shared
utils
string
object
is
extension
js
tracking
string
dom
when
selection
position
iframe
event
scroll
console
node
string
project
fs
console
methodExists
Type:Function
Status:stable
Since:1.0.0
Platform:jsnode
@blackbyte.sugar.shared.class
Check if one or more methods exists on a class instance
Params
- instance*-Object
The instance to check the methods on
- methods*-String[]
The methods to check
Return
- -Boolean|Array
Return true if all is ok, and an array of missing methods if not
Example
class Coco {
hello() {}
}
import { methodExists } from '@blackbyte/sugar/class';
const myInstance = new Coco();
methodExists(myInstance, 'hello', 'world'); // => ['world'];
methodExists(myInstance, 'hello'); // => trueTodo
- testsnormal
Author
- Olivier Bosselolivier.bossel@gmail.comhttps://blackbyte.space