Skip to content

Commit

Permalink
Add import extension
Browse files Browse the repository at this point in the history
  • Loading branch information
loynoir committed Apr 21, 2023
1 parent 41eb6bb commit 74108a7
Show file tree
Hide file tree
Showing 336 changed files with 388 additions and 388 deletions.
4 changes: 2 additions & 2 deletions benchmark/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from './compression/index'
export * from './measurement/index'
export * from './compression/index.js'
export * from './measurement/index.js'
4 changes: 2 additions & 2 deletions benchmark/measurement/module/check.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Cases } from './cases'
import { Benchmark } from './benchmark'
import { Cases } from './cases.js'
import { Benchmark } from './benchmark.js'
import { TypeCompiler } from '@sinclair/typebox/compiler'
import { TSchema, TypeGuard } from '@sinclair/typebox'
import { Value } from '@sinclair/typebox/value'
Expand Down
4 changes: 2 additions & 2 deletions benchmark/measurement/module/compile.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Cases } from './cases'
import { Benchmark } from './benchmark'
import { Cases } from './cases.js'
import { Benchmark } from './benchmark.js'
import { TypeCompiler } from '@sinclair/typebox/compiler'
import { TSchema, TypeGuard } from '@sinclair/typebox'
import Ajv from 'ajv'
Expand Down
6 changes: 3 additions & 3 deletions benchmark/measurement/module/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { CompileBenchmark } from './compile'
import { CheckBenchmark } from './check'
import { Result } from './result'
import { CompileBenchmark } from './compile.js'
import { CheckBenchmark } from './check.js'
import { Result } from './result.js'

