app/@overflow/core/path.ts
crusader ea0af6c32b ing
2018-10-02 10:32:32 +09:00

13 lines
336 B
TypeScript

import * as Path from 'path';
const 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);
}