base-class-extend
Advanced tools
Comparing version 0.0.7 to 0.0.8
{ | ||
"name": "base-class-extend", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"description": "Base Class constructor for easy class definition - supports getter/setter, inherit/extend Array Error or EventEmitter etc", | ||
@@ -5,0 +5,0 @@ "main": "lib/base-class.js", |
[base-class-extend](https://www.npmjs.org/package/base-class-extend) - npm | ||
==== | ||
[BaseClass.extend](https://www.npmjs.org/package/base-class-extend) defines classes in JavaScript.<br/> | ||
[BaseClass.extend](https://www.npmjs.org/package/base-class-extend) defines class in JavaScript.<br/> | ||
This is simple module providing a simple Class function to | ||
@@ -17,2 +17,6 @@ simplify class definition in JavaScript. | ||
[Japanese version/■日本語版はこちら■](README-JP.md#readme) | ||
![base-class.png](images/base-class.png) | ||
# INSTALL: | ||
@@ -32,2 +36,4 @@ | ||
Define new class that inherited from Base Class. | ||
### Format | ||
@@ -55,3 +61,3 @@ | ||
The newly defined class (Your class is subclass of BaseClass) | ||
The newly defined class. (Your class is subclass of BaseClass) | ||
@@ -89,2 +95,4 @@ ### Details | ||
Create an object, instance of the Class. | ||
### Format | ||
@@ -98,2 +106,6 @@ | ||
var yourObj = new YourClass(); | ||
// or | ||
var yourObj = YourClass(); | ||
// required: default constructor or right defined constructor | ||
``` | ||
@@ -107,3 +119,3 @@ | ||
Your new object | ||
Your new object, instance of the Class. | ||
@@ -173,4 +185,4 @@ ## without BaseClass, inherits from Object, or other Classes | ||
You can define private variables, hidden variables.<br/> | ||
Also support getter/setter, and normal methods to access private variables. | ||
You can define private variables, hidden variables.<br/> | ||
Also support getter/setter, and normal methods to access private variables. | ||
@@ -198,3 +210,3 @@ ### Format | ||
prototype object you passed | ||
The prototype object you passed. | ||
@@ -219,2 +231,55 @@ ### Details | ||
## property: this.constructor | ||
Get constructor function. (Class) | ||
### Format | ||
```js | ||
var MyClass = BaseClass.extend('MyClass'); | ||
var o1 = new MyClass(); | ||
console.log(o1.constructor === MyClass); // -> true | ||
``` | ||
### Returns | ||
The constructor function. (Class) | ||
## property: this.constructors | ||
Get an array of constructor functions. (Classes) | ||
### Format | ||
```js | ||
var MyClass = BaseClass.extend('MyClass'); | ||
var o1 = new MyClass(); | ||
var classes = o1.constructors; | ||
console.log(classes[0] === MyClass); // -> true | ||
console.log(classes[1] === BaseClass); // -> true | ||
console.log(classes[2] === Object); // -> true | ||
``` | ||
## Returns | ||
An array of constructor functions. (Classes) | ||
## property: Class.constructors | ||
Get an array of constructor functions. | ||
### Format | ||
```js | ||
var MyClass = BaseClass.extend('MyClass'); | ||
var classes = MyClass.constructors; | ||
console.log(classes[0] === MyClass); // -> true | ||
console.log(classes[1] === BaseClass); // -> true | ||
console.log(classes[2] === Object); // -> true | ||
``` | ||
## Returns | ||
An array of constructor functions. | ||
# EXAMPLES: | ||
@@ -221,0 +286,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
445061
22
408
0