Skip to content

Commit

Permalink
style(xsnap): Simplify type signatures
Browse files Browse the repository at this point in the history
  • Loading branch information
gibson042 committed Feb 11, 2025
1 parent 54fbc1f commit c981c22
Showing 1 changed file with 8 additions and 22 deletions.
30 changes: 8 additions & 22 deletions packages/xsnap/src/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,7 @@ const showEnv = async (submodules, { spawn, stdout }) => {
/**
* @param {SubmoduleDescriptor[]} submodules
* @param {{
* fs: {
* existsSync: typeof import('fs').existsSync,
* rmdirSync: typeof import('fs').rmdirSync,
* readFile: typeof import('fs').promises.readFile,
* },
* fs: Pick<typeof import('fs'), 'existsSync' | 'rmdirSync'>,
* spawn: typeof import('child_process').spawn,
* }} io
*/
Expand Down Expand Up @@ -235,12 +231,8 @@ const updateSubmodules = async (submodules, { fs, spawn }) => {
* @param {ModdablePlatform} platform
* @param {boolean} force
* @param {{
* fs: {
* existsSync: typeof import('fs').existsSync,
* rmdirSync: typeof import('fs').rmdirSync,
* readFile: typeof import('fs').promises.readFile,
* writeFile: typeof import('fs').promises.writeFile,
* },
* fs: Pick<typeof import('fs'), 'existsSync'> &
* Pick<typeof import('fs').promises, 'readFile' | 'writeFile'>,
* spawn: typeof import('child_process').spawn,
* }} io
*/
Expand Down Expand Up @@ -289,15 +281,9 @@ const buildXsnap = async (platform, force, { fs, spawn }) => {
* env: Record<string, string | undefined>,
* stdout: typeof process.stdout,
* spawn: typeof import('child_process').spawn,
* fs: {
* existsSync: typeof import('fs').existsSync,
* rmdirSync: typeof import('fs').rmdirSync,
* readFile: typeof import('fs').promises.readFile,
* writeFile: typeof import('fs').promises.writeFile,
* },
* os: {
* type: typeof import('os').type,
* }
* fs: Pick<typeof import('fs'), 'existsSync' | 'rmdirSync'> &
* Pick<typeof import('fs').promises, 'readFile' | 'writeFile'>,
* os: Pick<typeof import('os'), 'type'>,
* }} io
*/
async function main(args, { env, stdout, spawn, fs, os }) {
Expand Down Expand Up @@ -383,10 +369,10 @@ const run = () =>
stdout: process.stdout,
spawn: childProcessTop.spawn,
fs: {
readFile: fsTop.promises.readFile,
writeFile: fsTop.promises.writeFile,
existsSync: fsTop.existsSync,
rmdirSync: fsTop.rmdirSync,
readFile: fsTop.promises.readFile,
writeFile: fsTop.promises.writeFile,
},
os: {
type: osTop.type,
Expand Down

0 comments on commit c981c22

Please sign in to comment.