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.7 to 0.0.8

qiita-jp.md

2

package.json
{
"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 @@

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