svelte-countup
Advanced tools
Comparing version 0.2.7 to 0.2.8
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('nanoid/nanoid')) : | ||
typeof define === 'function' && define.amd ? define(['nanoid/nanoid'], factory) : | ||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.CountUp = factory(global.nanoid)); | ||
})(this, (function (nanoid) { 'use strict'; | ||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('crypto')) : | ||
typeof define === 'function' && define.amd ? define(['crypto'], factory) : | ||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.CountUp = factory(global.crypto)); | ||
})(this, (function (crypto) { 'use strict'; | ||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } | ||
var crypto__default = /*#__PURE__*/_interopDefaultLegacy(crypto); | ||
function noop() { } | ||
@@ -276,2 +280,27 @@ function run(fn) { | ||
let urlAlphabet = | ||
'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict'; | ||
const POOL_SIZE_MULTIPLIER = 128; | ||
let pool, poolOffset; | ||
let fillPool = bytes => { | ||
if (!pool || pool.length < bytes) { | ||
pool = Buffer.allocUnsafe(bytes * POOL_SIZE_MULTIPLIER); | ||
crypto__default["default"].randomFillSync(pool); | ||
poolOffset = 0; | ||
} else if (poolOffset + bytes > pool.length) { | ||
crypto__default["default"].randomFillSync(pool); | ||
poolOffset = 0; | ||
} | ||
poolOffset += bytes; | ||
}; | ||
let nanoid = (size = 21) => { | ||
fillPool((size -= 0)); | ||
let id = ''; | ||
for (let i = poolOffset - size; i < poolOffset; i++) { | ||
id += urlAlphabet[pool[i] & 63]; | ||
} | ||
return id | ||
}; | ||
const defaultOptions = { | ||
@@ -390,3 +419,3 @@ root: null, | ||
function instance($$self, $$props, $$invalidate) { | ||
const id = nanoid.nanoid(); | ||
const id = nanoid(); | ||
let isInView; | ||
@@ -393,0 +422,0 @@ let { value } = $$props; |
{ | ||
"name": "svelte-countup", | ||
"componentname": "CountUp", | ||
"version": "0.2.7", | ||
"version": "0.2.8", | ||
"main": "lib/index.js", | ||
@@ -6,0 +6,0 @@ "module": "lib/index.mjs", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
35753
951