@varlet/shared 3.2.10 → 3.2.11-alpha.1716133168406

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/lib/index.cjs CHANGED
@@ -224,9 +224,9 @@ var debounce = (fn, delay = 0) => {
224
224
  let timer;
225
225
  return function(...args) {
226
226
  if (timer) {
227
- window.clearTimeout(timer);
227
+ clearTimeout(timer);
228
228
  }
229
- timer = window.setTimeout(() => {
229
+ timer = setTimeout(() => {
230
230
  fn.apply(this, args);
231
231
  }, delay);
232
232
  };
@@ -241,13 +241,13 @@ var throttle = (fn, delay = 200) => {
241
241
  start = now;
242
242
  }
243
243
  if (timer) {
244
- window.clearTimeout(timer);
244
+ clearTimeout(timer);
245
245
  }
246
246
  if (elapsed >= delay) {
247
247
  fn.apply(this, args);
248
248
  start = now;
249
249
  } else {
250
- timer = window.setTimeout(() => {
250
+ timer = setTimeout(() => {
251
251
  loop.apply(this, args);
252
252
  }, delay - elapsed);
253
253
  }
package/lib/index.js CHANGED
@@ -157,9 +157,9 @@ var debounce = (fn, delay = 0) => {
157
157
  let timer;
158
158
  return function(...args) {
159
159
  if (timer) {
160
- window.clearTimeout(timer);
160
+ clearTimeout(timer);
161
161
  }
162
- timer = window.setTimeout(() => {
162
+ timer = setTimeout(() => {
163
163
  fn.apply(this, args);
164
164
  }, delay);
165
165
  };
@@ -174,13 +174,13 @@ var throttle = (fn, delay = 200) => {
174
174
  start = now;
175
175
  }
176
176
  if (timer) {
177
- window.clearTimeout(timer);
177
+ clearTimeout(timer);
178
178
  }
179
179
  if (elapsed >= delay) {
180
180
  fn.apply(this, args);
181
181
  start = now;
182
182
  } else {
183
- timer = window.setTimeout(() => {
183
+ timer = setTimeout(() => {
184
184
  loop.apply(this, args);
185
185
  }, delay - elapsed);
186
186
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@varlet/shared",
3
- "version": "3.2.10",
3
+ "version": "3.2.11-alpha.1716133168406",
4
4
  "type": "module",
5
5
  "main": "lib/index.cjs",
6
6
  "module": "lib/index.js",