utilium 1.7.0 → 1.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/struct.d.ts CHANGED
@@ -21,7 +21,7 @@ export declare function struct(options?: Partial<Options>): <const T extends Sta
21
21
  /**
22
22
  * Decorates a class member to be serialized
23
23
  */
24
- export declare function member<I extends Record<string, unknown>>(type: primitive.Valid | ClassLike<I>, length?: number): <V>(value: V, context: MemberContext) => V;
24
+ export declare function member<I extends Record<string, unknown>>(type: primitive.Valid | ClassLike<I>, length?: number | string): <V>(value: V, context: MemberContext) => V;
25
25
  /**
26
26
  * Serializes a struct into a Uint8Array
27
27
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "utilium",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "description": "Typescript utilities",
5
5
  "funding": {
6
6
  "type": "individual",
package/src/struct.ts CHANGED
@@ -138,7 +138,10 @@ export function struct(options: Partial<Options> = {}) {
138
138
  /**
139
139
  * Decorates a class member to be serialized
140
140
  */
141
- export function member<I extends Record<string, unknown>>(type: primitive.Valid | ClassLike<I>, length?: number) {
141
+ export function member<I extends Record<string, unknown>>(
142
+ type: primitive.Valid | ClassLike<I>,
143
+ length?: number | string
144
+ ) {
142
145
  return function <V>(value: V, context: MemberContext): V {
143
146
  let name = context.name;
144
147
  if (typeof name == 'symbol') {