Skip to content

Commit

Permalink
Polyfill crypto.randomUUID for VSCode
Browse files Browse the repository at this point in the history
  • Loading branch information
zjkmxy committed Mar 8, 2024
1 parent 07fbf1b commit a6c953b
Show file tree
Hide file tree
Showing 7 changed files with 74 additions and 52 deletions.
5 changes: 3 additions & 2 deletions deno.lock

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

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ucla-irl/ndnts-aux",
"version": "1.1.3",
"version": "1.1.4",
"description": "NDNts Auxiliary Package for Web and Deno",
"scripts": {
"test": "deno test --no-check",
Expand All @@ -22,9 +22,10 @@
"@ndn/sync-api": "https://ndnts-nightly.ndn.today/sync-api.tgz",
"event-iterator": "^2.0.0",
"eventemitter3": "^5.0.1",
"jose": "^5.2.2",
"jose": "^5.2.3",
"tslib": "^2.6.2",
"type-fest": "^4.10.3",
"type-fest": "^4.11.1",
"uuid": "^9.0.1",
"wait-your-turn": "^1.0.1",
"y-protocols": "^1.0.6",
"yjs": "^13.6.14"
Expand Down
97 changes: 53 additions & 44 deletions pnpm-lock.yaml

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

3 changes: 2 additions & 1 deletion src/sync-agent/namespace.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { type Component, Name } from '@ndn/packet';
import { Keyword as KeywordComponent } from '@ndn/naming-convention2';
import { randomUUID } from '../utils/mod.ts';

let currentNamespace: SyncAgentNamespace | undefined = undefined;

Expand Down Expand Up @@ -97,7 +98,7 @@ function createDefaultNamespace(): SyncAgentNamespace {
return '/8=local' + baseName.toString() + '/8=syncVector';
},
genBlobName(appPrefix: Name): Name {
return new Name([...appPrefix.comps, 'blob', crypto.randomUUID()]);
return new Name([...appPrefix.comps, 'blob', randomUUID()]);
},
syncKeyword: KeywordComponent.create('sync'),
atLeastOnceKeyword: KeywordComponent.create('alo'),
Expand Down
Loading

0 comments on commit a6c953b

Please sign in to comment.