inferred-types 0.19.0 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc +36 -20
- package/.github/workflows/main.yml +34 -0
- package/.github/workflows/other.yml +15 -0
- package/.vscode/settings.json +10 -2
- package/dist/index.d.ts +403 -8538
- package/dist/index.js +35 -60
- package/dist/index.mjs +24 -48
- package/package.json +34 -23
- package/src/shared/valueTypes.ts +1 -1
- package/src/types/ExpandRecursively.ts +10 -1
- package/src/types/FunctionType.ts +1 -1
- package/src/types/SimplifyObject.ts +12 -0
- package/src/types/Transformer.ts +1 -1
- package/src/types/alphabetic/CamelCase.ts +1 -1
- package/src/types/alphabetic/CapFirstAlpha.ts +7 -3
- package/src/types/alphabetic/Dasherize.ts +8 -5
- package/src/types/alphabetic/KebabCase.ts +1 -1
- package/src/types/alphabetic/PascalCase.ts +3 -1
- package/src/types/alphabetic/SnakeCase.ts +8 -3
- package/src/types/dictionary/DictPartialApplication.ts +30 -0
- package/src/types/dictionary/DictPrependWithFn.ts +23 -0
- package/src/types/dictionary/DictReturnValues.ts +27 -0
- package/src/types/dictionary/RequireProps.ts +15 -0
- package/src/types/{type-conversion → dictionary}/SameKeys.ts +0 -0
- package/src/types/dictionary/index.ts +8 -3
- package/src/types/{props.ts → dictionary/props.ts} +1 -1
- package/src/types/functions/FinalReturn.ts +12 -0
- package/{on-hold/types → src/types/functions}/index.ts +4 -3
- package/src/types/index.ts +4 -3
- package/src/types/ruleset-types.ts +3 -3
- package/src/types/runtime.ts +18 -18
- package/src/types/string-literals/LeftWhitespace.ts +5 -2
- package/src/types/string-literals/RightWhitespace.ts +5 -2
- package/src/types/tuples/FirstKey.ts +3 -3
- package/src/types/tuples/FromDictArray.ts +5 -4
- package/src/types/type-conversion/index.ts +2 -5
- package/src/utility/api/api.ts +8 -7
- package/src/utility/createFnWithProps.ts +26 -1
- package/src/utility/dictionary/dictionaryTransform.ts +5 -4
- package/src/utility/dictionary/entries.ts +9 -5
- package/src/utility/dictionary/index.ts +2 -3
- package/src/utility/dictionary/kv/dictToKv.ts +5 -3
- package/src/utility/dictionary/kv/filterDictArray.ts +5 -7
- package/src/utility/dictionary/kv/kv.ts +8 -3
- package/src/utility/dictionary/kv/kvToDict.ts +3 -2
- package/src/utility/dictionary/mapValues.ts +8 -5
- package/src/utility/dictionary/strArrayToDict.ts +1 -2
- package/src/utility/keys.ts +8 -4
- package/src/utility/lists/groupBy.ts +2 -9
- package/src/utility/literals/arrayToObject.ts +29 -29
- package/src/utility/literals/defineType.ts +6 -6
- package/src/utility/literals/identity.ts +5 -2
- package/src/utility/literals/literal.ts +3 -3
- package/src/utility/ruleset.ts +11 -9
- package/src/utility/runtime/condition.ts +1 -1
- package/src/utility/runtime/conditions/isFalse.ts +2 -2
- package/src/utility/runtime/conditions/isFunction.ts +2 -2
- package/src/utility/runtime/conditions/isObject.ts +4 -1
- package/src/utility/runtime/conditions/isTrue.ts +1 -1
- package/src/utility/runtime/ifTypeOf.ts +1 -1
- package/src/utility/runtime/type.ts +3 -1
- package/src/utility/runtime/withValue.ts +5 -3
- package/src/utility/state/Configurator.ts +2 -2
- package/src/utility/state/FluentConfigurator.ts +2 -2
- package/src/utility/state/index.ts +2 -3
- package/tests/CamelCase-spec.ts +2 -0
- package/tests/ExplicitFunction-spec.ts +3 -2
- package/tests/IncludeAndRetain-spec.ts +7 -12
- package/tests/Includes-spec.ts +2 -0
- package/tests/KebabCase-spec.ts +2 -0
- package/tests/MutationIdentity-spec.ts +2 -1
- package/tests/PascalCase-spec.ts +2 -0
- package/tests/Pluralize-spec.ts +2 -0
- package/tests/SnakeCase-spec.ts +2 -0
- package/tests/Where.spec.ts +9 -10
- package/tests/arrayToKeyLookup-spec.ts +5 -5
- package/tests/arrayToObject-spec.ts +12 -8
- package/tests/constructor.spec.ts +2 -0
- package/tests/createFnWithProps.spec.ts +2 -2
- package/tests/defineType-spec.ts +17 -11
- package/tests/dictionary/DictPartialApplication.test.ts +43 -0
- package/tests/dictionary/DictReturnValues.test.ts +32 -0
- package/tests/dictionary/Get.spec.ts +5 -3
- package/tests/dictionary/PrependValuesWithFunction.ts +34 -0
- package/tests/dictionary/RequireProps.test.ts +21 -0
- package/tests/dictionaryTransform-spec.ts +3 -3
- package/tests/ifTypeOf-spec.ts +31 -20
- package/tests/kv/KeyValue-spec.ts +4 -4
- package/tests/kv/SameKeys-spec.ts +6 -9
- package/tests/kv/dict-to-kv-and-back.spec.ts +5 -4
- package/tests/kv/entries-spec.ts +8 -9
- package/tests/kv/keys.spec.ts +9 -19
- package/tests/kv/kv-spec.ts +4 -4
- package/tests/lists/UniqueForProp.spec.ts +3 -1
- package/tests/literal-spec.ts +5 -3
- package/tests/mapValues-spec.ts +5 -3
- package/tests/props-spec.ts +3 -2
- package/tests/runtime/condition.spec.ts +2 -1
- package/tests/runtime/type.spec.ts +4 -3
- package/tests/strArrayToDict-spec.ts +6 -6
- package/tests/string-literals/AllCaps.spec.ts +6 -15
- package/tests/string-literals/CamelCase.spec.ts +13 -32
- package/tests/string-literals/Dasherize.spec.ts +13 -31
- package/tests/string-literals/HasUppercase.spec.ts +6 -15
- package/tests/string-literals/PascalCase.spec.ts +13 -32
- package/tests/string-literals/SnakeCase.spec.ts +13 -32
- package/tests/string-literals/whitespace-capture.spec.ts +10 -28
- package/tests/tuples/TupleToUnion.spec.ts +3 -1
- package/tests/withValue.spec.ts +4 -3
- package/tsconfig.json +8 -19
- package/vitest.config.ts +13 -0
- package/jest.config.ts +0 -20
- package/on-hold/Builder/Builder.ts +0 -66
- package/on-hold/Builder/BuilderApi.ts +0 -21
- package/on-hold/Builder/IdentityToMutationApi.ts +0 -44
- package/on-hold/Builder/MutationToFluentApi.ts +0 -60
- package/on-hold/Builder/index.ts +0 -35
- package/on-hold/tests/Builder-spec.ts +0 -310
- package/on-hold/tests/RuleSet-spec.ts +0 -59
- package/on-hold/tests/ToFluent-spec.ts +0 -60
- package/on-hold/tests/api-spec.ts +0 -73
- package/on-hold/tests/data/builder-data.ts +0 -53
- package/on-hold/tests/filterDictArray-spec.ts +0 -50
- package/on-hold/tests/run-time-spec.ts +0 -44
- package/on-hold/type.ts +0 -20
- package/on-hold/types/object.ts +0 -19
- package/on-hold/types/prop.ts +0 -28
- package/on-hold/types/scalar.ts +0 -37
- package/src/types/dictionary/NotEmptyObject.ts +0 -9
- package/src/types/type-conversion/UnwrapValue.ts +0 -13
- package/src/types/type-conversion/WrapValue.ts +0 -15
- package/src/utility/dictionary/valuesOfProp.ts +0 -13
- package/src/utility/state/KeyStorage.ts +0 -23
package/.eslintrc
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
{
|
|
2
|
-
"extends": [
|
|
3
|
-
|
|
2
|
+
"extends": [
|
|
3
|
+
"plugin:import/warnings",
|
|
4
|
+
"plugin:import/typescript"
|
|
5
|
+
],
|
|
6
|
+
"plugins": [
|
|
7
|
+
"@typescript-eslint",
|
|
8
|
+
"import",
|
|
9
|
+
"promise"
|
|
10
|
+
],
|
|
4
11
|
"parser": "@typescript-eslint/parser",
|
|
5
12
|
"parserOptions": {
|
|
6
13
|
"parser": "@typescript-eslint/parser",
|
|
@@ -9,29 +16,38 @@
|
|
|
9
16
|
},
|
|
10
17
|
"rules": {
|
|
11
18
|
"prefer-const": "error",
|
|
12
|
-
"semi": [
|
|
13
|
-
|
|
19
|
+
"semi": [
|
|
20
|
+
"error",
|
|
21
|
+
"always"
|
|
22
|
+
],
|
|
23
|
+
"quotes": [
|
|
24
|
+
"warn",
|
|
25
|
+
"double",
|
|
26
|
+
{
|
|
27
|
+
"avoidEscape": true,
|
|
28
|
+
"allowTemplateLiterals": true
|
|
29
|
+
}
|
|
30
|
+
],
|
|
14
31
|
"no-unused-vars": "off",
|
|
15
32
|
"curly": "error",
|
|
16
|
-
"brace-style": [
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"unicorn/prevent-abbreviations": "off",
|
|
24
|
-
"unicorn/no-null": "off",
|
|
33
|
+
"brace-style": [
|
|
34
|
+
"error",
|
|
35
|
+
"1tbs",
|
|
36
|
+
{
|
|
37
|
+
"allowSingleLine": true
|
|
38
|
+
}
|
|
39
|
+
],
|
|
25
40
|
"no-nested-ternary": "off",
|
|
26
|
-
// doesn't play well with prettier
|
|
27
|
-
"unicorn/no-nested-ternary": "off",
|
|
28
|
-
"unicorn/no-process-exit": "off",
|
|
29
|
-
|
|
30
41
|
// we need exceptions to be only "warn" because
|
|
31
42
|
// there are valid use cases for generic variables being
|
|
32
43
|
// used before being defined
|
|
33
|
-
"no-use-before-define": [
|
|
34
|
-
|
|
44
|
+
"no-use-before-define": [
|
|
45
|
+
"warn"
|
|
46
|
+
],
|
|
47
|
+
"@typescript-eslint/semi": [
|
|
48
|
+
"error",
|
|
49
|
+
"always"
|
|
50
|
+
],
|
|
35
51
|
"@typescript-eslint/no-unsafe-member-access": "off",
|
|
36
52
|
"@typescript-eslint/no-unsafe-call": "off",
|
|
37
53
|
"@typescript-eslint/no-unsafe-assignment": "off",
|
|
@@ -58,4 +74,4 @@
|
|
|
58
74
|
}
|
|
59
75
|
]
|
|
60
76
|
}
|
|
61
|
-
}
|
|
77
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
name: Continuous Integration
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
- master
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
testing:
|
|
11
|
+
name: testing
|
|
12
|
+
uses: yankeeinlondon/gha/.github/workflows/test.yml@main
|
|
13
|
+
|
|
14
|
+
publish:
|
|
15
|
+
name: npm
|
|
16
|
+
if: ( contains(github.event.head_commit.message, 'release v') )
|
|
17
|
+
needs:
|
|
18
|
+
- testing
|
|
19
|
+
uses: yankeeinlondon/gha/.github/workflows/npm.yml@main
|
|
20
|
+
with:
|
|
21
|
+
nodeVersion: 16
|
|
22
|
+
secrets:
|
|
23
|
+
npm_token: ${{secrets.NPM_TOKEN}}
|
|
24
|
+
|
|
25
|
+
do_not_publish:
|
|
26
|
+
name: npm / no publication
|
|
27
|
+
if: ( !contains(github.event.head_commit.message, 'release v') )
|
|
28
|
+
runs-on: ubuntu-latest
|
|
29
|
+
needs:
|
|
30
|
+
- testing
|
|
31
|
+
steps:
|
|
32
|
+
- name: Done
|
|
33
|
+
run: |
|
|
34
|
+
echo "::notice ::No need to publish to NPM"
|