Skip to content

Commit b2b8029

Browse files
committed
Add import extension
1 parent 95d9bdd commit b2b8029

File tree

336 files changed

+388
-388
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

336 files changed

+388
-388
lines changed

benchmark/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
export * from './compression/index'
2-
export * from './measurement/index'
1+
export * from './compression/index.js'
2+
export * from './measurement/index.js'

benchmark/measurement/module/check.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { Cases } from './cases'
2-
import { Benchmark } from './benchmark'
1+
import { Cases } from './cases.js'
2+
import { Benchmark } from './benchmark.js'
33
import { TypeCompiler } from '@sinclair/typebox/compiler'
44
import { TSchema, TypeGuard } from '@sinclair/typebox'
55
import { Value } from '@sinclair/typebox/value'

benchmark/measurement/module/compile.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { Cases } from './cases'
2-
import { Benchmark } from './benchmark'
1+
import { Cases } from './cases.js'
2+
import { Benchmark } from './benchmark.js'
33
import { TypeCompiler } from '@sinclair/typebox/compiler'
44
import { TSchema, TypeGuard } from '@sinclair/typebox'
55
import Ajv from 'ajv'

benchmark/measurement/module/index.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { CompileBenchmark } from './compile'
2-
import { CheckBenchmark } from './check'
3-
import { Result } from './result'
1+
import { CompileBenchmark } from './compile.js'
2+
import { CheckBenchmark } from './check.js'
3+
import { Result } from './result.js'
44

