@oh-my-pi/pi-utils 11.0.1 → 11.0.2
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 +1 -1
- package/src/snowflake.ts +3 -5
package/package.json
CHANGED
package/src/snowflake.ts
CHANGED
|
@@ -97,9 +97,8 @@ namespace Snowflake {
|
|
|
97
97
|
//
|
|
98
98
|
export function lowerbound(timelike: Date | number | Snowflake): Snowflake {
|
|
99
99
|
switch (typeof timelike) {
|
|
100
|
-
// biome-ignore lint/suspicious/noFallthroughSwitchClause: intentional fallthrough
|
|
101
100
|
case "object": // Date
|
|
102
|
-
|
|
101
|
+
return formatParts(timelike.getTime() - EPOCH, 0);
|
|
103
102
|
case "number":
|
|
104
103
|
return formatParts(timelike - EPOCH, 0);
|
|
105
104
|
case "string": // Snowflake hex string
|
|
@@ -108,11 +107,10 @@ namespace Snowflake {
|
|
|
108
107
|
}
|
|
109
108
|
export function upperbound(timelike: Date | number | Snowflake): Snowflake {
|
|
110
109
|
switch (typeof timelike) {
|
|
111
|
-
// biome-ignore lint/suspicious/noFallthroughSwitchClause: intentional fallthrough
|
|
112
110
|
case "object": // Date
|
|
113
|
-
|
|
111
|
+
return formatParts(timelike.getTime() - EPOCH, MAX_SEQ);
|
|
114
112
|
case "number":
|
|
115
|
-
return formatParts(timelike - EPOCH,
|
|
113
|
+
return formatParts(timelike - EPOCH, MAX_SEQ);
|
|
116
114
|
case "string": // Snowflake hex string
|
|
117
115
|
return timelike;
|
|
118
116
|
}
|