src/vs/base/common/path.ts/_format
function _format(sep: string, pathObject: ParsedPath) {
	if (pathObject === null || typeof pathObject !== 'object') {
		throw new ErrorInvalidArgType('pathObject', 'Object', pathObject);
	}
	const dir = pathObject.dir || pathObject.root;
	const base = pathObject.base ||
		`${pathObject.name || ''}${pathObject.ext || ''}`;
	if (!dir) {
		return base;
	}
	return dir === pathObject.root ? `${dir}${base}` : `${dir}${sep}${base}`;
}