{"_id":"ts-chain-core","_rev":"42-0a9a2d88280b52cb65ae5000ddae83d6","name":"ts-chain-core","dist-tags":{"latest":"0.0.3-alpha2"},"versions":{"0.0.1-alpha12":{"name":"ts-chain-core","version":"0.0.1-alpha12","description":"Chainable programming tool for Typescript","types":"dist/index.d.ts","main":"dist/index.js","scripts":{"clean":"node clean.js dist lib","build":"npm run clean & tsc","test":"mocha 'test/**/*.ts' --require ts-node/register --recursive --timeout 60000 --exit","publish":"npm publish --registry https://registry.npmjs.org","unpublish":"npm unpublish --registry https://registry.npmjs.org  ts-chain-core@xxx --force","versionlist":"npm view ts-chain-core versions --registry https://registry.npmjs.org"},"author":{"name":"Max Zhou","email":"maxzhou0@outlook.com","url":"https://github.com/maxzhou0"},"repository":{"type":"git","url":"git+https://github.com/maxzhou0/ts-chain-core.git"},"keywords":["typescript","chain","functional"],"license":"MIT","devDependencies":{"@types/chai":"^4.3.6","@types/mocha":"^10.0.2","@types/node":"^20.8.0","assert":"^2.1.0","chai":"^4.3.10","mocha":"^10.2.0","ts-node":"^10.9.1","typescript":"^5.2.2"},"gitHead":"458623332b9cca8e1f1911fbada84ea4018781e7","bugs":{"url":"https://github.com/maxzhou0/ts-chain-core/issues"},"homepage":"https://github.com/maxzhou0/ts-chain-core#readme","_id":"ts-chain-core@0.0.1-alpha12","_nodeVersion":"18.16.0","_npmVersion":"9.2.0","dist":{"integrity":"sha512-PjKSGOVgIk0eLpacSGH3/kGLRbhPUEhPe/ku0f6GvjNyUnKfYtdhj3T3FJE51Fvq2WpvStPHBFmBo4kDMn5D/g==","shasum":"f8cc0b77bd81e384809a07622e99b8e87b770f38","tarball":"https://registry.npmjs.org/ts-chain-core/-/ts-chain-core-0.0.1-alpha12.tgz","fileCount":24,"unpackedSize":944229,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD6I9CMkevVZiVFJ+JoLKPHL6FpM3K/nxm13Veih+mCtQIgMPK32hF3CEqjKk3P3CQXs6uOgL7Gzxg5FErkmBaP79A="}]},"_npmUser":{"name":"luka-fans","email":"maxzhou0@outlook.com"},"directories":{},"maintainers":[{"name":"luka-fans","email":"maxzhou0@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-chain-core_0.0.1-alpha12_1696949841192_0.6741456574711595"},"_hasShrinkwrap":false},"0.0.2-alpha7":{"name":"ts-chain-core","version":"0.0.2-alpha7","type":"module","umd:name":"ts-chain-core","description":"Chainable programming tool for Typescript","unpkg":"dist/index.min.js","module":"dist/index.mjs","main":"dist/index.js","types":"types/index.d.ts","scripts":{"build":"rollup -c","prepublishOnly":"npm run test && npm run build","types":"tsc --noEmit","test":"mocha","pub":"npm publish --registry https://registry.npmjs.org","unpub":"npm unpublish --registry https://registry.npmjs.org  ts-chain-core@0.0.2-alpha7 --force","vl":"npm view ts-chain-core versions --registry https://registry.npmjs.org & npm view ts-chain-core versions"},"exports":{".":{"import":"./dist/index.mjs","require":"./dist/index.js"},"./package.json":"./package.json"},"author":{"name":"Max Zhou","email":"maxzhou0@outlook.com","url":"https://github.com/maxzhou0"},"repository":{"type":"git","url":"git+https://github.com/maxzhou0/ts-chain-core.git"},"keywords":["typescript","chain","functional"],"license":"MIT","devDependencies":{"@types/chai":"^4.3.6","@types/mocha":"^10.0.2","@types/node":"^20.8.0","assert":"^2.1.0","chai":"^4.3.10","mocha":"^10.2.0","ts-node":"^10.9.1","typescript":"^5.2.2","@rollup/plugin-node-resolve":"13.1.3","rollup":"2.66.1","rollup-plugin-terser":"7.0.2","rollup-plugin-typescript2":"0.27.1"},"gitHead":"424e83a157da56c1421e1d26b87280dc38b6adc8","bugs":{"url":"https://github.com/maxzhou0/ts-chain-core/issues"},"homepage":"https://github.com/maxzhou0/ts-chain-core#readme","_id":"ts-chain-core@0.0.2-alpha7","_nodeVersion":"18.16.0","_npmVersion":"9.2.0","dist":{"integrity":"sha512-b813SHWGNQ71s7E08SCHR9jR/tZbqwF1R3c2VSjb9aIkI/4q/o07ONq4Q7qwNkPnQq4fuQ7x55/dKxf5WD6Ruw==","shasum":"61e3d7a0657de3fe257e8a81c5a765de5801d62c","tarball":"https://registry.npmjs.org/ts-chain-core/-/ts-chain-core-0.0.2-alpha7.tgz","fileCount":12,"unpackedSize":71861,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCbkgKL7aFDvdP9WySsUFwdnJP7V9l/RRDsiZcR2RIQ+AIgV0GFVnKC3TRQcKhxu+dt0iJo1bMFLgsbmq4JwTbaFQo="}]},"_npmUser":{"name":"luka-fans","email":"maxzhou0@outlook.com"},"directories":{},"maintainers":[{"name":"luka-fans","email":"maxzhou0@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-chain-core_0.0.2-alpha7_1697211036900_0.9623039038243217"},"_hasShrinkwrap":false},"0.0.2-alpha8":{"name":"ts-chain-core","version":"0.0.2-alpha8","type":"module","umd:name":"ts-chain-core","description":"Chainable programming tool for Typescript","unpkg":"dist/index.min.js","module":"dist/index.mjs","main":"dist/index.js","types":"types/index.d.ts","scripts":{"build":"rollup -c","prepublishOnly":"npm run test && npm run build","types":"tsc --noEmit","test":"mocha","pub":"npm publish --registry https://registry.npmjs.org","unpub":"npm unpublish --registry https://registry.npmjs.org  ts-chain-core@0.0.2-alpha7 --force","vl":"npm view ts-chain-core versions --registry https://registry.npmjs.org & npm view ts-chain-core versions"},"exports":{".":{"import":"./dist/index.mjs","require":"./dist/index.js"},"./package.json":"./package.json"},"author":{"name":"Max Zhou","email":"maxzhou0@outlook.com","url":"https://github.com/maxzhou0"},"repository":{"type":"git","url":"git+https://github.com/maxzhou0/ts-chain-core.git"},"keywords":["typescript","chain","functional"],"license":"MIT","devDependencies":{"@types/chai":"^4.3.6","@types/mocha":"^10.0.2","@types/node":"^20.8.0","assert":"^2.1.0","chai":"^4.3.10","mocha":"^10.2.0","ts-node":"^10.9.1","typescript":"^5.2.2","@rollup/plugin-node-resolve":"13.1.3","rollup":"2.66.1","rollup-plugin-terser":"7.0.2","rollup-plugin-typescript2":"0.27.1"},"gitHead":"ef3fc0b0f5533d7d58213c3b823ccd2c89994ec5","bugs":{"url":"https://github.com/maxzhou0/ts-chain-core/issues"},"homepage":"https://github.com/maxzhou0/ts-chain-core#readme","_id":"ts-chain-core@0.0.2-alpha8","_nodeVersion":"18.16.0","_npmVersion":"9.2.0","dist":{"integrity":"sha512-Vzi0GiyJaXEZtnuDh3TZkFGfOWelQJ+GFnkwavSd+iNoFPhG7Rd6AstmsN/8DwFtf5lBJuVmMIfokkjUIet90g==","shasum":"043e9d9124712b55fadf7aa31d3bd592f9b48727","tarball":"https://registry.npmjs.org/ts-chain-core/-/ts-chain-core-0.0.2-alpha8.tgz","fileCount":12,"unpackedSize":71861,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDDGoz4hRtNIhz3AUxd6r7ckPoBnjTcYJSbSEu0UViMDwIhALHwwpjhhflMxNLBQ3N2/oMETCKxuxeFFFlcscEbrg78"}]},"_npmUser":{"name":"luka-fans","email":"maxzhou0@outlook.com"},"directories":{},"maintainers":[{"name":"luka-fans","email":"maxzhou0@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-chain-core_0.0.2-alpha8_1697211536374_0.8129985744586785"},"_hasShrinkwrap":false},"0.0.2-alpha9":{"name":"ts-chain-core","version":"0.0.2-alpha9","type":"module","umd:name":"ts-chain-core","description":"Chainable programming tool for Typescript","unpkg":"dist/index.min.js","module":"dist/index.mjs","main":"dist/index.js","types":"types/index.d.ts","scripts":{"build":"rollup -c","prepublishOnly":"npm run test && npm run build","types":"tsc --noEmit","test":"mocha","pub":"npm publish --registry https://registry.npmjs.org","unpub":"npm unpublish --registry https://registry.npmjs.org  ts-chain-core@0.0.2-alpha9 --force","vl":"npm view ts-chain-core versions --registry https://registry.npmjs.org & npm view ts-chain-core versions"},"exports":{".":{"import":"./dist/index.mjs","require":"./dist/index.js","types":"./types/index.d.ts"},"./package.json":"./package.json"},"author":{"name":"Max Zhou","email":"maxzhou0@outlook.com","url":"https://github.com/maxzhou0"},"repository":{"type":"git","url":"git+https://github.com/maxzhou0/ts-chain-core.git"},"keywords":["typescript","chain","functional"],"license":"MIT","devDependencies":{"@types/chai":"^4.3.6","@types/mocha":"^10.0.2","@types/node":"^20.8.0","assert":"^2.1.0","chai":"^4.3.10","mocha":"^10.2.0","ts-node":"^10.9.1","typescript":"^5.2.2","@rollup/plugin-node-resolve":"13.1.3","rollup":"2.66.1","rollup-plugin-terser":"7.0.2","rollup-plugin-typescript2":"0.27.1"},"gitHead":"fed9ac74778aa93ae05edfb4a3e82c51e006aa77","bugs":{"url":"https://github.com/maxzhou0/ts-chain-core/issues"},"homepage":"https://github.com/maxzhou0/ts-chain-core#readme","_id":"ts-chain-core@0.0.2-alpha9","_nodeVersion":"18.16.0","_npmVersion":"9.2.0","dist":{"integrity":"sha512-CkXDvmPzyVNrEAmPteFnjF0shFb2Jj/OqIOG9lmwL6hLtkyM3gbyLSEQs5d40+j/K6LPVVtKN3zYuJMJqQmmow==","shasum":"07037c747741e443e0487631a2cb36b70323d96e","tarball":"https://registry.npmjs.org/ts-chain-core/-/ts-chain-core-0.0.2-alpha9.tgz","fileCount":12,"unpackedSize":60017,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDBY2fWkv5qmcesRteHXjzv8e3W6bClPxk/YRXwQcME8wIgJpoEvLnMNA9z0MeeMw87lRJz1k6TvH9ODRtTFK0YTT0="}]},"_npmUser":{"name":"luka-fans","email":"maxzhou0@outlook.com"},"directories":{},"maintainers":[{"name":"luka-fans","email":"maxzhou0@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-chain-core_0.0.2-alpha9_1697456047521_0.8229320279366681"},"_hasShrinkwrap":false},"0.0.2-alpha10":{"name":"ts-chain-core","version":"0.0.2-alpha10","type":"module","umd:name":"ts-chain-core","description":"Chainable programming tool for Typescript","unpkg":"dist/index.min.js","module":"dist/index.mjs","main":"dist/index.js","types":"types/index.d.ts","scripts":{"build":"rollup -c","prepublishOnly":"npm run test && npm run build","types":"tsc --noEmit","test":"mocha","pub":"npm publish --registry https://registry.npmjs.org","unpub":"npm unpublish --registry https://registry.npmjs.org  ts-chain-core@0.0.2-alpha10 --force","vl":"npm view ts-chain-core versions --registry https://registry.npmjs.org & npm view ts-chain-core versions"},"exports":{".":{"import":"./dist/index.mjs","require":"./dist/index.js","types":"./types/index.d.ts"},"./package.json":"./package.json"},"author":{"name":"Max Zhou","email":"maxzhou0@outlook.com","url":"https://github.com/maxzhou0"},"repository":{"type":"git","url":"git+https://github.com/maxzhou0/ts-chain-core.git"},"keywords":["typescript","chain","functional"],"license":"MIT","devDependencies":{"@types/chai":"^4.3.6","@types/mocha":"^10.0.2","@types/node":"^20.8.0","assert":"^2.1.0","chai":"^4.3.10","mocha":"^10.2.0","ts-node":"^10.9.1","typescript":"^5.2.2","@rollup/plugin-node-resolve":"13.1.3","rollup":"2.66.1","rollup-plugin-terser":"7.0.2","rollup-plugin-typescript2":"0.27.1"},"gitHead":"7a62997b93d0a90a4d1897e13a50fd26160039c3","bugs":{"url":"https://github.com/maxzhou0/ts-chain-core/issues"},"homepage":"https://github.com/maxzhou0/ts-chain-core#readme","_id":"ts-chain-core@0.0.2-alpha10","_nodeVersion":"18.16.0","_npmVersion":"9.2.0","dist":{"integrity":"sha512-1INssyQLtnLUxFZXd5UwEVSXGc/sAu26SclWQtvH87FqIXZRA5N41Carn8QVJshctyZ8+1sf5ItAAV/uZlKcgQ==","shasum":"78bc14482b2ac6e12169d7b8e175f0481a0410e5","tarball":"https://registry.npmjs.org/ts-chain-core/-/ts-chain-core-0.0.2-alpha10.tgz","fileCount":13,"unpackedSize":76618,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCkKUfigJSQbAxW08p6gvzpvODpKaqw3KneLBuBaeJJVgIhAIy6B1AjUwkDYM/JhJjUvhOW3Ew/kQ6kl6yFQMUMPjNM"}]},"_npmUser":{"name":"luka-fans","email":"maxzhou0@outlook.com"},"directories":{},"maintainers":[{"name":"luka-fans","email":"maxzhou0@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-chain-core_0.0.2-alpha10_1697472190989_0.11277462005625716"},"_hasShrinkwrap":false},"0.0.3-alpha1":{"name":"ts-chain-core","version":"0.0.3-alpha1","type":"module","umd:name":"ts-chain-core","description":"Chainable programming tool for Typescript","unpkg":"dist/index.min.js","module":"dist/index.mjs","main":"dist/index.js","types":"types/index.d.ts","scripts":{"build":"rollup -c","prepublishOnly":"npm run test && npm run build","types":"tsc --noEmit","test":"mocha","pub":"npm publish --registry https://registry.npmjs.org","unpub":"npm unpublish --registry https://registry.npmjs.org  ts-chain-core@0.0.2-alpha10 --force","vl":"npm view ts-chain-core versions --registry https://registry.npmjs.org & npm view ts-chain-core versions"},"exports":{".":{"import":"./dist/index.mjs","require":"./dist/index.js","types":"./types/index.d.ts"},"./package.json":"./package.json"},"author":{"name":"Max Zhou","email":"maxzhou0@outlook.com","url":"https://github.com/maxzhou0"},"repository":{"type":"git","url":"git+https://github.com/maxzhou0/ts-chain-core.git"},"keywords":["typescript","chain","functional"],"license":"MIT","devDependencies":{"@types/chai":"^4.3.6","@types/mocha":"^10.0.2","@types/node":"^20.8.0","assert":"^2.1.0","chai":"^4.3.10","mocha":"^10.2.0","ts-node":"^10.9.1","typescript":"^5.2.2","@rollup/plugin-node-resolve":"13.1.3","rollup":"2.66.1","rollup-plugin-terser":"7.0.2","rollup-plugin-typescript2":"0.27.1"},"gitHead":"ada54a88ff89a0d119a41bdcd4a8fc316f52610e","bugs":{"url":"https://github.com/maxzhou0/ts-chain-core/issues"},"homepage":"https://github.com/maxzhou0/ts-chain-core#readme","_id":"ts-chain-core@0.0.3-alpha1","_nodeVersion":"18.16.0","_npmVersion":"9.2.0","dist":{"integrity":"sha512-Ks8ITtPGU5ACoWCaCyAYQ3wWpsjtbTUY/Sbz5N0SJBncSbfEdVFXB10hEKrNvXAcNEdSiy99ToDk2UcboNdGTA==","shasum":"3900e8591a3677f894b9d1afb9683d2e49b15fd6","tarball":"https://registry.npmjs.org/ts-chain-core/-/ts-chain-core-0.0.3-alpha1.tgz","fileCount":13,"unpackedSize":78969,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDVaI5aWHNW8+S+nODc/yfE0WQB1dW/lr+1+q2gwyHFwgIhAIb0XHqPAh7nO2+6ucPg0ZCnDUgIGrNlEOmU6yqdlVRc"}]},"_npmUser":{"name":"luka-fans","email":"maxzhou0@outlook.com"},"directories":{},"maintainers":[{"name":"luka-fans","email":"maxzhou0@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-chain-core_0.0.3-alpha1_1698406670798_0.029917091063468515"},"_hasShrinkwrap":false},"0.0.3-alpha2":{"name":"ts-chain-core","version":"0.0.3-alpha2","type":"module","umd:name":"ts-chain-core","description":"Chainable programming tool for Typescript","unpkg":"dist/index.min.js","module":"dist/index.mjs","main":"dist/index.js","types":"types/index.d.ts","scripts":{"build":"rollup -c","prepublishOnly":"npm run test && npm run build","types":"tsc --noEmit","test":"mocha","pub":"npm publish --registry https://registry.npmjs.org","unpub":"npm unpublish --registry https://registry.npmjs.org  ts-chain-core@0.0.2-alpha10 --force","vl":"npm view ts-chain-core versions --registry https://registry.npmjs.org & npm view ts-chain-core versions","test1":"npx md-split"},"exports":{".":{"import":"./dist/index.mjs","require":"./dist/index.js","types":"./types/index.d.ts"},"./package.json":"./package.json"},"author":{"name":"Max Zhou","email":"maxzhou0@outlook.com","url":"https://github.com/maxzhou0"},"repository":{"type":"git","url":"git+https://github.com/maxzhou0/ts-chain-core.git"},"keywords":["typescript","chain","functional"],"license":"MIT","devDependencies":{"@rollup/plugin-node-resolve":"13.1.3","@types/chai":"^4.3.6","@types/mocha":"^10.0.2","@types/node":"^20.8.0","assert":"^2.1.0","chai":"^4.3.10","md-split":"^0.0.1-alpha1","mocha":"^10.2.0","rollup":"2.66.1","rollup-plugin-terser":"7.0.2","rollup-plugin-typescript2":"0.27.1","ts-node":"^10.9.1","typescript":"^5.2.2"},"gitHead":"ef2f19c4b64662d7a792deb0ac7846f63b618e07","bugs":{"url":"https://github.com/maxzhou0/ts-chain-core/issues"},"homepage":"https://github.com/maxzhou0/ts-chain-core#readme","_id":"ts-chain-core@0.0.3-alpha2","_nodeVersion":"18.16.0","_npmVersion":"9.2.0","dist":{"integrity":"sha512-erxAHq2V4cesvjKh/XFHCgIEwWTaf7b+Cfj/KwDwtA8tDhS1RdL0WJseGyTzFjfoYcsKfYvI3VDog+2tjSr4FA==","shasum":"837685b96492fbdf8b51ce0f7941b26eeafbf09e","tarball":"https://registry.npmjs.org/ts-chain-core/-/ts-chain-core-0.0.3-alpha2.tgz","fileCount":15,"unpackedSize":80522,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDtxopdcZKVBR8X8y/SVBStI48JmrZufmDpLWnh1gZLAAIgXuZtVBB8zCWldWQH1lNYTfzy4yqO7UMboruFazinod0="}]},"_npmUser":{"name":"luka-fans","email":"maxzhou0@outlook.com"},"directories":{},"maintainers":[{"name":"luka-fans","email":"maxzhou0@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-chain-core_0.0.3-alpha2_1698754194507_0.3412823560214071"},"_hasShrinkwrap":false}},"time":{"created":"2023-10-07T05:34:19.988Z","0.0.1-alpha1":"2023-10-07T05:34:20.192Z","modified":"2023-10-31T12:09:54.852Z","0.0.1-alpha2":"2023-10-07T06:10:29.004Z","0.0.1-alpha3":"2023-10-07T06:18:23.580Z","0.0.1-alpha4":"2023-10-07T07:05:18.826Z","0.0.1-alpha5":"2023-10-07T08:50:53.130Z","0.0.1-alpha6":"2023-10-07T12:45:31.332Z","0.0.1-alpha7":"2023-10-07T12:47:37.652Z","0.0.1-alpha8":"2023-10-07T15:11:12.154Z","0.0.1-alpha10":"2023-10-08T15:50:28.355Z","0.0.1-alpha11":"2023-10-08T16:19:47.771Z","0.0.1-alpha12":"2023-10-10T14:57:21.499Z","0.0.1-alpha13":"2023-10-10T14:58:29.343Z","0.0.1-alpha14":"2023-10-10T14:59:38.565Z","0.0.1-alpha15":"2023-10-12T15:01:23.501Z","0.0.1-alpha16":"2023-10-12T15:06:52.674Z","0.0.2-alpha1":"2023-10-12T15:08:07.342Z","0.0.2-alpha2":"2023-10-12T15:10:33.226Z","0.0.2-alpha3":"2023-10-12T15:19:07.492Z","0.0.2-alpha4":"2023-10-12T15:21:07.235Z","0.0.2-alpha7":"2023-10-13T15:30:37.095Z","0.0.2-alpha8":"2023-10-13T15:38:56.624Z","0.0.2-alpha9":"2023-10-16T11:34:07.794Z","0.0.2-alpha10":"2023-10-16T16:03:11.191Z","0.0.3-alpha1":"2023-10-27T11:37:51.041Z","0.0.3-alpha2":"2023-10-31T12:09:54.691Z"},"maintainers":[{"name":"luka-fans","email":"maxzhou0@outlook.com"}],"description":"Chainable programming tool for Typescript","homepage":"https://github.com/maxzhou0/ts-chain-core#readme","keywords":["typescript","chain","functional"],"repository":{"type":"git","url":"git+https://github.com/maxzhou0/ts-chain-core.git"},"author":{"name":"Max Zhou","email":"maxzhou0@outlook.com","url":"https://github.com/maxzhou0"},"bugs":{"url":"https://github.com/maxzhou0/ts-chain-core/issues"},"license":"MIT","readme":"<p align=\"center\">\r\n  <img src=\"./docs/img/title.png\" style=\"transition: all 2.5s ease;\" onmouseover=\"this.style.filter='hue-rotate(-80deg)'\"  onmouseout=\"this.style.filter=''\" width=\"400\" />\r\n</p>\r\n<p align='center'>\r\n  English |  <a style=\"color:#D437B5;transition: all 0.5s ease;\" onmouseover=\"this.style.color='#0069D3'\"\r\n    onmouseout=\"this.style.color='#D437B5'\"  href='./README.en.md'> 简体中文 </a> \r\n</p>\r\n\r\n\r\n# ts-chain-core\r\n\r\nThis is a basic library for TypeScript chain programming. It can be used to build anything from simple tools to comprehensive toolkits.\r\n\r\n### Features\r\n\r\n- Enables chain programming with minimal code\r\n- Saves code: tools built using this library can reduce actual code by half or more in some cases\r\n-  **💥💥Auto Interface Completion **  Interfaces you write will automatically appear in your code as you type! Below is an actual demonstration (using vscode, no special plugins)\r\n![image](./docs/img/screenshot-1.gif)\r\n- **🌈Easy to use** You only need to master three core APIs to create chain interfaces that meet most needs.\r\n- **🚀Compact** The program itself is only `3kb` in size after compression.\r\n\r\n\r\n### Quick Start\r\n\r\n#### Installation\r\n\r\n```shell\r\nnpm i ts-chain-core\r\n```\r\n#### Basic Usage\r\n\r\n```ts\r\nimport { ChainCore } from \"ts-chain-core\";\r\n\r\nChainCore(null)\r\n    .setFunction((name: string) => {\r\n        console.log(`hello,${name}`);\r\n    })\r\n    ('🍉')\r\n    ('🍍')\r\n    ('🥭')\r\n```\r\n\r\n### 🔗Turning Class Methods into Chainable Methods\r\n\r\n```ts\r\nclass Example {\r\n    toChain(){\r\n        return ChainCore(this).extendFunctionsFromObject(Example)\r\n    }\r\n    add(a:number,b:number){\r\n        console.log(a+b)\r\n    }\r\n    addOne(a:number){\r\n        return (b:number)=>{\r\n            console.log(a+b)\r\n        }\r\n    }\r\n    addEnd(a:number,b:number){\r\n        return a+b;\r\n    }\r\n}\r\n\r\nnew Example().toChain()\r\n    .add(3,5)   //8\r\n    .add(4,7)   //11\r\n    .addOne(4)  \r\n        (5)     //9\r\n        (6)     //10\r\n        (7)     //11\r\n    .addEnd(11,10)  //chain ended here\r\n    .add(42,1)  //❌error, chain function break\r\n```\r\n\r\n\r\nWhen extending the library, different chainable methods will be generated based on the return type of the methods.\r\n| Return Types | `undefined / void` | `function` | other types |\r\n| --- | --- | --- | -- |\r\n| modify the `()` operation | No | set function to `()` operation | No |\r\n| terminate the chain | No | No | No |\r\n\r\nBut the `()` operation does not change `()` operation itself regardless of its return type.\r\n\r\n### 🔗Extending Instance Methods\r\n\r\nIn the process of extending methods, you may need to call methods that have already been extended by `ChainCore` or methods that are inherent to `ChainCore`. In such methods, you need to add a reference to `ChainCore` instance in the entry parameters.\r\n`ts-chain-core` provides a method for extending these methods and automatically passing in the `ChainCore` instance when the method is called. We refer to these methods as **instance methods**.\r\n\r\nExample of Extending Methods\r\n\r\n\r\n```ts\r\nChainCore(null).extendFunctionsFromObject({\r\n    sayHello: (name: string) => {\r\n        console.log(`hello,${name}`);\r\n    },\r\n}).extendInstanceFunctions({\r\n    /**\r\n     * play a scenario\r\n     * @param ch passed by `ChainCore` and reference to itself\r\n     * @param time \r\n     * @param place \r\n     * @param to \r\n     */\r\n    play(ch,time:string,place:string,to:string){\r\n        console.log(`This is ${time},${place}`);\r\n        ch.sayHello(to)\r\n    }\r\n}).play('morning','garden','🍓')\r\n```\r\n\r\nWhen extending `instance methods`, the first entry parameter should be reserved for `ts-chain-core`. It does not need to be annotated with a type, and does not have to be passed in when called.\r\n\r\n#### Callbacks in Extended Methods\r\n\r\nIn extended methods, you may need to access `ChainCore` methods inside callbacks. Below is a different implementation of the previous example:\r\n\r\n```ts\r\nChainCore(null).extendFunctionsFromObject({\r\n    sayHello: (name: string) => {\r\n        console.log(`hello,${name}`);\r\n    },\r\n}).extendInstanceFunctions({\r\n    /**\r\n     * play a scenario\r\n     * @param ch passed by `ChainCore` and reference to itself\r\n     * @param fn play anything you wanted in this function\r\n     */\r\n    play(ch,fn:(ch:CurrentStateChainRef)=>void){\r\n        fn.apply(null,[ch]);\r\n    }\r\n}).play((ch)=>{\r\n    console.log(`This is morning,garden`);\r\n    ch.sayHello('🍓')\r\n})        \r\n```\r\nThe first parameter in the callback function should be annotated with the `CurrentStateChainRef` type. When called, the passed-in `ChainCore` instance will automatically receive code hints for previously extended methods.\r\n\r\n`Instance methods` can also have the `()` operation set, and callbacks can use it to access the `ChainCore` instance.\r\n\r\n```ts\r\nChainCore(null).extendFunctionsFromObject({\r\n    sayHello: (name: string) => {\r\n        console.log(`hello,${name}`);\r\n    },\r\n}).extendInstanceFunctions({\r\n    play(ch){\r\n        return (fn:(ch:CurrentStateChainRef,time:string,place:string,to:string)=>void,time:string,place:string,to:string)=>{\r\n            fn.apply(null,[ch,time,place,to]);\r\n        }\r\n    }\r\n}).play()((ch,time,place,to)=>{\r\n    console.log(`This is ${time},${place}`);\r\n    ch.sayHello(to)\r\n},'morning','garden','🍓');\r\n```\r\n\r\n**Attention** 📢📢 *It is important to note that the `ChainCore` instance in the callback function is passed in by the extended method itself. You do not need to pass the `ChainCore` instance as the first parameter, but it is convention to annotate the type of the first parameter as `CurrentStateChainRef` so that it is properly recognized as the `ChainCore` type.*\r\n\r\n\r\n\r\n##### 📑Type Remapping\r\n\r\n`ts-chain-core` uses type remapping to achieve automatic type conversions for convenient auto-completion features. `CurrentStateChainRef` is one example of this. More examples will be discussed later.\r\n\r\nHowever, there are limitations to this technique. Firstly, due to restrictions in `TypeScript`, it is not practical to automate type conversions for all parameters. To strike a balance between usability and computational overhead, this feature currently only supports the automatic conversion of the return type and the first four parameters. In the majority of cases, this is sufficient.\r\n\r\nAdditionally, remapping does not support generic mappings. However, ts-chain-core provides a solution for this, which will be discussed later.\r\n\r\n\r\n\r\n##### 🔍Declaring ChainCore Types\r\n\r\nSince `ChainCore` is a complex type, there may be situations where you need to declare the `ChainCore` type with certain methods extended. In most cases, directly writing the `ChainCore` type is not recommended due to its complexity. Instead, it is recommended to use type inference to declare the type.\r\n\r\n```ts\r\n//Declaration Example\r\nfunction chainFactory(){\r\n    return ChainCore(null).extendFunctionsFromObject({\r\n                sayHello: (name: string) => {\r\n                    console.log(`hello,${name}`);\r\n                },\r\n                //some other functions\r\n            })\r\n}\r\n\r\ntype MyChainType = ReturnType<typeof chainFactory>;\r\n\r\nfunction myFunction(ch:MyChainType){\r\n    ch.sayHello('')\r\n}\r\n```\r\n\r\n\r\n\r\n#### 🔍`thisArg`\r\n\r\n`thisArg` is a built-in variable in `ChainCore` that is used to set the `this` value in the running methods.\r\n\r\nIt can be passed through `ChainCore()`, or accessed and modified during runtime using `getThis() `and `setThis()`.\r\n\r\n#### `arguments cache`\r\n\r\nTo avoid repetitive input, `ChainCore` caches the arguments from the previous call at runtime. If no arguments are passed or if `undefined` is passed, `ChainCore` will use the values from the previous call as substitutes.\r\n\r\n```ts\r\nUIKit(this)\r\n    .show()\r\n        ('myUsernameEditor',props.mode==='edit')  //show these controls when user need edit\r\n        ('myAddressEditor')\r\n        ('myEmailEditor')\r\n        ('myPhotoEditBtn')\r\n        ('myUsernameLabel',props.mode==='view')  //show these controls when just read\r\n        ('myAddressLabel')\r\n        ('myEmailLabel')\r\n```\r\n\r\nIn most cases, this feature is helpful. However, in some situations, it may lead to confusing results and mistakenly be seen as a bug in the program.\r\n\r\n```ts\r\nChainCore(null)\r\n    .extendInstanceFunctions({\r\n        log(ch,...args:any){\r\n        console.log(...args)\r\n        }\r\n    })\r\n    //confused output\r\n    .log('a','b','c')                 // stdout: a b c\r\n    .log('d')                         // stdout: d b c  \r\n    .log(undefined,'e',undefined)     // stdout: d e c\r\n```\r\n`ts-chain-core` provides the `clearArgCache()` method to clear the cache from the previous call. \r\n\r\n```ts\r\n//proper version\r\nChainCore(null)\r\n    .extendInstanceFunctions({\r\n        log(ch,...args:any){\r\n        ch.clearArgCache();\r\n        console.log(...args)\r\n        }\r\n    })\r\n    .log('a','b','c')                 // stdout: a b c\r\n    .log('d')                         // stdout: d \r\n    .log(undefined,'e',undefined)     // stdout:  e \r\n```\r\n\r\nYou can also call it to clear potential memory leaks.\r\n\r\n```ts\r\nconst persistChainInstance =  ChainCore(null)\r\n    .extendInstanceFunctions({\r\n        on(ch,obj:any,eventName:string,fun:Function){\r\n            ch.clearArgCache(); //prevent fun be cached\r\n            obj.addEventListener(eventName,fun)\r\n        }\r\n    })\r\n\r\n```\r\n\r\n#### Batch Operations\r\n\r\n`ts-chain-core` provides two methods for batch `()`operations.\r\n\r\n```ts\r\nChainCore(null)\r\n    .setFunction((m: number, n?: number) => {\r\n        console.log(Math.pow(m, n || 0));\r\n    })\r\n    .batch([3, 4], [1, 2], [5, 6], [1], [2], [3]);\r\n\r\nChainCore(null)\r\n    .setFunction((m: number, n?: number) => {\r\n        console.log(Math.pow(m, n || 0));\r\n    })\r\n    .zipBatch([1, 2, 3, 4, 5, 6], [2]);\r\n    //equal to \r\n    .batch([1,2],[2],[3],[4],[5],[6]);\r\n\r\n```\r\nBatch operations still follow the argument caching rules.\r\n\r\n### 🔗Extending the Runtime\r\n\r\nIn addition to `thisArg` and the `arguments cache`, the runtime of `ChainCore` can be extended by the user. The extended properties can be accessed through the runtime interface.\r\n\r\n```ts\r\nconst ch = ChainCore(null)\r\n    .extendRuntime<{value:string}>()  //extend a field names `value`\r\n    .extendInstanceFunctions({\r\n        setValue(ch,value:string){\r\n            ch.runtime.value = value;   //write to value\r\n        },\r\n        getValue(ch){\r\n            return ch.runtime.value;   //access value\r\n        }\r\n    });\r\nconst result = ch.setValue('hello').getValue();\r\nconsole.log(result) //hello\r\n```\r\n\r\nHere is an simple example that mimics `JQuery`.\r\n\r\n```ts\r\nimport { ChainCore, CurrentStateChainRef } from \"ts-chain-core\";\r\n\r\ntype QueryType = string | Document | HTMLElement | EventTarget | null;\r\n\r\nconst getQuery = (q: QueryType) => {\r\n  if (q === null || q === undefined) return document.body;\r\n  if (typeof q === \"string\") {\r\n    return document.querySelector(q) as HTMLElement;\r\n  } else return q as HTMLElement;\r\n};\r\nconst $ = (q: QueryType) => {\r\n\r\n  return ChainCore(null)\r\n    .extendRuntime<{ dom: HTMLElement }>()\r\n    .extendInstanceFunctions({\r\n      ready(ch, fn: () => void) {\r\n        ch.runtime.dom.addEventListener(\"DOMContentLoaded\", fn);\r\n      },\r\n      click(ch, fn: (ch: CurrentStateChainRef, event: MouseEvent) => void) {\r\n        ch.runtime.dom.onclick = (event: MouseEvent) => fn(ch, event);\r\n      },\r\n      addClass(ch, className: string) {\r\n        ch.runtime.dom.classList.add(className);\r\n      },\r\n      removeClass(ch, className: string) {\r\n        ch.runtime.dom.classList.remove(className);\r\n      },\r\n      show(ch) {\r\n        ch.runtime.dom.style.display = \"\";\r\n      },\r\n      hide(ch) {\r\n        ch.runtime.dom.style.display = \"none\";\r\n      },\r\n      text(ch, str: any) {\r\n        ch.runtime.dom.textContent = str;\r\n      },\r\n      query(ch, q: QueryType) {\r\n        ch.runtime.dom = getQuery(q);\r\n      },\r\n    })\r\n    .query(q);\r\n};\r\n\r\n$(document).ready(() => {\r\n  $(\".button\")\r\n    .extendRuntime({\r\n      clicked: false,\r\n    })\r\n    .click((ch, event) => {\r\n      ch.runtime.clicked = !ch.runtime.clicked;\r\n      if (ch.runtime.clicked) {\r\n        $(event.currentTarget)\r\n          .addClass(\"clicked\")\r\n          .query(\"h2\")\r\n          .hide()\r\n          .query(\"h1\")\r\n          .text(\"Hello, Chain!\")\r\n          .show();\r\n      } else {\r\n        $(event.currentTarget)\r\n          .removeClass(\"clicked\")\r\n          .query(\"h2\")\r\n          .show()\r\n          .query(\"h1\")\r\n          .hide();\r\n      }\r\n    });\r\n});\r\n```\r\nYou can [try running it on the web](https://codesandbox.io/p/github/maxzhou0/ts-chain-core-web-demo/main?file=%2Fsrc%2Fmain.ts)\r\n\r\n#### 🚀Dynamically Modifying and Referencing Runtime Type\r\n\r\nIn some applications, it is not possible to predict the exact type of data in advance. For example, if you are creating a function library that operates on arrays, you cannot specify the exact type when defining the methods. This requires dynamic adjustment of generic parameters, which is currently not supported in `TypeScript`. `ts-chain-core` provides the `ReferTo<>` type to reference runtime types and the `ChangeChainRuntime<,>` type to dynamically modify runtime types.\r\n\r\n```ts\r\n\r\nconst ch = ChainCore(null)\r\n    .extendRuntime<{group:any[]}>()\r\n    .extendInstanceFunctions({\r\n        /**\r\n         * \r\n         * @param ch \r\n         * @param value ReferTo<'<0>'> which means use the first generic type as input type\r\n         * @returns ChangeChainRuntime<'group','<0>'> means change runtime `group' type to first generic type\r\n         */\r\n        group(ch,value:ReferTo<'<0>'>):ChangeChainRuntime<'group','<0>'>{\r\n            ch.runtime.group = value;\r\n            return ChangeRuntimeReturn();  //call this function to actually change runtime type\r\n        },\r\n        setToIndex(ch,value:ReferTo<'group[number]'>,index:number){\r\n            ch.runtime.group[index] = value;\r\n        },\r\n        each(ch,fn:(item:ReferTo<'group[number]'>,index?:number)=>void){\r\n            ch.runtime.group.forEach(fn);\r\n        }\r\n    });\r\nch.group([0,1,2,3]) //group<number[]> will change  setToIndex and each's function parameter type to number\r\n    .setToIndex(42,0)\r\n    //.setToIndex('42',0)  ❌error,'42' doesn't match type number\r\n    .each((item,index)=>{\r\n        console.log(index,item)\r\n    })  //output : 42,1,2,3\r\n\r\n```\r\n\r\nYou may have noticed that every extension method in `ts-chain-core` is actually a generic method with four type parameters. You can use `ReferTo<'<0>'>`, `ReferTo<'<1>'>`, `ReferTo<'<2>'>`, and `ReferTo<'<3>'>` to dynamically modify types, and use `ChangeChainRuntime<,>` to modify runtime type parameters.\r\n\r\n##### 🚀`ReferTo<>`Syntax\r\n\r\nReferTo<`T[]`> means it is an array type of type `T`.\r\nReferTo<`T[number]`> means it is an array element type of type `T`. (*Note: `T` must be an array type, or you will get a type error.*)\r\nYou can also use the path symbol `::` to represent the type of a property in a complex type.\r\nHere is an example (*this is just for demonstration purposes and does not necessarily mean you need to use `ReferTo<>` to refer to a type, unless it's a type that needs to be expressed using generics*).\r\n\r\n```ts\r\nChainCore(null).extendRuntime<{\r\n        actor:{\r\n            name:string,\r\n            birthDate:Date,\r\n            movie:{\r\n                title:string,\r\n                year:number,\r\n                genre:[{id:number,key:string,name:string}]\r\n            }[]\r\n        }\r\n    }>()\r\n    .setFunction((input:ReferTo<'actor::movie[number]::genre[number]'>)=>{\r\n        console.log((input as any).name)\r\n    })\r\n    ({id:1,key:'comedy',name:'comedy'})\r\n```\r\n\r\n##### 🚀 `Combining Multiple Extension Types`\r\n\r\nUse `ReMapTo<>` to combine the types of multiple extension runtime attributes into a new type.\r\n```ts\r\nconst v = ChainCore(null)\r\n    .extendRuntime<{name:string,age:number}>()\r\n    .extendInstanceFunctions({\r\n        setPerson(ch,values:ReMapTo<'name'|'age'>){\r\n            ch.runtime.age = (values as any).age;\r\n            ch.runtime.name = (values as any).name;\r\n        },\r\n        getPerson(ch):ReMapTo<'name'|'age'>{\r\n            return {...ch.runtime} as any;\r\n        }\r\n    })\r\n    .setPerson({name:'Amy',age:42})\r\n    .getPerson().name;\r\nconsole.log(v) //Amy\r\n```","readmeFilename":"README.en.md"}