Upload original JAVA语言程序设计 course files (part 19)
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/iconv-lite/LICENSE +21 -3
- Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/iconv-lite/README.md +130 -3
- Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/iconv-lite/encodings/utf16.js +197 -3
- Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/iconv-lite/encodings/utf32.js +319 -3
- Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/iconv-lite/encodings/utf7.js +290 -3
- Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/iconv-lite/lib/bom-handling.js +52 -3
- Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/iconv-lite/lib/index.d.ts +41 -3
- Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/iconv-lite/lib/index.js +180 -3
- Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/iconv-lite/lib/streams.js +109 -3
- Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/iconv-lite/package.json +44 -3
- Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/icss-utils/CHANGELOG.md +30 -3
- Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/icss-utils/LICENSE.md +6 -3
- Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/icss-utils/README.md +94 -3
- Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/icss-utils/package.json +52 -3
- Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/icss-utils/src/createICSSRules.js +67 -3
- Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/icss-utils/src/extractICSS.js +76 -3
- Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/icss-utils/src/index.js +11 -3
- Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/icss-utils/src/replaceSymbols.js +18 -3
- Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/icss-utils/src/replaceValueSymbols.js +22 -3
- Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/image-size/LICENSE +9 -3
- Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/image-size/Readme.md +88 -3
- Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/image-size/bin/image-size.js +36 -3
- Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/image-size/lib/detector.js +19 -3
- Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/image-size/lib/index.js +105 -3
- Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/image-size/lib/readUInt.js +11 -3
- Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/image-size/lib/types.js +13 -3
- Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/image-size/lib/types/bmp.js +17 -3
- Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/image-size/lib/types/dds.js +18 -3
- Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/image-size/lib/types/gif.js +19 -3
- Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/image-size/lib/types/jpg.js +62 -3
- Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/image-size/lib/types/png.js +36 -3
- Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/image-size/lib/types/psd.js +17 -3
- Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/image-size/lib/types/svg.js +78 -3
- Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/image-size/lib/types/tiff.js +118 -3
- Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/image-size/lib/types/webp.js +69 -3
- Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/image-size/package.json +49 -3
- Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/immutable/LICENSE +21 -3
- Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/immutable/README.md +761 -3
- Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/immutable/dist/immutable.d.ts +0 -0
- Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/immutable/dist/immutable.es.js +0 -0
- Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/immutable/dist/immutable.js +0 -0
- Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/immutable/dist/immutable.js.flow +2412 -3
- Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/immutable/dist/immutable.min.js +55 -3
- Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/immutable/package.json +39 -3
- Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/inflight/LICENSE +15 -3
- Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/inflight/README.md +37 -3
- Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/inflight/inflight.js +54 -3
- Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/inflight/package.json +29 -3
- Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/inherits/LICENSE +16 -3
- Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/inherits/README.md +42 -3
Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/iconv-lite/LICENSE
CHANGED
|
@@ -1,3 +1,21 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Copyright (c) 2011 Alexander Shtuchkin
|
| 2 |
+
|
| 3 |
+
Permission is hereby granted, free of charge, to any person obtaining
|
| 4 |
+
a copy of this software and associated documentation files (the
|
| 5 |
+
"Software"), to deal in the Software without restriction, including
|
| 6 |
+
without limitation the rights to use, copy, modify, merge, publish,
|
| 7 |
+
distribute, sublicense, and/or sell copies of the Software, and to
|
| 8 |
+
permit persons to whom the Software is furnished to do so, subject to
|
| 9 |
+
the following conditions:
|
| 10 |
+
|
| 11 |
+
The above copyright notice and this permission notice shall be
|
| 12 |
+
included in all copies or substantial portions of the Software.
|
| 13 |
+
|
| 14 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
| 15 |
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
| 16 |
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
| 17 |
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
| 18 |
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
| 19 |
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
| 20 |
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
| 21 |
+
|
Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/iconv-lite/README.md
CHANGED
|
@@ -1,3 +1,130 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
## iconv-lite: Pure JS character encoding conversion
|
| 2 |
+
|
| 3 |
+
* No need for native code compilation. Quick to install, works on Windows and in sandboxed environments like [Cloud9](http://c9.io).
|
| 4 |
+
* Used in popular projects like [Express.js (body_parser)](https://github.com/expressjs/body-parser),
|
| 5 |
+
[Grunt](http://gruntjs.com/), [Nodemailer](http://www.nodemailer.com/), [Yeoman](http://yeoman.io/) and others.
|
| 6 |
+
* Faster than [node-iconv](https://github.com/bnoordhuis/node-iconv) (see below for performance comparison).
|
| 7 |
+
* Intuitive encode/decode API, including Streaming support.
|
| 8 |
+
* In-browser usage via [browserify](https://github.com/substack/node-browserify) or [webpack](https://webpack.js.org/) (~180kb gzip compressed with Buffer shim included).
|
| 9 |
+
* Typescript [type definition file](https://github.com/ashtuchkin/iconv-lite/blob/master/lib/index.d.ts) included.
|
| 10 |
+
* React Native is supported (need to install `stream` module to enable Streaming API).
|
| 11 |
+
* License: MIT.
|
| 12 |
+
|
| 13 |
+
[](https://npmjs.org/package/iconv-lite/)
|
| 14 |
+
[](https://travis-ci.org/ashtuchkin/iconv-lite)
|
| 15 |
+
[](https://npmjs.org/package/iconv-lite/)
|
| 16 |
+
[](https://npmjs.org/package/iconv-lite/)
|
| 17 |
+
[](https://npmjs.org/package/iconv-lite/)
|
| 18 |
+
|
| 19 |
+
## Usage
|
| 20 |
+
### Basic API
|
| 21 |
+
```javascript
|
| 22 |
+
var iconv = require('iconv-lite');
|
| 23 |
+
|
| 24 |
+
// Convert from an encoded buffer to a js string.
|
| 25 |
+
str = iconv.decode(Buffer.from([0x68, 0x65, 0x6c, 0x6c, 0x6f]), 'win1251');
|
| 26 |
+
|
| 27 |
+
// Convert from a js string to an encoded buffer.
|
| 28 |
+
buf = iconv.encode("Sample input string", 'win1251');
|
| 29 |
+
|
| 30 |
+
// Check if encoding is supported
|
| 31 |
+
iconv.encodingExists("us-ascii")
|
| 32 |
+
```
|
| 33 |
+
|
| 34 |
+
### Streaming API
|
| 35 |
+
```javascript
|
| 36 |
+
|
| 37 |
+
// Decode stream (from binary data stream to js strings)
|
| 38 |
+
http.createServer(function(req, res) {
|
| 39 |
+
var converterStream = iconv.decodeStream('win1251');
|
| 40 |
+
req.pipe(converterStream);
|
| 41 |
+
|
| 42 |
+
converterStream.on('data', function(str) {
|
| 43 |
+
console.log(str); // Do something with decoded strings, chunk-by-chunk.
|
| 44 |
+
});
|
| 45 |
+
});
|
| 46 |
+
|
| 47 |
+
// Convert encoding streaming example
|
| 48 |
+
fs.createReadStream('file-in-win1251.txt')
|
| 49 |
+
.pipe(iconv.decodeStream('win1251'))
|
| 50 |
+
.pipe(iconv.encodeStream('ucs2'))
|
| 51 |
+
.pipe(fs.createWriteStream('file-in-ucs2.txt'));
|
| 52 |
+
|
| 53 |
+
// Sugar: all encode/decode streams have .collect(cb) method to accumulate data.
|
| 54 |
+
http.createServer(function(req, res) {
|
| 55 |
+
req.pipe(iconv.decodeStream('win1251')).collect(function(err, body) {
|
| 56 |
+
assert(typeof body == 'string');
|
| 57 |
+
console.log(body); // full request body string
|
| 58 |
+
});
|
| 59 |
+
});
|
| 60 |
+
```
|
| 61 |
+
|
| 62 |
+
## Supported encodings
|
| 63 |
+
|
| 64 |
+
* All node.js native encodings: utf8, ucs2 / utf16-le, ascii, binary, base64, hex.
|
| 65 |
+
* Additional unicode encodings: utf16, utf16-be, utf-7, utf-7-imap, utf32, utf32-le, and utf32-be.
|
| 66 |
+
* All widespread singlebyte encodings: Windows 125x family, ISO-8859 family,
|
| 67 |
+
IBM/DOS codepages, Macintosh family, KOI8 family, all others supported by iconv library.
|
| 68 |
+
Aliases like 'latin1', 'us-ascii' also supported.
|
| 69 |
+
* All widespread multibyte encodings: CP932, CP936, CP949, CP950, GB2312, GBK, GB18030, Big5, Shift_JIS, EUC-JP.
|
| 70 |
+
|
| 71 |
+
See [all supported encodings on wiki](https://github.com/ashtuchkin/iconv-lite/wiki/Supported-Encodings).
|
| 72 |
+
|
| 73 |
+
Most singlebyte encodings are generated automatically from [node-iconv](https://github.com/bnoordhuis/node-iconv). Thank you Ben Noordhuis and libiconv authors!
|
| 74 |
+
|
| 75 |
+
Multibyte encodings are generated from [Unicode.org mappings](http://www.unicode.org/Public/MAPPINGS/) and [WHATWG Encoding Standard mappings](http://encoding.spec.whatwg.org/). Thank you, respective authors!
|
| 76 |
+
|
| 77 |
+
|
| 78 |
+
## Encoding/decoding speed
|
| 79 |
+
|
| 80 |
+
Comparison with node-iconv module (1000x256kb, on MacBook Pro, Core i5/2.6 GHz, Node v0.12.0).
|
| 81 |
+
Note: your results may vary, so please always check on your hardware.
|
| 82 |
+
|
| 83 |
+
operation iconv@2.1.4 iconv-lite@0.4.7
|
| 84 |
+
----------------------------------------------------------
|
| 85 |
+
encode('win1251') ~96 Mb/s ~320 Mb/s
|
| 86 |
+
decode('win1251') ~95 Mb/s ~246 Mb/s
|
| 87 |
+
|
| 88 |
+
## BOM handling
|
| 89 |
+
|
| 90 |
+
* Decoding: BOM is stripped by default, unless overridden by passing `stripBOM: false` in options
|
| 91 |
+
(f.ex. `iconv.decode(buf, enc, {stripBOM: false})`).
|
| 92 |
+
A callback might also be given as a `stripBOM` parameter - it'll be called if BOM character was actually found.
|
| 93 |
+
* If you want to detect UTF-8 BOM when decoding other encodings, use [node-autodetect-decoder-stream](https://github.com/danielgindi/node-autodetect-decoder-stream) module.
|
| 94 |
+
* Encoding: No BOM added, unless overridden by `addBOM: true` option.
|
| 95 |
+
|
| 96 |
+
## UTF-16 Encodings
|
| 97 |
+
|
| 98 |
+
This library supports UTF-16LE, UTF-16BE and UTF-16 encodings. First two are straightforward, but UTF-16 is trying to be
|
| 99 |
+
smart about endianness in the following ways:
|
| 100 |
+
* Decoding: uses BOM and 'spaces heuristic' to determine input endianness. Default is UTF-16LE, but can be
|
| 101 |
+
overridden with `defaultEncoding: 'utf-16be'` option. Strips BOM unless `stripBOM: false`.
|
| 102 |
+
* Encoding: uses UTF-16LE and writes BOM by default. Use `addBOM: false` to override.
|
| 103 |
+
|
| 104 |
+
## UTF-32 Encodings
|
| 105 |
+
|
| 106 |
+
This library supports UTF-32LE, UTF-32BE and UTF-32 encodings. Like the UTF-16 encoding above, UTF-32 defaults to UTF-32LE, but uses BOM and 'spaces heuristics' to determine input endianness.
|
| 107 |
+
* The default of UTF-32LE can be overridden with the `defaultEncoding: 'utf-32be'` option. Strips BOM unless `stripBOM: false`.
|
| 108 |
+
* Encoding: uses UTF-32LE and writes BOM by default. Use `addBOM: false` to override. (`defaultEncoding: 'utf-32be'` can also be used here to change encoding.)
|
| 109 |
+
|
| 110 |
+
## Other notes
|
| 111 |
+
|
| 112 |
+
When decoding, be sure to supply a Buffer to decode() method, otherwise [bad things usually happen](https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding).
|
| 113 |
+
Untranslatable characters are set to � or ?. No transliteration is currently supported.
|
| 114 |
+
Node versions 0.10.31 and 0.11.13 are buggy, don't use them (see #65, #77).
|
| 115 |
+
|
| 116 |
+
## Testing
|
| 117 |
+
|
| 118 |
+
```bash
|
| 119 |
+
$ git clone git@github.com:ashtuchkin/iconv-lite.git
|
| 120 |
+
$ cd iconv-lite
|
| 121 |
+
$ npm install
|
| 122 |
+
$ npm test
|
| 123 |
+
|
| 124 |
+
$ # To view performance:
|
| 125 |
+
$ node test/performance.js
|
| 126 |
+
|
| 127 |
+
$ # To view test coverage:
|
| 128 |
+
$ npm run coverage
|
| 129 |
+
$ open coverage/lcov-report/index.html
|
| 130 |
+
```
|
Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/iconv-lite/encodings/utf16.js
CHANGED
|
@@ -1,3 +1,197 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
var Buffer = require("safer-buffer").Buffer;
|
| 3 |
+
|
| 4 |
+
// Note: UTF16-LE (or UCS2) codec is Node.js native. See encodings/internal.js
|
| 5 |
+
|
| 6 |
+
// == UTF16-BE codec. ==========================================================
|
| 7 |
+
|
| 8 |
+
exports.utf16be = Utf16BECodec;
|
| 9 |
+
function Utf16BECodec() {
|
| 10 |
+
}
|
| 11 |
+
|
| 12 |
+
Utf16BECodec.prototype.encoder = Utf16BEEncoder;
|
| 13 |
+
Utf16BECodec.prototype.decoder = Utf16BEDecoder;
|
| 14 |
+
Utf16BECodec.prototype.bomAware = true;
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
// -- Encoding
|
| 18 |
+
|
| 19 |
+
function Utf16BEEncoder() {
|
| 20 |
+
}
|
| 21 |
+
|
| 22 |
+
Utf16BEEncoder.prototype.write = function(str) {
|
| 23 |
+
var buf = Buffer.from(str, 'ucs2');
|
| 24 |
+
for (var i = 0; i < buf.length; i += 2) {
|
| 25 |
+
var tmp = buf[i]; buf[i] = buf[i+1]; buf[i+1] = tmp;
|
| 26 |
+
}
|
| 27 |
+
return buf;
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
Utf16BEEncoder.prototype.end = function() {
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
// -- Decoding
|
| 35 |
+
|
| 36 |
+
function Utf16BEDecoder() {
|
| 37 |
+
this.overflowByte = -1;
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
Utf16BEDecoder.prototype.write = function(buf) {
|
| 41 |
+
if (buf.length == 0)
|
| 42 |
+
return '';
|
| 43 |
+
|
| 44 |
+
var buf2 = Buffer.alloc(buf.length + 1),
|
| 45 |
+
i = 0, j = 0;
|
| 46 |
+
|
| 47 |
+
if (this.overflowByte !== -1) {
|
| 48 |
+
buf2[0] = buf[0];
|
| 49 |
+
buf2[1] = this.overflowByte;
|
| 50 |
+
i = 1; j = 2;
|
| 51 |
+
}
|
| 52 |
+
|
| 53 |
+
for (; i < buf.length-1; i += 2, j+= 2) {
|
| 54 |
+
buf2[j] = buf[i+1];
|
| 55 |
+
buf2[j+1] = buf[i];
|
| 56 |
+
}
|
| 57 |
+
|
| 58 |
+
this.overflowByte = (i == buf.length-1) ? buf[buf.length-1] : -1;
|
| 59 |
+
|
| 60 |
+
return buf2.slice(0, j).toString('ucs2');
|
| 61 |
+
}
|
| 62 |
+
|
| 63 |
+
Utf16BEDecoder.prototype.end = function() {
|
| 64 |
+
this.overflowByte = -1;
|
| 65 |
+
}
|
| 66 |
+
|
| 67 |
+
|
| 68 |
+
// == UTF-16 codec =============================================================
|
| 69 |
+
// Decoder chooses automatically from UTF-16LE and UTF-16BE using BOM and space-based heuristic.
|
| 70 |
+
// Defaults to UTF-16LE, as it's prevalent and default in Node.
|
| 71 |
+
// http://en.wikipedia.org/wiki/UTF-16 and http://encoding.spec.whatwg.org/#utf-16le
|
| 72 |
+
// Decoder default can be changed: iconv.decode(buf, 'utf16', {defaultEncoding: 'utf-16be'});
|
| 73 |
+
|
| 74 |
+
// Encoder uses UTF-16LE and prepends BOM (which can be overridden with addBOM: false).
|
| 75 |
+
|
| 76 |
+
exports.utf16 = Utf16Codec;
|
| 77 |
+
function Utf16Codec(codecOptions, iconv) {
|
| 78 |
+
this.iconv = iconv;
|
| 79 |
+
}
|
| 80 |
+
|
| 81 |
+
Utf16Codec.prototype.encoder = Utf16Encoder;
|
| 82 |
+
Utf16Codec.prototype.decoder = Utf16Decoder;
|
| 83 |
+
|
| 84 |
+
|
| 85 |
+
// -- Encoding (pass-through)
|
| 86 |
+
|
| 87 |
+
function Utf16Encoder(options, codec) {
|
| 88 |
+
options = options || {};
|
| 89 |
+
if (options.addBOM === undefined)
|
| 90 |
+
options.addBOM = true;
|
| 91 |
+
this.encoder = codec.iconv.getEncoder('utf-16le', options);
|
| 92 |
+
}
|
| 93 |
+
|
| 94 |
+
Utf16Encoder.prototype.write = function(str) {
|
| 95 |
+
return this.encoder.write(str);
|
| 96 |
+
}
|
| 97 |
+
|
| 98 |
+
Utf16Encoder.prototype.end = function() {
|
| 99 |
+
return this.encoder.end();
|
| 100 |
+
}
|
| 101 |
+
|
| 102 |
+
|
| 103 |
+
// -- Decoding
|
| 104 |
+
|
| 105 |
+
function Utf16Decoder(options, codec) {
|
| 106 |
+
this.decoder = null;
|
| 107 |
+
this.initialBufs = [];
|
| 108 |
+
this.initialBufsLen = 0;
|
| 109 |
+
|
| 110 |
+
this.options = options || {};
|
| 111 |
+
this.iconv = codec.iconv;
|
| 112 |
+
}
|
| 113 |
+
|
| 114 |
+
Utf16Decoder.prototype.write = function(buf) {
|
| 115 |
+
if (!this.decoder) {
|
| 116 |
+
// Codec is not chosen yet. Accumulate initial bytes.
|
| 117 |
+
this.initialBufs.push(buf);
|
| 118 |
+
this.initialBufsLen += buf.length;
|
| 119 |
+
|
| 120 |
+
if (this.initialBufsLen < 16) // We need more bytes to use space heuristic (see below)
|
| 121 |
+
return '';
|
| 122 |
+
|
| 123 |
+
// We have enough bytes -> detect endianness.
|
| 124 |
+
var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding);
|
| 125 |
+
this.decoder = this.iconv.getDecoder(encoding, this.options);
|
| 126 |
+
|
| 127 |
+
var resStr = '';
|
| 128 |
+
for (var i = 0; i < this.initialBufs.length; i++)
|
| 129 |
+
resStr += this.decoder.write(this.initialBufs[i]);
|
| 130 |
+
|
| 131 |
+
this.initialBufs.length = this.initialBufsLen = 0;
|
| 132 |
+
return resStr;
|
| 133 |
+
}
|
| 134 |
+
|
| 135 |
+
return this.decoder.write(buf);
|
| 136 |
+
}
|
| 137 |
+
|
| 138 |
+
Utf16Decoder.prototype.end = function() {
|
| 139 |
+
if (!this.decoder) {
|
| 140 |
+
var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding);
|
| 141 |
+
this.decoder = this.iconv.getDecoder(encoding, this.options);
|
| 142 |
+
|
| 143 |
+
var resStr = '';
|
| 144 |
+
for (var i = 0; i < this.initialBufs.length; i++)
|
| 145 |
+
resStr += this.decoder.write(this.initialBufs[i]);
|
| 146 |
+
|
| 147 |
+
var trail = this.decoder.end();
|
| 148 |
+
if (trail)
|
| 149 |
+
resStr += trail;
|
| 150 |
+
|
| 151 |
+
this.initialBufs.length = this.initialBufsLen = 0;
|
| 152 |
+
return resStr;
|
| 153 |
+
}
|
| 154 |
+
return this.decoder.end();
|
| 155 |
+
}
|
| 156 |
+
|
| 157 |
+
function detectEncoding(bufs, defaultEncoding) {
|
| 158 |
+
var b = [];
|
| 159 |
+
var charsProcessed = 0;
|
| 160 |
+
var asciiCharsLE = 0, asciiCharsBE = 0; // Number of ASCII chars when decoded as LE or BE.
|
| 161 |
+
|
| 162 |
+
outer_loop:
|
| 163 |
+
for (var i = 0; i < bufs.length; i++) {
|
| 164 |
+
var buf = bufs[i];
|
| 165 |
+
for (var j = 0; j < buf.length; j++) {
|
| 166 |
+
b.push(buf[j]);
|
| 167 |
+
if (b.length === 2) {
|
| 168 |
+
if (charsProcessed === 0) {
|
| 169 |
+
// Check BOM first.
|
| 170 |
+
if (b[0] === 0xFF && b[1] === 0xFE) return 'utf-16le';
|
| 171 |
+
if (b[0] === 0xFE && b[1] === 0xFF) return 'utf-16be';
|
| 172 |
+
}
|
| 173 |
+
|
| 174 |
+
if (b[0] === 0 && b[1] !== 0) asciiCharsBE++;
|
| 175 |
+
if (b[0] !== 0 && b[1] === 0) asciiCharsLE++;
|
| 176 |
+
|
| 177 |
+
b.length = 0;
|
| 178 |
+
charsProcessed++;
|
| 179 |
+
|
| 180 |
+
if (charsProcessed >= 100) {
|
| 181 |
+
break outer_loop;
|
| 182 |
+
}
|
| 183 |
+
}
|
| 184 |
+
}
|
| 185 |
+
}
|
| 186 |
+
|
| 187 |
+
// Make decisions.
|
| 188 |
+
// Most of the time, the content has ASCII chars (U+00**), but the opposite (U+**00) is uncommon.
|
| 189 |
+
// So, we count ASCII as if it was LE or BE, and decide from that.
|
| 190 |
+
if (asciiCharsBE > asciiCharsLE) return 'utf-16be';
|
| 191 |
+
if (asciiCharsBE < asciiCharsLE) return 'utf-16le';
|
| 192 |
+
|
| 193 |
+
// Couldn't decide (likely all zeros or not enough data).
|
| 194 |
+
return defaultEncoding || 'utf-16le';
|
| 195 |
+
}
|
| 196 |
+
|
| 197 |
+
|
Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/iconv-lite/encodings/utf32.js
CHANGED
|
@@ -1,3 +1,319 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var Buffer = require('safer-buffer').Buffer;
|
| 4 |
+
|
| 5 |
+
// == UTF32-LE/BE codec. ==========================================================
|
| 6 |
+
|
| 7 |
+
exports._utf32 = Utf32Codec;
|
| 8 |
+
|
| 9 |
+
function Utf32Codec(codecOptions, iconv) {
|
| 10 |
+
this.iconv = iconv;
|
| 11 |
+
this.bomAware = true;
|
| 12 |
+
this.isLE = codecOptions.isLE;
|
| 13 |
+
}
|
| 14 |
+
|
| 15 |
+
exports.utf32le = { type: '_utf32', isLE: true };
|
| 16 |
+
exports.utf32be = { type: '_utf32', isLE: false };
|
| 17 |
+
|
| 18 |
+
// Aliases
|
| 19 |
+
exports.ucs4le = 'utf32le';
|
| 20 |
+
exports.ucs4be = 'utf32be';
|
| 21 |
+
|
| 22 |
+
Utf32Codec.prototype.encoder = Utf32Encoder;
|
| 23 |
+
Utf32Codec.prototype.decoder = Utf32Decoder;
|
| 24 |
+
|
| 25 |
+
// -- Encoding
|
| 26 |
+
|
| 27 |
+
function Utf32Encoder(options, codec) {
|
| 28 |
+
this.isLE = codec.isLE;
|
| 29 |
+
this.highSurrogate = 0;
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
Utf32Encoder.prototype.write = function(str) {
|
| 33 |
+
var src = Buffer.from(str, 'ucs2');
|
| 34 |
+
var dst = Buffer.alloc(src.length * 2);
|
| 35 |
+
var write32 = this.isLE ? dst.writeUInt32LE : dst.writeUInt32BE;
|
| 36 |
+
var offset = 0;
|
| 37 |
+
|
| 38 |
+
for (var i = 0; i < src.length; i += 2) {
|
| 39 |
+
var code = src.readUInt16LE(i);
|
| 40 |
+
var isHighSurrogate = (0xD800 <= code && code < 0xDC00);
|
| 41 |
+
var isLowSurrogate = (0xDC00 <= code && code < 0xE000);
|
| 42 |
+
|
| 43 |
+
if (this.highSurrogate) {
|
| 44 |
+
if (isHighSurrogate || !isLowSurrogate) {
|
| 45 |
+
// There shouldn't be two high surrogates in a row, nor a high surrogate which isn't followed by a low
|
| 46 |
+
// surrogate. If this happens, keep the pending high surrogate as a stand-alone semi-invalid character
|
| 47 |
+
// (technically wrong, but expected by some applications, like Windows file names).
|
| 48 |
+
write32.call(dst, this.highSurrogate, offset);
|
| 49 |
+
offset += 4;
|
| 50 |
+
}
|
| 51 |
+
else {
|
| 52 |
+
// Create 32-bit value from high and low surrogates;
|
| 53 |
+
var codepoint = (((this.highSurrogate - 0xD800) << 10) | (code - 0xDC00)) + 0x10000;
|
| 54 |
+
|
| 55 |
+
write32.call(dst, codepoint, offset);
|
| 56 |
+
offset += 4;
|
| 57 |
+
this.highSurrogate = 0;
|
| 58 |
+
|
| 59 |
+
continue;
|
| 60 |
+
}
|
| 61 |
+
}
|
| 62 |
+
|
| 63 |
+
if (isHighSurrogate)
|
| 64 |
+
this.highSurrogate = code;
|
| 65 |
+
else {
|
| 66 |
+
// Even if the current character is a low surrogate, with no previous high surrogate, we'll
|
| 67 |
+
// encode it as a semi-invalid stand-alone character for the same reasons expressed above for
|
| 68 |
+
// unpaired high surrogates.
|
| 69 |
+
write32.call(dst, code, offset);
|
| 70 |
+
offset += 4;
|
| 71 |
+
this.highSurrogate = 0;
|
| 72 |
+
}
|
| 73 |
+
}
|
| 74 |
+
|
| 75 |
+
if (offset < dst.length)
|
| 76 |
+
dst = dst.slice(0, offset);
|
| 77 |
+
|
| 78 |
+
return dst;
|
| 79 |
+
};
|
| 80 |
+
|
| 81 |
+
Utf32Encoder.prototype.end = function() {
|
| 82 |
+
// Treat any leftover high surrogate as a semi-valid independent character.
|
| 83 |
+
if (!this.highSurrogate)
|
| 84 |
+
return;
|
| 85 |
+
|
| 86 |
+
var buf = Buffer.alloc(4);
|
| 87 |
+
|
| 88 |
+
if (this.isLE)
|
| 89 |
+
buf.writeUInt32LE(this.highSurrogate, 0);
|
| 90 |
+
else
|
| 91 |
+
buf.writeUInt32BE(this.highSurrogate, 0);
|
| 92 |
+
|
| 93 |
+
this.highSurrogate = 0;
|
| 94 |
+
|
| 95 |
+
return buf;
|
| 96 |
+
};
|
| 97 |
+
|
| 98 |
+
// -- Decoding
|
| 99 |
+
|
| 100 |
+
function Utf32Decoder(options, codec) {
|
| 101 |
+
this.isLE = codec.isLE;
|
| 102 |
+
this.badChar = codec.iconv.defaultCharUnicode.charCodeAt(0);
|
| 103 |
+
this.overflow = [];
|
| 104 |
+
}
|
| 105 |
+
|
| 106 |
+
Utf32Decoder.prototype.write = function(src) {
|
| 107 |
+
if (src.length === 0)
|
| 108 |
+
return '';
|
| 109 |
+
|
| 110 |
+
var i = 0;
|
| 111 |
+
var codepoint = 0;
|
| 112 |
+
var dst = Buffer.alloc(src.length + 4);
|
| 113 |
+
var offset = 0;
|
| 114 |
+
var isLE = this.isLE;
|
| 115 |
+
var overflow = this.overflow;
|
| 116 |
+
var badChar = this.badChar;
|
| 117 |
+
|
| 118 |
+
if (overflow.length > 0) {
|
| 119 |
+
for (; i < src.length && overflow.length < 4; i++)
|
| 120 |
+
overflow.push(src[i]);
|
| 121 |
+
|
| 122 |
+
if (overflow.length === 4) {
|
| 123 |
+
// NOTE: codepoint is a signed int32 and can be negative.
|
| 124 |
+
// NOTE: We copied this block from below to help V8 optimize it (it works with array, not buffer).
|
| 125 |
+
if (isLE) {
|
| 126 |
+
codepoint = overflow[i] | (overflow[i+1] << 8) | (overflow[i+2] << 16) | (overflow[i+3] << 24);
|
| 127 |
+
} else {
|
| 128 |
+
codepoint = overflow[i+3] | (overflow[i+2] << 8) | (overflow[i+1] << 16) | (overflow[i] << 24);
|
| 129 |
+
}
|
| 130 |
+
overflow.length = 0;
|
| 131 |
+
|
| 132 |
+
offset = _writeCodepoint(dst, offset, codepoint, badChar);
|
| 133 |
+
}
|
| 134 |
+
}
|
| 135 |
+
|
| 136 |
+
// Main loop. Should be as optimized as possible.
|
| 137 |
+
for (; i < src.length - 3; i += 4) {
|
| 138 |
+
// NOTE: codepoint is a signed int32 and can be negative.
|
| 139 |
+
if (isLE) {
|
| 140 |
+
codepoint = src[i] | (src[i+1] << 8) | (src[i+2] << 16) | (src[i+3] << 24);
|
| 141 |
+
} else {
|
| 142 |
+
codepoint = src[i+3] | (src[i+2] << 8) | (src[i+1] << 16) | (src[i] << 24);
|
| 143 |
+
}
|
| 144 |
+
offset = _writeCodepoint(dst, offset, codepoint, badChar);
|
| 145 |
+
}
|
| 146 |
+
|
| 147 |
+
// Keep overflowing bytes.
|
| 148 |
+
for (; i < src.length; i++) {
|
| 149 |
+
overflow.push(src[i]);
|
| 150 |
+
}
|
| 151 |
+
|
| 152 |
+
return dst.slice(0, offset).toString('ucs2');
|
| 153 |
+
};
|
| 154 |
+
|
| 155 |
+
function _writeCodepoint(dst, offset, codepoint, badChar) {
|
| 156 |
+
// NOTE: codepoint is signed int32 and can be negative. We keep it that way to help V8 with optimizations.
|
| 157 |
+
if (codepoint < 0 || codepoint > 0x10FFFF) {
|
| 158 |
+
// Not a valid Unicode codepoint
|
| 159 |
+
codepoint = badChar;
|
| 160 |
+
}
|
| 161 |
+
|
| 162 |
+
// Ephemeral Planes: Write high surrogate.
|
| 163 |
+
if (codepoint >= 0x10000) {
|
| 164 |
+
codepoint -= 0x10000;
|
| 165 |
+
|
| 166 |
+
var high = 0xD800 | (codepoint >> 10);
|
| 167 |
+
dst[offset++] = high & 0xff;
|
| 168 |
+
dst[offset++] = high >> 8;
|
| 169 |
+
|
| 170 |
+
// Low surrogate is written below.
|
| 171 |
+
var codepoint = 0xDC00 | (codepoint & 0x3FF);
|
| 172 |
+
}
|
| 173 |
+
|
| 174 |
+
// Write BMP char or low surrogate.
|
| 175 |
+
dst[offset++] = codepoint & 0xff;
|
| 176 |
+
dst[offset++] = codepoint >> 8;
|
| 177 |
+
|
| 178 |
+
return offset;
|
| 179 |
+
};
|
| 180 |
+
|
| 181 |
+
Utf32Decoder.prototype.end = function() {
|
| 182 |
+
this.overflow.length = 0;
|
| 183 |
+
};
|
| 184 |
+
|
| 185 |
+
// == UTF-32 Auto codec =============================================================
|
| 186 |
+
// Decoder chooses automatically from UTF-32LE and UTF-32BE using BOM and space-based heuristic.
|
| 187 |
+
// Defaults to UTF-32LE. http://en.wikipedia.org/wiki/UTF-32
|
| 188 |
+
// Encoder/decoder default can be changed: iconv.decode(buf, 'utf32', {defaultEncoding: 'utf-32be'});
|
| 189 |
+
|
| 190 |
+
// Encoder prepends BOM (which can be overridden with (addBOM: false}).
|
| 191 |
+
|
| 192 |
+
exports.utf32 = Utf32AutoCodec;
|
| 193 |
+
exports.ucs4 = 'utf32';
|
| 194 |
+
|
| 195 |
+
function Utf32AutoCodec(options, iconv) {
|
| 196 |
+
this.iconv = iconv;
|
| 197 |
+
}
|
| 198 |
+
|
| 199 |
+
Utf32AutoCodec.prototype.encoder = Utf32AutoEncoder;
|
| 200 |
+
Utf32AutoCodec.prototype.decoder = Utf32AutoDecoder;
|
| 201 |
+
|
| 202 |
+
// -- Encoding
|
| 203 |
+
|
| 204 |
+
function Utf32AutoEncoder(options, codec) {
|
| 205 |
+
options = options || {};
|
| 206 |
+
|
| 207 |
+
if (options.addBOM === undefined)
|
| 208 |
+
options.addBOM = true;
|
| 209 |
+
|
| 210 |
+
this.encoder = codec.iconv.getEncoder(options.defaultEncoding || 'utf-32le', options);
|
| 211 |
+
}
|
| 212 |
+
|
| 213 |
+
Utf32AutoEncoder.prototype.write = function(str) {
|
| 214 |
+
return this.encoder.write(str);
|
| 215 |
+
};
|
| 216 |
+
|
| 217 |
+
Utf32AutoEncoder.prototype.end = function() {
|
| 218 |
+
return this.encoder.end();
|
| 219 |
+
};
|
| 220 |
+
|
| 221 |
+
// -- Decoding
|
| 222 |
+
|
| 223 |
+
function Utf32AutoDecoder(options, codec) {
|
| 224 |
+
this.decoder = null;
|
| 225 |
+
this.initialBufs = [];
|
| 226 |
+
this.initialBufsLen = 0;
|
| 227 |
+
this.options = options || {};
|
| 228 |
+
this.iconv = codec.iconv;
|
| 229 |
+
}
|
| 230 |
+
|
| 231 |
+
Utf32AutoDecoder.prototype.write = function(buf) {
|
| 232 |
+
if (!this.decoder) {
|
| 233 |
+
// Codec is not chosen yet. Accumulate initial bytes.
|
| 234 |
+
this.initialBufs.push(buf);
|
| 235 |
+
this.initialBufsLen += buf.length;
|
| 236 |
+
|
| 237 |
+
if (this.initialBufsLen < 32) // We need more bytes to use space heuristic (see below)
|
| 238 |
+
return '';
|
| 239 |
+
|
| 240 |
+
// We have enough bytes -> detect endianness.
|
| 241 |
+
var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding);
|
| 242 |
+
this.decoder = this.iconv.getDecoder(encoding, this.options);
|
| 243 |
+
|
| 244 |
+
var resStr = '';
|
| 245 |
+
for (var i = 0; i < this.initialBufs.length; i++)
|
| 246 |
+
resStr += this.decoder.write(this.initialBufs[i]);
|
| 247 |
+
|
| 248 |
+
this.initialBufs.length = this.initialBufsLen = 0;
|
| 249 |
+
return resStr;
|
| 250 |
+
}
|
| 251 |
+
|
| 252 |
+
return this.decoder.write(buf);
|
| 253 |
+
};
|
| 254 |
+
|
| 255 |
+
Utf32AutoDecoder.prototype.end = function() {
|
| 256 |
+
if (!this.decoder) {
|
| 257 |
+
var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding);
|
| 258 |
+
this.decoder = this.iconv.getDecoder(encoding, this.options);
|
| 259 |
+
|
| 260 |
+
var resStr = '';
|
| 261 |
+
for (var i = 0; i < this.initialBufs.length; i++)
|
| 262 |
+
resStr += this.decoder.write(this.initialBufs[i]);
|
| 263 |
+
|
| 264 |
+
var trail = this.decoder.end();
|
| 265 |
+
if (trail)
|
| 266 |
+
resStr += trail;
|
| 267 |
+
|
| 268 |
+
this.initialBufs.length = this.initialBufsLen = 0;
|
| 269 |
+
return resStr;
|
| 270 |
+
}
|
| 271 |
+
|
| 272 |
+
return this.decoder.end();
|
| 273 |
+
};
|
| 274 |
+
|
| 275 |
+
function detectEncoding(bufs, defaultEncoding) {
|
| 276 |
+
var b = [];
|
| 277 |
+
var charsProcessed = 0;
|
| 278 |
+
var invalidLE = 0, invalidBE = 0; // Number of invalid chars when decoded as LE or BE.
|
| 279 |
+
var bmpCharsLE = 0, bmpCharsBE = 0; // Number of BMP chars when decoded as LE or BE.
|
| 280 |
+
|
| 281 |
+
outer_loop:
|
| 282 |
+
for (var i = 0; i < bufs.length; i++) {
|
| 283 |
+
var buf = bufs[i];
|
| 284 |
+
for (var j = 0; j < buf.length; j++) {
|
| 285 |
+
b.push(buf[j]);
|
| 286 |
+
if (b.length === 4) {
|
| 287 |
+
if (charsProcessed === 0) {
|
| 288 |
+
// Check BOM first.
|
| 289 |
+
if (b[0] === 0xFF && b[1] === 0xFE && b[2] === 0 && b[3] === 0) {
|
| 290 |
+
return 'utf-32le';
|
| 291 |
+
}
|
| 292 |
+
if (b[0] === 0 && b[1] === 0 && b[2] === 0xFE && b[3] === 0xFF) {
|
| 293 |
+
return 'utf-32be';
|
| 294 |
+
}
|
| 295 |
+
}
|
| 296 |
+
|
| 297 |
+
if (b[0] !== 0 || b[1] > 0x10) invalidBE++;
|
| 298 |
+
if (b[3] !== 0 || b[2] > 0x10) invalidLE++;
|
| 299 |
+
|
| 300 |
+
if (b[0] === 0 && b[1] === 0 && (b[2] !== 0 || b[3] !== 0)) bmpCharsBE++;
|
| 301 |
+
if ((b[0] !== 0 || b[1] !== 0) && b[2] === 0 && b[3] === 0) bmpCharsLE++;
|
| 302 |
+
|
| 303 |
+
b.length = 0;
|
| 304 |
+
charsProcessed++;
|
| 305 |
+
|
| 306 |
+
if (charsProcessed >= 100) {
|
| 307 |
+
break outer_loop;
|
| 308 |
+
}
|
| 309 |
+
}
|
| 310 |
+
}
|
| 311 |
+
}
|
| 312 |
+
|
| 313 |
+
// Make decisions.
|
| 314 |
+
if (bmpCharsBE - invalidBE > bmpCharsLE - invalidLE) return 'utf-32be';
|
| 315 |
+
if (bmpCharsBE - invalidBE < bmpCharsLE - invalidLE) return 'utf-32le';
|
| 316 |
+
|
| 317 |
+
// Couldn't decide (likely all zeros or not enough data).
|
| 318 |
+
return defaultEncoding || 'utf-32le';
|
| 319 |
+
}
|
Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/iconv-lite/encodings/utf7.js
CHANGED
|
@@ -1,3 +1,290 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
var Buffer = require("safer-buffer").Buffer;
|
| 3 |
+
|
| 4 |
+
// UTF-7 codec, according to https://tools.ietf.org/html/rfc2152
|
| 5 |
+
// See also below a UTF-7-IMAP codec, according to http://tools.ietf.org/html/rfc3501#section-5.1.3
|
| 6 |
+
|
| 7 |
+
exports.utf7 = Utf7Codec;
|
| 8 |
+
exports.unicode11utf7 = 'utf7'; // Alias UNICODE-1-1-UTF-7
|
| 9 |
+
function Utf7Codec(codecOptions, iconv) {
|
| 10 |
+
this.iconv = iconv;
|
| 11 |
+
};
|
| 12 |
+
|
| 13 |
+
Utf7Codec.prototype.encoder = Utf7Encoder;
|
| 14 |
+
Utf7Codec.prototype.decoder = Utf7Decoder;
|
| 15 |
+
Utf7Codec.prototype.bomAware = true;
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
// -- Encoding
|
| 19 |
+
|
| 20 |
+
var nonDirectChars = /[^A-Za-z0-9'\(\),-\.\/:\? \n\r\t]+/g;
|
| 21 |
+
|
| 22 |
+
function Utf7Encoder(options, codec) {
|
| 23 |
+
this.iconv = codec.iconv;
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
Utf7Encoder.prototype.write = function(str) {
|
| 27 |
+
// Naive implementation.
|
| 28 |
+
// Non-direct chars are encoded as "+<base64>-"; single "+" char is encoded as "+-".
|
| 29 |
+
return Buffer.from(str.replace(nonDirectChars, function(chunk) {
|
| 30 |
+
return "+" + (chunk === '+' ? '' :
|
| 31 |
+
this.iconv.encode(chunk, 'utf16-be').toString('base64').replace(/=+$/, ''))
|
| 32 |
+
+ "-";
|
| 33 |
+
}.bind(this)));
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
Utf7Encoder.prototype.end = function() {
|
| 37 |
+
}
|
| 38 |
+
|
| 39 |
+
|
| 40 |
+
// -- Decoding
|
| 41 |
+
|
| 42 |
+
function Utf7Decoder(options, codec) {
|
| 43 |
+
this.iconv = codec.iconv;
|
| 44 |
+
this.inBase64 = false;
|
| 45 |
+
this.base64Accum = '';
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
var base64Regex = /[A-Za-z0-9\/+]/;
|
| 49 |
+
var base64Chars = [];
|
| 50 |
+
for (var i = 0; i < 256; i++)
|
| 51 |
+
base64Chars[i] = base64Regex.test(String.fromCharCode(i));
|
| 52 |
+
|
| 53 |
+
var plusChar = '+'.charCodeAt(0),
|
| 54 |
+
minusChar = '-'.charCodeAt(0),
|
| 55 |
+
andChar = '&'.charCodeAt(0);
|
| 56 |
+
|
| 57 |
+
Utf7Decoder.prototype.write = function(buf) {
|
| 58 |
+
var res = "", lastI = 0,
|
| 59 |
+
inBase64 = this.inBase64,
|
| 60 |
+
base64Accum = this.base64Accum;
|
| 61 |
+
|
| 62 |
+
// The decoder is more involved as we must handle chunks in stream.
|
| 63 |
+
|
| 64 |
+
for (var i = 0; i < buf.length; i++) {
|
| 65 |
+
if (!inBase64) { // We're in direct mode.
|
| 66 |
+
// Write direct chars until '+'
|
| 67 |
+
if (buf[i] == plusChar) {
|
| 68 |
+
res += this.iconv.decode(buf.slice(lastI, i), "ascii"); // Write direct chars.
|
| 69 |
+
lastI = i+1;
|
| 70 |
+
inBase64 = true;
|
| 71 |
+
}
|
| 72 |
+
} else { // We decode base64.
|
| 73 |
+
if (!base64Chars[buf[i]]) { // Base64 ended.
|
| 74 |
+
if (i == lastI && buf[i] == minusChar) {// "+-" -> "+"
|
| 75 |
+
res += "+";
|
| 76 |
+
} else {
|
| 77 |
+
var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i), "ascii");
|
| 78 |
+
res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be");
|
| 79 |
+
}
|
| 80 |
+
|
| 81 |
+
if (buf[i] != minusChar) // Minus is absorbed after base64.
|
| 82 |
+
i--;
|
| 83 |
+
|
| 84 |
+
lastI = i+1;
|
| 85 |
+
inBase64 = false;
|
| 86 |
+
base64Accum = '';
|
| 87 |
+
}
|
| 88 |
+
}
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
if (!inBase64) {
|
| 92 |
+
res += this.iconv.decode(buf.slice(lastI), "ascii"); // Write direct chars.
|
| 93 |
+
} else {
|
| 94 |
+
var b64str = base64Accum + this.iconv.decode(buf.slice(lastI), "ascii");
|
| 95 |
+
|
| 96 |
+
var canBeDecoded = b64str.length - (b64str.length % 8); // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars.
|
| 97 |
+
base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future.
|
| 98 |
+
b64str = b64str.slice(0, canBeDecoded);
|
| 99 |
+
|
| 100 |
+
res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be");
|
| 101 |
+
}
|
| 102 |
+
|
| 103 |
+
this.inBase64 = inBase64;
|
| 104 |
+
this.base64Accum = base64Accum;
|
| 105 |
+
|
| 106 |
+
return res;
|
| 107 |
+
}
|
| 108 |
+
|
| 109 |
+
Utf7Decoder.prototype.end = function() {
|
| 110 |
+
var res = "";
|
| 111 |
+
if (this.inBase64 && this.base64Accum.length > 0)
|
| 112 |
+
res = this.iconv.decode(Buffer.from(this.base64Accum, 'base64'), "utf16-be");
|
| 113 |
+
|
| 114 |
+
this.inBase64 = false;
|
| 115 |
+
this.base64Accum = '';
|
| 116 |
+
return res;
|
| 117 |
+
}
|
| 118 |
+
|
| 119 |
+
|
| 120 |
+
// UTF-7-IMAP codec.
|
| 121 |
+
// RFC3501 Sec. 5.1.3 Modified UTF-7 (http://tools.ietf.org/html/rfc3501#section-5.1.3)
|
| 122 |
+
// Differences:
|
| 123 |
+
// * Base64 part is started by "&" instead of "+"
|
| 124 |
+
// * Direct characters are 0x20-0x7E, except "&" (0x26)
|
| 125 |
+
// * In Base64, "," is used instead of "/"
|
| 126 |
+
// * Base64 must not be used to represent direct characters.
|
| 127 |
+
// * No implicit shift back from Base64 (should always end with '-')
|
| 128 |
+
// * String must end in non-shifted position.
|
| 129 |
+
// * "-&" while in base64 is not allowed.
|
| 130 |
+
|
| 131 |
+
|
| 132 |
+
exports.utf7imap = Utf7IMAPCodec;
|
| 133 |
+
function Utf7IMAPCodec(codecOptions, iconv) {
|
| 134 |
+
this.iconv = iconv;
|
| 135 |
+
};
|
| 136 |
+
|
| 137 |
+
Utf7IMAPCodec.prototype.encoder = Utf7IMAPEncoder;
|
| 138 |
+
Utf7IMAPCodec.prototype.decoder = Utf7IMAPDecoder;
|
| 139 |
+
Utf7IMAPCodec.prototype.bomAware = true;
|
| 140 |
+
|
| 141 |
+
|
| 142 |
+
// -- Encoding
|
| 143 |
+
|
| 144 |
+
function Utf7IMAPEncoder(options, codec) {
|
| 145 |
+
this.iconv = codec.iconv;
|
| 146 |
+
this.inBase64 = false;
|
| 147 |
+
this.base64Accum = Buffer.alloc(6);
|
| 148 |
+
this.base64AccumIdx = 0;
|
| 149 |
+
}
|
| 150 |
+
|
| 151 |
+
Utf7IMAPEncoder.prototype.write = function(str) {
|
| 152 |
+
var inBase64 = this.inBase64,
|
| 153 |
+
base64Accum = this.base64Accum,
|
| 154 |
+
base64AccumIdx = this.base64AccumIdx,
|
| 155 |
+
buf = Buffer.alloc(str.length*5 + 10), bufIdx = 0;
|
| 156 |
+
|
| 157 |
+
for (var i = 0; i < str.length; i++) {
|
| 158 |
+
var uChar = str.charCodeAt(i);
|
| 159 |
+
if (0x20 <= uChar && uChar <= 0x7E) { // Direct character or '&'.
|
| 160 |
+
if (inBase64) {
|
| 161 |
+
if (base64AccumIdx > 0) {
|
| 162 |
+
bufIdx += buf.write(base64Accum.slice(0, base64AccumIdx).toString('base64').replace(/\//g, ',').replace(/=+$/, ''), bufIdx);
|
| 163 |
+
base64AccumIdx = 0;
|
| 164 |
+
}
|
| 165 |
+
|
| 166 |
+
buf[bufIdx++] = minusChar; // Write '-', then go to direct mode.
|
| 167 |
+
inBase64 = false;
|
| 168 |
+
}
|
| 169 |
+
|
| 170 |
+
if (!inBase64) {
|
| 171 |
+
buf[bufIdx++] = uChar; // Write direct character
|
| 172 |
+
|
| 173 |
+
if (uChar === andChar) // Ampersand -> '&-'
|
| 174 |
+
buf[bufIdx++] = minusChar;
|
| 175 |
+
}
|
| 176 |
+
|
| 177 |
+
} else { // Non-direct character
|
| 178 |
+
if (!inBase64) {
|
| 179 |
+
buf[bufIdx++] = andChar; // Write '&', then go to base64 mode.
|
| 180 |
+
inBase64 = true;
|
| 181 |
+
}
|
| 182 |
+
if (inBase64) {
|
| 183 |
+
base64Accum[base64AccumIdx++] = uChar >> 8;
|
| 184 |
+
base64Accum[base64AccumIdx++] = uChar & 0xFF;
|
| 185 |
+
|
| 186 |
+
if (base64AccumIdx == base64Accum.length) {
|
| 187 |
+
bufIdx += buf.write(base64Accum.toString('base64').replace(/\//g, ','), bufIdx);
|
| 188 |
+
base64AccumIdx = 0;
|
| 189 |
+
}
|
| 190 |
+
}
|
| 191 |
+
}
|
| 192 |
+
}
|
| 193 |
+
|
| 194 |
+
this.inBase64 = inBase64;
|
| 195 |
+
this.base64AccumIdx = base64AccumIdx;
|
| 196 |
+
|
| 197 |
+
return buf.slice(0, bufIdx);
|
| 198 |
+
}
|
| 199 |
+
|
| 200 |
+
Utf7IMAPEncoder.prototype.end = function() {
|
| 201 |
+
var buf = Buffer.alloc(10), bufIdx = 0;
|
| 202 |
+
if (this.inBase64) {
|
| 203 |
+
if (this.base64AccumIdx > 0) {
|
| 204 |
+
bufIdx += buf.write(this.base64Accum.slice(0, this.base64AccumIdx).toString('base64').replace(/\//g, ',').replace(/=+$/, ''), bufIdx);
|
| 205 |
+
this.base64AccumIdx = 0;
|
| 206 |
+
}
|
| 207 |
+
|
| 208 |
+
buf[bufIdx++] = minusChar; // Write '-', then go to direct mode.
|
| 209 |
+
this.inBase64 = false;
|
| 210 |
+
}
|
| 211 |
+
|
| 212 |
+
return buf.slice(0, bufIdx);
|
| 213 |
+
}
|
| 214 |
+
|
| 215 |
+
|
| 216 |
+
// -- Decoding
|
| 217 |
+
|
| 218 |
+
function Utf7IMAPDecoder(options, codec) {
|
| 219 |
+
this.iconv = codec.iconv;
|
| 220 |
+
this.inBase64 = false;
|
| 221 |
+
this.base64Accum = '';
|
| 222 |
+
}
|
| 223 |
+
|
| 224 |
+
var base64IMAPChars = base64Chars.slice();
|
| 225 |
+
base64IMAPChars[','.charCodeAt(0)] = true;
|
| 226 |
+
|
| 227 |
+
Utf7IMAPDecoder.prototype.write = function(buf) {
|
| 228 |
+
var res = "", lastI = 0,
|
| 229 |
+
inBase64 = this.inBase64,
|
| 230 |
+
base64Accum = this.base64Accum;
|
| 231 |
+
|
| 232 |
+
// The decoder is more involved as we must handle chunks in stream.
|
| 233 |
+
// It is forgiving, closer to standard UTF-7 (for example, '-' is optional at the end).
|
| 234 |
+
|
| 235 |
+
for (var i = 0; i < buf.length; i++) {
|
| 236 |
+
if (!inBase64) { // We're in direct mode.
|
| 237 |
+
// Write direct chars until '&'
|
| 238 |
+
if (buf[i] == andChar) {
|
| 239 |
+
res += this.iconv.decode(buf.slice(lastI, i), "ascii"); // Write direct chars.
|
| 240 |
+
lastI = i+1;
|
| 241 |
+
inBase64 = true;
|
| 242 |
+
}
|
| 243 |
+
} else { // We decode base64.
|
| 244 |
+
if (!base64IMAPChars[buf[i]]) { // Base64 ended.
|
| 245 |
+
if (i == lastI && buf[i] == minusChar) { // "&-" -> "&"
|
| 246 |
+
res += "&";
|
| 247 |
+
} else {
|
| 248 |
+
var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i), "ascii").replace(/,/g, '/');
|
| 249 |
+
res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be");
|
| 250 |
+
}
|
| 251 |
+
|
| 252 |
+
if (buf[i] != minusChar) // Minus may be absorbed after base64.
|
| 253 |
+
i--;
|
| 254 |
+
|
| 255 |
+
lastI = i+1;
|
| 256 |
+
inBase64 = false;
|
| 257 |
+
base64Accum = '';
|
| 258 |
+
}
|
| 259 |
+
}
|
| 260 |
+
}
|
| 261 |
+
|
| 262 |
+
if (!inBase64) {
|
| 263 |
+
res += this.iconv.decode(buf.slice(lastI), "ascii"); // Write direct chars.
|
| 264 |
+
} else {
|
| 265 |
+
var b64str = base64Accum + this.iconv.decode(buf.slice(lastI), "ascii").replace(/,/g, '/');
|
| 266 |
+
|
| 267 |
+
var canBeDecoded = b64str.length - (b64str.length % 8); // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars.
|
| 268 |
+
base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future.
|
| 269 |
+
b64str = b64str.slice(0, canBeDecoded);
|
| 270 |
+
|
| 271 |
+
res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be");
|
| 272 |
+
}
|
| 273 |
+
|
| 274 |
+
this.inBase64 = inBase64;
|
| 275 |
+
this.base64Accum = base64Accum;
|
| 276 |
+
|
| 277 |
+
return res;
|
| 278 |
+
}
|
| 279 |
+
|
| 280 |
+
Utf7IMAPDecoder.prototype.end = function() {
|
| 281 |
+
var res = "";
|
| 282 |
+
if (this.inBase64 && this.base64Accum.length > 0)
|
| 283 |
+
res = this.iconv.decode(Buffer.from(this.base64Accum, 'base64'), "utf16-be");
|
| 284 |
+
|
| 285 |
+
this.inBase64 = false;
|
| 286 |
+
this.base64Accum = '';
|
| 287 |
+
return res;
|
| 288 |
+
}
|
| 289 |
+
|
| 290 |
+
|
Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/iconv-lite/lib/bom-handling.js
CHANGED
|
@@ -1,3 +1,52 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
var BOMChar = '\uFEFF';
|
| 4 |
+
|
| 5 |
+
exports.PrependBOM = PrependBOMWrapper
|
| 6 |
+
function PrependBOMWrapper(encoder, options) {
|
| 7 |
+
this.encoder = encoder;
|
| 8 |
+
this.addBOM = true;
|
| 9 |
+
}
|
| 10 |
+
|
| 11 |
+
PrependBOMWrapper.prototype.write = function(str) {
|
| 12 |
+
if (this.addBOM) {
|
| 13 |
+
str = BOMChar + str;
|
| 14 |
+
this.addBOM = false;
|
| 15 |
+
}
|
| 16 |
+
|
| 17 |
+
return this.encoder.write(str);
|
| 18 |
+
}
|
| 19 |
+
|
| 20 |
+
PrependBOMWrapper.prototype.end = function() {
|
| 21 |
+
return this.encoder.end();
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
//------------------------------------------------------------------------------
|
| 26 |
+
|
| 27 |
+
exports.StripBOM = StripBOMWrapper;
|
| 28 |
+
function StripBOMWrapper(decoder, options) {
|
| 29 |
+
this.decoder = decoder;
|
| 30 |
+
this.pass = false;
|
| 31 |
+
this.options = options || {};
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
StripBOMWrapper.prototype.write = function(buf) {
|
| 35 |
+
var res = this.decoder.write(buf);
|
| 36 |
+
if (this.pass || !res)
|
| 37 |
+
return res;
|
| 38 |
+
|
| 39 |
+
if (res[0] === BOMChar) {
|
| 40 |
+
res = res.slice(1);
|
| 41 |
+
if (typeof this.options.stripBOM === 'function')
|
| 42 |
+
this.options.stripBOM();
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
this.pass = true;
|
| 46 |
+
return res;
|
| 47 |
+
}
|
| 48 |
+
|
| 49 |
+
StripBOMWrapper.prototype.end = function() {
|
| 50 |
+
return this.decoder.end();
|
| 51 |
+
}
|
| 52 |
+
|
Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/iconv-lite/lib/index.d.ts
CHANGED
|
@@ -1,3 +1,41 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*---------------------------------------------------------------------------------------------
|
| 2 |
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
| 3 |
+
* Licensed under the MIT License.
|
| 4 |
+
* REQUIREMENT: This definition is dependent on the @types/node definition.
|
| 5 |
+
* Install with `npm install @types/node --save-dev`
|
| 6 |
+
*--------------------------------------------------------------------------------------------*/
|
| 7 |
+
|
| 8 |
+
declare module 'iconv-lite' {
|
| 9 |
+
// Basic API
|
| 10 |
+
export function decode(buffer: Buffer, encoding: string, options?: Options): string;
|
| 11 |
+
|
| 12 |
+
export function encode(content: string, encoding: string, options?: Options): Buffer;
|
| 13 |
+
|
| 14 |
+
export function encodingExists(encoding: string): boolean;
|
| 15 |
+
|
| 16 |
+
// Stream API
|
| 17 |
+
export function decodeStream(encoding: string, options?: Options): NodeJS.ReadWriteStream;
|
| 18 |
+
|
| 19 |
+
export function encodeStream(encoding: string, options?: Options): NodeJS.ReadWriteStream;
|
| 20 |
+
|
| 21 |
+
// Low-level stream APIs
|
| 22 |
+
export function getEncoder(encoding: string, options?: Options): EncoderStream;
|
| 23 |
+
|
| 24 |
+
export function getDecoder(encoding: string, options?: Options): DecoderStream;
|
| 25 |
+
}
|
| 26 |
+
|
| 27 |
+
export interface Options {
|
| 28 |
+
stripBOM?: boolean;
|
| 29 |
+
addBOM?: boolean;
|
| 30 |
+
defaultEncoding?: string;
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
export interface EncoderStream {
|
| 34 |
+
write(str: string): Buffer;
|
| 35 |
+
end(): Buffer | undefined;
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
export interface DecoderStream {
|
| 39 |
+
write(buf: Buffer): string;
|
| 40 |
+
end(): string | undefined;
|
| 41 |
+
}
|
Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/iconv-lite/lib/index.js
CHANGED
|
@@ -1,3 +1,180 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
var Buffer = require("safer-buffer").Buffer;
|
| 4 |
+
|
| 5 |
+
var bomHandling = require("./bom-handling"),
|
| 6 |
+
iconv = module.exports;
|
| 7 |
+
|
| 8 |
+
// All codecs and aliases are kept here, keyed by encoding name/alias.
|
| 9 |
+
// They are lazy loaded in `iconv.getCodec` from `encodings/index.js`.
|
| 10 |
+
iconv.encodings = null;
|
| 11 |
+
|
| 12 |
+
// Characters emitted in case of error.
|
| 13 |
+
iconv.defaultCharUnicode = '�';
|
| 14 |
+
iconv.defaultCharSingleByte = '?';
|
| 15 |
+
|
| 16 |
+
// Public API.
|
| 17 |
+
iconv.encode = function encode(str, encoding, options) {
|
| 18 |
+
str = "" + (str || ""); // Ensure string.
|
| 19 |
+
|
| 20 |
+
var encoder = iconv.getEncoder(encoding, options);
|
| 21 |
+
|
| 22 |
+
var res = encoder.write(str);
|
| 23 |
+
var trail = encoder.end();
|
| 24 |
+
|
| 25 |
+
return (trail && trail.length > 0) ? Buffer.concat([res, trail]) : res;
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
iconv.decode = function decode(buf, encoding, options) {
|
| 29 |
+
if (typeof buf === 'string') {
|
| 30 |
+
if (!iconv.skipDecodeWarning) {
|
| 31 |
+
console.error('Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding');
|
| 32 |
+
iconv.skipDecodeWarning = true;
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
buf = Buffer.from("" + (buf || ""), "binary"); // Ensure buffer.
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
var decoder = iconv.getDecoder(encoding, options);
|
| 39 |
+
|
| 40 |
+
var res = decoder.write(buf);
|
| 41 |
+
var trail = decoder.end();
|
| 42 |
+
|
| 43 |
+
return trail ? (res + trail) : res;
|
| 44 |
+
}
|
| 45 |
+
|
| 46 |
+
iconv.encodingExists = function encodingExists(enc) {
|
| 47 |
+
try {
|
| 48 |
+
iconv.getCodec(enc);
|
| 49 |
+
return true;
|
| 50 |
+
} catch (e) {
|
| 51 |
+
return false;
|
| 52 |
+
}
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
// Legacy aliases to convert functions
|
| 56 |
+
iconv.toEncoding = iconv.encode;
|
| 57 |
+
iconv.fromEncoding = iconv.decode;
|
| 58 |
+
|
| 59 |
+
// Search for a codec in iconv.encodings. Cache codec data in iconv._codecDataCache.
|
| 60 |
+
iconv._codecDataCache = {};
|
| 61 |
+
iconv.getCodec = function getCodec(encoding) {
|
| 62 |
+
if (!iconv.encodings)
|
| 63 |
+
iconv.encodings = require("../encodings"); // Lazy load all encoding definitions.
|
| 64 |
+
|
| 65 |
+
// Canonicalize encoding name: strip all non-alphanumeric chars and appended year.
|
| 66 |
+
var enc = iconv._canonicalizeEncoding(encoding);
|
| 67 |
+
|
| 68 |
+
// Traverse iconv.encodings to find actual codec.
|
| 69 |
+
var codecOptions = {};
|
| 70 |
+
while (true) {
|
| 71 |
+
var codec = iconv._codecDataCache[enc];
|
| 72 |
+
if (codec)
|
| 73 |
+
return codec;
|
| 74 |
+
|
| 75 |
+
var codecDef = iconv.encodings[enc];
|
| 76 |
+
|
| 77 |
+
switch (typeof codecDef) {
|
| 78 |
+
case "string": // Direct alias to other encoding.
|
| 79 |
+
enc = codecDef;
|
| 80 |
+
break;
|
| 81 |
+
|
| 82 |
+
case "object": // Alias with options. Can be layered.
|
| 83 |
+
for (var key in codecDef)
|
| 84 |
+
codecOptions[key] = codecDef[key];
|
| 85 |
+
|
| 86 |
+
if (!codecOptions.encodingName)
|
| 87 |
+
codecOptions.encodingName = enc;
|
| 88 |
+
|
| 89 |
+
enc = codecDef.type;
|
| 90 |
+
break;
|
| 91 |
+
|
| 92 |
+
case "function": // Codec itself.
|
| 93 |
+
if (!codecOptions.encodingName)
|
| 94 |
+
codecOptions.encodingName = enc;
|
| 95 |
+
|
| 96 |
+
// The codec function must load all tables and return object with .encoder and .decoder methods.
|
| 97 |
+
// It'll be called only once (for each different options object).
|
| 98 |
+
codec = new codecDef(codecOptions, iconv);
|
| 99 |
+
|
| 100 |
+
iconv._codecDataCache[codecOptions.encodingName] = codec; // Save it to be reused later.
|
| 101 |
+
return codec;
|
| 102 |
+
|
| 103 |
+
default:
|
| 104 |
+
throw new Error("Encoding not recognized: '" + encoding + "' (searched as: '"+enc+"')");
|
| 105 |
+
}
|
| 106 |
+
}
|
| 107 |
+
}
|
| 108 |
+
|
| 109 |
+
iconv._canonicalizeEncoding = function(encoding) {
|
| 110 |
+
// Canonicalize encoding name: strip all non-alphanumeric chars and appended year.
|
| 111 |
+
return (''+encoding).toLowerCase().replace(/:\d{4}$|[^0-9a-z]/g, "");
|
| 112 |
+
}
|
| 113 |
+
|
| 114 |
+
iconv.getEncoder = function getEncoder(encoding, options) {
|
| 115 |
+
var codec = iconv.getCodec(encoding),
|
| 116 |
+
encoder = new codec.encoder(options, codec);
|
| 117 |
+
|
| 118 |
+
if (codec.bomAware && options && options.addBOM)
|
| 119 |
+
encoder = new bomHandling.PrependBOM(encoder, options);
|
| 120 |
+
|
| 121 |
+
return encoder;
|
| 122 |
+
}
|
| 123 |
+
|
| 124 |
+
iconv.getDecoder = function getDecoder(encoding, options) {
|
| 125 |
+
var codec = iconv.getCodec(encoding),
|
| 126 |
+
decoder = new codec.decoder(options, codec);
|
| 127 |
+
|
| 128 |
+
if (codec.bomAware && !(options && options.stripBOM === false))
|
| 129 |
+
decoder = new bomHandling.StripBOM(decoder, options);
|
| 130 |
+
|
| 131 |
+
return decoder;
|
| 132 |
+
}
|
| 133 |
+
|
| 134 |
+
// Streaming API
|
| 135 |
+
// NOTE: Streaming API naturally depends on 'stream' module from Node.js. Unfortunately in browser environments this module can add
|
| 136 |
+
// up to 100Kb to the output bundle. To avoid unnecessary code bloat, we don't enable Streaming API in browser by default.
|
| 137 |
+
// If you would like to enable it explicitly, please add the following code to your app:
|
| 138 |
+
// > iconv.enableStreamingAPI(require('stream'));
|
| 139 |
+
iconv.enableStreamingAPI = function enableStreamingAPI(stream_module) {
|
| 140 |
+
if (iconv.supportsStreams)
|
| 141 |
+
return;
|
| 142 |
+
|
| 143 |
+
// Dependency-inject stream module to create IconvLite stream classes.
|
| 144 |
+
var streams = require("./streams")(stream_module);
|
| 145 |
+
|
| 146 |
+
// Not public API yet, but expose the stream classes.
|
| 147 |
+
iconv.IconvLiteEncoderStream = streams.IconvLiteEncoderStream;
|
| 148 |
+
iconv.IconvLiteDecoderStream = streams.IconvLiteDecoderStream;
|
| 149 |
+
|
| 150 |
+
// Streaming API.
|
| 151 |
+
iconv.encodeStream = function encodeStream(encoding, options) {
|
| 152 |
+
return new iconv.IconvLiteEncoderStream(iconv.getEncoder(encoding, options), options);
|
| 153 |
+
}
|
| 154 |
+
|
| 155 |
+
iconv.decodeStream = function decodeStream(encoding, options) {
|
| 156 |
+
return new iconv.IconvLiteDecoderStream(iconv.getDecoder(encoding, options), options);
|
| 157 |
+
}
|
| 158 |
+
|
| 159 |
+
iconv.supportsStreams = true;
|
| 160 |
+
}
|
| 161 |
+
|
| 162 |
+
// Enable Streaming API automatically if 'stream' module is available and non-empty (the majority of environments).
|
| 163 |
+
var stream_module;
|
| 164 |
+
try {
|
| 165 |
+
stream_module = require("stream");
|
| 166 |
+
} catch (e) {}
|
| 167 |
+
|
| 168 |
+
if (stream_module && stream_module.Transform) {
|
| 169 |
+
iconv.enableStreamingAPI(stream_module);
|
| 170 |
+
|
| 171 |
+
} else {
|
| 172 |
+
// In rare cases where 'stream' module is not available by default, throw a helpful exception.
|
| 173 |
+
iconv.encodeStream = iconv.decodeStream = function() {
|
| 174 |
+
throw new Error("iconv-lite Streaming API is not enabled. Use iconv.enableStreamingAPI(require('stream')); to enable it.");
|
| 175 |
+
};
|
| 176 |
+
}
|
| 177 |
+
|
| 178 |
+
if ("Ā" != "\u0100") {
|
| 179 |
+
console.error("iconv-lite warning: js files use non-utf8 encoding. See https://github.com/ashtuchkin/iconv-lite/wiki/Javascript-source-file-encodings for more info.");
|
| 180 |
+
}
|
Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/iconv-lite/lib/streams.js
CHANGED
|
@@ -1,3 +1,109 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
var Buffer = require("safer-buffer").Buffer;
|
| 4 |
+
|
| 5 |
+
// NOTE: Due to 'stream' module being pretty large (~100Kb, significant in browser environments),
|
| 6 |
+
// we opt to dependency-inject it instead of creating a hard dependency.
|
| 7 |
+
module.exports = function(stream_module) {
|
| 8 |
+
var Transform = stream_module.Transform;
|
| 9 |
+
|
| 10 |
+
// == Encoder stream =======================================================
|
| 11 |
+
|
| 12 |
+
function IconvLiteEncoderStream(conv, options) {
|
| 13 |
+
this.conv = conv;
|
| 14 |
+
options = options || {};
|
| 15 |
+
options.decodeStrings = false; // We accept only strings, so we don't need to decode them.
|
| 16 |
+
Transform.call(this, options);
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
IconvLiteEncoderStream.prototype = Object.create(Transform.prototype, {
|
| 20 |
+
constructor: { value: IconvLiteEncoderStream }
|
| 21 |
+
});
|
| 22 |
+
|
| 23 |
+
IconvLiteEncoderStream.prototype._transform = function(chunk, encoding, done) {
|
| 24 |
+
if (typeof chunk != 'string')
|
| 25 |
+
return done(new Error("Iconv encoding stream needs strings as its input."));
|
| 26 |
+
try {
|
| 27 |
+
var res = this.conv.write(chunk);
|
| 28 |
+
if (res && res.length) this.push(res);
|
| 29 |
+
done();
|
| 30 |
+
}
|
| 31 |
+
catch (e) {
|
| 32 |
+
done(e);
|
| 33 |
+
}
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
IconvLiteEncoderStream.prototype._flush = function(done) {
|
| 37 |
+
try {
|
| 38 |
+
var res = this.conv.end();
|
| 39 |
+
if (res && res.length) this.push(res);
|
| 40 |
+
done();
|
| 41 |
+
}
|
| 42 |
+
catch (e) {
|
| 43 |
+
done(e);
|
| 44 |
+
}
|
| 45 |
+
}
|
| 46 |
+
|
| 47 |
+
IconvLiteEncoderStream.prototype.collect = function(cb) {
|
| 48 |
+
var chunks = [];
|
| 49 |
+
this.on('error', cb);
|
| 50 |
+
this.on('data', function(chunk) { chunks.push(chunk); });
|
| 51 |
+
this.on('end', function() {
|
| 52 |
+
cb(null, Buffer.concat(chunks));
|
| 53 |
+
});
|
| 54 |
+
return this;
|
| 55 |
+
}
|
| 56 |
+
|
| 57 |
+
|
| 58 |
+
// == Decoder stream =======================================================
|
| 59 |
+
|
| 60 |
+
function IconvLiteDecoderStream(conv, options) {
|
| 61 |
+
this.conv = conv;
|
| 62 |
+
options = options || {};
|
| 63 |
+
options.encoding = this.encoding = 'utf8'; // We output strings.
|
| 64 |
+
Transform.call(this, options);
|
| 65 |
+
}
|
| 66 |
+
|
| 67 |
+
IconvLiteDecoderStream.prototype = Object.create(Transform.prototype, {
|
| 68 |
+
constructor: { value: IconvLiteDecoderStream }
|
| 69 |
+
});
|
| 70 |
+
|
| 71 |
+
IconvLiteDecoderStream.prototype._transform = function(chunk, encoding, done) {
|
| 72 |
+
if (!Buffer.isBuffer(chunk) && !(chunk instanceof Uint8Array))
|
| 73 |
+
return done(new Error("Iconv decoding stream needs buffers as its input."));
|
| 74 |
+
try {
|
| 75 |
+
var res = this.conv.write(chunk);
|
| 76 |
+
if (res && res.length) this.push(res, this.encoding);
|
| 77 |
+
done();
|
| 78 |
+
}
|
| 79 |
+
catch (e) {
|
| 80 |
+
done(e);
|
| 81 |
+
}
|
| 82 |
+
}
|
| 83 |
+
|
| 84 |
+
IconvLiteDecoderStream.prototype._flush = function(done) {
|
| 85 |
+
try {
|
| 86 |
+
var res = this.conv.end();
|
| 87 |
+
if (res && res.length) this.push(res, this.encoding);
|
| 88 |
+
done();
|
| 89 |
+
}
|
| 90 |
+
catch (e) {
|
| 91 |
+
done(e);
|
| 92 |
+
}
|
| 93 |
+
}
|
| 94 |
+
|
| 95 |
+
IconvLiteDecoderStream.prototype.collect = function(cb) {
|
| 96 |
+
var res = '';
|
| 97 |
+
this.on('error', cb);
|
| 98 |
+
this.on('data', function(chunk) { res += chunk; });
|
| 99 |
+
this.on('end', function() {
|
| 100 |
+
cb(null, res);
|
| 101 |
+
});
|
| 102 |
+
return this;
|
| 103 |
+
}
|
| 104 |
+
|
| 105 |
+
return {
|
| 106 |
+
IconvLiteEncoderStream: IconvLiteEncoderStream,
|
| 107 |
+
IconvLiteDecoderStream: IconvLiteDecoderStream,
|
| 108 |
+
};
|
| 109 |
+
};
|
Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/iconv-lite/package.json
CHANGED
|
@@ -1,3 +1,44 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "iconv-lite",
|
| 3 |
+
"description": "Convert character encodings in pure javascript.",
|
| 4 |
+
"version": "0.6.3",
|
| 5 |
+
"license": "MIT",
|
| 6 |
+
"keywords": [
|
| 7 |
+
"iconv",
|
| 8 |
+
"convert",
|
| 9 |
+
"charset",
|
| 10 |
+
"icu"
|
| 11 |
+
],
|
| 12 |
+
"author": "Alexander Shtuchkin <ashtuchkin@gmail.com>",
|
| 13 |
+
"main": "./lib/index.js",
|
| 14 |
+
"typings": "./lib/index.d.ts",
|
| 15 |
+
"homepage": "https://github.com/ashtuchkin/iconv-lite",
|
| 16 |
+
"bugs": "https://github.com/ashtuchkin/iconv-lite/issues",
|
| 17 |
+
"repository": {
|
| 18 |
+
"type": "git",
|
| 19 |
+
"url": "git://github.com/ashtuchkin/iconv-lite.git"
|
| 20 |
+
},
|
| 21 |
+
"engines": {
|
| 22 |
+
"node": ">=0.10.0"
|
| 23 |
+
},
|
| 24 |
+
"scripts": {
|
| 25 |
+
"coverage": "c8 _mocha --grep .",
|
| 26 |
+
"test": "mocha --reporter spec --grep ."
|
| 27 |
+
},
|
| 28 |
+
"browser": {
|
| 29 |
+
"stream": false
|
| 30 |
+
},
|
| 31 |
+
"devDependencies": {
|
| 32 |
+
"async": "^3.2.0",
|
| 33 |
+
"c8": "^7.2.0",
|
| 34 |
+
"errto": "^0.2.1",
|
| 35 |
+
"iconv": "^2.3.5",
|
| 36 |
+
"mocha": "^3.5.3",
|
| 37 |
+
"request": "^2.88.2",
|
| 38 |
+
"semver": "^6.3.0",
|
| 39 |
+
"unorm": "^1.6.0"
|
| 40 |
+
},
|
| 41 |
+
"dependencies": {
|
| 42 |
+
"safer-buffer": ">= 2.1.2 < 3.0.0"
|
| 43 |
+
}
|
| 44 |
+
}
|
Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/icss-utils/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,30 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Change Log
|
| 2 |
+
|
| 3 |
+
All notable changes to this project will be documented in this file.
|
| 4 |
+
This project adheres to [Semantic Versioning](http://semver.org/).
|
| 5 |
+
|
| 6 |
+
## [5.1.0] - 2020-11-19
|
| 7 |
+
|
| 8 |
+
### Features
|
| 9 |
+
|
| 10 |
+
- feat: support at-rule versions of `import`/`export`
|
| 11 |
+
|
| 12 |
+
## [5.0.0] - 2020-10-12
|
| 13 |
+
|
| 14 |
+
### BREAKING CHANGE
|
| 15 |
+
|
| 16 |
+
- minimum supported `postcss` version is `^8.1.0`
|
| 17 |
+
|
| 18 |
+
### Fixes
|
| 19 |
+
|
| 20 |
+
- minimum supported `Node.js` version is `^10 || ^12 || >= 14`
|
| 21 |
+
- compatibility with PostCSS 8
|
| 22 |
+
|
| 23 |
+
## [5.0.0-rc.0] - 2020-09-21
|
| 24 |
+
|
| 25 |
+
### BREAKING CHANGE
|
| 26 |
+
|
| 27 |
+
- minimum supported `Node.js` version is `>= 10.13.0 || >= 12.13.0 || >= 14`
|
| 28 |
+
- minimum supported `postcss` version is `^8.0.0`
|
| 29 |
+
- `postcss` was moved to `peerDependencies`, you need to install `postcss` in your project before use the plugin
|
| 30 |
+
- you need to pass `postcss` API to using `createICSSRules` (third argument)
|
Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/icss-utils/LICENSE.md
CHANGED
|
@@ -1,3 +1,6 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
ISC License (ISC)
|
| 2 |
+
Copyright 2018 Glen Maddern
|
| 3 |
+
|
| 4 |
+
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
|
| 5 |
+
|
| 6 |
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/icss-utils/README.md
CHANGED
|
@@ -1,3 +1,94 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[](https://travis-ci.org/css-modules/icss-utils)
|
| 2 |
+
|
| 3 |
+
# ICSS Utils
|
| 4 |
+
|
| 5 |
+
## replaceSymbols
|
| 6 |
+
|
| 7 |
+
Governs the way tokens are searched & replaced during the linking stage of ICSS loading.
|
| 8 |
+
|
| 9 |
+
This is broken into its own module in case the behaviour needs to be replicated in other PostCSS plugins
|
| 10 |
+
(i.e. [CSS Modules Values](https://github.com/css-modules/postcss-modules-values))
|
| 11 |
+
|
| 12 |
+
```js
|
| 13 |
+
import { replaceSymbols, replaceValueSymbols } from "icss-utils";
|
| 14 |
+
|
| 15 |
+
replaceSymbols(css, replacements);
|
| 16 |
+
replaceValueSymbols(string, replacements);
|
| 17 |
+
```
|
| 18 |
+
|
| 19 |
+
Where:
|
| 20 |
+
|
| 21 |
+
- `css` is the PostCSS tree you're working with
|
| 22 |
+
- `replacements` is an JS object of `symbol: "replacement"` pairs, where all occurrences of `symbol` are replaced with `replacement`.
|
| 23 |
+
|
| 24 |
+
A symbol is a string of alphanumeric, `-` or `_` characters. A replacement can be any string. They are replaced in the following places:
|
| 25 |
+
|
| 26 |
+
- In the value of a declaration, i.e. `color: my_symbol;` or `box-shadow: 0 0 blur spread shadow-color`
|
| 27 |
+
- In a media expression i.e. `@media small {}` or `@media screen and not-large {}`
|
| 28 |
+
|
| 29 |
+
## extractICSS(css, removeRules = true, mode = 'auto')
|
| 30 |
+
|
| 31 |
+
Extracts and remove (if removeRules is equal true) from PostCSS tree `:import`, `@icss-import`, `:export` and `@icss-export` statements.
|
| 32 |
+
|
| 33 |
+
```js
|
| 34 |
+
import postcss from "postcss";
|
| 35 |
+
import { extractICSS } from "icss-utils";
|
| 36 |
+
|
| 37 |
+
const css = postcss.parse(`
|
| 38 |
+
:import(colors) {
|
| 39 |
+
a: b;
|
| 40 |
+
}
|
| 41 |
+
:export {
|
| 42 |
+
c: d;
|
| 43 |
+
}
|
| 44 |
+
`);
|
| 45 |
+
|
| 46 |
+
extractICSS(css);
|
| 47 |
+
/*
|
| 48 |
+
{
|
| 49 |
+
icssImports: {
|
| 50 |
+
colors: {
|
| 51 |
+
a: 'b'
|
| 52 |
+
}
|
| 53 |
+
},
|
| 54 |
+
icssExports: {
|
| 55 |
+
c: 'd'
|
| 56 |
+
}
|
| 57 |
+
}
|
| 58 |
+
*/
|
| 59 |
+
```
|
| 60 |
+
|
| 61 |
+
By default both the pseudo and at-rule form of the import and export statements
|
| 62 |
+
will be removed. Pass the `mode` option to limit to only one type.
|
| 63 |
+
|
| 64 |
+
## createICSSRules(icssImports, icssExports, mode = 'rule')
|
| 65 |
+
|
| 66 |
+
Converts icss imports and exports definitions to postcss ast
|
| 67 |
+
|
| 68 |
+
```js
|
| 69 |
+
createICSSRules(
|
| 70 |
+
{
|
| 71 |
+
colors: {
|
| 72 |
+
a: "b",
|
| 73 |
+
},
|
| 74 |
+
},
|
| 75 |
+
{
|
| 76 |
+
c: "d",
|
| 77 |
+
},
|
| 78 |
+
// Need pass `rule` and `decl` from postcss
|
| 79 |
+
// Please look at `Step 4` https://evilmartians.com/chronicles/postcss-8-plugin-migration
|
| 80 |
+
postcss
|
| 81 |
+
);
|
| 82 |
+
```
|
| 83 |
+
|
| 84 |
+
By default it will create pseudo selector rules (`:import` and `:export`). Pass
|
| 85 |
+
`at-rule` for `mode` to instead generate `@icss-import` and `@icss-export`, which
|
| 86 |
+
may be more resilient to post processing by other tools.
|
| 87 |
+
|
| 88 |
+
## License
|
| 89 |
+
|
| 90 |
+
ISC
|
| 91 |
+
|
| 92 |
+
---
|
| 93 |
+
|
| 94 |
+
Glen Maddern, Bogdan Chadkin and Evilebottnawi 2015-present.
|
Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/icss-utils/package.json
CHANGED
|
@@ -1,3 +1,52 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "icss-utils",
|
| 3 |
+
"version": "5.1.0",
|
| 4 |
+
"description": "ICSS utils for postcss ast",
|
| 5 |
+
"main": "src/index.js",
|
| 6 |
+
"engines": {
|
| 7 |
+
"node": "^10 || ^12 || >= 14"
|
| 8 |
+
},
|
| 9 |
+
"files": [
|
| 10 |
+
"src"
|
| 11 |
+
],
|
| 12 |
+
"scripts": {
|
| 13 |
+
"prettier": "prettier -l --ignore-path .gitignore . \"!test/test-cases\"",
|
| 14 |
+
"eslint": "eslint --ignore-path .gitignore .",
|
| 15 |
+
"lint": "yarn eslint && yarn prettier",
|
| 16 |
+
"test:only": "jest",
|
| 17 |
+
"test:watch": "jest --watch",
|
| 18 |
+
"test:coverage": "jest --coverage --collectCoverageFrom=\"src/**/*\"",
|
| 19 |
+
"pretest": "yarn lint",
|
| 20 |
+
"test": "yarn test:coverage",
|
| 21 |
+
"prepublishOnly": "yarn test"
|
| 22 |
+
},
|
| 23 |
+
"repository": {
|
| 24 |
+
"type": "git",
|
| 25 |
+
"url": "git+https://github.com/css-modules/icss-utils.git"
|
| 26 |
+
},
|
| 27 |
+
"keywords": [
|
| 28 |
+
"css",
|
| 29 |
+
"modules",
|
| 30 |
+
"icss",
|
| 31 |
+
"postcss"
|
| 32 |
+
],
|
| 33 |
+
"author": "Glen Maddern",
|
| 34 |
+
"license": "ISC",
|
| 35 |
+
"bugs": {
|
| 36 |
+
"url": "https://github.com/css-modules/icss-utils/issues"
|
| 37 |
+
},
|
| 38 |
+
"homepage": "https://github.com/css-modules/icss-utils#readme",
|
| 39 |
+
"devDependencies": {
|
| 40 |
+
"coveralls": "^3.1.0",
|
| 41 |
+
"eslint": "^7.9.0",
|
| 42 |
+
"eslint-config-prettier": "^6.12.0",
|
| 43 |
+
"husky": "^4.3.0",
|
| 44 |
+
"jest": "^26.4.2",
|
| 45 |
+
"lint-staged": "^10.4.0",
|
| 46 |
+
"postcss": "^8.1.0",
|
| 47 |
+
"prettier": "^2.1.2"
|
| 48 |
+
},
|
| 49 |
+
"peerDependencies": {
|
| 50 |
+
"postcss": "^8.1.0"
|
| 51 |
+
}
|
| 52 |
+
}
|
Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/icss-utils/src/createICSSRules.js
CHANGED
|
@@ -1,3 +1,67 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
const createImports = (imports, postcss, mode = "rule") => {
|
| 2 |
+
return Object.keys(imports).map((path) => {
|
| 3 |
+
const aliases = imports[path];
|
| 4 |
+
const declarations = Object.keys(aliases).map((key) =>
|
| 5 |
+
postcss.decl({
|
| 6 |
+
prop: key,
|
| 7 |
+
value: aliases[key],
|
| 8 |
+
raws: { before: "\n " },
|
| 9 |
+
})
|
| 10 |
+
);
|
| 11 |
+
|
| 12 |
+
const hasDeclarations = declarations.length > 0;
|
| 13 |
+
|
| 14 |
+
const rule =
|
| 15 |
+
mode === "rule"
|
| 16 |
+
? postcss.rule({
|
| 17 |
+
selector: `:import('${path}')`,
|
| 18 |
+
raws: { after: hasDeclarations ? "\n" : "" },
|
| 19 |
+
})
|
| 20 |
+
: postcss.atRule({
|
| 21 |
+
name: "icss-import",
|
| 22 |
+
params: `'${path}'`,
|
| 23 |
+
raws: { after: hasDeclarations ? "\n" : "" },
|
| 24 |
+
});
|
| 25 |
+
|
| 26 |
+
if (hasDeclarations) {
|
| 27 |
+
rule.append(declarations);
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
return rule;
|
| 31 |
+
});
|
| 32 |
+
};
|
| 33 |
+
|
| 34 |
+
const createExports = (exports, postcss, mode = "rule") => {
|
| 35 |
+
const declarations = Object.keys(exports).map((key) =>
|
| 36 |
+
postcss.decl({
|
| 37 |
+
prop: key,
|
| 38 |
+
value: exports[key],
|
| 39 |
+
raws: { before: "\n " },
|
| 40 |
+
})
|
| 41 |
+
);
|
| 42 |
+
|
| 43 |
+
if (declarations.length === 0) {
|
| 44 |
+
return [];
|
| 45 |
+
}
|
| 46 |
+
const rule =
|
| 47 |
+
mode === "rule"
|
| 48 |
+
? postcss.rule({
|
| 49 |
+
selector: `:export`,
|
| 50 |
+
raws: { after: "\n" },
|
| 51 |
+
})
|
| 52 |
+
: postcss.atRule({
|
| 53 |
+
name: "icss-export",
|
| 54 |
+
raws: { after: "\n" },
|
| 55 |
+
});
|
| 56 |
+
|
| 57 |
+
rule.append(declarations);
|
| 58 |
+
|
| 59 |
+
return [rule];
|
| 60 |
+
};
|
| 61 |
+
|
| 62 |
+
const createICSSRules = (imports, exports, postcss, mode) => [
|
| 63 |
+
...createImports(imports, postcss, mode),
|
| 64 |
+
...createExports(exports, postcss, mode),
|
| 65 |
+
];
|
| 66 |
+
|
| 67 |
+
module.exports = createICSSRules;
|
Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/icss-utils/src/extractICSS.js
CHANGED
|
@@ -1,3 +1,76 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
const importPattern = /^:import\(("[^"]*"|'[^']*'|[^"']+)\)$/;
|
| 2 |
+
const balancedQuotes = /^("[^"]*"|'[^']*'|[^"']+)$/;
|
| 3 |
+
|
| 4 |
+
const getDeclsObject = (rule) => {
|
| 5 |
+
const object = {};
|
| 6 |
+
|
| 7 |
+
rule.walkDecls((decl) => {
|
| 8 |
+
const before = decl.raws.before ? decl.raws.before.trim() : "";
|
| 9 |
+
|
| 10 |
+
object[before + decl.prop] = decl.value;
|
| 11 |
+
});
|
| 12 |
+
|
| 13 |
+
return object;
|
| 14 |
+
};
|
| 15 |
+
/**
|
| 16 |
+
*
|
| 17 |
+
* @param {string} css
|
| 18 |
+
* @param {boolean} removeRules
|
| 19 |
+
* @param {'auto' | 'rule' | 'at-rule'} mode
|
| 20 |
+
*/
|
| 21 |
+
const extractICSS = (css, removeRules = true, mode = "auto") => {
|
| 22 |
+
const icssImports = {};
|
| 23 |
+
const icssExports = {};
|
| 24 |
+
|
| 25 |
+
function addImports(node, path) {
|
| 26 |
+
const unquoted = path.replace(/'|"/g, "");
|
| 27 |
+
icssImports[unquoted] = Object.assign(
|
| 28 |
+
icssImports[unquoted] || {},
|
| 29 |
+
getDeclsObject(node)
|
| 30 |
+
);
|
| 31 |
+
|
| 32 |
+
if (removeRules) {
|
| 33 |
+
node.remove();
|
| 34 |
+
}
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
function addExports(node) {
|
| 38 |
+
Object.assign(icssExports, getDeclsObject(node));
|
| 39 |
+
if (removeRules) {
|
| 40 |
+
node.remove();
|
| 41 |
+
}
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
+
css.each((node) => {
|
| 45 |
+
if (node.type === "rule" && mode !== "at-rule") {
|
| 46 |
+
if (node.selector.slice(0, 7) === ":import") {
|
| 47 |
+
const matches = importPattern.exec(node.selector);
|
| 48 |
+
|
| 49 |
+
if (matches) {
|
| 50 |
+
addImports(node, matches[1]);
|
| 51 |
+
}
|
| 52 |
+
}
|
| 53 |
+
|
| 54 |
+
if (node.selector === ":export") {
|
| 55 |
+
addExports(node);
|
| 56 |
+
}
|
| 57 |
+
}
|
| 58 |
+
|
| 59 |
+
if (node.type === "atrule" && mode !== "rule") {
|
| 60 |
+
if (node.name === "icss-import") {
|
| 61 |
+
const matches = balancedQuotes.exec(node.params);
|
| 62 |
+
|
| 63 |
+
if (matches) {
|
| 64 |
+
addImports(node, matches[1]);
|
| 65 |
+
}
|
| 66 |
+
}
|
| 67 |
+
if (node.name === "icss-export") {
|
| 68 |
+
addExports(node);
|
| 69 |
+
}
|
| 70 |
+
}
|
| 71 |
+
});
|
| 72 |
+
|
| 73 |
+
return { icssImports, icssExports };
|
| 74 |
+
};
|
| 75 |
+
|
| 76 |
+
module.exports = extractICSS;
|
Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/icss-utils/src/index.js
CHANGED
|
@@ -1,3 +1,11 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
const replaceValueSymbols = require("./replaceValueSymbols.js");
|
| 2 |
+
const replaceSymbols = require("./replaceSymbols.js");
|
| 3 |
+
const extractICSS = require("./extractICSS.js");
|
| 4 |
+
const createICSSRules = require("./createICSSRules.js");
|
| 5 |
+
|
| 6 |
+
module.exports = {
|
| 7 |
+
replaceValueSymbols,
|
| 8 |
+
replaceSymbols,
|
| 9 |
+
extractICSS,
|
| 10 |
+
createICSSRules,
|
| 11 |
+
};
|
Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/icss-utils/src/replaceSymbols.js
CHANGED
|
@@ -1,3 +1,18 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
const replaceValueSymbols = require("./replaceValueSymbols.js");
|
| 2 |
+
|
| 3 |
+
const replaceSymbols = (css, replacements) => {
|
| 4 |
+
css.walk((node) => {
|
| 5 |
+
if (node.type === "decl" && node.value) {
|
| 6 |
+
node.value = replaceValueSymbols(node.value.toString(), replacements);
|
| 7 |
+
} else if (node.type === "rule" && node.selector) {
|
| 8 |
+
node.selector = replaceValueSymbols(
|
| 9 |
+
node.selector.toString(),
|
| 10 |
+
replacements
|
| 11 |
+
);
|
| 12 |
+
} else if (node.type === "atrule" && node.params) {
|
| 13 |
+
node.params = replaceValueSymbols(node.params.toString(), replacements);
|
| 14 |
+
}
|
| 15 |
+
});
|
| 16 |
+
};
|
| 17 |
+
|
| 18 |
+
module.exports = replaceSymbols;
|
Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/icss-utils/src/replaceValueSymbols.js
CHANGED
|
@@ -1,3 +1,22 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
const matchValueName = /[$]?[\w-]+/g;
|
| 2 |
+
|
| 3 |
+
const replaceValueSymbols = (value, replacements) => {
|
| 4 |
+
let matches;
|
| 5 |
+
|
| 6 |
+
while ((matches = matchValueName.exec(value))) {
|
| 7 |
+
const replacement = replacements[matches[0]];
|
| 8 |
+
|
| 9 |
+
if (replacement) {
|
| 10 |
+
value =
|
| 11 |
+
value.slice(0, matches.index) +
|
| 12 |
+
replacement +
|
| 13 |
+
value.slice(matchValueName.lastIndex);
|
| 14 |
+
|
| 15 |
+
matchValueName.lastIndex -= matches[0].length - replacement.length;
|
| 16 |
+
}
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
return value;
|
| 20 |
+
};
|
| 21 |
+
|
| 22 |
+
module.exports = replaceValueSymbols;
|
Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/image-size/LICENSE
CHANGED
|
@@ -1,3 +1,9 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
The MIT License (MIT)
|
| 2 |
+
|
| 3 |
+
Copyright © 2017 Aditya Yadav, http://netroy.in
|
| 4 |
+
|
| 5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
| 6 |
+
|
| 7 |
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
| 8 |
+
|
| 9 |
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/image-size/Readme.md
CHANGED
|
@@ -1,3 +1,88 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# image-size
|
| 2 |
+
|
| 3 |
+
[](https://www.npmjs.com/package/image-size)
|
| 4 |
+
[](https://travis-ci.org/image-size/image-size)
|
| 5 |
+
[](http://npm-stat.com/charts.html?package=image-size&author=&from=&to=)
|
| 6 |
+
[](https://coveralls.io/github/image-size/image-size?branch=master)
|
| 7 |
+
[](https://david-dm.org/image-size/image-size#info=devDependencies)
|
| 8 |
+
|
| 9 |
+
A [Node](https://nodejs.org/en/) module to get dimensions of any image file
|
| 10 |
+
|
| 11 |
+
## Supported formats
|
| 12 |
+
|
| 13 |
+
* BMP
|
| 14 |
+
* GIF
|
| 15 |
+
* JPEG
|
| 16 |
+
* PNG
|
| 17 |
+
* PSD
|
| 18 |
+
* TIFF
|
| 19 |
+
* WebP
|
| 20 |
+
* SVG
|
| 21 |
+
* DDS
|
| 22 |
+
|
| 23 |
+
### Upcoming
|
| 24 |
+
|
| 25 |
+
* SWF
|
| 26 |
+
|
| 27 |
+
## Programmatic Usage
|
| 28 |
+
|
| 29 |
+
```
|
| 30 |
+
npm install image-size --save
|
| 31 |
+
```
|
| 32 |
+
|
| 33 |
+
### Synchronous
|
| 34 |
+
|
| 35 |
+
```javascript
|
| 36 |
+
var sizeOf = require('image-size');
|
| 37 |
+
var dimensions = sizeOf('images/funny-cats.png');
|
| 38 |
+
console.log(dimensions.width, dimensions.height);
|
| 39 |
+
```
|
| 40 |
+
|
| 41 |
+
### Asynchronous
|
| 42 |
+
|
| 43 |
+
```javascript
|
| 44 |
+
var sizeOf = require('image-size');
|
| 45 |
+
sizeOf('images/funny-cats.png', function (err, dimensions) {
|
| 46 |
+
console.log(dimensions.width, dimensions.height);
|
| 47 |
+
});
|
| 48 |
+
```
|
| 49 |
+
NOTE: The asynchronous version doesn't work if the input is a Buffer. Use synchronous version instead.
|
| 50 |
+
|
| 51 |
+
### Using a URL
|
| 52 |
+
|
| 53 |
+
```javascript
|
| 54 |
+
var url = require('url');
|
| 55 |
+
var http = require('http');
|
| 56 |
+
|
| 57 |
+
var sizeOf = require('image-size');
|
| 58 |
+
|
| 59 |
+
var imgUrl = 'http://my-amazing-website.com/image.jpeg';
|
| 60 |
+
var options = url.parse(imgUrl);
|
| 61 |
+
|
| 62 |
+
http.get(options, function (response) {
|
| 63 |
+
var chunks = [];
|
| 64 |
+
response.on('data', function (chunk) {
|
| 65 |
+
chunks.push(chunk);
|
| 66 |
+
}).on('end', function() {
|
| 67 |
+
var buffer = Buffer.concat(chunks);
|
| 68 |
+
console.log(sizeOf(buffer));
|
| 69 |
+
});
|
| 70 |
+
});
|
| 71 |
+
```
|
| 72 |
+
|
| 73 |
+
You can optionally check the buffer lengths & stop downloading the image after a few kilobytes.
|
| 74 |
+
**You don't need to download the entire image**
|
| 75 |
+
|
| 76 |
+
## Command-Line Usage (CLI)
|
| 77 |
+
|
| 78 |
+
```
|
| 79 |
+
npm install image-size --global
|
| 80 |
+
image-size image1 [image2] [image3] ...
|
| 81 |
+
```
|
| 82 |
+
|
| 83 |
+
## Credits
|
| 84 |
+
|
| 85 |
+
not a direct port, but an attempt to have something like
|
| 86 |
+
[dabble's imagesize](https://github.com/dabble/imagesize/blob/master/lib/image_size.rb) as a node module.
|
| 87 |
+
|
| 88 |
+
## [Contributors](Contributors.md)
|
Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/image-size/bin/image-size.js
CHANGED
|
@@ -1,3 +1,36 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env node
|
| 2 |
+
'use strict';
|
| 3 |
+
|
| 4 |
+
var fs = require('fs');
|
| 5 |
+
var path = require('path');
|
| 6 |
+
|
| 7 |
+
var imageSize = require('..');
|
| 8 |
+
|
| 9 |
+
var files = process.argv.slice(2);
|
| 10 |
+
|
| 11 |
+
if (!files.length) {
|
| 12 |
+
console.error('Usage: image-size image1 [image2] [image3] ...');
|
| 13 |
+
process.exit(-1);
|
| 14 |
+
}
|
| 15 |
+
|
| 16 |
+
var red = ['\x1B[31m', '\x1B[39m'];
|
| 17 |
+
// var bold = ['\x1B[1m', '\x1B[22m'];
|
| 18 |
+
var grey = ['\x1B[90m', '\x1B[39m'];
|
| 19 |
+
var green = ['\x1B[32m', '\x1B[39m'];
|
| 20 |
+
|
| 21 |
+
files.forEach(function (image) {
|
| 22 |
+
try {
|
| 23 |
+
if (fs.existsSync(path.resolve(image))) {
|
| 24 |
+
var size = imageSize(image);
|
| 25 |
+
var label = green[0] + size.width + green[1] +
|
| 26 |
+
grey[0] + 'x' + grey[1] +
|
| 27 |
+
green[0] + size.height + green[1];
|
| 28 |
+
console.info(label, '-', grey[0] + image + grey[1]);
|
| 29 |
+
} else {
|
| 30 |
+
console.error('file doesn\'t exist - ', image);
|
| 31 |
+
}
|
| 32 |
+
} catch (e) {
|
| 33 |
+
// console.error(e.stack);
|
| 34 |
+
console.error(red[0] + e.message + red[1], '-', image);
|
| 35 |
+
}
|
| 36 |
+
});
|
Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/image-size/lib/detector.js
CHANGED
|
@@ -1,3 +1,19 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var typeMap = {};
|
| 4 |
+
var types = require('./types');
|
| 5 |
+
|
| 6 |
+
// load all available handlers
|
| 7 |
+
types.forEach(function (type) {
|
| 8 |
+
typeMap[type] = require('./types/' + type).detect;
|
| 9 |
+
});
|
| 10 |
+
|
| 11 |
+
module.exports = function (buffer, filepath) {
|
| 12 |
+
var type, result;
|
| 13 |
+
for (type in typeMap) {
|
| 14 |
+
result = typeMap[type](buffer, filepath);
|
| 15 |
+
if (result) {
|
| 16 |
+
return type;
|
| 17 |
+
}
|
| 18 |
+
}
|
| 19 |
+
};
|
Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/image-size/lib/index.js
CHANGED
|
@@ -1,3 +1,105 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var fs = require('fs');
|
| 4 |
+
var path = require('path');
|
| 5 |
+
|
| 6 |
+
var detector = require('./detector');
|
| 7 |
+
|
| 8 |
+
var handlers = {};
|
| 9 |
+
var types = require('./types');
|
| 10 |
+
|
| 11 |
+
// load all available handlers
|
| 12 |
+
types.forEach(function (type) {
|
| 13 |
+
handlers[type] = require('./types/' + type);
|
| 14 |
+
});
|
| 15 |
+
|
| 16 |
+
// Maximum buffer size, with a default of 128 kilobytes.
|
| 17 |
+
// TO-DO: make this adaptive based on the initial signature of the image
|
| 18 |
+
var MaxBufferSize = 128*1024;
|
| 19 |
+
|
| 20 |
+
function lookup (buffer, filepath) {
|
| 21 |
+
// detect the file type.. don't rely on the extension
|
| 22 |
+
var type = detector(buffer, filepath);
|
| 23 |
+
|
| 24 |
+
// find an appropriate handler for this file type
|
| 25 |
+
if (type in handlers) {
|
| 26 |
+
var size = handlers[type].calculate(buffer, filepath);
|
| 27 |
+
if (size !== false) {
|
| 28 |
+
size.type = type;
|
| 29 |
+
return size;
|
| 30 |
+
}
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
// throw up, if we don't understand the file
|
| 34 |
+
throw new TypeError('unsupported file type: ' + type + ' (file: ' + filepath + ')');
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
function asyncFileToBuffer (filepath, callback) {
|
| 38 |
+
// open the file in read only mode
|
| 39 |
+
fs.open(filepath, 'r', function (err, descriptor) {
|
| 40 |
+
if (err) { return callback(err); }
|
| 41 |
+
var size = fs.fstatSync(descriptor).size;
|
| 42 |
+
if (size <= 0){return callback(new Error("File size is not greater than 0 —— " + filepath)); }
|
| 43 |
+
var bufferSize = Math.min(size, MaxBufferSize);
|
| 44 |
+
var buffer = new Buffer(bufferSize);
|
| 45 |
+
// read first buffer block from the file, asynchronously
|
| 46 |
+
fs.read(descriptor, buffer, 0, bufferSize, 0, function (err) {
|
| 47 |
+
if (err) { return callback(err); }
|
| 48 |
+
// close the file, we are done
|
| 49 |
+
fs.close(descriptor, function (err) {
|
| 50 |
+
callback(err, buffer);
|
| 51 |
+
});
|
| 52 |
+
});
|
| 53 |
+
});
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
+
function syncFileToBuffer (filepath) {
|
| 57 |
+
// read from the file, synchronously
|
| 58 |
+
var descriptor = fs.openSync(filepath, 'r');
|
| 59 |
+
var size = fs.fstatSync(descriptor).size;
|
| 60 |
+
var bufferSize = Math.min(size, MaxBufferSize);
|
| 61 |
+
var buffer = new Buffer(bufferSize);
|
| 62 |
+
fs.readSync(descriptor, buffer, 0, bufferSize, 0);
|
| 63 |
+
fs.closeSync(descriptor);
|
| 64 |
+
return buffer;
|
| 65 |
+
}
|
| 66 |
+
|
| 67 |
+
/**
|
| 68 |
+
* @params input - buffer or relative/absolute path of the image file
|
| 69 |
+
* @params callback - optional function for async detection
|
| 70 |
+
*/
|
| 71 |
+
module.exports = function (input, callback) {
|
| 72 |
+
|
| 73 |
+
// Handle buffer input
|
| 74 |
+
if (Buffer.isBuffer(input)) {
|
| 75 |
+
return lookup(input);
|
| 76 |
+
}
|
| 77 |
+
|
| 78 |
+
// input should be a string at this point
|
| 79 |
+
if (typeof input !== 'string') {
|
| 80 |
+
throw new TypeError('invalid invocation');
|
| 81 |
+
}
|
| 82 |
+
|
| 83 |
+
// resolve the file path
|
| 84 |
+
var filepath = path.resolve(input);
|
| 85 |
+
|
| 86 |
+
if (typeof callback === 'function') {
|
| 87 |
+
asyncFileToBuffer(filepath, function (err, buffer) {
|
| 88 |
+
if (err) { return callback(err); }
|
| 89 |
+
|
| 90 |
+
// return the dimensions
|
| 91 |
+
var dimensions;
|
| 92 |
+
try {
|
| 93 |
+
dimensions = lookup(buffer, filepath);
|
| 94 |
+
} catch (e) {
|
| 95 |
+
err = e;
|
| 96 |
+
}
|
| 97 |
+
callback(err, dimensions);
|
| 98 |
+
});
|
| 99 |
+
} else {
|
| 100 |
+
var buffer = syncFileToBuffer(filepath);
|
| 101 |
+
return lookup(buffer, filepath);
|
| 102 |
+
}
|
| 103 |
+
};
|
| 104 |
+
|
| 105 |
+
module.exports.types = types;
|
Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/image-size/lib/readUInt.js
CHANGED
|
@@ -1,3 +1,11 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
// Abstract reading multi-byte unsigned integers
|
| 4 |
+
function readUInt (buffer, bits, offset, isBigEndian) {
|
| 5 |
+
offset = offset || 0;
|
| 6 |
+
var endian = !!isBigEndian ? 'BE' : 'LE';
|
| 7 |
+
var method = buffer['readUInt' + bits + endian];
|
| 8 |
+
return method.call(buffer, offset);
|
| 9 |
+
}
|
| 10 |
+
|
| 11 |
+
module.exports = readUInt;
|
Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/image-size/lib/types.js
CHANGED
|
@@ -1,3 +1,13 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
module.exports = [
|
| 4 |
+
'bmp',
|
| 5 |
+
'gif',
|
| 6 |
+
'jpg',
|
| 7 |
+
'png',
|
| 8 |
+
'psd',
|
| 9 |
+
'svg',
|
| 10 |
+
'tiff',
|
| 11 |
+
'webp',
|
| 12 |
+
'dds'
|
| 13 |
+
];
|
Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/image-size/lib/types/bmp.js
CHANGED
|
@@ -1,3 +1,17 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
function isBMP (buffer) {
|
| 4 |
+
return ('BM' === buffer.toString('ascii', 0, 2));
|
| 5 |
+
}
|
| 6 |
+
|
| 7 |
+
function calculate (buffer) {
|
| 8 |
+
return {
|
| 9 |
+
'width': buffer.readUInt32LE(18),
|
| 10 |
+
'height': Math.abs(buffer.readInt32LE(22))
|
| 11 |
+
};
|
| 12 |
+
}
|
| 13 |
+
|
| 14 |
+
module.exports = {
|
| 15 |
+
'detect': isBMP,
|
| 16 |
+
'calculate': calculate
|
| 17 |
+
};
|
Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/image-size/lib/types/dds.js
CHANGED
|
@@ -1,3 +1,18 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
function isDDS(buffer){
|
| 4 |
+
return buffer.readUInt32LE(0) === 0x20534444;
|
| 5 |
+
}
|
| 6 |
+
|
| 7 |
+
function calculate(buffer){
|
| 8 |
+
// read file resolution metadata
|
| 9 |
+
return {
|
| 10 |
+
'height': buffer.readUInt32LE(12),
|
| 11 |
+
'width': buffer.readUInt32LE(16)
|
| 12 |
+
};
|
| 13 |
+
}
|
| 14 |
+
|
| 15 |
+
module.exports = {
|
| 16 |
+
'detect': isDDS,
|
| 17 |
+
'calculate': calculate
|
| 18 |
+
};
|
Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/image-size/lib/types/gif.js
CHANGED
|
@@ -1,3 +1,19 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var gifRegexp = /^GIF8[79]a/;
|
| 4 |
+
function isGIF (buffer) {
|
| 5 |
+
var signature = buffer.toString('ascii', 0, 6);
|
| 6 |
+
return (gifRegexp.test(signature));
|
| 7 |
+
}
|
| 8 |
+
|
| 9 |
+
function calculate(buffer) {
|
| 10 |
+
return {
|
| 11 |
+
'width': buffer.readUInt16LE(6),
|
| 12 |
+
'height': buffer.readUInt16LE(8)
|
| 13 |
+
};
|
| 14 |
+
}
|
| 15 |
+
|
| 16 |
+
module.exports = {
|
| 17 |
+
'detect': isGIF,
|
| 18 |
+
'calculate': calculate
|
| 19 |
+
};
|
Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/image-size/lib/types/jpg.js
CHANGED
|
@@ -1,3 +1,62 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
// NOTE: we only support baseline and progressive JPGs here
|
| 4 |
+
// due to the structure of the loader class, we only get a buffer
|
| 5 |
+
// with a maximum size of 4096 bytes. so if the SOF marker is outside
|
| 6 |
+
// if this range we can't detect the file size correctly.
|
| 7 |
+
|
| 8 |
+
function isJPG (buffer) { //, filepath
|
| 9 |
+
var SOIMarker = buffer.toString('hex', 0, 2);
|
| 10 |
+
return ('ffd8' === SOIMarker);
|
| 11 |
+
}
|
| 12 |
+
|
| 13 |
+
function extractSize (buffer, i) {
|
| 14 |
+
return {
|
| 15 |
+
'height' : buffer.readUInt16BE(i),
|
| 16 |
+
'width' : buffer.readUInt16BE(i + 2)
|
| 17 |
+
};
|
| 18 |
+
}
|
| 19 |
+
|
| 20 |
+
function validateBuffer (buffer, i) {
|
| 21 |
+
// index should be within buffer limits
|
| 22 |
+
if (i > buffer.length) {
|
| 23 |
+
throw new TypeError('Corrupt JPG, exceeded buffer limits');
|
| 24 |
+
}
|
| 25 |
+
// Every JPEG block must begin with a 0xFF
|
| 26 |
+
if (buffer[i] !== 0xFF) {
|
| 27 |
+
throw new TypeError('Invalid JPG, marker table corrupted');
|
| 28 |
+
}
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
function calculate (buffer) {
|
| 32 |
+
|
| 33 |
+
// Skip 4 chars, they are for signature
|
| 34 |
+
buffer = buffer.slice(4);
|
| 35 |
+
|
| 36 |
+
var i, next;
|
| 37 |
+
while (buffer.length) {
|
| 38 |
+
// read length of the next block
|
| 39 |
+
i = buffer.readUInt16BE(0);
|
| 40 |
+
|
| 41 |
+
// ensure correct format
|
| 42 |
+
validateBuffer(buffer, i);
|
| 43 |
+
|
| 44 |
+
// 0xFFC0 is baseline standard(SOF)
|
| 45 |
+
// 0xFFC1 is baseline optimized(SOF)
|
| 46 |
+
// 0xFFC2 is progressive(SOF2)
|
| 47 |
+
next = buffer[i + 1];
|
| 48 |
+
if (next === 0xC0 || next === 0xC1 || next === 0xC2) {
|
| 49 |
+
return extractSize(buffer, i + 5);
|
| 50 |
+
}
|
| 51 |
+
|
| 52 |
+
// move to the next block
|
| 53 |
+
buffer = buffer.slice(i + 2);
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
+
throw new TypeError('Invalid JPG, no size found');
|
| 57 |
+
}
|
| 58 |
+
|
| 59 |
+
module.exports = {
|
| 60 |
+
'detect': isJPG,
|
| 61 |
+
'calculate': calculate
|
| 62 |
+
};
|
Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/image-size/lib/types/png.js
CHANGED
|
@@ -1,3 +1,36 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var pngSignature = 'PNG\r\n\x1a\n';
|
| 4 |
+
var pngImageHeaderChunkName = 'IHDR';
|
| 5 |
+
var pngFriedChunkName = 'CgBI'; // Used to detect "fried" png's: http://www.jongware.com/pngdefry.html
|
| 6 |
+
|
| 7 |
+
function isPNG (buffer) {
|
| 8 |
+
if (pngSignature === buffer.toString('ascii', 1, 8)) {
|
| 9 |
+
var chunkName = buffer.toString('ascii', 12, 16);
|
| 10 |
+
if (chunkName === pngFriedChunkName) {
|
| 11 |
+
chunkName = buffer.toString('ascii', 28, 32);
|
| 12 |
+
}
|
| 13 |
+
if (chunkName !== pngImageHeaderChunkName) {
|
| 14 |
+
throw new TypeError('invalid png');
|
| 15 |
+
}
|
| 16 |
+
return true;
|
| 17 |
+
}
|
| 18 |
+
}
|
| 19 |
+
|
| 20 |
+
function calculate (buffer) {
|
| 21 |
+
if (buffer.toString('ascii', 12, 16) === pngFriedChunkName) {
|
| 22 |
+
return {
|
| 23 |
+
'width': buffer.readUInt32BE(32),
|
| 24 |
+
'height': buffer.readUInt32BE(36)
|
| 25 |
+
};
|
| 26 |
+
}
|
| 27 |
+
return {
|
| 28 |
+
'width': buffer.readUInt32BE(16),
|
| 29 |
+
'height': buffer.readUInt32BE(20)
|
| 30 |
+
};
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
module.exports = {
|
| 34 |
+
'detect': isPNG,
|
| 35 |
+
'calculate': calculate
|
| 36 |
+
};
|
Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/image-size/lib/types/psd.js
CHANGED
|
@@ -1,3 +1,17 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
function isPSD (buffer) {
|
| 4 |
+
return ('8BPS' === buffer.toString('ascii', 0, 4));
|
| 5 |
+
}
|
| 6 |
+
|
| 7 |
+
function calculate (buffer) {
|
| 8 |
+
return {
|
| 9 |
+
'width': buffer.readUInt32BE(18),
|
| 10 |
+
'height': buffer.readUInt32BE(14)
|
| 11 |
+
};
|
| 12 |
+
}
|
| 13 |
+
|
| 14 |
+
module.exports = {
|
| 15 |
+
'detect': isPSD,
|
| 16 |
+
'calculate': calculate
|
| 17 |
+
};
|
Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/image-size/lib/types/svg.js
CHANGED
|
@@ -1,3 +1,78 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var svgReg = /<svg[^>]+[^>]*>/;
|
| 4 |
+
function isSVG (buffer) {
|
| 5 |
+
return svgReg.test(buffer);
|
| 6 |
+
}
|
| 7 |
+
|
| 8 |
+
var extractorRegExps = {
|
| 9 |
+
'root': /<svg\s[^>]+>/,
|
| 10 |
+
'width': /\bwidth=(['"])([^%]+?)\1/,
|
| 11 |
+
'height': /\bheight=(['"])([^%]+?)\1/,
|
| 12 |
+
'viewbox': /\bviewBox=(['"])(.+?)\1/
|
| 13 |
+
};
|
| 14 |
+
|
| 15 |
+
function parseViewbox (viewbox) {
|
| 16 |
+
var bounds = viewbox.split(' ');
|
| 17 |
+
return {
|
| 18 |
+
'width': parseInt(bounds[2], 10),
|
| 19 |
+
'height': parseInt(bounds[3], 10)
|
| 20 |
+
};
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
function parseAttributes (root) {
|
| 24 |
+
var width = root.match(extractorRegExps.width);
|
| 25 |
+
var height = root.match(extractorRegExps.height);
|
| 26 |
+
var viewbox = root.match(extractorRegExps.viewbox);
|
| 27 |
+
return {
|
| 28 |
+
'width': width && parseInt(width[2], 10),
|
| 29 |
+
'height': height && parseInt(height[2], 10),
|
| 30 |
+
'viewbox': viewbox && parseViewbox(viewbox[2])
|
| 31 |
+
};
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
function calculateByDimensions (attrs) {
|
| 35 |
+
return {
|
| 36 |
+
'width': attrs.width,
|
| 37 |
+
'height': attrs.height
|
| 38 |
+
};
|
| 39 |
+
}
|
| 40 |
+
|
| 41 |
+
function calculateByViewbox (attrs) {
|
| 42 |
+
var ratio = attrs.viewbox.width / attrs.viewbox.height;
|
| 43 |
+
if (attrs.width) {
|
| 44 |
+
return {
|
| 45 |
+
'width': attrs.width,
|
| 46 |
+
'height': Math.floor(attrs.width / ratio)
|
| 47 |
+
};
|
| 48 |
+
}
|
| 49 |
+
if (attrs.height) {
|
| 50 |
+
return {
|
| 51 |
+
'width': Math.floor(attrs.height * ratio),
|
| 52 |
+
'height': attrs.height
|
| 53 |
+
};
|
| 54 |
+
}
|
| 55 |
+
return {
|
| 56 |
+
'width': attrs.viewbox.width,
|
| 57 |
+
'height': attrs.viewbox.height
|
| 58 |
+
};
|
| 59 |
+
}
|
| 60 |
+
|
| 61 |
+
function calculate (buffer) {
|
| 62 |
+
var root = buffer.toString('utf8').match(extractorRegExps.root);
|
| 63 |
+
if (root) {
|
| 64 |
+
var attrs = parseAttributes(root[0]);
|
| 65 |
+
if (attrs.width && attrs.height) {
|
| 66 |
+
return calculateByDimensions(attrs);
|
| 67 |
+
}
|
| 68 |
+
if (attrs.viewbox) {
|
| 69 |
+
return calculateByViewbox(attrs);
|
| 70 |
+
}
|
| 71 |
+
}
|
| 72 |
+
throw new TypeError('invalid svg');
|
| 73 |
+
}
|
| 74 |
+
|
| 75 |
+
module.exports = {
|
| 76 |
+
'detect': isSVG,
|
| 77 |
+
'calculate': calculate
|
| 78 |
+
};
|
Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/image-size/lib/types/tiff.js
CHANGED
|
@@ -1,3 +1,118 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
// based on http://www.compix.com/fileformattif.htm
|
| 4 |
+
// TO-DO: support big-endian as well
|
| 5 |
+
|
| 6 |
+
var fs = require('fs');
|
| 7 |
+
var readUInt = require('../readUInt');
|
| 8 |
+
|
| 9 |
+
function isTIFF (buffer) {
|
| 10 |
+
var hex4 = buffer.toString('hex', 0, 4);
|
| 11 |
+
return ('49492a00' === hex4 || '4d4d002a' === hex4);
|
| 12 |
+
}
|
| 13 |
+
|
| 14 |
+
// Read IFD (image-file-directory) into a buffer
|
| 15 |
+
function readIFD (buffer, filepath, isBigEndian) {
|
| 16 |
+
|
| 17 |
+
var ifdOffset = readUInt(buffer, 32, 4, isBigEndian);
|
| 18 |
+
|
| 19 |
+
// read only till the end of the file
|
| 20 |
+
var bufferSize = 1024;
|
| 21 |
+
var fileSize = fs.statSync(filepath).size;
|
| 22 |
+
if (ifdOffset + bufferSize > fileSize) {
|
| 23 |
+
bufferSize = fileSize - ifdOffset - 10;
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
// populate the buffer
|
| 27 |
+
var endBuffer = new Buffer(bufferSize);
|
| 28 |
+
var descriptor = fs.openSync(filepath, 'r');
|
| 29 |
+
fs.readSync(descriptor, endBuffer, 0, bufferSize, ifdOffset);
|
| 30 |
+
|
| 31 |
+
// var ifdLength = readUInt(endBuffer, 16, 0, isBigEndian);
|
| 32 |
+
var ifdBuffer = endBuffer.slice(2); //, 2 + 12 * ifdLength);
|
| 33 |
+
return ifdBuffer;
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
// TIFF values seem to be messed up on Big-Endian, this helps
|
| 37 |
+
function readValue (buffer, isBigEndian) {
|
| 38 |
+
var low = readUInt(buffer, 16, 8, isBigEndian);
|
| 39 |
+
var high = readUInt(buffer, 16, 10, isBigEndian);
|
| 40 |
+
return (high << 16) + low;
|
| 41 |
+
}
|
| 42 |
+
|
| 43 |
+
// move to the next tag
|
| 44 |
+
function nextTag (buffer) {
|
| 45 |
+
if (buffer.length > 24) {
|
| 46 |
+
return buffer.slice(12);
|
| 47 |
+
}
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
// Extract IFD tags from TIFF metadata
|
| 51 |
+
function extractTags (buffer, isBigEndian) {
|
| 52 |
+
var tags = {};
|
| 53 |
+
var code, type, length;
|
| 54 |
+
|
| 55 |
+
while (buffer && buffer.length) {
|
| 56 |
+
code = readUInt(buffer, 16, 0, isBigEndian);
|
| 57 |
+
type = readUInt(buffer, 16, 2, isBigEndian);
|
| 58 |
+
length = readUInt(buffer, 32, 4, isBigEndian);
|
| 59 |
+
|
| 60 |
+
// 0 means end of IFD
|
| 61 |
+
if (code === 0) {
|
| 62 |
+
break;
|
| 63 |
+
} else {
|
| 64 |
+
// 256 is width, 257 is height
|
| 65 |
+
// if (code === 256 || code === 257) {
|
| 66 |
+
if (length === 1 && (type === 3 || type === 4)) {
|
| 67 |
+
tags[code] = readValue(buffer, isBigEndian);
|
| 68 |
+
}
|
| 69 |
+
|
| 70 |
+
// move to the next tag
|
| 71 |
+
buffer = nextTag(buffer);
|
| 72 |
+
}
|
| 73 |
+
}
|
| 74 |
+
return tags;
|
| 75 |
+
}
|
| 76 |
+
|
| 77 |
+
// Test if the TIFF is Big Endian or Little Endian
|
| 78 |
+
function determineEndianness (buffer) {
|
| 79 |
+
var signature = buffer.toString('ascii', 0, 2);
|
| 80 |
+
if ('II' === signature) {
|
| 81 |
+
return 'LE';
|
| 82 |
+
} else if ('MM' === signature) {
|
| 83 |
+
return 'BE';
|
| 84 |
+
}
|
| 85 |
+
}
|
| 86 |
+
|
| 87 |
+
function calculate (buffer, filepath) {
|
| 88 |
+
|
| 89 |
+
if (!filepath) {
|
| 90 |
+
throw new TypeError('Tiff doesn\'t support buffer');
|
| 91 |
+
}
|
| 92 |
+
|
| 93 |
+
// Determine BE/LE
|
| 94 |
+
var isBigEndian = determineEndianness(buffer) === 'BE';
|
| 95 |
+
|
| 96 |
+
// read the IFD
|
| 97 |
+
var ifdBuffer = readIFD(buffer, filepath, isBigEndian);
|
| 98 |
+
|
| 99 |
+
// extract the tags from the IFD
|
| 100 |
+
var tags = extractTags(ifdBuffer, isBigEndian);
|
| 101 |
+
|
| 102 |
+
var width = tags[256];
|
| 103 |
+
var height = tags[257];
|
| 104 |
+
|
| 105 |
+
if (!width || !height) {
|
| 106 |
+
throw new TypeError('Invalid Tiff, missing tags');
|
| 107 |
+
}
|
| 108 |
+
|
| 109 |
+
return {
|
| 110 |
+
'width': width,
|
| 111 |
+
'height': height
|
| 112 |
+
};
|
| 113 |
+
}
|
| 114 |
+
|
| 115 |
+
module.exports = {
|
| 116 |
+
'detect': isTIFF,
|
| 117 |
+
'calculate': calculate
|
| 118 |
+
};
|
Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/image-size/lib/types/webp.js
CHANGED
|
@@ -1,3 +1,69 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
// based on https://developers.google.com/speed/webp/docs/riff_container
|
| 4 |
+
|
| 5 |
+
function isWebP (buffer) {
|
| 6 |
+
var riffHeader = 'RIFF' === buffer.toString('ascii', 0, 4);
|
| 7 |
+
var webpHeader = 'WEBP' === buffer.toString('ascii', 8, 12);
|
| 8 |
+
var vp8Header = 'VP8' === buffer.toString('ascii', 12, 15);
|
| 9 |
+
return (riffHeader && webpHeader && vp8Header);
|
| 10 |
+
}
|
| 11 |
+
|
| 12 |
+
function calculate (buffer) {
|
| 13 |
+
var chunkHeader = buffer.toString('ascii', 12, 16);
|
| 14 |
+
buffer = buffer.slice(20, 30);
|
| 15 |
+
|
| 16 |
+
// Extended webp stream signature
|
| 17 |
+
if (chunkHeader === 'VP8X') {
|
| 18 |
+
var extendedHeader = buffer[0];
|
| 19 |
+
var validStart = (extendedHeader & 0xc0) === 0;
|
| 20 |
+
var validEnd = (extendedHeader & 0x01) === 0;
|
| 21 |
+
if (validStart && validEnd) {
|
| 22 |
+
return calculateExtended(buffer);
|
| 23 |
+
} else {
|
| 24 |
+
return false;
|
| 25 |
+
}
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
// Lossless webp stream signature
|
| 29 |
+
if (chunkHeader === 'VP8 ' && buffer[0] !== 0x2f) {
|
| 30 |
+
return calculateLossy(buffer);
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
// Lossy webp stream signature
|
| 34 |
+
var signature = buffer.toString('hex', 3, 6);
|
| 35 |
+
if (chunkHeader === 'VP8L' && signature !== '9d012a') {
|
| 36 |
+
return calculateLossless(buffer);
|
| 37 |
+
}
|
| 38 |
+
|
| 39 |
+
return false;
|
| 40 |
+
}
|
| 41 |
+
|
| 42 |
+
function calculateExtended (buffer) {
|
| 43 |
+
return {
|
| 44 |
+
'width': 1 + buffer.readUIntLE(4, 3),
|
| 45 |
+
'height': 1 + buffer.readUIntLE(7, 3)
|
| 46 |
+
}
|
| 47 |
+
}
|
| 48 |
+
|
| 49 |
+
function calculateLossless (buffer) {
|
| 50 |
+
return {
|
| 51 |
+
'width': 1 + (((buffer[2] & 0x3F) << 8) | buffer[1]),
|
| 52 |
+
'height': 1 + (((buffer[4] & 0xF) << 10) | (buffer[3] << 2) |
|
| 53 |
+
((buffer[2] & 0xC0) >> 6))
|
| 54 |
+
};
|
| 55 |
+
}
|
| 56 |
+
|
| 57 |
+
function calculateLossy (buffer) {
|
| 58 |
+
// `& 0x3fff` returns the last 14 bits
|
| 59 |
+
// TO-DO: include webp scaling in the calculations
|
| 60 |
+
return {
|
| 61 |
+
'width': buffer.readInt16LE(6) & 0x3fff,
|
| 62 |
+
'height': buffer.readInt16LE(8) & 0x3fff
|
| 63 |
+
};
|
| 64 |
+
}
|
| 65 |
+
|
| 66 |
+
module.exports = {
|
| 67 |
+
'detect': isWebP,
|
| 68 |
+
'calculate': calculate
|
| 69 |
+
};
|
Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/image-size/package.json
CHANGED
|
@@ -1,3 +1,49 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "image-size",
|
| 3 |
+
"version": "0.5.5",
|
| 4 |
+
"description": "get dimensions of any image file",
|
| 5 |
+
"main": "lib/index.js",
|
| 6 |
+
"files": [
|
| 7 |
+
"bin",
|
| 8 |
+
"lib"
|
| 9 |
+
],
|
| 10 |
+
"engines": {
|
| 11 |
+
"node": ">=0.10.0"
|
| 12 |
+
},
|
| 13 |
+
"bin": {
|
| 14 |
+
"image-size": "bin/image-size.js"
|
| 15 |
+
},
|
| 16 |
+
"scripts": {
|
| 17 |
+
"pretest": "jshint",
|
| 18 |
+
"test": "mocha specs",
|
| 19 |
+
"coverage": "istanbul cover _mocha specs"
|
| 20 |
+
},
|
| 21 |
+
"repository": "image-size/image-size",
|
| 22 |
+
"keywords": [
|
| 23 |
+
"image",
|
| 24 |
+
"size",
|
| 25 |
+
"dimensions",
|
| 26 |
+
"resolution",
|
| 27 |
+
"width",
|
| 28 |
+
"height",
|
| 29 |
+
"png",
|
| 30 |
+
"jpeg",
|
| 31 |
+
"bmp",
|
| 32 |
+
"gif",
|
| 33 |
+
"psd",
|
| 34 |
+
"tiff",
|
| 35 |
+
"webp",
|
| 36 |
+
"svg"
|
| 37 |
+
],
|
| 38 |
+
"author": "netroy <aditya@netroy.in> (http://netroy.in/)",
|
| 39 |
+
"license": "MIT",
|
| 40 |
+
"devDependencies": {
|
| 41 |
+
"escomplex-js": "^1.2.0",
|
| 42 |
+
"expect.js": "^0.3.1",
|
| 43 |
+
"glob": "^7.1.1",
|
| 44 |
+
"istanbul": "^1.1.0-alpha.1",
|
| 45 |
+
"jshint": "^2.9.4",
|
| 46 |
+
"mocha": "^3.4.1",
|
| 47 |
+
"sinon": "^2.2.0"
|
| 48 |
+
}
|
| 49 |
+
}
|
Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/immutable/LICENSE
CHANGED
|
@@ -1,3 +1,21 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MIT License
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2014-present, Lee Byron and other contributors.
|
| 4 |
+
|
| 5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 6 |
+
of this software and associated documentation files (the "Software"), to deal
|
| 7 |
+
in the Software without restriction, including without limitation the rights
|
| 8 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 9 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 10 |
+
furnished to do so, subject to the following conditions:
|
| 11 |
+
|
| 12 |
+
The above copyright notice and this permission notice shall be included in all
|
| 13 |
+
copies or substantial portions of the Software.
|
| 14 |
+
|
| 15 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 16 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 17 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 18 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 19 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 20 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
| 21 |
+
SOFTWARE.
|
Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/immutable/README.md
CHANGED
|
@@ -1,3 +1,761 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Immutable collections for JavaScript
|
| 2 |
+
|
| 3 |
+
[](https://github.com/immutable-js/immutable-js/actions/workflows/ci.yml?query=branch%3Amain) [Chat on slack](https://immutable-js.slack.com)
|
| 4 |
+
|
| 5 |
+
[Read the docs](https://immutable-js.com/docs/) and eat your vegetables.
|
| 6 |
+
|
| 7 |
+
Docs are automatically generated from [README.md][] and [immutable.d.ts][].
|
| 8 |
+
Please contribute! Also, don't miss the [wiki][] which contains articles on
|
| 9 |
+
additional specific topics. Can't find something? Open an [issue][].
|
| 10 |
+
|
| 11 |
+
**Table of contents:**
|
| 12 |
+
|
| 13 |
+
- [Introduction](#introduction)
|
| 14 |
+
- [Getting started](#getting-started)
|
| 15 |
+
- [The case for Immutability](#the-case-for-immutability)
|
| 16 |
+
- [JavaScript-first API](#javascript-first-api)
|
| 17 |
+
- [Nested Structures](#nested-structures)
|
| 18 |
+
- [Equality treats Collections as Values](#equality-treats-collections-as-values)
|
| 19 |
+
- [Batching Mutations](#batching-mutations)
|
| 20 |
+
- [Lazy Seq](#lazy-seq)
|
| 21 |
+
- [Additional Tools and Resources](#additional-tools-and-resources)
|
| 22 |
+
- [Contributing](#contributing)
|
| 23 |
+
|
| 24 |
+
## Introduction
|
| 25 |
+
|
| 26 |
+
[Immutable][] data cannot be changed once created, leading to much simpler
|
| 27 |
+
application development, no defensive copying, and enabling advanced memoization
|
| 28 |
+
and change detection techniques with simple logic. [Persistent][] data presents
|
| 29 |
+
a mutative API which does not update the data in-place, but instead always
|
| 30 |
+
yields new updated data.
|
| 31 |
+
|
| 32 |
+
Immutable.js provides many Persistent Immutable data structures including:
|
| 33 |
+
`List`, `Stack`, `Map`, `OrderedMap`, `Set`, `OrderedSet` and `Record`.
|
| 34 |
+
|
| 35 |
+
These data structures are highly efficient on modern JavaScript VMs by using
|
| 36 |
+
structural sharing via [hash maps tries][] and [vector tries][] as popularized
|
| 37 |
+
by Clojure and Scala, minimizing the need to copy or cache data.
|
| 38 |
+
|
| 39 |
+
Immutable.js also provides a lazy `Seq`, allowing efficient
|
| 40 |
+
chaining of collection methods like `map` and `filter` without creating
|
| 41 |
+
intermediate representations. Create some `Seq` with `Range` and `Repeat`.
|
| 42 |
+
|
| 43 |
+
Want to hear more? Watch the presentation about Immutable.js:
|
| 44 |
+
|
| 45 |
+
[](https://youtu.be/I7IdS-PbEgI)
|
| 46 |
+
|
| 47 |
+
[README.md]: https://github.com/immutable-js/immutable-js/blob/main/README.md
|
| 48 |
+
[immutable.d.ts]: https://github.com/immutable-js/immutable-js/blob/main/type-definitions/immutable.d.ts
|
| 49 |
+
[wiki]: https://github.com/immutable-js/immutable-js/wiki
|
| 50 |
+
[issue]: https://github.com/immutable-js/immutable-js/issues
|
| 51 |
+
[Persistent]: https://en.wikipedia.org/wiki/Persistent_data_structure
|
| 52 |
+
[Immutable]: https://en.wikipedia.org/wiki/Immutable_object
|
| 53 |
+
[hash maps tries]: https://en.wikipedia.org/wiki/Hash_array_mapped_trie
|
| 54 |
+
[vector tries]: https://hypirion.com/musings/understanding-persistent-vector-pt-1
|
| 55 |
+
|
| 56 |
+
## Getting started
|
| 57 |
+
|
| 58 |
+
Install `immutable` using npm.
|
| 59 |
+
|
| 60 |
+
```shell
|
| 61 |
+
# using npm
|
| 62 |
+
npm install immutable
|
| 63 |
+
|
| 64 |
+
# using Yarn
|
| 65 |
+
yarn add immutable
|
| 66 |
+
|
| 67 |
+
# using pnpm
|
| 68 |
+
pnpm add immutable
|
| 69 |
+
|
| 70 |
+
# using Bun
|
| 71 |
+
bun add immutable
|
| 72 |
+
```
|
| 73 |
+
|
| 74 |
+
Then require it into any module.
|
| 75 |
+
|
| 76 |
+
<!-- runkit:activate -->
|
| 77 |
+
|
| 78 |
+
```js
|
| 79 |
+
const { Map } = require('immutable');
|
| 80 |
+
const map1 = Map({ a: 1, b: 2, c: 3 });
|
| 81 |
+
const map2 = map1.set('b', 50);
|
| 82 |
+
map1.get('b') + ' vs. ' + map2.get('b'); // 2 vs. 50
|
| 83 |
+
```
|
| 84 |
+
|
| 85 |
+
### Browser
|
| 86 |
+
|
| 87 |
+
Immutable.js has no dependencies, which makes it predictable to include in a Browser.
|
| 88 |
+
|
| 89 |
+
It's highly recommended to use a module bundler like [webpack](https://webpack.github.io/),
|
| 90 |
+
[rollup](https://rollupjs.org/), or
|
| 91 |
+
[browserify](https://browserify.org/). The `immutable` npm module works
|
| 92 |
+
without any additional consideration. All examples throughout the documentation
|
| 93 |
+
will assume use of this kind of tool.
|
| 94 |
+
|
| 95 |
+
Alternatively, Immutable.js may be directly included as a script tag. Download
|
| 96 |
+
or link to a CDN such as [CDNJS](https://cdnjs.com/libraries/immutable)
|
| 97 |
+
or [jsDelivr](https://www.jsdelivr.com/package/npm/immutable).
|
| 98 |
+
|
| 99 |
+
Use a script tag to directly add `Immutable` to the global scope:
|
| 100 |
+
|
| 101 |
+
```html
|
| 102 |
+
<script src="immutable.min.js"></script>
|
| 103 |
+
<script>
|
| 104 |
+
var map1 = Immutable.Map({ a: 1, b: 2, c: 3 });
|
| 105 |
+
var map2 = map1.set('b', 50);
|
| 106 |
+
map1.get('b'); // 2
|
| 107 |
+
map2.get('b'); // 50
|
| 108 |
+
</script>
|
| 109 |
+
```
|
| 110 |
+
|
| 111 |
+
Or use an AMD-style loader (such as [RequireJS](https://requirejs.org/)):
|
| 112 |
+
|
| 113 |
+
```js
|
| 114 |
+
require(['./immutable.min.js'], function (Immutable) {
|
| 115 |
+
var map1 = Immutable.Map({ a: 1, b: 2, c: 3 });
|
| 116 |
+
var map2 = map1.set('b', 50);
|
| 117 |
+
map1.get('b'); // 2
|
| 118 |
+
map2.get('b'); // 50
|
| 119 |
+
});
|
| 120 |
+
```
|
| 121 |
+
|
| 122 |
+
### Flow & TypeScript
|
| 123 |
+
|
| 124 |
+
Use these Immutable collections and sequences as you would use native
|
| 125 |
+
collections in your [Flowtype](https://flowtype.org/) or [TypeScript](https://typescriptlang.org) programs while still taking
|
| 126 |
+
advantage of type generics, error detection, and auto-complete in your IDE.
|
| 127 |
+
|
| 128 |
+
Installing `immutable` via npm brings with it type definitions for Flow (v0.55.0 or higher)
|
| 129 |
+
and TypeScript (v2.1.0 or higher), so you shouldn't need to do anything at all!
|
| 130 |
+
|
| 131 |
+
#### Using TypeScript with Immutable.js v4
|
| 132 |
+
|
| 133 |
+
Immutable.js type definitions embrace ES2015. While Immutable.js itself supports
|
| 134 |
+
legacy browsers and environments, its type definitions require TypeScript's 2015
|
| 135 |
+
lib. Include either `"target": "es2015"` or `"lib": "es2015"` in your
|
| 136 |
+
`tsconfig.json`, or provide `--target es2015` or `--lib es2015` to the
|
| 137 |
+
`tsc` command.
|
| 138 |
+
|
| 139 |
+
<!-- runkit:activate -->
|
| 140 |
+
|
| 141 |
+
```js
|
| 142 |
+
const { Map } = require('immutable');
|
| 143 |
+
const map1 = Map({ a: 1, b: 2, c: 3 });
|
| 144 |
+
const map2 = map1.set('b', 50);
|
| 145 |
+
map1.get('b') + ' vs. ' + map2.get('b'); // 2 vs. 50
|
| 146 |
+
```
|
| 147 |
+
|
| 148 |
+
#### Using TypeScript with Immutable.js v3 and earlier:
|
| 149 |
+
|
| 150 |
+
Previous versions of Immutable.js include a reference file which you can include
|
| 151 |
+
via relative path to the type definitions at the top of your file.
|
| 152 |
+
|
| 153 |
+
```js
|
| 154 |
+
///<reference path='./node_modules/immutable/dist/immutable.d.ts'/>
|
| 155 |
+
import Immutable from 'immutable';
|
| 156 |
+
var map1: Immutable.Map<string, number>;
|
| 157 |
+
map1 = Immutable.Map({ a: 1, b: 2, c: 3 });
|
| 158 |
+
var map2 = map1.set('b', 50);
|
| 159 |
+
map1.get('b'); // 2
|
| 160 |
+
map2.get('b'); // 50
|
| 161 |
+
```
|
| 162 |
+
|
| 163 |
+
## The case for Immutability
|
| 164 |
+
|
| 165 |
+
Much of what makes application development difficult is tracking mutation and
|
| 166 |
+
maintaining state. Developing with immutable data encourages you to think
|
| 167 |
+
differently about how data flows through your application.
|
| 168 |
+
|
| 169 |
+
Subscribing to data events throughout your application creates a huge overhead of
|
| 170 |
+
book-keeping which can hurt performance, sometimes dramatically, and creates
|
| 171 |
+
opportunities for areas of your application to get out of sync with each other
|
| 172 |
+
due to easy to make programmer error. Since immutable data never changes,
|
| 173 |
+
subscribing to changes throughout the model is a dead-end and new data can only
|
| 174 |
+
ever be passed from above.
|
| 175 |
+
|
| 176 |
+
This model of data flow aligns well with the architecture of [React][]
|
| 177 |
+
and especially well with an application designed using the ideas of [Flux][].
|
| 178 |
+
|
| 179 |
+
When data is passed from above rather than being subscribed to, and you're only
|
| 180 |
+
interested in doing work when something has changed, you can use equality.
|
| 181 |
+
|
| 182 |
+
Immutable collections should be treated as _values_ rather than _objects_. While
|
| 183 |
+
objects represent some thing which could change over time, a value represents
|
| 184 |
+
the state of that thing at a particular instance of time. This principle is most
|
| 185 |
+
important to understanding the appropriate use of immutable data. In order to
|
| 186 |
+
treat Immutable.js collections as values, it's important to use the
|
| 187 |
+
`Immutable.is()` function or `.equals()` method to determine _value equality_
|
| 188 |
+
instead of the `===` operator which determines object _reference identity_.
|
| 189 |
+
|
| 190 |
+
<!-- runkit:activate -->
|
| 191 |
+
|
| 192 |
+
```js
|
| 193 |
+
const { Map } = require('immutable');
|
| 194 |
+
const map1 = Map({ a: 1, b: 2, c: 3 });
|
| 195 |
+
const map2 = Map({ a: 1, b: 2, c: 3 });
|
| 196 |
+
map1.equals(map2); // true
|
| 197 |
+
map1 === map2; // false
|
| 198 |
+
```
|
| 199 |
+
|
| 200 |
+
Note: As a performance optimization Immutable.js attempts to return the existing
|
| 201 |
+
collection when an operation would result in an identical collection, allowing
|
| 202 |
+
for using `===` reference equality to determine if something definitely has not
|
| 203 |
+
changed. This can be extremely useful when used within a memoization function
|
| 204 |
+
which would prefer to re-run the function if a deeper equality check could
|
| 205 |
+
potentially be more costly. The `===` equality check is also used internally by
|
| 206 |
+
`Immutable.is` and `.equals()` as a performance optimization.
|
| 207 |
+
|
| 208 |
+
<!-- runkit:activate -->
|
| 209 |
+
|
| 210 |
+
```js
|
| 211 |
+
const { Map } = require('immutable');
|
| 212 |
+
const map1 = Map({ a: 1, b: 2, c: 3 });
|
| 213 |
+
const map2 = map1.set('b', 2); // Set to same value
|
| 214 |
+
map1 === map2; // true
|
| 215 |
+
```
|
| 216 |
+
|
| 217 |
+
If an object is immutable, it can be "copied" simply by making another reference
|
| 218 |
+
to it instead of copying the entire object. Because a reference is much smaller
|
| 219 |
+
than the object itself, this results in memory savings and a potential boost in
|
| 220 |
+
execution speed for programs which rely on copies (such as an undo-stack).
|
| 221 |
+
|
| 222 |
+
<!-- runkit:activate -->
|
| 223 |
+
|
| 224 |
+
```js
|
| 225 |
+
const { Map } = require('immutable');
|
| 226 |
+
const map = Map({ a: 1, b: 2, c: 3 });
|
| 227 |
+
const mapCopy = map; // Look, "copies" are free!
|
| 228 |
+
```
|
| 229 |
+
|
| 230 |
+
[React]: https://reactjs.org/
|
| 231 |
+
[Flux]: https://facebook.github.io/flux/docs/in-depth-overview/
|
| 232 |
+
|
| 233 |
+
|
| 234 |
+
## JavaScript-first API
|
| 235 |
+
|
| 236 |
+
While Immutable.js is inspired by Clojure, Scala, Haskell and other functional
|
| 237 |
+
programming environments, it's designed to bring these powerful concepts to
|
| 238 |
+
JavaScript, and therefore has an Object-Oriented API that closely mirrors that
|
| 239 |
+
of [ES2015][] [Array][], [Map][], and [Set][].
|
| 240 |
+
|
| 241 |
+
[es2015]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/New_in_JavaScript/ECMAScript_6_support_in_Mozilla
|
| 242 |
+
[array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array
|
| 243 |
+
[map]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map
|
| 244 |
+
[set]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set
|
| 245 |
+
|
| 246 |
+
The difference for the immutable collections is that methods which would mutate
|
| 247 |
+
the collection, like `push`, `set`, `unshift` or `splice`, instead return a new
|
| 248 |
+
immutable collection. Methods which return new arrays, like `slice` or `concat`,
|
| 249 |
+
instead return new immutable collections.
|
| 250 |
+
|
| 251 |
+
<!-- runkit:activate -->
|
| 252 |
+
|
| 253 |
+
```js
|
| 254 |
+
const { List } = require('immutable');
|
| 255 |
+
const list1 = List([1, 2]);
|
| 256 |
+
const list2 = list1.push(3, 4, 5);
|
| 257 |
+
const list3 = list2.unshift(0);
|
| 258 |
+
const list4 = list1.concat(list2, list3);
|
| 259 |
+
assert.equal(list1.size, 2);
|
| 260 |
+
assert.equal(list2.size, 5);
|
| 261 |
+
assert.equal(list3.size, 6);
|
| 262 |
+
assert.equal(list4.size, 13);
|
| 263 |
+
assert.equal(list4.get(0), 1);
|
| 264 |
+
```
|
| 265 |
+
|
| 266 |
+
Almost all of the methods on [Array][] will be found in similar form on
|
| 267 |
+
`Immutable.List`, those of [Map][] found on `Immutable.Map`, and those of [Set][]
|
| 268 |
+
found on `Immutable.Set`, including collection operations like `forEach()`
|
| 269 |
+
and `map()`.
|
| 270 |
+
|
| 271 |
+
<!-- runkit:activate -->
|
| 272 |
+
|
| 273 |
+
```js
|
| 274 |
+
const { Map } = require('immutable');
|
| 275 |
+
const alpha = Map({ a: 1, b: 2, c: 3, d: 4 });
|
| 276 |
+
alpha.map((v, k) => k.toUpperCase()).join();
|
| 277 |
+
// 'A,B,C,D'
|
| 278 |
+
```
|
| 279 |
+
|
| 280 |
+
### Convert from raw JavaScript objects and arrays.
|
| 281 |
+
|
| 282 |
+
Designed to inter-operate with your existing JavaScript, Immutable.js
|
| 283 |
+
accepts plain JavaScript Arrays and Objects anywhere a method expects a
|
| 284 |
+
`Collection`.
|
| 285 |
+
|
| 286 |
+
<!-- runkit:activate -->
|
| 287 |
+
|
| 288 |
+
```js
|
| 289 |
+
const { Map, List } = require('immutable');
|
| 290 |
+
const map1 = Map({ a: 1, b: 2, c: 3, d: 4 });
|
| 291 |
+
const map2 = Map({ c: 10, a: 20, t: 30 });
|
| 292 |
+
const obj = { d: 100, o: 200, g: 300 };
|
| 293 |
+
const map3 = map1.merge(map2, obj);
|
| 294 |
+
// Map { a: 20, b: 2, c: 10, d: 100, t: 30, o: 200, g: 300 }
|
| 295 |
+
const list1 = List([1, 2, 3]);
|
| 296 |
+
const list2 = List([4, 5, 6]);
|
| 297 |
+
const array = [7, 8, 9];
|
| 298 |
+
const list3 = list1.concat(list2, array);
|
| 299 |
+
// List [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ]
|
| 300 |
+
```
|
| 301 |
+
|
| 302 |
+
This is possible because Immutable.js can treat any JavaScript Array or Object
|
| 303 |
+
as a Collection. You can take advantage of this in order to get sophisticated
|
| 304 |
+
collection methods on JavaScript Objects, which otherwise have a very sparse
|
| 305 |
+
native API. Because Seq evaluates lazily and does not cache intermediate
|
| 306 |
+
results, these operations can be extremely efficient.
|
| 307 |
+
|
| 308 |
+
<!-- runkit:activate -->
|
| 309 |
+
|
| 310 |
+
```js
|
| 311 |
+
const { Seq } = require('immutable');
|
| 312 |
+
const myObject = { a: 1, b: 2, c: 3 };
|
| 313 |
+
Seq(myObject)
|
| 314 |
+
.map(x => x * x)
|
| 315 |
+
.toObject();
|
| 316 |
+
// { a: 1, b: 4, c: 9 }
|
| 317 |
+
```
|
| 318 |
+
|
| 319 |
+
Keep in mind, when using JS objects to construct Immutable Maps, that
|
| 320 |
+
JavaScript Object properties are always strings, even if written in a quote-less
|
| 321 |
+
shorthand, while Immutable Maps accept keys of any type.
|
| 322 |
+
|
| 323 |
+
<!-- runkit:activate -->
|
| 324 |
+
|
| 325 |
+
```js
|
| 326 |
+
const { fromJS } = require('immutable');
|
| 327 |
+
|
| 328 |
+
const obj = { 1: 'one' };
|
| 329 |
+
console.log(Object.keys(obj)); // [ "1" ]
|
| 330 |
+
console.log(obj['1'], obj[1]); // "one", "one"
|
| 331 |
+
|
| 332 |
+
const map = fromJS(obj);
|
| 333 |
+
console.log(map.get('1'), map.get(1)); // "one", undefined
|
| 334 |
+
```
|
| 335 |
+
|
| 336 |
+
Property access for JavaScript Objects first converts the key to a string, but
|
| 337 |
+
since Immutable Map keys can be of any type the argument to `get()` is
|
| 338 |
+
not altered.
|
| 339 |
+
|
| 340 |
+
### Converts back to raw JavaScript objects.
|
| 341 |
+
|
| 342 |
+
All Immutable.js Collections can be converted to plain JavaScript Arrays and
|
| 343 |
+
Objects shallowly with `toArray()` and `toObject()` or deeply with `toJS()`.
|
| 344 |
+
All Immutable Collections also implement `toJSON()` allowing them to be passed
|
| 345 |
+
to `JSON.stringify` directly. They also respect the custom `toJSON()` methods of
|
| 346 |
+
nested objects.
|
| 347 |
+
|
| 348 |
+
<!-- runkit:activate -->
|
| 349 |
+
|
| 350 |
+
```js
|
| 351 |
+
const { Map, List } = require('immutable');
|
| 352 |
+
const deep = Map({ a: 1, b: 2, c: List([3, 4, 5]) });
|
| 353 |
+
console.log(deep.toObject()); // { a: 1, b: 2, c: List [ 3, 4, 5 ] }
|
| 354 |
+
console.log(deep.toArray()); // [ 1, 2, List [ 3, 4, 5 ] ]
|
| 355 |
+
console.log(deep.toJS()); // { a: 1, b: 2, c: [ 3, 4, 5 ] }
|
| 356 |
+
JSON.stringify(deep); // '{"a":1,"b":2,"c":[3,4,5]}'
|
| 357 |
+
```
|
| 358 |
+
|
| 359 |
+
### Embraces ES2015
|
| 360 |
+
|
| 361 |
+
Immutable.js supports all JavaScript environments, including legacy
|
| 362 |
+
browsers (even IE11). However it also takes advantage of features added to
|
| 363 |
+
JavaScript in [ES2015][], the latest standard version of JavaScript, including
|
| 364 |
+
[Iterators][], [Arrow Functions][], [Classes][], and [Modules][]. It's inspired
|
| 365 |
+
by the native [Map][] and [Set][] collections added to ES2015.
|
| 366 |
+
|
| 367 |
+
All examples in the Documentation are presented in ES2015. To run in all
|
| 368 |
+
browsers, they need to be translated to ES5.
|
| 369 |
+
|
| 370 |
+
```js
|
| 371 |
+
// ES2015
|
| 372 |
+
const mapped = foo.map(x => x * x);
|
| 373 |
+
// ES5
|
| 374 |
+
var mapped = foo.map(function (x) {
|
| 375 |
+
return x * x;
|
| 376 |
+
});
|
| 377 |
+
```
|
| 378 |
+
|
| 379 |
+
All Immutable.js collections are [Iterable][iterators], which allows them to be
|
| 380 |
+
used anywhere an Iterable is expected, such as when spreading into an Array.
|
| 381 |
+
|
| 382 |
+
<!-- runkit:activate -->
|
| 383 |
+
|
| 384 |
+
```js
|
| 385 |
+
const { List } = require('immutable');
|
| 386 |
+
const aList = List([1, 2, 3]);
|
| 387 |
+
const anArray = [0, ...aList, 4, 5]; // [ 0, 1, 2, 3, 4, 5 ]
|
| 388 |
+
```
|
| 389 |
+
|
| 390 |
+
Note: A Collection is always iterated in the same order, however that order may
|
| 391 |
+
not always be well defined, as is the case for the `Map` and `Set`.
|
| 392 |
+
|
| 393 |
+
[Iterators]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/The_Iterator_protocol
|
| 394 |
+
[Arrow Functions]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions
|
| 395 |
+
[Classes]: https://wiki.ecmascript.org/doku.php?id=strawman:maximally_minimal_classes
|
| 396 |
+
[Modules]: https://www.2ality.com/2014/09/es6-modules-final.html
|
| 397 |
+
|
| 398 |
+
|
| 399 |
+
## Nested Structures
|
| 400 |
+
|
| 401 |
+
The collections in Immutable.js are intended to be nested, allowing for deep
|
| 402 |
+
trees of data, similar to JSON.
|
| 403 |
+
|
| 404 |
+
<!-- runkit:activate -->
|
| 405 |
+
|
| 406 |
+
```js
|
| 407 |
+
const { fromJS } = require('immutable');
|
| 408 |
+
const nested = fromJS({ a: { b: { c: [3, 4, 5] } } });
|
| 409 |
+
// Map { a: Map { b: Map { c: List [ 3, 4, 5 ] } } }
|
| 410 |
+
```
|
| 411 |
+
|
| 412 |
+
A few power-tools allow for reading and operating on nested data. The
|
| 413 |
+
most useful are `mergeDeep`, `getIn`, `setIn`, and `updateIn`, found on `List`,
|
| 414 |
+
`Map` and `OrderedMap`.
|
| 415 |
+
|
| 416 |
+
<!-- runkit:activate -->
|
| 417 |
+
|
| 418 |
+
```js
|
| 419 |
+
const { fromJS } = require('immutable');
|
| 420 |
+
const nested = fromJS({ a: { b: { c: [3, 4, 5] } } });
|
| 421 |
+
|
| 422 |
+
const nested2 = nested.mergeDeep({ a: { b: { d: 6 } } });
|
| 423 |
+
// Map { a: Map { b: Map { c: List [ 3, 4, 5 ], d: 6 } } }
|
| 424 |
+
|
| 425 |
+
console.log(nested2.getIn(['a', 'b', 'd'])); // 6
|
| 426 |
+
|
| 427 |
+
const nested3 = nested2.updateIn(['a', 'b', 'd'], value => value + 1);
|
| 428 |
+
console.log(nested3);
|
| 429 |
+
// Map { a: Map { b: Map { c: List [ 3, 4, 5 ], d: 7 } } }
|
| 430 |
+
|
| 431 |
+
const nested4 = nested3.updateIn(['a', 'b', 'c'], list => list.push(6));
|
| 432 |
+
// Map { a: Map { b: Map { c: List [ 3, 4, 5, 6 ], d: 7 } } }
|
| 433 |
+
```
|
| 434 |
+
|
| 435 |
+
## Equality treats Collections as Values
|
| 436 |
+
|
| 437 |
+
Immutable.js collections are treated as pure data _values_. Two immutable
|
| 438 |
+
collections are considered _value equal_ (via `.equals()` or `is()`) if they
|
| 439 |
+
represent the same collection of values. This differs from JavaScript's typical
|
| 440 |
+
_reference equal_ (via `===` or `==`) for Objects and Arrays which only
|
| 441 |
+
determines if two variables represent references to the same object instance.
|
| 442 |
+
|
| 443 |
+
Consider the example below where two identical `Map` instances are not
|
| 444 |
+
_reference equal_ but are _value equal_.
|
| 445 |
+
|
| 446 |
+
<!-- runkit:activate -->
|
| 447 |
+
|
| 448 |
+
```js
|
| 449 |
+
// First consider:
|
| 450 |
+
const obj1 = { a: 1, b: 2, c: 3 };
|
| 451 |
+
const obj2 = { a: 1, b: 2, c: 3 };
|
| 452 |
+
obj1 !== obj2; // two different instances are always not equal with ===
|
| 453 |
+
|
| 454 |
+
const { Map, is } = require('immutable');
|
| 455 |
+
const map1 = Map({ a: 1, b: 2, c: 3 });
|
| 456 |
+
const map2 = Map({ a: 1, b: 2, c: 3 });
|
| 457 |
+
map1 !== map2; // two different instances are not reference-equal
|
| 458 |
+
map1.equals(map2); // but are value-equal if they have the same values
|
| 459 |
+
is(map1, map2); // alternatively can use the is() function
|
| 460 |
+
```
|
| 461 |
+
|
| 462 |
+
Value equality allows Immutable.js collections to be used as keys in Maps or
|
| 463 |
+
values in Sets, and retrieved with different but equivalent collections:
|
| 464 |
+
|
| 465 |
+
<!-- runkit:activate -->
|
| 466 |
+
|
| 467 |
+
```js
|
| 468 |
+
const { Map, Set } = require('immutable');
|
| 469 |
+
const map1 = Map({ a: 1, b: 2, c: 3 });
|
| 470 |
+
const map2 = Map({ a: 1, b: 2, c: 3 });
|
| 471 |
+
const set = Set().add(map1);
|
| 472 |
+
set.has(map2); // true because these are value-equal
|
| 473 |
+
```
|
| 474 |
+
|
| 475 |
+
Note: `is()` uses the same measure of equality as [Object.is][] for scalar
|
| 476 |
+
strings and numbers, but uses value equality for Immutable collections,
|
| 477 |
+
determining if both are immutable and all keys and values are equal
|
| 478 |
+
using the same measure of equality.
|
| 479 |
+
|
| 480 |
+
[object.is]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
|
| 481 |
+
|
| 482 |
+
#### Performance tradeoffs
|
| 483 |
+
|
| 484 |
+
While value equality is useful in many circumstances, it has different
|
| 485 |
+
performance characteristics than reference equality. Understanding these
|
| 486 |
+
tradeoffs may help you decide which to use in each case, especially when used
|
| 487 |
+
to memoize some operation.
|
| 488 |
+
|
| 489 |
+
When comparing two collections, value equality may require considering every
|
| 490 |
+
item in each collection, on an `O(N)` time complexity. For large collections of
|
| 491 |
+
values, this could become a costly operation. Though if the two are not equal
|
| 492 |
+
and hardly similar, the inequality is determined very quickly. In contrast, when
|
| 493 |
+
comparing two collections with reference equality, only the initial references
|
| 494 |
+
to memory need to be compared which is not based on the size of the collections,
|
| 495 |
+
which has an `O(1)` time complexity. Checking reference equality is always very
|
| 496 |
+
fast, however just because two collections are not reference-equal does not rule
|
| 497 |
+
out the possibility that they may be value-equal.
|
| 498 |
+
|
| 499 |
+
#### Return self on no-op optimization
|
| 500 |
+
|
| 501 |
+
When possible, Immutable.js avoids creating new objects for updates where no
|
| 502 |
+
change in _value_ occurred, to allow for efficient _reference equality_ checking
|
| 503 |
+
to quickly determine if no change occurred.
|
| 504 |
+
|
| 505 |
+
<!-- runkit:activate -->
|
| 506 |
+
|
| 507 |
+
```js
|
| 508 |
+
const { Map } = require('immutable');
|
| 509 |
+
const originalMap = Map({ a: 1, b: 2, c: 3 });
|
| 510 |
+
const updatedMap = originalMap.set('b', 2);
|
| 511 |
+
updatedMap === originalMap; // No-op .set() returned the original reference.
|
| 512 |
+
```
|
| 513 |
+
|
| 514 |
+
However updates which do result in a change will return a new reference. Each
|
| 515 |
+
of these operations occur independently, so two similar updates will not return
|
| 516 |
+
the same reference:
|
| 517 |
+
|
| 518 |
+
<!-- runkit:activate -->
|
| 519 |
+
|
| 520 |
+
```js
|
| 521 |
+
const { Map } = require('immutable');
|
| 522 |
+
const originalMap = Map({ a: 1, b: 2, c: 3 });
|
| 523 |
+
const updatedMap = originalMap.set('b', 1000);
|
| 524 |
+
// New instance, leaving the original immutable.
|
| 525 |
+
updatedMap !== originalMap;
|
| 526 |
+
const anotherUpdatedMap = originalMap.set('b', 1000);
|
| 527 |
+
// Despite both the results of the same operation, each created a new reference.
|
| 528 |
+
anotherUpdatedMap !== updatedMap;
|
| 529 |
+
// However the two are value equal.
|
| 530 |
+
anotherUpdatedMap.equals(updatedMap);
|
| 531 |
+
```
|
| 532 |
+
|
| 533 |
+
## Batching Mutations
|
| 534 |
+
|
| 535 |
+
> If a tree falls in the woods, does it make a sound?
|
| 536 |
+
>
|
| 537 |
+
> If a pure function mutates some local data in order to produce an immutable
|
| 538 |
+
> return value, is that ok?
|
| 539 |
+
>
|
| 540 |
+
> — Rich Hickey, Clojure
|
| 541 |
+
|
| 542 |
+
Applying a mutation to create a new immutable object results in some overhead,
|
| 543 |
+
which can add up to a minor performance penalty. If you need to apply a series
|
| 544 |
+
of mutations locally before returning, Immutable.js gives you the ability to
|
| 545 |
+
create a temporary mutable (transient) copy of a collection and apply a batch of
|
| 546 |
+
mutations in a performant manner by using `withMutations`. In fact, this is
|
| 547 |
+
exactly how Immutable.js applies complex mutations itself.
|
| 548 |
+
|
| 549 |
+
As an example, building `list2` results in the creation of 1, not 3, new
|
| 550 |
+
immutable Lists.
|
| 551 |
+
|
| 552 |
+
<!-- runkit:activate -->
|
| 553 |
+
|
| 554 |
+
```js
|
| 555 |
+
const { List } = require('immutable');
|
| 556 |
+
const list1 = List([1, 2, 3]);
|
| 557 |
+
const list2 = list1.withMutations(function (list) {
|
| 558 |
+
list.push(4).push(5).push(6);
|
| 559 |
+
});
|
| 560 |
+
assert.equal(list1.size, 3);
|
| 561 |
+
assert.equal(list2.size, 6);
|
| 562 |
+
```
|
| 563 |
+
|
| 564 |
+
Note: Immutable.js also provides `asMutable` and `asImmutable`, but only
|
| 565 |
+
encourages their use when `withMutations` will not suffice. Use caution to not
|
| 566 |
+
return a mutable copy, which could result in undesired behavior.
|
| 567 |
+
|
| 568 |
+
_Important!_: Only a select few methods can be used in `withMutations` including
|
| 569 |
+
`set`, `push` and `pop`. These methods can be applied directly against a
|
| 570 |
+
persistent data-structure where other methods like `map`, `filter`, `sort`,
|
| 571 |
+
and `splice` will always return new immutable data-structures and never mutate
|
| 572 |
+
a mutable collection.
|
| 573 |
+
|
| 574 |
+
## Lazy Seq
|
| 575 |
+
|
| 576 |
+
`Seq` describes a lazy operation, allowing them to efficiently chain
|
| 577 |
+
use of all the higher-order collection methods (such as `map` and `filter`)
|
| 578 |
+
by not creating intermediate collections.
|
| 579 |
+
|
| 580 |
+
**Seq is immutable** — Once a Seq is created, it cannot be
|
| 581 |
+
changed, appended to, rearranged or otherwise modified. Instead, any mutative
|
| 582 |
+
method called on a `Seq` will return a new `Seq`.
|
| 583 |
+
|
| 584 |
+
**Seq is lazy** — `Seq` does as little work as necessary to respond to any
|
| 585 |
+
method call. Values are often created during iteration, including implicit
|
| 586 |
+
iteration when reducing or converting to a concrete data structure such as
|
| 587 |
+
a `List` or JavaScript `Array`.
|
| 588 |
+
|
| 589 |
+
For example, the following performs no work, because the resulting
|
| 590 |
+
`Seq`'s values are never iterated:
|
| 591 |
+
|
| 592 |
+
```js
|
| 593 |
+
const { Seq } = require('immutable');
|
| 594 |
+
const oddSquares = Seq([1, 2, 3, 4, 5, 6, 7, 8])
|
| 595 |
+
.filter(x => x % 2 !== 0)
|
| 596 |
+
.map(x => x * x);
|
| 597 |
+
```
|
| 598 |
+
|
| 599 |
+
Once the `Seq` is used, it performs only the work necessary. In this
|
| 600 |
+
example, no intermediate arrays are ever created, filter is called three
|
| 601 |
+
times, and map is only called once:
|
| 602 |
+
|
| 603 |
+
```js
|
| 604 |
+
oddSquares.get(1); // 9
|
| 605 |
+
```
|
| 606 |
+
|
| 607 |
+
Any collection can be converted to a lazy Seq with `Seq()`.
|
| 608 |
+
|
| 609 |
+
<!-- runkit:activate -->
|
| 610 |
+
|
| 611 |
+
```js
|
| 612 |
+
const { Map, Seq } = require('immutable');
|
| 613 |
+
const map = Map({ a: 1, b: 2, c: 3 });
|
| 614 |
+
const lazySeq = Seq(map);
|
| 615 |
+
```
|
| 616 |
+
|
| 617 |
+
`Seq` allows for the efficient chaining of operations, allowing for the
|
| 618 |
+
expression of logic that can otherwise be very tedious:
|
| 619 |
+
|
| 620 |
+
```js
|
| 621 |
+
lazySeq
|
| 622 |
+
.flip()
|
| 623 |
+
.map(key => key.toUpperCase())
|
| 624 |
+
.flip();
|
| 625 |
+
// Seq { A: 1, B: 2, C: 3 }
|
| 626 |
+
```
|
| 627 |
+
|
| 628 |
+
As well as expressing logic that would otherwise seem memory or time
|
| 629 |
+
limited, for example `Range` is a special kind of Lazy sequence.
|
| 630 |
+
|
| 631 |
+
<!-- runkit:activate -->
|
| 632 |
+
|
| 633 |
+
```js
|
| 634 |
+
const { Range } = require('immutable');
|
| 635 |
+
Range(1, Infinity)
|
| 636 |
+
.skip(1000)
|
| 637 |
+
.map(n => -n)
|
| 638 |
+
.filter(n => n % 2 === 0)
|
| 639 |
+
.take(2)
|
| 640 |
+
.reduce((r, n) => r * n, 1);
|
| 641 |
+
// 1006008
|
| 642 |
+
```
|
| 643 |
+
|
| 644 |
+
## Comparison of filter(), groupBy(), and partition()
|
| 645 |
+
|
| 646 |
+
The `filter()`, `groupBy()`, and `partition()` methods are similar in that they
|
| 647 |
+
all divide a collection into parts based on applying a function to each element.
|
| 648 |
+
All three call the predicate or grouping function once for each item in the
|
| 649 |
+
input collection. All three return zero or more collections of the same type as
|
| 650 |
+
their input. The returned collections are always distinct from the input
|
| 651 |
+
(according to `===`), even if the contents are identical.
|
| 652 |
+
|
| 653 |
+
Of these methods, `filter()` is the only one that is lazy and the only one which
|
| 654 |
+
discards items from the input collection. It is the simplest to use, and the
|
| 655 |
+
fact that it returns exactly one collection makes it easy to combine with other
|
| 656 |
+
methods to form a pipeline of operations.
|
| 657 |
+
|
| 658 |
+
The `partition()` method is similar to an eager version of `filter()`, but it
|
| 659 |
+
returns two collections; the first contains the items that would have been
|
| 660 |
+
discarded by `filter()`, and the second contains the items that would have been
|
| 661 |
+
kept. It always returns an array of exactly two collections, which can make it
|
| 662 |
+
easier to use than `groupBy()`. Compared to making two separate calls to
|
| 663 |
+
`filter()`, `partition()` makes half as many calls it the predicate passed to
|
| 664 |
+
it.
|
| 665 |
+
|
| 666 |
+
The `groupBy()` method is a more generalized version of `partition()` that can
|
| 667 |
+
group by an arbitrary function rather than just a predicate. It returns a map
|
| 668 |
+
with zero or more entries, where the keys are the values returned by the
|
| 669 |
+
grouping function, and the values are nonempty collections of the corresponding
|
| 670 |
+
arguments. Although `groupBy()` is more powerful than `partition()`, it can be
|
| 671 |
+
harder to use because it is not always possible predict in advance how many
|
| 672 |
+
entries the returned map will have and what their keys will be.
|
| 673 |
+
|
| 674 |
+
| Summary | `filter` | `partition` | `groupBy` |
|
| 675 |
+
|:------------------------------|:---------|:------------|:---------------|
|
| 676 |
+
| ease of use | easiest | moderate | hardest |
|
| 677 |
+
| generality | least | moderate | most |
|
| 678 |
+
| laziness | lazy | eager | eager |
|
| 679 |
+
| # of returned sub-collections | 1 | 2 | 0 or more |
|
| 680 |
+
| sub-collections may be empty | yes | yes | no |
|
| 681 |
+
| can discard items | yes | no | no |
|
| 682 |
+
| wrapping container | none | array | Map/OrderedMap |
|
| 683 |
+
|
| 684 |
+
## Additional Tools and Resources
|
| 685 |
+
|
| 686 |
+
- [Atom-store](https://github.com/jameshopkins/atom-store/)
|
| 687 |
+
- A Clojure-inspired atom implementation in Javascript with configurability
|
| 688 |
+
for external persistance.
|
| 689 |
+
|
| 690 |
+
- [Chai Immutable](https://github.com/astorije/chai-immutable)
|
| 691 |
+
- If you are using the [Chai Assertion Library](https://chaijs.com/), this
|
| 692 |
+
provides a set of assertions to use against Immutable.js collections.
|
| 693 |
+
|
| 694 |
+
- [Fantasy-land](https://github.com/fantasyland/fantasy-land)
|
| 695 |
+
- Specification for interoperability of common algebraic structures in JavaScript.
|
| 696 |
+
|
| 697 |
+
- [Immutagen](https://github.com/pelotom/immutagen)
|
| 698 |
+
- A library for simulating immutable generators in JavaScript.
|
| 699 |
+
|
| 700 |
+
- [Immutable-cursor](https://github.com/redbadger/immutable-cursor)
|
| 701 |
+
- Immutable cursors incorporating the Immutable.js interface over
|
| 702 |
+
Clojure-inspired atom.
|
| 703 |
+
|
| 704 |
+
- [Immutable-ext](https://github.com/DrBoolean/immutable-ext)
|
| 705 |
+
- Fantasyland extensions for immutablejs
|
| 706 |
+
|
| 707 |
+
- [Immutable-js-tools](https://github.com/madeinfree/immutable-js-tools)
|
| 708 |
+
- Util tools for immutable.js
|
| 709 |
+
|
| 710 |
+
- [Immutable-Redux](https://github.com/gajus/redux-immutable)
|
| 711 |
+
- redux-immutable is used to create an equivalent function of Redux
|
| 712 |
+
combineReducers that works with Immutable.js state.
|
| 713 |
+
|
| 714 |
+
- [Immutable-Treeutils](https://github.com/lukasbuenger/immutable-treeutils)
|
| 715 |
+
- Functional tree traversal helpers for ImmutableJS data structures.
|
| 716 |
+
|
| 717 |
+
- [Irecord](https://github.com/ericelliott/irecord)
|
| 718 |
+
- An immutable store that exposes an RxJS observable. Great for React.
|
| 719 |
+
|
| 720 |
+
- [Mudash](https://github.com/brianneisler/mudash)
|
| 721 |
+
- Lodash wrapper providing Immutable.JS support.
|
| 722 |
+
|
| 723 |
+
- [React-Immutable-PropTypes](https://github.com/HurricaneJames/react-immutable-proptypes)
|
| 724 |
+
- PropType validators that work with Immutable.js.
|
| 725 |
+
|
| 726 |
+
- [Redux-Immutablejs](https://github.com/indexiatech/redux-immutablejs)
|
| 727 |
+
- Redux Immutable facilities.
|
| 728 |
+
|
| 729 |
+
- [Rxstate](https://github.com/yamalight/rxstate)
|
| 730 |
+
- Simple opinionated state management library based on RxJS and Immutable.js.
|
| 731 |
+
|
| 732 |
+
- [Transit-Immutable-js](https://github.com/glenjamin/transit-immutable-js)
|
| 733 |
+
- Transit serialisation for Immutable.js.
|
| 734 |
+
- See also: [Transit-js](https://github.com/cognitect/transit-js)
|
| 735 |
+
|
| 736 |
+
Have an additional tool designed to work with Immutable.js?
|
| 737 |
+
Submit a PR to add it to this list in alphabetical order.
|
| 738 |
+
|
| 739 |
+
## Contributing
|
| 740 |
+
|
| 741 |
+
Use [Github issues](https://github.com/immutable-js/immutable-js/issues) for requests.
|
| 742 |
+
|
| 743 |
+
We actively welcome pull requests, learn how to [contribute](https://github.com/immutable-js/immutable-js/blob/main/.github/CONTRIBUTING.md).
|
| 744 |
+
|
| 745 |
+
Immutable.js is maintained within the [Contributor Covenant's Code of Conduct](https://www.contributor-covenant.org/version/2/0/code_of_conduct/).
|
| 746 |
+
|
| 747 |
+
### Changelog
|
| 748 |
+
|
| 749 |
+
Changes are tracked as [Github releases](https://github.com/immutable-js/immutable-js/releases).
|
| 750 |
+
|
| 751 |
+
### License
|
| 752 |
+
|
| 753 |
+
Immutable.js is [MIT-licensed](./LICENSE).
|
| 754 |
+
|
| 755 |
+
### Thanks
|
| 756 |
+
|
| 757 |
+
[Phil Bagwell](https://www.youtube.com/watch?v=K2NYwP90bNs), for his inspiration
|
| 758 |
+
and research in persistent data structures.
|
| 759 |
+
|
| 760 |
+
[Hugh Jackson](https://github.com/hughfdjackson/), for providing the npm package
|
| 761 |
+
name. If you're looking for his unsupported package, see [this repository](https://github.com/hughfdjackson/immutable).
|
Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/immutable/dist/immutable.d.ts
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/immutable/dist/immutable.es.js
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/immutable/dist/immutable.js
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/immutable/dist/immutable.js.flow
CHANGED
|
@@ -1,3 +1,2412 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* This file provides type definitions for use with the Flow type checker.
|
| 3 |
+
*
|
| 4 |
+
* An important caveat when using these definitions is that the types for
|
| 5 |
+
* `Collection.Keyed`, `Collection.Indexed`, `Seq.Keyed`, and so on are stubs.
|
| 6 |
+
* When referring to those types, you can get the proper definitions by
|
| 7 |
+
* importing the types `KeyedCollection`, `IndexedCollection`, `KeyedSeq`, etc.
|
| 8 |
+
* For example,
|
| 9 |
+
*
|
| 10 |
+
* import { Seq } from 'immutable'
|
| 11 |
+
* import type { IndexedCollection, IndexedSeq } from 'immutable'
|
| 12 |
+
*
|
| 13 |
+
* const someSeq: IndexedSeq<number> = Seq.Indexed.of(1, 2, 3)
|
| 14 |
+
*
|
| 15 |
+
* function takesASeq<T, TS: IndexedCollection<T>>(iter: TS): TS {
|
| 16 |
+
* return iter.butLast()
|
| 17 |
+
* }
|
| 18 |
+
*
|
| 19 |
+
* takesASeq(someSeq)
|
| 20 |
+
*
|
| 21 |
+
* @flow strict
|
| 22 |
+
*/
|
| 23 |
+
|
| 24 |
+
// Helper type that represents plain objects allowed as arguments to
|
| 25 |
+
// some constructors and functions.
|
| 26 |
+
type PlainObjInput<K, V> = { +[key: K]: V, __proto__: null };
|
| 27 |
+
|
| 28 |
+
type K<T> = $Keys<T>;
|
| 29 |
+
|
| 30 |
+
// Helper types to extract the "keys" and "values" use by the *In() methods.
|
| 31 |
+
type $KeyOf<C> = $Call<
|
| 32 |
+
(<K>(?_Collection<K, mixed>) => K) &
|
| 33 |
+
(<T>(?$ReadOnlyArray<T>) => number) &
|
| 34 |
+
(<T>(?RecordInstance<T> | T) => $Keys<T>) &
|
| 35 |
+
(<T: Object>(T) => $Keys<T>),
|
| 36 |
+
C
|
| 37 |
+
>;
|
| 38 |
+
|
| 39 |
+
type $ValOf<C, K = $KeyOf<C>> = $Call<
|
| 40 |
+
(<V>(?_Collection<any, V>) => V) &
|
| 41 |
+
(<T>(?$ReadOnlyArray<T>) => T) &
|
| 42 |
+
(<T, K: $Keys<T>>(?RecordInstance<T> | T, K) => $ElementType<T, K>) &
|
| 43 |
+
(<T: Object>(T) => $Values<T>),
|
| 44 |
+
C,
|
| 45 |
+
K
|
| 46 |
+
>;
|
| 47 |
+
|
| 48 |
+
type $IterableOf<C> = $Call<
|
| 49 |
+
(<V: Array<any> | IndexedCollection<any> | SetCollection<any>>(
|
| 50 |
+
V
|
| 51 |
+
) => Iterable<$ValOf<V>>) &
|
| 52 |
+
(<
|
| 53 |
+
V:
|
| 54 |
+
| KeyedCollection<any, any>
|
| 55 |
+
| RecordInstance<any>
|
| 56 |
+
| PlainObjInput<any, any>
|
| 57 |
+
>(
|
| 58 |
+
V
|
| 59 |
+
) => Iterable<[$KeyOf<V>, $ValOf<V>]>),
|
| 60 |
+
C
|
| 61 |
+
>;
|
| 62 |
+
|
| 63 |
+
const PairSorting: $ReadOnly<{ LeftThenRight: number, RightThenLeft: number }> =
|
| 64 |
+
{
|
| 65 |
+
LeftThenRight: -1,
|
| 66 |
+
RightThenLeft: +1,
|
| 67 |
+
};
|
| 68 |
+
|
| 69 |
+
type Comparator<T> = (left: T, right: T) => number;
|
| 70 |
+
|
| 71 |
+
declare class _Collection<K, +V> implements ValueObject {
|
| 72 |
+
equals(other: mixed): boolean;
|
| 73 |
+
hashCode(): number;
|
| 74 |
+
get(key: K, ..._: []): V | void;
|
| 75 |
+
get<NSV>(key: K, notSetValue: NSV): V | NSV;
|
| 76 |
+
has(key: K): boolean;
|
| 77 |
+
includes(value: V): boolean;
|
| 78 |
+
contains(value: V): boolean;
|
| 79 |
+
first<NSV>(notSetValue?: NSV): V | NSV;
|
| 80 |
+
last<NSV>(notSetValue?: NSV): V | NSV;
|
| 81 |
+
|
| 82 |
+
hasIn(keyPath: Iterable<mixed>): boolean;
|
| 83 |
+
|
| 84 |
+
getIn(keyPath: [], notSetValue?: mixed): this;
|
| 85 |
+
getIn<NSV>(keyPath: [K], notSetValue: NSV): V | NSV;
|
| 86 |
+
getIn<NSV, K2: $KeyOf<V>>(
|
| 87 |
+
keyPath: [K, K2],
|
| 88 |
+
notSetValue: NSV
|
| 89 |
+
): $ValOf<V, K2> | NSV;
|
| 90 |
+
getIn<NSV, K2: $KeyOf<V>, K3: $KeyOf<$ValOf<V, K2>>>(
|
| 91 |
+
keyPath: [K, K2, K3],
|
| 92 |
+
notSetValue: NSV
|
| 93 |
+
): $ValOf<$ValOf<V, K2>, K3> | NSV;
|
| 94 |
+
getIn<
|
| 95 |
+
NSV,
|
| 96 |
+
K2: $KeyOf<V>,
|
| 97 |
+
K3: $KeyOf<$ValOf<V, K2>>,
|
| 98 |
+
K4: $KeyOf<$ValOf<$ValOf<V, K2>, K3>>
|
| 99 |
+
>(
|
| 100 |
+
keyPath: [K, K2, K3, K4],
|
| 101 |
+
notSetValue: NSV
|
| 102 |
+
): $ValOf<$ValOf<$ValOf<V, K2>, K3>, K4> | NSV;
|
| 103 |
+
getIn<
|
| 104 |
+
NSV,
|
| 105 |
+
K2: $KeyOf<V>,
|
| 106 |
+
K3: $KeyOf<$ValOf<V, K2>>,
|
| 107 |
+
K4: $KeyOf<$ValOf<$ValOf<V, K2>, K3>>,
|
| 108 |
+
K5: $KeyOf<$ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>>
|
| 109 |
+
>(
|
| 110 |
+
keyPath: [K, K2, K3, K4, K5],
|
| 111 |
+
notSetValue: NSV
|
| 112 |
+
): $ValOf<$ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>, K5> | NSV;
|
| 113 |
+
|
| 114 |
+
update<U>(updater: (value: this) => U): U;
|
| 115 |
+
|
| 116 |
+
toJS(): Array<any> | { [key: string]: mixed };
|
| 117 |
+
toJSON(): Array<V> | { [key: string]: V };
|
| 118 |
+
toArray(): Array<V> | Array<[K, V]>;
|
| 119 |
+
toObject(): { [key: string]: V };
|
| 120 |
+
toMap(): Map<K, V>;
|
| 121 |
+
toOrderedMap(): OrderedMap<K, V>;
|
| 122 |
+
toSet(): Set<V>;
|
| 123 |
+
toOrderedSet(): OrderedSet<V>;
|
| 124 |
+
toList(): List<V>;
|
| 125 |
+
toStack(): Stack<V>;
|
| 126 |
+
toSeq(): Seq<K, V>;
|
| 127 |
+
toKeyedSeq(): KeyedSeq<K, V>;
|
| 128 |
+
toIndexedSeq(): IndexedSeq<V>;
|
| 129 |
+
toSetSeq(): SetSeq<V>;
|
| 130 |
+
|
| 131 |
+
keys(): Iterator<K>;
|
| 132 |
+
values(): Iterator<V>;
|
| 133 |
+
entries(): Iterator<[K, V]>;
|
| 134 |
+
|
| 135 |
+
keySeq(): IndexedSeq<K>;
|
| 136 |
+
valueSeq(): IndexedSeq<V>;
|
| 137 |
+
entrySeq(): IndexedSeq<[K, V]>;
|
| 138 |
+
|
| 139 |
+
reverse(): this;
|
| 140 |
+
sort(comparator?: Comparator<V>): this;
|
| 141 |
+
|
| 142 |
+
sortBy<C>(
|
| 143 |
+
comparatorValueMapper: (value: V, key: K, iter: this) => C,
|
| 144 |
+
comparator?: Comparator<C>
|
| 145 |
+
): this;
|
| 146 |
+
|
| 147 |
+
groupBy<G>(
|
| 148 |
+
grouper: (value: V, key: K, iter: this) => G,
|
| 149 |
+
context?: mixed
|
| 150 |
+
): KeyedSeq<G, this>;
|
| 151 |
+
|
| 152 |
+
forEach(
|
| 153 |
+
sideEffect: (value: V, key: K, iter: this) => any,
|
| 154 |
+
context?: mixed
|
| 155 |
+
): number;
|
| 156 |
+
|
| 157 |
+
slice(begin?: number, end?: number): this;
|
| 158 |
+
rest(): this;
|
| 159 |
+
butLast(): this;
|
| 160 |
+
skip(amount: number): this;
|
| 161 |
+
skipLast(amount: number): this;
|
| 162 |
+
skipWhile(
|
| 163 |
+
predicate: (value: V, key: K, iter: this) => mixed,
|
| 164 |
+
context?: mixed
|
| 165 |
+
): this;
|
| 166 |
+
skipUntil(
|
| 167 |
+
predicate: (value: V, key: K, iter: this) => mixed,
|
| 168 |
+
context?: mixed
|
| 169 |
+
): this;
|
| 170 |
+
take(amount: number): this;
|
| 171 |
+
takeLast(amount: number): this;
|
| 172 |
+
takeWhile(
|
| 173 |
+
predicate: (value: V, key: K, iter: this) => mixed,
|
| 174 |
+
context?: mixed
|
| 175 |
+
): this;
|
| 176 |
+
takeUntil(
|
| 177 |
+
predicate: (value: V, key: K, iter: this) => mixed,
|
| 178 |
+
context?: mixed
|
| 179 |
+
): this;
|
| 180 |
+
|
| 181 |
+
filterNot(
|
| 182 |
+
predicate: (value: V, key: K, iter: this) => mixed,
|
| 183 |
+
context?: mixed
|
| 184 |
+
): this;
|
| 185 |
+
|
| 186 |
+
reduce<R>(
|
| 187 |
+
reducer: (reduction: R, value: V, key: K, iter: this) => R,
|
| 188 |
+
initialReduction: R,
|
| 189 |
+
context?: mixed
|
| 190 |
+
): R;
|
| 191 |
+
reduce<R>(reducer: (reduction: V | R, value: V, key: K, iter: this) => R): R;
|
| 192 |
+
|
| 193 |
+
reduceRight<R>(
|
| 194 |
+
reducer: (reduction: R, value: V, key: K, iter: this) => R,
|
| 195 |
+
initialReduction: R,
|
| 196 |
+
context?: mixed
|
| 197 |
+
): R;
|
| 198 |
+
reduceRight<R>(
|
| 199 |
+
reducer: (reduction: V | R, value: V, key: K, iter: this) => R
|
| 200 |
+
): R;
|
| 201 |
+
|
| 202 |
+
every(
|
| 203 |
+
predicate: (value: V, key: K, iter: this) => mixed,
|
| 204 |
+
context?: mixed
|
| 205 |
+
): boolean;
|
| 206 |
+
some(
|
| 207 |
+
predicate: (value: V, key: K, iter: this) => mixed,
|
| 208 |
+
context?: mixed
|
| 209 |
+
): boolean;
|
| 210 |
+
join(separator?: string): string;
|
| 211 |
+
isEmpty(): boolean;
|
| 212 |
+
count(
|
| 213 |
+
predicate?: (value: V, key: K, iter: this) => mixed,
|
| 214 |
+
context?: mixed
|
| 215 |
+
): number;
|
| 216 |
+
countBy<G>(
|
| 217 |
+
grouper: (value: V, key: K, iter: this) => G,
|
| 218 |
+
context?: mixed
|
| 219 |
+
): Map<G, number>;
|
| 220 |
+
|
| 221 |
+
find<NSV>(
|
| 222 |
+
predicate: (value: V, key: K, iter: this) => mixed,
|
| 223 |
+
context?: mixed,
|
| 224 |
+
notSetValue?: NSV
|
| 225 |
+
): V | NSV;
|
| 226 |
+
findLast<NSV>(
|
| 227 |
+
predicate: (value: V, key: K, iter: this) => mixed,
|
| 228 |
+
context?: mixed,
|
| 229 |
+
notSetValue?: NSV
|
| 230 |
+
): V | NSV;
|
| 231 |
+
|
| 232 |
+
findEntry(predicate: (value: V, key: K, iter: this) => mixed): [K, V] | void;
|
| 233 |
+
findLastEntry(
|
| 234 |
+
predicate: (value: V, key: K, iter: this) => mixed
|
| 235 |
+
): [K, V] | void;
|
| 236 |
+
|
| 237 |
+
findKey(
|
| 238 |
+
predicate: (value: V, key: K, iter: this) => mixed,
|
| 239 |
+
context?: mixed
|
| 240 |
+
): K | void;
|
| 241 |
+
findLastKey(
|
| 242 |
+
predicate: (value: V, key: K, iter: this) => mixed,
|
| 243 |
+
context?: mixed
|
| 244 |
+
): K | void;
|
| 245 |
+
|
| 246 |
+
keyOf(searchValue: V): K | void;
|
| 247 |
+
lastKeyOf(searchValue: V): K | void;
|
| 248 |
+
|
| 249 |
+
max(comparator?: Comparator<V>): V;
|
| 250 |
+
maxBy<C>(
|
| 251 |
+
comparatorValueMapper: (value: V, key: K, iter: this) => C,
|
| 252 |
+
comparator?: Comparator<C>
|
| 253 |
+
): V;
|
| 254 |
+
min(comparator?: Comparator<V>): V;
|
| 255 |
+
minBy<C>(
|
| 256 |
+
comparatorValueMapper: (value: V, key: K, iter: this) => C,
|
| 257 |
+
comparator?: Comparator<C>
|
| 258 |
+
): V;
|
| 259 |
+
|
| 260 |
+
isSubset(iter: Iterable<V>): boolean;
|
| 261 |
+
isSuperset(iter: Iterable<V>): boolean;
|
| 262 |
+
}
|
| 263 |
+
|
| 264 |
+
declare function isImmutable(
|
| 265 |
+
maybeImmutable: mixed
|
| 266 |
+
): boolean %checks(maybeImmutable instanceof Collection);
|
| 267 |
+
declare function isCollection(
|
| 268 |
+
maybeCollection: mixed
|
| 269 |
+
): boolean %checks(maybeCollection instanceof Collection);
|
| 270 |
+
declare function isKeyed(
|
| 271 |
+
maybeKeyed: mixed
|
| 272 |
+
): boolean %checks(maybeKeyed instanceof KeyedCollection);
|
| 273 |
+
declare function isIndexed(
|
| 274 |
+
maybeIndexed: mixed
|
| 275 |
+
): boolean %checks(maybeIndexed instanceof IndexedCollection);
|
| 276 |
+
declare function isAssociative(
|
| 277 |
+
maybeAssociative: mixed
|
| 278 |
+
): boolean %checks(maybeAssociative instanceof KeyedCollection ||
|
| 279 |
+
maybeAssociative instanceof IndexedCollection);
|
| 280 |
+
declare function isOrdered(
|
| 281 |
+
maybeOrdered: mixed
|
| 282 |
+
): boolean %checks(maybeOrdered instanceof IndexedCollection ||
|
| 283 |
+
maybeOrdered instanceof OrderedMap ||
|
| 284 |
+
maybeOrdered instanceof OrderedSet);
|
| 285 |
+
declare function isValueObject(maybeValue: mixed): boolean;
|
| 286 |
+
|
| 287 |
+
declare function isSeq(maybeSeq: any): boolean %checks(maybeSeq instanceof Seq);
|
| 288 |
+
declare function isList(maybeList: any): boolean %checks(maybeList instanceof
|
| 289 |
+
List);
|
| 290 |
+
declare function isMap(maybeMap: any): boolean %checks(maybeMap instanceof Map);
|
| 291 |
+
declare function isOrderedMap(
|
| 292 |
+
maybeOrderedMap: any
|
| 293 |
+
): boolean %checks(maybeOrderedMap instanceof OrderedMap);
|
| 294 |
+
declare function isStack(maybeStack: any): boolean %checks(maybeStack instanceof
|
| 295 |
+
Stack);
|
| 296 |
+
declare function isSet(maybeSet: any): boolean %checks(maybeSet instanceof Set);
|
| 297 |
+
declare function isOrderedSet(
|
| 298 |
+
maybeOrderedSet: any
|
| 299 |
+
): boolean %checks(maybeOrderedSet instanceof OrderedSet);
|
| 300 |
+
declare function isRecord(
|
| 301 |
+
maybeRecord: any
|
| 302 |
+
): boolean %checks(maybeRecord instanceof Record);
|
| 303 |
+
|
| 304 |
+
declare interface ValueObject {
|
| 305 |
+
equals(other: mixed): boolean;
|
| 306 |
+
hashCode(): number;
|
| 307 |
+
}
|
| 308 |
+
|
| 309 |
+
declare class Collection<K, +V> extends _Collection<K, V> {
|
| 310 |
+
static Keyed: typeof KeyedCollection;
|
| 311 |
+
static Indexed: typeof IndexedCollection;
|
| 312 |
+
static Set: typeof SetCollection;
|
| 313 |
+
|
| 314 |
+
static isCollection: typeof isCollection;
|
| 315 |
+
static isKeyed: typeof isKeyed;
|
| 316 |
+
static isIndexed: typeof isIndexed;
|
| 317 |
+
static isAssociative: typeof isAssociative;
|
| 318 |
+
static isOrdered: typeof isOrdered;
|
| 319 |
+
}
|
| 320 |
+
|
| 321 |
+
declare class KeyedCollection<K, +V> extends Collection<K, V> {
|
| 322 |
+
static <K, V>(
|
| 323 |
+
values?: Iterable<[K, V]> | PlainObjInput<K, V>
|
| 324 |
+
): KeyedCollection<K, V>;
|
| 325 |
+
|
| 326 |
+
toJS(): { [key: string]: mixed };
|
| 327 |
+
toJSON(): { [key: string]: V };
|
| 328 |
+
toArray(): Array<[K, V]>;
|
| 329 |
+
@@iterator(): Iterator<[K, V]>;
|
| 330 |
+
toSeq(): KeyedSeq<K, V>;
|
| 331 |
+
flip(): KeyedCollection<V, K>;
|
| 332 |
+
|
| 333 |
+
concat<KC, VC>(
|
| 334 |
+
...iters: Array<Iterable<[KC, VC]> | PlainObjInput<KC, VC>>
|
| 335 |
+
): KeyedCollection<K | KC, V | VC>;
|
| 336 |
+
|
| 337 |
+
filter(predicate: typeof Boolean): KeyedCollection<K, $NonMaybeType<V>>;
|
| 338 |
+
filter(
|
| 339 |
+
predicate: (value: V, key: K, iter: this) => mixed,
|
| 340 |
+
context?: mixed
|
| 341 |
+
): KeyedCollection<K, V>;
|
| 342 |
+
|
| 343 |
+
partition(
|
| 344 |
+
predicate: (value: V, key: K, iter: this) => mixed,
|
| 345 |
+
context?: mixed
|
| 346 |
+
): [this, this];
|
| 347 |
+
|
| 348 |
+
map<M>(
|
| 349 |
+
mapper: (value: V, key: K, iter: this) => M,
|
| 350 |
+
context?: mixed
|
| 351 |
+
): KeyedCollection<K, M>;
|
| 352 |
+
|
| 353 |
+
mapKeys<M>(
|
| 354 |
+
mapper: (key: K, value: V, iter: this) => M,
|
| 355 |
+
context?: mixed
|
| 356 |
+
): KeyedCollection<M, V>;
|
| 357 |
+
|
| 358 |
+
mapEntries<KM, VM>(
|
| 359 |
+
mapper: (entry: [K, V], index: number, iter: this) => [KM, VM],
|
| 360 |
+
context?: mixed
|
| 361 |
+
): KeyedCollection<KM, VM>;
|
| 362 |
+
|
| 363 |
+
flatMap<KM, VM>(
|
| 364 |
+
mapper: (value: V, key: K, iter: this) => Iterable<[KM, VM]>,
|
| 365 |
+
context?: mixed
|
| 366 |
+
): KeyedCollection<KM, VM>;
|
| 367 |
+
|
| 368 |
+
flatten(depth?: number): KeyedCollection<any, any>;
|
| 369 |
+
flatten(shallow?: boolean): KeyedCollection<any, any>;
|
| 370 |
+
}
|
| 371 |
+
|
| 372 |
+
Collection.Keyed = KeyedCollection;
|
| 373 |
+
|
| 374 |
+
declare class IndexedCollection<+T> extends Collection<number, T> {
|
| 375 |
+
static <T>(iter?: Iterable<T>): IndexedCollection<T>;
|
| 376 |
+
|
| 377 |
+
toJS(): Array<mixed>;
|
| 378 |
+
toJSON(): Array<T>;
|
| 379 |
+
toArray(): Array<T>;
|
| 380 |
+
@@iterator(): Iterator<T>;
|
| 381 |
+
toSeq(): IndexedSeq<T>;
|
| 382 |
+
fromEntrySeq<K, V>(): KeyedSeq<K, V>;
|
| 383 |
+
interpose(separator: T): this;
|
| 384 |
+
interleave(...collections: Iterable<T>[]): this;
|
| 385 |
+
splice(index: number, removeNum: number, ...values: T[]): this;
|
| 386 |
+
|
| 387 |
+
zip<A>(a: Iterable<A>, ..._: []): IndexedCollection<[T, A]>;
|
| 388 |
+
zip<A, B>(
|
| 389 |
+
a: Iterable<A>,
|
| 390 |
+
b: Iterable<B>,
|
| 391 |
+
..._: []
|
| 392 |
+
): IndexedCollection<[T, A, B]>;
|
| 393 |
+
zip<A, B, C>(
|
| 394 |
+
a: Iterable<A>,
|
| 395 |
+
b: Iterable<B>,
|
| 396 |
+
c: Iterable<C>,
|
| 397 |
+
..._: []
|
| 398 |
+
): IndexedCollection<[T, A, B, C]>;
|
| 399 |
+
zip<A, B, C, D>(
|
| 400 |
+
a: Iterable<A>,
|
| 401 |
+
b: Iterable<B>,
|
| 402 |
+
c: Iterable<C>,
|
| 403 |
+
d: Iterable<D>,
|
| 404 |
+
..._: []
|
| 405 |
+
): IndexedCollection<[T, A, B, C, D]>;
|
| 406 |
+
zip<A, B, C, D, E>(
|
| 407 |
+
a: Iterable<A>,
|
| 408 |
+
b: Iterable<B>,
|
| 409 |
+
c: Iterable<C>,
|
| 410 |
+
d: Iterable<D>,
|
| 411 |
+
e: Iterable<E>,
|
| 412 |
+
..._: []
|
| 413 |
+
): IndexedCollection<[T, A, B, C, D, E]>;
|
| 414 |
+
|
| 415 |
+
zipAll<A>(a: Iterable<A>, ..._: []): IndexedCollection<[T | void, A | void]>;
|
| 416 |
+
zipAll<A, B>(
|
| 417 |
+
a: Iterable<A>,
|
| 418 |
+
b: Iterable<B>,
|
| 419 |
+
..._: []
|
| 420 |
+
): IndexedCollection<[T | void, A | void, B | void]>;
|
| 421 |
+
zipAll<A, B, C>(
|
| 422 |
+
a: Iterable<A>,
|
| 423 |
+
b: Iterable<B>,
|
| 424 |
+
c: Iterable<C>,
|
| 425 |
+
..._: []
|
| 426 |
+
): IndexedCollection<[T | void, A | void, B | void, C | void]>;
|
| 427 |
+
zipAll<A, B, C, D>(
|
| 428 |
+
a: Iterable<A>,
|
| 429 |
+
b: Iterable<B>,
|
| 430 |
+
c: Iterable<C>,
|
| 431 |
+
d: Iterable<D>,
|
| 432 |
+
..._: []
|
| 433 |
+
): IndexedCollection<[T | void, A | void, B | void, C | void, D | void]>;
|
| 434 |
+
zipAll<A, B, C, D, E>(
|
| 435 |
+
a: Iterable<A>,
|
| 436 |
+
b: Iterable<B>,
|
| 437 |
+
c: Iterable<C>,
|
| 438 |
+
d: Iterable<D>,
|
| 439 |
+
e: Iterable<E>,
|
| 440 |
+
..._: []
|
| 441 |
+
): IndexedCollection<
|
| 442 |
+
[T | void, A | void, B | void, C | void, D | void, E | void]
|
| 443 |
+
>;
|
| 444 |
+
|
| 445 |
+
zipWith<A, R>(
|
| 446 |
+
zipper: (value: T, a: A) => R,
|
| 447 |
+
a: Iterable<A>,
|
| 448 |
+
..._: []
|
| 449 |
+
): IndexedCollection<R>;
|
| 450 |
+
zipWith<A, B, R>(
|
| 451 |
+
zipper: (value: T, a: A, b: B) => R,
|
| 452 |
+
a: Iterable<A>,
|
| 453 |
+
b: Iterable<B>,
|
| 454 |
+
..._: []
|
| 455 |
+
): IndexedCollection<R>;
|
| 456 |
+
zipWith<A, B, C, R>(
|
| 457 |
+
zipper: (value: T, a: A, b: B, c: C) => R,
|
| 458 |
+
a: Iterable<A>,
|
| 459 |
+
b: Iterable<B>,
|
| 460 |
+
c: Iterable<C>,
|
| 461 |
+
..._: []
|
| 462 |
+
): IndexedCollection<R>;
|
| 463 |
+
zipWith<A, B, C, D, R>(
|
| 464 |
+
zipper: (value: T, a: A, b: B, c: C, d: D) => R,
|
| 465 |
+
a: Iterable<A>,
|
| 466 |
+
b: Iterable<B>,
|
| 467 |
+
c: Iterable<C>,
|
| 468 |
+
d: Iterable<D>,
|
| 469 |
+
..._: []
|
| 470 |
+
): IndexedCollection<R>;
|
| 471 |
+
zipWith<A, B, C, D, E, R>(
|
| 472 |
+
zipper: (value: T, a: A, b: B, c: C, d: D, e: E) => R,
|
| 473 |
+
a: Iterable<A>,
|
| 474 |
+
b: Iterable<B>,
|
| 475 |
+
c: Iterable<C>,
|
| 476 |
+
d: Iterable<D>,
|
| 477 |
+
e: Iterable<E>,
|
| 478 |
+
..._: []
|
| 479 |
+
): IndexedCollection<R>;
|
| 480 |
+
|
| 481 |
+
indexOf(searchValue: T): number;
|
| 482 |
+
lastIndexOf(searchValue: T): number;
|
| 483 |
+
findIndex(
|
| 484 |
+
predicate: (value: T, index: number, iter: this) => mixed,
|
| 485 |
+
context?: mixed
|
| 486 |
+
): number;
|
| 487 |
+
findLastIndex(
|
| 488 |
+
predicate: (value: T, index: number, iter: this) => mixed,
|
| 489 |
+
context?: mixed
|
| 490 |
+
): number;
|
| 491 |
+
|
| 492 |
+
concat<C>(...iters: Array<Iterable<C> | C>): IndexedCollection<T | C>;
|
| 493 |
+
|
| 494 |
+
filter(predicate: typeof Boolean): IndexedCollection<$NonMaybeType<T>>;
|
| 495 |
+
filter(
|
| 496 |
+
predicate: (value: T, index: number, iter: this) => mixed,
|
| 497 |
+
context?: mixed
|
| 498 |
+
): IndexedCollection<T>;
|
| 499 |
+
|
| 500 |
+
partition(
|
| 501 |
+
predicate: (value: T, index: number, iter: this) => mixed,
|
| 502 |
+
context?: mixed
|
| 503 |
+
): [this, this];
|
| 504 |
+
|
| 505 |
+
map<M>(
|
| 506 |
+
mapper: (value: T, index: number, iter: this) => M,
|
| 507 |
+
context?: mixed
|
| 508 |
+
): IndexedCollection<M>;
|
| 509 |
+
|
| 510 |
+
flatMap<M>(
|
| 511 |
+
mapper: (value: T, index: number, iter: this) => Iterable<M>,
|
| 512 |
+
context?: mixed
|
| 513 |
+
): IndexedCollection<M>;
|
| 514 |
+
|
| 515 |
+
flatten(depth?: number): IndexedCollection<any>;
|
| 516 |
+
flatten(shallow?: boolean): IndexedCollection<any>;
|
| 517 |
+
}
|
| 518 |
+
|
| 519 |
+
declare class SetCollection<+T> extends Collection<T, T> {
|
| 520 |
+
static <T>(iter?: Iterable<T>): SetCollection<T>;
|
| 521 |
+
|
| 522 |
+
toJS(): Array<mixed>;
|
| 523 |
+
toJSON(): Array<T>;
|
| 524 |
+
toArray(): Array<T>;
|
| 525 |
+
@@iterator(): Iterator<T>;
|
| 526 |
+
toSeq(): SetSeq<T>;
|
| 527 |
+
|
| 528 |
+
concat<U>(...collections: Iterable<U>[]): SetCollection<T | U>;
|
| 529 |
+
|
| 530 |
+
// `filter`, `map` and `flatMap` cannot be defined further up the hierarchy,
|
| 531 |
+
// because the implementation for `KeyedCollection` allows the value type to
|
| 532 |
+
// change without constraining the key type. That does not work for
|
| 533 |
+
// `SetCollection` - the value and key types *must* match.
|
| 534 |
+
filter(predicate: typeof Boolean): SetCollection<$NonMaybeType<T>>;
|
| 535 |
+
filter(
|
| 536 |
+
predicate: (value: T, value: T, iter: this) => mixed,
|
| 537 |
+
context?: mixed
|
| 538 |
+
): SetCollection<T>;
|
| 539 |
+
|
| 540 |
+
partition(
|
| 541 |
+
predicate: (value: T, value: T, iter: this) => mixed,
|
| 542 |
+
context?: mixed
|
| 543 |
+
): [this, this];
|
| 544 |
+
|
| 545 |
+
map<M>(
|
| 546 |
+
mapper: (value: T, value: T, iter: this) => M,
|
| 547 |
+
context?: mixed
|
| 548 |
+
): SetCollection<M>;
|
| 549 |
+
|
| 550 |
+
flatMap<M>(
|
| 551 |
+
mapper: (value: T, value: T, iter: this) => Iterable<M>,
|
| 552 |
+
context?: mixed
|
| 553 |
+
): SetCollection<M>;
|
| 554 |
+
|
| 555 |
+
flatten(depth?: number): SetCollection<any>;
|
| 556 |
+
flatten(shallow?: boolean): SetCollection<any>;
|
| 557 |
+
}
|
| 558 |
+
|
| 559 |
+
declare function isSeq(maybeSeq: mixed): boolean %checks(maybeSeq instanceof
|
| 560 |
+
Seq);
|
| 561 |
+
declare class Seq<K, +V> extends _Collection<K, V> {
|
| 562 |
+
static Keyed: typeof KeyedSeq;
|
| 563 |
+
static Indexed: typeof IndexedSeq;
|
| 564 |
+
static Set: typeof SetSeq;
|
| 565 |
+
|
| 566 |
+
static <K, V>(values: KeyedSeq<K, V>): KeyedSeq<K, V>;
|
| 567 |
+
static <T>(values: SetSeq<T>): SetSeq<K, V>;
|
| 568 |
+
static <T>(values: Iterable<T>): IndexedSeq<T>;
|
| 569 |
+
static <K, V>(values?: PlainObjInput<K, V>): KeyedSeq<K, V>;
|
| 570 |
+
|
| 571 |
+
static isSeq: typeof isSeq;
|
| 572 |
+
|
| 573 |
+
size: number | void;
|
| 574 |
+
cacheResult(): this;
|
| 575 |
+
toSeq(): this;
|
| 576 |
+
}
|
| 577 |
+
|
| 578 |
+
declare class KeyedSeq<K, +V> extends Seq<K, V> mixins KeyedCollection<K, V> {
|
| 579 |
+
static <K, V>(
|
| 580 |
+
values?: Iterable<[K, V]> | PlainObjInput<K, V>
|
| 581 |
+
): KeyedSeq<K, V>;
|
| 582 |
+
|
| 583 |
+
// Override specialized return types
|
| 584 |
+
flip(): KeyedSeq<V, K>;
|
| 585 |
+
|
| 586 |
+
concat<KC, VC>(
|
| 587 |
+
...iters: Array<Iterable<[KC, VC]> | PlainObjInput<KC, VC>>
|
| 588 |
+
): KeyedSeq<K | KC, V | VC>;
|
| 589 |
+
|
| 590 |
+
filter(predicate: typeof Boolean): KeyedSeq<K, $NonMaybeType<V>>;
|
| 591 |
+
filter(
|
| 592 |
+
predicate: (value: V, key: K, iter: this) => mixed,
|
| 593 |
+
context?: mixed
|
| 594 |
+
): KeyedSeq<K, V>;
|
| 595 |
+
|
| 596 |
+
partition(
|
| 597 |
+
predicate: (value: V, key: K, iter: this) => mixed,
|
| 598 |
+
context?: mixed
|
| 599 |
+
): [this, this];
|
| 600 |
+
|
| 601 |
+
map<M>(
|
| 602 |
+
mapper: (value: V, key: K, iter: this) => M,
|
| 603 |
+
context?: mixed
|
| 604 |
+
): KeyedSeq<K, M>;
|
| 605 |
+
|
| 606 |
+
mapKeys<M>(
|
| 607 |
+
mapper: (key: K, value: V, iter: this) => M,
|
| 608 |
+
context?: mixed
|
| 609 |
+
): KeyedSeq<M, V>;
|
| 610 |
+
|
| 611 |
+
mapEntries<KM, VM>(
|
| 612 |
+
mapper: (entry: [K, V], index: number, iter: this) => [KM, VM],
|
| 613 |
+
context?: mixed
|
| 614 |
+
): KeyedSeq<KM, VM>;
|
| 615 |
+
|
| 616 |
+
flatMap<KM, VM>(
|
| 617 |
+
mapper: (value: V, key: K, iter: this) => Iterable<[KM, VM]>,
|
| 618 |
+
context?: mixed
|
| 619 |
+
): KeyedSeq<KM, VM>;
|
| 620 |
+
|
| 621 |
+
flatten(depth?: number): KeyedSeq<any, any>;
|
| 622 |
+
flatten(shallow?: boolean): KeyedSeq<any, any>;
|
| 623 |
+
}
|
| 624 |
+
|
| 625 |
+
declare class IndexedSeq<+T>
|
| 626 |
+
extends Seq<number, T>
|
| 627 |
+
mixins IndexedCollection<T>
|
| 628 |
+
{
|
| 629 |
+
static <T>(values?: Iterable<T>): IndexedSeq<T>;
|
| 630 |
+
|
| 631 |
+
static of<T>(...values: T[]): IndexedSeq<T>;
|
| 632 |
+
|
| 633 |
+
// Override specialized return types
|
| 634 |
+
|
| 635 |
+
concat<C>(...iters: Array<Iterable<C> | C>): IndexedSeq<T | C>;
|
| 636 |
+
|
| 637 |
+
filter(predicate: typeof Boolean): IndexedSeq<$NonMaybeType<T>>;
|
| 638 |
+
filter(
|
| 639 |
+
predicate: (value: T, index: number, iter: this) => mixed,
|
| 640 |
+
context?: mixed
|
| 641 |
+
): IndexedSeq<T>;
|
| 642 |
+
|
| 643 |
+
partition(
|
| 644 |
+
predicate: (value: T, index: number, iter: this) => mixed,
|
| 645 |
+
context?: mixed
|
| 646 |
+
): [this, this];
|
| 647 |
+
|
| 648 |
+
map<M>(
|
| 649 |
+
mapper: (value: T, index: number, iter: this) => M,
|
| 650 |
+
context?: mixed
|
| 651 |
+
): IndexedSeq<M>;
|
| 652 |
+
|
| 653 |
+
flatMap<M>(
|
| 654 |
+
mapper: (value: T, index: number, iter: this) => Iterable<M>,
|
| 655 |
+
context?: mixed
|
| 656 |
+
): IndexedSeq<M>;
|
| 657 |
+
|
| 658 |
+
flatten(depth?: number): IndexedSeq<any>;
|
| 659 |
+
flatten(shallow?: boolean): IndexedSeq<any>;
|
| 660 |
+
|
| 661 |
+
zip<A>(a: Iterable<A>, ..._: []): IndexedSeq<[T, A]>;
|
| 662 |
+
zip<A, B>(a: Iterable<A>, b: Iterable<B>, ..._: []): IndexedSeq<[T, A, B]>;
|
| 663 |
+
zip<A, B, C>(
|
| 664 |
+
a: Iterable<A>,
|
| 665 |
+
b: Iterable<B>,
|
| 666 |
+
c: Iterable<C>,
|
| 667 |
+
..._: []
|
| 668 |
+
): IndexedSeq<[T, A, B, C]>;
|
| 669 |
+
zip<A, B, C, D>(
|
| 670 |
+
a: Iterable<A>,
|
| 671 |
+
b: Iterable<B>,
|
| 672 |
+
c: Iterable<C>,
|
| 673 |
+
d: Iterable<D>,
|
| 674 |
+
..._: []
|
| 675 |
+
): IndexedSeq<[T, A, B, C, D]>;
|
| 676 |
+
zip<A, B, C, D, E>(
|
| 677 |
+
a: Iterable<A>,
|
| 678 |
+
b: Iterable<B>,
|
| 679 |
+
c: Iterable<C>,
|
| 680 |
+
d: Iterable<D>,
|
| 681 |
+
e: Iterable<E>,
|
| 682 |
+
..._: []
|
| 683 |
+
): IndexedSeq<[T, A, B, C, D, E]>;
|
| 684 |
+
|
| 685 |
+
zipAll<A>(a: Iterable<A>, ..._: []): IndexedSeq<[T | void, A | void]>;
|
| 686 |
+
zipAll<A, B>(
|
| 687 |
+
a: Iterable<A>,
|
| 688 |
+
b: Iterable<B>,
|
| 689 |
+
..._: []
|
| 690 |
+
): IndexedSeq<[T | void, A | void, B | void]>;
|
| 691 |
+
zipAll<A, B, C>(
|
| 692 |
+
a: Iterable<A>,
|
| 693 |
+
b: Iterable<B>,
|
| 694 |
+
c: Iterable<C>,
|
| 695 |
+
..._: []
|
| 696 |
+
): IndexedSeq<[T | void, A | void, B | void, C | void]>;
|
| 697 |
+
zipAll<A, B, C, D>(
|
| 698 |
+
a: Iterable<A>,
|
| 699 |
+
b: Iterable<B>,
|
| 700 |
+
c: Iterable<C>,
|
| 701 |
+
d: Iterable<D>,
|
| 702 |
+
..._: []
|
| 703 |
+
): IndexedSeq<[T | void, A | void, B | void, C | void, D | void]>;
|
| 704 |
+
zipAll<A, B, C, D, E>(
|
| 705 |
+
a: Iterable<A>,
|
| 706 |
+
b: Iterable<B>,
|
| 707 |
+
c: Iterable<C>,
|
| 708 |
+
d: Iterable<D>,
|
| 709 |
+
e: Iterable<E>,
|
| 710 |
+
..._: []
|
| 711 |
+
): IndexedSeq<[T | void, A | void, B | void, C | void, D | void, E | void]>;
|
| 712 |
+
|
| 713 |
+
zipWith<A, R>(
|
| 714 |
+
zipper: (value: T, a: A) => R,
|
| 715 |
+
a: Iterable<A>,
|
| 716 |
+
..._: []
|
| 717 |
+
): IndexedSeq<R>;
|
| 718 |
+
zipWith<A, B, R>(
|
| 719 |
+
zipper: (value: T, a: A, b: B) => R,
|
| 720 |
+
a: Iterable<A>,
|
| 721 |
+
b: Iterable<B>,
|
| 722 |
+
..._: []
|
| 723 |
+
): IndexedSeq<R>;
|
| 724 |
+
zipWith<A, B, C, R>(
|
| 725 |
+
zipper: (value: T, a: A, b: B, c: C) => R,
|
| 726 |
+
a: Iterable<A>,
|
| 727 |
+
b: Iterable<B>,
|
| 728 |
+
c: Iterable<C>,
|
| 729 |
+
..._: []
|
| 730 |
+
): IndexedSeq<R>;
|
| 731 |
+
zipWith<A, B, C, D, R>(
|
| 732 |
+
zipper: (value: T, a: A, b: B, c: C, d: D) => R,
|
| 733 |
+
a: Iterable<A>,
|
| 734 |
+
b: Iterable<B>,
|
| 735 |
+
c: Iterable<C>,
|
| 736 |
+
d: Iterable<D>,
|
| 737 |
+
..._: []
|
| 738 |
+
): IndexedSeq<R>;
|
| 739 |
+
zipWith<A, B, C, D, E, R>(
|
| 740 |
+
zipper: (value: T, a: A, b: B, c: C, d: D, e: E) => R,
|
| 741 |
+
a: Iterable<A>,
|
| 742 |
+
b: Iterable<B>,
|
| 743 |
+
c: Iterable<C>,
|
| 744 |
+
d: Iterable<D>,
|
| 745 |
+
e: Iterable<E>,
|
| 746 |
+
..._: []
|
| 747 |
+
): IndexedSeq<R>;
|
| 748 |
+
}
|
| 749 |
+
|
| 750 |
+
declare class SetSeq<+T> extends Seq<T, T> mixins SetCollection<T> {
|
| 751 |
+
static <T>(values?: Iterable<T>): SetSeq<T>;
|
| 752 |
+
|
| 753 |
+
static of<T>(...values: T[]): SetSeq<T>;
|
| 754 |
+
|
| 755 |
+
// Override specialized return types
|
| 756 |
+
|
| 757 |
+
concat<U>(...collections: Iterable<U>[]): SetSeq<T | U>;
|
| 758 |
+
|
| 759 |
+
filter(predicate: typeof Boolean): SetSeq<$NonMaybeType<T>>;
|
| 760 |
+
filter(
|
| 761 |
+
predicate: (value: T, value: T, iter: this) => mixed,
|
| 762 |
+
context?: mixed
|
| 763 |
+
): SetSeq<T>;
|
| 764 |
+
|
| 765 |
+
partition(
|
| 766 |
+
predicate: (value: T, value: T, iter: this) => mixed,
|
| 767 |
+
context?: mixed
|
| 768 |
+
): [this, this];
|
| 769 |
+
|
| 770 |
+
map<M>(
|
| 771 |
+
mapper: (value: T, value: T, iter: this) => M,
|
| 772 |
+
context?: mixed
|
| 773 |
+
): SetSeq<M>;
|
| 774 |
+
|
| 775 |
+
flatMap<M>(
|
| 776 |
+
mapper: (value: T, value: T, iter: this) => Iterable<M>,
|
| 777 |
+
context?: mixed
|
| 778 |
+
): SetSeq<M>;
|
| 779 |
+
|
| 780 |
+
flatten(depth?: number): SetSeq<any>;
|
| 781 |
+
flatten(shallow?: boolean): SetSeq<any>;
|
| 782 |
+
}
|
| 783 |
+
|
| 784 |
+
declare class UpdatableInCollection<K, +V> {
|
| 785 |
+
setIn<S>(keyPath: [], value: S): S;
|
| 786 |
+
setIn(keyPath: [K], value: V): this;
|
| 787 |
+
setIn<K2: $KeyOf<V>, S: $ValOf<V, K2>>(keyPath: [K, K2], value: S): this;
|
| 788 |
+
setIn<K2: $KeyOf<V>, K3: $KeyOf<$ValOf<V, K2>>, S: $ValOf<$ValOf<V, K2>, K3>>(
|
| 789 |
+
keyPath: [K, K2, K3],
|
| 790 |
+
value: S
|
| 791 |
+
): this;
|
| 792 |
+
setIn<
|
| 793 |
+
K2: $KeyOf<V>,
|
| 794 |
+
K3: $KeyOf<$ValOf<V, K2>>,
|
| 795 |
+
K4: $KeyOf<$ValOf<$ValOf<V, K2>, K3>>,
|
| 796 |
+
S: $ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>
|
| 797 |
+
>(
|
| 798 |
+
keyPath: [K, K2, K3, K4],
|
| 799 |
+
value: S
|
| 800 |
+
): this;
|
| 801 |
+
setIn<
|
| 802 |
+
K2: $KeyOf<V>,
|
| 803 |
+
K3: $KeyOf<$ValOf<V, K2>>,
|
| 804 |
+
K4: $KeyOf<$ValOf<$ValOf<V, K2>, K3>>,
|
| 805 |
+
K5: $KeyOf<$ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>>,
|
| 806 |
+
S: $ValOf<$ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>, K5>
|
| 807 |
+
>(
|
| 808 |
+
keyPath: [K, K2, K3, K4, K5],
|
| 809 |
+
value: S
|
| 810 |
+
): this;
|
| 811 |
+
|
| 812 |
+
deleteIn(keyPath: []): void;
|
| 813 |
+
deleteIn(keyPath: [K]): this;
|
| 814 |
+
deleteIn<K2: $KeyOf<V>>(keyPath: [K, K2]): this;
|
| 815 |
+
deleteIn<K2: $KeyOf<V>, K3: $KeyOf<$ValOf<V, K2>>>(
|
| 816 |
+
keyPath: [K, K2, K3]
|
| 817 |
+
): this;
|
| 818 |
+
deleteIn<
|
| 819 |
+
K2: $KeyOf<V>,
|
| 820 |
+
K3: $KeyOf<$ValOf<V, K2>>,
|
| 821 |
+
K4: $KeyOf<$ValOf<$ValOf<V, K2>, K3>>
|
| 822 |
+
>(
|
| 823 |
+
keyPath: [K, K2, K3, K4]
|
| 824 |
+
): this;
|
| 825 |
+
deleteIn<
|
| 826 |
+
K2: $KeyOf<V>,
|
| 827 |
+
K3: $KeyOf<$ValOf<V, K2>>,
|
| 828 |
+
K4: $KeyOf<$ValOf<$ValOf<V, K2>, K3>>,
|
| 829 |
+
K5: $KeyOf<$ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>>
|
| 830 |
+
>(
|
| 831 |
+
keyPath: [K, K2, K3, K4, K5]
|
| 832 |
+
): this;
|
| 833 |
+
|
| 834 |
+
removeIn(keyPath: []): void;
|
| 835 |
+
removeIn(keyPath: [K]): this;
|
| 836 |
+
removeIn<K2: $KeyOf<V>>(keyPath: [K, K2]): this;
|
| 837 |
+
removeIn<K2: $KeyOf<V>, K3: $KeyOf<$ValOf<V, K2>>>(
|
| 838 |
+
keyPath: [K, K2, K3]
|
| 839 |
+
): this;
|
| 840 |
+
removeIn<
|
| 841 |
+
K2: $KeyOf<V>,
|
| 842 |
+
K3: $KeyOf<$ValOf<V, K2>>,
|
| 843 |
+
K4: $KeyOf<$ValOf<$ValOf<V, K2>, K3>>
|
| 844 |
+
>(
|
| 845 |
+
keyPath: [K, K2, K3, K4]
|
| 846 |
+
): this;
|
| 847 |
+
removeIn<
|
| 848 |
+
K2: $KeyOf<V>,
|
| 849 |
+
K3: $KeyOf<$ValOf<V, K2>>,
|
| 850 |
+
K4: $KeyOf<$ValOf<$ValOf<V, K2>, K3>>,
|
| 851 |
+
K5: $KeyOf<$ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>>
|
| 852 |
+
>(
|
| 853 |
+
keyPath: [K, K2, K3, K4, K5]
|
| 854 |
+
): this;
|
| 855 |
+
|
| 856 |
+
updateIn<U>(keyPath: [], notSetValue: mixed, updater: (value: this) => U): U;
|
| 857 |
+
updateIn<U>(keyPath: [], updater: (value: this) => U): U;
|
| 858 |
+
updateIn<NSV>(keyPath: [K], notSetValue: NSV, updater: (value: V) => V): this;
|
| 859 |
+
updateIn(keyPath: [K], updater: (value: V) => V): this;
|
| 860 |
+
updateIn<NSV, K2: $KeyOf<V>, S: $ValOf<V, K2>>(
|
| 861 |
+
keyPath: [K, K2],
|
| 862 |
+
notSetValue: NSV,
|
| 863 |
+
updater: (value: $ValOf<V, K2> | NSV) => S
|
| 864 |
+
): this;
|
| 865 |
+
updateIn<K2: $KeyOf<V>, S: $ValOf<V, K2>>(
|
| 866 |
+
keyPath: [K, K2],
|
| 867 |
+
updater: (value: $ValOf<V, K2>) => S
|
| 868 |
+
): this;
|
| 869 |
+
updateIn<
|
| 870 |
+
NSV,
|
| 871 |
+
K2: $KeyOf<V>,
|
| 872 |
+
K3: $KeyOf<$ValOf<V, K2>>,
|
| 873 |
+
S: $ValOf<$ValOf<V, K2>, K3>
|
| 874 |
+
>(
|
| 875 |
+
keyPath: [K, K2, K3],
|
| 876 |
+
notSetValue: NSV,
|
| 877 |
+
updater: (value: $ValOf<$ValOf<V, K2>, K3> | NSV) => S
|
| 878 |
+
): this;
|
| 879 |
+
updateIn<
|
| 880 |
+
K2: $KeyOf<V>,
|
| 881 |
+
K3: $KeyOf<$ValOf<V, K2>>,
|
| 882 |
+
S: $ValOf<$ValOf<V, K2>, K3>
|
| 883 |
+
>(
|
| 884 |
+
keyPath: [K, K2, K3],
|
| 885 |
+
updater: (value: $ValOf<$ValOf<V, K2>, K3>) => S
|
| 886 |
+
): this;
|
| 887 |
+
updateIn<
|
| 888 |
+
NSV,
|
| 889 |
+
K2: $KeyOf<V>,
|
| 890 |
+
K3: $KeyOf<$ValOf<V, K2>>,
|
| 891 |
+
K4: $KeyOf<$ValOf<$ValOf<V, K2>, K3>>,
|
| 892 |
+
S: $ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>
|
| 893 |
+
>(
|
| 894 |
+
keyPath: [K, K2, K3, K4],
|
| 895 |
+
notSetValue: NSV,
|
| 896 |
+
updater: (value: $ValOf<$ValOf<$ValOf<V, K2>, K3>, K4> | NSV) => S
|
| 897 |
+
): this;
|
| 898 |
+
updateIn<
|
| 899 |
+
K2: $KeyOf<V>,
|
| 900 |
+
K3: $KeyOf<$ValOf<V, K2>>,
|
| 901 |
+
K4: $KeyOf<$ValOf<$ValOf<V, K2>, K3>>,
|
| 902 |
+
S: $ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>
|
| 903 |
+
>(
|
| 904 |
+
keyPath: [K, K2, K3, K4],
|
| 905 |
+
updater: (value: $ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>) => S
|
| 906 |
+
): this;
|
| 907 |
+
updateIn<
|
| 908 |
+
NSV,
|
| 909 |
+
K2: $KeyOf<V>,
|
| 910 |
+
K3: $KeyOf<$ValOf<V, K2>>,
|
| 911 |
+
K4: $KeyOf<$ValOf<$ValOf<V, K2>, K3>>,
|
| 912 |
+
K5: $KeyOf<$ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>>,
|
| 913 |
+
S: $ValOf<$ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>, K5>
|
| 914 |
+
>(
|
| 915 |
+
keyPath: [K, K2, K3, K4, K5],
|
| 916 |
+
notSetValue: NSV,
|
| 917 |
+
updater: (
|
| 918 |
+
value: $ValOf<$ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>, K5> | NSV
|
| 919 |
+
) => S
|
| 920 |
+
): this;
|
| 921 |
+
updateIn<
|
| 922 |
+
K2: $KeyOf<V>,
|
| 923 |
+
K3: $KeyOf<$ValOf<V, K2>>,
|
| 924 |
+
K4: $KeyOf<$ValOf<$ValOf<V, K2>, K3>>,
|
| 925 |
+
K5: $KeyOf<$ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>>,
|
| 926 |
+
S: $ValOf<$ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>, K5>
|
| 927 |
+
>(
|
| 928 |
+
keyPath: [K, K2, K3, K4, K5],
|
| 929 |
+
updater: (value: $ValOf<$ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>, K5>) => S
|
| 930 |
+
): this;
|
| 931 |
+
}
|
| 932 |
+
|
| 933 |
+
declare function isList(maybeList: mixed): boolean %checks(maybeList instanceof
|
| 934 |
+
List);
|
| 935 |
+
declare class List<+T>
|
| 936 |
+
extends IndexedCollection<T>
|
| 937 |
+
mixins UpdatableInCollection<number, T>
|
| 938 |
+
{
|
| 939 |
+
static (collection?: Iterable<T>): List<T>;
|
| 940 |
+
|
| 941 |
+
static of<T>(...values: T[]): List<T>;
|
| 942 |
+
|
| 943 |
+
static isList: typeof isList;
|
| 944 |
+
|
| 945 |
+
size: number;
|
| 946 |
+
|
| 947 |
+
set<U>(index: number, value: U): List<T | U>;
|
| 948 |
+
delete(index: number): this;
|
| 949 |
+
remove(index: number): this;
|
| 950 |
+
insert<U>(index: number, value: U): List<T | U>;
|
| 951 |
+
clear(): this;
|
| 952 |
+
push<U>(...values: U[]): List<T | U>;
|
| 953 |
+
pop(): this;
|
| 954 |
+
unshift<U>(...values: U[]): List<T | U>;
|
| 955 |
+
shift(): this;
|
| 956 |
+
|
| 957 |
+
update<U>(updater: (value: this) => U): U;
|
| 958 |
+
update<U>(index: number, updater: (value: T) => U): List<T | U>;
|
| 959 |
+
update<U>(
|
| 960 |
+
index: number,
|
| 961 |
+
notSetValue: U,
|
| 962 |
+
updater: (value: T) => U
|
| 963 |
+
): List<T | U>;
|
| 964 |
+
|
| 965 |
+
merge<U>(...collections: Iterable<U>[]): List<T | U>;
|
| 966 |
+
|
| 967 |
+
setSize(size: number): this;
|
| 968 |
+
|
| 969 |
+
mergeIn(keyPath: Iterable<mixed>, ...collections: Iterable<mixed>[]): this;
|
| 970 |
+
mergeDeepIn(
|
| 971 |
+
keyPath: Iterable<mixed>,
|
| 972 |
+
...collections: Iterable<mixed>[]
|
| 973 |
+
): this;
|
| 974 |
+
|
| 975 |
+
withMutations(mutator: (mutable: this) => mixed): this;
|
| 976 |
+
asMutable(): this;
|
| 977 |
+
wasAltered(): boolean;
|
| 978 |
+
asImmutable(): this;
|
| 979 |
+
|
| 980 |
+
// Override specialized return types
|
| 981 |
+
|
| 982 |
+
concat<C>(...iters: Array<Iterable<C> | C>): List<T | C>;
|
| 983 |
+
|
| 984 |
+
filter(predicate: typeof Boolean): List<$NonMaybeType<T>>;
|
| 985 |
+
filter(
|
| 986 |
+
predicate: (value: T, index: number, iter: this) => mixed,
|
| 987 |
+
context?: mixed
|
| 988 |
+
): List<T>;
|
| 989 |
+
|
| 990 |
+
partition(
|
| 991 |
+
predicate: (value: T, index: number, iter: this) => mixed,
|
| 992 |
+
context?: mixed
|
| 993 |
+
): [this, this];
|
| 994 |
+
|
| 995 |
+
map<M>(
|
| 996 |
+
mapper: (value: T, index: number, iter: this) => M,
|
| 997 |
+
context?: mixed
|
| 998 |
+
): List<M>;
|
| 999 |
+
|
| 1000 |
+
flatMap<M>(
|
| 1001 |
+
mapper: (value: T, index: number, iter: this) => Iterable<M>,
|
| 1002 |
+
context?: mixed
|
| 1003 |
+
): List<M>;
|
| 1004 |
+
|
| 1005 |
+
flatten(depth?: number): List<any>;
|
| 1006 |
+
flatten(shallow?: boolean): List<any>;
|
| 1007 |
+
|
| 1008 |
+
zip<A>(a: Iterable<A>, ..._: []): List<[T, A]>;
|
| 1009 |
+
zip<A, B>(a: Iterable<A>, b: Iterable<B>, ..._: []): List<[T, A, B]>;
|
| 1010 |
+
zip<A, B, C>(
|
| 1011 |
+
a: Iterable<A>,
|
| 1012 |
+
b: Iterable<B>,
|
| 1013 |
+
c: Iterable<C>,
|
| 1014 |
+
..._: []
|
| 1015 |
+
): List<[T, A, B, C]>;
|
| 1016 |
+
zip<A, B, C, D>(
|
| 1017 |
+
a: Iterable<A>,
|
| 1018 |
+
b: Iterable<B>,
|
| 1019 |
+
c: Iterable<C>,
|
| 1020 |
+
d: Iterable<D>,
|
| 1021 |
+
..._: []
|
| 1022 |
+
): List<[T, A, B, C, D]>;
|
| 1023 |
+
zip<A, B, C, D, E>(
|
| 1024 |
+
a: Iterable<A>,
|
| 1025 |
+
b: Iterable<B>,
|
| 1026 |
+
c: Iterable<C>,
|
| 1027 |
+
d: Iterable<D>,
|
| 1028 |
+
e: Iterable<E>,
|
| 1029 |
+
..._: []
|
| 1030 |
+
): List<[T, A, B, C, D, E]>;
|
| 1031 |
+
|
| 1032 |
+
zipAll<A>(a: Iterable<A>, ..._: []): List<[T | void, A | void]>;
|
| 1033 |
+
zipAll<A, B>(
|
| 1034 |
+
a: Iterable<A>,
|
| 1035 |
+
b: Iterable<B>,
|
| 1036 |
+
..._: []
|
| 1037 |
+
): List<[T | void, A | void, B | void]>;
|
| 1038 |
+
zipAll<A, B, C>(
|
| 1039 |
+
a: Iterable<A>,
|
| 1040 |
+
b: Iterable<B>,
|
| 1041 |
+
c: Iterable<C>,
|
| 1042 |
+
..._: []
|
| 1043 |
+
): List<[T | void, A | void, B | void, C | void]>;
|
| 1044 |
+
zipAll<A, B, C, D>(
|
| 1045 |
+
a: Iterable<A>,
|
| 1046 |
+
b: Iterable<B>,
|
| 1047 |
+
c: Iterable<C>,
|
| 1048 |
+
d: Iterable<D>,
|
| 1049 |
+
..._: []
|
| 1050 |
+
): List<[T | void, A | void, B | void, C | void, D | void]>;
|
| 1051 |
+
zipAll<A, B, C, D, E>(
|
| 1052 |
+
a: Iterable<A>,
|
| 1053 |
+
b: Iterable<B>,
|
| 1054 |
+
c: Iterable<C>,
|
| 1055 |
+
d: Iterable<D>,
|
| 1056 |
+
e: Iterable<E>,
|
| 1057 |
+
..._: []
|
| 1058 |
+
): List<[T | void, A | void, B | void, C | void, D | void, E | void]>;
|
| 1059 |
+
|
| 1060 |
+
zipWith<A, R>(
|
| 1061 |
+
zipper: (value: T, a: A) => R,
|
| 1062 |
+
a: Iterable<A>,
|
| 1063 |
+
..._: []
|
| 1064 |
+
): List<R>;
|
| 1065 |
+
zipWith<A, B, R>(
|
| 1066 |
+
zipper: (value: T, a: A, b: B) => R,
|
| 1067 |
+
a: Iterable<A>,
|
| 1068 |
+
b: Iterable<B>,
|
| 1069 |
+
..._: []
|
| 1070 |
+
): List<R>;
|
| 1071 |
+
zipWith<A, B, C, R>(
|
| 1072 |
+
zipper: (value: T, a: A, b: B, c: C) => R,
|
| 1073 |
+
a: Iterable<A>,
|
| 1074 |
+
b: Iterable<B>,
|
| 1075 |
+
c: Iterable<C>,
|
| 1076 |
+
..._: []
|
| 1077 |
+
): List<R>;
|
| 1078 |
+
zipWith<A, B, C, D, R>(
|
| 1079 |
+
zipper: (value: T, a: A, b: B, c: C, d: D) => R,
|
| 1080 |
+
a: Iterable<A>,
|
| 1081 |
+
b: Iterable<B>,
|
| 1082 |
+
c: Iterable<C>,
|
| 1083 |
+
d: Iterable<D>,
|
| 1084 |
+
..._: []
|
| 1085 |
+
): List<R>;
|
| 1086 |
+
zipWith<A, B, C, D, E, R>(
|
| 1087 |
+
zipper: (value: T, a: A, b: B, c: C, d: D, e: E) => R,
|
| 1088 |
+
a: Iterable<A>,
|
| 1089 |
+
b: Iterable<B>,
|
| 1090 |
+
c: Iterable<C>,
|
| 1091 |
+
d: Iterable<D>,
|
| 1092 |
+
e: Iterable<E>,
|
| 1093 |
+
..._: []
|
| 1094 |
+
): List<R>;
|
| 1095 |
+
}
|
| 1096 |
+
|
| 1097 |
+
declare function isMap(maybeMap: mixed): boolean %checks(maybeMap instanceof
|
| 1098 |
+
Map);
|
| 1099 |
+
declare class Map<K, +V>
|
| 1100 |
+
extends KeyedCollection<K, V>
|
| 1101 |
+
mixins UpdatableInCollection<K, V>
|
| 1102 |
+
{
|
| 1103 |
+
static <K, V>(values?: Iterable<[K, V]> | PlainObjInput<K, V>): Map<K, V>;
|
| 1104 |
+
|
| 1105 |
+
static isMap: typeof isMap;
|
| 1106 |
+
|
| 1107 |
+
size: number;
|
| 1108 |
+
|
| 1109 |
+
set<K_, V_>(key: K_, value: V_): Map<K | K_, V | V_>;
|
| 1110 |
+
delete(key: K): this;
|
| 1111 |
+
remove(key: K): this;
|
| 1112 |
+
clear(): this;
|
| 1113 |
+
|
| 1114 |
+
deleteAll(keys: Iterable<K>): Map<K, V>;
|
| 1115 |
+
removeAll(keys: Iterable<K>): Map<K, V>;
|
| 1116 |
+
|
| 1117 |
+
update<U>(updater: (value: this) => U): U;
|
| 1118 |
+
update<V_>(key: K, updater: (value: V) => V_): Map<K, V | V_>;
|
| 1119 |
+
update<V_>(
|
| 1120 |
+
key: K,
|
| 1121 |
+
notSetValue: V_,
|
| 1122 |
+
updater: (value: V) => V_
|
| 1123 |
+
): Map<K, V | V_>;
|
| 1124 |
+
|
| 1125 |
+
merge<K_, V_>(
|
| 1126 |
+
...collections: (Iterable<[K_, V_]> | PlainObjInput<K_, V_>)[]
|
| 1127 |
+
): Map<K | K_, V | V_>;
|
| 1128 |
+
concat<K_, V_>(
|
| 1129 |
+
...collections: (Iterable<[K_, V_]> | PlainObjInput<K_, V_>)[]
|
| 1130 |
+
): Map<K | K_, V | V_>;
|
| 1131 |
+
|
| 1132 |
+
mergeWith<K_, W, X>(
|
| 1133 |
+
merger: (oldVal: V, newVal: W, key: K) => X,
|
| 1134 |
+
...collections: (Iterable<[K_, W]> | PlainObjInput<K_, W>)[]
|
| 1135 |
+
): Map<K | K_, V | W | X>;
|
| 1136 |
+
|
| 1137 |
+
mergeDeep<K_, V_>(
|
| 1138 |
+
...collections: (Iterable<[K_, V_]> | PlainObjInput<K_, V_>)[]
|
| 1139 |
+
): Map<K | K_, V | V_>;
|
| 1140 |
+
|
| 1141 |
+
mergeDeepWith<K_, V_>(
|
| 1142 |
+
merger: (oldVal: any, newVal: any, key: any) => mixed,
|
| 1143 |
+
...collections: (Iterable<[K_, V_]> | PlainObjInput<K_, V_>)[]
|
| 1144 |
+
): Map<K | K_, V | V_>;
|
| 1145 |
+
|
| 1146 |
+
mergeIn(
|
| 1147 |
+
keyPath: Iterable<mixed>,
|
| 1148 |
+
...collections: (Iterable<mixed> | PlainObjInput<mixed, mixed>)[]
|
| 1149 |
+
): this;
|
| 1150 |
+
mergeDeepIn(
|
| 1151 |
+
keyPath: Iterable<mixed>,
|
| 1152 |
+
...collections: (Iterable<mixed> | PlainObjInput<mixed, mixed>)[]
|
| 1153 |
+
): this;
|
| 1154 |
+
|
| 1155 |
+
withMutations(mutator: (mutable: this) => mixed): this;
|
| 1156 |
+
asMutable(): this;
|
| 1157 |
+
wasAltered(): boolean;
|
| 1158 |
+
asImmutable(): this;
|
| 1159 |
+
|
| 1160 |
+
// Override specialized return types
|
| 1161 |
+
|
| 1162 |
+
flip(): Map<V, K>;
|
| 1163 |
+
|
| 1164 |
+
filter(predicate: typeof Boolean): Map<K, $NonMaybeType<V>>;
|
| 1165 |
+
filter(
|
| 1166 |
+
predicate: (value: V, key: K, iter: this) => mixed,
|
| 1167 |
+
context?: mixed
|
| 1168 |
+
): Map<K, V>;
|
| 1169 |
+
|
| 1170 |
+
partition(
|
| 1171 |
+
predicate: (value: V, key: K, iter: this) => mixed,
|
| 1172 |
+
context?: mixed
|
| 1173 |
+
): [this, this];
|
| 1174 |
+
|
| 1175 |
+
map<M>(
|
| 1176 |
+
mapper: (value: V, key: K, iter: this) => M,
|
| 1177 |
+
context?: mixed
|
| 1178 |
+
): Map<K, M>;
|
| 1179 |
+
|
| 1180 |
+
mapKeys<M>(
|
| 1181 |
+
mapper: (key: K, value: V, iter: this) => M,
|
| 1182 |
+
context?: mixed
|
| 1183 |
+
): Map<M, V>;
|
| 1184 |
+
|
| 1185 |
+
mapEntries<KM, VM>(
|
| 1186 |
+
mapper: (entry: [K, V], index: number, iter: this) => [KM, VM],
|
| 1187 |
+
context?: mixed
|
| 1188 |
+
): Map<KM, VM>;
|
| 1189 |
+
|
| 1190 |
+
flatMap<KM, VM>(
|
| 1191 |
+
mapper: (value: V, key: K, iter: this) => Iterable<[KM, VM]>,
|
| 1192 |
+
context?: mixed
|
| 1193 |
+
): Map<KM, VM>;
|
| 1194 |
+
|
| 1195 |
+
flatten(depth?: number): Map<any, any>;
|
| 1196 |
+
flatten(shallow?: boolean): Map<any, any>;
|
| 1197 |
+
}
|
| 1198 |
+
|
| 1199 |
+
declare function isOrderedMap(
|
| 1200 |
+
maybeOrderedMap: mixed
|
| 1201 |
+
): boolean %checks(maybeOrderedMap instanceof OrderedMap);
|
| 1202 |
+
declare class OrderedMap<K, +V>
|
| 1203 |
+
extends Map<K, V>
|
| 1204 |
+
mixins UpdatableInCollection<K, V>
|
| 1205 |
+
{
|
| 1206 |
+
static <K, V>(
|
| 1207 |
+
values?: Iterable<[K, V]> | PlainObjInput<K, V>
|
| 1208 |
+
): OrderedMap<K, V>;
|
| 1209 |
+
|
| 1210 |
+
static isOrderedMap: typeof isOrderedMap;
|
| 1211 |
+
|
| 1212 |
+
size: number;
|
| 1213 |
+
|
| 1214 |
+
set<K_, V_>(key: K_, value: V_): OrderedMap<K | K_, V | V_>;
|
| 1215 |
+
delete(key: K): this;
|
| 1216 |
+
remove(key: K): this;
|
| 1217 |
+
clear(): this;
|
| 1218 |
+
|
| 1219 |
+
update<U>(updater: (value: this) => U): U;
|
| 1220 |
+
update<V_>(key: K, updater: (value: V) => V_): OrderedMap<K, V | V_>;
|
| 1221 |
+
update<V_>(
|
| 1222 |
+
key: K,
|
| 1223 |
+
notSetValue: V_,
|
| 1224 |
+
updater: (value: V) => V_
|
| 1225 |
+
): OrderedMap<K, V | V_>;
|
| 1226 |
+
|
| 1227 |
+
merge<K_, V_>(
|
| 1228 |
+
...collections: (Iterable<[K_, V_]> | PlainObjInput<K_, V_>)[]
|
| 1229 |
+
): OrderedMap<K | K_, V | V_>;
|
| 1230 |
+
concat<K_, V_>(
|
| 1231 |
+
...collections: (Iterable<[K_, V_]> | PlainObjInput<K_, V_>)[]
|
| 1232 |
+
): OrderedMap<K | K_, V | V_>;
|
| 1233 |
+
|
| 1234 |
+
mergeWith<K_, W, X>(
|
| 1235 |
+
merger: (oldVal: V, newVal: W, key: K) => X,
|
| 1236 |
+
...collections: (Iterable<[K_, W]> | PlainObjInput<K_, W>)[]
|
| 1237 |
+
): OrderedMap<K | K_, V | W | X>;
|
| 1238 |
+
|
| 1239 |
+
mergeDeep<K_, V_>(
|
| 1240 |
+
...collections: (Iterable<[K_, V_]> | PlainObjInput<K_, V_>)[]
|
| 1241 |
+
): OrderedMap<K | K_, V | V_>;
|
| 1242 |
+
|
| 1243 |
+
mergeDeepWith<K_, V_>(
|
| 1244 |
+
merger: (oldVal: any, newVal: any, key: any) => mixed,
|
| 1245 |
+
...collections: (Iterable<[K_, V_]> | PlainObjInput<K_, V_>)[]
|
| 1246 |
+
): OrderedMap<K | K_, V | V_>;
|
| 1247 |
+
|
| 1248 |
+
mergeIn(
|
| 1249 |
+
keyPath: Iterable<mixed>,
|
| 1250 |
+
...collections: (Iterable<mixed> | PlainObjInput<mixed, mixed>)[]
|
| 1251 |
+
): this;
|
| 1252 |
+
mergeDeepIn(
|
| 1253 |
+
keyPath: Iterable<mixed>,
|
| 1254 |
+
...collections: (Iterable<mixed> | PlainObjInput<mixed, mixed>)[]
|
| 1255 |
+
): this;
|
| 1256 |
+
|
| 1257 |
+
withMutations(mutator: (mutable: this) => mixed): this;
|
| 1258 |
+
asMutable(): this;
|
| 1259 |
+
wasAltered(): boolean;
|
| 1260 |
+
asImmutable(): this;
|
| 1261 |
+
|
| 1262 |
+
// Override specialized return types
|
| 1263 |
+
|
| 1264 |
+
flip(): OrderedMap<V, K>;
|
| 1265 |
+
|
| 1266 |
+
filter(predicate: typeof Boolean): OrderedMap<K, $NonMaybeType<V>>;
|
| 1267 |
+
filter(
|
| 1268 |
+
predicate: (value: V, key: K, iter: this) => mixed,
|
| 1269 |
+
context?: mixed
|
| 1270 |
+
): OrderedMap<K, V>;
|
| 1271 |
+
|
| 1272 |
+
partition(
|
| 1273 |
+
predicate: (value: V, key: K, iter: this) => mixed,
|
| 1274 |
+
context?: mixed
|
| 1275 |
+
): [this, this];
|
| 1276 |
+
|
| 1277 |
+
map<M>(
|
| 1278 |
+
mapper: (value: V, key: K, iter: this) => M,
|
| 1279 |
+
context?: mixed
|
| 1280 |
+
): OrderedMap<K, M>;
|
| 1281 |
+
|
| 1282 |
+
mapKeys<M>(
|
| 1283 |
+
mapper: (key: K, value: V, iter: this) => M,
|
| 1284 |
+
context?: mixed
|
| 1285 |
+
): OrderedMap<M, V>;
|
| 1286 |
+
|
| 1287 |
+
mapEntries<KM, VM>(
|
| 1288 |
+
mapper: (entry: [K, V], index: number, iter: this) => [KM, VM],
|
| 1289 |
+
context?: mixed
|
| 1290 |
+
): OrderedMap<KM, VM>;
|
| 1291 |
+
|
| 1292 |
+
flatMap<KM, VM>(
|
| 1293 |
+
mapper: (value: V, key: K, iter: this) => Iterable<[KM, VM]>,
|
| 1294 |
+
context?: mixed
|
| 1295 |
+
): OrderedMap<KM, VM>;
|
| 1296 |
+
|
| 1297 |
+
flatten(depth?: number): OrderedMap<any, any>;
|
| 1298 |
+
flatten(shallow?: boolean): OrderedMap<any, any>;
|
| 1299 |
+
}
|
| 1300 |
+
|
| 1301 |
+
declare function isSet(maybeSet: mixed): boolean %checks(maybeSet instanceof
|
| 1302 |
+
Set);
|
| 1303 |
+
declare class Set<+T> extends SetCollection<T> {
|
| 1304 |
+
static <T>(values?: Iterable<T>): Set<T>;
|
| 1305 |
+
|
| 1306 |
+
static of<T>(...values: T[]): Set<T>;
|
| 1307 |
+
static fromKeys<T>(
|
| 1308 |
+
values: Iterable<[T, mixed]> | PlainObjInput<T, mixed>
|
| 1309 |
+
): Set<T>;
|
| 1310 |
+
|
| 1311 |
+
static intersect(sets: Iterable<Iterable<T>>): Set<T>;
|
| 1312 |
+
static union(sets: Iterable<Iterable<T>>): Set<T>;
|
| 1313 |
+
|
| 1314 |
+
static isSet: typeof isSet;
|
| 1315 |
+
|
| 1316 |
+
size: number;
|
| 1317 |
+
|
| 1318 |
+
add<U>(value: U): Set<T | U>;
|
| 1319 |
+
delete(value: T): this;
|
| 1320 |
+
remove(value: T): this;
|
| 1321 |
+
clear(): this;
|
| 1322 |
+
union<U>(...collections: Iterable<U>[]): Set<T | U>;
|
| 1323 |
+
merge<U>(...collections: Iterable<U>[]): Set<T | U>;
|
| 1324 |
+
concat<U>(...collections: Iterable<U>[]): Set<T | U>;
|
| 1325 |
+
intersect<U>(...collections: Iterable<U>[]): Set<T & U>;
|
| 1326 |
+
subtract(...collections: Iterable<mixed>[]): this;
|
| 1327 |
+
|
| 1328 |
+
withMutations(mutator: (mutable: this) => mixed): this;
|
| 1329 |
+
asMutable(): this;
|
| 1330 |
+
wasAltered(): boolean;
|
| 1331 |
+
asImmutable(): this;
|
| 1332 |
+
|
| 1333 |
+
// Override specialized return types
|
| 1334 |
+
|
| 1335 |
+
filter(predicate: typeof Boolean): Set<$NonMaybeType<T>>;
|
| 1336 |
+
filter(
|
| 1337 |
+
predicate: (value: T, value: T, iter: this) => mixed,
|
| 1338 |
+
context?: mixed
|
| 1339 |
+
): Set<T>;
|
| 1340 |
+
|
| 1341 |
+
partition(
|
| 1342 |
+
predicate: (value: T, value: T, iter: this) => mixed,
|
| 1343 |
+
context?: mixed
|
| 1344 |
+
): [this, this];
|
| 1345 |
+
|
| 1346 |
+
map<M>(
|
| 1347 |
+
mapper: (value: T, value: T, iter: this) => M,
|
| 1348 |
+
context?: mixed
|
| 1349 |
+
): Set<M>;
|
| 1350 |
+
|
| 1351 |
+
flatMap<M>(
|
| 1352 |
+
mapper: (value: T, value: T, iter: this) => Iterable<M>,
|
| 1353 |
+
context?: mixed
|
| 1354 |
+
): Set<M>;
|
| 1355 |
+
|
| 1356 |
+
flatten(depth?: number): Set<any>;
|
| 1357 |
+
flatten(shallow?: boolean): Set<any>;
|
| 1358 |
+
}
|
| 1359 |
+
|
| 1360 |
+
// Overrides except for `isOrderedSet` are for specialized return types
|
| 1361 |
+
declare function isOrderedSet(
|
| 1362 |
+
maybeOrderedSet: mixed
|
| 1363 |
+
): boolean %checks(maybeOrderedSet instanceof OrderedSet);
|
| 1364 |
+
declare class OrderedSet<+T> extends Set<T> {
|
| 1365 |
+
static <T>(values?: Iterable<T>): OrderedSet<T>;
|
| 1366 |
+
|
| 1367 |
+
static of<T>(...values: T[]): OrderedSet<T>;
|
| 1368 |
+
static fromKeys<T>(
|
| 1369 |
+
values: Iterable<[T, mixed]> | PlainObjInput<T, mixed>
|
| 1370 |
+
): OrderedSet<T>;
|
| 1371 |
+
|
| 1372 |
+
static isOrderedSet: typeof isOrderedSet;
|
| 1373 |
+
|
| 1374 |
+
size: number;
|
| 1375 |
+
|
| 1376 |
+
add<U>(value: U): OrderedSet<T | U>;
|
| 1377 |
+
union<U>(...collections: Iterable<U>[]): OrderedSet<T | U>;
|
| 1378 |
+
merge<U>(...collections: Iterable<U>[]): OrderedSet<T | U>;
|
| 1379 |
+
concat<U>(...collections: Iterable<U>[]): OrderedSet<T | U>;
|
| 1380 |
+
intersect<U>(...collections: Iterable<U>[]): OrderedSet<T & U>;
|
| 1381 |
+
|
| 1382 |
+
filter(predicate: typeof Boolean): OrderedSet<$NonMaybeType<T>>;
|
| 1383 |
+
filter(
|
| 1384 |
+
predicate: (value: T, value: T, iter: this) => mixed,
|
| 1385 |
+
context?: mixed
|
| 1386 |
+
): OrderedSet<T>;
|
| 1387 |
+
|
| 1388 |
+
partition(
|
| 1389 |
+
predicate: (value: T, value: T, iter: this) => mixed,
|
| 1390 |
+
context?: mixed
|
| 1391 |
+
): [this, this];
|
| 1392 |
+
|
| 1393 |
+
map<M>(
|
| 1394 |
+
mapper: (value: T, value: T, iter: this) => M,
|
| 1395 |
+
context?: mixed
|
| 1396 |
+
): OrderedSet<M>;
|
| 1397 |
+
|
| 1398 |
+
flatMap<M>(
|
| 1399 |
+
mapper: (value: T, value: T, iter: this) => Iterable<M>,
|
| 1400 |
+
context?: mixed
|
| 1401 |
+
): OrderedSet<M>;
|
| 1402 |
+
|
| 1403 |
+
flatten(depth?: number): OrderedSet<any>;
|
| 1404 |
+
flatten(shallow?: boolean): OrderedSet<any>;
|
| 1405 |
+
|
| 1406 |
+
zip<A>(a: Iterable<A>, ..._: []): OrderedSet<[T, A]>;
|
| 1407 |
+
zip<A, B>(a: Iterable<A>, b: Iterable<B>, ..._: []): OrderedSet<[T, A, B]>;
|
| 1408 |
+
zip<A, B, C>(
|
| 1409 |
+
a: Iterable<A>,
|
| 1410 |
+
b: Iterable<B>,
|
| 1411 |
+
c: Iterable<C>,
|
| 1412 |
+
..._: []
|
| 1413 |
+
): OrderedSet<[T, A, B, C]>;
|
| 1414 |
+
zip<A, B, C, D>(
|
| 1415 |
+
a: Iterable<A>,
|
| 1416 |
+
b: Iterable<B>,
|
| 1417 |
+
c: Iterable<C>,
|
| 1418 |
+
d: Iterable<D>,
|
| 1419 |
+
..._: []
|
| 1420 |
+
): OrderedSet<[T, A, B, C, D]>;
|
| 1421 |
+
zip<A, B, C, D, E>(
|
| 1422 |
+
a: Iterable<A>,
|
| 1423 |
+
b: Iterable<B>,
|
| 1424 |
+
c: Iterable<C>,
|
| 1425 |
+
d: Iterable<D>,
|
| 1426 |
+
e: Iterable<E>,
|
| 1427 |
+
..._: []
|
| 1428 |
+
): OrderedSet<[T, A, B, C, D, E]>;
|
| 1429 |
+
|
| 1430 |
+
zipAll<A>(a: Iterable<A>, ..._: []): OrderedSet<[T | void, A | void]>;
|
| 1431 |
+
zipAll<A, B>(
|
| 1432 |
+
a: Iterable<A>,
|
| 1433 |
+
b: Iterable<B>,
|
| 1434 |
+
..._: []
|
| 1435 |
+
): OrderedSet<[T | void, A | void, B | void]>;
|
| 1436 |
+
zipAll<A, B, C>(
|
| 1437 |
+
a: Iterable<A>,
|
| 1438 |
+
b: Iterable<B>,
|
| 1439 |
+
c: Iterable<C>,
|
| 1440 |
+
..._: []
|
| 1441 |
+
): OrderedSet<[T | void, A | void, B | void, C | void]>;
|
| 1442 |
+
zipAll<A, B, C, D>(
|
| 1443 |
+
a: Iterable<A>,
|
| 1444 |
+
b: Iterable<B>,
|
| 1445 |
+
c: Iterable<C>,
|
| 1446 |
+
d: Iterable<D>,
|
| 1447 |
+
..._: []
|
| 1448 |
+
): OrderedSet<[T | void, A | void, B | void, C | void, D | void]>;
|
| 1449 |
+
zipAll<A, B, C, D, E>(
|
| 1450 |
+
a: Iterable<A>,
|
| 1451 |
+
b: Iterable<B>,
|
| 1452 |
+
c: Iterable<C>,
|
| 1453 |
+
d: Iterable<D>,
|
| 1454 |
+
e: Iterable<E>,
|
| 1455 |
+
..._: []
|
| 1456 |
+
): OrderedSet<[T | void, A | void, B | void, C | void, D | void, E | void]>;
|
| 1457 |
+
|
| 1458 |
+
zipWith<A, R>(
|
| 1459 |
+
zipper: (value: T, a: A) => R,
|
| 1460 |
+
a: Iterable<A>,
|
| 1461 |
+
..._: []
|
| 1462 |
+
): OrderedSet<R>;
|
| 1463 |
+
zipWith<A, B, R>(
|
| 1464 |
+
zipper: (value: T, a: A, b: B) => R,
|
| 1465 |
+
a: Iterable<A>,
|
| 1466 |
+
b: Iterable<B>,
|
| 1467 |
+
..._: []
|
| 1468 |
+
): OrderedSet<R>;
|
| 1469 |
+
zipWith<A, B, C, R>(
|
| 1470 |
+
zipper: (value: T, a: A, b: B, c: C) => R,
|
| 1471 |
+
a: Iterable<A>,
|
| 1472 |
+
b: Iterable<B>,
|
| 1473 |
+
c: Iterable<C>,
|
| 1474 |
+
..._: []
|
| 1475 |
+
): OrderedSet<R>;
|
| 1476 |
+
zipWith<A, B, C, D, R>(
|
| 1477 |
+
zipper: (value: T, a: A, b: B, c: C, d: D) => R,
|
| 1478 |
+
a: Iterable<A>,
|
| 1479 |
+
b: Iterable<B>,
|
| 1480 |
+
c: Iterable<C>,
|
| 1481 |
+
d: Iterable<D>,
|
| 1482 |
+
..._: []
|
| 1483 |
+
): OrderedSet<R>;
|
| 1484 |
+
zipWith<A, B, C, D, E, R>(
|
| 1485 |
+
zipper: (value: T, a: A, b: B, c: C, d: D, e: E) => R,
|
| 1486 |
+
a: Iterable<A>,
|
| 1487 |
+
b: Iterable<B>,
|
| 1488 |
+
c: Iterable<C>,
|
| 1489 |
+
d: Iterable<D>,
|
| 1490 |
+
e: Iterable<E>,
|
| 1491 |
+
..._: []
|
| 1492 |
+
): OrderedSet<R>;
|
| 1493 |
+
}
|
| 1494 |
+
|
| 1495 |
+
declare function isStack(
|
| 1496 |
+
maybeStack: mixed
|
| 1497 |
+
): boolean %checks(maybeStack instanceof Stack);
|
| 1498 |
+
declare class Stack<+T> extends IndexedCollection<T> {
|
| 1499 |
+
static <T>(collection?: Iterable<T>): Stack<T>;
|
| 1500 |
+
|
| 1501 |
+
static isStack(maybeStack: mixed): boolean;
|
| 1502 |
+
static of<T>(...values: T[]): Stack<T>;
|
| 1503 |
+
|
| 1504 |
+
static isStack: typeof isStack;
|
| 1505 |
+
|
| 1506 |
+
size: number;
|
| 1507 |
+
|
| 1508 |
+
peek(): T;
|
| 1509 |
+
clear(): this;
|
| 1510 |
+
unshift<U>(...values: U[]): Stack<T | U>;
|
| 1511 |
+
unshiftAll<U>(iter: Iterable<U>): Stack<T | U>;
|
| 1512 |
+
shift(): this;
|
| 1513 |
+
push<U>(...values: U[]): Stack<T | U>;
|
| 1514 |
+
pushAll<U>(iter: Iterable<U>): Stack<T | U>;
|
| 1515 |
+
pop(): this;
|
| 1516 |
+
|
| 1517 |
+
withMutations(mutator: (mutable: this) => mixed): this;
|
| 1518 |
+
asMutable(): this;
|
| 1519 |
+
wasAltered(): boolean;
|
| 1520 |
+
asImmutable(): this;
|
| 1521 |
+
|
| 1522 |
+
// Override specialized return types
|
| 1523 |
+
|
| 1524 |
+
concat<C>(...iters: Array<Iterable<C> | C>): Stack<T | C>;
|
| 1525 |
+
|
| 1526 |
+
filter(predicate: typeof Boolean): Stack<$NonMaybeType<T>>;
|
| 1527 |
+
filter(
|
| 1528 |
+
predicate: (value: T, index: number, iter: this) => mixed,
|
| 1529 |
+
context?: mixed
|
| 1530 |
+
): Stack<T>;
|
| 1531 |
+
|
| 1532 |
+
map<M>(
|
| 1533 |
+
mapper: (value: T, index: number, iter: this) => M,
|
| 1534 |
+
context?: mixed
|
| 1535 |
+
): Stack<M>;
|
| 1536 |
+
|
| 1537 |
+
flatMap<M>(
|
| 1538 |
+
mapper: (value: T, index: number, iter: this) => Iterable<M>,
|
| 1539 |
+
context?: mixed
|
| 1540 |
+
): Stack<M>;
|
| 1541 |
+
|
| 1542 |
+
flatten(depth?: number): Stack<any>;
|
| 1543 |
+
flatten(shallow?: boolean): Stack<any>;
|
| 1544 |
+
|
| 1545 |
+
zip<A>(a: Iterable<A>, ..._: []): Stack<[T, A]>;
|
| 1546 |
+
zip<A, B>(a: Iterable<A>, b: Iterable<B>, ..._: []): Stack<[T, A, B]>;
|
| 1547 |
+
zip<A, B, C>(
|
| 1548 |
+
a: Iterable<A>,
|
| 1549 |
+
b: Iterable<B>,
|
| 1550 |
+
c: Iterable<C>,
|
| 1551 |
+
..._: []
|
| 1552 |
+
): Stack<[T, A, B, C]>;
|
| 1553 |
+
zip<A, B, C, D>(
|
| 1554 |
+
a: Iterable<A>,
|
| 1555 |
+
b: Iterable<B>,
|
| 1556 |
+
c: Iterable<C>,
|
| 1557 |
+
d: Iterable<D>,
|
| 1558 |
+
..._: []
|
| 1559 |
+
): Stack<[T, A, B, C, D]>;
|
| 1560 |
+
zip<A, B, C, D, E>(
|
| 1561 |
+
a: Iterable<A>,
|
| 1562 |
+
b: Iterable<B>,
|
| 1563 |
+
c: Iterable<C>,
|
| 1564 |
+
d: Iterable<D>,
|
| 1565 |
+
e: Iterable<E>,
|
| 1566 |
+
..._: []
|
| 1567 |
+
): Stack<[T, A, B, C, D, E]>;
|
| 1568 |
+
|
| 1569 |
+
zipAll<A>(a: Iterable<A>, ..._: []): Stack<[T | void, A | void]>;
|
| 1570 |
+
zipAll<A, B>(
|
| 1571 |
+
a: Iterable<A>,
|
| 1572 |
+
b: Iterable<B>,
|
| 1573 |
+
..._: []
|
| 1574 |
+
): Stack<[T | void, A | void, B | void]>;
|
| 1575 |
+
zipAll<A, B, C>(
|
| 1576 |
+
a: Iterable<A>,
|
| 1577 |
+
b: Iterable<B>,
|
| 1578 |
+
c: Iterable<C>,
|
| 1579 |
+
..._: []
|
| 1580 |
+
): Stack<[T | void, A | void, B | void, C | void]>;
|
| 1581 |
+
zipAll<A, B, C, D>(
|
| 1582 |
+
a: Iterable<A>,
|
| 1583 |
+
b: Iterable<B>,
|
| 1584 |
+
c: Iterable<C>,
|
| 1585 |
+
d: Iterable<D>,
|
| 1586 |
+
..._: []
|
| 1587 |
+
): Stack<[T | void, A | void, B | void, C | void, D | void]>;
|
| 1588 |
+
zipAll<A, B, C, D, E>(
|
| 1589 |
+
a: Iterable<A>,
|
| 1590 |
+
b: Iterable<B>,
|
| 1591 |
+
c: Iterable<C>,
|
| 1592 |
+
d: Iterable<D>,
|
| 1593 |
+
e: Iterable<E>,
|
| 1594 |
+
..._: []
|
| 1595 |
+
): Stack<[T | void, A | void, B | void, C | void, D | void, E | void]>;
|
| 1596 |
+
|
| 1597 |
+
zipWith<A, R>(
|
| 1598 |
+
zipper: (value: T, a: A) => R,
|
| 1599 |
+
a: Iterable<A>,
|
| 1600 |
+
..._: []
|
| 1601 |
+
): Stack<R>;
|
| 1602 |
+
zipWith<A, B, R>(
|
| 1603 |
+
zipper: (value: T, a: A, b: B) => R,
|
| 1604 |
+
a: Iterable<A>,
|
| 1605 |
+
b: Iterable<B>,
|
| 1606 |
+
..._: []
|
| 1607 |
+
): Stack<R>;
|
| 1608 |
+
zipWith<A, B, C, R>(
|
| 1609 |
+
zipper: (value: T, a: A, b: B, c: C) => R,
|
| 1610 |
+
a: Iterable<A>,
|
| 1611 |
+
b: Iterable<B>,
|
| 1612 |
+
c: Iterable<C>,
|
| 1613 |
+
..._: []
|
| 1614 |
+
): Stack<R>;
|
| 1615 |
+
zipWith<A, B, C, D, R>(
|
| 1616 |
+
zipper: (value: T, a: A, b: B, c: C, d: D) => R,
|
| 1617 |
+
a: Iterable<A>,
|
| 1618 |
+
b: Iterable<B>,
|
| 1619 |
+
c: Iterable<C>,
|
| 1620 |
+
d: Iterable<D>,
|
| 1621 |
+
..._: []
|
| 1622 |
+
): Stack<R>;
|
| 1623 |
+
zipWith<A, B, C, D, E, R>(
|
| 1624 |
+
zipper: (value: T, a: A, b: B, c: C, d: D, e: E) => R,
|
| 1625 |
+
a: Iterable<A>,
|
| 1626 |
+
b: Iterable<B>,
|
| 1627 |
+
c: Iterable<C>,
|
| 1628 |
+
d: Iterable<D>,
|
| 1629 |
+
e: Iterable<E>,
|
| 1630 |
+
..._: []
|
| 1631 |
+
): Stack<R>;
|
| 1632 |
+
}
|
| 1633 |
+
|
| 1634 |
+
declare function Range(
|
| 1635 |
+
start?: number,
|
| 1636 |
+
end?: number,
|
| 1637 |
+
step?: number
|
| 1638 |
+
): IndexedSeq<number>;
|
| 1639 |
+
declare function Repeat<T>(value: T, times?: number): IndexedSeq<T>;
|
| 1640 |
+
|
| 1641 |
+
// The type of a Record factory function.
|
| 1642 |
+
type RecordFactory<Values: Object> = Class<RecordInstance<Values>>;
|
| 1643 |
+
|
| 1644 |
+
// The type of runtime Record instances.
|
| 1645 |
+
type RecordOf<Values: Object> = RecordInstance<Values> & $ReadOnly<Values>;
|
| 1646 |
+
|
| 1647 |
+
// The values of a Record instance.
|
| 1648 |
+
type _RecordValues<T, R: RecordInstance<T> | T> = R;
|
| 1649 |
+
type RecordValues<R> = _RecordValues<*, R>;
|
| 1650 |
+
|
| 1651 |
+
declare function isRecord(
|
| 1652 |
+
maybeRecord: any
|
| 1653 |
+
): boolean %checks(maybeRecord instanceof RecordInstance);
|
| 1654 |
+
declare class Record {
|
| 1655 |
+
static <Values: Object>(spec: Values, name?: string): typeof RecordInstance;
|
| 1656 |
+
constructor<Values: Object>(
|
| 1657 |
+
spec: Values,
|
| 1658 |
+
name?: string
|
| 1659 |
+
): typeof RecordInstance;
|
| 1660 |
+
|
| 1661 |
+
static isRecord: typeof isRecord;
|
| 1662 |
+
|
| 1663 |
+
static getDescriptiveName(record: RecordInstance<any>): string;
|
| 1664 |
+
}
|
| 1665 |
+
|
| 1666 |
+
declare class RecordInstance<T: Object = Object> {
|
| 1667 |
+
static (values?: Iterable<[$Keys<T>, $ValOf<T>]> | $Shape<T>): RecordOf<T>;
|
| 1668 |
+
// Note: a constructor can only create an instance of RecordInstance<T>,
|
| 1669 |
+
// it's encouraged to not use `new` when creating Records.
|
| 1670 |
+
constructor(values?: Iterable<[$Keys<T>, $ValOf<T>]> | $Shape<T>): void;
|
| 1671 |
+
|
| 1672 |
+
size: number;
|
| 1673 |
+
|
| 1674 |
+
has(key: string): boolean;
|
| 1675 |
+
|
| 1676 |
+
get<K: $Keys<T>>(key: K, ..._: []): $ElementType<T, K>;
|
| 1677 |
+
get<K: $Keys<T>, NSV>(key: K, notSetValue: NSV): $ElementType<T, K> | NSV;
|
| 1678 |
+
|
| 1679 |
+
hasIn(keyPath: Iterable<mixed>): boolean;
|
| 1680 |
+
|
| 1681 |
+
getIn(keyPath: [], notSetValue?: mixed): this & $ReadOnly<T>;
|
| 1682 |
+
getIn<K: $Keys<T>>(keyPath: [K], notSetValue?: mixed): $ElementType<T, K>;
|
| 1683 |
+
getIn<NSV, K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>>(
|
| 1684 |
+
keyPath: [K, K2],
|
| 1685 |
+
notSetValue: NSV
|
| 1686 |
+
): $ValOf<$ValOf<T, K>, K2> | NSV;
|
| 1687 |
+
getIn<
|
| 1688 |
+
NSV,
|
| 1689 |
+
K: $Keys<T>,
|
| 1690 |
+
K2: $KeyOf<$ValOf<T, K>>,
|
| 1691 |
+
K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>
|
| 1692 |
+
>(
|
| 1693 |
+
keyPath: [K, K2, K3],
|
| 1694 |
+
notSetValue: NSV
|
| 1695 |
+
): $ValOf<$ValOf<$ValOf<T, K>, K2>, K3> | NSV;
|
| 1696 |
+
getIn<
|
| 1697 |
+
NSV,
|
| 1698 |
+
K: $Keys<T>,
|
| 1699 |
+
K2: $KeyOf<$ValOf<T, K>>,
|
| 1700 |
+
K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>,
|
| 1701 |
+
K4: $KeyOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>>
|
| 1702 |
+
>(
|
| 1703 |
+
keyPath: [K, K2, K3, K4],
|
| 1704 |
+
notSetValue: NSV
|
| 1705 |
+
): $ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4> | NSV;
|
| 1706 |
+
getIn<
|
| 1707 |
+
NSV,
|
| 1708 |
+
K: $Keys<T>,
|
| 1709 |
+
K2: $KeyOf<$ValOf<T, K>>,
|
| 1710 |
+
K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>,
|
| 1711 |
+
K4: $KeyOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>>,
|
| 1712 |
+
K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>>
|
| 1713 |
+
>(
|
| 1714 |
+
keyPath: [K, K2, K3, K4, K5],
|
| 1715 |
+
notSetValue: NSV
|
| 1716 |
+
): $ValOf<$ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>, K5> | NSV;
|
| 1717 |
+
|
| 1718 |
+
equals(other: any): boolean;
|
| 1719 |
+
hashCode(): number;
|
| 1720 |
+
|
| 1721 |
+
set<K: $Keys<T>>(key: K, value: $ElementType<T, K>): this & $ReadOnly<T>;
|
| 1722 |
+
update<K: $Keys<T>>(
|
| 1723 |
+
key: K,
|
| 1724 |
+
updater: (value: $ElementType<T, K>) => $ElementType<T, K>
|
| 1725 |
+
): this & $ReadOnly<T>;
|
| 1726 |
+
merge(
|
| 1727 |
+
...collections: Array<Iterable<[$Keys<T>, $ValOf<T>]> | $Shape<T>>
|
| 1728 |
+
): this & $ReadOnly<T>;
|
| 1729 |
+
mergeDeep(
|
| 1730 |
+
...collections: Array<Iterable<[$Keys<T>, $ValOf<T>]> | $Shape<T>>
|
| 1731 |
+
): this & $ReadOnly<T>;
|
| 1732 |
+
|
| 1733 |
+
mergeWith(
|
| 1734 |
+
merger: (oldVal: $ValOf<T>, newVal: $ValOf<T>, key: $Keys<T>) => $ValOf<T>,
|
| 1735 |
+
...collections: Array<Iterable<[$Keys<T>, $ValOf<T>]> | $Shape<T>>
|
| 1736 |
+
): this & $ReadOnly<T>;
|
| 1737 |
+
mergeDeepWith(
|
| 1738 |
+
merger: (oldVal: any, newVal: any, key: any) => any,
|
| 1739 |
+
...collections: Array<Iterable<[$Keys<T>, $ValOf<T>]> | $Shape<T>>
|
| 1740 |
+
): this & $ReadOnly<T>;
|
| 1741 |
+
|
| 1742 |
+
delete<K: $Keys<T>>(key: K): this & $ReadOnly<T>;
|
| 1743 |
+
remove<K: $Keys<T>>(key: K): this & $ReadOnly<T>;
|
| 1744 |
+
clear(): this & $ReadOnly<T>;
|
| 1745 |
+
|
| 1746 |
+
setIn<S>(keyPath: [], value: S): S;
|
| 1747 |
+
setIn<K: $Keys<T>, S: $ValOf<T, K>>(
|
| 1748 |
+
keyPath: [K],
|
| 1749 |
+
value: S
|
| 1750 |
+
): this & $ReadOnly<T>;
|
| 1751 |
+
setIn<K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>, S: $ValOf<$ValOf<T, K>, K2>>(
|
| 1752 |
+
keyPath: [K, K2],
|
| 1753 |
+
value: S
|
| 1754 |
+
): this & $ReadOnly<T>;
|
| 1755 |
+
setIn<
|
| 1756 |
+
K: $Keys<T>,
|
| 1757 |
+
K2: $KeyOf<$ValOf<T, K>>,
|
| 1758 |
+
K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>,
|
| 1759 |
+
S: $ValOf<$ValOf<$ValOf<T, K>, K2>, K3>
|
| 1760 |
+
>(
|
| 1761 |
+
keyPath: [K, K2, K3],
|
| 1762 |
+
value: S
|
| 1763 |
+
): this & $ReadOnly<T>;
|
| 1764 |
+
setIn<
|
| 1765 |
+
K: $Keys<T>,
|
| 1766 |
+
K2: $KeyOf<$ValOf<T, K>>,
|
| 1767 |
+
K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>,
|
| 1768 |
+
K4: $KeyOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>>,
|
| 1769 |
+
S: $ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>
|
| 1770 |
+
>(
|
| 1771 |
+
keyPath: [K, K2, K3, K4],
|
| 1772 |
+
value: S
|
| 1773 |
+
): this & $ReadOnly<T>;
|
| 1774 |
+
setIn<
|
| 1775 |
+
K: $Keys<T>,
|
| 1776 |
+
K2: $KeyOf<$ValOf<T, K>>,
|
| 1777 |
+
K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>,
|
| 1778 |
+
K4: $KeyOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>>,
|
| 1779 |
+
K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>>,
|
| 1780 |
+
S: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>, K5>
|
| 1781 |
+
>(
|
| 1782 |
+
keyPath: [K, K2, K3, K4, K5],
|
| 1783 |
+
value: S
|
| 1784 |
+
): this & $ReadOnly<T>;
|
| 1785 |
+
|
| 1786 |
+
deleteIn(keyPath: []): void;
|
| 1787 |
+
deleteIn<K: $Keys<T>>(keyPath: [K]): this & $ReadOnly<T>;
|
| 1788 |
+
deleteIn<K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>>(
|
| 1789 |
+
keyPath: [K, K2]
|
| 1790 |
+
): this & $ReadOnly<T>;
|
| 1791 |
+
deleteIn<
|
| 1792 |
+
K: $Keys<T>,
|
| 1793 |
+
K2: $KeyOf<$ValOf<T, K>>,
|
| 1794 |
+
K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>
|
| 1795 |
+
>(
|
| 1796 |
+
keyPath: [K, K2, K3]
|
| 1797 |
+
): this & $ReadOnly<T>;
|
| 1798 |
+
deleteIn<
|
| 1799 |
+
K: $Keys<T>,
|
| 1800 |
+
K2: $KeyOf<$ValOf<T, K>>,
|
| 1801 |
+
K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>,
|
| 1802 |
+
K4: $KeyOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>>
|
| 1803 |
+
>(
|
| 1804 |
+
keyPath: [K, K2, K3, K4]
|
| 1805 |
+
): this & $ReadOnly<T>;
|
| 1806 |
+
deleteIn<
|
| 1807 |
+
K: $Keys<T>,
|
| 1808 |
+
K2: $KeyOf<$ValOf<T, K>>,
|
| 1809 |
+
K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>,
|
| 1810 |
+
K4: $KeyOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>>,
|
| 1811 |
+
K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>>
|
| 1812 |
+
>(
|
| 1813 |
+
keyPath: [K, K2, K3, K4, K5]
|
| 1814 |
+
): this & $ReadOnly<T>;
|
| 1815 |
+
|
| 1816 |
+
removeIn(keyPath: []): void;
|
| 1817 |
+
removeIn<K: $Keys<T>>(keyPath: [K]): this & $ReadOnly<T>;
|
| 1818 |
+
removeIn<K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>>(
|
| 1819 |
+
keyPath: [K, K2]
|
| 1820 |
+
): this & $ReadOnly<T>;
|
| 1821 |
+
removeIn<
|
| 1822 |
+
K: $Keys<T>,
|
| 1823 |
+
K2: $KeyOf<$ValOf<T, K>>,
|
| 1824 |
+
K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>
|
| 1825 |
+
>(
|
| 1826 |
+
keyPath: [K, K2, K3]
|
| 1827 |
+
): this & $ReadOnly<T>;
|
| 1828 |
+
removeIn<
|
| 1829 |
+
K: $Keys<T>,
|
| 1830 |
+
K2: $KeyOf<$ValOf<T, K>>,
|
| 1831 |
+
K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>,
|
| 1832 |
+
K4: $KeyOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>>
|
| 1833 |
+
>(
|
| 1834 |
+
keyPath: [K, K2, K3, K4]
|
| 1835 |
+
): this & $ReadOnly<T>;
|
| 1836 |
+
removeIn<
|
| 1837 |
+
K: $Keys<T>,
|
| 1838 |
+
K2: $KeyOf<$ValOf<T, K>>,
|
| 1839 |
+
K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>,
|
| 1840 |
+
K4: $KeyOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>>,
|
| 1841 |
+
K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>>
|
| 1842 |
+
>(
|
| 1843 |
+
keyPath: [K, K2, K3, K4, K5]
|
| 1844 |
+
): this & $ReadOnly<T>;
|
| 1845 |
+
|
| 1846 |
+
updateIn<U>(
|
| 1847 |
+
keyPath: [],
|
| 1848 |
+
notSetValue: mixed,
|
| 1849 |
+
updater: (value: this & T) => U
|
| 1850 |
+
): U;
|
| 1851 |
+
updateIn<U>(keyPath: [], updater: (value: this & T) => U): U;
|
| 1852 |
+
updateIn<NSV, K: $Keys<T>, S: $ValOf<T, K>>(
|
| 1853 |
+
keyPath: [K],
|
| 1854 |
+
notSetValue: NSV,
|
| 1855 |
+
updater: (value: $ValOf<T, K>) => S
|
| 1856 |
+
): this & $ReadOnly<T>;
|
| 1857 |
+
updateIn<K: $Keys<T>, S: $ValOf<T, K>>(
|
| 1858 |
+
keyPath: [K],
|
| 1859 |
+
updater: (value: $ValOf<T, K>) => S
|
| 1860 |
+
): this & $ReadOnly<T>;
|
| 1861 |
+
updateIn<
|
| 1862 |
+
NSV,
|
| 1863 |
+
K: $Keys<T>,
|
| 1864 |
+
K2: $KeyOf<$ValOf<T, K>>,
|
| 1865 |
+
S: $ValOf<$ValOf<T, K>, K2>
|
| 1866 |
+
>(
|
| 1867 |
+
keyPath: [K, K2],
|
| 1868 |
+
notSetValue: NSV,
|
| 1869 |
+
updater: (value: $ValOf<$ValOf<T, K>, K2> | NSV) => S
|
| 1870 |
+
): this & $ReadOnly<T>;
|
| 1871 |
+
updateIn<K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>, S: $ValOf<$ValOf<T, K>, K2>>(
|
| 1872 |
+
keyPath: [K, K2],
|
| 1873 |
+
updater: (value: $ValOf<$ValOf<T, K>, K2>) => S
|
| 1874 |
+
): this & $ReadOnly<T>;
|
| 1875 |
+
updateIn<
|
| 1876 |
+
NSV,
|
| 1877 |
+
K: $Keys<T>,
|
| 1878 |
+
K2: $KeyOf<$ValOf<T, K>>,
|
| 1879 |
+
K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>,
|
| 1880 |
+
S: $ValOf<$ValOf<$ValOf<T, K>, K2>, K3>
|
| 1881 |
+
>(
|
| 1882 |
+
keyPath: [K, K2, K3],
|
| 1883 |
+
notSetValue: NSV,
|
| 1884 |
+
updater: (value: $ValOf<$ValOf<$ValOf<T, K>, K2>, K3> | NSV) => S
|
| 1885 |
+
): this & $ReadOnly<T>;
|
| 1886 |
+
updateIn<
|
| 1887 |
+
K: $Keys<T>,
|
| 1888 |
+
K2: $KeyOf<$ValOf<T, K>>,
|
| 1889 |
+
K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>,
|
| 1890 |
+
S: $ValOf<$ValOf<$ValOf<T, K>, K2>, K3>
|
| 1891 |
+
>(
|
| 1892 |
+
keyPath: [K, K2, K3],
|
| 1893 |
+
updater: (value: $ValOf<$ValOf<$ValOf<T, K>, K2>, K3>) => S
|
| 1894 |
+
): this & $ReadOnly<T>;
|
| 1895 |
+
updateIn<
|
| 1896 |
+
NSV,
|
| 1897 |
+
K: $Keys<T>,
|
| 1898 |
+
K2: $KeyOf<$ValOf<T, K>>,
|
| 1899 |
+
K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>,
|
| 1900 |
+
K4: $KeyOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>>,
|
| 1901 |
+
S: $ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>
|
| 1902 |
+
>(
|
| 1903 |
+
keyPath: [K, K2, K3, K4],
|
| 1904 |
+
notSetValue: NSV,
|
| 1905 |
+
updater: (
|
| 1906 |
+
value: $ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4> | NSV
|
| 1907 |
+
) => S
|
| 1908 |
+
): this & $ReadOnly<T>;
|
| 1909 |
+
updateIn<
|
| 1910 |
+
K: $Keys<T>,
|
| 1911 |
+
K2: $KeyOf<$ValOf<T, K>>,
|
| 1912 |
+
K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>,
|
| 1913 |
+
K4: $KeyOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>>,
|
| 1914 |
+
S: $ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>
|
| 1915 |
+
>(
|
| 1916 |
+
keyPath: [K, K2, K3, K4],
|
| 1917 |
+
updater: (value: $ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>) => S
|
| 1918 |
+
): this & $ReadOnly<T>;
|
| 1919 |
+
updateIn<
|
| 1920 |
+
NSV,
|
| 1921 |
+
K: $Keys<T>,
|
| 1922 |
+
K2: $KeyOf<$ValOf<T, K>>,
|
| 1923 |
+
K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>,
|
| 1924 |
+
K4: $KeyOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>>,
|
| 1925 |
+
K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>>,
|
| 1926 |
+
S: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>, K5>
|
| 1927 |
+
>(
|
| 1928 |
+
keyPath: [K, K2, K3, K4, K5],
|
| 1929 |
+
notSetValue: NSV,
|
| 1930 |
+
updater: (
|
| 1931 |
+
value: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>, K5> | NSV
|
| 1932 |
+
) => S
|
| 1933 |
+
): this & $ReadOnly<T>;
|
| 1934 |
+
updateIn<
|
| 1935 |
+
K: $Keys<T>,
|
| 1936 |
+
K2: $KeyOf<$ValOf<T, K>>,
|
| 1937 |
+
K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>,
|
| 1938 |
+
K4: $KeyOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>>,
|
| 1939 |
+
K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>>,
|
| 1940 |
+
S: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>, K5>
|
| 1941 |
+
>(
|
| 1942 |
+
keyPath: [K, K2, K3, K4, K5],
|
| 1943 |
+
updater: (
|
| 1944 |
+
value: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>, K5>
|
| 1945 |
+
) => S
|
| 1946 |
+
): this & $ReadOnly<T>;
|
| 1947 |
+
|
| 1948 |
+
mergeIn(
|
| 1949 |
+
keyPath: Iterable<mixed>,
|
| 1950 |
+
...collections: Array<any>
|
| 1951 |
+
): this & $ReadOnly<T>;
|
| 1952 |
+
mergeDeepIn(
|
| 1953 |
+
keyPath: Iterable<mixed>,
|
| 1954 |
+
...collections: Array<any>
|
| 1955 |
+
): this & $ReadOnly<T>;
|
| 1956 |
+
|
| 1957 |
+
toSeq(): KeyedSeq<$Keys<T>, any>;
|
| 1958 |
+
|
| 1959 |
+
toJS(): { [key: $Keys<T>]: mixed };
|
| 1960 |
+
toJSON(): T;
|
| 1961 |
+
toObject(): T;
|
| 1962 |
+
|
| 1963 |
+
withMutations(mutator: (mutable: this & T) => mixed): this & $ReadOnly<T>;
|
| 1964 |
+
asMutable(): this & $ReadOnly<T>;
|
| 1965 |
+
wasAltered(): boolean;
|
| 1966 |
+
asImmutable(): this & $ReadOnly<T>;
|
| 1967 |
+
|
| 1968 |
+
@@iterator(): Iterator<[$Keys<T>, $ValOf<T>]>;
|
| 1969 |
+
}
|
| 1970 |
+
|
| 1971 |
+
declare function fromJS(
|
| 1972 |
+
jsValue: mixed,
|
| 1973 |
+
reviver?: (
|
| 1974 |
+
key: string | number,
|
| 1975 |
+
sequence: KeyedCollection<string, mixed> | IndexedCollection<mixed>,
|
| 1976 |
+
path?: Array<string | number>
|
| 1977 |
+
) => mixed
|
| 1978 |
+
): Collection<mixed, mixed>;
|
| 1979 |
+
|
| 1980 |
+
declare function is(first: mixed, second: mixed): boolean;
|
| 1981 |
+
declare function hash(value: mixed): number;
|
| 1982 |
+
|
| 1983 |
+
declare function get<C: Object, K: $Keys<C>>(
|
| 1984 |
+
collection: C,
|
| 1985 |
+
key: K,
|
| 1986 |
+
notSetValue: mixed
|
| 1987 |
+
): $ValOf<C, K>;
|
| 1988 |
+
declare function get<C, K: $KeyOf<C>, NSV>(
|
| 1989 |
+
collection: C,
|
| 1990 |
+
key: K,
|
| 1991 |
+
notSetValue: NSV
|
| 1992 |
+
): $ValOf<C, K> | NSV;
|
| 1993 |
+
|
| 1994 |
+
declare function has(collection: Object, key: mixed): boolean;
|
| 1995 |
+
declare function remove<C>(collection: C, key: $KeyOf<C>): C;
|
| 1996 |
+
declare function set<C, K: $KeyOf<C>, V: $ValOf<C, K>>(
|
| 1997 |
+
collection: C,
|
| 1998 |
+
key: K,
|
| 1999 |
+
value: V
|
| 2000 |
+
): C;
|
| 2001 |
+
declare function update<C, K: $KeyOf<C>, V: $ValOf<C, K>, NSV>(
|
| 2002 |
+
collection: C,
|
| 2003 |
+
key: K,
|
| 2004 |
+
notSetValue: NSV,
|
| 2005 |
+
updater: ($ValOf<C, K> | NSV) => V
|
| 2006 |
+
): C;
|
| 2007 |
+
declare function update<C, K: $KeyOf<C>, V: $ValOf<C, K>>(
|
| 2008 |
+
collection: C,
|
| 2009 |
+
key: K,
|
| 2010 |
+
updater: ($ValOf<C, K>) => V
|
| 2011 |
+
): C;
|
| 2012 |
+
|
| 2013 |
+
declare function getIn<C>(collection: C, keyPath: [], notSetValue?: mixed): C;
|
| 2014 |
+
declare function getIn<C, K: $KeyOf<C>, NSV>(
|
| 2015 |
+
collection: C,
|
| 2016 |
+
keyPath: [K],
|
| 2017 |
+
notSetValue: NSV
|
| 2018 |
+
): $ValOf<C, K> | NSV;
|
| 2019 |
+
declare function getIn<C, K: $KeyOf<C>, K2: $KeyOf<$ValOf<C, K>>, NSV>(
|
| 2020 |
+
collection: C,
|
| 2021 |
+
keyPath: [K, K2],
|
| 2022 |
+
notSetValue: NSV
|
| 2023 |
+
): $ValOf<$ValOf<C, K>, K2> | NSV;
|
| 2024 |
+
declare function getIn<
|
| 2025 |
+
C,
|
| 2026 |
+
K: $KeyOf<C>,
|
| 2027 |
+
K2: $KeyOf<$ValOf<C, K>>,
|
| 2028 |
+
K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>,
|
| 2029 |
+
NSV
|
| 2030 |
+
>(
|
| 2031 |
+
collection: C,
|
| 2032 |
+
keyPath: [K, K2, K3],
|
| 2033 |
+
notSetValue: NSV
|
| 2034 |
+
): $ValOf<$ValOf<$ValOf<C, K>, K2>, K3> | NSV;
|
| 2035 |
+
declare function getIn<
|
| 2036 |
+
C,
|
| 2037 |
+
K: $KeyOf<C>,
|
| 2038 |
+
K2: $KeyOf<$ValOf<C, K>>,
|
| 2039 |
+
K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>,
|
| 2040 |
+
K4: $KeyOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>>,
|
| 2041 |
+
NSV
|
| 2042 |
+
>(
|
| 2043 |
+
collection: C,
|
| 2044 |
+
keyPath: [K, K2, K3, K4],
|
| 2045 |
+
notSetValue: NSV
|
| 2046 |
+
): $ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4> | NSV;
|
| 2047 |
+
declare function getIn<
|
| 2048 |
+
C,
|
| 2049 |
+
K: $KeyOf<C>,
|
| 2050 |
+
K2: $KeyOf<$ValOf<C, K>>,
|
| 2051 |
+
K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>,
|
| 2052 |
+
K4: $KeyOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>>,
|
| 2053 |
+
K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>>,
|
| 2054 |
+
NSV
|
| 2055 |
+
>(
|
| 2056 |
+
collection: C,
|
| 2057 |
+
keyPath: [K, K2, K3, K4, K5],
|
| 2058 |
+
notSetValue: NSV
|
| 2059 |
+
): $ValOf<$ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>, K5> | NSV;
|
| 2060 |
+
|
| 2061 |
+
declare function hasIn(collection: Object, keyPath: Iterable<mixed>): boolean;
|
| 2062 |
+
|
| 2063 |
+
declare function removeIn<C>(collection: C, keyPath: []): void;
|
| 2064 |
+
declare function removeIn<C, K: $KeyOf<C>>(collection: C, keyPath: [K]): C;
|
| 2065 |
+
declare function removeIn<C, K: $KeyOf<C>, K2: $KeyOf<$ValOf<C, K>>>(
|
| 2066 |
+
collection: C,
|
| 2067 |
+
keyPath: [K, K2]
|
| 2068 |
+
): C;
|
| 2069 |
+
declare function removeIn<
|
| 2070 |
+
C,
|
| 2071 |
+
K: $KeyOf<C>,
|
| 2072 |
+
K2: $KeyOf<$ValOf<C, K>>,
|
| 2073 |
+
K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>
|
| 2074 |
+
>(
|
| 2075 |
+
collection: C,
|
| 2076 |
+
keyPath: [K, K2, K3]
|
| 2077 |
+
): C;
|
| 2078 |
+
declare function removeIn<
|
| 2079 |
+
C,
|
| 2080 |
+
K: $KeyOf<C>,
|
| 2081 |
+
K2: $KeyOf<$ValOf<C, K>>,
|
| 2082 |
+
K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>,
|
| 2083 |
+
K4: $KeyOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>>
|
| 2084 |
+
>(
|
| 2085 |
+
collection: C,
|
| 2086 |
+
keyPath: [K, K2, K3, K4]
|
| 2087 |
+
): C;
|
| 2088 |
+
declare function removeIn<
|
| 2089 |
+
C,
|
| 2090 |
+
K: $KeyOf<C>,
|
| 2091 |
+
K2: $KeyOf<$ValOf<C, K>>,
|
| 2092 |
+
K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>,
|
| 2093 |
+
K4: $KeyOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>>,
|
| 2094 |
+
K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>>
|
| 2095 |
+
>(
|
| 2096 |
+
collection: C,
|
| 2097 |
+
keyPath: [K, K2, K3, K4, K5]
|
| 2098 |
+
): C;
|
| 2099 |
+
|
| 2100 |
+
declare function setIn<S>(collection: Object, keyPath: [], value: S): S;
|
| 2101 |
+
declare function setIn<C, K: $KeyOf<C>, S: $ValOf<C, K>>(
|
| 2102 |
+
collection: C,
|
| 2103 |
+
keyPath: [K],
|
| 2104 |
+
value: S
|
| 2105 |
+
): C;
|
| 2106 |
+
declare function setIn<
|
| 2107 |
+
C,
|
| 2108 |
+
K: $KeyOf<C>,
|
| 2109 |
+
K2: $KeyOf<$ValOf<C, K>>,
|
| 2110 |
+
S: $ValOf<$ValOf<C, K>, K2>
|
| 2111 |
+
>(
|
| 2112 |
+
collection: C,
|
| 2113 |
+
keyPath: [K, K2],
|
| 2114 |
+
value: S
|
| 2115 |
+
): C;
|
| 2116 |
+
declare function setIn<
|
| 2117 |
+
C,
|
| 2118 |
+
K: $KeyOf<C>,
|
| 2119 |
+
K2: $KeyOf<$ValOf<C, K>>,
|
| 2120 |
+
K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>,
|
| 2121 |
+
S: $ValOf<$ValOf<$ValOf<C, K>, K2>, K3>
|
| 2122 |
+
>(
|
| 2123 |
+
collection: C,
|
| 2124 |
+
keyPath: [K, K2, K3],
|
| 2125 |
+
value: S
|
| 2126 |
+
): C;
|
| 2127 |
+
declare function setIn<
|
| 2128 |
+
C,
|
| 2129 |
+
K: $KeyOf<C>,
|
| 2130 |
+
K2: $KeyOf<$ValOf<C, K>>,
|
| 2131 |
+
K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>,
|
| 2132 |
+
K4: $KeyOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>>,
|
| 2133 |
+
S: $ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>
|
| 2134 |
+
>(
|
| 2135 |
+
collection: C,
|
| 2136 |
+
keyPath: [K, K2, K3, K4],
|
| 2137 |
+
value: S
|
| 2138 |
+
): C;
|
| 2139 |
+
declare function setIn<
|
| 2140 |
+
C,
|
| 2141 |
+
K: $KeyOf<C>,
|
| 2142 |
+
K2: $KeyOf<$ValOf<C, K>>,
|
| 2143 |
+
K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>,
|
| 2144 |
+
K4: $KeyOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>>,
|
| 2145 |
+
K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>>,
|
| 2146 |
+
S: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>, K5>
|
| 2147 |
+
>(
|
| 2148 |
+
collection: C,
|
| 2149 |
+
keyPath: [K, K2, K3, K4, K5],
|
| 2150 |
+
value: S
|
| 2151 |
+
): C;
|
| 2152 |
+
|
| 2153 |
+
declare function updateIn<C, S>(
|
| 2154 |
+
collection: C,
|
| 2155 |
+
keyPath: [],
|
| 2156 |
+
notSetValue: mixed,
|
| 2157 |
+
updater: (value: C) => S
|
| 2158 |
+
): S;
|
| 2159 |
+
declare function updateIn<C, S>(
|
| 2160 |
+
collection: C,
|
| 2161 |
+
keyPath: [],
|
| 2162 |
+
updater: (value: C) => S
|
| 2163 |
+
): S;
|
| 2164 |
+
declare function updateIn<C, K: $KeyOf<C>, S: $ValOf<C, K>, NSV>(
|
| 2165 |
+
collection: C,
|
| 2166 |
+
keyPath: [K],
|
| 2167 |
+
notSetValue: NSV,
|
| 2168 |
+
updater: (value: $ValOf<C, K> | NSV) => S
|
| 2169 |
+
): C;
|
| 2170 |
+
declare function updateIn<C, K: $KeyOf<C>, S: $ValOf<C, K>>(
|
| 2171 |
+
collection: C,
|
| 2172 |
+
keyPath: [K],
|
| 2173 |
+
updater: (value: $ValOf<C, K>) => S
|
| 2174 |
+
): C;
|
| 2175 |
+
declare function updateIn<
|
| 2176 |
+
C,
|
| 2177 |
+
K: $KeyOf<C>,
|
| 2178 |
+
K2: $KeyOf<$ValOf<C, K>>,
|
| 2179 |
+
S: $ValOf<$ValOf<C, K>, K2>,
|
| 2180 |
+
NSV
|
| 2181 |
+
>(
|
| 2182 |
+
collection: C,
|
| 2183 |
+
keyPath: [K, K2],
|
| 2184 |
+
notSetValue: NSV,
|
| 2185 |
+
updater: (value: $ValOf<$ValOf<C, K>, K2> | NSV) => S
|
| 2186 |
+
): C;
|
| 2187 |
+
declare function updateIn<
|
| 2188 |
+
C,
|
| 2189 |
+
K: $KeyOf<C>,
|
| 2190 |
+
K2: $KeyOf<$ValOf<C, K>>,
|
| 2191 |
+
S: $ValOf<$ValOf<C, K>, K2>
|
| 2192 |
+
>(
|
| 2193 |
+
collection: C,
|
| 2194 |
+
keyPath: [K, K2],
|
| 2195 |
+
updater: (value: $ValOf<$ValOf<C, K>, K2>) => S
|
| 2196 |
+
): C;
|
| 2197 |
+
declare function updateIn<
|
| 2198 |
+
C,
|
| 2199 |
+
K: $KeyOf<C>,
|
| 2200 |
+
K2: $KeyOf<$ValOf<C, K>>,
|
| 2201 |
+
K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>,
|
| 2202 |
+
S: $ValOf<$ValOf<$ValOf<C, K>, K2>, K3>,
|
| 2203 |
+
NSV
|
| 2204 |
+
>(
|
| 2205 |
+
collection: C,
|
| 2206 |
+
keyPath: [K, K2, K3],
|
| 2207 |
+
notSetValue: NSV,
|
| 2208 |
+
updater: (value: $ValOf<$ValOf<$ValOf<C, K>, K2>, K3> | NSV) => S
|
| 2209 |
+
): C;
|
| 2210 |
+
declare function updateIn<
|
| 2211 |
+
C,
|
| 2212 |
+
K: $KeyOf<C>,
|
| 2213 |
+
K2: $KeyOf<$ValOf<C, K>>,
|
| 2214 |
+
K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>,
|
| 2215 |
+
S: $ValOf<$ValOf<$ValOf<C, K>, K2>, K3>
|
| 2216 |
+
>(
|
| 2217 |
+
collection: C,
|
| 2218 |
+
keyPath: [K, K2, K3],
|
| 2219 |
+
updater: (value: $ValOf<$ValOf<$ValOf<C, K>, K2>, K3>) => S
|
| 2220 |
+
): C;
|
| 2221 |
+
declare function updateIn<
|
| 2222 |
+
C,
|
| 2223 |
+
K: $KeyOf<C>,
|
| 2224 |
+
K2: $KeyOf<$ValOf<C, K>>,
|
| 2225 |
+
K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>,
|
| 2226 |
+
K4: $KeyOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>>,
|
| 2227 |
+
S: $ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>,
|
| 2228 |
+
NSV
|
| 2229 |
+
>(
|
| 2230 |
+
collection: C,
|
| 2231 |
+
keyPath: [K, K2, K3, K4],
|
| 2232 |
+
notSetValue: NSV,
|
| 2233 |
+
updater: (value: $ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4> | NSV) => S
|
| 2234 |
+
): C;
|
| 2235 |
+
declare function updateIn<
|
| 2236 |
+
C,
|
| 2237 |
+
K: $KeyOf<C>,
|
| 2238 |
+
K2: $KeyOf<$ValOf<C, K>>,
|
| 2239 |
+
K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>,
|
| 2240 |
+
K4: $KeyOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>>,
|
| 2241 |
+
S: $ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>
|
| 2242 |
+
>(
|
| 2243 |
+
collection: C,
|
| 2244 |
+
keyPath: [K, K2, K3, K4],
|
| 2245 |
+
updater: (value: $ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>) => S
|
| 2246 |
+
): C;
|
| 2247 |
+
declare function updateIn<
|
| 2248 |
+
C,
|
| 2249 |
+
K: $KeyOf<C>,
|
| 2250 |
+
K2: $KeyOf<$ValOf<C, K>>,
|
| 2251 |
+
K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>,
|
| 2252 |
+
K4: $KeyOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>>,
|
| 2253 |
+
K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>>,
|
| 2254 |
+
S: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>, K5>,
|
| 2255 |
+
NSV
|
| 2256 |
+
>(
|
| 2257 |
+
collection: C,
|
| 2258 |
+
keyPath: [K, K2, K3, K4, K5],
|
| 2259 |
+
notSetValue: NSV,
|
| 2260 |
+
updater: (
|
| 2261 |
+
value: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>, K5> | NSV
|
| 2262 |
+
) => S
|
| 2263 |
+
): C;
|
| 2264 |
+
declare function updateIn<
|
| 2265 |
+
C,
|
| 2266 |
+
K: $KeyOf<C>,
|
| 2267 |
+
K2: $KeyOf<$ValOf<C, K>>,
|
| 2268 |
+
K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>,
|
| 2269 |
+
K4: $KeyOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>>,
|
| 2270 |
+
K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>>,
|
| 2271 |
+
S: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>, K5>
|
| 2272 |
+
>(
|
| 2273 |
+
collection: C,
|
| 2274 |
+
keyPath: [K, K2, K3, K4, K5],
|
| 2275 |
+
updater: (
|
| 2276 |
+
value: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>, K5>
|
| 2277 |
+
) => S
|
| 2278 |
+
): C;
|
| 2279 |
+
|
| 2280 |
+
declare function merge<C>(
|
| 2281 |
+
collection: C,
|
| 2282 |
+
...collections: Array<
|
| 2283 |
+
| $IterableOf<C>
|
| 2284 |
+
| $Shape<RecordValues<C>>
|
| 2285 |
+
| PlainObjInput<$KeyOf<C>, $ValOf<C>>
|
| 2286 |
+
>
|
| 2287 |
+
): C;
|
| 2288 |
+
declare function mergeWith<C>(
|
| 2289 |
+
merger: (oldVal: $ValOf<C>, newVal: $ValOf<C>, key: $KeyOf<C>) => $ValOf<C>,
|
| 2290 |
+
collection: C,
|
| 2291 |
+
...collections: Array<
|
| 2292 |
+
| $IterableOf<C>
|
| 2293 |
+
| $Shape<RecordValues<C>>
|
| 2294 |
+
| PlainObjInput<$KeyOf<C>, $ValOf<C>>
|
| 2295 |
+
>
|
| 2296 |
+
): C;
|
| 2297 |
+
declare function mergeDeep<C>(
|
| 2298 |
+
collection: C,
|
| 2299 |
+
...collections: Array<
|
| 2300 |
+
| $IterableOf<C>
|
| 2301 |
+
| $Shape<RecordValues<C>>
|
| 2302 |
+
| PlainObjInput<$KeyOf<C>, $ValOf<C>>
|
| 2303 |
+
>
|
| 2304 |
+
): C;
|
| 2305 |
+
declare function mergeDeepWith<C>(
|
| 2306 |
+
merger: (oldVal: any, newVal: any, key: any) => mixed,
|
| 2307 |
+
collection: C,
|
| 2308 |
+
...collections: Array<
|
| 2309 |
+
| $IterableOf<C>
|
| 2310 |
+
| $Shape<RecordValues<C>>
|
| 2311 |
+
| PlainObjInput<$KeyOf<C>, $ValOf<C>>
|
| 2312 |
+
>
|
| 2313 |
+
): C;
|
| 2314 |
+
|
| 2315 |
+
export {
|
| 2316 |
+
Collection,
|
| 2317 |
+
Seq,
|
| 2318 |
+
List,
|
| 2319 |
+
Map,
|
| 2320 |
+
OrderedMap,
|
| 2321 |
+
OrderedSet,
|
| 2322 |
+
Range,
|
| 2323 |
+
Repeat,
|
| 2324 |
+
Record,
|
| 2325 |
+
Set,
|
| 2326 |
+
Stack,
|
| 2327 |
+
fromJS,
|
| 2328 |
+
is,
|
| 2329 |
+
hash,
|
| 2330 |
+
isImmutable,
|
| 2331 |
+
isCollection,
|
| 2332 |
+
isKeyed,
|
| 2333 |
+
isIndexed,
|
| 2334 |
+
isAssociative,
|
| 2335 |
+
isOrdered,
|
| 2336 |
+
isRecord,
|
| 2337 |
+
isValueObject,
|
| 2338 |
+
get,
|
| 2339 |
+
has,
|
| 2340 |
+
remove,
|
| 2341 |
+
set,
|
| 2342 |
+
update,
|
| 2343 |
+
getIn,
|
| 2344 |
+
hasIn,
|
| 2345 |
+
removeIn,
|
| 2346 |
+
setIn,
|
| 2347 |
+
updateIn,
|
| 2348 |
+
merge,
|
| 2349 |
+
mergeWith,
|
| 2350 |
+
mergeDeep,
|
| 2351 |
+
mergeDeepWith,
|
| 2352 |
+
};
|
| 2353 |
+
|
| 2354 |
+
export default {
|
| 2355 |
+
Collection,
|
| 2356 |
+
Seq,
|
| 2357 |
+
|
| 2358 |
+
List,
|
| 2359 |
+
Map,
|
| 2360 |
+
OrderedMap,
|
| 2361 |
+
OrderedSet,
|
| 2362 |
+
PairSorting,
|
| 2363 |
+
Range,
|
| 2364 |
+
Repeat,
|
| 2365 |
+
Record,
|
| 2366 |
+
Set,
|
| 2367 |
+
Stack,
|
| 2368 |
+
|
| 2369 |
+
fromJS,
|
| 2370 |
+
is,
|
| 2371 |
+
hash,
|
| 2372 |
+
|
| 2373 |
+
isImmutable,
|
| 2374 |
+
isCollection,
|
| 2375 |
+
isKeyed,
|
| 2376 |
+
isIndexed,
|
| 2377 |
+
isAssociative,
|
| 2378 |
+
isOrdered,
|
| 2379 |
+
isRecord,
|
| 2380 |
+
isValueObject,
|
| 2381 |
+
|
| 2382 |
+
get,
|
| 2383 |
+
has,
|
| 2384 |
+
remove,
|
| 2385 |
+
set,
|
| 2386 |
+
update,
|
| 2387 |
+
getIn,
|
| 2388 |
+
hasIn,
|
| 2389 |
+
removeIn,
|
| 2390 |
+
setIn,
|
| 2391 |
+
updateIn,
|
| 2392 |
+
merge,
|
| 2393 |
+
mergeWith,
|
| 2394 |
+
mergeDeep,
|
| 2395 |
+
mergeDeepWith,
|
| 2396 |
+
};
|
| 2397 |
+
|
| 2398 |
+
export type {
|
| 2399 |
+
Comparator,
|
| 2400 |
+
KeyedCollection,
|
| 2401 |
+
IndexedCollection,
|
| 2402 |
+
SetCollection,
|
| 2403 |
+
KeyedSeq,
|
| 2404 |
+
IndexedSeq,
|
| 2405 |
+
SetSeq,
|
| 2406 |
+
RecordFactory,
|
| 2407 |
+
RecordOf,
|
| 2408 |
+
RecordInstance,
|
| 2409 |
+
ValueObject,
|
| 2410 |
+
$KeyOf,
|
| 2411 |
+
$ValOf,
|
| 2412 |
+
};
|
Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/immutable/dist/immutable.min.js
CHANGED
|
@@ -1,3 +1,55 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* MIT License
|
| 3 |
+
*
|
| 4 |
+
* Copyright (c) 2014-present, Lee Byron and other contributors.
|
| 5 |
+
*
|
| 6 |
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 7 |
+
* of this software and associated documentation files (the "Software"), to deal
|
| 8 |
+
* in the Software without restriction, including without limitation the rights
|
| 9 |
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 10 |
+
* copies of the Software, and to permit persons to whom the Software is
|
| 11 |
+
* furnished to do so, subject to the following conditions:
|
| 12 |
+
*
|
| 13 |
+
* The above copyright notice and this permission notice shall be included in all
|
| 14 |
+
* copies or substantial portions of the Software.
|
| 15 |
+
*
|
| 16 |
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 17 |
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 18 |
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 19 |
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 20 |
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 21 |
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
| 22 |
+
* SOFTWARE.
|
| 23 |
+
*/
|
| 24 |
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Immutable={})}(this,function(t){"use strict";var e="delete",d=5,l=1<<d,g=l-1,v={};function u(){return{value:!1}}function _(t){t&&(t.value=!0)}function m(){}function c(t){return void 0===t.size&&(t.size=t.__iterate(r)),t.size}function h(t,e){if("number"!=typeof e){var r=e>>>0;if(""+r!==e||4294967295==r)return NaN;e=r}return e<0?c(t)+e:e}function r(){return!0}function p(t,e,r){return(0===t&&!i(t)||void 0!==r&&t<=-r)&&(void 0===e||void 0!==r&&r<=e)}function y(t,e){return n(t,e,0)}function w(t,e){return n(t,e,e)}function n(t,e,r){return void 0===t?r:i(t)?e===1/0?e:0|Math.max(0,e+t):void 0===e||e===t?t:0|Math.min(e,t)}function i(t){return t<0||0===t&&1/t==-1/0}var o="@@__IMMUTABLE_ITERABLE__@@";function f(t){return!(!t||!t[o])}var s="@@__IMMUTABLE_KEYED__@@";function a(t){return!(!t||!t[s])}var S="@@__IMMUTABLE_INDEXED__@@";function z(t){return!(!t||!t[S])}function b(t){return a(t)||z(t)}function I(t){return f(t)?t:F(t)}var O=function(t){function e(t){return a(t)?t:G(t)}return e.__proto__=t,(e.prototype=Object.create(t.prototype)).constructor=e}(I),E=function(t){function e(t){return z(t)?t:Z(t)}return e.__proto__=t,(e.prototype=Object.create(t.prototype)).constructor=e}(I),j=function(t){function e(t){return f(t)&&!b(t)?t:$(t)}return e.__proto__=t,(e.prototype=Object.create(t.prototype)).constructor=e}(I);I.Keyed=O,I.Indexed=E,I.Set=j;var q="@@__IMMUTABLE_SEQ__@@";function M(t){return!(!t||!t[q])}var D="@@__IMMUTABLE_RECORD__@@";function x(t){return!(!t||!t[D])}function A(t){return f(t)||x(t)}var k="@@__IMMUTABLE_ORDERED__@@";function R(t){return!(!t||!t[k])}var U=0,T=1,K=2,L="function"==typeof Symbol&&Symbol.iterator,C="@@iterator",B=L||C,P=function(t){this.next=t};function W(t,e,r,n){r=0===t?e:1===t?r:[e,r];return n?n.value=r:n={value:r,done:!1},n}function N(){return{value:void 0,done:!0}}function H(t){return Array.isArray(t
|
| 25 |
+
)||Y(t)}function J(t){return t&&"function"==typeof t.next}function V(t){var e=Y(t);return e&&e.call(t)}function Y(t){t=t&&(L&&t[L]||t[C]);if("function"==typeof t)return t}P.prototype.toString=function(){return"[Iterator]"},P.KEYS=U,P.VALUES=T,P.ENTRIES=K,P.prototype.inspect=P.prototype.toSource=function(){return""+this},P.prototype[B]=function(){return this};var Q=Object.prototype.hasOwnProperty;function X(t){return Array.isArray(t)||"string"==typeof t||t&&"object"==typeof t&&Number.isInteger(t.length)&&0<=t.length&&(0===t.length?1===Object.keys(t).length:t.hasOwnProperty(t.length-1))}var F=function(t){function e(t){return null==t?it():A(t)?t.toSeq():function(t){var e=st(t);if(e)return function(t){var e=Y(t);return e&&e===t.entries}(t)?e.fromEntrySeq():function(t){var e=Y(t);return e&&e===t.keys}(t)?e.toSetSeq():e;if("object"!=typeof t)throw new TypeError("Expected Array or collection object of values, or keyed object: "+t);return new et(t)}(t)}return e.__proto__=t,((e.prototype=Object.create(t.prototype)).constructor=e).prototype.toSeq=function(){return this},e.prototype.toString=function(){return this.__toString("Seq {","}")},e.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},e.prototype.__iterate=function(t,e){var r=this._cache;if(r){for(var n=r.length,i=0;i!==n;){var o=r[e?n-++i:i++];if(!1===t(o[1],o[0],this))break}return i}return this.__iterateUncached(t,e)},e.prototype.__iterator=function(e,r){var n=this._cache;if(n){var i=n.length,o=0;return new P(function(){if(o===i)return N();var t=n[r?i-++o:o++];return W(e,t[0],t[1])})}return this.__iteratorUncached(e,r)},e}(I),G=function(t){function e(t){return null==t?it().toKeyedSeq():f(t)?a(t)?t.toSeq():t.fromEntrySeq():x(t)?t.toSeq():ot(t)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.toKeyedSeq=function(){return this},e}(F),Z=function(t){function e(t){return null==t?it():f(t)?a(t)?t.entrySeq():t.toIndexedSeq():x(t
|
| 26 |
+
)?t.toSeq().entrySeq():ut(t)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).of=function(){return e(arguments)},e.prototype.toIndexedSeq=function(){return this},e.prototype.toString=function(){return this.__toString("Seq [","]")},e}(F),$=function(t){function e(t){return(f(t)&&!b(t)?t:Z(t)).toSetSeq()}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).of=function(){return e(arguments)},e.prototype.toSetSeq=function(){return this},e}(F);F.isSeq=M,F.Keyed=G,F.Set=$,F.Indexed=Z,F.prototype[q]=!0;var tt=function(t){function e(t){this._array=t,this.size=t.length}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.get=function(t,e){return this.has(t)?this._array[h(this,t)]:e},e.prototype.__iterate=function(t,e){for(var r=this._array,n=r.length,i=0;i!==n;){var o=e?n-++i:i++;if(!1===t(r[o],o,this))break}return i},e.prototype.__iterator=function(e,r){var n=this._array,i=n.length,o=0;return new P(function(){if(o===i)return N();var t=r?i-++o:o++;return W(e,t,n[t])})},e}(Z),et=function(t){function e(t){var e=Object.keys(t).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t):[]);this._object=t,this._keys=e,this.size=e.length}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.get=function(t,e){return void 0===e||this.has(t)?this._object[t]:e},e.prototype.has=function(t){return Q.call(this._object,t)},e.prototype.__iterate=function(t,e){for(var r=this._object,n=this._keys,i=n.length,o=0;o!==i;){var u=n[e?i-++o:o++];if(!1===t(r[u],u,this))break}return o},e.prototype.__iterator=function(e,r){var n=this._object,i=this._keys,o=i.length,u=0;return new P(function(){if(u===o)return N();var t=i[r?o-++u:u++];return W(e,t,n[t])})},e}(G);et.prototype[k]=!0;var rt,nt=function(t){function e(t){this._collection=t,this.size=t.length||t.size}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.__iterateUncached=function(t,e){
|
| 27 |
+
if(e)return this.cacheResult().__iterate(t,e);var r,n=V(this._collection),i=0;if(J(n))for(;!(r=n.next()).done&&!1!==t(r.value,i++,this););return i},e.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var r=V(this._collection);if(!J(r))return new P(N);var n=0;return new P(function(){var t=r.next();return t.done?t:W(e,n++,t.value)})},e}(Z);function it(){return rt=rt||new tt([])}function ot(t){var e=st(t);if(e)return e.fromEntrySeq();if("object"==typeof t)return new et(t);throw new TypeError("Expected Array or collection object of [k, v] entries, or keyed object: "+t)}function ut(t){var e=st(t);if(e)return e;throw new TypeError("Expected Array or collection object of values: "+t)}function st(t){return X(t)?new tt(t):H(t)?new nt(t):void 0}var at="@@__IMMUTABLE_MAP__@@";function ct(t){return!(!t||!t[at])}function ft(t){return ct(t)&&R(t)}function ht(t){return!(!t||"function"!=typeof t.equals||"function"!=typeof t.hashCode)}function _t(t,e){if(t===e||t!=t&&e!=e)return!0;if(!t||!e)return!1;if("function"==typeof t.valueOf&&"function"==typeof e.valueOf){if((t=t.valueOf())===(e=e.valueOf())||t!=t&&e!=e)return!0;if(!t||!e)return!1}return!!(ht(t)&&ht(e)&&t.equals(e))}var pt="function"==typeof Math.imul&&-2==Math.imul(4294967295,2)?Math.imul:function(t,e){var r=65535&(t|=0),n=65535&(e|=0);return r*n+((t>>>16)*n+r*(e>>>16)<<16>>>0)|0};function lt(t){return t>>>1&1073741824|3221225471&t}var vt=Object.prototype.valueOf;function yt(t){if(null==t)return dt(t);if("function"==typeof t.hashCode)return lt(t.hashCode(t));var e,r=(e=t).valueOf!==vt&&"function"==typeof e.valueOf?e.valueOf(e):e;if(null==r)return dt(r);switch(typeof r){case"boolean":return r?1108378657:1108378656;case"number":return function(t){if(t!=t||t===1/0)return 0;var e=0|t;e!==t&&(e^=4294967295*t);for(;4294967295<t;)e^=t/=4294967295;return lt(e)}(r);case"string":return(jt<r.length?function(t){var e=Dt[t];void 0===e&&(e=gt(t),Mt===qt&&(Mt=0,Dt={}),Mt++,Dt[t]=e);return e}:gt)(r);case"object":case"function":return function(t){
|
| 28 |
+
var e;if(bt&&void 0!==(e=zt.get(t)))return e;if(void 0!==(e=t[Et]))return e;if(!wt){if(void 0!==(e=t.propertyIsEnumerable&&t.propertyIsEnumerable[Et]))return e;if(void 0!==(e=function(t){if(t&&0<t.nodeType)switch(t.nodeType){case 1:return t.uniqueID;case 9:return t.documentElement&&t.documentElement.uniqueID}}(t)))return e}if(e=St(),bt)zt.set(t,e);else{if(void 0!==mt&&!1===mt(t))throw Error("Non-extensible objects are not allowed as keys.");if(wt)Object.defineProperty(t,Et,{enumerable:!1,configurable:!1,writable:!1,value:e});else if(void 0!==t.propertyIsEnumerable&&t.propertyIsEnumerable===t.constructor.prototype.propertyIsEnumerable)t.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},t.propertyIsEnumerable[Et]=e;else{if(void 0===t.nodeType)throw Error("Unable to set a non-enumerable property on object.");t[Et]=e}}return e}(r);case"symbol":return void 0===(e=It[t=r])?(e=St(),It[t]=e):e;default:if("function"==typeof r.toString)return gt(""+r);throw Error("Value type "+typeof r+" cannot be hashed.")}}function dt(t){return null===t?1108378658:1108378659}function gt(t){for(var e=0,r=0;r<t.length;r++)e=31*e+t.charCodeAt(r)|0;return lt(e)}var mt=Object.isExtensible,wt=function(){try{return Object.defineProperty({},"@",{}),!0}catch(t){return!1}}();function St(){var t=++Ot;return 1073741824&Ot&&(Ot=0),t}var zt,bt="function"==typeof WeakMap;bt&&(zt=new WeakMap);var It=Object.create(null),Ot=0,Et="__immutablehash__";"function"==typeof Symbol&&(Et=Symbol(Et));var jt=16,qt=255,Mt=0,Dt={},xt=function(t){function e(t,e){this._iter=t,this._useKeys=e,this.size=t.size}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.get=function(t,e){return this._iter.get(t,e)},e.prototype.has=function(t){return this._iter.has(t)},e.prototype.valueSeq=function(){return this._iter.valueSeq()},e.prototype.reverse=function(){var t=this,e=Kt(this,!0);return this._useKeys||(e.valueSeq=function(){return t._iter.toSeq().reverse()}),e},
|
| 29 |
+
e.prototype.map=function(t,e){var r=this,n=Tt(this,t,e);return this._useKeys||(n.valueSeq=function(){return r._iter.toSeq().map(t,e)}),n},e.prototype.__iterate=function(r,t){var n=this;return this._iter.__iterate(function(t,e){return r(t,e,n)},t)},e.prototype.__iterator=function(t,e){return this._iter.__iterator(t,e)},e}(G);xt.prototype[k]=!0;var At=function(t){function e(t){this._iter=t,this.size=t.size}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.includes=function(t){return this._iter.includes(t)},e.prototype.__iterate=function(e,r){var n=this,i=0;return r&&c(this),this._iter.__iterate(function(t){return e(t,r?n.size-++i:i++,n)},r)},e.prototype.__iterator=function(e,r){var n=this,i=this._iter.__iterator(T,r),o=0;return r&&c(this),new P(function(){var t=i.next();return t.done?t:W(e,r?n.size-++o:o++,t.value,t)})},e}(Z),kt=function(t){function e(t){this._iter=t,this.size=t.size}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.has=function(t){return this._iter.includes(t)},e.prototype.__iterate=function(e,t){var r=this;return this._iter.__iterate(function(t){return e(t,t,r)},t)},e.prototype.__iterator=function(e,t){var r=this._iter.__iterator(T,t);return new P(function(){var t=r.next();return t.done?t:W(e,t.value,t.value,t)})},e}($),Rt=function(t){function e(t){this._iter=t,this.size=t.size}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.entrySeq=function(){return this._iter.toSeq()},e.prototype.__iterate=function(r,t){var n=this;return this._iter.__iterate(function(t){if(t){Yt(t);var e=f(t);return r(e?t.get(1):t[1],e?t.get(0):t[0],n)}},t)},e.prototype.__iterator=function(n,t){var i=this._iter.__iterator(T,t);return new P(function(){for(;;){var t=i.next();if(t.done)return t;var e=t.value;if(e){Yt(e);var r=f(e);return W(n,r?e.get(0):e[0],r?e.get(1):e[1],t)}}})},e}(G);function Ut(i){var t=Xt(i);return t._iter=i,t.size=i.size,t.flip=function(){return i},t.reverse=function(){
|
| 30 |
+
var t=i.reverse.apply(this);return t.flip=function(){return i.reverse()},t},t.has=function(t){return i.includes(t)},t.includes=function(t){return i.has(t)},t.cacheResult=Ft,t.__iterateUncached=function(r,t){var n=this;return i.__iterate(function(t,e){return!1!==r(e,t,n)},t)},t.__iteratorUncached=function(t,e){if(t!==K)return i.__iterator(t===T?U:T,e);var r=i.__iterator(t,e);return new P(function(){var t,e=r.next();return e.done||(t=e.value[0],e.value[0]=e.value[1],e.value[1]=t),e})},t}function Tt(o,u,s){var t=Xt(o);return t.size=o.size,t.has=function(t){return o.has(t)},t.get=function(t,e){var r=o.get(t,v);return r===v?e:u.call(s,r,t,o)},t.__iterateUncached=function(n,t){var i=this;return o.__iterate(function(t,e,r){return!1!==n(u.call(s,t,e,r),e,i)},t)},t.__iteratorUncached=function(n,t){var i=o.__iterator(K,t);return new P(function(){var t=i.next();if(t.done)return t;var e=t.value,r=e[0];return W(n,r,u.call(s,e[1],r,o),t)})},t}function Kt(u,s){var a=this,t=Xt(u);return t._iter=u,t.size=u.size,t.reverse=function(){return u},u.flip&&(t.flip=function(){var t=Ut(u);return t.reverse=function(){return u.flip()},t}),t.get=function(t,e){return u.get(s?t:-1-t,e)},t.has=function(t){return u.has(s?t:-1-t)},t.includes=function(t){return u.includes(t)},t.cacheResult=Ft,t.__iterate=function(r,n){var i=this,o=0;return n&&c(u),u.__iterate(function(t,e){return r(t,s?e:n?i.size-++o:o++,i)},!n)},t.__iterator=function(r,n){var i=0;n&&c(u);var o=u.__iterator(K,!n);return new P(function(){var t=o.next();if(t.done)return t;var e=t.value;return W(r,s?e[0]:n?a.size-++i:i++,e[1],t)})},t}function Lt(u,s,a,c){var t=Xt(u);return c&&(t.has=function(t){var e=u.get(t,v);return e!==v&&!!s.call(a,e,t,u)},t.get=function(t,e){var r=u.get(t,v);return r!==v&&s.call(a,r,t,u)?r:e}),t.__iterateUncached=function(n,t){var i=this,o=0;return u.__iterate(function(t,e,r){if(s.call(a,t,e,r))return o++,n(t,c?e:o-1,i)},t),o},t.__iteratorUncached=function(n,t){var i=u.__iterator(K,t),o=0;return new P(function(){for(;;){var t=i.next();if(t.done)return t
|
| 31 |
+
;var e=t.value,r=e[0],e=e[1];if(s.call(a,e,r,u))return W(n,c?r:o++,e,t)}})},t}function Ct(s,t,e,a){var r=s.size;if(p(t,e,r))return s;var c=y(t,r),r=w(e,r);if(c!=c||r!=r)return Ct(s.toSeq().cacheResult(),t,e,a);var f,r=r-c;r==r&&(f=r<0?0:r);r=Xt(s);return r.size=0===f?f:s.size&&f||void 0,!a&&M(s)&&0<=f&&(r.get=function(t,e){return 0<=(t=h(this,t))&&t<f?s.get(t+c,e):e}),r.__iterateUncached=function(r,t){var n=this;if(0===f)return 0;if(t)return this.cacheResult().__iterate(r,t);var i=0,o=!0,u=0;return s.__iterate(function(t,e){if(!(o=o&&i++<c))return u++,!1!==r(t,a?e:u-1,n)&&u!==f}),u},r.__iteratorUncached=function(e,t){if(0!==f&&t)return this.cacheResult().__iterator(e,t);if(0===f)return new P(N);var r=s.__iterator(e,t),n=0,i=0;return new P(function(){for(;n++<c;)r.next();if(++i>f)return N();var t=r.next();return a||e===T||t.done?t:W(e,i-1,e===U?void 0:t.value[1],t)})},r}function Bt(e,c,f,h){var t=Xt(e);return t.__iterateUncached=function(n,t){var i=this;if(t)return this.cacheResult().__iterate(n,t);var o=!0,u=0;return e.__iterate(function(t,e,r){if(!(o=o&&c.call(f,t,e,r)))return u++,n(t,h?e:u-1,i)}),u},t.__iteratorUncached=function(i,t){var o=this;if(t)return this.cacheResult().__iterator(i,t);var u=e.__iterator(K,t),s=!0,a=0;return new P(function(){var t;do{if((t=u.next()).done)return h||i===T?t:W(i,a++,i===U?void 0:t.value[1],t);var e=t.value,r=e[0],n=e[1];s=s&&c.call(f,n,r,o)}while(s);return i===K?t:W(i,r,n,t)})},t}function Pt(t,s,a){var c=Xt(t);return c.__iterateUncached=function(i,e){if(e)return this.cacheResult().__iterate(i,e);var o=0,u=!1;return function r(t,n){t.__iterate(function(t,e){return(!s||n<s)&&f(t)?r(t,n+1):(o++,!1===i(t,a?e:o-1,c)&&(u=!0)),!u},e)}(t,0),o},c.__iteratorUncached=function(r,n){if(n)return this.cacheResult().__iterator(r,n);var i=t.__iterator(r,n),o=[],u=0;return new P(function(){for(;i;){var t=i.next();if(!1===t.done){var e=t.value;if(r===K&&(e=e[1]),s&&!(o.length<s)||!f(e))return a?t:W(r,u++,e,t);o.push(i),i=e.__iterator(r,n)}else i=o.pop()}return N()})},c}function Wt(r,n,i){
|
| 32 |
+
n=n||Gt;var t=a(r),o=0,u=r.toSeq().map(function(t,e){return[e,t,o++,i?i(t,e,r):t]}).valueSeq().toArray();return u.sort(function(t,e){return n(t[3],e[3])||t[2]-e[2]}).forEach(t?function(t,e){u[e].length=2}:function(t,e){u[e]=t[1]}),(t?G:z(r)?Z:$)(u)}function Nt(r,n,i){if(n=n||Gt,i){var t=r.toSeq().map(function(t,e){return[t,i(t,e,r)]}).reduce(function(t,e){return Ht(n,t[1],e[1])?e:t});return t&&t[0]}return r.reduce(function(t,e){return Ht(n,t,e)?e:t})}function Ht(t,e,r){t=t(r,e);return 0===t&&r!==e&&(null==r||r!=r)||0<t}function Jt(t,u,s,a){var e=Xt(t),t=new tt(s).map(function(t){return t.size});return e.size=a?t.max():t.min(),e.__iterate=function(t,e){for(var r,n=this.__iterator(T,e),i=0;!(r=n.next()).done&&!1!==t(r.value,i++,this););return i},e.__iteratorUncached=function(e,r){var n=s.map(function(t){return t=I(t),V(r?t.reverse():t)}),i=0,o=!1;return new P(function(){var t;return o||(t=n.map(function(t){return t.next()}),o=a?t.every(function(t){return t.done}):t.some(function(t){return t.done})),o?N():W(e,i++,u.apply(null,t.map(function(t){return t.value})))})},e}function Vt(t,e){return t===e?t:M(t)?e:t.constructor(e)}function Yt(t){if(t!==Object(t))throw new TypeError("Expected [K, V] tuple: "+t)}function Qt(t){return a(t)?O:z(t)?E:j}function Xt(t){return Object.create((a(t)?G:z(t)?Z:$).prototype)}function Ft(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):F.prototype.cacheResult.call(this)}function Gt(t,e){return void 0===t&&void 0===e?0:void 0===t?1:void 0===e?-1:e<t?1:t<e?-1:0}function Zt(t,e){for(var r=Math.max(0,t.length-(e=e||0)),n=Array(r),i=0;i<r;i++)n[i]=t[i+e];return n}function $t(t,e){if(!t)throw Error(e)}function te(t){$t(t!==1/0,"Cannot perform this action with an infinite size.")}function ee(t){if(X(t)&&"string"!=typeof t)return t;if(R(t))return t.toArray();throw new TypeError("Invalid keyPath: expected Ordered Collection or Array: "+t)}At.prototype.cacheResult=xt.prototype.cacheResult=kt.prototype.cacheResult=Rt.prototype.cacheResult=Ft
|
| 33 |
+
;var re=Object.prototype.toString;function ne(t){if(!t||"object"!=typeof t||"[object Object]"!==re.call(t))return!1;t=Object.getPrototypeOf(t);if(null===t)return!0;for(var e=t,r=Object.getPrototypeOf(t);null!==r;)r=Object.getPrototypeOf(e=r);return e===t}function ie(t){return"object"==typeof t&&(A(t)||Array.isArray(t)||ne(t))}function oe(e){try{return"string"==typeof e?JSON.stringify(e):e+""}catch(t){return JSON.stringify(e)}}function ue(t,e){return A(t)?t.has(e):ie(t)&&Q.call(t,e)}function se(t,e,r){return A(t)?t.get(e,r):ue(t,e)?"function"==typeof t.get?t.get(e):t[e]:r}function ae(t){if(Array.isArray(t))return Zt(t);var e,r={};for(e in t)Q.call(t,e)&&(r[e]=t[e]);return r}function ce(t,e){if(!ie(t))throw new TypeError("Cannot update non-data-structure value: "+t);if(A(t)){if(!t.remove)throw new TypeError("Cannot update immutable value without .remove() method: "+t);return t.remove(e)}if(!Q.call(t,e))return t;t=ae(t);return Array.isArray(t)?t.splice(e,1):delete t[e],t}function fe(t,e,r){if(!ie(t))throw new TypeError("Cannot update non-data-structure value: "+t);if(A(t)){if(!t.set)throw new TypeError("Cannot update immutable value without .set() method: "+t);return t.set(e,r)}if(Q.call(t,e)&&r===t[e])return t;t=ae(t);return t[e]=r,t}function he(t,e,r,n){n||(n=r,r=void 0);n=function t(e,r,n,i,o,u){var s=r===v;if(i===n.length){var a=s?o:r,c=u(a);return c===a?r:c}if(!s&&!ie(r))throw new TypeError("Cannot update within non-data-structure value in path ["+n.slice(0,i).map(oe)+"]: "+r);var a=n[i];var c=s?v:se(r,a,v);var u=t(c===v?e:A(c),c,n,i+1,o,u);return u===c?r:u===v?ce(r,a):fe(s?e?Qe():{}:r,a,u)}(A(t),t,ee(e),0,r,n);return n===v?r:n}function _e(t,e,r){return he(t,e,v,function(){return r})}function pe(t,e){return _e(this,t,e)}function le(t,e){return he(t,e,function(){return v})}function ve(t){return le(this,t)}function ye(t,e,r,n){return he(t,[e],r,n)}function de(t,e,r){return 1===arguments.length?t(this):ye(this,t,e,r)}function ge(t,e,r){return he(this,t,e,r)}function me(){for(var t=[],e=arguments.length;e--;
|
| 34 |
+
)t[e]=arguments[e];return Se(this,t)}function we(t){for(var e=[],r=arguments.length-1;0<r--;)e[r]=arguments[r+1];if("function"!=typeof t)throw new TypeError("Invalid merger function: "+t);return Se(this,e,t)}function Se(t,e,i){for(var r=[],n=0;n<e.length;n++){var o=O(e[n]);0!==o.size&&r.push(o)}return 0===r.length?t:0!==t.toSeq().size||t.__ownerID||1!==r.length?t.withMutations(function(n){for(var t=i?function(e,r){ye(n,r,v,function(t){return t===v?e:i(t,e,r)})}:function(t,e){n.set(e,t)},e=0;e<r.length;e++)r[e].forEach(t)}):t.constructor(r[0])}function ze(t){for(var e=[],r=arguments.length-1;0<r--;)e[r]=arguments[r+1];return je(t,e)}function be(t,e){for(var r=[],n=arguments.length-2;0<n--;)r[n]=arguments[n+2];return je(e,r,t)}function Ie(t){for(var e=[],r=arguments.length-1;0<r--;)e[r]=arguments[r+1];return Ee(t,e)}function Oe(t,e){for(var r=[],n=arguments.length-2;0<n--;)r[n]=arguments[n+2];return Ee(e,r,t)}function Ee(t,e,r){return je(t,e,(i=r,function t(e,r,n){return ie(e)&&ie(r)&&function(t,e){return t=F(t),e=F(e),z(t)===z(e)&&a(t)===a(e)}(e,r)?je(e,[r],t):i?i(e,r,n):r}));var i}function je(n,t,i){if(!ie(n))throw new TypeError("Cannot merge into non-data-structure value: "+n);if(A(n))return"function"==typeof i&&n.mergeWith?n.mergeWith.apply(n,[i].concat(t)):(n.merge?n.merge:n.concat).apply(n,t);for(var e=Array.isArray(n),o=n,r=e?E:O,u=e?function(t){o===n&&(o=ae(o)),o.push(t)}:function(t,e){var r=Q.call(o,e),t=r&&i?i(o[e],t,e):t;r&&t===o[e]||(o===n&&(o=ae(o)),o[e]=t)},s=0;s<t.length;s++)r(t[s]).forEach(u);return o}function qe(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return Ee(this,t)}function Me(t){for(var e=[],r=arguments.length-1;0<r--;)e[r]=arguments[r+1];return Ee(this,e,t)}function De(t){for(var e=[],r=arguments.length-1;0<r--;)e[r]=arguments[r+1];return he(this,t,Qe(),function(t){return je(t,e)})}function xe(t){for(var e=[],r=arguments.length-1;0<r--;)e[r]=arguments[r+1];return he(this,t,Qe(),function(t){return Ee(t,e)})}function Ae(t){var e=this.asMutable();return t(e),e.wasAltered(
|
| 35 |
+
)?e.__ensureOwner(this.__ownerID):this}function ke(){return this.__ownerID?this:this.__ensureOwner(new m)}function Re(){return this.__ensureOwner()}function Ue(){return this.__altered}var Te=function(n){function t(e){return null==e?Qe():ct(e)&&!R(e)?e:Qe().withMutations(function(r){var t=n(e);te(t.size),t.forEach(function(t,e){return r.set(e,t)})})}return n&&(t.__proto__=n),((t.prototype=Object.create(n&&n.prototype)).constructor=t).of=function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];return Qe().withMutations(function(t){for(var e=0;e<r.length;e+=2){if(r.length<=e+1)throw Error("Missing value for key: "+r[e]);t.set(r[e],r[e+1])}})},t.prototype.toString=function(){return this.__toString("Map {","}")},t.prototype.get=function(t,e){return this._root?this._root.get(0,void 0,t,e):e},t.prototype.set=function(t,e){return Xe(this,t,e)},t.prototype.remove=function(t){return Xe(this,t,v)},t.prototype.deleteAll=function(t){var r=I(t);return 0===r.size?this:this.withMutations(function(e){r.forEach(function(t){return e.remove(t)})})},t.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):Qe()},t.prototype.sort=function(t){return wr(Wt(this,t))},t.prototype.sortBy=function(t,e){return wr(Wt(this,e,t))},t.prototype.map=function(n,i){var o=this;return this.withMutations(function(r){r.forEach(function(t,e){r.set(e,n.call(i,t,e,o))})})},t.prototype.__iterator=function(t,e){return new He(this,t,e)},t.prototype.__iterate=function(e,t){var r=this,n=0;return this._root&&this._root.iterate(function(t){return n++,e(t[1],t[0],r)},t),n},t.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Ye(this.size,this._root,t,this.__hash):0===this.size?Qe():(this.__ownerID=t,this.__altered=!1,this)},t}(O);Te.isMap=ct;var Ke=Te.prototype;Ke[at]=!0,Ke[e]=Ke.remove,Ke.removeAll=Ke.deleteAll,Ke.setIn=pe,Ke.removeIn=Ke.deleteIn=ve,Ke.update=de,Ke.updateIn=ge,Ke.merge=Ke.concat=me,Ke.mergeWith=we,Ke.mergeDeep=qe,Ke.mergeDeepWith=Me,
|
| 36 |
+
Ke.mergeIn=De,Ke.mergeDeepIn=xe,Ke.withMutations=Ae,Ke.wasAltered=Ue,Ke.asImmutable=Re,Ke["@@transducer/init"]=Ke.asMutable=ke,Ke["@@transducer/step"]=function(t,e){return t.set(e[0],e[1])},Ke["@@transducer/result"]=function(t){return t.asImmutable()};var Le=function(t,e){this.ownerID=t,this.entries=e};Le.prototype.get=function(t,e,r,n){for(var i=this.entries,o=0,u=i.length;o<u;o++)if(_t(r,i[o][0]))return i[o][1];return n},Le.prototype.update=function(t,e,r,n,i,o,u){for(var s=i===v,a=this.entries,c=0,f=a.length;c<f&&!_t(n,a[c][0]);c++);var h=c<f;if(h?a[c][1]===i:s)return this;if(_(u),!s&&h||_(o),!s||1!==a.length){if(!h&&!s&&er<=a.length)return function(t,e,r,n){t=t||new m;for(var i=new We(t,yt(r),[r,n]),o=0;o<e.length;o++){var u=e[o];i=i.update(t,0,void 0,u[0],u[1])}return i}(t,a,n,i);u=t&&t===this.ownerID,o=u?a:Zt(a);return h?s?c===f-1?o.pop():o[c]=o.pop():o[c]=[n,i]:o.push([n,i]),u?(this.entries=o,this):new Le(t,o)}};var Ce=function(t,e,r){this.ownerID=t,this.bitmap=e,this.nodes=r};Ce.prototype.get=function(t,e,r,n){void 0===e&&(e=yt(r));var i=1<<((0===t?e:e>>>t)&g),o=this.bitmap;return 0==(o&i)?n:this.nodes[$e(o&i-1)].get(t+d,e,r,n)},Ce.prototype.update=function(t,e,r,n,i,o,u){void 0===r&&(r=yt(n));var s=(0===e?r:r>>>e)&g,a=1<<s,c=this.bitmap,f=0!=(c&a);if(!f&&i===v)return this;var h=$e(c&a-1),_=this.nodes,p=f?_[h]:void 0,u=Fe(p,t,e+d,r,n,i,o,u);if(u===p)return this;if(!f&&u&&rr<=_.length)return function(t,e,r,n,i){for(var o=0,u=Array(l),s=0;0!==r;s++,r>>>=1)u[s]=1&r?e[o++]:void 0;return u[n]=i,new Be(t,o+1,u)}(t,_,c,s,u);if(f&&!u&&2===_.length&&Ge(_[1^h]))return _[1^h];if(f&&u&&1===_.length&&Ge(u))return u;s=t&&t===this.ownerID,a=f?u?c:c^a:c|a,u=f?u?tr(_,h,u,s):function(t,e,r){var n=t.length-1;if(r&&e===n)return t.pop(),t;for(var i=Array(n),o=0,u=0;u<n;u++)u===e&&(o=1),i[u]=t[u+o];return i}(_,h,s):function(t,e,r,n){var i=t.length+1;if(n&&e+1===i)return t[e]=r,t;for(var o=Array(i),u=0,s=0;s<i;s++)s===e?(o[s]=r,u=-1):o[s]=t[s+u];return o}(_,h,u,s);return s?(this.bitmap=a,this.nodes=u,this):new Ce(t,a,u)}
|
| 37 |
+
;var Be=function(t,e,r){this.ownerID=t,this.count=e,this.nodes=r};Be.prototype.get=function(t,e,r,n){void 0===e&&(e=yt(r));var i=this.nodes[(0===t?e:e>>>t)&g];return i?i.get(t+d,e,r,n):n},Be.prototype.update=function(t,e,r,n,i,o,u){void 0===r&&(r=yt(n));var s=(0===e?r:r>>>e)&g,a=this.nodes,c=a[s];if(i===v&&!c)return this;o=Fe(c,t,e+d,r,n,i,o,u);if(o===c)return this;u=this.count;if(c){if(!o&&--u<nr)return function(t,e,r,n){for(var i=0,o=0,u=Array(r),s=0,a=1,c=e.length;s<c;s++,a<<=1){var f=e[s];void 0!==f&&s!==n&&(i|=a,u[o++]=f)}return new Ce(t,i,u)}(t,a,u,s)}else u++;c=t&&t===this.ownerID,o=tr(a,s,o,c);return c?(this.count=u,this.nodes=o,this):new Be(t,u,o)};var Pe=function(t,e,r){this.ownerID=t,this.keyHash=e,this.entries=r};Pe.prototype.get=function(t,e,r,n){for(var i=this.entries,o=0,u=i.length;o<u;o++)if(_t(r,i[o][0]))return i[o][1];return n},Pe.prototype.update=function(t,e,r,n,i,o,u){void 0===r&&(r=yt(n));var s=i===v;if(r!==this.keyHash)return s?this:(_(u),_(o),Ze(this,t,e,r,[n,i]));for(var a=this.entries,c=0,f=a.length;c<f&&!_t(n,a[c][0]);c++);r=c<f;if(r?a[c][1]===i:s)return this;if(_(u),!s&&r||_(o),s&&2===f)return new We(t,this.keyHash,a[1^c]);u=t&&t===this.ownerID,o=u?a:Zt(a);return r?s?c===f-1?o.pop():o[c]=o.pop():o[c]=[n,i]:o.push([n,i]),u?(this.entries=o,this):new Pe(t,this.keyHash,o)};var We=function(t,e,r){this.ownerID=t,this.keyHash=e,this.entry=r};We.prototype.get=function(t,e,r,n){return _t(r,this.entry[0])?this.entry[1]:n},We.prototype.update=function(t,e,r,n,i,o,u){var s=i===v,a=_t(n,this.entry[0]);return(a?i===this.entry[1]:s)?this:(_(u),s?void _(o):a?t&&t===this.ownerID?(this.entry[1]=i,this):new We(t,this.keyHash,[n,i]):(_(o),Ze(this,t,e,yt(n),[n,i])))},Le.prototype.iterate=Pe.prototype.iterate=function(t,e){for(var r=this.entries,n=0,i=r.length-1;n<=i;n++)if(!1===t(r[e?i-n:n]))return!1},Ce.prototype.iterate=Be.prototype.iterate=function(t,e){for(var r=this.nodes,n=0,i=r.length-1;n<=i;n++){var o=r[e?i-n:n];if(o&&!1===o.iterate(t,e))return!1}},We.prototype.iterate=function(t,e){return t(
|
| 38 |
+
this.entry)};var Ne,He=function(t){function e(t,e,r){this._type=e,this._reverse=r,this._stack=t._root&&Ve(t._root)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.next=function(){for(var t=this._type,e=this._stack;e;){var r=e.node,n=e.index++,i=void 0;if(r.entry){if(0==n)return Je(t,r.entry)}else if(r.entries){if(n<=(i=r.entries.length-1))return Je(t,r.entries[this._reverse?i-n:n])}else if(n<=(i=r.nodes.length-1)){n=r.nodes[this._reverse?i-n:n];if(n){if(n.entry)return Je(t,n.entry);e=this._stack=Ve(n,e)}continue}e=this._stack=this._stack.__prev}return N()},e}(P);function Je(t,e){return W(t,e[0],e[1])}function Ve(t,e){return{node:t,index:0,__prev:e}}function Ye(t,e,r,n){var i=Object.create(Ke);return i.size=t,i._root=e,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function Qe(){return Ne=Ne||Ye(0)}function Xe(t,e,r){if(t._root){var n=u(),i=u(),o=Fe(t._root,t.__ownerID,0,void 0,e,r,n,i);if(!i.value)return t;n=t.size+(n.value?r===v?-1:1:0)}else{if(r===v)return t;n=1,o=new Le(t.__ownerID,[[e,r]])}return t.__ownerID?(t.size=n,t._root=o,t.__hash=void 0,t.__altered=!0,t):o?Ye(n,o):Qe()}function Fe(t,e,r,n,i,o,u,s){return t?t.update(e,r,n,i,o,u,s):o===v?t:(_(s),_(u),new We(e,n,[i,o]))}function Ge(t){return t.constructor===We||t.constructor===Pe}function Ze(t,e,r,n,i){if(t.keyHash===n)return new Pe(e,n,[t.entry,i]);var o=(0===r?t.keyHash:t.keyHash>>>r)&g,u=(0===r?n:n>>>r)&g,t=o==u?[Ze(t,e,r+d,n,i)]:(i=new We(e,n,i),o<u?[t,i]:[i,t]);return new Ce(e,1<<o|1<<u,t)}function $e(t){return t=(t=(858993459&(t-=t>>1&1431655765))+(t>>2&858993459))+(t>>4)&252645135,t+=t>>8,127&(t+=t>>16)}function tr(t,e,r,n){t=n?t:Zt(t);return t[e]=r,t}var er=l/4,rr=l/2,nr=l/4,ir="@@__IMMUTABLE_LIST__@@";function or(t){return!(!t||!t[ir])}var ur=function(o){function t(t){var e=pr();if(null==t)return e;if(or(t))return t;var n=o(t),i=n.size;return 0===i?e:(te(i),0<i&&i<l?_r(0,i,d,null,new ar(n.toArray())):e.withMutations(function(r){r.setSize(i),n.forEach(function(t,e){return r.set(e,t)})}))}return o&&(
|
| 39 |
+
t.__proto__=o),((t.prototype=Object.create(o&&o.prototype)).constructor=t).of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("List [","]")},t.prototype.get=function(t,e){if(0<=(t=h(this,t))&&t<this.size){var r=yr(this,t+=this._origin);return r&&r.array[t&g]}return e},t.prototype.set=function(t,e){return function(t,e,r){if((e=h(t,e))!==e)return t;if(t.size<=e||e<0)return t.withMutations(function(t){e<0?dr(t,e).set(0,r):dr(t,0,e+1).set(e,r)});var n=t._tail,i=t._root,o=u();(e+=t._origin)>=gr(t._capacity)?n=lr(n,t.__ownerID,0,e,r,o):i=lr(i,t.__ownerID,t._level,e,r,o);if(!o.value)return t;if(t.__ownerID)return t._root=i,t._tail=n,t.__hash=void 0,t.__altered=!0,t;return _r(t._origin,t._capacity,t._level,i,n)}(this,t,e)},t.prototype.remove=function(t){return this.has(t)?0===t?this.shift():t===this.size-1?this.pop():this.splice(t,1):this},t.prototype.insert=function(t,e){return this.splice(t,0,e)},t.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=d,this._root=this._tail=this.__hash=void 0,this.__altered=!0,this):pr()},t.prototype.push=function(){var r=arguments,n=this.size;return this.withMutations(function(t){dr(t,0,n+r.length);for(var e=0;e<r.length;e++)t.set(n+e,r[e])})},t.prototype.pop=function(){return dr(this,0,-1)},t.prototype.unshift=function(){var r=arguments;return this.withMutations(function(t){dr(t,-r.length);for(var e=0;e<r.length;e++)t.set(e,r[e])})},t.prototype.shift=function(){return dr(this,1)},t.prototype.concat=function(){for(var t=arguments,r=[],e=0;e<arguments.length;e++){var n=t[e],n=o("string"!=typeof n&&H(n)?n:[n]);0!==n.size&&r.push(n)}return 0===r.length?this:0!==this.size||this.__ownerID||1!==r.length?this.withMutations(function(e){r.forEach(function(t){return t.forEach(function(t){return e.push(t)})})}):this.constructor(r[0])},t.prototype.setSize=function(t){return dr(this,0,t)},t.prototype.map=function(r,n){var i=this;return this.withMutations(function(t){for(
|
| 40 |
+
var e=0;e<i.size;e++)t.set(e,r.call(n,t.get(e),e,i))})},t.prototype.slice=function(t,e){var r=this.size;return p(t,e,r)?this:dr(this,y(t,r),w(e,r))},t.prototype.__iterator=function(e,r){var n=r?this.size:0,i=hr(this,r);return new P(function(){var t=i();return t===fr?N():W(e,r?--n:n++,t)})},t.prototype.__iterate=function(t,e){for(var r,n=e?this.size:0,i=hr(this,e);(r=i())!==fr&&!1!==t(r,e?--n:n++,this););return n},t.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?_r(this._origin,this._capacity,this._level,this._root,this._tail,t,this.__hash):0===this.size?pr():(this.__ownerID=t,this.__altered=!1,this)},t}(E);ur.isList=or;var sr=ur.prototype;sr[ir]=!0,sr[e]=sr.remove,sr.merge=sr.concat,sr.setIn=pe,sr.deleteIn=sr.removeIn=ve,sr.update=de,sr.updateIn=ge,sr.mergeIn=De,sr.mergeDeepIn=xe,sr.withMutations=Ae,sr.wasAltered=Ue,sr.asImmutable=Re,sr["@@transducer/init"]=sr.asMutable=ke,sr["@@transducer/step"]=function(t,e){return t.push(e)},sr["@@transducer/result"]=function(t){return t.asImmutable()};var ar=function(t,e){this.array=t,this.ownerID=e};ar.prototype.removeBefore=function(t,e,r){if(r===e?1<<e:0===this.array.length)return this;var n=r>>>e&g;if(this.array.length<=n)return new ar([],t);var i=0==n;if(0<e){var o,u=this.array[n];if((o=u&&u.removeBefore(t,e-d,r))===u&&i)return this}if(i&&!o)return this;var s=vr(this,t);if(!i)for(var a=0;a<n;a++)s.array[a]=void 0;return o&&(s.array[n]=o),s},ar.prototype.removeAfter=function(t,e,r){if(r===(e?1<<e:0)||0===this.array.length)return this;var n=r-1>>>e&g;if(this.array.length<=n)return this;if(0<e){var i,o=this.array[n];if((i=o&&o.removeAfter(t,e-d,r))===o&&n==this.array.length-1)return this}t=vr(this,t);return t.array.splice(1+n),i&&(t.array[n]=i),t};var cr,fr={};function hr(t,s){var a=t._origin,c=t._capacity,o=gr(c),u=t._tail;return f(t._root,t._level,0);function f(t,e,r){return 0===e?function(t,e){var r=e===o?u&&u.array:t&&t.array,n=a<e?0:a-e,i=c-e;l<i&&(i=l);return function(){if(n===i)return fr;var t=s?--i:n++;return r&&r[t]}}(t,r):function(t,e,r){
|
| 41 |
+
var n,i=t&&t.array,o=a<r?0:a-r>>e,u=1+(c-r>>e);l<u&&(u=l);return function(){for(;;){if(n){var t=n();if(t!==fr)return t;n=null}if(o===u)return fr;t=s?--u:o++;n=f(i&&i[t],e-d,r+(t<<e))}}}(t,e,r)}}function _r(t,e,r,n,i,o,u){var s=Object.create(sr);return s.size=e-t,s._origin=t,s._capacity=e,s._level=r,s._root=n,s._tail=i,s.__ownerID=o,s.__hash=u,s.__altered=!1,s}function pr(){return cr=cr||_r(0,0,d)}function lr(t,e,r,n,i,o){var u,s=n>>>r&g,a=t&&s<t.array.length;if(!a&&void 0===i)return t;if(0<r){var c=t&&t.array[s],n=lr(c,e,r-d,n,i,o);return n===c?t:((u=vr(t,e)).array[s]=n,u)}return a&&t.array[s]===i?t:(o&&_(o),u=vr(t,e),void 0===i&&s==u.array.length-1?u.array.pop():u.array[s]=i,u)}function vr(t,e){return e&&t&&e===t.ownerID?t:new ar(t?t.array.slice():[],e)}function yr(t,e){if(e>=gr(t._capacity))return t._tail;if(e<1<<t._level+d){for(var r=t._root,n=t._level;r&&0<n;)r=r.array[e>>>n&g],n-=d;return r}}function dr(t,e,r){void 0!==e&&(e|=0),void 0!==r&&(r|=0);var n=t.__ownerID||new m,i=t._origin,o=t._capacity,u=i+e,s=void 0===r?o:r<0?o+r:i+r;if(u===i&&s===o)return t;if(s<=u)return t.clear();for(var a=t._level,c=t._root,f=0;u+f<0;)c=new ar(c&&c.array.length?[void 0,c]:[],n),f+=1<<(a+=d);f&&(u+=f,i+=f,s+=f,o+=f);for(var h=gr(o),_=gr(s);1<<a+d<=_;)c=new ar(c&&c.array.length?[c]:[],n),a+=d;e=t._tail,r=_<h?yr(t,s-1):h<_?new ar([],n):e;if(e&&h<_&&u<o&&e.array.length){for(var p=c=vr(c,n),l=a;d<l;l-=d)var v=h>>>l&g,p=p.array[v]=vr(p.array[v],n);p.array[h>>>d&g]=e}if(s<o&&(r=r&&r.removeAfter(n,0,s)),_<=u)u-=_,s-=_,a=d,c=null,r=r&&r.removeBefore(n,0,u);else if(i<u||_<h){for(f=0;c;){var y=u>>>a&g;if(y!=_>>>a&g)break;y&&(f+=(1<<a)*y),a-=d,c=c.array[y]}c&&i<u&&(c=c.removeBefore(n,a,u-f)),c&&_<h&&(c=c.removeAfter(n,a,_-f)),f&&(u-=f,s-=f)}return t.__ownerID?(t.size=s-u,t._origin=u,t._capacity=s,t._level=a,t._root=c,t._tail=r,t.__hash=void 0,t.__altered=!0,t):_r(u,s,a,c,r)}function gr(t){return t<l?0:t-1>>>d<<d}var mr,wr=function(t){function e(e){return null==e?zr():ft(e)?e:zr().withMutations(function(r){var t=O(e);te(t.size),
|
| 42 |
+
t.forEach(function(t,e){return r.set(e,t)})})}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).of=function(){return this(arguments)},e.prototype.toString=function(){return this.__toString("OrderedMap {","}")},e.prototype.get=function(t,e){t=this._map.get(t);return void 0!==t?this._list.get(t)[1]:e},e.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this.__altered=!0,this):zr()},e.prototype.set=function(t,e){return br(this,t,e)},e.prototype.remove=function(t){return br(this,t,v)},e.prototype.__iterate=function(e,t){var r=this;return this._list.__iterate(function(t){return t&&e(t[1],t[0],r)},t)},e.prototype.__iterator=function(t,e){return this._list.fromEntrySeq().__iterator(t,e)},e.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t),r=this._list.__ensureOwner(t);return t?Sr(e,r,t,this.__hash):0===this.size?zr():(this.__ownerID=t,this.__altered=!1,this._map=e,this._list=r,this)},e}(Te);function Sr(t,e,r,n){var i=Object.create(wr.prototype);return i.size=t?t.size:0,i._map=t,i._list=e,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function zr(){return mr=mr||Sr(Qe(),pr())}function br(t,e,r){var n,i,o=t._map,u=t._list,s=o.get(e),a=void 0!==s;if(r===v){if(!a)return t;l<=u.size&&2*o.size<=u.size?(n=(i=u.filter(function(t,e){return void 0!==t&&s!==e})).toKeyedSeq().map(function(t){return t[0]}).flip().toMap(),t.__ownerID&&(n.__ownerID=i.__ownerID=t.__ownerID)):(n=o.remove(e),i=s===u.size-1?u.pop():u.set(s,void 0))}else if(a){if(r===u.get(s)[1])return t;n=o,i=u.set(s,[e,r])}else n=o.set(e,u.size),i=u.set(u.size,[e,r]);return t.__ownerID?(t.size=n.size,t._map=n,t._list=i,t.__hash=void 0,t.__altered=!0,t):Sr(n,i)}wr.isOrderedMap=ft,wr.prototype[k]=!0,wr.prototype[e]=wr.prototype.remove;var Ir="@@__IMMUTABLE_STACK__@@";function Or(t){return!(!t||!t[Ir])}var Er=function(i){function t(t){return null==t?Dr():Or(t)?t:Dr().pushAll(t)}return i&&(t.__proto__=i),((
|
| 43 |
+
t.prototype=Object.create(i&&i.prototype)).constructor=t).of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("Stack [","]")},t.prototype.get=function(t,e){var r=this._head;for(t=h(this,t);r&&t--;)r=r.next;return r?r.value:e},t.prototype.peek=function(){return this._head&&this._head.value},t.prototype.push=function(){var t=arguments;if(0===arguments.length)return this;for(var e=this.size+arguments.length,r=this._head,n=arguments.length-1;0<=n;n--)r={value:t[n],next:r};return this.__ownerID?(this.size=e,this._head=r,this.__hash=void 0,this.__altered=!0,this):Mr(e,r)},t.prototype.pushAll=function(t){if(0===(t=i(t)).size)return this;if(0===this.size&&Or(t))return t;te(t.size);var e=this.size,r=this._head;return t.__iterate(function(t){e++,r={value:t,next:r}},!0),this.__ownerID?(this.size=e,this._head=r,this.__hash=void 0,this.__altered=!0,this):Mr(e,r)},t.prototype.pop=function(){return this.slice(1)},t.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):Dr()},t.prototype.slice=function(t,e){if(p(t,e,this.size))return this;var r=y(t,this.size);if(w(e,this.size)!==this.size)return i.prototype.slice.call(this,t,e);for(var e=this.size-r,n=this._head;r--;)n=n.next;return this.__ownerID?(this.size=e,this._head=n,this.__hash=void 0,this.__altered=!0,this):Mr(e,n)},t.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Mr(this.size,this._head,t,this.__hash):0===this.size?Dr():(this.__ownerID=t,this.__altered=!1,this)},t.prototype.__iterate=function(r,t){var n=this;if(t)return new tt(this.toArray()).__iterate(function(t,e){return r(t,e,n)},t);for(var e=0,i=this._head;i&&!1!==r(i.value,e++,this);)i=i.next;return e},t.prototype.__iterator=function(e,t){if(t)return new tt(this.toArray()).__iterator(e,t);var r=0,n=this._head;return new P(function(){if(n){var t=n.value;return n=n.next,W(e,r++,t)}return N()})},t}(E);Er.isStack=Or;var jr,qr=Er.prototype;function Mr(t,e,r,n){
|
| 44 |
+
var i=Object.create(qr);return i.size=t,i._head=e,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function Dr(){return jr=jr||Mr(0)}qr[Ir]=!0,qr.shift=qr.pop,qr.unshift=qr.push,qr.unshiftAll=qr.pushAll,qr.withMutations=Ae,qr.wasAltered=Ue,qr.asImmutable=Re,qr["@@transducer/init"]=qr.asMutable=ke,qr["@@transducer/step"]=function(t,e){return t.unshift(e)},qr["@@transducer/result"]=function(t){return t.asImmutable()};var xr="@@__IMMUTABLE_SET__@@";function Ar(t){return!(!t||!t[xr])}function kr(t){return Ar(t)&&R(t)}function Rr(r,t){if(r===t)return!0;if(!f(t)||void 0!==r.size&&void 0!==t.size&&r.size!==t.size||void 0!==r.__hash&&void 0!==t.__hash&&r.__hash!==t.__hash||a(r)!==a(t)||z(r)!==z(t)||R(r)!==R(t))return!1;if(0===r.size&&0===t.size)return!0;var n=!b(r);if(R(r)){var i=r.entries();return t.every(function(t,e){var r=i.next().value;return r&&_t(r[1],t)&&(n||_t(r[0],e))})&&i.next().done}var e,o=!1;void 0===r.size&&(void 0===t.size?"function"==typeof r.cacheResult&&r.cacheResult():(o=!0,e=r,r=t,t=e));var u=!0,t=t.__iterate(function(t,e){if(n?!r.has(t):o?!_t(t,r.get(e,v)):!_t(r.get(e,v),t))return u=!1});return u&&r.size===t}function Ur(e,r){function t(t){e.prototype[t]=r[t]}return Object.keys(r).forEach(t),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(r).forEach(t),e}function Tr(t){if(!t||"object"!=typeof t)return t;if(!f(t)){if(!ie(t))return t;t=F(t)}if(a(t)){var r={};return t.__iterate(function(t,e){r[e]=Tr(t)}),r}var e=[];return t.__iterate(function(t){e.push(Tr(t))}),e}var Kr=function(n){function e(r){return null==r?Wr():Ar(r)&&!R(r)?r:Wr().withMutations(function(e){var t=n(r);te(t.size),t.forEach(function(t){return e.add(t)})})}return n&&(e.__proto__=n),((e.prototype=Object.create(n&&n.prototype)).constructor=e).of=function(){return this(arguments)},e.fromKeys=function(t){return this(O(t).keySeq())},e.intersect=function(t){return(t=I(t).toArray()).length?Cr.intersect.apply(e(t.pop()),t):Wr()},e.union=function(t){return(t=I(t).toArray()).length?Cr.union.apply(e(t.pop()),t):Wr()},
|
| 45 |
+
e.prototype.toString=function(){return this.__toString("Set {","}")},e.prototype.has=function(t){return this._map.has(t)},e.prototype.add=function(t){return Br(this,this._map.set(t,t))},e.prototype.remove=function(t){return Br(this,this._map.remove(t))},e.prototype.clear=function(){return Br(this,this._map.clear())},e.prototype.map=function(r,n){var i=this,o=!1,t=Br(this,this._map.mapEntries(function(t){var e=t[1],t=r.call(n,e,e,i);return t!==e&&(o=!0),[t,t]},n));return o?t:this},e.prototype.union=function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];return 0===(r=r.filter(function(t){return 0!==t.size})).length?this:0!==this.size||this.__ownerID||1!==r.length?this.withMutations(function(e){for(var t=0;t<r.length;t++)"string"==typeof r[t]?e.add(r[t]):n(r[t]).forEach(function(t){return e.add(t)})}):this.constructor(r[0])},e.prototype.intersect=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];if(0===t.length)return this;t=t.map(function(t){return n(t)});var r=[];return this.forEach(function(e){t.every(function(t){return t.includes(e)})||r.push(e)}),this.withMutations(function(e){r.forEach(function(t){e.remove(t)})})},e.prototype.subtract=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];if(0===t.length)return this;t=t.map(function(t){return n(t)});var r=[];return this.forEach(function(e){t.some(function(t){return t.includes(e)})&&r.push(e)}),this.withMutations(function(e){r.forEach(function(t){e.remove(t)})})},e.prototype.sort=function(t){return an(Wt(this,t))},e.prototype.sortBy=function(t,e){return an(Wt(this,e,t))},e.prototype.wasAltered=function(){return this._map.wasAltered()},e.prototype.__iterate=function(e,t){var r=this;return this._map.__iterate(function(t){return e(t,t,r)},t)},e.prototype.__iterator=function(t,e){return this._map.__iterator(t,e)},e.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t);return t?this.__make(e,t):0===this.size?this.__empty():(this.__ownerID=t,this._map=e,this)},e}(j);Kr.isSet=Ar
|
| 46 |
+
;var Lr,Cr=Kr.prototype;function Br(t,e){return t.__ownerID?(t.size=e.size,t._map=e,t):e===t._map?t:0===e.size?t.__empty():t.__make(e)}function Pr(t,e){var r=Object.create(Cr);return r.size=t?t.size:0,r._map=t,r.__ownerID=e,r}function Wr(){return Lr=Lr||Pr(Qe())}Cr[xr]=!0,Cr[e]=Cr.remove,Cr.merge=Cr.concat=Cr.union,Cr.withMutations=Ae,Cr.asImmutable=Re,Cr["@@transducer/init"]=Cr.asMutable=ke,Cr["@@transducer/step"]=function(t,e){return t.add(e)},Cr["@@transducer/result"]=function(t){return t.asImmutable()},Cr.__empty=Wr,Cr.__make=Pr;var Nr,Hr=function(t){function n(t,e,r){if(!(this instanceof n))return new n(t,e,r);if($t(0!==r,"Cannot step a Range by 0"),t=t||0,void 0===e&&(e=1/0),r=void 0===r?1:Math.abs(r),e<t&&(r=-r),this._start=t,this._end=e,this._step=r,this.size=Math.max(0,1+Math.ceil((e-t)/r-1)),0===this.size){if(Nr)return Nr;Nr=this}}return t&&(n.__proto__=t),((n.prototype=Object.create(t&&t.prototype)).constructor=n).prototype.toString=function(){return 0===this.size?"Range []":"Range [ "+this._start+"..."+this._end+(1!==this._step?" by "+this._step:"")+" ]"},n.prototype.get=function(t,e){return this.has(t)?this._start+h(this,t)*this._step:e},n.prototype.includes=function(t){t=(t-this._start)/this._step;return 0<=t&&t<this.size&&t==Math.floor(t)},n.prototype.slice=function(t,e){return p(t,e,this.size)?this:(t=y(t,this.size),(e=w(e,this.size))<=t?new n(0,0):new n(this.get(t,this._end),this.get(e,this._end),this._step))},n.prototype.indexOf=function(t){t-=this._start;if(t%this._step==0){t=t/this._step;if(0<=t&&t<this.size)return t}return-1},n.prototype.lastIndexOf=function(t){return this.indexOf(t)},n.prototype.__iterate=function(t,e){for(var r=this.size,n=this._step,i=e?this._start+(r-1)*n:this._start,o=0;o!==r&&!1!==t(i,e?r-++o:o++,this);)i+=e?-n:n;return o},n.prototype.__iterator=function(e,r){var n=this.size,i=this._step,o=r?this._start+(n-1)*i:this._start,u=0;return new P(function(){if(u===n)return N();var t=o;return o+=r?-i:i,W(e,r?n-++u:u++,t)})},n.prototype.equals=function(t){
|
| 47 |
+
return t instanceof n?this._start===t._start&&this._end===t._end&&this._step===t._step:Rr(this,t)},n}(Z);function Jr(t,e,r){for(var n=ee(e),i=0;i!==n.length;)if((t=se(t,n[i++],v))===v)return r;return t}function Vr(t,e){return Jr(this,t,e)}function Yr(t,e){return Jr(t,e,v)!==v}function Qr(){te(this.size);var r={};return this.__iterate(function(t,e){r[e]=t}),r}I.isIterable=f,I.isKeyed=a,I.isIndexed=z,I.isAssociative=b,I.isOrdered=R,I.Iterator=P,Ur(I,{toArray:function(){te(this.size);var r=Array(this.size||0),n=a(this),i=0;return this.__iterate(function(t,e){r[i++]=n?[e,t]:t}),r},toIndexedSeq:function(){return new At(this)},toJS:function(){return Tr(this)},toKeyedSeq:function(){return new xt(this,!0)},toMap:function(){return Te(this.toKeyedSeq())},toObject:Qr,toOrderedMap:function(){return wr(this.toKeyedSeq())},toOrderedSet:function(){return an(a(this)?this.valueSeq():this)},toSet:function(){return Kr(a(this)?this.valueSeq():this)},toSetSeq:function(){return new kt(this)},toSeq:function(){return z(this)?this.toIndexedSeq():a(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return Er(a(this)?this.valueSeq():this)},toList:function(){return ur(a(this)?this.valueSeq():this)},toString:function(){return"[Collection]"},__toString:function(t,e){return 0===this.size?t+e:t+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+e},concat:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return Vt(this,function(t,e){var r=a(t);if(0===(e=[t].concat(e).map(function(t){return f(t)?r&&(t=O(t)):t=r?ot(t):ut(Array.isArray(t)?t:[t]),t}).filter(function(t){return 0!==t.size})).length)return t;if(1===e.length){var n=e[0];if(n===t||r&&a(n)||z(t)&&z(n))return n}return n=new tt(e),r?n=n.toKeyedSeq():z(t)||(n=n.toSetSeq()),(n=n.flatten(!0)).size=e.reduce(function(t,e){if(void 0!==t){e=e.size;if(void 0!==e)return t+e}},0),n}(this,t))},includes:function(e){return this.some(function(t){return _t(t,e)})},entries:function(){return this.__iterator(K)},every:function(n,i){te(this.size);var o=!0
|
| 48 |
+
;return this.__iterate(function(t,e,r){if(!n.call(i,t,e,r))return o=!1}),o},filter:function(t,e){return Vt(this,Lt(this,t,e,!0))},partition:function(t,e){return function(r,n,i){var o=a(r),u=[[],[]];r.__iterate(function(t,e){u[n.call(i,t,e,r)?1:0].push(o?[e,t]:t)});var e=Qt(r);return u.map(function(t){return Vt(r,e(t))})}(this,t,e)},find:function(t,e,r){e=this.findEntry(t,e);return e?e[1]:r},forEach:function(t,e){return te(this.size),this.__iterate(e?t.bind(e):t)},join:function(e){te(this.size),e=void 0!==e?""+e:",";var r="",n=!0;return this.__iterate(function(t){n?n=!1:r+=e,r+=null!=t?""+t:""}),r},keys:function(){return this.__iterator(U)},map:function(t,e){return Vt(this,Tt(this,t,e))},reduce:function(t,e,r){return $r(this,t,e,r,arguments.length<2,!1)},reduceRight:function(t,e,r){return $r(this,t,e,r,arguments.length<2,!0)},reverse:function(){return Vt(this,Kt(this,!0))},slice:function(t,e){return Vt(this,Ct(this,t,e,!0))},some:function(n,i){te(this.size);var o=!1;return this.__iterate(function(t,e,r){if(n.call(i,t,e,r))return!(o=!0)}),o},sort:function(t){return Vt(this,Wt(this,t))},values:function(){return this.__iterator(T)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some(function(){return!0})},count:function(t,e){return c(t?this.toSeq().filter(t,e):this)},countBy:function(t,e){return r=this,n=t,i=e,o=Te().asMutable(),r.__iterate(function(t,e){o.update(n.call(i,t,e,r),0,function(t){return t+1})}),o.asImmutable();var r,n,i,o},equals:function(t){return Rr(this,t)},entrySeq:function(){var t=this;if(t._cache)return new tt(t._cache);var e=t.toSeq().map(en).toIndexedSeq();return e.fromEntrySeq=function(){return t.toSeq()},e},filterNot:function(t,e){return this.filter(rn(t),e)},findEntry:function(n,i,t){var o=t;return this.__iterate(function(t,e,r){if(n.call(i,t,e,r))return!(o=[e,t])}),o},findKey:function(t,e){e=this.findEntry(t,e);return e&&e[0]},findLast:function(t,e,r){return this.toKeyedSeq().reverse().find(t,e,r)},findLastEntry:function(t,e,r){
|
| 49 |
+
return this.toKeyedSeq().reverse().findEntry(t,e,r)},findLastKey:function(t,e){return this.toKeyedSeq().reverse().findKey(t,e)},first:function(t){return this.find(r,null,t)},flatMap:function(t,e){return Vt(this,(n=t,i=e,o=Qt(r=this),r.toSeq().map(function(t,e){return o(n.call(i,t,e,r))}).flatten(!0)));var r,n,i,o},flatten:function(t){return Vt(this,Pt(this,t,!0))},fromEntrySeq:function(){return new Rt(this)},get:function(r,t){return this.find(function(t,e){return _t(e,r)},void 0,t)},getIn:Vr,groupBy:function(t,e){return function(n,t,i){var o=a(n),u=(R(n)?wr:Te)().asMutable();n.__iterate(function(e,r){u.update(t.call(i,e,r,n),function(t){return(t=t||[]).push(o?[r,e]:e),t})});var e=Qt(n);return u.map(function(t){return Vt(n,e(t))}).asImmutable()}(this,t,e)},has:function(t){return this.get(t,v)!==v},hasIn:function(t){return Yr(this,t)},isSubset:function(e){return e="function"==typeof e.includes?e:I(e),this.every(function(t){return e.includes(t)})},isSuperset:function(t){return(t="function"==typeof t.isSubset?t:I(t)).isSubset(this)},keyOf:function(e){return this.findKey(function(t){return _t(t,e)})},keySeq:function(){return this.toSeq().map(tn).toIndexedSeq()},last:function(t){return this.toSeq().reverse().first(t)},lastKeyOf:function(t){return this.toKeyedSeq().reverse().keyOf(t)},max:function(t){return Nt(this,t)},maxBy:function(t,e){return Nt(this,e,t)},min:function(t){return Nt(this,t?nn(t):un)},minBy:function(t,e){return Nt(this,e?nn(e):un,t)},rest:function(){return this.slice(1)},skip:function(t){return 0===t?this:this.slice(Math.max(0,t))},skipLast:function(t){return 0===t?this:this.slice(0,-Math.max(0,t))},skipWhile:function(t,e){return Vt(this,Bt(this,t,e,!0))},skipUntil:function(t,e){return this.skipWhile(rn(t),e)},sortBy:function(t,e){return Vt(this,Wt(this,e,t))},take:function(t){return this.slice(0,Math.max(0,t))},takeLast:function(t){return this.slice(-Math.max(0,t))},takeWhile:function(t,e){return Vt(this,(s=t,a=e,(e=Xt(r=this)).__iterateUncached=function(n,t){var i=this;if(t)return this.cacheResult(
|
| 50 |
+
).__iterate(n,t);var o=0;return r.__iterate(function(t,e,r){return s.call(a,t,e,r)&&++o&&n(t,e,i)}),o},e.__iteratorUncached=function(n,t){var i=this;if(t)return this.cacheResult().__iterator(n,t);var o=r.__iterator(K,t),u=!0;return new P(function(){if(!u)return N();var t=o.next();if(t.done)return t;var e=t.value,r=e[0],e=e[1];return s.call(a,e,r,i)?n===K?t:W(n,r,e,t):(u=!1,N())})},e));var r,s,a},takeUntil:function(t,e){return this.takeWhile(rn(t),e)},update:function(t){return t(this)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=function(t){if(t.size===1/0)return 0;var e=R(t),r=a(t),n=e?1:0;return function(t,e){return e=pt(e,3432918353),e=pt(e<<15|e>>>-15,461845907),e=pt(e<<13|e>>>-13,5),e=pt((e=(e+3864292196|0)^t)^e>>>16,2246822507),e=lt((e=pt(e^e>>>13,3266489909))^e>>>16)}(t.__iterate(r?e?function(t,e){n=31*n+sn(yt(t),yt(e))|0}:function(t,e){n=n+sn(yt(t),yt(e))|0}:e?function(t){n=31*n+yt(t)|0}:function(t){n=n+yt(t)|0}),n)}(this))}});var Xr=I.prototype;Xr[o]=!0,Xr[B]=Xr.values,Xr.toJSON=Xr.toArray,Xr.__toStringMapper=oe,Xr.inspect=Xr.toSource=function(){return""+this},Xr.chain=Xr.flatMap,Xr.contains=Xr.includes,Ur(O,{flip:function(){return Vt(this,Ut(this))},mapEntries:function(r,n){var i=this,o=0;return Vt(this,this.toSeq().map(function(t,e){return r.call(n,[e,t],o++,i)}).fromEntrySeq())},mapKeys:function(r,n){var i=this;return Vt(this,this.toSeq().flip().map(function(t,e){return r.call(n,t,e,i)}).flip())}});var Fr=O.prototype;Fr[s]=!0,Fr[B]=Xr.entries,Fr.toJSON=Qr,Fr.__toStringMapper=function(t,e){return oe(e)+": "+oe(t)},Ur(E,{toKeyedSeq:function(){return new xt(this,!1)},filter:function(t,e){return Vt(this,Lt(this,t,e,!1))},findIndex:function(t,e){e=this.findEntry(t,e);return e?e[0]:-1},indexOf:function(t){t=this.keyOf(t);return void 0===t?-1:t},lastIndexOf:function(t){t=this.lastKeyOf(t);return void 0===t?-1:t},reverse:function(){return Vt(this,Kt(this,!1))},slice:function(t,e){return Vt(this,Ct(this,t,e,!1))},splice:function(t,e){
|
| 51 |
+
var r=arguments.length;if(e=Math.max(e||0,0),0===r||2===r&&!e)return this;t=y(t,t<0?this.count():this.size);var n=this.slice(0,t);return Vt(this,1===r?n:n.concat(Zt(arguments,2),this.slice(t+e)))},findLastIndex:function(t,e){e=this.findLastEntry(t,e);return e?e[0]:-1},first:function(t){return this.get(0,t)},flatten:function(t){return Vt(this,Pt(this,t,!1))},get:function(r,t){return(r=h(this,r))<0||this.size===1/0||void 0!==this.size&&this.size<r?t:this.find(function(t,e){return e===r},void 0,t)},has:function(t){return 0<=(t=h(this,t))&&(void 0!==this.size?this.size===1/0||t<this.size:!!~this.indexOf(t))},interpose:function(t){return Vt(this,(u=t,(t=Xt(o=this)).size=o.size&&2*o.size-1,t.__iterateUncached=function(e,t){var r=this,n=0;return o.__iterate(function(t){return(!n||!1!==e(u,n++,r))&&!1!==e(t,n++,r)},t),n},t.__iteratorUncached=function(t,e){var r,n=o.__iterator(T,e),i=0;return new P(function(){return(!r||i%2)&&(r=n.next()).done?r:i%2?W(t,i++,u):W(t,i++,r.value,r)})},t));var o,u},interleave:function(){var t=[this].concat(Zt(arguments)),e=Jt(this.toSeq(),Z.of,t),r=e.flatten(!0);return e.size&&(r.size=e.size*t.length),Vt(this,r)},keySeq:function(){return Hr(0,this.size)},last:function(t){return this.get(-1,t)},skipWhile:function(t,e){return Vt(this,Bt(this,t,e,!1))},zip:function(){var t=[this].concat(Zt(arguments));return Vt(this,Jt(this,on,t))},zipAll:function(){var t=[this].concat(Zt(arguments));return Vt(this,Jt(this,on,t,!0))},zipWith:function(t){var e=Zt(arguments);return Vt(e[0]=this,Jt(this,t,e))}});var Gr=E.prototype;Gr[S]=!0,Gr[k]=!0,Ur(j,{get:function(t,e){return this.has(t)?t:e},includes:function(t){return this.has(t)},keySeq:function(){return this.valueSeq()}});var Zr=j.prototype;function $r(t,n,i,o,u,e){return te(t.size),t.__iterate(function(t,e,r){i=u?(u=!1,t):n.call(o,i,t,e,r)},e),i}function tn(t,e){return e}function en(t,e){return[e,t]}function rn(t){return function(){return!t.apply(this,arguments)}}function nn(t){return function(){return-t.apply(this,arguments)}}function on(){return Zt(
|
| 52 |
+
arguments)}function un(t,e){return t<e?1:e<t?-1:0}function sn(t,e){return t^e+2654435769+(t<<6)+(t>>2)|0}Zr.has=Xr.includes,Zr.contains=Zr.includes,Zr.keys=Zr.values,Ur(G,Fr),Ur(Z,Gr),Ur($,Zr);var an=function(t){function e(r){return null==r?_n():kr(r)?r:_n().withMutations(function(e){var t=j(r);te(t.size),t.forEach(function(t){return e.add(t)})})}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).of=function(){return this(arguments)},e.fromKeys=function(t){return this(O(t).keySeq())},e.prototype.toString=function(){return this.__toString("OrderedSet {","}")},e}(Kr);an.isOrderedSet=kr;var cn,fn=an.prototype;function hn(t,e){var r=Object.create(fn);return r.size=t?t.size:0,r._map=t,r.__ownerID=e,r}function _n(){return cn=cn||hn(zr())}fn[k]=!0,fn.zip=Gr.zip,fn.zipWith=Gr.zipWith,fn.zipAll=Gr.zipAll,fn.__empty=_n,fn.__make=hn;Zr={LeftThenRight:-1,RightThenLeft:1};Gr=function(u,s){var a;!function(t){if(x(t))throw Error("Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.");if(A(t))throw Error("Can not call `Record` with an immutable Collection as default values. Use a plain javascript object instead.");if(null===t||"object"!=typeof t)throw Error("Can not call `Record` with a non-object as default values. Use a plain javascript object instead.")}(u);var c=function(t){var n=this;if(t instanceof c)return t;if(!(this instanceof c))return new c(t);if(!a){a=!0;var e=Object.keys(u),r=f._indices={};f._name=s,f._keys=e,f._defaultValues=u;for(var i=0;i<e.length;i++){var o=e[i];r[o]=i,f[o]?"object"==typeof console&&console.warn&&console.warn("Cannot define "+vn(this)+' with property "'+o+'" since that property name is part of the Record API.'):function(t,e){try{Object.defineProperty(t,e,{get:function(){return this.get(e)},set:function(t){$t(this.__ownerID,"Cannot set on an immutable record."),this.set(e,t)}})}catch(t){}}(f,o)}}return this.__ownerID=void 0,this._values=ur().withMutations(function(r){r.setSize(n._keys.length),O(t).forEach(
|
| 53 |
+
function(t,e){r.set(n._indices[e],t===n._defaultValues[e]?void 0:t)})}),this},f=c.prototype=Object.create(pn);return f.constructor=c,s&&(c.displayName=s),c};Gr.prototype.toString=function(){for(var t,e=vn(this)+" { ",r=this._keys,n=0,i=r.length;n!==i;n++)e+=(n?", ":"")+(t=r[n])+": "+oe(this.get(t));return e+" }"},Gr.prototype.equals=function(t){return this===t||x(t)&&yn(this).equals(yn(t))},Gr.prototype.hashCode=function(){return yn(this).hashCode()},Gr.prototype.has=function(t){return this._indices.hasOwnProperty(t)},Gr.prototype.get=function(t,e){if(!this.has(t))return e;e=this._values.get(this._indices[t]);return void 0===e?this._defaultValues[t]:e},Gr.prototype.set=function(t,e){if(this.has(t)){e=this._values.set(this._indices[t],e===this._defaultValues[t]?void 0:e);if(e!==this._values&&!this.__ownerID)return ln(this,e)}return this},Gr.prototype.remove=function(t){return this.set(t)},Gr.prototype.clear=function(){var t=this._values.clear().setSize(this._keys.length);return this.__ownerID?this:ln(this,t)},Gr.prototype.wasAltered=function(){return this._values.wasAltered()},Gr.prototype.toSeq=function(){return yn(this)},Gr.prototype.toJS=function(){return Tr(this)},Gr.prototype.entries=function(){return this.__iterator(K)},Gr.prototype.__iterator=function(t,e){return yn(this).__iterator(t,e)},Gr.prototype.__iterate=function(t,e){return yn(this).__iterate(t,e)},Gr.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._values.__ensureOwner(t);return t?ln(this,e,t):(this.__ownerID=t,this._values=e,this)},Gr.isRecord=x,Gr.getDescriptiveName=vn;var pn=Gr.prototype;function ln(t,e,r){t=Object.create(Object.getPrototypeOf(t));return t._values=e,t.__ownerID=r,t}function vn(t){return t.constructor.displayName||t.constructor.name||"Record"}function yn(e){return ot(e._keys.map(function(t){return[t,e.get(t)]}))}pn[D]=!0,pn[e]=pn.remove,pn.deleteIn=pn.removeIn=ve,pn.getIn=Vr,pn.hasIn=Xr.hasIn,pn.merge=me,pn.mergeWith=we,pn.mergeIn=De,pn.mergeDeep=qe,pn.mergeDeepWith=Me,pn.mergeDeepIn=xe,
|
| 54 |
+
pn.setIn=pe,pn.update=de,pn.updateIn=ge,pn.withMutations=Ae,pn.asMutable=ke,pn.asImmutable=Re,pn[B]=pn.entries,pn.toJSON=pn.toObject=Xr.toObject,pn.inspect=pn.toSource=function(){return""+this};var dn,e=function(t){function n(t,e){if(!(this instanceof n))return new n(t,e);if(this._value=t,this.size=void 0===e?1/0:Math.max(0,e),0===this.size){if(dn)return dn;dn=this}}return t&&(n.__proto__=t),((n.prototype=Object.create(t&&t.prototype)).constructor=n).prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},n.prototype.get=function(t,e){return this.has(t)?this._value:e},n.prototype.includes=function(t){return _t(this._value,t)},n.prototype.slice=function(t,e){var r=this.size;return p(t,e,r)?this:new n(this._value,w(e,r)-y(t,r))},n.prototype.reverse=function(){return this},n.prototype.indexOf=function(t){return _t(this._value,t)?0:-1},n.prototype.lastIndexOf=function(t){return _t(this._value,t)?this.size:-1},n.prototype.__iterate=function(t,e){for(var r=this.size,n=0;n!==r&&!1!==t(this._value,e?r-++n:n++,this););return n},n.prototype.__iterator=function(t,e){var r=this,n=this.size,i=0;return new P(function(){return i===n?N():W(t,e?n-++i:i++,r._value)})},n.prototype.equals=function(t){return t instanceof n?_t(this._value,t._value):Rr(this,t)},n}(Z);function gn(t,e){return function r(n,i,o,t,u,e){if("string"!=typeof o&&!A(o)&&(X(o)||H(o)||ne(o))){if(~n.indexOf(o))throw new TypeError("Cannot convert circular structure to Immutable");n.push(o),u&&""!==t&&u.push(t);var t=i.call(e,t,F(o).map(function(t,e){return r(n,i,t,e,u,o)}),u&&u.slice());return n.pop(),u&&u.pop(),t}return o}([],e||mn,t,"",e&&2<e.length?[]:void 0,{"":t})}function mn(t,e){return z(e)?e.toList():a(e)?e.toMap():e.toSet()}B={version:"4.3.6",Collection:I,Iterable:I,Seq:F,Map:Te,OrderedMap:wr,List:ur,Stack:Er,Set:Kr,OrderedSet:an,PairSorting:Zr,Record:Gr,Range:Hr,Repeat:e,is:_t,fromJS:gn,hash:yt,isImmutable:A,isCollection:f,isKeyed:a,isIndexed:z,isAssociative:b,isOrdered:R,isValueObject:ht,
|
| 55 |
+
isPlainObject:ne,isSeq:M,isList:or,isMap:ct,isOrderedMap:ft,isStack:Or,isSet:Ar,isOrderedSet:kr,isRecord:x,get:se,getIn:Jr,has:ue,hasIn:Yr,merge:ze,mergeDeep:Ie,mergeWith:be,mergeDeepWith:Oe,remove:ce,removeIn:le,set:fe,setIn:_e,update:ye,updateIn:he},Xr=I;t.Collection=I,t.Iterable=Xr,t.List=ur,t.Map=Te,t.OrderedMap=wr,t.OrderedSet=an,t.PairSorting=Zr,t.Range=Hr,t.Record=Gr,t.Repeat=e,t.Seq=F,t.Set=Kr,t.Stack=Er,t.default=B,t.fromJS=gn,t.get=se,t.getIn=Jr,t.has=ue,t.hasIn=Yr,t.hash=yt,t.is=_t,t.isAssociative=b,t.isCollection=f,t.isImmutable=A,t.isIndexed=z,t.isKeyed=a,t.isList=or,t.isMap=ct,t.isOrdered=R,t.isOrderedMap=ft,t.isOrderedSet=kr,t.isPlainObject=ne,t.isRecord=x,t.isSeq=M,t.isSet=Ar,t.isStack=Or,t.isValueObject=ht,t.merge=ze,t.mergeDeep=Ie,t.mergeDeepWith=Oe,t.mergeWith=be,t.remove=ce,t.removeIn=le,t.set=fe,t.setIn=_e,t.update=ye,t.updateIn=he,t.version="4.3.6",Object.defineProperty(t,"__esModule",{value:!0})});
|
Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/immutable/package.json
CHANGED
|
@@ -1,3 +1,39 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "immutable",
|
| 3 |
+
"version": "4.3.6",
|
| 4 |
+
"description": "Immutable Data Collections",
|
| 5 |
+
"license": "MIT",
|
| 6 |
+
"homepage": "https://immutable-js.com",
|
| 7 |
+
"author": {
|
| 8 |
+
"name": "Lee Byron",
|
| 9 |
+
"url": "https://github.com/leebyron"
|
| 10 |
+
},
|
| 11 |
+
"repository": {
|
| 12 |
+
"type": "git",
|
| 13 |
+
"url": "git://github.com/immutable-js/immutable-js.git"
|
| 14 |
+
},
|
| 15 |
+
"bugs": {
|
| 16 |
+
"url": "https://github.com/immutable-js/immutable-js/issues"
|
| 17 |
+
},
|
| 18 |
+
"main": "dist/immutable.js",
|
| 19 |
+
"module": "dist/immutable.es.js",
|
| 20 |
+
"sideEffects": false,
|
| 21 |
+
"types": "dist/immutable.d.ts",
|
| 22 |
+
"files": [
|
| 23 |
+
"dist",
|
| 24 |
+
"README.md",
|
| 25 |
+
"LICENSE"
|
| 26 |
+
],
|
| 27 |
+
"keywords": [
|
| 28 |
+
"immutable",
|
| 29 |
+
"persistent",
|
| 30 |
+
"lazy",
|
| 31 |
+
"data",
|
| 32 |
+
"datastructure",
|
| 33 |
+
"functional",
|
| 34 |
+
"collection",
|
| 35 |
+
"stateless",
|
| 36 |
+
"sequence",
|
| 37 |
+
"iteration"
|
| 38 |
+
]
|
| 39 |
+
}
|
Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/inflight/LICENSE
CHANGED
|
@@ -1,3 +1,15 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
The ISC License
|
| 2 |
+
|
| 3 |
+
Copyright (c) Isaac Z. Schlueter
|
| 4 |
+
|
| 5 |
+
Permission to use, copy, modify, and/or distribute this software for any
|
| 6 |
+
purpose with or without fee is hereby granted, provided that the above
|
| 7 |
+
copyright notice and this permission notice appear in all copies.
|
| 8 |
+
|
| 9 |
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
| 10 |
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
| 11 |
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
| 12 |
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
| 13 |
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
| 14 |
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
| 15 |
+
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/inflight/README.md
CHANGED
|
@@ -1,3 +1,37 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# inflight
|
| 2 |
+
|
| 3 |
+
Add callbacks to requests in flight to avoid async duplication
|
| 4 |
+
|
| 5 |
+
## USAGE
|
| 6 |
+
|
| 7 |
+
```javascript
|
| 8 |
+
var inflight = require('inflight')
|
| 9 |
+
|
| 10 |
+
// some request that does some stuff
|
| 11 |
+
function req(key, callback) {
|
| 12 |
+
// key is any random string. like a url or filename or whatever.
|
| 13 |
+
//
|
| 14 |
+
// will return either a falsey value, indicating that the
|
| 15 |
+
// request for this key is already in flight, or a new callback
|
| 16 |
+
// which when called will call all callbacks passed to inflightk
|
| 17 |
+
// with the same key
|
| 18 |
+
callback = inflight(key, callback)
|
| 19 |
+
|
| 20 |
+
// If we got a falsey value back, then there's already a req going
|
| 21 |
+
if (!callback) return
|
| 22 |
+
|
| 23 |
+
// this is where you'd fetch the url or whatever
|
| 24 |
+
// callback is also once()-ified, so it can safely be assigned
|
| 25 |
+
// to multiple events etc. First call wins.
|
| 26 |
+
setTimeout(function() {
|
| 27 |
+
callback(null, key)
|
| 28 |
+
}, 100)
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
// only assigns a single setTimeout
|
| 32 |
+
// when it dings, all cbs get called
|
| 33 |
+
req('foo', cb1)
|
| 34 |
+
req('foo', cb2)
|
| 35 |
+
req('foo', cb3)
|
| 36 |
+
req('foo', cb4)
|
| 37 |
+
```
|
Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/inflight/inflight.js
CHANGED
|
@@ -1,3 +1,54 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
var wrappy = require('wrappy')
|
| 2 |
+
var reqs = Object.create(null)
|
| 3 |
+
var once = require('once')
|
| 4 |
+
|
| 5 |
+
module.exports = wrappy(inflight)
|
| 6 |
+
|
| 7 |
+
function inflight (key, cb) {
|
| 8 |
+
if (reqs[key]) {
|
| 9 |
+
reqs[key].push(cb)
|
| 10 |
+
return null
|
| 11 |
+
} else {
|
| 12 |
+
reqs[key] = [cb]
|
| 13 |
+
return makeres(key)
|
| 14 |
+
}
|
| 15 |
+
}
|
| 16 |
+
|
| 17 |
+
function makeres (key) {
|
| 18 |
+
return once(function RES () {
|
| 19 |
+
var cbs = reqs[key]
|
| 20 |
+
var len = cbs.length
|
| 21 |
+
var args = slice(arguments)
|
| 22 |
+
|
| 23 |
+
// XXX It's somewhat ambiguous whether a new callback added in this
|
| 24 |
+
// pass should be queued for later execution if something in the
|
| 25 |
+
// list of callbacks throws, or if it should just be discarded.
|
| 26 |
+
// However, it's such an edge case that it hardly matters, and either
|
| 27 |
+
// choice is likely as surprising as the other.
|
| 28 |
+
// As it happens, we do go ahead and schedule it for later execution.
|
| 29 |
+
try {
|
| 30 |
+
for (var i = 0; i < len; i++) {
|
| 31 |
+
cbs[i].apply(null, args)
|
| 32 |
+
}
|
| 33 |
+
} finally {
|
| 34 |
+
if (cbs.length > len) {
|
| 35 |
+
// added more in the interim.
|
| 36 |
+
// de-zalgo, just in case, but don't call again.
|
| 37 |
+
cbs.splice(0, len)
|
| 38 |
+
process.nextTick(function () {
|
| 39 |
+
RES.apply(null, args)
|
| 40 |
+
})
|
| 41 |
+
} else {
|
| 42 |
+
delete reqs[key]
|
| 43 |
+
}
|
| 44 |
+
}
|
| 45 |
+
})
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
function slice (args) {
|
| 49 |
+
var length = args.length
|
| 50 |
+
var array = []
|
| 51 |
+
|
| 52 |
+
for (var i = 0; i < length; i++) array[i] = args[i]
|
| 53 |
+
return array
|
| 54 |
+
}
|
Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/inflight/package.json
CHANGED
|
@@ -1,3 +1,29 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "inflight",
|
| 3 |
+
"version": "1.0.6",
|
| 4 |
+
"description": "Add callbacks to requests in flight to avoid async duplication",
|
| 5 |
+
"main": "inflight.js",
|
| 6 |
+
"files": [
|
| 7 |
+
"inflight.js"
|
| 8 |
+
],
|
| 9 |
+
"dependencies": {
|
| 10 |
+
"once": "^1.3.0",
|
| 11 |
+
"wrappy": "1"
|
| 12 |
+
},
|
| 13 |
+
"devDependencies": {
|
| 14 |
+
"tap": "^7.1.2"
|
| 15 |
+
},
|
| 16 |
+
"scripts": {
|
| 17 |
+
"test": "tap test.js --100"
|
| 18 |
+
},
|
| 19 |
+
"repository": {
|
| 20 |
+
"type": "git",
|
| 21 |
+
"url": "https://github.com/npm/inflight.git"
|
| 22 |
+
},
|
| 23 |
+
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
|
| 24 |
+
"bugs": {
|
| 25 |
+
"url": "https://github.com/isaacs/inflight/issues"
|
| 26 |
+
},
|
| 27 |
+
"homepage": "https://github.com/isaacs/inflight",
|
| 28 |
+
"license": "ISC"
|
| 29 |
+
}
|
Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/inherits/LICENSE
CHANGED
|
@@ -1,3 +1,16 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
The ISC License
|
| 2 |
+
|
| 3 |
+
Copyright (c) Isaac Z. Schlueter
|
| 4 |
+
|
| 5 |
+
Permission to use, copy, modify, and/or distribute this software for any
|
| 6 |
+
purpose with or without fee is hereby granted, provided that the above
|
| 7 |
+
copyright notice and this permission notice appear in all copies.
|
| 8 |
+
|
| 9 |
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
| 10 |
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
| 11 |
+
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
| 12 |
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
| 13 |
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
| 14 |
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
| 15 |
+
PERFORMANCE OF THIS SOFTWARE.
|
| 16 |
+
|
Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/inherits/README.md
CHANGED
|
@@ -1,3 +1,42 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Browser-friendly inheritance fully compatible with standard node.js
|
| 2 |
+
[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor).
|
| 3 |
+
|
| 4 |
+
This package exports standard `inherits` from node.js `util` module in
|
| 5 |
+
node environment, but also provides alternative browser-friendly
|
| 6 |
+
implementation through [browser
|
| 7 |
+
field](https://gist.github.com/shtylman/4339901). Alternative
|
| 8 |
+
implementation is a literal copy of standard one located in standalone
|
| 9 |
+
module to avoid requiring of `util`. It also has a shim for old
|
| 10 |
+
browsers with no `Object.create` support.
|
| 11 |
+
|
| 12 |
+
While keeping you sure you are using standard `inherits`
|
| 13 |
+
implementation in node.js environment, it allows bundlers such as
|
| 14 |
+
[browserify](https://github.com/substack/node-browserify) to not
|
| 15 |
+
include full `util` package to your client code if all you need is
|
| 16 |
+
just `inherits` function. It worth, because browser shim for `util`
|
| 17 |
+
package is large and `inherits` is often the single function you need
|
| 18 |
+
from it.
|
| 19 |
+
|
| 20 |
+
It's recommended to use this package instead of
|
| 21 |
+
`require('util').inherits` for any code that has chances to be used
|
| 22 |
+
not only in node.js but in browser too.
|
| 23 |
+
|
| 24 |
+
## usage
|
| 25 |
+
|
| 26 |
+
```js
|
| 27 |
+
var inherits = require('inherits');
|
| 28 |
+
// then use exactly as the standard one
|
| 29 |
+
```
|
| 30 |
+
|
| 31 |
+
## note on version ~1.0
|
| 32 |
+
|
| 33 |
+
Version ~1.0 had completely different motivation and is not compatible
|
| 34 |
+
neither with 2.0 nor with standard node.js `inherits`.
|
| 35 |
+
|
| 36 |
+
If you are using version ~1.0 and planning to switch to ~2.0, be
|
| 37 |
+
careful:
|
| 38 |
+
|
| 39 |
+
* new version uses `super_` instead of `super` for referencing
|
| 40 |
+
superclass
|
| 41 |
+
* new version overwrites current prototype while old one preserves any
|
| 42 |
+
existing fields on it
|