@takeshape/util 8.89.2 → 8.96.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/es/common.js CHANGED
@@ -17,4 +17,5 @@ export * from './templates';
17
17
  export * from './highlight-code';
18
18
  export * from './billing';
19
19
  export * from './timezone';
20
- export * from './async-noop';
20
+ export * from './async-noop';
21
+ export * from './set-in';
package/es/set-in.js ADDED
@@ -0,0 +1,6 @@
1
+ import { clone, setWith, curry } from 'lodash/fp';
2
+ /**
3
+ * Same as lodash/set but does not mutate the arguments
4
+ */
5
+
6
+ export const setIn = curry((obj, path, value) => setWith(clone, path, value, clone(obj)));
package/lib/common.d.ts CHANGED
@@ -18,4 +18,5 @@ export * from './highlight-code';
18
18
  export * from './billing';
19
19
  export * from './timezone';
20
20
  export * from './async-noop';
21
+ export * from './set-in';
21
22
  //# sourceMappingURL=common.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/common.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/common.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC"}
package/lib/common.js CHANGED
@@ -262,4 +262,17 @@ Object.keys(_asyncNoop).forEach(function (key) {
262
262
  return _asyncNoop[key];
263
263
  }
264
264
  });
265
+ });
266
+
267
+ var _setIn = require("./set-in");
268
+
269
+ Object.keys(_setIn).forEach(function (key) {
270
+ if (key === "default" || key === "__esModule") return;
271
+ if (key in exports && exports[key] === _setIn[key]) return;
272
+ Object.defineProperty(exports, key, {
273
+ enumerable: true,
274
+ get: function () {
275
+ return _setIn[key];
276
+ }
277
+ });
265
278
  });
@@ -0,0 +1,6 @@
1
+ /// <reference types="lodash" />
2
+ /**
3
+ * Same as lodash/set but does not mutate the arguments
4
+ */
5
+ export declare const setIn: import("lodash").CurriedFunction3<any, string | string[], any, any>;
6
+ //# sourceMappingURL=set-in.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"set-in.d.ts","sourceRoot":"","sources":["../../src/set-in.ts"],"names":[],"mappings":";AAEA;;GAEG;AACH,eAAO,MAAM,KAAK,qEAAoG,CAAC"}
package/lib/set-in.js ADDED
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.setIn = void 0;
7
+
8
+ var _fp = require("lodash/fp");
9
+
10
+ /**
11
+ * Same as lodash/set but does not mutate the arguments
12
+ */
13
+ const setIn = (0, _fp.curry)((obj, path, value) => (0, _fp.setWith)(_fp.clone, path, value, (0, _fp.clone)(obj)));
14
+ exports.setIn = setIn;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@takeshape/util",
3
- "version": "8.89.2",
3
+ "version": "8.96.0",
4
4
  "description": "Shared utilities",
5
5
  "homepage": "https://www.takeshape.io",
6
6
  "repository": {
@@ -21,7 +21,7 @@
21
21
  "es"
22
22
  ],
23
23
  "dependencies": {
24
- "@takeshape/routing": "8.89.2",
24
+ "@takeshape/routing": "8.96.0",
25
25
  "@types/url-parse": "^1.4.4",
26
26
  "aws-sdk": "^2.802.0",
27
27
  "classnames": "^2.2.5",