{"_id":"@alfyn/pipeline","_rev":"1-9207ea07173b52143881e6246aecfbd5","name":"@alfyn/pipeline","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.1":{"name":"@alfyn/pipeline","version":"1.0.1","keywords":["Functional programming","pipeline"],"author":{"url":"https://github.com/alfyn719","name":"alfyn719","email":"zyk1191894890@gmail.com"},"license":"ISC","_id":"@alfyn/pipeline@1.0.1","maintainers":[{"name":"alfyn719","email":"zyk1191894890@gmail.com"}],"homepage":"https://github.com/alfyn719/designer/tree/master/packages/pipeline","bugs":{"url":"https://github.com/alfyn719/designer/issues"},"dist":{"shasum":"e94f1ae322e5eb6375fde89156f0a316707002a7","tarball":"https://registry.npmjs.org/@alfyn/pipeline/-/pipeline-1.0.1.tgz","fileCount":7,"integrity":"sha512-Sx31EwJaJBhY+AvHSJ4VjNJVJZwkQ4LQ3Ag4K562BY2qMgJ2ubRED2Y/4cKCdI1EV+TTu39Z2EMZDZfBsckoug==","signatures":[{"sig":"MEQCIHoeYCFigdtr2P6bNUuePV8QwsKW9ApveDi5jfElE5hAAiA+1eHYs0W5zApUh2P2ZXIPYIQT9SlYN5yf5/CDOIctRw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9730},"main":"./dist/index.umd.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":"./dist/index.js","require":"./dist/index.umd.cjs"}},"gitHead":"22821822eab15d61dbe85a4dbea8f3b2fab99a45","private":false,"scripts":{"build":"vite build"},"_npmUser":{"name":"alfyn719","email":"zyk1191894890@gmail.com"},"repository":{"url":"git+https://github.com/alfyn719/designer.git#master","type":"git"},"_npmVersion":"10.9.0","description":"有助于实践函数式编程范式的工具函数。","directories":{},"_nodeVersion":"22.12.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^6.0.6","vite-plugin-dts":"^4.4.0"},"_npmOperationalInternal":{"tmp":"tmp/pipeline_1.0.1_1736133177254_0.22017232857244995","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@alfyn/pipeline","type":"module","version":"1.0.2","private":false,"author":{"name":"alfyn719","email":"zyk1191894890@gmail.com","url":"https://github.com/alfyn719"},"license":"ISC","homepage":"https://github.com/alfyn719/designer/tree/master/packages/pipeline","repository":{"type":"git","url":"git+https://github.com/alfyn719/designer.git#master"},"keywords":["Functional programming","pipeline"],"exports":{".":{"import":"./dist/index.js","require":"./dist/index.umd.cjs"}},"main":"./dist/index.umd.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","scripts":{"build":"vite build"},"devDependencies":{"vite":"^6.0.6","vite-plugin-dts":"^4.4.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_id":"@alfyn/pipeline@1.0.2","gitHead":"22821822eab15d61dbe85a4dbea8f3b2fab99a45","description":"有助于实践函数式编程范式的工具函数。","bugs":{"url":"https://github.com/alfyn719/designer/issues"},"_nodeVersion":"22.12.0","_npmVersion":"10.9.0","dist":{"integrity":"sha512-V1XLswasLJJXE/Fhk1JTteAtwxoRUXc3VRpYn1KbZycI90X4GSZ8VNlRm1wL4948OCvlVYIuYNv45PLf38GLLA==","shasum":"8e7dd7c8dde2f335deb08c8cbf78c978af90ea6c","tarball":"https://registry.npmjs.org/@alfyn/pipeline/-/pipeline-1.0.2.tgz","fileCount":7,"unpackedSize":9730,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCEgOMZozga9y3d9yVLhaBvCVb6zYzfP4T3UBFmZfo93AIhAK3nFxJW3tuzYNa7GKbnYWPKs/xAQmgAS24steFTXL5i"}]},"_npmUser":{"name":"alfyn719","email":"zyk1191894890@gmail.com"},"directories":{},"maintainers":[{"name":"alfyn719","email":"zyk1191894890@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pipeline_1.0.2_1736133926337_0.33555927812298125"},"_hasShrinkwrap":false}},"time":{"created":"2025-01-06T03:12:57.140Z","modified":"2025-01-06T03:25:26.725Z","1.0.1":"2025-01-06T03:12:57.410Z","1.0.2":"2025-01-06T03:25:26.514Z"},"bugs":{"url":"https://github.com/alfyn719/designer/issues"},"author":{"name":"alfyn719","email":"zyk1191894890@gmail.com","url":"https://github.com/alfyn719"},"license":"ISC","homepage":"https://github.com/alfyn719/designer/tree/master/packages/pipeline","keywords":["Functional programming","pipeline"],"repository":{"type":"git","url":"git+https://github.com/alfyn719/designer.git#master"},"description":"有助于实践函数式编程范式的工具函数。","maintainers":[{"name":"alfyn719","email":"zyk1191894890@gmail.com"}],"readme":"### 介绍\n\n有助于实践函数式编程范式的工具函数。\n\n核心思想是 haoel 的课件示例，代码功能如下：\n\n```javascript\nconst fnA = x => x + 1\nconst fnB = x => x + 2\nconst fnC = x => x + 3\n\nconst fns = [fnA, fnB, fnC]\n\nconst init = 1\n\nconst result = fns.reduce((acc, fn) => fn(acc), init)\n\nconsole.log('result is:', result)\n```\n\n在上面的基础上增加：\n\n1. 支持下钻；\n2. 支持异步；\n3. 连续异步下钻时，使用 `Promise.allSettled + map` 做了并行执行；\n4. 做了柯里化，方便在 `control` 代码中使用;\n\n### `pipeline` 示例一：\n\n```javascript\nimport pipeline from '@designer/pipeline'\n\nconst fnA = x => x + 1\nconst fnB = x => x + 2\nconst fnC = x => x + 3\n\nconst init = 1\n\nconst result = pipeline([fnC, fnB, fnA], init)\n\nconsole.log('result is:', result)\n```\n\n### `pipeline` 示例二：下钻（异步语法相同）\n\n```javascript\nimport pipeline /* , { asyncPipeline } */ from '@designer/pipeline'\n\nconst fnA = x => x + 1\nconst fnB = x => x + 2\nconst fnC = x => x + 3\nconst fnD = (x) => {\n  x.name = x.name.toUpperCase()\n\n  return x\n}\n\nconst init = {\n  money: 1,\n  age: 17,\n  height: 177,\n  name: '',\n}\n\nconst result = pipeline(\n  [\n    fnD,\n    [['money'], [fnB, fnA]],\n    [['age'], [fnC, fnB]],\n    [['height'], [fnC, fnB, fnA]]\n  ],\n  init\n)\n\nconsole.log('result is:', result)\n```\n","readmeFilename":"README.md"}