Skip to content

Commit

Permalink
Add all types in the utils submodule as package-level exports (#25)
Browse files Browse the repository at this point in the history
## Motivation

`snaps` repos have continued to expand its usage of `utils` types in the
`superstruct` package.

Unfortunately, the workaround of importing from `superstruct/dist/utils`
is no longer available in the `@metamask/superstruct` fork, so importing
new `utils` types will require new version releases going forward.

To prevent this from blocking downstream development, this commit adds
all currently available types in the `utils` submodule as package-level
exports.

## Description

- Newly exports the following types: `Assign`, `If`, `IsUnion`,
`ObjectType`, `PartialObjectSchema`, `StructSchema`, `TupleSchema`

## References

- Closes #26
- Blocking MetaMask/snaps#2445
  - Blocking MetaMask/snaps#2514
  • Loading branch information
MajorLift authored Jun 26, 2024
1 parent 4a2a7b0 commit 0ff3957
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- Newly exports the following types: `Assign`, `If`, `IsUnion`, `ObjectType`, `PartialObjectSchema`, `StructSchema`, `TupleSchema` ([#25](https://github.com/MetaMask/superstruct/pull/25)).

## [3.0.0]

### Added
Expand Down
7 changes: 7 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,23 @@ export * from './structs/types.js';
export * from './structs/utilities.js';
export type {
AnyStruct,
Assign,
EnumSchema,
If,
InferStructTuple,
IsExactMatch,
IsMatch,
IsRecord,
IsTuple,
IsUnion,
ObjectSchema,
ObjectType,
OmitBy,
Optionalize,
PartialObjectSchema,
PickBy,
Simplify,
StructSchema,
TupleSchema,
UnionToIntersection,
} from './utils.js';

0 comments on commit 0ff3957

Please sign in to comment.