export function present(results: Result[]) {
console.table(
Expand Down
8 changes: 4 additions & 4 deletions example/codegen/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ THE SOFTWARE.
---------------------------------------------------------------------------*/

export { TypeBoxToTypeScript } from './typebox-to-typescript'
export { TypeBoxToZod } from './typebox-to-zod'
export { TypeScriptToJsonSchema } from './typescript-to-json-schema'
export { TypeScriptToTypeBox } from './typescript-to-typebox'
export { TypeBoxToTypeScript } from './typebox-to-typescript.js'
export { TypeBoxToZod } from './typebox-to-zod.js'
export { TypeScriptToJsonSchema } from './typescript-to-json-schema.js'
export { TypeScriptToTypeBox } from './typescript-to-typebox.js'
2 changes: 1 addition & 1 deletion example/codegen/typebox-to-typescript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ THE SOFTWARE.
---------------------------------------------------------------------------*/

import { Formatter } from './formatter'
import { Formatter } from './formatter.js'
import * as Types from '@sinclair/typebox'

export namespace TypeBoxToTypeScript {
Expand Down
2 changes: 1 addition & 1 deletion example/codegen/typebox-to-zod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ THE SOFTWARE.
---------------------------------------------------------------------------*/

import { Formatter } from './formatter'
import { Formatter } from './formatter.js'
import * as Types from '@sinclair/typebox'

// --------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion example/codegen/typescript-to-typebox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ THE SOFTWARE.
---------------------------------------------------------------------------*/

import { Formatter } from './formatter'
import { Formatter } from './formatter.js'
import * as ts from 'typescript'

// -------------------------------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions example/collections/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ THE SOFTWARE.
---------------------------------------------------------------------------*/

export * from './array'
export * from './map'
export * from './set'
export * from './array.js'
export * from './map.js'
export * from './set.js'
2 changes: 1 addition & 1 deletion example/experimental/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ THE SOFTWARE.
---------------------------------------------------------------------------*/

export * from './experimental'
export * from './experimental.js'
2 changes: 1 addition & 1 deletion example/formats/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './standard'
export * from './standard.js'
2 changes: 1 addition & 1 deletion example/template-dsl/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ THE SOFTWARE.
---------------------------------------------------------------------------*/

export * from './template-dsl'
export * from './template-dsl.js'
2 changes: 1 addition & 1 deletion example/typedef/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ THE SOFTWARE.
---------------------------------------------------------------------------*/

export * from './typedef'
export * from './typedef.js'
8 changes: 4 additions & 4 deletions src/compiler/compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ THE SOFTWARE.
---------------------------------------------------------------------------*/

import * as Types from '../typebox'
import { ValueErrors, ValueErrorIterator } from '../errors/index'
import { TypeSystem } from '../system/index'
import { ValueHash } from '../value/hash'
import * as Types from '../typebox.js'
import { ValueErrors, ValueErrorIterator } from '../errors/index.js'
import { TypeSystem } from '../system/index.js'
import { ValueHash } from '../value/hash.js'

// -------------------------------------------------------------------
// CheckFunction
Expand Down
4 changes: 2 additions & 2 deletions src/compiler/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ THE SOFTWARE.
---------------------------------------------------------------------------*/

export { ValueError, ValueErrorType } from '../errors/index'
export * from './compiler'
export { ValueError, ValueErrorType } from '../errors/index.js'
export * from './compiler.js'
6 changes: 3 additions & 3 deletions src/errors/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
---------------------------------------------------------------------------*/
import * as Types from '../typebox'
import { TypeSystem } from '../system/index'
import { ValueHash } from '../value/hash'
import * as Types from '../typebox.js'
import { TypeSystem } from '../system/index.js'
import { ValueHash } from '../value/hash.js'

// -------------------------------------------------------------------
// ValueErrorType
Expand Down
2 changes: 1 addition & 1 deletion src/errors/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ THE SOFTWARE.
---------------------------------------------------------------------------*/

export * from './errors'
export * from './errors.js'
2 changes: 1 addition & 1 deletion src/system/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ THE SOFTWARE.
---------------------------------------------------------------------------*/

export * from './system'
export * from './system.js'
2 changes: 1 addition & 1 deletion src/system/system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ THE SOFTWARE.
---------------------------------------------------------------------------*/

import * as Types from '../typebox'
import * as Types from '../typebox.js'

export class TypeSystemDuplicateTypeKind extends Error {
constructor(kind: string) {
Expand Down
8 changes: 4 additions & 4 deletions src/value/cast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ THE SOFTWARE.
---------------------------------------------------------------------------*/

import * as Types from '../typebox'
import { ValueCreate } from './create'
import { ValueCheck } from './check'
import { ValueClone } from './clone'
import * as Types from '../typebox.js'
import { ValueCreate } from './create.js'
import { ValueCheck } from './check.js'
import { ValueClone } from './clone.js'

// ----------------------------------------------------------------------------------------------
// Errors
Expand Down
6 changes: 3 additions & 3 deletions src/value/check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ THE SOFTWARE.
---------------------------------------------------------------------------*/

import * as Types from '../typebox'
import { TypeSystem } from '../system/index'
import { ValueHash } from './hash'
import * as Types from '../typebox.js'
import { TypeSystem } from '../system/index.js'
import { ValueHash } from './hash.js'

// -------------------------------------------------------------------------
// Errors
Expand Down
2 changes: 1 addition & 1 deletion src/value/clone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ THE SOFTWARE.
---------------------------------------------------------------------------*/

import { Is, ObjectType, ArrayType, TypedArrayType, ValueType } from './is'
import { Is, ObjectType, ArrayType, TypedArrayType, ValueType } from './is.js'

export namespace ValueClone {
function Array(value: ArrayType): any {
Expand Down
6 changes: 3 additions & 3 deletions src/value/convert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ THE SOFTWARE.
---------------------------------------------------------------------------*/

import * as Types from '../typebox'
import { ValueClone } from './clone'
import { ValueCheck } from './check'
import * as Types from '../typebox.js'
import { ValueClone } from './clone.js'
import { ValueCheck } from './check.js'

// ----------------------------------------------------------------------------------------------
// Errors
Expand Down
4 changes: 2 additions & 2 deletions src/value/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ THE SOFTWARE.
---------------------------------------------------------------------------*/

import * as Types from '../typebox'
import { ValueCheck } from './check'
import * as Types from '../typebox.js'
import { ValueCheck } from './check.js'

// --------------------------------------------------------------------------
// Errors
Expand Down
8 changes: 4 additions & 4 deletions src/value/delta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ THE SOFTWARE.
---------------------------------------------------------------------------*/

import { Type, Static } from '../typebox'
import { Is, ObjectType, ArrayType, TypedArrayType, ValueType } from './is'
import { ValueClone } from './clone'
import { ValuePointer } from './pointer'
import { Type, Static } from '../typebox.js'
import { Is, ObjectType, ArrayType, TypedArrayType, ValueType } from './is.js'
import { ValueClone } from './clone.js'
import { ValuePointer } from './pointer.js'

// ---------------------------------------------------------------------
// Operations
Expand Down
2 changes: 1 addition & 1 deletion src/value/equal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ THE SOFTWARE.
---------------------------------------------------------------------------*/

import { Is, ObjectType, ArrayType, TypedArrayType, ValueType } from './is'
import { Is, ObjectType, ArrayType, TypedArrayType, ValueType } from './is.js'

export namespace ValueEqual {
function Object(left: ObjectType, right: unknown): boolean {
Expand Down
12 changes: 6 additions & 6 deletions src/value/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ THE SOFTWARE.
---------------------------------------------------------------------------*/

export { ValueError, ValueErrorIterator, ValueErrorType } from '../errors/index'
export { ValueHash } from './hash'
export { Edit, Insert, Update, Delete } from './delta'
export { Mutable } from './mutate'
export * from './pointer'
export * from './value'
export { ValueError, ValueErrorIterator, ValueErrorType } from '../errors/index.js'
export { ValueHash } from './hash.js'
export { Edit, Insert, Update, Delete } from './delta.js'
export { Mutable } from './mutate.js'
export * from './pointer.js'
export * from './value.js'
6 changes: 3 additions & 3 deletions src/value/mutate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ THE SOFTWARE.
---------------------------------------------------------------------------*/

import { Is, TypedArrayType } from './is'
import { ValuePointer } from './pointer'
import { ValueClone } from './clone'
import { Is, TypedArrayType } from './is.js'
import { ValuePointer } from './pointer.js'
import { ValueClone } from './clone.js'

export class ValueMutateTypeMismatchError extends Error {
constructor() {
Expand Down
22 changes: 11 additions & 11 deletions src/value/value.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@ THE SOFTWARE.
---------------------------------------------------------------------------*/

import * as Types from '../typebox'
import { ValueErrors, ValueErrorIterator, ValueError } from '../errors/index'
import { ValueMutate, Mutable } from './mutate'
import { ValueHash } from './hash'
import { ValueEqual } from './equal'
import { ValueCast } from './cast'
import { ValueClone } from './clone'
import { ValueConvert } from './convert'
import { ValueCreate } from './create'
import { ValueCheck } from './check'
import { ValueDelta, Edit } from './delta'
import * as Types from '../typebox.js'
import { ValueErrors, ValueErrorIterator, ValueError } from '../errors/index.js'
import { ValueMutate, Mutable } from './mutate.js'
import { ValueHash } from './hash.js'
import { ValueEqual } from './equal.js'
import { ValueCast } from './cast.js'
import { ValueClone } from './clone.js'
import { ValueConvert } from './convert.js'
import { ValueCreate } from './create.js'
import { ValueCheck } from './check.js'
import { ValueDelta, Edit } from './delta.js'

/** Provides functions to perform structural updates to JavaScript values */
export namespace Value {
Expand Down
2 changes: 1 addition & 1 deletion test/runtime/assert/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './assert'
export * from './assert.js'
2 changes: 1 addition & 1 deletion test/runtime/compiler/any.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Type } from '@sinclair/typebox'
import { Ok } from './validate'
import { Ok } from './validate.js'

describe('type/compiler/Any', () => {
it('Should validate number', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/runtime/compiler/array.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Type } from '@sinclair/typebox'
import { Ok, Fail } from './validate'
import { Ok, Fail } from './validate.js'

describe('type/compiler/Array', () => {
it('Should validate an array of any', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/runtime/compiler/bigint.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Type } from '@sinclair/typebox'
import { Ok, Fail } from './validate'
import { Ok, Fail } from './validate.js'

describe('type/compiler/BigInt', () => {
it('Should not validate number', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/runtime/compiler/boolean.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Type } from '@sinclair/typebox'
import { Ok, Fail } from './validate'
import { Ok, Fail } from './validate.js'

describe('type/compiler/Boolean', () => {
it('Should validate a boolean', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/runtime/compiler/composite.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Type } from '@sinclair/typebox'
import { Ok, Fail } from './validate'
import { Ok, Fail } from './validate.js'

describe('type/compiler/Composite', () => {
it('Should compose two objects', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/runtime/compiler/custom.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Type, Kind, TypeRegistry } from '@sinclair/typebox'
import { Ok, Fail } from './validate'
import { Ok, Fail } from './validate.js'

describe('type/compiler/Custom', () => {
TypeRegistry.Set('BigInt', (schema, value) => typeof value === 'bigint')
Expand Down
2 changes: 1 addition & 1 deletion test/runtime/compiler/date.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Type } from '@sinclair/typebox'
import { Ok, Fail } from './validate'
import { Ok, Fail } from './validate.js'

describe('type/compiler/Date', () => {
it('Should not validate number', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/runtime/compiler/enum.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Type } from '@sinclair/typebox'
import { Ok, Fail } from './validate'
import { Ok, Fail } from './validate.js'

describe('type/compiler/Enum', () => {
it('Should validate when emum uses default numeric values', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/runtime/compiler/integer.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Type } from '@sinclair/typebox'
import { Ok, Fail } from './validate'
import { Ok, Fail } from './validate.js'

describe('type/compiler/Integer', () => {
it('Should not validate number', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/runtime/compiler/intersect.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Type, Static } from '@sinclair/typebox'
import { Ok, Fail } from './validate'
import { Ok, Fail } from './validate.js'

describe('type/compiler/Intersect', () => {
it('Should intersect number and number', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/runtime/compiler/keyof.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Type } from '@sinclair/typebox'
import { Ok, Fail } from './validate'
import { Ok, Fail } from './validate.js'
import { strictEqual } from 'assert'

describe('type/compiler/KeyOf', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/runtime/compiler/literal.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Type } from '@sinclair/typebox'
import { Ok, Fail } from './validate'
import { Ok, Fail } from './validate.js'

describe('type/compiler/Literal', () => {
it('Should validate literal number', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/runtime/compiler/never.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Type } from '@sinclair/typebox'
import { Fail } from './validate'
import { Fail } from './validate.js'

describe('type/compiler/Never', () => {
it('Should not validate number', () => {
Expand Down
Loading

0 comments on commit 74108a7

Please sign in to comment.