UNPKG

queen

Version:

A platform for running scripts on many browsers

3 lines 1.8 kB
/*! its - v1.0.0 - 2013-01-19 * Copyright 2013 Ozan Turgut; Licensed MIT */ its=function(){var e=function(e,t){e.exports=t;var n=e.exports=function(e,t){if(e===!1)throw t&&typeof t!="string"?t(arguments.length>3?o(arguments[2],r.call(arguments,3)):arguments[2]):new Error(arguments.length>2?o(t,r.call(arguments,2)):t);return e};n.type=function(e,t){if(e===!1)throw new TypeError(arguments.length>2?o(t,r.call(arguments,2)):t);return e},n.undefined=function(e){return n.type.apply(null,[e===void 0].concat(r.call(arguments,1)))},n.null=function(e){return n.type.apply(null,[e===null].concat(r.call(arguments,1)))},n.boolean=function(e){return n.type.apply(null,[e===!0||e===!1||i.call(e)==="[object Boolean]"].concat(r.call(arguments,1)))},n.array=function(e){return n.type.apply(null,[i.call(e)==="[object Array]"].concat(r.call(arguments,1)))},n.object=function(e){return n.type.apply(null,[e===Object(e)].concat(r.call(arguments,1)))},function(){var e=[["args","Arguments"],["func","Function"],["string","String"],["number","Number"],["date","Date"],["regexp","RegExp"]],t=0,s=e.length;for(;t<s;t++)(function(){var s=e[t];n[s[0]]=function(e){return n.type.apply(null,[i.call(e)==="[object "+s[1]+"]"].concat(r.call(arguments,1)))}})()}(),typeof /./!="function"&&(n.func=function(e){return n.type.apply(null,[typeof e=="function"].concat(r.call(arguments,1)))}),n.defined=function(e,t){if(e===void 0)throw new ReferenceError(arguments.length>2?o(t,r.call(arguments,2)):t);return e},n.range=function(e,t){if(e===!1)throw new RangeError(arguments.length>2?o(t,r.call(arguments,2)):t);return e};var r=Array.prototype.slice,i=Object.prototype.toString,s=/%s/,o=function(e,t){var n=[],r=e.split(s),i=0,o=r.length;for(;i<o;i++)n.push(r[i]),n.push(t[i]);return n.join("")};return e.exports}({},{});return e}();