You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
335 B
17 lines
335 B
var utils = require('../utils')
|
|
, path = require('path');
|
|
|
|
/**
|
|
* Return the basename of `path`.
|
|
*
|
|
* @param {String} path
|
|
* @return {String}
|
|
* @api public
|
|
*/
|
|
|
|
function basename(p, ext){
|
|
utils.assertString(p, 'path');
|
|
return path.basename(p.val, ext && ext.val);
|
|
};
|
|
basename.params = ['p', 'ext'];
|
|
module.exports = basename;
|