@zwa73/utils 1.0.135 → 1.0.136
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/UtilFunctions.js
CHANGED
|
@@ -394,6 +394,8 @@ class UtilFunc {
|
|
|
394
394
|
typeof item === 'boolean' || item == null))
|
|
395
395
|
return `@@@${JSON.stringify(value)}@@@`;
|
|
396
396
|
const str = JSON.stringify(value);
|
|
397
|
+
if (typeof str != 'string')
|
|
398
|
+
return value;
|
|
397
399
|
if (str.length <= 100)
|
|
398
400
|
return `@@@${str}@@@`;
|
|
399
401
|
return value;
|
package/dist/UtilInterfaces.d.ts
CHANGED
|
@@ -211,4 +211,6 @@ export type AnyRecord = Record<Keyable, any>;
|
|
|
211
211
|
export type AnnotableTuple<T extends {
|
|
212
212
|
[K: number]: unknown;
|
|
213
213
|
}, Tuple extends unknown[] = []> = unknown extends T[Tuple['length']] ? T & Tuple : AnnotableTuple<T, [...Tuple, T[Tuple['length']]]>;
|
|
214
|
+
/**非严格模式下将会判断为false的值, 不包含NaN */
|
|
215
|
+
export type Flasy = false | 0 | -0 | "" | null | undefined;
|
|
214
216
|
export {};
|
package/package.json
CHANGED
package/src/UtilFunctions.ts
CHANGED
|
@@ -458,6 +458,7 @@ static stringifyJToken(token:JToken|IJData,opt?:StringifyOpt){
|
|
|
458
458
|
typeof item === 'boolean' || item == null))
|
|
459
459
|
return `@@@${JSON.stringify(value)}@@@`;
|
|
460
460
|
const str = JSON.stringify(value);
|
|
461
|
+
if(typeof str!='string') return value;
|
|
461
462
|
if(str.length<=100) return `@@@${str}@@@`;
|
|
462
463
|
return value;
|
|
463
464
|
}
|
package/src/UtilInterfaces.ts
CHANGED
|
@@ -303,4 +303,7 @@ export type AnyRecord = Record<Keyable,any>;
|
|
|
303
303
|
export type AnnotableTuple<T extends {[K:number]:unknown},Tuple extends unknown[]=[]> =
|
|
304
304
|
unknown extends T[Tuple['length']]
|
|
305
305
|
? T & Tuple
|
|
306
|
-
: AnnotableTuple<T,[...Tuple,T[Tuple['length']]]>;
|
|
306
|
+
: AnnotableTuple<T,[...Tuple,T[Tuple['length']]]>;
|
|
307
|
+
|
|
308
|
+
/**非严格模式下将会判断为false的值, 不包含NaN */
|
|
309
|
+
export type Flasy = false | 0 | -0 | "" | null | undefined;
|