ut2 1.18.1 → 1.19.1

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.
@@ -2,7 +2,7 @@ import isObjectLike from '../isObjectLike.js';
2
2
  import getTag from './getTag.js';
3
3
  import { argumentsTag, functionProtoToString, stringUndefined } from './native.js';
4
4
 
5
- var VERSION = "1.18.1";
5
+ var VERSION = "1.19.1";
6
6
  var isBrowser = typeof window !== stringUndefined && isObjectLike(window) && typeof document !== stringUndefined && isObjectLike(document) && window.document === document;
7
7
  var supportedArgumentsType = getTag((function () { return arguments; })()) === argumentsTag;
8
8
  var FUNC_ERROR_TEXT = 'Expected a function';
@@ -2,7 +2,7 @@ import getTag from './internals/getTag.js';
2
2
  import { nodeIsTypedArray } from './internals/nodeUtil.js';
3
3
  import isArrayLikeObject from './isArrayLikeObject.js';
4
4
 
5
- var typedArrayPattern = /\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;
5
+ var typedArrayPattern = /\[object ((I|Ui)nt(8|16|32)|Float(16|32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;
6
6
  function isTypedArray(value) {
7
7
  if (nodeIsTypedArray) {
8
8
  return nodeIsTypedArray(value);
@@ -4,7 +4,7 @@ var isObjectLike = require('../isObjectLike.js');
4
4
  var getTag = require('./getTag.js');
5
5
  var native = require('./native.js');
6
6
 
7
- var VERSION = "1.18.1";
7
+ var VERSION = "1.19.1";
8
8
  var isBrowser = typeof window !== native.stringUndefined && isObjectLike(window) && typeof document !== native.stringUndefined && isObjectLike(document) && window.document === document;
9
9
  var supportedArgumentsType = getTag((function () { return arguments; })()) === native.argumentsTag;
10
10
  var FUNC_ERROR_TEXT = 'Expected a function';
@@ -4,7 +4,7 @@ var getTag = require('./internals/getTag.js');
4
4
  var nodeUtil = require('./internals/nodeUtil.js');
5
5
  var isArrayLikeObject = require('./isArrayLikeObject.js');
6
6
 
7
- var typedArrayPattern = /\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;
7
+ var typedArrayPattern = /\[object ((I|Ui)nt(8|16|32)|Float(16|32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;
8
8
  function isTypedArray(value) {
9
9
  if (nodeUtil.nodeIsTypedArray) {
10
10
  return nodeUtil.nodeIsTypedArray(value);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ut2",
3
- "version": "1.18.1",
3
+ "version": "1.19.1",
4
4
  "author": "caijf",
5
5
  "license": "MIT",
6
6
  "main": "lib/index.js",
@@ -9,5 +9,5 @@
9
9
  * @since 1.10.0
10
10
  * @see {@link https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/globalThis globalThis}
11
11
  */
12
- declare const root: typeof globalThis;
12
+ declare const root: Window & typeof globalThis;
13
13
  export default root;
package/types/limit.d.ts CHANGED
@@ -4,7 +4,10 @@ import { FunctionAny } from './internals/types';
4
4
  *
5
5
  * 与 `throttle` 的区别:
6
6
  * 1. 在时间间隔内再次调用,`limit`不会执行,而`throttle` 会执行;
7
- * 2. `limit` 没有取消和立即执行的方法,逻辑更简洁。
7
+ * 2. `limit` 没有取消和立即执行的方法,逻辑简洁。
8
+ *
9
+ * 与 `throttle(fn, wait, false)` 第三个参数为`false`的区别:
10
+ * 1. 两者都是在间隔时间内只执行一次,但 `limit` 调用后立即执行,`throttle(fn, wait, false)` 调用后等待 wait 毫秒后执行。
8
11
  *
9
12
  * @alias module:Function.limit
10
13
  * @since 1.19.0