nhb-toolbox 4.30.16 → 4.30.21

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.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,10 @@
4
4
 
5
5
  All notable changes to the package will be documented here.
6
6
 
7
+ ## [4.30.21] - 2026-05-26
8
+
9
+ - **Fixed** token audience(s) validation issue in `Signet` class, previously it was returning false even for valid tokens.
10
+
7
11
  ## [4.30.16] - 2026-05-24
8
12
 
9
13
  - **Fixed** multiple issues with `createFormData`: Now handles configuration options properly and it is more reliable now.
package/README.md CHANGED
@@ -45,6 +45,15 @@
45
45
  </a>
46
46
  </p>
47
47
 
48
+ >[!Info] Notice
49
+ >`nhb-toolbox` is now split into 3 packages for better maintenance, organization and user experience.
50
+ >It will not receive any new features, only critical bug fixes will be provided in the future updates.
51
+ >
52
+ >The new packages are:
53
+ > <a target="_blank" href="https://toolbox-x.nazmul-nhb.dev"> <img src="https://img.shields.io/badge/Toolbox--X-toolbox--x-steelblue" alt="toolbox-x" /> </a>
54
+ > <a target="_blank" href="https://chronos.nazmul-nhb.dev"> <img src="https://img.shields.io/badge/Chronos--Date-chronos--date-teal" alt="chronos-date" /> </a>
55
+ > <a target="_blank" href="https://github.com/nazmul-nhb/bn-calendar"> <img src="https://img.shields.io/badge/Bangla_Calendar-bn--calendar-red" alt="bn-calendar" /> </a>
56
+
48
57
  ## JavaScript/TypeScript Utility Library
49
58
 
50
59
  **NHB Toolbox** provides battle-tested utilities for professional JavaScript/TypeScript development. Carefully crafted to solve common challenges with elegant, production-ready solutions:
@@ -523,6 +532,12 @@ debounceAction(fetchResults, 300);
523
532
  </a>
524
533
  </div>
525
534
 
535
+ <div style={{ display: 'flex', alignItems: 'center', gap: '0.5rem' }}>
536
+ <a target="_blank" href="https://www.npmjs.com/package/chronos-date">
537
+ <img src="https://img.shields.io/badge/Chronos--Date-chronos--date-teal" alt="chronos-date" />
538
+ </a>
539
+ </div>
540
+
526
541
  <div style={{ display: 'flex', alignItems: 'center', gap: '0.5rem' }}>
527
542
  <a target="_blank" href="https://www.npmjs.com/package/bn-calendar">
528
543
  <img src="https://img.shields.io/badge/Bangla_Calendar-bn--calendar-red" alt="bn-calendar" />
@@ -114,7 +114,7 @@ class Signet {
114
114
  return false;
115
115
  const payloadAud = Array.isArray(aud) ? aud : [aud];
116
116
  const expectedAud = Array.isArray(expected) ? expected : [expected];
117
- return payloadAud.some((tokenAud) => expectedAud.includes(tokenAud));
117
+ return !payloadAud.some((tokenAud) => expectedAud.includes(tokenAud));
118
118
  }
119
119
  isInvalidSubject(token, expected) {
120
120
  if (!expected)
@@ -141,7 +141,7 @@ class Signet {
141
141
  throw new Error('Invalid token issuer!');
142
142
  }
143
143
  if (this.isInvalidAudience(token, audience)) {
144
- throw new Error('Invalid token audience(s!');
144
+ throw new Error('Invalid token audience(s)!');
145
145
  }
146
146
  if (this.isInvalidSubject(token, subject)) {
147
147
  throw new Error('Invalid token subject!');
@@ -111,7 +111,7 @@ export class Signet {
111
111
  return false;
112
112
  const payloadAud = Array.isArray(aud) ? aud : [aud];
113
113
  const expectedAud = Array.isArray(expected) ? expected : [expected];
114
- return payloadAud.some((tokenAud) => expectedAud.includes(tokenAud));
114
+ return !payloadAud.some((tokenAud) => expectedAud.includes(tokenAud));
115
115
  }
116
116
  isInvalidSubject(token, expected) {
117
117
  if (!expected)
@@ -138,7 +138,7 @@ export class Signet {
138
138
  throw new Error('Invalid token issuer!');
139
139
  }
140
140
  if (this.isInvalidAudience(token, audience)) {
141
- throw new Error('Invalid token audience(s!');
141
+ throw new Error('Invalid token audience(s)!');
142
142
  }
143
143
  if (this.isInvalidSubject(token, subject)) {
144
144
  throw new Error('Invalid token subject!');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nhb-toolbox",
3
- "version": "4.30.16",
3
+ "version": "4.30.21",
4
4
  "description": "A versatile collection of smart, efficient, and reusable utility functions, classes and types for everyday development needs.",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",