Skip to content

Commit

Permalink
feat(uuid-generator): add support for UUID v7 and update uuid package…
Browse files Browse the repository at this point in the history
… to version 11.0.0
  • Loading branch information
Sebatt committed Dec 13, 2024
1 parent 63fbd3b commit a22a17b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
"ulid": "^2.3.0",
"unicode-emoji-json": "^0.4.0",
"unplugin-auto-import": "^0.16.4",
"uuid": "^9.0.0",
"uuid": "^11.0.0",
"vue": "^3.3.4",
"vue-i18n": "^9.9.1",
"vue-router": "^4.1.6",
Expand Down
5 changes: 3 additions & 2 deletions src/tools/uuid-generator/uuid-generator.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<script setup lang="ts">
import { v1 as generateUuidV1, v3 as generateUuidV3, v4 as generateUuidV4, v5 as generateUuidV5, NIL as nilUuid } from 'uuid';
import { v1 as generateUuidV1, v3 as generateUuidV3, v4 as generateUuidV4, v5 as generateUuidV5, v7 as generateUuidV7, NIL as nilUuid } from 'uuid';
import { useCopy } from '@/composable/copy';
import { computedRefreshable } from '@/composable/computedRefreshable';
import { withDefaultOnError } from '@/utils/defaults';
const versions = ['NIL', 'v1', 'v3', 'v4', 'v5'] as const;
const versions = ['NIL', 'v1', 'v3', 'v4', 'v5', 'v7'] as const;
const version = useStorage<typeof versions[number]>('uuid-generator:version', 'v4');
const count = useStorage('uuid-generator:quantity', 1);
Expand Down Expand Up @@ -34,6 +34,7 @@ const generators = {
v3: () => generateUuidV3(v35Args.value.name, v35Args.value.namespace),
v4: () => generateUuidV4(),
v5: () => generateUuidV5(v35Args.value.name, v35Args.value.namespace),
v7: () => generateUuidV7(),
};
const [uuids, refreshUUIDs] = computedRefreshable(() => withDefaultOnError(() =>
Expand Down

0 comments on commit a22a17b

Please sign in to comment.