Skip to content

Commit

Permalink
refactor: Fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
roottool committed Dec 2, 2023
1 parent ff0b605 commit 18cd92c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions dev/attest/src/assertions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as assert from "node:assert/strict"
import { hasDomain } from "arktype/internal/utils/domains.js"
import type { AssertionContext } from "./attest.js"

export type ThrowAsertionErrorContext = {
export type ThrowAssertionErrorContext = {
message: string
expected?: unknown
actual?: unknown
Expand All @@ -12,7 +12,7 @@ export type ThrowAsertionErrorContext = {
export const throwAssertionError = ({
ctx,
...errorArgs
}: ThrowAsertionErrorContext): never => {
}: ThrowAssertionErrorContext): never => {
const e = new assert.AssertionError(errorArgs)
e.stack = ctx.assertionStack
throw e
Expand Down
4 changes: 2 additions & 2 deletions dev/attest/src/bench/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ const getInstantiationsWithFile = (fileText: string, fakePath: string) => {

const transformBenchSource = (
originalFile: SourceFile,
isolatedBenchExressionText: string,
isolatedBenchExpressionText: string,
includeBenchFn: boolean,
fakePath: string
) => {
const fileToTransform = originalFile.copy(fakePath)
const currentBenchStatement = fileToTransform.getFirstDescendantOrThrow(
(node) =>
node.isKind(SyntaxKind.ExpressionStatement) &&
node.getText() === isolatedBenchExressionText
node.getText() === isolatedBenchExpressionText
) as Node<ts.ExpressionStatement>
if (!includeBenchFn) {
emptyBenchFn(currentBenchStatement)
Expand Down
8 changes: 4 additions & 4 deletions dev/attest/src/caller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ const nonexistentCurrentLine = {

export type FormatFilePathOptions = {
relative?: string | boolean
seperator?: string
separator?: string
}

export const formatFilePath = (
original: string,
{ relative, seperator }: FormatFilePathOptions
{ relative, separator }: FormatFilePathOptions
) => {
let formatted = original
if (original.startsWith("file:///")) {
Expand All @@ -57,10 +57,10 @@ export const formatFilePath = (
formatted
)
}
if (seperator) {
if (separator) {
formatted = formatted.replace(
new RegExp(`\\${path.sep}`, "g"),
seperator
separator
)
}
return formatted
Expand Down
4 changes: 2 additions & 2 deletions dev/attest/src/type/internal/getAssertionsInFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ const checkTypeAssertion = (
}

// Using any as isTypeAssignableTo is not publicly exposed
const getInteralTypeChecker = (project: Project) =>
const getInternalTypeChecker = (project: Project) =>
project.getTypeChecker().compilerObject as ts.TypeChecker & {
isTypeAssignableTo: (first: ts.Type, second: ts.Type) => boolean
}
Expand All @@ -230,7 +230,7 @@ const checkMutualAssignability = (
assertionTypes: Required<AssertionTypes>,
project: Project
) => {
const checker = getInteralTypeChecker(project)
const checker = getInternalTypeChecker(project)
const isActualAssignableToExpected = checker.isTypeAssignableTo(
assertionTypes.actual.compilerType,
assertionTypes.expected.compilerType
Expand Down

0 comments on commit 18cd92c

Please sign in to comment.