Skip to content

Commit

Permalink
extract layouting into standalone package and adjust for changes (#738)
Browse files Browse the repository at this point in the history
  • Loading branch information
nonergodic authored Nov 21, 2024
1 parent 394b7fd commit 0c57292
Show file tree
Hide file tree
Showing 28 changed files with 191 additions and 2,130 deletions.
5 changes: 3 additions & 2 deletions core/base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@
"dist/cjs"
],
"dependencies": {
"@scure/base": "^1.1.3"
"@scure/base": "^1.1.3",
"binary-layout": "^1.0.3"
},
"sideEffects": false,
"scripts": {
Expand All @@ -132,4 +133,4 @@
"prettier": "prettier --write ./src"
},
"type": "module"
}
}
4 changes: 1 addition & 3 deletions core/base/src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ export * from "./array.js";
export * from "./mapping.js";
export * from "./metaprogramming.js";
export * from "./misc.js";

export * from "./layout/index.js";
export * from "./layout.js";

export * as amount from "./amount.js";
export * as layout from "./layout/index.js";
export * as encoding from "./encoding.js";
26 changes: 26 additions & 0 deletions core/base/src/utils/layout.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
export {
type Layout,
type DeriveType as LayoutToType,
type FixedConversion,
type CustomConversion,
type Endianness,
type CustomizableBytes,
type CustomizableBytesReturn,
type Discriminator,
type FixedItemsOf as FixedItemsOfLayout,
type DynamicItemsOf as DynamicItemsOfLayout,
type Bitset,
type BitsetItem,
serialize as serializeLayout,
deserialize as deserializeLayout,
buildDiscriminator as layoutDiscriminator,
calcSize as calcLayoutSize,
calcStaticSize as calcStaticLayoutSize,
customizableBytes,
addFixedValues,
fixedItemsOf as fixedItemsOfLayout,
dynamicItemsOf as dynamicItemsOfLayout,
enumItem,
optionItem,
bitsetItem
} from "binary-layout";
225 changes: 0 additions & 225 deletions core/base/src/utils/layout/deserialize.ts

This file was deleted.

Loading

0 comments on commit 0c57292

Please sign in to comment.