method-missing
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -34,3 +34,5 @@ /*! | ||
method = method || '__call'; | ||
return proxy(this, method); | ||
const pro = proxy(this, method); | ||
pro.isProxy = true; | ||
return pro; | ||
} | ||
@@ -37,0 +39,0 @@ |
{ | ||
"name": "method-missing", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"engines" : { | ||
@@ -5,0 +5,0 @@ "node" : ">=6.0.0" |
@@ -105,2 +105,13 @@ # Method Missing Class | ||
Using `extends-classes` you can extend from other classes too: | ||
```js | ||
const classes = require('extends-classes'); | ||
const MethodMissing = require('method-missing'); | ||
class Test extends classes (A, B, C, MethodMissing) { | ||
} | ||
``` | ||
Check out [extends-classes npm package](https://www.npmjs.com/package/extends-classes) to extend multiple classes! | ||
Check out the [test folder](test) for more! | ||
@@ -107,0 +118,0 @@ |
@@ -97,2 +97,32 @@ /*! | ||
object.one(); | ||
object.two(); | ||
object.two(); | ||
const classes = require('../../extends-classes'); | ||
class A { | ||
constructor() { | ||
console.log("A has been initialised"); | ||
} | ||
one() { | ||
console.log('One called'); | ||
} | ||
}; | ||
class B {}; | ||
class C {}; | ||
class T extends classes (A, B, C, MethodMissing) { | ||
constructor() { | ||
super(); | ||
} | ||
__call(name, args) { | ||
console.log(`Couldn't find ${name}`); | ||
} | ||
} | ||
var t = new T(); | ||
t.one(); | ||
t.goneburgers(); | ||
// One called | ||
// Couldn't find goneburgers |
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
10122
185
193