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

refactor: fix some typos #890

Merged
merged 1 commit into from
Dec 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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