{"_id":"ts-undefined-partial","_rev":"5-f18d8bf36d98e23c04f1f4b34c080f2c","name":"ts-undefined-partial","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"ts-undefined-partial","version":"1.0.0","description":"TypeScript recursive conversion between optional (partial) and undefined properties.","homepage":"https://github.com/DmitryKoterov/ts-undefined-partial#readme","author":{"name":"Dmitry Koterov"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/DmitryKoterov/ts-undefined-partial.git"},"bugs":{"url":"https://github.com/DmitryKoterov/ts-undefined-partial/issues"},"keywords":["typescript","undefined","optional","partial","type","generics"],"main":"./dist/index.js","typings":"dist/index.d.ts","scripts":{"build":"tsc","dev":"tsc --watch","test":"jest","clean":"rm -rf dist node_modules yarn.lock package-lock.json"},"devDependencies":{"@types/jest":"^26.0.3","jest":"^26.1.0","ts-jest":"^26.1.1","typescript":"^4.1.0"},"dependencies":{},"gitHead":"60d11fd52450b93ae0b71109603dd2046a40427d","_id":"ts-undefined-partial@1.0.0","_nodeVersion":"15.1.0","_npmVersion":"7.0.8","dist":{"integrity":"sha512-pILD0SuK8xx/MnpfJhu9HAUjnaEcjSPLTsCIbJ5Qz5pZ2d/kYScq3pFZpYp+gGlbTpY5o1TaETH8dzS4EYjlQA==","shasum":"02a72bcb4ca828be6e9c16060dddb22817bb91e9","tarball":"https://registry.npmjs.org/ts-undefined-partial/-/ts-undefined-partial-1.0.0.tgz","fileCount":7,"unpackedSize":8318,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgC3X2CRA9TVsSAnZWagAA1M0P/A6MZKqnA1YAG/naDQ1+\nu90G80MCnVeC+jyHq1rrCtSbGlYUV3LNF7fsVCJWZ68TfnI71yUQcXPZQyuS\ncJdYXiDwp3l76YNYEHVzX6odg5xQ2WrOCUDBNrb0CFY6JbRgY4VL0GC4SW3P\n9g7krPdwfbBaiRfUWBanyf9o3ramoV8V8rQj080sdfQubSGgHB3zt9twWIqG\n8HtEfG/DuBTPolsGUfrAgy5/6Cto6eRVgG486ZNe+6H/Ivw/aP922QlWZbgS\nB1P6utB0PtIz18+YWoYYsa0OwKa87mvvr6fUQa0iecEI8Bfsm6VI+zXNZMzk\nleGW1Cq1O0szrm/n9m1qLaL9/KNj0sacmqQ58K07QJFAmGkYC75slNkXt+0s\n1GQL9pEMgyxKzBsmE3kzAnDLL7+Jk7u4sVzBkn/4W+zUbTnzpCMKHu1E9uBm\nZ7JyDluVN9DKKs1yHP1nlyXqAvF3jOeVSosr8FP+L4in5jO4gITXyLe+/KEY\njoIeUzbvHUVprL8A2qBoXWpAxAbwMO/x9wkoMdS0ji0j8DcAleQdDdwxJ+cf\naNzHW6GLsJ7hV4zLLFAmHqUIpSWNjgh0cWTtghcf3n3UgCxonkdITK4EW9e7\n019wrrTtmRLD3QRC3MhKWmhH5m1NrAJqIvB/oMDtH+eiKALCyLqpxJFlXXsD\nl/dS\r\n=fX54\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH7ySWn73+Loef7CWouOYuuRRwCl1LdkryhI7yjDtClgAiEA/op2sNIgGNoSDoxJHmqEIZ7eY6WTg69IZzcjWx3kLq4="}]},"_npmUser":{"name":"dmitry-koterov","email":"dmitry.koterov@gmail.com"},"directories":{},"maintainers":[{"name":"dmitry-koterov","email":"dmitry.koterov@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-undefined-partial_1.0.0_1611363829532_0.3319945643354223"},"_hasShrinkwrap":false},"1.0.1":{"name":"ts-undefined-partial","version":"1.0.1","description":"TypeScript recursive conversion between optional (partial) and undefined properties.","homepage":"https://github.com/dimikot/ts-undefined-partial#readme","author":{"name":"Dimi Kot"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/dimikot/ts-undefined-partial.git"},"bugs":{"url":"https://github.com/dimikot/ts-undefined-partial/issues"},"keywords":["typescript","undefined","optional","partial","type","generics"],"main":"./dist/index.js","typings":"dist/index.d.ts","scripts":{"build":"tsc","dev":"tsc --watch","test":"jest","clean":"rm -rf dist node_modules yarn.lock package-lock.json","deploy":"npm run build && npm test && npm publish"},"devDependencies":{"@types/jest":"^26.0.3","jest":"^26.1.0","ts-jest":"^26.1.1","typescript":"^4.1.0"},"dependencies":{},"_id":"ts-undefined-partial@1.0.1","gitHead":"49c04be00f118f7fc261b0e85eaa3143785d7275","_nodeVersion":"20.5.1","_npmVersion":"9.8.0","dist":{"integrity":"sha512-ICYV2oXt/shfL1Ba+8onEzgiQ5thsIsn0SwaWS1r5qT6mDpKdoDPubjyh3TGYdpyy49xQyxW5yjL+uDby3kBVA==","shasum":"78cd950a1426ccc5e9704337541d9bf97659151f","tarball":"https://registry.npmjs.org/ts-undefined-partial/-/ts-undefined-partial-1.0.1.tgz","fileCount":7,"unpackedSize":8314,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDvwPqa06WDB9aQU4txRRHMh2uNTGMJwcrkTCePsf40FAIgJcX6Scqe4i11sgr7GMUS7Tqt0OXEUmZJ2jsHb91ZUHQ="}]},"_npmUser":{"name":"dmitry-koterov","email":"dmitry.koterov@gmail.com"},"directories":{},"maintainers":[{"name":"dmitry-koterov","email":"dmitry.koterov@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-undefined-partial_1.0.1_1696995426979_0.010933076767226435"},"_hasShrinkwrap":false},"1.0.2":{"name":"ts-undefined-partial","version":"1.0.2","description":"TypeScript recursive conversion between optional (partial) and undefined properties.","homepage":"https://github.com/dimikot/ts-undefined-partial#readme","author":{"name":"Dimi Kot"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/dimikot/ts-undefined-partial.git"},"bugs":{"url":"https://github.com/dimikot/ts-undefined-partial/issues"},"keywords":["typescript","undefined","optional","partial","type","generics"],"main":"./dist/index.js","typings":"dist/index.d.ts","scripts":{"build":"tsc","dev":"tsc --watch","test":"jest","clean":"rm -rf dist node_modules yarn.lock package-lock.json","deploy":"npm run build && npm test && npm publish"},"devDependencies":{"@types/jest":"^26.0.3","jest":"^26.1.0","ts-jest":"^26.1.1","typescript":"^4.1.0"},"dependencies":{},"_id":"ts-undefined-partial@1.0.2","gitHead":"300457e7d29fcdfe9d79683b849fe1dec2ed5c38","_nodeVersion":"20.5.1","_npmVersion":"9.8.0","dist":{"integrity":"sha512-gnAxvVrUHq58aQnAL0Rg7K9exJFJtgB1+/fOg19qe+OO4H3YRGo8ldWSIW1Ior5BXIsH+6AE1wFem4ztsocYUQ==","shasum":"bb696018864643f3720ae1ba969ada6d7cd8c7e9","tarball":"https://registry.npmjs.org/ts-undefined-partial/-/ts-undefined-partial-1.0.2.tgz","fileCount":7,"unpackedSize":8314,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE3OnDLr6lgN7omSCknqZMgSv5ZTJsvgmD6xm8x91GzkAiBUSWiIE1Lu5QyplKeZPbqG1cR/h3Ns8NqVyCFw1q3hTg=="}]},"_npmUser":{"name":"dimikot","email":"dimi.kot.code@gmail.com"},"directories":{},"maintainers":[{"name":"dimikot","email":"dimi.kot.code@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-undefined-partial_1.0.2_1696998223168_0.9939016148628916"},"_hasShrinkwrap":false}},"time":{"created":"2021-01-23T01:03:49.531Z","1.0.0":"2021-01-23T01:03:49.638Z","modified":"2023-10-11T04:23:43.607Z","1.0.1":"2023-10-11T03:37:07.152Z","1.0.2":"2023-10-11T04:23:43.417Z"},"maintainers":[{"name":"dimikot","email":"dimi.kot.code@gmail.com"}],"description":"TypeScript recursive conversion between optional (partial) and undefined properties.","homepage":"https://github.com/dimikot/ts-undefined-partial#readme","keywords":["typescript","undefined","optional","partial","type","generics"],"repository":{"type":"git","url":"git+https://github.com/dimikot/ts-undefined-partial.git"},"author":{"name":"Dimi Kot"},"bugs":{"url":"https://github.com/dimikot/ts-undefined-partial/issues"},"license":"MIT","readme":"# ts-undefined-partial: TypeScript recursive conversion between optional (partial) and undefined properties\n\nThe library has 2 typing utilities:\n\n1. `PartialToUndefined<T>` removes \"?\" optionality marker on all properties\n   (recursively) and replaces them with `| undefined`. I.e. it makes the type\n   \"stricter\" in assignments.\n2. `UndefinedToPartial<T>` adds \"?\" optionality marker for all properties\n   (recursively) which can accept `undefined` as a value. I.e. it makes the type\n   \"more relaxed\" in assignments.\n\nThese tools ignore \"complex\" objects which have at lease 1 method on them (like\nDate, Map etc.). I.e. the library is suited for data objects only.\n\n## Examples\n\n```ts\nPartialToUndefined<{ a?: string; c: MyClass; some: { x?: string } }>\n// -> { a: string | undefined; c: MyClass; some: { x: string | undefined } }\n\nUndefinedToPartial<{ a: string | undefined; c: MyClass; some: { x: string | undefined } }>\n// -> { a?: string | undefined; c: MyClass; some: { x?: string | undefined } }\n```\n\n## Background\n\nFor object properties, TypeScript supports two slightly different notions of \"optionality\":\n\n1. whether a property is \"required\" or \"optional\" (\"?\" suffix marker);\n2. whether a property accepts `undefined` as a value or not.\n\nExamples:\n\n```ts\nlet optional: {\n  a?: number;\n};\noptional = {}; // OK; property can be omitted\noptional = { a: undefined }; // OK\n\nlet undefinable: {\n  a: number | undefined;\n};\noptional = {}; // ERROR\noptional = { a: undefined }; // OK\n```\n\nThere is also the 3rd notion (`a?: number | undefined`) which is technically\ndifferent, but in practice, TypeScript can't distinguish it from `a?: number` in\nmany cases, especially when working with generics.\n","readmeFilename":"README.md"}