Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: use better type #471

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/node/src/utils/index.ts
Expand Up @@ -9,11 +9,11 @@ export function arraify<T>(value: T | T[]): T[] {
return Array.isArray(value) ? value : [value]
}

export function unimplemented(info?: string): never {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

never would actually be the correct type for this function.

It doesn't ever return a value since it always throws in every condition.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This.

export function unimplemented(info?: string): Error {
if (info) {
throw new Error(`unimplemented: ${info}`)
}
throw new Error('unimplemented')
}

export function noop(..._args: any[]) {}
export function noop(..._args: any[]) { }
2 changes: 1 addition & 1 deletion scripts/build-node-binding.mjs
Expand Up @@ -5,7 +5,7 @@ import watcher from '@parcel/watcher'
import path from 'node:path'
import crypto from 'crypto'
import fs from 'node:fs'
import fsp from 'fs/promises'
import fsp from 'node:fs/promises'
import debug from 'debug'
import chalk from 'chalk'
import { fileURLToPath } from 'node:url'
Expand Down