Skip to content

Commit

Permalink
Merge branch 'main' into doc_support
Browse files Browse the repository at this point in the history
  • Loading branch information
broofa committed Jan 9, 2025
2 parents 6ff8de2 + e426aaa commit 8a21004
Show file tree
Hide file tree
Showing 48 changed files with 11,118 additions and 15,547 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 22.x

- run: npm ci
- run: npm run lint
- run: npm run docs:diff

test:
runs-on: ubuntu-latest
needs: lint
strategy:
fail-fast: false
matrix:
Expand All @@ -32,7 +32,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
cache: npm

- run: npm ci
- run: npm run test
- run: npm run test:node
- run: npm run test:pack
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
*.tgz
browserstack.err
dist/
.build/
local.log
logs/
node_modules/
examples/**/package-lock.json
9 changes: 0 additions & 9 deletions .local/README.md

This file was deleted.

1 change: 0 additions & 1 deletion .local/uuid/dist

This file was deleted.

1 change: 0 additions & 1 deletion .local/uuid/package.json

This file was deleted.

1 change: 0 additions & 1 deletion .local/uuid/v1.js

This file was deleted.

1 change: 0 additions & 1 deletion .local/uuid/v1tov6.js

This file was deleted.

1 change: 0 additions & 1 deletion .local/uuid/v3.js

This file was deleted.

1 change: 0 additions & 1 deletion .local/uuid/v4.js

This file was deleted.

1 change: 0 additions & 1 deletion .local/uuid/v5.js

This file was deleted.

1 change: 0 additions & 1 deletion .local/uuid/v6.js

This file was deleted.

1 change: 0 additions & 1 deletion .local/uuid/v6tov1.js

This file was deleted.

1 change: 0 additions & 1 deletion .local/uuid/v7.js

This file was deleted.

1 change: 0 additions & 1 deletion .local/uuid/wrapper.mjs

This file was deleted.

1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
.local/
dist/
node_modules/
README.md
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Change Log

## [11.0.4](https://github.com/uuidjs/uuid/compare/v11.0.3...v11.0.4) (2025-01-05)


### Bug Fixes

* **docs:** insure -> ensure ([#843](https://github.com/uuidjs/uuid/issues/843)) ([d2a61e1](https://github.com/uuidjs/uuid/commit/d2a61e154d861e58549466e753bb9e4d5bfffb68))
* exclude tests from published package ([#840](https://github.com/uuidjs/uuid/issues/840)) ([f992ff4](https://github.com/uuidjs/uuid/commit/f992ff4780937089b0134195fa22e76e2e1cb3a7))
* 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.0.3](https://github.com/uuidjs/uuid/compare/v11.0.2...v11.0.3) (2024-11-04)


Expand Down
29 changes: 17 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
-- This file is auto-generated from README_js.md. Changes should be made there.
-->


# 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)

For the creation of [RFC9562](https://www.rfc-editor.org/rfc/rfc9562.html) (formally [RFC4122](https://www.rfc-editor.org/rfc/rfc4122.html)) UUIDs
Expand Down Expand Up @@ -117,13 +116,13 @@ Example:
import { parse as uuidParse } from 'uuid';

// Parse a UUID
uuidParse('6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b'); //
// Uint8Array(16) [
// 110, 192, 189, 127, 17,
// 192, 67, 218, 151, 94,
// 42, 138, 217, 235, 174,
// 11
// ]
uuidParse('6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b'); //
// Uint8Array(16) [
// 110, 192, 189, 127, 17,
// 192, 67, 218, 151, 94,
// 42, 138, 217, 235, 174,
// 11
// ]
```

### uuid.stringify(arr[, offset])
Expand Down Expand Up @@ -367,7 +366,7 @@ Create an RFC version 7 (random) UUID
| [`options.msecs = (current time)`] | RFC "timestamp" field (`Number` of milliseconds, unix epoch) |
| [`options.random = (random)`] | `Array` of 16 random bytes (0-255) used to generate other fields, above |
| [`options.rng`] | Alternative to `options.random`, a `Function` that returns an `Array` of 16 random bytes (0-255) |
| [`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. |
| [`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. |
| [`buffer`] | `Array \| Buffer` If specified, uuid will be written here in byte-form, starting at `offset` |
| [`offset` = 0] | `Number` Index to start writing UUID bytes in `buffer` |
| _returns_ | UUID `String` if no `buffer` is specified, otherwise returns `buffer` |
Expand Down Expand Up @@ -475,7 +474,7 @@ defined by RFC9562

## `options` Handling for Timestamp UUIDs

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:
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:

- Without `options`: Internal state is utilized to improve UUID uniqueness.
- With `options`: Internal state is **NOT** used and, instead, appropriate defaults are applied as needed.
Expand All @@ -490,7 +489,13 @@ Prior to `uuid@11`, it was possible for `options` state to interfere with the in

## Known issues

### React Native / Expo
<!-- This header is referenced as an anchor in src/rng-browser.ts -->

### "getRandomValues() not supported"

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:

#### React Native / Expo

1. Install [`react-native-get-random-values`](https://github.com/LinusU/react-native-get-random-values#readme)
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:
Expand All @@ -502,4 +507,4 @@ import { v4 as uuidv4 } from 'uuid';

---

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>
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>
12 changes: 9 additions & 3 deletions README_js.md
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ Create an RFC version 7 (random) UUID
| [`options.msecs = (current time)`] | RFC "timestamp" field (`Number` of milliseconds, unix epoch) |
| [`options.random = (random)`] | `Array` of 16 random bytes (0-255) used to generate other fields, above |
| [`options.rng`] | Alternative to `options.random`, a `Function` that returns an `Array` of 16 random bytes (0-255) |
| [`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. |
| [`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. |
| [`buffer`] | `Array \| Buffer` If specified, uuid will be written here in byte-form, starting at `offset` |
| [`offset` = 0] | `Number` Index to start writing UUID bytes in `buffer` |
| _returns_ | UUID `String` if no `buffer` is specified, otherwise returns `buffer` |
Expand Down Expand Up @@ -483,7 +483,7 @@ defined by RFC9562

## `options` Handling for Timestamp UUIDs

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:
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:

- Without `options`: Internal state is utilized to improve UUID uniqueness.
- With `options`: Internal state is **NOT** used and, instead, appropriate defaults are applied as needed.
Expand All @@ -498,7 +498,13 @@ Prior to `uuid@11`, it was possible for `options` state to interfere with the in

## Known issues

### React Native / Expo
<!-- This header is referenced as an anchor in src/rng-browser.ts -->

### "getRandomValues() not supported"

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:

#### React Native / Expo

1. Install [`react-native-get-random-values`](https://github.com/LinusU/react-native-get-random-values#readme)
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:
Expand Down
2 changes: 1 addition & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ export default [
},
},
{
ignores: ['eslint.config.cjs', '.local/', '**/dist/', 'node_modules/'],
ignores: ['eslint.config.cjs', '**/dist/', 'node_modules/'],
},
];
138 changes: 0 additions & 138 deletions examples/benchmark/package-lock.json

This file was deleted.

3 changes: 2 additions & 1 deletion examples/benchmark/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
"scripts": {
"build": "true",
"start": "npm run build && npx http-server . -o",
"pretest": "HUSKY=0 npm install --no-package-lock",
"test": "node node.js"
},
"dependencies": {
"uuid": "file:../../.local/uuid"
"uuid": "file:../../.build/uuid.tgz"
},
"devDependencies": {
"benchmark": "^2.1.4"
Expand Down
Loading

0 comments on commit 8a21004

Please sign in to comment.