Socket
Socket
Sign inDemoInstall

classified-magic

Package Overview
Dependencies
1
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.3 to 0.1.4

37

magic.js
var classified = require('classified'),
separator = require('path').sep,
proxy = Proxy;
separator = require('path').sep;
/*jshint -W079 */
if(typeof Proxy === 'undefined') {
var Proxy = require('node-proxified');
}
/* Definition

@@ -186,4 +180,26 @@ -------------------------------*/

// check if native Proxy is enabled
if(typeof Proxy === 'undefined') {
throw new Error(
'Must have at least native proxy support by running ' +
'`node --harmony` or node -- harmony-proxies, or if ' +
'using mocha run `mocha --harmony test`');
}
var magic = {};
magic.getOwnPropertyDescriptor = function(name) {
if(typeof instance.getOwnPropertyDescriptor === 'function') {
return instance.getOwnPropertyDescriptor(instance, name);
}
var descriptor = Object.getOwnPropertyDescriptor(instance, name);
if(typeof descriptor !== 'undefined') {
desciptor.configurable = true;
}
return descriptor;
};
magic.get = function(receiver, name) {

@@ -242,3 +258,8 @@ //if it exists

return Proxy(magic, instance);
// check support for new Proxy
if(typeof Proxy === 'object') {
return Proxy.create(magic, instance);
}
return new Proxy(instance, magic);
};

@@ -245,0 +266,0 @@

{
"name": "classified-magic",
"description": "OOP for NodeJS with magic",
"version": "0.1.3",
"version": "0.1.4",
"author": {

@@ -25,4 +25,3 @@ "name": "Christian Blanquera",

"dependencies": {
"classified": "0.1.2" ,
"node-proxified": "0.0.2"
"classified": "0.1.2"
},

@@ -29,0 +28,0 @@ "main": "./magic.js",

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc