{"_id":"0type","_rev":"4-e89caa5f4219085ab1899f4d1fcad613","name":"0type","dist-tags":{"latest":"0.2.0"},"versions":{"0.0.1":{"name":"0type","version":"0.0.1","keywords":["typescript","ts","type"],"author":{"name":"ruihuag"},"license":"ISC","_id":"0type@0.0.1","maintainers":[{"name":"ruihuag","email":"3494242908@qq.com"}],"dist":{"shasum":"868eb9efdf611eec03676486f57e48c2b5ac5e17","tarball":"https://registry.npmjs.org/0type/-/0type-0.0.1.tgz","fileCount":10,"integrity":"sha512-YdeRvN8My3BYkVS29mGfULfUQz8AR2tgi0VlrmOcmaahzHm1QWDbvhHE4/UfB2NrI3KiwDzR8bTcUZ3iihFtLg==","signatures":[{"sig":"MEUCIQClrbqlxSbA2F9hwNWBp5ll4Y4fZijSkMZ3rFU4JWgSagIgAdczRVa9jzQcKnpXvI9MlVRixeesUhr7wwEPGjiFkJw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":5816},"main":"src/index.ts","gitHead":"aeca1fce31854508f8f7c52d05a12a45bd1260f8","scripts":{"dev":"ts-node-dev --respawn --transpile-only ./__test__/index.ts","pub":"npm publish","devD":"ts-node-dev --respawn --transpile-only ./__test__/test_d.ts","lint":"eslint ./src --ext .jsx,.js,.ts,.tsx","prod":"npm run build && npm run start","start":"node ./dist/index.js","prepare":"husky install","restart":"rimraf dist && npm run build && npm start","dev_test":"ts-node-dev --respawn --transpile-only ./src/__test__/test_rh.ts","lint:fix":"eslint ./src --ext .jsx,.js,.ts,.tsx --fix --quiet","lint:style":"stylelint src/**/*.{css,less,scss} --fix ","lint:format":"prettier  --loglevel warn --write \"./**/*.{js,jsx,ts,tsx,css,md,json}\" "},"_npmUser":{"name":"ruihuag","email":"3494242908@qq.com"},"_npmVersion":"8.13.1","description":"ts类型包","directories":{},"lint-staged":{"*.{ts,js,tsx}":["eslint","echo 'no error'"]},"_nodeVersion":"16.20.0","_hasShrinkwrap":false,"devDependencies":{"husky":"^7.0.4","eslint":"^8.9.0","rimraf":"^3.0.2","prettier":"^2.5.1","commitizen":"^4.2.4","typescript":"^4.5.5","@types/node":"^16.11.22","lint-staged":"^12.3.4","ts-node-dev":"^1.1.8","node-notifier":"^8.0.2","rh-js-methods":"^1.0.2","@commitlint/cli":"^12.1.4","cz-customizable":"^6.3.0","eslint-plugin-react":"^7.24.0","commitlint-config-cz":"^0.13.3","eslint-plugin-import":"^2.23.4","eslint-config-prettier":"^8.3.0","eslint-plugin-jsx-a11y":"^6.4.1","eslint-plugin-prettier":"^3.4.0","@typescript-eslint/parser":"^5.12.0","cz-conventional-changelog":"^3.3.0","eslint-plugin-react-hooks":"^4.2.0","@commitlint/config-conventional":"^12.1.4","@typescript-eslint/eslint-plugin":"^5.12.0","eslint-plugin-simple-import-sort":"^7.0.0"},"_npmOperationalInternal":{"tmp":"tmp/0type_0.0.1_1701136260448_0.036663045845243936","host":"s3://npm-registry-packages"}},"0.0.2":{"name":"0type","version":"0.0.2","keywords":["typescript","ts","type"],"author":{"name":"ruihuag"},"license":"ISC","_id":"0type@0.0.2","maintainers":[{"name":"ruihuag","email":"3494242908@qq.com"}],"dist":{"shasum":"153d50da68cd323b2c14da6b0a694ee626b3c528","tarball":"https://registry.npmjs.org/0type/-/0type-0.0.2.tgz","fileCount":10,"integrity":"sha512-y9e70okOe48m45E5yvmHn6zY07z7/qJaUzgEZapzc2on445tBMDz6KbhARbTCIxPQMEqoQuvBgVtB3u2EAXC/g==","signatures":[{"sig":"MEYCIQDLvX8w5tTQ/+UyPk1rrdX5b94Y8zbnPho2aB3Pcs5SQAIhAJ9hbLUvEZYpSYrsvKxG+4a0dgmIhvG+Zpryr/Bc/7ym","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6167},"main":"src/index.ts","gitHead":"684e025228ca30689600bfce459789d8a88ab128","scripts":{"pub":"npm publish","lint":"eslint ./src --ext .jsx,.js,.ts,.tsx","prepare":"husky install","restart":"rimraf dist && npm run build && npm start","lint:fix":"eslint ./src --ext .jsx,.js,.ts,.tsx --fix --quiet","lint:style":"stylelint src/**/*.{css,less,scss} --fix ","lint:format":"prettier  --loglevel warn --write \"./**/*.{js,jsx,ts,tsx,css,md,json}\" "},"_npmUser":{"name":"ruihuag","email":"3494242908@qq.com"},"_npmVersion":"8.13.1","description":"ts类型包","directories":{},"lint-staged":{"*.{ts,js,tsx}":["eslint","echo 'no error'"]},"_nodeVersion":"16.20.0","_hasShrinkwrap":false,"devDependencies":{"husky":"^7.0.4","eslint":"^8.9.0","rimraf":"^3.0.2","prettier":"^2.5.1","commitizen":"^4.2.4","typescript":"^4.5.5","@types/node":"^16.11.22","lint-staged":"^12.3.4","ts-node-dev":"^1.1.8","node-notifier":"^8.0.2","rh-js-methods":"^1.0.2","@commitlint/cli":"^12.1.4","cz-customizable":"^6.3.0","eslint-plugin-react":"^7.24.0","commitlint-config-cz":"^0.13.3","eslint-plugin-import":"^2.23.4","eslint-config-prettier":"^8.3.0","eslint-plugin-jsx-a11y":"^6.4.1","eslint-plugin-prettier":"^3.4.0","@typescript-eslint/parser":"^5.12.0","cz-conventional-changelog":"^3.3.0","eslint-plugin-react-hooks":"^4.2.0","@commitlint/config-conventional":"^12.1.4","@typescript-eslint/eslint-plugin":"^5.12.0","eslint-plugin-simple-import-sort":"^7.0.0"},"_npmOperationalInternal":{"tmp":"tmp/0type_0.0.2_1712461434932_0.4984859835952209","host":"s3://npm-registry-packages"}},"0.0.3":{"name":"0type","version":"0.0.3","keywords":["typescript","ts","type"],"author":{"name":"ruihuag"},"license":"ISC","_id":"0type@0.0.3","maintainers":[{"name":"ruihuag","email":"3494242908@qq.com"}],"dist":{"shasum":"c22c45be7337ea0c394990bbfedf46ae0d019204","tarball":"https://registry.npmjs.org/0type/-/0type-0.0.3.tgz","fileCount":10,"integrity":"sha512-Qw7e4j5OpodgxNTFTzCP0bbSUVxLJaFGWcqoSa63zw+ueNX33xFgWhNzGy+Od3bCivos/OKfXE8vUEzLcL5qDg==","signatures":[{"sig":"MEQCIDM/7y7NFjFVQFZxp/txPJF8+pT2knWx3y+cybpnJyNJAiBF2Ug2wRr/RDNKNMxn3TQIMmz1VcwgkEJLbuQqe0Gkaw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6081},"main":"src/index.ts","gitHead":"684e025228ca30689600bfce459789d8a88ab128","scripts":{"pub":"npm publish","lint":"eslint ./src --ext .jsx,.js,.ts,.tsx","prepare":"husky install","restart":"rimraf dist && npm run build && npm start","lint:fix":"eslint ./src --ext .jsx,.js,.ts,.tsx --fix --quiet","lint:style":"stylelint src/**/*.{css,less,scss} --fix ","lint:format":"prettier  --loglevel warn --write \"./**/*.{js,jsx,ts,tsx,css,md,json}\" "},"_npmUser":{"name":"ruihuag","email":"3494242908@qq.com"},"_npmVersion":"8.13.1","description":"ts类型包","directories":{},"lint-staged":{"*.{ts,js,tsx}":["eslint","echo 'no error'"]},"_nodeVersion":"16.20.0","_hasShrinkwrap":false,"devDependencies":{"husky":"^7.0.4","eslint":"^8.9.0","rimraf":"^3.0.2","prettier":"^2.5.1","commitizen":"^4.2.4","typescript":"^4.5.5","@types/node":"^16.11.22","lint-staged":"^12.3.4","ts-node-dev":"^1.1.8","node-notifier":"^8.0.2","rh-js-methods":"^1.0.2","@commitlint/cli":"^12.1.4","cz-customizable":"^6.3.0","eslint-plugin-react":"^7.24.0","commitlint-config-cz":"^0.13.3","eslint-plugin-import":"^2.23.4","eslint-config-prettier":"^8.3.0","eslint-plugin-jsx-a11y":"^6.4.1","eslint-plugin-prettier":"^3.4.0","@typescript-eslint/parser":"^5.12.0","cz-conventional-changelog":"^3.3.0","eslint-plugin-react-hooks":"^4.2.0","@commitlint/config-conventional":"^12.1.4","@typescript-eslint/eslint-plugin":"^5.12.0","eslint-plugin-simple-import-sort":"^7.0.0"},"_npmOperationalInternal":{"tmp":"tmp/0type_0.0.3_1712461599978_0.965253359189026","host":"s3://npm-registry-packages"}},"0.1.0":{"name":"0type","version":"0.1.0","keywords":["typescript","ts","type"],"author":{"name":"ruihuag"},"license":"ISC","_id":"0type@0.1.0","maintainers":[{"name":"ruihuag","email":"3494242908@qq.com"}],"dist":{"shasum":"bbec0d436cca393539bf183e710c3b6ae3569ecd","tarball":"https://registry.npmjs.org/0type/-/0type-0.1.0.tgz","fileCount":10,"integrity":"sha512-u1wzXRC4XDONSv7ejY1F1eUST8ysyRYD6SEYDdQZ2Q1snQrS7za+mU0XbZi0wgoHt6+ei++jbCRt0fSDSccnSw==","signatures":[{"sig":"MEUCIQDTccs4vpUYWw4c9RvNUrvE7ZxA8A8lVvfVW4ZHibWOkwIgfxSZUDnoMYGxpz0k8xzRaJFpl20Un90K598Q/7PODE8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6032},"main":"src/index.ts","gitHead":"def476bd4eb1c7aa114ec363e744f3f0e5f7b4b8","scripts":{"pub":"npm publish","lint":"eslint ./src --ext .jsx,.js,.ts,.tsx","prepare":"husky install","restart":"rimraf dist && npm run build && npm start","lint:fix":"eslint ./src --ext .jsx,.js,.ts,.tsx --fix --quiet","lint:style":"stylelint src/**/*.{css,less,scss} --fix ","lint:format":"prettier  --loglevel warn --write \"./**/*.{js,jsx,ts,tsx,css,md,json}\" "},"_npmUser":{"name":"ruihuag","email":"3494242908@qq.com"},"_npmVersion":"8.13.1","description":"ts类型包","directories":{},"lint-staged":{"*.{ts,js,tsx}":["eslint","echo 'no error'"]},"_nodeVersion":"16.20.0","_hasShrinkwrap":false,"devDependencies":{"husky":"^7.0.4","eslint":"^8.9.0","rimraf":"^3.0.2","prettier":"^2.5.1","commitizen":"^4.2.4","typescript":"^4.5.5","@types/node":"^16.11.22","lint-staged":"^12.3.4","ts-node-dev":"^1.1.8","node-notifier":"^8.0.2","@commitlint/cli":"^12.1.4","cz-customizable":"^6.3.0","eslint-plugin-react":"^7.24.0","commitlint-config-cz":"^0.13.3","eslint-plugin-import":"^2.23.4","eslint-config-prettier":"^8.3.0","eslint-plugin-jsx-a11y":"^6.4.1","eslint-plugin-prettier":"^3.4.0","@typescript-eslint/parser":"^5.12.0","cz-conventional-changelog":"^3.3.0","eslint-plugin-react-hooks":"^4.2.0","@commitlint/config-conventional":"^12.1.4","@typescript-eslint/eslint-plugin":"^5.12.0","eslint-plugin-simple-import-sort":"^7.0.0"},"_npmOperationalInternal":{"tmp":"tmp/0type_0.1.0_1712470360981_0.39445348459636675","host":"s3://npm-registry-packages"}},"0.2.0":{"name":"0type","version":"0.2.0","description":"ts类型包","main":"src/index.ts","scripts":{"restart":"rimraf dist && npm run build && npm start","pub":"npm publish","prepare":"husky install","lint":"eslint ./src --ext .jsx,.js,.ts,.tsx","lint:fix":"eslint ./src --ext .jsx,.js,.ts,.tsx --fix --quiet","lint:format":"prettier  --loglevel warn --write \"./**/*.{js,jsx,ts,tsx,css,md,json}\" ","lint:style":"stylelint src/**/*.{css,less,scss} --fix "},"keywords":["typescript","ts","type"],"author":{"name":"ruihuag"},"license":"ISC","lint-staged":{"*.{ts,js,tsx}":["eslint","echo 'no error'"]},"devDependencies":{"@commitlint/cli":"^12.1.4","@commitlint/config-conventional":"^12.1.4","@types/node":"^16.11.22","@typescript-eslint/eslint-plugin":"^5.12.0","@typescript-eslint/parser":"^5.12.0","commitizen":"^4.2.4","commitlint-config-cz":"^0.13.3","cz-conventional-changelog":"^3.3.0","cz-customizable":"^6.3.0","eslint":"^8.9.0","eslint-config-prettier":"^8.3.0","eslint-plugin-import":"^2.23.4","eslint-plugin-jsx-a11y":"^6.4.1","eslint-plugin-prettier":"^3.4.0","eslint-plugin-react":"^7.24.0","eslint-plugin-react-hooks":"^4.2.0","eslint-plugin-simple-import-sort":"^7.0.0","husky":"^7.0.4","lint-staged":"^12.3.4","node-notifier":"^8.0.2","prettier":"^2.5.1","rimraf":"^3.0.2","ts-node-dev":"^1.1.8","typescript":"^4.5.5"},"_id":"0type@0.2.0","gitHead":"def476bd4eb1c7aa114ec363e744f3f0e5f7b4b8","_nodeVersion":"20.9.0","_npmVersion":"10.1.0","dist":{"integrity":"sha512-4bBJmMeXt7fgqyKjwV0a5gEoYbfx7+N/ctd766iFNHumlEeufCZqMFAiYapLWB38F9RPdd/HNwhqOcPDHKIGFA==","shasum":"6ea6748aa2901b121a2c8735d0c3d80ea0689717","tarball":"https://registry.npmjs.org/0type/-/0type-0.2.0.tgz","fileCount":9,"unpackedSize":5801,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDSJLeWV+Y990S+QD1iUqsE1yuI6QGBtGRHEqaAZzuF2QIgW7XW+akV6weaZV+U0aw1rz5dkmaTWCV6nVX+JtV5Ms4="}]},"_npmUser":{"name":"ruihuag","email":"3494242908@qq.com"},"directories":{},"maintainers":[{"name":"ruihuag","email":"3494242908@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/0type_0.2.0_1735270735891_0.7007217484069819"},"_hasShrinkwrap":false}},"time":{"created":"2023-11-28T01:51:00.448Z","modified":"2024-12-27T03:38:56.192Z","0.0.1":"2023-11-28T01:51:00.625Z","0.0.2":"2024-04-07T03:43:55.081Z","0.0.3":"2024-04-07T03:46:40.139Z","0.1.0":"2024-04-07T06:12:41.146Z","0.2.0":"2024-12-27T03:38:56.042Z"},"author":{"name":"ruihuag"},"license":"ISC","keywords":["typescript","ts","type"],"description":"ts类型包","maintainers":[{"name":"ruihuag","email":"3494242908@qq.com"}],"readme":"# 描述\r\n\r\n## ts 内置常用 & 拓展\r\n\r\n- 拓展内置类型名前加`E`, 表示对原有的类型进行拓展\r\n\r\n### `Record<K, T>`\r\n\r\n- 生成属性为`K`, 类型为`T`的类型几何\r\n- `K` 只支持 `number`, `string` , `symbol` 的类型\r\n\r\n```ts\r\n const t1: Record<'s' |  -1 | symbol, number> = {\r\n  's': 123,\r\n  '-1': 123,\r\n  [Symbol(1)]: 123\r\n }\r\n\r\n```\r\n\r\n#### `ERcord<K, T>`\r\n\r\n- 拓展`K`的支持类型 `null, undefined, boolean`\r\n\r\n```ts\r\n const te1: ERecord<null | undefined| true | false | '12', 1> = {\r\n  null: 1,\r\n  undefined: 1,\r\n  false: 1,\r\n  true: 1,\r\n  12: 1\r\n }\r\n```\r\n\r\n### `Partial<T>`\r\n\r\n- 全部变可选\r\n\r\n```ts\r\n type tt = {\r\n  a: number,\r\n  b: number\r\n }\r\n\r\n const t2: Partial<tt> = {}\r\n```\r\n\r\n### `Required<T>`\r\n\r\n- 全部变必填\r\n\r\n```ts\r\n type tt = {\r\n  a?: number,\r\n  b: number\r\n }\r\n\r\n const t3: Required<tt> = {\r\n  a: 0,\r\n  b: 0\r\n }\r\n```\r\n\r\n### `Readonly<T>`\r\n\r\n- 全部变只读\r\n\r\n```ts\r\n type tt = {\r\n  a: number,\r\n  b: number\r\n }\r\n type t1 = Readonly<tt>\r\n // 等同于\r\n type t2 = {\r\n  readonly a: number;\r\n  readonly b: number;\r\n }\r\n```\r\n\r\n### `Pick<T,K>`\r\n\r\n- 提取指定属性\r\n\r\n```ts\r\n type tt = {\r\n  n: number,\r\n  n2: number,\r\n  s: string,\r\n  s2: string,\r\n }\r\n const t1: Pick<tt, 'n'> = {\r\n  n: 1\r\n }\r\n const t2: Pick<tt, 'n'|'s'> = {\r\n  n: 1,\r\n  s: 's'\r\n }\r\n```\r\n\r\n### `Exclude<T,U>`\r\n\r\n- 从`T`中排除掉所有包含`U`的属性\r\n\r\n```ts\r\n type tt = number | string | boolean\r\n const t1: Exclude<tt, number|string> =  true\r\n const t2: Exclude<tt, number|boolean> = '12'\r\n```\r\n\r\n### `Extact<T,U>`\r\n\r\n- 提取T和U都有的\r\n\r\n```ts\r\n type tt = number | string | boolean\r\n const t1: Extract<tt, number> =  12\r\n const t2: Extract<tt, boolean> = true\r\n```\r\n\r\n### `NonNullable<T>`\r\n\r\n- 去除掉`null`和`underfined`\r\n\r\n```ts\r\n// 不可以为 null 和 undefined\r\nconst t1: NonNullable<number> = 1\r\nconst t2: NonNullable<123> = 123\r\n```\r\n\r\n### `Omit<T,K>`\r\n\r\n- 忽略T中的K属性\r\n\r\n## 基础类型\r\n\r\n| 类型             | 描述               | 预期                                                                     |\r\n| :--------------- | :----------------- | :----------------------------------------------------------------------- |\r\n| `NumberLike`     | 可转`number`的类型 | <code> number \\| \\`${number}\\` </code>                                   |\r\n| `CanStringified` | 可转`string`的类型 | <code>string \\| number \\| bigint \\| boolean \\| null \\| undefined </code> |\r\n\r\n## ts拓展\r\n","readmeFilename":"README.md"}