2 * path-root <https://github.com/jonschlinkert/path-root>
4 * Copyright (c) 2016, Jon Schlinkert.
5 * Licensed under the MIT License.
10 var pathRootRegex = require('path-root-regex');
12 module.exports = function(filepath) {
13 if (typeof filepath !== 'string') {
14 throw new TypeError('expected a string');
17 var match = pathRootRegex().exec(filepath);