extname.js 302 B

1234567891011121314151617
  1. var utils = require('../utils')
  2. , path = require('path');
  3. /**
  4. * Return the extname of `path`.
  5. *
  6. * @param {String} path
  7. * @return {String}
  8. * @api public
  9. */
  10. function extname(p){
  11. utils.assertString(p, 'path');
  12. return path.extname(p.val);
  13. };
  14. extname.params = ['p'];
  15. module.exports = extname;