/
eb
/
Surf
Обзор
Документация
Войти
/
eb
/
Surf
Код
Запросы
0
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
node_modules/path-root/index.js
21 строка
424 B
EvgeniyBudaev
Initial commit
17 фев 2020, 09:02
17 фев 2020, 09:02
bb6f06f
Код
Авторство
О чём код?
/*! * path-root <https://github.com/jonschlinkert/path-root> * * Copyright (c) 2016, Jon Schlinkert. * Licensed under the MIT License. */ 'use strict'; var pathRootRegex = require('path-root-regex'); module.exports = function(filepath) { if (typeof filepath !== 'string') { throw new TypeError('expected a string'); } var match = pathRootRegex().exec(filepath); if (match) { return match[0]; } };