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 +1 -0
- package/dist/ut2.js +15 -4
- package/dist/ut2.js.map +1 -1
- package/dist/ut2.min.js +1 -1
- package/dist/ut2.min.js.map +1 -1
- package/es/index.js +1 -0
- package/es/internals/helpers.js +1 -1
- package/es/internals/native.js +2 -1
- package/es/isFile.js +12 -0
- package/es/move.js +4 -3
- package/lib/index.js +2 -0
- package/lib/internals/helpers.js +1 -1
- package/lib/internals/native.js +2 -0
- package/lib/isFile.js +14 -0
- package/lib/move.js +4 -3
- package/package.json +1 -1
- package/types/index.d.ts +1 -0
- package/types/internals/native.d.ts +1 -0
- package/types/isBlob.d.ts +2 -0
- package/types/isFile.d.ts +24 -0
- package/types/isPromiseLike.d.ts +1 -6
- package/types/merge.d.ts +3 -1
- package/types/move.d.ts +4 -5
- package/types/nth.d.ts +6 -4
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(
|
|
212
|
-
|
|
213
|
-
|
|
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.
|
|
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;
|