Skip to content

Commit

Permalink
Merge pull request #42 from hildjj/diagnostic-web
Browse files Browse the repository at this point in the history
Add diagnostic round-tripping to the web playground
  • Loading branch information
hildjj authored Aug 27, 2024
2 parents 7c3c943 + c436b13 commit 4720417
Show file tree
Hide file tree
Showing 9 changed files with 782 additions and 791 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@
},
"license": "MIT",
"devDependencies": {
"@cto.af/eslint-config": "4.1.5",
"@cto.af/eslint-config": "4.1.6",
"c8": "10.1.2",
"eslint": "9.9.0",
"eslint": "9.9.1",
"eslint-plugin-jsdoc": "50.2.2",
"eslint-plugin-markdown": "5.1.0",
"rimraf": "^6.0.1",
"tsup": "8.2.4",
"typedoc": "0.26.6",
"typescript-eslint": "8.2.0"
"typescript-eslint": "8.3.0"
},
"overrides": {
"@typescript-eslint/utils": "8.0.0-alpha.44",
Expand All @@ -69,7 +69,7 @@
"@typescript-eslint/parser": "8.0.0-alpha.44"
}
},
"packageManager": "pnpm@9.8.0",
"packageManager": "pnpm@9.9.0",
"engines": {
"node": ">=18"
}
Expand Down
916 changes: 438 additions & 478 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

10 changes: 7 additions & 3 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,14 @@
* @returns Array with contents decoded as hex from str.
*/
export function hexToU8(str: string): Uint8Array {
const len = str.length / 2;
let len = Math.ceil(str.length / 2);
const res = new Uint8Array(len);
for (let i = 0; i < len; i++) {
res[i] = parseInt(str.substr(i << 1, 2), 16);
len--;
for (let end = str.length, start = end - 2;
end >= 0;
end = start, start -= 2, len--
) {
res[len] = parseInt(str.substring(start, end), 16);
}

return res;
Expand Down
9 changes: 5 additions & 4 deletions typedoc.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ module.exports = {
out: 'docs',
cleanOutputDir: true,
sidebarLinks: {
GitHub: 'https://github.com/hildjj/cbor2/',
Documentation: 'http://hildjj.github.io/cbor2/',
Playground: '/cbor2/playground/index.html',
Spec: 'http://cbor.io/',
'Playground': '/cbor2/playground/index.html',
'cbor-edn': 'https://github.com/hildjj/cbor-edn',
'GitHub': 'https://github.com/hildjj/cbor2/',
'Spec': 'http://cbor.io/',
'Documentation': 'http://hildjj.github.io/cbor2/',
},
navigation: {
includeCategories: false,
Expand Down
6 changes: 6 additions & 0 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"license": "MIT",
"devDependencies": {
"@playwright/test": "1.46.1",
"cbor-edn": "0.0.3",
"cbor2": "link:..",
"css-loader": "7.1.2",
"five-server": "0.3.3",
Expand All @@ -22,6 +23,11 @@
"webpack": "5.94.0",
"webpack-cli": "5.1.4"
},
"pnpm": {
"overrides": {
"cbor2": "link:.."
}
},
"engines": {
"node": ">=18"
}
Expand Down
Loading

0 comments on commit 4720417

Please sign in to comment.