@nest-util/nest-crud 1.0.1 → 1.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.
@@ -8,11 +8,11 @@ exports.buildNextCursor = buildNextCursor;
8
8
  exports.detectCursorStrategy = detectCursorStrategy;
9
9
  // ─── Base64-URL helpers ──────────────────────────────────────────────
10
10
  function base64UrlEncode(payload) {
11
- return Buffer.from(JSON.stringify(payload))
11
+ const b64 = Buffer.from(JSON.stringify(payload))
12
12
  .toString('base64')
13
13
  .replace(/\+/g, '-')
14
- .replace(/\//g, '_')
15
- .replace(/=+$/, '');
14
+ .replace(/\//g, '_');
15
+ return b64.endsWith('==') ? b64.slice(0, -2) : b64.endsWith('=') ? b64.slice(0, -1) : b64;
16
16
  }
17
17
  function base64UrlDecode(raw) {
18
18
  const base64 = raw.replace(/-/g, '+').replace(/_/g, '/') + '=='.slice((raw.length + 3) % 4);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nest-util/nest-crud",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",