Skip to content

Commit 74b1614

Browse files
committed
Merge branch 'main' into template_update
2 parents 294022c + e426aaa commit 74b1614

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+11142
-15555
lines changed

.github/workflows/ci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ jobs:
1414
uses: actions/setup-node@v4
1515
with:
1616
node-version: 22.x
17+
1718
- run: npm ci
1819
- run: npm run lint
1920
- run: npm run docs:diff
2021

2122
test:
2223
runs-on: ubuntu-latest
23-
needs: lint
2424
strategy:
2525
fail-fast: false
2626
matrix:
@@ -32,7 +32,7 @@ jobs:
3232
with:
3333
node-version: ${{ matrix.node-version }}
3434
cache: npm
35+
3536
- run: npm ci
3637
- run: npm run test
3738
- run: npm run test:node
38-
- run: npm run test:pack

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
*.tgz
22
browserstack.err
33
dist/
4+
.build/
45
local.log
56
logs/
67
node_modules/
8+
examples/**/package-lock.json

.local/README.md

-9
This file was deleted.

.local/uuid/dist

-1
This file was deleted.

.local/uuid/package.json

-1
This file was deleted.

.local/uuid/v1.js

-1
This file was deleted.

.local/uuid/v1tov6.js

-1
This file was deleted.

.local/uuid/v3.js

-1
This file was deleted.

.local/uuid/v4.js

-1
This file was deleted.

.local/uuid/v5.js

-1
This file was deleted.

.local/uuid/v6.js

-1
This file was deleted.

.local/uuid/v6tov1.js

-1
This file was deleted.

.local/uuid/v7.js

-1
This file was deleted.

.local/uuid/wrapper.mjs

-1
This file was deleted.

.prettierignore

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
.local/
21
dist/
32
node_modules/
43
README.md

CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Change Log
22

