@dereekb/util 10.1.25 → 10.1.26

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.
@@ -2,6 +2,10 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [10.1.26](https://github.com/dereekb/dbx-components/compare/v10.1.25-dev...v10.1.26) (2024-09-12)
6
+
7
+
8
+
5
9
  ## [10.1.25](https://github.com/dereekb/dbx-components/compare/v10.1.24-dev...v10.1.25) (2024-09-09)
6
10
 
7
11
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dereekb/util/fetch",
3
- "version": "10.1.25",
3
+ "version": "10.1.26",
4
4
  "type": "commonjs",
5
5
  "peerDependencies": {
6
6
  "@dereekb/util": "*"
package/index.cjs.js CHANGED
@@ -7406,11 +7406,13 @@ function assignValuesToPOJOFunction(input = exports.KeyValueTypleValueFilter.UND
7406
7406
  target[key] = value;
7407
7407
  }
7408
7408
  });
7409
- return (inputTarget, obj) => {
7410
- const target = copy ? Object.assign({}, inputTarget) : inputTarget;
7409
+ const fn = (inputTarget, obj, inputCopy = copy) => {
7410
+ const target = inputCopy ? Object.assign({}, inputTarget) : inputTarget;
7411
7411
  assignEachValueToTarget(obj, target);
7412
7412
  return target;
7413
7413
  };
7414
+ fn._returnCopyByDefault = copy;
7415
+ return fn;
7414
7416
  }
7415
7417
  // MARK: ValuesFromPOJO
7416
7418
  /**
package/index.esm.js CHANGED
@@ -8476,6 +8476,8 @@ function assignValuesToPOJO(target, obj, input) {
8476
8476
 
8477
8477
  /**
8478
8478
  * Assigns values from the object to the target based on the configuration, and returns the result.
8479
+ *
8480
+ * Additional argument available to return a copy instead of assigning to the input value.
8479
8481
  */
8480
8482
 
8481
8483
  /**
@@ -8494,11 +8496,13 @@ function assignValuesToPOJOFunction(input = KeyValueTypleValueFilter.UNDEFINED)
8494
8496
  target[key] = value;
8495
8497
  }
8496
8498
  });
8497
- return (inputTarget, obj) => {
8498
- const target = copy ? Object.assign({}, inputTarget) : inputTarget;
8499
+ const fn = (inputTarget, obj, inputCopy = copy) => {
8500
+ const target = inputCopy ? Object.assign({}, inputTarget) : inputTarget;
8499
8501
  assignEachValueToTarget(obj, target);
8500
8502
  return target;
8501
8503
  };
8504
+ fn._returnCopyByDefault = copy;
8505
+ return fn;
8502
8506
  }
8503
8507
 
8504
8508
  // MARK: ValuesFromPOJO
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dereekb/util",
3
- "version": "10.1.25",
3
+ "version": "10.1.26",
4
4
  "exports": {
5
5
  ".": {
6
6
  "types": "./src/index.d.ts",
@@ -147,10 +147,16 @@ export declare function filterFromPOJOFunction<T extends object>({ copy, filter:
147
147
  */
148
148
  export declare const defaultFilterFromPOJOFunctionNoCopy: FilterFromPOJOFunction<object>;
149
149
  export declare function assignValuesToPOJO<T extends object, K extends keyof T = keyof T>(target: T, obj: T, input?: AssignValuesToPOJOFunctionInput<T, K>): T;
150
+ export type AssignValuesToPOJOCopyFunction<T> = (target: T, obj: T, returnCopy: true) => T;
151
+ export type AssignValuesToPOJONoCopyFunction<T> = <I extends T>(target: I, obj: T, returnCopy: false) => I;
150
152
  /**
151
153
  * Assigns values from the object to the target based on the configuration, and returns the result.
154
+ *
155
+ * Additional argument available to return a copy instead of assigning to the input value.
152
156
  */
153
- export type AssignValuesToPOJOFunction<T> = (target: T, obj: T) => T;
157
+ export type AssignValuesToPOJOFunction<T> = ((target: T, obj: T, returnCopy?: boolean) => T) & AssignValuesToPOJOCopyFunction<T> & AssignValuesToPOJONoCopyFunction<T> & {
158
+ readonly _returnCopyByDefault: boolean;
159
+ };
154
160
  export type AssignValuesToPOJOFunctionInput<T extends object = object, K extends keyof T = keyof T> = KeyValueTypleValueFilter | (KeyValueTupleFilter<T, K> & {
155
161
  /**
156
162
  * Whether or not to copy the object before assigning values, and returning the new object.
package/test/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [10.1.26](https://github.com/dereekb/dbx-components/compare/v10.1.25-dev...v10.1.26) (2024-09-12)
6
+
7
+
8
+
5
9
  ## [10.1.25](https://github.com/dereekb/dbx-components/compare/v10.1.24-dev...v10.1.25) (2024-09-09)
6
10
 
7
11
 
package/test/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dereekb/util/test",
3
- "version": "10.1.25",
3
+ "version": "10.1.26",
4
4
  "type": "commonjs",
5
5
  "peerDependencies": {
6
6
  "@dereekb/util": "*"