@bgord/tools 0.12.25 → 0.12.26
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.
|
@@ -15,9 +15,6 @@ export class RateLimiter {
|
|
|
15
15
|
this.lastInvocationTimestampMs = currentTimestampMs;
|
|
16
16
|
return { allowed: true };
|
|
17
17
|
}
|
|
18
|
-
return {
|
|
19
|
-
allowed: false,
|
|
20
|
-
remainingMs: Timestamp.parse(nextAllowedTimestampMs - currentTimestampMs),
|
|
21
|
-
};
|
|
18
|
+
return { allowed: false, remainingMs: Timestamp.parse(nextAllowedTimestampMs - currentTimestampMs) };
|
|
22
19
|
}
|
|
23
20
|
}
|
package/dist/relative-date.vo.js
CHANGED
|
@@ -9,9 +9,6 @@ export class RelativeDate {
|
|
|
9
9
|
return RelativeDate._format(timestampMs);
|
|
10
10
|
}
|
|
11
11
|
static _format(timestampMs) {
|
|
12
|
-
return {
|
|
13
|
-
raw: timestampMs,
|
|
14
|
-
relative: DateFormatters.relative(timestampMs),
|
|
15
|
-
};
|
|
12
|
+
return { raw: timestampMs, relative: DateFormatters.relative(timestampMs) };
|
|
16
13
|
}
|
|
17
14
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bgord/tools",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.26",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Bartosz Gordon",
|
|
@@ -21,25 +21,25 @@
|
|
|
21
21
|
"preinstall": "bunx only-allow bun"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@biomejs/biome": "2.2.
|
|
24
|
+
"@biomejs/biome": "2.2.4",
|
|
25
25
|
"@commitlint/cli": "19.8.1",
|
|
26
26
|
"@commitlint/config-conventional": "19.8.1",
|
|
27
|
-
"@types/bun": "1.2.
|
|
27
|
+
"@types/bun": "1.2.22",
|
|
28
28
|
"@types/mime-types": "3.0.1",
|
|
29
29
|
"cspell": "9.2.1",
|
|
30
30
|
"knip": "5.63.1",
|
|
31
|
-
"lefthook": "1.
|
|
31
|
+
"lefthook": "1.13.0",
|
|
32
32
|
"only-allow": "1.2.1",
|
|
33
33
|
"shellcheck": "4.1.0",
|
|
34
34
|
"typescript": "5.9.2",
|
|
35
|
-
"zod": "4.1.
|
|
35
|
+
"zod": "4.1.8"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"date-fns": "4.1.0",
|
|
39
39
|
"mime-types": "3.0.1"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"zod": "4.1.
|
|
42
|
+
"zod": "4.1.8"
|
|
43
43
|
},
|
|
44
44
|
"sideEffects": false
|
|
45
45
|
}
|
|
@@ -6,10 +6,7 @@ type RateLimiterOptionsType = Pick<TimeResult, "ms">;
|
|
|
6
6
|
|
|
7
7
|
type RateLimiterResultSuccessType = { allowed: true };
|
|
8
8
|
|
|
9
|
-
type RateLimiterResultErrorType = {
|
|
10
|
-
allowed: false;
|
|
11
|
-
remainingMs: TimestampType;
|
|
12
|
-
};
|
|
9
|
+
type RateLimiterResultErrorType = { allowed: false; remainingMs: TimestampType };
|
|
13
10
|
|
|
14
11
|
type RateLimiterResultType = RateLimiterResultSuccessType | RateLimiterResultErrorType;
|
|
15
12
|
|
|
@@ -33,9 +30,6 @@ export class RateLimiter {
|
|
|
33
30
|
return { allowed: true };
|
|
34
31
|
}
|
|
35
32
|
|
|
36
|
-
return {
|
|
37
|
-
allowed: false,
|
|
38
|
-
remainingMs: Timestamp.parse(nextAllowedTimestampMs - currentTimestampMs),
|
|
39
|
-
};
|
|
33
|
+
return { allowed: false, remainingMs: Timestamp.parse(nextAllowedTimestampMs - currentTimestampMs) };
|
|
40
34
|
}
|
|
41
35
|
}
|
package/src/relative-date.vo.ts
CHANGED
|
@@ -16,9 +16,6 @@ export class RelativeDate {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
private static _format(timestampMs: TimestampType): RelativeDateType {
|
|
19
|
-
return {
|
|
20
|
-
raw: timestampMs,
|
|
21
|
-
relative: DateFormatters.relative(timestampMs),
|
|
22
|
-
};
|
|
19
|
+
return { raw: timestampMs, relative: DateFormatters.relative(timestampMs) };
|
|
23
20
|
}
|
|
24
21
|
}
|