mirror of
https://github.com/BorysLevytskyi/BitwiseCmd.git
synced 2025-12-11 15:32:09 +01:00
32 lines
739 B
JavaScript
32 lines
739 B
JavaScript
(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;
|
|
}
|
|
};
|
|
})();
|