utilitas 1995.2.85 → 1995.2.86
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 +1 -0
- package/dist/utilitas.lite.mjs +1 -1
- package/dist/utilitas.lite.mjs.map +1 -1
- package/lib/manifest.mjs +1 -1
- package/lib/utilitas.mjs +19 -0
- package/package.json +1 -1
package/lib/manifest.mjs
CHANGED
package/lib/utilitas.mjs
CHANGED
|
@@ -114,6 +114,24 @@ const deepCleanBigInt = (any, func = String) => {
|
|
|
114
114
|
return resp;
|
|
115
115
|
};
|
|
116
116
|
|
|
117
|
+
const assembleBuffer = any => {
|
|
118
|
+
let resp = any;
|
|
119
|
+
switch (getType(any)) {
|
|
120
|
+
case 'Object':
|
|
121
|
+
if (any.type === 'Buffer' && Array.isArray(any.data)) {
|
|
122
|
+
resp = Buffer.from(any.data);
|
|
123
|
+
} else {
|
|
124
|
+
resp = {};
|
|
125
|
+
for (let i in any) { resp[i] = assembleBuffer(any[i]); }
|
|
126
|
+
}
|
|
127
|
+
break;
|
|
128
|
+
case 'Array':
|
|
129
|
+
resp = [];
|
|
130
|
+
any.map(x => { resp.push(assembleBuffer(x)); });
|
|
131
|
+
}
|
|
132
|
+
return resp;
|
|
133
|
+
};
|
|
134
|
+
|
|
117
135
|
const mapKeys = (any, map, strict, path) => {
|
|
118
136
|
let [resp, func] = [any, map];
|
|
119
137
|
if (Object.isObject(map)) { func = (key) => { return map[key]; } }
|
|
@@ -791,6 +809,7 @@ export {
|
|
|
791
809
|
analyzeModule,
|
|
792
810
|
arrayEqual,
|
|
793
811
|
assembleApiUrl,
|
|
812
|
+
assembleBuffer,
|
|
794
813
|
assembleUrl,
|
|
795
814
|
assertArray,
|
|
796
815
|
assertBuffer,
|