ansuko 1.3.11 → 1.3.15

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.
Files changed (3) hide show
  1. package/dist/index.d.ts +309 -309
  2. package/dist/index.js +51 -49
  3. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import _ from "lodash";
1
+ import lodash from "lodash";
2
2
  /**
3
3
  * Checks if the value is a non-empty string. null/undefined/empty string -> false.
4
4
  * @param str - Value to check
@@ -107,7 +107,7 @@ declare const equalsOr: <T, E>(...args: any[]) => MaybePromise<T | E | null>;
107
107
  * @example parseJSON('{a:1}') // {a:1} (JSON5)
108
108
  * @category Conversion
109
109
  */
110
- declare const parseJSON: <T = any>(str: string | object) => T | null;
110
+ declare const parseJSON: <T = any>(str: string | object | null | undefined) => T | null;
111
111
  /**
112
112
  * Stringifies objects/arrays; returns null for strings or numbers.
113
113
  * @param obj - Target object
@@ -213,7 +213,7 @@ declare const arrayDepth: (ary: unknown) => number;
213
213
  * Extends ansuko with a plugin and returns the augmented instance.
214
214
  * @param plugin - Plugin function
215
215
  * @returns Extended instance
216
- * @example const extended = _.extend(jaPlugin)
216
+ * @example const extended = lodash.extend(jaPlugin)
217
217
  * @category Core Functions
218
218
  */
219
219
  declare const extend: <T extends AnsukoType, E>(this: T, plugin: (a: T) => T & E) => T & E;
