inferred-types 0.35.0 → 0.36.1
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/README.md +2 -34
- package/dist/index.d.ts +1812 -1656
- package/dist/index.mjs +95 -26
- package/package.json +12 -11
- package/src/runtime/combinators/filter.ts +0 -1
- package/src/runtime/lists/asArray.ts +8 -4
- package/src/runtime/lists/createConverter.ts +62 -0
- package/src/runtime/lists/index.ts +1 -0
- package/src/runtime/literals/box.ts +41 -20
- package/src/runtime/literals/ensureLeading.ts +17 -0
- package/src/runtime/literals/ensureTrailing.ts +17 -0
- package/src/runtime/literals/index.ts +4 -2
- package/src/runtime/literals/pathJoin.ts +22 -7
- package/src/runtime/literals/{stripStarting.ts → stripLeading.ts} +4 -4
- package/src/runtime/literals/stripTrailing.ts +15 -0
- package/src/runtime/literals/wide.ts +13 -0
- package/src/runtime/type-checks/ifSameType.ts +20 -0
- package/src/runtime/type-checks/index.ts +1 -0
- package/src/runtime/type-checks/isBoolean.ts +2 -1
- package/src/runtime/type-checks/isFunction.ts +2 -4
- package/src/runtime/type-checks/isObject.ts +10 -2
- package/src/runtime/type-checks/isString.ts +1 -1
- package/src/runtime/type-checks/isUndefined.ts +8 -0
- package/src/types/alphabetic/EnsureLeading.ts +24 -0
- package/src/types/alphabetic/EnsureTrailing.ts +24 -0
- package/src/types/alphabetic/PathJoin.ts +43 -31
- package/src/types/alphabetic/{StripStarting.ts → StripLeading.ts} +1 -1
- package/src/types/alphabetic/{StripEnding.ts → StripTrailing.ts} +1 -1
- package/src/types/alphabetic/index.ts +5 -2
- package/src/types/boolean-logic/HasParameters.ts +21 -0
- package/src/types/boolean-logic/array.ts +2 -2
- package/src/types/boolean-logic/boolean.ts +1 -1
- package/src/types/boolean-logic/equivalency.ts +2 -2
- package/src/types/boolean-logic/index.ts +1 -0
- package/src/types/dictionary/props.ts +5 -0
- package/src/types/lists/ConvertAndMap.ts +151 -0
- package/src/types/type-conversion/Widen.ts +15 -0
- package/tests/boolean-logic/HasParameters.ts +29 -0
- package/tests/lists/asArray.test.ts +19 -1
- package/tests/literals/EnsureStripLeadingTrailing.test.ts +79 -0
- package/tests/literals/PathJoin.test.ts +44 -37
- package/tests/literals/box.test.ts +31 -23
- package/tests/runtime/if-is.spec.ts +66 -5
- package/tests/runtime/map-and-convert.test.ts +31 -0
- package/dist/index.js +0 -868
- package/src/runtime/literals/stripEnding.ts +0 -9
package/README.md
CHANGED
|
@@ -1,37 +1,5 @@
|
|
|
1
1
|
# Inferred Types
|
|
2
2
|
|
|
3
|
-
A collection of Typescript
|
|
4
|
-
|
|
5
|
-
**Functions**
|
|
6
|
-
|
|
7
|
-
- `Model` - wraps the popular `io-ts` codec/type class in a way that ensures that the model's name is seen as a _literal type_ rather than just a `string` as it is in `io-ts`. This helps TS's inference downstream.
|
|
8
|
-
- `Configurator` - provides a configurator which is intended to allow a type strong dictionary to be built up as part of a builder pattern
|
|
9
|
-
- `FluentConfigurator` - provides a fluent style API which also provides a similar feature set to the base `Configurator`.
|
|
10
|
-
- `arrayToObjectKind` and `arrayToObjectName` takes an array of objects which discriminate on the property `kind`/`name` and converts it into a strongly typed dictionary.
|
|
11
|
-
|
|
12
|
-
**Types**
|
|
13
|
-
|
|
14
|
-
- `PascalCase`, `CamelCase`, `DashToSnake`, and `KebabCase` are all utility classes which will convert a literal type to a transformed literal type of the appropriate casing.
|
|
15
|
-
- `Pluralize` takes a literal type and transforms it into the plural version of the type.
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
All symbols are typed and exported in both CommonJS and ESModule format.
|
|
19
|
-
|
|
20
|
-
## Devops
|
|
21
|
-
|
|
22
|
-
This repo uses **pnpm** to bring in all deps. Please use that instead of **npm**, **yarn**, or whatever your favorite package manager is these days. The main things you will be interested in while working this repo are:
|
|
23
|
-
|
|
24
|
-
- `pnpm build` - transpiles the Typescript source to javascript and typings files off of /dist; it uses Rollup to do this.
|
|
25
|
-
- `pnpm lint` - linting is part of the build process but sometimes you just want see the lint results without the parts of the build done
|
|
26
|
-
- `pnpm build:bundle` - if you have things which are not passing yet lint muster but you need to just test the executable code _as-is_ is building you can do that with this target
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
## Contributing
|
|
30
|
-
|
|
31
|
-
Contributions are welcome as pull requests. To aid in making this process efficient, please note:
|
|
32
|
-
|
|
33
|
-
- We use the _git-flow_ standard for branch naming and therefore, if you're wanting to merge in a PR please target it at the **@develop** branch and we will review it before merging it in. Once in develop we'll run it through CI-CD there and merge it into @master and deploy a new version of **npm**.
|
|
34
|
-
- New code requires _new_ (or at least _updated_) test cases to demonstrate both the intended effect and ensure this effect is preserved into the future; please expect us to reject the PR if there is no attempt to show
|
|
35
|
-
|
|
36
|
-
**Note:** all our coding standards have been hopefully incorporated as **eslint** rules and therefore stylistically so long as you're saving using these rules along with prettier we should be in good shape for the PR review to just focus on the "real stuff".
|
|
3
|
+
A collection of Typescript utilities which try to preserve as much strong and narrow typing as is possible. The repo's `src/` directory ia broken into a set of **runtime** utilities as well as pure **design-type** type utilities.
|
|
37
4
|
|
|
5
|
+
All utilities are tested for runtime and design-time correctness.
|