1 | "use strict";
|
2 | var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
3 | if (kind === "m") throw new TypeError("Private method is not writable");
|
4 | if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
5 | if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
6 | return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
7 | };
|
8 | var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
9 | if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
10 | if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
11 | return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
12 | };
|
13 | var __importDefault = (this && this.__importDefault) || function (mod) {
|
14 | return (mod && mod.__esModule) ? mod : { "default": mod };
|
15 | };
|
16 | var _FileList_files, _FileList_length, _a;
|
17 | Object.defineProperty(exports, "__esModule", { value: true });
|
18 | exports.FileList = void 0;
|
19 | const typeson_js_1 = __importDefault(require("./typeson.js"));
|
20 | const { toStringTag } = typeson_js_1.default;
|
21 | const file_js_1 = __importDefault(require("./file.js"));
|
22 | const filelist = {
|
23 | file: file_js_1.default.file,
|
24 | filelist: {
|
25 | test(x) { return toStringTag(x) === 'FileList'; },
|
26 | replace(fl) {
|
27 | const arr = [];
|
28 | for (let i = 0; i < fl.length; i++) {
|
29 | arr[i] = fl.item(i);
|
30 | }
|
31 | return arr;
|
32 | },
|
33 | revive(o) {
|
34 | return new FileList(o);
|
35 | }
|
36 | }
|
37 | };
|
38 |
|
39 |
|
40 | class FileList {
|
41 |
|
42 | constructor() {
|
43 | _FileList_files.set(this, void 0);
|
44 | _FileList_length.set(this, void 0);
|
45 |
|
46 | Object.defineProperty(this, _a, {
|
47 | enumerable: true,
|
48 | configurable: true,
|
49 | writable: true,
|
50 | value: 'FileList'
|
51 | });
|
52 | __classPrivateFieldSet(this, _FileList_files, arguments[0], "f");
|
53 | __classPrivateFieldSet(this, _FileList_length, __classPrivateFieldGet(this, _FileList_files, "f").length, "f");
|
54 | }
|
55 | |
56 |
|
57 |
|
58 |
|
59 | item(index) { return __classPrivateFieldGet(this, _FileList_files, "f")[index]; }
|
60 |
|
61 | get length() { return __classPrivateFieldGet(this, _FileList_length, "f"); }
|
62 | }
|
63 | exports.FileList = FileList;
|
64 | _FileList_files = new WeakMap(), _FileList_length = new WeakMap(), _a = Symbol.toStringTag;
|
65 | exports.default = filelist;
|
66 |
|
\ | No newline at end of file |