@@ -242,311 +242,311 @@ export interface AnsukoType {
242
242
  isEmpty: typeof isEmpty;
243
243
  toNumber: typeof toNumber;
244
244
  castArray: typeof castArray;
245
- isEmptyOrg: typeof _.isEmpty;
246
- toNumberOrg: typeof _.toNumber;
247
- castArrayOrg: typeof _.castArray;
248
- add: typeof _.add;
249
- after: typeof _.after;
250
- ary: typeof _.ary;
251
- assign: typeof _.assign;
252
- assignIn: typeof _.assignIn;
253
- assignInWith: typeof _.assignInWith;
254
- assignWith: typeof _.assignWith;
255
- at: typeof _.at;
256
- attempt: typeof _.attempt;
257
- before: typeof _.before;
258
- bind: typeof _.bind;
259
- bindAll: typeof _.bindAll;
260
- bindKey: typeof _.bindKey;
261
- camelCase: typeof _.camelCase;
262
- capitalize: typeof _.capitalize;
263
- ceil: typeof _.ceil;
264
- chain: typeof _.chain;
265
- chunk: typeof _.chunk;
266
- clamp: typeof _.clamp;
267
- clone: typeof _.clone;
268
- cloneDeep: typeof _.cloneDeep;
269
- cloneDeepWith: typeof _.cloneDeepWith;
270
- cloneWith: typeof _.cloneWith;
271
- compact: typeof _.compact;
272
- concat: typeof _.concat;
273
- cond: typeof _.cond;
274
- conforms: typeof _.conforms;
275
- conformsTo: typeof _.conformsTo;
276
- constant: typeof _.constant;
277
- countBy: typeof _.countBy;
278
- create: typeof _.create;
279
- curry: typeof _.curry;
280
- curryRight: typeof _.curryRight;
281
- debounce: typeof _.debounce;
282
- deburr: typeof _.deburr;
283
- defaultTo: typeof _.defaultTo;
284
- defaults: typeof _.defaults;
285
- defaultsDeep: typeof _.defaultsDeep;
286
- defer: typeof _.defer;
287
- delay: typeof _.delay;
288
- difference: typeof _.difference;
289
- differenceBy: typeof _.differenceBy;
290
- differenceWith: typeof _.differenceWith;
291
- divide: typeof _.divide;
292
- drop: typeof _.drop;
293
- dropRight: typeof _.dropRight;
294
- dropRightWhile: typeof _.dropRightWhile;
295
- dropWhile: typeof _.dropWhile;
296
- each: typeof _.each;
297
- eachRight: typeof _.eachRight;
298
- endsWith: typeof _.endsWith;
299
- entries: typeof _.entries;
300
- entriesIn: typeof _.entriesIn;
301
- eq: typeof _.eq;
302
- escape: typeof _.escape;
303
- escapeRegExp: typeof _.escapeRegExp;
304
- every: typeof _.every;
305
- extendWith: typeof _.extendWith;
306
- fill: typeof _.fill;
307
- filter: typeof _.filter;
308
- find: typeof _.find;
309
- findIndex: typeof _.findIndex;
310
- findKey: typeof _.findKey;
311
- findLast: typeof _.findLast;
312
- findLastIndex: typeof _.findLastIndex;
313
- findLastKey: typeof _.findLastKey;
314
- first: typeof _.first;
315
- flatMap: typeof _.flatMap;
316
- flatMapDeep: typeof _.flatMapDeep;
317
- flatMapDepth: typeof _.flatMapDepth;
318
- flatten: typeof _.flatten;
319
- flattenDeep: typeof _.flattenDeep;
320
- flattenDepth: typeof _.flattenDepth;
321
- flip: typeof _.flip;
322
- floor: typeof _.floor;
323
- flow: typeof _.flow;
324
- flowRight: typeof _.flowRight;
325
- forEach: typeof _.forEach;
326
- forEachRight: typeof _.forEachRight;
327
- forIn: typeof _.forIn;
328
- forInRight: typeof _.forInRight;
329
- forOwn: typeof _.forOwn;
330
- forOwnRight: typeof _.forOwnRight;
331
- fromPairs: typeof _.fromPairs;
332
- functions: typeof _.functions;
333
- functionsIn: typeof _.functionsIn;
334
- get: typeof _.get;
335
- groupBy: typeof _.groupBy;
336
- gt: typeof _.gt;
337
- gte: typeof _.gte;
338
- has: typeof _.has;
339
- hasIn: typeof _.hasIn;
340
- head: typeof _.head;
341
- identity: typeof _.identity;
342
- inRange: typeof _.inRange;
343
- includes: typeof _.includes;
344
- indexOf: typeof _.indexOf;
345
- initial: typeof _.initial;
346
- intersection: typeof _.intersection;
347
- intersectionBy: typeof _.intersectionBy;
348
- intersectionWith: typeof _.intersectionWith;
349
- invert: typeof _.invert;
350
- invertBy: typeof _.invertBy;
351
- invoke: typeof _.invoke;
352
- invokeMap: typeof _.invokeMap;
353
- isArguments: typeof _.isArguments;
354
- isArray: typeof _.isArray;
355
- isArrayBuffer: typeof _.isArrayBuffer;
356
- isArrayLike: typeof _.isArrayLike;
357
- isArrayLikeObject: typeof _.isArrayLikeObject;
358
- isBoolean: typeof _.isBoolean;
359
- isBuffer: typeof _.isBuffer;
360
- isDate: typeof _.isDate;
361
- isElement: typeof _.isElement;
362
- isEqual: typeof _.isEqual;
363
- isEqualWith: typeof _.isEqualWith;
364
- isError: typeof _.isError;
365
- isFinite: typeof _.isFinite;
366
- isFunction: typeof _.isFunction;
367
- isInteger: typeof _.isInteger;
368
- isLength: typeof _.isLength;
369
- isMap: typeof _.isMap;
370
- isMatch: typeof _.isMatch;
371
- isMatchWith: typeof _.isMatchWith;
372
- isNaN: typeof _.isNaN;
373
- isNative: typeof _.isNative;
374
- isNil: typeof _.isNil;
375
- isNull: typeof _.isNull;
376
- isNumber: typeof _.isNumber;
377
- isObject: typeof _.isObject;
378
- isObjectLike: typeof _.isObjectLike;
379
- isPlainObject: typeof _.isPlainObject;
380
- isRegExp: typeof _.isRegExp;
381
- isSafeInteger: typeof _.isSafeInteger;
382
- isSet: typeof _.isSet;
383
- isString: typeof _.isString;
384
- isSymbol: typeof _.isSymbol;
385
- isTypedArray: typeof _.isTypedArray;
386
- isUndefined: typeof _.isUndefined;
387
- isWeakMap: typeof _.isWeakMap;
388
- isWeakSet: typeof _.isWeakSet;
389
- iteratee: typeof _.iteratee;
390
- join: typeof _.join;
391
- kebabCase: typeof _.kebabCase;
392
- keyBy: typeof _.keyBy;
393
- keys: typeof _.keys;
394
- keysIn: typeof _.keysIn;
395
- last: typeof _.last;
396
- lastIndexOf: typeof _.lastIndexOf;
397
- lowerCase: typeof _.lowerCase;
398
- lowerFirst: typeof _.lowerFirst;
399
- lt: typeof _.lt;
400
- lte: typeof _.lte;
401
- map: typeof _.map;
402
- mapKeys: typeof _.mapKeys;
403
- mapValues: typeof _.mapValues;
404
- matches: typeof _.matches;
405
- matchesProperty: typeof _.matchesProperty;
406
- max: typeof _.max;
407
- maxBy: typeof _.maxBy;
408
- mean: typeof _.mean;
409
- meanBy: typeof _.meanBy;
410
- memoize: typeof _.memoize;
411
- merge: typeof _.merge;
412
- mergeWith: typeof _.mergeWith;
413
- method: typeof _.method;
414
- methodOf: typeof _.methodOf;
415
- min: typeof _.min;
416
- minBy: typeof _.minBy;
417
- mixin: typeof _.mixin;
418
- multiply: typeof _.multiply;
419
- negate: typeof _.negate;
420
- noConflict: typeof _.noConflict;
421
- noop: typeof _.noop;
422
- now: typeof _.now;
423
- nth: typeof _.nth;
424
- nthArg: typeof _.nthArg;
425
- omit: typeof _.omit;
426
- omitBy: typeof _.omitBy;
427
- once: typeof _.once;
428
- orderBy: typeof _.orderBy;
429
- over: typeof _.over;
430
- overArgs: typeof _.overArgs;
431
- overEvery: typeof _.overEvery;
432
- overSome: typeof _.overSome;
433
- pad: typeof _.pad;
434
- padEnd: typeof _.padEnd;
435
- padStart: typeof _.padStart;
436
- parseInt: typeof _.parseInt;
437
- partial: typeof _.partial;
438
- partialRight: typeof _.partialRight;
439
- partition: typeof _.partition;
440
- pick: typeof _.pick;
441
- pickBy: typeof _.pickBy;
442
- property: typeof _.property;
443
- propertyOf: typeof _.propertyOf;
444
- pull: typeof _.pull;
445
- pullAll: typeof _.pullAll;
446
- pullAllBy: typeof _.pullAllBy;
447
- pullAllWith: typeof _.pullAllWith;
448
- pullAt: typeof _.pullAt;
449
- random: typeof _.random;
450
- range: typeof _.range;
451
- rangeRight: typeof _.rangeRight;
452
- rearg: typeof _.rearg;
453
- reduce: typeof _.reduce;
454
- reduceRight: typeof _.reduceRight;
455
- reject: typeof _.reject;
456
- remove: typeof _.remove;
457
- repeat: typeof _.repeat;
458
- replace: typeof _.replace;
459
- rest: typeof _.rest;
460
- result: typeof _.result;
461
- reverse: typeof _.reverse;
462
- round: typeof _.round;
463
- runInContext: typeof _.runInContext;
464
- sample: typeof _.sample;
465
- sampleSize: typeof _.sampleSize;
466
- set: typeof _.set;
467
- setWith: typeof _.setWith;
468
- shuffle: typeof _.shuffle;
469
- size: typeof _.size;
470
- slice: typeof _.slice;
471
- snakeCase: typeof _.snakeCase;
472
- some: typeof _.some;
473
- sortBy: typeof _.sortBy;
474
- sortedIndex: typeof _.sortedIndex;
475
- sortedIndexBy: typeof _.sortedIndexBy;
476
- sortedIndexOf: typeof _.sortedIndexOf;
477
- sortedLastIndex: typeof _.sortedLastIndex;
478
- sortedLastIndexBy: typeof _.sortedLastIndexBy;
479
- sortedLastIndexOf: typeof _.sortedLastIndexOf;
480
- sortedUniq: typeof _.sortedUniq;
481
- sortedUniqBy: typeof _.sortedUniqBy;
482
- split: typeof _.split;
483
- spread: typeof _.spread;
484
- startCase: typeof _.startCase;
485
- startsWith: typeof _.startsWith;
486
- stubArray: typeof _.stubArray;
487
- stubFalse: typeof _.stubFalse;
488
- stubObject: typeof _.stubObject;
489
- stubString: typeof _.stubString;
490
- stubTrue: typeof _.stubTrue;
491
- subtract: typeof _.subtract;
492
- sum: typeof _.sum;
493
- sumBy: typeof _.sumBy;
494
- tail: typeof _.tail;
495
- take: typeof _.take;
496
- takeRight: typeof _.takeRight;
497
- takeRightWhile: typeof _.takeRightWhile;
498
- takeWhile: typeof _.takeWhile;
499
- tap: typeof _.tap;
500
- template: typeof _.template;
501
- throttle: typeof _.throttle;
502
- thru: typeof _.thru;
503
- times: typeof _.times;
504
- toArray: typeof _.toArray;
505
- toFinite: typeof _.toFinite;
506
- toInteger: typeof _.toInteger;
507
- toLength: typeof _.toLength;
508
- toLower: typeof _.toLower;
509
- toPairs: typeof _.toPairs;
510
- toPairsIn: typeof _.toPairsIn;
511
- toPath: typeof _.toPath;
512
- toPlainObject: typeof _.toPlainObject;
513
- toSafeInteger: typeof _.toSafeInteger;
514
- toString: typeof _.toString;
515
- toUpper: typeof _.toUpper;
516
- transform: typeof _.transform;
517
- trim: typeof _.trim;
518
- trimEnd: typeof _.trimEnd;
519
- trimStart: typeof _.trimStart;
520
- truncate: typeof _.truncate;
521
- unary: typeof _.unary;
522
- unescape: typeof _.unescape;
523
- union: typeof _.union;
524
- unionBy: typeof _.unionBy;
525
- unionWith: typeof _.unionWith;
526
- uniq: typeof _.uniq;
527
- uniqBy: typeof _.uniqBy;
528
- uniqWith: typeof _.uniqWith;
529
- uniqueId: typeof _.uniqueId;
530
- unset: typeof _.unset;
531
- unzip: typeof _.unzip;
532
- unzipWith: typeof _.unzipWith;
533
- update: typeof _.update;
534
- updateWith: typeof _.updateWith;
535
- upperCase: typeof _.upperCase;
536
- upperFirst: typeof _.upperFirst;
537
- values: typeof _.values;
538
- valuesIn: typeof _.valuesIn;
539
- without: typeof _.without;
540
- words: typeof _.words;
541
- wrap: typeof _.wrap;
542
- xor: typeof _.xor;
543
- xorBy: typeof _.xorBy;
544
- xorWith: typeof _.xorWith;
545
- zip: typeof _.zip;
546
- zipObject: typeof _.zipObject;
547
- zipObjectDeep: typeof _.zipObjectDeep;
548
- zipWith: typeof _.zipWith;
245
+ isEmptyOrg: typeof lodash.isEmpty;
246
+ toNumberOrg: typeof lodash.toNumber;
247
+ castArrayOrg: typeof lodash.castArray;
248
+ add: typeof lodash.add;
249
+ after: typeof lodash.after;
250
+ ary: typeof lodash.ary;
251
+ assign: typeof lodash.assign;
252
+ assignIn: typeof lodash.assignIn;
253
+ assignInWith: typeof lodash.assignInWith;
254
+ assignWith: typeof lodash.assignWith;
255
+ at: typeof lodash.at;
256
+ attempt: typeof lodash.attempt;
257
+ before: typeof lodash.before;
258
+ bind: typeof lodash.bind;
259
+ bindAll: typeof lodash.bindAll;
260
+ bindKey: typeof lodash.bindKey;
261
+ camelCase: typeof lodash.camelCase;
262
+ capitalize: typeof lodash.capitalize;
263
+ ceil: typeof lodash.ceil;
264
+ chain: typeof lodash.chain;
265
+ chunk: typeof lodash.chunk;
266
+ clamp: typeof lodash.clamp;
267
+ clone: typeof lodash.clone;
268
+ cloneDeep: typeof lodash.cloneDeep;
269
+ cloneDeepWith: typeof lodash.cloneDeepWith;
270
+ cloneWith: typeof lodash.cloneWith;
271
+ compact: typeof lodash.compact;
272
+ concat: typeof lodash.concat;
273
+ cond: typeof lodash.cond;
274
+ conforms: typeof lodash.conforms;
275
+ conformsTo: typeof lodash.conformsTo;
276
+ constant: typeof lodash.constant;
277
+ countBy: typeof lodash.countBy;
278
+ create: typeof lodash.create;
279
+ curry: typeof lodash.curry;
280
+ curryRight: typeof lodash.curryRight;
281
+ debounce: typeof lodash.debounce;
282
+ deburr: typeof lodash.deburr;
283
+ defaultTo: typeof lodash.defaultTo;
284
+ defaults: typeof lodash.defaults;
285
+ defaultsDeep: typeof lodash.defaultsDeep;
286
+ defer: typeof lodash.defer;
287
+ delay: typeof lodash.delay;
288
+ difference: typeof lodash.difference;
289
+ differenceBy: typeof lodash.differenceBy;
290
+ differenceWith: typeof lodash.differenceWith;
291
+ divide: typeof lodash.divide;
292
+ drop: typeof lodash.drop;
293
+ dropRight: typeof lodash.dropRight;
294
+ dropRightWhile: typeof lodash.dropRightWhile;
295
+ dropWhile: typeof lodash.dropWhile;
296
+ each: typeof lodash.each;
297
+ eachRight: typeof lodash.eachRight;
298
+ endsWith: typeof lodash.endsWith;
299
+ entries: typeof lodash.entries;
300
+ entriesIn: typeof lodash.entriesIn;
301
+ eq: typeof lodash.eq;
302
+ escape: typeof lodash.escape;
303
+ escapeRegExp: typeof lodash.escapeRegExp;
304
+ every: typeof lodash.every;
305
+ extendWith: typeof lodash.extendWith;
306
+ fill: typeof lodash.fill;
307
+ filter: typeof lodash.filter;
308
+ find: typeof lodash.find;
309
+ findIndex: typeof lodash.findIndex;
310
+ findKey: typeof lodash.findKey;
311
+ findLast: typeof lodash.findLast;
312
+ findLastIndex: typeof lodash.findLastIndex;
313
+ findLastKey: typeof lodash.findLastKey;
314
+ first: typeof lodash.first;
315
+ flatMap: typeof lodash.flatMap;
316
+ flatMapDeep: typeof lodash.flatMapDeep;
317
+ flatMapDepth: typeof lodash.flatMapDepth;
318
+ flatten: typeof lodash.flatten;
319
+ flattenDeep: typeof lodash.flattenDeep;
320
+ flattenDepth: typeof lodash.flattenDepth;
321
+ flip: typeof lodash.flip;
322
+ floor: typeof lodash.floor;
323
+ flow: typeof lodash.flow;
324
+ flowRight: typeof lodash.flowRight;
325
+ forEach: typeof lodash.forEach;
326
+ forEachRight: typeof lodash.forEachRight;
327
+ forIn: typeof lodash.forIn;
328
+ forInRight: typeof lodash.forInRight;
329
+ forOwn: typeof lodash.forOwn;
330
+ forOwnRight: typeof lodash.forOwnRight;
331
+ fromPairs: typeof lodash.fromPairs;
332
+ functions: typeof lodash.functions;
333
+ functionsIn: typeof lodash.functionsIn;
334
+ get: typeof lodash.get;
335
+ groupBy: typeof lodash.groupBy;
336
+ gt: typeof lodash.gt;
337
+ gte: typeof lodash.gte;
338
+ has: typeof lodash.has;
339
+ hasIn: typeof lodash.hasIn;
340
+ head: typeof lodash.head;
341
+ identity: typeof lodash.identity;
342
+ inRange: typeof lodash.inRange;
343
+ includes: typeof lodash.includes;
344
+ indexOf: typeof lodash.indexOf;
345
+ initial: typeof lodash.initial;
346
+ intersection: typeof lodash.intersection;
347
+ intersectionBy: typeof lodash.intersectionBy;
348
+ intersectionWith: typeof lodash.intersectionWith;
349
+ invert: typeof lodash.invert;
350
+ invertBy: typeof lodash.invertBy;
351
+ invoke: typeof lodash.invoke;
352
+ invokeMap: typeof lodash.invokeMap;
353
+ isArguments: typeof lodash.isArguments;
354
+ isArray: typeof lodash.isArray;
355
+ isArrayBuffer: typeof lodash.isArrayBuffer;
356
+ isArrayLike: typeof lodash.isArrayLike;
357
+ isArrayLikeObject: typeof lodash.isArrayLikeObject;
358
+ isBoolean: typeof lodash.isBoolean;
359
+ isBuffer: typeof lodash.isBuffer;
360
+ isDate: typeof lodash.isDate;
361
+ isElement: typeof lodash.isElement;
362
+ isEqual: typeof lodash.isEqual;
363
+ isEqualWith: typeof lodash.isEqualWith;
364
+ isError: typeof lodash.isError;
365
+ isFinite: typeof lodash.isFinite;
366
+ isFunction: typeof lodash.isFunction;
367
+ isInteger: typeof lodash.isInteger;
368
+ isLength: typeof lodash.isLength;
369
+ isMap: typeof lodash.isMap;
370
+ isMatch: typeof lodash.isMatch;
371
+ isMatchWith: typeof lodash.isMatchWith;
372
+ isNaN: typeof lodash.isNaN;
373
+ isNative: typeof lodash.isNative;
374
+ isNil: typeof lodash.isNil;
375
+ isNull: typeof lodash.isNull;
376
+ isNumber: typeof lodash.isNumber;
377
+ isObject: typeof lodash.isObject;
378
+ isObjectLike: typeof lodash.isObjectLike;
379
+ isPlainObject: typeof lodash.isPlainObject;
380
+ isRegExp: typeof lodash.isRegExp;
381
+ isSafeInteger: typeof lodash.isSafeInteger;
382
+ isSet: typeof lodash.isSet;
383
+ isString: typeof lodash.isString;
384
+ isSymbol: typeof lodash.isSymbol;
385
+ isTypedArray: typeof lodash.isTypedArray;
386
+ isUndefined: typeof lodash.isUndefined;
387
+ isWeakMap: typeof lodash.isWeakMap;
388
+ isWeakSet: typeof lodash.isWeakSet;
389
+ iteratee: typeof lodash.iteratee;
390
+ join: typeof lodash.join;
391
+ kebabCase: typeof lodash.kebabCase;
392
+ keyBy: typeof lodash.keyBy;
393
+ keys: typeof lodash.keys;
394
+ keysIn: typeof lodash.keysIn;
395
+ last: typeof lodash.last;
396
+ lastIndexOf: typeof lodash.lastIndexOf;
397
+ lowerCase: typeof lodash.lowerCase;
398
+ lowerFirst: typeof lodash.lowerFirst;
399
+ lt: typeof lodash.lt;
400
+ lte: typeof lodash.lte;
401
+ map: typeof lodash.map;
402
+ mapKeys: typeof lodash.mapKeys;
403
+ mapValues: typeof lodash.mapValues;
404
+ matches: typeof lodash.matches;
405
+ matchesProperty: typeof lodash.matchesProperty;
406
+ max: typeof lodash.max;
407
+ maxBy: typeof lodash.maxBy;
408
+ mean: typeof lodash.mean;
409
+ meanBy: typeof lodash.meanBy;
410
+ memoize: typeof lodash.memoize;
411
+ merge: typeof lodash.merge;
412
+ mergeWith: typeof lodash.mergeWith;
413
+ method: typeof lodash.method;
414
+ methodOf: typeof lodash.methodOf;
415
+ min: typeof lodash.min;
416
+ minBy: typeof lodash.minBy;
417
+ mixin: typeof lodash.mixin;
418
+ multiply: typeof lodash.multiply;
419
+ negate: typeof lodash.negate;
420
+ noConflict: typeof lodash.noConflict;
421
+ noop: typeof lodash.noop;
422
+ now: typeof lodash.now;
423
+ nth: typeof lodash.nth;
424
+ nthArg: typeof lodash.nthArg;
425
+ omit: typeof lodash.omit;
426
+ omitBy: typeof lodash.omitBy;
427
+ once: typeof lodash.once;
428
+ orderBy: typeof lodash.orderBy;
429
+ over: typeof lodash.over;
430
+ overArgs: typeof lodash.overArgs;
431
+ overEvery: typeof lodash.overEvery;
432
+ overSome: typeof lodash.overSome;
433
+ pad: typeof lodash.pad;
434
+ padEnd: typeof lodash.padEnd;
435
+ padStart: typeof lodash.padStart;
436
+ parseInt: typeof lodash.parseInt;
437
+ partial: typeof lodash.partial;
438
+ partialRight: typeof lodash.partialRight;
439
+ partition: typeof lodash.partition;
440
+ pick: typeof lodash.pick;
441
+ pickBy: typeof lodash.pickBy;
442
+ property: typeof lodash.property;
443
+ propertyOf: typeof lodash.propertyOf;
444
+ pull: typeof lodash.pull;
445
+ pullAll: typeof lodash.pullAll;
446
+ pullAllBy: typeof lodash.pullAllBy;
447
+ pullAllWith: typeof lodash.pullAllWith;
448
+ pullAt: typeof lodash.pullAt;
449
+ random: typeof lodash.random;
450
+ range: typeof lodash.range;
451
+ rangeRight: typeof lodash.rangeRight;
452
+ rearg: typeof lodash.rearg;
453
+ reduce: typeof lodash.reduce;
454
+ reduceRight: typeof lodash.reduceRight;
455
+ reject: typeof lodash.reject;
456
+ remove: typeof lodash.remove;
457
+ repeat: typeof lodash.repeat;
458
+ replace: typeof lodash.replace;
459
+ rest: typeof lodash.rest;
460
+ result: typeof lodash.result;
461
+ reverse: typeof lodash.reverse;
462
+ round: typeof lodash.round;
463
+ runInContext: typeof lodash.runInContext;
464
+ sample: typeof lodash.sample;
465
+ sampleSize: typeof lodash.sampleSize;
466
+ set: typeof lodash.set;
467
+ setWith: typeof lodash.setWith;
468
+ shuffle: typeof lodash.shuffle;
469
+ size: typeof lodash.size;
470
+ slice: typeof lodash.slice;
471
+ snakeCase: typeof lodash.snakeCase;
472
+ some: typeof lodash.some;
473
+ sortBy: typeof lodash.sortBy;
474
+ sortedIndex: typeof lodash.sortedIndex;
475
+ sortedIndexBy: typeof lodash.sortedIndexBy;
476
+ sortedIndexOf: typeof lodash.sortedIndexOf;
477
+ sortedLastIndex: typeof lodash.sortedLastIndex;
478
+ sortedLastIndexBy: typeof lodash.sortedLastIndexBy;
479
+ sortedLastIndexOf: typeof lodash.sortedLastIndexOf;
480
+ sortedUniq: typeof lodash.sortedUniq;
481
+ sortedUniqBy: typeof lodash.sortedUniqBy;
482
+ split: typeof lodash.split;
483
+ spread: typeof lodash.spread;
484
+ startCase: typeof lodash.startCase;
485
+ startsWith: typeof lodash.startsWith;
486
+ stubArray: typeof lodash.stubArray;
487
+ stubFalse: typeof lodash.stubFalse;
488
+ stubObject: typeof lodash.stubObject;
489
+ stubString: typeof lodash.stubString;
490
+ stubTrue: typeof lodash.stubTrue;
491
+ subtract: typeof lodash.subtract;
492
+ sum: typeof lodash.sum;
493
+ sumBy: typeof lodash.sumBy;
494
+ tail: typeof lodash.tail;
495
+ take: typeof lodash.take;
496
+ takeRight: typeof lodash.takeRight;
497
+ takeRightWhile: typeof lodash.takeRightWhile;
498
+ takeWhile: typeof lodash.takeWhile;
499
+ tap: typeof lodash.tap;
500
+ template: typeof lodash.template;
501
+ throttle: typeof lodash.throttle;
502
+ thru: typeof lodash.thru;
503
+ times: typeof lodash.times;
504
+ toArray: typeof lodash.toArray;
505
+ toFinite: typeof lodash.toFinite;
506
+ toInteger: typeof lodash.toInteger;
507
+ toLength: typeof lodash.toLength;
508
+ toLower: typeof lodash.toLower;
509
+ toPairs: typeof lodash.toPairs;
510
+ toPairsIn: typeof lodash.toPairsIn;
511
+ toPath: typeof lodash.toPath;
512
+ toPlainObject: typeof lodash.toPlainObject;
513
+ toSafeInteger: typeof lodash.toSafeInteger;
514
+ toString: typeof lodash.toString;
515
+ toUpper: typeof lodash.toUpper;
516
+ transform: typeof lodash.transform;
517
+ trim: typeof lodash.trim;
518
+ trimEnd: typeof lodash.trimEnd;
519
+ trimStart: typeof lodash.trimStart;
520
+ truncate: typeof lodash.truncate;
521
+ unary: typeof lodash.unary;
522
+ unescape: typeof lodash.unescape;
523
+ union: typeof lodash.union;
524
+ unionBy: typeof lodash.unionBy;
525
+ unionWith: typeof lodash.unionWith;
526
+ uniq: typeof lodash.uniq;
527
+ uniqBy: typeof lodash.uniqBy;
528
+ uniqWith: typeof lodash.uniqWith;
529
+ uniqueId: typeof lodash.uniqueId;
530
+ unset: typeof lodash.unset;
531
+ unzip: typeof lodash.unzip;
532
+ unzipWith: typeof lodash.unzipWith;
533
+ update: typeof lodash.update;
534
+ updateWith: typeof lodash.updateWith;
535
+ upperCase: typeof lodash.upperCase;
536
+ upperFirst: typeof lodash.upperFirst;
537
+ values: typeof lodash.values;
538
+ valuesIn: typeof lodash.valuesIn;
539
+ without: typeof lodash.without;
540
+ words: typeof lodash.words;
541
+ wrap: typeof lodash.wrap;
542
+ xor: typeof lodash.xor;
543
+ xorBy: typeof lodash.xorBy;
544
+ xorWith: typeof lodash.xorWith;
545
+ zip: typeof lodash.zip;
546
+ zipObject: typeof lodash.zipObject;
547
+ zipObjectDeep: typeof lodash.zipObjectDeep;
548
+ zipWith: typeof lodash.zipWith;
549
549
  }
