Skip to content

Commit

Permalink
feat: make options optional for array, string, and struct helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
fallenoak authored Dec 4, 2023
1 parent 8fb1e80 commit 29e9e82
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import { validateType } from './util.js';
import { openStream } from './stream/util.js';
import { IoContext, IoSource, IoStream, IoType } from './types.js';

const array = (type: IoType, options: ArrayOptions) =>
const array = (type: IoType, options: ArrayOptions = {}) =>
new ArrayIo(type, options);

const string = (options: StringOptions) => new StringIo(options);
const string = (options: StringOptions = {}) => new StringIo(options);

const struct = (fields: StructFields, options: StructOptions) =>
const struct = (fields: StructFields, options: StructOptions = {}) =>
new StructIo(fields, options);

const tlv = (
Expand Down

0 comments on commit 29e9e82

Please sign in to comment.