Skip to content

Commit

Permalink
v5.0.1 Released
Browse files Browse the repository at this point in the history
Added:

- CHANGELOG.md to NPM package

Maintenance:

- Updated TypeScript to 5.0
- Refined doc comment style
  • Loading branch information
LiosK committed Mar 30, 2023
2 parents 22ba6e3 + 47dbd42 commit 0b74855
Show file tree
Hide file tree
Showing 10 changed files with 203 additions and 181 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,16 @@
# Changelog

## v5.0.1 - 2023-03-30

### Added

- CHANGELOG.md to NPM package

### Maintenance

- Updated TypeScript to 5.0
- Refined doc comment style

## v5.0.0 - 2023-01-28

### Breaking changes
Expand Down
62 changes: 31 additions & 31 deletions dist/uuid.d.ts
Expand Up @@ -2,23 +2,23 @@
* UUID.js - RFC-compliant UUID Generator for JavaScript
*
* @author LiosK
* @version v5.0.0
* @version v5.0.1
* @license Apache License 2.0: Copyright (c) 2010-2023 LiosK
* @packageDocumentation
*/
/**
* UUID object.
* The UUID object type.
*/
export declare class UUID {
/**
* Generates a version 4 UUID as a hexadecimal string.
* @returns Hexadecimal UUID string.
* @returns The hexadecimal UUID string.
*/
static generate(): string;
/**
* Returns an unsigned x-bit random integer.
* @param x - Unsigned integer ranging from 0 to 53, inclusive.
* @returns Unsigned x-bit random integer (0 <= f(x) < 2^x).
* Returns an unsigned `x`-bit random integer.
* @param x - An unsigned integer ranging from 0 to 53, inclusive.
* @returns An unsigned `x`-bit random integer (`0 <= f(x) < 2^x`).
*/
private static _getRandomInt;
/**
Expand All @@ -33,30 +33,30 @@ export declare class UUID {
*/
static useMathRandom(): void;
/**
* Names of UUID internal fields.
* The names of UUID internal fields.
* @since 3.0
*/
static readonly FIELD_NAMES: readonly string[];
/**
* Sizes of UUID internal fields.
* The sizes of UUID internal fields.
* @since 3.0
*/
static readonly FIELD_SIZES: readonly number[];
/**
* Creates a version 4 UUID object.
* @returns Version 4 UUID object.
* @returns A version 4 UUID object.
* @since 3.0
*/
static genV4(): UUID;
/**
* Converts a hexadecimal UUID string to a UUID object.
* @param strId - Hexadecimal UUID string ("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx").
* @returns UUID object or null.
* @param strId - A hexadecimal UUID string ("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx").
* @returns The UUID object or `null`.
* @since 3.0
*/
static parse(strId: string): UUID | null;
/**
* UUID internal field values as an array of integers.
* The UUID internal field values as an array of integers.
*/
readonly intFields: readonly number[] & {
readonly timeLow: number;
Expand All @@ -67,7 +67,7 @@ export declare class UUID {
readonly node: number;
};
/**
* UUID internal field values as an array of binary strings.
* The UUID internal field values as an array of binary strings.
*/
readonly bitFields: readonly string[] & {
readonly timeLow: string;
Expand All @@ -78,7 +78,7 @@ export declare class UUID {
readonly node: string;
};
/**
* UUID internal field values as an array of hexadecimal strings.
* The UUID internal field values as an array of hexadecimal strings.
*/
readonly hexFields: readonly string[] & {
readonly timeLow: string;
Expand All @@ -89,34 +89,34 @@ export declare class UUID {
readonly node: string;
};
/**
* UUID version number.
* The UUID version number.
*/
readonly version: number;
/**
* 128-bit binary string representation.
* The 128-bit binary string representation.
*/
readonly bitString: string;
/**
* Non-delimited hexadecimal string representation ("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx").
* The non-delimited hexadecimal string representation ("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx").
* @since v3.3.0
*/
readonly hexNoDelim: string;
/**
* Hexadecimal string representation ("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx").
* The hexadecimal string representation ("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx").
*/
readonly hexString: string;
/**
* URN string representation ("urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx").
* The URN string representation ("urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx").
*/
readonly urn: string;
/**
* Initializes the UUID object.
* @param _timeLow - time_low field (octet 0-3, uint32).
* @param _timeMid - time_mid field (octet 4-5, uint16).
* @param _timeHiAndVersion - time_hi_and_version field (octet 6-7, uint16).
* @param _clockSeqHiAndReserved - clock_seq_hi_and_reserved field (octet 8, uint8).
* @param _clockSeqLow - clock_seq_low field (octet 9, uint8).
* @param _node - node field (octet 10-15, uint48).
* @param _timeLow - The time_low field (octet 0-3, uint32).
* @param _timeMid - The time_mid field (octet 4-5, uint16).
* @param _timeHiAndVersion - The time_hi_and_version field (octet 6-7, uint16).
* @param _clockSeqHiAndReserved - The clock_seq_hi_and_reserved field (octet 8, uint8).
* @param _clockSeqLow - The clock_seq_low field (octet 9, uint8).
* @param _node - The node field (octet 10-15, uint48).
*/
private constructor();
/**
Expand All @@ -130,17 +130,17 @@ export declare class UUID {
toString(): string;
/**
* Tests if two UUID objects are equal.
* @returns True if two UUID objects are equal.
* @returns `true` if two UUID objects are equal.
*/
equals(uuid: UUID): boolean;
/**
* Nil UUID object.
* A nil UUID object.
* @since v3.4.0
*/
static readonly NIL: UUID;
/**
* Creates a version 1 UUID object.
* @returns Version 1 UUID object.
* @returns A version 1 UUID object.
* @since 3.0
*/
static genV1(): UUID;
Expand All @@ -150,18 +150,18 @@ export declare class UUID {
*/
static resetState(): void;
/**
* Persistent internal state for version 1 UUID creation.
* The persistent internal state for version 1 UUID creation.
*/
private static _state;
/**
* @param time - Milliseconds elapsed since 1970-01-01.
* @param time - The number of milliseconds elapsed since 1970-01-01.
*/
private static _getTimeFieldValues;
/**
* Creates a version 6 UUID object. This function is experimentally provided
* based on the draft RFC and may be changed or removed in the future without
* conforming to semantic versioning requirements.
* @returns Version 6 UUID object.
* @returns A version 6 UUID object.
* @since v4.2.13
* @experimental
*/
Expand Down
49 changes: 25 additions & 24 deletions dist/uuid.js
Expand Up @@ -2,19 +2,19 @@
* UUID.js - RFC-compliant UUID Generator for JavaScript
*
* @author LiosK
* @version v5.0.0
* @version v5.0.1
* @license Apache License 2.0: Copyright (c) 2010-2023 LiosK
* @packageDocumentation
*/
var _a;
/**
* UUID object.
* The UUID object type.
*/
export class UUID {
class UUID {
// Core Component {{{
/**
* Generates a version 4 UUID as a hexadecimal string.
* @returns Hexadecimal UUID string.
* @returns The hexadecimal UUID string.
*/
static generate() {
var rand = UUID._getRandomInt, hex = UUID._hexAligner;
Expand All @@ -30,9 +30,9 @@ export class UUID {
);
}
/**
* Returns an unsigned x-bit random integer.
* @param x - Unsigned integer ranging from 0 to 53, inclusive.
* @returns Unsigned x-bit random integer (0 <= f(x) < 2^x).
* Returns an unsigned `x`-bit random integer.
* @param x - An unsigned integer ranging from 0 to 53, inclusive.
* @returns An unsigned `x`-bit random integer (`0 <= f(x) < 2^x`).
*/
static _getRandomInt(x) {
if (x < 0 || x > 53) {
Expand Down Expand Up @@ -65,7 +65,7 @@ export class UUID {
}
/**
* Creates a version 4 UUID object.
* @returns Version 4 UUID object.
* @returns A version 4 UUID object.
* @since 3.0
*/
static genV4() {
Expand All @@ -80,8 +80,8 @@ export class UUID {
}
/**
* Converts a hexadecimal UUID string to a UUID object.
* @param strId - Hexadecimal UUID string ("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx").
* @returns UUID object or null.
* @param strId - A hexadecimal UUID string ("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx").
* @returns The UUID object or `null`.
* @since 3.0
*/
static parse(strId) {
Expand All @@ -98,12 +98,12 @@ export class UUID {
}
/**
* Initializes the UUID object.
* @param _timeLow - time_low field (octet 0-3, uint32).
* @param _timeMid - time_mid field (octet 4-5, uint16).
* @param _timeHiAndVersion - time_hi_and_version field (octet 6-7, uint16).
* @param _clockSeqHiAndReserved - clock_seq_hi_and_reserved field (octet 8, uint8).
* @param _clockSeqLow - clock_seq_low field (octet 9, uint8).
* @param _node - node field (octet 10-15, uint48).
* @param _timeLow - The time_low field (octet 0-3, uint32).
* @param _timeMid - The time_mid field (octet 4-5, uint16).
* @param _timeHiAndVersion - The time_hi_and_version field (octet 6-7, uint16).
* @param _clockSeqHiAndReserved - The clock_seq_hi_and_reserved field (octet 8, uint8).
* @param _clockSeqLow - The clock_seq_low field (octet 9, uint8).
* @param _node - The node field (octet 10-15, uint48).
*/
constructor(_timeLow, _timeMid, _timeHiAndVersion, _clockSeqHiAndReserved, _clockSeqLow, _node) {
var names = UUID.FIELD_NAMES, sizes = UUID.FIELD_SIZES;
Expand Down Expand Up @@ -160,7 +160,7 @@ export class UUID {
}
/**
* Tests if two UUID objects are equal.
* @returns True if two UUID objects are equal.
* @returns `true` if two UUID objects are equal.
*/
equals(uuid) {
if (!(uuid instanceof UUID)) {
Expand All @@ -177,7 +177,7 @@ export class UUID {
// UUID Version 1 Component (1 of 2) {{{
/**
* Creates a version 1 UUID object.
* @returns Version 1 UUID object.
* @returns A version 1 UUID object.
* @since 3.0
*/
static genV1() {
Expand Down Expand Up @@ -218,7 +218,7 @@ export class UUID {
UUID._state = new UUIDState();
}
/**
* @param time - Milliseconds elapsed since 1970-01-01.
* @param time - The number of milliseconds elapsed since 1970-01-01.
*/
static _getTimeFieldValues(time) {
var ts = time - Date.UTC(1582, 9, 15);
Expand All @@ -236,7 +236,7 @@ export class UUID {
* Creates a version 6 UUID object. This function is experimentally provided
* based on the draft RFC and may be changed or removed in the future without
* conforming to semantic versioning requirements.
* @returns Version 6 UUID object.
* @returns A version 6 UUID object.
* @since v4.2.13
* @experimental
*/
Expand Down Expand Up @@ -295,7 +295,7 @@ UUID._mathPRNG = UUID._getRandomInt;
// }}}
// UUID Object Component {{{
/**
* Names of UUID internal fields.
* The names of UUID internal fields.
* @since 3.0
*/
UUID.FIELD_NAMES = [
Expand All @@ -307,19 +307,20 @@ UUID.FIELD_NAMES = [
"node",
];
/**
* Sizes of UUID internal fields.
* The sizes of UUID internal fields.
* @since 3.0
*/
UUID.FIELD_SIZES = [32, 16, 16, 8, 8, 48];
/**
* Nil UUID object.
* A nil UUID object.
* @since v3.4.0
*/
UUID.NIL = new UUID(0, 0, 0, 0, 0, 0);
/**
* Persistent internal state for version 1 UUID creation.
* The persistent internal state for version 1 UUID creation.
*/
UUID._state = null;
export { UUID };
// UUID Version 1 Component (2 of 2) {{{
class UUIDState {
constructor() {
Expand Down
2 changes: 1 addition & 1 deletion docs/assets/main.js

Large diffs are not rendered by default.

9 changes: 4 additions & 5 deletions docs/assets/style.css
Expand Up @@ -483,10 +483,9 @@ blockquote {
.has-menu .col-menu {
visibility: visible;
transform: translate(0, 0);
display: grid;
align-items: center;
grid-template-rows: auto 1fr;
grid-gap: 1.5rem;
display: flex;
flex-direction: column;
gap: 1.5rem;
max-height: 100vh;
padding: 1rem 2rem;
}
Expand Down Expand Up @@ -911,7 +910,7 @@ a.tsd-index-link {
margin-right: 0.8rem;
}

@media (min-width: 1024px) {
@media (min-width: 1025px) {
.col-content {
margin: 2rem auto;
}
Expand Down

0 comments on commit 0b74855

Please sign in to comment.