@vuu-ui/vuu-utils 3.5.0-beta.2 → 3.5.0-beta.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/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "3.5.0-beta.
|
|
2
|
+
"version": "3.5.0-beta.3",
|
|
3
3
|
"author": "heswell",
|
|
4
4
|
"main": "./src/index.js",
|
|
5
5
|
"license": "Apache-2.0",
|
|
@@ -15,14 +15,14 @@
|
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
17
|
"@dnd-kit/react": "^0.1.21",
|
|
18
|
-
"@vuu-ui/vuu-data-types": "3.5.0-beta.
|
|
19
|
-
"@vuu-ui/vuu-table-types": "3.5.0-beta.
|
|
20
|
-
"@vuu-ui/vuu-filter-types": "3.5.0-beta.
|
|
21
|
-
"@vuu-ui/vuu-protocol-types": "3.5.0-beta.
|
|
18
|
+
"@vuu-ui/vuu-data-types": "3.5.0-beta.3",
|
|
19
|
+
"@vuu-ui/vuu-table-types": "3.5.0-beta.3",
|
|
20
|
+
"@vuu-ui/vuu-filter-types": "3.5.0-beta.3",
|
|
21
|
+
"@vuu-ui/vuu-protocol-types": "3.5.0-beta.3"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"@internationalized/date": "^3.0.0",
|
|
25
|
-
"@vuu-ui/vuu-filter-parser": "3.5.0-beta.
|
|
25
|
+
"@vuu-ui/vuu-filter-parser": "3.5.0-beta.3",
|
|
26
26
|
"clsx": "^2.0.0",
|
|
27
27
|
"react": "^19.2.3",
|
|
28
28
|
"react-dom": "^19.2.3"
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { fromDateTimeFields, getDateTimeFields } from "./time-zone.js";
|
|
2
2
|
const NANOS_PER_MILLI = 1000000n;
|
|
3
3
|
const integerPattern = /^-?\d+$/;
|
|
4
|
+
const MAX_EPOCH_MILLIS = 8.64e15;
|
|
4
5
|
class EpochTimestamp {
|
|
5
6
|
epochMillis;
|
|
6
7
|
subMilliNanos;
|
|
@@ -32,6 +33,10 @@ class EpochTimestamp {
|
|
|
32
33
|
return null == value || "" === value || 0 === value || "0" === value || 0n === value;
|
|
33
34
|
}
|
|
34
35
|
static fromWire(value, encoding) {
|
|
36
|
+
const ts = EpochTimestamp.decode(value, encoding);
|
|
37
|
+
return void 0 !== ts && Math.abs(ts.epochMillis) <= MAX_EPOCH_MILLIS ? ts : void 0;
|
|
38
|
+
}
|
|
39
|
+
static decode(value, encoding) {
|
|
35
40
|
if (EpochTimestamp.isEmpty(value)) return;
|
|
36
41
|
if (value instanceof EpochTimestamp) return value;
|
|
37
42
|
if ("epochNanos" === encoding) {
|
|
@@ -32,9 +32,12 @@ export declare class EpochTimestamp {
|
|
|
32
32
|
static isEmpty(value: unknown): value is 0 | "" | "0" | 0n | null | undefined;
|
|
33
33
|
/**
|
|
34
34
|
* Decode a value as received from the server, or held in a filter,
|
|
35
|
-
* in the given encoding. Returns undefined for an empty or invalid value
|
|
35
|
+
* in the given encoding. Returns undefined for an empty or invalid value,
|
|
36
|
+
* including a value outside the range of a JavaScript Date (e.g. a nanos
|
|
37
|
+
* value decoded as millis).
|
|
36
38
|
*/
|
|
37
39
|
static fromWire(value: unknown, encoding: TemporalEncoding): EpochTimestamp | undefined;
|
|
40
|
+
private static decode;
|
|
38
41
|
get epochNanos(): bigint;
|
|
39
42
|
toDate(): Date;
|
|
40
43
|
/**
|