cafe-utility 2.2.0 → 4.0.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/index.d.ts +480 -0
- package/index.js +706 -499
- package/module.mjs +1 -0
- package/package.json +3 -2
package/index.d.ts
ADDED
|
@@ -0,0 +1,480 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import * as ChildProcess from 'child_process';
|
|
3
|
+
import { ExecOptions } from 'child_process';
|
|
4
|
+
declare type Indexable = number | string;
|
|
5
|
+
declare type CafeObject<T = unknown> = Record<string, T>;
|
|
6
|
+
declare function invertPromise<T>(promise: Promise<T>): Promise<unknown>;
|
|
7
|
+
declare function raceFulfilled<T>(promises: Promise<T>[]): Promise<void>;
|
|
8
|
+
declare function runInParallelBatches<T>(promises: (() => Promise<T>)[], concurrency?: number): Promise<T[]>;
|
|
9
|
+
declare function sleepMillis(millis: number): Promise<unknown>;
|
|
10
|
+
declare function shuffle<T>(array: T[]): T[];
|
|
11
|
+
declare function onlyOrThrow<T>(array: T[]): T;
|
|
12
|
+
declare function onlyOrNull<T>(array: T[]): T | null;
|
|
13
|
+
declare function firstOrNull<T>(array: T[]): T | null;
|
|
14
|
+
declare function initializeArray<T>(count: number, initializer: (index: number) => T): T[];
|
|
15
|
+
declare function takeRandomly<T>(array: T[], count: number): T[];
|
|
16
|
+
declare function pluck<T, K extends keyof T>(array: T[], key: K): T[K][];
|
|
17
|
+
declare function randomIntInclusive(min: number, max: number): number;
|
|
18
|
+
declare function randomBetween(min: number, max: number): number;
|
|
19
|
+
declare function signedRandom(): number;
|
|
20
|
+
declare function chance(threshold: number): boolean;
|
|
21
|
+
declare function pick<T>(array: T[]): T;
|
|
22
|
+
declare function last<T>(array: T[]): T;
|
|
23
|
+
declare function pickWeighted<T>(array: T[], weights: number[], randomNumber?: number): T;
|
|
24
|
+
declare function sortWeighted<T>(array: T[], weights: number[]): T[];
|
|
25
|
+
declare function getDeep(object: CafeObject, path: string): unknown;
|
|
26
|
+
declare function getDeepOrElse(object: CafeObject, path: string, fallback: unknown): unknown;
|
|
27
|
+
declare function setDeep<T>(object: CafeObject, path: string, value: T): T;
|
|
28
|
+
declare function ensureDeep(object: CafeObject, path: string, value: unknown): unknown;
|
|
29
|
+
declare function deleteDeep(object: CafeObject, path: string): void;
|
|
30
|
+
declare function replaceDeep(object: CafeObject, path: string, value: unknown): unknown;
|
|
31
|
+
declare function getFirstDeep(object: CafeObject, paths: string[], fallbackToAnyKey: string): unknown;
|
|
32
|
+
declare function forever(callable: () => Promise<never>, millis: number): Promise<never>;
|
|
33
|
+
declare function readUtf8FileAsync(path: string): Promise<string>;
|
|
34
|
+
declare function readJsonAsync(path: string): Promise<CafeObject>;
|
|
35
|
+
declare function writeJsonAsync(path: string, object: CafeObject, prettify?: boolean): Promise<void>;
|
|
36
|
+
declare function readLinesAsync(path: string): Promise<string[]>;
|
|
37
|
+
declare function readMatchingLines(path: string, filterFn: (matcher: string) => boolean): Promise<string[]>;
|
|
38
|
+
declare function readNonEmptyLines(path: string): Promise<string[]>;
|
|
39
|
+
declare function readCsv(path: string, skip?: number, delimiter?: string, quote?: string): Promise<string[][]>;
|
|
40
|
+
declare function walkTreeAsync(path: string): AsyncIterable<string>;
|
|
41
|
+
declare function readdirDeepAsync(path: string, cwd: string): Promise<string[]>;
|
|
42
|
+
declare function existsAsync(path: string): Promise<boolean>;
|
|
43
|
+
declare function getFileSize(path: string): Promise<number>;
|
|
44
|
+
declare function asMegabytes(number: number): number;
|
|
45
|
+
declare function getDirectorySize(path: string): Promise<number>;
|
|
46
|
+
declare function convertBytes(bytes: number): string;
|
|
47
|
+
declare function getChecksum(data: string): string;
|
|
48
|
+
declare function getChecksumOfFile(path: string): Promise<string>;
|
|
49
|
+
declare function isObject(value: any): value is object;
|
|
50
|
+
declare function isStrictlyObject(value: any): value is object;
|
|
51
|
+
declare function isEmptyArray(value: any): boolean;
|
|
52
|
+
declare function isUndefined(value: any): value is undefined;
|
|
53
|
+
declare function isFunction(value: any): value is Function;
|
|
54
|
+
declare function isString(value: any): value is string;
|
|
55
|
+
declare function isNumber(value: any): value is number;
|
|
56
|
+
declare function isDate(value: any): value is Date;
|
|
57
|
+
declare function isBlank(value: any): boolean;
|
|
58
|
+
declare function randomLetterString(length: number): string;
|
|
59
|
+
declare function randomAlphanumericString(length: number): string;
|
|
60
|
+
declare function randomRichAsciiString(length: number): string;
|
|
61
|
+
declare function randomUnicodeString(length: number): string;
|
|
62
|
+
declare function randomHexString(length: number): string;
|
|
63
|
+
declare function asString(string: any): string;
|
|
64
|
+
declare function asNumber(number: any): number;
|
|
65
|
+
declare function asDate(date: any): Date;
|
|
66
|
+
declare function asNullableString(string: any): string | null;
|
|
67
|
+
declare function createLogger(module: string): {
|
|
68
|
+
trace: (...pieces: string[]) => void;
|
|
69
|
+
info: (...pieces: string[]) => void;
|
|
70
|
+
warn: (...pieces: string[]) => void;
|
|
71
|
+
error: (...pieces: string[]) => void;
|
|
72
|
+
errorObject: (error: Error, stackTrace?: boolean) => void;
|
|
73
|
+
};
|
|
74
|
+
declare function enableFileLogging(path: string): void;
|
|
75
|
+
declare function expandError(error: string | Error, stackTrace?: boolean): string;
|
|
76
|
+
declare function mergeDeep(target: CafeObject, source: CafeObject): CafeObject;
|
|
77
|
+
declare function zip<T>(objects: CafeObject<T>[], reducer: (a: T, b: T) => T): CafeObject<T>;
|
|
78
|
+
declare function zipSum(objects: CafeObject<number>[]): CafeObject<number>;
|
|
79
|
+
declare function asPageNumber(value: any): number;
|
|
80
|
+
declare function pushToBucket<T>(object: Record<string, T[]>, bucket: string, item: T): void;
|
|
81
|
+
declare function unshiftAndLimit<T>(array: T[], item: T, limit: number): void;
|
|
82
|
+
declare function atRolling<T>(array: T[], index: number): T;
|
|
83
|
+
declare function pushAll<T>(array: T[], elements: T[]): void;
|
|
84
|
+
declare function unshiftAll<T>(array: T[], elements: T[]): void;
|
|
85
|
+
declare function mapAllAsync<T, K>(array: T[], fn: (value: T) => Promise<K>): Promise<K[]>;
|
|
86
|
+
declare function glue<T, K>(array: T[], glueElement: K | (() => K)): (T | K)[];
|
|
87
|
+
interface Page<T> {
|
|
88
|
+
data: T[];
|
|
89
|
+
pageSize: number;
|
|
90
|
+
totalPages: number;
|
|
91
|
+
totalElements: number;
|
|
92
|
+
currentPage: number;
|
|
93
|
+
}
|
|
94
|
+
declare function pageify<T>(data: T[], totalElements: number, pageSize: number, currentPage: number): Page<T>;
|
|
95
|
+
declare function asEqual<A>(a: A, b: A): [A, A];
|
|
96
|
+
declare function asTrue(data: any): true;
|
|
97
|
+
declare function asTruthy<T>(data: T): T;
|
|
98
|
+
declare function asFalse(data: any): false;
|
|
99
|
+
declare function asFalsy<T>(data: T): T;
|
|
100
|
+
declare function asEither(data: string, values: string[]): string;
|
|
101
|
+
declare function scheduleMany<T>(handlers: (() => T)[], dates: Date[]): void;
|
|
102
|
+
declare function interpolate(a: number, b: number, t: number): number;
|
|
103
|
+
declare function sum(array: number[]): number;
|
|
104
|
+
declare function average(array: number[]): number;
|
|
105
|
+
declare function range(start: number, end: number): number[];
|
|
106
|
+
declare function includesAny(string: string, substrings: string[]): boolean;
|
|
107
|
+
declare function slugify(string: string): string;
|
|
108
|
+
declare function camelToTitle(string: string): string;
|
|
109
|
+
declare function slugToTitle(string: string): string;
|
|
110
|
+
declare function slugToCamel(string: string): string;
|
|
111
|
+
declare function joinHumanly(parts: string[], separator?: string, lastSeparator?: string): null | string;
|
|
112
|
+
declare function surroundInOut(string: string, filler: string): string;
|
|
113
|
+
declare function enumify(string: string): string;
|
|
114
|
+
declare function getFuzzyMatchScore(string: string, input: string): number;
|
|
115
|
+
declare function sortByFuzzyScore(strings: string[], input: string): string[];
|
|
116
|
+
declare function escapeHtml(string: string): string;
|
|
117
|
+
declare function decodeHtmlEntities(string: string): string;
|
|
118
|
+
declare function before(string: string, searchString: string): string;
|
|
119
|
+
declare function after(string: string, searchString: string): string;
|
|
120
|
+
declare function beforeLast(string: string, searchString: string): string;
|
|
121
|
+
declare function afterLast(string: string, searchString: string): string;
|
|
122
|
+
declare function between(string: string, start: string, end: string): string;
|
|
123
|
+
declare function betweenWide(string: string, start: string, end: string): string;
|
|
124
|
+
declare function betweenNarrow(string: string, start: string, end: string): string;
|
|
125
|
+
declare function splitOnce(string: string, separator: string): [string, string];
|
|
126
|
+
declare function getExtension(path: string): string;
|
|
127
|
+
declare function getBasename(path: string): string;
|
|
128
|
+
declare function normalizeFilename(path: string): string;
|
|
129
|
+
interface ParsedFilename {
|
|
130
|
+
basename: string;
|
|
131
|
+
extension: string;
|
|
132
|
+
filename: string;
|
|
133
|
+
}
|
|
134
|
+
declare function parseFilename(string: string): ParsedFilename;
|
|
135
|
+
declare function randomize(string: string): string;
|
|
136
|
+
declare function shrinkTrim(string: string): string;
|
|
137
|
+
declare function capitalize(string: string): string;
|
|
138
|
+
declare function decapitalize(string: string): string;
|
|
139
|
+
declare function csvEscape(string: string): string;
|
|
140
|
+
declare function parseCsv(string: string, delimiter?: string, quote?: string): string[];
|
|
141
|
+
declare function humanizeProgress(state: Progress): string;
|
|
142
|
+
declare function waitFor(predicate: () => Promise<boolean>, waitLength: number, maxWaits: number): Promise<boolean>;
|
|
143
|
+
declare function mkdirp(path: string): Promise<void>;
|
|
144
|
+
declare function filterAndRemove<T>(array: T[], predicate: (item: T) => boolean): T[];
|
|
145
|
+
declare function execAsync(command: string, resolveWithErrors: boolean, inherit: boolean, options: ExecOptions): Promise<{
|
|
146
|
+
stdout: string;
|
|
147
|
+
stderr: string;
|
|
148
|
+
error?: string | Error;
|
|
149
|
+
}>;
|
|
150
|
+
declare function runProcess(command: string, args: string[], options: ChildProcess.SpawnOptions, onStdout: (chunk: string) => void, onStderr: (chunk: string) => void): Promise<number>;
|
|
151
|
+
declare function cloneWithJson<T>(a: T): T;
|
|
152
|
+
declare function unixTimestamp(optionalTimestamp?: number): number;
|
|
153
|
+
declare function isoDate(optionalDate?: Date): string;
|
|
154
|
+
declare function dateTimeSlug(optionalDate?: Date): string;
|
|
155
|
+
declare function fromUtcString(string: string): Date;
|
|
156
|
+
declare function createTimeDigits(value: number): string;
|
|
157
|
+
declare function humanizeTime(millis: number): string;
|
|
158
|
+
declare function getAgo(date: Date, now?: number): string;
|
|
159
|
+
interface WrappedNumber {
|
|
160
|
+
value: number;
|
|
161
|
+
}
|
|
162
|
+
declare function debounce(longWrapper: WrappedNumber, millis: number): boolean;
|
|
163
|
+
declare function timeSince(unit: 's' | 'm' | 'h' | 'd', a: Date | number, optionalB?: Date | number): number;
|
|
164
|
+
interface Progress {
|
|
165
|
+
deltaMs: number;
|
|
166
|
+
progress: number;
|
|
167
|
+
baseTimeMs: number;
|
|
168
|
+
totalTimeMs: number;
|
|
169
|
+
remainingTimeMs: number;
|
|
170
|
+
}
|
|
171
|
+
declare function getProgress(startedAt: number, current: number, total: number, now?: number): Progress;
|
|
172
|
+
declare const dayNumberIndex: {
|
|
173
|
+
0: string;
|
|
174
|
+
1: string;
|
|
175
|
+
2: string;
|
|
176
|
+
3: string;
|
|
177
|
+
4: string;
|
|
178
|
+
5: string;
|
|
179
|
+
6: string;
|
|
180
|
+
};
|
|
181
|
+
interface DayInfo {
|
|
182
|
+
zeroBasedIndex: number;
|
|
183
|
+
day: string;
|
|
184
|
+
}
|
|
185
|
+
declare function mapDayNumber(zeroBasedIndex: keyof typeof dayNumberIndex): DayInfo;
|
|
186
|
+
declare function getDayInfoFromDate(date: Date): DayInfo;
|
|
187
|
+
declare function getDayInfoFromDateTimeString(dateTimeString: string): DayInfo;
|
|
188
|
+
declare function getPreLine(string: string): string;
|
|
189
|
+
declare function containsWord(string: string, word: string): boolean;
|
|
190
|
+
declare function containsWords(string: string, words: string[]): boolean;
|
|
191
|
+
declare function getCached<T>(key: string, ttlMillis: number, handler: () => Promise<T>): Promise<T>;
|
|
192
|
+
declare function joinUrl(...parts: string[]): string;
|
|
193
|
+
declare function sortObject<T>(object: CafeObject<T>): CafeObject<T>;
|
|
194
|
+
declare function sortArray<T>(array: T[]): T[];
|
|
195
|
+
declare function sortAny(any: unknown): unknown;
|
|
196
|
+
declare function deepEquals(a: unknown, b: unknown): boolean;
|
|
197
|
+
declare function safeParse(stringable: string): CafeObject | null;
|
|
198
|
+
interface NumberFormatOptions {
|
|
199
|
+
precision?: number;
|
|
200
|
+
longForm?: boolean;
|
|
201
|
+
unit?: null | string;
|
|
202
|
+
}
|
|
203
|
+
declare function formatNumber(number: number, options?: NumberFormatOptions): string;
|
|
204
|
+
declare function parseIntOrThrow(numberOrString: string | number): number;
|
|
205
|
+
declare function clamp(value: number, lower: number, upper: number): number;
|
|
206
|
+
declare function increment(value: number, change: number, maximum: number): number;
|
|
207
|
+
declare function decrement(value: number, change: number, minimum: number): number;
|
|
208
|
+
interface HeapMegabytes {
|
|
209
|
+
used: string;
|
|
210
|
+
total: string;
|
|
211
|
+
rss: string;
|
|
212
|
+
}
|
|
213
|
+
declare function getHeapMegabytes(): HeapMegabytes;
|
|
214
|
+
declare function runOn<T>(object: T, callable: (object: T) => void): T;
|
|
215
|
+
declare function ifPresent<T>(object: T, callable: (object: T) => void): void;
|
|
216
|
+
declare function mergeArrays(target: CafeObject<unknown[]>, source: CafeObject<unknown[]>): void;
|
|
217
|
+
declare function empty<T>(array: T[]): T[];
|
|
218
|
+
declare function removeEmptyArrays(object: CafeObject): CafeObject;
|
|
219
|
+
declare function removeEmptyValues(object: CafeObject): CafeObject;
|
|
220
|
+
declare function mapObject<T, K>(object: CafeObject<T>, mapper: (value: T) => K): CafeObject<K>;
|
|
221
|
+
declare function rethrow<T>(asyncFn: () => Promise<T>, throwable: Error): Promise<T>;
|
|
222
|
+
declare function setSomeOnObject(object: CafeObject, key: string, value: unknown): void;
|
|
223
|
+
declare function flip(object: Record<string, Indexable>): CafeObject;
|
|
224
|
+
declare function getAllPermutations(object: CafeObject<unknown[]>): CafeObject[];
|
|
225
|
+
declare function countTruthyValues(object: CafeObject): number;
|
|
226
|
+
declare function flatten(object: CafeObject, arrays?: boolean, prefix?: string): CafeObject | Array<unknown>;
|
|
227
|
+
declare function unflatten(object: CafeObject): CafeObject;
|
|
228
|
+
declare function match(value: string, options: CafeObject<string>, fallback: string): string;
|
|
229
|
+
declare function indexArray<T>(array: T[], keyFn: (item: T) => Indexable, useArrays?: boolean): CafeObject<T | T[]>;
|
|
230
|
+
declare function splitBySize<T>(array: T[], size: number): T[][];
|
|
231
|
+
declare function splitByCount<T>(array: T[], count: number): T[][];
|
|
232
|
+
declare function tokenizeByLength(string: string, length: number): string[];
|
|
233
|
+
declare function tokenizeByCount(string: string, count: number): string[];
|
|
234
|
+
declare function makeUnique<T>(array: T[], fn: (item: T) => string): T[];
|
|
235
|
+
declare function countUnique(array: string[], mapper?: (item: string) => string, plain?: boolean, sort?: boolean, reverse?: boolean): CafeObject<number> | string[];
|
|
236
|
+
declare function sortObjectValues<T>(object: CafeObject<T>, compareFn: (a: [string, T], b: [string, T]) => number): CafeObject<T>;
|
|
237
|
+
declare function transformToArray<T>(objectOfArrays: CafeObject<T[]>): CafeObject[];
|
|
238
|
+
declare function incrementMulti<T>(objects: T[], key: keyof T, step?: number): void;
|
|
239
|
+
declare function setMulti<T, K extends keyof T>(objects: T[], key: K, value: T[K]): void;
|
|
240
|
+
interface Index<T> {
|
|
241
|
+
index: CafeObject<T>;
|
|
242
|
+
keys: string[];
|
|
243
|
+
}
|
|
244
|
+
interface FastIndexItem<T> {
|
|
245
|
+
validUntil: number;
|
|
246
|
+
data: T;
|
|
247
|
+
}
|
|
248
|
+
interface FastIndex<T> {
|
|
249
|
+
index: CafeObject<FastIndexItem<T>>;
|
|
250
|
+
keys: string[];
|
|
251
|
+
}
|
|
252
|
+
declare function createFastIndex<T>(): FastIndex<T>;
|
|
253
|
+
declare function pushToFastIndex<T>(object: Index<T>, key: string, item: T, limit?: number): void;
|
|
254
|
+
declare function pushToFastIndexWithExpiracy<T>(object: FastIndex<T>, key: string, item: unknown, expiration: number, limit?: number): void;
|
|
255
|
+
declare function getFromFastIndexWithExpiracy<T>(object: FastIndex<T>, key: string): T | null;
|
|
256
|
+
declare function makeAsyncQueue(concurrency?: number): {
|
|
257
|
+
enqueue(fn: () => Promise<void>): void;
|
|
258
|
+
};
|
|
259
|
+
export declare class Maybe<T> {
|
|
260
|
+
private value;
|
|
261
|
+
constructor(value: T | null);
|
|
262
|
+
bind<K>(fn: (value: T) => K): Maybe<Awaited<K>>;
|
|
263
|
+
valueOf(): Promise<T | null>;
|
|
264
|
+
}
|
|
265
|
+
export declare const Random: {
|
|
266
|
+
inclusiveInt: typeof randomIntInclusive;
|
|
267
|
+
between: typeof randomBetween;
|
|
268
|
+
chance: typeof chance;
|
|
269
|
+
signed: typeof signedRandom;
|
|
270
|
+
};
|
|
271
|
+
export declare const Arrays: {
|
|
272
|
+
countUnique: typeof countUnique;
|
|
273
|
+
makeUnique: typeof makeUnique;
|
|
274
|
+
splitBySize: typeof splitBySize;
|
|
275
|
+
splitByCount: typeof splitByCount;
|
|
276
|
+
index: typeof indexArray;
|
|
277
|
+
onlyOrThrow: typeof onlyOrThrow;
|
|
278
|
+
onlyOrNull: typeof onlyOrNull;
|
|
279
|
+
firstOrNull: typeof firstOrNull;
|
|
280
|
+
shuffle: typeof shuffle;
|
|
281
|
+
takeRandomly: typeof takeRandomly;
|
|
282
|
+
initialize: typeof initializeArray;
|
|
283
|
+
glue: typeof glue;
|
|
284
|
+
pluck: typeof pluck;
|
|
285
|
+
pick: typeof pick;
|
|
286
|
+
last: typeof last;
|
|
287
|
+
pickWeighted: typeof pickWeighted;
|
|
288
|
+
sortWeighted: typeof sortWeighted;
|
|
289
|
+
pushAll: typeof pushAll;
|
|
290
|
+
unshiftAll: typeof unshiftAll;
|
|
291
|
+
filterAndRemove: typeof filterAndRemove;
|
|
292
|
+
merge: typeof mergeArrays;
|
|
293
|
+
empty: typeof empty;
|
|
294
|
+
pushToBucket: typeof pushToBucket;
|
|
295
|
+
unshiftAndLimit: typeof unshiftAndLimit;
|
|
296
|
+
atRolling: typeof atRolling;
|
|
297
|
+
};
|
|
298
|
+
export declare const System: {
|
|
299
|
+
sleepMillis: typeof sleepMillis;
|
|
300
|
+
forever: typeof forever;
|
|
301
|
+
scheduleMany: typeof scheduleMany;
|
|
302
|
+
waitFor: typeof waitFor;
|
|
303
|
+
execAsync: typeof execAsync;
|
|
304
|
+
getHeapMegabytes: typeof getHeapMegabytes;
|
|
305
|
+
expandError: typeof expandError;
|
|
306
|
+
runProcess: typeof runProcess;
|
|
307
|
+
};
|
|
308
|
+
export declare const Numbers: {
|
|
309
|
+
sum: typeof sum;
|
|
310
|
+
average: typeof average;
|
|
311
|
+
clamp: typeof clamp;
|
|
312
|
+
range: typeof range;
|
|
313
|
+
interpolate: typeof interpolate;
|
|
314
|
+
createSequence: () => {
|
|
315
|
+
next: () => number;
|
|
316
|
+
};
|
|
317
|
+
increment: typeof increment;
|
|
318
|
+
decrement: typeof decrement;
|
|
319
|
+
format: typeof formatNumber;
|
|
320
|
+
parseIntOrThrow: typeof parseIntOrThrow;
|
|
321
|
+
};
|
|
322
|
+
export declare const Promises: {
|
|
323
|
+
raceFulfilled: typeof raceFulfilled;
|
|
324
|
+
invert: typeof invertPromise;
|
|
325
|
+
runInParallelBatches: typeof runInParallelBatches;
|
|
326
|
+
makeAsyncQueue: typeof makeAsyncQueue;
|
|
327
|
+
};
|
|
328
|
+
export declare const Dates: {
|
|
329
|
+
getAgo: typeof getAgo;
|
|
330
|
+
isoDate: typeof isoDate;
|
|
331
|
+
debounce: typeof debounce;
|
|
332
|
+
timeSince: typeof timeSince;
|
|
333
|
+
dateTimeSlug: typeof dateTimeSlug;
|
|
334
|
+
unixTimestamp: typeof unixTimestamp;
|
|
335
|
+
fromUtcString: typeof fromUtcString;
|
|
336
|
+
getProgress: typeof getProgress;
|
|
337
|
+
humanizeTime: typeof humanizeTime;
|
|
338
|
+
humanizeProgress: typeof humanizeProgress;
|
|
339
|
+
createTimeDigits: typeof createTimeDigits;
|
|
340
|
+
mapDayNumber: typeof mapDayNumber;
|
|
341
|
+
getDayInfoFromDate: typeof getDayInfoFromDate;
|
|
342
|
+
getDayInfoFromDateTimeString: typeof getDayInfoFromDateTimeString;
|
|
343
|
+
};
|
|
344
|
+
export declare const Objects: {
|
|
345
|
+
safeParse: typeof safeParse;
|
|
346
|
+
deleteDeep: typeof deleteDeep;
|
|
347
|
+
getDeep: typeof getDeep;
|
|
348
|
+
getDeepOrElse: typeof getDeepOrElse;
|
|
349
|
+
setDeep: typeof setDeep;
|
|
350
|
+
ensureDeep: typeof ensureDeep;
|
|
351
|
+
replaceDeep: typeof replaceDeep;
|
|
352
|
+
getFirstDeep: typeof getFirstDeep;
|
|
353
|
+
mergeDeep: typeof mergeDeep;
|
|
354
|
+
mapAllAsync: typeof mapAllAsync;
|
|
355
|
+
cloneWithJson: typeof cloneWithJson;
|
|
356
|
+
sortObject: typeof sortObject;
|
|
357
|
+
sortArray: typeof sortArray;
|
|
358
|
+
sortAny: typeof sortAny;
|
|
359
|
+
deepEquals: typeof deepEquals;
|
|
360
|
+
runOn: typeof runOn;
|
|
361
|
+
ifPresent: typeof ifPresent;
|
|
362
|
+
zip: typeof zip;
|
|
363
|
+
zipSum: typeof zipSum;
|
|
364
|
+
removeEmptyArrays: typeof removeEmptyArrays;
|
|
365
|
+
removeEmptyValues: typeof removeEmptyValues;
|
|
366
|
+
flatten: typeof flatten;
|
|
367
|
+
unflatten: typeof unflatten;
|
|
368
|
+
match: typeof match;
|
|
369
|
+
sort: typeof sortObjectValues;
|
|
370
|
+
map: typeof mapObject;
|
|
371
|
+
rethrow: typeof rethrow;
|
|
372
|
+
setSomeOnObject: typeof setSomeOnObject;
|
|
373
|
+
flip: typeof flip;
|
|
374
|
+
getAllPermutations: typeof getAllPermutations;
|
|
375
|
+
countTruthyValues: typeof countTruthyValues;
|
|
376
|
+
transformToArray: typeof transformToArray;
|
|
377
|
+
setMulti: typeof setMulti;
|
|
378
|
+
incrementMulti: typeof incrementMulti;
|
|
379
|
+
createFastIndex: typeof createFastIndex;
|
|
380
|
+
pushToFastIndex: typeof pushToFastIndex;
|
|
381
|
+
pushToFastIndexWithExpiracy: typeof pushToFastIndexWithExpiracy;
|
|
382
|
+
getFromFastIndexWithExpiracy: typeof getFromFastIndexWithExpiracy;
|
|
383
|
+
};
|
|
384
|
+
export declare const Pagination: {
|
|
385
|
+
asPageNumber: typeof asPageNumber;
|
|
386
|
+
pageify: typeof pageify;
|
|
387
|
+
};
|
|
388
|
+
export declare const Files: {
|
|
389
|
+
existsAsync: typeof existsAsync;
|
|
390
|
+
writeJsonAsync: typeof writeJsonAsync;
|
|
391
|
+
readdirDeepAsync: typeof readdirDeepAsync;
|
|
392
|
+
readUtf8FileAsync: typeof readUtf8FileAsync;
|
|
393
|
+
readJsonAsync: typeof readJsonAsync;
|
|
394
|
+
readLinesAsync: typeof readLinesAsync;
|
|
395
|
+
readMatchingLines: typeof readMatchingLines;
|
|
396
|
+
readNonEmptyLines: typeof readNonEmptyLines;
|
|
397
|
+
readCsv: typeof readCsv;
|
|
398
|
+
walkTreeAsync: typeof walkTreeAsync;
|
|
399
|
+
getFileSize: typeof getFileSize;
|
|
400
|
+
asMegabytes: typeof asMegabytes;
|
|
401
|
+
getDirectorySize: typeof getDirectorySize;
|
|
402
|
+
convertBytes: typeof convertBytes;
|
|
403
|
+
getChecksum: typeof getChecksumOfFile;
|
|
404
|
+
mkdirp: typeof mkdirp;
|
|
405
|
+
};
|
|
406
|
+
export declare const Types: {
|
|
407
|
+
isFunction: typeof isFunction;
|
|
408
|
+
isObject: typeof isObject;
|
|
409
|
+
isStrictlyObject: typeof isStrictlyObject;
|
|
410
|
+
isEmptyArray: typeof isEmptyArray;
|
|
411
|
+
isUndefined: typeof isUndefined;
|
|
412
|
+
isString: typeof isString;
|
|
413
|
+
isNumber: typeof isNumber;
|
|
414
|
+
isDate: typeof isDate;
|
|
415
|
+
isBlank: typeof isBlank;
|
|
416
|
+
asString: typeof asString;
|
|
417
|
+
asNumber: typeof asNumber;
|
|
418
|
+
asDate: typeof asDate;
|
|
419
|
+
asNullableString: typeof asNullableString;
|
|
420
|
+
};
|
|
421
|
+
export declare const Strings: {
|
|
422
|
+
tokenizeByCount: typeof tokenizeByCount;
|
|
423
|
+
tokenizeByLength: typeof tokenizeByLength;
|
|
424
|
+
randomHex: typeof randomHexString;
|
|
425
|
+
randomLetter: typeof randomLetterString;
|
|
426
|
+
randomAlphanumeric: typeof randomAlphanumericString;
|
|
427
|
+
randomRichAscii: typeof randomRichAsciiString;
|
|
428
|
+
randomUnicode: typeof randomUnicodeString;
|
|
429
|
+
includesAny: typeof includesAny;
|
|
430
|
+
slugify: typeof slugify;
|
|
431
|
+
enumify: typeof enumify;
|
|
432
|
+
escapeHtml: typeof escapeHtml;
|
|
433
|
+
decodeHtmlEntities: typeof decodeHtmlEntities;
|
|
434
|
+
after: typeof after;
|
|
435
|
+
afterLast: typeof afterLast;
|
|
436
|
+
before: typeof before;
|
|
437
|
+
beforeLast: typeof beforeLast;
|
|
438
|
+
between: typeof between;
|
|
439
|
+
betweenWide: typeof betweenWide;
|
|
440
|
+
betweenNarrow: typeof betweenNarrow;
|
|
441
|
+
getPreLine: typeof getPreLine;
|
|
442
|
+
containsWord: typeof containsWord;
|
|
443
|
+
containsWords: typeof containsWords;
|
|
444
|
+
joinUrl: typeof joinUrl;
|
|
445
|
+
getFuzzyMatchScore: typeof getFuzzyMatchScore;
|
|
446
|
+
sortByFuzzyScore: typeof sortByFuzzyScore;
|
|
447
|
+
getChecksum: typeof getChecksum;
|
|
448
|
+
splitOnce: typeof splitOnce;
|
|
449
|
+
randomize: typeof randomize;
|
|
450
|
+
shrinkTrim: typeof shrinkTrim;
|
|
451
|
+
capitalize: typeof capitalize;
|
|
452
|
+
decapitalize: typeof decapitalize;
|
|
453
|
+
csvEscape: typeof csvEscape;
|
|
454
|
+
parseCsv: typeof parseCsv;
|
|
455
|
+
surroundInOut: typeof surroundInOut;
|
|
456
|
+
getExtension: typeof getExtension;
|
|
457
|
+
getBasename: typeof getBasename;
|
|
458
|
+
normalizeFilename: typeof normalizeFilename;
|
|
459
|
+
parseFilename: typeof parseFilename;
|
|
460
|
+
camelToTitle: typeof camelToTitle;
|
|
461
|
+
slugToTitle: typeof slugToTitle;
|
|
462
|
+
slugToCamel: typeof slugToCamel;
|
|
463
|
+
joinHumanly: typeof joinHumanly;
|
|
464
|
+
};
|
|
465
|
+
export declare const Assertions: {
|
|
466
|
+
asEqual: typeof asEqual;
|
|
467
|
+
asTrue: typeof asTrue;
|
|
468
|
+
asTruthy: typeof asTruthy;
|
|
469
|
+
asFalse: typeof asFalse;
|
|
470
|
+
asFalsy: typeof asFalsy;
|
|
471
|
+
asEither: typeof asEither;
|
|
472
|
+
};
|
|
473
|
+
export declare const Cache: {
|
|
474
|
+
get: typeof getCached;
|
|
475
|
+
};
|
|
476
|
+
export declare const Logger: {
|
|
477
|
+
create: typeof createLogger;
|
|
478
|
+
enableFileLogging: typeof enableFileLogging;
|
|
479
|
+
};
|
|
480
|
+
export {};
|