utilium 1.7.1 → 1.7.2
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 +1 -1
- package/dist/struct.js +1 -0
- package/package.json +1 -1
- package/src/struct.ts +2 -4
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
|
24
|
+
export declare function member<I extends {}>(type: primitive.Valid | ClassLike<I>, length?: number | (keyof I & string)): <V>(value: V, context: MemberContext) => V;
|
25
25
|
/**
|
26
26
|
* Serializes a struct into a Uint8Array
|
27
27
|
*/
|
package/dist/struct.js
CHANGED
@@ -97,6 +97,7 @@ export function struct(options = {}) {
|
|
97
97
|
/**
|
98
98
|
* Decorates a class member to be serialized
|
99
99
|
*/
|
100
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
100
101
|
export function member(type, length) {
|
101
102
|
return function (value, context) {
|
102
103
|
let name = context.name;
|
package/package.json
CHANGED
package/src/struct.ts
CHANGED
@@ -138,10 +138,8 @@ export function struct(options: Partial<Options> = {}) {
|
|
138
138
|
/**
|
139
139
|
* Decorates a class member to be serialized
|
140
140
|
*/
|
141
|
-
|
142
|
-
|
143
|
-
length?: number | string
|
144
|
-
) {
|
141
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
142
|
+
export function member<I extends {}>(type: primitive.Valid | ClassLike<I>, length?: number | (keyof I & string)) {
|
145
143
|
return function <V>(value: V, context: MemberContext): V {
|
146
144
|
let name = context.name;
|
147
145
|
if (typeof name == 'symbol') {
|