implemented dispatcher commands

This commit is contained in:
Borys Levytskyi
2015-04-03 18:55:39 +03:00
parent d301d0c317
commit 8e5be22fe3
6 changed files with 136 additions and 54 deletions

27
components/is.js Normal file
View File

@@ -0,0 +1,27 @@
(function(){
window.is = {
plainObject: function(obj) {
return typeof obj == "object" && obj instanceof Object;
},
aFunction: function (obj) {
return typeof obj == "function";
},
string: function (obj) {
return typeof obj == "string";
},
regex: function (obj) {
return typeof obj == "object" && this.constructedFrom(RegExp);
},
constructedFrom: function (obj, ctor) {
return obj instanceof ctor;
},
htmlElement: function(obj) {
return obj instanceof HtmlElement;
}
};
})();