Skip to content

Commit

Permalink
Update package descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
t-ski committed Oct 16, 2024
1 parent 1fc50e4 commit 10445e9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 13 deletions.
13 changes: 6 additions & 7 deletions packages/rjs-handler/src/RateLimiter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ export class RateLimiter {
if (this.limit === 0) return true;

const now: number = Date.now();
const limitData: ILimitData = this.limits.get(clientIdentifier) ?? {
const limitData: ILimitData = this.limits.get(clientIdentifier)
?? {
timePivot: now,
previousWindow: null,
currentWindow: 0
Expand All @@ -27,13 +28,11 @@ export class RateLimiter {
const windowSpan: number = this.windowSize * 2;
const delta: number = now - limitData.timePivot;
if (delta > this.windowSize) {
limitData.previousWindow = limitData.currentWindow;
limitData.timePivot = now;
limitData.previousWindow = (delta <= windowSpan)
? limitData.currentWindow
: 0;
limitData.currentWindow = 0;

if (delta > windowSpan) {
limitData.timePivot = now;
limitData.previousWindow = 0;
}
}
limitData.currentWindow += 1;

Expand Down
2 changes: 1 addition & 1 deletion packages/rjs-server/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@rapidjs.org/rjs-server",
"version": "0.1.3",
"description": "rJS (pron. ‘rapidJS’) is a web server with virtual plugin-based build capabilities.",
"description": "Core web server utility for rJS.",
"author": "Thassilo Martin Schiepanski",
"license": "Apache-2.0",
"homepage": "https://rapidjs.org",
Expand Down
5 changes: 1 addition & 4 deletions packages/rjs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,15 @@

<p align="center">
<a href="https://github.com/rapidjs-org/rJS/actions/workflows/test.yml"><img src="https://img.shields.io/github/actions/workflow/status/rapidjs-org/rjs/test.yml?label=test&logo=github"></a>
&hairsp;
<a href="https://github.com/rapidjs-org/rJS/blob/main/LICENSE"><img src="https://img.shields.io/github/license/rapidjs-org/rjs"></a>
&hairsp;
<a href="https://www.npmjs.com/package/@rapidjs.org/rjs"><img src="https://img.shields.io/npm/v/@rapidjs.org/rjs?logo=npm"></a>
&hairsp;
<a href="https://www.npmjs.com/package/@rapidjs.org/rjs"><img src="https://img.shields.io/bundlephobia/minzip/@rapidjs.org/rjs?label=size&logo=npm"></a>
</p>

<p align="center">
<strong><a href="https://rapidjs.org" target="_blank">rJS</a> (pron. ‘rapidJS’)</strong> is a plugin-based build interface, and
<br>
a progressive web server based on virtual build capabilites.
a progressive web server based on virtual build capabilities.
</p>

## Install
Expand Down
2 changes: 1 addition & 1 deletion packages/rjs/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@rapidjs.org/rjs",
"version": "0.1.3",
"description": "rJS (pron. ‘rapidJS’) is a plugin-based build interface, and a progressive web server based on virtual build capabilites.",
"description": "rJS (pron. ‘rapidJS’) is a plugin-based build interface, and a progressive web server based on virtual build capabilities.",
"author": "Thassilo Martin Schiepanski",
"license": "Apache-2.0",
"homepage": "https://rapidjs.org",
Expand Down

0 comments on commit 10445e9

Please sign in to comment.