@withwiz/toolkit 0.2.2 → 0.2.3

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.
@@ -1,25 +1,6 @@
1
- import {
2
- JWTClientManager,
3
- clearStoredTokens,
4
- clearTokens,
5
- createApiHeaders,
6
- createAuthHeader,
7
- decodeJWTPayload,
8
- extractUserFromToken,
9
- getStoredTokens,
10
- getTokenExpirationString,
11
- getTokenIssuedAtString,
12
- getTokenRemainingTime,
13
- isTokenExpired,
14
- isTokenExpiringSoon,
15
- storeTokens
16
- } from "../chunk-XRRPEBKB.js";
17
1
  import {
18
2
  OAuthManager
19
3
  } from "../chunk-V5K5FYU7.js";
20
- import {
21
- TokenGenerator
22
- } from "../chunk-GDWEDUHO.js";
23
4
  import {
24
5
  DEFAULT_PASSWORD_CONFIG,
25
6
  createPasswordHasher,
@@ -35,6 +16,25 @@ import {
35
16
  defaultPasswordSchema,
36
17
  strongPasswordSchema
37
18
  } from "../chunk-IHXRF3BH.js";
19
+ import {
20
+ TokenGenerator
21
+ } from "../chunk-GDWEDUHO.js";
22
+ import {
23
+ JWTClientManager,
24
+ clearStoredTokens,
25
+ clearTokens,
26
+ createApiHeaders,
27
+ createAuthHeader,
28
+ decodeJWTPayload,
29
+ extractUserFromToken,
30
+ getStoredTokens,
31
+ getTokenExpirationString,
32
+ getTokenIssuedAtString,
33
+ getTokenRemainingTime,
34
+ isTokenExpired,
35
+ isTokenExpiringSoon,
36
+ storeTokens
37
+ } from "../chunk-XRRPEBKB.js";
38
38
  import {
39
39
  OAuthProvider,
40
40
  PasswordStrength,
@@ -74,7 +74,7 @@ function escapeHTML(input) {
74
74
  if (typeof input !== "string") {
75
75
  return "";
76
76
  }
77
- return input.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#x27;").replace(/\//g, "&#x2F;");
77
+ return input.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#x27;");
78
78
  }
79
79
  function detectXSS(input) {
80
80
  if (typeof input !== "string") {
@@ -149,14 +149,14 @@ function sanitizeInput(input, options = {}) {
149
149
  if (trim) {
150
150
  sanitized = sanitized.trim();
151
151
  }
152
- if (sanitized.length > maxLength) {
153
- sanitized = sanitized.substring(0, maxLength);
154
- }
155
152
  if (!allowHTML) {
156
153
  sanitized = escapeHTML(sanitized);
157
154
  }
158
155
  sanitized = sanitized.replace(/\0/g, "");
159
156
  sanitized = sanitized.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/g, "");
157
+ if (sanitized.length > maxLength) {
158
+ sanitized = sanitized.substring(0, maxLength);
159
+ }
160
160
  return sanitized;
161
161
  }
162
162
  function validateFilename(filename) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@withwiz/toolkit",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "Shared utility library for withwiz projects",
5
5
  "license": "MIT",
6
6
  "private": false,