diff --git a/packages/typed-binary/src/structure/array.ts b/packages/typed-binary/src/structure/array.ts index b7b6910..3f9b95a 100644 --- a/packages/typed-binary/src/structure/array.ts +++ b/packages/typed-binary/src/structure/array.ts @@ -1,6 +1,6 @@ import { ValidationError } from '../error.ts'; -import type { IMeasurer, ISerialInput, ISerialOutput } from '../io/types.ts'; import { Measurer } from '../io/measurer.ts'; +import type { IMeasurer, ISerialInput, ISerialOutput } from '../io/types.ts'; import type { ParseUnwrapped } from '../utilityTypes.ts'; import { type AnySchema, @@ -82,7 +82,9 @@ export class ArraySchema extends Schema< } } -export const arrayOf = ( +export function arrayOf( elementSchema: TSchema, length: number, -) => new ArraySchema(elementSchema, length); +) { + return new ArraySchema(elementSchema, length); +} diff --git a/packages/typed-binary/src/structure/baseTypes.ts b/packages/typed-binary/src/structure/baseTypes.ts index 2fe0a2c..2a4ef20 100644 --- a/packages/typed-binary/src/structure/baseTypes.ts +++ b/packages/typed-binary/src/structure/baseTypes.ts @@ -1,5 +1,5 @@ -import type { IMeasurer, ISerialInput, ISerialOutput } from '../io/types.ts'; import { Measurer } from '../io/measurer.ts'; +import type { IMeasurer, ISerialInput, ISerialOutput } from '../io/types.ts'; import { MaxValue, Schema } from './types.ts'; //// diff --git a/packages/typed-binary/src/structure/chars.ts b/packages/typed-binary/src/structure/chars.ts index a698be2..977bd6f 100644 --- a/packages/typed-binary/src/structure/chars.ts +++ b/packages/typed-binary/src/structure/chars.ts @@ -1,6 +1,6 @@ import { ValidationError } from '../error.ts'; -import type { IMeasurer, ISerialInput, ISerialOutput } from '../io/types.ts'; import { Measurer } from '../io/measurer.ts'; +import type { IMeasurer, ISerialInput, ISerialOutput } from '../io/types.ts'; import { Schema } from './types.ts'; export class CharsSchema extends Schema { @@ -35,4 +35,6 @@ export class CharsSchema extends Schema { } } -export const chars = (length: T) => new CharsSchema(length); +export function chars(length: T) { + return new CharsSchema(length); +} diff --git a/packages/typed-binary/src/structure/concat.ts b/packages/typed-binary/src/structure/concat.ts index 1671163..3f977fe 100644 --- a/packages/typed-binary/src/structure/concat.ts +++ b/packages/typed-binary/src/structure/concat.ts @@ -1,6 +1,6 @@ +import type { MergeRecordUnion } from '../utilityTypes.ts'; import { type AnyObjectSchema, ObjectSchema } from './object.ts'; import type { PropertiesOf } from './types.ts'; -import type { MergeRecordUnion } from '../utilityTypes.ts'; type Concat = ObjectSchema< MergeRecordUnion> diff --git a/packages/typed-binary/src/structure/dynamicArray.ts b/packages/typed-binary/src/structure/dynamicArray.ts index 4fca2fe..c3a50a1 100644 --- a/packages/typed-binary/src/structure/dynamicArray.ts +++ b/packages/typed-binary/src/structure/dynamicArray.ts @@ -1,5 +1,5 @@ -import type { IMeasurer, ISerialInput, ISerialOutput } from '../io/types.ts'; import { Measurer } from '../io/measurer.ts'; +import type { IMeasurer, ISerialInput, ISerialOutput } from '../io/types.ts'; import type { ParseUnwrapped } from '../utilityTypes.ts'; import { type AnySchema, diff --git a/packages/typed-binary/src/structure/keyed.ts b/packages/typed-binary/src/structure/keyed.ts index 47bb2a3..cad2bce 100644 --- a/packages/typed-binary/src/structure/keyed.ts +++ b/packages/typed-binary/src/structure/keyed.ts @@ -1,6 +1,6 @@ import { UnresolvedReferenceError } from '../error.ts'; -import type { IMeasurer, ISerialInput, ISerialOutput } from '../io/types.ts'; import { Measurer } from '../io/measurer.ts'; +import type { IMeasurer, ISerialInput, ISerialOutput } from '../io/types.ts'; import type { ParseUnwrapped, Parsed } from '../utilityTypes.ts'; import { type AnySchema, diff --git a/packages/typed-binary/src/structure/object.ts b/packages/typed-binary/src/structure/object.ts index 94d3cb8..fad8ed6 100644 --- a/packages/typed-binary/src/structure/object.ts +++ b/packages/typed-binary/src/structure/object.ts @@ -1,5 +1,5 @@ -import type { IMeasurer, ISerialInput, ISerialOutput } from '../io/types.ts'; import { Measurer } from '../io/measurer.ts'; +import type { IMeasurer, ISerialInput, ISerialOutput } from '../io/types.ts'; import type { ParseUnwrappedRecord, Parsed } from '../utilityTypes.ts'; import { type AnySchema, diff --git a/packages/typed-binary/src/structure/optional.ts b/packages/typed-binary/src/structure/optional.ts index 4613335..eba4268 100644 --- a/packages/typed-binary/src/structure/optional.ts +++ b/packages/typed-binary/src/structure/optional.ts @@ -1,5 +1,5 @@ -import type { IMeasurer, ISerialInput, ISerialOutput } from '../io/types.ts'; import { Measurer } from '../io/measurer.ts'; +import type { IMeasurer, ISerialInput, ISerialOutput } from '../io/types.ts'; import type { ParseUnwrapped } from '../utilityTypes.ts'; import { type AnySchema, diff --git a/packages/typed-binary/src/structure/tuple.ts b/packages/typed-binary/src/structure/tuple.ts index 8e4173a..bcd8fa4 100644 --- a/packages/typed-binary/src/structure/tuple.ts +++ b/packages/typed-binary/src/structure/tuple.ts @@ -1,6 +1,6 @@ import { ValidationError } from '../error.ts'; -import type { IMeasurer, ISerialInput, ISerialOutput } from '../io/types.ts'; import { Measurer } from '../io/measurer.ts'; +import type { IMeasurer, ISerialInput, ISerialOutput } from '../io/types.ts'; import type { Parsed } from '../utilityTypes.ts'; import { type AnySchema, @@ -88,6 +88,8 @@ export class TupleSchema< } } -export const tupleOf = ( +export function tupleOf( schemas: TSchema, -) => new TupleSchema(schemas); +) { + return new TupleSchema(schemas); +} diff --git a/packages/typed-binary/src/structure/typedArray.ts b/packages/typed-binary/src/structure/typedArray.ts index 38be5e6..c427a4c 100644 --- a/packages/typed-binary/src/structure/typedArray.ts +++ b/packages/typed-binary/src/structure/typedArray.ts @@ -1,5 +1,5 @@ -import type { IMeasurer, ISerialInput, ISerialOutput } from '../io/types.ts'; import { Measurer } from '../io/measurer.ts'; +import type { IMeasurer, ISerialInput, ISerialOutput } from '../io/types.ts'; import type { Parsed } from '../utilityTypes.ts'; import { type MaxValue, Schema } from './types.ts'; diff --git a/packages/typed-binary/src/test/unwrap.test.ts b/packages/typed-binary/src/test/unwrap.test.ts index 0ba4bd5..3337b6f 100644 --- a/packages/typed-binary/src/test/unwrap.test.ts +++ b/packages/typed-binary/src/test/unwrap.test.ts @@ -2,11 +2,11 @@ import { describe, expectTypeOf, it } from 'vitest'; // Importing from the public API import type { - Unwrap, - ISchema, IKeyedSchema, - UnwrapRecord, + ISchema, + Unwrap, UnwrapArray, + UnwrapRecord, } from '../index.ts'; describe('Unwrap', () => {