@naturalcycles/js-lib 14.114.0 → 14.115.1

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.
@@ -24,6 +24,8 @@ exports._lowerFirst = _lowerFirst;
24
24
  */
25
25
  function _split(str, separator, limit) {
26
26
  const parts = str.split(separator);
27
+ if (parts.length <= limit)
28
+ return parts;
27
29
  return [...parts.slice(0, limit - 1), parts.slice(limit - 1).join(separator)];
28
30
  }
29
31
  exports._split = _split;
package/dist/types.d.ts CHANGED
@@ -165,6 +165,7 @@ export declare type UnixTimestamp = number;
165
165
  export declare type Integer = number;
166
166
  export declare type Base64String = string;
167
167
  export declare type Base64UrlString = string;
168
+ export declare type JWTString = string;
168
169
  /**
169
170
  * Named type for JSON.parse / JSON.stringify second argument
170
171
  */
@@ -18,6 +18,8 @@ export function _lowerFirst(s) {
18
18
  */
19
19
  export function _split(str, separator, limit) {
20
20
  const parts = str.split(separator);
21
+ if (parts.length <= limit)
22
+ return parts;
21
23
  return [...parts.slice(0, limit - 1), parts.slice(limit - 1).join(separator)];
22
24
  }
23
25
  export function _removeWhitespace(s) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturalcycles/js-lib",
3
- "version": "14.114.0",
3
+ "version": "14.115.1",
4
4
  "scripts": {
5
5
  "prepare": "husky install",
6
6
  "build-prod": "build-prod-esm-cjs",
@@ -22,6 +22,7 @@ export function _lowerFirst(s: string): string {
22
22
  */
23
23
  export function _split(str: string, separator: string, limit: number): string[] {
24
24
  const parts = str.split(separator)
25
+ if (parts.length <= limit) return parts
25
26
  return [...parts.slice(0, limit - 1), parts.slice(limit - 1).join(separator)]
26
27
  }
27
28
 
package/src/types.ts CHANGED
@@ -225,6 +225,7 @@ export type Integer = number
225
225
 
226
226
  export type Base64String = string
227
227
  export type Base64UrlString = string
228
+ export type JWTString = string
228
229
 
229
230
  /**
230
231
  * Named type for JSON.parse / JSON.stringify second argument