3+
## [11.0.4](https://github.com/uuidjs/uuid/compare/v11.0.3...v11.0.4) (2025-01-05)
4+
5+
6+
### Bug Fixes
7+
8+
* **docs:** insure -> ensure ([#843](https://github.com/uuidjs/uuid/issues/843)) ([d2a61e1](https://github.com/uuidjs/uuid/commit/d2a61e154d861e58549466e753bb9e4d5bfffb68))
9+
* exclude tests from published package ([#840](https://github.com/uuidjs/uuid/issues/840)) ([f992ff4](https://github.com/uuidjs/uuid/commit/f992ff4780937089b0134195fa22e76e2e1cb3a7))
10+
* Test for invalid byte array sizes and ranges in `v1()`, `v4()`, and `v7()` ([#845](https://github.com/uuidjs/uuid/issues/845)) ([e0ee900](https://github.com/uuidjs/uuid/commit/e0ee90051ebd13475bbcff4d371330aa4f9bd1dd))
11+
312
## [11.0.3](https://github.com/uuidjs/uuid/compare/v11.0.2...v11.0.3) (2024-11-04)
413

514

README.md

+29-16
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,15 @@
22
-- This file is auto-generated from README_js.md. Changes should be made there.
33
-->
44

5-
65
# uuid [![CI](https://github.com/uuidjs/uuid/workflows/CI/badge.svg)](https://github.com/uuidjs/uuid/actions?query=workflow%3ACI) [![Browser](https://github.com/uuidjs/uuid/workflows/Browser/badge.svg)](https://github.com/uuidjs/uuid/actions?query=workflow%3ABrowser)
76

87
For the creation of [RFC9562](https://www.rfc-editor.org/rfc/rfc9562.html) (formally [RFC4122](https://www.rfc-editor.org/rfc/rfc4122.html)) UUIDs
98

109
- **Complete** - Support for all RFC9562 UUID versions
11-
- **Cross-platform** - Support for ...
12-
- CommonJS, [ECMAScript Modules](#ecmascript-modules)
13-
- NodeJS 16+ ([LTS releases](https://github.com/nodejs/Release))
14-
- Chrome, Safari, Firefox, Edge browsers
10+
- **Cross-platform** - Support for...
11+
- ESM & Common JS
12+
- [Chrome, Safari, Firefox, Edge browsers](#support)
13+
- [NodeJS](#support)
1514
- [React Native / Expo](#react-native--expo)
1615
- **Secure** - Cryptographically-strong random values
1716
- **Compact** - No dependencies, [tree-shakable](https://developer.mozilla.org/en-US/docs/Glossary/Tree_shaking)
@@ -117,13 +116,13 @@ Example:
117116
import { parse as uuidParse } from 'uuid';
118117

119118
// Parse a UUID
120-
uuidParse('6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b'); //
121-
// Uint8Array(16) [
122-
// 110, 192, 189, 127, 17,
123-
// 192, 67, 218, 151, 94,
124-
// 42, 138, 217, 235, 174,
125-
// 11
126-
// ]
119+
uuidParse('6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b'); //
120+
// Uint8Array(16) [
121+
// 110, 192, 189, 127, 17,
122+
// 192, 67, 218, 151, 94,
123+
// 42, 138, 217, 235, 174,
124+
// 11
125+
// ]
127126
```
128127

129128
### uuid.stringify(arr[, offset])
@@ -367,7 +366,7 @@ Create an RFC version 7 (random) UUID
367366
| [`options.msecs = (current time)`] | RFC "timestamp" field (`Number` of milliseconds, unix epoch) |
368367
| [`options.random = (random)`] | `Array` of 16 random bytes (0-255) used to generate other fields, above |
369368
| [`options.rng`] | Alternative to `options.random`, a `Function` that returns an `Array` of 16 random bytes (0-255) |
370-
| [`options.seq = (random)`] | 32-bit sequence `Number` between 0 - 0xffffffff. This may be provided to help insure uniqueness for UUIDs generated within the same millisecond time interval. Default = random value. |
369+
| [`options.seq = (random)`] | 32-bit sequence `Number` between 0 - 0xffffffff. This may be provided to help ensure uniqueness for UUIDs generated within the same millisecond time interval. Default = random value. |
371370
| [`buffer`] | `Array \| Buffer` If specified, uuid will be written here in byte-form, starting at `offset` |
372371
| [`offset` = 0] | `Number` Index to start writing UUID bytes in `buffer` |
373372
| _returns_ | UUID `String` if no `buffer` is specified, otherwise returns `buffer` |
@@ -475,14 +474,28 @@ defined by RFC9562
475474

476475
## `options` Handling for Timestamp UUIDs
477476

478-
Prior to `uuid@11`, it was possible for `options` state to interfere with the internal state used to insure uniqueness of timestamp-based UUIDs (the `v1()`, `v6()`, and `v7()` methods). Starting with `uuid@11`, this issue has been addressed by using the presence of the `options` argument as a flag to select between two possible behaviors:
477+
Prior to `uuid@11`, it was possible for `options` state to interfere with the internal state used to ensure uniqueness of timestamp-based UUIDs (the `v1()`, `v6()`, and `v7()` methods). Starting with `uuid@11`, this issue has been addressed by using the presence of the `options` argument as a flag to select between two possible behaviors:
479478

480479
- Without `options`: Internal state is utilized to improve UUID uniqueness.
481480
- With `options`: Internal state is **NOT** used and, instead, appropriate defaults are applied as needed.
482481

482+
## Support
483+
484+
**Browsers**: `uuid` [builds are tested](/uuidjs/uuid/blob/main/wdio.conf.js) against the latest version of desktop Chrome, Safari, Firefox, and Edge. Mobile versions of these same browsers are expected to work but aren't currently tested.
485+
486+
**Node**: `uuid` [builds are tested](https://github.com/uuidjs/uuid/blob/main/.github/workflows/ci.yml#L26-L27) against node ([LTS releases](https://github.com/nodejs/Release)), plus one prior. E.g. `node@18` is in maintainence mode, and `node@22` is the current LTS release. So `uuid` supports `node@16`-`node@22`.
487+
488+
**Typescript**: TS versions released within the past two years are supported. [source](https://github.com/microsoft/TypeScript/issues/49088#issuecomment-2468723715)
489+
483490
## Known issues
484491

485-
### React Native / Expo
492+
<!-- This header is referenced as an anchor in src/rng-browser.ts -->
493+
494+
### "getRandomValues() not supported"
495+
496+
This error occurs in environments where the standard [`crypto.getRandomValues()`](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues) API is not supported. This issue can be resolved by adding an appropriate polyfill:
497+
498+
#### React Native / Expo
486499

487500
1. Install [`react-native-get-random-values`](https://github.com/LinusU/react-native-get-random-values#readme)
488501
1. Import it _before_ `uuid`. Since `uuid` might also appear as a transitive dependency of some other imports it's safest to just import `react-native-get-random-values` as the very first thing in your entry point:
@@ -494,4 +507,4 @@ import { v4 as uuidv4 } from 'uuid';
494507

495508
---
496509

497-
Markdown generated from [README_js.md](README_js.md) by <a href="https://github.com/broofa/runmd"><image height="12px" src="https://camo.githubusercontent.com/5c7c603cd1e6a43370b0a5063d457e0dabb74cf317adc7baba183acb686ee8d0/687474703a2f2f692e696d6775722e636f6d2f634a4b6f3662552e706e67" /></a>
510+
Markdown generated from [README_js.md](README_js.md) by <a href="https://github.com/broofa/runmd"><image height="13" src="https://camo.githubusercontent.com/5c7c603cd1e6a43370b0a5063d457e0dabb74cf317adc7baba183acb686ee8d0/687474703a2f2f692e696d6775722e636f6d2f634a4b6f3662552e706e67" /></a>

README_js.md

+21-7
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ require('crypto').randomUUID = undefined;
2222
For the creation of [RFC9562](https://www.rfc-editor.org/rfc/rfc9562.html) (formally [RFC4122](https://www.rfc-editor.org/rfc/rfc4122.html)) UUIDs
2323

2424
- **Complete** - Support for all RFC9562 UUID versions
25-
- **Cross-platform** - Support for ...
26-
- CommonJS, [ECMAScript Modules](#ecmascript-modules)
27-
- NodeJS 16+ ([LTS releases](https://github.com/nodejs/Release))
28-
- Chrome, Safari, Firefox, Edge browsers
25+
- **Cross-platform** - Support for...
26+
- ESM & Common JS
27+
- [Chrome, Safari, Firefox, Edge browsers](#support)
28+
- [NodeJS](#support)
2929
- [React Native / Expo](#react-native--expo)
3030
- **Secure** - Cryptographically-strong random values
3131
- **Compact** - No dependencies, [tree-shakable](https://developer.mozilla.org/en-US/docs/Glossary/Tree_shaking)
@@ -375,7 +375,7 @@ Create an RFC version 7 (random) UUID
375375
| [`options.msecs = (current time)`] | RFC "timestamp" field (`Number` of milliseconds, unix epoch) |
376376
| [`options.random = (random)`] | `Array` of 16 random bytes (0-255) used to generate other fields, above |
377377
| [`options.rng`] | Alternative to `options.random`, a `Function` that returns an `Array` of 16 random bytes (0-255) |
378-
| [`options.seq = (random)`] | 32-bit sequence `Number` between 0 - 0xffffffff. This may be provided to help insure uniqueness for UUIDs generated within the same millisecond time interval. Default = random value. |
378+
| [`options.seq = (random)`] | 32-bit sequence `Number` between 0 - 0xffffffff. This may be provided to help ensure uniqueness for UUIDs generated within the same millisecond time interval. Default = random value. |
379379
| [`buffer`] | `Array \| Buffer` If specified, uuid will be written here in byte-form, starting at `offset` |
380380
| [`offset` = 0] | `Number` Index to start writing UUID bytes in `buffer` |
381381
| _returns_ | UUID `String` if no `buffer` is specified, otherwise returns `buffer` |
@@ -483,14 +483,28 @@ defined by RFC9562
483483

484484
## `options` Handling for Timestamp UUIDs
485485

486-
Prior to `uuid@11`, it was possible for `options` state to interfere with the internal state used to insure uniqueness of timestamp-based UUIDs (the `v1()`, `v6()`, and `v7()` methods). Starting with `uuid@11`, this issue has been addressed by using the presence of the `options` argument as a flag to select between two possible behaviors:
486+
Prior to `uuid@11`, it was possible for `options` state to interfere with the internal state used to ensure uniqueness of timestamp-based UUIDs (the `v1()`, `v6()`, and `v7()` methods). Starting with `uuid@11`, this issue has been addressed by using the presence of the `options` argument as a flag to select between two possible behaviors:
487487

488488
- Without `options`: Internal state is utilized to improve UUID uniqueness.
489489
- With `options`: Internal state is **NOT** used and, instead, appropriate defaults are applied as needed.
490490

491+
## Support
492+
493+
**Browsers**: `uuid` [builds are tested](/uuidjs/uuid/blob/main/wdio.conf.js) against the latest version of desktop Chrome, Safari, Firefox, and Edge. Mobile versions of these same browsers are expected to work but aren't currently tested.
494+
495+
**Node**: `uuid` [builds are tested](https://github.com/uuidjs/uuid/blob/main/.github/workflows/ci.yml#L26-L27) against node ([LTS releases](https://github.com/nodejs/Release)), plus one prior. E.g. `node@18` is in maintainence mode, and `node@22` is the current LTS release. So `uuid` supports `node@16`-`node@22`.
496+
497+
**Typescript**: TS versions released within the past two years are supported. [source](https://github.com/microsoft/TypeScript/issues/49088#issuecomment-2468723715)
498+
491499
## Known issues
492500

493-
### React Native / Expo
501+
<!-- This header is referenced as an anchor in src/rng-browser.ts -->
502+
503+
### "getRandomValues() not supported"
504+
505+
This error occurs in environments where the standard [`crypto.getRandomValues()`](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues) API is not supported. This issue can be resolved by adding an appropriate polyfill:
506+
507+
#### React Native / Expo
494508

495509
1. Install [`react-native-get-random-values`](https://github.com/LinusU/react-native-get-random-values#readme)
496510
1. Import it _before_ `uuid`. Since `uuid` might also appear as a transitive dependency of some other imports it's safest to just import `react-native-get-random-values` as the very first thing in your entry point:

eslint.config.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@ export default [
3333
},
3434
},
3535
{
36-
ignores: ['eslint.config.cjs', '.local/', '**/dist/', 'node_modules/'],
36+
ignores: ['eslint.config.cjs', '**/dist/', 'node_modules/'],
3737
},
3838
];

examples/benchmark/package-lock.json

-138
This file was deleted.

examples/benchmark/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
"scripts": {
66
"build": "true",
77
"start": "npm run build && npx http-server . -o",
8+
"pretest": "HUSKY=0 npm install --no-package-lock",
89
"test": "node node.js"
910
},
1011
"dependencies": {
11-
"uuid": "file:../../.local/uuid"
12+
"uuid": "file:../../.build/uuid.tgz"
1213
},
1314
"devDependencies": {
1415
"benchmark": "^2.1.4"

0 commit comments

Comments
 (0)