Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// Guess remaining helper files based on module
// name: this should probably be improved in the
// future.
var split = module.id.split(path.sep)
var j = split.length - 1
while (split[--j] !== 'node_modules');;
var dir = split.slice(j + 1)[0].replace(/\-(?:browser(?:ify)?|es3)$/g, '')
if (dir === 'Base64') return yes
if (dir === 'base64-js') return yes
if (dir === 'inherits') return yes
if (dir === 'process') return yes
if (dir === 'ieee754') return yes
if (builtins.indexOf(dir) !== -1) return yes
return no
}
}
function clickHandler(e) {
var newWindow = (e.metaKey || e.ctrlKey || e.which === 2);
var $target = $(e.currentTarget);
var data = $target.data();
if (data.type) {
if (!$target.hasClass('tooltipped')) {
$target.addClass('tooltipped tooltipped-e');
}
$target.attr('aria-label', LOADING);
// Redirect to nodejs api
if (data.type === 'npm' && builtins.indexOf(data.value) > -1) {
// https://nodejs.org/api/modules.html, not https://nodejs.org/api/module.html
if (data.value === 'module') {
data.value = 'modules';
}
return openUrl(util.format(NODEJS_API, data.value), newWindow);
}
if (data.value === '.' || data.value.indexOf('...') === 0) {
return $target.attr('aria-label', SORRY);
}
// Get url from static informations
var resolveResult = glResolve(data.value, data.locationUrl);
if (resolveResult) {
var urls = [];
var requireBuilder = function(url, requireValue) {
var link = '';
if (builtins.indexOf(requireValue) !== -1) {
// Redirect to http://iojs.org/api/{module}.html
link = util.format(NODE_API, requireValue);
} else if (cache.npm[requireValue]) {
// Get repo link from cache list
link = cache.npm[requireValue];
} else {
if (validatePackageName(requireValue)) {
// Try to resolve link via https://www.npmjs.org/package/{name}
link = RESOLVE_INDICATOR + NPM_API + requireValue;
} else {
// Resolve paths, duojs and github shorthand
link = glResolve(requireValue, url);
if (link) {
link = RESOLVE_INDICATOR + link;
}
}
if (name.trim() !== name) {
errors.push("name cannot contain leading or trailing spaces")
}
// No funny business
blacklist.forEach(function(blacklistedName){
if (name.toLowerCase() === blacklistedName) {
errors.push(blacklistedName + " is a blacklisted name")
}
})
// Generate warnings for stuff that used to be allowed
// core module names like http, events, util, etc
builtins.forEach(function(builtin){
if (name.toLowerCase() === builtin) {
warnings.push(builtin + " is a core module name")
}
})
// really-long-package-names-------------------------------such--length-----many---wow
// the thisisareallyreallylongpackagenameitshouldpublishdowenowhavealimittothelengthofpackagenames-poch.
if (name.length > 214) {
warnings.push("name can no longer contain more than 214 characters")
}
// mIxeD CaSe nAMEs
if (name.toLowerCase() !== name) {
warnings.push("name can no longer contain capital letters")
}
if (name.trim() !== name) {
errors.push("name cannot contain leading or trailing spaces")
}
// No funny business
blacklist.forEach(function(blacklistedName){
if (name.toLowerCase() === blacklistedName) {
errors.push(blacklistedName + " is a blacklisted name")
}
})
// Generate warnings for stuff that used to be allowed
// core module names like http, events, util, etc
builtins.forEach(function(builtin){
if (name.toLowerCase() === builtin) {
warnings.push(builtin + " is a core module name")
}
})
// really-long-package-names-------------------------------such--length-----many---wow
// the thisisareallyreallylongpackagenameitshouldpublishdowenowhavealimittothelengthofpackagenames-poch.
if (name.length > 214) {
warnings.push("name can no longer contain more than 214 characters")
}
// mIxeD CaSe nAMEs
if (name.toLowerCase() !== name) {
warnings.push("name can no longer contain capital letters")
}
if (name.trim() !== name) {
errors.push('name cannot contain leading or trailing spaces')
}
// No funny business
blacklist.forEach(function (blacklistedName) {
if (name.toLowerCase() === blacklistedName) {
errors.push(blacklistedName + ' is a blacklisted name')
}
})
// Generate warnings for stuff that used to be allowed
// core module names like http, events, util, etc
builtins.forEach(function (builtin) {
if (name.toLowerCase() === builtin) {
warnings.push(builtin + ' is a core module name')
}
})
// really-long-package-names-------------------------------such--length-----many---wow
// the thisisareallyreallylongpackagenameitshouldpublishdowenowhavealimittothelengthofpackagenames-poch.
if (name.length > 214) {
warnings.push('name can no longer contain more than 214 characters')
}
// mIxeD CaSe nAMEs
if (name.toLowerCase() !== name) {
warnings.push('name can no longer contain capital letters')
}
// value USER_DEACTIVATED. If a plugin is deactivated because a required
// plugin is deactivated, then the value is a DEPENDS_DEACTIVATED.
this.deactivatedPlugins = {};
this._extensionsOrdering = [];
this.instances = {};
this.instancesLoadPromises = {};
this._objectDescriptors = {};
// Stores the child catalogs.
this.children = [];
// set up the "extensionpoint" extension point.
// it indexes on name.
var ep = this.getExtensionPoint("extensionpoint", true);
ep.indexOn = "name";
this.registerMetadata(builtins.metadata);
};
// value USER_DEACTIVATED. If a plugin is deactivated because a required
// plugin is deactivated, then the value is a DEPENDS_DEACTIVATED.
this.deactivatedPlugins = {};
this._extensionsOrdering = [];
this.instances = {};
this.instancesLoadPromises = {};
this._objectDescriptors = {};
// Stores the child catalogs.
this.children = [];
// set up the "extensionpoint" extension point.
// it indexes on name.
var ep = this.getExtensionPoint("extensionpoint", true);
ep.indexOn = "name";
this.registerMetadata(builtins.metadata);
};
return requires.filter(function(r) {
return builtins.indexOf(r) == -1
})
}
export function getExternal(
{devDependencies, peerDependencies, dependencies, rollup}: Pkg
): string[] {
const deps = Object.assign({}, devDependencies, peerDependencies, dependencies)
const bundled: string[] = rollup.bundledDependencies || []
return Object.keys(deps).concat(getBuiltins()).filter(name => !bundled.includes(name))
}