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

node-extend

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-extend - npm Package Compare versions

Comparing version 0.0.7 to 0.0.8

71

lib/extend.js

@@ -1,21 +0,54 @@

function extend(A, B, as, isAargs) {
var ___A___ = A, ___B___ = B;
if (arguments.length < 2) throw new Error("arguments is error!");
var args = "";
if (arguments.length > 2) if (isAargs) {
args += "var args = [";
for (var i = 0; i < as.length; i++) args += "arguments[" + as[i] + "]", i !== as.length - 1 && (args += ",");
args += "];";
} else args = "var args = " + JSON.stringify(as) + ";";
var s = A.toString(), footer = "}", header = s.match(/^(function)(.)*{/gi), e = "";
args ? e += "___B___.apply(this,args);" : e += "___B___.apply(this);", e += "___A___.apply(this,arguments)";
var ss = header + e + footer, nn = eval("(" + ss + ")"), ap = A.prototype;
util.inherits(nn, B);
for (var k in A) nn[k] = A[k];
for (var k in ap) nn.prototype[k] = ap[k];
return nn;
var util = require('util');
module.exports = extend;
extend.EXTEND = 'EXTEND';
function extend(A,B,B_args){
var ___A___ = A;
var ___B___ = B;
if(arguments.length < 2){
throw new Error('arguments is error!');
}
var args = "";
if(arguments.length > 2){
if(!B_args){}
else if(B_args === extend.EXTEND){
args += 'var args = arguments';
}else if(B_args.length >= 0){
args += 'var args = [';
for(var i=0 ; i<as.length ; i++){
args += 'arguments['+as[i]+']';
if(i!==as.length-1) args += ',';
}
args += '];'
}
}
var s = A.toString();
var footer = '}'
var header = s.match(/^(function)(.)*{/gi);
var e = '';
if(args){e += '___B___.apply(this,args);'}else{e += '___B___.apply(this);';}
e+='___A___.apply(this,arguments)';
var ss = header+e+footer
var nn = eval('('+ss+')');
var ap = A.prototype;
util.inherits(nn,B);
for(var k in A){
nn[k] = A[k];
}
for(var k in ap){
nn.prototype[k] = ap[k];
}
return nn;
}
var util = require("util");
module.exports = extend;
{
"name": "node-extend",
"version": "0.0.7",
"version": "0.0.8",
"description": "extend for javascript",

@@ -19,3 +19,3 @@ "main": "index.js",

"author": "brighthas",
"license": "BSD"
"license": "MIT"
}
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