@ztimson/utils 0.27.7 → 0.27.8
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/dist/index.cjs +4 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +4 -0
- package/dist/index.mjs.map +1 -1
- package/dist/objects.d.ts +7 -0
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -267,6 +267,9 @@ function mixin(target, constructors) {
|
|
|
267
267
|
});
|
|
268
268
|
});
|
|
269
269
|
}
|
|
270
|
+
function objectMap(obj, fn2) {
|
|
271
|
+
return Object.entries(obj).map(([key, value]) => [key, fn2(key, value)]).reduce((acc, [key, value]) => ({ ...acc, [key]: value }), {});
|
|
272
|
+
}
|
|
270
273
|
function JSONAttemptParse(json) {
|
|
271
274
|
try {
|
|
272
275
|
return JSON.parse(json);
|
|
@@ -2531,6 +2534,7 @@ export {
|
|
|
2531
2534
|
mixin,
|
|
2532
2535
|
month,
|
|
2533
2536
|
numSuffix,
|
|
2537
|
+
objectMap,
|
|
2534
2538
|
pad,
|
|
2535
2539
|
parseUrl,
|
|
2536
2540
|
pascalCase,
|