is-node-modules.cjs 317 B

123456789101112131415
  1. 'use strict';
  2. const path = require('path');
  3. function isNodeModules(directory) {
  4. let basename = path.basename(directory);
  5. /* istanbul ignore next: platform specific branch */
  6. if (path.sep === '\\') {
  7. basename = basename.toLowerCase();
  8. }
  9. return basename === 'node_modules';
  10. }
  11. module.exports = isNodeModules;