@augment-vir/common 13.2.1 → 13.2.2

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 (97) hide show
  1. package/dist/types/augments/ansi.d.ts +0 -1
  2. package/dist/types/augments/array.d.ts +0 -1
  3. package/dist/types/augments/async.d.ts +0 -1
  4. package/dist/types/augments/common-number.d.ts +0 -1
  5. package/dist/types/augments/common-string.d.ts +0 -1
  6. package/dist/types/augments/date/date.d.ts +0 -1
  7. package/dist/types/augments/date/relative-date.d.ts +0 -1
  8. package/dist/types/augments/environment.d.ts +0 -1
  9. package/dist/types/augments/error.d.ts +0 -1
  10. package/dist/types/augments/function.d.ts +0 -1
  11. package/dist/types/augments/json-compatible.d.ts +0 -1
  12. package/dist/types/augments/json.d.ts +0 -1
  13. package/dist/types/augments/object/enum.d.ts +0 -1
  14. package/dist/types/augments/object/filter-object.d.ts +0 -1
  15. package/dist/types/augments/object/has-key.d.ts +0 -1
  16. package/dist/types/augments/object/jsonify.d.ts +0 -1
  17. package/dist/types/augments/object/map-object.d.ts +0 -1
  18. package/dist/types/augments/object/matches-object-shape.d.ts +0 -1
  19. package/dist/types/augments/object/nested-keys.d.ts +0 -1
  20. package/dist/types/augments/object/object-entries.d.ts +0 -1
  21. package/dist/types/augments/object/object.d.ts +0 -1
  22. package/dist/types/augments/object/pick-deep.d.ts +0 -1
  23. package/dist/types/augments/object/typed-has-property.d.ts +0 -1
  24. package/dist/types/augments/promise.d.ts +0 -1
  25. package/dist/types/augments/regexp.d.ts +0 -1
  26. package/dist/types/augments/runtime-type-of.d.ts +0 -1
  27. package/dist/types/augments/string/url.d.ts +0 -1
  28. package/dist/types/augments/string/uuid.d.ts +0 -1
  29. package/dist/types/augments/truncate-number.d.ts +0 -1
  30. package/dist/types/augments/tuple.d.ts +0 -1
  31. package/dist/types/augments/type.d.ts +0 -1
  32. package/dist/types/index.d.ts +0 -1
  33. package/package.json +4 -4
  34. package/dist/cjs/augments/ansi.d.ts +0 -2
  35. package/dist/cjs/augments/array.d.ts +0 -14
  36. package/dist/cjs/augments/async.d.ts +0 -15
  37. package/dist/cjs/augments/common-number.d.ts +0 -26
  38. package/dist/cjs/augments/common-string.d.ts +0 -45
  39. package/dist/cjs/augments/date/date.d.ts +0 -27
  40. package/dist/cjs/augments/date/relative-date.d.ts +0 -12
  41. package/dist/cjs/augments/environment.d.ts +0 -2
  42. package/dist/cjs/augments/error.d.ts +0 -11
  43. package/dist/cjs/augments/function.d.ts +0 -27
  44. package/dist/cjs/augments/json-compatible.d.ts +0 -23
  45. package/dist/cjs/augments/json.d.ts +0 -6
  46. package/dist/cjs/augments/object/enum.d.ts +0 -5
  47. package/dist/cjs/augments/object/filter-object.d.ts +0 -5
  48. package/dist/cjs/augments/object/has-key.d.ts +0 -2
  49. package/dist/cjs/augments/object/jsonify.d.ts +0 -3
  50. package/dist/cjs/augments/object/map-object.d.ts +0 -25
  51. package/dist/cjs/augments/object/matches-object-shape.d.ts +0 -37
  52. package/dist/cjs/augments/object/nested-keys.d.ts +0 -12
  53. package/dist/cjs/augments/object/object-entries.d.ts +0 -6
  54. package/dist/cjs/augments/object/object.d.ts +0 -13
  55. package/dist/cjs/augments/object/pick-deep.d.ts +0 -8
  56. package/dist/cjs/augments/object/typed-has-property.d.ts +0 -8
  57. package/dist/cjs/augments/promise.d.ts +0 -28
  58. package/dist/cjs/augments/regexp.d.ts +0 -4
  59. package/dist/cjs/augments/runtime-type-of.d.ts +0 -20
  60. package/dist/cjs/augments/string/url.d.ts +0 -8
  61. package/dist/cjs/augments/string/uuid.d.ts +0 -2
  62. package/dist/cjs/augments/truncate-number.d.ts +0 -20
  63. package/dist/cjs/augments/tuple.d.ts +0 -9
  64. package/dist/cjs/augments/type.d.ts +0 -60
  65. package/dist/cjs/index.d.ts +0 -32
  66. package/dist/esm/augments/ansi.d.ts +0 -2
  67. package/dist/esm/augments/array.d.ts +0 -14
  68. package/dist/esm/augments/async.d.ts +0 -15
  69. package/dist/esm/augments/common-number.d.ts +0 -26
  70. package/dist/esm/augments/common-string.d.ts +0 -45
  71. package/dist/esm/augments/date/date.d.ts +0 -27
  72. package/dist/esm/augments/date/relative-date.d.ts +0 -12
  73. package/dist/esm/augments/environment.d.ts +0 -2
  74. package/dist/esm/augments/error.d.ts +0 -11
  75. package/dist/esm/augments/function.d.ts +0 -27
  76. package/dist/esm/augments/json-compatible.d.ts +0 -23
  77. package/dist/esm/augments/json.d.ts +0 -6
  78. package/dist/esm/augments/object/enum.d.ts +0 -5
  79. package/dist/esm/augments/object/filter-object.d.ts +0 -5
  80. package/dist/esm/augments/object/has-key.d.ts +0 -2
  81. package/dist/esm/augments/object/jsonify.d.ts +0 -3
  82. package/dist/esm/augments/object/map-object.d.ts +0 -25
  83. package/dist/esm/augments/object/matches-object-shape.d.ts +0 -37
  84. package/dist/esm/augments/object/nested-keys.d.ts +0 -12
  85. package/dist/esm/augments/object/object-entries.d.ts +0 -6
  86. package/dist/esm/augments/object/object.d.ts +0 -13
  87. package/dist/esm/augments/object/pick-deep.d.ts +0 -8
  88. package/dist/esm/augments/object/typed-has-property.d.ts +0 -8
  89. package/dist/esm/augments/promise.d.ts +0 -28
  90. package/dist/esm/augments/regexp.d.ts +0 -4
  91. package/dist/esm/augments/runtime-type-of.d.ts +0 -20
  92. package/dist/esm/augments/string/url.d.ts +0 -8
  93. package/dist/esm/augments/string/uuid.d.ts +0 -2
  94. package/dist/esm/augments/truncate-number.d.ts +0 -20
  95. package/dist/esm/augments/tuple.d.ts +0 -9
  96. package/dist/esm/augments/type.d.ts +0 -60
  97. package/dist/esm/index.d.ts +0 -32
