@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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/snowflake.ts +3 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oh-my-pi/pi-utils",
3
- "version": "11.0.1",
3
+ "version": "11.0.2",
4
4
  "description": "Shared utilities for pi packages",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
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
- timelike = timelike.getTime();
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
- timelike = timelike.getTime();
111
+ return formatParts(timelike.getTime() - EPOCH, MAX_SEQ);
114
112
  case "number":
115
- return formatParts(timelike - EPOCH, 0x3fffff);
113
+ return formatParts(timelike - EPOCH, MAX_SEQ);
116
114
  case "string": // Snowflake hex string
117
115
  return timelike;
118
116
  }