@blaze-react/utils
Advanced tools
Comparing version 0.3.30 to 0.3.31
"use strict"; | ||
exports.__esModule = true; | ||
var generateKey = function (element) { | ||
var key = unescape(encodeURIComponent(JSON.stringify(element))); | ||
try { | ||
return btoa(key); | ||
var UniqueId = /** @class */ (function () { | ||
function UniqueId() { | ||
var _this = this; | ||
this.uniqueId = function (element) { | ||
var key = "uid-" + _this.generateKey(element); | ||
var allKeys = Object.keys(_this.keys); | ||
if (allKeys.includes(key)) { | ||
key = key + "_" + allKeys.length; | ||
} | ||
_this.keys[key] = key; | ||
return key; | ||
}; | ||
this.keys = {}; | ||
} | ||
catch (_a) { | ||
return Buffer.from(key).toString("base64"); | ||
} | ||
}; | ||
var uniqueId = function (element) { | ||
var keys = {}; | ||
var key = "uid-" + generateKey(element); | ||
keys[key] = key; | ||
return key; | ||
}; | ||
exports["default"] = uniqueId; | ||
UniqueId.prototype.generateKey = function (element) { | ||
var key = unescape(encodeURIComponent(JSON.stringify(element))); | ||
return typeof btoa === "function" | ||
? btoa(key) | ||
: Buffer.from(key).toString("base64"); | ||
}; | ||
return UniqueId; | ||
}()); | ||
var uniqId = new UniqueId(); | ||
exports["default"] = uniqId.uniqueId; |
{ | ||
"name": "@blaze-react/utils", | ||
"version": "0.3.30", | ||
"version": "0.3.31", | ||
"publishConfig": { | ||
@@ -39,3 +39,3 @@ "access": "public" | ||
}, | ||
"gitHead": "ecc7322cc780bab38907289591eb3b3edf34c72c" | ||
"gitHead": "7bfdf6bfe5c67be5a9119c8b35d62bfff6c5c009" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9651
16
262