app/@overflow/core/path.ts

13 lines
337 B
TypeScript
Raw Normal View History

2018-08-16 10:49:37 +00:00
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);
}