55
export function present(results: Result[]) {
66
console.table(

example/codegen/index.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ THE SOFTWARE.
2626
2727
---------------------------------------------------------------------------*/
2828

29-
export { TypeBoxToTypeScript } from './typebox-to-typescript'
30-
export { TypeBoxToZod } from './typebox-to-zod'
31-
export { TypeScriptToJsonSchema } from './typescript-to-json-schema'
32-
export { TypeScriptToTypeBox } from './typescript-to-typebox'
29+
export { TypeBoxToTypeScript } from './typebox-to-typescript.js'
30+
export { TypeBoxToZod } from './typebox-to-zod.js'
31+
export { TypeScriptToJsonSchema } from './typescript-to-json-schema.js'
32+
export { TypeScriptToTypeBox } from './typescript-to-typebox.js'

example/codegen/typebox-to-typescript.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ THE SOFTWARE.
2626
2727
---------------------------------------------------------------------------*/
2828

29-
import { Formatter } from './formatter'
29+
import { Formatter } from './formatter.js'
3030
import * as Types from '@sinclair/typebox'
3131

3232
export namespace TypeBoxToTypeScript {

example/codegen/typebox-to-zod.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ THE SOFTWARE.
2626
2727
---------------------------------------------------------------------------*/
2828

29-
import { Formatter } from './formatter'
29+
import { Formatter } from './formatter.js'
3030
import * as Types from '@sinclair/typebox'
3131

3232
// --------------------------------------------------------------------------

example/codegen/typescript-to-typebox.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ THE SOFTWARE.
2626
2727
---------------------------------------------------------------------------*/
2828

29-
import { Formatter } from './formatter'
29+
import { Formatter } from './formatter.js'
3030
import * as ts from 'typescript'
3131

3232
// -------------------------------------------------------------------------

example/collections/index.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ THE SOFTWARE.
2626
2727
---------------------------------------------------------------------------*/
2828

29-
export * from './array'
30-
export * from './map'
31-
export * from './set'
29+
export * from './array.js'
30+
export * from './map.js'
31+
export * from './set.js'

example/experimental/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ THE SOFTWARE.
2626
2727
---------------------------------------------------------------------------*/
2828

29-
export * from './experimental'
29+
export * from './experimental.js'

example/formats/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export * from './standard'
1+
export * from './standard.js'

example/template-dsl/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ THE SOFTWARE.
2626
2727
---------------------------------------------------------------------------*/
2828

29-
export * from './template-dsl'
29+
export * from './template-dsl.js'

example/typedef/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ THE SOFTWARE.
2626
2727
---------------------------------------------------------------------------*/
2828

29-
export * from './typedef'
29+
export * from './typedef.js'

src/compiler/compiler.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ THE SOFTWARE.
2626
2727
---------------------------------------------------------------------------*/
2828

29-
import * as Types from '../typebox'
30-
import { ValueErrors, ValueErrorIterator } from '../errors/index'
31-
import { TypeSystem } from '../system/index'
32-
import { ValueHash } from '../value/hash'
29+
import * as Types from '../typebox.js'
30+
import { ValueErrors, ValueErrorIterator } from '../errors/index.js'
31+
import { TypeSystem } from '../system/index.js'
32+
import { ValueHash } from '../value/hash.js'
3333

3434
// -------------------------------------------------------------------
3535
// CheckFunction

src/compiler/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ THE SOFTWARE.
2626
2727
---------------------------------------------------------------------------*/
2828

29-
export { ValueError, ValueErrorType } from '../errors/index'
30-
export * from './compiler'
29+
export { ValueError, ValueErrorType } from '../errors/index.js'
30+
export * from './compiler.js'

src/errors/errors.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2525
THE SOFTWARE.
2626
2727
---------------------------------------------------------------------------*/
28-
import * as Types from '../typebox'
29-
import { TypeSystem } from '../system/index'
30-
import { ValueHash } from '../value/hash'
28+
import * as Types from '../typebox.js'
29+
import { TypeSystem } from '../system/index.js'
30+
import { ValueHash } from '../value/hash.js'
3131

3232
// -------------------------------------------------------------------
3333
// ValueErrorType

src/errors/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ THE SOFTWARE.
2626
2727
---------------------------------------------------------------------------*/
2828

29-
export * from './errors'
29+
export * from './errors.js'

src/system/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ THE SOFTWARE.
2626
2727
---------------------------------------------------------------------------*/
2828

29-
export * from './system'
29+
export * from './system.js'

src/system/system.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ THE SOFTWARE.
2626
2727
---------------------------------------------------------------------------*/
2828

29-
import * as Types from '../typebox'
29+
import * as Types from '../typebox.js'
3030

3131
export class TypeSystemDuplicateTypeKind extends Error {
3232
constructor(kind: string) {

src/value/cast.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ THE SOFTWARE.
2626
2727
---------------------------------------------------------------------------*/
2828

29-
import * as Types from '../typebox'
30-
import { ValueCreate } from './create'
31-
import { ValueCheck } from './check'
32-
import { ValueClone } from './clone'
29+
import * as Types from '../typebox.js'
30+
import { ValueCreate } from './create.js'
31+
import { ValueCheck } from './check.js'
32+
import { ValueClone } from './clone.js'
3333

3434
// ----------------------------------------------------------------------------------------------
3535
// Errors

src/value/check.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ THE SOFTWARE.
2626
2727
---------------------------------------------------------------------------*/
2828

29-
import * as Types from '../typebox'
30-
import { TypeSystem } from '../system/index'
31-
import { ValueHash } from './hash'
29+
import * as Types from '../typebox.js'
30+
import { TypeSystem } from '../system/index.js'
31+
import { ValueHash } from './hash.js'
3232

3333
// -------------------------------------------------------------------------
3434
// Errors

src/value/clone.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ THE SOFTWARE.
2626
2727
---------------------------------------------------------------------------*/
2828

29-
import { Is, ObjectType, ArrayType, TypedArrayType, ValueType } from './is'
29+
import { Is, ObjectType, ArrayType, TypedArrayType, ValueType } from './is.js'
3030

3131
export namespace ValueClone {
3232
function Array(value: ArrayType): any {

src/value/convert.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ THE SOFTWARE.
2626
2727
---------------------------------------------------------------------------*/
2828

29-
import * as Types from '../typebox'
30-
import { ValueClone } from './clone'
31-
import { ValueCheck } from './check'
29+
import * as Types from '../typebox.js'
30+
import { ValueClone } from './clone.js'
31+
import { ValueCheck } from './check.js'
3232

3333
// ----------------------------------------------------------------------------------------------
3434
// Errors

src/value/create.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ THE SOFTWARE.
2626
2727
---------------------------------------------------------------------------*/
2828

29-
import * as Types from '../typebox'
30-
import { ValueCheck } from './check'
29+
import * as Types from '../typebox.js'
30+
import { ValueCheck } from './check.js'
3131

3232
// --------------------------------------------------------------------------
3333
// Errors

src/value/delta.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ THE SOFTWARE.
2626
2727
---------------------------------------------------------------------------*/
2828

29-
import { Type, Static } from '../typebox'
30-
import { Is, ObjectType, ArrayType, TypedArrayType, ValueType } from './is'
31-
import { ValueClone } from './clone'
32-
import { ValuePointer } from './pointer'
29+
import { Type, Static } from '../typebox.js'
30+
import { Is, ObjectType, ArrayType, TypedArrayType, ValueType } from './is.js'
31+
import { ValueClone } from './clone.js'
32+
import { ValuePointer } from './pointer.js'
3333

3434
// ---------------------------------------------------------------------
3535
// Operations

src/value/equal.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ THE SOFTWARE.
2626
2727
---------------------------------------------------------------------------*/
2828

29-
import { Is, ObjectType, ArrayType, TypedArrayType, ValueType } from './is'
29+
import { Is, ObjectType, ArrayType, TypedArrayType, ValueType } from './is.js'
3030

3131
export namespace ValueEqual {
3232
function Object(left: ObjectType, right: unknown): boolean {

src/value/index.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ THE SOFTWARE.
2626
2727
---------------------------------------------------------------------------*/
2828

29-
export { ValueError, ValueErrorIterator, ValueErrorType } from '../errors/index'
30-
export { ValueHash } from './hash'
31-
export { Edit, Insert, Update, Delete } from './delta'
32-
export { Mutable } from './mutate'
33-
export * from './pointer'
34-
export * from './value'
29+
export { ValueError, ValueErrorIterator, ValueErrorType } from '../errors/index.js'
30+
export { ValueHash } from './hash.js'
31+
export { Edit, Insert, Update, Delete } from './delta.js'
32+
export { Mutable } from './mutate.js'
33+
export * from './pointer.js'
34+
export * from './value.js'

src/value/mutate.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ THE SOFTWARE.
2626
2727
---------------------------------------------------------------------------*/
2828

29-
import { Is, TypedArrayType } from './is'
30-
import { ValuePointer } from './pointer'
31-
import { ValueClone } from './clone'
29+
import { Is, TypedArrayType } from './is.js'
30+
import { ValuePointer } from './pointer.js'
31+
import { ValueClone } from './clone.js'
3232

3333
export class ValueMutateTypeMismatchError extends Error {
3434
constructor() {

src/value/value.ts

+11-11
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,17 @@ THE SOFTWARE.
2626
2727
---------------------------------------------------------------------------*/
2828

29-
import * as Types from '../typebox'
30-
import { ValueErrors, ValueErrorIterator, ValueError } from '../errors/index'
31-
import { ValueMutate, Mutable } from './mutate'
32-
import { ValueHash } from './hash'
33-
import { ValueEqual } from './equal'
34-
import { ValueCast } from './cast'
35-
import { ValueClone } from './clone'
36-
import { ValueConvert } from './convert'
37-
import { ValueCreate } from './create'
38-
import { ValueCheck } from './check'
39-
import { ValueDelta, Edit } from './delta'
29+
import * as Types from '../typebox.js'
30+
import { ValueErrors, ValueErrorIterator, ValueError } from '../errors/index.js'
31+
import { ValueMutate, Mutable } from './mutate.js'
32+
import { ValueHash } from './hash.js'
33+
import { ValueEqual } from './equal.js'
34+
import { ValueCast } from './cast.js'
35+
import { ValueClone } from './clone.js'
36+
import { ValueConvert } from './convert.js'
37+
import { ValueCreate } from './create.js'
38+
import { ValueCheck } from './check.js'
39+
import { ValueDelta, Edit } from './delta.js'
4040

4141
/** Provides functions to perform structural updates to JavaScript values */
4242
export namespace Value {

test/runtime/assert/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export * from './assert'
1+
export * from './assert.js'

test/runtime/compiler/any.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Type } from '@sinclair/typebox'
2-
import { Ok } from './validate'
2+
import { Ok } from './validate.js'
33

44
describe('type/compiler/Any', () => {
55
it('Should validate number', () => {

test/runtime/compiler/array.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Type } from '@sinclair/typebox'
2-
import { Ok, Fail } from './validate'
2+
import { Ok, Fail } from './validate.js'
33

44
describe('type/compiler/Array', () => {
55
it('Should validate an array of any', () => {

test/runtime/compiler/bigint.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Type } from '@sinclair/typebox'
2-
import { Ok, Fail } from './validate'
2+
import { Ok, Fail } from './validate.js'
33

44
describe('type/compiler/BigInt', () => {
55
it('Should not validate number', () => {

test/runtime/compiler/boolean.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Type } from '@sinclair/typebox'
2-
import { Ok, Fail } from './validate'
2+
import { Ok, Fail } from './validate.js'
33

44
describe('type/compiler/Boolean', () => {
55
it('Should validate a boolean', () => {

test/runtime/compiler/composite.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Type } from '@sinclair/typebox'
2-
import { Ok, Fail } from './validate'
2+
import { Ok, Fail } from './validate.js'
33

44
describe('type/compiler/Composite', () => {
55
it('Should compose two objects', () => {

test/runtime/compiler/custom.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Type, Kind, TypeRegistry } from '@sinclair/typebox'
2-
import { Ok, Fail } from './validate'
2+
import { Ok, Fail } from './validate.js'
33

44
describe('type/compiler/Custom', () => {
55
TypeRegistry.Set('BigInt', (schema, value) => typeof value === 'bigint')

test/runtime/compiler/date.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Type } from '@sinclair/typebox'
2-
import { Ok, Fail } from './validate'
2+
import { Ok, Fail } from './validate.js'
33

44
describe('type/compiler/Date', () => {
55
it('Should not validate number', () => {

test/runtime/compiler/enum.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Type } from '@sinclair/typebox'
2-
import { Ok, Fail } from './validate'
2+
import { Ok, Fail } from './validate.js'
33

44
describe('type/compiler/Enum', () => {
55
it('Should validate when emum uses default numeric values', () => {

test/runtime/compiler/integer.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Type } from '@sinclair/typebox'
2-
import { Ok, Fail } from './validate'
2+
import { Ok, Fail } from './validate.js'
33

44
describe('type/compiler/Integer', () => {
55
it('Should not validate number', () => {

test/runtime/compiler/intersect.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Type, Static } from '@sinclair/typebox'
2-
import { Ok, Fail } from './validate'
2+
import { Ok, Fail } from './validate.js'
33

44
describe('type/compiler/Intersect', () => {
55
it('Should intersect number and number', () => {

test/runtime/compiler/keyof.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Type } from '@sinclair/typebox'
2-
import { Ok, Fail } from './validate'
2+
import { Ok, Fail } from './validate.js'
33
import { strictEqual } from 'assert'
44

55
describe('type/compiler/KeyOf', () => {

test/runtime/compiler/literal.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Type } from '@sinclair/typebox'
2-
import { Ok, Fail } from './validate'
2+
import { Ok, Fail } from './validate.js'
33

44
describe('type/compiler/Literal', () => {
55
it('Should validate literal number', () => {

test/runtime/compiler/never.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Type } from '@sinclair/typebox'
2-
import { Fail } from './validate'
2+
import { Fail } from './validate.js'
33

44
describe('type/compiler/Never', () => {
55
it('Should not validate number', () => {

0 commit comments

Comments
 (0)