Skip to content

Commit

Permalink
chore: Updated dependencies.
Browse files Browse the repository at this point in the history
  • Loading branch information
ShogunPanda committed Dec 20, 2023
1 parent eccb509 commit db97ddf
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 17 deletions.
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,20 @@
"split2": "^4.2.0"
},
"devDependencies": {
"@cowtech/eslint-config": "^8.10.0",
"@swc/cli": "^0.1.62",
"@swc/core": "^1.3.94",
"@types/node": "^20.8.7",
"@types/pump": "^1.1.2",
"@types/split2": "^4.2.2",
"@types/tap": "^15.0.10",
"@cowtech/eslint-config": "^9.0.0",
"@swc/cli": "^0.1.63",
"@swc/core": "^1.3.101",
"@types/node": "^20.10.5",
"@types/pump": "^1.1.3",
"@types/split2": "^4.2.3",
"@types/tap": "^15.0.11",
"c8": "^8.0.1",
"chokidar": "^3.5.3",
"concurrently": "^8.2.2",
"prettier": "^3.0.3",
"tap": "^18.5.2",
"ts-node": "^10.9.1",
"typescript": "^5.2.2"
"prettier": "^3.1.1",
"tap": "^18.6.1",
"ts-node": "^10.9.2",
"typescript": "^5.3.3"
},
"engines": {
"node": ">= 18.18.0"
Expand Down
9 changes: 5 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ function parseOptionAsync(promises: Promise<void>[], fn: (...args: any[]) => Pro
const [promise, resolve, reject] = createPromiseForCallbacks()

promises.push(promise)
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
fn(...args)
.then(resolve)
.catch(reject)
Expand Down Expand Up @@ -41,7 +42,7 @@ export async function processData(
contents += chunk.toString(encoding)
}
} catch (error) {
handleError(error, input)
handleError(error as Error, input)
}

return executeCommands(contents, 0, commands)
Expand Down Expand Up @@ -77,7 +78,7 @@ export async function processData(
// Start processing
pipe.resume()
}).catch(error => {
handleError(error, input)
handleError(error as Error, input)
})
}

Expand Down Expand Up @@ -126,8 +127,8 @@ export async function execute(args: string[], { version, description }: PackageI
const { input, encoding, whole } = cli.opts()

try {
await processData(input, encoding, whole, commands)
await processData(input as string, encoding as BufferEncoding, whole as boolean, commands)
} catch (error) {
handleError(error, input, true)
handleError(error as Error, input as string, true)
}
}
4 changes: 2 additions & 2 deletions test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import { readFileSync } from 'node:fs'
import t from 'tap'
import { execute, processData } from '../src/index.js'
import { NSedError } from '../src/models.js'
import { NSedError, type PackageInfo } from '../src/models.js'
import { requireModule } from '../src/operations.js'

const packageInfo = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8'))
const packageInfo: PackageInfo = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8'))
const dataFile = new URL('fixtures/data.txt', import.meta.url).toString().replace('file://', '')

t.test('NSed execution', async t => {
Expand Down

0 comments on commit db97ddf

Please sign in to comment.