Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

types.js

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

types.js - npm Package Compare versions

Comparing version 1.9.3 to 1.9.4

7

package.json
{
"name": "types.js",
"version": "1.9.3",
"version": "1.9.4",
"description": "A tiny and fast dynamic type checker/enforcer library",

@@ -40,5 +40,4 @@ "main": "types.min.js",

"@babel/preset-env": "latest",
"jasmine": "latest"
},
"dependencies": {}
"jasmine": "^4.1.0"
}
}
"use strict";
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
// Generated by CoffeeScript 2.5.1
// Generated by CoffeeScript 2.7.0
(function () {

@@ -9,0 +9,0 @@ var _LITERALS, _TYPES;

@@ -1,1 +0,1 @@

"use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _defineProperty(e,n,r){return n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}(function(){var e,n,r,t,o,i,u,f,c,a,l,d,y,p,s,g,b,m,_;t="".concat("types.js"," - force"),r="".concat("types.js"," - enum: ERROR,"),i="".concat("types.js"," - all logging disabled by user"),u="".concat("types.js"," - logging re-enabled by user"),_defineProperty(e={},"boolean",!1),_defineProperty(e,"string",""),_defineProperty(e,"object",{}),_defineProperty(e,"array",[]),_defineProperty(e,"function",(function(){})),_defineProperty(e,"number",((_=new Number).void=!0,_)),_defineProperty(e,"regexp",new RegExp),o=e,y=function(){var e;if(c.logging)return(e=console).log.apply(e,arguments)},p=function(){},m=function(e){return e[0].toUpperCase()+e.slice(1)},d=function(e,n){return n instanceof e},g=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"object";return _typeof(e)===n},a=function(){var e;return e={},Object.defineProperty(e,"_ENUM_",{configurable:!1,enumerable:!1,value:!0,writable:!1}),e},_defineProperty(n={},"undefined",(function(e){return void 0===e})),_defineProperty(n,"null",(function(e){return null===e})),_defineProperty(n,"function",(function(e){return g(e,"function")})),_defineProperty(n,"boolean",(function(e){return g(e,"boolean")})),_defineProperty(n,"string",(function(e){return g(e,"string")})),_defineProperty(n,"array",(function(e){return g(e)&&d(Array,e)})),_defineProperty(n,"regexp",(function(e){return g(e)&&d(RegExp,e)})),_defineProperty(n,"date",(function(e){return g(e)&&d(Date,e)})),_defineProperty(n,"number",(function(e){return g(e,"number")&&e==e||g(e)&&d(Number,e)})),_defineProperty(n,"object",(function(e){return g(e)&&null!==e&&!d(Boolean,e)&&!d(Number,e)&&!d(Array,e)&&!d(RegExp,e)&&!d(Date,e)})),_defineProperty(n,"symbol",(function(e){return g(e,"symbol")})),_defineProperty(n,"nan",(function(e){return g(e,"number")&&e!=e})),_defineProperty(n,"enum",(function(e){return c.forceObject(e).hasOwnProperty("_ENUM_")})),_defineProperty(n,"defined",(function(e){return void 0!==e})),(f=n).StringOrNumber=function(e){return f.string(e)||f.number(e)},c=b={parseIntBase:10,autoConvert:!0,logging:!0,disableLogging:function(){return c.logging=!1,console.log(i)},enableLogging:function(){return c.logging=!0,console.log(u)},logForce:function(e){return p=function(n,r,o){var i;if(c.isFunction(e))return e(n,r,o);switch(i=r,n){case 1:i+=": initial value is not of type "+r;break;case 2:i+=": optional value is not of type "+r;break;case 3:i+=": no valid type found, returning a type "+r+" literal"}return y(t+i)}}},l=function(e){var n,r;return n=m(e),r=function(r){if(b.autoConvert)switch(e){case"number":b.isString(r)&&(r=parseInt(r,b.parseIntBase));break;case"string":b.isNumber(r)&&(r+="")}if(c["is"+n](r))return r},function(t,i){var u;if(null!=t&&void 0!==(u=r(t)))return u;if(p(1,n,t),b.isDefined(i)){if(b.typeof(i),null!=i&&void 0!==(i=r(i)))return i;p(2,n,t)}return p(3,n,t),o[e]}},s=function(e,n){var r,t,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(o.length<1)return e===f[void 0];for(r=0,t=o.length;r<t;r++)if(e(o[r])===n)return n;return!n},function(){var e,n,r;for(r in n=[],f)e=f[r],n.push(function(e,n){var r;return r=function(){switch(e){case"nan":return"NaN";case"regexp":return"RegExp";default:return m(e)}}(),c["is"+r]=n,c["not"+r]=function(e){return!n(e)},c["has"+r]=function(){return s(n,!0,arguments)},c["all"+r]=function(){return s(n,!1,arguments)},e in o&&(c["force"+r]=l(e)),c["getFirst"+r]=function(){for(var e,n,t,o=arguments.length,i=new Array(o),u=0;u<o;u++)i[u]=arguments[u];for(e=0,n=i.length;e<n;e++)if(t=i[e],c["is"+r](t))return t}}(r,e))}(),c.intoArray=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return n.length<2&&(b.isString(n[0])?n=n.join("").replace(/^\s+|\s+$/g,"").replace(/\s+/g," ").split(" "):b.isArray(n[0])&&(n=n[0])),n},c.typeOf=c.typeof=function(e){var n;for(n in f)if(!0===(0,f[n])(e))return n},c.enum=c.enumerate=function(e,n){var t,o,i,u,f;if(n=b.forceNumber(n,0),t=a(),b.notArray(e))return y("".concat(r," invalid or missing enumeration array")),t;for(i=o=0,f=e.length;o<f;i=++o)u=e[i],b.isString(u)?t[u]=i+n:y("".concat(r," ignored non-string item that was found in enumeration array"));return b.forceFunction(Object.freeze)(t),t},"undefined"!=typeof define&&null!==define&&"function"===("undefined"==typeof define?"undefined":_typeof(define))&&define.amd&&define("types",[],(function(){return c})),"undefined"!==("undefined"==typeof module?"undefined":_typeof(module))&&(module.exports=c),"undefined"!==("undefined"==typeof window?"undefined":_typeof(window))&&(window.Types=c)}).call(void 0);
"use strict";function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}function _defineProperty(e,n,r){return n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}(function(){var e,n,r,t,o,i,u,f,c,a,l,d,y,p,s,g,b,v,_,m,P,w,h,N,S,O,j,A,R,x,E;u="_ENUM_",f="".concat(y="types.js"," - force"),i="".concat(y," - enum: ERROR,"),l="".concat(y," - all logging disabled by user"),d="".concat(y," - logging re-enabled by user"),r="array",c="function",p="number",s="object",g="regexp",b="string",v="symbol",P="undefined",_defineProperty(e={},t="boolean",!1),_defineProperty(e,b,""),_defineProperty(e,s,{}),_defineProperty(e,r,[]),_defineProperty(e,c,(function(){})),_defineProperty(e,p,((E=new Number).void=!0,E)),_defineProperty(e,g,new RegExp),a=e,S=function(){var e;if(m.logging)return(e=console).log.apply(e,arguments)},O=function(){},x=function(e){return e[0].toUpperCase()+e.slice(1)},N=function(e,n){return n instanceof e},A=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;return _typeof(e)===n},w=function(){var e;return e={},Object.defineProperty(e,u,{configurable:!1,enumerable:!1,value:!0,writable:!1}),e},_defineProperty(n={},P,(function(e){return void 0===e})),_defineProperty(n,"null",(function(e){return null===e})),_defineProperty(n,c,(function(e){return A(e,c)})),_defineProperty(n,t,(function(e){return A(e,t)})),_defineProperty(n,b,(function(e){return A(e,b)})),_defineProperty(n,r,(function(e){return A(e)&&N(Array,e)})),_defineProperty(n,g,(function(e){return A(e)&&N(RegExp,e)})),_defineProperty(n,"date",(function(e){return A(e)&&N(Date,e)})),_defineProperty(n,p,(function(e){return A(e,p)&&e==e||A(e)&&N(Number,e)})),_defineProperty(n,s,(function(e){return A(e)&&null!==e&&!N(Boolean,e)&&!N(Number,e)&&!N(Array,e)&&!N(RegExp,e)&&!N(Date,e)})),_defineProperty(n,v,(function(e){return A(e,v)})),_defineProperty(n,"nan",(function(e){return A(e,p)&&e!=e})),_defineProperty(n,"enum",(function(e){return m.forceObject(e).hasOwnProperty(u)})),_defineProperty(n,"defined",(function(e){return void 0!==e})),(_=n).StringOrNumber=function(e){return _.string(e)||_.number(e)},m=R={parseIntBase:10,autoConvert:!0,logging:!0,disableLogging:function(){return m.logging=!1,console.log(l)},enableLogging:function(){return m.logging=!0,console.log(d)},logForce:function(e){return O=function(n,r,t){var o;if(m.isFunction(e))return e(n,r,t);switch(o=r,n){case 1:o+=": initial value is not of type "+r;break;case 2:o+=": optional value is not of type "+r;break;case 3:o+=": no valid type found, returning a type "+r+" literal"}return S(f+o)}}},h=function(e){var n,r;return n=x(e),r=function(r){if(R.autoConvert)switch(e){case p:R.isString(r)&&(r=parseInt(r,R.parseIntBase));break;case b:R.isNumber(r)&&(r+="")}if(m["is"+n](r))return r},function(t,o){var i;if(null!=t&&void 0!==(i=r(t)))return i;if(O(1,n,t),R.isDefined(o)){if(R.typeof(o),null!=o&&void 0!==(o=r(o)))return o;O(2,n,t)}return O(3,n,t),a[e]}},j=function(e,n){var r,t,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(o.length<1)return e===_[void 0];for(r=0,t=o.length;r<t;r++)if(e(o[r])===n)return n;return!n},o=!0,function(){var e,n,r;for(r in n=[],_)e=_[r],n.push(function(e,n){var r;return r=function(){switch(e){case"nan":return"NaN";case g:return"RegExp";default:return x(e)}}(),m["is"+r]=n,m["not"+r]=function(e){return!n(e)},m["has"+r]=function(){return j(n,o,arguments)},m["all"+r]=function(){return j(n,!1,arguments)},e in a&&(m["force"+r]=h(e)),m["getFirst"+r]=function(){for(var e,n,t,o=arguments.length,i=new Array(o),u=0;u<o;u++)i[u]=arguments[u];for(e=0,n=i.length;e<n;e++)if(t=i[e],m["is"+r](t))return t}}(r,e))}(),m.intoArray=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return n.length<2&&(R.isString(n[0])?n=n.join("").replace(/^\s+|\s+$/g,"").replace(/\s+/g," ").split(" "):R.isArray(n[0])&&(n=n[0])),n},m.typeOf=m.typeof=function(e){var n;for(n in _)if(!0===(0,_[n])(e))return n},m.enum=m.enumerate=function(e,n){var r,t,o,u,f;if(n=R.forceNumber(n,0),r=w(),R.notArray(e))return S("".concat(i," invalid or missing enumeration array")),r;for(o=t=0,f=e.length;t<f;o=++t)u=e[o],R.isString(u)?r[u]=o+n:S("".concat(i," ignored non-string item that was found in enumeration array"));return R.forceFunction(Object.freeze)(r),r},"undefined"!=typeof define&&null!==define&&c===("undefined"==typeof define?"undefined":_typeof(define))&&define.amd&&define("types",[],(function(){return m})),("undefined"==typeof module?"undefined":_typeof(module))!==P&&(module.exports=m),("undefined"==typeof window?"undefined":_typeof(window))!==P&&(window.Types=m)}).call(void 0);
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc