svelte-countup
Advanced tools
Comparing version 0.2.6 to 0.2.7
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : | ||
typeof define === 'function' && define.amd ? define(factory) : | ||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.CountUp = factory()); | ||
})(this, (function () { 'use strict'; | ||
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'; | ||
@@ -276,13 +276,2 @@ function noop() { } | ||
let urlAlphabet = | ||
'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict'; | ||
let nanoid = (size = 21) => { | ||
let id = ''; | ||
let i = size; | ||
while (i--) { | ||
id += urlAlphabet[(Math.random() * 64) | 0]; | ||
} | ||
return id | ||
}; | ||
const defaultOptions = { | ||
@@ -401,3 +390,3 @@ root: null, | ||
function instance($$self, $$props, $$invalidate) { | ||
const id = nanoid(); | ||
const id = nanoid.nanoid(); | ||
let isInView; | ||
@@ -432,3 +421,3 @@ let { value } = $$props; | ||
if (isInView) { | ||
if (counterResult[id] <= max) { | ||
if (counterResult[id] < max) { | ||
$$invalidate(1, counterResult[id] += step, counterResult); | ||
@@ -435,0 +424,0 @@ } else { |
{ | ||
"name": "svelte-countup", | ||
"componentname": "CountUp", | ||
"version": "0.2.6", | ||
"version": "0.2.7", | ||
"main": "lib/index.js", | ||
@@ -28,2 +28,2 @@ "module": "lib/index.mjs", | ||
} | ||
} | ||
} |
@@ -34,3 +34,3 @@ # Svelte CountUp | ||
## Porps | ||
## Props | ||
@@ -37,0 +37,0 @@ All props (with default values): |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
34161
903