{"_id":"ts-deep-pick","_rev":"11-faecf3fd8ec9a56e3191eaf3abf951f3","name":"ts-deep-pick","dist-tags":{"latest":"0.2.2","beta":"0.2.1-beta.2"},"versions":{"0.1.0":{"name":"ts-deep-pick","version":"0.1.0","license":"MIT","description":"TypeScript utility generating new types by deep picking/omitting, leveraging Template Literal Types from TypeScript >= 4.1","repository":{"url":"git+https://gitlab.com/soul-codes/ts-deep-pick.git"},"keywords":["typescript","deep","pick","omit","lodash","typesafe","template literal type","ts"],"scripts":{"clean":"rm -rf lib","prepare":"npm run clean && tsc","watch":"tsc --watch --noEmit","test":"npm run test:typing","test:typing":"tsc -p src/typing-test --noEmit","release":"npm run prepare && release-it","tidy":"./bin/tidy.sh"},"main":"lib","types":"lib","devDependencies":{"@release-it/conventional-changelog":"^2.0.0","@types/node":"^14.14.9","cz-conventional-changelog":"^3.3.0","import-sort-style-module":"^6.0.0","prettier":"^2.2.1","prettier-plugin-import-sort":"^0.0.6","release-it":"^14.2.1","ts-typetools":"^0.5.1","tslint":"^6.1.3","tslint-etc":"^1.13.7","typescript":"^4.1.2"},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"release-it":{"plugins":{"@release-it/conventional-changelog":{"preset":"angular","infile":"CHANGELOG.md"}}},"publishConfig":{"access":"public"},"importSort":{".js, .jsx, .ts, .tsx":{"style":"module","parser":"typescript"}},"gitHead":"d72630609417f8ba61baf8fba57456b07a3f0241","bugs":{"url":"https://gitlab.com/soul-codes/ts-deep-pick/issues"},"homepage":"https://gitlab.com/soul-codes/ts-deep-pick#readme","_id":"ts-deep-pick@0.1.0","_nodeVersion":"13.12.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-V+g4FAJNcQ/lxNAnQzu3sD/0SC4M35FbPIbmYk3ESG0/MXx6HukTZjgeZjtOsUXjINUxQf0y5l7Mfq4XxG3MtA==","shasum":"7affcac824371702026f468beb9d79c898b1beb5","tarball":"https://registry.npmjs.org/ts-deep-pick/-/ts-deep-pick-0.1.0.tgz","fileCount":32,"unpackedSize":69187,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfylH5CRA9TVsSAnZWagAAR5sP/jZWkkZPN/XdDqsxLBMh\nCu1RkzuTvzQDy3hckz0tJNI7ya7nEs2+Ch2EbVbbyRRYMY+Ig/dPxbfE4gD/\nNe8sTeWMnJ0mMtVI/tB049JgM+bYyJsmlmcur462X4/ek7YGySpc9i3KKG0f\nNZ2i0LSb27DBlMJggzUMDfqOY+ilskcr8Vc7xCMBpaTQrtkEck5WdbmM5FFV\ncYr9RC84g8LxvGaTHeOHjNJNYbwjfk1/97f9i0EVGJXDbtPSZ5V3ovfZlwt3\nXtPe9njUMf8HTWZR1JIM6kJe7TAMKH05Wr0MsCLtWd8t2g7T6RUxMfhqkhvI\n5x1tIK/cygMYYIwaICyUqcNDwTBi0rS5vc9X/6W6wHMJ0JM3Wlo4KMqfMSkR\nws0IQcUXKbwmutc53GPmKWjIRZXxfM1EEbuHhA8ko6bFd5kJRBZU7eWKzCcC\nb7FMfOFwQfv/irj2JMbF/W2gXPVGSTfcP8sjIQu42BF5ipZo/wnCk1Hp1QIj\nagI6lHFN2IjkwGfzdTIr/DF98P2S25SlMLf7aXVd4BaJw4ozo8VSUUNqmDMr\nCZl4caaUeEPO3aUoN2HY+lCe4FFTvmIekSbSbgYL7OmJwQj5Q31mUH3D/hi5\nNq8PW1ZTY7ybzNqz6z6vTpxDJMrXRHqcRBuB0DXM7MzcTM9JGF8ybhkRr5mX\n9ebV\r\n=IssT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDzAYUGaiLC2kiltW2MpPDWacD0Cptnsl5sbD1elKgY4QIhAIW1s1QKO5BvYKKvNbsRVXTcAm1IbjAlxYizxtvsNsLg"}]},"_npmUser":{"name":"soul-codes","email":"reach.soul.codes@gmail.com"},"directories":{},"maintainers":[{"name":"soul-codes","email":"reach.soul.codes@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-deep-pick_0.1.0_1607094777001_0.11935540091267072"},"_hasShrinkwrap":false},"0.1.1":{"name":"ts-deep-pick","version":"0.1.1","license":"MIT","description":"TypeScript utility generating new types by deep picking/omitting, leveraging Template Literal Types from TypeScript >= 4.1","repository":{"url":"git+https://gitlab.com/soul-codes/ts-deep-pick.git"},"keywords":["typescript","deep","pick","omit","lodash","typesafe","template literal type","ts"],"scripts":{"clean":"rm -rf lib","prepare":"npm run clean && tsc","watch":"tsc --watch --noEmit","test":"npm run test:typing","test:typing":"tsc -p src/typing-test --noEmit","release":"npm run prepare && release-it","tidy":"./bin/tidy.sh"},"main":"lib","types":"lib","devDependencies":{"@release-it/conventional-changelog":"^2.0.0","@types/node":"^14.14.9","cz-conventional-changelog":"^3.3.0","import-sort-style-module":"^6.0.0","prettier":"^2.2.1","prettier-plugin-import-sort":"^0.0.6","release-it":"^14.2.1","ts-typetools":"^0.5.1","tslint":"^6.1.3","tslint-etc":"^1.13.7","typescript":"^4.1.2"},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"release-it":{"plugins":{"@release-it/conventional-changelog":{"preset":"angular","infile":"CHANGELOG.md"}}},"publishConfig":{"access":"public"},"importSort":{".js, .jsx, .ts, .tsx":{"style":"module","parser":"typescript"}},"gitHead":"2969ab77745119f5a58952f2a63cc16bf47d936a","bugs":{"url":"https://gitlab.com/soul-codes/ts-deep-pick/issues"},"homepage":"https://gitlab.com/soul-codes/ts-deep-pick#readme","_id":"ts-deep-pick@0.1.1","_nodeVersion":"13.12.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-HT/OOARut+oP/+TGrXcrBb0j05XwXuJKO3dXrN0EsfB1Diop8AJQ+0JPZcGcEyBcUKEyNl8WbZXioX83SQ4oZw==","shasum":"a384a6ff848131f50e30c6aee41b27a0bfb90932","tarball":"https://registry.npmjs.org/ts-deep-pick/-/ts-deep-pick-0.1.1.tgz","fileCount":32,"unpackedSize":69549,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfylKXCRA9TVsSAnZWagAAIMwP/2TUuTJ4YtNvJElakjky\nvlLQvrZ2D6VrM9aEz5HM+7+xtehmcRklBgF2CCXs4cwS7h73fwb/M7IEMaHt\n6fuJo3hj5Df9L8ESWP+O/jOnx1qAXR66oNN6hf8FRjyRXS/JpYV7X0qBp4jy\n6wA1uhRI1nFCc8COSuUnyNI3YO9GTrRd8gxTRa/fHR+Ymq9Qqp1bCNep9VEV\nr9W+68FpU1Yl5d1oA1XMriBzH6vPLNjgJeZC/3qh8beQSGZJ7glQDM1sAHEE\nQP19c6mYpGMgJF7eBPz/HpDOQDRdGE4Pppf+X4/8zPv4RPYaNro0XqFxia08\nHT1WDc8AS8d8JsbnSt5Uusp+qcyYf8+QFGlrubVp4vzGwTIFh3yIhqCC54/r\nK9siTYtz7Pvhwf+07Y+Wt8W+NiyTmNxGy0gO/En/I9Fk+ORI09P+CKm7kgdQ\nC5iman0aul4cXfeaNl1nr9keFog/YSCnFtfE9GEl++phDbq9U0w6oKa2dglF\nw9arf74uO2+fVyOMo1X2eOWxk8JCZPLBQZx5A6wxoE2G8kbZtxFNxqk54c0c\nBJICISI5kgmYMb5avzaJXgU9u2IrV5SEmQGBXsHjJtwOVD75P+ASppSaAquN\nHAzw8NCre0W7ReILwKrwtQ1kPMkja2PHuMDM5oJA28eEiNRiOrA5HDl0KHUM\nnO6z\r\n=12YH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDmxJlWMQX6xT9si3oRkIlWvM5Q8eeJua04M+5r4IUC0wIhAMi83jQ+s+BALlhJ/lI5zSbQ8QI1cC4UlvlL7f3w4B2X"}]},"_npmUser":{"name":"soul-codes","email":"reach.soul.codes@gmail.com"},"directories":{},"maintainers":[{"name":"soul-codes","email":"reach.soul.codes@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-deep-pick_0.1.1_1607094935523_0.12557832752041298"},"_hasShrinkwrap":false},"0.1.2":{"name":"ts-deep-pick","version":"0.1.2","license":"MIT","description":"TypeScript utility generating new types by deep picking/omitting, leveraging Template Literal Types from TypeScript >= 4.1","repository":{"url":"git+https://gitlab.com/soul-codes/ts-deep-pick.git"},"keywords":["typescript","deep","pick","omit","lodash","typesafe","template literal type","ts"],"scripts":{"clean":"rm -rf lib","prepare":"npm run clean && tsc","watch":"tsc --watch --noEmit","test":"npm run test:typing","test:typing":"tsc -p src/typing-test --noEmit","release":"npm run prepare && release-it","tidy":"./bin/tidy.sh"},"main":"lib","types":"lib","devDependencies":{"@release-it/conventional-changelog":"^2.0.0","@types/node":"^14.14.9","cz-conventional-changelog":"^3.3.0","import-sort-style-module":"^6.0.0","prettier":"^2.2.1","prettier-plugin-import-sort":"^0.0.6","release-it":"^14.2.1","ts-typetools":"^0.5.1","tslint":"^6.1.3","tslint-etc":"^1.13.7","typescript":"^4.1.2"},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"release-it":{"plugins":{"@release-it/conventional-changelog":{"preset":"angular","infile":"CHANGELOG.md"}}},"publishConfig":{"access":"public"},"importSort":{".js, .jsx, .ts, .tsx":{"style":"module","parser":"typescript"}},"gitHead":"e042277c854a22c72a74668d0024e0ce2f21fdae","bugs":{"url":"https://gitlab.com/soul-codes/ts-deep-pick/issues"},"homepage":"https://gitlab.com/soul-codes/ts-deep-pick#readme","_id":"ts-deep-pick@0.1.2","_nodeVersion":"13.12.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-Re0uL2ROmOzSI5cTGnEqGiPcvzXkCPRuXWaUtKSr3QhC3sE5/5beQminvVcmgPwxHKNQKxfFXo6DyZVE+ojmsA==","shasum":"cee2e0574ab8964b3600410ef632883956cda048","tarball":"https://registry.npmjs.org/ts-deep-pick/-/ts-deep-pick-0.1.2.tgz","fileCount":18,"unpackedSize":13318,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfylcGCRA9TVsSAnZWagAA5BEP/jUv9gDqLd2a4H03d45o\n0ZR+bY31k1SHBlleT4I+A73PTNsuidb7iY/CjPf+T8GnIVncwd+iWPvm7QBX\nhPofHzqmVb22R4Hoo3p372SrsSbG0sXEZB7NX8Z86XTcGoocNIBCem3WY74d\n8XJk1w2uxaRcv6VcuAFN950ltCb6SoBkETcts6tLrfp20ImXkH/BF6XE8cZr\n/U8iX0/PnN2DVDuhn+mmZaBu7W7qieR7spaE1idsC7AlnuwUd214g6IFRZUK\n1ed0E4uls7jrEXZRJ/qtW/kdqvLq4p2mHIq7W4aKjbp1FYATaQZw5Z8GJlAB\naaGMUZuzX8QsUTvU1EJGguqWPHkXT6Ql9aer5oX3jWLudP0YbCZU1cT0QBji\nG3fPObLhddBc9cTfk0N4ULdl9omu9Hfjy4j0c51PJT9u7+by+9V2tp4Z9PTP\ndjJly6GdSF3gLZV9DsE2bFKs7cTswVjjWeyfFAxVhGUnDWUMLcZ312s35nX1\nWW6L54CmtAVnOFLyZOyaIVUsCFsx4KkT0imaHewmvU0xkRtSN9E80USEbGqS\ngl670ucDbToPcDEAfqu/IQcDvvYRUv+tV3rdOFpMrChTCvl8pg2r9VElv1pD\n2m4149ZPC48HuxelE8oUCl7fD7CaToXRajKVtbgI/teuazVQAYaeRLRWyAhp\nHrx4\r\n=PtBK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCZHTr0ujoc0eb3MhrEvC5HwmMp4RLtx8jMyN+qTqTAAAIgR/YhTiC5tIGUxH+nrCLGeQcB6gCqymQigcuK1SLAgpc="}]},"_npmUser":{"name":"soul-codes","email":"reach.soul.codes@gmail.com"},"directories":{},"maintainers":[{"name":"soul-codes","email":"reach.soul.codes@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-deep-pick_0.1.2_1607096069841_0.2481657226539873"},"_hasShrinkwrap":false},"0.2.0-beta.0":{"name":"ts-deep-pick","version":"0.2.0-beta.0","license":"MIT","description":"TypeScript utility generating new types by deep picking/omitting, leveraging Template Literal Types from TypeScript >= 4.1","repository":{"url":"git+https://gitlab.com/soul-codes/ts-deep-pick.git"},"keywords":["typescript","deep","pick","omit","lodash","typesafe","template literal type","ts"],"scripts":{"clean":"rimraf lib","prepare":"npm run clean && tsc","watch":"tsc --watch --noEmit","test":"npm run test:typing","test:typing":"tsc -p src/typing-test --noEmit","release":"npm run prepare && release-it","tidy":"./bin/tidy.sh"},"main":"lib","types":"lib","devDependencies":{"@release-it/conventional-changelog":"^2.0.0","@types/node":"^14.14.9","cz-conventional-changelog":"^3.3.0","import-sort-style-module":"^6.0.0","prettier":"^2.2.1","prettier-plugin-import-sort":"^0.0.6","release-it":"^14.2.1","rimraf":"^3.0.2","ts-typetools":"^0.5.1","tslint":"^6.1.3","tslint-etc":"^1.13.7","typescript":"^4.1.2"},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"release-it":{"plugins":{"@release-it/conventional-changelog":{"preset":"angular","infile":"CHANGELOG.md"}}},"publishConfig":{"access":"public"},"importSort":{".js, .jsx, .ts, .tsx":{"style":"module","parser":"typescript"}},"readme":"`ts-deep-pick` is a TypeScript type-only utility package that allows for\r\ntype-safe, deep picking/omitting of properties from nested object types.\r\nPowered by the\r\n[template literal type released in TypeScript 4.1](https://devblogs.microsoft.com/typescript/announcing-typescript-4-1-beta/#template-literal-types),\r\nthe type `DeepPick` will offer all combinations of nested pick/omit string\r\npatterns that will then return the deeply picked/omit type according to the\r\n[deep-picking grammar](#Grammar).\r\n\r\n![Screenshot](docs/screenshot.png)\r\n\r\n## Usage\r\n\r\n### `DeepPick`\r\n\r\n```ts\r\nimport { DeepPick } from \"ts-deep-pick\";\r\n\r\ninterface FooBar {\r\n  foo: ABC;\r\n  bar: ABC;\r\n}\r\n\r\ninterface ABC {\r\n  a: number;\r\n  b: number;\r\n  c: number;\r\n}\r\n\r\n// Result type: { foo: { a: number } };\r\n// including a property \"positively\" omits the exluded properties.\r\ntype FooWithJustA = DeepPick<FooBar, \"foo.a\">; // \".\" joins nested properties\r\n\r\n// Result type: { foo: { a: number, b: number } };\r\ntype FooWithJustAB = DeepPick<FooBar, \"foo.a\" | \"foo.b\">;properties\r\n\r\n// Result type: { foo: { a: number, b: number } };\r\ntype FooWithoutC = DeepPick<FooBar, \"foo.!c\">; // \"!\" omits a property\r\n\r\n// Result type: { bar: ABC };\r\ntype Bar = DeepPick<FooBar, \"!bar\">; // \"!\" omits a property\r\n\r\n// Result type:\r\n// {\r\n//    foo: { a: number, b: number },\r\n//    bar: ABC\r\n// };\r\n// \"~\" mutates the property's nested membership without explicitly picking\r\n// the property and thereby omitting the remaining.\r\ntype FooBarWithoutFooC = DeepPick<FooBar, \"~foo.!c\">;\r\n\r\n// Result type: Array<{ foo: ABC }>\r\ntype ArrayWithFoo = DeepPick<FooBar[], \"[].foo\"> // \"[]\" accesses an array item.\r\n\r\n// Result type: FooBar\r\ntype ArrayWithFoo = DeepPick<FooBar, \"*\"> // \"*\" is the \"identity\" operand\r\n```\r\n\r\n### `DeepPickPath`\r\n\r\nReturns the possible path that can be used to passed into `DeepPick` for a given\r\nstructure.\r\n\r\n```ts\r\nimport { DeepPickPath } from \"ts-deep-pick\";\r\n\r\n// assume FooBar as defined earlier.\r\n// \"foo\" | \"bar\" | \"!foo\" | \"!bar\" | \"~foo.a\" | \"~foo.!a\" | ...\r\ntype Path = DeepPickPath<FooBar>;\r\n```\r\n\r\n## Behavior\r\n\r\n- Union paths are treated like a combination of paths. For example, `\"a\"|\"b\"`\r\n  would mean \"pick properties `a` and `b`\".\r\n- At each level, the \"picked set\" is determined before omitting and mutating.\r\n  If the paths at the given level include at least one explicitly picked\r\n  key (`\"a\"`) then these keys and the mutations (`\"~a\"`) become the picked\r\n  set. In this case, omits are redundant because they are either no-op\r\n  (omitting keys that aren't picked) or they make the picks no-op (omitting\r\n  keys that are picked).\r\n- If the paths at the given level consist only of omits (`\"!a\"`) and\r\n  mutations (`\"~a\"`), then the omit operation takes place on the full set of\r\n  keys.\r\n\r\n### Examples\r\n\r\n- `\"a\" | \"b\"` will pick just properties `a` and `b`.\r\n- `\"a\" | \"!a\"` will pick nothing (`a` is picked but is then omitted.)\r\n- `\"~a.foo\"` will pick everything at the outermost level, and pick foo as the\r\n  only property of `a`.\r\n- `\"!a\" | \"~b.foo\"` will pick everything except for `a` at the outermost level,\r\n  and modifies `b` such that only `foo` is available there.\r\n\r\n## Grammar\r\n\r\nThe character tokens `.`, `!`, `~`, `[]` and `*` define the property\r\nseparator, omit prefix, mutation prefix, array index property and the\r\npass-through (return the original type) operand respectively. These tokens can\r\nbe replaced by defining the following interface and passing it as the extra\r\ntype parameter to `DeepPick` and `DeepPickPath`.\r\n\r\n```ts\r\ninterface DeepPickGrammar {\r\n  array: string;  // default: \"[]\"\r\n  prop: string;   // default: \".\"\r\n  omit: string;   // default: \"!\"\r\n  mutate: string; // default: \"~\"\r\n  glob: string;   // default: \"*\"\r\n}\r\n```\r\n\r\nExample:\r\n\r\n```ts\r\nimport { DefaultGrammar } from \"ts-deep-pick\";\r\n\r\ninterface G extends DeepPickGrammar {\r\n  props: \":\"; // Now use \":\" as property separator\r\n}\r\n\r\n// Result type: { foo: { a: number } };\r\ntype FooWithJustA = DeepPick<FooBar, \"foo:a\", G>;\r\n\r\n```\r\n\r\n### `AmbiguousProp<G = DefaultGrammar>`\r\n\r\nReturns the template literal type that represents any string that -- if used\r\nas a property name -- would be ambigous given the set of character tokens.\r\n\r\n```ts\r\n// Result type: \"a\"\r\n// (\"!a\" is ambiguous because of the \"!\" character).\r\n// (\"a.b\" is ambiguous because of the \".\" character)\r\ntype ValidProps = Exclude<\"a\" | \"!a\" | \"a.b\", AmbiguousProps>\r\n\r\n// Result type: \"a\" | \"a.b\"\r\n// (\"a:b\" would have been ambiguous now because of custom grammar G defined\r\n// earlier).\r\ntype ValidProps = Exclude<\"a\" | \"!a\" | \"a.b\", AmbiguousProps<G>>\r\n```\r\n","readmeFilename":"README.md","gitHead":"4ff875c573447f884a04a9d0801d141f91d18f5b","bugs":{"url":"https://gitlab.com/soul-codes/ts-deep-pick/issues"},"homepage":"https://gitlab.com/soul-codes/ts-deep-pick#readme","_id":"ts-deep-pick@0.2.0-beta.0","_nodeVersion":"13.12.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-s++7Ji/XhvnpwYoP8PdPN9834oR2FDJF7gee9cm0hYtKCYv/Rz6O6BOqRm3IfYg/S5Z9Wteq4k/v8PoTFu3Aog==","shasum":"376acc89a1239884730beb5a5785a691b67dbc94","tarball":"https://registry.npmjs.org/ts-deep-pick/-/ts-deep-pick-0.2.0-beta.0.tgz","fileCount":27,"unpackedSize":22785,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf1i9DCRA9TVsSAnZWagAAtdoQAImxju4XmChDiIL5su9z\nM9UQwcm1FZkjczrjVDHqRX/q3uwn+PU08BrhX01+d91qkzguMeny0sChdMWu\nYZyOnD1FryS4sBI9rpGMrkIfZ6MGn5s7KEYTICDIM0Uh5tSutZT+Zp+jghEH\nRS6fs23/3DeGVYSN19HXKvs8mksxVU9xTimvgea9MiQ/TAEh4Szf4Dg1Jydq\nMGSFfKMNQUTCHGeFAsNhIfQ5IXOJ0oV/cUv/lFON+vyoesmF6BdokSZL24ve\nZvb/vyNnbJCFYe5Loj1b+uVNO8zxag/DXRjFkPb8ytZLNjk2mbB3kTkSfDZq\n/NNE1bsON1YTbxmU44uXQbYZo95ktQopyLJucXDe+MNJ8AtE9eHdnj4GCF+m\n8rm47bTakjZieZzooU8HCWTCTGO7ScZxjxiFGdAct7F1GAP/J3mmgxHLaPhu\njAZUBWCbMMpImpKlRcvOn1l4QUr+QEaJTFBjy/Vl7UfRwc0pgoBdNqg+yLG0\nXZ9JLnLjUDDr1unZRPDaI5ied5oelt/ZEWg2796pWv0Xg01W3nH/2IpeNk3v\nvP1SaJi06UbYZ1IQb9Dlr7wXQ4oHUEcRsdEIuVLO1EHGTmCDiGSrzWBoVRPH\ntmnkF10tEpbMkUEwTWMY+bl/XeW898h9Q4sSM4svnOsTWyowiku3BGRGK4rq\n1yFf\r\n=ilM8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDs6L/92gt62U88M+3h9NWSvKnyI61j3NvGJ8onZwiCDwIgX+qutV9LusqyhCAxxsE6XL9zoE9QobaOqEeyMnL6vnM="}]},"_npmUser":{"name":"soul-codes","email":"reach.soul.codes@gmail.com"},"directories":{},"maintainers":[{"name":"soul-codes","email":"reach.soul.codes@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-deep-pick_0.2.0-beta.0_1607872323109_0.7218258176451264"},"_hasShrinkwrap":false},"0.2.0-beta.1":{"name":"ts-deep-pick","version":"0.2.0-beta.1","license":"MIT","description":"TypeScript utility generating new types by deep picking/omitting, leveraging Template Literal Types from TypeScript >= 4.1","repository":{"url":"git+https://gitlab.com/soul-codes/ts-deep-pick.git"},"keywords":["typescript","deep","pick","omit","lodash","typesafe","template literal type","ts"],"scripts":{"clean":"rimraf lib","prepare":"npm run clean && tsc","watch":"tsc --watch --noEmit","test":"npm run test:typing","test:typing":"tsc -p src/typing-test --noEmit","release":"npm run prepare && release-it","tidy":"./bin/tidy.sh"},"main":"lib","types":"lib","devDependencies":{"@release-it/conventional-changelog":"^2.0.0","@types/node":"^14.14.9","cz-conventional-changelog":"^3.3.0","import-sort-style-module":"^6.0.0","prettier":"^2.2.1","prettier-plugin-import-sort":"^0.0.6","release-it":"^14.2.1","rimraf":"^3.0.2","ts-typetools":"^0.5.1","tslint":"^6.1.3","tslint-etc":"^1.13.7","typescript":"^4.1.2"},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"release-it":{"plugins":{"@release-it/conventional-changelog":{"preset":"angular","infile":"CHANGELOG.md"}}},"publishConfig":{"access":"public"},"importSort":{".js, .jsx, .ts, .tsx":{"style":"module","parser":"typescript"}},"readme":"`ts-deep-pick` is a TypeScript type-only utility package that allows for\r\ntype-safe, deep picking/omitting of properties from nested object types.\r\nPowered by the\r\n[template literal type released in TypeScript 4.1](https://devblogs.microsoft.com/typescript/announcing-typescript-4-1-beta/#template-literal-types),\r\nthe type `DeepPick` will offer all combinations of nested pick/omit string\r\npatterns that will then return the deeply picked/omit type according to the\r\n[deep-picking grammar](#Grammar).\r\n\r\n![Screenshot](docs/screenshot.png)\r\n\r\n## Usage\r\n\r\n### `DeepPick`\r\n\r\n```ts\r\nimport { DeepPick } from \"ts-deep-pick\";\r\n\r\ninterface FooBar {\r\n  foo: ABC;\r\n  bar: ABC;\r\n}\r\n\r\ninterface ABC {\r\n  a: number;\r\n  b: number;\r\n  c: number;\r\n}\r\n\r\n// Result type: { foo: { a: number } };\r\n// including a property \"positively\" omits the exluded properties.\r\ntype FooWithJustA = DeepPick<FooBar, \"foo.a\">; // \".\" joins nested properties\r\n\r\n// Result type: { foo: { a: number, b: number } };\r\ntype FooWithJustAB = DeepPick<FooBar, \"foo.a\" | \"foo.b\">;properties\r\n\r\n// Result type: { foo: { a: number, b: number } };\r\ntype FooWithoutC = DeepPick<FooBar, \"foo.!c\">; // \"!\" omits a property\r\n\r\n// Result type: { bar: ABC };\r\ntype Bar = DeepPick<FooBar, \"!bar\">; // \"!\" omits a property\r\n\r\n// Result type:\r\n// {\r\n//    foo: { a: number, b: number },\r\n//    bar: ABC\r\n// };\r\n// \"~\" mutates the property's nested membership without explicitly picking\r\n// the property and thereby omitting the remaining.\r\ntype FooBarWithoutFooC = DeepPick<FooBar, \"~foo.!c\">;\r\n\r\n// Result type: Array<{ foo: ABC }>\r\ntype ArrayWithFoo = DeepPick<FooBar[], \"[].foo\"> // \"[]\" accesses an array item.\r\n\r\n// Result type: FooBar\r\ntype ArrayWithFoo = DeepPick<FooBar, \"*\"> // \"*\" is the \"identity\" operand\r\n```\r\n\r\n### `DeepPickPath`\r\n\r\nReturns the possible path that can be used to passed into `DeepPick` for a given\r\nstructure.\r\n\r\n```ts\r\nimport { DeepPickPath } from \"ts-deep-pick\";\r\n\r\n// assume FooBar as defined earlier.\r\n// \"foo\" | \"bar\" | \"!foo\" | \"!bar\" | \"~foo.a\" | \"~foo.!a\" | ...\r\ntype Path = DeepPickPath<FooBar>;\r\n```\r\n\r\n## Behavior\r\n\r\n- Union paths are treated like a combination of paths. For example, `\"a\"|\"b\"`\r\n  would mean \"pick properties `a` and `b`\".\r\n- At each level, the \"picked set\" is determined before omitting and mutating.\r\n  If the paths at the given level include at least one explicitly picked\r\n  key (`\"a\"`) then these keys and the mutations (`\"~a\"`) become the picked\r\n  set. In this case, omits are redundant because they are either no-op\r\n  (omitting keys that aren't picked) or they make the picks no-op (omitting\r\n  keys that are picked).\r\n- If the paths at the given level consist only of omits (`\"!a\"`) and\r\n  mutations (`\"~a\"`), then the omit operation takes place on the full set of\r\n  keys.\r\n\r\n### Examples\r\n\r\n- `\"a\" | \"b\"` will pick just properties `a` and `b`.\r\n- `\"a\" | \"!a\"` will pick nothing (`a` is picked but is then omitted.)\r\n- `\"~a.foo\"` will pick everything at the outermost level, and pick foo as the\r\n  only property of `a`.\r\n- `\"!a\" | \"~b.foo\"` will pick everything except for `a` at the outermost level,\r\n  and modifies `b` such that only `foo` is available there.\r\n\r\n## Grammar\r\n\r\nThe character tokens `.`, `!`, `~`, `[]` and `*` define the property\r\nseparator, omit prefix, mutation prefix, array index property and the\r\npass-through (return the original type) operand respectively. These tokens can\r\nbe replaced by defining the following interface and passing it as the extra\r\ntype parameter to `DeepPick` and `DeepPickPath`.\r\n\r\n```ts\r\ninterface DeepPickGrammar {\r\n  array: string;  // default: \"[]\"\r\n  prop: string;   // default: \".\"\r\n  omit: string;   // default: \"!\"\r\n  mutate: string; // default: \"~\"\r\n  glob: string;   // default: \"*\"\r\n}\r\n```\r\n\r\nExample:\r\n\r\n```ts\r\nimport { DefaultGrammar } from \"ts-deep-pick\";\r\n\r\ninterface G extends DeepPickGrammar {\r\n  props: \":\"; // Now use \":\" as property separator\r\n}\r\n\r\n// Result type: { foo: { a: number } };\r\ntype FooWithJustA = DeepPick<FooBar, \"foo:a\", G>;\r\n\r\n```\r\n\r\n### `AmbiguousProp<G = DefaultGrammar>`\r\n\r\nReturns the template literal type that represents any string that -- if used\r\nas a property name -- would be ambigous given the set of character tokens.\r\n\r\n```ts\r\n// Result type: \"a\"\r\n// (\"!a\" is ambiguous because of the \"!\" character).\r\n// (\"a.b\" is ambiguous because of the \".\" character)\r\ntype ValidProps = Exclude<\"a\" | \"!a\" | \"a.b\", AmbiguousProps>\r\n\r\n// Result type: \"a\" | \"a.b\"\r\n// (\"a:b\" would have been ambiguous now because of custom grammar G defined\r\n// earlier).\r\ntype ValidProps = Exclude<\"a\" | \"!a\" | \"a.b\", AmbiguousProps<G>>\r\n```\r\n","readmeFilename":"README.md","gitHead":"3fc7868e324dd8dcbbdb6e7ad236739ea318b535","bugs":{"url":"https://gitlab.com/soul-codes/ts-deep-pick/issues"},"homepage":"https://gitlab.com/soul-codes/ts-deep-pick#readme","_id":"ts-deep-pick@0.2.0-beta.1","_nodeVersion":"13.12.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-JU1lNvBH1vsFf+kiKbBCCWEgFhUrSIswZrySSUUE8UuhMK8Z2C4bkppqhcvxYP+MNO80I6o3kFeo48Ws8IiaUA==","shasum":"6e5839beefb64a085efaefd3b4fca4233a4c033c","tarball":"https://registry.npmjs.org/ts-deep-pick/-/ts-deep-pick-0.2.0-beta.1.tgz","fileCount":27,"unpackedSize":23604,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf1z4gCRA9TVsSAnZWagAAvH8P/0MuuXw8F/9gG6pEwLS+\n8XRIfT/dbmnqvVKr/fDhf0OWPfAVs3dXU87u9I1IiiFAQvymbuPy5N4sIW1r\nWjWNtZutOIBIJvP/JDwBhYX25ZL9sPfCS6YyQXt7Dc7SDtHufIr16JKsYpcG\nRN0Hxs1bIU7KgXLeEN9QJO0ZWHU8JU00qBrzBB0M6YWuPqViOdu432VR9xLm\nrerTQWbIQiuMSSKV/BSQDGJYw3CR1MaL7dI9/ElAzFQ2s/5Z57DbfOoDM4v9\nyvnULIU8XXC1WZnYftw/XpUqhJtkqrXtzydZBsQrXdSmP1YM8au19YUO9P1k\n+8sJphXHuJG57SyqyYGT4oZi3v9l0GuK0JZE05EQvQVd1m28UgCOXVe9VLZh\n4TF4t5EwDkNA8RVg4Ug5z2qL+pRTWVgMu0C7mD2tWJO6gvDzjtsvHH0IHlJZ\n5DFFSEjo1U9xZOrntsRAuOgm6b0QEPgzsj5oSNjegpv+6Lef/T+DxU/EBOdS\n1R+cABDHEIhed5vDuNFMgokRHnygkkjqo8q4O0UFnfXQWzOHtaNDoU2S8Qv/\ngk0YQt9ErhqNL2zG6U9hUAgpG/7Z/QUNtlE+YofYwgySLIWQjeBuEmf9DfRC\npvDa6C2xnxxrvDETD0BkQeyKX1NRsPW8W9heaX4EVUEqh5mOPuz2+E/t9s/3\nvPHP\r\n=X6rw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDFzSKxdDnwHP/zTlCuTbjaRAn12eZ9u+YC/hDcbU71FAIhAPaAn5vQgn8XQvCGRgss69FJiGBpOCizA9F8g/oiLQv2"}]},"_npmUser":{"name":"soul-codes","email":"reach.soul.codes@gmail.com"},"directories":{},"maintainers":[{"name":"soul-codes","email":"reach.soul.codes@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-deep-pick_0.2.0-beta.1_1607941664365_0.5312966616546995"},"_hasShrinkwrap":false},"0.2.0":{"name":"ts-deep-pick","version":"0.2.0","license":"MIT","description":"TypeScript utility generating new types by deep picking/omitting, leveraging Template Literal Types from TypeScript >= 4.1","repository":{"url":"git+https://gitlab.com/soul-codes/ts-deep-pick.git"},"keywords":["typescript","deep","pick","omit","lodash","typesafe","template literal type","ts"],"scripts":{"clean":"rimraf lib","prepare":"npm run clean && tsc","watch":"tsc --watch --noEmit","test":"npm run test:typing","test:typing":"tsc -p src/typing-test --noEmit","release":"npm run prepare && release-it","tidy":"./bin/tidy.sh"},"main":"lib","types":"lib","devDependencies":{"@release-it/conventional-changelog":"^2.0.0","@types/node":"^14.14.9","cz-conventional-changelog":"^3.3.0","import-sort-style-module":"^6.0.0","prettier":"^2.2.1","prettier-plugin-import-sort":"^0.0.6","release-it":"^14.2.1","rimraf":"^3.0.2","ts-typetools":"^0.5.1","tslint":"^6.1.3","tslint-etc":"^1.13.7","typescript":"^4.1.2"},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"release-it":{"plugins":{"@release-it/conventional-changelog":{"preset":"angular","infile":"CHANGELOG.md"}}},"publishConfig":{"access":"public"},"importSort":{".js, .jsx, .ts, .tsx":{"style":"module","parser":"typescript"}},"gitHead":"7e2f28eea451ece90d1646160329700a41e4b4f3","bugs":{"url":"https://gitlab.com/soul-codes/ts-deep-pick/issues"},"homepage":"https://gitlab.com/soul-codes/ts-deep-pick#readme","_id":"ts-deep-pick@0.2.0","_nodeVersion":"13.12.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-c4MCVzDxAnbOoYJXiqcrTZYNq/fS+x5cw4r+qbD0D9ATXsAa9C+FXfZoj/99n0S8L+b8WbwE8aUU3uuYEzG/VQ==","shasum":"de71621ffc0e9c145c6cee6a19f228b8b9e428e3","tarball":"https://registry.npmjs.org/ts-deep-pick/-/ts-deep-pick-0.2.0.tgz","fileCount":27,"unpackedSize":23696,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2CQrCRA9TVsSAnZWagAA4EYP/ArZZHaAy2Yq8Crh/6Ix\naEooZR6/brDulQNgn/vMIm6cMCd5+VnReHk5k+ar2P5gKuTloi/UkHXUWb5x\nKW9QLdiTEEdbd4iMcNQyDh185saDiyPyzHZud/6xAJ4JzJWCrOEoknKzo2XA\ni23SFNR7Q5/yFGfUX6H6faBccM1GnP78wKIGlcsE9d3tCI2Tpg7f0Kos6cD9\nUEzh8QKSQCng87rZQete6z5ERywHHiI6jaW1tbszctKf6v4uT0jRAF6IHAvk\nzq3F7KMD5U07rcNcoCCXviebdlorzIXXXgAaXu0pOsyS42umjMn1/anXrOLP\njhM8QGW6cCs+7rnY8AnB388Kyv6axMmeMVidtU8r+1yeU6VsJeH7qQ/a+trb\nsObuB8eg5poyFSderjmn1udTotUU7dXKxO6S4ABmmB00bx7hfgnDut4RG+Wz\nvonfUiFv6KG1gP+Kch0rRvfrjak6irHm8E7EZN2IzgVODZEmvqO7+64cPh4J\nO8pDIvJ2EKauOGGPufY4jTxh9ClDjFalnOzwUKbRVjxJgavHL4Ldys9DlWDD\n6+7tR/rRTG3VIF8r+ajUyxHJxpVeIwl9eG59ITAtXTTTEXwBwb97ccGcgsNu\nc+u3rwLpklXc8+mmRJbb8atVbecMY9DxaFTz4RSJie+0Q0we00HUjzDNtcXH\nsGI1\r\n=BGo2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHfYUnEXvCCrQWDVnzLzuuYBjfziG+IQx/hHvbiyGR8EAiEAy5/UZoWt0d6w8d1Jo0nIwhF2BcXki5TZjzuwFxzVjlE="}]},"_npmUser":{"name":"soul-codes","email":"reach.soul.codes@gmail.com"},"directories":{},"maintainers":[{"name":"soul-codes","email":"reach.soul.codes@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-deep-pick_0.2.0_1608000554773_0.6961368665118501"},"_hasShrinkwrap":false},"0.2.1-beta.0":{"name":"ts-deep-pick","version":"0.2.1-beta.0","license":"MIT","description":"TypeScript utility generating new types by deep picking/omitting, leveraging Template Literal Types from TypeScript >= 4.1","repository":{"url":"git+https://gitlab.com/soul-codes/ts-deep-pick.git"},"keywords":["typescript","deep","pick","omit","lodash","typesafe","template literal type","ts"],"scripts":{"clean":"rimraf lib","prepare":"npm run clean && tsc","watch":"tsc --watch --noEmit","test":"npm run test:typing","test:typing":"tsc -p src/typing-test --noEmit","release":"npm run prepare && release-it","tidy":"./bin/tidy.sh"},"main":"lib","types":"lib","dependencies":{"ts-typetools":"^0.5.1"},"devDependencies":{"@release-it/conventional-changelog":"^2.0.0","@types/node":"^14.14.9","cz-conventional-changelog":"^3.3.0","import-sort-style-module":"^6.0.0","prettier":"^2.2.1","prettier-plugin-import-sort":"^0.0.6","release-it":"^14.2.1","rimraf":"^3.0.2","tslint":"^6.1.3","tslint-etc":"^1.13.7","typescript":"^4.1.2"},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"release-it":{"plugins":{"@release-it/conventional-changelog":{"preset":"angular","infile":"CHANGELOG.md"}}},"publishConfig":{"access":"public"},"importSort":{".js, .jsx, .ts, .tsx":{"style":"module","parser":"typescript"}},"readme":"`ts-deep-pick` is a TypeScript type-only utility package that allows for\ntype-safe, deep picking/omitting of properties from nested object types.\nPowered by the\n[template literal type released in TypeScript 4.1](https://devblogs.microsoft.com/typescript/announcing-typescript-4-1-beta/#template-literal-types),\nthe type `DeepPick` will offer all combinations of nested pick/omit string\npatterns that will then return the deeply picked/omit type according to the\n[deep-picking grammar](#Grammar).\n\n![Screenshot](docs/screenshot.png)\n\n## Usage\n\n### `DeepPick`\n\n```ts\nimport { DeepPick } from \"ts-deep-pick\";\n\ninterface FooBar {\n  foo: ABC;\n  bar: ABC;\n}\n\ninterface ABC {\n  a: number;\n  b: number;\n  c: number;\n}\n\n// Result type: { foo: { a: number } };\n// including a property \"positively\" omits the exluded properties.\ntype FooWithJustA = DeepPick<FooBar, \"foo.a\">; // \".\" joins nested properties\n\n// Result type: { foo: { a: number, b: number } };\ntype FooWithJustAB = DeepPick<FooBar, \"foo.a\" | \"foo.b\">;properties\n\n// Result type: { foo: { a: number, b: number } };\ntype FooWithoutC = DeepPick<FooBar, \"foo.!c\">; // \"!\" omits a property\n\n// Result type: { bar: ABC };\ntype Bar = DeepPick<FooBar, \"!bar\">; // \"!\" omits a property\n\n// Result type:\n// {\n//    foo: { a: number, b: number },\n//    bar: ABC\n// };\n// \"~\" mutates the property's nested membership without explicitly picking\n// the property and thereby omitting the remaining.\ntype FooBarWithoutFooC = DeepPick<FooBar, \"~foo.!c\">;\n\n// Result type: Array<{ foo: ABC }>\ntype ArrayWithFoo = DeepPick<FooBar[], \"[].foo\"> // \"[]\" accesses an array item.\n\n// Result type: FooBar\ntype ArrayWithFoo = DeepPick<FooBar, \"*\"> // \"*\" is the \"identity\" operand\n```\n\n### `DeepPickPath`\n\nReturns the possible path that can be used to passed into `DeepPick` for a given\nstructure.\n\n```ts\nimport { DeepPickPath } from \"ts-deep-pick\";\n\n// assume FooBar as defined earlier.\n// \"foo\" | \"bar\" | \"!foo\" | \"!bar\" | \"~foo.a\" | \"~foo.!a\" | ...\ntype Path = DeepPickPath<FooBar>;\n```\n\n## Behavior\n\n- Union paths are treated like a combination of paths. For example, `\"a\"|\"b\"`\n  would mean \"pick properties `a` and `b`\".\n- At each level, the \"picked set\" is determined before omitting and mutating.\n  If the paths at the given level include at least one explicitly picked\n  key (`\"a\"`) then these keys and the mutations (`\"~a\"`) become the picked\n  set. In this case, omits are redundant because they are either no-op\n  (omitting keys that aren't picked) or they make the picks no-op (omitting\n  keys that are picked).\n- If the paths at the given level consist only of omits (`\"!a\"`) and\n  mutations (`\"~a\"`), then the omit operation takes place on the full set of\n  keys.\n\n### Examples\n\n- `\"a\" | \"b\"` will pick just properties `a` and `b`.\n- `\"a\" | \"!a\"` will pick nothing (`a` is picked but is then omitted.)\n- `\"~a.foo\"` will pick everything at the outermost level, and pick foo as the\n  only property of `a`.\n- `\"!a\" | \"~b.foo\"` will pick everything except for `a` at the outermost level,\n  and modifies `b` such that only `foo` is available there.\n\n## Grammar\n\nThe character tokens `.`, `!`, `~`, `[]` and `*` define the property\nseparator, omit prefix, mutation prefix, array index property and the\npass-through (return the original type) operand respectively. These tokens can\nbe replaced by defining the following interface and passing it as the extra\ntype parameter to `DeepPick` and `DeepPickPath`.\n\n```ts\ninterface DeepPickGrammar {\n  array: string;  // default: \"[]\"\n  prop: string;   // default: \".\"\n  omit: string;   // default: \"!\"\n  mutate: string; // default: \"~\"\n  glob: string;   // default: \"*\"\n}\n```\n\nExample:\n\n```ts\nimport { DefaultGrammar } from \"ts-deep-pick\";\n\ninterface G extends DeepPickGrammar {\n  props: \":\"; // Now use \":\" as property separator\n}\n\n// Result type: { foo: { a: number } };\ntype FooWithJustA = DeepPick<FooBar, \"foo:a\", G>;\n\n```\n\n### `AmbiguousProp<G = DefaultGrammar>`\n\nReturns the template literal type that represents any string that -- if used\nas a property name -- would be ambigous given the set of character tokens.\n\n```ts\n// Result type: \"a\"\n// (\"!a\" is ambiguous because of the \"!\" character).\n// (\"a.b\" is ambiguous because of the \".\" character)\ntype ValidProps = Exclude<\"a\" | \"!a\" | \"a.b\", AmbiguousProps>\n\n// Result type: \"a\" | \"a.b\"\n// (\"a:b\" would have been ambiguous now because of custom grammar G defined\n// earlier).\ntype ValidProps = Exclude<\"a\" | \"!a\" | \"a.b\", AmbiguousProps<G>>\n```\n","readmeFilename":"README.md","gitHead":"0a868f98d518d913b9bcfaa739e1cac048bf21f8","bugs":{"url":"https://gitlab.com/soul-codes/ts-deep-pick/issues"},"homepage":"https://gitlab.com/soul-codes/ts-deep-pick#readme","_id":"ts-deep-pick@0.2.1-beta.0","_nodeVersion":"14.15.4","_npmVersion":"6.14.10","dist":{"integrity":"sha512-SzAbfoFzD2HRbmGsuqZIlQmA9211sx2NSo8V8Jf8PYGNv5t2mQMPMIuaXuQvWBx62jP6XhDJ/0xTrdbant6poA==","shasum":"731cb4658bba163f5d323a422c6a6c0732588870","tarball":"https://registry.npmjs.org/ts-deep-pick/-/ts-deep-pick-0.2.1-beta.0.tgz","fileCount":27,"unpackedSize":23657,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgueiLCRA9TVsSAnZWagAA+JIP/2Un1jlUCzuyY/pO8s4N\n49rpwA4cnNnnPkXtT0y9SRWvA1+Q9pCrZ1ijpTsDOIZt2Ie4g7n/IOs4QfkR\niILTlNalNyST4FR9MxrXNHVKiBA7agM3E0gpStZ9Fi0y2umhNfIQDO3nkykK\njyoMzjtvUMbIq7PV4VnG5smIgWv1pla5hoXSjUqyK4wd/+Z8q8JDuSC8HLel\nPcM2blS7a9yjSd6UV6bnFiiE17dcbYAQRMpM8tnI3nUqjrj4YDbWciufyQFA\nqxs/xKcKiR/hSBzE2ON70LRDMKSk+6SR2AufvtQ9HF3ajcUT4Ko+UItKeT4z\nNEfKO40PeB5NbdxZClzUxWHgJJeRm8n3RrccfJYtpFcFMiXEImML8AHoflbw\nop1RK+uBcHQC2//zKeMXiz1Nin0iJ21gRtP6Tz2BeGeJsq1IZVc6SLjsLVOC\nkdZ9qmBd+xhe7LdDHdQ+GEm9hfZYIFo9pED0plOkJsHhoIbS+4WB+8q0c1HJ\ne3DfD6ePK9pXd/G49T2Yk0box7/CYez0mxIJ75zfCweb9LoQppJV4Tp1jI25\n8q0TKZiXS2X+IoWK45Coo7VyYcxYNPZvtVjfUJGVDT3TxeR7kh8SDXiXDbk2\njokdCsODF13cLqDTvYG04wqXDzG6fjzVruzAawVBUO/Dx/QPKb1jwJ15lO+T\naFOj\r\n=U0PT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCZvDDCMkrdeDL3/dpM6KpvKt9sX09L3x2FIcZlDcGLDgIhALYNNCZq1peL7YbPpL+XcnS/BGYFqdO7FDAZqorABIeZ"}]},"_npmUser":{"name":"soul-codes","email":"reach.soul.codes@gmail.com"},"directories":{},"maintainers":[{"name":"soul-codes","email":"reach.soul.codes@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-deep-pick_0.2.1-beta.0_1622796427765_0.8516370212716993"},"_hasShrinkwrap":false},"0.2.1-beta.1":{"name":"ts-deep-pick","version":"0.2.1-beta.1","license":"MIT","description":"TypeScript utility generating new types by deep picking/omitting, leveraging Template Literal Types from TypeScript >= 4.1","repository":{"url":"git+https://gitlab.com/soul-codes/ts-deep-pick.git"},"keywords":["typescript","deep","pick","omit","lodash","typesafe","template literal type","ts"],"scripts":{"clean":"rimraf lib","prepare":"npm run clean && tsc","watch":"tsc --watch --noEmit","test":"npm run test:typing","test:typing":"tsc -p src/typing-test --noEmit","release":"npm run prepare && release-it","tidy":"./bin/tidy.sh"},"main":"lib","types":"lib","dependencies":{"ts-typetools":"^0.5.1"},"devDependencies":{"@release-it/conventional-changelog":"^2.0.0","@types/node":"^14.14.9","cz-conventional-changelog":"^3.3.0","import-sort-style-module":"^6.0.0","prettier":"^2.2.1","prettier-plugin-import-sort":"^0.0.6","release-it":"^14.2.1","rimraf":"^3.0.2","tslint":"^6.1.3","tslint-etc":"^1.13.7","typescript":"^4.1.2"},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"release-it":{"plugins":{"@release-it/conventional-changelog":{"preset":"angular","infile":"CHANGELOG.md"}}},"publishConfig":{"access":"public"},"importSort":{".js, .jsx, .ts, .tsx":{"style":"module","parser":"typescript"}},"readme":"`ts-deep-pick` is a TypeScript type-only utility package that allows for\ntype-safe, deep picking/omitting of properties from nested object types.\nPowered by the\n[template literal type released in TypeScript 4.1](https://devblogs.microsoft.com/typescript/announcing-typescript-4-1-beta/#template-literal-types),\nthe type `DeepPick` will offer all combinations of nested pick/omit string\npatterns that will then return the deeply picked/omit type according to the\n[deep-picking grammar](#Grammar).\n\n![Screenshot](docs/screenshot.png)\n\n## Usage\n\n### `DeepPick`\n\n```ts\nimport { DeepPick } from \"ts-deep-pick\";\n\ninterface FooBar {\n  foo: ABC;\n  bar: ABC;\n}\n\ninterface ABC {\n  a: number;\n  b: number;\n  c: number;\n}\n\n// Result type: { foo: { a: number } };\n// including a property \"positively\" omits the exluded properties.\ntype FooWithJustA = DeepPick<FooBar, \"foo.a\">; // \".\" joins nested properties\n\n// Result type: { foo: { a: number, b: number } };\ntype FooWithJustAB = DeepPick<FooBar, \"foo.a\" | \"foo.b\">;properties\n\n// Result type: { foo: { a: number, b: number } };\ntype FooWithoutC = DeepPick<FooBar, \"foo.!c\">; // \"!\" omits a property\n\n// Result type: { bar: ABC };\ntype Bar = DeepPick<FooBar, \"!bar\">; // \"!\" omits a property\n\n// Result type:\n// {\n//    foo: { a: number, b: number },\n//    bar: ABC\n// };\n// \"~\" mutates the property's nested membership without explicitly picking\n// the property and thereby omitting the remaining.\ntype FooBarWithoutFooC = DeepPick<FooBar, \"~foo.!c\">;\n\n// Result type: Array<{ foo: ABC }>\ntype ArrayWithFoo = DeepPick<FooBar[], \"[].foo\"> // \"[]\" accesses an array item.\n\n// Result type: FooBar\ntype ArrayWithFoo = DeepPick<FooBar, \"*\"> // \"*\" is the \"identity\" operand\n```\n\n### `DeepPickPath`\n\nReturns the possible path that can be used to passed into `DeepPick` for a given\nstructure.\n\n```ts\nimport { DeepPickPath } from \"ts-deep-pick\";\n\n// assume FooBar as defined earlier.\n// \"foo\" | \"bar\" | \"!foo\" | \"!bar\" | \"~foo.a\" | \"~foo.!a\" | ...\ntype Path = DeepPickPath<FooBar>;\n```\n\n## Behavior\n\n- Union paths are treated like a combination of paths. For example, `\"a\"|\"b\"`\n  would mean \"pick properties `a` and `b`\".\n- At each level, the \"picked set\" is determined before omitting and mutating.\n  If the paths at the given level include at least one explicitly picked\n  key (`\"a\"`) then these keys and the mutations (`\"~a\"`) become the picked\n  set. In this case, omits are redundant because they are either no-op\n  (omitting keys that aren't picked) or they make the picks no-op (omitting\n  keys that are picked).\n- If the paths at the given level consist only of omits (`\"!a\"`) and\n  mutations (`\"~a\"`), then the omit operation takes place on the full set of\n  keys.\n\n### Examples\n\n- `\"a\" | \"b\"` will pick just properties `a` and `b`.\n- `\"a\" | \"!a\"` will pick nothing (`a` is picked but is then omitted.)\n- `\"~a.foo\"` will pick everything at the outermost level, and pick foo as the\n  only property of `a`.\n- `\"!a\" | \"~b.foo\"` will pick everything except for `a` at the outermost level,\n  and modifies `b` such that only `foo` is available there.\n\n## Grammar\n\nThe character tokens `.`, `!`, `~`, `[]` and `*` define the property\nseparator, omit prefix, mutation prefix, array index property and the\npass-through (return the original type) operand respectively. These tokens can\nbe replaced by defining the following interface and passing it as the extra\ntype parameter to `DeepPick` and `DeepPickPath`.\n\n```ts\ninterface DeepPickGrammar {\n  array: string;  // default: \"[]\"\n  prop: string;   // default: \".\"\n  omit: string;   // default: \"!\"\n  mutate: string; // default: \"~\"\n  glob: string;   // default: \"*\"\n}\n```\n\nExample:\n\n```ts\nimport { DefaultGrammar } from \"ts-deep-pick\";\n\ninterface G extends DeepPickGrammar {\n  props: \":\"; // Now use \":\" as property separator\n}\n\n// Result type: { foo: { a: number } };\ntype FooWithJustA = DeepPick<FooBar, \"foo:a\", G>;\n\n```\n\n### `AmbiguousProp<G = DefaultGrammar>`\n\nReturns the template literal type that represents any string that -- if used\nas a property name -- would be ambigous given the set of character tokens.\n\n```ts\n// Result type: \"a\"\n// (\"!a\" is ambiguous because of the \"!\" character).\n// (\"a.b\" is ambiguous because of the \".\" character)\ntype ValidProps = Exclude<\"a\" | \"!a\" | \"a.b\", AmbiguousProps>\n\n// Result type: \"a\" | \"a.b\"\n// (\"a:b\" would have been ambiguous now because of custom grammar G defined\n// earlier).\ntype ValidProps = Exclude<\"a\" | \"!a\" | \"a.b\", AmbiguousProps<G>>\n```\n","readmeFilename":"README.md","gitHead":"8a227e67696077e50d56584c34b7c0e1cfac10be","bugs":{"url":"https://gitlab.com/soul-codes/ts-deep-pick/issues"},"homepage":"https://gitlab.com/soul-codes/ts-deep-pick#readme","_id":"ts-deep-pick@0.2.1-beta.1","_nodeVersion":"14.15.4","_npmVersion":"6.14.10","dist":{"integrity":"sha512-9Rn9RBZs9tBCF5/XZZlJAG97sQD4dh1Asa/QBKk4p5UXZyMoNL/Enko2+Che3VRPyGjVCJTcnpyivC72kjhSAw==","shasum":"d7bd7ee986d6a48184b888f3a0bde33a7a50eb90","tarball":"https://registry.npmjs.org/ts-deep-pick/-/ts-deep-pick-0.2.1-beta.1.tgz","fileCount":27,"unpackedSize":26527,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgugNdCRA9TVsSAnZWagAA6CYP/jUdqqdPV2UnZUGvt0qn\noWCbyFmFmeWKwXtewi5KoGLUM/ZnK6lvCCCZKY5Qs4cR/dmxFmqIy57JXZNt\nnbplnJmhJeReoAeBjbK6egMffTvWMnszraGljTNjmctc3SY4puPW2Nn2i1HC\nxW2warZjOh+FtgTZMZl087fXL47XCDvi8rXzJGlPuq5gYcNNGeitWHS3sl36\nM6IiQBI3apCblBc9xz4cpmGmIFI4GOvP8Tg0r4MNFe/P1qISYsd8oQyz0wpS\nAwa7kqVf5SvglaUdRwCw3b6U8FR15QS568TO2GTISnWd/2EWzJ7HsxRZuJz3\nbAzjQoDCQmFd3K9UBbTl+sy7bRYjTh+zFX6RZYn//Izm6VdmSJjYPFQ0hyBq\n5jGzwRDMunv+7ovTFZk+MPyCuMvzl7WsVj/WlXSEyOgWSePAE6GD03pTmd3j\n/Yud/OwavBz/hvg6Mv5XcKmDMHsecQ0yzRi7kKhM5XjvS8TSdPQ66yx+MfZh\nUCQi/UkPN3UPSiXE2YGlt/3hGZZ3H0GNA140tZx/8QI+zLWgkH54i1BbCfsl\njTIrcTE55Tzj3b/+P8EEdKG1qNmr4l6GhMJD4oXM1LXEZHca7khOtDZA01WU\nAVvsEoC4uL5WrdP+N56UKNfq+xB+MFhwRClsECvLh/mIkAJNDUAN6YrYC7YG\nlAzy\r\n=dDwf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCg+FUMfz9B9u7nbyyelyMfoS5GzJwnBQPD3foNF78JpAIgbz2/43Xkt0lYzTk5Mdeigg5ZPcd6gOB2ejTMrCIvUjg="}]},"_npmUser":{"name":"soul-codes","email":"reach.soul.codes@gmail.com"},"directories":{},"maintainers":[{"name":"soul-codes","email":"reach.soul.codes@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-deep-pick_0.2.1-beta.1_1622803293787_0.5572311908490342"},"_hasShrinkwrap":false},"0.2.1-beta.2":{"name":"ts-deep-pick","version":"0.2.1-beta.2","license":"MIT","description":"TypeScript utility generating new types by deep picking/omitting, leveraging Template Literal Types from TypeScript >= 4.1","repository":{"url":"git+https://gitlab.com/soul-codes/ts-deep-pick.git"},"keywords":["typescript","deep","pick","omit","lodash","typesafe","template literal type","ts"],"scripts":{"clean":"rimraf lib","prepare":"npm run clean && tsc","watch":"tsc --watch --noEmit","test":"npm run test:typing","test:typing":"tsc -p src/typing-test --noEmit","release":"npm run prepare && release-it","tidy":"./bin/tidy.sh"},"main":"lib","types":"lib","dependencies":{"ts-typetools":"^0.5.1"},"devDependencies":{"@release-it/conventional-changelog":"^2.0.0","@types/node":"^14.14.9","cz-conventional-changelog":"^3.3.0","import-sort-style-module":"^6.0.0","prettier":"^2.2.1","prettier-plugin-import-sort":"^0.0.6","release-it":"^14.2.1","rimraf":"^3.0.2","tslint":"^6.1.3","tslint-etc":"^1.13.7","typescript":"^4.1.2"},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"release-it":{"plugins":{"@release-it/conventional-changelog":{"preset":"angular","infile":"CHANGELOG.md"}}},"publishConfig":{"access":"public"},"importSort":{".js, .jsx, .ts, .tsx":{"style":"module","parser":"typescript"}},"readme":"`ts-deep-pick` is a TypeScript type-only utility package that allows for\ntype-safe, deep picking/omitting of properties from nested object types.\nPowered by the\n[template literal type released in TypeScript 4.1](https://devblogs.microsoft.com/typescript/announcing-typescript-4-1-beta/#template-literal-types),\nthe type `DeepPick` will offer all combinations of nested pick/omit string\npatterns that will then return the deeply picked/omit type according to the\n[deep-picking grammar](#Grammar).\n\n![Screenshot](docs/screenshot.png)\n\n## Usage\n\n### `DeepPick`\n\n```ts\nimport { DeepPick } from \"ts-deep-pick\";\n\ninterface FooBar {\n  foo: ABC;\n  bar: ABC;\n}\n\ninterface ABC {\n  a: number;\n  b: number;\n  c: number;\n}\n\n// Result type: { foo: { a: number } };\n// including a property \"positively\" omits the exluded properties.\ntype FooWithJustA = DeepPick<FooBar, \"foo.a\">; // \".\" joins nested properties\n\n// Result type: { foo: { a: number, b: number } };\ntype FooWithJustAB = DeepPick<FooBar, \"foo.a\" | \"foo.b\">;properties\n\n// Result type: { foo: { a: number, b: number } };\ntype FooWithoutC = DeepPick<FooBar, \"foo.!c\">; // \"!\" omits a property\n\n// Result type: { bar: ABC };\ntype Bar = DeepPick<FooBar, \"!bar\">; // \"!\" omits a property\n\n// Result type:\n// {\n//    foo: { a: number, b: number },\n//    bar: ABC\n// };\n// \"~\" mutates the property's nested membership without explicitly picking\n// the property and thereby omitting the remaining.\ntype FooBarWithoutFooC = DeepPick<FooBar, \"~foo.!c\">;\n\n// Result type: Array<{ foo: ABC }>\ntype ArrayWithFoo = DeepPick<FooBar[], \"[].foo\"> // \"[]\" accesses an array item.\n\n// Result type: FooBar\ntype ArrayWithFoo = DeepPick<FooBar, \"*\"> // \"*\" is the \"identity\" operand\n```\n\n### `DeepPickPath`\n\nReturns the possible path that can be used to passed into `DeepPick` for a given\nstructure.\n\n```ts\nimport { DeepPickPath } from \"ts-deep-pick\";\n\n// assume FooBar as defined earlier.\n// \"foo\" | \"bar\" | \"!foo\" | \"!bar\" | \"~foo.a\" | \"~foo.!a\" | ...\ntype Path = DeepPickPath<FooBar>;\n```\n\n## Behavior\n\n- Union paths are treated like a combination of paths. For example, `\"a\"|\"b\"`\n  would mean \"pick properties `a` and `b`\".\n- At each level, the \"picked set\" is determined before omitting and mutating.\n  If the paths at the given level include at least one explicitly picked\n  key (`\"a\"`) then these keys and the mutations (`\"~a\"`) become the picked\n  set. In this case, omits are redundant because they are either no-op\n  (omitting keys that aren't picked) or they make the picks no-op (omitting\n  keys that are picked).\n- If the paths at the given level consist only of omits (`\"!a\"`) and\n  mutations (`\"~a\"`), then the omit operation takes place on the full set of\n  keys.\n\n### Examples\n\n- `\"a\" | \"b\"` will pick just properties `a` and `b`.\n- `\"a\" | \"!a\"` will pick nothing (`a` is picked but is then omitted.)\n- `\"~a.foo\"` will pick everything at the outermost level, and pick foo as the\n  only property of `a`.\n- `\"!a\" | \"~b.foo\"` will pick everything except for `a` at the outermost level,\n  and modifies `b` such that only `foo` is available there.\n\n## Grammar\n\nThe character tokens `.`, `!`, `~`, `[]` and `*` define the property\nseparator, omit prefix, mutation prefix, array index property and the\npass-through (return the original type) operand respectively. These tokens can\nbe replaced by defining the following interface and passing it as the extra\ntype parameter to `DeepPick` and `DeepPickPath`.\n\n```ts\ninterface DeepPickGrammar {\n  array: string;  // default: \"[]\"\n  prop: string;   // default: \".\"\n  omit: string;   // default: \"!\"\n  mutate: string; // default: \"~\"\n  glob: string;   // default: \"*\"\n}\n```\n\nExample:\n\n```ts\nimport { DefaultGrammar } from \"ts-deep-pick\";\n\ninterface G extends DeepPickGrammar {\n  props: \":\"; // Now use \":\" as property separator\n}\n\n// Result type: { foo: { a: number } };\ntype FooWithJustA = DeepPick<FooBar, \"foo:a\", G>;\n\n```\n\n### `AmbiguousProp<G = DefaultGrammar>`\n\nReturns the template literal type that represents any string that -- if used\nas a property name -- would be ambigous given the set of character tokens.\n\n```ts\n// Result type: \"a\"\n// (\"!a\" is ambiguous because of the \"!\" character).\n// (\"a.b\" is ambiguous because of the \".\" character)\ntype ValidProps = Exclude<\"a\" | \"!a\" | \"a.b\", AmbiguousProps>\n\n// Result type: \"a\" | \"a.b\"\n// (\"a:b\" would have been ambiguous now because of custom grammar G defined\n// earlier).\ntype ValidProps = Exclude<\"a\" | \"!a\" | \"a.b\", AmbiguousProps<G>>\n```\n","readmeFilename":"README.md","gitHead":"b8c07bd612bb0d2efe6c7b70b379f3b69e29ddf0","bugs":{"url":"https://gitlab.com/soul-codes/ts-deep-pick/issues"},"homepage":"https://gitlab.com/soul-codes/ts-deep-pick#readme","_id":"ts-deep-pick@0.2.1-beta.2","_nodeVersion":"14.15.4","_npmVersion":"6.14.10","dist":{"integrity":"sha512-XxKwxfbgeyuq+ytbAhO11fAOD8VOFU0lIpqyZka7pshtt+X2OxjmEfcIZW/zMnj5Eisvh9ZQkDn2pE0U16d2pA==","shasum":"3b4b42342f9c9007dfcb84eda083faf37b5c8703","tarball":"https://registry.npmjs.org/ts-deep-pick/-/ts-deep-pick-0.2.1-beta.2.tgz","fileCount":27,"unpackedSize":26828,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgugd4CRA9TVsSAnZWagAA+x0P/jOtFqL97/6OT4DEqLOi\nJlN99A6Jn1jYLGmG/SpXEe98ssAwhnfhG6IFv38xKSw7CjFF1Nl2Mlt5hO8V\nQAq2/Pj0mpWyA+LprzZfayU8idV7iYmYQ37ggMntevggUnyeVFCox15Hbxc0\nKrnJ3jJP7isinTOYaiCoU9R8Nu76LFTZ3X32zSKeCm5jQxWYC7Gil16yemzM\nlksgTsoi+RF1cs9iNoSdZRL4zoUxNuiFhmDt2rC9z26FWnNiLJMBoLc+53cS\nZVEMf8qNf24zacZHMJs2Q7Bvebfzd+s+53A8i0n4iNENWsAjaSMuyu3Kqv/q\nuR4rYZIKRLXnVrmf7DOKOPWfBKtEiolbkxcFGi0DkC2BWBJCVkvcTJp0J+Pr\nkafSnYFPO5RbF1Ml7c4AXpbeDEeqZnuE6UAIT94yGO6oCT3ylfkVL/TnCPta\ntio7uqlIOSgwtgej6bSg6ycqXgCOYnDPnMOYCf9w+OW9m8wnJ3ukPs/1u4gH\n0Y3gFP2teyr8/C6XsQ1OYsXxDKCMemncqepRGpA490BvfbYz6CDCAM/jH5vY\nz0QLxlB4Ncv52GBVGhPISxlyQCnjUYbHikOXmsSYEbViuBME441+8Esb8pQs\nJuo+uEoyNfvK3vnQz02h/Cfh8QD6wL7RTACcFWRF7vrwQhT0bYeeh9bGDwWZ\n/Sb+\r\n=ndYK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICKOGlCuRMPKQfFaRGJEhTdpl2mMvuvTbR6Wu0jZciOlAiBD5mVgkACuqwtSYKj58Aglx968Z0qbP7umm11kWX8H5g=="}]},"_npmUser":{"name":"soul-codes","email":"reach.soul.codes@gmail.com"},"directories":{},"maintainers":[{"name":"soul-codes","email":"reach.soul.codes@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-deep-pick_0.2.1-beta.2_1622804344605_0.6135659306393593"},"_hasShrinkwrap":false},"0.2.1":{"name":"ts-deep-pick","version":"0.2.1","license":"MIT","description":"TypeScript utility generating new types by deep picking/omitting, leveraging Template Literal Types from TypeScript >= 4.1","repository":{"url":"git+https://gitlab.com/soul-codes/ts-deep-pick.git"},"keywords":["typescript","deep","pick","omit","lodash","typesafe","template literal type","ts"],"scripts":{"clean":"rimraf lib","prepare":"npm run clean && tsc","watch":"tsc --watch --noEmit","test":"npm run test:typing","test:typing":"tsc -p src/typing-test --noEmit","release":"npm run prepare && release-it","tidy":"./bin/tidy.sh"},"main":"lib","types":"lib","dependencies":{"ts-typetools":"^0.5.1"},"devDependencies":{"@release-it/conventional-changelog":"^2.0.0","@types/node":"^14.14.9","cz-conventional-changelog":"^3.3.0","import-sort-style-module":"^6.0.0","prettier":"^2.2.1","prettier-plugin-import-sort":"^0.0.6","release-it":"^14.2.1","rimraf":"^3.0.2","tslint":"^6.1.3","tslint-etc":"^1.13.7","typescript":"^4.1.2"},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"release-it":{"plugins":{"@release-it/conventional-changelog":{"preset":"angular","infile":"CHANGELOG.md"}}},"publishConfig":{"access":"public"},"importSort":{".js, .jsx, .ts, .tsx":{"style":"module","parser":"typescript"}},"gitHead":"d10d3a9824578cce412332ff6255d9a7e6240673","bugs":{"url":"https://gitlab.com/soul-codes/ts-deep-pick/issues"},"homepage":"https://gitlab.com/soul-codes/ts-deep-pick#readme","_id":"ts-deep-pick@0.2.1","_nodeVersion":"14.15.4","_npmVersion":"6.14.10","dist":{"integrity":"sha512-yM8wjOFUQGrOAQjuhOEnK6Ne7sLvBeteNBvu8wSkrb/As1pEv85jvtlOFf6PNoR2Xv46ectio4tnx5gQczjMAA==","shasum":"6792e54adb478b06465f71d8f08c8fc37c35fd4e","tarball":"https://registry.npmjs.org/ts-deep-pick/-/ts-deep-pick-0.2.1.tgz","fileCount":27,"unpackedSize":26919,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgvXhiCRA9TVsSAnZWagAA9YQQAKD8t0G5LbUeznzBAOxj\n7p5+ws9s+mnDkjrEN4jdg+/ptBiD6RA/9HPwTqxiAQpYHGQUww2V1dg9KxrL\nKfccvZ1x/f7geBDTgyJ9ExNQu/Uu/7nRxKBkFJJbe+FE9YxmFRvS76SJ+iaF\nsV9SEHt5c5qY4Glt1ePPDKSBxKnQluPjGmHQC+CPmeAdwaFC6Uu+LkmMIPjR\nhxIVrojJuK/OONMuB523cgrX2nyWuN5sUcTUnNOmc7jVUUnA32oIgR0WdrvP\nHh+uZauFTb+U7rTOUIGWM//iB15eLqimyNXFTBiHHLntrgSeJDaYD+YlcG+O\nBbRgjJcMDWdaKZ5BirRBRvfelQ/U/iQT3L7m4ezC3Z9ii43ndPulClWyl1Ui\nZsDz4lybQnkRay4L8bgMbmI9slBN6UjGI8Cyy1TTYF2afizjaC6+CdPZKDkY\n2TDNOYrabgNm+r0f87dWKdqmissMK5f+4f3IgIwYSmRMFDaXzKEaUc+P0oQS\nkOeC++UurHzNlM+18OizKg7cRF/D2JiBSZ+de/L8bUZOEge8IvPwO53oiQeD\n7hxqeJI810l9DmR+pE2tfkAoV1yb14OV56JAeVRan2p/DgQtlxWcBHxX2FQB\nWJvUWywhElRHLa5QnJtmvWoWiEnN/K1nrg/h1Heo0+MwqeNcRCrHIJmdA+zP\nuj1G\r\n=xt5u\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC9PINLS4PLVuWz/jO6Ln/GW5MC/7e391Hr1Sw1lQWizgIgQSu81CMo/5aNxXQLnE4aCWxaOzdvWQDQ/niMXQbdBFw="}]},"_npmUser":{"name":"soul-codes","email":"reach.soul.codes@gmail.com"},"directories":{},"maintainers":[{"name":"soul-codes","email":"reach.soul.codes@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-deep-pick_0.2.1_1623029858648_0.2722634880469057"},"_hasShrinkwrap":false},"0.2.2":{"name":"ts-deep-pick","version":"0.2.2","license":"MIT","description":"TypeScript utility generating new types by deep picking/omitting, leveraging Template Literal Types from TypeScript >= 4.1","repository":{"url":"git+https://gitlab.com/soul-codes/ts-deep-pick.git"},"keywords":["typescript","deep","pick","omit","lodash","typesafe","template literal type","ts"],"scripts":{"clean":"rimraf lib","prepare":"npm run clean && tsc","watch":"tsc --watch --noEmit","test":"npm run test:typing","test:typing":"tsc -p src/typing-test --noEmit","release":"npm run prepare && release-it","tidy":"./bin/tidy.sh"},"main":"lib","types":"lib","dependencies":{"ts-typetools":"^0.6.1"},"devDependencies":{"@release-it/conventional-changelog":"^2.0.0","@types/node":"^14.14.9","cz-conventional-changelog":"^3.3.0","import-sort-style-module":"^6.0.0","prettier":"^2.2.1","prettier-plugin-import-sort":"^0.0.6","release-it":"^14.2.1","rimraf":"^3.0.2","tslint":"^6.1.3","tslint-etc":"^1.13.7","typescript":"^4.1.2"},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"release-it":{"plugins":{"@release-it/conventional-changelog":{"preset":"angular","infile":"CHANGELOG.md"}}},"publishConfig":{"access":"public"},"importSort":{".js, .jsx, .ts, .tsx":{"style":"module","parser":"typescript"}},"gitHead":"98d54ca2169756394d18074bca054dbab26d8ee7","bugs":{"url":"https://gitlab.com/soul-codes/ts-deep-pick/issues"},"homepage":"https://gitlab.com/soul-codes/ts-deep-pick#readme","_id":"ts-deep-pick@0.2.2","_nodeVersion":"14.15.4","_npmVersion":"6.14.10","dist":{"integrity":"sha512-DFR0THXKY8Hil84r4vx5Ofb7zVryHCBfv/vYcgbDyymmivdB1vUcBwbYsDzP3j9pwnQqVFNZZplYu628STrXAA==","shasum":"004219c60d997cac2b1d8bb9db024b84643ef0b5","tarball":"https://registry.npmjs.org/ts-deep-pick/-/ts-deep-pick-0.2.2.tgz","fileCount":27,"unpackedSize":27318,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg9BI3CRA9TVsSAnZWagAAOQAP/jf7CaQxfZNMc4hmzk4B\nCJHJuXSD/Xxsd/TONkZVbVk7Uy+vUmdfAFDNNsDdcx9o4kFKdu61NuNrSkc0\nNTZ8xAxbQw2zjS6IReRVvzLq2MV14UTJByS6c8s1qxBLR/uARgyyGXVTj7/q\n3oOz5fSMgfJBx2/ozP5PvtvjYqlATzpI/I7TKLnmSjvLmyTAkbjfFddeCem2\nbOLH91rjGf7UC1M4Hp3rvy5M/M7GY/e185cNzvCXLgq3g8J6+c5L6XpdOyVu\nH3nlkWrHlKVyA7Qe4uT4uswMtOWSVZqXendbzshKwi7SyZlwC+cpq/RIfsBL\n/PUjznG6+nHg8J8hnhEVAsrg/egHjPReuxqtj8kiZIsYtGbL908OlkyCLWyj\nYkZkC0ixZnCCnQpmfOTpIzPsFPMG3s2vL4wekj8dvpBAcIQXCoEoalbjdpZC\n/RiE1aI9O6I+OoXfpj4aLbtnMiAS+70sNAi/AC1B4u2slehFIv/9s3ehkKFy\nCYNrwrSzfFf7/KVKPhk/9uJ3pauKxzJcWLiklrQPL0Cg45VQFhzh4UeEQ0XM\nktW26i78K9mZ74SI4ItCIGxSdnt3IDX9AIebV9DBmxw6CazQ3ZJP2Di+SgRP\nBjH/P2sP0OzVSHF0UNKo3AklfbOFgJXUCJB1GC5w2xw49Yvv81P7CcFioEmJ\nZn0F\r\n=RXLG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDummY+l5lMRH5t/nFRuOCResVeJCsE4u/JaqCCKDObfAiEA+mk0GjbAe1lWiELP07Cx5fcrFTyFAi9cPzmglxM55wc="}]},"_npmUser":{"name":"soul-codes","email":"reach.soul.codes@gmail.com"},"directories":{},"maintainers":[{"name":"soul-codes","email":"reach.soul.codes@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-deep-pick_0.2.2_1626608183831_0.08537802041000897"},"_hasShrinkwrap":false}},"time":{"created":"2020-12-04T15:12:56.946Z","0.1.0":"2020-12-04T15:12:57.232Z","modified":"2022-05-22T07:03:29.021Z","0.1.1":"2020-12-04T15:15:35.707Z","0.1.2":"2020-12-04T15:34:29.994Z","0.2.0-beta.0":"2020-12-13T15:12:03.225Z","0.2.0-beta.1":"2020-12-14T10:27:44.508Z","0.2.0":"2020-12-15T02:49:14.972Z","0.2.1-beta.0":"2021-06-04T08:47:07.908Z","0.2.1-beta.1":"2021-06-04T10:41:33.932Z","0.2.1-beta.2":"2021-06-04T10:59:04.737Z","0.2.1":"2021-06-07T01:37:38.785Z","0.2.2":"2021-07-18T11:36:23.994Z"},"maintainers":[{"name":"soul-codes","email":"reach.soul.codes@gmail.com"}],"description":"TypeScript utility generating new types by deep picking/omitting, leveraging Template Literal Types from TypeScript >= 4.1","homepage":"https://gitlab.com/soul-codes/ts-deep-pick#readme","keywords":["typescript","deep","pick","omit","lodash","typesafe","template literal type","ts"],"repository":{"url":"git+https://gitlab.com/soul-codes/ts-deep-pick.git"},"bugs":{"url":"https://gitlab.com/soul-codes/ts-deep-pick/issues"},"license":"MIT","readme":"`ts-deep-pick` is a TypeScript type-only utility package that allows for\ntype-safe, deep picking/omitting of properties from nested object types.\nPowered by the\n[template literal type released in TypeScript 4.1](https://devblogs.microsoft.com/typescript/announcing-typescript-4-1-beta/#template-literal-types),\nthe type `DeepPick` will offer all combinations of nested pick/omit string\npatterns that will then return the deeply picked/omit type according to the\n[deep-picking grammar](#Grammar).\n\n![Screenshot](docs/screenshot.png)\n\n## Usage\n\n### `DeepPick`\n\n```ts\nimport { DeepPick } from \"ts-deep-pick\";\n\ninterface FooBar {\n  foo: ABC;\n  bar: ABC;\n}\n\ninterface ABC {\n  a: number;\n  b: number;\n  c: number;\n}\n\n// Result type: { foo: { a: number } };\n// including a property \"positively\" omits the exluded properties.\ntype FooWithJustA = DeepPick<FooBar, \"foo.a\">; // \".\" joins nested properties\n\n// Result type: { foo: { a: number, b: number } };\ntype FooWithJustAB = DeepPick<FooBar, \"foo.a\" | \"foo.b\">;properties\n\n// Result type: { foo: { a: number, b: number } };\ntype FooWithoutC = DeepPick<FooBar, \"foo.!c\">; // \"!\" omits a property\n\n// Result type: { bar: ABC };\ntype Bar = DeepPick<FooBar, \"!bar\">; // \"!\" omits a property\n\n// Result type:\n// {\n//    foo: { a: number, b: number },\n//    bar: ABC\n// };\n// \"~\" mutates the property's nested membership without explicitly picking\n// the property and thereby omitting the remaining.\ntype FooBarWithoutFooC = DeepPick<FooBar, \"~foo.!c\">;\n\n// Result type: Array<{ foo: ABC }>\ntype ArrayWithFoo = DeepPick<FooBar[], \"[].foo\"> // \"[]\" accesses an array item.\n\n// Result type: FooBar\ntype ArrayWithFoo = DeepPick<FooBar, \"*\"> // \"*\" is the \"identity\" operand\n```\n\n### `DeepPickPath`\n\nReturns the possible path that can be used to passed into `DeepPick` for a given\nstructure.\n\n```ts\nimport { DeepPickPath } from \"ts-deep-pick\";\n\n// assume FooBar as defined earlier.\n// \"foo\" | \"bar\" | \"!foo\" | \"!bar\" | \"~foo.a\" | \"~foo.!a\" | ...\ntype Path = DeepPickPath<FooBar>;\n```\n\n## Behavior\n\n- Union paths are treated like a combination of paths. For example, `\"a\"|\"b\"`\n  would mean \"pick properties `a` and `b`\".\n- At each level, the \"picked set\" is determined before omitting and mutating.\n  If the paths at the given level include at least one explicitly picked\n  key (`\"a\"`) then these keys and the mutations (`\"~a\"`) become the picked\n  set. In this case, omits are redundant because they are either no-op\n  (omitting keys that aren't picked) or they make the picks no-op (omitting\n  keys that are picked).\n- If the paths at the given level consist only of omits (`\"!a\"`) and\n  mutations (`\"~a\"`), then the omit operation takes place on the full set of\n  keys.\n\n### Examples\n\n- `\"a\" | \"b\"` will pick just properties `a` and `b`.\n- `\"a\" | \"!a\"` will pick nothing (`a` is picked but is then omitted.)\n- `\"~a.foo\"` will pick everything at the outermost level, and pick foo as the\n  only property of `a`.\n- `\"!a\" | \"~b.foo\"` will pick everything except for `a` at the outermost level,\n  and modifies `b` such that only `foo` is available there.\n\n## Grammar\n\nThe character tokens `.`, `!`, `~`, `[]` and `*` define the property\nseparator, omit prefix, mutation prefix, array index property and the\npass-through (return the original type) operand respectively. These tokens can\nbe replaced by defining the following interface and passing it as the extra\ntype parameter to `DeepPick` and `DeepPickPath`.\n\n```ts\ninterface DeepPickGrammar {\n  array: string;  // default: \"[]\"\n  prop: string;   // default: \".\"\n  omit: string;   // default: \"!\"\n  mutate: string; // default: \"~\"\n  glob: string;   // default: \"*\"\n}\n```\n\nExample:\n\n```ts\nimport { DefaultGrammar } from \"ts-deep-pick\";\n\ninterface G extends DeepPickGrammar {\n  props: \":\"; // Now use \":\" as property separator\n}\n\n// Result type: { foo: { a: number } };\ntype FooWithJustA = DeepPick<FooBar, \"foo:a\", G>;\n\n```\n\n### `AmbiguousProp<G = DefaultGrammar>`\n\nReturns the template literal type that represents any string that -- if used\nas a property name -- would be ambigous given the set of character tokens.\n\n```ts\n// Result type: \"a\"\n// (\"!a\" is ambiguous because of the \"!\" character).\n// (\"a.b\" is ambiguous because of the \".\" character)\ntype ValidProps = Exclude<\"a\" | \"!a\" | \"a.b\", AmbiguousProps>\n\n// Result type: \"a\" | \"a.b\"\n// (\"a:b\" would have been ambiguous now because of custom grammar G defined\n// earlier).\ntype ValidProps = Exclude<\"a\" | \"!a\" | \"a.b\", AmbiguousProps<G>>\n```\n","readmeFilename":"README.md"}