Introduced AppShall

This commit is contained in:
Borys Levytskyi
2015-04-04 16:10:17 +03:00
parent a3ca46174b
commit 17fc0bad97
13 changed files with 80 additions and 75 deletions

31
core/is.js Normal file
View File

@@ -0,0 +1,31 @@
(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;
},
array: function(obj) {
return obj instanceof Array;
}
};
})();