vest-utils
Advanced tools
Comparing version 1.3.2 to 1.3.3-dev-20241111-bedd
@@ -71,3 +71,3 @@ 'use strict'; | ||
function genMinifiedKey() { | ||
const chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*'; | ||
const chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*_'; | ||
let index = 0; | ||
@@ -85,7 +85,7 @@ return function next() { | ||
} | ||
function minifyObject(obj, excludeKeys = new Set()) { | ||
function minifyObject(obj, replacer = v => v) { | ||
const countMap = new Map(); | ||
countOccurrences(obj, countMap, excludeKeys); | ||
countOccurrences(obj, countMap, replacer); | ||
const maps = genMap(countMap); | ||
const o = minifyObjectImpl(obj, maps.map, excludeKeys); | ||
const o = minifyObjectImpl(obj, maps.map, replacer); | ||
// need to reverse the map so that the minified keys are the keys and the original keys are the values | ||
@@ -129,7 +129,6 @@ // and turn it into an object | ||
} | ||
// eslint-disable-next-line complexity | ||
function countOccurrences(obj, countMap, excludeKeys) { | ||
function countOccurrences(obj, countMap, replacer) { | ||
for (const key in obj) { | ||
const value = obj[key]; | ||
if (!shouldMinify({ key, value }, excludeKeys)) | ||
const value = replacer(obj[key], key); | ||
if (!shouldMinify(value)) | ||
continue; | ||
@@ -140,3 +139,3 @@ if (!Array.isArray(obj)) { | ||
if (isObject(value)) { | ||
countOccurrences(value, countMap, excludeKeys); | ||
countOccurrences(value, countMap, replacer); | ||
} | ||
@@ -152,6 +151,3 @@ else { | ||
// eslint-disable-next-line complexity | ||
function shouldMinify({ key, value }, excludeKeys) { | ||
if (key && excludeKeys.has(key)) { | ||
return false; | ||
} | ||
function shouldMinify(value) { | ||
if (isObject(value) && isEmpty(value)) { | ||
@@ -168,11 +164,11 @@ return false; | ||
} | ||
function minifyObjectImpl(obj, map, excludeKeys) { | ||
function minifyObjectImpl(obj, map, replacer) { | ||
const minifiedObject = getRootNode(obj); | ||
for (const key in obj) { | ||
const value = obj[key]; | ||
if (!shouldMinify({ key, value }, excludeKeys)) | ||
const value = replacer(obj[key], key); | ||
if (!shouldMinify(value)) | ||
continue; | ||
let minifiedValue; | ||
if (isObject(value)) { | ||
minifiedValue = minifyObjectImpl(value, map, excludeKeys); | ||
minifiedValue = minifyObjectImpl(value, map, replacer); | ||
} | ||
@@ -179,0 +175,0 @@ else { |
@@ -1,2 +0,2 @@ | ||
"use strict";function n(n){return Boolean(Array.isArray(n))}function t(n){const t=String(n),e=Number(n),r=!isNaN(parseFloat(t))&&!isNaN(Number(n))&&isFinite(e);return Boolean(r)}function e(n,e){return function(n,e){return t(n)&&t(e)&&Number(n)===Number(e)}(n.length,e)}function r(n){return function(n){return null===n}(n)||function(n){return void 0===n}(n)}function o(n){return"object"==typeof n&&!r(n)}function u(n){return!n||(t=n,r="length",Object.prototype.hasOwnProperty.call(t,r)?e(n,0):!!o(n)&&e(Object.keys(n),0));var t,r}function c(n,t){t.set(n,(t.get(n)||0)+1)}function i(n,t,e){for(const r in n){const u=n[r];f({key:r,value:u},e)&&(Array.isArray(n)||c(r,t),o(u)?i(u,t,e):c(u,t))}}function f({key:n,value:t},e){return(!n||!e.has(n))&&((!o(t)||!u(t))&&(!function(n){return r(n)||function(n){return"function"==typeof n}(n)||"symbol"==typeof n}(t)&&(!o(t)||!u(t))))}function s(n,t,e){const r=y(n);for(const u in n){const c=n[u];if(!f({key:u,value:c},e))continue;let i;i=o(c)?s(c,t,e):a(c,t),p(r,i,a(u,t))}return r}function a(n,t){var e;return null!==(e=t.get(n))&&void 0!==e?e:n}function l(n,t){var e,r;return r=n,String(r)===r&&null!==(e=t[n])&&void 0!==e?e:n}function p(t,e,r){n(t)?t.push(e):t[r]=e}function y(t){return n(t)?[]:{}}exports.expandObject=function n(t,e){const r=y(t);for(const u in t){let c;const i=t[u];c=o(i)?n(i,e):l(i,e);p(r,c,l(u,e))}return r},exports.minifyObject=function(n,t=new Set){const e=new Map;i(n,e,t);const r=function(n){const t=[];for(const[e,r]of n)r>1&&t.push({value:e,count:r});const e=t.sort(((n,t)=>t.count-n.count)),r=function(){const n="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*";let t=0;return function(){let e="",r=t;do{e+=n[r%70],r=Math.floor(r/70)}while(r>0);return t++,e}}();return e.reduce(((t,{value:e})=>{if(!function(n,t){return n.toString().length>=t}(e,t.keyLength))return t;let o;do{o=r()}while(n.has(o));return t.map.set(e,o),t.reverseMap[o]=e,t.keyLength=o.length,t}),{map:new Map,reverseMap:{},keyLength:1})}(e);return[s(n,r.map,t),r.reverseMap]}; | ||
"use strict";function n(n){return Boolean(Array.isArray(n))}function t(n){const t=String(n),r=Number(n),e=!isNaN(parseFloat(t))&&!isNaN(Number(n))&&isFinite(r);return Boolean(e)}function r(n,r){return function(n,r){return t(n)&&t(r)&&Number(n)===Number(r)}(n.length,r)}function e(n){return function(n){return null===n}(n)||function(n){return void 0===n}(n)}function o(n){return"object"==typeof n&&!e(n)}function u(n){return!n||(t=n,e="length",Object.prototype.hasOwnProperty.call(t,e)?r(n,0):!!o(n)&&r(Object.keys(n),0));var t,e}function c(n,t){t.set(n,(t.get(n)||0)+1)}function i(n,t,r){for(const e in n){const u=r(n[e],e);f(u)&&(Array.isArray(n)||c(e,t),o(u)?i(u,t,r):c(u,t))}}function f(n){return(!o(n)||!u(n))&&(!function(n){return e(n)||function(n){return"function"==typeof n}(n)||"symbol"==typeof n}(n)&&(!o(n)||!u(n)))}function s(n,t,r){const e=y(n);for(const u in n){const c=r(n[u],u);if(!f(c))continue;let i;i=o(c)?s(c,t,r):a(c,t),p(e,i,a(u,t))}return e}function a(n,t){var r;return null!==(r=t.get(n))&&void 0!==r?r:n}function l(n,t){var r,e;return e=n,String(e)===e&&null!==(r=t[n])&&void 0!==r?r:n}function p(t,r,e){n(t)?t.push(r):t[e]=r}function y(t){return n(t)?[]:{}}exports.expandObject=function n(t,r){const e=y(t);for(const u in t){let c;const i=t[u];c=o(i)?n(i,r):l(i,r);p(e,c,l(u,r))}return e},exports.minifyObject=function(n,t=(n=>n)){const r=new Map;i(n,r,t);const e=function(n){const t=[];for(const[r,e]of n)e>1&&t.push({value:r,count:e});const r=t.sort(((n,t)=>t.count-n.count)),e=function(){const n="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*_";let t=0;return function(){let r="",e=t;do{r+=n[e%71],e=Math.floor(e/71)}while(e>0);return t++,r}}();return r.reduce(((t,{value:r})=>{if(!function(n,t){return n.toString().length>=t}(r,t.keyLength))return t;let o;do{o=e()}while(n.has(o));return t.map.set(r,o),t.reverseMap[o]=r,t.keyLength=o.length,t}),{map:new Map,reverseMap:{},keyLength:1})}(r);return[s(n,e.map,t),e.reverseMap]}; | ||
//# sourceMappingURL=minifyObject.production.js.map |
@@ -69,3 +69,3 @@ // The module is named "isArrayValue" since it | ||
function genMinifiedKey() { | ||
const chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*'; | ||
const chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*_'; | ||
let index = 0; | ||
@@ -83,7 +83,7 @@ return function next() { | ||
} | ||
function minifyObject(obj, excludeKeys = new Set()) { | ||
function minifyObject(obj, replacer = v => v) { | ||
const countMap = new Map(); | ||
countOccurrences(obj, countMap, excludeKeys); | ||
countOccurrences(obj, countMap, replacer); | ||
const maps = genMap(countMap); | ||
const o = minifyObjectImpl(obj, maps.map, excludeKeys); | ||
const o = minifyObjectImpl(obj, maps.map, replacer); | ||
// need to reverse the map so that the minified keys are the keys and the original keys are the values | ||
@@ -127,7 +127,6 @@ // and turn it into an object | ||
} | ||
// eslint-disable-next-line complexity | ||
function countOccurrences(obj, countMap, excludeKeys) { | ||
function countOccurrences(obj, countMap, replacer) { | ||
for (const key in obj) { | ||
const value = obj[key]; | ||
if (!shouldMinify({ key, value }, excludeKeys)) | ||
const value = replacer(obj[key], key); | ||
if (!shouldMinify(value)) | ||
continue; | ||
@@ -138,3 +137,3 @@ if (!Array.isArray(obj)) { | ||
if (isObject(value)) { | ||
countOccurrences(value, countMap, excludeKeys); | ||
countOccurrences(value, countMap, replacer); | ||
} | ||
@@ -150,6 +149,3 @@ else { | ||
// eslint-disable-next-line complexity | ||
function shouldMinify({ key, value }, excludeKeys) { | ||
if (key && excludeKeys.has(key)) { | ||
return false; | ||
} | ||
function shouldMinify(value) { | ||
if (isObject(value) && isEmpty(value)) { | ||
@@ -166,11 +162,11 @@ return false; | ||
} | ||
function minifyObjectImpl(obj, map, excludeKeys) { | ||
function minifyObjectImpl(obj, map, replacer) { | ||
const minifiedObject = getRootNode(obj); | ||
for (const key in obj) { | ||
const value = obj[key]; | ||
if (!shouldMinify({ key, value }, excludeKeys)) | ||
const value = replacer(obj[key], key); | ||
if (!shouldMinify(value)) | ||
continue; | ||
let minifiedValue; | ||
if (isObject(value)) { | ||
minifiedValue = minifyObjectImpl(value, map, excludeKeys); | ||
minifiedValue = minifyObjectImpl(value, map, replacer); | ||
} | ||
@@ -177,0 +173,0 @@ else { |
@@ -1,2 +0,2 @@ | ||
function n(n){return Boolean(Array.isArray(n))}function t(n){const t=String(n),e=Number(n),r=!isNaN(parseFloat(t))&&!isNaN(Number(n))&&isFinite(e);return Boolean(r)}function e(n,e){return function(n,e){return t(n)&&t(e)&&Number(n)===Number(e)}(n.length,e)}function r(n){return function(n){return null===n}(n)||function(n){return void 0===n}(n)}function o(n){return"object"==typeof n&&!r(n)}function u(n){return!n||(t=n,r="length",Object.prototype.hasOwnProperty.call(t,r)?e(n,0):!!o(n)&&e(Object.keys(n),0));var t,r}function c(n,t=new Set){const e=new Map;f(n,e,t);const r=function(n){const t=[];for(const[e,r]of n)r>1&&t.push({value:e,count:r});const e=t.sort(((n,t)=>t.count-n.count)),r=function(){const n="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*";let t=0;return function(){let e="",r=t;do{e+=n[r%70],r=Math.floor(r/70)}while(r>0);return t++,e}}();return e.reduce(((t,{value:e})=>{if(!function(n,t){return n.toString().length>=t}(e,t.keyLength))return t;let o;do{o=r()}while(n.has(o));return t.map.set(e,o),t.reverseMap[o]=e,t.keyLength=o.length,t}),{map:new Map,reverseMap:{},keyLength:1})}(e);return[a(n,r.map,t),r.reverseMap]}function i(n,t){t.set(n,(t.get(n)||0)+1)}function f(n,t,e){for(const r in n){const u=n[r];s({key:r,value:u},e)&&(Array.isArray(n)||i(r,t),o(u)?f(u,t,e):i(u,t))}}function s({key:n,value:t},e){return(!n||!e.has(n))&&((!o(t)||!u(t))&&(!function(n){return r(n)||function(n){return"function"==typeof n}(n)||"symbol"==typeof n}(t)&&(!o(t)||!u(t))))}function a(n,t,e){const r=v(n);for(const u in n){const c=n[u];if(!s({key:u,value:c},e))continue;let i;i=o(c)?a(c,t,e):l(c,t),h(r,i,l(u,t))}return r}function l(n,t){var e;return null!==(e=t.get(n))&&void 0!==e?e:n}function p(n,t){var e,r;return r=n,String(r)===r&&null!==(e=t[n])&&void 0!==e?e:n}function y(n,t){const e=v(n);for(const r in n){let u;const c=n[r];u=o(c)?y(c,t):p(c,t);h(e,u,p(r,t))}return e}function h(t,e,r){n(t)?t.push(e):t[r]=e}function v(t){return n(t)?[]:{}}export{y as expandObject,c as minifyObject}; | ||
function n(n){return Boolean(Array.isArray(n))}function t(n){const t=String(n),r=Number(n),e=!isNaN(parseFloat(t))&&!isNaN(Number(n))&&isFinite(r);return Boolean(e)}function r(n,r){return function(n,r){return t(n)&&t(r)&&Number(n)===Number(r)}(n.length,r)}function e(n){return function(n){return null===n}(n)||function(n){return void 0===n}(n)}function o(n){return"object"==typeof n&&!e(n)}function u(n){return!n||(t=n,e="length",Object.prototype.hasOwnProperty.call(t,e)?r(n,0):!!o(n)&&r(Object.keys(n),0));var t,e}function c(n,t=(n=>n)){const r=new Map;f(n,r,t);const e=function(n){const t=[];for(const[r,e]of n)e>1&&t.push({value:r,count:e});const r=t.sort(((n,t)=>t.count-n.count)),e=function(){const n="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*_";let t=0;return function(){let r="",e=t;do{r+=n[e%71],e=Math.floor(e/71)}while(e>0);return t++,r}}();return r.reduce(((t,{value:r})=>{if(!function(n,t){return n.toString().length>=t}(r,t.keyLength))return t;let o;do{o=e()}while(n.has(o));return t.map.set(r,o),t.reverseMap[o]=r,t.keyLength=o.length,t}),{map:new Map,reverseMap:{},keyLength:1})}(r);return[a(n,e.map,t),e.reverseMap]}function i(n,t){t.set(n,(t.get(n)||0)+1)}function f(n,t,r){for(const e in n){const u=r(n[e],e);s(u)&&(Array.isArray(n)||i(e,t),o(u)?f(u,t,r):i(u,t))}}function s(n){return(!o(n)||!u(n))&&(!function(n){return e(n)||function(n){return"function"==typeof n}(n)||"symbol"==typeof n}(n)&&(!o(n)||!u(n)))}function a(n,t,r){const e=g(n);for(const u in n){const c=r(n[u],u);if(!s(c))continue;let i;i=o(c)?a(c,t,r):l(c,t),y(e,i,l(u,t))}return e}function l(n,t){var r;return null!==(r=t.get(n))&&void 0!==r?r:n}function p(n,t){var r,e;return e=n,String(e)===e&&null!==(r=t[n])&&void 0!==r?r:n}function h(n,t){const r=g(n);for(const e in n){let u;const c=n[e];u=o(c)?h(c,t):p(c,t);y(r,u,p(e,t))}return r}function y(t,r,e){n(t)?t.push(r):t[e]=r}function g(t){return n(t)?[]:{}}export{h as expandObject,c as minifyObject}; | ||
//# sourceMappingURL=minifyObject.production.js.map |
@@ -75,3 +75,3 @@ (function (global, factory) { | ||
function genMinifiedKey() { | ||
const chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*'; | ||
const chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*_'; | ||
let index = 0; | ||
@@ -89,7 +89,7 @@ return function next() { | ||
} | ||
function minifyObject(obj, excludeKeys = new Set()) { | ||
function minifyObject(obj, replacer = v => v) { | ||
const countMap = new Map(); | ||
countOccurrences(obj, countMap, excludeKeys); | ||
countOccurrences(obj, countMap, replacer); | ||
const maps = genMap(countMap); | ||
const o = minifyObjectImpl(obj, maps.map, excludeKeys); | ||
const o = minifyObjectImpl(obj, maps.map, replacer); | ||
// need to reverse the map so that the minified keys are the keys and the original keys are the values | ||
@@ -133,7 +133,6 @@ // and turn it into an object | ||
} | ||
// eslint-disable-next-line complexity | ||
function countOccurrences(obj, countMap, excludeKeys) { | ||
function countOccurrences(obj, countMap, replacer) { | ||
for (const key in obj) { | ||
const value = obj[key]; | ||
if (!shouldMinify({ key, value }, excludeKeys)) | ||
const value = replacer(obj[key], key); | ||
if (!shouldMinify(value)) | ||
continue; | ||
@@ -144,3 +143,3 @@ if (!Array.isArray(obj)) { | ||
if (isObject(value)) { | ||
countOccurrences(value, countMap, excludeKeys); | ||
countOccurrences(value, countMap, replacer); | ||
} | ||
@@ -156,6 +155,3 @@ else { | ||
// eslint-disable-next-line complexity | ||
function shouldMinify({ key, value }, excludeKeys) { | ||
if (key && excludeKeys.has(key)) { | ||
return false; | ||
} | ||
function shouldMinify(value) { | ||
if (isObject(value) && isEmpty(value)) { | ||
@@ -172,11 +168,11 @@ return false; | ||
} | ||
function minifyObjectImpl(obj, map, excludeKeys) { | ||
function minifyObjectImpl(obj, map, replacer) { | ||
const minifiedObject = getRootNode(obj); | ||
for (const key in obj) { | ||
const value = obj[key]; | ||
if (!shouldMinify({ key, value }, excludeKeys)) | ||
const value = replacer(obj[key], key); | ||
if (!shouldMinify(value)) | ||
continue; | ||
let minifiedValue; | ||
if (isObject(value)) { | ||
minifiedValue = minifyObjectImpl(value, map, excludeKeys); | ||
minifiedValue = minifyObjectImpl(value, map, replacer); | ||
} | ||
@@ -183,0 +179,0 @@ else { |
@@ -1,2 +0,2 @@ | ||
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((n="undefined"!=typeof globalThis?globalThis:n||self).minifyObject={})}(this,(function(n){"use strict";function t(n){return Boolean(Array.isArray(n))}function e(n){const t=String(n),e=Number(n),r=!isNaN(parseFloat(t))&&!isNaN(Number(n))&&isFinite(e);return Boolean(r)}function r(n,t){return function(n,t){return e(n)&&e(t)&&Number(n)===Number(t)}(n.length,t)}function o(n){return function(n){return null===n}(n)||function(n){return void 0===n}(n)}function u(n){return"object"==typeof n&&!o(n)}function i(n){return!n||(t=n,e="length",Object.prototype.hasOwnProperty.call(t,e)?r(n,0):!!u(n)&&r(Object.keys(n),0));var t,e}function c(n,t){t.set(n,(t.get(n)||0)+1)}function f(n,t,e){for(const r in n){const o=n[r];s({key:r,value:o},e)&&(Array.isArray(n)||c(r,t),u(o)?f(o,t,e):c(o,t))}}function s({key:n,value:t},e){return(!n||!e.has(n))&&((!u(t)||!i(t))&&(!function(n){return o(n)||function(n){return"function"==typeof n}(n)||"symbol"==typeof n}(t)&&(!u(t)||!i(t))))}function a(n,t,e){const r=h(n);for(const o in n){const i=n[o];if(!s({key:o,value:i},e))continue;let c;c=u(i)?a(i,t,e):l(i,t),y(r,c,l(o,t))}return r}function l(n,t){var e;return null!==(e=t.get(n))&&void 0!==e?e:n}function p(n,t){var e,r;return r=n,String(r)===r&&null!==(e=t[n])&&void 0!==e?e:n}function y(n,e,r){t(n)?n.push(e):n[r]=e}function h(n){return t(n)?[]:{}}n.expandObject=function n(t,e){const r=h(t);for(const o in t){let i;const c=t[o];i=u(c)?n(c,e):p(c,e);y(r,i,p(o,e))}return r},n.minifyObject=function(n,t=new Set){const e=new Map;f(n,e,t);const r=function(n){const t=[];for(const[e,r]of n)r>1&&t.push({value:e,count:r});const e=t.sort(((n,t)=>t.count-n.count)),r=function(){const n="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*";let t=0;return function(){let e="",r=t;do{e+=n[r%70],r=Math.floor(r/70)}while(r>0);return t++,e}}();return e.reduce(((t,{value:e})=>{if(!function(n,t){return n.toString().length>=t}(e,t.keyLength))return t;let o;do{o=r()}while(n.has(o));return t.map.set(e,o),t.reverseMap[o]=e,t.keyLength=o.length,t}),{map:new Map,reverseMap:{},keyLength:1})}(e);return[a(n,r.map,t),r.reverseMap]}})); | ||
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((n="undefined"!=typeof globalThis?globalThis:n||self).minifyObject={})}(this,(function(n){"use strict";function t(n){return Boolean(Array.isArray(n))}function e(n){const t=String(n),e=Number(n),r=!isNaN(parseFloat(t))&&!isNaN(Number(n))&&isFinite(e);return Boolean(r)}function r(n,t){return function(n,t){return e(n)&&e(t)&&Number(n)===Number(t)}(n.length,t)}function o(n){return function(n){return null===n}(n)||function(n){return void 0===n}(n)}function u(n){return"object"==typeof n&&!o(n)}function i(n){return!n||(t=n,e="length",Object.prototype.hasOwnProperty.call(t,e)?r(n,0):!!u(n)&&r(Object.keys(n),0));var t,e}function c(n,t){t.set(n,(t.get(n)||0)+1)}function f(n,t,e){for(const r in n){const o=e(n[r],r);s(o)&&(Array.isArray(n)||c(r,t),u(o)?f(o,t,e):c(o,t))}}function s(n){return(!u(n)||!i(n))&&(!function(n){return o(n)||function(n){return"function"==typeof n}(n)||"symbol"==typeof n}(n)&&(!u(n)||!i(n)))}function l(n,t,e){const r=h(n);for(const o in n){const i=e(n[o],o);if(!s(i))continue;let c;c=u(i)?l(i,t,e):a(i,t),y(r,c,a(o,t))}return r}function a(n,t){var e;return null!==(e=t.get(n))&&void 0!==e?e:n}function p(n,t){var e,r;return r=n,String(r)===r&&null!==(e=t[n])&&void 0!==e?e:n}function y(n,e,r){t(n)?n.push(e):n[r]=e}function h(n){return t(n)?[]:{}}n.expandObject=function n(t,e){const r=h(t);for(const o in t){let i;const c=t[o];i=u(c)?n(c,e):p(c,e);y(r,i,p(o,e))}return r},n.minifyObject=function(n,t=(n=>n)){const e=new Map;f(n,e,t);const r=function(n){const t=[];for(const[e,r]of n)r>1&&t.push({value:e,count:r});const e=t.sort(((n,t)=>t.count-n.count)),r=function(){const n="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*_";let t=0;return function(){let e="",r=t;do{e+=n[r%71],r=Math.floor(r/71)}while(r>0);return t++,e}}();return e.reduce(((t,{value:e})=>{if(!function(n,t){return n.toString().length>=t}(e,t.keyLength))return t;let o;do{o=r()}while(n.has(o));return t.map.set(e,o),t.reverseMap[o]=e,t.keyLength=o.length,t}),{map:new Map,reverseMap:{},keyLength:1})}(e);return[l(n,r.map,t),r.reverseMap]}})); | ||
//# sourceMappingURL=minifyObject.production.js.map |
@@ -8,3 +8,4 @@ { | ||
"types": "../types/minifyObject.d.ts", | ||
"license": "MIT", | ||
"private": true | ||
} |
{ | ||
"version": "1.3.2", | ||
"version": "1.3.3-dev-20241111-bedd", | ||
"name": "vest-utils", | ||
@@ -77,3 +77,4 @@ "author": "ealush", | ||
}, | ||
"vxAllowResolve": [] | ||
"vxAllowResolve": [], | ||
"license": "MIT" | ||
} |
@@ -1,4 +0,5 @@ | ||
declare function minifyObject(obj: any, excludeKeys?: Set<string>): [any, any]; | ||
declare function minifyObject(obj: any, replacer?: MinifyObjectReplacer): [any, any]; | ||
declare function expandObject(minifiedObj: any, map: Record<string, any>): any; | ||
export { minifyObject, expandObject }; | ||
type MinifyObjectReplacer = (value: any, key: string) => any; | ||
export { minifyObject, expandObject, MinifyObjectReplacer }; | ||
//# sourceMappingURL=minifyObject.d.ts.map |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
298845
1920
2