Skip to content

Commit

Permalink
Remove experimental Set tag, wait for working group.
Browse files Browse the repository at this point in the history
  • Loading branch information
hildjj committed Aug 2, 2021
1 parent 7724a01 commit 528ed11
Show file tree
Hide file tree
Showing 21 changed files with 68 additions and 65 deletions.
14 changes: 7 additions & 7 deletions docs/Encoder.html
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ <h4 class="name" id=".SEMANTIC_TYPES"><span class="type-signature">(static) </sp

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="encoder.js.html">encoder.js</a>, <a href="encoder.js.html#line1033">line 1033</a>
<a href="encoder.js.html">encoder.js</a>, <a href="encoder.js.html#line1035">line 1035</a>
</li></ul></dd>


Expand Down Expand Up @@ -437,7 +437,7 @@ <h4 class="name" id=".encode"><span class="type-signature">(static) </span>encod

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="encoder.js.html">encoder.js</a>, <a href="encoder.js.html#line978">line 978</a>
<a href="encoder.js.html">encoder.js</a>, <a href="encoder.js.html#line980">line 980</a>
</li></ul></dd>


Expand Down Expand Up @@ -613,7 +613,7 @@ <h4 class="name" id=".encodeAsync"><span class="type-signature">(static) </span>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="encoder.js.html">encoder.js</a>, <a href="encoder.js.html#line1017">line 1017</a>
<a href="encoder.js.html">encoder.js</a>, <a href="encoder.js.html#line1019">line 1019</a>
</li></ul></dd>


Expand Down Expand Up @@ -807,7 +807,7 @@ <h4 class="name" id=".encodeCanonical"><span class="type-signature">(static) </s

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="encoder.js.html">encoder.js</a>, <a href="encoder.js.html#line989">line 989</a>
<a href="encoder.js.html">encoder.js</a>, <a href="encoder.js.html#line991">line 991</a>
</li></ul></dd>


Expand Down Expand Up @@ -982,7 +982,7 @@ <h4 class="name" id=".encodeIndefinite"><span class="type-signature">(static) </

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="encoder.js.html">encoder.js</a>, <a href="encoder.js.html#line917">line 917</a>
<a href="encoder.js.html">encoder.js</a>, <a href="encoder.js.html#line919">line 919</a>
</li></ul></dd>


Expand Down Expand Up @@ -1266,7 +1266,7 @@ <h4 class="name" id=".encodeOne"><span class="type-signature">(static) </span>en

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="encoder.js.html">encoder.js</a>, <a href="encoder.js.html#line1003">line 1003</a>
<a href="encoder.js.html">encoder.js</a>, <a href="encoder.js.html#line1005">line 1005</a>
</li></ul></dd>


Expand Down Expand Up @@ -1796,7 +1796,7 @@ <h4 class="name" id=".reset"><span class="type-signature">(static) </span>reset<

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="encoder.js.html">encoder.js</a>, <a href="encoder.js.html#line1045">line 1045</a>
<a href="encoder.js.html">encoder.js</a>, <a href="encoder.js.html#line1047">line 1047</a>
</li></ul></dd>


Expand Down
12 changes: 6 additions & 6 deletions docs/Tagged.html
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ <h4 class="name" id="Tagged"><span class="type-signature"></span>new Tagged<span

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="tagged.js.html">tagged.js</a>, <a href="tagged.js.html#line262">line 262</a>
<a href="tagged.js.html">tagged.js</a>, <a href="tagged.js.html#line263">line 263</a>
</li></ul></dd>


Expand Down Expand Up @@ -332,7 +332,7 @@ <h4 class="name" id=".TAGS"><span class="type-signature">(static) </span>TAGS<sp

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="tagged.js.html">tagged.js</a>, <a href="tagged.js.html#line352">line 352</a>
<a href="tagged.js.html">tagged.js</a>, <a href="tagged.js.html#line353">line 353</a>
</li></ul></dd>


Expand Down Expand Up @@ -417,7 +417,7 @@ <h4 class="name" id=".reset"><span class="type-signature">(static) </span>reset<

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="tagged.js.html">tagged.js</a>, <a href="tagged.js.html#line364">line 364</a>
<a href="tagged.js.html">tagged.js</a>, <a href="tagged.js.html#line365">line 365</a>
</li></ul></dd>


