@easy-editor/core 0.0.3 → 0.0.4
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/dist/cjs/index.development.js +5 -20
- package/dist/cjs/index.development.js.map +1 -1
- package/dist/cjs/index.js +5 -20
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/index.production.js +5 -20
- package/dist/cjs/index.production.js.map +1 -1
- package/dist/esm/index.development.js +5 -20
- package/dist/esm/index.development.js.map +1 -1
- package/dist/esm/index.js +5 -20
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.production.js +5 -20
- package/dist/esm/index.production.js.map +1 -1
- package/dist/index.js +5 -20
- package/package.json +1 -1
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var node_crypto = require('node:crypto');
|
|
4
|
-
|
|
5
3
|
var niceErrors = {
|
|
6
4
|
0: "Invalid value for configuration 'enforceActions', expected 'never', 'always' or 'observed'",
|
|
7
5
|
1: function _(annotationType, key) {
|
|
@@ -5282,27 +5280,14 @@ const isPlainObject = value => {
|
|
|
5282
5280
|
|
|
5283
5281
|
const urlAlphabet = 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict';
|
|
5284
5282
|
|
|
5285
|
-
|
|
5286
|
-
let pool, poolOffset;
|
|
5287
|
-
function fillPool(bytes) {
|
|
5288
|
-
if (!pool || pool.length < bytes) {
|
|
5289
|
-
pool = Buffer.allocUnsafe(bytes * POOL_SIZE_MULTIPLIER);
|
|
5290
|
-
node_crypto.webcrypto.getRandomValues(pool);
|
|
5291
|
-
poolOffset = 0;
|
|
5292
|
-
} else if (poolOffset + bytes > pool.length) {
|
|
5293
|
-
node_crypto.webcrypto.getRandomValues(pool);
|
|
5294
|
-
poolOffset = 0;
|
|
5295
|
-
}
|
|
5296
|
-
poolOffset += bytes;
|
|
5297
|
-
}
|
|
5298
|
-
function nanoid(size = 21) {
|
|
5299
|
-
fillPool(size -= 0);
|
|
5283
|
+
let nanoid = (size = 21) => {
|
|
5300
5284
|
let id = '';
|
|
5301
|
-
|
|
5302
|
-
|
|
5285
|
+
let bytes = crypto.getRandomValues(new Uint8Array(size));
|
|
5286
|
+
while (size--) {
|
|
5287
|
+
id += urlAlphabet[bytes[size] & 63];
|
|
5303
5288
|
}
|
|
5304
5289
|
return id;
|
|
5305
|
-
}
|
|
5290
|
+
};
|
|
5306
5291
|
|
|
5307
5292
|
const uniqueId = (prefix = '') => {
|
|
5308
5293
|
return `${prefix}-${nanoid(12)}`;
|