@daaler/jutils 0.3.5 → 0.3.6
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/browser.d.ts +2 -1
- package/dist/browser.js +2 -1
- package/dist/browser.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/recursive-merge.d.ts +2 -0
- package/dist/recursive-merge.js +18 -0
- package/dist/recursive-merge.js.map +1 -0
- package/package.json +3 -2
package/dist/browser.d.ts
CHANGED
|
@@ -18,5 +18,6 @@ import Exception from "./exception.js";
|
|
|
18
18
|
import matchExceptions from "./match-exceptions.js";
|
|
19
19
|
import { registerException, getException, getExceptionNoError } from "./exceptions.js";
|
|
20
20
|
import NotImplementedError, { notImplemented } from "./not-implemented.js";
|
|
21
|
+
import recursiveMerge from "./recursive-merge.js";
|
|
21
22
|
export { interrupt, wait, timedifference, timefromnow, timefromx, zeroDate as zeroTime, // legacy naming
|
|
22
|
-
zeroDate, maxDate, JSchema, UUID, Integer, jdebug, WeakValueCache, IdBasedLRUCache, IdBasedCache, Notifications, noop, noopn, pass, Exception, matchExceptions, registerException, getException, getExceptionNoError, NotImplementedError, notImplemented, };
|
|
23
|
+
zeroDate, maxDate, JSchema, UUID, Integer, jdebug, WeakValueCache, IdBasedLRUCache, IdBasedCache, Notifications, noop, noopn, pass, Exception, matchExceptions, registerException, getException, getExceptionNoError, NotImplementedError, notImplemented, recursiveMerge, };
|
package/dist/browser.js
CHANGED
|
@@ -18,6 +18,7 @@ import Exception from "./exception.js";
|
|
|
18
18
|
import matchExceptions from "./match-exceptions.js";
|
|
19
19
|
import { registerException, getException, getExceptionNoError } from "./exceptions.js";
|
|
20
20
|
import NotImplementedError, { notImplemented } from "./not-implemented.js";
|
|
21
|
+
import recursiveMerge from "./recursive-merge.js";
|
|
21
22
|
export { interrupt, wait, timedifference, timefromnow, timefromx, zeroDate as zeroTime, // legacy naming
|
|
22
|
-
zeroDate, maxDate, JSchema, UUID, Integer, jdebug, WeakValueCache, IdBasedLRUCache, IdBasedCache, Notifications, noop, noopn, pass, Exception, matchExceptions, registerException, getException, getExceptionNoError, NotImplementedError, notImplemented, };
|
|
23
|
+
zeroDate, maxDate, JSchema, UUID, Integer, jdebug, WeakValueCache, IdBasedLRUCache, IdBasedCache, Notifications, noop, noopn, pass, Exception, matchExceptions, registerException, getException, getExceptionNoError, NotImplementedError, notImplemented, recursiveMerge, };
|
|
23
24
|
//# sourceMappingURL=browser.js.map
|
package/dist/browser.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.js","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,cAAc,MAAM,qBAAqB,CAAC;AACjD,OAAO,WAAW,MAAM,kBAAkB,CAAC;AAC3C,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,OAAO,MAAM,eAAe,CAAC;AACpC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,cAAc,MAAM,uBAAuB,CAAC;AACnD,OAAO,eAAe,MAAM,yBAAyB,CAAC;AACtD,OAAO,YAAY,MAAM,qBAAqB,CAAC;AAC/C,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAC,KAAK,EAAC,IAAI,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,eAAe,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAC,YAAY,EAAC,mBAAmB,EAAE,MAAM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,EACN,cAAc,EACd,eAAe,EACf,YAAY,EACZ,aAAa,EACb,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,SAAS,EACT,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,cAAc,EACd,cAAc,GACd,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -19,5 +19,6 @@ import matchExceptions from "./match-exceptions.js";
|
|
|
19
19
|
import { registerException, getException, getExceptionNoError } from "./exceptions.js";
|
|
20
20
|
import NotImplementedError, { notImplemented } from "./not-implemented.js";
|
|
21
21
|
import randomInteger from "./randomInteger.js";
|
|
22
|
+
import recursiveMerge from "./recursive-merge.js";
|
|
22
23
|
export { interrupt, wait, timedifference, timefromnow, timefromx, zeroDate as zeroTime, // legacy naming
|
|
23
|
-
zeroDate, maxDate, JSchema, UUID, Integer, jdebug, WeakValueCache, IdBasedLRUCache, IdBasedCache, Notifications, noop, noopn, pass, Exception, matchExceptions, registerException, getException, getExceptionNoError, NotImplementedError, notImplemented, randomInteger, };
|
|
24
|
+
zeroDate, maxDate, JSchema, UUID, Integer, jdebug, WeakValueCache, IdBasedLRUCache, IdBasedCache, Notifications, noop, noopn, pass, Exception, matchExceptions, registerException, getException, getExceptionNoError, NotImplementedError, notImplemented, randomInteger, recursiveMerge, };
|
package/dist/index.js
CHANGED
|
@@ -19,6 +19,7 @@ import matchExceptions from "./match-exceptions.js";
|
|
|
19
19
|
import { registerException, getException, getExceptionNoError } from "./exceptions.js";
|
|
20
20
|
import NotImplementedError, { notImplemented } from "./not-implemented.js";
|
|
21
21
|
import randomInteger from "./randomInteger.js";
|
|
22
|
+
import recursiveMerge from "./recursive-merge.js";
|
|
22
23
|
export { interrupt, wait, timedifference, timefromnow, timefromx, zeroDate as zeroTime, // legacy naming
|
|
23
|
-
zeroDate, maxDate, JSchema, UUID, Integer, jdebug, WeakValueCache, IdBasedLRUCache, IdBasedCache, Notifications, noop, noopn, pass, Exception, matchExceptions, registerException, getException, getExceptionNoError, NotImplementedError, notImplemented, randomInteger, };
|
|
24
|
+
zeroDate, maxDate, JSchema, UUID, Integer, jdebug, WeakValueCache, IdBasedLRUCache, IdBasedCache, Notifications, noop, noopn, pass, Exception, matchExceptions, registerException, getException, getExceptionNoError, NotImplementedError, notImplemented, randomInteger, recursiveMerge, };
|
|
24
25
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,cAAc,MAAM,qBAAqB,CAAC;AACjD,OAAO,WAAW,MAAM,kBAAkB,CAAC;AAC3C,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,OAAO,MAAM,eAAe,CAAC;AACpC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,cAAc,MAAM,uBAAuB,CAAC;AACnD,OAAO,eAAe,MAAM,yBAAyB,CAAC;AACtD,OAAO,YAAY,MAAM,qBAAqB,CAAC;AAC/C,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAC,KAAK,EAAC,IAAI,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,eAAe,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAC,YAAY,EAAC,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACrF,OAAO,mBAAmB,EAAC,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAO,aAAa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,EACf,YAAY,EACZ,aAAa,EACb,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,SAAS,EACT,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,cAAc,EACd,aAAa,EACb,cAAc,GACd,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const recursiveMerge = (targetObject, ...sourceObjects) => {
|
|
2
|
+
for (const sourceObject of sourceObjects) {
|
|
3
|
+
for (const [key, item] of Object.entries(sourceObject)) {
|
|
4
|
+
if (typeof item === "object") {
|
|
5
|
+
if (targetObject[key] === undefined) {
|
|
6
|
+
targetObject[key] = {};
|
|
7
|
+
}
|
|
8
|
+
recursiveMerge(targetObject[key], item);
|
|
9
|
+
}
|
|
10
|
+
else {
|
|
11
|
+
targetObject[key] = item;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
return targetObject;
|
|
16
|
+
};
|
|
17
|
+
export default recursiveMerge;
|
|
18
|
+
//# sourceMappingURL=recursive-merge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recursive-merge.js","sourceRoot":"","sources":["../src/recursive-merge.ts"],"names":[],"mappings":"AACA,MAAM,cAAc,GAAG,CAAC,YAAmB,EAAC,GAAG,aAAsB,EAAE,EAAE;IACxE,KAAI,MAAM,YAAY,IAAI,aAAa,EAAE,CAAC;QACzC,KAAI,MAAM,CAAE,GAAG,EAAC,IAAI,CAAE,IAAI,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC;YACxD,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;gBAC9B,IAAI,YAAY,CAAC,GAAG,CAAC,KAAK,SAAS,EAAE,CAAC;oBACrC,YAAY,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;gBACxB,CAAC;gBACD,cAAc,CAAC,YAAY,CAAC,GAAG,CAAC,EAAC,IAAI,CAAC,CAAC;YACxC,CAAC;iBAAM,CAAC;gBACP,YAAY,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;YAC1B,CAAC;QACF,CAAC;IACF,CAAC;IACD,OAAO,YAAY,CAAC;AACrB,CAAC,CAAC;AAIF,eAAe,cAAc,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@daaler/jutils",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.6",
|
|
4
4
|
"description": "Utility functions for js",
|
|
5
5
|
"author": "jarno.parviainen@gmail.com",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
"files": [ "dist" ],
|
|
12
12
|
"scripts": {
|
|
13
13
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
14
|
-
"build": "tsc"
|
|
14
|
+
"build": "tsc",
|
|
15
|
+
"publish": "npm run build && npm publish --access public"
|
|
15
16
|
},
|
|
16
17
|
"devDependencies": {
|
|
17
18
|
"@types/node": "^20.7.0"
|