feat: use @optolith/helpers package
This commit is contained in:
Generated
+12
@@ -9,6 +9,7 @@
|
||||
"version": "0.10.7",
|
||||
"license": "MPL-2.0",
|
||||
"dependencies": {
|
||||
"@optolith/helpers": "^0.2.1",
|
||||
"typescript": "^5.2.2"
|
||||
},
|
||||
"bin": {
|
||||
@@ -513,6 +514,12 @@
|
||||
"url": "https://github.com/chalk/wrap-ansi?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/@optolith/helpers": {
|
||||
"version": "0.2.1",
|
||||
"resolved": "https://registry.npmjs.org/@optolith/helpers/-/helpers-0.2.1.tgz",
|
||||
"integrity": "sha512-i2mg5ro2XaY0sFT3vwW+BBuMYVuJpHRMt27X9/sBfXmgY6L16aKG3UXEcP5jjX+/gjH2AM7Uiz6xgtV31/rFLw==",
|
||||
"license": "MPL-2.0"
|
||||
},
|
||||
"node_modules/@pkgjs/parseargs": {
|
||||
"version": "0.11.0",
|
||||
"resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz",
|
||||
@@ -3218,6 +3225,11 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"@optolith/helpers": {
|
||||
"version": "0.2.1",
|
||||
"resolved": "https://registry.npmjs.org/@optolith/helpers/-/helpers-0.2.1.tgz",
|
||||
"integrity": "sha512-i2mg5ro2XaY0sFT3vwW+BBuMYVuJpHRMt27X9/sBfXmgY6L16aKG3UXEcP5jjX+/gjH2AM7Uiz6xgtV31/rFLw=="
|
||||
},
|
||||
"@pkgjs/parseargs": {
|
||||
"version": "0.11.0",
|
||||
"resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz",
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
"author": "Lukas Obermann",
|
||||
"license": "MPL-2.0",
|
||||
"dependencies": {
|
||||
"@optolith/helpers": "^0.2.1",
|
||||
"typescript": "^5.2.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { isNotNullish } from "@optolith/helpers/nullable"
|
||||
import { assertExhaustive } from "@optolith/helpers/typeSafety"
|
||||
import {
|
||||
ContentNode,
|
||||
EnumerationNode,
|
||||
@@ -10,8 +12,6 @@ import {
|
||||
TypeDefinitionNode,
|
||||
isExportAssignmentNode,
|
||||
} from "../ast.js"
|
||||
import { assertExhaustive } from "../utils/assertExhaustive.js"
|
||||
import { isNotNullish } from "../utils/nullable.js"
|
||||
|
||||
enum ScopeTypeKind {
|
||||
Default,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { assertExhaustive } from "@optolith/helpers/typeSafety"
|
||||
import { EOL } from "node:os"
|
||||
import { sep } from "node:path"
|
||||
import {
|
||||
@@ -12,7 +13,6 @@ import {
|
||||
isReferenceNode,
|
||||
} from "../ast.js"
|
||||
import { AstTransformer, Renderer } from "../main.js"
|
||||
import { assertExhaustive } from "../utils/assertExhaustive.js"
|
||||
import {
|
||||
getAliasedImportName,
|
||||
getFullyQualifiedNameAsPath,
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { isNotNullish } from "@optolith/helpers/nullable"
|
||||
import { assertExhaustive } from "@optolith/helpers/typeSafety"
|
||||
import { EOL } from "node:os"
|
||||
import {
|
||||
ArrayNode,
|
||||
@@ -20,8 +22,6 @@ import {
|
||||
isTokenNode,
|
||||
} from "../ast.js"
|
||||
import { AstTransformer, Renderer } from "../main.js"
|
||||
import { assertExhaustive } from "../utils/assertExhaustive.js"
|
||||
import { isNotNullish } from "../utils/nullable.js"
|
||||
import {
|
||||
getRightmostQualifiedNameSegment,
|
||||
qualifiedNameToArray,
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
export function assertExhaustive(
|
||||
_x: never,
|
||||
msg: string = "The switch is not exhaustive."
|
||||
): never {
|
||||
throw new Error(msg)
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
export const isNotNullish = <T>(value: T): value is NonNullable<T> =>
|
||||
value !== null && value !== undefined
|
||||
Reference in New Issue
Block a user