inferred-types 0.16.1 → 0.18.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.
- package/.tsbuildinfo +1 -0
- package/dist/{types/utility/state/KeyStorage.d.ts → index.d.ts} +9780 -8195
- package/dist/index.js +687 -0
- package/dist/index.mjs +603 -0
- package/on-hold/Builder/index.ts +15 -21
- package/on-hold/types/index.ts +15 -20
- package/package.json +25 -36
- package/pnpm-lock.yaml +1680 -3233
- package/src/Mutation/index.ts +16 -18
- package/src/index.ts +15 -19
- package/src/shared/index.ts +16 -18
- package/src/types/Not.ts +3 -1
- package/src/types/Transformer.ts +1 -2
- package/src/types/Where.ts +36 -0
- package/src/types/alphabetic/PascalCase.ts +5 -4
- package/src/types/alphabetic/index.ts +16 -20
- package/src/types/dictionary/index.ts +16 -18
- package/src/types/{fluent.ts → fluent/fluent.ts} +8 -9
- package/src/types/fluent/index.ts +35 -0
- package/src/types/index.ts +18 -22
- package/src/types/kv/index.ts +16 -18
- package/src/types/lists/index.ts +16 -18
- package/src/types/ruleset-types.ts +1 -1
- package/src/types/string-literals/index.ts +16 -18
- package/src/types/tuples/index.ts +16 -18
- package/src/types/{SameKeys.ts → type-conversion/SameKeys.ts} +0 -0
- package/src/types/type-conversion/WrapValue.ts +15 -0
- package/src/types/type-conversion/index.ts +18 -18
- package/src/utility/api/index.ts +16 -18
- package/src/utility/dictionary/index.ts +16 -20
- package/src/utility/dictionary/kv/index.ts +16 -18
- package/src/utility/index.ts +16 -20
- package/src/utility/lists/index.ts +16 -18
- package/src/utility/literals/index.ts +16 -18
- package/src/utility/map-reduce/index.ts +16 -18
- package/src/utility/modelling/index.ts +16 -18
- package/src/utility/runtime/conditions/index.ts +16 -18
- package/src/utility/runtime/ifTypeOf.ts +1 -5
- package/src/utility/runtime/index.ts +16 -20
- package/src/utility/state/index.ts +16 -18
- package/tests/Where.spec.ts +39 -0
- package/tests/data/index.ts +9 -14
- package/tests/kv/dict-to-kv-and-back.spec.ts +6 -2
- package/tsconfig.json +4 -3
- package/dist/cjs/index.js +0 -1
- package/dist/es/index.js +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/dist/types/Mutation/MutationFunction.d.ts +0 -16
- package/dist/types/Mutation/MutationIdentity.d.ts +0 -30
- package/dist/types/Mutation/index.d.ts +0 -2
- package/dist/types/errors/InferenceError.d.ts +0 -1
- package/dist/types/errors/index.d.ts +0 -1
- package/dist/types/index.d.ts +0 -4
- package/dist/types/shared/index.d.ts +0 -3
- package/dist/types/shared/randomString.d.ts +0 -1
- package/dist/types/shared/uuid.d.ts +0 -1
- package/dist/types/shared/valueTypes.d.ts +0 -27
- package/dist/types/types/Api.d.ts +0 -10
- package/dist/types/types/Constructor.d.ts +0 -5
- package/dist/types/types/EnumValues.d.ts +0 -14
- package/dist/types/types/ExpandRecursively.d.ts +0 -3
- package/dist/types/types/First.d.ts +0 -4
- package/dist/types/types/FunctionType.d.ts +0 -9
- package/dist/types/types/If.d.ts +0 -10
- package/dist/types/types/Include.d.ts +0 -16
- package/dist/types/types/Includes.d.ts +0 -5
- package/dist/types/types/KeyedRecord.d.ts +0 -22
- package/dist/types/types/Keys.d.ts +0 -17
- package/dist/types/types/Length.d.ts +0 -8
- package/dist/types/types/Mutable.d.ts +0 -6
- package/dist/types/types/Narrowable.d.ts +0 -5
- package/dist/types/types/Not.d.ts +0 -11
- package/dist/types/types/Numeric.d.ts +0 -14
- package/dist/types/types/Opaque.d.ts +0 -12
- package/dist/types/types/Retain.d.ts +0 -16
- package/dist/types/types/SameKeys.d.ts +0 -11
- package/dist/types/types/Transformer.d.ts +0 -11
- package/dist/types/types/TypeGuard.d.ts +0 -7
- package/dist/types/types/alphabetic/AllCaps.d.ts +0 -12
- package/dist/types/types/alphabetic/CamelCase.d.ts +0 -2
- package/dist/types/types/alphabetic/CapFirstAlpha.d.ts +0 -13
- package/dist/types/types/alphabetic/CapitalizeWords.d.ts +0 -4
- package/dist/types/types/alphabetic/DashToSnake.d.ts +0 -1
- package/dist/types/types/alphabetic/DashUppercase.d.ts +0 -14
- package/dist/types/types/alphabetic/Dasherize.d.ts +0 -15
- package/dist/types/types/alphabetic/HasUppercase.d.ts +0 -13
- package/dist/types/types/alphabetic/Intrinsic.d.ts +0 -4
- package/dist/types/types/alphabetic/IsCapitalized.d.ts +0 -15
- package/dist/types/types/alphabetic/KebabCase.d.ts +0 -12
- package/dist/types/types/alphabetic/LowerAllCaps.d.ts +0 -4
- package/dist/types/types/alphabetic/PascalCase.d.ts +0 -16
- package/dist/types/types/alphabetic/Pluralize.d.ts +0 -36
- package/dist/types/types/alphabetic/SnakeCase.d.ts +0 -14
- package/dist/types/types/alphabetic/alpha-characters.d.ts +0 -36
- package/dist/types/types/alphabetic/index.d.ts +0 -16
- package/dist/types/types/append-types.d.ts +0 -9
- package/dist/types/types/dictionary/Get.d.ts +0 -7
- package/dist/types/types/dictionary/index.d.ts +0 -1
- package/dist/types/types/fluent.d.ts +0 -51
- package/dist/types/types/index.d.ts +0 -35
- package/dist/types/types/kv/DictFromKv.d.ts +0 -6
- package/dist/types/types/kv/KeyValue.d.ts +0 -11
- package/dist/types/types/kv/KvFrom.d.ts +0 -13
- package/dist/types/types/kv/KvTuple.d.ts +0 -14
- package/dist/types/types/kv/index.d.ts +0 -4
- package/dist/types/types/lists/UniqueForProp.d.ts +0 -14
- package/dist/types/types/lists/index.d.ts +0 -1
- package/dist/types/types/maybe.d.ts +0 -8
- package/dist/types/types/props.d.ts +0 -100
- package/dist/types/types/ruleset-types.d.ts +0 -59
- package/dist/types/types/runtime.d.ts +0 -33
- package/dist/types/types/string-literals/Break.d.ts +0 -12
- package/dist/types/types/string-literals/Concat.d.ts +0 -8
- package/dist/types/types/string-literals/LeftWhitespace.d.ts +0 -9
- package/dist/types/types/string-literals/Replace.d.ts +0 -11
- package/dist/types/types/string-literals/RightWhitespace.d.ts +0 -9
- package/dist/types/types/string-literals/StringLength.d.ts +0 -10
- package/dist/types/types/string-literals/Trim.d.ts +0 -11
- package/dist/types/types/string-literals/TrimLeft.d.ts +0 -11
- package/dist/types/types/string-literals/TrimRight.d.ts +0 -11
- package/dist/types/types/string-literals/form-fields.d.ts +0 -12
- package/dist/types/types/string-literals/index.d.ts +0 -10
- package/dist/types/types/tuples/DictArray.d.ts +0 -19
- package/dist/types/types/tuples/FirstKey.d.ts +0 -8
- package/dist/types/types/tuples/FirstKeyValue.d.ts +0 -8
- package/dist/types/types/tuples/FirstOfEach.d.ts +0 -11
- package/dist/types/types/tuples/FromDictArray.d.ts +0 -10
- package/dist/types/types/tuples/SecondOfEach.d.ts +0 -10
- package/dist/types/types/tuples/index.d.ts +0 -6
- package/dist/types/types/type-conversion/TupleToUnion.d.ts +0 -10
- package/dist/types/types/type-conversion/UnionToIntersection.d.ts +0 -5
- package/dist/types/types/type-conversion/UnionToTuple.d.ts +0 -9
- package/dist/types/types/type-conversion/index.d.ts +0 -3
- package/dist/types/types/type-testing.d.ts +0 -13
- package/dist/types/utility/api/api.d.ts +0 -2
- package/dist/types/utility/api/index.d.ts +0 -1
- package/dist/types/utility/createFnWithProps.d.ts +0 -1
- package/dist/types/utility/dictionary/arrayToKeyLookup.d.ts +0 -9
- package/dist/types/utility/dictionary/dictFilter.d.ts +0 -8
- package/dist/types/utility/dictionary/dictionaryTransform.d.ts +0 -9
- package/dist/types/utility/dictionary/entries.d.ts +0 -17
- package/dist/types/utility/dictionary/index.d.ts +0 -8
- package/dist/types/utility/dictionary/kv/dictToKv.d.ts +0 -16
- package/dist/types/utility/dictionary/kv/filterDictArray.d.ts +0 -9
- package/dist/types/utility/dictionary/kv/index.d.ts +0 -4
- package/dist/types/utility/dictionary/kv/kv.d.ts +0 -10
- package/dist/types/utility/dictionary/kv/kvToDict.d.ts +0 -15
- package/dist/types/utility/dictionary/mapValues.d.ts +0 -13
- package/dist/types/utility/dictionary/strArrayToDict.d.ts +0 -6
- package/dist/types/utility/dictionary/valuesOfProp.d.ts +0 -1
- package/dist/types/utility/index.d.ts +0 -11
- package/dist/types/utility/keys.d.ts +0 -5
- package/dist/types/utility/lists/groupBy.d.ts +0 -12
- package/dist/types/utility/lists/index.d.ts +0 -1
- package/dist/types/utility/literals/ExplicitFunction.d.ts +0 -6
- package/dist/types/utility/literals/arrayToObject.d.ts +0 -41
- package/dist/types/utility/literals/defineType.d.ts +0 -8
- package/dist/types/utility/literals/identity.d.ts +0 -6
- package/dist/types/utility/literals/index.d.ts +0 -5
- package/dist/types/utility/literals/literal.d.ts +0 -41
- package/dist/types/utility/map-reduce/filter.d.ts +0 -26
- package/dist/types/utility/map-reduce/index.d.ts +0 -1
- package/dist/types/utility/modelling/Model.d.ts +0 -22
- package/dist/types/utility/modelling/index.d.ts +0 -1
- package/dist/types/utility/ruleset.d.ts +0 -18
- package/dist/types/utility/runtime/condition.d.ts +0 -3
- package/dist/types/utility/runtime/conditions/index.d.ts +0 -12
- package/dist/types/utility/runtime/conditions/isArray.d.ts +0 -2
- package/dist/types/utility/runtime/conditions/isBoolean.d.ts +0 -5
- package/dist/types/utility/runtime/conditions/isFalse.d.ts +0 -4
- package/dist/types/utility/runtime/conditions/isFunction.d.ts +0 -15
- package/dist/types/utility/runtime/conditions/isLiteral.d.ts +0 -2
- package/dist/types/utility/runtime/conditions/isNull.d.ts +0 -1
- package/dist/types/utility/runtime/conditions/isNumber.d.ts +0 -1
- package/dist/types/utility/runtime/conditions/isObject.d.ts +0 -10
- package/dist/types/utility/runtime/conditions/isString.d.ts +0 -2
- package/dist/types/utility/runtime/conditions/isSymbol.d.ts +0 -1
- package/dist/types/utility/runtime/conditions/isTrue.d.ts +0 -20
- package/dist/types/utility/runtime/conditions/isUndefined.d.ts +0 -1
- package/dist/types/utility/runtime/ifTypeOf.d.ts +0 -23
- package/dist/types/utility/runtime/index.d.ts +0 -5
- package/dist/types/utility/runtime/type.d.ts +0 -27
- package/dist/types/utility/runtime/withValue.d.ts +0 -19
- package/dist/types/utility/state/Configurator.d.ts +0 -36
- package/dist/types/utility/state/FluentConfigurator.d.ts +0 -27
- package/dist/types/utility/state/index.d.ts +0 -3
- package/src/errors/InferenceError.ts +0 -3
- package/src/errors/index.ts +0 -37
- package/src/types/alphabetic/Intrinsic.ts +0 -6
- package/tests/FluentApi-spec.ts +0 -90
- package/tests/FluentConfigurator-spec.hold +0 -88
package/src/Mutation/index.ts
CHANGED
|
@@ -1,39 +1,37 @@
|
|
|
1
1
|
// #autoindex
|
|
2
2
|
|
|
3
3
|
// #region autoindexed files
|
|
4
|
+
// index last changed at: 12th Dec, 2021, 09:28 AM ( GMT-8 )
|
|
5
|
+
// hash-code: 4139440866
|
|
4
6
|
|
|
5
|
-
//
|
|
6
|
-
// export: named; exclusions: index, private.
|
|
7
|
-
// files: MutationFunction, MutationIdentity.
|
|
8
|
-
|
|
9
|
-
// local file exports
|
|
7
|
+
// file exports
|
|
10
8
|
export * from "./MutationFunction";
|
|
11
9
|
export * from "./MutationIdentity";
|
|
12
10
|
|
|
13
|
-
//
|
|
14
|
-
|
|
15
|
-
// This file was created by running: "dd
|
|
16
|
-
// the 'do-devops' pkg installed as a dev dep.
|
|
11
|
+
// #endregion
|
|
12
|
+
|
|
13
|
+
// This file was created by running: "dd autoindex"; it assumes you have
|
|
14
|
+
// the 'do-devops' pkg (that's "dd" on npm) installed as a dev dep.
|
|
17
15
|
//
|
|
18
16
|
// By default it assumes that exports are named exports but this can be changed by
|
|
19
17
|
// adding a modifier to the '// #autoindex' syntax:
|
|
20
18
|
//
|
|
21
19
|
// - autoindex:named same as default, exports "named symbols"
|
|
22
|
-
// - autoindex:default assumes each file is exporting a default export
|
|
23
|
-
//
|
|
24
|
-
// file
|
|
20
|
+
// - autoindex:default assumes each file is exporting a default export and
|
|
21
|
+
// converts the default export to the name of the file
|
|
25
22
|
// - autoindex:offset assumes files export "named symbols" but that each
|
|
26
23
|
// file's symbols should be offset by the file's name
|
|
27
|
-
// (useful for files which might symbols which collide
|
|
28
|
-
// or where the namespacing helps consumers)
|
|
29
24
|
//
|
|
30
25
|
// You may also exclude certain files or directories by adding it to the
|
|
31
26
|
// autoindex command. As an example:
|
|
32
27
|
//
|
|
33
28
|
// - autoindex:named, exclude: foo,bar,baz
|
|
34
29
|
//
|
|
35
|
-
//
|
|
36
|
-
//
|
|
30
|
+
// Inversely, if you state a file to be an "orphan" then autoindex files
|
|
31
|
+
// below this file will not reference this autoindex file:
|
|
32
|
+
//
|
|
33
|
+
// - autoindex:named, orphan
|
|
34
|
+
//
|
|
35
|
+
// All content outside the "// #region" section in this file will be
|
|
36
|
+
// preserved in situations where you need to do something paricularly awesome.
|
|
37
37
|
// Keep on being awesome.
|
|
38
|
-
|
|
39
|
-
// #endregion
|
package/src/index.ts
CHANGED
|
@@ -1,43 +1,39 @@
|
|
|
1
1
|
// #autoindex
|
|
2
2
|
|
|
3
3
|
// #region autoindexed files
|
|
4
|
-
|
|
5
|
-
//
|
|
6
|
-
// export: named; exclusions: index, private.
|
|
7
|
-
// directories: Mutation, errors, types, utility.
|
|
4
|
+
// index last changed at: 12th Dec, 2021, 09:30 AM ( GMT-8 )
|
|
5
|
+
// hash-code: 1064662042
|
|
8
6
|
|
|
9
7
|
// directory exports
|
|
10
8
|
export * from "./Mutation/index";
|
|
11
|
-
export * from "./
|
|
9
|
+
export * from "./shared/index";
|
|
12
10
|
export * from "./types/index";
|
|
13
11
|
export * from "./utility/index";
|
|
14
12
|
|
|
15
|
-
//
|
|
13
|
+
// #endregion
|
|
16
14
|
|
|
17
|
-
//
|
|
18
|
-
//
|
|
19
|
-
// This file was created by running: "dd devops autoindex"; it assumes you have
|
|
20
|
-
// the 'do-devops' pkg installed as a dev dep.
|
|
15
|
+
// This file was created by running: "dd autoindex"; it assumes you have
|
|
16
|
+
// the 'do-devops' pkg (that's "dd" on npm) installed as a dev dep.
|
|
21
17
|
//
|
|
22
18
|
// By default it assumes that exports are named exports but this can be changed by
|
|
23
19
|
// adding a modifier to the '// #autoindex' syntax:
|
|
24
20
|
//
|
|
25
21
|
// - autoindex:named same as default, exports "named symbols"
|
|
26
|
-
// - autoindex:default assumes each file is exporting a default export
|
|
27
|
-
//
|
|
28
|
-
// file
|
|
22
|
+
// - autoindex:default assumes each file is exporting a default export and
|
|
23
|
+
// converts the default export to the name of the file
|
|
29
24
|
// - autoindex:offset assumes files export "named symbols" but that each
|
|
30
25
|
// file's symbols should be offset by the file's name
|
|
31
|
-
// (useful for files which might symbols which collide
|
|
32
|
-
// or where the namespacing helps consumers)
|
|
33
26
|
//
|
|
34
27
|
// You may also exclude certain files or directories by adding it to the
|
|
35
28
|
// autoindex command. As an example:
|
|
36
29
|
//
|
|
37
30
|
// - autoindex:named, exclude: foo,bar,baz
|
|
38
31
|
//
|
|
39
|
-
//
|
|
40
|
-
//
|
|
32
|
+
// Inversely, if you state a file to be an "orphan" then autoindex files
|
|
33
|
+
// below this file will not reference this autoindex file:
|
|
34
|
+
//
|
|
35
|
+
// - autoindex:named, orphan
|
|
36
|
+
//
|
|
37
|
+
// All content outside the "// #region" section in this file will be
|
|
38
|
+
// preserved in situations where you need to do something paricularly awesome.
|
|
41
39
|
// Keep on being awesome.
|
|
42
|
-
|
|
43
|
-
// #endregion
|
package/src/shared/index.ts
CHANGED
|
@@ -1,40 +1,38 @@
|
|
|
1
1
|
// #autoindex: orphan
|
|
2
2
|
|
|
3
3
|
// #region autoindexed files
|
|
4
|
+
// index last changed at: 12th Dec, 2021, 09:28 AM ( GMT-8 )
|
|
5
|
+
// hash-code: 1491784011
|
|
4
6
|
|
|
5
|
-
//
|
|
6
|
-
// export: named; exclusions: index, private.
|
|
7
|
-
// files: randomString, uuid, valueTypes.
|
|
8
|
-
|
|
9
|
-
// local file exports
|
|
7
|
+
// file exports
|
|
10
8
|
export * from "./randomString";
|
|
11
9
|
export * from "./uuid";
|
|
12
10
|
export * from "./valueTypes";
|
|
13
11
|
|
|
14
|
-
//
|
|
15
|
-
|
|
16
|
-
// This file was created by running: "dd
|
|
17
|
-
// the 'do-devops' pkg installed as a dev dep.
|
|
12
|
+
// #endregion
|
|
13
|
+
|
|
14
|
+
// This file was created by running: "dd autoindex"; it assumes you have
|
|
15
|
+
// the 'do-devops' pkg (that's "dd" on npm) installed as a dev dep.
|
|
18
16
|
//
|
|
19
17
|
// By default it assumes that exports are named exports but this can be changed by
|
|
20
18
|
// adding a modifier to the '// #autoindex' syntax:
|
|
21
19
|
//
|
|
22
20
|
// - autoindex:named same as default, exports "named symbols"
|
|
23
|
-
// - autoindex:default assumes each file is exporting a default export
|
|
24
|
-
//
|
|
25
|
-
// file
|
|
21
|
+
// - autoindex:default assumes each file is exporting a default export and
|
|
22
|
+
// converts the default export to the name of the file
|
|
26
23
|
// - autoindex:offset assumes files export "named symbols" but that each
|
|
27
24
|
// file's symbols should be offset by the file's name
|
|
28
|
-
// (useful for files which might symbols which collide
|
|
29
|
-
// or where the namespacing helps consumers)
|
|
30
25
|
//
|
|
31
26
|
// You may also exclude certain files or directories by adding it to the
|
|
32
27
|
// autoindex command. As an example:
|
|
33
28
|
//
|
|
34
29
|
// - autoindex:named, exclude: foo,bar,baz
|
|
35
30
|
//
|
|
36
|
-
//
|
|
37
|
-
//
|
|
31
|
+
// Inversely, if you state a file to be an "orphan" then autoindex files
|
|
32
|
+
// below this file will not reference this autoindex file:
|
|
33
|
+
//
|
|
34
|
+
// - autoindex:named, orphan
|
|
35
|
+
//
|
|
36
|
+
// All content outside the "// #region" section in this file will be
|
|
37
|
+
// preserved in situations where you need to do something paricularly awesome.
|
|
38
38
|
// Keep on being awesome.
|
|
39
|
-
|
|
40
|
-
// #endregion
|
package/src/types/Not.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Provides a negation of a type of the type `T` _not_ `U
|
|
2
|
+
* Provides a negation of a type of the type `T` _not_ `U`.
|
|
3
3
|
* ```ts
|
|
4
4
|
* const foo = 42;
|
|
5
5
|
* // 33
|
|
@@ -7,5 +7,7 @@
|
|
|
7
7
|
* // never
|
|
8
8
|
* type NotTheMeaningOfLife = Not<42, 42>;
|
|
9
9
|
* ```
|
|
10
|
+
*
|
|
11
|
+
* Note: same as `Exclude`
|
|
10
12
|
*/
|
|
11
13
|
export type Not<T, U> = T extends U ? never : T;
|
package/src/types/Transformer.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SameKeys } from "./SameKeys";
|
|
1
|
+
import { SameKeys } from "./type-conversion/SameKeys";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* **Transformer**
|
|
@@ -13,4 +13,3 @@ export type Transformer<I extends object, O extends SameKeys<I>, K extends keyof
|
|
|
13
13
|
input: I,
|
|
14
14
|
key: K
|
|
15
15
|
) => O[K];
|
|
16
|
-
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Include } from "native-dash";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Allows filtering down `T` to those which extend a given type `U`.
|
|
5
|
+
*
|
|
6
|
+
* - `T` is either a dictionary (where keys will be used to compare) or
|
|
7
|
+
* a readonly sting array.
|
|
8
|
+
* ```ts
|
|
9
|
+
* const arr = ["foo", "bar", "baz"];
|
|
10
|
+
* // "bar" | "baz"
|
|
11
|
+
* type BA = Where<typeof arr, `ba${string}`>;
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export type Where<T extends Record<string, any> | readonly string[], U> = T extends readonly string[]
|
|
15
|
+
? Include<T[number], U>
|
|
16
|
+
: {
|
|
17
|
+
[K in keyof T]: K extends U ? K : never;
|
|
18
|
+
}[keyof T];
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Allows filtering down `T` to those which extend a given type `U`.
|
|
23
|
+
*
|
|
24
|
+
* - `T` is either a dictionary (where keys will be used to compare) or
|
|
25
|
+
* a readonly sting array.
|
|
26
|
+
* ```ts
|
|
27
|
+
* const arr = ["foo", "bar", "baz"];
|
|
28
|
+
* // "foo"
|
|
29
|
+
* type F = WhereNot<typeof arr, `ba${string}`>;
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export type WhereNot<T extends Record<string, any> | readonly string[], U> = T extends readonly string[]
|
|
33
|
+
? Exclude<T[number], U>
|
|
34
|
+
: {
|
|
35
|
+
[K in keyof T]: K extends U ? never : K;
|
|
36
|
+
}[keyof T];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint @typescript-eslint/no-unused-vars: "off" */
|
|
2
|
-
import type {
|
|
2
|
+
import type { LowerAllCaps, Trim } from "~/types";
|
|
3
3
|
|
|
4
4
|
type Delimiter = "_" | "-" | " ";
|
|
5
5
|
|
|
@@ -10,7 +10,7 @@ type DashDelim<T extends string> = T extends `${infer Begin}${" "}${infer Rest}`
|
|
|
10
10
|
? DashDelim<`${Begin}-${Rest}`>
|
|
11
11
|
: T;
|
|
12
12
|
|
|
13
|
-
/**
|
|
13
|
+
/**
|
|
14
14
|
* Converts a string literal type to a **PascalCase** representation.
|
|
15
15
|
* ```ts
|
|
16
16
|
* // "FooBar"
|
|
@@ -20,7 +20,8 @@ type DashDelim<T extends string> = T extends `${infer Begin}${" "}${infer Rest}`
|
|
|
20
20
|
* type T = PascalCase<"\n foo_bar \t">;
|
|
21
21
|
* ```
|
|
22
22
|
*/
|
|
23
|
-
export type PascalCase<S extends string> = string extends S
|
|
24
|
-
|
|
23
|
+
export type PascalCase<S extends string> = string extends S
|
|
24
|
+
? string
|
|
25
|
+
: Trim<DashDelim<LowerAllCaps<S>>> extends `${infer Begin}${Delimiter}${infer Rest}`
|
|
25
26
|
? PascalCase<`${Capitalize<Begin>}${Capitalize<Rest>}`>
|
|
26
27
|
: Capitalize<Trim<LowerAllCaps<S>>>;
|
|
@@ -1,20 +1,16 @@
|
|
|
1
1
|
// #autoindex, exclude: Alpha
|
|
2
2
|
// #region autoindexed files
|
|
3
|
+
// index last changed at: 12th Dec, 2021, 09:28 AM ( GMT-8 )
|
|
4
|
+
// hash-code: 265264203
|
|
3
5
|
|
|
4
|
-
//
|
|
5
|
-
// export: named; exclusions: Alpha, index, private.
|
|
6
|
-
// files: AllCaps, CamelCase, CapFirstAlpha, CapitalizeWords, DashToSnake, DashUppercase, Dasherize, HasUppercase, Intrinsic, IsCapitalized, KebabCase, LowerAllCaps, PascalCase, Pluralize, SnakeCase, alpha-characters.
|
|
7
|
-
|
|
8
|
-
// local file exports
|
|
6
|
+
// file exports
|
|
9
7
|
export * from "./AllCaps";
|
|
10
8
|
export * from "./CamelCase";
|
|
11
|
-
export * from "./CapFirstAlpha";
|
|
12
9
|
export * from "./CapitalizeWords";
|
|
13
10
|
export * from "./DashToSnake";
|
|
14
11
|
export * from "./DashUppercase";
|
|
15
12
|
export * from "./Dasherize";
|
|
16
13
|
export * from "./HasUppercase";
|
|
17
|
-
export * from "./Intrinsic";
|
|
18
14
|
export * from "./IsCapitalized";
|
|
19
15
|
export * from "./KebabCase";
|
|
20
16
|
export * from "./LowerAllCaps";
|
|
@@ -23,30 +19,30 @@ export * from "./Pluralize";
|
|
|
23
19
|
export * from "./SnakeCase";
|
|
24
20
|
export * from "./alpha-characters";
|
|
25
21
|
|
|
26
|
-
//
|
|
27
|
-
|
|
28
|
-
// This file was created by running: "dd
|
|
29
|
-
// the 'do-devops' pkg installed as a dev dep.
|
|
22
|
+
// #endregion
|
|
23
|
+
|
|
24
|
+
// This file was created by running: "dd autoindex"; it assumes you have
|
|
25
|
+
// the 'do-devops' pkg (that's "dd" on npm) installed as a dev dep.
|
|
30
26
|
//
|
|
31
27
|
// By default it assumes that exports are named exports but this can be changed by
|
|
32
28
|
// adding a modifier to the '// #autoindex' syntax:
|
|
33
29
|
//
|
|
34
30
|
// - autoindex:named same as default, exports "named symbols"
|
|
35
|
-
// - autoindex:default assumes each file is exporting a default export
|
|
36
|
-
//
|
|
37
|
-
// file
|
|
31
|
+
// - autoindex:default assumes each file is exporting a default export and
|
|
32
|
+
// converts the default export to the name of the file
|
|
38
33
|
// - autoindex:offset assumes files export "named symbols" but that each
|
|
39
34
|
// file's symbols should be offset by the file's name
|
|
40
|
-
// (useful for files which might symbols which collide
|
|
41
|
-
// or where the namespacing helps consumers)
|
|
42
35
|
//
|
|
43
36
|
// You may also exclude certain files or directories by adding it to the
|
|
44
37
|
// autoindex command. As an example:
|
|
45
38
|
//
|
|
46
39
|
// - autoindex:named, exclude: foo,bar,baz
|
|
47
40
|
//
|
|
48
|
-
//
|
|
49
|
-
//
|
|
41
|
+
// Inversely, if you state a file to be an "orphan" then autoindex files
|
|
42
|
+
// below this file will not reference this autoindex file:
|
|
43
|
+
//
|
|
44
|
+
// - autoindex:named, orphan
|
|
45
|
+
//
|
|
46
|
+
// All content outside the "// #region" section in this file will be
|
|
47
|
+
// preserved in situations where you need to do something paricularly awesome.
|
|
50
48
|
// Keep on being awesome.
|
|
51
|
-
|
|
52
|
-
// #endregion
|
|
@@ -1,37 +1,35 @@
|
|
|
1
1
|
// #autoindex
|
|
2
2
|
// #region autoindexed files
|
|
3
|
+
// index last changed at: 12th Dec, 2021, 09:28 AM ( GMT-8 )
|
|
4
|
+
// hash-code: 1199590002
|
|
3
5
|
|
|
4
|
-
//
|
|
5
|
-
// export: named; exclusions: index, private.
|
|
6
|
-
// files: Get.
|
|
7
|
-
|
|
8
|
-
// local file exports
|
|
6
|
+
// file exports
|
|
9
7
|
export * from "./Get";
|
|
10
8
|
|
|
11
|
-
//
|
|
12
|
-
|
|
13
|
-
// This file was created by running: "dd
|
|
14
|
-
// the 'do-devops' pkg installed as a dev dep.
|
|
9
|
+
// #endregion
|
|
10
|
+
|
|
11
|
+
// This file was created by running: "dd autoindex"; it assumes you have
|
|
12
|
+
// the 'do-devops' pkg (that's "dd" on npm) installed as a dev dep.
|
|
15
13
|
//
|
|
16
14
|
// By default it assumes that exports are named exports but this can be changed by
|
|
17
15
|
// adding a modifier to the '// #autoindex' syntax:
|
|
18
16
|
//
|
|
19
17
|
// - autoindex:named same as default, exports "named symbols"
|
|
20
|
-
// - autoindex:default assumes each file is exporting a default export
|
|
21
|
-
//
|
|
22
|
-
// file
|
|
18
|
+
// - autoindex:default assumes each file is exporting a default export and
|
|
19
|
+
// converts the default export to the name of the file
|
|
23
20
|
// - autoindex:offset assumes files export "named symbols" but that each
|
|
24
21
|
// file's symbols should be offset by the file's name
|
|
25
|
-
// (useful for files which might symbols which collide
|
|
26
|
-
// or where the namespacing helps consumers)
|
|
27
22
|
//
|
|
28
23
|
// You may also exclude certain files or directories by adding it to the
|
|
29
24
|
// autoindex command. As an example:
|
|
30
25
|
//
|
|
31
26
|
// - autoindex:named, exclude: foo,bar,baz
|
|
32
27
|
//
|
|
33
|
-
//
|
|
34
|
-
//
|
|
28
|
+
// Inversely, if you state a file to be an "orphan" then autoindex files
|
|
29
|
+
// below this file will not reference this autoindex file:
|
|
30
|
+
//
|
|
31
|
+
// - autoindex:named, orphan
|
|
32
|
+
//
|
|
33
|
+
// All content outside the "// #region" section in this file will be
|
|
34
|
+
// preserved in situations where you need to do something paricularly awesome.
|
|
35
35
|
// Keep on being awesome.
|
|
36
|
-
|
|
37
|
-
// #endregion
|
|
@@ -14,8 +14,7 @@ export type ToFluent<
|
|
|
14
14
|
X extends object = {}
|
|
15
15
|
> = {
|
|
16
16
|
[K in keyof T]: (...args: Parameters<T[K]>) => ToFluent<T, X> & X;
|
|
17
|
-
} &
|
|
18
|
-
X;
|
|
17
|
+
} & X;
|
|
19
18
|
|
|
20
19
|
/**
|
|
21
20
|
* A _pure_ Fluent API which promotes an API surface where _every_ API endpoint must be a function
|
|
@@ -53,10 +52,10 @@ export type PureFluentApi<
|
|
|
53
52
|
* pass out the interior state which has been configured by the fluent parts of the API
|
|
54
53
|
* - `TExclude` represents part of the API which -- due to the internal state -- should be hidden
|
|
55
54
|
*/
|
|
56
|
-
export type FluentApi<
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
> = Omit<TFluent & TEscape, TExclude>;
|
|
55
|
+
// export type FluentApi<
|
|
56
|
+
// TFluent extends {
|
|
57
|
+
// [K in keyof TFluent]: (...args: Parameters<TFluent[K]>) => FluentApi<TFluent, TEscape>;
|
|
58
|
+
// },
|
|
59
|
+
// TEscape extends object = {},
|
|
60
|
+
// TExclude extends string = ""
|
|
61
|
+
// > = Omit<TFluent & TEscape, TExclude>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// #autoindex
|
|
2
|
+
// #region autoindexed files
|
|
3
|
+
// index last changed at: 12th Dec, 2021, 09:28 AM ( GMT-8 )
|
|
4
|
+
// hash-code: 3321613880
|
|
5
|
+
|
|
6
|
+
// file exports
|
|
7
|
+
export * from "./fluent";
|
|
8
|
+
|
|
9
|
+
// #endregion
|
|
10
|
+
|
|
11
|
+
// This file was created by running: "dd autoindex"; it assumes you have
|
|
12
|
+
// the 'do-devops' pkg (that's "dd" on npm) installed as a dev dep.
|
|
13
|
+
//
|
|
14
|
+
// By default it assumes that exports are named exports but this can be changed by
|
|
15
|
+
// adding a modifier to the '// #autoindex' syntax:
|
|
16
|
+
//
|
|
17
|
+
// - autoindex:named same as default, exports "named symbols"
|
|
18
|
+
// - autoindex:default assumes each file is exporting a default export and
|
|
19
|
+
// converts the default export to the name of the file
|
|
20
|
+
// - autoindex:offset assumes files export "named symbols" but that each
|
|
21
|
+
// file's symbols should be offset by the file's name
|
|
22
|
+
//
|
|
23
|
+
// You may also exclude certain files or directories by adding it to the
|
|
24
|
+
// autoindex command. As an example:
|
|
25
|
+
//
|
|
26
|
+
// - autoindex:named, exclude: foo,bar,baz
|
|
27
|
+
//
|
|
28
|
+
// Inversely, if you state a file to be an "orphan" then autoindex files
|
|
29
|
+
// below this file will not reference this autoindex file:
|
|
30
|
+
//
|
|
31
|
+
// - autoindex:named, orphan
|
|
32
|
+
//
|
|
33
|
+
// All content outside the "// #region" section in this file will be
|
|
34
|
+
// preserved in situations where you need to do something paricularly awesome.
|
|
35
|
+
// Keep on being awesome.
|
package/src/types/index.ts
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
// #autoindex
|
|
2
2
|
// #region autoindexed files
|
|
3
|
+
// index last changed at: 12th Dec, 2021, 09:28 AM ( GMT-8 )
|
|
4
|
+
// hash-code: 2121148832
|
|
3
5
|
|
|
4
|
-
//
|
|
5
|
-
// export: named; exclusions: index, private.
|
|
6
|
-
// files: Api, Constructor, EnumValues, ExpandRecursively, First, FunctionType, If, Include, Includes, KeyedRecord, Keys, Length, Mutable, Narrowable, Not, Numeric, Opaque, Retain, SameKeys, Transformer, TypeGuard, append-types, fluent, maybe, props, ruleset-types, runtime, type-testing.
|
|
7
|
-
// directories: alphabetic, dictionary, kv, lists, string-literals, tuples, type-conversion.
|
|
8
|
-
|
|
9
|
-
// local file exports
|
|
6
|
+
// file exports
|
|
10
7
|
export * from "./Api";
|
|
11
8
|
export * from "./Constructor";
|
|
12
9
|
export * from "./EnumValues";
|
|
@@ -25,50 +22,49 @@ export * from "./Not";
|
|
|
25
22
|
export * from "./Numeric";
|
|
26
23
|
export * from "./Opaque";
|
|
27
24
|
export * from "./Retain";
|
|
28
|
-
export * from "./SameKeys";
|
|
29
25
|
export * from "./Transformer";
|
|
30
26
|
export * from "./TypeGuard";
|
|
27
|
+
export * from "./Where";
|
|
31
28
|
export * from "./append-types";
|
|
32
|
-
export * from "./fluent";
|
|
33
29
|
export * from "./maybe";
|
|
34
30
|
export * from "./props";
|
|
35
31
|
export * from "./ruleset-types";
|
|
36
32
|
export * from "./runtime";
|
|
37
33
|
export * from "./type-testing";
|
|
38
|
-
|
|
39
34
|
// directory exports
|
|
40
35
|
export * from "./alphabetic/index";
|
|
41
36
|
export * from "./dictionary/index";
|
|
37
|
+
export * from "./fluent/index";
|
|
42
38
|
export * from "./kv/index";
|
|
43
39
|
export * from "./lists/index";
|
|
44
40
|
export * from "./string-literals/index";
|
|
45
41
|
export * from "./tuples/index";
|
|
46
42
|
export * from "./type-conversion/index";
|
|
47
43
|
|
|
48
|
-
//
|
|
49
|
-
|
|
50
|
-
// This file was created by running: "dd
|
|
51
|
-
// the 'do-devops' pkg installed as a dev dep.
|
|
44
|
+
// #endregion
|
|
45
|
+
|
|
46
|
+
// This file was created by running: "dd autoindex"; it assumes you have
|
|
47
|
+
// the 'do-devops' pkg (that's "dd" on npm) installed as a dev dep.
|
|
52
48
|
//
|
|
53
49
|
// By default it assumes that exports are named exports but this can be changed by
|
|
54
50
|
// adding a modifier to the '// #autoindex' syntax:
|
|
55
51
|
//
|
|
56
52
|
// - autoindex:named same as default, exports "named symbols"
|
|
57
|
-
// - autoindex:default assumes each file is exporting a default export
|
|
58
|
-
//
|
|
59
|
-
// file
|
|
53
|
+
// - autoindex:default assumes each file is exporting a default export and
|
|
54
|
+
// converts the default export to the name of the file
|
|
60
55
|
// - autoindex:offset assumes files export "named symbols" but that each
|
|
61
56
|
// file's symbols should be offset by the file's name
|
|
62
|
-
// (useful for files which might symbols which collide
|
|
63
|
-
// or where the namespacing helps consumers)
|
|
64
57
|
//
|
|
65
58
|
// You may also exclude certain files or directories by adding it to the
|
|
66
59
|
// autoindex command. As an example:
|
|
67
60
|
//
|
|
68
61
|
// - autoindex:named, exclude: foo,bar,baz
|
|
69
62
|
//
|
|
70
|
-
//
|
|
71
|
-
//
|
|
63
|
+
// Inversely, if you state a file to be an "orphan" then autoindex files
|
|
64
|
+
// below this file will not reference this autoindex file:
|
|
65
|
+
//
|
|
66
|
+
// - autoindex:named, orphan
|
|
67
|
+
//
|
|
68
|
+
// All content outside the "// #region" section in this file will be
|
|
69
|
+
// preserved in situations where you need to do something paricularly awesome.
|
|
72
70
|
// Keep on being awesome.
|
|
73
|
-
|
|
74
|
-
// #endregion
|
package/src/types/kv/index.ts
CHANGED
|
@@ -1,40 +1,38 @@
|
|
|
1
1
|
// #autoindex
|
|
2
2
|
// #region autoindexed files
|
|
3
|
+
// index last changed at: 12th Dec, 2021, 09:28 AM ( GMT-8 )
|
|
4
|
+
// hash-code: 2882639582
|
|
3
5
|
|
|
4
|
-
//
|
|
5
|
-
// export: named; exclusions: index, private.
|
|
6
|
-
// files: DictFromKv, KeyValue, KvFrom, KvTuple.
|
|
7
|
-
|
|
8
|
-
// local file exports
|
|
6
|
+
// file exports
|
|
9
7
|
export * from "./DictFromKv";
|
|
10
8
|
export * from "./KeyValue";
|
|
11
9
|
export * from "./KvFrom";
|
|
12
10
|
export * from "./KvTuple";
|
|
13
11
|
|
|
14
|
-
//
|
|
15
|
-
|
|
16
|
-
// This file was created by running: "dd
|
|
17
|
-
// the 'do-devops' pkg installed as a dev dep.
|
|
12
|
+
// #endregion
|
|
13
|
+
|
|
14
|
+
// This file was created by running: "dd autoindex"; it assumes you have
|
|
15
|
+
// the 'do-devops' pkg (that's "dd" on npm) installed as a dev dep.
|
|
18
16
|
//
|
|
19
17
|
// By default it assumes that exports are named exports but this can be changed by
|
|
20
18
|
// adding a modifier to the '// #autoindex' syntax:
|
|
21
19
|
//
|
|
22
20
|
// - autoindex:named same as default, exports "named symbols"
|
|
23
|
-
// - autoindex:default assumes each file is exporting a default export
|
|
24
|
-
//
|
|
25
|
-
// file
|
|
21
|
+
// - autoindex:default assumes each file is exporting a default export and
|
|
22
|
+
// converts the default export to the name of the file
|
|
26
23
|
// - autoindex:offset assumes files export "named symbols" but that each
|
|
27
24
|
// file's symbols should be offset by the file's name
|
|
28
|
-
// (useful for files which might symbols which collide
|
|
29
|
-
// or where the namespacing helps consumers)
|
|
30
25
|
//
|
|
31
26
|
// You may also exclude certain files or directories by adding it to the
|
|
32
27
|
// autoindex command. As an example:
|
|
33
28
|
//
|
|
34
29
|
// - autoindex:named, exclude: foo,bar,baz
|
|
35
30
|
//
|
|
36
|
-
//
|
|
37
|
-
//
|
|
31
|
+
// Inversely, if you state a file to be an "orphan" then autoindex files
|
|
32
|
+
// below this file will not reference this autoindex file:
|
|
33
|
+
//
|
|
34
|
+
// - autoindex:named, orphan
|
|
35
|
+
//
|
|
36
|
+
// All content outside the "// #region" section in this file will be
|
|
37
|
+
// preserved in situations where you need to do something paricularly awesome.
|
|
38
38
|
// Keep on being awesome.
|
|
39
|
-
|
|
40
|
-
// #endregion
|