Socket
Socket
Sign inDemoInstall

@blaze-react/utils

Package Overview
Dependencies
Maintainers
5
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@blaze-react/utils - npm Package Compare versions

Comparing version 0.3.30 to 0.3.31

lib/decorator.js

38

lib/uniqueId.js
"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"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc