@salespark/toolkit 2.1.18 → 2.1.19

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/README.md CHANGED
@@ -33,6 +33,7 @@ npm i @salespark/toolkit
33
33
  - **Boolean utilities**: safe boolean conversion with common representations
34
34
  - **Validation utilities**: IBAN validator (ISO 13616), Portuguese tax ID validator
35
35
  - **Security utilities**: Markdown XSS protection, content sanitization, risk assessment, obfuscation helpers, reversible base36 code encoding/decoding
36
+ - **UUID utilities**: uuidv4 generator (RFC 4122)
36
37
  - **Environment detection**: `isBrowser`, `isNode` runtime checks
37
38
 
38
39
  ---
@@ -52,6 +53,7 @@ import {
52
53
  clamp,
53
54
  isBrowser,
54
55
  toBool,
56
+ uuidv4,
55
57
  } from "@salespark/toolkit";
56
58
 
57
59
  // Debounce a function
@@ -74,6 +76,9 @@ const safe = clamp(15, 0, 10); // 10
74
76
  // Convert to boolean
75
77
  const bool = toBool("yes"); // true
76
78
 
79
+ // Generate UUID v4
80
+ const id = uuidv4();
81
+
77
82
  // Check environment
78
83
  if (isBrowser) {
79
84
  /* browser-specific code */
@@ -102,6 +107,9 @@ const safe = _.clamp(15, 0, 10); // 10
102
107
  // Convert to boolean
103
108
  const bool = _.toBool("yes"); // true
104
109
 
110
+ // Generate UUID v4
111
+ const id = _.uuidv4();
112
+
105
113
  // Check environment
106
114
  if (_.isBrowser) {
107
115
  /* browser-specific code */
@@ -1053,5 +1061,5 @@ MIT © [SalesPark](https://salespark.io)
1053
1061
 
1054
1062
  ---
1055
1063
 
1056
- _Document version: 15_
1057
- _Last update: 16-02-2026_
1064
+ _Document version: 16_
1065
+ _Last update: 14-03-2026_
package/dist/index.cjs CHANGED
@@ -1,5 +1,7 @@
1
1
  'use strict';
2
2
 
3
+ var uuid = require('uuid');
4
+
3
5
  // src/utils/array.ts
4
6
  function uniqBy(arr, key) {
5
7
  const seen = /* @__PURE__ */ new Set();
@@ -2224,6 +2226,10 @@ var decodeBase36Code = (code, config) => {
2224
2226
  var isBrowser = typeof globalThis !== "undefined" && typeof globalThis.document !== "undefined";
2225
2227
  var isNode = typeof process !== "undefined" && !!process.versions?.node;
2226
2228
 
2229
+ Object.defineProperty(exports, "uuidv4", {
2230
+ enumerable: true,
2231
+ get: function () { return uuid.v4; }
2232
+ });
2227
2233
  exports.addSpaceBetweenNumbers = addSpaceBetweenNumbers;
2228
2234
  exports.addThousandsSpace = addThousandsSpace;
2229
2235
  exports.areArraysDeepEqualUnordered = areArraysDeepEqualUnordered;