Comparing version 1.0.28-alpha to 1.0.29-alpha
@@ -5,13 +5,6 @@ "use strict"; | ||
}); | ||
function _export(target, all) { | ||
for(var name in all)Object.defineProperty(target, name, { | ||
enumerable: true, | ||
get: all[name] | ||
}); | ||
} | ||
_export(exports, { | ||
Cache: ()=>Cache, | ||
FreezingCache: ()=>FreezingCache | ||
Object.defineProperty(exports, "Cache", { | ||
enumerable: true, | ||
get: ()=>Cache | ||
}); | ||
const _freezeJs = require("../utils/freeze.js"); | ||
function _defineProperty(obj, key, value) { | ||
@@ -48,7 +41,1 @@ if (key in obj) { | ||
} | ||
class FreezingCache extends Cache { | ||
set(name, item) { | ||
this.cache[name] = (0, _freezeJs.deepFreeze)(item); | ||
return item; | ||
} | ||
} |
@@ -26,3 +26,2 @@ "use strict"; | ||
const _errorsJs = require("../utils/errors.js"); | ||
const _freezeJs = require("../utils/freeze.js"); | ||
const _genericsJs = require("../utils/generics.js"); | ||
@@ -184,3 +183,3 @@ const _pathsJs = require("../utils/paths.js"); | ||
this.aliases = aliases; | ||
this.parseCache = new _cacheJs.FreezingCache(); | ||
this.parseCache = new _cacheJs.Cache(); | ||
_classPrivateFieldSet(this, _resolutions, new _cacheJs.Cache()); | ||
@@ -242,7 +241,7 @@ _classPrivateFieldSet(this, _exports, new _cacheJs.Cache()); | ||
const root = (0, _definitionJs.parseDefinition)(def, ctx); | ||
t.node = (0, _freezeJs.deepFreeze)((0, _genericsJs.hasKeys)(config) ? { | ||
t.node = (0, _genericsJs.hasKeys)(config) ? { | ||
config, | ||
node: this.resolveTypeNode(root) | ||
} : root); | ||
t.flat = (0, _freezeJs.deepFreeze)((0, _nodeJs.flattenType)(t)); | ||
} : root; | ||
t.flat = (0, _nodeJs.flattenType)(t); | ||
return t; | ||
@@ -312,4 +311,4 @@ }, { | ||
} | ||
t.node = (0, _freezeJs.deepFreeze)(node); | ||
t.flat = (0, _freezeJs.deepFreeze)((0, _nodeJs.flattenType)(t)); | ||
t.node = node; | ||
t.flat = (0, _nodeJs.flattenType)(t); | ||
return t; | ||
@@ -316,0 +315,0 @@ } |
@@ -14,3 +14,2 @@ function _defineProperty(obj, key, value) { | ||
} | ||
import { deepFreeze } from "../utils/freeze.js"; | ||
export class Cache { | ||
@@ -34,7 +33,1 @@ get root() { | ||
} | ||
export class FreezingCache extends Cache { | ||
set(name, item) { | ||
this.cache[name] = deepFreeze(item); | ||
return item; | ||
} | ||
} |
@@ -69,6 +69,5 @@ function _checkPrivateRedeclaration(obj, privateCollection) { | ||
import { throwInternalError, throwParseError } from "../utils/errors.js"; | ||
import { deepFreeze } from "../utils/freeze.js"; | ||
import { hasKeys } from "../utils/generics.js"; | ||
import { Path } from "../utils/paths.js"; | ||
import { Cache, FreezingCache } from "./cache.js"; | ||
import { Cache } from "./cache.js"; | ||
import { initializeType } from "./type.js"; | ||
@@ -164,3 +163,3 @@ export const compileScopeOptions = (opts)=>({ | ||
this.aliases = aliases; | ||
this.parseCache = new FreezingCache(); | ||
this.parseCache = new Cache(); | ||
_classPrivateFieldSet(this, _resolutions, new Cache()); | ||
@@ -222,7 +221,7 @@ _classPrivateFieldSet(this, _exports, new Cache()); | ||
const root = parseDefinition(def, ctx); | ||
t.node = deepFreeze(hasKeys(config) ? { | ||
t.node = hasKeys(config) ? { | ||
config, | ||
node: this.resolveTypeNode(root) | ||
} : root); | ||
t.flat = deepFreeze(flattenType(t)); | ||
} : root; | ||
t.flat = flattenType(t); | ||
return t; | ||
@@ -292,4 +291,4 @@ }, { | ||
} | ||
t.node = deepFreeze(node); | ||
t.flat = deepFreeze(flattenType(t)); | ||
t.node = node; | ||
t.flat = flattenType(t); | ||
return t; | ||
@@ -296,0 +295,0 @@ } |
@@ -12,4 +12,1 @@ export declare class Cache<item = unknown> { | ||
} | ||
export declare class FreezingCache<item = unknown> extends Cache<item> { | ||
set(name: string, item: item): item; | ||
} |
@@ -8,3 +8,3 @@ import type { Node, ResolvedNode, TypeNode } from "../nodes/node.js"; | ||
import type { PrecompiledDefaults } from "./ark.js"; | ||
import { FreezingCache } from "./cache.js"; | ||
import { Cache } from "./cache.js"; | ||
import type { Expressions } from "./expressions.js"; | ||
@@ -72,3 +72,3 @@ import type { AnonymousTypeName, KeyCheckKind, QualifiedTypeName, Type, TypeParser } from "./type.js"; | ||
config: ScopeConfig; | ||
parseCache: FreezingCache<Node>; | ||
parseCache: Cache<Node>; | ||
constructor(aliases: Dict, opts?: ScopeOptions); | ||
@@ -75,0 +75,0 @@ getAnonymousQualifiedName(base: AnonymousTypeName): QualifiedTypeName; |
{ | ||
"name": "arktype", | ||
"description": "TypeScript's 1:1 validator, optimized from editor to runtime", | ||
"version": "1.0.28-alpha", | ||
"version": "1.0.29-alpha", | ||
"license": "MIT", | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -55,3 +55,3 @@ <h1 align="center">ArkType <sub><sup>TypeScript's 1:1 validator</sup></sub></h1> | ||
Our types are tested in [strict-mode](https://www.typescriptlang.org/tsconfig#strict) with TypeScript versions `4.8`, `4.9`, and `5.0`. | ||
Our types are tested in [strict-mode](https://www.typescriptlang.org/tsconfig#strict) with TypeScript version `4.8` or greater. | ||
@@ -263,3 +263,3 @@ _Our APIs have mostly stabilized, but details may still change during the alpha/beta stages of our 1.0 release. If you have suggestions that may require a breaking change, now is the time to let us know!_ β΅ | ||
### Current Sponsors π₯° | ||
### ArkSponsors β΅ | ||
@@ -270,5 +270,2 @@ <table> | ||
<th>sam-goodwin</th> | ||
<th>tmm</th> | ||
<th>thomasballinger</th> | ||
<th>jacksteamdev</th> | ||
</tr> | ||
@@ -290,2 +287,15 @@ <tr> | ||
</td> | ||
</tr> | ||
## Sponsors π₯° | ||
<table> | ||
<tr> | ||
<th>tmm</th> | ||
<th>jacksteamdev</th> | ||
<th>neodon</th> | ||
<th>mewhhaha</th> | ||
<th>codeandcats</th> | ||
</tr> | ||
<tr> | ||
<td> | ||
@@ -299,9 +309,2 @@ <a href="https://github.com/tmm" | ||
<td> | ||
<a href="https://github.com/thomasballinger" | ||
><img | ||
height="64px" | ||
src="https://avatars.githubusercontent.com/u/458879" | ||
/></a> | ||
</td> | ||
<td> | ||
<a href="https://github.com/jacksteamdev" | ||
@@ -313,45 +316,34 @@ ><img | ||
</td> | ||
<td> | ||
<a href="https://github.com/neodon" | ||
><img height="64px" src="https://avatars.githubusercontent.com/u/82944" | ||
/></a> | ||
</td> | ||
<td> | ||
<a href="https://github.com/mewhhaha" | ||
><img | ||
height="64px" | ||
src="https://avatars.githubusercontent.com/u/3399205" | ||
/></a> | ||
</td> | ||
<td> | ||
<a href="https://github.com/codeandcats" | ||
><img | ||
height="64px" | ||
src="https://avatars.githubusercontent.com/u/6035934" | ||
/></a> | ||
</td> | ||
</tr> | ||
<tr> | ||
<th>neodon</th> | ||
<th>mewhhaha</th> | ||
<th>codeandcats</th> | ||
<th>xrexy</th> | ||
<th>Timeraa</th> | ||
</tr> | ||
<tr> | ||
<td> | ||
<a href="https://github.com/neodon" | ||
><img height="64px" src="https://avatars.githubusercontent.com/u/82944" | ||
/></a> | ||
</td> | ||
<td> | ||
<a href="https://github.com/mewhhaha" | ||
><img | ||
height="64px" | ||
src="https://avatars.githubusercontent.com/u/3399205" | ||
/></a> | ||
</td> | ||
<td> | ||
<a href="https://github.com/codeandcats" | ||
><img | ||
height="64px" | ||
src="https://avatars.githubusercontent.com/u/6035934" | ||
/></a> | ||
</td> | ||
<td> | ||
<a href="https://github.com/xrexy" | ||
><img | ||
height="64px" | ||
src="https://avatars.githubusercontent.com/u/71969236" | ||
/></a> | ||
</td> | ||
<td> | ||
<a href="https://github.com/Timeraa" | ||
><img | ||
height="64px" | ||
src="https://avatars.githubusercontent.com/u/29104008" | ||
/></a> | ||
</td> | ||
</tr> | ||
<th>Timeraa</th> | ||
</tr> | ||
<tr> | ||
<td> | ||
<a href="https://github.com/Timeraa" | ||
><img | ||
height="64px" | ||
src="https://avatars.githubusercontent.com/u/29104008" | ||
/></a> | ||
</td> | ||
</tr> | ||
</table> |
Sorry, the diff of this file is not supported yet
499258
10767
344