Expand Down Expand Up @@ -503,7 +503,7 @@ <h4 class="name" id="convert"><span class="type-signature"></span>convert<span c

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="tagged.js.html">tagged.js</a>, <a href="tagged.js.html#line326">line 326</a>
<a href="tagged.js.html">tagged.js</a>, <a href="tagged.js.html#line327">line 327</a>
</li></ul></dd>


Expand Down Expand Up @@ -665,7 +665,7 @@ <h4 class="name" id="encodeCBOR"><span class="type-signature"></span>encodeCBOR<

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="tagged.js.html">tagged.js</a>, <a href="tagged.js.html#line310">line 310</a>
<a href="tagged.js.html">tagged.js</a>, <a href="tagged.js.html#line311">line 311</a>
</li></ul></dd>


Expand Down Expand Up @@ -800,7 +800,7 @@ <h4 class="name" id="toString"><span class="type-signature"></span>toString<span

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="tagged.js.html">tagged.js</a>, <a href="tagged.js.html#line301">line 301</a>
<a href="tagged.js.html">tagged.js</a>, <a href="tagged.js.html#line302">line 302</a>
</li></ul></dd>


Expand Down
2 changes: 2 additions & 0 deletions docs/encoder.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -780,9 +780,11 @@ <h1 class="page-title">encoder.js</h1>
* @ignore
*/
static _pushSet(gen, obj) {
/* TODO: track draft-bormann-cbor-cddl-map-like-data
if (!gen._pushTag(TAG.SET)) {
return false
}
*/
if (!gen._pushInt(obj.size, MT.ARRAY)) {
return false
}
Expand Down
2 changes: 1 addition & 1 deletion docs/example/bundle-bf.js

Large diffs are not rendered by default.

52 changes: 26 additions & 26 deletions docs/example/bundle-wp.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/example/cbor.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/example/index-p.9907d27d.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion docs/example/index-p.fbc18b7d.js

This file was deleted.

2 changes: 1 addition & 1 deletion docs/example/index-p.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<!DOCTYPE html><html><head><meta charset="utf-8"><title>CBOR/web (parcel)</title><link rel="stylesheet" href="index-p.deed4ac3.css"></head><body> <h2>CBOR converter</h2> <div class="container"> <div class="input"> <h3>Input</h3> <div class="cmd"> <select id="input-fmt"> <option>JSON</option> <option>hex</option> <option>base64</option> </select> <span id="to">&rarr;&rarr;&rarr; to &rarr;&rarr;&rarr;</span> </div> <textarea id="input-text" rows="30" cols="50" autofocus>{
"type": "here"
}</textarea> </div> <div class="output"> <h3>Output</h3> <div class="cmd"> <select id="output-fmt"> <option>commented</option> <option>diagnostic</option> <option>hex</option> <option>base64</option> <option>js</option> <option>JSON</option> </select> <button id="copy">Copy to input</button> </div> <textarea id="output-text" rows="30" cols="50" readonly></textarea> </div> </div> <div class="power"> Powered by <a href="https://github.com/hildjj/node-cbor/">node-cbor</a>. <a href="https://github.com/hildjj/node-cbor/tree/main/packages/parcel-demo">Source</a> </div> <script src="index-p.fbc18b7d.js"></script> </body></html>
}</textarea> </div> <div class="output"> <h3>Output</h3> <div class="cmd"> <select id="output-fmt"> <option>commented</option> <option>diagnostic</option> <option>hex</option> <option>base64</option> <option>js</option> <option>JSON</option> </select> <button id="copy">Copy to input</button> </div> <textarea id="output-text" rows="30" cols="50" readonly></textarea> </div> </div> <div class="power"> Powered by <a href="https://github.com/hildjj/node-cbor/">node-cbor</a>. <a href="https://github.com/hildjj/node-cbor/tree/main/packages/parcel-demo">Source</a> </div> <script src="index-p.9907d27d.js"></script> </body></html>
7 changes: 4 additions & 3 deletions docs/tagged.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,10 @@ <h1 class="page-title">tagged.js</h1>
return tag
},
// Regular expression; see Section 2.4.4.3
35: v => new RegExp(v),
// https://github.com/input-output-hk/cbor-sets-spec/blob/master/CBOR_SETS.md
258: v => new Set(v)
35: v => new RegExp(v)

