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

base-class-extend

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

base-class-extend - npm Package Compare versions

Comparing version 0.0.6 to 0.0.7

images/base-class.jpg

31

lib/base-class.js

@@ -138,8 +138,18 @@ // base-class.js

// add methods and class methods if not found (in prototype chain)
if (!('private' in proto)) proto.private = BaseClass_private;
if (!('extend' in ctor)) ctor.extend = BaseClass_extend;
if (!('new' in ctor)) ctor.new = BaseClass_new;
if (!('constructors' in ctor))
Object.defineProperty(ctor, 'constructors',
Object.getOwnPropertyDescriptor(getProto(BaseClass), 'constructors'));
if (!('private' in proto)) proto.private = BaseClass_private;
if (!('constructors' in proto))
Object.defineProperty(proto, 'constructors',
Object.getOwnPropertyDescriptor(BaseClass.prototype, 'constructors'));
// constructor.super_ -> for points super class
setConst(ctor, 'super_', superCtor);
setConst(ctor, 'super', superCtor);

@@ -190,5 +200,20 @@ return ctor;

var BaseClass = BaseClass_extend('BaseClass',
{private: BaseClass_private},
{private: BaseClass_private,
get constructors() {
var ctors = [], obj = this;
while (obj) {
if (obj.hasOwnProperty('constructor'))
ctors.push(obj.constructor);
obj = getProto(obj); }
return ctors; }},
{extend: BaseClass_extend,
new: BaseClass_new});
new: BaseClass_new,
get constructors() {
var ctors = [], ctor = this;
while (ctor) {
if (typeof ctor === 'function' &&
ctor.hasOwnProperty('prototype'))
ctors.push(ctor);
ctor = getProto(ctor); }
return ctors; }});

@@ -195,0 +220,0 @@

22

package.json
{
"name": "base-class-extend",
"version": "0.0.6",
"version": "0.0.7",
"description": "Base Class constructor for easy class definition - supports getter/setter, inherit/extend Array Error or EventEmitter etc",
"main": "lib/base-class.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://github.com/LightSpeedWorks/base-class"
},
"keywords": [

@@ -23,8 +16,15 @@ "Array",

],
"author": "LightSpeedC",
"license": "MIT",
"homepage": "https://github.com/LightSpeedWorks/base-class",
"repository": {
"type": "git",
"url": "https://github.com/LightSpeedWorks/base-class"
},
"bugs": {
"url": "https://github.com/LightSpeedWorks/base-class/issues"
},
"homepage": "https://github.com/LightSpeedWorks/base-class"
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "LightSpeedC",
"license": "MIT"
}

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

base-class-extend
[base-class-extend](https://www.npmjs.org/package/base-class-extend) - npm
====
BaseClass.extend defines classes in JavaScript.<br/>
[BaseClass.extend](https://www.npmjs.org/package/base-class-extend) defines classes in JavaScript.<br/>
This is simple module providing a simple Class function to

@@ -43,3 +43,9 @@ simplify class definition in JavaScript.

+ **proto**: the prototype object for your class, optional
+ **new** or **constructor**: constructor function, optional
+ **get** getter or **set** setter: getter/setter, optional
+ **any methods**: any method or member function, optional
+ **classProps**: the object for class or static properties, optional
+ **init** or **initialize**: initialize function, optional
+ **get** getter or **set** setter: getter/setter, optional
+ **any methods**: any static method or class function, optional

@@ -181,2 +187,4 @@ ### Returns

+ **proto**: the prototype object contains methods accessing private variables, required
+ **get** getter or **set** setter: getter/setter, optional
+ **any methods**: any method or member function, optional

@@ -183,0 +191,0 @@ ### Returns

Sorry, the diff of this file is not supported yet

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