Skip to content

Commit

Permalink
fix: replace unique symbols with noSuggest (#1231)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssalbdivad authored Dec 19, 2024
1 parent c31c88c commit 3b27f24
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 20 deletions.
2 changes: 1 addition & 1 deletion ark/attest/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ark/attest",
"version": "0.31.0",
"version": "0.32.0",
"license": "MIT",
"author": {
"name": "David Blass",
Expand Down
2 changes: 1 addition & 1 deletion ark/fs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ark/fs",
"version": "0.27.0",
"version": "0.28.0",
"license": "MIT",
"author": {
"name": "David Blass",
Expand Down
2 changes: 1 addition & 1 deletion ark/schema/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ark/schema",
"version": "0.27.0",
"version": "0.28.0",
"license": "MIT",
"author": {
"name": "David Blass",
Expand Down
29 changes: 15 additions & 14 deletions ark/type/attributes.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import type { ArkError, ArkErrors, Morph } from "@ark/schema"
import type {
anyOrNever,
array,
Brand,
equals,
Hkt,
intersectArrays,
isSafelyMappable,
Primitive,
show
import {
noSuggest,
type anyOrNever,
type array,
type Brand,
type equals,
type Hkt,
type intersectArrays,
type isSafelyMappable,
type Primitive,
type show
} from "@ark/util"
import type { arkPrototypes } from "./keywords/constructors.ts"
import type { type } from "./keywords/keywords.ts"
Expand Down Expand Up @@ -202,10 +203,10 @@ export type inferMorphOut<morph extends Morph> = Exclude<
ArkError | ArkErrors
>

declare const morphOutSymbol: unique symbol
const isMorphOutKey = noSuggest("isMorphOut")

export interface Out<o = any> {
[morphOutSymbol]: true
[isMorphOutKey]: true
t: o
introspectable: boolean
}
Expand All @@ -216,9 +217,9 @@ export interface To<o = any> extends Out<o> {

export type InferredMorph<i = any, o extends Out = Out> = (In: i) => o

declare const defaultsTo: unique symbol
const defaultsToKey = noSuggest("defaultsTo")

export type Default<t = unknown, v = unknown> = { [defaultsTo]: [t, v] }
export type Default<t = unknown, v = unknown> = { [defaultsToKey]: [t, v] }

// we have to distribute over morphs to preserve the i/o relationship
// this avoids stuff like:
Expand Down
2 changes: 1 addition & 1 deletion ark/type/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "arktype",
"description": "TypeScript's 1:1 validator, optimized from editor to runtime",
"version": "2.0.0-rc.27",
"version": "2.0.0-rc.28",
"license": "MIT",
"author": {
"name": "David Blass",
Expand Down
2 changes: 1 addition & 1 deletion ark/util/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ark/util",
"version": "0.27.0",
"version": "0.28.0",
"license": "MIT",
"author": {
"name": "David Blass",
Expand Down
2 changes: 1 addition & 1 deletion ark/util/registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { FileConstructor, objectKindOf } from "./objectKinds.ts"
// recent node versions (https://nodejs.org/api/esm.html#json-modules).

// For now, we assert this matches the package.json version via a unit test.
export const arkUtilVersion = "0.27.0"
export const arkUtilVersion = "0.28.0"

export const initialRegistryContents = {
version: arkUtilVersion,
Expand Down

0 comments on commit 3b27f24

Please sign in to comment.