@@ -1,2 +1 @@
1
1
  export declare const ansiRegex: RegExp;
2
- //# sourceMappingURL=ansi.d.ts.map
@@ -11,4 +11,3 @@ export declare function typedMap<InputArrayGeneric extends ReadonlyArray<any>, O
11
11
  [Index in keyof InputArrayGeneric]: OutputType;
12
12
  };
13
13
  export {};
14
- //# sourceMappingURL=array.d.ts.map
@@ -12,4 +12,3 @@ export declare function awaitedFilter<OriginalGeneric>(arrayInput: ReadonlyArray
12
12
  */
13
13
  blocking?: boolean | undefined;
14
14
  }): Promise<OriginalGeneric[]>;
15
- //# sourceMappingURL=async.d.ts.map
@@ -23,4 +23,3 @@ export declare function ensureMinAndMax({ min, max }: {
23
23
  min: number;
24
24
  max: number;
25
25
  };
26
- //# sourceMappingURL=common-number.d.ts.map
@@ -42,4 +42,3 @@ export declare function getAllIndexesOf<IncludeLength extends boolean | undefine
42
42
  length: number;
43
43
  }[] : number[];
44
44
  export declare function typedSplit(input: string, splitString: string): AtLeastTuple<string, 1>;
45
- //# sourceMappingURL=common-string.d.ts.map
@@ -24,4 +24,3 @@ export declare function createDateFromNamedCommaFormat(commaFormatString: string
24
24
  * @param isoFormatString Should be a date in the format YYYY-MM-DD.
25
25
  */
26
26
  export declare function createDateFromUtcIsoFormat(isoFormatString: string): Date;
27
- //# sourceMappingURL=date.d.ts.map
@@ -9,4 +9,3 @@ export type RelativeDateCalculation = PartialAndUndefined<{
9
9
  years: number;
10
10
  }>;
11
11
  export declare function calculateRelativeDate(startingDate: Date | number | string, calculations: RelativeDateCalculation): Date;
12
- //# sourceMappingURL=relative-date.d.ts.map
@@ -1,2 +1 @@
1
1
  export declare function isBrowser(): boolean;
2
- //# sourceMappingURL=environment.d.ts.map
@@ -8,4 +8,3 @@ export declare function extractErrorMessage(error: unknown): string;
8
8
  export declare function ensureError(input: unknown): Error;
9
9
  export declare function executeAndReturnError<CallbackGeneric extends NoInputsFunction<PromiseLike<any>>>(callback: CallbackGeneric): Promise<Error | UnPromise<ReturnType<CallbackGeneric>>>;
10
10
  export declare function executeAndReturnError<CallbackGeneric extends NoInputsFunction>(callback: CallbackGeneric): Error | ReturnType<CallbackGeneric>;
11
- //# sourceMappingURL=error.d.ts.map
@@ -24,4 +24,3 @@ export type NoInputsFunction<ReturnGeneric = any> = () => ReturnGeneric;
24
24
  */
25
25
  export type TypedFunction<Arguments, Return> = Arguments extends readonly any[] ? number extends Arguments['length'] ? (...args: ArrayElement<Arguments>[]) => Return : (...args: Arguments) => Return : void extends Arguments ? () => Return : (arg: Arguments) => Return;
26
26
  export declare function isTruthy<T>(input: T): input is NonNullable<T>;
27
- //# sourceMappingURL=function.d.ts.map
@@ -20,4 +20,3 @@ export type JsonCompatibleArray = JsonCompatibleValue[]
20
20
  readonly [P in number]: JsonCompatibleValue;
21
21
  } & ReadonlyArray<any>);
22
22
  export type JsonCompatibleValue = JsonCompatiblePrimitiveValue | JsonCompatibleObject | JsonCompatibleArray;
23
- //# sourceMappingURL=json-compatible.d.ts.map
@@ -3,4 +3,3 @@ export declare function parseJson<ParsedJsonGeneric>({ jsonString, errorHandler,
3
3
  errorHandler?: (error: unknown) => never | ParsedJsonGeneric;
4
4
  shapeMatcher?: ParsedJsonGeneric;
5
5
  }): ParsedJsonGeneric;