// TODO: track draft-bormann-cbor-cddl-map-like-data
// 258: v => new Set(v)
}

const TYPED_ARRAY_TAGS = {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@cto.af/eslint-config": "*",
"ava": "4.0.0-alpha.2",
"bignumber.js": "^9.0.1",
"eslint": "^7.31.0",
"eslint": "^7.32.0",
"eslint-plugin-ava": "^12.0.0",
"eslint-plugin-node": "^11.1.0",
"jsdoc": "^3.6.7",
Expand Down
2 changes: 1 addition & 1 deletion packages/cbor-bigdecimal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
},
"devDependencies": {
"bignumber.js": "^9.0.1",
"webpack": "^5.47.0",
"webpack": "^5.48.0",
"webpack-cli": "^4.7.2"
}
}
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 @@ -29,7 +29,7 @@
"stream-browserify": "^3.0.0",
"string_decoder": "^1.3.0",
"util-deprecate": "^1.0.2",
"webpack": "^5.47.0",
"webpack": "^5.48.0",
"webpack-cli": "^4.7.2"
}
}
6 changes: 3 additions & 3 deletions packages/cbor/lib/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ exports.TAG = {
BASE64URL: 33,
BASE64: 34,
REGEXP: 35,
MIME: 36,
// https://github.com/input-output-hk/cbor-sets-spec/blob/master/CBOR_SETS.md
SET: 258
MIME: 36
// TODO: track draft-bormann-cbor-cddl-map-like-data
// SET: 258
}

/**
Expand Down
2 changes: 2 additions & 0 deletions packages/cbor/lib/encoder.js
Original file line number Diff line number Diff line change
Expand Up @@ -739,9 +739,11 @@ Call removeLoopDetectors before resuming.`)
* @ignore
*/
static _pushSet(gen, obj) {
/* TODO: track draft-bormann-cbor-cddl-map-like-data
if (!gen._pushTag(TAG.SET)) {
return false
}
*/
if (!gen._pushInt(obj.size, MT.ARRAY)) {
return false
}
Expand Down
7 changes: 4 additions & 3 deletions packages/cbor/lib/tagged.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,10 @@ const TAGS = {
return tag
},
// Regular expression; see Section 2.4.4.3
35: v => new RegExp(v),
// https://github.com/input-output-hk/cbor-sets-spec/blob/master/CBOR_SETS.md
258: v => new Set(v)
35: v => new RegExp(v)

// TODO: track draft-bormann-cbor-cddl-map-like-data
// 258: v => new Set(v)
}

const TYPED_ARRAY_TAGS = {
Expand Down
10 changes: 4 additions & 6 deletions packages/cbor/test/cases.js
Original file line number Diff line number Diff line change
Expand Up @@ -676,12 +676,10 @@ exports.encodeGood = [
f7 -- undefined
0xf7`],
[new Set([1, 2]), '[1, 2]', `
d9 -- next 2 bytes
0102 -- Tag #258
82 -- Array, 2 items
01 -- [0], 1
02 -- [1], 2
0xd90102820102`],
82 -- Array, 2 items
01 -- [0], 1
02 -- [1], 2
0x820102`],

// internal types
[new NoFilter(Buffer.from([1, 2, 3, 4])), 'h\'01020304\'', `
Expand Down
1 change: 0 additions & 1 deletion packages/cbor/types/lib/constants.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export namespace TAG {
const BASE64: number;
const REGEXP: number;
const MIME: number;
const SET: number;
}
export type TAG = number;
export namespace NUMBYTES {
Expand Down
2 changes: 1 addition & 1 deletion packages/puppeteer-demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"author": "Joe Hildebrand <joe-github@cursive.net>",
"license": "MIT",
"devDependencies": {
"chalk": "^4.1.1",
"chalk": "^4.1.2",
"chrome-finder": "^1.0.7",
"puppeteer": "^10.1.0"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/webpack-demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"string_decoder": "^1.3.0",
"style-loader": "^3.2.1",
"util-deprecate": "^1.0.2",
"webpack": "^5.47.0",
"webpack": "^5.48.0",
"webpack-cli": "^4.7.2"
}
}

0 comments on commit 528ed11

Please sign in to comment.