aboutsummaryrefslogtreecommitdiff
path: root/node_modules/get-package-type/is-node-modules.cjs
blob: 5a37a7758c3225d501a447ad1947f26cbf2bbefa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
'use strict';

const path = require('path');

function isNodeModules(directory) {
	let basename = path.basename(directory);
	/* istanbul ignore next: platform specific branch */
	if (path.sep === '\\') {
		basename = basename.toLowerCase();
	}

	return basename === 'node_modules';
}

module.exports = isNodeModules;