Upload original JAVA语言程序设计 course files (part 19)
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
Files changed (50)
- 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
- 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
- Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/immutable/dist/immutable.js
- 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
123123456789101112131415161718192021version https://git-lfs.github.com/spec/v1oid sha256:ac779f7314c74f232ef847ea86e714abe25cf6eeb5cc97b69451b74e2af6492dsize 1064Copyright (c) 2011 Alexander Shtuchkin
Permission is hereby granted, free of charge, to any person obtaininga copy of this software and associated documentation files (the"Software"), to deal in the Software without restriction, includingwithout limitation the rights to use, copy, modify, merge, publish,distribute, sublicense, and/or sell copies of the Software, and topermit persons to whom the Software is furnished to do so, subject tothe following conditions:
The above copyright notice and this permission notice shall beincluded in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OFMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE ANDNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BELIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTIONOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTIONWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
123123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130version https://git-lfs.github.com/spec/v1oid sha256:d320d84b29280ae77bc70b2ae6f0510b7fedce9ba6aa2da9bcec5c68688a83aesize 6352## iconv-lite: Pure JS character encoding conversion
* No need for native code compilation. Quick to install, works on Windows and in sandboxed environments like [Cloud9](http://c9.io). * Used in popular projects like [Express.js (body_parser)](https://github.com/expressjs/body-parser), [Grunt](http://gruntjs.com/), [Nodemailer](http://www.nodemailer.com/), [Yeoman](http://yeoman.io/) and others. * Faster than [node-iconv](https://github.com/bnoordhuis/node-iconv) (see below for performance comparison). * Intuitive encode/decode API, including Streaming support. * In-browser usage via [browserify](https://github.com/substack/node-browserify) or [webpack](https://webpack.js.org/) (~180kb gzip compressed with Buffer shim included). * Typescript [type definition file](https://github.com/ashtuchkin/iconv-lite/blob/master/lib/index.d.ts) included. * React Native is supported (need to install `stream` module to enable Streaming API). * License: MIT.
[](https://npmjs.org/package/iconv-lite/) [](https://travis-ci.org/ashtuchkin/iconv-lite)[](https://npmjs.org/package/iconv-lite/)[](https://npmjs.org/package/iconv-lite/)[](https://npmjs.org/package/iconv-lite/)
## Usage### Basic API```javascriptvar iconv = require('iconv-lite');
// Convert from an encoded buffer to a js string.str = iconv.decode(Buffer.from([0x68, 0x65, 0x6c, 0x6c, 0x6f]), 'win1251');
// Convert from a js string to an encoded buffer.buf = iconv.encode("Sample input string", 'win1251');
// Check if encoding is supportediconv.encodingExists("us-ascii")```
### Streaming API```javascript
// Decode stream (from binary data stream to js strings)http.createServer(function(req, res) { var converterStream = iconv.decodeStream('win1251'); req.pipe(converterStream);
converterStream.on('data', function(str) { console.log(str); // Do something with decoded strings, chunk-by-chunk. });});
// Convert encoding streaming examplefs.createReadStream('file-in-win1251.txt') .pipe(iconv.decodeStream('win1251')) .pipe(iconv.encodeStream('ucs2')) .pipe(fs.createWriteStream('file-in-ucs2.txt'));
// Sugar: all encode/decode streams have .collect(cb) method to accumulate data.http.createServer(function(req, res) { req.pipe(iconv.decodeStream('win1251')).collect(function(err, body) { assert(typeof body == 'string'); console.log(body); // full request body string });});```
## Supported encodings
* All node.js native encodings: utf8, ucs2 / utf16-le, ascii, binary, base64, hex. * Additional unicode encodings: utf16, utf16-be, utf-7, utf-7-imap, utf32, utf32-le, and utf32-be. * All widespread singlebyte encodings: Windows 125x family, ISO-8859 family, IBM/DOS codepages, Macintosh family, KOI8 family, all others supported by iconv library. Aliases like 'latin1', 'us-ascii' also supported. * All widespread multibyte encodings: CP932, CP936, CP949, CP950, GB2312, GBK, GB18030, Big5, Shift_JIS, EUC-JP.
See [all supported encodings on wiki](https://github.com/ashtuchkin/iconv-lite/wiki/Supported-Encodings).
Most singlebyte encodings are generated automatically from [node-iconv](https://github.com/bnoordhuis/node-iconv). Thank you Ben Noordhuis and libiconv authors!
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!
## Encoding/decoding speed
Comparison with node-iconv module (1000x256kb, on MacBook Pro, Core i5/2.6 GHz, Node v0.12.0). Note: your results may vary, so please always check on your hardware.
operation iconv@2.1.4 iconv-lite@0.4.7 ---------------------------------------------------------- encode('win1251') ~96 Mb/s ~320 Mb/s decode('win1251') ~95 Mb/s ~246 Mb/s
## BOM handling
* Decoding: BOM is stripped by default, unless overridden by passing `stripBOM: false` in options (f.ex. `iconv.decode(buf, enc, {stripBOM: false})`). A callback might also be given as a `stripBOM` parameter - it'll be called if BOM character was actually found. * 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. * Encoding: No BOM added, unless overridden by `addBOM: true` option.
## UTF-16 Encodings
This library supports UTF-16LE, UTF-16BE and UTF-16 encodings. First two are straightforward, but UTF-16 is trying to besmart about endianness in the following ways: * Decoding: uses BOM and 'spaces heuristic' to determine input endianness. Default is UTF-16LE, but can be overridden with `defaultEncoding: 'utf-16be'` option. Strips BOM unless `stripBOM: false`. * Encoding: uses UTF-16LE and writes BOM by default. Use `addBOM: false` to override.
## UTF-32 Encodings
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. * The default of UTF-32LE can be overridden with the `defaultEncoding: 'utf-32be'` option. Strips BOM unless `stripBOM: false`. * 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.)
## Other notes
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). Untranslatable characters are set to � or ?. No transliteration is currently supported. Node versions 0.10.31 and 0.11.13 are buggy, don't use them (see #65, #77).
## Testing
```bash$ git clone git@github.com:ashtuchkin/iconv-lite.git$ cd iconv-lite$ npm install$ npm test $ # To view performance:$ node test/performance.js
$ # To view test coverage:$ npm run coverage$ open coverage/lcov-report/index.html```123123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197version https://git-lfs.github.com/spec/v1oid sha256:506eabee3546c0551f78e6adb3102f4e73e7312b4c709117d0da016b0f5b3d80size 5502"use strict";var Buffer = require("safer-buffer").Buffer;
// Note: UTF16-LE (or UCS2) codec is Node.js native. See encodings/internal.js
// == UTF16-BE codec. ==========================================================
exports.utf16be = Utf16BECodec;function Utf16BECodec() {}
Utf16BECodec.prototype.encoder = Utf16BEEncoder;Utf16BECodec.prototype.decoder = Utf16BEDecoder;Utf16BECodec.prototype.bomAware = true;
// -- Encoding
function Utf16BEEncoder() {}
Utf16BEEncoder.prototype.write = function(str) { var buf = Buffer.from(str, 'ucs2'); for (var i = 0; i < buf.length; i += 2) { var tmp = buf[i]; buf[i] = buf[i+1]; buf[i+1] = tmp; } return buf;}
Utf16BEEncoder.prototype.end = function() {}
// -- Decoding
function Utf16BEDecoder() { this.overflowByte = -1;}
Utf16BEDecoder.prototype.write = function(buf) { if (buf.length == 0) return '';
var buf2 = Buffer.alloc(buf.length + 1), i = 0, j = 0;
if (this.overflowByte !== -1) { buf2[0] = buf[0]; buf2[1] = this.overflowByte; i = 1; j = 2; }
for (; i < buf.length-1; i += 2, j+= 2) { buf2[j] = buf[i+1]; buf2[j+1] = buf[i]; }
this.overflowByte = (i == buf.length-1) ? buf[buf.length-1] : -1;
return buf2.slice(0, j).toString('ucs2');}
Utf16BEDecoder.prototype.end = function() { this.overflowByte = -1;}
// == UTF-16 codec =============================================================// Decoder chooses automatically from UTF-16LE and UTF-16BE using BOM and space-based heuristic.// Defaults to UTF-16LE, as it's prevalent and default in Node.// http://en.wikipedia.org/wiki/UTF-16 and http://encoding.spec.whatwg.org/#utf-16le// Decoder default can be changed: iconv.decode(buf, 'utf16', {defaultEncoding: 'utf-16be'});
// Encoder uses UTF-16LE and prepends BOM (which can be overridden with addBOM: false).
exports.utf16 = Utf16Codec;function Utf16Codec(codecOptions, iconv) { this.iconv = iconv;}
Utf16Codec.prototype.encoder = Utf16Encoder;Utf16Codec.prototype.decoder = Utf16Decoder;
// -- Encoding (pass-through)
function Utf16Encoder(options, codec) { options = options || {}; if (options.addBOM === undefined) options.addBOM = true; this.encoder = codec.iconv.getEncoder('utf-16le', options);}
Utf16Encoder.prototype.write = function(str) { return this.encoder.write(str);}
Utf16Encoder.prototype.end = function() { return this.encoder.end();}
// -- Decoding
function Utf16Decoder(options, codec) { this.decoder = null; this.initialBufs = []; this.initialBufsLen = 0;
this.options = options || {}; this.iconv = codec.iconv;}
Utf16Decoder.prototype.write = function(buf) { if (!this.decoder) { // Codec is not chosen yet. Accumulate initial bytes. this.initialBufs.push(buf); this.initialBufsLen += buf.length; if (this.initialBufsLen < 16) // We need more bytes to use space heuristic (see below) return '';
// We have enough bytes -> detect endianness. var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding); this.decoder = this.iconv.getDecoder(encoding, this.options);
var resStr = ''; for (var i = 0; i < this.initialBufs.length; i++) resStr += this.decoder.write(this.initialBufs[i]);
this.initialBufs.length = this.initialBufsLen = 0; return resStr; }
return this.decoder.write(buf);}
Utf16Decoder.prototype.end = function() { if (!this.decoder) { var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding); this.decoder = this.iconv.getDecoder(encoding, this.options);
var resStr = ''; for (var i = 0; i < this.initialBufs.length; i++) resStr += this.decoder.write(this.initialBufs[i]);
var trail = this.decoder.end(); if (trail) resStr += trail;
this.initialBufs.length = this.initialBufsLen = 0; return resStr; } return this.decoder.end();}
function detectEncoding(bufs, defaultEncoding) { var b = []; var charsProcessed = 0; var asciiCharsLE = 0, asciiCharsBE = 0; // Number of ASCII chars when decoded as LE or BE.
outer_loop: for (var i = 0; i < bufs.length; i++) { var buf = bufs[i]; for (var j = 0; j < buf.length; j++) { b.push(buf[j]); if (b.length === 2) { if (charsProcessed === 0) { // Check BOM first. if (b[0] === 0xFF && b[1] === 0xFE) return 'utf-16le'; if (b[0] === 0xFE && b[1] === 0xFF) return 'utf-16be'; }
if (b[0] === 0 && b[1] !== 0) asciiCharsBE++; if (b[0] !== 0 && b[1] === 0) asciiCharsLE++;
b.length = 0; charsProcessed++;
if (charsProcessed >= 100) { break outer_loop; } } } }
// Make decisions. // Most of the time, the content has ASCII chars (U+00**), but the opposite (U+**00) is uncommon. // So, we count ASCII as if it was LE or BE, and decide from that. if (asciiCharsBE > asciiCharsLE) return 'utf-16be'; if (asciiCharsBE < asciiCharsLE) return 'utf-16le';
// Couldn't decide (likely all zeros or not enough data). return defaultEncoding || 'utf-16le';}
123123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319version https://git-lfs.github.com/spec/v1oid sha256:3a762514744c1edcaf5262f77df105f89581c1292b8321b6f96ad49e9244d95asize 9982'use strict';
var Buffer = require('safer-buffer').Buffer;
// == UTF32-LE/BE codec. ==========================================================
exports._utf32 = Utf32Codec;
function Utf32Codec(codecOptions, iconv) { this.iconv = iconv; this.bomAware = true; this.isLE = codecOptions.isLE;}
exports.utf32le = { type: '_utf32', isLE: true };exports.utf32be = { type: '_utf32', isLE: false };
// Aliasesexports.ucs4le = 'utf32le';exports.ucs4be = 'utf32be';
Utf32Codec.prototype.encoder = Utf32Encoder;Utf32Codec.prototype.decoder = Utf32Decoder;
// -- Encoding
function Utf32Encoder(options, codec) { this.isLE = codec.isLE; this.highSurrogate = 0;}
Utf32Encoder.prototype.write = function(str) { var src = Buffer.from(str, 'ucs2'); var dst = Buffer.alloc(src.length * 2); var write32 = this.isLE ? dst.writeUInt32LE : dst.writeUInt32BE; var offset = 0;
for (var i = 0; i < src.length; i += 2) { var code = src.readUInt16LE(i); var isHighSurrogate = (0xD800 <= code && code < 0xDC00); var isLowSurrogate = (0xDC00 <= code && code < 0xE000);
if (this.highSurrogate) { if (isHighSurrogate || !isLowSurrogate) { // There shouldn't be two high surrogates in a row, nor a high surrogate which isn't followed by a low // surrogate. If this happens, keep the pending high surrogate as a stand-alone semi-invalid character // (technically wrong, but expected by some applications, like Windows file names). write32.call(dst, this.highSurrogate, offset); offset += 4; } else { // Create 32-bit value from high and low surrogates; var codepoint = (((this.highSurrogate - 0xD800) << 10) | (code - 0xDC00)) + 0x10000;
write32.call(dst, codepoint, offset); offset += 4; this.highSurrogate = 0;
continue; } }
if (isHighSurrogate) this.highSurrogate = code; else { // Even if the current character is a low surrogate, with no previous high surrogate, we'll // encode it as a semi-invalid stand-alone character for the same reasons expressed above for // unpaired high surrogates. write32.call(dst, code, offset); offset += 4; this.highSurrogate = 0; } }
if (offset < dst.length) dst = dst.slice(0, offset);
return dst;};
Utf32Encoder.prototype.end = function() { // Treat any leftover high surrogate as a semi-valid independent character. if (!this.highSurrogate) return;
var buf = Buffer.alloc(4);
if (this.isLE) buf.writeUInt32LE(this.highSurrogate, 0); else buf.writeUInt32BE(this.highSurrogate, 0);
this.highSurrogate = 0;
return buf;};
// -- Decoding
function Utf32Decoder(options, codec) { this.isLE = codec.isLE; this.badChar = codec.iconv.defaultCharUnicode.charCodeAt(0); this.overflow = [];}
Utf32Decoder.prototype.write = function(src) { if (src.length === 0) return '';
var i = 0; var codepoint = 0; var dst = Buffer.alloc(src.length + 4); var offset = 0; var isLE = this.isLE; var overflow = this.overflow; var badChar = this.badChar;
if (overflow.length > 0) { for (; i < src.length && overflow.length < 4; i++) overflow.push(src[i]); if (overflow.length === 4) { // NOTE: codepoint is a signed int32 and can be negative. // NOTE: We copied this block from below to help V8 optimize it (it works with array, not buffer). if (isLE) { codepoint = overflow[i] | (overflow[i+1] << 8) | (overflow[i+2] << 16) | (overflow[i+3] << 24); } else { codepoint = overflow[i+3] | (overflow[i+2] << 8) | (overflow[i+1] << 16) | (overflow[i] << 24); } overflow.length = 0;
offset = _writeCodepoint(dst, offset, codepoint, badChar); } }
// Main loop. Should be as optimized as possible. for (; i < src.length - 3; i += 4) { // NOTE: codepoint is a signed int32 and can be negative. if (isLE) { codepoint = src[i] | (src[i+1] << 8) | (src[i+2] << 16) | (src[i+3] << 24); } else { codepoint = src[i+3] | (src[i+2] << 8) | (src[i+1] << 16) | (src[i] << 24); } offset = _writeCodepoint(dst, offset, codepoint, badChar); }
// Keep overflowing bytes. for (; i < src.length; i++) { overflow.push(src[i]); }
return dst.slice(0, offset).toString('ucs2');};
function _writeCodepoint(dst, offset, codepoint, badChar) { // NOTE: codepoint is signed int32 and can be negative. We keep it that way to help V8 with optimizations. if (codepoint < 0 || codepoint > 0x10FFFF) { // Not a valid Unicode codepoint codepoint = badChar; }
// Ephemeral Planes: Write high surrogate. if (codepoint >= 0x10000) { codepoint -= 0x10000;
var high = 0xD800 | (codepoint >> 10); dst[offset++] = high & 0xff; dst[offset++] = high >> 8;
// Low surrogate is written below. var codepoint = 0xDC00 | (codepoint & 0x3FF); }
// Write BMP char or low surrogate. dst[offset++] = codepoint & 0xff; dst[offset++] = codepoint >> 8;
return offset;};
Utf32Decoder.prototype.end = function() { this.overflow.length = 0;};
// == UTF-32 Auto codec =============================================================// Decoder chooses automatically from UTF-32LE and UTF-32BE using BOM and space-based heuristic.// Defaults to UTF-32LE. http://en.wikipedia.org/wiki/UTF-32// Encoder/decoder default can be changed: iconv.decode(buf, 'utf32', {defaultEncoding: 'utf-32be'});
// Encoder prepends BOM (which can be overridden with (addBOM: false}).
exports.utf32 = Utf32AutoCodec;exports.ucs4 = 'utf32';
function Utf32AutoCodec(options, iconv) { this.iconv = iconv;}
Utf32AutoCodec.prototype.encoder = Utf32AutoEncoder;Utf32AutoCodec.prototype.decoder = Utf32AutoDecoder;
// -- Encoding
function Utf32AutoEncoder(options, codec) { options = options || {};
if (options.addBOM === undefined) options.addBOM = true;
this.encoder = codec.iconv.getEncoder(options.defaultEncoding || 'utf-32le', options);}
Utf32AutoEncoder.prototype.write = function(str) { return this.encoder.write(str);};
Utf32AutoEncoder.prototype.end = function() { return this.encoder.end();};
// -- Decoding
function Utf32AutoDecoder(options, codec) { this.decoder = null; this.initialBufs = []; this.initialBufsLen = 0; this.options = options || {}; this.iconv = codec.iconv;}
Utf32AutoDecoder.prototype.write = function(buf) { if (!this.decoder) { // Codec is not chosen yet. Accumulate initial bytes. this.initialBufs.push(buf); this.initialBufsLen += buf.length;
if (this.initialBufsLen < 32) // We need more bytes to use space heuristic (see below) return '';
// We have enough bytes -> detect endianness. var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding); this.decoder = this.iconv.getDecoder(encoding, this.options);
var resStr = ''; for (var i = 0; i < this.initialBufs.length; i++) resStr += this.decoder.write(this.initialBufs[i]);
this.initialBufs.length = this.initialBufsLen = 0; return resStr; }
return this.decoder.write(buf);};
Utf32AutoDecoder.prototype.end = function() { if (!this.decoder) { var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding); this.decoder = this.iconv.getDecoder(encoding, this.options);
var resStr = ''; for (var i = 0; i < this.initialBufs.length; i++) resStr += this.decoder.write(this.initialBufs[i]);
var trail = this.decoder.end(); if (trail) resStr += trail;
this.initialBufs.length = this.initialBufsLen = 0; return resStr; }
return this.decoder.end();};
function detectEncoding(bufs, defaultEncoding) { var b = []; var charsProcessed = 0; var invalidLE = 0, invalidBE = 0; // Number of invalid chars when decoded as LE or BE. var bmpCharsLE = 0, bmpCharsBE = 0; // Number of BMP chars when decoded as LE or BE.
outer_loop: for (var i = 0; i < bufs.length; i++) { var buf = bufs[i]; for (var j = 0; j < buf.length; j++) { b.push(buf[j]); if (b.length === 4) { if (charsProcessed === 0) { // Check BOM first. if (b[0] === 0xFF && b[1] === 0xFE && b[2] === 0 && b[3] === 0) { return 'utf-32le'; } if (b[0] === 0 && b[1] === 0 && b[2] === 0xFE && b[3] === 0xFF) { return 'utf-32be'; } }
if (b[0] !== 0 || b[1] > 0x10) invalidBE++; if (b[3] !== 0 || b[2] > 0x10) invalidLE++;
if (b[0] === 0 && b[1] === 0 && (b[2] !== 0 || b[3] !== 0)) bmpCharsBE++; if ((b[0] !== 0 || b[1] !== 0) && b[2] === 0 && b[3] === 0) bmpCharsLE++;
b.length = 0; charsProcessed++;
if (charsProcessed >= 100) { break outer_loop; } } } }
// Make decisions. if (bmpCharsBE - invalidBE > bmpCharsLE - invalidLE) return 'utf-32be'; if (bmpCharsBE - invalidBE < bmpCharsLE - invalidLE) return 'utf-32le';
// Couldn't decide (likely all zeros or not enough data). return defaultEncoding || 'utf-32le';}123123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290version https://git-lfs.github.com/spec/v1oid sha256:289da5c0c44b1ec4a502e2862ee9e46d9b1758420904385fed0abae41f138a6csize 9283"use strict";var Buffer = require("safer-buffer").Buffer;
// UTF-7 codec, according to https://tools.ietf.org/html/rfc2152// See also below a UTF-7-IMAP codec, according to http://tools.ietf.org/html/rfc3501#section-5.1.3
exports.utf7 = Utf7Codec;exports.unicode11utf7 = 'utf7'; // Alias UNICODE-1-1-UTF-7function Utf7Codec(codecOptions, iconv) { this.iconv = iconv;};
Utf7Codec.prototype.encoder = Utf7Encoder;Utf7Codec.prototype.decoder = Utf7Decoder;Utf7Codec.prototype.bomAware = true;
// -- Encoding
var nonDirectChars = /[^A-Za-z0-9'\(\),-\.\/:\? \n\r\t]+/g;
function Utf7Encoder(options, codec) { this.iconv = codec.iconv;}
Utf7Encoder.prototype.write = function(str) { // Naive implementation. // Non-direct chars are encoded as "+<base64>-"; single "+" char is encoded as "+-". return Buffer.from(str.replace(nonDirectChars, function(chunk) { return "+" + (chunk === '+' ? '' : this.iconv.encode(chunk, 'utf16-be').toString('base64').replace(/=+$/, '')) + "-"; }.bind(this)));}
Utf7Encoder.prototype.end = function() {}
// -- Decoding
function Utf7Decoder(options, codec) { this.iconv = codec.iconv; this.inBase64 = false; this.base64Accum = '';}
var base64Regex = /[A-Za-z0-9\/+]/;var base64Chars = [];for (var i = 0; i < 256; i++) base64Chars[i] = base64Regex.test(String.fromCharCode(i));
var plusChar = '+'.charCodeAt(0), minusChar = '-'.charCodeAt(0), andChar = '&'.charCodeAt(0);
Utf7Decoder.prototype.write = function(buf) { var res = "", lastI = 0, inBase64 = this.inBase64, base64Accum = this.base64Accum;
// The decoder is more involved as we must handle chunks in stream.
for (var i = 0; i < buf.length; i++) { if (!inBase64) { // We're in direct mode. // Write direct chars until '+' if (buf[i] == plusChar) { res += this.iconv.decode(buf.slice(lastI, i), "ascii"); // Write direct chars. lastI = i+1; inBase64 = true; } } else { // We decode base64. if (!base64Chars[buf[i]]) { // Base64 ended. if (i == lastI && buf[i] == minusChar) {// "+-" -> "+" res += "+"; } else { var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i), "ascii"); res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); }
if (buf[i] != minusChar) // Minus is absorbed after base64. i--;
lastI = i+1; inBase64 = false; base64Accum = ''; } } }
if (!inBase64) { res += this.iconv.decode(buf.slice(lastI), "ascii"); // Write direct chars. } else { var b64str = base64Accum + this.iconv.decode(buf.slice(lastI), "ascii");
var canBeDecoded = b64str.length - (b64str.length % 8); // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars. base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future. b64str = b64str.slice(0, canBeDecoded);
res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); }
this.inBase64 = inBase64; this.base64Accum = base64Accum;
return res;}
Utf7Decoder.prototype.end = function() { var res = ""; if (this.inBase64 && this.base64Accum.length > 0) res = this.iconv.decode(Buffer.from(this.base64Accum, 'base64'), "utf16-be");
this.inBase64 = false; this.base64Accum = ''; return res;}
// UTF-7-IMAP codec.// RFC3501 Sec. 5.1.3 Modified UTF-7 (http://tools.ietf.org/html/rfc3501#section-5.1.3)// Differences:// * Base64 part is started by "&" instead of "+"// * Direct characters are 0x20-0x7E, except "&" (0x26)// * In Base64, "," is used instead of "/"// * Base64 must not be used to represent direct characters.// * No implicit shift back from Base64 (should always end with '-')// * String must end in non-shifted position.// * "-&" while in base64 is not allowed.
exports.utf7imap = Utf7IMAPCodec;function Utf7IMAPCodec(codecOptions, iconv) { this.iconv = iconv;};
Utf7IMAPCodec.prototype.encoder = Utf7IMAPEncoder;Utf7IMAPCodec.prototype.decoder = Utf7IMAPDecoder;Utf7IMAPCodec.prototype.bomAware = true;
// -- Encoding
function Utf7IMAPEncoder(options, codec) { this.iconv = codec.iconv; this.inBase64 = false; this.base64Accum = Buffer.alloc(6); this.base64AccumIdx = 0;}
Utf7IMAPEncoder.prototype.write = function(str) { var inBase64 = this.inBase64, base64Accum = this.base64Accum, base64AccumIdx = this.base64AccumIdx, buf = Buffer.alloc(str.length*5 + 10), bufIdx = 0;
for (var i = 0; i < str.length; i++) { var uChar = str.charCodeAt(i); if (0x20 <= uChar && uChar <= 0x7E) { // Direct character or '&'. if (inBase64) { if (base64AccumIdx > 0) { bufIdx += buf.write(base64Accum.slice(0, base64AccumIdx).toString('base64').replace(/\//g, ',').replace(/=+$/, ''), bufIdx); base64AccumIdx = 0; }
buf[bufIdx++] = minusChar; // Write '-', then go to direct mode. inBase64 = false; }
if (!inBase64) { buf[bufIdx++] = uChar; // Write direct character
if (uChar === andChar) // Ampersand -> '&-' buf[bufIdx++] = minusChar; }
} else { // Non-direct character if (!inBase64) { buf[bufIdx++] = andChar; // Write '&', then go to base64 mode. inBase64 = true; } if (inBase64) { base64Accum[base64AccumIdx++] = uChar >> 8; base64Accum[base64AccumIdx++] = uChar & 0xFF;
if (base64AccumIdx == base64Accum.length) { bufIdx += buf.write(base64Accum.toString('base64').replace(/\//g, ','), bufIdx); base64AccumIdx = 0; } } } }
this.inBase64 = inBase64; this.base64AccumIdx = base64AccumIdx;
return buf.slice(0, bufIdx);}
Utf7IMAPEncoder.prototype.end = function() { var buf = Buffer.alloc(10), bufIdx = 0; if (this.inBase64) { if (this.base64AccumIdx > 0) { bufIdx += buf.write(this.base64Accum.slice(0, this.base64AccumIdx).toString('base64').replace(/\//g, ',').replace(/=+$/, ''), bufIdx); this.base64AccumIdx = 0; }
buf[bufIdx++] = minusChar; // Write '-', then go to direct mode. this.inBase64 = false; }
return buf.slice(0, bufIdx);}
// -- Decoding
function Utf7IMAPDecoder(options, codec) { this.iconv = codec.iconv; this.inBase64 = false; this.base64Accum = '';}
var base64IMAPChars = base64Chars.slice();base64IMAPChars[','.charCodeAt(0)] = true;
Utf7IMAPDecoder.prototype.write = function(buf) { var res = "", lastI = 0, inBase64 = this.inBase64, base64Accum = this.base64Accum;
// The decoder is more involved as we must handle chunks in stream. // It is forgiving, closer to standard UTF-7 (for example, '-' is optional at the end).
for (var i = 0; i < buf.length; i++) { if (!inBase64) { // We're in direct mode. // Write direct chars until '&' if (buf[i] == andChar) { res += this.iconv.decode(buf.slice(lastI, i), "ascii"); // Write direct chars. lastI = i+1; inBase64 = true; } } else { // We decode base64. if (!base64IMAPChars[buf[i]]) { // Base64 ended. if (i == lastI && buf[i] == minusChar) { // "&-" -> "&" res += "&"; } else { var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i), "ascii").replace(/,/g, '/'); res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); }
if (buf[i] != minusChar) // Minus may be absorbed after base64. i--;
lastI = i+1; inBase64 = false; base64Accum = ''; } } }
if (!inBase64) { res += this.iconv.decode(buf.slice(lastI), "ascii"); // Write direct chars. } else { var b64str = base64Accum + this.iconv.decode(buf.slice(lastI), "ascii").replace(/,/g, '/');
var canBeDecoded = b64str.length - (b64str.length % 8); // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars. base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future. b64str = b64str.slice(0, canBeDecoded);
res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); }
this.inBase64 = inBase64; this.base64Accum = base64Accum;
return res;}
Utf7IMAPDecoder.prototype.end = function() { var res = ""; if (this.inBase64 && this.base64Accum.length > 0) res = this.iconv.decode(Buffer.from(this.base64Accum, 'base64'), "utf16-be");
this.inBase64 = false; this.base64Accum = ''; return res;}
12312345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152version https://git-lfs.github.com/spec/v1oid sha256:c230d25d8e7fbb50960c634b636b71327c409e9a77e67fe9446b566bdcea362dsize 1109"use strict";
var BOMChar = '\uFEFF';
exports.PrependBOM = PrependBOMWrapperfunction PrependBOMWrapper(encoder, options) { this.encoder = encoder; this.addBOM = true;}
PrependBOMWrapper.prototype.write = function(str) { if (this.addBOM) { str = BOMChar + str; this.addBOM = false; }
return this.encoder.write(str);}
PrependBOMWrapper.prototype.end = function() { return this.encoder.end();}
//------------------------------------------------------------------------------
exports.StripBOM = StripBOMWrapper;function StripBOMWrapper(decoder, options) { this.decoder = decoder; this.pass = false; this.options = options || {};}
StripBOMWrapper.prototype.write = function(buf) { var res = this.decoder.write(buf); if (this.pass || !res) return res;
if (res[0] === BOMChar) { res = res.slice(1); if (typeof this.options.stripBOM === 'function') this.options.stripBOM(); }
this.pass = true; return res;}
StripBOMWrapper.prototype.end = function() { return this.decoder.end();}
1231234567891011121314151617181920212223242526272829303132333435363738394041version https://git-lfs.github.com/spec/v1oid sha256:85d3aa95b0086752d2f7784d2bdaeb38f99c3cf6c35bee861702beb68556cb9esize 1387/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. * REQUIREMENT: This definition is dependent on the @types/node definition. * Install with `npm install @types/node --save-dev` *--------------------------------------------------------------------------------------------*/
declare module 'iconv-lite' { // Basic API export function decode(buffer: Buffer, encoding: string, options?: Options): string;
export function encode(content: string, encoding: string, options?: Options): Buffer;
export function encodingExists(encoding: string): boolean;
// Stream API export function decodeStream(encoding: string, options?: Options): NodeJS.ReadWriteStream;
export function encodeStream(encoding: string, options?: Options): NodeJS.ReadWriteStream;
// Low-level stream APIs export function getEncoder(encoding: string, options?: Options): EncoderStream;
export function getDecoder(encoding: string, options?: Options): DecoderStream;}
export interface Options { stripBOM?: boolean; addBOM?: boolean; defaultEncoding?: string;}
export interface EncoderStream { write(str: string): Buffer; end(): Buffer | undefined;}
export interface DecoderStream { write(buf: Buffer): string; end(): string | undefined;}123123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180version https://git-lfs.github.com/spec/v1oid sha256:0cb1506e70126aa00bc5bdf12f2200db89db032e8dabf23dcdd6a92b37d0f2afsize 6321"use strict";
var Buffer = require("safer-buffer").Buffer;
var bomHandling = require("./bom-handling"), iconv = module.exports;
// All codecs and aliases are kept here, keyed by encoding name/alias.// They are lazy loaded in `iconv.getCodec` from `encodings/index.js`.iconv.encodings = null;
// Characters emitted in case of error.iconv.defaultCharUnicode = '�';iconv.defaultCharSingleByte = '?';
// Public API.iconv.encode = function encode(str, encoding, options) { str = "" + (str || ""); // Ensure string.
var encoder = iconv.getEncoder(encoding, options);
var res = encoder.write(str); var trail = encoder.end(); return (trail && trail.length > 0) ? Buffer.concat([res, trail]) : res;}
iconv.decode = function decode(buf, encoding, options) { if (typeof buf === 'string') { if (!iconv.skipDecodeWarning) { console.error('Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding'); iconv.skipDecodeWarning = true; }
buf = Buffer.from("" + (buf || ""), "binary"); // Ensure buffer. }
var decoder = iconv.getDecoder(encoding, options);
var res = decoder.write(buf); var trail = decoder.end();
return trail ? (res + trail) : res;}
iconv.encodingExists = function encodingExists(enc) { try { iconv.getCodec(enc); return true; } catch (e) { return false; }}
// Legacy aliases to convert functionsiconv.toEncoding = iconv.encode;iconv.fromEncoding = iconv.decode;
// Search for a codec in iconv.encodings. Cache codec data in iconv._codecDataCache.iconv._codecDataCache = {};iconv.getCodec = function getCodec(encoding) { if (!iconv.encodings) iconv.encodings = require("../encodings"); // Lazy load all encoding definitions. // Canonicalize encoding name: strip all non-alphanumeric chars and appended year. var enc = iconv._canonicalizeEncoding(encoding);
// Traverse iconv.encodings to find actual codec. var codecOptions = {}; while (true) { var codec = iconv._codecDataCache[enc]; if (codec) return codec;
var codecDef = iconv.encodings[enc];
switch (typeof codecDef) { case "string": // Direct alias to other encoding. enc = codecDef; break;
case "object": // Alias with options. Can be layered. for (var key in codecDef) codecOptions[key] = codecDef[key];
if (!codecOptions.encodingName) codecOptions.encodingName = enc; enc = codecDef.type; break;
case "function": // Codec itself. if (!codecOptions.encodingName) codecOptions.encodingName = enc;
// The codec function must load all tables and return object with .encoder and .decoder methods. // It'll be called only once (for each different options object). codec = new codecDef(codecOptions, iconv);
iconv._codecDataCache[codecOptions.encodingName] = codec; // Save it to be reused later. return codec;
default: throw new Error("Encoding not recognized: '" + encoding + "' (searched as: '"+enc+"')"); } }}
iconv._canonicalizeEncoding = function(encoding) { // Canonicalize encoding name: strip all non-alphanumeric chars and appended year. return (''+encoding).toLowerCase().replace(/:\d{4}$|[^0-9a-z]/g, "");}
iconv.getEncoder = function getEncoder(encoding, options) { var codec = iconv.getCodec(encoding), encoder = new codec.encoder(options, codec);
if (codec.bomAware && options && options.addBOM) encoder = new bomHandling.PrependBOM(encoder, options);
return encoder;}
iconv.getDecoder = function getDecoder(encoding, options) { var codec = iconv.getCodec(encoding), decoder = new codec.decoder(options, codec);
if (codec.bomAware && !(options && options.stripBOM === false)) decoder = new bomHandling.StripBOM(decoder, options);
return decoder;}
// Streaming API// NOTE: Streaming API naturally depends on 'stream' module from Node.js. Unfortunately in browser environments this module can add// up to 100Kb to the output bundle. To avoid unnecessary code bloat, we don't enable Streaming API in browser by default.// If you would like to enable it explicitly, please add the following code to your app:// > iconv.enableStreamingAPI(require('stream'));iconv.enableStreamingAPI = function enableStreamingAPI(stream_module) { if (iconv.supportsStreams) return;
// Dependency-inject stream module to create IconvLite stream classes. var streams = require("./streams")(stream_module);
// Not public API yet, but expose the stream classes. iconv.IconvLiteEncoderStream = streams.IconvLiteEncoderStream; iconv.IconvLiteDecoderStream = streams.IconvLiteDecoderStream;
// Streaming API. iconv.encodeStream = function encodeStream(encoding, options) { return new iconv.IconvLiteEncoderStream(iconv.getEncoder(encoding, options), options); }
iconv.decodeStream = function decodeStream(encoding, options) { return new iconv.IconvLiteDecoderStream(iconv.getDecoder(encoding, options), options); }
iconv.supportsStreams = true;}
// Enable Streaming API automatically if 'stream' module is available and non-empty (the majority of environments).var stream_module;try { stream_module = require("stream");} catch (e) {}
if (stream_module && stream_module.Transform) { iconv.enableStreamingAPI(stream_module);
} else { // In rare cases where 'stream' module is not available by default, throw a helpful exception. iconv.encodeStream = iconv.decodeStream = function() { throw new Error("iconv-lite Streaming API is not enabled. Use iconv.enableStreamingAPI(require('stream')); to enable it."); };}
if ("Ā" != "\u0100") { 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.");}123123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109version https://git-lfs.github.com/spec/v1oid sha256:368596cfa80b9b9c6b93f2fde73615f10e89d650e6a1c92d3c07d56c34e4e393size 3380"use strict";
var Buffer = require("safer-buffer").Buffer;
// NOTE: Due to 'stream' module being pretty large (~100Kb, significant in browser environments), // we opt to dependency-inject it instead of creating a hard dependency.module.exports = function(stream_module) { var Transform = stream_module.Transform;
// == Encoder stream =======================================================
function IconvLiteEncoderStream(conv, options) { this.conv = conv; options = options || {}; options.decodeStrings = false; // We accept only strings, so we don't need to decode them. Transform.call(this, options); }
IconvLiteEncoderStream.prototype = Object.create(Transform.prototype, { constructor: { value: IconvLiteEncoderStream } });
IconvLiteEncoderStream.prototype._transform = function(chunk, encoding, done) { if (typeof chunk != 'string') return done(new Error("Iconv encoding stream needs strings as its input.")); try { var res = this.conv.write(chunk); if (res && res.length) this.push(res); done(); } catch (e) { done(e); } }
IconvLiteEncoderStream.prototype._flush = function(done) { try { var res = this.conv.end(); if (res && res.length) this.push(res); done(); } catch (e) { done(e); } }
IconvLiteEncoderStream.prototype.collect = function(cb) { var chunks = []; this.on('error', cb); this.on('data', function(chunk) { chunks.push(chunk); }); this.on('end', function() { cb(null, Buffer.concat(chunks)); }); return this; }
// == Decoder stream =======================================================
function IconvLiteDecoderStream(conv, options) { this.conv = conv; options = options || {}; options.encoding = this.encoding = 'utf8'; // We output strings. Transform.call(this, options); }
IconvLiteDecoderStream.prototype = Object.create(Transform.prototype, { constructor: { value: IconvLiteDecoderStream } });
IconvLiteDecoderStream.prototype._transform = function(chunk, encoding, done) { if (!Buffer.isBuffer(chunk) && !(chunk instanceof Uint8Array)) return done(new Error("Iconv decoding stream needs buffers as its input.")); try { var res = this.conv.write(chunk); if (res && res.length) this.push(res, this.encoding); done(); } catch (e) { done(e); } }
IconvLiteDecoderStream.prototype._flush = function(done) { try { var res = this.conv.end(); if (res && res.length) this.push(res, this.encoding); done(); } catch (e) { done(e); } }
IconvLiteDecoderStream.prototype.collect = function(cb) { var res = ''; this.on('error', cb); this.on('data', function(chunk) { res += chunk; }); this.on('end', function() { cb(null, res); }); return this; }
return { IconvLiteEncoderStream: IconvLiteEncoderStream, IconvLiteDecoderStream: IconvLiteDecoderStream, };};1231234567891011121314151617181920212223242526272829303132333435363738394041424344version https://git-lfs.github.com/spec/v1oid sha256:3a9582fd121f841c245d1fcf84ef0b9e41c94b785b8d7eb63f9f5aec9bad0b98size 1131{ "name": "iconv-lite", "description": "Convert character encodings in pure javascript.", "version": "0.6.3", "license": "MIT", "keywords": [ "iconv", "convert", "charset", "icu" ], "author": "Alexander Shtuchkin <ashtuchkin@gmail.com>", "main": "./lib/index.js", "typings": "./lib/index.d.ts", "homepage": "https://github.com/ashtuchkin/iconv-lite", "bugs": "https://github.com/ashtuchkin/iconv-lite/issues", "repository": { "type": "git", "url": "git://github.com/ashtuchkin/iconv-lite.git" }, "engines": { "node": ">=0.10.0" }, "scripts": { "coverage": "c8 _mocha --grep .", "test": "mocha --reporter spec --grep ." }, "browser": { "stream": false }, "devDependencies": { "async": "^3.2.0", "c8": "^7.2.0", "errto": "^0.2.1", "iconv": "^2.3.5", "mocha": "^3.5.3", "request": "^2.88.2", "semver": "^6.3.0", "unorm": "^1.6.0" }, "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" }}123123456789101112131415161718192021222324252627282930version https://git-lfs.github.com/spec/v1oid sha256:142d7abb8d44c3281c4356d7a14371ca056689121511f4ac75252cc4623281absize 816# Change Log
All notable changes to this project will be documented in this file.This project adheres to [Semantic Versioning](http://semver.org/).
## [5.1.0] - 2020-11-19
### Features
- feat: support at-rule versions of `import`/`export`
## [5.0.0] - 2020-10-12
### BREAKING CHANGE
- minimum supported `postcss` version is `^8.1.0`
### Fixes
- minimum supported `Node.js` version is `^10 || ^12 || >= 14`- compatibility with PostCSS 8
## [5.0.0-rc.0] - 2020-09-21
### BREAKING CHANGE
- minimum supported `Node.js` version is `>= 10.13.0 || >= 12.13.0 || >= 14`- minimum supported `postcss` version is `^8.0.0`- `postcss` was moved to `peerDependencies`, you need to install `postcss` in your project before use the plugin- you need to pass `postcss` API to using `createICSSRules` (third argument)123123456version https://git-lfs.github.com/spec/v1oid sha256:b2b54c738525e98cc42d4a1c239c9d8421507816acce98950e81d0943daae68esize 744ISC License (ISC)Copyright 2018 Glen Maddern
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.
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.12312345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394version https://git-lfs.github.com/spec/v1oid sha256:6867f6ef25e73b8774c42e4717c02fb7ae8ca407bd310308f892c7a3db5a98ddsize 2425[](https://travis-ci.org/css-modules/icss-utils)
# ICSS Utils
## replaceSymbols
Governs the way tokens are searched & replaced during the linking stage of ICSS loading.
This is broken into its own module in case the behaviour needs to be replicated in other PostCSS plugins(i.e. [CSS Modules Values](https://github.com/css-modules/postcss-modules-values))
```jsimport { replaceSymbols, replaceValueSymbols } from "icss-utils";
replaceSymbols(css, replacements);replaceValueSymbols(string, replacements);```
Where:
- `css` is the PostCSS tree you're working with- `replacements` is an JS object of `symbol: "replacement"` pairs, where all occurrences of `symbol` are replaced with `replacement`.
A symbol is a string of alphanumeric, `-` or `_` characters. A replacement can be any string. They are replaced in the following places:
- In the value of a declaration, i.e. `color: my_symbol;` or `box-shadow: 0 0 blur spread shadow-color`- In a media expression i.e. `@media small {}` or `@media screen and not-large {}`
## extractICSS(css, removeRules = true, mode = 'auto')
Extracts and remove (if removeRules is equal true) from PostCSS tree `:import`, `@icss-import`, `:export` and `@icss-export` statements.
```jsimport postcss from "postcss";import { extractICSS } from "icss-utils";
const css = postcss.parse(` :import(colors) { a: b; } :export { c: d; }`);
extractICSS(css);/* { icssImports: { colors: { a: 'b' } }, icssExports: { c: 'd' } }*/```
By default both the pseudo and at-rule form of the import and export statementswill be removed. Pass the `mode` option to limit to only one type.
## createICSSRules(icssImports, icssExports, mode = 'rule')
Converts icss imports and exports definitions to postcss ast
```jscreateICSSRules( { colors: { a: "b", }, }, { c: "d", }, // Need pass `rule` and `decl` from postcss // Please look at `Step 4` https://evilmartians.com/chronicles/postcss-8-plugin-migration postcss);```
By default it will create pseudo selector rules (`:import` and `:export`). Pass`at-rule` for `mode` to instead generate `@icss-import` and `@icss-export`, whichmay be more resilient to post processing by other tools.
## License
ISC
---
Glen Maddern, Bogdan Chadkin and Evilebottnawi 2015-present.12312345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152version https://git-lfs.github.com/spec/v1oid sha256:75035d3340621929bad4585f07e82fde17b3cc58d0f7ff9aa1ce3658d9463b62size 1298{ "name": "icss-utils", "version": "5.1.0", "description": "ICSS utils for postcss ast", "main": "src/index.js", "engines": { "node": "^10 || ^12 || >= 14" }, "files": [ "src" ], "scripts": { "prettier": "prettier -l --ignore-path .gitignore . \"!test/test-cases\"", "eslint": "eslint --ignore-path .gitignore .", "lint": "yarn eslint && yarn prettier", "test:only": "jest", "test:watch": "jest --watch", "test:coverage": "jest --coverage --collectCoverageFrom=\"src/**/*\"", "pretest": "yarn lint", "test": "yarn test:coverage", "prepublishOnly": "yarn test" }, "repository": { "type": "git", "url": "git+https://github.com/css-modules/icss-utils.git" }, "keywords": [ "css", "modules", "icss", "postcss" ], "author": "Glen Maddern", "license": "ISC", "bugs": { "url": "https://github.com/css-modules/icss-utils/issues" }, "homepage": "https://github.com/css-modules/icss-utils#readme", "devDependencies": { "coveralls": "^3.1.0", "eslint": "^7.9.0", "eslint-config-prettier": "^6.12.0", "husky": "^4.3.0", "jest": "^26.4.2", "lint-staged": "^10.4.0", "postcss": "^8.1.0", "prettier": "^2.1.2" }, "peerDependencies": { "postcss": "^8.1.0" }}12312345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667version https://git-lfs.github.com/spec/v1oid sha256:cb61241822353aae5cf2844c92eb6b48f61ab2a1558c2550e797cb10b8eb1687size 1569const createImports = (imports, postcss, mode = "rule") => { return Object.keys(imports).map((path) => { const aliases = imports[path]; const declarations = Object.keys(aliases).map((key) => postcss.decl({ prop: key, value: aliases[key], raws: { before: "\n " }, }) );
const hasDeclarations = declarations.length > 0;
const rule = mode === "rule" ? postcss.rule({ selector: `:import('${path}')`, raws: { after: hasDeclarations ? "\n" : "" }, }) : postcss.atRule({ name: "icss-import", params: `'${path}'`, raws: { after: hasDeclarations ? "\n" : "" }, });
if (hasDeclarations) { rule.append(declarations); }
return rule; });};
const createExports = (exports, postcss, mode = "rule") => { const declarations = Object.keys(exports).map((key) => postcss.decl({ prop: key, value: exports[key], raws: { before: "\n " }, }) );
if (declarations.length === 0) { return []; } const rule = mode === "rule" ? postcss.rule({ selector: `:export`, raws: { after: "\n" }, }) : postcss.atRule({ name: "icss-export", raws: { after: "\n" }, });
rule.append(declarations);
return [rule];};
const createICSSRules = (imports, exports, postcss, mode) => [ ...createImports(imports, postcss, mode), ...createExports(exports, postcss, mode),];
module.exports = createICSSRules;12312345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576version https://git-lfs.github.com/spec/v1oid sha256:2d6a84d57b92b4ee2bc6b2a29f1b1a74d78b35603a2c7ba8749808378fbef634size 1713const importPattern = /^:import\(("[^"]*"|'[^']*'|[^"']+)\)$/;const balancedQuotes = /^("[^"]*"|'[^']*'|[^"']+)$/;
const getDeclsObject = (rule) => { const object = {};
rule.walkDecls((decl) => { const before = decl.raws.before ? decl.raws.before.trim() : "";
object[before + decl.prop] = decl.value; });
return object;};/** * * @param {string} css * @param {boolean} removeRules * @param {'auto' | 'rule' | 'at-rule'} mode */const extractICSS = (css, removeRules = true, mode = "auto") => { const icssImports = {}; const icssExports = {};
function addImports(node, path) { const unquoted = path.replace(/'|"/g, ""); icssImports[unquoted] = Object.assign( icssImports[unquoted] || {}, getDeclsObject(node) );
if (removeRules) { node.remove(); } }
function addExports(node) { Object.assign(icssExports, getDeclsObject(node)); if (removeRules) { node.remove(); } }
css.each((node) => { if (node.type === "rule" && mode !== "at-rule") { if (node.selector.slice(0, 7) === ":import") { const matches = importPattern.exec(node.selector);
if (matches) { addImports(node, matches[1]); } }
if (node.selector === ":export") { addExports(node); } }
if (node.type === "atrule" && mode !== "rule") { if (node.name === "icss-import") { const matches = balancedQuotes.exec(node.params);
if (matches) { addImports(node, matches[1]); } } if (node.name === "icss-export") { addExports(node); } } });
return { icssImports, icssExports };};
module.exports = extractICSS;1231234567891011version https://git-lfs.github.com/spec/v1oid sha256:f1c970f95b0a0b8afd2d34429aee1d151a554c305347b5146c089a177265c614size 324const replaceValueSymbols = require("./replaceValueSymbols.js");const replaceSymbols = require("./replaceSymbols.js");const extractICSS = require("./extractICSS.js");const createICSSRules = require("./createICSSRules.js");
module.exports = { replaceValueSymbols, replaceSymbols, extractICSS, createICSSRules,};123123456789101112131415161718version https://git-lfs.github.com/spec/v1oid sha256:e48190de9f27312b7c7f00a774f175eb4705e9f69bc0d3f5b2b87bccfb8e3130size 607const replaceValueSymbols = require("./replaceValueSymbols.js");
const replaceSymbols = (css, replacements) => { css.walk((node) => { if (node.type === "decl" && node.value) { node.value = replaceValueSymbols(node.value.toString(), replacements); } else if (node.type === "rule" && node.selector) { node.selector = replaceValueSymbols( node.selector.toString(), replacements ); } else if (node.type === "atrule" && node.params) { node.params = replaceValueSymbols(node.params.toString(), replacements); } });};
module.exports = replaceSymbols;12312345678910111213141516171819202122version https://git-lfs.github.com/spec/v1oid sha256:a982039c2cfa03b85053f52d969812cfd37d65ff3fa44c02028f44361c730d52size 502const matchValueName = /[$]?[\w-]+/g;
const replaceValueSymbols = (value, replacements) => { let matches;
while ((matches = matchValueName.exec(value))) { const replacement = replacements[matches[0]];
if (replacement) { value = value.slice(0, matches.index) + replacement + value.slice(matchValueName.lastIndex);
matchValueName.lastIndex -= matches[0].length - replacement.length; } }
return value;};
module.exports = replaceValueSymbols;123123456789version https://git-lfs.github.com/spec/v1oid sha256:54d0b82d1e7d0bc60a4b48b6172f1a9fa7385cfa8a448d14ad3a638930ef417csize 1104The MIT License (MIT)
Copyright © 2017 Aditya Yadav, http://netroy.in
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:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
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.12312345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788version https://git-lfs.github.com/spec/v1oid sha256:2cfa51e9122b224c3cfdfe51d9880d1411c2f92b4bce580884e56d33c320db40size 2308# image-size
[](https://www.npmjs.com/package/image-size)[](https://travis-ci.org/image-size/image-size)[](http://npm-stat.com/charts.html?package=image-size&author=&from=&to=)[](https://coveralls.io/github/image-size/image-size?branch=master)[](https://david-dm.org/image-size/image-size#info=devDependencies)
A [Node](https://nodejs.org/en/) module to get dimensions of any image file
## Supported formats
* BMP* GIF* JPEG* PNG* PSD* TIFF* WebP* SVG* DDS
### Upcoming
* SWF
## Programmatic Usage
```npm install image-size --save```
### Synchronous
```javascriptvar sizeOf = require('image-size');var dimensions = sizeOf('images/funny-cats.png');console.log(dimensions.width, dimensions.height);```
### Asynchronous
```javascriptvar sizeOf = require('image-size');sizeOf('images/funny-cats.png', function (err, dimensions) { console.log(dimensions.width, dimensions.height);});```NOTE: The asynchronous version doesn't work if the input is a Buffer. Use synchronous version instead.
### Using a URL
```javascriptvar url = require('url');var http = require('http');
var sizeOf = require('image-size');
var imgUrl = 'http://my-amazing-website.com/image.jpeg';var options = url.parse(imgUrl);
http.get(options, function (response) { var chunks = []; response.on('data', function (chunk) { chunks.push(chunk); }).on('end', function() { var buffer = Buffer.concat(chunks); console.log(sizeOf(buffer)); });});```
You can optionally check the buffer lengths & stop downloading the image after a few kilobytes.**You don't need to download the entire image**
## Command-Line Usage (CLI)
```npm install image-size --globalimage-size image1 [image2] [image3] ...```
## Credits
not a direct port, but an attempt to have something like[dabble's imagesize](https://github.com/dabble/imagesize/blob/master/lib/image_size.rb) as a node module.
## [Contributors](Contributors.md)123123456789101112131415161718192021222324252627282930313233343536version https://git-lfs.github.com/spec/v1oid sha256:fead705258edb259ccce8a82476100c475af7de8ffb35c14381a434e0bd24255size 938#!/usr/bin/env node'use strict';
var fs = require('fs');var path = require('path');
var imageSize = require('..');
var files = process.argv.slice(2);
if (!files.length) { console.error('Usage: image-size image1 [image2] [image3] ...'); process.exit(-1);}
var red = ['\x1B[31m', '\x1B[39m'];// var bold = ['\x1B[1m', '\x1B[22m'];var grey = ['\x1B[90m', '\x1B[39m'];var green = ['\x1B[32m', '\x1B[39m'];
files.forEach(function (image) { try { if (fs.existsSync(path.resolve(image))) { var size = imageSize(image); var label = green[0] + size.width + green[1] + grey[0] + 'x' + grey[1] + green[0] + size.height + green[1]; console.info(label, '-', grey[0] + image + grey[1]); } else { console.error('file doesn\'t exist - ', image); } } catch (e) { // console.error(e.stack); console.error(red[0] + e.message + red[1], '-', image); }});12312345678910111213141516171819version https://git-lfs.github.com/spec/v1oid sha256:7f5664e0d9e0de4e3876cb5dc160bfb1df4db2f09872bb350a49949867ff8343size 376'use strict';
var typeMap = {};var types = require('./types');
// load all available handlerstypes.forEach(function (type) { typeMap[type] = require('./types/' + type).detect;});
module.exports = function (buffer, filepath) { var type, result; for (type in typeMap) { result = typeMap[type](buffer, filepath); if (result) { return type; } }};123123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105version https://git-lfs.github.com/spec/v1oid sha256:711d2bd1f8bf0c430afd3d7d37be6623015b9b80bf45fecdf696dad094e47b54size 2951'use strict';
var fs = require('fs');var path = require('path');
var detector = require('./detector');
var handlers = {};var types = require('./types');
// load all available handlerstypes.forEach(function (type) { handlers[type] = require('./types/' + type);});
// Maximum buffer size, with a default of 128 kilobytes.// TO-DO: make this adaptive based on the initial signature of the imagevar MaxBufferSize = 128*1024;
function lookup (buffer, filepath) { // detect the file type.. don't rely on the extension var type = detector(buffer, filepath);
// find an appropriate handler for this file type if (type in handlers) { var size = handlers[type].calculate(buffer, filepath); if (size !== false) { size.type = type; return size; } }
// throw up, if we don't understand the file throw new TypeError('unsupported file type: ' + type + ' (file: ' + filepath + ')');}
function asyncFileToBuffer (filepath, callback) { // open the file in read only mode fs.open(filepath, 'r', function (err, descriptor) { if (err) { return callback(err); } var size = fs.fstatSync(descriptor).size; if (size <= 0){return callback(new Error("File size is not greater than 0 —— " + filepath)); } var bufferSize = Math.min(size, MaxBufferSize); var buffer = new Buffer(bufferSize); // read first buffer block from the file, asynchronously fs.read(descriptor, buffer, 0, bufferSize, 0, function (err) { if (err) { return callback(err); } // close the file, we are done fs.close(descriptor, function (err) { callback(err, buffer); }); }); });}
function syncFileToBuffer (filepath) { // read from the file, synchronously var descriptor = fs.openSync(filepath, 'r'); var size = fs.fstatSync(descriptor).size; var bufferSize = Math.min(size, MaxBufferSize); var buffer = new Buffer(bufferSize); fs.readSync(descriptor, buffer, 0, bufferSize, 0); fs.closeSync(descriptor); return buffer;}
/** * @params input - buffer or relative/absolute path of the image file * @params callback - optional function for async detection */module.exports = function (input, callback) {
// Handle buffer input if (Buffer.isBuffer(input)) { return lookup(input); }
// input should be a string at this point if (typeof input !== 'string') { throw new TypeError('invalid invocation'); }
// resolve the file path var filepath = path.resolve(input);
if (typeof callback === 'function') { asyncFileToBuffer(filepath, function (err, buffer) { if (err) { return callback(err); }
// return the dimensions var dimensions; try { dimensions = lookup(buffer, filepath); } catch (e) { err = e; } callback(err, dimensions); }); } else { var buffer = syncFileToBuffer(filepath); return lookup(buffer, filepath); }};
module.exports.types = types;1231234567891011version https://git-lfs.github.com/spec/v1oid sha256:06e564631ed6bee74592063ee8ea326314fd2ffedd7298216e1bdccf863d1284size 307'use strict';
// Abstract reading multi-byte unsigned integersfunction readUInt (buffer, bits, offset, isBigEndian) { offset = offset || 0; var endian = !!isBigEndian ? 'BE' : 'LE'; var method = buffer['readUInt' + bits + endian]; return method.call(buffer, offset);}
module.exports = readUInt;12312345678910111213version https://git-lfs.github.com/spec/v1oid sha256:b318ce358b35b9d48a27419b10900b2515bdfeff65b3f52c49b6e1e5ae494600size 119'use strict';
module.exports = [ 'bmp', 'gif', 'jpg', 'png', 'psd', 'svg', 'tiff', 'webp', 'dds'];1231234567891011121314151617version https://git-lfs.github.com/spec/v1oid sha256:a234df14c25770dcbc0f838e2c46c73358476e326533ec1f84f6ea1265437b67size 296'use strict';
function isBMP (buffer) { return ('BM' === buffer.toString('ascii', 0, 2));}
function calculate (buffer) { return { 'width': buffer.readUInt32LE(18), 'height': Math.abs(buffer.readInt32LE(22)) };}
module.exports = { 'detect': isBMP, 'calculate': calculate};123123456789101112131415161718version https://git-lfs.github.com/spec/v1oid sha256:0d4c33a7204c70b055ef0e9e307e3b165eb5aebbc3568fa6073ac885bf0e1b8asize 304'use strict';
function isDDS(buffer){ return buffer.readUInt32LE(0) === 0x20534444;}
function calculate(buffer){ // read file resolution metadata return { 'height': buffer.readUInt32LE(12), 'width': buffer.readUInt32LE(16) };}
module.exports = { 'detect': isDDS, 'calculate': calculate};12312345678910111213141516171819version https://git-lfs.github.com/spec/v1oid sha256:b6e166b9f2e12419f6a545f823882c96eaa509e04d80daa781bee1e88878f634size 350'use strict';
var gifRegexp = /^GIF8[79]a/;function isGIF (buffer) { var signature = buffer.toString('ascii', 0, 6); return (gifRegexp.test(signature));}
function calculate(buffer) { return { 'width': buffer.readUInt16LE(6), 'height': buffer.readUInt16LE(8) };}
module.exports = { 'detect': isGIF, 'calculate': calculate};1231234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162version https://git-lfs.github.com/spec/v1oid sha256:f02406c3509304bc2209504c126c0d95b0ca7d500b30f22dd6e9be66c7ee6c43size 1560'use strict';
// NOTE: we only support baseline and progressive JPGs here// due to the structure of the loader class, we only get a buffer// with a maximum size of 4096 bytes. so if the SOF marker is outside// if this range we can't detect the file size correctly.
function isJPG (buffer) { //, filepath var SOIMarker = buffer.toString('hex', 0, 2); return ('ffd8' === SOIMarker);}
function extractSize (buffer, i) { return { 'height' : buffer.readUInt16BE(i), 'width' : buffer.readUInt16BE(i + 2) };}
function validateBuffer (buffer, i) { // index should be within buffer limits if (i > buffer.length) { throw new TypeError('Corrupt JPG, exceeded buffer limits'); } // Every JPEG block must begin with a 0xFF if (buffer[i] !== 0xFF) { throw new TypeError('Invalid JPG, marker table corrupted'); }}
function calculate (buffer) {
// Skip 4 chars, they are for signature buffer = buffer.slice(4);
var i, next; while (buffer.length) { // read length of the next block i = buffer.readUInt16BE(0);
// ensure correct format validateBuffer(buffer, i);
// 0xFFC0 is baseline standard(SOF) // 0xFFC1 is baseline optimized(SOF) // 0xFFC2 is progressive(SOF2) next = buffer[i + 1]; if (next === 0xC0 || next === 0xC1 || next === 0xC2) { return extractSize(buffer, i + 5); }
// move to the next block buffer = buffer.slice(i + 2); }
throw new TypeError('Invalid JPG, no size found');}
module.exports = { 'detect': isJPG, 'calculate': calculate};123123456789101112131415161718192021222324252627282930313233343536version https://git-lfs.github.com/spec/v1oid sha256:4bb0e2b63e2f30d1953d943c91b686d99ab94615a4e548cac4db37bdbc08116csize 911'use strict';
var pngSignature = 'PNG\r\n\x1a\n';var pngImageHeaderChunkName = 'IHDR';var pngFriedChunkName = 'CgBI'; // Used to detect "fried" png's: http://www.jongware.com/pngdefry.html
function isPNG (buffer) { if (pngSignature === buffer.toString('ascii', 1, 8)) { var chunkName = buffer.toString('ascii', 12, 16); if (chunkName === pngFriedChunkName) { chunkName = buffer.toString('ascii', 28, 32); } if (chunkName !== pngImageHeaderChunkName) { throw new TypeError('invalid png'); } return true; }}
function calculate (buffer) { if (buffer.toString('ascii', 12, 16) === pngFriedChunkName) { return { 'width': buffer.readUInt32BE(32), 'height': buffer.readUInt32BE(36) }; } return { 'width': buffer.readUInt32BE(16), 'height': buffer.readUInt32BE(20) };}
module.exports = { 'detect': isPNG, 'calculate': calculate};1231234567891011121314151617version https://git-lfs.github.com/spec/v1oid sha256:f6c5af919ff18e5b3696da3e7a49ea3a30a55370ca7720f2f9249ac3114badc5size 289'use strict';
function isPSD (buffer) { return ('8BPS' === buffer.toString('ascii', 0, 4));}
function calculate (buffer) { return { 'width': buffer.readUInt32BE(18), 'height': buffer.readUInt32BE(14) };}
module.exports = { 'detect': isPSD, 'calculate': calculate};123123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778version https://git-lfs.github.com/spec/v1oid sha256:ec6bb559e133e8a0decf8ce312a7266548794c1319010ad16a67c34b37613cddsize 1764'use strict';
var svgReg = /<svg[^>]+[^>]*>/;function isSVG (buffer) { return svgReg.test(buffer);}
var extractorRegExps = { 'root': /<svg\s[^>]+>/, 'width': /\bwidth=(['"])([^%]+?)\1/, 'height': /\bheight=(['"])([^%]+?)\1/, 'viewbox': /\bviewBox=(['"])(.+?)\1/};
function parseViewbox (viewbox) { var bounds = viewbox.split(' '); return { 'width': parseInt(bounds[2], 10), 'height': parseInt(bounds[3], 10) };}
function parseAttributes (root) { var width = root.match(extractorRegExps.width); var height = root.match(extractorRegExps.height); var viewbox = root.match(extractorRegExps.viewbox); return { 'width': width && parseInt(width[2], 10), 'height': height && parseInt(height[2], 10), 'viewbox': viewbox && parseViewbox(viewbox[2]) };}
function calculateByDimensions (attrs) { return { 'width': attrs.width, 'height': attrs.height };}
function calculateByViewbox (attrs) { var ratio = attrs.viewbox.width / attrs.viewbox.height; if (attrs.width) { return { 'width': attrs.width, 'height': Math.floor(attrs.width / ratio) }; } if (attrs.height) { return { 'width': Math.floor(attrs.height * ratio), 'height': attrs.height }; } return { 'width': attrs.viewbox.width, 'height': attrs.viewbox.height };}
function calculate (buffer) { var root = buffer.toString('utf8').match(extractorRegExps.root); if (root) { var attrs = parseAttributes(root[0]); if (attrs.width && attrs.height) { return calculateByDimensions(attrs); } if (attrs.viewbox) { return calculateByViewbox(attrs); } } throw new TypeError('invalid svg');}
module.exports = { 'detect': isSVG, 'calculate': calculate};123123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118version https://git-lfs.github.com/spec/v1oid sha256:4bf27eea9cb59b37cb2cb0e293e1515e79831bf7f36ec212f6e7c7047b84535csize 2893'use strict';
// based on http://www.compix.com/fileformattif.htm// TO-DO: support big-endian as well
var fs = require('fs');var readUInt = require('../readUInt');
function isTIFF (buffer) { var hex4 = buffer.toString('hex', 0, 4); return ('49492a00' === hex4 || '4d4d002a' === hex4);}
// Read IFD (image-file-directory) into a bufferfunction readIFD (buffer, filepath, isBigEndian) {
var ifdOffset = readUInt(buffer, 32, 4, isBigEndian);
// read only till the end of the file var bufferSize = 1024; var fileSize = fs.statSync(filepath).size; if (ifdOffset + bufferSize > fileSize) { bufferSize = fileSize - ifdOffset - 10; }
// populate the buffer var endBuffer = new Buffer(bufferSize); var descriptor = fs.openSync(filepath, 'r'); fs.readSync(descriptor, endBuffer, 0, bufferSize, ifdOffset);
// var ifdLength = readUInt(endBuffer, 16, 0, isBigEndian); var ifdBuffer = endBuffer.slice(2); //, 2 + 12 * ifdLength); return ifdBuffer;}
// TIFF values seem to be messed up on Big-Endian, this helpsfunction readValue (buffer, isBigEndian) { var low = readUInt(buffer, 16, 8, isBigEndian); var high = readUInt(buffer, 16, 10, isBigEndian); return (high << 16) + low;}
// move to the next tagfunction nextTag (buffer) { if (buffer.length > 24) { return buffer.slice(12); }}
// Extract IFD tags from TIFF metadatafunction extractTags (buffer, isBigEndian) { var tags = {}; var code, type, length;
while (buffer && buffer.length) { code = readUInt(buffer, 16, 0, isBigEndian); type = readUInt(buffer, 16, 2, isBigEndian); length = readUInt(buffer, 32, 4, isBigEndian);
// 0 means end of IFD if (code === 0) { break; } else { // 256 is width, 257 is height // if (code === 256 || code === 257) { if (length === 1 && (type === 3 || type === 4)) { tags[code] = readValue(buffer, isBigEndian); }
// move to the next tag buffer = nextTag(buffer); } } return tags;}
// Test if the TIFF is Big Endian or Little Endianfunction determineEndianness (buffer) { var signature = buffer.toString('ascii', 0, 2); if ('II' === signature) { return 'LE'; } else if ('MM' === signature) { return 'BE'; }}
function calculate (buffer, filepath) {
if (!filepath) { throw new TypeError('Tiff doesn\'t support buffer'); }
// Determine BE/LE var isBigEndian = determineEndianness(buffer) === 'BE';
// read the IFD var ifdBuffer = readIFD(buffer, filepath, isBigEndian);
// extract the tags from the IFD var tags = extractTags(ifdBuffer, isBigEndian);
var width = tags[256]; var height = tags[257];
if (!width || !height) { throw new TypeError('Invalid Tiff, missing tags'); }
return { 'width': width, 'height': height };}
module.exports = { 'detect': isTIFF, 'calculate': calculate};123123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869version https://git-lfs.github.com/spec/v1oid sha256:974eeb762532fb9d7c37957a5c8ccec4da4fddca22082807bcc207694335e217size 1802'use strict';
// based on https://developers.google.com/speed/webp/docs/riff_container
function isWebP (buffer) { var riffHeader = 'RIFF' === buffer.toString('ascii', 0, 4); var webpHeader = 'WEBP' === buffer.toString('ascii', 8, 12); var vp8Header = 'VP8' === buffer.toString('ascii', 12, 15); return (riffHeader && webpHeader && vp8Header);}
function calculate (buffer) { var chunkHeader = buffer.toString('ascii', 12, 16); buffer = buffer.slice(20, 30);
// Extended webp stream signature if (chunkHeader === 'VP8X') { var extendedHeader = buffer[0]; var validStart = (extendedHeader & 0xc0) === 0; var validEnd = (extendedHeader & 0x01) === 0; if (validStart && validEnd) { return calculateExtended(buffer); } else { return false; } }
// Lossless webp stream signature if (chunkHeader === 'VP8 ' && buffer[0] !== 0x2f) { return calculateLossy(buffer); }
// Lossy webp stream signature var signature = buffer.toString('hex', 3, 6); if (chunkHeader === 'VP8L' && signature !== '9d012a') { return calculateLossless(buffer); }
return false;}
function calculateExtended (buffer) { return { 'width': 1 + buffer.readUIntLE(4, 3), 'height': 1 + buffer.readUIntLE(7, 3) }}
function calculateLossless (buffer) { return { 'width': 1 + (((buffer[2] & 0x3F) << 8) | buffer[1]), 'height': 1 + (((buffer[4] & 0xF) << 10) | (buffer[3] << 2) | ((buffer[2] & 0xC0) >> 6)) };}
function calculateLossy (buffer) { // `& 0x3fff` returns the last 14 bits // TO-DO: include webp scaling in the calculations return { 'width': buffer.readInt16LE(6) & 0x3fff, 'height': buffer.readInt16LE(8) & 0x3fff };}
module.exports = { 'detect': isWebP, 'calculate': calculate};12312345678910111213141516171819202122232425262728293031323334353637383940414243444546474849version https://git-lfs.github.com/spec/v1oid sha256:ced46a8aec29663d7cc48b73be9aa69d46d7a10276f483291f14ace804f56e25size 913{ "name": "image-size", "version": "0.5.5", "description": "get dimensions of any image file", "main": "lib/index.js", "files": [ "bin", "lib" ], "engines": { "node": ">=0.10.0" }, "bin": { "image-size": "bin/image-size.js" }, "scripts": { "pretest": "jshint", "test": "mocha specs", "coverage": "istanbul cover _mocha specs" }, "repository": "image-size/image-size", "keywords": [ "image", "size", "dimensions", "resolution", "width", "height", "png", "jpeg", "bmp", "gif", "psd", "tiff", "webp", "svg" ], "author": "netroy <aditya@netroy.in> (http://netroy.in/)", "license": "MIT", "devDependencies": { "escomplex-js": "^1.2.0", "expect.js": "^0.3.1", "glob": "^7.1.1", "istanbul": "^1.1.0-alpha.1", "jshint": "^2.9.4", "mocha": "^3.4.1", "sinon": "^2.2.0" }}123123456789101112131415161718192021version https://git-lfs.github.com/spec/v1oid sha256:784fd7232e106901065a329b285ff9ba9ad98ff08ac1932b45b53a0b954974c5size 1099MIT License
Copyright (c) 2014-present, Lee Byron and other contributors.
Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, 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 THESOFTWARE.123123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761version https://git-lfs.github.com/spec/v1oid sha256:904d12120b128f019245e7f0616622d011c71e29f64f92fc970e1139ab731525size 28929# Immutable collections for JavaScript
[](https://github.com/immutable-js/immutable-js/actions/workflows/ci.yml?query=branch%3Amain) [Chat on slack](https://immutable-js.slack.com)
[Read the docs](https://immutable-js.com/docs/) and eat your vegetables.
Docs are automatically generated from [README.md][] and [immutable.d.ts][].Please contribute! Also, don't miss the [wiki][] which contains articles onadditional specific topics. Can't find something? Open an [issue][].
**Table of contents:**
- [Introduction](#introduction)- [Getting started](#getting-started)- [The case for Immutability](#the-case-for-immutability)- [JavaScript-first API](#javascript-first-api)- [Nested Structures](#nested-structures)- [Equality treats Collections as Values](#equality-treats-collections-as-values)- [Batching Mutations](#batching-mutations)- [Lazy Seq](#lazy-seq)- [Additional Tools and Resources](#additional-tools-and-resources)- [Contributing](#contributing)
## Introduction
[Immutable][] data cannot be changed once created, leading to much simplerapplication development, no defensive copying, and enabling advanced memoizationand change detection techniques with simple logic. [Persistent][] data presentsa mutative API which does not update the data in-place, but instead alwaysyields new updated data.
Immutable.js provides many Persistent Immutable data structures including:`List`, `Stack`, `Map`, `OrderedMap`, `Set`, `OrderedSet` and `Record`.
These data structures are highly efficient on modern JavaScript VMs by usingstructural sharing via [hash maps tries][] and [vector tries][] as popularizedby Clojure and Scala, minimizing the need to copy or cache data.
Immutable.js also provides a lazy `Seq`, allowing efficientchaining of collection methods like `map` and `filter` without creatingintermediate representations. Create some `Seq` with `Range` and `Repeat`.
Want to hear more? Watch the presentation about Immutable.js:
[](https://youtu.be/I7IdS-PbEgI)
[README.md]: https://github.com/immutable-js/immutable-js/blob/main/README.md[immutable.d.ts]: https://github.com/immutable-js/immutable-js/blob/main/type-definitions/immutable.d.ts[wiki]: https://github.com/immutable-js/immutable-js/wiki[issue]: https://github.com/immutable-js/immutable-js/issues[Persistent]: https://en.wikipedia.org/wiki/Persistent_data_structure[Immutable]: https://en.wikipedia.org/wiki/Immutable_object[hash maps tries]: https://en.wikipedia.org/wiki/Hash_array_mapped_trie[vector tries]: https://hypirion.com/musings/understanding-persistent-vector-pt-1
## Getting started
Install `immutable` using npm.
```shell# using npmnpm install immutable
# using Yarnyarn add immutable
# using pnpmpnpm add immutable
# using Bunbun add immutable```
Then require it into any module.
<!-- runkit:activate -->
```jsconst { Map } = require('immutable');const map1 = Map({ a: 1, b: 2, c: 3 });const map2 = map1.set('b', 50);map1.get('b') + ' vs. ' + map2.get('b'); // 2 vs. 50```
### Browser
Immutable.js has no dependencies, which makes it predictable to include in a Browser.
It's highly recommended to use a module bundler like [webpack](https://webpack.github.io/),[rollup](https://rollupjs.org/), or[browserify](https://browserify.org/). The `immutable` npm module workswithout any additional consideration. All examples throughout the documentationwill assume use of this kind of tool.
Alternatively, Immutable.js may be directly included as a script tag. Downloador link to a CDN such as [CDNJS](https://cdnjs.com/libraries/immutable)or [jsDelivr](https://www.jsdelivr.com/package/npm/immutable).
Use a script tag to directly add `Immutable` to the global scope:
```html<script src="immutable.min.js"></script><script> var map1 = Immutable.Map({ a: 1, b: 2, c: 3 }); var map2 = map1.set('b', 50); map1.get('b'); // 2 map2.get('b'); // 50</script>```
Or use an AMD-style loader (such as [RequireJS](https://requirejs.org/)):
```jsrequire(['./immutable.min.js'], function (Immutable) { var map1 = Immutable.Map({ a: 1, b: 2, c: 3 }); var map2 = map1.set('b', 50); map1.get('b'); // 2 map2.get('b'); // 50});```
### Flow & TypeScript
Use these Immutable collections and sequences as you would use nativecollections in your [Flowtype](https://flowtype.org/) or [TypeScript](https://typescriptlang.org) programs while still takingadvantage of type generics, error detection, and auto-complete in your IDE.
Installing `immutable` via npm brings with it type definitions for Flow (v0.55.0 or higher)and TypeScript (v2.1.0 or higher), so you shouldn't need to do anything at all!
#### Using TypeScript with Immutable.js v4
Immutable.js type definitions embrace ES2015. While Immutable.js itself supportslegacy browsers and environments, its type definitions require TypeScript's 2015lib. Include either `"target": "es2015"` or `"lib": "es2015"` in your`tsconfig.json`, or provide `--target es2015` or `--lib es2015` to the`tsc` command.
<!-- runkit:activate -->
```jsconst { Map } = require('immutable');const map1 = Map({ a: 1, b: 2, c: 3 });const map2 = map1.set('b', 50);map1.get('b') + ' vs. ' + map2.get('b'); // 2 vs. 50```
#### Using TypeScript with Immutable.js v3 and earlier:
Previous versions of Immutable.js include a reference file which you can includevia relative path to the type definitions at the top of your file.
```js///<reference path='./node_modules/immutable/dist/immutable.d.ts'/>import Immutable from 'immutable';var map1: Immutable.Map<string, number>;map1 = Immutable.Map({ a: 1, b: 2, c: 3 });var map2 = map1.set('b', 50);map1.get('b'); // 2map2.get('b'); // 50```
## The case for Immutability
Much of what makes application development difficult is tracking mutation andmaintaining state. Developing with immutable data encourages you to thinkdifferently about how data flows through your application.
Subscribing to data events throughout your application creates a huge overhead ofbook-keeping which can hurt performance, sometimes dramatically, and createsopportunities for areas of your application to get out of sync with each otherdue to easy to make programmer error. Since immutable data never changes,subscribing to changes throughout the model is a dead-end and new data can onlyever be passed from above.
This model of data flow aligns well with the architecture of [React][]and especially well with an application designed using the ideas of [Flux][].
When data is passed from above rather than being subscribed to, and you're onlyinterested in doing work when something has changed, you can use equality.
Immutable collections should be treated as _values_ rather than _objects_. Whileobjects represent some thing which could change over time, a value representsthe state of that thing at a particular instance of time. This principle is mostimportant to understanding the appropriate use of immutable data. In order totreat Immutable.js collections as values, it's important to use the`Immutable.is()` function or `.equals()` method to determine _value equality_instead of the `===` operator which determines object _reference identity_.
<!-- runkit:activate -->
```jsconst { Map } = require('immutable');const map1 = Map({ a: 1, b: 2, c: 3 });const map2 = Map({ a: 1, b: 2, c: 3 });map1.equals(map2); // truemap1 === map2; // false```
Note: As a performance optimization Immutable.js attempts to return the existingcollection when an operation would result in an identical collection, allowingfor using `===` reference equality to determine if something definitely has notchanged. This can be extremely useful when used within a memoization functionwhich would prefer to re-run the function if a deeper equality check couldpotentially be more costly. The `===` equality check is also used internally by`Immutable.is` and `.equals()` as a performance optimization.
<!-- runkit:activate -->
```jsconst { Map } = require('immutable');const map1 = Map({ a: 1, b: 2, c: 3 });const map2 = map1.set('b', 2); // Set to same valuemap1 === map2; // true```
If an object is immutable, it can be "copied" simply by making another referenceto it instead of copying the entire object. Because a reference is much smallerthan the object itself, this results in memory savings and a potential boost inexecution speed for programs which rely on copies (such as an undo-stack).
<!-- runkit:activate -->
```jsconst { Map } = require('immutable');const map = Map({ a: 1, b: 2, c: 3 });const mapCopy = map; // Look, "copies" are free!```
[React]: https://reactjs.org/[Flux]: https://facebook.github.io/flux/docs/in-depth-overview/
## JavaScript-first API
While Immutable.js is inspired by Clojure, Scala, Haskell and other functionalprogramming environments, it's designed to bring these powerful concepts toJavaScript, and therefore has an Object-Oriented API that closely mirrors thatof [ES2015][] [Array][], [Map][], and [Set][].
[es2015]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/New_in_JavaScript/ECMAScript_6_support_in_Mozilla[array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array[map]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map[set]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set
The difference for the immutable collections is that methods which would mutatethe collection, like `push`, `set`, `unshift` or `splice`, instead return a newimmutable collection. Methods which return new arrays, like `slice` or `concat`,instead return new immutable collections.
<!-- runkit:activate -->
```jsconst { List } = require('immutable');const list1 = List([1, 2]);const list2 = list1.push(3, 4, 5);const list3 = list2.unshift(0);const list4 = list1.concat(list2, list3);assert.equal(list1.size, 2);assert.equal(list2.size, 5);assert.equal(list3.size, 6);assert.equal(list4.size, 13);assert.equal(list4.get(0), 1);```
Almost all of the methods on [Array][] will be found in similar form on`Immutable.List`, those of [Map][] found on `Immutable.Map`, and those of [Set][]found on `Immutable.Set`, including collection operations like `forEach()`and `map()`.
<!-- runkit:activate -->
```jsconst { Map } = require('immutable');const alpha = Map({ a: 1, b: 2, c: 3, d: 4 });alpha.map((v, k) => k.toUpperCase()).join();// 'A,B,C,D'```
### Convert from raw JavaScript objects and arrays.
Designed to inter-operate with your existing JavaScript, Immutable.jsaccepts plain JavaScript Arrays and Objects anywhere a method expects a`Collection`.
<!-- runkit:activate -->
```jsconst { Map, List } = require('immutable');const map1 = Map({ a: 1, b: 2, c: 3, d: 4 });const map2 = Map({ c: 10, a: 20, t: 30 });const obj = { d: 100, o: 200, g: 300 };const map3 = map1.merge(map2, obj);// Map { a: 20, b: 2, c: 10, d: 100, t: 30, o: 200, g: 300 }const list1 = List([1, 2, 3]);const list2 = List([4, 5, 6]);const array = [7, 8, 9];const list3 = list1.concat(list2, array);// List [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ]```
This is possible because Immutable.js can treat any JavaScript Array or Objectas a Collection. You can take advantage of this in order to get sophisticatedcollection methods on JavaScript Objects, which otherwise have a very sparsenative API. Because Seq evaluates lazily and does not cache intermediateresults, these operations can be extremely efficient.
<!-- runkit:activate -->
```jsconst { Seq } = require('immutable');const myObject = { a: 1, b: 2, c: 3 };Seq(myObject) .map(x => x * x) .toObject();// { a: 1, b: 4, c: 9 }```
Keep in mind, when using JS objects to construct Immutable Maps, thatJavaScript Object properties are always strings, even if written in a quote-lessshorthand, while Immutable Maps accept keys of any type.
<!-- runkit:activate -->
```jsconst { fromJS } = require('immutable');
const obj = { 1: 'one' };console.log(Object.keys(obj)); // [ "1" ]console.log(obj['1'], obj[1]); // "one", "one"
const map = fromJS(obj);console.log(map.get('1'), map.get(1)); // "one", undefined```
Property access for JavaScript Objects first converts the key to a string, butsince Immutable Map keys can be of any type the argument to `get()` isnot altered.
### Converts back to raw JavaScript objects.
All Immutable.js Collections can be converted to plain JavaScript Arrays andObjects shallowly with `toArray()` and `toObject()` or deeply with `toJS()`.All Immutable Collections also implement `toJSON()` allowing them to be passedto `JSON.stringify` directly. They also respect the custom `toJSON()` methods ofnested objects.
<!-- runkit:activate -->
```jsconst { Map, List } = require('immutable');const deep = Map({ a: 1, b: 2, c: List([3, 4, 5]) });console.log(deep.toObject()); // { a: 1, b: 2, c: List [ 3, 4, 5 ] }console.log(deep.toArray()); // [ 1, 2, List [ 3, 4, 5 ] ]console.log(deep.toJS()); // { a: 1, b: 2, c: [ 3, 4, 5 ] }JSON.stringify(deep); // '{"a":1,"b":2,"c":[3,4,5]}'```
### Embraces ES2015
Immutable.js supports all JavaScript environments, including legacybrowsers (even IE11). However it also takes advantage of features added toJavaScript in [ES2015][], the latest standard version of JavaScript, including[Iterators][], [Arrow Functions][], [Classes][], and [Modules][]. It's inspiredby the native [Map][] and [Set][] collections added to ES2015.
All examples in the Documentation are presented in ES2015. To run in allbrowsers, they need to be translated to ES5.
```js// ES2015const mapped = foo.map(x => x * x);// ES5var mapped = foo.map(function (x) { return x * x;});```
All Immutable.js collections are [Iterable][iterators], which allows them to beused anywhere an Iterable is expected, such as when spreading into an Array.
<!-- runkit:activate -->
```jsconst { List } = require('immutable');const aList = List([1, 2, 3]);const anArray = [0, ...aList, 4, 5]; // [ 0, 1, 2, 3, 4, 5 ]```
Note: A Collection is always iterated in the same order, however that order maynot always be well defined, as is the case for the `Map` and `Set`.
[Iterators]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/The_Iterator_protocol[Arrow Functions]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions[Classes]: https://wiki.ecmascript.org/doku.php?id=strawman:maximally_minimal_classes[Modules]: https://www.2ality.com/2014/09/es6-modules-final.html
## Nested Structures
The collections in Immutable.js are intended to be nested, allowing for deeptrees of data, similar to JSON.
<!-- runkit:activate -->
```jsconst { fromJS } = require('immutable');const nested = fromJS({ a: { b: { c: [3, 4, 5] } } });// Map { a: Map { b: Map { c: List [ 3, 4, 5 ] } } }```
A few power-tools allow for reading and operating on nested data. Themost useful are `mergeDeep`, `getIn`, `setIn`, and `updateIn`, found on `List`,`Map` and `OrderedMap`.
<!-- runkit:activate -->
```jsconst { fromJS } = require('immutable');const nested = fromJS({ a: { b: { c: [3, 4, 5] } } });
const nested2 = nested.mergeDeep({ a: { b: { d: 6 } } });// Map { a: Map { b: Map { c: List [ 3, 4, 5 ], d: 6 } } }
console.log(nested2.getIn(['a', 'b', 'd'])); // 6
const nested3 = nested2.updateIn(['a', 'b', 'd'], value => value + 1);console.log(nested3);// Map { a: Map { b: Map { c: List [ 3, 4, 5 ], d: 7 } } }
const nested4 = nested3.updateIn(['a', 'b', 'c'], list => list.push(6));// Map { a: Map { b: Map { c: List [ 3, 4, 5, 6 ], d: 7 } } }```
## Equality treats Collections as Values
Immutable.js collections are treated as pure data _values_. Two immutablecollections are considered _value equal_ (via `.equals()` or `is()`) if theyrepresent the same collection of values. This differs from JavaScript's typical_reference equal_ (via `===` or `==`) for Objects and Arrays which onlydetermines if two variables represent references to the same object instance.
Consider the example below where two identical `Map` instances are not_reference equal_ but are _value equal_.
<!-- runkit:activate -->
```js// First consider:const obj1 = { a: 1, b: 2, c: 3 };const obj2 = { a: 1, b: 2, c: 3 };obj1 !== obj2; // two different instances are always not equal with ===
const { Map, is } = require('immutable');const map1 = Map({ a: 1, b: 2, c: 3 });const map2 = Map({ a: 1, b: 2, c: 3 });map1 !== map2; // two different instances are not reference-equalmap1.equals(map2); // but are value-equal if they have the same valuesis(map1, map2); // alternatively can use the is() function```
Value equality allows Immutable.js collections to be used as keys in Maps orvalues in Sets, and retrieved with different but equivalent collections:
<!-- runkit:activate -->
```jsconst { Map, Set } = require('immutable');const map1 = Map({ a: 1, b: 2, c: 3 });const map2 = Map({ a: 1, b: 2, c: 3 });const set = Set().add(map1);set.has(map2); // true because these are value-equal```
Note: `is()` uses the same measure of equality as [Object.is][] for scalarstrings and numbers, but uses value equality for Immutable collections,determining if both are immutable and all keys and values are equalusing the same measure of equality.
[object.is]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
#### Performance tradeoffs
While value equality is useful in many circumstances, it has differentperformance characteristics than reference equality. Understanding thesetradeoffs may help you decide which to use in each case, especially when usedto memoize some operation.
When comparing two collections, value equality may require considering everyitem in each collection, on an `O(N)` time complexity. For large collections ofvalues, this could become a costly operation. Though if the two are not equaland hardly similar, the inequality is determined very quickly. In contrast, whencomparing two collections with reference equality, only the initial referencesto memory need to be compared which is not based on the size of the collections,which has an `O(1)` time complexity. Checking reference equality is always veryfast, however just because two collections are not reference-equal does not ruleout the possibility that they may be value-equal.
#### Return self on no-op optimization
When possible, Immutable.js avoids creating new objects for updates where nochange in _value_ occurred, to allow for efficient _reference equality_ checkingto quickly determine if no change occurred.
<!-- runkit:activate -->
```jsconst { Map } = require('immutable');const originalMap = Map({ a: 1, b: 2, c: 3 });const updatedMap = originalMap.set('b', 2);updatedMap === originalMap; // No-op .set() returned the original reference.```
However updates which do result in a change will return a new reference. Eachof these operations occur independently, so two similar updates will not returnthe same reference:
<!-- runkit:activate -->
```jsconst { Map } = require('immutable');const originalMap = Map({ a: 1, b: 2, c: 3 });const updatedMap = originalMap.set('b', 1000);// New instance, leaving the original immutable.updatedMap !== originalMap;const anotherUpdatedMap = originalMap.set('b', 1000);// Despite both the results of the same operation, each created a new reference.anotherUpdatedMap !== updatedMap;// However the two are value equal.anotherUpdatedMap.equals(updatedMap);```
## Batching Mutations
> If a tree falls in the woods, does it make a sound?>> If a pure function mutates some local data in order to produce an immutable> return value, is that ok?>> — Rich Hickey, Clojure
Applying a mutation to create a new immutable object results in some overhead,which can add up to a minor performance penalty. If you need to apply a seriesof mutations locally before returning, Immutable.js gives you the ability tocreate a temporary mutable (transient) copy of a collection and apply a batch ofmutations in a performant manner by using `withMutations`. In fact, this isexactly how Immutable.js applies complex mutations itself.
As an example, building `list2` results in the creation of 1, not 3, newimmutable Lists.
<!-- runkit:activate -->
```jsconst { List } = require('immutable');const list1 = List([1, 2, 3]);const list2 = list1.withMutations(function (list) { list.push(4).push(5).push(6);});assert.equal(list1.size, 3);assert.equal(list2.size, 6);```
Note: Immutable.js also provides `asMutable` and `asImmutable`, but onlyencourages their use when `withMutations` will not suffice. Use caution to notreturn a mutable copy, which could result in undesired behavior.
_Important!_: Only a select few methods can be used in `withMutations` including`set`, `push` and `pop`. These methods can be applied directly against apersistent data-structure where other methods like `map`, `filter`, `sort`,and `splice` will always return new immutable data-structures and never mutatea mutable collection.
## Lazy Seq
`Seq` describes a lazy operation, allowing them to efficiently chainuse of all the higher-order collection methods (such as `map` and `filter`)by not creating intermediate collections.
**Seq is immutable** — Once a Seq is created, it cannot bechanged, appended to, rearranged or otherwise modified. Instead, any mutativemethod called on a `Seq` will return a new `Seq`.
**Seq is lazy** — `Seq` does as little work as necessary to respond to anymethod call. Values are often created during iteration, including implicititeration when reducing or converting to a concrete data structure such asa `List` or JavaScript `Array`.
For example, the following performs no work, because the resulting`Seq`'s values are never iterated:
```jsconst { Seq } = require('immutable');const oddSquares = Seq([1, 2, 3, 4, 5, 6, 7, 8]) .filter(x => x % 2 !== 0) .map(x => x * x);```
Once the `Seq` is used, it performs only the work necessary. In thisexample, no intermediate arrays are ever created, filter is called threetimes, and map is only called once:
```jsoddSquares.get(1); // 9```
Any collection can be converted to a lazy Seq with `Seq()`.
<!-- runkit:activate -->
```jsconst { Map, Seq } = require('immutable');const map = Map({ a: 1, b: 2, c: 3 });const lazySeq = Seq(map);```
`Seq` allows for the efficient chaining of operations, allowing for theexpression of logic that can otherwise be very tedious:
```jslazySeq .flip() .map(key => key.toUpperCase()) .flip();// Seq { A: 1, B: 2, C: 3 }```
As well as expressing logic that would otherwise seem memory or timelimited, for example `Range` is a special kind of Lazy sequence.
<!-- runkit:activate -->
```jsconst { Range } = require('immutable');Range(1, Infinity) .skip(1000) .map(n => -n) .filter(n => n % 2 === 0) .take(2) .reduce((r, n) => r * n, 1);// 1006008```
## Comparison of filter(), groupBy(), and partition()
The `filter()`, `groupBy()`, and `partition()` methods are similar in that theyall divide a collection into parts based on applying a function to each element.All three call the predicate or grouping function once for each item in theinput collection. All three return zero or more collections of the same type astheir input. The returned collections are always distinct from the input(according to `===`), even if the contents are identical.
Of these methods, `filter()` is the only one that is lazy and the only one whichdiscards items from the input collection. It is the simplest to use, and thefact that it returns exactly one collection makes it easy to combine with othermethods to form a pipeline of operations.
The `partition()` method is similar to an eager version of `filter()`, but itreturns two collections; the first contains the items that would have beendiscarded by `filter()`, and the second contains the items that would have beenkept. It always returns an array of exactly two collections, which can make iteasier to use than `groupBy()`. Compared to making two separate calls to`filter()`, `partition()` makes half as many calls it the predicate passed toit.
The `groupBy()` method is a more generalized version of `partition()` that cangroup by an arbitrary function rather than just a predicate. It returns a mapwith zero or more entries, where the keys are the values returned by thegrouping function, and the values are nonempty collections of the correspondingarguments. Although `groupBy()` is more powerful than `partition()`, it can beharder to use because it is not always possible predict in advance how manyentries the returned map will have and what their keys will be.
| Summary | `filter` | `partition` | `groupBy` ||:------------------------------|:---------|:------------|:---------------|| ease of use | easiest | moderate | hardest || generality | least | moderate | most || laziness | lazy | eager | eager || # of returned sub-collections | 1 | 2 | 0 or more || sub-collections may be empty | yes | yes | no || can discard items | yes | no | no || wrapping container | none | array | Map/OrderedMap |
## Additional Tools and Resources
- [Atom-store](https://github.com/jameshopkins/atom-store/) - A Clojure-inspired atom implementation in Javascript with configurability for external persistance.
- [Chai Immutable](https://github.com/astorije/chai-immutable) - If you are using the [Chai Assertion Library](https://chaijs.com/), this provides a set of assertions to use against Immutable.js collections.
- [Fantasy-land](https://github.com/fantasyland/fantasy-land) - Specification for interoperability of common algebraic structures in JavaScript.
- [Immutagen](https://github.com/pelotom/immutagen) - A library for simulating immutable generators in JavaScript.
- [Immutable-cursor](https://github.com/redbadger/immutable-cursor) - Immutable cursors incorporating the Immutable.js interface over Clojure-inspired atom.
- [Immutable-ext](https://github.com/DrBoolean/immutable-ext) - Fantasyland extensions for immutablejs
- [Immutable-js-tools](https://github.com/madeinfree/immutable-js-tools) - Util tools for immutable.js
- [Immutable-Redux](https://github.com/gajus/redux-immutable) - redux-immutable is used to create an equivalent function of Redux combineReducers that works with Immutable.js state.
- [Immutable-Treeutils](https://github.com/lukasbuenger/immutable-treeutils) - Functional tree traversal helpers for ImmutableJS data structures.
- [Irecord](https://github.com/ericelliott/irecord) - An immutable store that exposes an RxJS observable. Great for React.
- [Mudash](https://github.com/brianneisler/mudash) - Lodash wrapper providing Immutable.JS support.
- [React-Immutable-PropTypes](https://github.com/HurricaneJames/react-immutable-proptypes) - PropType validators that work with Immutable.js.
- [Redux-Immutablejs](https://github.com/indexiatech/redux-immutablejs) - Redux Immutable facilities.
- [Rxstate](https://github.com/yamalight/rxstate) - Simple opinionated state management library based on RxJS and Immutable.js.
- [Transit-Immutable-js](https://github.com/glenjamin/transit-immutable-js) - Transit serialisation for Immutable.js. - See also: [Transit-js](https://github.com/cognitect/transit-js)
Have an additional tool designed to work with Immutable.js?Submit a PR to add it to this list in alphabetical order.
## Contributing
Use [Github issues](https://github.com/immutable-js/immutable-js/issues) for requests.
We actively welcome pull requests, learn how to [contribute](https://github.com/immutable-js/immutable-js/blob/main/.github/CONTRIBUTING.md).
Immutable.js is maintained within the [Contributor Covenant's Code of Conduct](https://www.contributor-covenant.org/version/2/0/code_of_conduct/).
### Changelog
Changes are tracked as [Github releases](https://github.com/immutable-js/immutable-js/releases).
### License
Immutable.js is [MIT-licensed](./LICENSE).
### Thanks
[Phil Bagwell](https://www.youtube.com/watch?v=K2NYwP90bNs), for his inspirationand research in persistent data structures.
[Hugh Jackson](https://github.com/hughfdjackson/), for providing the npm packagename. If you're looking for his unsupported package, see [this repository](https://github.com/hughfdjackson/immutable).123123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412version https://git-lfs.github.com/spec/v1oid sha256:997046b23404e9fd471bdd2de697a39e0696db83cbfcec01399664644ab025absize 62767/** * This file provides type definitions for use with the Flow type checker. * * An important caveat when using these definitions is that the types for * `Collection.Keyed`, `Collection.Indexed`, `Seq.Keyed`, and so on are stubs. * When referring to those types, you can get the proper definitions by * importing the types `KeyedCollection`, `IndexedCollection`, `KeyedSeq`, etc. * For example, * * import { Seq } from 'immutable' * import type { IndexedCollection, IndexedSeq } from 'immutable' * * const someSeq: IndexedSeq<number> = Seq.Indexed.of(1, 2, 3) * * function takesASeq<T, TS: IndexedCollection<T>>(iter: TS): TS { * return iter.butLast() * } * * takesASeq(someSeq) * * @flow strict */
// Helper type that represents plain objects allowed as arguments to// some constructors and functions.type PlainObjInput<K, V> = { +[key: K]: V, __proto__: null };
type K<T> = $Keys<T>;
// Helper types to extract the "keys" and "values" use by the *In() methods.type $KeyOf<C> = $Call< (<K>(?_Collection<K, mixed>) => K) & (<T>(?$ReadOnlyArray<T>) => number) & (<T>(?RecordInstance<T> | T) => $Keys<T>) & (<T: Object>(T) => $Keys<T>), C>;
type $ValOf<C, K = $KeyOf<C>> = $Call< (<V>(?_Collection<any, V>) => V) & (<T>(?$ReadOnlyArray<T>) => T) & (<T, K: $Keys<T>>(?RecordInstance<T> | T, K) => $ElementType<T, K>) & (<T: Object>(T) => $Values<T>), C, K>;
type $IterableOf<C> = $Call< (<V: Array<any> | IndexedCollection<any> | SetCollection<any>>( V ) => Iterable<$ValOf<V>>) & (< V: | KeyedCollection<any, any> | RecordInstance<any> | PlainObjInput<any, any> >( V ) => Iterable<[$KeyOf<V>, $ValOf<V>]>), C>;
const PairSorting: $ReadOnly<{ LeftThenRight: number, RightThenLeft: number }> = { LeftThenRight: -1, RightThenLeft: +1, };
type Comparator<T> = (left: T, right: T) => number;
declare class _Collection<K, +V> implements ValueObject { equals(other: mixed): boolean; hashCode(): number; get(key: K, ..._: []): V | void; get<NSV>(key: K, notSetValue: NSV): V | NSV; has(key: K): boolean; includes(value: V): boolean; contains(value: V): boolean; first<NSV>(notSetValue?: NSV): V | NSV; last<NSV>(notSetValue?: NSV): V | NSV;
hasIn(keyPath: Iterable<mixed>): boolean;
getIn(keyPath: [], notSetValue?: mixed): this; getIn<NSV>(keyPath: [K], notSetValue: NSV): V | NSV; getIn<NSV, K2: $KeyOf<V>>( keyPath: [K, K2], notSetValue: NSV ): $ValOf<V, K2> | NSV; getIn<NSV, K2: $KeyOf<V>, K3: $KeyOf<$ValOf<V, K2>>>( keyPath: [K, K2, K3], notSetValue: NSV ): $ValOf<$ValOf<V, K2>, K3> | NSV; getIn< NSV, K2: $KeyOf<V>, K3: $KeyOf<$ValOf<V, K2>>, K4: $KeyOf<$ValOf<$ValOf<V, K2>, K3>> >( keyPath: [K, K2, K3, K4], notSetValue: NSV ): $ValOf<$ValOf<$ValOf<V, K2>, K3>, K4> | NSV; getIn< NSV, K2: $KeyOf<V>, K3: $KeyOf<$ValOf<V, K2>>, K4: $KeyOf<$ValOf<$ValOf<V, K2>, K3>>, K5: $KeyOf<$ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>> >( keyPath: [K, K2, K3, K4, K5], notSetValue: NSV ): $ValOf<$ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>, K5> | NSV;
update<U>(updater: (value: this) => U): U;
toJS(): Array<any> | { [key: string]: mixed }; toJSON(): Array<V> | { [key: string]: V }; toArray(): Array<V> | Array<[K, V]>; toObject(): { [key: string]: V }; toMap(): Map<K, V>; toOrderedMap(): OrderedMap<K, V>; toSet(): Set<V>; toOrderedSet(): OrderedSet<V>; toList(): List<V>; toStack(): Stack<V>; toSeq(): Seq<K, V>; toKeyedSeq(): KeyedSeq<K, V>; toIndexedSeq(): IndexedSeq<V>; toSetSeq(): SetSeq<V>;
keys(): Iterator<K>; values(): Iterator<V>; entries(): Iterator<[K, V]>;
keySeq(): IndexedSeq<K>; valueSeq(): IndexedSeq<V>; entrySeq(): IndexedSeq<[K, V]>;
reverse(): this; sort(comparator?: Comparator<V>): this;
sortBy<C>( comparatorValueMapper: (value: V, key: K, iter: this) => C, comparator?: Comparator<C> ): this;
groupBy<G>( grouper: (value: V, key: K, iter: this) => G, context?: mixed ): KeyedSeq<G, this>;
forEach( sideEffect: (value: V, key: K, iter: this) => any, context?: mixed ): number;
slice(begin?: number, end?: number): this; rest(): this; butLast(): this; skip(amount: number): this; skipLast(amount: number): this; skipWhile( predicate: (value: V, key: K, iter: this) => mixed, context?: mixed ): this; skipUntil( predicate: (value: V, key: K, iter: this) => mixed, context?: mixed ): this; take(amount: number): this; takeLast(amount: number): this; takeWhile( predicate: (value: V, key: K, iter: this) => mixed, context?: mixed ): this; takeUntil( predicate: (value: V, key: K, iter: this) => mixed, context?: mixed ): this;
filterNot( predicate: (value: V, key: K, iter: this) => mixed, context?: mixed ): this;
reduce<R>( reducer: (reduction: R, value: V, key: K, iter: this) => R, initialReduction: R, context?: mixed ): R; reduce<R>(reducer: (reduction: V | R, value: V, key: K, iter: this) => R): R;
reduceRight<R>( reducer: (reduction: R, value: V, key: K, iter: this) => R, initialReduction: R, context?: mixed ): R; reduceRight<R>( reducer: (reduction: V | R, value: V, key: K, iter: this) => R ): R;
every( predicate: (value: V, key: K, iter: this) => mixed, context?: mixed ): boolean; some( predicate: (value: V, key: K, iter: this) => mixed, context?: mixed ): boolean; join(separator?: string): string; isEmpty(): boolean; count( predicate?: (value: V, key: K, iter: this) => mixed, context?: mixed ): number; countBy<G>( grouper: (value: V, key: K, iter: this) => G, context?: mixed ): Map<G, number>;
find<NSV>( predicate: (value: V, key: K, iter: this) => mixed, context?: mixed, notSetValue?: NSV ): V | NSV; findLast<NSV>( predicate: (value: V, key: K, iter: this) => mixed, context?: mixed, notSetValue?: NSV ): V | NSV;
findEntry(predicate: (value: V, key: K, iter: this) => mixed): [K, V] | void; findLastEntry( predicate: (value: V, key: K, iter: this) => mixed ): [K, V] | void;
findKey( predicate: (value: V, key: K, iter: this) => mixed, context?: mixed ): K | void; findLastKey( predicate: (value: V, key: K, iter: this) => mixed, context?: mixed ): K | void;
keyOf(searchValue: V): K | void; lastKeyOf(searchValue: V): K | void;
max(comparator?: Comparator<V>): V; maxBy<C>( comparatorValueMapper: (value: V, key: K, iter: this) => C, comparator?: Comparator<C> ): V; min(comparator?: Comparator<V>): V; minBy<C>( comparatorValueMapper: (value: V, key: K, iter: this) => C, comparator?: Comparator<C> ): V;
isSubset(iter: Iterable<V>): boolean; isSuperset(iter: Iterable<V>): boolean;}
declare function isImmutable( maybeImmutable: mixed): boolean %checks(maybeImmutable instanceof Collection);declare function isCollection( maybeCollection: mixed): boolean %checks(maybeCollection instanceof Collection);declare function isKeyed( maybeKeyed: mixed): boolean %checks(maybeKeyed instanceof KeyedCollection);declare function isIndexed( maybeIndexed: mixed): boolean %checks(maybeIndexed instanceof IndexedCollection);declare function isAssociative( maybeAssociative: mixed): boolean %checks(maybeAssociative instanceof KeyedCollection || maybeAssociative instanceof IndexedCollection);declare function isOrdered( maybeOrdered: mixed): boolean %checks(maybeOrdered instanceof IndexedCollection || maybeOrdered instanceof OrderedMap || maybeOrdered instanceof OrderedSet);declare function isValueObject(maybeValue: mixed): boolean;
declare function isSeq(maybeSeq: any): boolean %checks(maybeSeq instanceof Seq);declare function isList(maybeList: any): boolean %checks(maybeList instanceof List);declare function isMap(maybeMap: any): boolean %checks(maybeMap instanceof Map);declare function isOrderedMap( maybeOrderedMap: any): boolean %checks(maybeOrderedMap instanceof OrderedMap);declare function isStack(maybeStack: any): boolean %checks(maybeStack instanceof Stack);declare function isSet(maybeSet: any): boolean %checks(maybeSet instanceof Set);declare function isOrderedSet( maybeOrderedSet: any): boolean %checks(maybeOrderedSet instanceof OrderedSet);declare function isRecord( maybeRecord: any): boolean %checks(maybeRecord instanceof Record);
declare interface ValueObject { equals(other: mixed): boolean; hashCode(): number;}
declare class Collection<K, +V> extends _Collection<K, V> { static Keyed: typeof KeyedCollection; static Indexed: typeof IndexedCollection; static Set: typeof SetCollection;
static isCollection: typeof isCollection; static isKeyed: typeof isKeyed; static isIndexed: typeof isIndexed; static isAssociative: typeof isAssociative; static isOrdered: typeof isOrdered;}
declare class KeyedCollection<K, +V> extends Collection<K, V> { static <K, V>( values?: Iterable<[K, V]> | PlainObjInput<K, V> ): KeyedCollection<K, V>;
toJS(): { [key: string]: mixed }; toJSON(): { [key: string]: V }; toArray(): Array<[K, V]>; @@iterator(): Iterator<[K, V]>; toSeq(): KeyedSeq<K, V>; flip(): KeyedCollection<V, K>;
concat<KC, VC>( ...iters: Array<Iterable<[KC, VC]> | PlainObjInput<KC, VC>> ): KeyedCollection<K | KC, V | VC>;
filter(predicate: typeof Boolean): KeyedCollection<K, $NonMaybeType<V>>; filter( predicate: (value: V, key: K, iter: this) => mixed, context?: mixed ): KeyedCollection<K, V>;
partition( predicate: (value: V, key: K, iter: this) => mixed, context?: mixed ): [this, this];
map<M>( mapper: (value: V, key: K, iter: this) => M, context?: mixed ): KeyedCollection<K, M>;
mapKeys<M>( mapper: (key: K, value: V, iter: this) => M, context?: mixed ): KeyedCollection<M, V>;
mapEntries<KM, VM>( mapper: (entry: [K, V], index: number, iter: this) => [KM, VM], context?: mixed ): KeyedCollection<KM, VM>;
flatMap<KM, VM>( mapper: (value: V, key: K, iter: this) => Iterable<[KM, VM]>, context?: mixed ): KeyedCollection<KM, VM>;
flatten(depth?: number): KeyedCollection<any, any>; flatten(shallow?: boolean): KeyedCollection<any, any>;}
Collection.Keyed = KeyedCollection;
declare class IndexedCollection<+T> extends Collection<number, T> { static <T>(iter?: Iterable<T>): IndexedCollection<T>;
toJS(): Array<mixed>; toJSON(): Array<T>; toArray(): Array<T>; @@iterator(): Iterator<T>; toSeq(): IndexedSeq<T>; fromEntrySeq<K, V>(): KeyedSeq<K, V>; interpose(separator: T): this; interleave(...collections: Iterable<T>[]): this; splice(index: number, removeNum: number, ...values: T[]): this;
zip<A>(a: Iterable<A>, ..._: []): IndexedCollection<[T, A]>; zip<A, B>( a: Iterable<A>, b: Iterable<B>, ..._: [] ): IndexedCollection<[T, A, B]>; zip<A, B, C>( a: Iterable<A>, b: Iterable<B>, c: Iterable<C>, ..._: [] ): IndexedCollection<[T, A, B, C]>; zip<A, B, C, D>( a: Iterable<A>, b: Iterable<B>, c: Iterable<C>, d: Iterable<D>, ..._: [] ): IndexedCollection<[T, A, B, C, D]>; zip<A, B, C, D, E>( a: Iterable<A>, b: Iterable<B>, c: Iterable<C>, d: Iterable<D>, e: Iterable<E>, ..._: [] ): IndexedCollection<[T, A, B, C, D, E]>;
zipAll<A>(a: Iterable<A>, ..._: []): IndexedCollection<[T | void, A | void]>; zipAll<A, B>( a: Iterable<A>, b: Iterable<B>, ..._: [] ): IndexedCollection<[T | void, A | void, B | void]>; zipAll<A, B, C>( a: Iterable<A>, b: Iterable<B>, c: Iterable<C>, ..._: [] ): IndexedCollection<[T | void, A | void, B | void, C | void]>; zipAll<A, B, C, D>( a: Iterable<A>, b: Iterable<B>, c: Iterable<C>, d: Iterable<D>, ..._: [] ): IndexedCollection<[T | void, A | void, B | void, C | void, D | void]>; zipAll<A, B, C, D, E>( a: Iterable<A>, b: Iterable<B>, c: Iterable<C>, d: Iterable<D>, e: Iterable<E>, ..._: [] ): IndexedCollection< [T | void, A | void, B | void, C | void, D | void, E | void] >;
zipWith<A, R>( zipper: (value: T, a: A) => R, a: Iterable<A>, ..._: [] ): IndexedCollection<R>; zipWith<A, B, R>( zipper: (value: T, a: A, b: B) => R, a: Iterable<A>, b: Iterable<B>, ..._: [] ): IndexedCollection<R>; zipWith<A, B, C, R>( zipper: (value: T, a: A, b: B, c: C) => R, a: Iterable<A>, b: Iterable<B>, c: Iterable<C>, ..._: [] ): IndexedCollection<R>; zipWith<A, B, C, D, R>( zipper: (value: T, a: A, b: B, c: C, d: D) => R, a: Iterable<A>, b: Iterable<B>, c: Iterable<C>, d: Iterable<D>, ..._: [] ): IndexedCollection<R>; zipWith<A, B, C, D, E, R>( zipper: (value: T, a: A, b: B, c: C, d: D, e: E) => R, a: Iterable<A>, b: Iterable<B>, c: Iterable<C>, d: Iterable<D>, e: Iterable<E>, ..._: [] ): IndexedCollection<R>;
indexOf(searchValue: T): number; lastIndexOf(searchValue: T): number; findIndex( predicate: (value: T, index: number, iter: this) => mixed, context?: mixed ): number; findLastIndex( predicate: (value: T, index: number, iter: this) => mixed, context?: mixed ): number;
concat<C>(...iters: Array<Iterable<C> | C>): IndexedCollection<T | C>;
filter(predicate: typeof Boolean): IndexedCollection<$NonMaybeType<T>>; filter( predicate: (value: T, index: number, iter: this) => mixed, context?: mixed ): IndexedCollection<T>;
partition( predicate: (value: T, index: number, iter: this) => mixed, context?: mixed ): [this, this];
map<M>( mapper: (value: T, index: number, iter: this) => M, context?: mixed ): IndexedCollection<M>;
flatMap<M>( mapper: (value: T, index: number, iter: this) => Iterable<M>, context?: mixed ): IndexedCollection<M>;
flatten(depth?: number): IndexedCollection<any>; flatten(shallow?: boolean): IndexedCollection<any>;}
declare class SetCollection<+T> extends Collection<T, T> { static <T>(iter?: Iterable<T>): SetCollection<T>;
toJS(): Array<mixed>; toJSON(): Array<T>; toArray(): Array<T>; @@iterator(): Iterator<T>; toSeq(): SetSeq<T>;
concat<U>(...collections: Iterable<U>[]): SetCollection<T | U>;
// `filter`, `map` and `flatMap` cannot be defined further up the hierarchy, // because the implementation for `KeyedCollection` allows the value type to // change without constraining the key type. That does not work for // `SetCollection` - the value and key types *must* match. filter(predicate: typeof Boolean): SetCollection<$NonMaybeType<T>>; filter( predicate: (value: T, value: T, iter: this) => mixed, context?: mixed ): SetCollection<T>;
partition( predicate: (value: T, value: T, iter: this) => mixed, context?: mixed ): [this, this];
map<M>( mapper: (value: T, value: T, iter: this) => M, context?: mixed ): SetCollection<M>;
flatMap<M>( mapper: (value: T, value: T, iter: this) => Iterable<M>, context?: mixed ): SetCollection<M>;
flatten(depth?: number): SetCollection<any>; flatten(shallow?: boolean): SetCollection<any>;}
declare function isSeq(maybeSeq: mixed): boolean %checks(maybeSeq instanceof Seq);declare class Seq<K, +V> extends _Collection<K, V> { static Keyed: typeof KeyedSeq; static Indexed: typeof IndexedSeq; static Set: typeof SetSeq;
static <K, V>(values: KeyedSeq<K, V>): KeyedSeq<K, V>; static <T>(values: SetSeq<T>): SetSeq<K, V>; static <T>(values: Iterable<T>): IndexedSeq<T>; static <K, V>(values?: PlainObjInput<K, V>): KeyedSeq<K, V>;
static isSeq: typeof isSeq;
size: number | void; cacheResult(): this; toSeq(): this;}
declare class KeyedSeq<K, +V> extends Seq<K, V> mixins KeyedCollection<K, V> { static <K, V>( values?: Iterable<[K, V]> | PlainObjInput<K, V> ): KeyedSeq<K, V>;
// Override specialized return types flip(): KeyedSeq<V, K>;
concat<KC, VC>( ...iters: Array<Iterable<[KC, VC]> | PlainObjInput<KC, VC>> ): KeyedSeq<K | KC, V | VC>;
filter(predicate: typeof Boolean): KeyedSeq<K, $NonMaybeType<V>>; filter( predicate: (value: V, key: K, iter: this) => mixed, context?: mixed ): KeyedSeq<K, V>;
partition( predicate: (value: V, key: K, iter: this) => mixed, context?: mixed ): [this, this];
map<M>( mapper: (value: V, key: K, iter: this) => M, context?: mixed ): KeyedSeq<K, M>;
mapKeys<M>( mapper: (key: K, value: V, iter: this) => M, context?: mixed ): KeyedSeq<M, V>;
mapEntries<KM, VM>( mapper: (entry: [K, V], index: number, iter: this) => [KM, VM], context?: mixed ): KeyedSeq<KM, VM>;
flatMap<KM, VM>( mapper: (value: V, key: K, iter: this) => Iterable<[KM, VM]>, context?: mixed ): KeyedSeq<KM, VM>;
flatten(depth?: number): KeyedSeq<any, any>; flatten(shallow?: boolean): KeyedSeq<any, any>;}
declare class IndexedSeq<+T> extends Seq<number, T> mixins IndexedCollection<T>{ static <T>(values?: Iterable<T>): IndexedSeq<T>;
static of<T>(...values: T[]): IndexedSeq<T>;
// Override specialized return types
concat<C>(...iters: Array<Iterable<C> | C>): IndexedSeq<T | C>;
filter(predicate: typeof Boolean): IndexedSeq<$NonMaybeType<T>>; filter( predicate: (value: T, index: number, iter: this) => mixed, context?: mixed ): IndexedSeq<T>;
partition( predicate: (value: T, index: number, iter: this) => mixed, context?: mixed ): [this, this];
map<M>( mapper: (value: T, index: number, iter: this) => M, context?: mixed ): IndexedSeq<M>;
flatMap<M>( mapper: (value: T, index: number, iter: this) => Iterable<M>, context?: mixed ): IndexedSeq<M>;
flatten(depth?: number): IndexedSeq<any>; flatten(shallow?: boolean): IndexedSeq<any>;
zip<A>(a: Iterable<A>, ..._: []): IndexedSeq<[T, A]>; zip<A, B>(a: Iterable<A>, b: Iterable<B>, ..._: []): IndexedSeq<[T, A, B]>; zip<A, B, C>( a: Iterable<A>, b: Iterable<B>, c: Iterable<C>, ..._: [] ): IndexedSeq<[T, A, B, C]>; zip<A, B, C, D>( a: Iterable<A>, b: Iterable<B>, c: Iterable<C>, d: Iterable<D>, ..._: [] ): IndexedSeq<[T, A, B, C, D]>; zip<A, B, C, D, E>( a: Iterable<A>, b: Iterable<B>, c: Iterable<C>, d: Iterable<D>, e: Iterable<E>, ..._: [] ): IndexedSeq<[T, A, B, C, D, E]>;
zipAll<A>(a: Iterable<A>, ..._: []): IndexedSeq<[T | void, A | void]>; zipAll<A, B>( a: Iterable<A>, b: Iterable<B>, ..._: [] ): IndexedSeq<[T | void, A | void, B | void]>; zipAll<A, B, C>( a: Iterable<A>, b: Iterable<B>, c: Iterable<C>, ..._: [] ): IndexedSeq<[T | void, A | void, B | void, C | void]>; zipAll<A, B, C, D>( a: Iterable<A>, b: Iterable<B>, c: Iterable<C>, d: Iterable<D>, ..._: [] ): IndexedSeq<[T | void, A | void, B | void, C | void, D | void]>; zipAll<A, B, C, D, E>( a: Iterable<A>, b: Iterable<B>, c: Iterable<C>, d: Iterable<D>, e: Iterable<E>, ..._: [] ): IndexedSeq<[T | void, A | void, B | void, C | void, D | void, E | void]>;
zipWith<A, R>( zipper: (value: T, a: A) => R, a: Iterable<A>, ..._: [] ): IndexedSeq<R>; zipWith<A, B, R>( zipper: (value: T, a: A, b: B) => R, a: Iterable<A>, b: Iterable<B>, ..._: [] ): IndexedSeq<R>; zipWith<A, B, C, R>( zipper: (value: T, a: A, b: B, c: C) => R, a: Iterable<A>, b: Iterable<B>, c: Iterable<C>, ..._: [] ): IndexedSeq<R>; zipWith<A, B, C, D, R>( zipper: (value: T, a: A, b: B, c: C, d: D) => R, a: Iterable<A>, b: Iterable<B>, c: Iterable<C>, d: Iterable<D>, ..._: [] ): IndexedSeq<R>; zipWith<A, B, C, D, E, R>( zipper: (value: T, a: A, b: B, c: C, d: D, e: E) => R, a: Iterable<A>, b: Iterable<B>, c: Iterable<C>, d: Iterable<D>, e: Iterable<E>, ..._: [] ): IndexedSeq<R>;}
declare class SetSeq<+T> extends Seq<T, T> mixins SetCollection<T> { static <T>(values?: Iterable<T>): SetSeq<T>;
static of<T>(...values: T[]): SetSeq<T>;
// Override specialized return types
concat<U>(...collections: Iterable<U>[]): SetSeq<T | U>;
filter(predicate: typeof Boolean): SetSeq<$NonMaybeType<T>>; filter( predicate: (value: T, value: T, iter: this) => mixed, context?: mixed ): SetSeq<T>;
partition( predicate: (value: T, value: T, iter: this) => mixed, context?: mixed ): [this, this];
map<M>( mapper: (value: T, value: T, iter: this) => M, context?: mixed ): SetSeq<M>;
flatMap<M>( mapper: (value: T, value: T, iter: this) => Iterable<M>, context?: mixed ): SetSeq<M>;
flatten(depth?: number): SetSeq<any>; flatten(shallow?: boolean): SetSeq<any>;}
declare class UpdatableInCollection<K, +V> { setIn<S>(keyPath: [], value: S): S; setIn(keyPath: [K], value: V): this; setIn<K2: $KeyOf<V>, S: $ValOf<V, K2>>(keyPath: [K, K2], value: S): this; setIn<K2: $KeyOf<V>, K3: $KeyOf<$ValOf<V, K2>>, S: $ValOf<$ValOf<V, K2>, K3>>( keyPath: [K, K2, K3], value: S ): this; setIn< K2: $KeyOf<V>, K3: $KeyOf<$ValOf<V, K2>>, K4: $KeyOf<$ValOf<$ValOf<V, K2>, K3>>, S: $ValOf<$ValOf<$ValOf<V, K2>, K3>, K4> >( keyPath: [K, K2, K3, K4], value: S ): this; setIn< K2: $KeyOf<V>, K3: $KeyOf<$ValOf<V, K2>>, K4: $KeyOf<$ValOf<$ValOf<V, K2>, K3>>, K5: $KeyOf<$ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>>, S: $ValOf<$ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>, K5> >( keyPath: [K, K2, K3, K4, K5], value: S ): this;
deleteIn(keyPath: []): void; deleteIn(keyPath: [K]): this; deleteIn<K2: $KeyOf<V>>(keyPath: [K, K2]): this; deleteIn<K2: $KeyOf<V>, K3: $KeyOf<$ValOf<V, K2>>>( keyPath: [K, K2, K3] ): this; deleteIn< K2: $KeyOf<V>, K3: $KeyOf<$ValOf<V, K2>>, K4: $KeyOf<$ValOf<$ValOf<V, K2>, K3>> >( keyPath: [K, K2, K3, K4] ): this; deleteIn< K2: $KeyOf<V>, K3: $KeyOf<$ValOf<V, K2>>, K4: $KeyOf<$ValOf<$ValOf<V, K2>, K3>>, K5: $KeyOf<$ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>> >( keyPath: [K, K2, K3, K4, K5] ): this;
removeIn(keyPath: []): void; removeIn(keyPath: [K]): this; removeIn<K2: $KeyOf<V>>(keyPath: [K, K2]): this; removeIn<K2: $KeyOf<V>, K3: $KeyOf<$ValOf<V, K2>>>( keyPath: [K, K2, K3] ): this; removeIn< K2: $KeyOf<V>, K3: $KeyOf<$ValOf<V, K2>>, K4: $KeyOf<$ValOf<$ValOf<V, K2>, K3>> >( keyPath: [K, K2, K3, K4] ): this; removeIn< K2: $KeyOf<V>, K3: $KeyOf<$ValOf<V, K2>>, K4: $KeyOf<$ValOf<$ValOf<V, K2>, K3>>, K5: $KeyOf<$ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>> >( keyPath: [K, K2, K3, K4, K5] ): this;
updateIn<U>(keyPath: [], notSetValue: mixed, updater: (value: this) => U): U; updateIn<U>(keyPath: [], updater: (value: this) => U): U; updateIn<NSV>(keyPath: [K], notSetValue: NSV, updater: (value: V) => V): this; updateIn(keyPath: [K], updater: (value: V) => V): this; updateIn<NSV, K2: $KeyOf<V>, S: $ValOf<V, K2>>( keyPath: [K, K2], notSetValue: NSV, updater: (value: $ValOf<V, K2> | NSV) => S ): this; updateIn<K2: $KeyOf<V>, S: $ValOf<V, K2>>( keyPath: [K, K2], updater: (value: $ValOf<V, K2>) => S ): this; updateIn< NSV, K2: $KeyOf<V>, K3: $KeyOf<$ValOf<V, K2>>, S: $ValOf<$ValOf<V, K2>, K3> >( keyPath: [K, K2, K3], notSetValue: NSV, updater: (value: $ValOf<$ValOf<V, K2>, K3> | NSV) => S ): this; updateIn< K2: $KeyOf<V>, K3: $KeyOf<$ValOf<V, K2>>, S: $ValOf<$ValOf<V, K2>, K3> >( keyPath: [K, K2, K3], updater: (value: $ValOf<$ValOf<V, K2>, K3>) => S ): this; updateIn< NSV, K2: $KeyOf<V>, K3: $KeyOf<$ValOf<V, K2>>, K4: $KeyOf<$ValOf<$ValOf<V, K2>, K3>>, S: $ValOf<$ValOf<$ValOf<V, K2>, K3>, K4> >( keyPath: [K, K2, K3, K4], notSetValue: NSV, updater: (value: $ValOf<$ValOf<$ValOf<V, K2>, K3>, K4> | NSV) => S ): this; updateIn< K2: $KeyOf<V>, K3: $KeyOf<$ValOf<V, K2>>, K4: $KeyOf<$ValOf<$ValOf<V, K2>, K3>>, S: $ValOf<$ValOf<$ValOf<V, K2>, K3>, K4> >( keyPath: [K, K2, K3, K4], updater: (value: $ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>) => S ): this; updateIn< NSV, K2: $KeyOf<V>, K3: $KeyOf<$ValOf<V, K2>>, K4: $KeyOf<$ValOf<$ValOf<V, K2>, K3>>, K5: $KeyOf<$ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>>, S: $ValOf<$ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>, K5> >( keyPath: [K, K2, K3, K4, K5], notSetValue: NSV, updater: ( value: $ValOf<$ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>, K5> | NSV ) => S ): this; updateIn< K2: $KeyOf<V>, K3: $KeyOf<$ValOf<V, K2>>, K4: $KeyOf<$ValOf<$ValOf<V, K2>, K3>>, K5: $KeyOf<$ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>>, S: $ValOf<$ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>, K5> >( keyPath: [K, K2, K3, K4, K5], updater: (value: $ValOf<$ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>, K5>) => S ): this;}
declare function isList(maybeList: mixed): boolean %checks(maybeList instanceof List);declare class List<+T> extends IndexedCollection<T> mixins UpdatableInCollection<number, T>{ static (collection?: Iterable<T>): List<T>;
static of<T>(...values: T[]): List<T>;
static isList: typeof isList;
size: number;
set<U>(index: number, value: U): List<T | U>; delete(index: number): this; remove(index: number): this; insert<U>(index: number, value: U): List<T | U>; clear(): this; push<U>(...values: U[]): List<T | U>; pop(): this; unshift<U>(...values: U[]): List<T | U>; shift(): this;
update<U>(updater: (value: this) => U): U; update<U>(index: number, updater: (value: T) => U): List<T | U>; update<U>( index: number, notSetValue: U, updater: (value: T) => U ): List<T | U>;
merge<U>(...collections: Iterable<U>[]): List<T | U>;
setSize(size: number): this;
mergeIn(keyPath: Iterable<mixed>, ...collections: Iterable<mixed>[]): this; mergeDeepIn( keyPath: Iterable<mixed>, ...collections: Iterable<mixed>[] ): this;
withMutations(mutator: (mutable: this) => mixed): this; asMutable(): this; wasAltered(): boolean; asImmutable(): this;
// Override specialized return types
concat<C>(...iters: Array<Iterable<C> | C>): List<T | C>;
filter(predicate: typeof Boolean): List<$NonMaybeType<T>>; filter( predicate: (value: T, index: number, iter: this) => mixed, context?: mixed ): List<T>;
partition( predicate: (value: T, index: number, iter: this) => mixed, context?: mixed ): [this, this];
map<M>( mapper: (value: T, index: number, iter: this) => M, context?: mixed ): List<M>;
flatMap<M>( mapper: (value: T, index: number, iter: this) => Iterable<M>, context?: mixed ): List<M>;
flatten(depth?: number): List<any>; flatten(shallow?: boolean): List<any>;
zip<A>(a: Iterable<A>, ..._: []): List<[T, A]>; zip<A, B>(a: Iterable<A>, b: Iterable<B>, ..._: []): List<[T, A, B]>; zip<A, B, C>( a: Iterable<A>, b: Iterable<B>, c: Iterable<C>, ..._: [] ): List<[T, A, B, C]>; zip<A, B, C, D>( a: Iterable<A>, b: Iterable<B>, c: Iterable<C>, d: Iterable<D>, ..._: [] ): List<[T, A, B, C, D]>; zip<A, B, C, D, E>( a: Iterable<A>, b: Iterable<B>, c: Iterable<C>, d: Iterable<D>, e: Iterable<E>, ..._: [] ): List<[T, A, B, C, D, E]>;
zipAll<A>(a: Iterable<A>, ..._: []): List<[T | void, A | void]>; zipAll<A, B>( a: Iterable<A>, b: Iterable<B>, ..._: [] ): List<[T | void, A | void, B | void]>; zipAll<A, B, C>( a: Iterable<A>, b: Iterable<B>, c: Iterable<C>, ..._: [] ): List<[T | void, A | void, B | void, C | void]>; zipAll<A, B, C, D>( a: Iterable<A>, b: Iterable<B>, c: Iterable<C>, d: Iterable<D>, ..._: [] ): List<[T | void, A | void, B | void, C | void, D | void]>; zipAll<A, B, C, D, E>( a: Iterable<A>, b: Iterable<B>, c: Iterable<C>, d: Iterable<D>, e: Iterable<E>, ..._: [] ): List<[T | void, A | void, B | void, C | void, D | void, E | void]>;
zipWith<A, R>( zipper: (value: T, a: A) => R, a: Iterable<A>, ..._: [] ): List<R>; zipWith<A, B, R>( zipper: (value: T, a: A, b: B) => R, a: Iterable<A>, b: Iterable<B>, ..._: [] ): List<R>; zipWith<A, B, C, R>( zipper: (value: T, a: A, b: B, c: C) => R, a: Iterable<A>, b: Iterable<B>, c: Iterable<C>, ..._: [] ): List<R>; zipWith<A, B, C, D, R>( zipper: (value: T, a: A, b: B, c: C, d: D) => R, a: Iterable<A>, b: Iterable<B>, c: Iterable<C>, d: Iterable<D>, ..._: [] ): List<R>; zipWith<A, B, C, D, E, R>( zipper: (value: T, a: A, b: B, c: C, d: D, e: E) => R, a: Iterable<A>, b: Iterable<B>, c: Iterable<C>, d: Iterable<D>, e: Iterable<E>, ..._: [] ): List<R>;}
declare function isMap(maybeMap: mixed): boolean %checks(maybeMap instanceof Map);declare class Map<K, +V> extends KeyedCollection<K, V> mixins UpdatableInCollection<K, V>{ static <K, V>(values?: Iterable<[K, V]> | PlainObjInput<K, V>): Map<K, V>;
static isMap: typeof isMap;
size: number;
set<K_, V_>(key: K_, value: V_): Map<K | K_, V | V_>; delete(key: K): this; remove(key: K): this; clear(): this;
deleteAll(keys: Iterable<K>): Map<K, V>; removeAll(keys: Iterable<K>): Map<K, V>;
update<U>(updater: (value: this) => U): U; update<V_>(key: K, updater: (value: V) => V_): Map<K, V | V_>; update<V_>( key: K, notSetValue: V_, updater: (value: V) => V_ ): Map<K, V | V_>;
merge<K_, V_>( ...collections: (Iterable<[K_, V_]> | PlainObjInput<K_, V_>)[] ): Map<K | K_, V | V_>; concat<K_, V_>( ...collections: (Iterable<[K_, V_]> | PlainObjInput<K_, V_>)[] ): Map<K | K_, V | V_>;
mergeWith<K_, W, X>( merger: (oldVal: V, newVal: W, key: K) => X, ...collections: (Iterable<[K_, W]> | PlainObjInput<K_, W>)[] ): Map<K | K_, V | W | X>;
mergeDeep<K_, V_>( ...collections: (Iterable<[K_, V_]> | PlainObjInput<K_, V_>)[] ): Map<K | K_, V | V_>;
mergeDeepWith<K_, V_>( merger: (oldVal: any, newVal: any, key: any) => mixed, ...collections: (Iterable<[K_, V_]> | PlainObjInput<K_, V_>)[] ): Map<K | K_, V | V_>;
mergeIn( keyPath: Iterable<mixed>, ...collections: (Iterable<mixed> | PlainObjInput<mixed, mixed>)[] ): this; mergeDeepIn( keyPath: Iterable<mixed>, ...collections: (Iterable<mixed> | PlainObjInput<mixed, mixed>)[] ): this;
withMutations(mutator: (mutable: this) => mixed): this; asMutable(): this; wasAltered(): boolean; asImmutable(): this;
// Override specialized return types
flip(): Map<V, K>;
filter(predicate: typeof Boolean): Map<K, $NonMaybeType<V>>; filter( predicate: (value: V, key: K, iter: this) => mixed, context?: mixed ): Map<K, V>;
partition( predicate: (value: V, key: K, iter: this) => mixed, context?: mixed ): [this, this];
map<M>( mapper: (value: V, key: K, iter: this) => M, context?: mixed ): Map<K, M>;
mapKeys<M>( mapper: (key: K, value: V, iter: this) => M, context?: mixed ): Map<M, V>;
mapEntries<KM, VM>( mapper: (entry: [K, V], index: number, iter: this) => [KM, VM], context?: mixed ): Map<KM, VM>;
flatMap<KM, VM>( mapper: (value: V, key: K, iter: this) => Iterable<[KM, VM]>, context?: mixed ): Map<KM, VM>;
flatten(depth?: number): Map<any, any>; flatten(shallow?: boolean): Map<any, any>;}
declare function isOrderedMap( maybeOrderedMap: mixed): boolean %checks(maybeOrderedMap instanceof OrderedMap);declare class OrderedMap<K, +V> extends Map<K, V> mixins UpdatableInCollection<K, V>{ static <K, V>( values?: Iterable<[K, V]> | PlainObjInput<K, V> ): OrderedMap<K, V>;
static isOrderedMap: typeof isOrderedMap;
size: number;
set<K_, V_>(key: K_, value: V_): OrderedMap<K | K_, V | V_>; delete(key: K): this; remove(key: K): this; clear(): this;
update<U>(updater: (value: this) => U): U; update<V_>(key: K, updater: (value: V) => V_): OrderedMap<K, V | V_>; update<V_>( key: K, notSetValue: V_, updater: (value: V) => V_ ): OrderedMap<K, V | V_>;
merge<K_, V_>( ...collections: (Iterable<[K_, V_]> | PlainObjInput<K_, V_>)[] ): OrderedMap<K | K_, V | V_>; concat<K_, V_>( ...collections: (Iterable<[K_, V_]> | PlainObjInput<K_, V_>)[] ): OrderedMap<K | K_, V | V_>;
mergeWith<K_, W, X>( merger: (oldVal: V, newVal: W, key: K) => X, ...collections: (Iterable<[K_, W]> | PlainObjInput<K_, W>)[] ): OrderedMap<K | K_, V | W | X>;
mergeDeep<K_, V_>( ...collections: (Iterable<[K_, V_]> | PlainObjInput<K_, V_>)[] ): OrderedMap<K | K_, V | V_>;
mergeDeepWith<K_, V_>( merger: (oldVal: any, newVal: any, key: any) => mixed, ...collections: (Iterable<[K_, V_]> | PlainObjInput<K_, V_>)[] ): OrderedMap<K | K_, V | V_>;
mergeIn( keyPath: Iterable<mixed>, ...collections: (Iterable<mixed> | PlainObjInput<mixed, mixed>)[] ): this; mergeDeepIn( keyPath: Iterable<mixed>, ...collections: (Iterable<mixed> | PlainObjInput<mixed, mixed>)[] ): this;
withMutations(mutator: (mutable: this) => mixed): this; asMutable(): this; wasAltered(): boolean; asImmutable(): this;
// Override specialized return types
flip(): OrderedMap<V, K>;
filter(predicate: typeof Boolean): OrderedMap<K, $NonMaybeType<V>>; filter( predicate: (value: V, key: K, iter: this) => mixed, context?: mixed ): OrderedMap<K, V>;
partition( predicate: (value: V, key: K, iter: this) => mixed, context?: mixed ): [this, this];
map<M>( mapper: (value: V, key: K, iter: this) => M, context?: mixed ): OrderedMap<K, M>;
mapKeys<M>( mapper: (key: K, value: V, iter: this) => M, context?: mixed ): OrderedMap<M, V>;
mapEntries<KM, VM>( mapper: (entry: [K, V], index: number, iter: this) => [KM, VM], context?: mixed ): OrderedMap<KM, VM>;
flatMap<KM, VM>( mapper: (value: V, key: K, iter: this) => Iterable<[KM, VM]>, context?: mixed ): OrderedMap<KM, VM>;
flatten(depth?: number): OrderedMap<any, any>; flatten(shallow?: boolean): OrderedMap<any, any>;}
declare function isSet(maybeSet: mixed): boolean %checks(maybeSet instanceof Set);declare class Set<+T> extends SetCollection<T> { static <T>(values?: Iterable<T>): Set<T>;
static of<T>(...values: T[]): Set<T>; static fromKeys<T>( values: Iterable<[T, mixed]> | PlainObjInput<T, mixed> ): Set<T>;
static intersect(sets: Iterable<Iterable<T>>): Set<T>; static union(sets: Iterable<Iterable<T>>): Set<T>;
static isSet: typeof isSet;
size: number;
add<U>(value: U): Set<T | U>; delete(value: T): this; remove(value: T): this; clear(): this; union<U>(...collections: Iterable<U>[]): Set<T | U>; merge<U>(...collections: Iterable<U>[]): Set<T | U>; concat<U>(...collections: Iterable<U>[]): Set<T | U>; intersect<U>(...collections: Iterable<U>[]): Set<T & U>; subtract(...collections: Iterable<mixed>[]): this;
withMutations(mutator: (mutable: this) => mixed): this; asMutable(): this; wasAltered(): boolean; asImmutable(): this;
// Override specialized return types
filter(predicate: typeof Boolean): Set<$NonMaybeType<T>>; filter( predicate: (value: T, value: T, iter: this) => mixed, context?: mixed ): Set<T>;
partition( predicate: (value: T, value: T, iter: this) => mixed, context?: mixed ): [this, this];
map<M>( mapper: (value: T, value: T, iter: this) => M, context?: mixed ): Set<M>;
flatMap<M>( mapper: (value: T, value: T, iter: this) => Iterable<M>, context?: mixed ): Set<M>;
flatten(depth?: number): Set<any>; flatten(shallow?: boolean): Set<any>;}
// Overrides except for `isOrderedSet` are for specialized return typesdeclare function isOrderedSet( maybeOrderedSet: mixed): boolean %checks(maybeOrderedSet instanceof OrderedSet);declare class OrderedSet<+T> extends Set<T> { static <T>(values?: Iterable<T>): OrderedSet<T>;
static of<T>(...values: T[]): OrderedSet<T>; static fromKeys<T>( values: Iterable<[T, mixed]> | PlainObjInput<T, mixed> ): OrderedSet<T>;
static isOrderedSet: typeof isOrderedSet;
size: number;
add<U>(value: U): OrderedSet<T | U>; union<U>(...collections: Iterable<U>[]): OrderedSet<T | U>; merge<U>(...collections: Iterable<U>[]): OrderedSet<T | U>; concat<U>(...collections: Iterable<U>[]): OrderedSet<T | U>; intersect<U>(...collections: Iterable<U>[]): OrderedSet<T & U>;
filter(predicate: typeof Boolean): OrderedSet<$NonMaybeType<T>>; filter( predicate: (value: T, value: T, iter: this) => mixed, context?: mixed ): OrderedSet<T>;
partition( predicate: (value: T, value: T, iter: this) => mixed, context?: mixed ): [this, this];
map<M>( mapper: (value: T, value: T, iter: this) => M, context?: mixed ): OrderedSet<M>;
flatMap<M>( mapper: (value: T, value: T, iter: this) => Iterable<M>, context?: mixed ): OrderedSet<M>;
flatten(depth?: number): OrderedSet<any>; flatten(shallow?: boolean): OrderedSet<any>;
zip<A>(a: Iterable<A>, ..._: []): OrderedSet<[T, A]>; zip<A, B>(a: Iterable<A>, b: Iterable<B>, ..._: []): OrderedSet<[T, A, B]>; zip<A, B, C>( a: Iterable<A>, b: Iterable<B>, c: Iterable<C>, ..._: [] ): OrderedSet<[T, A, B, C]>; zip<A, B, C, D>( a: Iterable<A>, b: Iterable<B>, c: Iterable<C>, d: Iterable<D>, ..._: [] ): OrderedSet<[T, A, B, C, D]>; zip<A, B, C, D, E>( a: Iterable<A>, b: Iterable<B>, c: Iterable<C>, d: Iterable<D>, e: Iterable<E>, ..._: [] ): OrderedSet<[T, A, B, C, D, E]>;
zipAll<A>(a: Iterable<A>, ..._: []): OrderedSet<[T | void, A | void]>; zipAll<A, B>( a: Iterable<A>, b: Iterable<B>, ..._: [] ): OrderedSet<[T | void, A | void, B | void]>; zipAll<A, B, C>( a: Iterable<A>, b: Iterable<B>, c: Iterable<C>, ..._: [] ): OrderedSet<[T | void, A | void, B | void, C | void]>; zipAll<A, B, C, D>( a: Iterable<A>, b: Iterable<B>, c: Iterable<C>, d: Iterable<D>, ..._: [] ): OrderedSet<[T | void, A | void, B | void, C | void, D | void]>; zipAll<A, B, C, D, E>( a: Iterable<A>, b: Iterable<B>, c: Iterable<C>, d: Iterable<D>, e: Iterable<E>, ..._: [] ): OrderedSet<[T | void, A | void, B | void, C | void, D | void, E | void]>;
zipWith<A, R>( zipper: (value: T, a: A) => R, a: Iterable<A>, ..._: [] ): OrderedSet<R>; zipWith<A, B, R>( zipper: (value: T, a: A, b: B) => R, a: Iterable<A>, b: Iterable<B>, ..._: [] ): OrderedSet<R>; zipWith<A, B, C, R>( zipper: (value: T, a: A, b: B, c: C) => R, a: Iterable<A>, b: Iterable<B>, c: Iterable<C>, ..._: [] ): OrderedSet<R>; zipWith<A, B, C, D, R>( zipper: (value: T, a: A, b: B, c: C, d: D) => R, a: Iterable<A>, b: Iterable<B>, c: Iterable<C>, d: Iterable<D>, ..._: [] ): OrderedSet<R>; zipWith<A, B, C, D, E, R>( zipper: (value: T, a: A, b: B, c: C, d: D, e: E) => R, a: Iterable<A>, b: Iterable<B>, c: Iterable<C>, d: Iterable<D>, e: Iterable<E>, ..._: [] ): OrderedSet<R>;}
declare function isStack( maybeStack: mixed): boolean %checks(maybeStack instanceof Stack);declare class Stack<+T> extends IndexedCollection<T> { static <T>(collection?: Iterable<T>): Stack<T>;
static isStack(maybeStack: mixed): boolean; static of<T>(...values: T[]): Stack<T>;
static isStack: typeof isStack;
size: number;
peek(): T; clear(): this; unshift<U>(...values: U[]): Stack<T | U>; unshiftAll<U>(iter: Iterable<U>): Stack<T | U>; shift(): this; push<U>(...values: U[]): Stack<T | U>; pushAll<U>(iter: Iterable<U>): Stack<T | U>; pop(): this;
withMutations(mutator: (mutable: this) => mixed): this; asMutable(): this; wasAltered(): boolean; asImmutable(): this;
// Override specialized return types
concat<C>(...iters: Array<Iterable<C> | C>): Stack<T | C>;
filter(predicate: typeof Boolean): Stack<$NonMaybeType<T>>; filter( predicate: (value: T, index: number, iter: this) => mixed, context?: mixed ): Stack<T>;
map<M>( mapper: (value: T, index: number, iter: this) => M, context?: mixed ): Stack<M>;
flatMap<M>( mapper: (value: T, index: number, iter: this) => Iterable<M>, context?: mixed ): Stack<M>;
flatten(depth?: number): Stack<any>; flatten(shallow?: boolean): Stack<any>;
zip<A>(a: Iterable<A>, ..._: []): Stack<[T, A]>; zip<A, B>(a: Iterable<A>, b: Iterable<B>, ..._: []): Stack<[T, A, B]>; zip<A, B, C>( a: Iterable<A>, b: Iterable<B>, c: Iterable<C>, ..._: [] ): Stack<[T, A, B, C]>; zip<A, B, C, D>( a: Iterable<A>, b: Iterable<B>, c: Iterable<C>, d: Iterable<D>, ..._: [] ): Stack<[T, A, B, C, D]>; zip<A, B, C, D, E>( a: Iterable<A>, b: Iterable<B>, c: Iterable<C>, d: Iterable<D>, e: Iterable<E>, ..._: [] ): Stack<[T, A, B, C, D, E]>;
zipAll<A>(a: Iterable<A>, ..._: []): Stack<[T | void, A | void]>; zipAll<A, B>( a: Iterable<A>, b: Iterable<B>, ..._: [] ): Stack<[T | void, A | void, B | void]>; zipAll<A, B, C>( a: Iterable<A>, b: Iterable<B>, c: Iterable<C>, ..._: [] ): Stack<[T | void, A | void, B | void, C | void]>; zipAll<A, B, C, D>( a: Iterable<A>, b: Iterable<B>, c: Iterable<C>, d: Iterable<D>, ..._: [] ): Stack<[T | void, A | void, B | void, C | void, D | void]>; zipAll<A, B, C, D, E>( a: Iterable<A>, b: Iterable<B>, c: Iterable<C>, d: Iterable<D>, e: Iterable<E>, ..._: [] ): Stack<[T | void, A | void, B | void, C | void, D | void, E | void]>;
zipWith<A, R>( zipper: (value: T, a: A) => R, a: Iterable<A>, ..._: [] ): Stack<R>; zipWith<A, B, R>( zipper: (value: T, a: A, b: B) => R, a: Iterable<A>, b: Iterable<B>, ..._: [] ): Stack<R>; zipWith<A, B, C, R>( zipper: (value: T, a: A, b: B, c: C) => R, a: Iterable<A>, b: Iterable<B>, c: Iterable<C>, ..._: [] ): Stack<R>; zipWith<A, B, C, D, R>( zipper: (value: T, a: A, b: B, c: C, d: D) => R, a: Iterable<A>, b: Iterable<B>, c: Iterable<C>, d: Iterable<D>, ..._: [] ): Stack<R>; zipWith<A, B, C, D, E, R>( zipper: (value: T, a: A, b: B, c: C, d: D, e: E) => R, a: Iterable<A>, b: Iterable<B>, c: Iterable<C>, d: Iterable<D>, e: Iterable<E>, ..._: [] ): Stack<R>;}
declare function Range( start?: number, end?: number, step?: number): IndexedSeq<number>;declare function Repeat<T>(value: T, times?: number): IndexedSeq<T>;
// The type of a Record factory function.type RecordFactory<Values: Object> = Class<RecordInstance<Values>>;
// The type of runtime Record instances.type RecordOf<Values: Object> = RecordInstance<Values> & $ReadOnly<Values>;
// The values of a Record instance.type _RecordValues<T, R: RecordInstance<T> | T> = R;type RecordValues<R> = _RecordValues<*, R>;
declare function isRecord( maybeRecord: any): boolean %checks(maybeRecord instanceof RecordInstance);declare class Record { static <Values: Object>(spec: Values, name?: string): typeof RecordInstance; constructor<Values: Object>( spec: Values, name?: string ): typeof RecordInstance;
static isRecord: typeof isRecord;
static getDescriptiveName(record: RecordInstance<any>): string;}
declare class RecordInstance<T: Object = Object> { static (values?: Iterable<[$Keys<T>, $ValOf<T>]> | $Shape<T>): RecordOf<T>; // Note: a constructor can only create an instance of RecordInstance<T>, // it's encouraged to not use `new` when creating Records. constructor(values?: Iterable<[$Keys<T>, $ValOf<T>]> | $Shape<T>): void;
size: number;
has(key: string): boolean;
get<K: $Keys<T>>(key: K, ..._: []): $ElementType<T, K>; get<K: $Keys<T>, NSV>(key: K, notSetValue: NSV): $ElementType<T, K> | NSV;
hasIn(keyPath: Iterable<mixed>): boolean;
getIn(keyPath: [], notSetValue?: mixed): this & $ReadOnly<T>; getIn<K: $Keys<T>>(keyPath: [K], notSetValue?: mixed): $ElementType<T, K>; getIn<NSV, K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>>( keyPath: [K, K2], notSetValue: NSV ): $ValOf<$ValOf<T, K>, K2> | NSV; getIn< NSV, K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>, K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>> >( keyPath: [K, K2, K3], notSetValue: NSV ): $ValOf<$ValOf<$ValOf<T, K>, K2>, K3> | NSV; getIn< NSV, K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>, K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>> >( keyPath: [K, K2, K3, K4], notSetValue: NSV ): $ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4> | NSV; getIn< NSV, K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>, K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>>, K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>> >( keyPath: [K, K2, K3, K4, K5], notSetValue: NSV ): $ValOf<$ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>, K5> | NSV;
equals(other: any): boolean; hashCode(): number;
set<K: $Keys<T>>(key: K, value: $ElementType<T, K>): this & $ReadOnly<T>; update<K: $Keys<T>>( key: K, updater: (value: $ElementType<T, K>) => $ElementType<T, K> ): this & $ReadOnly<T>; merge( ...collections: Array<Iterable<[$Keys<T>, $ValOf<T>]> | $Shape<T>> ): this & $ReadOnly<T>; mergeDeep( ...collections: Array<Iterable<[$Keys<T>, $ValOf<T>]> | $Shape<T>> ): this & $ReadOnly<T>;
mergeWith( merger: (oldVal: $ValOf<T>, newVal: $ValOf<T>, key: $Keys<T>) => $ValOf<T>, ...collections: Array<Iterable<[$Keys<T>, $ValOf<T>]> | $Shape<T>> ): this & $ReadOnly<T>; mergeDeepWith( merger: (oldVal: any, newVal: any, key: any) => any, ...collections: Array<Iterable<[$Keys<T>, $ValOf<T>]> | $Shape<T>> ): this & $ReadOnly<T>;
delete<K: $Keys<T>>(key: K): this & $ReadOnly<T>; remove<K: $Keys<T>>(key: K): this & $ReadOnly<T>; clear(): this & $ReadOnly<T>;
setIn<S>(keyPath: [], value: S): S; setIn<K: $Keys<T>, S: $ValOf<T, K>>( keyPath: [K], value: S ): this & $ReadOnly<T>; setIn<K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>, S: $ValOf<$ValOf<T, K>, K2>>( keyPath: [K, K2], value: S ): this & $ReadOnly<T>; setIn< K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>, K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>, S: $ValOf<$ValOf<$ValOf<T, K>, K2>, K3> >( keyPath: [K, K2, K3], value: S ): this & $ReadOnly<T>; setIn< K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>, K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>>, S: $ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4> >( keyPath: [K, K2, K3, K4], value: S ): this & $ReadOnly<T>; setIn< K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>, K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>>, K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>>, S: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>, K5> >( keyPath: [K, K2, K3, K4, K5], value: S ): this & $ReadOnly<T>;
deleteIn(keyPath: []): void; deleteIn<K: $Keys<T>>(keyPath: [K]): this & $ReadOnly<T>; deleteIn<K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>>( keyPath: [K, K2] ): this & $ReadOnly<T>; deleteIn< K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>, K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>> >( keyPath: [K, K2, K3] ): this & $ReadOnly<T>; deleteIn< K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>, K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>> >( keyPath: [K, K2, K3, K4] ): this & $ReadOnly<T>; deleteIn< K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>, K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>>, K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>> >( keyPath: [K, K2, K3, K4, K5] ): this & $ReadOnly<T>;
removeIn(keyPath: []): void; removeIn<K: $Keys<T>>(keyPath: [K]): this & $ReadOnly<T>; removeIn<K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>>( keyPath: [K, K2] ): this & $ReadOnly<T>; removeIn< K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>, K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>> >( keyPath: [K, K2, K3] ): this & $ReadOnly<T>; removeIn< K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>, K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>> >( keyPath: [K, K2, K3, K4] ): this & $ReadOnly<T>; removeIn< K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>, K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>>, K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>> >( keyPath: [K, K2, K3, K4, K5] ): this & $ReadOnly<T>;
updateIn<U>( keyPath: [], notSetValue: mixed, updater: (value: this & T) => U ): U; updateIn<U>(keyPath: [], updater: (value: this & T) => U): U; updateIn<NSV, K: $Keys<T>, S: $ValOf<T, K>>( keyPath: [K], notSetValue: NSV, updater: (value: $ValOf<T, K>) => S ): this & $ReadOnly<T>; updateIn<K: $Keys<T>, S: $ValOf<T, K>>( keyPath: [K], updater: (value: $ValOf<T, K>) => S ): this & $ReadOnly<T>; updateIn< NSV, K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>, S: $ValOf<$ValOf<T, K>, K2> >( keyPath: [K, K2], notSetValue: NSV, updater: (value: $ValOf<$ValOf<T, K>, K2> | NSV) => S ): this & $ReadOnly<T>; updateIn<K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>, S: $ValOf<$ValOf<T, K>, K2>>( keyPath: [K, K2], updater: (value: $ValOf<$ValOf<T, K>, K2>) => S ): this & $ReadOnly<T>; updateIn< NSV, K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>, K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>, S: $ValOf<$ValOf<$ValOf<T, K>, K2>, K3> >( keyPath: [K, K2, K3], notSetValue: NSV, updater: (value: $ValOf<$ValOf<$ValOf<T, K>, K2>, K3> | NSV) => S ): this & $ReadOnly<T>; updateIn< K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>, K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>, S: $ValOf<$ValOf<$ValOf<T, K>, K2>, K3> >( keyPath: [K, K2, K3], updater: (value: $ValOf<$ValOf<$ValOf<T, K>, K2>, K3>) => S ): this & $ReadOnly<T>; updateIn< NSV, K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>, K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>>, S: $ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4> >( keyPath: [K, K2, K3, K4], notSetValue: NSV, updater: ( value: $ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4> | NSV ) => S ): this & $ReadOnly<T>; updateIn< K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>, K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>>, S: $ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4> >( keyPath: [K, K2, K3, K4], updater: (value: $ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>) => S ): this & $ReadOnly<T>; updateIn< NSV, K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>, K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>>, K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>>, S: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>, K5> >( keyPath: [K, K2, K3, K4, K5], notSetValue: NSV, updater: ( value: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>, K5> | NSV ) => S ): this & $ReadOnly<T>; updateIn< K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>, K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>>, K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>>, S: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>, K5> >( keyPath: [K, K2, K3, K4, K5], updater: ( value: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>, K5> ) => S ): this & $ReadOnly<T>;
mergeIn( keyPath: Iterable<mixed>, ...collections: Array<any> ): this & $ReadOnly<T>; mergeDeepIn( keyPath: Iterable<mixed>, ...collections: Array<any> ): this & $ReadOnly<T>;
toSeq(): KeyedSeq<$Keys<T>, any>;
toJS(): { [key: $Keys<T>]: mixed }; toJSON(): T; toObject(): T;
withMutations(mutator: (mutable: this & T) => mixed): this & $ReadOnly<T>; asMutable(): this & $ReadOnly<T>; wasAltered(): boolean; asImmutable(): this & $ReadOnly<T>;
@@iterator(): Iterator<[$Keys<T>, $ValOf<T>]>;}
declare function fromJS( jsValue: mixed, reviver?: ( key: string | number, sequence: KeyedCollection<string, mixed> | IndexedCollection<mixed>, path?: Array<string | number> ) => mixed): Collection<mixed, mixed>;
declare function is(first: mixed, second: mixed): boolean;declare function hash(value: mixed): number;
declare function get<C: Object, K: $Keys<C>>( collection: C, key: K, notSetValue: mixed): $ValOf<C, K>;declare function get<C, K: $KeyOf<C>, NSV>( collection: C, key: K, notSetValue: NSV): $ValOf<C, K> | NSV;
declare function has(collection: Object, key: mixed): boolean;declare function remove<C>(collection: C, key: $KeyOf<C>): C;declare function set<C, K: $KeyOf<C>, V: $ValOf<C, K>>( collection: C, key: K, value: V): C;declare function update<C, K: $KeyOf<C>, V: $ValOf<C, K>, NSV>( collection: C, key: K, notSetValue: NSV, updater: ($ValOf<C, K> | NSV) => V): C;declare function update<C, K: $KeyOf<C>, V: $ValOf<C, K>>( collection: C, key: K, updater: ($ValOf<C, K>) => V): C;
declare function getIn<C>(collection: C, keyPath: [], notSetValue?: mixed): C;declare function getIn<C, K: $KeyOf<C>, NSV>( collection: C, keyPath: [K], notSetValue: NSV): $ValOf<C, K> | NSV;declare function getIn<C, K: $KeyOf<C>, K2: $KeyOf<$ValOf<C, K>>, NSV>( collection: C, keyPath: [K, K2], notSetValue: NSV): $ValOf<$ValOf<C, K>, K2> | NSV;declare function getIn< C, K: $KeyOf<C>, K2: $KeyOf<$ValOf<C, K>>, K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>, NSV>( collection: C, keyPath: [K, K2, K3], notSetValue: NSV): $ValOf<$ValOf<$ValOf<C, K>, K2>, K3> | NSV;declare function getIn< C, K: $KeyOf<C>, K2: $KeyOf<$ValOf<C, K>>, K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>>, NSV>( collection: C, keyPath: [K, K2, K3, K4], notSetValue: NSV): $ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4> | NSV;declare function getIn< C, K: $KeyOf<C>, K2: $KeyOf<$ValOf<C, K>>, K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>>, K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>>, NSV>( collection: C, keyPath: [K, K2, K3, K4, K5], notSetValue: NSV): $ValOf<$ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>, K5> | NSV;
declare function hasIn(collection: Object, keyPath: Iterable<mixed>): boolean;
declare function removeIn<C>(collection: C, keyPath: []): void;declare function removeIn<C, K: $KeyOf<C>>(collection: C, keyPath: [K]): C;declare function removeIn<C, K: $KeyOf<C>, K2: $KeyOf<$ValOf<C, K>>>( collection: C, keyPath: [K, K2]): C;declare function removeIn< C, K: $KeyOf<C>, K2: $KeyOf<$ValOf<C, K>>, K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>>( collection: C, keyPath: [K, K2, K3]): C;declare function removeIn< C, K: $KeyOf<C>, K2: $KeyOf<$ValOf<C, K>>, K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>>>( collection: C, keyPath: [K, K2, K3, K4]): C;declare function removeIn< C, K: $KeyOf<C>, K2: $KeyOf<$ValOf<C, K>>, K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>>, K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>>>( collection: C, keyPath: [K, K2, K3, K4, K5]): C;
declare function setIn<S>(collection: Object, keyPath: [], value: S): S;declare function setIn<C, K: $KeyOf<C>, S: $ValOf<C, K>>( collection: C, keyPath: [K], value: S): C;declare function setIn< C, K: $KeyOf<C>, K2: $KeyOf<$ValOf<C, K>>, S: $ValOf<$ValOf<C, K>, K2>>( collection: C, keyPath: [K, K2], value: S): C;declare function setIn< C, K: $KeyOf<C>, K2: $KeyOf<$ValOf<C, K>>, K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>, S: $ValOf<$ValOf<$ValOf<C, K>, K2>, K3>>( collection: C, keyPath: [K, K2, K3], value: S): C;declare function setIn< C, K: $KeyOf<C>, K2: $KeyOf<$ValOf<C, K>>, K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>>, S: $ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>>( collection: C, keyPath: [K, K2, K3, K4], value: S): C;declare function setIn< C, K: $KeyOf<C>, K2: $KeyOf<$ValOf<C, K>>, K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>>, K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>>, S: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>, K5>>( collection: C, keyPath: [K, K2, K3, K4, K5], value: S): C;
declare function updateIn<C, S>( collection: C, keyPath: [], notSetValue: mixed, updater: (value: C) => S): S;declare function updateIn<C, S>( collection: C, keyPath: [], updater: (value: C) => S): S;declare function updateIn<C, K: $KeyOf<C>, S: $ValOf<C, K>, NSV>( collection: C, keyPath: [K], notSetValue: NSV, updater: (value: $ValOf<C, K> | NSV) => S): C;declare function updateIn<C, K: $KeyOf<C>, S: $ValOf<C, K>>( collection: C, keyPath: [K], updater: (value: $ValOf<C, K>) => S): C;declare function updateIn< C, K: $KeyOf<C>, K2: $KeyOf<$ValOf<C, K>>, S: $ValOf<$ValOf<C, K>, K2>, NSV>( collection: C, keyPath: [K, K2], notSetValue: NSV, updater: (value: $ValOf<$ValOf<C, K>, K2> | NSV) => S): C;declare function updateIn< C, K: $KeyOf<C>, K2: $KeyOf<$ValOf<C, K>>, S: $ValOf<$ValOf<C, K>, K2>>( collection: C, keyPath: [K, K2], updater: (value: $ValOf<$ValOf<C, K>, K2>) => S): C;declare function updateIn< C, K: $KeyOf<C>, K2: $KeyOf<$ValOf<C, K>>, K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>, S: $ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, NSV>( collection: C, keyPath: [K, K2, K3], notSetValue: NSV, updater: (value: $ValOf<$ValOf<$ValOf<C, K>, K2>, K3> | NSV) => S): C;declare function updateIn< C, K: $KeyOf<C>, K2: $KeyOf<$ValOf<C, K>>, K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>, S: $ValOf<$ValOf<$ValOf<C, K>, K2>, K3>>( collection: C, keyPath: [K, K2, K3], updater: (value: $ValOf<$ValOf<$ValOf<C, K>, K2>, K3>) => S): C;declare function updateIn< C, K: $KeyOf<C>, K2: $KeyOf<$ValOf<C, K>>, K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>>, S: $ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>, NSV>( collection: C, keyPath: [K, K2, K3, K4], notSetValue: NSV, updater: (value: $ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4> | NSV) => S): C;declare function updateIn< C, K: $KeyOf<C>, K2: $KeyOf<$ValOf<C, K>>, K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>>, S: $ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>>( collection: C, keyPath: [K, K2, K3, K4], updater: (value: $ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>) => S): C;declare function updateIn< C, K: $KeyOf<C>, K2: $KeyOf<$ValOf<C, K>>, K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>>, K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>>, S: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>, K5>, NSV>( collection: C, keyPath: [K, K2, K3, K4, K5], notSetValue: NSV, updater: ( value: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>, K5> | NSV ) => S): C;declare function updateIn< C, K: $KeyOf<C>, K2: $KeyOf<$ValOf<C, K>>, K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>>, K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>>, S: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>, K5>>( collection: C, keyPath: [K, K2, K3, K4, K5], updater: ( value: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>, K5> ) => S): C;
declare function merge<C>( collection: C, ...collections: Array< | $IterableOf<C> | $Shape<RecordValues<C>> | PlainObjInput<$KeyOf<C>, $ValOf<C>> >): C;declare function mergeWith<C>( merger: (oldVal: $ValOf<C>, newVal: $ValOf<C>, key: $KeyOf<C>) => $ValOf<C>, collection: C, ...collections: Array< | $IterableOf<C> | $Shape<RecordValues<C>> | PlainObjInput<$KeyOf<C>, $ValOf<C>> >): C;declare function mergeDeep<C>( collection: C, ...collections: Array< | $IterableOf<C> | $Shape<RecordValues<C>> | PlainObjInput<$KeyOf<C>, $ValOf<C>> >): C;declare function mergeDeepWith<C>( merger: (oldVal: any, newVal: any, key: any) => mixed, collection: C, ...collections: Array< | $IterableOf<C> | $Shape<RecordValues<C>> | PlainObjInput<$KeyOf<C>, $ValOf<C>> >): C;
export { Collection, Seq, List, Map, OrderedMap, OrderedSet, Range, Repeat, Record, Set, Stack, fromJS, is, hash, isImmutable, isCollection, isKeyed, isIndexed, isAssociative, isOrdered, isRecord, isValueObject, get, has, remove, set, update, getIn, hasIn, removeIn, setIn, updateIn, merge, mergeWith, mergeDeep, mergeDeepWith,};
export default { Collection, Seq,
List, Map, OrderedMap, OrderedSet, PairSorting, Range, Repeat, Record, Set, Stack,
fromJS, is, hash,
isImmutable, isCollection, isKeyed, isIndexed, isAssociative, isOrdered, isRecord, isValueObject,
get, has, remove, set, update, getIn, hasIn, removeIn, setIn, updateIn, merge, mergeWith, mergeDeep, mergeDeepWith,};
export type { Comparator, KeyedCollection, IndexedCollection, SetCollection, KeyedSeq, IndexedSeq, SetSeq, RecordFactory, RecordOf, RecordInstance, ValueObject, $KeyOf, $ValOf,};12312345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455version https://git-lfs.github.com/spec/v1oid sha256:87325af960ae4958683069d6c8260a2cc57c2bb007a65e7c9252f9643a1355a4size 65337/** * MIT License * * Copyright (c) 2014-present, Lee Byron and other contributors. * * 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: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * 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. */!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)||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)?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){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){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},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(){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;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){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;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--;)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()?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,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)};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(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&&(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(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){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),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),((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){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()},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;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){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;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){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().__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){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(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(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,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,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})});123123456789101112131415161718192021222324252627282930313233343536373839version https://git-lfs.github.com/spec/v1oid sha256:a603f52982c3555edecd7684ed49bef02997dee19de96ee6c31e6663eed39a75size 797{ "name": "immutable", "version": "4.3.6", "description": "Immutable Data Collections", "license": "MIT", "homepage": "https://immutable-js.com", "author": { "name": "Lee Byron", "url": "https://github.com/leebyron" }, "repository": { "type": "git", "url": "git://github.com/immutable-js/immutable-js.git" }, "bugs": { "url": "https://github.com/immutable-js/immutable-js/issues" }, "main": "dist/immutable.js", "module": "dist/immutable.es.js", "sideEffects": false, "types": "dist/immutable.d.ts", "files": [ "dist", "README.md", "LICENSE" ], "keywords": [ "immutable", "persistent", "lazy", "data", "datastructure", "functional", "collection", "stateless", "sequence", "iteration" ]}123123456789101112131415version https://git-lfs.github.com/spec/v1oid sha256:05dc4d785ac3a488676d3ed10e901b75ad89dafcc63f8e66610fd4a39cc5c7e8size 748The ISC License
Copyright (c) Isaac Z. Schlueter
Permission to use, copy, modify, and/or distribute this software for anypurpose with or without fee is hereby granted, provided that the abovecopyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIESWITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OFMERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FORANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGESWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN ANACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF ORIN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.12312345678910111213141516171819202122232425262728293031323334353637version https://git-lfs.github.com/spec/v1oid sha256:7287d41cefa8c790b6a3bd8a802614f93acf2fd0eaca3d2fc7b6fef0c5e2ce47size 991# inflight
Add callbacks to requests in flight to avoid async duplication
## USAGE
```javascriptvar inflight = require('inflight')
// some request that does some stufffunction req(key, callback) { // key is any random string. like a url or filename or whatever. // // will return either a falsey value, indicating that the // request for this key is already in flight, or a new callback // which when called will call all callbacks passed to inflightk // with the same key callback = inflight(key, callback)
// If we got a falsey value back, then there's already a req going if (!callback) return
// this is where you'd fetch the url or whatever // callback is also once()-ified, so it can safely be assigned // to multiple events etc. First call wins. setTimeout(function() { callback(null, key) }, 100)}
// only assigns a single setTimeout// when it dings, all cbs get calledreq('foo', cb1)req('foo', cb2)req('foo', cb3)req('foo', cb4)```123123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354version https://git-lfs.github.com/spec/v1oid sha256:e33ea098a91d2c41be886fbbcecacb9799fe183d8a446f138a4786cb3d809802size 1365var wrappy = require('wrappy')var reqs = Object.create(null)var once = require('once')
module.exports = wrappy(inflight)
function inflight (key, cb) { if (reqs[key]) { reqs[key].push(cb) return null } else { reqs[key] = [cb] return makeres(key) }}
function makeres (key) { return once(function RES () { var cbs = reqs[key] var len = cbs.length var args = slice(arguments)
// XXX It's somewhat ambiguous whether a new callback added in this // pass should be queued for later execution if something in the // list of callbacks throws, or if it should just be discarded. // However, it's such an edge case that it hardly matters, and either // choice is likely as surprising as the other. // As it happens, we do go ahead and schedule it for later execution. try { for (var i = 0; i < len; i++) { cbs[i].apply(null, args) } } finally { if (cbs.length > len) { // added more in the interim. // de-zalgo, just in case, but don't call again. cbs.splice(0, len) process.nextTick(function () { RES.apply(null, args) }) } else { delete reqs[key] } } })}
function slice (args) { var length = args.length var array = []
for (var i = 0; i < length; i++) array[i] = args[i] return array}1231234567891011121314151617181920212223242526272829version https://git-lfs.github.com/spec/v1oid sha256:5f2489e13f73e9ebad999134fae8a591f6d8b58e8341ec8e3b33397c4d1ef817size 658{ "name": "inflight", "version": "1.0.6", "description": "Add callbacks to requests in flight to avoid async duplication", "main": "inflight.js", "files": [ "inflight.js" ], "dependencies": { "once": "^1.3.0", "wrappy": "1" }, "devDependencies": { "tap": "^7.1.2" }, "scripts": { "test": "tap test.js --100" }, "repository": { "type": "git", "url": "https://github.com/npm/inflight.git" }, "author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)", "bugs": { "url": "https://github.com/isaacs/inflight/issues" }, "homepage": "https://github.com/isaacs/inflight", "license": "ISC"}12312345678910111213141516version https://git-lfs.github.com/spec/v1oid sha256:5ffe28e7ade7d8f10d85d5337a73fd793dac5c462fb9a28fbf8c5046c7fbca3bsize 749The ISC License
Copyright (c) Isaac Z. Schlueter
Permission to use, copy, modify, and/or distribute this software for anypurpose with or without fee is hereby granted, provided that the abovecopyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITHREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY ANDFITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROMLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OROTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE ORPERFORMANCE OF THIS SOFTWARE.
123123456789101112131415161718192021222324252627282930313233343536373839404142version https://git-lfs.github.com/spec/v1oid sha256:b33c8be1ca837d9e4c9b0e04a550feacbc101556164d3cdbb875aed6ccbb8a29size 1625Browser-friendly inheritance fully compatible with standard node.js[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor).
This package exports standard `inherits` from node.js `util` module innode environment, but also provides alternative browser-friendlyimplementation through [browserfield](https://gist.github.com/shtylman/4339901). Alternativeimplementation is a literal copy of standard one located in standalonemodule to avoid requiring of `util`. It also has a shim for oldbrowsers with no `Object.create` support.
While keeping you sure you are using standard `inherits`implementation in node.js environment, it allows bundlers such as[browserify](https://github.com/substack/node-browserify) to notinclude full `util` package to your client code if all you need isjust `inherits` function. It worth, because browser shim for `util`package is large and `inherits` is often the single function you needfrom it.
It's recommended to use this package instead of`require('util').inherits` for any code that has chances to be usednot only in node.js but in browser too.
## usage
```jsvar inherits = require('inherits');// then use exactly as the standard one```
## note on version ~1.0
Version ~1.0 had completely different motivation and is not compatibleneither with 2.0 nor with standard node.js `inherits`.
If you are using version ~1.0 and planning to switch to ~2.0, becareful:
* new version uses `super_` instead of `super` for referencing superclass* new version overwrites current prototype while old one preserves any existing fields on itJava开发环境安装/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
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
Java开发环境安装/eclipse-jee-2024-06-R-win32-x86_64/eclipse/plugins/org.eclipse.wildwebdeveloper_1.2.2.202405280856/node_modules/immutable/dist/immutable.js
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