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

jujsoop

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jujsoop - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

41

index.js
var exports = {};
exports.abstract = function (type) {
var old = type;
type = (function () {
var old = this.old;
return function () {
if (this.constructor == old)
throw Error(type.name + " instance can not be created!");
old.apply(this, arguments);
}
}).call({ old: old });
type.prototype = old.prototype;
Object.defineProperty(type, "name", { value: old.name });
return type;
var fn = 'function ' + type.name + '() { if (this.constructor == type) throw Error(type.name + " instance can not be created!"); type.apply(this, arguments); }';
var ju = new Function("type", "return " + fn + ";")(type);
ju.prototype = type.prototype;
Object.defineProperty(ju, "name", { value: type.name });
return ju;
}
exports.inherit = function (type, base) {
var old = type;
type = (function () {
var old = this.old, base = this.base;
return function () {
base.apply(this, arguments);
old.apply(this, arguments);
}
}).call({ old: old, base: base });
type.prototype = old.prototype;
type.prototype.__proto__ = base.prototype;
Object.defineProperty(type, "name", { value: old.name });
return type;
var fn = 'function ' + type.name + '() { base.apply(this, arguments); type.apply(this, arguments); }';
var ju = new Function("type", "base", "return " + fn + ";")(type, base);
ju.prototype = type.prototype;
ju.prototype.__proto__ = base.prototype;
Object.defineProperty(ju, "name", { value: type.name });
return ju;
}
module.exports = exports;
{
"name": "jujsoop",
"version": "1.0.1",
"version": "1.0.2",
"description": "For inheritance in javascript.",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "mocha"
},

@@ -19,7 +19,10 @@ "author": "josephuz",

},
"keywords":[
"keywords": [
"OOP",
"Javascript OOP",
"Inheritance"
]
],
"devDependencies": {
"mocha": "^5.2.0"
}
}
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