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

classified-magic

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

classified-magic - npm Package Compare versions

Comparing version 0.0.5 to 0.0.6

29

magic.js

@@ -1,4 +0,5 @@

var classified = require('classified');
var separator = require('path').sep;
var classified = require('classified'),
separator = require('path').sep,
registry = {};
if(typeof Proxy === 'undefined') {

@@ -60,3 +61,8 @@ var Proxy = require('node-proxy');

//if prototype is a string
if(typeof prototype === 'string') {
//and it's definied in the registry
if(typeof prototype === 'string'
&& typeof registry[prototype] !== 'undefined') {
prototype = registry[prototype];
//if prototype is a string
} else if(typeof prototype === 'string') {
//its a path to a file

@@ -74,2 +80,6 @@ var path = _getCallerPath();

}
//its a string and we do not know
//what to do with it
} else {
return this;
}

@@ -107,2 +117,13 @@ }

/**
* Registers this class for extend
*
* @param string
* @return this
*/
method.register = function(name) {
registry[name] = this.definition();
return this;
};
/**
* Sets loader to return a single instance

@@ -109,0 +130,0 @@ *

2

package.json
{
"name": "classified-magic",
"description": "OOP for NodeJS with magic",
"version": "0.0.5",
"version": "0.0.6",
"author": {

@@ -6,0 +6,0 @@ "name": "Christian Blanquera",

@@ -242,3 +242,15 @@ var assert = require('assert');

});
it('should not be able to register and access root', function() {
Root.register('rooty');
var child = classified({
sampleMethod: function() {
return typeof this.___parent.__sampleMethod;
}
}).extend('rooty').load();
assert.equal('undefined', child.sampleMethod());
});
});
});
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