@powfix/core-js 0.20.1 → 0.20.3
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.
- package/dist/browser/cjs/shared/utils/UUID.js +6 -0
- package/dist/browser/esm/shared/utils/UUID.mjs +6 -0
- package/dist/browser/types/shared/utils/UUID.d.ts +2 -0
- package/dist/node/cjs/nodejs/utils/sequelize-utils/SequelizeUtils.js +5 -3
- package/dist/node/cjs/shared/utils/UUID.js +6 -0
- package/dist/node/esm/nodejs/utils/sequelize-utils/SequelizeUtils.mjs +5 -3
- package/dist/node/esm/shared/utils/UUID.mjs +6 -0
- package/dist/node/types/shared/utils/UUID.d.ts +2 -0
- package/package.json +1 -1
|
@@ -72,6 +72,9 @@ class UUID {
|
|
|
72
72
|
return false;
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
+
static version(input) {
|
|
76
|
+
return this.parse(input)[14];
|
|
77
|
+
}
|
|
75
78
|
/* --------------------------------------------------------------------
|
|
76
79
|
* Parsing / formatting helpers
|
|
77
80
|
* -------------------------------------------------------------------- */
|
|
@@ -260,6 +263,9 @@ class UUID {
|
|
|
260
263
|
compare(other) {
|
|
261
264
|
return UUID.compare(this, other);
|
|
262
265
|
}
|
|
266
|
+
version() {
|
|
267
|
+
return UUID.version(this);
|
|
268
|
+
}
|
|
263
269
|
/**
|
|
264
270
|
* Returns the RFC 4122 string representation of this UUID.
|
|
265
271
|
* @returns The formatted UUID string.
|
|
@@ -69,6 +69,9 @@ export class UUID {
|
|
|
69
69
|
return false;
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
|
+
static version(input) {
|
|
73
|
+
return this.parse(input)[14];
|
|
74
|
+
}
|
|
72
75
|
/* --------------------------------------------------------------------
|
|
73
76
|
* Parsing / formatting helpers
|
|
74
77
|
* -------------------------------------------------------------------- */
|
|
@@ -257,6 +260,9 @@ export class UUID {
|
|
|
257
260
|
compare(other) {
|
|
258
261
|
return UUID.compare(this, other);
|
|
259
262
|
}
|
|
263
|
+
version() {
|
|
264
|
+
return UUID.version(this);
|
|
265
|
+
}
|
|
260
266
|
/**
|
|
261
267
|
* Returns the RFC 4122 string representation of this UUID.
|
|
262
268
|
* @returns The formatted UUID string.
|
|
@@ -39,6 +39,7 @@ export declare class UUID {
|
|
|
39
39
|
* @returns true if the input is a valid representation of a UUID.
|
|
40
40
|
*/
|
|
41
41
|
static isValid(input: UuidInput): boolean;
|
|
42
|
+
static version(input: UuidInput): number;
|
|
42
43
|
/**
|
|
43
44
|
* Inserts hyphens into a 32‑character hex string to produce an RFC 4122 string.
|
|
44
45
|
* @param hex - The plain hexadecimal UUID.
|
|
@@ -125,6 +126,7 @@ export declare class UUID {
|
|
|
125
126
|
equals(...uuids: UUID[]): boolean;
|
|
126
127
|
/** Instance wrapper for {@link compare}. */
|
|
127
128
|
compare(other: UUID): number;
|
|
129
|
+
version(): number;
|
|
128
130
|
/**
|
|
129
131
|
* Returns the RFC 4122 string representation of this UUID.
|
|
130
132
|
* @returns The formatted UUID string.
|
|
@@ -41,10 +41,12 @@ class SequelizeUtils {
|
|
|
41
41
|
}
|
|
42
42
|
else {
|
|
43
43
|
return Object.assign({ type: "binary(16)", get() {
|
|
44
|
-
|
|
44
|
+
const value = this.getDataValue(columnName);
|
|
45
|
+
return UUID_1.UUID.from(value);
|
|
45
46
|
},
|
|
46
|
-
set(
|
|
47
|
-
|
|
47
|
+
set(input) {
|
|
48
|
+
const value = UUID_1.UUID.from(input).toBuffer();
|
|
49
|
+
this.setDataValue(columnName, value);
|
|
48
50
|
} }, overrideOptions);
|
|
49
51
|
}
|
|
50
52
|
}
|
|
@@ -72,6 +72,9 @@ class UUID {
|
|
|
72
72
|
return false;
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
+
static version(input) {
|
|
76
|
+
return this.parse(input)[14];
|
|
77
|
+
}
|
|
75
78
|
/* --------------------------------------------------------------------
|
|
76
79
|
* Parsing / formatting helpers
|
|
77
80
|
* -------------------------------------------------------------------- */
|
|
@@ -260,6 +263,9 @@ class UUID {
|
|
|
260
263
|
compare(other) {
|
|
261
264
|
return UUID.compare(this, other);
|
|
262
265
|
}
|
|
266
|
+
version() {
|
|
267
|
+
return UUID.version(this);
|
|
268
|
+
}
|
|
263
269
|
/**
|
|
264
270
|
* Returns the RFC 4122 string representation of this UUID.
|
|
265
271
|
* @returns The formatted UUID string.
|
|
@@ -38,10 +38,12 @@ export class SequelizeUtils {
|
|
|
38
38
|
}
|
|
39
39
|
else {
|
|
40
40
|
return Object.assign({ type: "binary(16)", get() {
|
|
41
|
-
|
|
41
|
+
const value = this.getDataValue(columnName);
|
|
42
|
+
return UUID.from(value);
|
|
42
43
|
},
|
|
43
|
-
set(
|
|
44
|
-
|
|
44
|
+
set(input) {
|
|
45
|
+
const value = UUID.from(input).toBuffer();
|
|
46
|
+
this.setDataValue(columnName, value);
|
|
45
47
|
} }, overrideOptions);
|
|
46
48
|
}
|
|
47
49
|
}
|
|
@@ -69,6 +69,9 @@ export class UUID {
|
|
|
69
69
|
return false;
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
|
+
static version(input) {
|
|
73
|
+
return this.parse(input)[14];
|
|
74
|
+
}
|
|
72
75
|
/* --------------------------------------------------------------------
|
|
73
76
|
* Parsing / formatting helpers
|
|
74
77
|
* -------------------------------------------------------------------- */
|
|
@@ -257,6 +260,9 @@ export class UUID {
|
|
|
257
260
|
compare(other) {
|
|
258
261
|
return UUID.compare(this, other);
|
|
259
262
|
}
|
|
263
|
+
version() {
|
|
264
|
+
return UUID.version(this);
|
|
265
|
+
}
|
|
260
266
|
/**
|
|
261
267
|
* Returns the RFC 4122 string representation of this UUID.
|
|
262
268
|
* @returns The formatted UUID string.
|
|
@@ -39,6 +39,7 @@ export declare class UUID {
|
|
|
39
39
|
* @returns true if the input is a valid representation of a UUID.
|
|
40
40
|
*/
|
|
41
41
|
static isValid(input: UuidInput): boolean;
|
|
42
|
+
static version(input: UuidInput): number;
|
|
42
43
|
/**
|
|
43
44
|
* Inserts hyphens into a 32‑character hex string to produce an RFC 4122 string.
|
|
44
45
|
* @param hex - The plain hexadecimal UUID.
|
|
@@ -125,6 +126,7 @@ export declare class UUID {
|
|
|
125
126
|
equals(...uuids: UUID[]): boolean;
|
|
126
127
|
/** Instance wrapper for {@link compare}. */
|
|
127
128
|
compare(other: UUID): number;
|
|
129
|
+
version(): number;
|
|
128
130
|
/**
|
|
129
131
|
* Returns the RFC 4122 string representation of this UUID.
|
|
130
132
|
* @returns The formatted UUID string.
|