ut2 1.10.1 → 1.11.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.
package/README.md CHANGED
@@ -116,6 +116,7 @@ const debounced = debounce(() => {
116
116
  - [isEqual](https://caijf.github.io/ut2/module-Language.html#.isEqual) - 深比较。
117
117
  - [isError](https://caijf.github.io/ut2/module-Language.html#.isError) - `Error` 对象。
118
118
  - [isFinite](https://caijf.github.io/ut2/module-Language.html#.isFinite) - 有限数字。
119
+ - [isFile](https://caijf.github.io/ut2/module-Language.html#.isFile) - `File` 对象。
119
120
  - [isFunction](https://caijf.github.io/ut2/module-Language.html#.isFunction) - `Function` 对象。
120
121
  - [isInteger](https://caijf.github.io/ut2/module-Language.html#.isInteger) - 整数。
121
122
  - [isLength](https://caijf.github.io/ut2/module-Language.html#.isLength) - 有效的类数组长度。
package/dist/ut2.js CHANGED
@@ -49,6 +49,7 @@
49
49
  var functionTags = ['Function', 'AsyncFunction', 'GeneratorFunction', 'Proxy'].map(function (item) { return '[object ' + item + ']'; });
50
50
  var weakSetTag = '[object WeakSet]';
51
51
  var blobTag = '[object Blob]';
52
+ var fileTag = '[object File]';
52
53
  var domExceptionTag = '[object DOMException]';
53
54
  var objectTag = '[object Object]';
54
55
  var dataViewTag = '[object DataView]';
@@ -208,9 +209,10 @@
208
209
  });
209
210
  }
210
211
 
211
- function move(arr, from, to) {
212
- arr.splice(to, 0, arr.splice(from, 1)[0]);
213
- return arr;
212
+ function move(array, from, to) {
213
+ var copyArray = array.slice();
214
+ copyArray.splice(to, 0, copyArray.splice(from, 1)[0]);
215
+ return copyArray;
214
216
  }
215
217
 
216
218
  function isFunction(value) {
@@ -605,7 +607,7 @@
605
607
  return value == null || value !== value ? defaultValue : value;
606
608
  };
607
609
 
608
- var VERSION = "1.10.1";
610
+ var VERSION = "1.11.1";
609
611
  var isBrowser = typeof window !== stringUndefined && isObjectLike(window) && typeof document !== stringUndefined && isObjectLike(document) && window.document === document;
610
612
  var supportedArgumentsType = getTag((function () { return arguments; })()) === argumentsTag;
611
613
  var FUNC_ERROR_TEXT = 'Expected a function';
@@ -1155,6 +1157,14 @@
1155
1157
  return tag === errorTag || tag === domExceptionTag;
1156
1158
  }
1157
1159
 
1160
+ var fileExisted = typeof File !== stringUndefined;
1161
+ function isFile(value) {
1162
+ if (fileExisted && value instanceof File) {
1163
+ return true;
1164
+ }
1165
+ return getTag(value) === fileTag;
1166
+ }
1167
+
1158
1168
  var freeGlobalThis = globalThisExisted && globalThis.Object === Object && globalThis;
1159
1169
  var freeGlobal = globalExisted && global.Object === Object && global;
1160
1170
  var freeSelf = selfExisted && self.Object === Object && self;
@@ -1829,6 +1839,7 @@
1829
1839
  exports.isEmpty = isEmpty;
1830
1840
  exports.isEqual = isEqual;
1831
1841
  exports.isError = isError;
1842
+ exports.isFile = isFile;
1832
1843
  exports.isFinite = isFinite;
1833
1844
  exports.isFunction = isFunction;
1834
1845
  exports.isInteger = isInteger;