Skip to content

Commit

Permalink
chore: minor code imprs (#924)
Browse files Browse the repository at this point in the history
* build: replace fx with node

* chore: shrink a few bytes

* ci: remove redundand script
  • Loading branch information
antongolub authored Oct 30, 2024
1 parent 7ffb44e commit 2f8066c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 23 deletions.
11 changes: 0 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@
"test:smoke:win32": "node ./test/smoke/win32.test.js",
"test:smoke:cjs": "node ./test/smoke/node.test.cjs",
"test:smoke:mjs": "node ./test/smoke/node.test.mjs",
"test:smoke:deno": "deno test ./test/smoke/deno.test.js --allow-read --allow-sys --allow-env --allow-run",
"version": "cat package.json | fx .version"
"test:smoke:deno": "deno test ./test/smoke/deno.test.js --allow-read --allow-sys --allow-env --allow-run"
},
"optionalDependencies": {
"@types/fs-extra": ">=11",
Expand Down Expand Up @@ -113,7 +112,6 @@
"esbuild-plugin-transform-hook": "^0.1.1",
"esbuild-plugin-utils": "^0.1.0",
"fs-extra": "^11.2.0",
"fx": "*",
"globby": "^14.0.2",
"madge": "^8.0.0",
"minimist": "^1.2.8",
Expand Down
17 changes: 8 additions & 9 deletions src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -544,16 +544,15 @@ export class ProcessPromise extends Promise<ProcessOutput> {
.once('finish', () => _res(res()))
)
}
if (key === 'pipe') {
const pipe = Reflect.get(target, key)
if (typeof pipe === 'function')
return function (...args: any) {
return ProcessPromise.promisifyStream(
pipe.apply(target, args) as S
)
}
const value = Reflect.get(target, key)
if (key === 'pipe' && typeof value === 'function') {
return function (...args: any) {
return ProcessPromise.promisifyStream(
value.apply(target, args) as S
)
}
}
return Reflect.get(target, key)
return value
},
})
}
Expand Down

0 comments on commit 2f8066c

Please sign in to comment.