550
- declare const _default: AnsukoType;
551
- export default _default;
550
+ declare const _: AnsukoType;
551
+ export default _;
552
552
  export { isEmpty, toNumber, boolIf, isValidStr, valueOr, equalsOr, waited, parseJSON, jsonStringify, castArray, changes, strWrap, swallow, swallowMap, arrayDepth, };
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import _ from "lodash";
1
+ import lodash from "lodash";
2
2
  import JSON5 from "json5";
3
3
  import { toHalfWidth } from "./util.js";
4
4
  /**
@@ -10,10 +10,10 @@ import { toHalfWidth } from "./util.js";
10
10
  * @category Type Guards
11
11
  */
12
12
  const isValidStr = (str) => {
13
- if (_.isNil(str)) {
13
+ if (lodash.isNil(str)) {
14
14
  return false;
15
15
  }
16
- if (_.isEmpty(str)) {
16
+ if (lodash.isEmpty(str)) {
17
17
  return false;
18
18
  }
19
19
  return typeof str === "string";
@@ -26,7 +26,7 @@ const valueOr = (value, els) => {
26
26
  // Promiseかチェック
27
27
  if (resolvedValue instanceof Promise) {
28
28
  return Promise.resolve(resolvedValue).then(res => {
29
- if (_.isNil(res) || isEmpty(res)) {
29
+ if (lodash.isNil(res) || isEmpty(res)) {
30
30
  if (typeof els === "function") {
31
31
  return els();
32
32
  }
@@ -35,7 +35,7 @@ const valueOr = (value, els) => {
35
35
  return res;
36
36
  });
37
37
  }
38
- if (!_.isNil(resolvedValue) && !isEmpty(resolvedValue)) {
38
+ if (!lodash.isNil(resolvedValue) && !isEmpty(resolvedValue)) {
39
39
  return resolvedValue;
40
40
  }
41
41
  if (typeof els === "function") {
@@ -51,7 +51,7 @@ const emptyOr = (value, els) => {
51
51
  // Promiseかチェック
52
52
  if (resolvedValue instanceof Promise) {
53
53
  return Promise.resolve(resolvedValue).then(res => {
54
- if (_.isNil(res) || isEmpty(res)) {
54
+ if (lodash.isNil(res) || isEmpty(res)) {
55
55
  return null;
56
56
  }
57
57
  if (typeof els === "function") {
@@ -60,7 +60,7 @@ const emptyOr = (value, els) => {
60
60
  return els;
61
61
  });
62
62
  }
63
- if (_.isNil(resolvedValue) || isEmpty(resolvedValue)) {
63
+ if (lodash.isNil(resolvedValue) || isEmpty(resolvedValue)) {
64
64
  return null;
65
65
  }
66
66
  if (typeof els === "function") {
@@ -87,9 +87,9 @@ const hasOr = (value, paths, els) => {
87
87
  const pathArray = Array.isArray(paths) ? paths : [paths];
88
88
  // パスが全て存在するかチェック
89
89
  const checkPaths = (val) => {
90
- if (_.isNil(val) || isEmpty(val))
90
+ if (lodash.isNil(val) || isEmpty(val))
91
91
  return false;
92
- return pathArray.every(path => _.has(val, path));
92
+ return pathArray.every(path => lodash.has(val, path));
93
93
  };
94
94
  // Promiseかチェック
95
95
  if (resolvedValue instanceof Promise) {
@@ -120,16 +120,16 @@ const hasOr = (value, paths, els) => {
120
120
  * @category Core Functions
121
121
  */
122
122
  const isEmpty = (value) => {
123
- if (_.isNil(value)) {
123
+ if (lodash.isNil(value)) {
124
124
  return true;
125
125
  }
126
- if (_.isNumber(value)) {
126
+ if (lodash.isNumber(value)) {
127
127
  return false;
128
128
  }
129
- if (_.isBoolean(value)) {
129
+ if (lodash.isBoolean(value)) {
130
130
  return false;
131
131
  }
132
- return _.isEmpty(value);
132
+ return lodash.isEmpty(value);
133
133
  };
134
134
  /**
135
135
  * Converts a value to number (full-width and comma aware). Returns null when invalid.
@@ -144,10 +144,10 @@ const isEmpty = (value) => {
144
144
  * @category Core Functions
145
145
  */
146
146
  const toNumber = (value, toFixed) => {
147
- if (_.isNil(value)) {
147
+ if (lodash.isNil(value)) {
148
148
  return null;
149
149
  }
150
- if (_.isNumber(value)) {
150
+ if (lodash.isNumber(value)) {
151
151
  return value;
152
152
  }
153
153
  if (isEmpty(value)) {
@@ -155,16 +155,16 @@ const toNumber = (value, toFixed) => {
155
155
  }
156
156
  let v = toHalfWidth(value);
157
157
  if (typeof v === "string" && v.trim().match(/^[0-9][0-9,.]*$/)) {
158
- v = _.toNumber(v.trim().replace(/,/g, ""));
158
+ v = lodash.toNumber(v.trim().replace(/,/g, ""));
159
159
  }
160
160
  else {
161
- v = _.toNumber(v);
161
+ v = lodash.toNumber(v);
162
162
  }
163
- if (!_.isNaN(v) && !_.isNil(toFixed)) {
164
- const f = _.toNumber(toFixed);
163
+ if (!lodash.isNaN(v) && !lodash.isNil(toFixed)) {
164
+ const f = lodash.toNumber(toFixed);
165
165
  v = parseFloat(v.toFixed(f));
166
166
  }
167
- if (_.isNaN(v)) {
167
+ if (lodash.isNaN(v)) {
168
168
  return null;
169
169
  }
170
170
  return v;
@@ -180,16 +180,16 @@ const toNumber = (value, toFixed) => {
180
180
  * @category Core Functions
181
181
  */
182
182
  const toBool = (value, undetected = null) => {
183
- if (_.isNil(value)) {
183
+ if (lodash.isNil(value)) {
184
184
  return false;
185
185
  }
186
186
  if (isEmpty(value)) {
187
187
  return false;
188
188
  }
189
- if (_.isBoolean(value)) {
189
+ if (lodash.isBoolean(value)) {
190
190
  return value;
191
191
  }
192
- if (_.isNumber(value)) {
192
+ if (lodash.isNumber(value)) {
193
193
  return value !== 0;
194
194
  }
195
195
  const n = toNumber(value);
@@ -231,10 +231,10 @@ const toBool = (value, undetected = null) => {
231
231
  * @category Core Functions
232
232
  */
233
233
  const boolIf = (value, defaultValue = false) => {
234
- if (_.isBoolean(value)) {
234
+ if (lodash.isBoolean(value)) {
235
235
  return value;
236
236
  }
237
- if (_.isNumber(value)) {
237
+ if (lodash.isNumber(value)) {
238
238
  return !!value;
239
239
  }
240
240
  return defaultValue;
@@ -286,10 +286,10 @@ const equalsOr = (...args) => {
286
286
  Promise.resolve(p1),
287
287
  Promise.resolve(p2)
288
288
  ]).then(([v1, v2]) => {
289
- if (_.isNil(v1) && _.isNil(v2)) {
289
+ if (lodash.isNil(v1) && lodash.isNil(v2)) {
290
290
  return null;
291
291
  }
292
- if (_.isEqual(v1, v2)) {
292
+ if (lodash.isEqual(v1, v2)) {
293
293
  return v1;
294
294
  }
295
295
  // elsの解決
@@ -301,10 +301,10 @@ const equalsOr = (...args) => {
301
301
  }
302
302
  else {
303
303
  // 同期処理ブランチ
304
- if (_.isNil(p1) && _.isNil(p2)) {
304
+ if (lodash.isNil(p1) && lodash.isNil(p2)) {
305
305
  return null;
306
306
  }
307
- if (_.isEqual(p1, p2)) {
307
+ if (lodash.isEqual(p1, p2)) {
308
308
  return p1;
309
309
  }
310
310
  // elsの解決
@@ -323,7 +323,7 @@ const equalsOr = (...args) => {
323
323
  * @category Conversion
324
324
  */
325
325
  const parseJSON = (str) => {
326
- if (_.isNil(str)) {
326
+ if (lodash.isNil(str)) {
327
327
  return null;
328
328
  }
329
329
  if (typeof str === "object") {
@@ -347,7 +347,7 @@ const parseJSON = (str) => {
347
347
  * @category Conversion
348
348
  */
349
349
  const jsonStringify = (obj, replacer, space) => {
350
- if (_.isNil(obj)) {
350
+ if (lodash.isNil(obj)) {
351
351
  return null;
352
352
  }
353
353
  if (typeof obj === "string") {
@@ -378,10 +378,10 @@ const jsonStringify = (obj, replacer, space) => {
378
378
  * @category Array Utilities
379
379
  */
380
380
  const castArray = (value) => {
381
- if (_.isNil(value)) {
381
+ if (lodash.isNil(value)) {
382
382
  return [];
383
383
  }
384
- return _.castArray(value);
384
+ return lodash.castArray(value);
385
385
  };
386
386
  /**
387
387
  * Computes differences between two objects. Supports deep paths. When `keyExcludes` is true,
@@ -405,7 +405,7 @@ const castArray = (value) => {
405
405
  */
406
406
  const changes = (sourceValue, currentValue, keys, options, finallyCallback, notEmptyCallback) => {
407
407
  const diff = {};
408
- if (_.isEmpty(keys)) {
408
+ if (lodash.isEmpty(keys)) {
409
409
  keys = [];
410
410
  options = { ...options, keyExcludes: true };
411
411
  }
@@ -418,28 +418,28 @@ const changes = (sourceValue, currentValue, keys, options, finallyCallback, notE
418
418
  }
419
419
  }
420
420
  const targetKeys = options?.keyExcludes === true
421
- ? _.difference(_.uniq([...Object.keys(sourceValue), ...Object.keys(currentValue)]), keys)
421
+ ? lodash.difference(lodash.uniq([...Object.keys(sourceValue), ...Object.keys(currentValue)]), keys)
422
422
  : keys;
423
423
  for (const key of targetKeys) {
424
- const v1 = options?.keyExcludes === true ? sourceValue[key] : _.get(sourceValue, key);
425
- const v2 = options?.keyExcludes === true ? currentValue[key] : _.get(currentValue, key);
426
- if (_.isNil(v1) && _.isNil(v2))
424
+ const v1 = options?.keyExcludes === true ? sourceValue[key] : lodash.get(sourceValue, key);
425
+ const v2 = options?.keyExcludes === true ? currentValue[key] : lodash.get(currentValue, key);
426
+ if (lodash.isNil(v1) && lodash.isNil(v2))
427
427
  continue;
428
- if (_.isNil(v1) || _.isNil(v2)) {
428
+ if (lodash.isNil(v1) || lodash.isNil(v2)) {
429
429
  if (options?.keyExcludes === true) {
430
430
  diff[key] = v2 ?? null;
431
431
  }
432
432
  else {
433
- _.set(diff, key, v2 ?? null);
433
+ lodash.set(diff, key, v2 ?? null);
434
434
  }
435
435
  continue;
436
436
  }
437
- if (!_.isEqual(v1, v2)) {
437
+ if (!lodash.isEqual(v1, v2)) {
438
438
  if (options?.keyExcludes === true) {
439
439
  diff[key] = v2 ?? null;
440
440
  }
441
441
  else {
442
- _.set(diff, key, v2 ?? null);
442
+ lodash.set(diff, key, v2 ?? null);
443
443
  }
444
444
  }
445
445
  }
@@ -559,7 +559,7 @@ const arrayDepth = (ary) => {
559
559
  if (!Array.isArray(ary)) {
560
560
  return 0;
561
561
  }
562
- if (_.size(ary) === 0) {
562
+ if (lodash.size(ary) === 0) {
563
563
  return 1;
564
564
  }
565
565
  return 1 + Math.min(...ary.map(arrayDepth));
@@ -568,7 +568,7 @@ const arrayDepth = (ary) => {
568
568
  * Extends ansuko with a plugin and returns the augmented instance.
569
569
  * @param plugin - Plugin function
570
570
  * @returns Extended instance
571
- * @example const extended = _.extend(jaPlugin)
571
+ * @example const extended = lodash.extend(jaPlugin)
572
572
  * @category Core Functions
573
573
  */
574
574
  const extend = function (plugin) {
@@ -578,12 +578,13 @@ const extend = function (plugin) {
578
578
  return this;
579
579
  };
580
580
  // Ansuko型へのキャストを外し、より安全な unknown as LoDashStatic に変更
581
- export default {
582
- ..._,
581
+ // 変数名を _ にすることで、VS Code の auto import 候補が `_` として表示される
582
+ const _ = {
583
+ ...lodash,
583
584
  extend,
584
- isEmptyOrg: _.isEmpty,
585
- toNumberOrg: _.toNumber,
586
- castArrayOrg: _.castArray,
585
+ isEmptyOrg: lodash.isEmpty,
586
+ toNumberOrg: lodash.toNumber,
587
+ castArrayOrg: lodash.castArray,
587
588
  strWrap,
588
589
  isEmpty,
589
590
  toNumber,
@@ -603,5 +604,6 @@ export default {
603
604
  swallowMap,
604
605
  arrayDepth,
605
606
  };
607
+ export default _;
606
608
  // 個別エクスポートはそのまま
607
609
  export { isEmpty, toNumber, boolIf, isValidStr, valueOr, equalsOr, waited, parseJSON, jsonStringify, castArray, changes, strWrap, swallow, swallowMap, arrayDepth, };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ansuko",
3
- "version": "1.3.11",
3
+ "version": "1.3.15",
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",