6
- //# sourceMappingURL=json.d.ts.map
@@ -2,4 +2,3 @@ export declare function getEnumTypedKeys<T extends object>(input: T): (keyof T)[
2
2
  export declare function getEnumTypedValues<T extends object>(input: T): T[keyof T][];
3
3
  export declare function isEnumValue<T extends object>(input: unknown, checkEnum: T): input is T[keyof T];
4
4
  export declare function filterToEnumValues<T extends object>(inputs: ReadonlyArray<unknown>, checkEnum: T, caseInsensitive?: boolean): T[keyof T][];
5
- //# sourceMappingURL=enum.d.ts.map
@@ -2,4 +2,3 @@ import { PropertyValueType } from './object';
2
2
  export declare function filterObject<ObjectGeneric>(inputObject: ObjectGeneric, callback: (key: keyof ObjectGeneric, value: PropertyValueType<ObjectGeneric>, fullObject: ObjectGeneric) => boolean): Partial<ObjectGeneric>;
3
3
  export declare function omitObjectKeys<ObjectGeneric, KeyGeneric extends keyof ObjectGeneric>(inputObject: Readonly<ObjectGeneric>, omitTheseKeys: ReadonlyArray<KeyGeneric>): Omit<ObjectGeneric, KeyGeneric>;
4
4
  export declare function pickObjectKeys<ObjectGeneric, KeyGeneric extends keyof ObjectGeneric>(inputObject: Readonly<ObjectGeneric>, pickTheseKeys: ReadonlyArray<KeyGeneric>): Pick<ObjectGeneric, KeyGeneric>;
5
- //# sourceMappingURL=filter-object.d.ts.map
@@ -1,2 +1 @@
1
1
  export declare function hasKey<ParentType>(parent: ParentType, property: PropertyKey): property is keyof ParentType;
2
- //# sourceMappingURL=has-key.d.ts.map
@@ -1,3 +1,2 @@
1
1
  import { Jsonify } from 'type-fest';
2
2
  export declare function jsonify<InputGeneric>(input: InputGeneric): Jsonify<InputGeneric>;
3
- //# sourceMappingURL=jsonify.d.ts.map
@@ -22,4 +22,3 @@ export declare function mapObjectValuesSync<EntireInputGeneric extends object>(i
22
22
  * result of mapCallback for each property.
23
23
  */
24
24
  export declare function mapObjectValues<EntireInputGeneric extends object, MappedValueGeneric>(inputObject: EntireInputGeneric, mapCallback: (inputKey: keyof EntireInputGeneric, keyValue: EntireInputGeneric[typeof inputKey], fullObject: EntireInputGeneric) => MappedValueGeneric): MappedValues<EntireInputGeneric, MappedValueGeneric>;
25
- //# sourceMappingURL=map-object.d.ts.map
@@ -34,4 +34,3 @@ export type NestedBoolean<MatchObject extends object> = Partial<{
34
34
  * entries in that array.
35
35
  */
36
36
  export declare function assertMatchesObjectShape<MatchThisGeneric extends object = never>(testThisOne: unknown, compareToThisOne: NoInfer<ObjectWithAtLeastSingleEntryArrays<MatchThisGeneric>>, allowExtraProps?: boolean, noCheckInnerValueOfTheseKeys?: NestedBoolean<typeof compareToThisOne>): asserts testThisOne is MatchThisGeneric;
37
- //# sourceMappingURL=matches-object-shape.d.ts.map
@@ -9,4 +9,3 @@ export type NestedKeys<ObjectGeneric extends object> = UnionToIntersection<Extra
9
9
  ] : [keyof ObjectGeneric];
10
10
  export type NestedValue<ObjectGeneric extends object, NestedKeysGeneric extends NestedSequentialKeys<ObjectGeneric>> = NestedKeysGeneric extends readonly [infer FirstEntry, ...infer FollowingEntries] ? FirstEntry extends keyof ObjectGeneric ? FollowingEntries extends never[] ? ObjectGeneric[FirstEntry] : ObjectGeneric[FirstEntry] extends object ? FollowingEntries extends NestedSequentialKeys<ObjectGeneric[FirstEntry]> ? NestedValue<ObjectGeneric[FirstEntry], FollowingEntries> : never : never : never : never;
11
11
  export declare function getValueFromNestedKeys<ObjectGeneric extends object, KeysGeneric extends NestedSequentialKeys<ObjectGeneric>>(inputObject: ObjectGeneric, nestedKeys: KeysGeneric): NestedValue<ObjectGeneric, KeysGeneric> | undefined;
12
- //# sourceMappingURL=nested-keys.d.ts.map
@@ -3,4 +3,3 @@ export declare function getObjectTypedKeys<ObjectGeneric extends unknown>(input:
3
3
  export declare function getObjectTypedValues<ObjectGeneric extends unknown>(input: ObjectGeneric): ObjectGeneric[keyof ObjectGeneric][];
4
4
  export declare function getEntriesSortedByKey(input: object): [string, unknown][];
5
5
  export declare function typedObjectFromEntries<KeyType extends PropertyKey, ValueType>(entries: ReadonlyArray<Readonly<[KeyType, ValueType]>>): Record<KeyType, ValueType>;
6
- //# sourceMappingURL=object-entries.d.ts.map
@@ -10,4 +10,3 @@ export declare function areJsonEqual(a: Readonly<JsonCompatibleValue | undefined
10
10
  /** The input here must be serializable otherwise JSON parsing errors will be thrown */
11
11
  export declare function copyThroughJson<T>(input: T): T;
12
12
  export type PropertyValueType<T> = T[keyof T];
13
- //# sourceMappingURL=object.d.ts.map
@@ -5,4 +5,3 @@ type InnerPickDeep<OriginalObjectGeneric extends object, DeepKeys extends any[]>
5
5
  } : DeepKeys extends [infer CurrentLevelPick] ? CurrentLevelPick extends keyof OriginalObjectGeneric ? Pick<OriginalObjectGeneric, CurrentLevelPick> : never : never>;
6
6
  export type PickDeep<OriginalObjectGeneric extends object, DeepKeys extends NestedKeys<OriginalObjectGeneric>> = InnerPickDeep<OriginalObjectGeneric, DeepKeys>;
7
7
  export {};
8
- //# sourceMappingURL=pick-deep.d.ts.map
@@ -5,4 +5,3 @@ type CombineTypeWithKey<KeyGeneric extends PropertyKey, ParentGeneric> = ParentG
5
5
  export declare function typedHasProperty<KeyGeneric extends PropertyKey, ParentGeneric>(inputObject: ParentGeneric, inputKey: KeyGeneric): inputObject is CombineTypeWithKey<KeyGeneric, ParentGeneric>;
6
6
  export declare function typedHasProperties<KeyGeneric extends PropertyKey, ParentGeneric>(inputObject: ParentGeneric, inputKeys: ReadonlyArray<KeyGeneric>): inputObject is CombineTypeWithKey<KeyGeneric, ParentGeneric>;
7
7
  export {};
8
- //# sourceMappingURL=typed-has-property.d.ts.map
@@ -25,4 +25,3 @@ export type WaitForConditionInputs = {
25
25
  timeoutMessage?: string;
26
26
  };
27
27
  export declare function waitForCondition({ conditionCallback, timeoutMs, intervalMs, timeoutMessage, }: WaitForConditionInputs): Promise<void>;
28
- //# sourceMappingURL=promise.d.ts.map
@@ -1,4 +1,3 @@
1
1
  export declare function deDupeRegExFlags(flags: string): string;
2
2
  export declare function addRegExpFlags(originalRegExp: RegExp, flags: string): RegExp;
3
3
  export declare function safeMatch(input: string, regExp: RegExp): string[];
4
- //# sourceMappingURL=regexp.d.ts.map
@@ -17,4 +17,3 @@ export declare function getRuntimeTypeOf(input: unknown): RuntimeTypeOf;
17
17
  export declare function isRuntimeTypeOf<T extends RuntimeTypeOf>(input: unknown, testType: T): input is RuntimeTypeOfMapping[T];
18
18
  export declare function assertRuntimeTypeOf<T extends RuntimeTypeOf>(input: unknown, testType: T, inputName: string): asserts input is RuntimeTypeOfMapping[T];
19
19
  export {};
20
- //# sourceMappingURL=runtime-type-of.d.ts.map
@@ -5,4 +5,3 @@
5
5
  * @example: joinToUrl('https://example.com', 'path1', 'path2/', '/path3/') === 'https://example.com/path1/path2/path3/'
6
6
  */
7
7
  export declare function joinUrlParts(...urlParts: ReadonlyArray<string>): string;
8
- //# sourceMappingURL=url.d.ts.map
@@ -1,2 +1 @@
1
1
  export declare function isUuid(maybeUuid: string): boolean;
2
- //# sourceMappingURL=uuid.d.ts.map
@@ -17,4 +17,3 @@ export declare function truncateNumber(originalValue: Readonly<unknown>, { custo
17
17
  customSuffixes: ReadonlyArray<string> | undefined;
18
18
  maxLength: number | undefined;
19
19
  }>): string;
20
- //# sourceMappingURL=truncate-number.d.ts.map
@@ -6,4 +6,3 @@ export type AtLeastTuple<ArrayElementGeneric, LengthGeneric extends number> = re
6
6
  ];
7
7
  export declare function isLengthAtLeast<ArrayElementGeneric, LengthGeneric extends number>(array: ReadonlyArray<ArrayElementGeneric | undefined>, length: LengthGeneric): array is AtLeastTuple<ArrayElementGeneric, LengthGeneric>;
8
8
  export {};
9
- //# sourceMappingURL=tuple.d.ts.map
@@ -57,4 +57,3 @@ export type NoInfer<T> = [T][T extends any ? 0 : never];
57
57
  * input.
58
58
  */
59
59
  export declare function ensureType<ExpectedType = never>(input: NoInfer<ExpectedType>): NoInfer<ExpectedType>;
60
- //# sourceMappingURL=type.d.ts.map
@@ -29,4 +29,3 @@ export * from './augments/string/uuid';
29
29
  export * from './augments/truncate-number';
30
30
  export * from './augments/tuple';
31
31
  export * from './augments/type';
32
- //# sourceMappingURL=index.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@augment-vir/common",
3
- "version": "13.2.1",
3
+ "version": "13.2.2",
4
4
  "homepage": "https://github.com/electrovir/augment-vir/tree/main/packages/common",
5
5
  "bugs": {
6
6
  "url": "https://github.com/electrovir/augment-vir/issues"
@@ -18,16 +18,16 @@
18
18
  "module": "dist/esm/index.js",
19
19
  "types": "dist/types/index.d.ts",
20
20
  "scripts": {
21
- "compile": "tsc --project tsconfig.json && tsc --project tsconfig.cjs.json && tsc --project tsconfig.esm.json",
21
+ "compile": "tsc --project tsconfig.json && tsc --project tsconfig.cjs.json",
22
22
  "test": "echo \"use common-test to run tests\" && exit 0",
23
23
  "test:coverage": "npm test",
24
24
  "test:types": "tsc --noEmit"
25
25
  },
26
26
  "dependencies": {
27
- "type-fest": "^3.6.1"
27
+ "type-fest": "^3.7.2"
28
28
  },
29
29
  "devDependencies": {
30
- "typescript": "^4.9.5"
30
+ "typescript": "^5.0.2"
31
31
  },
32
32
  "publishConfig": {
33
33
  "access": "public"
@@ -1,2 +0,0 @@
1
- export declare const ansiRegex: RegExp;
2
- //# sourceMappingURL=ansi.d.ts.map
@@ -1,14 +0,0 @@
1
- import { AtLeastTuple } from './tuple';
2
- import { ArrayElement } from './type';
3
- export declare function filterOutIndexes<T>(array: ReadonlyArray<T>, indexes: ReadonlyArray<number>): T[];
4
- export declare function flatten2dArray<T>(array2d: ReadonlyArray<ReadonlyArray<T>>): T[];
5
- export type AtLeastOneEntryArray<ArrayGeneric extends ReadonlyArray<any>> = AtLeastTuple<ArrayElement<ArrayGeneric>, 1>;
6
- export declare function trimArrayStrings(input: ReadonlyArray<string>): string[];
7
- export declare function typedArrayIncludes<T>(array: ReadonlyArray<T>, input: unknown): input is T;
8
- type MapCallbackType<ArrayType extends ReadonlyArray<any>, OutputType> = (value: ArrayElement<ArrayType>, index: number, array: ArrayType) => OutputType;
9
- /** Preserves tuple types. */
10
- export declare function typedMap<InputArrayGeneric extends ReadonlyArray<any>, OutputType>(arrayToMap: InputArrayGeneric, mapCallback: MapCallbackType<InputArrayGeneric, OutputType>): {
11
- [Index in keyof InputArrayGeneric]: OutputType;
12
- };
13
- export {};
14
- //# sourceMappingURL=array.d.ts.map
@@ -1,15 +0,0 @@
1
- /**
2
- * Acts like calling Array.prototype.forEach in that all elements are executed upon in order, and
3
- * each execution is blocking. Meaning, the callback won't be called on element 2 until the callback
4
- * has finished its call on element 1.
5
- */
6
- export declare function awaitedForEach<OriginalGeneric>(input: ReadonlyArray<OriginalGeneric>, callback: (arrayElement: OriginalGeneric, index: number, wholeArray: ReadonlyArray<OriginalGeneric>) => void | PromiseLike<void>): Promise<void>;
7
- export declare function awaitedBlockingMap<OriginalGeneric, MappedGeneric>(input: ReadonlyArray<OriginalGeneric>, callback: (arrayElement: OriginalGeneric, index: number, wholeArray: ReadonlyArray<OriginalGeneric>) => MappedGeneric | PromiseLike<MappedGeneric>): Promise<Awaited<MappedGeneric>[]>;
8
- export declare function awaitedFilter<OriginalGeneric>(arrayInput: ReadonlyArray<OriginalGeneric>, filterCallback: (arrayElement: OriginalGeneric, index: number, wholeArray: ReadonlyArray<OriginalGeneric>) => Promise<unknown>, options?: {
9
- /**
10
- * Each call to the filter callback is blocking, meaning the next one won't start until the
11
- * current one finishes. By default this is false.
12
- */
13
- blocking?: boolean | undefined;
14
- }): Promise<OriginalGeneric[]>;
15
- //# sourceMappingURL=async.d.ts.map
@@ -1,26 +0,0 @@
1
- export declare const NaNString: string;
2
- export declare function addCommasToNumber(input: number | string): string;
3
- export declare function clamp(
4
- /**
5
- * This uses a destructured object so that consumers cannot get confused as to which input is
6
- * which (which would be easy to do since they're all of the same type).
7
- */
8
- { value, min, max, }: {
9
- value: number;
10
- min: number;
11
- max: number;
12
- }): number;
13
- export declare function convertIntoNumber(input: unknown): number;
14
- export declare function doesRequireScientificNotation(input: number): boolean;
15
- /**
16
- * Given a min and max, ensures that they are in correct order. Meaning, min is less than max. If
17
- * that is not the case, the returned value is the given min and max values swapped.
18
- */
19
- export declare function ensureMinAndMax({ min, max }: {
20
- min: number;
21
- max: number;
22
- }): {
23
- min: number;
24
- max: number;
25
- };
26
- //# sourceMappingURL=common-number.d.ts.map
@@ -1,45 +0,0 @@
1
- import { AtLeastTuple } from './tuple';
2
- /**
3
- * Join elements into a string with commas separating each value. Add a conjunction before the final
4
- * item in the list. If the array has a length < 2, the conjunction is not added. If the list is
5
- * only of length 2, then no commas are added.
6
- *
7
- * @param list Array of items to be converted into strings. Works best if these are simply strings
8
- * to begin with.
9
- * @param conjunction Defaults to 'and'. The conjunction to be used before the final element.
10
- */
11
- export declare function joinWithFinalConjunction(list: ReadonlyArray<any>, conjunction?: string): string;
12
- export declare function removeAnsiEscapeCodes(input: string): string;
13
- export declare const removeColor: typeof removeAnsiEscapeCodes;
14
- export declare function removeCommasFromNumberString(numberString: string): string;
15
- /** Collapse all consecutive white space into just one space and trim surrounding whitespace. */
16
- export declare function collapseWhiteSpace(input: string): string;
17
- /** Same as String.prototype.split but includes the delimiter to split by in the output array. */
18
- export declare function splitIncludeSplit(original: string, splitterInput: string | RegExp, caseSensitive: boolean): readonly string[];
19
- export type CasingOptions = {
20
- capitalizeFirstLetter: boolean;
21
- };
22
- export declare function capitalizeFirstLetter<InputGeneric extends string>(input: InputGeneric): Capitalize<InputGeneric>;
23
- export declare function kebabCaseToCamelCase(rawKebabCase: string, casingOptions?: Partial<CasingOptions> | undefined): string;
24
- export declare function camelCaseToKebabCase(rawCamelCase: string): string;
25
- export declare function replaceStringAtIndex(originalString: string, start: number, newString: string, length?: number): string;
26
- /**
27
- * Escapes characters from the given string so that it can be used within a RegExp without being
28
- * parsed as RegExp syntax.
29
- */
30
- export declare function escapeStringForRegExp(input: string): string;
31
- export declare function getAllIndexesOf<IncludeLength extends boolean | undefined>({ searchIn, searchFor, caseSensitive, includeLength, }: {
32
- searchIn: string;
33
- searchFor: string | RegExp;
34
- /**
35
- * CaseSensitive only applies when the input is a string. Otherwise, the RegExp's "i" flag is
36
- * used to determine case sensitivity.
37
- */
38
- caseSensitive: boolean;
39
- includeLength?: IncludeLength;
40
- }): IncludeLength extends true ? {
41
- index: number;
42
- length: number;
43
- }[] : number[];
44
- export declare function typedSplit(input: string, splitString: string): AtLeastTuple<string, 1>;
45
- //# sourceMappingURL=common-string.d.ts.map
@@ -1,27 +0,0 @@
1
- export declare const englishFullMonthNames: readonly ["january", "february", "march", "april", "may", "june", "july", "august", "september", "october", "november", "december"];
2
- export declare const englishShortMonthNames: string[];
3
- export declare class InvalidDateError extends Error {
4
- readonly name = "InvalidDateError";
5
- }
6
- /**
7
- * @param slashFormatString String that should be of format "MM/DD/YY", "MM/DD/YYYY". When the year
8
- * portion only contains 2 numbers ("MM/DD/YY") the century must be provided in the form of the
9
- * yearPrefix input.
10
- * @param yearPrefix String or number that is used to prefix slash format strings that only contain
11
- * 2 digits ("MM/DD/YY"). If the year is entirely missing form the given slash format string, the
12
- * year will default to year 00 of the given century. See test file for examples.
13
- */
14
- export declare function createDateFromSlashFormat(slashFormatString: string, yearPrefix?: number | string): Date;
15
- /**
16
- * @param commaFormatString Should be at string of the form "monthName dayNumber, fullYear" Example:
17
- * "May 19, 2005"
18
- * @param ignoreInvalidMonth Set to true to ignore invalid months and just use the current UTC month
19
- */
20
- export declare function createDateFromNamedCommaFormat(commaFormatString: string, ignoreInvalidMonth?: boolean): Date;
21
- /**
22
- * Converts an iso-formatted string to a UTC date object. The time is nulled out to all zeros.
23
- *
24
- * @param isoFormatString Should be a date in the format YYYY-MM-DD.
25
- */
26
- export declare function createDateFromUtcIsoFormat(isoFormatString: string): Date;
27
- //# sourceMappingURL=date.d.ts.map
@@ -1,12 +0,0 @@
1
- import { PartialAndUndefined } from '../..';
2
- export type RelativeDateCalculation = PartialAndUndefined<{
3
- milliseconds: number;
4
- seconds: number;
5
- minutes: number;
6
- hours: number;
7
- days: number;
8
- months: number;
9
- years: number;
10
- }>;
11
- export declare function calculateRelativeDate(startingDate: Date | number | string, calculations: RelativeDateCalculation): Date;
12
- //# sourceMappingURL=relative-date.d.ts.map
@@ -1,2 +0,0 @@
1
- export declare function isBrowser(): boolean;
2
- //# sourceMappingURL=environment.d.ts.map
@@ -1,11 +0,0 @@
1
- import { AtLeastTuple, NoInputsFunction, UnPromise } from '..';
2
- export declare function combineErrors(errors: AtLeastTuple<Error, 1>): Error;
3
- export declare function combineErrors(errors: ReadonlyArray<never>): undefined;
4
- export declare function combineErrors(errors: ReadonlyArray<Error>): Error | undefined;
5
- export declare function combineErrors(errors?: undefined): undefined;
6
- export declare function combineErrorMessages(errors?: ReadonlyArray<Error | string | undefined> | undefined): string;
7
- export declare function extractErrorMessage(error: unknown): string;
8
- export declare function ensureError(input: unknown): Error;
9
- export declare function executeAndReturnError<CallbackGeneric extends NoInputsFunction<PromiseLike<any>>>(callback: CallbackGeneric): Promise<Error | UnPromise<ReturnType<CallbackGeneric>>>;
10
- export declare function executeAndReturnError<CallbackGeneric extends NoInputsFunction>(callback: CallbackGeneric): Error | ReturnType<CallbackGeneric>;
11
- //# sourceMappingURL=error.d.ts.map
@@ -1,27 +0,0 @@
1
- import { ArrayElement } from './type';
2
- export type AnyFunction<ReturnGeneric = any> = (...args: any[]) => ReturnGeneric;
3
- export type NoInputsFunction<ReturnGeneric = any> = () => ReturnGeneric;
4
- /**
5
- * Accepts an "Arguments" and "Return" generic to quickly make a function type. If "Arguments" is an
6
- * array, it is spread into the full function's Parameters list. If any argument should be an array,
7
- * instead of a rest parameter, put it inside of a tuple. If no arguments should be possible, pass
8
- * void to "Arguments". If you need an optional argument, pass it inside of a tuple.
9
- *
10
- * @example
11
- * TypedFunction<string, number>; // (input: string) => number
12
- *
13
- * @example
14
- * TypedFunction<string[], number>; // (...inputs: string[]) => number
15
- *
16
- * @example
17
- * TypedFunction<[string[]], number>; // (input: string[]) => number
18
- *
19
- * @example
20
- * TypedFunction<[string, number], number>; // (input1: string, input2: number) => number
21
- *
22
- * @example
23
- * TypedFunction<[string | undefined], number>; // (input1: string|undefined) => number
24
- */
25
- export type TypedFunction<Arguments, Return> = Arguments extends readonly any[] ? number extends Arguments['length'] ? (...args: ArrayElement<Arguments>[]) => Return : (...args: Arguments) => Return : void extends Arguments ? () => Return : (arg: Arguments) => Return;
26
- export declare function isTruthy<T>(input: T): input is NonNullable<T>;
27
- //# sourceMappingURL=function.d.ts.map
@@ -1,23 +0,0 @@
1
- import { Jsonify, Primitive } from 'type-fest';
2
- /**
3
- * These are similar in purpose, name, and structure to type-fest's JsonValue types but these are
4
- * permissive. The goal here is to allow any types that do not get serialized into just empty
5
- * objects. (For example, JSON.stringify(new Map()) returns "{}", so we don't want to allow that
6
- * type.)
7
- */
8
- export type JsonCompatiblePrimitiveValue = Jsonify<Primitive> | undefined;
9
- export type JsonCompatibleObject = Partial<{
10
- readonly [key: string | number]: JsonCompatibleValue | Readonly<JsonCompatibleValue>;
11
- }> | Partial<{
12
- [key: string | number]: JsonCompatibleValue | Readonly<JsonCompatibleValue>;
13
- }>;
14
- export type JsonCompatibleArray = JsonCompatibleValue[]
15
- /**
16
- * This weird readonly with object syntax for an array type is so that TypeScript doesn't
17
- * complain about JsonCompatibleArray circularly referencing itself
18
- */
19
- | ({
20
- readonly [P in number]: JsonCompatibleValue;
21
- } & ReadonlyArray<any>);
22
- export type JsonCompatibleValue = JsonCompatiblePrimitiveValue | JsonCompatibleObject | JsonCompatibleArray;
23
- //# sourceMappingURL=json-compatible.d.ts.map
@@ -1,6 +0,0 @@
1
- export declare function parseJson<ParsedJsonGeneric>({ jsonString, errorHandler, shapeMatcher, }: {
2
- jsonString: string;
3
- errorHandler?: (error: unknown) => never | ParsedJsonGeneric;
4
- shapeMatcher?: ParsedJsonGeneric;
5
- }): ParsedJsonGeneric;
6
- //# sourceMappingURL=json.d.ts.map
@@ -1,5 +0,0 @@
1
- export declare function getEnumTypedKeys<T extends object>(input: T): (keyof T)[];
2
- export declare function getEnumTypedValues<T extends object>(input: T): T[keyof T][];
3
- export declare function isEnumValue<T extends object>(input: unknown, checkEnum: T): input is T[keyof T];
4
- export declare function filterToEnumValues<T extends object>(inputs: ReadonlyArray<unknown>, checkEnum: T, caseInsensitive?: boolean): T[keyof T][];
5
- //# sourceMappingURL=enum.d.ts.map
@@ -1,5 +0,0 @@
1
- import { PropertyValueType } from './object';
2
- export declare function filterObject<ObjectGeneric>(inputObject: ObjectGeneric, callback: (key: keyof ObjectGeneric, value: PropertyValueType<ObjectGeneric>, fullObject: ObjectGeneric) => boolean): Partial<ObjectGeneric>;
3
- export declare function omitObjectKeys<ObjectGeneric, KeyGeneric extends keyof ObjectGeneric>(inputObject: Readonly<ObjectGeneric>, omitTheseKeys: ReadonlyArray<KeyGeneric>): Omit<ObjectGeneric, KeyGeneric>;
4
- export declare function pickObjectKeys<ObjectGeneric, KeyGeneric extends keyof ObjectGeneric>(inputObject: Readonly<ObjectGeneric>, pickTheseKeys: ReadonlyArray<KeyGeneric>): Pick<ObjectGeneric, KeyGeneric>;
5
- //# sourceMappingURL=filter-object.d.ts.map
@@ -1,2 +0,0 @@
1
- export declare function hasKey<ParentType>(parent: ParentType, property: PropertyKey): property is keyof ParentType;
2
- //# sourceMappingURL=has-key.d.ts.map
@@ -1,3 +0,0 @@
1
- import { Jsonify } from 'type-fest';
2
- export declare function jsonify<InputGeneric>(input: InputGeneric): Jsonify<InputGeneric>;
3
- //# sourceMappingURL=jsonify.d.ts.map
@@ -1,25 +0,0 @@
1
- import { PropertyValueType, UnPromise } from '../..';
2
- export type InnerMappedValues<EntireInputGeneric extends object, MappedValueGeneric> = {
3
- [MappedProp in keyof EntireInputGeneric]: MappedValueGeneric;
4
- };
5
- export type MappedValues<EntireInputGeneric extends object, MappedValueGeneric> = MappedValueGeneric extends PromiseLike<unknown> ? Promise<InnerMappedValues<EntireInputGeneric, UnPromise<MappedValueGeneric>>> : InnerMappedValues<EntireInputGeneric, UnPromise<MappedValueGeneric>>;
6
- /**
7
- * Map an object's keys to new values synchronously. This is different from plain mapObjectValues in
8
- * that this will not wrap the return value in a promise if any of the new object values are
9
- * promises. This function also requires currying in order to get the types correct. This allows you
10
- * to explicitly state the return type.
11
- *
12
- * @example
13
- * mapObjectValuesSync({objectToIterateOver: 'initial value'})<{objectToIterateOver: number}>(
14
- * (key, value) => ({
15
- * newValue: value.length,
16
- * }),
17
- * );
18
- */
19
- export declare function mapObjectValuesSync<EntireInputGeneric extends object>(inputObject: EntireInputGeneric): <OutputObjectGeneric extends object>(mapCallback: (inputKey: keyof EntireInputGeneric, keyValue: EntireInputGeneric[keyof EntireInputGeneric], fullObject: EntireInputGeneric) => never extends PropertyValueType<OutputObjectGeneric> ? any : PropertyValueType<OutputObjectGeneric>) => OutputObjectGeneric;
20
- /**
21
- * Creates a new object with the same properties as the input object, but with values set to the
22
- * result of mapCallback for each property.
23
- */
24
- export declare function mapObjectValues<EntireInputGeneric extends object, MappedValueGeneric>(inputObject: EntireInputGeneric, mapCallback: (inputKey: keyof EntireInputGeneric, keyValue: EntireInputGeneric[typeof inputKey], fullObject: EntireInputGeneric) => MappedValueGeneric): MappedValues<EntireInputGeneric, MappedValueGeneric>;
25
- //# sourceMappingURL=map-object.d.ts.map
@@ -1,37 +0,0 @@
1
- import { AtLeastOneEntryArray } from '../array';
2
- import { NoInfer } from '../type';
3
- /**
4
- * Checks that the first input, testThisOne, matches the object shape of the second input,
5
- * compareToThisOne. Does not compare exact values of properties, only types.
6
- *
7
- * To allow the test input, the first input, to have additional keys that the compare input, the
8
- * second input, does not have, pass in a third argument set to true.
9
- *
10
- * This function REQUIRES a generic to be assigned to it: it cannot infer it from the inputs.
11
- *
12
- * The compare input, the second input, is required to have at least one entry in every array value
13
- * that exists. If more array values are present, they will be considered other possible types for
14
- * entries in that array.
15
- */
16
- export declare function matchesObjectShape<MatchThisGeneric extends object>(testThisOne: unknown, compareToThisOne: NoInfer<ObjectWithAtLeastSingleEntryArrays<MatchThisGeneric>>, allowExtraProps?: boolean, shouldLogWhy?: boolean): testThisOne is MatchThisGeneric;
17
- export type ObjectWithAtLeastSingleEntryArrays<BaseObject extends object> = {
18
- [Prop in keyof BaseObject]: BaseObject[Prop] extends ReadonlyArray<any> ? AtLeastOneEntryArray<BaseObject[Prop]> : BaseObject[Prop] extends object ? ObjectWithAtLeastSingleEntryArrays<BaseObject[Prop]> : BaseObject[Prop];
19
- };
20
- export type NestedBoolean<MatchObject extends object> = Partial<{
21
- [Prop in keyof MatchObject]: MatchObject[Prop] extends object ? NestedBoolean<MatchObject[Prop]> | boolean : boolean;
22
- }>;
23
- /**
24
- * Asserts that the first input, testThisOne, matches the object shape of the second input,
25
- * compareToThisOne. Does not compare exact values of properties, only types.
26
- *
27
- * To allow the test input, the first input, to have additional keys that the compare input, the
28
- * second input, does not have, pass in a third argument set to true.
29
- *
30
- * This function REQUIRES a generic to be assigned to it: it cannot infer it from the inputs.
31
- *
32
- * The compare input, the second input, is required to have at least one entry in every array value
33
- * that exists. If more array values are present, they will be considered other possible types for
34
- * entries in that array.
35
- */
36
- export declare function assertMatchesObjectShape<MatchThisGeneric extends object = never>(testThisOne: unknown, compareToThisOne: NoInfer<ObjectWithAtLeastSingleEntryArrays<MatchThisGeneric>>, allowExtraProps?: boolean, noCheckInnerValueOfTheseKeys?: NestedBoolean<typeof compareToThisOne>): asserts testThisOne is MatchThisGeneric;
37
- //# sourceMappingURL=matches-object-shape.d.ts.map
@@ -1,12 +0,0 @@
1
- import { UnionToIntersection } from 'type-fest';
2
- import { PropertyValueType } from './object';
3
- export type NestedSequentialKeys<ObjectGeneric extends object> = PropertyValueType<{
4
- [Prop in keyof ObjectGeneric]: NonNullable<ObjectGeneric[Prop]> extends object ? [Prop, ...(NestedSequentialKeys<NonNullable<ObjectGeneric[Prop]>> | [])] : [Prop];
5
- }>;
6
- export type NestedKeys<ObjectGeneric extends object> = UnionToIntersection<Extract<PropertyValueType<ObjectGeneric>, object>> extends object ? [
7
- keyof ObjectGeneric,
8
- ...(NestedKeys<UnionToIntersection<Extract<PropertyValueType<ObjectGeneric>, object>>> | [])
9
- ] : [keyof ObjectGeneric];
10
- export type NestedValue<ObjectGeneric extends object, NestedKeysGeneric extends NestedSequentialKeys<ObjectGeneric>> = NestedKeysGeneric extends readonly [infer FirstEntry, ...infer FollowingEntries] ? FirstEntry extends keyof ObjectGeneric ? FollowingEntries extends never[] ? ObjectGeneric[FirstEntry] : ObjectGeneric[FirstEntry] extends object ? FollowingEntries extends NestedSequentialKeys<ObjectGeneric[FirstEntry]> ? NestedValue<ObjectGeneric[FirstEntry], FollowingEntries> : never : never : never : never;
11
- export declare function getValueFromNestedKeys<ObjectGeneric extends object, KeysGeneric extends NestedSequentialKeys<ObjectGeneric>>(inputObject: ObjectGeneric, nestedKeys: KeysGeneric): NestedValue<ObjectGeneric, KeysGeneric> | undefined;
12
- //# sourceMappingURL=nested-keys.d.ts.map
@@ -1,6 +0,0 @@
1
- export declare function isKeyof<ObjectGeneric>(key: PropertyKey, object: ObjectGeneric): key is keyof ObjectGeneric;
2
- export declare function getObjectTypedKeys<ObjectGeneric extends unknown>(input: ObjectGeneric): Array<keyof ObjectGeneric>;
3
- export declare function getObjectTypedValues<ObjectGeneric extends unknown>(input: ObjectGeneric): ObjectGeneric[keyof ObjectGeneric][];
4
- export declare function getEntriesSortedByKey(input: object): [string, unknown][];
5
- export declare function typedObjectFromEntries<KeyType extends PropertyKey, ValueType>(entries: ReadonlyArray<Readonly<[KeyType, ValueType]>>): Record<KeyType, ValueType>;
6
- //# sourceMappingURL=object-entries.d.ts.map
@@ -1,13 +0,0 @@
1
- import { JsonCompatibleValue } from '../json-compatible';
2
- export type PartialAndNullable<T extends object> = {
3
- [Prop in keyof T]?: T[Prop] | null | undefined;
4
- };
5
- export type PartialAndUndefined<T extends object> = {
6
- [Prop in keyof T]?: T[Prop] | undefined;
7
- };
8
- export declare function isObject(input: any): input is NonNullable<object>;
9
- export declare function areJsonEqual(a: Readonly<JsonCompatibleValue | undefined>, b: Readonly<JsonCompatibleValue | undefined>): boolean;
10
- /** The input here must be serializable otherwise JSON parsing errors will be thrown */
11
- export declare function copyThroughJson<T>(input: T): T;
12
- export type PropertyValueType<T> = T[keyof T];
13
- //# sourceMappingURL=object.d.ts.map
@@ -1,8 +0,0 @@
1
- import { UnionToIntersection } from 'type-fest';
2
- import { NestedKeys } from './nested-keys';
3
- type InnerPickDeep<OriginalObjectGeneric extends object, DeepKeys extends any[]> = UnionToIntersection<DeepKeys extends [infer CurrentLevelPick, ...infer RemainingKeys] ? {
4
- [CurrentProp in Extract<CurrentLevelPick, keyof OriginalObjectGeneric>]: OriginalObjectGeneric[CurrentProp] extends object ? InnerPickDeep<OriginalObjectGeneric[CurrentProp], RemainingKeys> : OriginalObjectGeneric[CurrentProp];
5
- } : DeepKeys extends [infer CurrentLevelPick] ? CurrentLevelPick extends keyof OriginalObjectGeneric ? Pick<OriginalObjectGeneric, CurrentLevelPick> : never : never>;
6
- export type PickDeep<OriginalObjectGeneric extends object, DeepKeys extends NestedKeys<OriginalObjectGeneric>> = InnerPickDeep<OriginalObjectGeneric, DeepKeys>;
7
- export {};
8
- //# sourceMappingURL=pick-deep.d.ts.map
@@ -1,8 +0,0 @@
1
- import { RequiredBy } from '../type';
2
- type ExtractValue<KeyGeneric extends PropertyKey, ParentGeneric> = KeyGeneric extends keyof ParentGeneric ? RequiredBy<ParentGeneric, KeyGeneric>[KeyGeneric] : KeyGeneric extends keyof Extract<ParentGeneric, Record<KeyGeneric, any>> ? RequiredBy<Extract<ParentGeneric, Record<KeyGeneric, any>>, KeyGeneric>[KeyGeneric] : never;
3
- type CombinedParentValue<KeyGeneric extends PropertyKey, ParentGeneric> = ExtractValue<KeyGeneric, ParentGeneric> extends never ? unknown : ExtractValue<KeyGeneric, ParentGeneric>;
4
- type CombineTypeWithKey<KeyGeneric extends PropertyKey, ParentGeneric> = ParentGeneric & Record<KeyGeneric, CombinedParentValue<KeyGeneric, ParentGeneric>>;
5
- export declare function typedHasProperty<KeyGeneric extends PropertyKey, ParentGeneric>(inputObject: ParentGeneric, inputKey: KeyGeneric): inputObject is CombineTypeWithKey<KeyGeneric, ParentGeneric>;
6
- export declare function typedHasProperties<KeyGeneric extends PropertyKey, ParentGeneric>(inputObject: ParentGeneric, inputKeys: ReadonlyArray<KeyGeneric>): inputObject is CombineTypeWithKey<KeyGeneric, ParentGeneric>;
7
- export {};
8
- //# sourceMappingURL=typed-has-property.d.ts.map