tiny-coerce
Advanced tools
Comparing version 3.0.1 to 3.0.2
@@ -6,3 +6,3 @@ /** | ||
* @license BSD-3-Clause | ||
* @version 3.0.1 | ||
* @version 3.0.2 | ||
*/ | ||
@@ -9,0 +9,0 @@ const regex = { |
/*! | ||
2023 Jason Mulligan <jason.mulligan@avoidwork.com> | ||
@version 3.0.1 | ||
@version 3.0.2 | ||
*/ | ||
const e={false:/^(F|f)alse$/,null:/^(N|n)ull$/,json:/^["\[{].*[}\]"]$/,true:/^(T|t)rue$/},t="string",s="undefined";function l(e){const t=Array.isArray(e);(t?e:Object.keys(e)).forEach(((s,l)=>{e[t?l:s]=n(t?s:e[s],!0)}))}function n(n,f=!1){let i;if(typeof n!==t)i=n,f&&l(i);else{const t=n.trim();let r;if(0===t.length)i=t;else if(e.true.test(t))i=!0;else if(e.false.test(t))i=!1;else if(e.null.test(t))i=null;else if(t===s)i=void 0;else if(isNaN(r=Number(t)))if(e.json.test(t)){let e;try{i=JSON.parse(t),e=!0}catch(s){i=t,e=!1}e&&f&&l(i)}else i=t;else i=r}return i}export{n as coerce};//# sourceMappingURL=tiny-coerce.min.js.map |
@@ -6,3 +6,3 @@ /** | ||
* @license BSD-3-Clause | ||
* @version 3.0.1 | ||
* @version 3.0.2 | ||
*/ | ||
@@ -9,0 +9,0 @@ (function(g,f){typeof exports==='object'&&typeof module!=='undefined'?f(exports):typeof define==='function'&&define.amd?define(['exports'],f):(g=typeof globalThis!=='undefined'?globalThis:g||self,f(g.lru={}));})(this,(function(exports){'use strict';const regex = { |
/*! | ||
2023 Jason Mulligan <jason.mulligan@avoidwork.com> | ||
@version 3.0.1 | ||
@version 3.0.2 | ||
*/ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).lru={})}(this,(function(e){"use strict";const t={false:/^(F|f)alse$/,null:/^(N|n)ull$/,json:/^["\[{].*[}\]"]$/,true:/^(T|t)rue$/},s="string",n="undefined";function l(e){const t=Array.isArray(e);(t?e:Object.keys(e)).forEach(((s,n)=>{e[t?n:s]=f(t?s:e[s],!0)}))}function f(e,f=!1){let i;if(typeof e!==s)i=e,f&&l(i);else{const s=e.trim();let o;if(0===s.length)i=s;else if(t.true.test(s))i=!0;else if(t.false.test(s))i=!1;else if(t.null.test(s))i=null;else if(s===n)i=void 0;else if(isNaN(o=Number(s)))if(t.json.test(s)){let e;try{i=JSON.parse(s),e=!0}catch(t){i=s,e=!1}e&&f&&l(i)}else i=s;else i=o}return i}e.coerce=f}));//# sourceMappingURL=tiny-coerce.umd.min.js.map |
{ | ||
"name": "tiny-coerce", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"description": "Tiny coercion library for Client or Server", | ||
@@ -19,3 +19,3 @@ "type": "module", | ||
"engines": { | ||
"node": ">=12" | ||
"node": ">=6" | ||
}, | ||
@@ -30,3 +30,3 @@ "engineStrict": true, | ||
"mocha": "nyc mocha test/*.js", | ||
"types": "npx -p typescript tsc src/httptest.js --declaration --allowJs --emitDeclarationOnly --outDir types", | ||
"types": "npx -p typescript tsc src/coerce.js --declaration --allowJs --emitDeclarationOnly --outDir types && rm types/constants.d.ts && rm types/regex.d.ts", | ||
"test": "npm run lint && npm run mocha", | ||
@@ -33,0 +33,0 @@ "prepare": "husky install" |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16761
11
201