Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

component-require

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

component-require - npm Package Compare versions

Comparing version 0.3.1 to 1.0.0

9

History.md
0.3.1 / 2013-09-12
1.0.0 / 2013-12-29
==================
* remove alias support
0.3.1 / 2013-09-12
==================
* fix circular dependency issue
0.3.0 / 2013-08-04
0.3.0 / 2013-08-04
==================

@@ -9,0 +14,0 @@

@@ -49,8 +49,2 @@

/**
* Registered aliases.
*/
require.aliases = {};
/**
* Resolve `path`.

@@ -70,3 +64,3 @@ *

require.resolve = function(path) {
if (path.charAt(0) === '/') path = path.slice(1);
if ('/' == path.charAt(0)) path = path.slice(1);

@@ -81,6 +75,7 @@ var paths = [

for (var i = 0; i < paths.length; i++) {
for (var i = 0, len = paths.length; i < len; i++) {
var path = paths[i];
if (require.modules.hasOwnProperty(path)) return path;
if (require.aliases.hasOwnProperty(path)) return require.aliases[path];
if (require.modules.hasOwnProperty(path)) {
return path;
}
}

@@ -106,3 +101,3 @@ };

for (var i = 0; i < path.length; ++i) {
for (var i = 0, len = path.length; i < len; ++i) {
if ('..' == path[i]) {

@@ -131,17 +126,2 @@ curr.pop();

/**
* Alias a module definition.
*
* @param {String} from
* @param {String} to
* @api private
*/
require.alias = function(from, to) {
if (!require.modules.hasOwnProperty(from)) {
throw new Error('Failed to alias "' + from + '", it does not exist');
}
require.aliases[to] = from;
};
/**
* Return a require function relative to the `parent` path.

@@ -155,3 +135,3 @@ *

require.relative = function(parent) {
var p = require.normalize(parent, '..');
var root = require.normalize(parent, '..');

@@ -186,11 +166,3 @@ /**

if ('/' == c) return path.slice(1);
if ('.' == c) return require.normalize(p, path);
// resolve deps by returning
// the dep in the nearest "deps"
// directory
var segs = parent.split('/');
var i = lastIndexOf(segs, 'deps') + 1;
if (!i) i = 0;
path = segs.slice(0, i + 1).join('/') + '/deps/' + path;
if ('.' == c) return require.normalize(root, path);
return path;

@@ -197,0 +169,0 @@ };

{
"name": "component-require",
"version": "0.3.1",
"version": "1.0.0",
"description": "require implementation for component(1)",
"keywords": ["require", "component"],
"keywords": [
"require",
"component"
],
"author": "TJ Holowaychuk <tj@vision-media.ca>",

@@ -12,3 +15,7 @@ "dependencies": {},

},
"main": "index"
"main": "index",
"repository": {
"type": "git",
"url": "https://github.com/component/require.git"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc