Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ jobs:
publish_dir: docs
publish_branch: gh-pages
- run: npx monopub delete devDependencies,scripts
- run: npx monopub exec 'npm publish --access public --provenance'
- run: npx monopub exec 'pnpm publish --access public --provenance'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"docdash": "2.0.2",
"eslint": "^9.29.0",
"eslint-plugin-ava": "^15.0.1",
"eslint-plugin-jsdoc": "^51.1.1",
"eslint-plugin-jsdoc": "^51.1.2",
"events": "^3.3.0",
"jsdoc": "^4.0.4",
"minami": "*",
Expand All @@ -51,7 +51,8 @@
"process": "^0.11.10",
"rimraf": "5.0.10",
"stream-browserify": "^3.0.0",
"svgo": "3.3.2",
"svgo": "4.0.0",
"typedoc": "0.28.5",
"typescript": "^5.8.3"
},
"packageManager": "pnpm@10.12.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/browserify-demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"@babel/core": "^7.27.4",
"babelify": "^10.0.0",
"browserify": "^17.0.1",
"cbor-bigdecimal": "10.0.5",
"cbor-bigdecimal": "link:../cbor-bigdecimal/",
"copyfiles": "^2.4.1",
"node-inspect-extracted": "*",
"rimraf": "5.0.10",
Expand Down
2 changes: 1 addition & 1 deletion packages/cbor-bigdecimal/dist/cbor-bigdecimal.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/cbor-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@
"readmeFilename": "README.md",
"dependencies": {
"bignumber.js": "^9.3.0",
"cbor": "10.0.5",
"cbor-bigdecimal": "10.0.5",
"cbor": "link:../cbor/",
"cbor-bigdecimal": "link:../cbor-bigdecimal/",
"commander": "^14.0.0",
"json-text-sequence": "1.0.1"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/cbor-web/dist/cbor.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/cbor-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"abort-controller": "3.0.0",
"base64-js": "^1.5.1",
"buffer": "^6.0.3",
"cbor": "10.0.5",
"cbor": "link:../cbor/",
"events": "^3.3.0",
"ieee754": "^1.2.1",
"inherits": "^2.0.4",
Expand Down
7 changes: 3 additions & 4 deletions packages/cbor-web/types/lib/commented.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ declare class Commented extends stream.Transform {
* @param {commentCallback} [cb] If specified, called on completion.
* @returns {Promise} If cb not specified.
* @throws {Error} Input required.
* @static
*/
static comment(input: string | Buffer | ArrayBuffer | Uint8Array | Uint8ClampedArray | DataView | stream.Readable, options?: CommentOptions | commentCallback | string | number, cb?: commentCallback): Promise<any>;
/**
Expand Down Expand Up @@ -45,19 +44,19 @@ declare class Commented extends stream.Transform {
/**
* @ignore
*/
_on_more(mt: any, len: any, parent_mt: any, pos: any): void;
_on_more(mt: any, len: any, _parent_mt: any, _pos: any): void;
/**
* @ignore
*/
_on_start_string(mt: any, len: any, parent_mt: any, pos: any): void;
_on_start_string(mt: any, len: any, _parent_mt: any, _pos: any): void;
/**
* @ignore
*/
_on_start(mt: any, tag: any, parent_mt: any, pos: any): void;
/**
* @ignore
*/
_on_stop(mt: any): void;
_on_stop(_mt: any): void;
/**
* @private
*/
Expand Down
4 changes: 0 additions & 4 deletions packages/cbor-web/types/lib/decoder.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ declare class Decoder extends BinaryParseStream {
* @returns {ExtendedResults|any} The decoded value.
* @throws {UnexpectedDataError} Data is left over after decoding.
* @throws {Error} Insufficient data.
* @static
*/
static decodeFirstSync(input: BufferLike, options?: DecoderOptions | string): ExtendedResults | any;
/**
Expand All @@ -49,7 +48,6 @@ declare class Decoder extends BinaryParseStream {
* @returns {Array<ExtendedResults>|Array<any>} Array of all found items.
* @throws {TypeError} No input provided.
* @throws {Error} Insufficient data provided.
* @static
*/
static decodeAllSync(input: BufferLike, options?: DecoderOptions | string): Array<ExtendedResults> | Array<any>;
/**
Expand All @@ -66,7 +64,6 @@ declare class Decoder extends BinaryParseStream {
* @returns {Promise<ExtendedResults|any>} Returned even if callback is
* specified.
* @throws {TypeError} No input provided.
* @static
*/
static decodeFirst(input: BufferLike, options?: DecoderOptions | decodeCallback | string, cb?: decodeCallback): Promise<ExtendedResults | any>;
/**
Expand All @@ -86,7 +83,6 @@ declare class Decoder extends BinaryParseStream {
* @returns {Promise<Array<ExtendedResults>|Array<any>>} Even if callback
* is specified.
* @throws {TypeError} No input specified.
* @static
*/
static decodeAll(input: BufferLike, options?: DecoderOptions | ((error: Error, value: Array<ExtendedResults> | Array<any>) => any) | string, cb?: (error: Error, value: Array<ExtendedResults> | Array<any>) => any): Promise<Array<ExtendedResults> | Array<any>>;
/**
Expand Down
2 changes: 1 addition & 1 deletion packages/cbor-web/types/lib/diagnose.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ import Decoder = require("./decoder");
/**
* Things that can act as inputs, from which a NoFilter can be created.
*/
type BufferLike = string | Buffer | ArrayBuffer | Uint8Array | Uint8ClampedArray | DataView | stream.Readable;
type BufferLike = string | Buffer | ArrayBuffer | ArrayBufferView | DataView | stream.Readable;
type DiagnoseOptions = {
/**
* Output between detected objects.
Expand Down
13 changes: 4 additions & 9 deletions packages/cbor-web/types/lib/encoder.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ declare class Encoder extends stream.Transform {
* @param {any} obj The object to encode.
* @param {EncodingOptions} [options={}] Passed to the Encoder constructor.
* @returns {Buffer} The encoded objects.
* @static
*/
static encodeOne(obj: any, options?: EncodingOptions): Buffer;
/**
Expand All @@ -194,17 +193,13 @@ declare class Encoder extends stream.Transform {
* @returns {Promise<Buffer>} A promise for the encoded buffer.
*/
static encodeAsync(obj: any, options?: EncodingOptions): Promise<Buffer>;
static set SEMANTIC_TYPES(val: {
[x: string]: EncodeFunction;
});
static set SEMANTIC_TYPES(val: SemanticMap);
/**
* The currently supported set of semantic types. May be modified by plugins.
*
* @type {SemanticMap}
*/
static get SEMANTIC_TYPES(): {
[x: string]: EncodeFunction;
};
static get SEMANTIC_TYPES(): SemanticMap;
/**
* Reset the supported semantic types to the original set, before any
* plugins modified the list.
Expand Down Expand Up @@ -328,11 +323,11 @@ declare class Encoder extends stream.Transform {
*/
_pushUndefined(obj: undefined): boolean;
/**
* @param {null} obj Ignored.
* @param {null} _obj Ignored.
* @returns {boolean} True on success.
* @ignore
*/
_pushNull(obj: null): boolean;
_pushNull(_obj: null): boolean;
/**
* @param {number} tag Tag number to encode.
* @returns {boolean} True on success.
Expand Down
8 changes: 4 additions & 4 deletions packages/cbor-web/types/lib/map.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ declare class CborMap extends Map<any, any> {
* Returns a new Iterator object that contains the [key, value] pairs for
* each element in the Map object in insertion order.
*
* @returns {IterableIterator<any>} Key value pairs.
* @returns {MapIterator<any>} Key value pairs.
* @yields {any[]} Key value pairs.
*/
entries(): IterableIterator<any>;
entries(): MapIterator<any>;
/**
* Executes a provided function once per each key/value pair in the Map
* object, in insertion order.
Expand All @@ -72,7 +72,7 @@ declare class CborMap extends Map<any, any> {
* Returns a new Iterator object that contains the [key, value] pairs for
* each element in the Map object in insertion order.
*
* @returns {IterableIterator<any>} Key value pairs.
* @returns {MapIterator<any>} Key value pairs.
*/
[Symbol.iterator](): IterableIterator<any>;
[Symbol.iterator](): MapIterator<any>;
}
8 changes: 2 additions & 6 deletions packages/cbor-web/types/lib/tagged.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,14 @@ export = Tagged;
* be an extension point you're not yet expecting.
*/
declare class Tagged {
static set TAGS(val: {
[x: string]: TagFunction;
});
static set TAGS(val: TagMap);
/**
* The current set of supported tags. May be modified by plugins.
*
* @type {TagMap}
* @static
*/
static get TAGS(): {
[x: string]: TagFunction;
};
static get TAGS(): TagMap;
/**
* Reset the supported tags to the original set, before any plugins modified
* the list.
Expand Down
6 changes: 3 additions & 3 deletions packages/cbor-web/types/lib/utils.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ export namespace utf8 {
let checksUTF8: boolean;
}
export function isBufferish(b: any): boolean;
export function bufferishToBuffer(b: any): Buffer;
export function bufferishToBuffer(b: any): Buffer<ArrayBuffer>;
export function parseCBORint(ai: any, buf: any): any;
export function writeHalf(buf: any, half: any): boolean;
export function parseHalf(buf: any): number;
export function parseCBORfloat(buf: any): any;
export function hex(s: any): Buffer;
export function bin(s: any): Buffer;
export function hex(s: any): Buffer<ArrayBuffer>;
export function bin(s: any): Buffer<ArrayBuffer>;
export function arrayEqual(a: any, b: any): any;
export function bufferToBigInt(buf: any): bigint;
export function cborValueToString(val: any, float_bytes?: number): any;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ declare class BinaryParseStream extends stream.Transform {
*/
_parse(): Generator<number, any, Buffer>;
__restart(): void;
__parser: Generator<number, any, Buffer>;
__parser: Generator<number, any, Buffer<ArrayBufferLike>>;
}
import stream = require("stream");
import NoFilter = require("nofilter");
6 changes: 3 additions & 3 deletions packages/cbor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ $ npm install --save cbor
```

**NOTE**
If you are going to use this on the web, use [cbor-web](../cbor-web) instead.
If you are going to use this on the web, use [cbor-web](../cbor-web/) instead.

If you need support for encoding and decoding BigDecimal fractions (tag 4) or
BigFloats (tag 5), please see [cbor-bigdecimal](../cbor-bigdecimal).
BigFloats (tag 5), please see [cbor-bigdecimal](../cbor-bigdecimal/).

## Documentation:

See the full API [documentation](http://hildjj.github.io/node-cbor/).

For a command-line interface, see [cbor-cli](../cbor-cli).
For a command-line interface, see [cbor-cli](../cbor-cli/).

Example:
```js
Expand Down
4 changes: 2 additions & 2 deletions packages/cbor/lib/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class CborMap extends Map {
* Returns a new Iterator object that contains the [key, value] pairs for
* each element in the Map object in insertion order.
*
* @returns {IterableIterator<any>} Key value pairs.
* @returns {MapIterator<any>} Key value pairs.
* @yields {any[]} Key value pairs.
*/
*entries() {
Expand All @@ -127,7 +127,7 @@ class CborMap extends Map {
* Returns a new Iterator object that contains the [key, value] pairs for
* each element in the Map object in insertion order.
*
* @returns {IterableIterator<any>} Key value pairs.
* @returns {MapIterator<any>} Key value pairs.
*/
[Symbol.iterator]() {
return this.entries();
Expand Down
7 changes: 3 additions & 4 deletions packages/cbor/types/lib/commented.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ declare class Commented extends stream.Transform {
* @param {commentCallback} [cb] If specified, called on completion.
* @returns {Promise} If cb not specified.
* @throws {Error} Input required.
* @static
*/
static comment(input: string | Buffer | ArrayBuffer | Uint8Array | Uint8ClampedArray | DataView | stream.Readable, options?: CommentOptions | commentCallback | string | number, cb?: commentCallback): Promise<any>;
/**
Expand Down Expand Up @@ -45,19 +44,19 @@ declare class Commented extends stream.Transform {
/**
* @ignore
*/
_on_more(mt: any, len: any, parent_mt: any, pos: any): void;
_on_more(mt: any, len: any, _parent_mt: any, _pos: any): void;
/**
* @ignore
*/
_on_start_string(mt: any, len: any, parent_mt: any, pos: any): void;
_on_start_string(mt: any, len: any, _parent_mt: any, _pos: any): void;
/**
* @ignore
*/
_on_start(mt: any, tag: any, parent_mt: any, pos: any): void;
/**
* @ignore
*/
_on_stop(mt: any): void;
_on_stop(_mt: any): void;
/**
* @private
*/
Expand Down
4 changes: 0 additions & 4 deletions packages/cbor/types/lib/decoder.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ declare class Decoder extends BinaryParseStream {
* @returns {ExtendedResults|any} The decoded value.
* @throws {UnexpectedDataError} Data is left over after decoding.
* @throws {Error} Insufficient data.
* @static
*/
static decodeFirstSync(input: BufferLike, options?: DecoderOptions | string): ExtendedResults | any;
/**
Expand All @@ -49,7 +48,6 @@ declare class Decoder extends BinaryParseStream {
* @returns {Array<ExtendedResults>|Array<any>} Array of all found items.
* @throws {TypeError} No input provided.
* @throws {Error} Insufficient data provided.
* @static
*/
static decodeAllSync(input: BufferLike, options?: DecoderOptions | string): Array<ExtendedResults> | Array<any>;
/**
Expand All @@ -66,7 +64,6 @@ declare class Decoder extends BinaryParseStream {
* @returns {Promise<ExtendedResults|any>} Returned even if callback is
* specified.
* @throws {TypeError} No input provided.
* @static
*/
static decodeFirst(input: BufferLike, options?: DecoderOptions | decodeCallback | string, cb?: decodeCallback): Promise<ExtendedResults | any>;
/**
Expand All @@ -86,7 +83,6 @@ declare class Decoder extends BinaryParseStream {
* @returns {Promise<Array<ExtendedResults>|Array<any>>} Even if callback
* is specified.
* @throws {TypeError} No input specified.
* @static
*/
static decodeAll(input: BufferLike, options?: DecoderOptions | ((error: Error, value: Array<ExtendedResults> | Array<any>) => any) | string, cb?: (error: Error, value: Array<ExtendedResults> | Array<any>) => any): Promise<Array<ExtendedResults> | Array<any>>;
/**
Expand Down
2 changes: 1 addition & 1 deletion packages/cbor/types/lib/diagnose.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ import Decoder = require("./decoder");
/**
* Things that can act as inputs, from which a NoFilter can be created.
*/
type BufferLike = string | Buffer | ArrayBuffer | Uint8Array | Uint8ClampedArray | DataView | stream.Readable;
type BufferLike = string | Buffer | ArrayBuffer | ArrayBufferView | DataView | stream.Readable;
type DiagnoseOptions = {
/**
* Output between detected objects.
Expand Down
13 changes: 4 additions & 9 deletions packages/cbor/types/lib/encoder.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ declare class Encoder extends stream.Transform {
* @param {any} obj The object to encode.
* @param {EncodingOptions} [options={}] Passed to the Encoder constructor.
* @returns {Buffer} The encoded objects.
* @static
*/
static encodeOne(obj: any, options?: EncodingOptions): Buffer;
/**
Expand All @@ -194,17 +193,13 @@ declare class Encoder extends stream.Transform {
* @returns {Promise<Buffer>} A promise for the encoded buffer.
*/
static encodeAsync(obj: any, options?: EncodingOptions): Promise<Buffer>;
static set SEMANTIC_TYPES(val: {
[x: string]: EncodeFunction;
});
static set SEMANTIC_TYPES(val: SemanticMap);
/**
* The currently supported set of semantic types. May be modified by plugins.
*
* @type {SemanticMap}
*/
static get SEMANTIC_TYPES(): {
[x: string]: EncodeFunction;
};
static get SEMANTIC_TYPES(): SemanticMap;
/**
* Reset the supported semantic types to the original set, before any
* plugins modified the list.
Expand Down Expand Up @@ -328,11 +323,11 @@ declare class Encoder extends stream.Transform {
*/
_pushUndefined(obj: undefined): boolean;
/**
* @param {null} obj Ignored.
* @param {null} _obj Ignored.
* @returns {boolean} True on success.
* @ignore
*/
_pushNull(obj: null): boolean;
_pushNull(_obj: null): boolean;
/**
* @param {number} tag Tag number to encode.
* @returns {boolean} True on success.
Expand Down
Loading