Skip to content

Commit

Permalink
Fix typos
Browse files Browse the repository at this point in the history
Linter fixes
  • Loading branch information
MajorLift committed Mar 26, 2024
1 parent 4153976 commit 1935b64
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 14 deletions.
8 changes: 4 additions & 4 deletions src/object/at-path-n.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Kind, Type, Object } from '..'
import { KeyOrPath } from './key-or-path';
import { KeyOrPath } from './key-or-path'

/**
* `_atPathN` is a type-level function that get the nested values in object O at the paths and keys specified in P.
*
* @template P - The path to the property or properties.
* @template P - The paths or keys to the properties to retrieve.
* @template O - The type of the object to retrieve values from.
* @template Acc - Accumulator type to store intermediate results.
* @template Output - The resulting type after retrieving values.
Expand All @@ -30,10 +30,10 @@ export type _$atPathN<
: Acc[number]
> = Output

interface AtPathN_T<Path extends KeyOrPath[]> extends Kind.Kind {
interface AtPathN_T<Paths extends KeyOrPath[]> extends Kind.Kind {
f(
x: Type._$cast<this[Kind._], Record<PropertyKey, unknown>>
): _$atPathN<Path, typeof x>
): _$atPathN<Paths, typeof x>
}

/**
Expand Down
5 changes: 4 additions & 1 deletion src/object/at.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { Kind, Type } from '..'

export type _$at<K extends keyof T, T extends Record<PropertyKey, unknown>> = T[K]
export type _$at<
K extends keyof T,
T extends Record<PropertyKey, unknown>
> = T[K]

interface At_T<K extends PropertyKey> extends Kind.Kind {
f(x: Type._$cast<this[Kind._], Record<K, unknown>>): _$at<K, typeof x>
Expand Down
2 changes: 1 addition & 1 deletion src/object/key-or-path.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export type KeyOrPath = PropertyKey | PropertyKey[]
export type KeyOrPath = PropertyKey | PropertyKey[]
8 changes: 4 additions & 4 deletions src/object/update-n.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { $, Test, Object } from '..'

type UpdateN_Spec = [
/**
* Can Update List Of Keys
* Can update a list of keys
*/
Test.Expect<
$<
Expand All @@ -20,7 +20,7 @@ type UpdateN_Spec = [
}
>,
/**
* Can Update nested paths
* Can update nested paths
*/
Test.Expect<
$<
Expand Down Expand Up @@ -49,7 +49,7 @@ type UpdateN_Spec = [
}
>,
/**
* Can Update a list of keys and nested paths
* Can update a list of keys and nested paths
*/
Test.Expect<
$<
Expand Down Expand Up @@ -86,7 +86,7 @@ type UpdateN_Spec = [
>,

/**
* Keeps original object if the path is invalid
* Keeps original object if the path is invalid
*/
Test.Expect<
$<
Expand Down
2 changes: 1 addition & 1 deletion src/object/update-n.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Kind, Type, Object } from '..'
import { KeyOrPath } from './key-or-path';
import { KeyOrPath } from './key-or-path'

/**
* `_updateN` is a type-level function that Update multiple nested values in object O
Expand Down
6 changes: 3 additions & 3 deletions src/object/update.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { $, Test, Object } from '..'

type Update_Spec = [
/**
* Can Update at key.
* Can update at key.
*/
Test.Expect<
$<
Expand All @@ -20,7 +20,7 @@ type Update_Spec = [
}
>,
/**
* Can Update at nestd path.
* Can update at nested path.
*/
Test.Expect<
$<
Expand All @@ -38,7 +38,7 @@ type Update_Spec = [
}
>,
/**
* Keeps original object if the path is invalid
* Keeps original object if the path is invalid
*/
Test.Expect<
$<
Expand Down

0 comments on commit 1935b64

Please sign in to comment.