app/@overflow/core/path.ts
crusader a9f514b9fb ing
2018-08-16 19:49:37 +09:00

13 lines
337 B
TypeScript

import * as Path from 'path';
import fileUrl = require('file-url');
/**
* Resolve and encode the path information into a URL.
*
* @param pathSegments array of path segments to resolve
*/
export function encodePathAsUrl(...pathSegments: string[]): string {
const path = Path.resolve(...pathSegments);
return fileUrl(path);
}