Repository: millsp/ts-toolbelt Branch: master Commit: b8a49285e3ed Files: 293 Total size: 382.9 KB Directory structure: gitextract_d0x81m7m/ ├── .commitlintrc.json ├── .eslintrc.json ├── .github/ │ ├── CODEOWNERS │ ├── FUNDING.yml │ ├── ISSUE_TEMPLATE/ │ │ ├── ---bug-report.md │ │ └── ---feature-request.md │ ├── pull_request_template.md │ └── stale.yml ├── .gitignore ├── .huskyrc.json ├── .travis.yml ├── .versionrc.json ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── SECURITY.md ├── package.json ├── scripts/ │ ├── build/ │ │ ├── clean.sh │ │ ├── code.sh │ │ ├── docs.sh │ │ └── types.sh │ ├── ci/ │ │ ├── branch/ │ │ │ ├── ad.sh │ │ │ └── bd.sh │ │ ├── master/ │ │ │ ├── ad.sh │ │ │ └── bd.sh │ │ └── test/ │ │ ├── ad.sh │ │ └── bd.sh │ ├── release.sh │ ├── test/ │ │ ├── all.sh │ │ ├── code.sh │ │ ├── lint.sh │ │ └── types.sh │ └── tools/ │ ├── check-deploy.sh │ ├── dt-update-version.ts │ ├── package-test-version.ts │ └── regex-update-file.ts ├── sources/ │ ├── Any/ │ │ ├── At.ts │ │ ├── Await.ts │ │ ├── Cast.ts │ │ ├── Compute.ts │ │ ├── Contains.ts │ │ ├── Equals.ts │ │ ├── Extends.ts │ │ ├── If.ts │ │ ├── Is.ts │ │ ├── Key.ts │ │ ├── Keys.ts │ │ ├── KnownKeys.ts │ │ ├── Promise.ts │ │ ├── Try.ts │ │ ├── Type.ts │ │ ├── _Internal.ts │ │ ├── _api.ts │ │ └── x.ts │ ├── Boolean/ │ │ ├── And.ts │ │ ├── Not.ts │ │ ├── Or.ts │ │ ├── Xor.ts │ │ ├── _Internal.ts │ │ └── _api.ts │ ├── Class/ │ │ ├── Class.ts │ │ ├── Instance.ts │ │ ├── Parameters.ts │ │ └── _api.ts │ ├── Community/ │ │ ├── IncludesDeep.ts │ │ ├── IsLiteral.ts │ │ └── _api.ts │ ├── Function/ │ │ ├── AutoPath.ts │ │ ├── Compose/ │ │ │ ├── List/ │ │ │ │ ├── Async.ts │ │ │ │ └── Sync.ts │ │ │ └── Multi/ │ │ │ ├── Async.ts │ │ │ └── Sync.ts │ │ ├── Compose.ts │ │ ├── Curry.ts │ │ ├── Exact.ts │ │ ├── Function.ts │ │ ├── Length.ts │ │ ├── Narrow.ts │ │ ├── NoInfer.ts │ │ ├── Parameters.ts │ │ ├── Pipe/ │ │ │ ├── List/ │ │ │ │ ├── Async.ts │ │ │ │ └── Sync.ts │ │ │ └── Multi/ │ │ │ ├── Async.ts │ │ │ └── Sync.ts │ │ ├── Pipe.ts │ │ ├── Promisify.ts │ │ ├── Return.ts │ │ ├── UnCurry.ts │ │ ├── ValidPath.ts │ │ ├── _Internal.ts │ │ └── _api.ts │ ├── Iteration/ │ │ ├── Iteration.ts │ │ ├── IterationOf.ts │ │ ├── Key.ts │ │ ├── Next.ts │ │ ├── Pos.ts │ │ ├── Prev.ts │ │ ├── _Internal.ts │ │ └── _api.ts │ ├── List/ │ │ ├── Append.ts │ │ ├── Assign.ts │ │ ├── AtLeast.ts │ │ ├── Compulsory.ts │ │ ├── CompulsoryKeys.ts │ │ ├── Concat.ts │ │ ├── Diff.ts │ │ ├── Drop.ts │ │ ├── Either.ts │ │ ├── Exclude.ts │ │ ├── ExcludeKeys.ts │ │ ├── Extract.ts │ │ ├── Filter.ts │ │ ├── FilterKeys.ts │ │ ├── Flatten.ts │ │ ├── Group.ts │ │ ├── Has.ts │ │ ├── HasPath.ts │ │ ├── Head.ts │ │ ├── Includes.ts │ │ ├── Intersect.ts │ │ ├── IntersectKeys.ts │ │ ├── KeySet.ts │ │ ├── Last.ts │ │ ├── LastKey.ts │ │ ├── Length.ts │ │ ├── List.ts │ │ ├── Longest.ts │ │ ├── Merge.ts │ │ ├── MergeAll.ts │ │ ├── Modify.ts │ │ ├── NonNullable.ts │ │ ├── NonNullableKeys.ts │ │ ├── Nullable.ts │ │ ├── NullableKeys.ts │ │ ├── ObjectOf.ts │ │ ├── Omit.ts │ │ ├── Optional.ts │ │ ├── OptionalKeys.ts │ │ ├── Overwrite.ts │ │ ├── Partial.ts │ │ ├── Patch.ts │ │ ├── PatchAll.ts │ │ ├── Path.ts │ │ ├── Paths.ts │ │ ├── Pick.ts │ │ ├── Pop.ts │ │ ├── Prepend.ts │ │ ├── Readonly.ts │ │ ├── ReadonlyKeys.ts │ │ ├── Remove.ts │ │ ├── Repeat.ts │ │ ├── Replace.ts │ │ ├── Required.ts │ │ ├── RequiredKeys.ts │ │ ├── Reverse.ts │ │ ├── Select.ts │ │ ├── SelectKeys.ts │ │ ├── Shortest.ts │ │ ├── Tail.ts │ │ ├── Take.ts │ │ ├── UnNest.ts │ │ ├── Undefinable.ts │ │ ├── UndefinableKeys.ts │ │ ├── UnionOf.ts │ │ ├── Unionize.ts │ │ ├── Update.ts │ │ ├── Writable.ts │ │ ├── WritableKeys.ts │ │ ├── Zip.ts │ │ ├── ZipObj.ts │ │ ├── _Internal.ts │ │ └── _api.ts │ ├── Misc/ │ │ ├── BuiltIn.ts │ │ ├── JSON/ │ │ │ ├── Array.ts │ │ │ ├── Object.ts │ │ │ ├── Primitive.ts │ │ │ ├── Value.ts │ │ │ └── _api.ts │ │ ├── Primitive.ts │ │ └── _api.ts │ ├── Number/ │ │ ├── Absolute.ts │ │ ├── Add.ts │ │ ├── Greater.ts │ │ ├── GreaterEq.ts │ │ ├── IsNegative.ts │ │ ├── IsPositive.ts │ │ ├── IsZero.ts │ │ ├── Lower.ts │ │ ├── LowerEq.ts │ │ ├── Negate.ts │ │ ├── Range.ts │ │ ├── Sub.ts │ │ └── _api.ts │ ├── Object/ │ │ ├── Assign.ts │ │ ├── AtLeast.ts │ │ ├── Compulsory.ts │ │ ├── CompulsoryKeys.ts │ │ ├── Diff.ts │ │ ├── Either.ts │ │ ├── Exclude.ts │ │ ├── ExcludeKeys.ts │ │ ├── Filter.ts │ │ ├── FilterKeys.ts │ │ ├── Has.ts │ │ ├── HasPath.ts │ │ ├── Includes.ts │ │ ├── Intersect.ts │ │ ├── IntersectKeys.ts │ │ ├── Invert.ts │ │ ├── ListOf.ts │ │ ├── Merge.ts │ │ ├── MergeAll.ts │ │ ├── Modify.ts │ │ ├── NonNullable.ts │ │ ├── NonNullableKeys.ts │ │ ├── Nullable.ts │ │ ├── NullableKeys.ts │ │ ├── Object.ts │ │ ├── Omit.ts │ │ ├── Optional.ts │ │ ├── OptionalKeys.ts │ │ ├── Overwrite.ts │ │ ├── P/ │ │ │ ├── Merge.ts │ │ │ ├── Omit.ts │ │ │ ├── Pick.ts │ │ │ ├── Readonly.ts │ │ │ ├── Record.ts │ │ │ ├── Update.ts │ │ │ ├── _Internal.ts │ │ │ └── _api.ts │ │ ├── Partial.ts │ │ ├── Patch.ts │ │ ├── PatchAll.ts │ │ ├── Path.ts │ │ ├── Paths.ts │ │ ├── Pick.ts │ │ ├── Readonly.ts │ │ ├── ReadonlyKeys.ts │ │ ├── Record.ts │ │ ├── Replace.ts │ │ ├── Required.ts │ │ ├── RequiredKeys.ts │ │ ├── Select.ts │ │ ├── SelectKeys.ts │ │ ├── Undefinable.ts │ │ ├── UndefinableKeys.ts │ │ ├── UnionOf.ts │ │ ├── Unionize.ts │ │ ├── Update.ts │ │ ├── Writable.ts │ │ ├── WritableKeys.ts │ │ ├── _Internal.ts │ │ └── _api.ts │ ├── String/ │ │ ├── At.ts │ │ ├── Join.ts │ │ ├── Length.ts │ │ ├── Replace.ts │ │ ├── Split.ts │ │ ├── _Internal.ts │ │ └── _api.ts │ ├── Test.ts │ ├── Union/ │ │ ├── Diff.ts │ │ ├── Exclude.ts │ │ ├── Filter.ts │ │ ├── Has.ts │ │ ├── Intersect.ts │ │ ├── IntersectOf.ts │ │ ├── Last.ts │ │ ├── ListOf.ts │ │ ├── Merge.ts │ │ ├── NonNullable.ts │ │ ├── Nullable.ts │ │ ├── Pop.ts │ │ ├── Replace.ts │ │ ├── Select.ts │ │ ├── Strict.ts │ │ └── _api.ts │ └── index.ts ├── tests/ │ ├── Any.ts │ ├── Boolean.ts │ ├── Class.ts │ ├── Community.ts │ ├── Function.ts │ ├── Iteration.ts │ ├── List.ts │ ├── Misc.ts │ ├── Number.ts │ ├── Object.ts │ ├── String.ts │ └── Union.ts └── tsconfig.json ================================================ FILE CONTENTS ================================================ ================================================ FILE: .commitlintrc.json ================================================ { "extends": ["@commitlint/config-conventional"] } ================================================ FILE: .eslintrc.json ================================================ { // https://github.com/Microsoft/vscode-eslint/issues/284 "parser": "@typescript-eslint/parser", "extends": ["eslint:recommended"], "plugins": ["react", "fp"], "env": { "browser": true, "es6": true, "commonjs": true }, "globals": { "__dirname": false }, "parserOptions": { "jsx": true, "ecmaFeatures": { "jsx": true }, "ecmaVersion": 2018, "sourceType": "module" }, "rules": { // code features "array-callback-return" : ["error"], "arrow-parens" : ["error"], "arrow-spacing" : ["error"], "curly" : ["error", "multi-or-nest"], "default-case" : ["error"], "dot-location" : ["error"], "eqeqeq" : ["warn"], "generator-star-spacing" : ["error"], "no-caller" : ["error"], "no-console" : ["off"], "no-div-regex" : ["error"], "no-else-return" : ["error"], "no-extend-native" : ["error"], "no-floating-decimal" : ["error"], // "no-implicit-coercion" : ["error"], "no-implicit-globals" : ["error"], "no-implied-eval" : ["error"], "no-invalid-this" : ["error"], "no-labels" : ["error"], "no-new-wrappers" : ["error"], "no-proto" : ["error"], "no-return-assign" : ["error"], "no-return-await" : ["error"], "no-self-compare" : ["error"], "no-sequences" : ["error"], "no-unmodified-loop-condition": ["warn"], "no-undef" : ["off"], "no-unused-vars" : ["off"], "no-useless-call" : ["error"], "no-useless-catch" : ["error"], "no-useless-concat" : ["error"], "no-useless-return" : ["error"], "no-var" : ["error"], "no-with" : ["error"], // "object-shorthand" : ["warn"], "prefer-arrow-callback" : ["error"], "prefer-rest-params" : ["error"], "prefer-spread" : ["error"], "prefer-template" : ["error"], "require-await" : ["warn"], "require-unicode-regexp" : ["error"], "rest-spread-spacing" : ["error"], "symbol-description" : ["error"], "template-curly-spacing" : ["error"], "yield-star-spacing" : ["error", "before"], "yoda" : ["error"], // code style "array-bracket-newline" : ["error", "consistent"], "array-bracket-spacing" : ["error"], "block-spacing" : ["error", "never"], "brace-style" : ["error", "1tbs", {"allowSingleLine": true}], "comma-dangle" : ["error", "always-multiline"], "comma-spacing" : ["error", {"before": false, "after": true}], "computed-property-spacing" : ["error"], "eol-last" : ["error"], "func-call-spacing" : ["error"], "indent" : ["error", 4, {"MemberExpression": 0}], "key-spacing" : ["error", {"align": "colon"}], "keyword-spacing" : ["error"], "linebreak-style" : ["error"], "new-cap" : ["error", {"capIsNew": false}], "no-array-constructor" : ["error"], "no-multi-assign" : ["error"], "no-nested-ternary" : ["error"], "no-whitespace-before-property": ["error"], "object-curly-newline" : ["error"], "object-curly-spacing" : ["error"], "prefer-object-spread" : ["error"], "quotes" : ["error", "single"], "semi" : ["error", "never"], "no-trailing-spaces" : ["error"] // "multiline-comment-style" : ["error", "starred-block"] } } ================================================ FILE: .github/CODEOWNERS ================================================ * @millsp ================================================ FILE: .github/FUNDING.yml ================================================ github: millsp custom: https://www.buymeacoffee.com/millsp patreon: millsp ================================================ FILE: .github/ISSUE_TEMPLATE/---bug-report.md ================================================ --- name: "🐞 Bug Report" about: "Something isn't working well 💔" --- ## 🐞 Bug Report #### Describe the bug #### Reproduce the bug ```ts // REPL or a link to your repository if applicable. // A *self-contained* demonstration of the problem. ``` #### Expected behavior #### Possible Solution #### Screenshots #### Additional context ================================================ FILE: .github/ISSUE_TEMPLATE/---feature-request.md ================================================ --- name: "🍩 Feature Request" about: "Suggest an idea for this project 💡" --- ## 🍩 Feature Request #### Is your feature request related to a problem? #### Describe the solution you'd like #### Describe alternatives you've considered #### Teachability, Documentation, Adoption, Migration Strategy ================================================ FILE: .github/pull_request_template.md ================================================ ## 🎁 Pull Request * [ ] Used a clear / meaningful title for this pull request * [ ] Tested the changes in your own code (on your projects) * [ ] Added / Edited tests to reflect changes (`tests` folder) * [ ] Have read the **Contributing** part of the **Readme** * [ ] Passed `npm test` #### Fixes #### Why have you made changes? #### What changes have you made? * changed this to achieve this * changed that to achieve this * ... #### What tests have you updated? * tested this in `tests/...` * tested that in `tests/...` * ... #### Is there any breaking changes? * [ ] Yes, I changed the public API & documented it * [ ] Yes, I changed existing tests * [ ] No, I added to the public API & documented it * [ ] No, I added to the existing tests * [ ] I don't know #### Anything else worth mentioning? ================================================ FILE: .github/stale.yml ================================================ # Number of days of inactivity before an issue becomes stale daysUntilStale: 60 # Number of days of inactivity before a stale issue is closed daysUntilClose: 7 # Issues with these labels will never be considered stale exemptLabels: - pinned #todo - security # Label to use when marking an issue as stale staleLabel: wontfix # Comment to post when marking an issue as stale. Set to `false` to disable markComment: > This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. # Comment to post when closing a stale issue. Set to `false` to disable closeComment: false ================================================ FILE: .gitignore ================================================ package-lock.json node_modules .vscode *.tgz docs out dt ================================================ FILE: .huskyrc.json ================================================ { "hooks": { "commit-msg": "commitlint -E HUSKY_GIT_PARAMS" } } ================================================ FILE: .travis.yml ================================================ # https://docs.travis-ci.com/user/job-lifecycle language: node_js node_js: - '12.0' git: depth: 5 install: - npm install --only=dev env: - DEPLOY=true stages: - test - deploy:master - deploy:branch - deploy:docs jobs: include: - stage: test if: tag IS blank # filter double build with tags script: - npm run test deploy: edge: true provider: npm email: $NPM_EMAIL api_key: $NPM_TOKEN skip_cleanup: true tag: test on: all_branches: true before_deploy: # https://github.com/travis-ci/travis-ci/issues/1574#issuecomment-451787844 - if ! npm run ci:test:bd; then travis_terminate 1; fi after_deploy: # the above link explains how to make the build fail if something went wrong - if ! npm run ci:test:ad; then travis_terminate 1; fi - stage: deploy:master if: tag IS blank AND branch = master AND fork = false AND env(DEPLOY) = true deploy: edge: true provider: npm email: $NPM_EMAIL api_key: $NPM_TOKEN tag: latest skip_cleanup: true on: all_branches: true before_deploy: - if ! npm run ci:master:bd; then travis_terminate 1; fi after_deploy: - if ! npm run ci:master:ad; then travis_terminate 1; fi - stage: deploy:branch if: tag IS blank AND branch != master AND fork = false AND env(DEPLOY) = true deploy: edge: true provider: npm email: $NPM_EMAIL api_key: $NPM_TOKEN tag: $TRAVIS_BRANCH skip_cleanup: true on: all_branches: true before_deploy: - if ! npm run ci:branch:bd; then travis_terminate 1; fi after_deploy: - if ! npm run ci:branch:ad; then travis_terminate 1; fi - stage: deploy:docs #deploys doc to gh-pages branch if: tag IS blank AND branch = master AND fork = false AND env(DEPLOY) = true deploy: edge: true provider: pages skip_cleanup: true github_token: $GH_TOKEN local_dir: "docs" keep_history: true on: all_branches: true before_deploy: - if ! npm run ci:docs:bd; then travis_terminate 1; fi after_deploy: - if ! npm run ci:docs:ad; then travis_terminate 1; fi ================================================ FILE: .versionrc.json ================================================ { "types": [ {"type": "feat", "section": "Features"}, {"type": "fix", "section": "Bug Fixes"}, {"type": "build", "section": "Others"}, {"type": "ci", "section": "Others"}, {"type": "chore", "section": "Others"}, {"type": "docs", "section": "Others"}, {"type": "perf", "section": "Others"}, {"type": "refactor", "section": "Others"}, {"type": "revert", "section": "Others"}, {"type": "style", "section": "Others"}, {"type": "test", "section": "Others"} ] } ================================================ FILE: CHANGELOG.md ================================================ # Changelog All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. ## [9.6.0](https://github.com/millsp/ts-toolbelt/compare/v9.5.1...v9.6.0) (2021-03-10) ### Features * **paths:** parameter for AutoPath delimiter ([6d5bbdc](https://github.com/millsp/ts-toolbelt/commit/6d5bbdc834ce15dd3339d101c828457b1a34cce4)) ### Bug Fixes * **f.autopath:** distribute ([29eddd9](https://github.com/millsp/ts-toolbelt/commit/29eddd99c6826696941c50681ce4858243786110)) * **f.autopath:** do not show primitive props ([1ad2638](https://github.com/millsp/ts-toolbelt/commit/1ad26389aa6a9a795d19d90d2724c73ae2bd51d9)) * **f.autopath:** no primitve paths ([2bdb477](https://github.com/millsp/ts-toolbelt/commit/2bdb4778325288154c8f71c0a5ae4a1b7e2b217f)) * **f.narrow:** fix variance and array inference ([4c7618d](https://github.com/millsp/ts-toolbelt/commit/4c7618d77b07d6b8c6dfd5087aa85a073bf57db3)) * **f.narrow:** higher order function support ([dad05ee](https://github.com/millsp/ts-toolbelt/commit/dad05eec6e6710ea4f63063658a3dee4d9c0ca28)) * **f.narrow:** preserve fns and better display ([a0d62d8](https://github.com/millsp/ts-toolbelt/commit/a0d62d8cfcd28eab7132c225ba187556ca749b4d)) * **f.narrow:** preserve functions ([c34f1b9](https://github.com/millsp/ts-toolbelt/commit/c34f1b95d0e0855203104eb696cfcb8221a65374)) * **f.narrow:** revert variance fixes ([12e014a](https://github.com/millsp/ts-toolbelt/commit/12e014a3f3d34047a3722486a73493f857a3697a)) * **f.narrow:** variance ([866ecd7](https://github.com/millsp/ts-toolbelt/commit/866ecd76744fc38244d85e7ef7b4bb90105cf7eb)) * **fn:** allow for curried in compose ([2bc5604](https://github.com/millsp/ts-toolbelt/commit/2bc560446916b423977c25e396b4f1f310b6c03f)) * **o.paths:** dive within arrays and deeper ([626beb6](https://github.com/millsp/ts-toolbelt/commit/626beb61b3100c5e4fd699c946e0e2fed7e24cb6)) ### Others * **list:** more flexible keys ([d9415b2](https://github.com/millsp/ts-toolbelt/commit/d9415b2f85633c7c74a815c9909899114faf530c)) * **o.p:** re-implement ([0f44362](https://github.com/millsp/ts-toolbelt/commit/0f443626dc3b114b6784d2053510a1e0c2f7f839)) * **release:** 9.5.10 ([1f3928a](https://github.com/millsp/ts-toolbelt/commit/1f3928a70ff2a7e903a5398b53295c9c9997b42c)) * **release:** 9.5.11 ([bde9210](https://github.com/millsp/ts-toolbelt/commit/bde9210d0a361ddb1e03920a0c2bd42dad17ee30)) * **release:** 9.5.12 ([80579e1](https://github.com/millsp/ts-toolbelt/commit/80579e1eaa17b2d1c61bd7881d0ea6ff94753141)) * **release:** 9.5.13 ([277a6e2](https://github.com/millsp/ts-toolbelt/commit/277a6e2ac5ca8be2bbcd7593d987aaac3ea9bb75)) * **release:** 9.5.2 ([ec4a953](https://github.com/millsp/ts-toolbelt/commit/ec4a953cabe6c4d704c0dca5f37d1dc630de047b)) * **release:** 9.5.3 ([0836f6e](https://github.com/millsp/ts-toolbelt/commit/0836f6e8187287a0c86f249e4e552d68a44e4f60)) * **release:** 9.5.4 ([855855e](https://github.com/millsp/ts-toolbelt/commit/855855e520ed4a04059f9d61884d2045dd0d751b)) * **release:** 9.5.5 ([e28bddf](https://github.com/millsp/ts-toolbelt/commit/e28bddf33066850a764e2ba344883ff84da561b9)) * **release:** 9.5.6 ([b8e0d0a](https://github.com/millsp/ts-toolbelt/commit/b8e0d0a83228baf666e00f4fdb0d99ca936c133f)) * **release:** 9.5.7 ([5646455](https://github.com/millsp/ts-toolbelt/commit/564645547862c7d698f4a03b15ccb7a5ffb5fc29)) * **release:** 9.5.8 ([bceb8be](https://github.com/millsp/ts-toolbelt/commit/bceb8be67701f9c7aba9608aed851567e8118ca5)) * **release:** 9.5.9 ([533a6ac](https://github.com/millsp/ts-toolbelt/commit/533a6ac0f7b713933c94f0962166c7a0245b055e)) * **release:** 9.6.0 ([5e6d008](https://github.com/millsp/ts-toolbelt/commit/5e6d008888c1705e41bf752b3a308323a5c563fe)) * **string:** instantiation limiters ([9a678d8](https://github.com/millsp/ts-toolbelt/commit/9a678d8a400c97436d428dad05405abb154af958)) * **update:** remove dirty code ([9d0ff64](https://github.com/millsp/ts-toolbelt/commit/9d0ff6441518c2c9a01cea7726c08acd19eb37d9)) * cleanup ([6f23f2e](https://github.com/millsp/ts-toolbelt/commit/6f23f2ec79145a0545eb45d15d50d0363a119b12)) ================================================ FILE: CODE_OF_CONDUCT.md ================================================ # Contributor Covenant Code of Conduct ## Our Pledge In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to make participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. ## Our Standards Examples of behavior that contributes to creating a positive environment include: * Using welcoming and inclusive language * Being respectful of differing viewpoints and experiences * Gracefully accepting constructive criticism * Focusing on what is best for the community * Showing empathy towards other community members Examples of unacceptable behavior by participants include: * The use of sexualized language or imagery and unwelcome sexual attention or advances * Trolling, insulting/derogatory comments, and personal or political attacks * Public or private harassment * Publishing others' private information, such as a physical or electronic address, without explicit permission * Other conduct which could reasonably be considered inappropriate in a professional setting ## Our Responsibilities Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. ## Scope This Code of Conduct applies within all project spaces, and it also applies when an individual is representing the project or its community in public spaces. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [gitter.im/millsp](https://gitter.im/millsp). All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. ## Attribution This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html [homepage]: https://www.contributor-covenant.org For answers to common questions about this code of conduct, see https://www.contributor-covenant.org/faq ================================================ FILE: CONTRIBUTING.md ================================================ Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**. There are many ways to contribute to the project: ### Community * [Help the community with answers on Gitter](https://gitter.im/ts-toolbelt/community?utm_source=share-link&utm_medium=link&utm_campaign=share-link) * [Reporting bugs or requesting new features](https://github.com/millsp/ts-toolbelt/issues/new/choose) ### Codebase * Improving existing documentation * Adding new types to the collection * [Getting involved with things to do](#-whats-next) ### Pull Requests 1. [Read the tutorial](https://medium.com/free-code-camp/typescript-curry-ramda-types-f747e99744ab) 2. Fork the project 3. Clone your fork 4. Create a pr/**feature** branch ```sh git checkout -b pr/CoolFeature ``` 5. Commit your changes You **must** follow the [conventional commit](https://conventionalcommits.org) to be able to commit ```sh git commit -m "feat(name): Added this CoolFeature" ``` 6. [Run the tests](#-running-tests) 7. Push your changes ```sh npm run release -- --no-tags ``` 8. Open a pull request ================================================ FILE: LICENSE ================================================ Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright 2019 Pierre-Antoine Mills Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ================================================ FILE: README.md ================================================
📖 Documentation · 📣 Announcements · 🐞 Report Bug · 🍩 Request Feature · 🤔 Ask Questions
## About **ts-toolbelt** is the largest, and most tested type library available right now, featuring **+200 utilities**. Our type collection packages some of the most advanced mapped types, conditional types, and recursive types on the market. **Spend less time, build stronger**. Benefit from a wide range of generic type functions to achieve better type safety. We work just like lodash, or ramda, but applied to the type system. Our mission is to provide you with simple ways to compute, change, and create types. We abstract all those complex type checks away for you. We provide a simple, reusable, and standard API to help you get more done with TypeScript. **ts-toolbelt** is a well organized package that can help you perform advanced operations on object types, union types, as well as function, and literal types. It is carefully and coherently designed for building robust, flexible, and type-safe software. We are a community and a knowledge base. Everyone is welcome to ask questions about types. If you are stuck or you misunderstand something, you came to the right place!. We welcome beginners and advanced developers to come take part. **Welcome!** ## Getting Started ### Prerequisites ```sh npm install typescript@^4.1.0 --save-dev ``` For best results, add this to your `tsconfig.json` ```ts { "compilerOptions": { // highly recommended (required by few utilities) "strictNullChecks": true, // this is optional, but enable whenever possible "strict": true, // this is the lowest supported standard library "lib": ["es2015"], } } ``` ### Installation ```sh npm install ts-toolbelt --save ``` ### Hello World ```ts import {Object} from "ts-toolbelt" // Check the docs below for more // Merge two `object` together type merge = Object.Merge<{name: string}, {age?: number}> // {name: string, age?: number} // Make a field of an `object` optional type optional = Object.Optional<{id: number, name: string}, "name"> // {id: number, name?: string} ``` You can [**level-up, and re-code this library from scratch**](https://medium.com/free-code-camp/typescript-curry-ramda-types-f747e99744ab). ## [Documentation ⤢](https://millsp.github.io/ts-toolbelt/) ### Imports The project is organized around TypeScript's main concepts: | **Any** | **Boolean** | **Class** | **Function** | **Iteration** | **List** | |------------|-------------|--------------|--------------|---------------|----------| | **Number** | **Object** | **Object.P** | **String** | **Union** | **Test** | > **`TIP`** How to choose categories? Match your type with them. There are many ways to import the types into your project: * **Explicit** ```ts import {Any, Boolean, Class, Function, Iteration, List, Number, Object, String, Union} from "ts-toolbelt" ``` * **Compact** ```ts import {A, B, C, F, I, L, N, O, S, U} from "ts-toolbelt" ``` * **Portable** ```ts import tb from "ts-toolbelt" ``` You can also import our non-official API from the community: ```ts import {Community} from "ts-toolbelt" ``` > **`TIP`** The community API is for our community to publish useful types that > don't see fit in the standard API. ### Utility Index |ANY|OBJECT|LIST|FUNCTION|STRING|UNION|CLASS|BOOLEAN|NUMBER|OBJECT.P|ITERATION| |---|---|---|---|---|---|---|---|---|---|---| |[Await](https://millsp.github.io/ts-toolbelt/modules/any_await.html)|[Assign](https://millsp.github.io/ts-toolbelt/modules/object_assign.html)|[Append](https://millsp.github.io/ts-toolbelt/modules/list_append.html)|[AutoPath](https://millsp.github.io/ts-toolbelt/modules/function_autopath.html)|[At](https://millsp.github.io/ts-toolbelt/modules/string_at.html)|[Diff](https://millsp.github.io/ts-toolbelt/modules/union_diff.html)|[Class](https://millsp.github.io/ts-toolbelt/modules/class_class.html)|[And](https://millsp.github.io/ts-toolbelt/modules/boolean_and.html)|[Absolute](https://millsp.github.io/ts-toolbelt/modules/number_absolute.html)|[Merge](https://millsp.github.io/ts-toolbelt/modules/object_p_merge.html)|[Iteration](https://millsp.github.io/ts-toolbelt/modules/iteration_iteration.html)| |[At](https://millsp.github.io/ts-toolbelt/modules/any_at.html)|[AtLeast](https://millsp.github.io/ts-toolbelt/modules/object_atleast.html)|[Assign](https://millsp.github.io/ts-toolbelt/modules/list_assign.html)|[Compose](https://millsp.github.io/ts-toolbelt/modules/function_compose.html)|[Join](https://millsp.github.io/ts-toolbelt/modules/string_join.html)|[Exclude](https://millsp.github.io/ts-toolbelt/modules/union_exclude.html)|[Instance](https://millsp.github.io/ts-toolbelt/modules/class_instance.html)|[Not](https://millsp.github.io/ts-toolbelt/modules/boolean_not.html)|[Add](https://millsp.github.io/ts-toolbelt/modules/number_add.html)|[Omit](https://millsp.github.io/ts-toolbelt/modules/object_p_omit.html)|[IterationOf](https://millsp.github.io/ts-toolbelt/modules/iteration_iterationof.html)| |[Cast](https://millsp.github.io/ts-toolbelt/modules/any_cast.html)|[Compulsory](https://millsp.github.io/ts-toolbelt/modules/object_compulsory.html)|[AtLeast](https://millsp.github.io/ts-toolbelt/modules/list_atleast.html)|[Curry](https://millsp.github.io/ts-toolbelt/modules/function_curry.html)|[Length](https://millsp.github.io/ts-toolbelt/modules/string_length.html)|[Filter](https://millsp.github.io/ts-toolbelt/modules/union_filter.html)|[Parameters](https://millsp.github.io/ts-toolbelt/modules/class_parameters.html)|[Or](https://millsp.github.io/ts-toolbelt/modules/boolean_or.html)|[Greater](https://millsp.github.io/ts-toolbelt/modules/number_greater.html)|[Pick](https://millsp.github.io/ts-toolbelt/modules/object_p_pick.html)|[Key](https://millsp.github.io/ts-toolbelt/modules/iteration_key.html)| |[Compute](https://millsp.github.io/ts-toolbelt/modules/any_compute.html)|[CompulsoryKeys](https://millsp.github.io/ts-toolbelt/modules/object_compulsorykeys.html)|[Compulsory](https://millsp.github.io/ts-toolbelt/modules/list_compulsory.html)|[Exact](https://millsp.github.io/ts-toolbelt/modules/function_exact.html)|[Replace](https://millsp.github.io/ts-toolbelt/modules/string_replace.html)|[Has](https://millsp.github.io/ts-toolbelt/modules/union_has.html)||[Xor](https://millsp.github.io/ts-toolbelt/modules/boolean_xor.html)|[GreaterEq](https://millsp.github.io/ts-toolbelt/modules/number_greatereq.html)|[Readonly](https://millsp.github.io/ts-toolbelt/modules/object_p_readonly.html)|[Next](https://millsp.github.io/ts-toolbelt/modules/iteration_next.html)| |[Contains](https://millsp.github.io/ts-toolbelt/modules/any_contains.html)|[Diff](https://millsp.github.io/ts-toolbelt/modules/object_diff.html)|[CompulsoryKeys](https://millsp.github.io/ts-toolbelt/modules/list_compulsorykeys.html)|[Function](https://millsp.github.io/ts-toolbelt/modules/function_function.html)|[Split](https://millsp.github.io/ts-toolbelt/modules/string_split.html)|[IntersectOf](https://millsp.github.io/ts-toolbelt/modules/union_intersectof.html)|||[IsNegative](https://millsp.github.io/ts-toolbelt/modules/number_isnegative.html)|[Update](https://millsp.github.io/ts-toolbelt/modules/object_p_update.html)|[Pos](https://millsp.github.io/ts-toolbelt/modules/iteration_pos.html)| |[Equals](https://millsp.github.io/ts-toolbelt/modules/any_equals.html)|[Either](https://millsp.github.io/ts-toolbelt/modules/object_either.html)|[Concat](https://millsp.github.io/ts-toolbelt/modules/list_concat.html)|[Length](https://millsp.github.io/ts-toolbelt/modules/function_length.html)||[Last](https://millsp.github.io/ts-toolbelt/modules/union_last.html)|||[IsPositive](https://millsp.github.io/ts-toolbelt/modules/number_ispositive.html)|[Record](https://millsp.github.io/ts-toolbelt/modules/object_p_record.html)|[Prev](https://millsp.github.io/ts-toolbelt/modules/iteration_prev.html)| |[Extends](https://millsp.github.io/ts-toolbelt/modules/any_extends.html)|[Exclude](https://millsp.github.io/ts-toolbelt/modules/object_exclude.html)|[Diff](https://millsp.github.io/ts-toolbelt/modules/list_diff.html)|[Narrow](https://millsp.github.io/ts-toolbelt/modules/function_narrow.html)||[Merge](https://millsp.github.io/ts-toolbelt/modules/union_merge.html)|||[IsZero](https://millsp.github.io/ts-toolbelt/modules/number_iszero.html)||| |[Key](https://millsp.github.io/ts-toolbelt/modules/any_key.html)|[ExcludeKeys](https://millsp.github.io/ts-toolbelt/modules/object_excludekeys.html)|[Drop](https://millsp.github.io/ts-toolbelt/modules/list_drop.html)|[NoInfer](https://millsp.github.io/ts-toolbelt/modules/function_noinfer.html)||[NonNullable](https://millsp.github.io/ts-toolbelt/modules/union_nonnullable.html)|||[Lower](https://millsp.github.io/ts-toolbelt/modules/number_lower.html)||| |[Keys](https://millsp.github.io/ts-toolbelt/modules/any_keys.html)|[Filter](https://millsp.github.io/ts-toolbelt/modules/object_filter.html)|[Either](https://millsp.github.io/ts-toolbelt/modules/list_either.html)|[Parameters](https://millsp.github.io/ts-toolbelt/modules/function_parameters.html)||[Nullable](https://millsp.github.io/ts-toolbelt/modules/union_nullable.html)|||[LowerEq](https://millsp.github.io/ts-toolbelt/modules/number_lowereq.html)||| |[KnownKeys](https://millsp.github.io/ts-toolbelt/modules/any_knownkeys.html)|[FilterKeys](https://millsp.github.io/ts-toolbelt/modules/object_filterkeys.html)|[Exclude](https://millsp.github.io/ts-toolbelt/modules/list_exclude.html)|[Pipe](https://millsp.github.io/ts-toolbelt/modules/function_pipe.html)||[Pop](https://millsp.github.io/ts-toolbelt/modules/union_pop.html)|||[Negate](https://millsp.github.io/ts-toolbelt/modules/number_negate.html)||| |[Is](https://millsp.github.io/ts-toolbelt/modules/any_is.html)|[Has](https://millsp.github.io/ts-toolbelt/modules/object_has.html)|[ExcludeKeys](https://millsp.github.io/ts-toolbelt/modules/list_excludekeys.html)|[Promisify](https://millsp.github.io/ts-toolbelt/modules/function_promisify.html)||[Replace](https://millsp.github.io/ts-toolbelt/modules/union_replace.html)|||[Range](https://millsp.github.io/ts-toolbelt/modules/number_range.html)||| |[Promise](https://millsp.github.io/ts-toolbelt/modules/any_promise.html)|[HasPath](https://millsp.github.io/ts-toolbelt/modules/object_haspath.html)|[Extract](https://millsp.github.io/ts-toolbelt/modules/list_extract.html)|[Return](https://millsp.github.io/ts-toolbelt/modules/function_return.html)||[Select](https://millsp.github.io/ts-toolbelt/modules/union_select.html)|||[Sub](https://millsp.github.io/ts-toolbelt/modules/number_sub.html)||| |[Try](https://millsp.github.io/ts-toolbelt/modules/any_try.html)|[Includes](https://millsp.github.io/ts-toolbelt/modules/object_includes.html)|[Filter](https://millsp.github.io/ts-toolbelt/modules/list_filter.html)|[UnCurry](https://millsp.github.io/ts-toolbelt/modules/function_uncurry.html)||[Strict](https://millsp.github.io/ts-toolbelt/modules/union_strict.html)|||||| |[Type](https://millsp.github.io/ts-toolbelt/modules/any_type.html)|[Intersect](https://millsp.github.io/ts-toolbelt/modules/object_intersect.html)|[FilterKeys](https://millsp.github.io/ts-toolbelt/modules/list_filterkeys.html)|[ValidPath](https://millsp.github.io/ts-toolbelt/modules/function_validpath.html)||[ListOf](https://millsp.github.io/ts-toolbelt/modules/union_listof.html)|||||| |[x](https://millsp.github.io/ts-toolbelt/modules/any_x.html)|[IntersectKeys](https://millsp.github.io/ts-toolbelt/modules/object_intersectkeys.html)|[Flatten](https://millsp.github.io/ts-toolbelt/modules/list_flatten.html)||||||||| ||[Invert](https://millsp.github.io/ts-toolbelt/modules/object_invert.html)|[Group](https://millsp.github.io/ts-toolbelt/modules/list_group.html)||||||||| ||[ListOf](https://millsp.github.io/ts-toolbelt/modules/object_listof.html)|[Has](https://millsp.github.io/ts-toolbelt/modules/list_has.html)||||||||| ||[Merge](https://millsp.github.io/ts-toolbelt/modules/object_merge.html)|[HasPath](https://millsp.github.io/ts-toolbelt/modules/list_haspath.html)||||||||| ||[MergeAll](https://millsp.github.io/ts-toolbelt/modules/object_mergeall.html)|[Head](https://millsp.github.io/ts-toolbelt/modules/list_head.html)||||||||| ||[Modify](https://millsp.github.io/ts-toolbelt/modules/object_modify.html)|[Includes](https://millsp.github.io/ts-toolbelt/modules/list_includes.html)||||||||| ||[NonNullable](https://millsp.github.io/ts-toolbelt/modules/object_nonnullable.html)|[Intersect](https://millsp.github.io/ts-toolbelt/modules/list_intersect.html)||||||||| ||[NonNullableKeys](https://millsp.github.io/ts-toolbelt/modules/object_nonnullablekeys.html)|[IntersectKeys](https://millsp.github.io/ts-toolbelt/modules/list_intersectkeys.html)||||||||| ||[Nullable](https://millsp.github.io/ts-toolbelt/modules/object_nullable.html)|[KeySet](https://millsp.github.io/ts-toolbelt/modules/list_keyset.html)||||||||| ||[NullableKeys](https://millsp.github.io/ts-toolbelt/modules/object_nullablekeys.html)|[Last](https://millsp.github.io/ts-toolbelt/modules/list_last.html)||||||||| ||[Object](https://millsp.github.io/ts-toolbelt/modules/object_object.html)|[LastKey](https://millsp.github.io/ts-toolbelt/modules/list_lastkey.html)||||||||| ||[Omit](https://millsp.github.io/ts-toolbelt/modules/object_omit.html)|[Length](https://millsp.github.io/ts-toolbelt/modules/list_length.html)||||||||| ||[Optional](https://millsp.github.io/ts-toolbelt/modules/object_optional.html)|[List](https://millsp.github.io/ts-toolbelt/modules/list_list.html)||||||||| ||[OptionalKeys](https://millsp.github.io/ts-toolbelt/modules/object_optionalkeys.html)|[Longest](https://millsp.github.io/ts-toolbelt/modules/list_longest.html)||||||||| ||[Overwrite](https://millsp.github.io/ts-toolbelt/modules/object_overwrite.html)|[Merge](https://millsp.github.io/ts-toolbelt/modules/list_merge.html)||||||||| ||[Partial](https://millsp.github.io/ts-toolbelt/modules/object_partial.html)|[MergeAll](https://millsp.github.io/ts-toolbelt/modules/list_mergeall.html)||||||||| ||[Patch](https://millsp.github.io/ts-toolbelt/modules/object_patch.html)|[Modify](https://millsp.github.io/ts-toolbelt/modules/list_modify.html)||||||||| ||[PatchAll](https://millsp.github.io/ts-toolbelt/modules/object_patchall.html)|[NonNullable](https://millsp.github.io/ts-toolbelt/modules/list_nonnullable.html)||||||||| ||[Path](https://millsp.github.io/ts-toolbelt/modules/object_path.html)|[NonNullableKeys](https://millsp.github.io/ts-toolbelt/modules/list_nonnullablekeys.html)||||||||| ||[Paths](https://millsp.github.io/ts-toolbelt/modules/object_paths.html)|[Nullable](https://millsp.github.io/ts-toolbelt/modules/list_nullable.html)||||||||| ||[Pick](https://millsp.github.io/ts-toolbelt/modules/object_pick.html)|[NullableKeys](https://millsp.github.io/ts-toolbelt/modules/list_nullablekeys.html)||||||||| ||[Readonly](https://millsp.github.io/ts-toolbelt/modules/object_readonly.html)|[ObjectOf](https://millsp.github.io/ts-toolbelt/modules/list_objectof.html)||||||||| ||[ReadonlyKeys](https://millsp.github.io/ts-toolbelt/modules/object_readonlykeys.html)|[Omit](https://millsp.github.io/ts-toolbelt/modules/list_omit.html)||||||||| ||[Record](https://millsp.github.io/ts-toolbelt/modules/object_record.html)|[Optional](https://millsp.github.io/ts-toolbelt/modules/list_optional.html)||||||||| ||[Replace](https://millsp.github.io/ts-toolbelt/modules/object_replace.html)|[OptionalKeys](https://millsp.github.io/ts-toolbelt/modules/list_optionalkeys.html)||||||||| ||[Required](https://millsp.github.io/ts-toolbelt/modules/object_required.html)|[Overwrite](https://millsp.github.io/ts-toolbelt/modules/list_overwrite.html)||||||||| ||[RequiredKeys](https://millsp.github.io/ts-toolbelt/modules/object_requiredkeys.html)|[Partial](https://millsp.github.io/ts-toolbelt/modules/list_partial.html)||||||||| ||[Select](https://millsp.github.io/ts-toolbelt/modules/object_select.html)|[Patch](https://millsp.github.io/ts-toolbelt/modules/list_patch.html)||||||||| ||[SelectKeys](https://millsp.github.io/ts-toolbelt/modules/object_selectkeys.html)|[PatchAll](https://millsp.github.io/ts-toolbelt/modules/list_patchall.html)||||||||| ||[Undefinable](https://millsp.github.io/ts-toolbelt/modules/object_undefinable.html)|[Path](https://millsp.github.io/ts-toolbelt/modules/list_path.html)||||||||| ||[UndefinableKeys](https://millsp.github.io/ts-toolbelt/modules/object_undefinablekeys.html)|[Paths](https://millsp.github.io/ts-toolbelt/modules/list_paths.html)||||||||| ||[Unionize](https://millsp.github.io/ts-toolbelt/modules/object_unionize.html)|[Pick](https://millsp.github.io/ts-toolbelt/modules/list_pick.html)||||||||| ||[UnionOf](https://millsp.github.io/ts-toolbelt/modules/object_unionof.html)|[Pop](https://millsp.github.io/ts-toolbelt/modules/list_pop.html)||||||||| ||[Update](https://millsp.github.io/ts-toolbelt/modules/object_update.html)|[Prepend](https://millsp.github.io/ts-toolbelt/modules/list_prepend.html)||||||||| ||[Writable](https://millsp.github.io/ts-toolbelt/modules/object_writable.html)|[Readonly](https://millsp.github.io/ts-toolbelt/modules/list_readonly.html)||||||||| ||[WritableKeys](https://millsp.github.io/ts-toolbelt/modules/object_writablekeys.html)|[ReadonlyKeys](https://millsp.github.io/ts-toolbelt/modules/list_readonlykeys.html)||||||||| |||[Remove](https://millsp.github.io/ts-toolbelt/modules/list_remove.html)||||||||| |||[Repeat](https://millsp.github.io/ts-toolbelt/modules/list_repeat.html)||||||||| |||[Replace](https://millsp.github.io/ts-toolbelt/modules/list_replace.html)||||||||| |||[Required](https://millsp.github.io/ts-toolbelt/modules/list_required.html)||||||||| |||[RequiredKeys](https://millsp.github.io/ts-toolbelt/modules/list_requiredkeys.html)||||||||| |||[Reverse](https://millsp.github.io/ts-toolbelt/modules/list_reverse.html)||||||||| |||[Select](https://millsp.github.io/ts-toolbelt/modules/list_select.html)||||||||| |||[SelectKeys](https://millsp.github.io/ts-toolbelt/modules/list_selectkeys.html)||||||||| |||[Shortest](https://millsp.github.io/ts-toolbelt/modules/list_shortest.html)||||||||| |||[Tail](https://millsp.github.io/ts-toolbelt/modules/list_tail.html)||||||||| |||[Take](https://millsp.github.io/ts-toolbelt/modules/list_take.html)||||||||| |||[Undefinable](https://millsp.github.io/ts-toolbelt/modules/list_undefinable.html)||||||||| |||[UndefinableKeys](https://millsp.github.io/ts-toolbelt/modules/list_undefinablekeys.html)||||||||| |||[Unionize](https://millsp.github.io/ts-toolbelt/modules/list_unionize.html)||||||||| |||[UnionOf](https://millsp.github.io/ts-toolbelt/modules/list_unionof.html)||||||||| |||[UnNest](https://millsp.github.io/ts-toolbelt/modules/list_unnest.html)||||||||| |||[Update](https://millsp.github.io/ts-toolbelt/modules/list_update.html)||||||||| |||[Writable](https://millsp.github.io/ts-toolbelt/modules/list_writable.html)||||||||| |||[WritableKeys](https://millsp.github.io/ts-toolbelt/modules/list_writablekeys.html)||||||||| |||[Zip](https://millsp.github.io/ts-toolbelt/modules/list_zip.html)||||||||| |||[ZipObj](https://millsp.github.io/ts-toolbelt/modules/list_zipobj.html)||||||||| ### [Archives ⤢](https://github.com/millsp/ts-toolbelt/tree/gh-pages) > **`EXAMPLE`** https://millsp.github.io/ts-toolbelt/4.2.1/ ## [Good to Know ⤢](https://github.com/millsp/ts-toolbelt/discussions/categories/q-a) In this wiki, you will find some extra resources for your learning, and understanding. **Are you missing something?** Participate to the open-wiki by [posting your questions](https://github.com/millsp/ts-toolbelt/discussions/new). ## Running tests ### For this project To run the `lint` & `type` tests, simply run: ```sh npm test ``` ### For your project Want to test your own types? Let's get started: ```ts import {Number, Test} from "ts-toolbelt" const {checks, check} = Test checks([ check =
P extends Promise = {
new (...args: P): R
}
================================================
FILE: sources/Class/Instance.ts
================================================
import {Class} from './Class'
/**
* Get the instance type of a `class` from a class object
* @param C * *typeof** class
* @returns [[Object]]
* @example
* ```ts
* import {C} from 'ts-toolbelt'
*
* /// `create` takes an instance constructor and creates an instance of it
* declare function create