micro-packed
Advanced tools
Comparing version 0.3.1 to 0.3.2
@@ -169,3 +169,3 @@ import * as base from '@scure/base'; | ||
export declare function constant<T>(c: T): CoderType<T>; | ||
export declare function struct<T>(fields: StructRecord<T>): CoderType<StructInput<T>>; | ||
export declare function struct<T extends Record<string, any>>(fields: StructRecord<T>): CoderType<StructInput<T>>; | ||
export declare function tuple<T extends ArrLike<CoderType<any>>, O = Writable<{ | ||
@@ -172,0 +172,0 @@ [K in keyof T]: UnwrapCoder<T[K]>; |
@@ -735,3 +735,5 @@ import * as base from '@scure/base'; | ||
export function struct<T>(fields: StructRecord<T>): CoderType<StructInput<T>> { | ||
export function struct<T extends Record<string, any>>( | ||
fields: StructRecord<T> | ||
): CoderType<StructInput<T>> { | ||
if (Array.isArray(fields)) throw new Error('Packed.Struct: got array instead of object'); | ||
@@ -738,0 +740,0 @@ return wrap({ |
{ | ||
"name": "micro-packed", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"description": "Less painful binary encoding / decoding", | ||
@@ -31,3 +31,3 @@ "files": [ | ||
"devDependencies": { | ||
"micro-should": "0.2.0", | ||
"micro-should": "0.4.0", | ||
"prettier": "2.6.2", | ||
@@ -34,0 +34,0 @@ "typescript": "4.7.3" |
@@ -8,2 +8,8 @@ # micro-packed | ||
Comes with an separate [debugger package](./debugger/). | ||
## Usage | ||
> npm install micro-packed | ||
```ts | ||
@@ -10,0 +16,0 @@ import * as P from 'micro-packed'; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
99450
2199
259