extension-props
Advanced tools
Comparing version 0.9.1 to 0.9.2
@@ -10,2 +10,3 @@ declare function forInstance(v: any): boolean; | ||
preventOverrideFunction(classDefinition: any, functions: string[]): boolean; | ||
subclassOf(superClass: any): boolean; | ||
} | ||
@@ -12,0 +13,0 @@ declare function valueOf(v: any): FunctionType | undefined; |
@@ -128,2 +128,5 @@ "use strict"; | ||
} | ||
function subclassOf(superClass) { | ||
return this instanceof Function && this.prototype instanceof superClass; | ||
} | ||
function valueOf(v) { | ||
@@ -134,6 +137,7 @@ if (!forInstance(v)) | ||
defineClass: function (name, superClass) { | ||
return defineClass(name, superClass, this); | ||
return defineClass(name, superClass, v); | ||
}, | ||
preventOverrideClass: dynamicPreventOverrideClass, | ||
preventOverrideFunction: dynamicPreventOverrideFunction | ||
preventOverrideClass: dynamicPreventOverrideClass.bind(v), | ||
preventOverrideFunction: dynamicPreventOverrideFunction.bind(v), | ||
subclassOf: subclassOf.bind(v) | ||
}; | ||
@@ -152,2 +156,3 @@ } | ||
Function.isClass = isClass; | ||
Function.subclassOf = subclassOf; | ||
Object.preventOverrideClass = preventOverrideClass; | ||
@@ -154,0 +159,0 @@ Object.preventOverrideFunction = preventOverrideFunction; |
@@ -126,2 +126,6 @@ import OverridingError from '../errors/OverridingError'; | ||
function subclassOf(superClass: any): boolean { | ||
return this instanceof Function && this.prototype instanceof superClass; | ||
} | ||
interface FunctionType { | ||
@@ -133,2 +137,4 @@ defineClass(name: string, superClass?: any); | ||
preventOverrideFunction(classDefinition: any, functions: string[]): boolean; | ||
subclassOf(superClass: any): boolean; | ||
} | ||
@@ -140,6 +146,7 @@ | ||
defineClass(name: string, superClass) { | ||
return defineClass(name, superClass, this); | ||
return defineClass(name, superClass, v); | ||
}, | ||
preventOverrideClass: dynamicPreventOverrideClass, | ||
preventOverrideFunction: dynamicPreventOverrideFunction | ||
preventOverrideClass: dynamicPreventOverrideClass.bind(v), | ||
preventOverrideFunction: dynamicPreventOverrideFunction.bind(v), | ||
subclassOf: subclassOf.bind(v) | ||
}; | ||
@@ -160,2 +167,3 @@ } | ||
Function.isClass = isClass; | ||
Function.subclassOf = subclassOf; | ||
@@ -162,0 +170,0 @@ Object.preventOverrideClass = preventOverrideClass; |
@@ -41,2 +41,3 @@ interface String { | ||
defineFunction(name: string): Function | undefined; | ||
subclassOf(superClass: any): boolean; | ||
} | ||
@@ -43,0 +44,0 @@ |
{ | ||
"name": "extension-props", | ||
"version": "0.9.1", | ||
"version": "0.9.2", | ||
"description": "", | ||
"main": "lib/index.js", | ||
"types": "./lib/index.d.ts", | ||
"typescript:main": "./lib/index.ts", | ||
"directories": { | ||
@@ -28,3 +30,5 @@ "lib": "lib" | ||
"keywords": [ | ||
"extension-props" | ||
"extension-props", | ||
"extension properties", | ||
"utilities" | ||
], | ||
@@ -31,0 +35,0 @@ "author": "Jout V Hu (Giao Ho)", |
@@ -1,1 +0,9 @@ | ||
# extension-props | ||
# extension-props | ||
## Installation | ||
```bash | ||
npm install extension-props | ||
# or | ||
yarn add extension-props | ||
``` |
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
45794
1305
10