@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,20 +0,0 @@
1
- import { AnyFunction } from './function';
2
- declare function rawGetTypeOf(x: any): "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function";
3
- type RawTypeOf = ReturnType<typeof rawGetTypeOf>;
4
- export type RuntimeTypeOf = RawTypeOf | 'array';
5
- export type RuntimeTypeOfMapping = {
6
- array: any[] | ReadonlyArray<any>;
7
- bigint: bigint;
8
- boolean: boolean;
9
- function: AnyFunction | Readonly<AnyFunction>;
10
- number: number;
11
- object: Record<PropertyKey, unknown> | Readonly<Record<PropertyKey, unknown>>;
12
- string: string;
13
- symbol: symbol;
14
- undefined: undefined;
15
- };
16
- export declare function getRuntimeTypeOf(input: unknown): RuntimeTypeOf;
17
- export declare function isRuntimeTypeOf<T extends RuntimeTypeOf>(input: unknown, testType: T): input is RuntimeTypeOfMapping[T];
18
- export declare function assertRuntimeTypeOf<T extends RuntimeTypeOf>(input: unknown, testType: T, inputName: string): asserts input is RuntimeTypeOfMapping[T];
19
- export {};
20
- //# sourceMappingURL=runtime-type-of.d.ts.map
@@ -1,8 +0,0 @@
1
- /**
2
- * Joins all given arguments together as if they were parts of a URL. Preserves trailing slashes and
3
- * removes consecutive slashes in the path. This also encodes each URL part.
4
- *
5
- * @example: joinToUrl('https://example.com', 'path1', 'path2/', '/path3/') === 'https://example.com/path1/path2/path3/'
6
- */
7
- export declare function joinUrlParts(...urlParts: ReadonlyArray<string>): string;
8
- //# sourceMappingURL=url.d.ts.map
@@ -1,2 +0,0 @@
1
- export declare function isUuid(maybeUuid: string): boolean;
2
- //# sourceMappingURL=uuid.d.ts.map
@@ -1,20 +0,0 @@
1
- /**
2
- * This truncates a number such that is will at a max have 6 characters including suffix, decimal
3
- * point, or comma.
4
- *
5
- * Default suffixes are:
6
- *
7
- * 'k', // thousand
8
- * 'M', // million
9
- * 'B', // billion
10
- * 'T', // trillion
11
- * 'P', // peta-, quadrillion
12
- * 'E', // exa- quintillion
13
- * 'Z', // zetta- sextillion
14
- * 'Y', // yotta- septillion
15
- */
16
- export declare function truncateNumber(originalValue: Readonly<unknown>, { customSuffixes, maxLength, }?: Partial<{
17
- customSuffixes: ReadonlyArray<string> | undefined;
18
- maxLength: number | undefined;
19
- }>): string;
20
- //# sourceMappingURL=truncate-number.d.ts.map
@@ -1,9 +0,0 @@
1
- export type Tuple<ArrayElementGeneric, LengthGeneric extends number> = LengthGeneric extends LengthGeneric ? number extends LengthGeneric ? ArrayElementGeneric[] : _TupleOf<ArrayElementGeneric, LengthGeneric, []> : never;
2
- type _TupleOf<ArrayElementGeneric, LengthGeneric extends number, FullArrayGeneric extends unknown[]> = FullArrayGeneric['length'] extends LengthGeneric ? FullArrayGeneric : _TupleOf<ArrayElementGeneric, LengthGeneric, [ArrayElementGeneric, ...FullArrayGeneric]>;
3
- export type AtLeastTuple<ArrayElementGeneric, LengthGeneric extends number> = readonly [
4
- ...Tuple<ArrayElementGeneric, LengthGeneric>,
5
- ...(ArrayElementGeneric | undefined)[]
6
- ];
7
- export declare function isLengthAtLeast<ArrayElementGeneric, LengthGeneric extends number>(array: ReadonlyArray<ArrayElementGeneric | undefined>, length: LengthGeneric): array is AtLeastTuple<ArrayElementGeneric, LengthGeneric>;
8
- export {};
9
- //# sourceMappingURL=tuple.d.ts.map
@@ -1,60 +0,0 @@
1
- import { Except, Simplify } from 'type-fest';
2
- /** Makes all properties in an object writable. This is the opposite of Readonly<> */
3
- export type Writeable<T> = {
4
- -readonly [P in keyof T]: T[P];
5
- };
6
- /** Makes all property values in an object also readonly. Can cause issues on primitive. */
7
- export type DeepWriteable<T> = {
8
- -readonly [P in keyof T]: DeepWriteable<T[P]>;
9
- };
10
- /** Replace properties in T with properties in U. */
11
- export type Overwrite<T, U> = Pick<T, Exclude<keyof T, keyof U>> & U;
12
- /** Extract the element type out of an array type. */
13
- export type ArrayElement<ArrayType extends ReadonlyArray<any>> = ArrayType[number];
14
- /**
15
- * Same as the Required<> built-in type helper but this requires that each property be present and
16
- * be not null.
17
- */
18
- export type RequiredAndNotNull<T> = {
19
- [P in keyof T]-?: NonNullable<T[P]>;
20
- };
21
- export type SetOptionalAndNullable<OriginalObjectGeneric, OptionalKeysGeneric extends keyof OriginalObjectGeneric> = Simplify<Except<OriginalObjectGeneric, OptionalKeysGeneric> & {
22
- [PropKey in OptionalKeysGeneric]?: OriginalObjectGeneric[PropKey] | null | undefined;
23
- }>;
24
- /** Require only a subset of object properties. */
25
- export type RequiredBy<T, K extends keyof T> = Overwrite<T, Required<Pick<T, K>>>;
26
- export declare function makeWritable<T>(input: T): Writeable<T>;
27
- export declare function makeReadonly<T>(input: T): Readonly<T>;
28
- /**
29
- * Require only a subset of object properties and require that they be not null. This is
30
- * particularly useful in conjunction with the "exactOptionalPropertyTypes" tsconfig flag.
31
- */
32
- export type RequiredAndNotNullBy<T, K extends keyof T> = Omit<T, K> & Required<{
33
- [PropertyName in K]: NonNullable<T[PropertyName]>;
34
- }>;
35
- /** If type T = type U, then type Y. Else type N. */
36
- export type IfEquals<T, U, Y = unknown, N = never> = (<G>() => G extends T ? 1 : 2) extends <G>() => G extends U ? 1 : 2 ? Y : N;
37
- /**
38
- * This function returns another function that simply returns whatever input it's given. However, it
39
- * also checks that the input matches the original wrapNarrowTypeWithTypeCheck's generic, while
40
- * maintaining strict "const" like typing.
41
- *
42
- * Use like this: wrapNarrowTypeWithTypeCheck<EnforcedTypeHere>()(valueToEnforceTypeOn as const)
43
- *
44
- * Sometimes "as const" isn't required, usually it is for any object or array though.
45
- */
46
- export declare function wrapNarrowTypeWithTypeCheck<P>(): <T extends P>(input: T) => Readonly<T>;
47
- /**
48
- * This type helper is useful for forcing function generics to be explicitly provided, rather than
49
- * inferring them from the given inputs. See the test file for examples.
50
- */
51
- export type NoInfer<T> = [T][T extends any ? 0 : never];
52
- /**
53
- * This is a type helper that ensures the given input matches the given generic type. The generic is
54
- * setup in such a way that if it is omitted (which is typically allowed in TypeScript, resulting in
55
- * the generic being inferred from the inputs), there will actually be a type error. This forces
56
- * each usage of this function to explicitly specify the generic, thus giving us type safety for the
57
- * input.
58
- */
59
- export declare function ensureType<ExpectedType = never>(input: NoInfer<ExpectedType>): NoInfer<ExpectedType>;
60
- //# sourceMappingURL=type.d.ts.map
@@ -1,32 +0,0 @@
1
- export * from './augments/ansi';
2
- export * from './augments/array';
3
- export * from './augments/async';
4
- export * from './augments/common-number';
5
- export * from './augments/common-string';
6
- export * from './augments/date/date';
7
- export * from './augments/date/relative-date';
8
- export * from './augments/environment';
9
- export * from './augments/error';
10
- export * from './augments/function';
11
- export * from './augments/json';
12
- export * from './augments/json-compatible';
13
- export * from './augments/object/enum';
14
- export * from './augments/object/filter-object';
15
- export * from './augments/object/has-key';
16
- export * from './augments/object/jsonify';
17
- export * from './augments/object/map-object';
18
- export * from './augments/object/matches-object-shape';
19
- export * from './augments/object/nested-keys';
20
- export * from './augments/object/object';
21
- export * from './augments/object/object-entries';
22
- export * from './augments/object/pick-deep';
23
- export * from './augments/object/typed-has-property';
24
- export * from './augments/promise';
25
- export * from './augments/regexp';
26
- export * from './augments/runtime-type-of';
27
- export * from './augments/string/url';
28
- export * from './augments/string/uuid';
29
- export * from './augments/truncate-number';
30
- export * from './augments/tuple';
31
- export * from './augments/type';
32
- //# sourceMappingURL=index.d.ts.map