strict-method

strict method

strictmethod

strict method

example

 
 var m = require("strict-method");
 
 var user = {
    _name:"leo",
    _age:22,
    change:m(String,{min:5},Number,function(name,age){
        this._name = name;
        this._age = age;
    })
 }
 
 user.change("brighthas",28); // not error. 
 
 user.change("bri",28);  // throw error! must min > 5 
 

install