ansuko 1.3.6 → 1.3.7
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.d.ts +1 -1
- package/dist/index.js +4 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -145,7 +145,7 @@ declare const castArray: <T>(value: T | T[] | null | undefined) => T[];
|
|
|
145
145
|
* ) // => { profile:{ tags:{ 1:'c' } } }
|
|
146
146
|
* @category Object Utilities
|
|
147
147
|
*/
|
|
148
|
-
declare const changes: <T extends Record<string, any>, E extends Record<string, any>>(sourceValue: T, currentValue: E, keys
|
|
148
|
+
declare const changes: <T extends Record<string, any>, E extends Record<string, any>>(sourceValue: T, currentValue: E, keys?: string[], options?: ChangesOptions, finallyCallback?: ChangesAfterFinallyCallback<Record<string, any>>, notEmptyCallback?: ChangesAfterCallback<Record<string, any>>) => Record<string, any>;
|
|
149
149
|
declare const strWrap: (value: string, wrapper: string, whenInvalid?: any) => string | null | undefined;
|
|
150
150
|
/**
|
|
151
151
|
* Executes a function and returns undefined if an error occurs.
|
package/dist/index.js
CHANGED
|
@@ -395,6 +395,10 @@ const castArray = (value) => {
|
|
|
395
395
|
*/
|
|
396
396
|
const changes = (sourceValue, currentValue, keys, options, finallyCallback, notEmptyCallback) => {
|
|
397
397
|
const diff = {};
|
|
398
|
+
if (_.isEmpty(keys)) {
|
|
399
|
+
keys = [];
|
|
400
|
+
options = { ...options, keyExcludes: true };
|
|
401
|
+
}
|
|
398
402
|
// keyExcludes時にdeep pathが指定されていたら警告
|
|
399
403
|
if (options?.keyExcludes === true) {
|
|
400
404
|
const hasDeepPath = keys.some(k => k.includes('.') || k.includes('['));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ansuko",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.7",
|
|
4
4
|
"description": "A modern JavaScript/TypeScript utility library that extends lodash with practical, intuitive behaviors. Fixes lodash quirks, adds Promise support, Japanese text processing, and GeoJSON utilities.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lodash",
|