@powfix/core-js 0.20.4 → 0.20.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -215,17 +215,17 @@ class UUID {
215
215
  * -------------------------------------------------------------------- */
216
216
  /**
217
217
  * Compares multiple UUIDs for strict equality.
218
- * @param uuids - The UUIDs to compare (at least two required).
218
+ * @param inputs - The UUIDs to compare (at least two required).
219
219
  * @returns true if all provided UUIDs are identical.
220
220
  */
221
- static equals(...uuids) {
222
- const n = uuids.length;
221
+ static equals(...inputs) {
222
+ const n = inputs.length;
223
223
  if (n < 2) {
224
224
  throw new Error('At least two UUIDs required for comparison');
225
225
  }
226
- const ref = uuids[0].bytes;
226
+ const ref = this.parse(inputs[0]);
227
227
  for (let i = 1; i < n; ++i) {
228
- const b = uuids[i].bytes;
228
+ const b = this.parse(inputs[i]);
229
229
  for (let j = 0; j < UUID.BYTE_LENGTH; ++j) {
230
230
  if (ref[j] !== b[j])
231
231
  return false;
@@ -240,8 +240,8 @@ class UUID {
240
240
  * @returns -1 if uuid1 < uuid2, 1 if uuid1 > uuid2, 0 otherwise.
241
241
  */
242
242
  static compare(uuid1, uuid2) {
243
- const a = uuid1.bytes;
244
- const b = uuid2.bytes;
243
+ const a = this.parse(uuid1);
244
+ const b = this.parse(uuid2);
245
245
  for (let i = 0; i < UUID.BYTE_LENGTH; i++) {
246
246
  if (a[i] !== b[i])
247
247
  return a[i] < b[i] ? -1 : 1;
@@ -256,8 +256,8 @@ class UUID {
256
256
  this.bytes = UUID.parse(input);
257
257
  }
258
258
  /** Instance wrapper for {@link equals}. */
259
- equals(...uuids) {
260
- return UUID.equals(this, ...uuids);
259
+ equals(...inputs) {
260
+ return UUID.equals(this, ...inputs);
261
261
  }
262
262
  /** Instance wrapper for {@link compare}. */
263
263
  compare(other) {
@@ -212,17 +212,17 @@ export class UUID {
212
212
  * -------------------------------------------------------------------- */
213
213
  /**
214
214
  * Compares multiple UUIDs for strict equality.
215
- * @param uuids - The UUIDs to compare (at least two required).
215
+ * @param inputs - The UUIDs to compare (at least two required).
216
216
  * @returns true if all provided UUIDs are identical.
217
217
  */
218
- static equals(...uuids) {
219
- const n = uuids.length;
218
+ static equals(...inputs) {
219
+ const n = inputs.length;
220
220
  if (n < 2) {
221
221
  throw new Error('At least two UUIDs required for comparison');
222
222
  }
223
- const ref = uuids[0].bytes;
223
+ const ref = this.parse(inputs[0]);
224
224
  for (let i = 1; i < n; ++i) {
225
- const b = uuids[i].bytes;
225
+ const b = this.parse(inputs[i]);
226
226
  for (let j = 0; j < UUID.BYTE_LENGTH; ++j) {
227
227
  if (ref[j] !== b[j])
228
228
  return false;
@@ -237,8 +237,8 @@ export class UUID {
237
237
  * @returns -1 if uuid1 < uuid2, 1 if uuid1 > uuid2, 0 otherwise.
238
238
  */
239
239
  static compare(uuid1, uuid2) {
240
- const a = uuid1.bytes;
241
- const b = uuid2.bytes;
240
+ const a = this.parse(uuid1);
241
+ const b = this.parse(uuid2);
242
242
  for (let i = 0; i < UUID.BYTE_LENGTH; i++) {
243
243
  if (a[i] !== b[i])
244
244
  return a[i] < b[i] ? -1 : 1;
@@ -253,8 +253,8 @@ export class UUID {
253
253
  this.bytes = UUID.parse(input);
254
254
  }
255
255
  /** Instance wrapper for {@link equals}. */
256
- equals(...uuids) {
257
- return UUID.equals(this, ...uuids);
256
+ equals(...inputs) {
257
+ return UUID.equals(this, ...inputs);
258
258
  }
259
259
  /** Instance wrapper for {@link compare}. */
260
260
  compare(other) {
@@ -102,17 +102,17 @@ export declare class UUID {
102
102
  static max<T extends typeof UUID>(this: T): InstanceType<T>;
103
103
  /**
104
104
  * Compares multiple UUIDs for strict equality.
105
- * @param uuids - The UUIDs to compare (at least two required).
105
+ * @param inputs - The UUIDs to compare (at least two required).
106
106
  * @returns true if all provided UUIDs are identical.
107
107
  */
108
- static equals(...uuids: UUID[]): boolean;
108
+ static equals(...inputs: UuidInput[]): boolean;
109
109
  /**
110
110
  * Lexicographically compares two UUIDs.
111
111
  * @param uuid1 - The first UUID.
112
112
  * @param uuid2 - The second UUID.
113
113
  * @returns -1 if uuid1 < uuid2, 1 if uuid1 > uuid2, 0 otherwise.
114
114
  */
115
- static compare(uuid1: UUID, uuid2: UUID): number;
115
+ static compare(uuid1: UuidInput, uuid2: UuidInput): number;
116
116
  /** Raw byte representation of the UUID. */
117
117
  protected readonly bytes: Uint8Array;
118
118
  private _str?;
@@ -123,9 +123,9 @@ export declare class UUID {
123
123
  */
124
124
  constructor(input: UuidInput);
125
125
  /** Instance wrapper for {@link equals}. */
126
- equals(...uuids: UUID[]): boolean;
126
+ equals(...inputs: UuidInput[]): boolean;
127
127
  /** Instance wrapper for {@link compare}. */
128
- compare(other: UUID): number;
128
+ compare(other: UuidInput): number;
129
129
  version(): number;
130
130
  /**
131
131
  * Returns the RFC 4122 string representation of this UUID.
@@ -215,17 +215,17 @@ class UUID {
215
215
  * -------------------------------------------------------------------- */
216
216
  /**
217
217
  * Compares multiple UUIDs for strict equality.
218
- * @param uuids - The UUIDs to compare (at least two required).
218
+ * @param inputs - The UUIDs to compare (at least two required).
219
219
  * @returns true if all provided UUIDs are identical.
220
220
  */
221
- static equals(...uuids) {
222
- const n = uuids.length;
221
+ static equals(...inputs) {
222
+ const n = inputs.length;
223
223
  if (n < 2) {
224
224
  throw new Error('At least two UUIDs required for comparison');
225
225
  }
226
- const ref = uuids[0].bytes;
226
+ const ref = this.parse(inputs[0]);
227
227
  for (let i = 1; i < n; ++i) {
228
- const b = uuids[i].bytes;
228
+ const b = this.parse(inputs[i]);
229
229
  for (let j = 0; j < UUID.BYTE_LENGTH; ++j) {
230
230
  if (ref[j] !== b[j])
231
231
  return false;
@@ -240,8 +240,8 @@ class UUID {
240
240
  * @returns -1 if uuid1 < uuid2, 1 if uuid1 > uuid2, 0 otherwise.
241
241
  */
242
242
  static compare(uuid1, uuid2) {
243
- const a = uuid1.bytes;
244
- const b = uuid2.bytes;
243
+ const a = this.parse(uuid1);
244
+ const b = this.parse(uuid2);
245
245
  for (let i = 0; i < UUID.BYTE_LENGTH; i++) {
246
246
  if (a[i] !== b[i])
247
247
  return a[i] < b[i] ? -1 : 1;
@@ -256,8 +256,8 @@ class UUID {
256
256
  this.bytes = UUID.parse(input);
257
257
  }
258
258
  /** Instance wrapper for {@link equals}. */
259
- equals(...uuids) {
260
- return UUID.equals(this, ...uuids);
259
+ equals(...inputs) {
260
+ return UUID.equals(this, ...inputs);
261
261
  }
262
262
  /** Instance wrapper for {@link compare}. */
263
263
  compare(other) {
@@ -212,17 +212,17 @@ export class UUID {
212
212
  * -------------------------------------------------------------------- */
213
213
  /**
214
214
  * Compares multiple UUIDs for strict equality.
215
- * @param uuids - The UUIDs to compare (at least two required).
215
+ * @param inputs - The UUIDs to compare (at least two required).
216
216
  * @returns true if all provided UUIDs are identical.
217
217
  */
218
- static equals(...uuids) {
219
- const n = uuids.length;
218
+ static equals(...inputs) {
219
+ const n = inputs.length;
220
220
  if (n < 2) {
221
221
  throw new Error('At least two UUIDs required for comparison');
222
222
  }
223
- const ref = uuids[0].bytes;
223
+ const ref = this.parse(inputs[0]);
224
224
  for (let i = 1; i < n; ++i) {
225
- const b = uuids[i].bytes;
225
+ const b = this.parse(inputs[i]);
226
226
  for (let j = 0; j < UUID.BYTE_LENGTH; ++j) {
227
227
  if (ref[j] !== b[j])
228
228
  return false;
@@ -237,8 +237,8 @@ export class UUID {
237
237
  * @returns -1 if uuid1 < uuid2, 1 if uuid1 > uuid2, 0 otherwise.
238
238
  */
239
239
  static compare(uuid1, uuid2) {
240
- const a = uuid1.bytes;
241
- const b = uuid2.bytes;
240
+ const a = this.parse(uuid1);
241
+ const b = this.parse(uuid2);
242
242
  for (let i = 0; i < UUID.BYTE_LENGTH; i++) {
243
243
  if (a[i] !== b[i])
244
244
  return a[i] < b[i] ? -1 : 1;
@@ -253,8 +253,8 @@ export class UUID {
253
253
  this.bytes = UUID.parse(input);
254
254
  }
255
255
  /** Instance wrapper for {@link equals}. */
256
- equals(...uuids) {
257
- return UUID.equals(this, ...uuids);
256
+ equals(...inputs) {
257
+ return UUID.equals(this, ...inputs);
258
258
  }
259
259
  /** Instance wrapper for {@link compare}. */
260
260
  compare(other) {
@@ -102,17 +102,17 @@ export declare class UUID {
102
102
  static max<T extends typeof UUID>(this: T): InstanceType<T>;
103
103
  /**
104
104
  * Compares multiple UUIDs for strict equality.
105
- * @param uuids - The UUIDs to compare (at least two required).
105
+ * @param inputs - The UUIDs to compare (at least two required).
106
106
  * @returns true if all provided UUIDs are identical.
107
107
  */
108
- static equals(...uuids: UUID[]): boolean;
108
+ static equals(...inputs: UuidInput[]): boolean;
109
109
  /**
110
110
  * Lexicographically compares two UUIDs.
111
111
  * @param uuid1 - The first UUID.
112
112
  * @param uuid2 - The second UUID.
113
113
  * @returns -1 if uuid1 < uuid2, 1 if uuid1 > uuid2, 0 otherwise.
114
114
  */
115
- static compare(uuid1: UUID, uuid2: UUID): number;
115
+ static compare(uuid1: UuidInput, uuid2: UuidInput): number;
116
116
  /** Raw byte representation of the UUID. */
117
117
  protected readonly bytes: Uint8Array;
118
118
  private _str?;
@@ -123,9 +123,9 @@ export declare class UUID {
123
123
  */
124
124
  constructor(input: UuidInput);
125
125
  /** Instance wrapper for {@link equals}. */
126
- equals(...uuids: UUID[]): boolean;
126
+ equals(...inputs: UuidInput[]): boolean;
127
127
  /** Instance wrapper for {@link compare}. */
128
- compare(other: UUID): number;
128
+ compare(other: UuidInput): number;
129
129
  version(): number;
130
130
  /**
131
131
  * Returns the RFC 4122 string representation of this UUID.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powfix/core-js",
3
- "version": "0.20.4",
3
+ "version": "0.20.5",
4
4
  "description": "core package",
5
5
  "author": "Kwon Kyung-Min <powfix@gmail.com>",
6
6
  "private": false,