@poppinss/utils 7.0.0-next.6 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/build/index.js +6 -6
- package/build/is_script_file-CbSEfxE_.js +20 -0
- package/build/lodash/main.cjs +43 -34
- package/build/modules/base64.js +2 -2
- package/build/modules/exception.js +1 -1
- package/build/modules/fs/main.js +4 -5
- package/build/modules/json/main.js +1 -2
- package/build/{main-aO4h7ygK.js → safe_stringify-DenlQd3-.js} +54 -33
- package/lodash/lodash.types.d.ts +59 -2
- package/package.json +21 -13
- package/build/chunk-BNZ4_A-W.js +0 -23
- package/build/exception-L7vjh-Gv.js +0 -2
- package/build/main-CdreHl1_.js +0 -694
package/README.md
CHANGED
|
@@ -95,7 +95,9 @@ Lodash is quite a big library, and we do not use all its helper methods. Therefo
|
|
|
95
95
|
> **Why not use something else**: All other helpers I have used are not as accurate or well implemented as lodash.
|
|
96
96
|
|
|
97
97
|
- pick
|
|
98
|
+
- pickBy
|
|
98
99
|
- omit
|
|
100
|
+
- omitBy
|
|
99
101
|
- has
|
|
100
102
|
- get
|
|
101
103
|
- set
|
package/build/index.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { n as
|
|
2
|
-
import { n as
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
1
|
+
import { n as safeParse, t as safeStringify } from "./safe_stringify-DenlQd3-.js";
|
|
2
|
+
import { n as naturalSort, t as isScriptFile } from "./is_script_file-CbSEfxE_.js";
|
|
3
|
+
import { RuntimeException } from "./modules/exception.js";
|
|
4
|
+
import "./modules/json/main.js";
|
|
5
5
|
import { flattie } from "flattie";
|
|
6
6
|
import { Buffer } from "node:buffer";
|
|
7
7
|
import { timingSafeEqual } from "node:crypto";
|
|
8
8
|
import string from "@poppinss/string";
|
|
9
|
+
import lodash from "@poppinss/utils/lodash";
|
|
9
10
|
const REDACTED = "[redacted]";
|
|
10
11
|
var Secret = class Secret {
|
|
11
12
|
#value;
|
|
@@ -138,7 +139,6 @@ var ImportsBag = class {
|
|
|
138
139
|
return this.toArray().map((imp) => this.#generateImportStatement(imp)).join("\n");
|
|
139
140
|
}
|
|
140
141
|
};
|
|
141
|
-
var import_main = /* @__PURE__ */ __toESM(require_main());
|
|
142
142
|
function defineStaticProperty(self, propertyName, { initialValue, strategy }) {
|
|
143
143
|
if (!self.hasOwnProperty(propertyName)) {
|
|
144
144
|
const value = self[propertyName];
|
|
@@ -152,7 +152,7 @@ function defineStaticProperty(self, propertyName, { initialValue, strategy }) {
|
|
|
152
152
|
return;
|
|
153
153
|
}
|
|
154
154
|
Object.defineProperty(self, propertyName, {
|
|
155
|
-
value: typeof strategy === "function" ? strategy(value) :
|
|
155
|
+
value: typeof strategy === "function" ? strategy(value) : lodash.cloneDeep(value),
|
|
156
156
|
configurable: true,
|
|
157
157
|
enumerable: true,
|
|
158
158
|
writable: true
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { extname } from "node:path";
|
|
2
|
+
function naturalSort(current, next) {
|
|
3
|
+
return current.localeCompare(next, void 0, {
|
|
4
|
+
numeric: true,
|
|
5
|
+
sensitivity: "base"
|
|
6
|
+
});
|
|
7
|
+
}
|
|
8
|
+
const JS_MODULES = [
|
|
9
|
+
".js",
|
|
10
|
+
".json",
|
|
11
|
+
".cjs",
|
|
12
|
+
".mjs"
|
|
13
|
+
];
|
|
14
|
+
function isScriptFile(filePath) {
|
|
15
|
+
const ext = extname(filePath);
|
|
16
|
+
if (JS_MODULES.includes(ext)) return true;
|
|
17
|
+
if (ext === ".ts" && !filePath.endsWith(".d.ts")) return true;
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
export { naturalSort as n, isScriptFile as t };
|
package/build/lodash/main.cjs
CHANGED
|
@@ -1,39 +1,48 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* Lodash (Custom Build) lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE
|
|
4
|
-
* Build: `lodash include="pick,omit,has,get,set,unset,mergeWith,merge,size,clone,cloneWith,cloneDeep,cloneDeepWith,toPath" --production`
|
|
4
|
+
* Build: `lodash include="pick,pickBy,omit,omitBy,has,get,set,unset,mergeWith,merge,size,clone,cloneWith,cloneDeep,cloneDeepWith,toPath" --production`
|
|
5
5
|
*/
|
|
6
6
|
;(function(){function t(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function e(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&false!==e(t[n],n,t););}function n(t,e){for(var n=-1,r=null==t?0:t.length,u=0,o=[];++n<r;){var c=t[n];e(c,n,t)&&(o[u++]=c)}return o}function r(t,e){for(var n=-1,r=null==t?0:t.length,u=Array(r);++n<r;)u[n]=e(t[n],n,t);return u}function u(t,e){for(var n=-1,r=e.length,u=t.length;++n<r;)t[u+n]=e[n];
|
|
7
|
-
return t}function o(t){return function(
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
return o
|
|
12
|
-
}function
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
return
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}function
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
return function(e){return null
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
return
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
7
|
+
return t}function o(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return true;return false}function c(t){return function(e){return null==e?Zt:e[t]}}function i(t){return function(e){return t(e)}}function f(t){var e=-1,n=Array(t.size);return t.forEach(function(t,r){n[++e]=[r,t]}),n}function a(t){var e=Object;return function(n){return t(e(n))}}function l(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=t}),n}function s(){}function b(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){
|
|
8
|
+
var r=t[e];this.set(r[0],r[1])}}function h(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function p(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function y(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new p;++e<n;)this.add(t[e])}function j(t){this.size=(this.__data__=new h(t)).size}function _(t,e){var n=An(t),r=!n&&vn(t),u=!n&&!r&&wn(t),o=!n&&!r&&!u&&Sn(t);if(n=n||r||u||o){for(var r=t.length,c=String,i=-1,f=Array(r);++i<r;)f[i]=c(i);
|
|
9
|
+
r=f}else r=[];var a,c=r.length;for(a in t)!e&&!Fe.call(t,a)||n&&("length"==a||u&&("offset"==a||"parent"==a)||o&&("buffer"==a||"byteLength"==a||"byteOffset"==a)||gt(a,c))||r.push(a);return r}function d(t,e,n){(n===Zt||Ft(t[e],n))&&(n!==Zt||e in t)||m(t,e,n)}function g(t,e,n){var r=t[e];Fe.call(t,e)&&Ft(r,n)&&(n!==Zt||e in t)||m(t,e,n)}function v(t,e){for(var n=t.length;n--;)if(Ft(t[n][0],e))return n;return-1}function A(t,e){return t&&tt(e,Nt(e),t)}function w(t,e){return t&&tt(e,Gt(e),t)}function m(t,e,n){
|
|
10
|
+
"__proto__"==e&&Ge?Ge(t,e,{configurable:true,enumerable:true,value:n,writable:true}):t[e]=n}function O(t,n,r,u,o,c){var i,f=1&n,a=2&n,l=4&n;if(r&&(i=o?r(t,u,o,c):r(t)),i!==Zt)return i;if(!Ut(t))return t;if(u=An(t)){if(i=yt(t),!f)return Z(t,i)}else{var s=_n(t),b="[object Function]"==s||"[object GeneratorFunction]"==s;if(wn(t))return Q(t,f);if("[object Object]"==s||"[object Arguments]"==s||b&&!o){if(i=a||b?{}:jt(t),!f)return a?nt(t,w(i,t)):et(t,A(i,t))}else{if(!he[s])return o?t:{};i=_t(t,s,f)}}if(c||(c=new j),
|
|
11
|
+
o=c.get(t))return o;if(c.set(t,i),On(t))return t.forEach(function(e){i.add(O(e,n,r,e,t,c))}),i;if(mn(t))return t.forEach(function(e,u){i.set(u,O(e,n,r,u,t,c))}),i;var a=l?a?at:ft:a?Gt:Nt,h=u?Zt:a(t);return e(h||t,function(e,u){h&&(u=e,e=t[u]),g(i,u,O(e,n,r,u,t,c))}),i}function S(t,e,n,r,o){var c=-1,i=t.length;for(n||(n=dt),o||(o=[]);++c<i;){var f=t[c];0<e&&n(f)?1<e?S(f,e-1,n,r,o):u(o,f):r||(o[o.length]=f)}return o}function k(t,e){e=K(e,t);for(var n=0,r=e.length;null!=t&&n<r;)t=t[Ot(e[n++])];return n&&n==r?t:Zt;
|
|
12
|
+
}function z(t,e,n){return e=e(t),An(t)?e:u(e,n(t))}function x(t){if(null==t)t=t===Zt?"[object Undefined]":"[object Null]";else if(Ne&&Ne in Object(t)){var e=Fe.call(t,Ne),n=t[Ne];try{t[Ne]=Zt;var r=true}catch(t){}var u=Me.call(t);r&&(e?t[Ne]=n:delete t[Ne]),t=u}else t=Me.call(t);return t}function E(t,e){return null!=t&&Fe.call(t,e)}function F(t,e){return null!=t&&e in Object(t)}function I(t){return Pt(t)&&"[object Arguments]"==x(t)}function M(t,e,n,r,u){if(t===e)e=true;else if(null==t||null==e||!Pt(t)&&!Pt(e))e=t!==t&&e!==e;else t:{
|
|
13
|
+
var o=An(t),c=An(e),i=o?"[object Array]":_n(t),f=c?"[object Array]":_n(e),i="[object Arguments]"==i?"[object Object]":i,f="[object Arguments]"==f?"[object Object]":f,a="[object Object]"==i,c="[object Object]"==f;if((f=i==f)&&wn(t)){if(!wn(e)){e=false;break t}o=true,a=false}if(f&&!a)u||(u=new j),e=o||Sn(t)?ot(t,e,n,r,M,u):ct(t,e,i,n,r,M,u);else{if(!(1&n)&&(o=a&&Fe.call(t,"__wrapped__"),i=c&&Fe.call(e,"__wrapped__"),o||i)){t=o?t.value():t,e=i?e.value():e,u||(u=new j),e=M(t,e,n,r,u);break t}if(f)e:if(u||(u=new j),
|
|
14
|
+
o=1&n,i=ft(t),c=i.length,f=ft(e).length,c==f||o){for(a=c;a--;){var l=i[a];if(!(o?l in e:Fe.call(e,l))){e=false;break e}}if((f=u.get(t))&&u.get(e))e=f==e;else{f=true,u.set(t,e),u.set(e,t);for(var s=o;++a<c;){var l=i[a],b=t[l],h=e[l];if(r)var p=o?r(h,b,l,e,t,u):r(b,h,l,t,e,u);if(p===Zt?b!==h&&!M(b,h,n,r,u):!p){f=false;break}s||(s="constructor"==l)}f&&!s&&(n=t.constructor,r=e.constructor,n!=r&&"constructor"in t&&"constructor"in e&&!(typeof n=="function"&&n instanceof n&&typeof r=="function"&&r instanceof r)&&(f=false)),
|
|
15
|
+
u.delete(t),u.delete(e),e=f}}else e=false;else e=false}}return e}function B(t){return Pt(t)&&"[object Map]"==_n(t)}function D(t,e){var n=e.length,r=n;if(null==t)return!r;for(t=Object(t);n--;){var u=e[n];if(u[2]?u[1]!==t[u[0]]:!(u[0]in t))return false}for(;++n<r;){var u=e[n],o=u[0],c=t[o],i=u[1];if(u[2]){if(c===Zt&&!(o in t))return false}else if(u=new j,void 0===Zt?!M(i,c,3,void 0,u):1)return false}return true}function U(t){return Pt(t)&&"[object Set]"==_n(t)}function P(t){return Pt(t)&&Dt(t.length)&&!!be[x(t)]}function L(t){
|
|
16
|
+
return typeof t=="function"?t:null==t?Jt:typeof t=="object"?An(t)?C(t[0],t[1]):R(t):Qt(t)}function $(t){if(!At(t))return Je(t);var e,n=[];for(e in Object(t))Fe.call(t,e)&&"constructor"!=e&&n.push(e);return n}function R(t){var e=bt(t);return 1==e.length&&e[0][2]?wt(e[0][0],e[0][1]):function(n){return n===t||D(n,e)}}function C(t,e){return vt(t)&&e===e&&!Ut(e)?wt(Ot(t),e):function(n){var r=Vt(n,t);return r===Zt&&r===e?Wt(n,t):M(e,r,3)}}function T(t,e,n,r,u){t!==e&&hn(e,function(o,c){if(Ut(o)){u||(u=new j);
|
|
17
|
+
var i=u,f="__proto__"==c?Zt:t[c],a="__proto__"==c?Zt:e[c],l=i.get(a);if(l)d(t,c,l);else{var l=r?r(f,a,c+"",t,e,i):Zt,s=l===Zt;if(s){var b=An(a),h=!b&&wn(a),p=!b&&!h&&Sn(a),l=a;b||h||p?An(f)?l=f:Mt(f)?l=Z(f):h?(s=false,l=Q(a,true)):p?(s=false,l=Y(a,true)):l=[]:Lt(a)||vn(a)?(l=f,vn(f)?l=Ct(f):(!Ut(f)||n&&Bt(f))&&(l=jt(a))):s=false}s&&(i.set(a,l),T(l,a,n,r,i),i.delete(a)),d(t,c,l)}}else i=r?r("__proto__"==c?Zt:t[c],o,c+"",t,e,u):Zt,i===Zt&&(i=o),d(t,c,i)},Gt)}function V(t,e){return W(t,e,function(e,n){return Wt(t,n);
|
|
18
|
+
})}function W(t,e,n){for(var r=-1,u=e.length,o={};++r<u;){var c=e[r],i=k(t,c);n(i,c)&&q(o,K(c,t),i)}return o}function N(t){return function(e){return k(e,t)}}function G(t){return dn(mt(t,void 0,Jt),t+"")}function q(t,e,n){if(!Ut(t))return t;e=K(e,t);for(var r=-1,u=e.length,o=u-1,c=t;null!=c&&++r<u;){var i=Ot(e[r]),f=n;if(r!=o){var a=c[i],f=Zt;f===Zt&&(f=Ut(a)?a:gt(e[r+1])?[]:{})}g(c,i,f),c=c[i]}return t}function H(t){if(typeof t=="string")return t;if(An(t))return r(t,H)+"";if(Rt(t))return sn?sn.call(t):"";
|
|
19
|
+
var e=t+"";return"0"==e&&1/t==-te?"-0":e}function J(t,e){e=K(e,t);var n;if(2>e.length)n=t;else{n=e;var r=0,u=-1,o=-1,c=n.length;for(0>r&&(r=-r>c?0:c+r),u=u>c?c:u,0>u&&(u+=c),c=r>u?0:u-r>>>0,r>>>=0,u=Array(c);++o<c;)u[o]=n[o+r];n=k(t,u)}return t=n,null==t||delete t[Ot(zt(e))]}function K(t,e){return An(t)?t:vt(t,e)?[t]:gn(Tt(t))}function Q(t,e){if(e)return t.slice();var n=t.length,n=$e?$e(n):new t.constructor(n);return t.copy(n),n}function X(t){var e=new t.constructor(t.byteLength);return new Le(e).set(new Le(t)),
|
|
20
|
+
e}function Y(t,e){return new t.constructor(e?X(t.buffer):t.buffer,t.byteOffset,t.length)}function Z(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}function tt(t,e,n){var r=!n;n||(n={});for(var u=-1,o=e.length;++u<o;){var c=e[u],i=Zt;i===Zt&&(i=t[c]),r?m(n,c,i):g(n,c,i)}return n}function et(t,e){return tt(t,yn(t),e)}function nt(t,e){return tt(t,jn(t),e)}function rt(t){return G(function(e,n){var r,u=-1,o=n.length,c=1<o?n[o-1]:Zt,i=2<o?n[2]:Zt,c=3<t.length&&typeof c=="function"?(o--,
|
|
21
|
+
c):Zt;if(r=i){r=n[0];var f=n[1];if(Ut(i)){var a=typeof f;r=!!("number"==a?It(i)&>(f,i.length):"string"==a&&f in i)&&Ft(i[f],r)}else r=false}for(r&&(c=3>o?Zt:c,o=1),e=Object(e);++u<o;)(i=n[u])&&t(e,i,u,c);return e})}function ut(t){return Lt(t)?Zt:t}function ot(t,e,n,r,u,c){var i=1&n,f=t.length,a=e.length;if(f!=a&&!(i&&a>f))return false;if((a=c.get(t))&&c.get(e))return a==e;var a=-1,l=true,s=2&n?new y:Zt;for(c.set(t,e),c.set(e,t);++a<f;){var b=t[a],h=e[a];if(r)var p=i?r(h,b,a,e,t,c):r(b,h,a,t,e,c);if(p!==Zt){
|
|
22
|
+
if(p)continue;l=false;break}if(s){if(!o(e,function(t,e){if(!s.has(e)&&(b===t||u(b,t,n,r,c)))return s.push(e)})){l=false;break}}else if(b!==h&&!u(b,h,n,r,c)){l=false;break}}return c.delete(t),c.delete(e),l}function ct(t,e,n,r,u,o,c){switch(n){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)break;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":if(t.byteLength!=e.byteLength||!o(new Le(t),new Le(e)))break;return true;case"[object Boolean]":case"[object Date]":case"[object Number]":
|
|
23
|
+
return Ft(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var i=f;case"[object Set]":if(i||(i=l),t.size!=e.size&&!(1&r))break;return(n=c.get(t))?n==e:(r|=2,c.set(t,e),e=ot(i(t),i(e),r,u,o,c),c.delete(t),e);case"[object Symbol]":if(ln)return ln.call(t)==ln.call(e)}return false}function it(t){return dn(mt(t,Zt,kt),t+"")}function ft(t){return z(t,Nt,yn)}function at(t){return z(t,Gt,jn)}function lt(){var t=s.iteratee||Kt,t=t===Kt?L:t;
|
|
24
|
+
return arguments.length?t(arguments[0],arguments[1]):t}function st(t,e){var n=t.__data__,r=typeof e;return("string"==r||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==e:null===e)?n[typeof e=="string"?"string":"hash"]:n.map}function bt(t){for(var e=Nt(t),n=e.length;n--;){var r=e[n],u=t[r];e[n]=[r,u,u===u&&!Ut(u)]}return e}function ht(t,e){var n=null==t?Zt:t[e];return(!Ut(n)||Ie&&Ie in n?0:(Bt(n)?De:ce).test(St(n)))?n:Zt}function pt(t,e,n){e=K(e,t);for(var r=-1,u=e.length,o=false;++r<u;){var c=Ot(e[r]);
|
|
25
|
+
if(!(o=null!=t&&n(t,c)))break;t=t[c]}return o||++r!=u?o:(u=null==t?0:t.length,!!u&&Dt(u)&>(c,u)&&(An(t)||vn(t)))}function yt(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&Fe.call(t,"index")&&(n.index=t.index,n.input=t.input),n}function jt(t){return typeof t.constructor!="function"||At(t)?{}:bn(Re(t))}function _t(t,e,n){var r=t.constructor;switch(e){case"[object ArrayBuffer]":return X(t);case"[object Boolean]":case"[object Date]":return new r(+t);case"[object DataView]":
|
|
26
|
+
return e=n?X(t.buffer):t.buffer,new t.constructor(e,t.byteOffset,t.byteLength);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return Y(t,n);case"[object Map]":return new r;case"[object Number]":case"[object String]":return new r(t);case"[object RegExp]":return e=new t.constructor(t.source,oe.exec(t)),
|
|
27
|
+
e.lastIndex=t.lastIndex,e;case"[object Set]":return new r;case"[object Symbol]":return ln?Object(ln.call(t)):{}}}function dt(t){return An(t)||vn(t)||!!(We&&t&&t[We])}function gt(t,e){var n=typeof t;return e=null==e?9007199254740991:e,!!e&&("number"==n||"symbol"!=n&&ie.test(t))&&-1<t&&0==t%1&&t<e}function vt(t,e){if(An(t))return false;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!Rt(t))||(ne.test(t)||!ee.test(t)||null!=e&&t in Object(e))}function At(t){var e=t&&t.constructor;
|
|
28
|
+
return t===(typeof e=="function"&&e.prototype||ze)}function wt(t,e){return function(n){return null!=n&&(n[t]===e&&(e!==Zt||t in Object(n)))}}function mt(e,n,r){return n=Ke(n===Zt?e.length-1:n,0),function(){for(var u=arguments,o=-1,c=Ke(u.length-n,0),i=Array(c);++o<c;)i[o]=u[n+o];for(o=-1,c=Array(n+1);++o<n;)c[o]=u[o];return c[n]=r(i),t(e,this,c)}}function Ot(t){if(typeof t=="string"||Rt(t))return t;var e=t+"";return"0"==e&&1/t==-te?"-0":e}function St(t){if(null!=t){try{return Ee.call(t)}catch(t){}
|
|
29
|
+
return t+""}return""}function kt(t){return(null==t?0:t.length)?S(t,1):[]}function zt(t){var e=null==t?0:t.length;return e?t[e-1]:Zt}function xt(t,e){function n(){var r=arguments,u=e?e.apply(this,r):r[0],o=n.cache;return o.has(u)?o.get(u):(r=t.apply(this,r),n.cache=o.set(u,r)||o,r)}if(typeof t!="function"||null!=e&&typeof e!="function")throw new TypeError("Expected a function");return n.cache=new(xt.Cache||p),n}function Et(t){if(typeof t!="function")throw new TypeError("Expected a function");return function(){
|
|
30
|
+
var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}function Ft(t,e){return t===e||t!==t&&e!==e}function It(t){return null!=t&&Dt(t.length)&&!Bt(t)}function Mt(t){return Pt(t)&&It(t)}function Bt(t){return!!Ut(t)&&(t=x(t),"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t)}function Dt(t){return typeof t=="number"&&-1<t&&0==t%1&&9007199254740991>=t;
|
|
31
|
+
}function Ut(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Pt(t){return null!=t&&typeof t=="object"}function Lt(t){return!(!Pt(t)||"[object Object]"!=x(t))&&(t=Re(t),null===t||(t=Fe.call(t,"constructor")&&t.constructor,typeof t=="function"&&t instanceof t&&Ee.call(t)==Be))}function $t(t){return typeof t=="string"||!An(t)&&Pt(t)&&"[object String]"==x(t)}function Rt(t){return typeof t=="symbol"||Pt(t)&&"[object Symbol]"==x(t)}function Ct(t){return tt(t,Gt(t))}function Tt(t){
|
|
32
|
+
return null==t?"":H(t)}function Vt(t,e,n){return t=null==t?Zt:k(t,e),t===Zt?n:t}function Wt(t,e){return null!=t&&pt(t,e,F)}function Nt(t){return It(t)?_(t):$(t)}function Gt(t){if(It(t))t=_(t,true);else if(Ut(t)){var e,n=At(t),r=[];for(e in t)("constructor"!=e||!n&&Fe.call(t,e))&&r.push(e);t=r}else{if(e=[],null!=t)for(n in Object(t))e.push(n);t=e}return t}function qt(t,e){if(null==t)return{};var n=r(at(t),function(t){return[t]});return e=lt(e),W(t,n,function(t,n){return e(t,n[0])})}function Ht(t){return function(){
|
|
33
|
+
return t}}function Jt(t){return t}function Kt(t){return L(typeof t=="function"?t:O(t,1))}function Qt(t){return vt(t)?c(Ot(t)):N(t)}function Xt(){return[]}function Yt(){return false}var Zt,te=1/0,ee=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ne=/^\w*$/,re=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ue=/\\(\\)?/g,oe=/\w*$/,ce=/^\[object .+?Constructor\]$/,ie=/^(?:0|[1-9]\d*)$/,fe="[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?(?:\\u200d(?:[^\\ud800-\\udfff]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?)*",ae="(?:[^\\ud800-\\udfff][\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]?|[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff]|[\\ud800-\\udfff])",le=RegExp("\\ud83c[\\udffb-\\udfff](?=\\ud83c[\\udffb-\\udfff])|"+ae+fe,"g"),se=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]"),be={};
|
|
34
|
+
be["[object Float32Array]"]=be["[object Float64Array]"]=be["[object Int8Array]"]=be["[object Int16Array]"]=be["[object Int32Array]"]=be["[object Uint8Array]"]=be["[object Uint8ClampedArray]"]=be["[object Uint16Array]"]=be["[object Uint32Array]"]=true,be["[object Arguments]"]=be["[object Array]"]=be["[object ArrayBuffer]"]=be["[object Boolean]"]=be["[object DataView]"]=be["[object Date]"]=be["[object Error]"]=be["[object Function]"]=be["[object Map]"]=be["[object Number]"]=be["[object Object]"]=be["[object RegExp]"]=be["[object Set]"]=be["[object String]"]=be["[object WeakMap]"]=false;
|
|
35
|
+
var he={};he["[object Arguments]"]=he["[object Array]"]=he["[object ArrayBuffer]"]=he["[object DataView]"]=he["[object Boolean]"]=he["[object Date]"]=he["[object Float32Array]"]=he["[object Float64Array]"]=he["[object Int8Array]"]=he["[object Int16Array]"]=he["[object Int32Array]"]=he["[object Map]"]=he["[object Number]"]=he["[object Object]"]=he["[object RegExp]"]=he["[object Set]"]=he["[object String]"]=he["[object Symbol]"]=he["[object Uint8Array]"]=he["[object Uint8ClampedArray]"]=he["[object Uint16Array]"]=he["[object Uint32Array]"]=true,
|
|
36
|
+
he["[object Error]"]=he["[object Function]"]=he["[object WeakMap]"]=false;var pe,ye=typeof global=="object"&&global&&global.Object===Object&&global,je=typeof self=="object"&&self&&self.Object===Object&&self,_e=ye||je||Function("return this")(),de=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ge=de&&typeof module=="object"&&module&&!module.nodeType&&module,ve=ge&&ge.exports===de,Ae=ve&&ye.process;t:{try{pe=Ae&&Ae.binding&&Ae.binding("util");break t}catch(t){}pe=void 0}var we=pe&&pe.isMap,me=pe&&pe.isSet,Oe=pe&&pe.isTypedArray,Se=c("length"),ke=Array.prototype,ze=Object.prototype,xe=_e["__core-js_shared__"],Ee=Function.prototype.toString,Fe=ze.hasOwnProperty,Ie=function(){
|
|
37
|
+
var t=/[^.]+$/.exec(xe&&xe.keys&&xe.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),Me=ze.toString,Be=Ee.call(Object),De=RegExp("^"+Ee.call(Fe).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ue=ve?_e.Buffer:Zt,Pe=_e.Symbol,Le=_e.Uint8Array,$e=Ue?Ue.a:Zt,Re=a(Object.getPrototypeOf),Ce=Object.create,Te=ze.propertyIsEnumerable,Ve=ke.splice,We=Pe?Pe.isConcatSpreadable:Zt,Ne=Pe?Pe.toStringTag:Zt,Ge=function(){try{var t=ht(Object,"defineProperty");
|
|
38
|
+
return t({},"",{}),t}catch(t){}}(),qe=Object.getOwnPropertySymbols,He=Ue?Ue.isBuffer:Zt,Je=a(Object.keys),Ke=Math.max,Qe=Date.now,Xe=ht(_e,"DataView"),Ye=ht(_e,"Map"),Ze=ht(_e,"Promise"),tn=ht(_e,"Set"),en=ht(_e,"WeakMap"),nn=ht(Object,"create"),rn=St(Xe),un=St(Ye),on=St(Ze),cn=St(tn),fn=St(en),an=Pe?Pe.prototype:Zt,ln=an?an.valueOf:Zt,sn=an?an.toString:Zt,bn=function(){function t(){}return function(e){return Ut(e)?Ce?Ce(e):(t.prototype=e,e=new t,t.prototype=Zt,e):{}}}();b.prototype.clear=function(){
|
|
39
|
+
this.__data__=nn?nn(null):{},this.size=0},b.prototype.delete=function(t){return t=this.has(t)&&delete this.__data__[t],this.size-=t?1:0,t},b.prototype.get=function(t){var e=this.__data__;return nn?(t=e[t],"__lodash_hash_undefined__"===t?Zt:t):Fe.call(e,t)?e[t]:Zt},b.prototype.has=function(t){var e=this.__data__;return nn?e[t]!==Zt:Fe.call(e,t)},b.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=nn&&e===Zt?"__lodash_hash_undefined__":e,this},h.prototype.clear=function(){
|
|
40
|
+
this.__data__=[],this.size=0},h.prototype.delete=function(t){var e=this.__data__;return t=v(e,t),!(0>t)&&(t==e.length-1?e.pop():Ve.call(e,t,1),--this.size,true)},h.prototype.get=function(t){var e=this.__data__;return t=v(e,t),0>t?Zt:e[t][1]},h.prototype.has=function(t){return-1<v(this.__data__,t)},h.prototype.set=function(t,e){var n=this.__data__,r=v(n,t);return 0>r?(++this.size,n.push([t,e])):n[r][1]=e,this},p.prototype.clear=function(){this.size=0,this.__data__={hash:new b,map:new(Ye||h),string:new b
|
|
41
|
+
}},p.prototype.delete=function(t){return t=st(this,t).delete(t),this.size-=t?1:0,t},p.prototype.get=function(t){return st(this,t).get(t)},p.prototype.has=function(t){return st(this,t).has(t)},p.prototype.set=function(t,e){var n=st(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},y.prototype.add=y.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},y.prototype.has=function(t){return this.__data__.has(t)},j.prototype.clear=function(){this.__data__=new h,
|
|
42
|
+
this.size=0},j.prototype.delete=function(t){var e=this.__data__;return t=e.delete(t),this.size=e.size,t},j.prototype.get=function(t){return this.__data__.get(t)},j.prototype.has=function(t){return this.__data__.has(t)},j.prototype.set=function(t,e){var n=this.__data__;if(n instanceof h){var r=n.__data__;if(!Ye||199>r.length)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new p(r)}return n.set(t,e),this.size=n.size,this};var hn=function(t){return function(e,n,r){var u=-1,o=Object(e);r=r(e);
|
|
43
|
+
for(var c=r.length;c--;){var i=r[t?c:++u];if(false===n(o[i],i,o))break}return e}}(),pn=Ge?function(t,e){return Ge(t,"toString",{configurable:true,enumerable:false,value:Ht(e),writable:true})}:Jt,yn=qe?function(t){return null==t?[]:(t=Object(t),n(qe(t),function(e){return Te.call(t,e)}))}:Xt,jn=qe?function(t){for(var e=[];t;)u(e,yn(t)),t=Re(t);return e}:Xt,_n=x;(Xe&&"[object DataView]"!=_n(new Xe(new ArrayBuffer(1)))||Ye&&"[object Map]"!=_n(new Ye)||Ze&&"[object Promise]"!=_n(Ze.resolve())||tn&&"[object Set]"!=_n(new tn)||en&&"[object WeakMap]"!=_n(new en))&&(_n=function(t){
|
|
44
|
+
var e=x(t);if(t=(t="[object Object]"==e?t.constructor:Zt)?St(t):"")switch(t){case rn:return"[object DataView]";case un:return"[object Map]";case on:return"[object Promise]";case cn:return"[object Set]";case fn:return"[object WeakMap]"}return e});var dn=function(t){var e=0,n=0;return function(){var r=Qe(),u=16-(r-n);if(n=r,0<u){if(800<=++e)return arguments[0]}else e=0;return t.apply(Zt,arguments)}}(pn),gn=function(t){t=xt(t,function(t){return 500===e.size&&e.clear(),t});var e=t.cache;return t}(function(t){
|
|
45
|
+
var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(re,function(t,n,r,u){e.push(r?u.replace(ue,"$1"):n||t)}),e});xt.Cache=p;var vn=I(function(){return arguments}())?I:function(t){return Pt(t)&&Fe.call(t,"callee")&&!Te.call(t,"callee")},An=Array.isArray,wn=He||Yt,mn=we?i(we):B,On=me?i(me):U,Sn=Oe?i(Oe):P,kn=rt(function(t,e,n){T(t,e,n)}),zn=rt(function(t,e,n,r){T(t,e,n,r)}),xn=it(function(t,e){var n={};if(null==t)return n;var u=false;e=r(e,function(e){return e=K(e,t),u||(u=1<e.length),e}),tt(t,at(t),n),
|
|
46
|
+
u&&(n=O(n,7,ut));for(var o=e.length;o--;)J(n,e[o]);return n}),En=it(function(t,e){return null==t?{}:V(t,e)});s.constant=Ht,s.flatten=kt,s.iteratee=Kt,s.keys=Nt,s.keysIn=Gt,s.memoize=xt,s.merge=kn,s.mergeWith=zn,s.negate=Et,s.omit=xn,s.omitBy=function(t,e){return qt(t,Et(lt(e)))},s.pick=En,s.pickBy=qt,s.property=Qt,s.set=function(t,e,n){return null==t?t:q(t,e,n)},s.toPath=function(t){return An(t)?r(t,Ot):Rt(t)?[t]:Z(gn(Tt(t)))},s.toPlainObject=Ct,s.unset=function(t,e){return null==t||J(t,e)},s.clone=function(t){
|
|
47
|
+
return O(t,4)},s.cloneDeep=function(t){return O(t,5)},s.cloneDeepWith=function(t,e){return e=typeof e=="function"?e:Zt,O(t,5,e)},s.cloneWith=function(t,e){return e=typeof e=="function"?e:Zt,O(t,4,e)},s.eq=Ft,s.get=Vt,s.has=function(t,e){return null!=t&&pt(t,e,E)},s.hasIn=Wt,s.identity=Jt,s.isArguments=vn,s.isArray=An,s.isArrayLike=It,s.isArrayLikeObject=Mt,s.isBuffer=wn,s.isFunction=Bt,s.isLength=Dt,s.isMap=mn,s.isObject=Ut,s.isObjectLike=Pt,s.isPlainObject=Lt,s.isSet=On,s.isString=$t,s.isSymbol=Rt,
|
|
48
|
+
s.isTypedArray=Sn,s.last=zt,s.stubArray=Xt,s.stubFalse=Yt,s.size=function(t){if(null==t)return 0;if(It(t)){if($t(t))if(se.test(t)){for(var e=le.lastIndex=0;le.test(t);)++e;t=e}else t=Se(t);else t=t.length;return t}return e=_n(t),"[object Map]"==e||"[object Set]"==e?t.size:$(t).length},s.toString=Tt,s.VERSION="4.17.5",typeof define=="function"&&typeof define.amd=="object"&&define.amd?(_e._=s, define(function(){return s})):ge?((ge.exports=s)._=s,de._=s):_e._=s}).call(this);
|
package/build/modules/base64.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Exception, InvalidArgumentsException, RuntimeException, createError } from "@poppinss/exception";
|
|
2
2
|
export { Exception, InvalidArgumentsException, RuntimeException, createError };
|
package/build/modules/fs/main.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { n as
|
|
2
|
-
import { n as isScriptFile, r as naturalSort, t as require_main } from "../../main-CdreHl1_.js";
|
|
1
|
+
import { n as naturalSort, t as isScriptFile } from "../../is_script_file-CbSEfxE_.js";
|
|
3
2
|
import { extname, join, relative, sep } from "node:path";
|
|
4
3
|
import string from "@poppinss/string";
|
|
4
|
+
import lodash from "@poppinss/utils/lodash";
|
|
5
5
|
import { readdir, stat } from "node:fs/promises";
|
|
6
6
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
7
7
|
async function fsReadAll(location, options) {
|
|
@@ -36,13 +36,12 @@ async function fsReadAll(location, options) {
|
|
|
36
36
|
if (normalizedOptions.filter) return files.filter(normalizedOptions.filter).sort(normalizedOptions.sort);
|
|
37
37
|
return files.sort(normalizedOptions.sort);
|
|
38
38
|
}
|
|
39
|
-
var import_main = /* @__PURE__ */ __toESM(require_main());
|
|
40
39
|
async function importFile(basePath, fileURL, values, options) {
|
|
41
40
|
const filePath = fileURLToPath(fileURL);
|
|
42
41
|
const fileExtension = extname(filePath);
|
|
43
|
-
const collectionKey = relative(basePath, filePath).replace(
|
|
42
|
+
const collectionKey = relative(basePath, filePath).replace(new RegExp(`${fileExtension}$`), "").split(sep);
|
|
44
43
|
const exportedValue = fileExtension === ".json" ? await import(fileURL, { with: { type: "json" } }) : await import(fileURL);
|
|
45
|
-
|
|
44
|
+
lodash.set(values, options.transformKeys ? options.transformKeys(collectionKey) : collectionKey, exportedValue.default ? exportedValue.default : { ...exportedValue });
|
|
46
45
|
}
|
|
47
46
|
async function fsImportAll(location, options) {
|
|
48
47
|
options = options || {};
|
|
@@ -1,4 +1,25 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "node:module";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
|
+
key = keys[i];
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
13
|
+
get: ((k) => from[k]).bind(null, key),
|
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
20
|
+
value: mod,
|
|
21
|
+
enumerable: true
|
|
22
|
+
}) : target, mod));
|
|
2
23
|
var import_secure_json_parse = (/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3
24
|
const hasBuffer = typeof Buffer !== "undefined";
|
|
4
25
|
const suspectProtoRx = /"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/;
|
|
@@ -173,9 +194,9 @@ var import_safe_stable_stringify = /* @__PURE__ */ __toESM((/* @__PURE__ */ __co
|
|
|
173
194
|
if (hasOwnProperty.call(options, "strict")) {
|
|
174
195
|
const value = options.strict;
|
|
175
196
|
if (typeof value !== "boolean") throw new TypeError("The \"strict\" argument must be of type boolean");
|
|
176
|
-
if (value) return (value
|
|
177
|
-
let message = `Object can not safely be stringified. Received type ${typeof value
|
|
178
|
-
if (typeof value
|
|
197
|
+
if (value) return (value) => {
|
|
198
|
+
let message = `Object can not safely be stringified. Received type ${typeof value}`;
|
|
199
|
+
if (typeof value !== "function") message += ` (${value.toString()})`;
|
|
179
200
|
throw new Error(message);
|
|
180
201
|
};
|
|
181
202
|
}
|
|
@@ -217,8 +238,8 @@ var import_safe_stable_stringify = /* @__PURE__ */ __toESM((/* @__PURE__ */ __co
|
|
|
217
238
|
const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
|
|
218
239
|
let i = 0;
|
|
219
240
|
for (; i < maximumValuesToStringify - 1; i++) {
|
|
220
|
-
const tmp
|
|
221
|
-
res += tmp
|
|
241
|
+
const tmp = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation);
|
|
242
|
+
res += tmp !== void 0 ? tmp : "null";
|
|
222
243
|
res += join;
|
|
223
244
|
}
|
|
224
245
|
const tmp = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation);
|
|
@@ -246,10 +267,10 @@ var import_safe_stable_stringify = /* @__PURE__ */ __toESM((/* @__PURE__ */ __co
|
|
|
246
267
|
if (deterministic && !isTypedArrayWithEntries(value)) keys = sort(keys, comparator);
|
|
247
268
|
stack.push(value);
|
|
248
269
|
for (let i = 0; i < maximumPropertiesToStringify; i++) {
|
|
249
|
-
const key
|
|
250
|
-
const tmp = stringifyFnReplacer(key
|
|
270
|
+
const key = keys[i];
|
|
271
|
+
const tmp = stringifyFnReplacer(key, value, stack, replacer, spacer, indentation);
|
|
251
272
|
if (tmp !== void 0) {
|
|
252
|
-
res += `${separator}${strEscape(key
|
|
273
|
+
res += `${separator}${strEscape(key)}:${whitespace}${tmp}`;
|
|
253
274
|
separator = join;
|
|
254
275
|
}
|
|
255
276
|
}
|
|
@@ -291,8 +312,8 @@ var import_safe_stable_stringify = /* @__PURE__ */ __toESM((/* @__PURE__ */ __co
|
|
|
291
312
|
const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
|
|
292
313
|
let i = 0;
|
|
293
314
|
for (; i < maximumValuesToStringify - 1; i++) {
|
|
294
|
-
const tmp
|
|
295
|
-
res += tmp
|
|
315
|
+
const tmp = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation);
|
|
316
|
+
res += tmp !== void 0 ? tmp : "null";
|
|
296
317
|
res += join;
|
|
297
318
|
}
|
|
298
319
|
const tmp = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation);
|
|
@@ -313,10 +334,10 @@ var import_safe_stable_stringify = /* @__PURE__ */ __toESM((/* @__PURE__ */ __co
|
|
|
313
334
|
whitespace = " ";
|
|
314
335
|
}
|
|
315
336
|
let separator = "";
|
|
316
|
-
for (const key
|
|
317
|
-
const tmp = stringifyArrayReplacer(key
|
|
337
|
+
for (const key of replacer) {
|
|
338
|
+
const tmp = stringifyArrayReplacer(key, value[key], stack, replacer, spacer, indentation);
|
|
318
339
|
if (tmp !== void 0) {
|
|
319
|
-
res += `${separator}${strEscape(key
|
|
340
|
+
res += `${separator}${strEscape(key)}:${whitespace}${tmp}`;
|
|
320
341
|
separator = join;
|
|
321
342
|
}
|
|
322
343
|
}
|
|
@@ -348,24 +369,24 @@ var import_safe_stable_stringify = /* @__PURE__ */ __toESM((/* @__PURE__ */ __co
|
|
|
348
369
|
if (maximumDepth < stack.length + 1) return "\"[Array]\"";
|
|
349
370
|
stack.push(value);
|
|
350
371
|
indentation += spacer;
|
|
351
|
-
let res
|
|
352
|
-
const join
|
|
372
|
+
let res = `\n${indentation}`;
|
|
373
|
+
const join = `,\n${indentation}`;
|
|
353
374
|
const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
|
|
354
375
|
let i = 0;
|
|
355
376
|
for (; i < maximumValuesToStringify - 1; i++) {
|
|
356
|
-
const tmp
|
|
357
|
-
res
|
|
358
|
-
res
|
|
377
|
+
const tmp = stringifyIndent(String(i), value[i], stack, spacer, indentation);
|
|
378
|
+
res += tmp !== void 0 ? tmp : "null";
|
|
379
|
+
res += join;
|
|
359
380
|
}
|
|
360
381
|
const tmp = stringifyIndent(String(i), value[i], stack, spacer, indentation);
|
|
361
|
-
res
|
|
382
|
+
res += tmp !== void 0 ? tmp : "null";
|
|
362
383
|
if (value.length - 1 > maximumBreadth) {
|
|
363
384
|
const removedKeys = value.length - maximumBreadth - 1;
|
|
364
|
-
res
|
|
385
|
+
res += `${join}"... ${getItemCount(removedKeys)} not stringified"`;
|
|
365
386
|
}
|
|
366
|
-
res
|
|
387
|
+
res += `\n${originalIndentation}`;
|
|
367
388
|
stack.pop();
|
|
368
|
-
return `[${res
|
|
389
|
+
return `[${res}]`;
|
|
369
390
|
}
|
|
370
391
|
let keys = Object.keys(value);
|
|
371
392
|
const keyLength = keys.length;
|
|
@@ -385,10 +406,10 @@ var import_safe_stable_stringify = /* @__PURE__ */ __toESM((/* @__PURE__ */ __co
|
|
|
385
406
|
if (deterministic) keys = sort(keys, comparator);
|
|
386
407
|
stack.push(value);
|
|
387
408
|
for (let i = 0; i < maximumPropertiesToStringify; i++) {
|
|
388
|
-
const key
|
|
389
|
-
const tmp = stringifyIndent(key
|
|
409
|
+
const key = keys[i];
|
|
410
|
+
const tmp = stringifyIndent(key, value[key], stack, spacer, indentation);
|
|
390
411
|
if (tmp !== void 0) {
|
|
391
|
-
res += `${separator}${strEscape(key
|
|
412
|
+
res += `${separator}${strEscape(key)}: ${tmp}`;
|
|
392
413
|
separator = join;
|
|
393
414
|
}
|
|
394
415
|
}
|
|
@@ -428,8 +449,8 @@ var import_safe_stable_stringify = /* @__PURE__ */ __toESM((/* @__PURE__ */ __co
|
|
|
428
449
|
const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
|
|
429
450
|
let i = 0;
|
|
430
451
|
for (; i < maximumValuesToStringify - 1; i++) {
|
|
431
|
-
const tmp
|
|
432
|
-
res += tmp
|
|
452
|
+
const tmp = stringifySimple(String(i), value[i], stack);
|
|
453
|
+
res += tmp !== void 0 ? tmp : "null";
|
|
433
454
|
res += ",";
|
|
434
455
|
}
|
|
435
456
|
const tmp = stringifySimple(String(i), value[i], stack);
|
|
@@ -456,10 +477,10 @@ var import_safe_stable_stringify = /* @__PURE__ */ __toESM((/* @__PURE__ */ __co
|
|
|
456
477
|
if (deterministic) keys = sort(keys, comparator);
|
|
457
478
|
stack.push(value);
|
|
458
479
|
for (let i = 0; i < maximumPropertiesToStringify; i++) {
|
|
459
|
-
const key
|
|
460
|
-
const tmp = stringifySimple(key
|
|
480
|
+
const key = keys[i];
|
|
481
|
+
const tmp = stringifySimple(key, value[key], stack);
|
|
461
482
|
if (tmp !== void 0) {
|
|
462
|
-
res += `${separator}${strEscape(key
|
|
483
|
+
res += `${separator}${strEscape(key)}:${tmp}`;
|
|
463
484
|
separator = ",";
|
|
464
485
|
}
|
|
465
486
|
}
|
|
@@ -477,7 +498,7 @@ var import_safe_stable_stringify = /* @__PURE__ */ __toESM((/* @__PURE__ */ __co
|
|
|
477
498
|
default: return fail ? fail(value) : void 0;
|
|
478
499
|
}
|
|
479
500
|
}
|
|
480
|
-
function stringify
|
|
501
|
+
function stringify(value, replacer, space) {
|
|
481
502
|
if (arguments.length > 1) {
|
|
482
503
|
let spacer = "";
|
|
483
504
|
if (typeof space === "number") spacer = " ".repeat(Math.min(space, 10));
|
|
@@ -490,7 +511,7 @@ var import_safe_stable_stringify = /* @__PURE__ */ __toESM((/* @__PURE__ */ __co
|
|
|
490
511
|
}
|
|
491
512
|
return stringifySimple("", value, []);
|
|
492
513
|
}
|
|
493
|
-
return stringify
|
|
514
|
+
return stringify;
|
|
494
515
|
}
|
|
495
516
|
})))(), 1);
|
|
496
517
|
const configure = import_safe_stable_stringify.configure;
|