提交subgame插件
This commit is contained in:
201
node_modules/crc-32/LICENSE
generated
vendored
Normal file
201
node_modules/crc-32/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,201 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "{}"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright (C) 2014-present SheetJS LLC
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
200
node_modules/crc-32/README.md
generated
vendored
Normal file
200
node_modules/crc-32/README.md
generated
vendored
Normal file
@@ -0,0 +1,200 @@
|
||||
# crc32
|
||||
|
||||
Standard CRC-32 algorithm implementation in JS (for the browser and nodejs).
|
||||
Emphasis on correctness, performance, and IE6+ support.
|
||||
|
||||
## Installation
|
||||
|
||||
With [npm](https://www.npmjs.org/package/crc-32):
|
||||
|
||||
```bash
|
||||
$ npm install crc-32
|
||||
```
|
||||
|
||||
When installed globally, npm installs a script `crc32` that computes the
|
||||
checksum for a specified file or standard input.
|
||||
|
||||
<details>
|
||||
<summary><b>CDN Availability</b> (click to show)</summary>
|
||||
|
||||
| CDN | URL |
|
||||
|-----------:|:-------------------------------------------|
|
||||
| `unpkg` | <https://unpkg.com/crc-32/> |
|
||||
| `jsDelivr` | <https://jsdelivr.com/package/npm/crc-32> |
|
||||
| `CDNjs` | <https://cdnjs.com/libraries/crc-32> |
|
||||
|
||||
</details>
|
||||
|
||||
|
||||
## Integration
|
||||
|
||||
Using NodeJS or a bundler:
|
||||
|
||||
```js
|
||||
var CRC32 = require("crc-32");
|
||||
```
|
||||
|
||||
In the browser, the `crc32.js` script can be loaded directly:
|
||||
|
||||
```html
|
||||
<script src="crc32.js"></script>
|
||||
```
|
||||
|
||||
The browser script exposes a variable `CRC32`.
|
||||
|
||||
The script will manipulate `module.exports` if available . This is not always
|
||||
desirable. To prevent the behavior, define `DO_NOT_EXPORT_CRC`.
|
||||
|
||||
### CRC32C (Castagnoli)
|
||||
|
||||
The module and CDNs also include a parallel script for CRC32C calculations.
|
||||
|
||||
Using NodeJS or a bundler:
|
||||
|
||||
```js
|
||||
var CRC32C = require("crc-32/crc32c");
|
||||
```
|
||||
|
||||
In the browser, the `crc32c.js` script can be loaded directly:
|
||||
|
||||
```html
|
||||
<script src="crc32c.js"></script>
|
||||
```
|
||||
|
||||
The browser exposes a variable `CRC32C`.
|
||||
|
||||
The script will manipulate `module.exports` if available . This is not always
|
||||
desirable. To prevent the behavior, define `DO_NOT_EXPORT_CRC`.
|
||||
|
||||
## Usage
|
||||
|
||||
In all cases, the relevant function takes an argument representing data and an
|
||||
optional second argument representing the starting "seed" (for rolling CRC).
|
||||
|
||||
The return value is a signed 32-bit integer.
|
||||
|
||||
- `CRC32.buf(byte array or buffer[, seed])` assumes the argument is a sequence
|
||||
of 8-bit unsigned integers (nodejs `Buffer`, `Uint8Array` or array of bytes).
|
||||
|
||||
- `CRC32.bstr(binary string[, seed])` assumes the argument is a binary string
|
||||
where byte `i` is the low byte of the UCS-2 char: `str.charCodeAt(i) & 0xFF`
|
||||
|
||||
- `CRC32.str(string[, seed])` assumes the argument is a standard JS string and
|
||||
calculates the hash of the UTF-8 encoding.
|
||||
|
||||
For example:
|
||||
|
||||
```js
|
||||
// var CRC32 = require('crc-32'); // uncomment this line if in node
|
||||
CRC32.str("SheetJS") // -1647298270
|
||||
CRC32.bstr("SheetJS") // -1647298270
|
||||
CRC32.buf([ 83, 104, 101, 101, 116, 74, 83 ]) // -1647298270
|
||||
|
||||
crc32 = CRC32.buf([83, 104]) // -1826163454 "Sh"
|
||||
crc32 = CRC32.str("eet", crc32) // 1191034598 "Sheet"
|
||||
CRC32.bstr("JS", crc32) // -1647298270 "SheetJS"
|
||||
|
||||
[CRC32.str("\u2603"), CRC32.str("\u0003")] // [ -1743909036, 1259060791 ]
|
||||
[CRC32.bstr("\u2603"), CRC32.bstr("\u0003")] // [ 1259060791, 1259060791 ]
|
||||
[CRC32.buf([0x2603]), CRC32.buf([0x0003])] // [ 1259060791, 1259060791 ]
|
||||
|
||||
// var CRC32C = require('crc-32/crc32c'); // uncomment this line if in node
|
||||
CRC32C.str("SheetJS") // -284764294
|
||||
CRC32C.bstr("SheetJS") // -284764294
|
||||
CRC32C.buf([ 83, 104, 101, 101, 116, 74, 83 ]) // -284764294
|
||||
|
||||
crc32c = CRC32C.buf([83, 104]) // -297065629 "Sh"
|
||||
crc32c = CRC32C.str("eet", crc32c) // 1241364256 "Sheet"
|
||||
CRC32C.bstr("JS", crc32c) // -284764294 "SheetJS"
|
||||
|
||||
[CRC32C.str("\u2603"), CRC32C.str("\u0003")] // [ 1253703093, 1093509285 ]
|
||||
[CRC32C.bstr("\u2603"), CRC32C.bstr("\u0003")] // [ 1093509285, 1093509285 ]
|
||||
[CRC32C.buf([0x2603]), CRC32C.buf([0x0003])] // [ 1093509285, 1093509285 ]
|
||||
```
|
||||
|
||||
### Best Practices
|
||||
|
||||
Even though the initial seed is optional, for performance reasons it is highly
|
||||
recommended to explicitly pass the default seed 0.
|
||||
|
||||
In NodeJS with the native Buffer implementation, it is oftentimes faster to
|
||||
convert binary strings with `Buffer.from(bstr, "binary")` first:
|
||||
|
||||
```js
|
||||
/* Frequently slower in NodeJS */
|
||||
crc32 = CRC32.bstr(bstr, 0);
|
||||
/* Frequently faster in NodeJS */
|
||||
crc32 = CRC32.buf(Buffer.from(bstr, "binary"), 0);
|
||||
```
|
||||
|
||||
This does not apply to browser `Buffer` shims, and thus is not implemented in
|
||||
the library directly.
|
||||
|
||||
## Testing
|
||||
|
||||
`make test` will run the nodejs-based test.
|
||||
|
||||
To run the in-browser tests, run a local server and go to the `ctest` directory.
|
||||
`make ctestserv` will start a python `SimpleHTTPServer` server on port 8000.
|
||||
|
||||
To update the browser artifacts, run `make ctest`.
|
||||
|
||||
To generate the bits file, use the `crc32` function from python `zlib`:
|
||||
|
||||
```python
|
||||
>>> from zlib import crc32
|
||||
>>> x="foo bar baz٪☃🍣"
|
||||
>>> crc32(x)
|
||||
1531648243
|
||||
>>> crc32(x+x)
|
||||
-218791105
|
||||
>>> crc32(x+x+x)
|
||||
1834240887
|
||||
```
|
||||
|
||||
The included `crc32.njs` script can process files or standard input:
|
||||
|
||||
```bash
|
||||
$ echo "this is a test" > t.txt
|
||||
$ bin/crc32.njs t.txt
|
||||
1912935186
|
||||
```
|
||||
|
||||
For comparison, the included `crc32.py` script uses python `zlib`:
|
||||
|
||||
```bash
|
||||
$ bin/crc32.py t.txt
|
||||
1912935186
|
||||
```
|
||||
|
||||
On OSX the command `cksum` generates unsigned CRC-32 with Algorithm 3:
|
||||
|
||||
```bash
|
||||
$ cksum -o 3 < IE8.Win7.For.Windows.VMware.zip
|
||||
1891069052 4161613172
|
||||
$ crc32 --unsigned ~/Downloads/IE8.Win7.For.Windows.VMware.zip
|
||||
1891069052
|
||||
```
|
||||
|
||||
## Performance
|
||||
|
||||
`make perf` will run algorithmic performance tests (which should justify certain
|
||||
decisions in the code).
|
||||
|
||||
The [`adler-32` project](http://git.io/adler32) has more performance notes
|
||||
|
||||
## License
|
||||
|
||||
Please consult the attached LICENSE file for details. All rights not explicitly
|
||||
granted by the Apache 2.0 license are reserved by the Original Author.
|
||||
|
||||
## Badges
|
||||
|
||||
[](https://saucelabs.com/u/crc32)
|
||||
|
||||
[](https://travis-ci.org/SheetJS/js-crc32)
|
||||
[](https://coveralls.io/r/SheetJS/js-crc32?branch=master)
|
||||
[](https://david-dm.org/sheetjs/js-crc32)
|
||||
[](https://npmjs.org/package/crc-32)
|
||||
[](https://ghit.me/repo/sheetjs/js-xlsx)
|
||||
[](https://github.com/SheetJS/js-crc32)
|
||||
90
node_modules/crc-32/bin/crc32.njs
generated
vendored
Normal file
90
node_modules/crc-32/bin/crc32.njs
generated
vendored
Normal file
@@ -0,0 +1,90 @@
|
||||
#!/usr/bin/env node
|
||||
/* crc32.js (C) 2014-present SheetJS -- http://sheetjs.com */
|
||||
/* eslint-env node */
|
||||
/* vim: set ts=2 ft=javascript: */
|
||||
/*jshint node:true */
|
||||
|
||||
var X/*:CRC32Module*/;
|
||||
try { X = require('../'); } catch(e) { X = require('crc-32'); }
|
||||
|
||||
function help()/*:number*/ {
|
||||
[
|
||||
"usage: crc32 [options] [filename]",
|
||||
"",
|
||||
"Options:",
|
||||
" -h, --help output usage information",
|
||||
" -V, --version output the version number",
|
||||
" -S, --seed=<n> use integer seed as starting value (rolling CRC)",
|
||||
" -H, --hex-seed=<h> use hex seed as starting value (rolling CRC)",
|
||||
" -d, --signed print result with format `%d` (default)",
|
||||
" -u, --unsigned print result with format `%u`",
|
||||
" -x, --hex print result with format `%0.8x`",
|
||||
" -X, --HEX print result with format `%0.8X`",
|
||||
" -c, --crc32c use CRC32C (Castagnoli)",
|
||||
" -F, --format=<s> use specified printf format",
|
||||
"",
|
||||
"Set filename = '-' or pipe data into crc32 to read from stdin",
|
||||
"Default output mode is signed (-d)",
|
||||
""
|
||||
].forEach(function(l) { console.log(l); });
|
||||
return 0;
|
||||
}
|
||||
|
||||
function version()/*:number*/ { console.log(X.version); return 0; }
|
||||
|
||||
var fs = require('fs');
|
||||
require('exit-on-epipe');
|
||||
|
||||
function die(msg/*:string*/, ec/*:?number*/)/*:void*/ { console.error(msg); process.exit(ec || 0); }
|
||||
|
||||
var args/*:Array<string>*/ = process.argv.slice(2);
|
||||
var filename/*:string*/ = "";
|
||||
var fmt/*:string*/ = "";
|
||||
var seed = 0, r = 10;
|
||||
|
||||
for(var i = 0; i < args.length; ++i) {
|
||||
var arg = args[i];
|
||||
if(arg.charCodeAt(0) != 45) { if(filename === "") filename = arg; continue; }
|
||||
var m = arg.indexOf("=") == -1 ? arg : arg.substr(0, arg.indexOf("="));
|
||||
switch(m) {
|
||||
case "-": filename = "-"; break;
|
||||
|
||||
case "--help": case "-h": process.exit(help()); break;
|
||||
case "--version": case "-V": process.exit(version()); break;
|
||||
|
||||
case "--crc32c": case "-c": try { X = require('../crc32c'); } catch(e) { X = require('crc-32/crc32c'); } break;
|
||||
|
||||
case "--signed": case "-d": fmt = "%d"; break;
|
||||
case "--unsigned": case "-u": fmt = "%u"; break;
|
||||
case "--hex": case "-x": fmt = "%0.8x"; break;
|
||||
case "--HEX": case "-X": fmt = "%0.8X"; break;
|
||||
case "--format": case "-F":
|
||||
fmt = ((m!=arg) ? arg.substr(m.length+1) : args[++i])||""; break;
|
||||
|
||||
case "--hex-seed": case "-H": r = 16;
|
||||
/* falls through */
|
||||
case "--seed": case "-S":
|
||||
seed=parseInt((m!=arg) ? arg.substr(m.length+1) : args[++i], r)||0; break;
|
||||
|
||||
default: die("crc32: unrecognized option `" + arg + "'", 22);
|
||||
}
|
||||
}
|
||||
|
||||
if(!process.stdin.isTTY) filename = filename || "-";
|
||||
if(filename.length===0) die("crc32: must specify a filename ('-' for stdin)",1);
|
||||
|
||||
var crc32 = seed;
|
||||
// $FlowIgnore -- Writable is callable but type sig disagrees
|
||||
var writable = require('stream').Writable();
|
||||
writable._write = function(chunk, e, cb) { crc32 = X.buf(chunk, crc32); cb(); };
|
||||
writable._writev = function(chunks, cb) {
|
||||
chunks.forEach(function(c) { crc32 = X.buf(c.chunk, crc32);});
|
||||
cb();
|
||||
};
|
||||
writable.on('finish', function() {
|
||||
console.log(fmt === "" ? crc32 : require("printj").sprintf(fmt, crc32));
|
||||
});
|
||||
|
||||
if(filename === "-") process.stdin.pipe(writable);
|
||||
else if(fs.existsSync(filename)) fs.createReadStream(filename).pipe(writable);
|
||||
else die("crc32: " + filename + ": No such file or directory", 2);
|
||||
115
node_modules/crc-32/crc32.js
generated
vendored
Normal file
115
node_modules/crc-32/crc32.js
generated
vendored
Normal file
@@ -0,0 +1,115 @@
|
||||
/*! crc32.js (C) 2014-present SheetJS -- http://sheetjs.com */
|
||||
/* vim: set ts=2: */
|
||||
/*exported CRC32 */
|
||||
var CRC32;
|
||||
(function (factory) {
|
||||
/*jshint ignore:start */
|
||||
/*eslint-disable */
|
||||
if(typeof DO_NOT_EXPORT_CRC === 'undefined') {
|
||||
if('object' === typeof exports) {
|
||||
factory(exports);
|
||||
} else if ('function' === typeof define && define.amd) {
|
||||
define(function () {
|
||||
var module = {};
|
||||
factory(module);
|
||||
return module;
|
||||
});
|
||||
} else {
|
||||
factory(CRC32 = {});
|
||||
}
|
||||
} else {
|
||||
factory(CRC32 = {});
|
||||
}
|
||||
/*eslint-enable */
|
||||
/*jshint ignore:end */
|
||||
}(function(CRC32) {
|
||||
CRC32.version = '1.2.1';
|
||||
/*global Int32Array */
|
||||
function signed_crc_table() {
|
||||
var c = 0, table = new Array(256);
|
||||
|
||||
for(var n =0; n != 256; ++n){
|
||||
c = n;
|
||||
c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));
|
||||
c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));
|
||||
c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));
|
||||
c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));
|
||||
c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));
|
||||
c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));
|
||||
c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));
|
||||
c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));
|
||||
table[n] = c;
|
||||
}
|
||||
|
||||
return typeof Int32Array !== 'undefined' ? new Int32Array(table) : table;
|
||||
}
|
||||
|
||||
var T0 = signed_crc_table();
|
||||
function slice_by_16_tables(T) {
|
||||
var c = 0, v = 0, n = 0, table = typeof Int32Array !== 'undefined' ? new Int32Array(4096) : new Array(4096) ;
|
||||
|
||||
for(n = 0; n != 256; ++n) table[n] = T[n];
|
||||
for(n = 0; n != 256; ++n) {
|
||||
v = T[n];
|
||||
for(c = 256 + n; c < 4096; c += 256) v = table[c] = (v >>> 8) ^ T[v & 0xFF];
|
||||
}
|
||||
var out = [];
|
||||
for(n = 1; n != 16; ++n) out[n - 1] = typeof Int32Array !== 'undefined' ? table.subarray(n * 256, n * 256 + 256) : table.slice(n * 256, n * 256 + 256);
|
||||
return out;
|
||||
}
|
||||
var TT = slice_by_16_tables(T0);
|
||||
var T1 = TT[0], T2 = TT[1], T3 = TT[2], T4 = TT[3], T5 = TT[4];
|
||||
var T6 = TT[5], T7 = TT[6], T8 = TT[7], T9 = TT[8], Ta = TT[9];
|
||||
var Tb = TT[10], Tc = TT[11], Td = TT[12], Te = TT[13], Tf = TT[14];
|
||||
function crc32_bstr(bstr, seed) {
|
||||
var C = seed ^ -1;
|
||||
for(var i = 0, L = bstr.length; i < L;) C = (C>>>8) ^ T0[(C^bstr.charCodeAt(i++))&0xFF];
|
||||
return ~C;
|
||||
}
|
||||
|
||||
function crc32_buf(B, seed) {
|
||||
var C = seed ^ -1, L = B.length - 15, i = 0;
|
||||
for(; i < L;) C =
|
||||
Tf[B[i++] ^ (C & 255)] ^
|
||||
Te[B[i++] ^ ((C >> 8) & 255)] ^
|
||||
Td[B[i++] ^ ((C >> 16) & 255)] ^
|
||||
Tc[B[i++] ^ (C >>> 24)] ^
|
||||
Tb[B[i++]] ^ Ta[B[i++]] ^ T9[B[i++]] ^ T8[B[i++]] ^
|
||||
T7[B[i++]] ^ T6[B[i++]] ^ T5[B[i++]] ^ T4[B[i++]] ^
|
||||
T3[B[i++]] ^ T2[B[i++]] ^ T1[B[i++]] ^ T0[B[i++]];
|
||||
L += 15;
|
||||
while(i < L) C = (C>>>8) ^ T0[(C^B[i++])&0xFF];
|
||||
return ~C;
|
||||
}
|
||||
|
||||
function crc32_str(str, seed) {
|
||||
var C = seed ^ -1;
|
||||
for(var i = 0, L = str.length, c = 0, d = 0; i < L;) {
|
||||
c = str.charCodeAt(i++);
|
||||
if(c < 0x80) {
|
||||
C = (C>>>8) ^ T0[(C^c)&0xFF];
|
||||
} else if(c < 0x800) {
|
||||
C = (C>>>8) ^ T0[(C ^ (192|((c>>6)&31)))&0xFF];
|
||||
C = (C>>>8) ^ T0[(C ^ (128|(c&63)))&0xFF];
|
||||
} else if(c >= 0xD800 && c < 0xE000) {
|
||||
c = (c&1023)+64; d = str.charCodeAt(i++)&1023;
|
||||
C = (C>>>8) ^ T0[(C ^ (240|((c>>8)&7)))&0xFF];
|
||||
C = (C>>>8) ^ T0[(C ^ (128|((c>>2)&63)))&0xFF];
|
||||
C = (C>>>8) ^ T0[(C ^ (128|((d>>6)&15)|((c&3)<<4)))&0xFF];
|
||||
C = (C>>>8) ^ T0[(C ^ (128|(d&63)))&0xFF];
|
||||
} else {
|
||||
C = (C>>>8) ^ T0[(C ^ (224|((c>>12)&15)))&0xFF];
|
||||
C = (C>>>8) ^ T0[(C ^ (128|((c>>6)&63)))&0xFF];
|
||||
C = (C>>>8) ^ T0[(C ^ (128|(c&63)))&0xFF];
|
||||
}
|
||||
}
|
||||
return ~C;
|
||||
}
|
||||
CRC32.table = T0;
|
||||
// $FlowIgnore
|
||||
CRC32.bstr = crc32_bstr;
|
||||
// $FlowIgnore
|
||||
CRC32.buf = crc32_buf;
|
||||
// $FlowIgnore
|
||||
CRC32.str = crc32_str;
|
||||
}));
|
||||
115
node_modules/crc-32/crc32c.js
generated
vendored
Normal file
115
node_modules/crc-32/crc32c.js
generated
vendored
Normal file
@@ -0,0 +1,115 @@
|
||||
/*! crc32.js (C) 2014-present SheetJS -- http://sheetjs.com */
|
||||
/* vim: set ts=2: */
|
||||
/*exported CRC32C */
|
||||
var CRC32C;
|
||||
(function (factory) {
|
||||
/*jshint ignore:start */
|
||||
/*eslint-disable */
|
||||
if(typeof DO_NOT_EXPORT_CRC === 'undefined') {
|
||||
if('object' === typeof exports) {
|
||||
factory(exports);
|
||||
} else if ('function' === typeof define && define.amd) {
|
||||
define(function () {
|
||||
var module = {};
|
||||
factory(module);
|
||||
return module;
|
||||
});
|
||||
} else {
|
||||
factory(CRC32C = {});
|
||||
}
|
||||
} else {
|
||||
factory(CRC32C = {});
|
||||
}
|
||||
/*eslint-enable */
|
||||
/*jshint ignore:end */
|
||||
}(function(CRC32C) {
|
||||
CRC32C.version = '1.2.1';
|
||||
/*global Int32Array */
|
||||
function signed_crc_table() {
|
||||
var c = 0, table = new Array(256);
|
||||
|
||||
for(var n =0; n != 256; ++n){
|
||||
c = n;
|
||||
c = ((c&1) ? (-2097792136 ^ (c >>> 1)) : (c >>> 1));
|
||||
c = ((c&1) ? (-2097792136 ^ (c >>> 1)) : (c >>> 1));
|
||||
c = ((c&1) ? (-2097792136 ^ (c >>> 1)) : (c >>> 1));
|
||||
c = ((c&1) ? (-2097792136 ^ (c >>> 1)) : (c >>> 1));
|
||||
c = ((c&1) ? (-2097792136 ^ (c >>> 1)) : (c >>> 1));
|
||||
c = ((c&1) ? (-2097792136 ^ (c >>> 1)) : (c >>> 1));
|
||||
c = ((c&1) ? (-2097792136 ^ (c >>> 1)) : (c >>> 1));
|
||||
c = ((c&1) ? (-2097792136 ^ (c >>> 1)) : (c >>> 1));
|
||||
table[n] = c;
|
||||
}
|
||||
|
||||
return typeof Int32Array !== 'undefined' ? new Int32Array(table) : table;
|
||||
}
|
||||
|
||||
var T0 = signed_crc_table();
|
||||
function slice_by_16_tables(T) {
|
||||
var c = 0, v = 0, n = 0, table = typeof Int32Array !== 'undefined' ? new Int32Array(4096) : new Array(4096) ;
|
||||
|
||||
for(n = 0; n != 256; ++n) table[n] = T[n];
|
||||
for(n = 0; n != 256; ++n) {
|
||||
v = T[n];
|
||||
for(c = 256 + n; c < 4096; c += 256) v = table[c] = (v >>> 8) ^ T[v & 0xFF];
|
||||
}
|
||||
var out = [];
|
||||
for(n = 1; n != 16; ++n) out[n - 1] = typeof Int32Array !== 'undefined' ? table.subarray(n * 256, n * 256 + 256) : table.slice(n * 256, n * 256 + 256);
|
||||
return out;
|
||||
}
|
||||
var TT = slice_by_16_tables(T0);
|
||||
var T1 = TT[0], T2 = TT[1], T3 = TT[2], T4 = TT[3], T5 = TT[4];
|
||||
var T6 = TT[5], T7 = TT[6], T8 = TT[7], T9 = TT[8], Ta = TT[9];
|
||||
var Tb = TT[10], Tc = TT[11], Td = TT[12], Te = TT[13], Tf = TT[14];
|
||||
function crc32_bstr(bstr, seed) {
|
||||
var C = seed ^ -1;
|
||||
for(var i = 0, L = bstr.length; i < L;) C = (C>>>8) ^ T0[(C^bstr.charCodeAt(i++))&0xFF];
|
||||
return ~C;
|
||||
}
|
||||
|
||||
function crc32_buf(B, seed) {
|
||||
var C = seed ^ -1, L = B.length - 15, i = 0;
|
||||
for(; i < L;) C =
|
||||
Tf[B[i++] ^ (C & 255)] ^
|
||||
Te[B[i++] ^ ((C >> 8) & 255)] ^
|
||||
Td[B[i++] ^ ((C >> 16) & 255)] ^
|
||||
Tc[B[i++] ^ (C >>> 24)] ^
|
||||
Tb[B[i++]] ^ Ta[B[i++]] ^ T9[B[i++]] ^ T8[B[i++]] ^
|
||||
T7[B[i++]] ^ T6[B[i++]] ^ T5[B[i++]] ^ T4[B[i++]] ^
|
||||
T3[B[i++]] ^ T2[B[i++]] ^ T1[B[i++]] ^ T0[B[i++]];
|
||||
L += 15;
|
||||
while(i < L) C = (C>>>8) ^ T0[(C^B[i++])&0xFF];
|
||||
return ~C;
|
||||
}
|
||||
|
||||
function crc32_str(str, seed) {
|
||||
var C = seed ^ -1;
|
||||
for(var i = 0, L = str.length, c = 0, d = 0; i < L;) {
|
||||
c = str.charCodeAt(i++);
|
||||
if(c < 0x80) {
|
||||
C = (C>>>8) ^ T0[(C^c)&0xFF];
|
||||
} else if(c < 0x800) {
|
||||
C = (C>>>8) ^ T0[(C ^ (192|((c>>6)&31)))&0xFF];
|
||||
C = (C>>>8) ^ T0[(C ^ (128|(c&63)))&0xFF];
|
||||
} else if(c >= 0xD800 && c < 0xE000) {
|
||||
c = (c&1023)+64; d = str.charCodeAt(i++)&1023;
|
||||
C = (C>>>8) ^ T0[(C ^ (240|((c>>8)&7)))&0xFF];
|
||||
C = (C>>>8) ^ T0[(C ^ (128|((c>>2)&63)))&0xFF];
|
||||
C = (C>>>8) ^ T0[(C ^ (128|((d>>6)&15)|((c&3)<<4)))&0xFF];
|
||||
C = (C>>>8) ^ T0[(C ^ (128|(d&63)))&0xFF];
|
||||
} else {
|
||||
C = (C>>>8) ^ T0[(C ^ (224|((c>>12)&15)))&0xFF];
|
||||
C = (C>>>8) ^ T0[(C ^ (128|((c>>6)&63)))&0xFF];
|
||||
C = (C>>>8) ^ T0[(C ^ (128|(c&63)))&0xFF];
|
||||
}
|
||||
}
|
||||
return ~C;
|
||||
}
|
||||
CRC32C.table = T0;
|
||||
// $FlowIgnore
|
||||
CRC32C.bstr = crc32_bstr;
|
||||
// $FlowIgnore
|
||||
CRC32C.buf = crc32_buf;
|
||||
// $FlowIgnore
|
||||
CRC32C.str = crc32_str;
|
||||
}));
|
||||
12
node_modules/crc-32/node_modules/.bin/printj
generated
vendored
Normal file
12
node_modules/crc-32/node_modules/.bin/printj
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
exec "$basedir/node" "$basedir/../printj/bin/printj.njs" "$@"
|
||||
else
|
||||
exec node "$basedir/../printj/bin/printj.njs" "$@"
|
||||
fi
|
||||
17
node_modules/crc-32/node_modules/.bin/printj.cmd
generated
vendored
Normal file
17
node_modules/crc-32/node_modules/.bin/printj.cmd
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
@ECHO off
|
||||
GOTO start
|
||||
:find_dp0
|
||||
SET dp0=%~dp0
|
||||
EXIT /b
|
||||
:start
|
||||
SETLOCAL
|
||||
CALL :find_dp0
|
||||
|
||||
IF EXIST "%dp0%\node.exe" (
|
||||
SET "_prog=%dp0%\node.exe"
|
||||
) ELSE (
|
||||
SET "_prog=node"
|
||||
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
)
|
||||
|
||||
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\printj\bin\printj.njs" %*
|
||||
28
node_modules/crc-32/node_modules/.bin/printj.ps1
generated
vendored
Normal file
28
node_modules/crc-32/node_modules/.bin/printj.ps1
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env pwsh
|
||||
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||
|
||||
$exe=""
|
||||
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||
# Fix case when both the Windows and Linux builds of Node
|
||||
# are installed in the same directory
|
||||
$exe=".exe"
|
||||
}
|
||||
$ret=0
|
||||
if (Test-Path "$basedir/node$exe") {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "$basedir/node$exe" "$basedir/../printj/bin/printj.njs" $args
|
||||
} else {
|
||||
& "$basedir/node$exe" "$basedir/../printj/bin/printj.njs" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
} else {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "node$exe" "$basedir/../printj/bin/printj.njs" $args
|
||||
} else {
|
||||
& "node$exe" "$basedir/../printj/bin/printj.njs" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
}
|
||||
exit $ret
|
||||
201
node_modules/crc-32/node_modules/printj/LICENSE
generated
vendored
Normal file
201
node_modules/crc-32/node_modules/printj/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,201 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "{}"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright (C) 2016-present SheetJS LLC
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
1095
node_modules/crc-32/node_modules/printj/README.md
generated
vendored
Normal file
1095
node_modules/crc-32/node_modules/printj/README.md
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
65
node_modules/crc-32/node_modules/printj/bin/printj.njs
generated
vendored
Normal file
65
node_modules/crc-32/node_modules/printj/bin/printj.njs
generated
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
#!/usr/bin/env node
|
||||
/* printj.js (C) 2016-present SheetJS -- https://sheetjs.com */
|
||||
/* eslint-env node */
|
||||
/* vim: set ts=2 ft=javascript: */
|
||||
/*jshint node:true, evil:true */
|
||||
require("../shim");
|
||||
var X = require("../"), argv = process.argv;
|
||||
|
||||
function help() {
|
||||
[
|
||||
"usage: printj [options] <format> [args...]",
|
||||
"",
|
||||
"Options:",
|
||||
" -h, --help output usage information",
|
||||
" -d, --dump print debug information about format string",
|
||||
"",
|
||||
"Arguments are treated as strings unless prefaced by a type indicator:",
|
||||
" n:<integer> call parseInt (ex. n:3 -> 3)",
|
||||
" f:<float> call parseFloat (ex. f:3.1 -> 3.1)",
|
||||
' b:<boolean> false when lowercase value is "FALSE" or "0", else true',
|
||||
" s:<string> interpret as string (ex. s:n:3 -> \"n:3\")",
|
||||
" j:<JSON> interpret as an object using JSON.parse",
|
||||
" e:<JS> evaluate argument (ex. e:1+1 -> 2, e:\"1\"+1 -> \"11\")",
|
||||
"",
|
||||
"samples:",
|
||||
" $ printj '|%02hhx%d|' n:50 e:0x7B # |32123|",
|
||||
" $ printj '|%2$d + %3$d is %1$d|' e:1+2 n:1 n:2 # |1 + 2 is 3| ",
|
||||
" $ printj '|%s is %s|' s:1+2 e:1+2 # |1+2 is 3|",
|
||||
" $ printj '|%c %c|' s:69 n:69 # |6 E|",
|
||||
"",
|
||||
"Web Demo: https://oss.sheetjs.com/printj/"
|
||||
].forEach(function(l) { console.log(l); });
|
||||
return 0;
|
||||
}
|
||||
|
||||
function parse_arg(arg/*:string*/)/*:any*/ {
|
||||
var m = arg.substr(2), p/*:number*/ = 0;
|
||||
if(arg.charCodeAt(1) === 58) switch((p = arg.charCodeAt(0))) {
|
||||
case /*n*/ 110: return parseInt(m, 10);
|
||||
case /*f*/ 102: return parseFloat(m);
|
||||
case /*b*/ 98: return !(m.toUpperCase() === "FALSE" || m === "0");
|
||||
case /*j*/ 106: return JSON.parse(m);
|
||||
case /*e*/ 101: return eval(m);
|
||||
case /*s*/ 115: return m;
|
||||
}
|
||||
void p;
|
||||
return arg;
|
||||
}
|
||||
|
||||
var args/*:Array<any>*/ = [];
|
||||
var fmt = "", n = 0;
|
||||
for(var i = 2; i < argv.length; ++i) switch(argv[i]) {
|
||||
case "--help": case "-h": process.exit(help()); break;
|
||||
case "--dump": case "-d": if(fmt.length===0) fmt = argv[++i]; process.exit(dump(fmt)); break;
|
||||
default: if(n++ === 0) fmt = argv[i]; else args.push(parse_arg(argv[i]));
|
||||
}
|
||||
|
||||
console.log(X.vsprintf(fmt, args));
|
||||
process.exit(0);
|
||||
|
||||
function dump(fmt/*:string*/)/*:number*/ {
|
||||
if(!fmt) { console.error("printj: missing format argument"); return 1; }
|
||||
X._tokenize(fmt).forEach(function(x){console.log(x);});
|
||||
return 0;
|
||||
}
|
||||
201
node_modules/crc-32/node_modules/printj/dist/LICENSE
generated
vendored
Normal file
201
node_modules/crc-32/node_modules/printj/dist/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,201 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "{}"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright (C) 2016-present SheetJS LLC
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
602
node_modules/crc-32/node_modules/printj/dist/printj.js
generated
vendored
Normal file
602
node_modules/crc-32/node_modules/printj/dist/printj.js
generated
vendored
Normal file
@@ -0,0 +1,602 @@
|
||||
/* printj.js (C) 2016-present SheetJS -- http://sheetjs.com */
|
||||
/* vim: set ts=2: */
|
||||
/*jshint sub:true, eqnull:true */
|
||||
/*exported PRINTJ */
|
||||
var PRINTJ;
|
||||
(function (factory) {
|
||||
/*jshint ignore:start */
|
||||
/*eslint-disable */
|
||||
if(typeof DO_NOT_EXPORT_PRINTJ === 'undefined') {
|
||||
if('object' === typeof exports) {
|
||||
factory(exports);
|
||||
} else if ('function' === typeof define && define.amd) {
|
||||
define(function () {
|
||||
var module = {};
|
||||
factory(module);
|
||||
return module;
|
||||
});
|
||||
} else {
|
||||
factory(PRINTJ = {});
|
||||
}
|
||||
} else {
|
||||
factory(PRINTJ = {});
|
||||
}
|
||||
/*eslint-enable */
|
||||
/*jshint ignore:end */
|
||||
}(function(PRINTJ) {
|
||||
|
||||
PRINTJ.version = '1.3.1';
|
||||
|
||||
var tcache = {};
|
||||
|
||||
function tokenize(fmt) {
|
||||
if(tcache[fmt]) return tcache[fmt];
|
||||
var out = [];
|
||||
var start = 0;
|
||||
|
||||
var i = 0;
|
||||
var infmt = false;
|
||||
var fmtparam = "", fmtflags = "", fmtwidth = "", fmtprec = "", fmtlen = "";
|
||||
|
||||
var c = 0;
|
||||
|
||||
var L = fmt.length;
|
||||
|
||||
for(; i < L; ++i) {
|
||||
c = fmt.charCodeAt(i);
|
||||
if(!infmt) {
|
||||
|
||||
if(c !== 37) continue;
|
||||
|
||||
if(start < i) out.push(["L", fmt.substring(start, i)]);
|
||||
start = i;
|
||||
infmt = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
if(c >= 48 && c < 58) {
|
||||
if(fmtprec.length) fmtprec += String.fromCharCode(c);
|
||||
else if(c == 48 && !fmtwidth.length) fmtflags += String.fromCharCode(c);
|
||||
else fmtwidth += String.fromCharCode(c);
|
||||
} else switch(c) {
|
||||
/* positional */
|
||||
case 36:
|
||||
if(fmtprec.length) fmtprec += "$";
|
||||
else if(fmtwidth.charAt(0) == "*") fmtwidth += "$";
|
||||
else { fmtparam = fmtwidth + "$"; fmtwidth = ""; }
|
||||
break;
|
||||
|
||||
/* flags */
|
||||
case 39: fmtflags += "'"; break;
|
||||
case 45: fmtflags += "-"; break;
|
||||
case 43: fmtflags += "+"; break;
|
||||
case 32: fmtflags += " "; break;
|
||||
case 35: fmtflags += "#"; break;
|
||||
|
||||
/* width and precision */
|
||||
case 46: fmtprec = "."; break;
|
||||
case 42:
|
||||
if(fmtprec.charAt(0) == ".") fmtprec += "*";
|
||||
else fmtwidth += "*";
|
||||
break;
|
||||
|
||||
/* length */
|
||||
case 104:
|
||||
case 108:
|
||||
if(fmtlen.length > 1) throw "bad length " + fmtlen + String(c);
|
||||
fmtlen += String.fromCharCode(c);
|
||||
break;
|
||||
|
||||
case 76:
|
||||
case 106:
|
||||
case 122:
|
||||
case 116:
|
||||
case 113:
|
||||
case 90:
|
||||
case 119:
|
||||
if(fmtlen !== "") throw "bad length " + fmtlen + String.fromCharCode(c);
|
||||
fmtlen = String.fromCharCode(c);
|
||||
break;
|
||||
|
||||
case 73:
|
||||
if(fmtlen !== "") throw "bad length " + fmtlen + 'I';
|
||||
fmtlen = 'I';
|
||||
break;
|
||||
|
||||
/* conversion */
|
||||
case 100:
|
||||
case 105:
|
||||
case 111:
|
||||
case 117:
|
||||
case 120:
|
||||
case 88:
|
||||
case 102:
|
||||
case 70:
|
||||
case 101:
|
||||
case 69:
|
||||
case 103:
|
||||
case 71:
|
||||
case 97:
|
||||
case 65:
|
||||
case 99:
|
||||
case 67:
|
||||
case 115:
|
||||
case 83:
|
||||
case 112:
|
||||
case 110:
|
||||
case 68:
|
||||
case 85:
|
||||
case 79:
|
||||
case 109:
|
||||
case 98:
|
||||
case 66:
|
||||
case 121:
|
||||
case 89:
|
||||
case 74:
|
||||
case 86:
|
||||
case 84:
|
||||
case 37:
|
||||
infmt = false;
|
||||
if(fmtprec.length > 1) fmtprec = fmtprec.substr(1);
|
||||
out.push([String.fromCharCode(c), fmt.substring(start, i+1), fmtparam, fmtflags, fmtwidth, fmtprec, fmtlen]);
|
||||
start = i+1;
|
||||
fmtlen = fmtprec = fmtwidth = fmtflags = fmtparam = "";
|
||||
break;
|
||||
default:
|
||||
throw new Error("Invalid format string starting with |" + fmt.substring(start, i+1) + "|");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(start < fmt.length) out.push(["L", fmt.substring(start)]);
|
||||
return (tcache[fmt] = out);
|
||||
}
|
||||
|
||||
/*global process:true, util:true, require:true */
|
||||
if(typeof process !== 'undefined' && !!process.versions && !!process.versions.node) util=require("util");
|
||||
var u_inspect = (typeof util != 'undefined') ? util.inspect : JSON.stringify;
|
||||
|
||||
function doit(t, args) {
|
||||
//var o = [];
|
||||
var o = "";
|
||||
var argidx = 0, idx = 0;
|
||||
var Vnum = 0;
|
||||
var pad = "";
|
||||
for(var i = 0; i < t.length; ++i) {
|
||||
var m = t[i], c = (m[0]).charCodeAt(0);
|
||||
/* m order: conv full param flags width prec length */
|
||||
|
||||
if(c === /*L*/ 76) { o += /*o.push*/(m[1]); continue; }
|
||||
if(c === /*%*/ 37) { o += /*o.push*/("%"); continue; }
|
||||
|
||||
var O = "";
|
||||
var isnum = 0, radix = 10, bytes = 4, sign = false;
|
||||
|
||||
/* flags */
|
||||
var flags = m[3]/*||""*/;
|
||||
var alt = flags.indexOf("#") > -1;
|
||||
|
||||
/* position */
|
||||
if(m[2]) argidx = parseInt(m[2], 10)-1;
|
||||
/* %m special case */
|
||||
else if(c === /*m*/ 109 && !alt) { o += /*.push*/("Success"); continue; }
|
||||
|
||||
/* grab width */
|
||||
var width = 0; if( m[ 4].length > 0) { if(m[ 4].charAt(0) !== '*') width = parseInt(m[ 4], 10); else if(m[ 4].length === 1) width = args[idx++]; else width = args[parseInt(m[ 4].substr(1), 10)-1]; }
|
||||
|
||||
/* grab precision */
|
||||
var prec = -1; if( m[ 5].length > 0) { if(m[ 5].charAt(0) !== '*') prec = parseInt(m[ 5], 10); else if(m[ 5].length === 1) prec = args[idx++]; else prec = args[parseInt(m[ 5].substr(1), 10)-1]; }
|
||||
|
||||
/* position not specified */
|
||||
if(!m[2]) argidx = idx++;
|
||||
|
||||
/* grab argument */
|
||||
var arg = args[argidx];
|
||||
|
||||
/* grab length */
|
||||
var len = m[6]/* || ""*/;
|
||||
|
||||
switch(c) {
|
||||
/* str cCsS */
|
||||
|
||||
case /*S*/ 83:
|
||||
case /*s*/ 115:
|
||||
/* only valid flag is "-" for left justification */
|
||||
O = String(arg);
|
||||
if( prec >= 0) O = O.substr(0, prec);
|
||||
if( width > O.length || - width > O.length) { if(( flags.indexOf("-") == -1 || width < 0) && flags.indexOf("0") != -1) { pad = ( width - O.length >= 0 ? "0".repeat( width - O.length) : ""); O = pad + O; } else { pad = ( width - O.length >= 0 ? " ".repeat( width - O.length) : ""); O = flags.indexOf("-") > -1 ? O + pad : pad + O; } }
|
||||
break;
|
||||
|
||||
/* first char of string or convert */
|
||||
case /*C*/ 67:
|
||||
case /*c*/ 99:
|
||||
switch(typeof arg) {
|
||||
case "number":
|
||||
var cc = arg;
|
||||
if(c == 67 || len.charCodeAt(0) === /*l*/ 108) { cc &= 0xFFFFFFFF; O = String.fromCharCode( cc); }
|
||||
else { cc &= 0xFF; O = String.fromCharCode( cc); }
|
||||
break;
|
||||
case "string": O = arg.charAt(0); break;
|
||||
default: O = String(arg).charAt(0);
|
||||
}
|
||||
if( width > O.length || - width > O.length) { if(( flags.indexOf("-") == -1 || width < 0) && flags.indexOf("0") != -1) { pad = ( width - O.length >= 0 ? "0".repeat( width - O.length) : ""); O = pad + O; } else { pad = ( width - O.length >= 0 ? " ".repeat( width - O.length) : ""); O = flags.indexOf("-") > -1 ? O + pad : pad + O; } }
|
||||
break;
|
||||
|
||||
/* int diDuUoOxXbB */
|
||||
|
||||
/* signed integer */
|
||||
case /*D*/ 68: bytes = 8;
|
||||
/* falls through */
|
||||
case /*d*/ 100:
|
||||
case /*i*/ 105: isnum = -1; sign = true; break;
|
||||
|
||||
/* unsigned integer */
|
||||
case /*U*/ 85: bytes = 8;
|
||||
/* falls through */
|
||||
case /*u*/ 117: isnum = -1; break;
|
||||
|
||||
/* unsigned octal */
|
||||
case /*O*/ 79: bytes = 8;
|
||||
/* falls through */
|
||||
case /*o*/ 111: isnum = -1; radix = (8); break;
|
||||
|
||||
/* unsigned hex */
|
||||
case /*x*/ 120: isnum = -1; radix = (-16); break;
|
||||
case /*X*/ 88: isnum = -1; radix = (16); break;
|
||||
|
||||
/* unsigned binary (extension) */
|
||||
case /*B*/ 66: bytes = 8;
|
||||
/* falls through */
|
||||
case /*b*/ 98: isnum = -1; radix = (2); break;
|
||||
|
||||
/* flt fegFEGaA */
|
||||
|
||||
/* floating point logic */
|
||||
case /*F*/ 70:
|
||||
case /*f*/ 102: isnum = (1); break;
|
||||
|
||||
case /*E*/ 69:
|
||||
case /*e*/ 101: isnum = (2); break;
|
||||
|
||||
case /*G*/ 71:
|
||||
case /*g*/ 103: isnum = (3); break;
|
||||
|
||||
/* floating hex */
|
||||
case /*A*/ 65:
|
||||
case /*a*/ 97: isnum = (4); break;
|
||||
|
||||
/* misc pnmJVTyY */
|
||||
|
||||
/* JS has no concept of pointers so interpret the `l` key as an address */
|
||||
case /*p*/ 112:
|
||||
Vnum = typeof arg == "number" ? arg : arg ? Number(arg.l) : -1;
|
||||
if(isNaN(Vnum)) Vnum = -1;
|
||||
if(alt) O = Vnum.toString(10);
|
||||
else {
|
||||
Vnum = Math.abs(Vnum);
|
||||
O = "0x" + Vnum.toString(16).toLowerCase();
|
||||
}
|
||||
break;
|
||||
|
||||
/* store length in the `len` key */
|
||||
case /*n*/ 110:
|
||||
if(arg) { arg.len = o.length; }
|
||||
//if(arg) { arg.len=0; for(var oo = 0; oo < o.length; ++oo) arg.len += o[oo].length; }
|
||||
continue;
|
||||
|
||||
/* process error */
|
||||
case /*m*/ 109:
|
||||
if(!(arg instanceof Error)) O = "Success";
|
||||
else if(arg.message) O = arg.message;
|
||||
else if(arg.errno) O = "Error number " + arg.errno;
|
||||
else O = "Error " + String(arg);
|
||||
break;
|
||||
|
||||
/* JS-specific conversions (extension) */
|
||||
case /*J*/ 74: O = (alt ? u_inspect : JSON.stringify)(arg); break;
|
||||
case /*V*/ 86: O = arg == null ? "null" : String(arg.valueOf()); break;
|
||||
case /*T*/ 84:
|
||||
if(alt) { /* from '[object %s]' extract %s */
|
||||
O = Object.prototype.toString.call(arg).substr(8);
|
||||
O = O.substr(0, O.length - 1);
|
||||
} else O = typeof arg;
|
||||
break;
|
||||
|
||||
/* boolean (extension) */
|
||||
case /*Y*/ 89:
|
||||
case /*y*/ 121:
|
||||
O = (arg) ? (alt ? "yes" : "true") : (alt ? "no" : "false");
|
||||
if(c == /*Y*/ 89) O = O.toUpperCase();
|
||||
if( prec >= 0) O = O.substr(0, prec);
|
||||
if( width > O.length || - width > O.length) { if(( flags.indexOf("-") == -1 || width < 0) && flags.indexOf("0") != -1) { pad = ( width - O.length >= 0 ? "0".repeat( width - O.length) : ""); O = pad + O; } else { pad = ( width - O.length >= 0 ? " ".repeat( width - O.length) : ""); O = flags.indexOf("-") > -1 ? O + pad : pad + O; } }
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
if(width < 0) { width = -width; flags += "-"; }
|
||||
|
||||
if(isnum == -1) {
|
||||
|
||||
Vnum = Number(arg);
|
||||
|
||||
/* parse byte length field */
|
||||
|
||||
switch(len) {
|
||||
/* char */
|
||||
case "hh": { bytes = 1; } break;
|
||||
/* short */
|
||||
case "h": { bytes = 2; } break;
|
||||
|
||||
/* long */
|
||||
case "l": { if(bytes == 4) bytes = 8; } break;
|
||||
|
||||
/* long long */
|
||||
case "L":
|
||||
case "q":
|
||||
case "ll": { if(bytes == 4) bytes = 8; } break;
|
||||
|
||||
/* intmax_t */
|
||||
case "j": { if(bytes == 4) bytes = 8; } break;
|
||||
|
||||
/* ptrdiff_t */
|
||||
case "t": { if(bytes == 4) bytes = 8; } break;
|
||||
|
||||
/* size_t */
|
||||
case "z":
|
||||
case "Z": { if(bytes == 4) bytes = 8; } break;
|
||||
|
||||
/* CRT size_t or ptrdiff_t */
|
||||
case "I":
|
||||
|
||||
{ if(bytes == 4) bytes = 8; }
|
||||
|
||||
break;
|
||||
|
||||
/* CRT wchar_t */
|
||||
case "w": break;
|
||||
}
|
||||
|
||||
/* restrict value */
|
||||
|
||||
switch(bytes) {
|
||||
case 1: Vnum = (Vnum & 0xFF); if(sign && (Vnum > 0x7F)) Vnum -= (0xFF + 1); break;
|
||||
case 2: Vnum = (Vnum & 0xFFFF); if(sign && (Vnum > 0x7FFF)) Vnum -= (0xFFFF + 1); break;
|
||||
case 4: Vnum = sign ? (Vnum | 0) : (Vnum >>> 0); break;
|
||||
default: Vnum = isNaN(Vnum) ? 0 : Math.round(Vnum); break;
|
||||
}
|
||||
|
||||
/* generate string */
|
||||
if(bytes > 4 && Vnum < 0 && !sign) {
|
||||
if(radix == 16 || radix == -16) {
|
||||
O = (Vnum>>>0).toString(16);
|
||||
Vnum = Math.floor((Vnum - (Vnum >>> 0)) / Math.pow(2,32));
|
||||
O = (Vnum>>>0).toString(16) + (8 - O.length >= 0 ? "0".repeat(8 - O.length) : "") + O;
|
||||
O = (16 - O.length >= 0 ? "f".repeat(16 - O.length) : "") + O;
|
||||
if(radix == 16) O = O.toUpperCase();
|
||||
} else if(radix == 8) {
|
||||
O = (Vnum>>>0).toString(8);
|
||||
O = (10 - O.length >= 0 ? "0".repeat(10 - O.length) : "") + O;
|
||||
Vnum = Math.floor((Vnum - ((Vnum >>> 0)&0x3FFFFFFF)) / Math.pow(2,30));
|
||||
O = (Vnum>>>0).toString(8) + O.substr(O.length - 10);
|
||||
O = O.substr(O.length - 20);
|
||||
O = "1" + (21 - O.length >= 0 ? "7".repeat(21 - O.length) : "") + O;
|
||||
} else {
|
||||
Vnum = (-Vnum) % 1e16;
|
||||
var d1 = [1,8,4,4,6,7,4,4,0,7,3,7,0,9,5,5,1,6,1,6];
|
||||
var di = d1.length - 1;
|
||||
while(Vnum > 0) {
|
||||
if((d1[di] -= (Vnum % 10)) < 0) { d1[di] += 10; d1[di-1]--; }
|
||||
--di; Vnum = Math.floor(Vnum / 10);
|
||||
}
|
||||
O = d1.join("");
|
||||
}
|
||||
} else {
|
||||
if(radix === -16) O = Vnum.toString(16).toLowerCase();
|
||||
else if(radix === 16) O = Vnum.toString(16).toUpperCase();
|
||||
else O = Vnum.toString(radix);
|
||||
}
|
||||
|
||||
/* apply precision */
|
||||
if(prec ===0 && O == "0" && !(radix == 8 && alt)) O = ""; /* bail out */
|
||||
else {
|
||||
if(O.length < prec + (O.substr(0,1) == "-" ? 1 : 0)) {
|
||||
if(O.substr(0,1) != "-") O = (prec - O.length >= 0 ? "0".repeat(prec - O.length) : "") + O;
|
||||
else O = O.substr(0,1) + (prec + 1 - O.length >= 0 ? "0".repeat(prec + 1 - O.length) : "") + O.substr(1);
|
||||
}
|
||||
|
||||
/* add prefix for # form */
|
||||
if(!sign && alt && Vnum !== 0) switch(radix) {
|
||||
case -16: O = "0x" + O; break;
|
||||
case 16: O = "0X" + O; break;
|
||||
case 8: if(O.charAt(0) != "0") O = "0" + O; break;
|
||||
case 2: O = "0b" + O; break;
|
||||
}
|
||||
}
|
||||
|
||||
/* add sign character */
|
||||
if(sign && O.charAt(0) != "-") {
|
||||
if(flags.indexOf("+") > -1) O = "+" + O;
|
||||
else if(flags.indexOf(" ") > -1) O = " " + O;
|
||||
}
|
||||
/* width */
|
||||
if(width > 0) {
|
||||
if(O.length < width) {
|
||||
if(flags.indexOf("-") > -1) {
|
||||
O = O + ((width - O.length) >= 0 ? " ".repeat((width - O.length)) : "");
|
||||
} else if(flags.indexOf("0") > -1 && prec < 0 && O.length > 0) {
|
||||
if(prec > O.length) O = ((prec - O.length) >= 0 ? "0".repeat((prec - O.length)) : "") + O;
|
||||
pad = ((width - O.length) >= 0 ? (prec > 0 ? " " : "0").repeat((width - O.length)) : "");
|
||||
if(O.charCodeAt(0) < 48) {
|
||||
if(O.charAt(2).toLowerCase() == "x") O = O.substr(0,3) + pad + O.substring(3);
|
||||
else O = O.substr(0,1) + pad + O.substring(1);
|
||||
}
|
||||
else if(O.charAt(1).toLowerCase() == "x") O = O.substr(0,2) + pad + O.substring(2);
|
||||
else O = pad + O;
|
||||
} else {
|
||||
O = ((width - O.length) >= 0 ? " ".repeat((width - O.length)) : "") + O;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} else if(isnum > 0) {
|
||||
|
||||
Vnum = Number(arg);
|
||||
if(arg === null) Vnum = 0/0;
|
||||
if(len == "L") bytes = 12;
|
||||
var isf = isFinite(Vnum);
|
||||
if(!isf) { /* Infinity or NaN */
|
||||
if(Vnum < 0) O = "-";
|
||||
else if(flags.indexOf("+") > -1) O = "+";
|
||||
else if(flags.indexOf(" ") > -1) O = " ";
|
||||
O += (isNaN(Vnum)) ? "nan" : "inf";
|
||||
} else {
|
||||
var E = 0;
|
||||
|
||||
if(prec == -1 && isnum != 4) prec = 6;
|
||||
|
||||
/* g/G conditional behavior */
|
||||
if(isnum == 3) {
|
||||
O = Vnum.toExponential(1);
|
||||
E = +O.substr(O.indexOf("e") + 1);
|
||||
if(prec === 0) prec = 1;
|
||||
if(prec > E && E >= -4) { isnum = (11); prec = prec -(E + 1); }
|
||||
else { isnum = (12); prec = prec - 1; }
|
||||
}
|
||||
|
||||
/* sign: workaround for negative zero */
|
||||
var sg = (Vnum < 0 || 1/Vnum == -Infinity) ? "-" : "";
|
||||
if(Vnum < 0) Vnum = -Vnum;
|
||||
|
||||
switch(isnum) {
|
||||
/* f/F standard */
|
||||
case 1: case 11:
|
||||
if(Vnum < 1e21) {
|
||||
O = Vnum.toFixed(prec);
|
||||
if(isnum == 1) { if(prec===0 &&alt&& O.indexOf(".")==-1) O+="."; }
|
||||
else if(!alt) O=O.replace(/(\.\d*[1-9])0*$/,"$1").replace(/\.0*$/,"");
|
||||
else if(O.indexOf(".") == -1) O+= ".";
|
||||
break;
|
||||
}
|
||||
O = Vnum.toExponential(20);
|
||||
E = +O.substr(O.indexOf("e")+1);
|
||||
O = O.charAt(0) + O.substr(2,O.indexOf("e")-2);
|
||||
O = O + (E - O.length + 1 >= 0 ? "0".repeat(E - O.length + 1) : "");
|
||||
if(alt || (prec > 0 && isnum !== 11)) O = O + "." + (prec >= 0 ? "0".repeat(prec) : "");
|
||||
break;
|
||||
|
||||
/* e/E exponential */
|
||||
case 2: case 12:
|
||||
O = Vnum.toExponential(prec);
|
||||
E = O.indexOf("e");
|
||||
if(O.length - E === 3) O = O.substr(0, E+2) + "0" + O.substr(E+2);
|
||||
if(alt && O.indexOf(".") == -1) O = O.substr(0,E) +"."+ O.substr(E);
|
||||
else if(!alt && isnum == 12) O = O.replace(/\.0*e/, "e").replace(/\.(\d*[1-9])0*e/, ".$1e");
|
||||
break;
|
||||
|
||||
/* a/A hex */
|
||||
case 4:
|
||||
if(Vnum===0){O= "0x0"+((alt||prec>0)?"."+(prec >= 0 ? "0".repeat(prec) : ""):"")+"p+0"; break;}
|
||||
O = Vnum.toString(16);
|
||||
/* First char 0-9 */
|
||||
var ac = O.charCodeAt(0);
|
||||
if(ac == 48) {
|
||||
ac = 2; E = -4; Vnum *= 16;
|
||||
while(O.charCodeAt(ac++) == 48) { E -= 4; Vnum *= 16; }
|
||||
O = Vnum.toString(16);
|
||||
ac = O.charCodeAt(0);
|
||||
}
|
||||
|
||||
var ai = O.indexOf(".");
|
||||
if(O.indexOf("(") > -1) {
|
||||
/* IE exponential form */
|
||||
var am = O.match(/\(e(.*)\)/);
|
||||
var ae = am ? (+am[1]) : 0;
|
||||
E += 4 * ae; Vnum /= Math.pow(16, ae);
|
||||
} else if(ai > 1) {
|
||||
E += 4 * (ai - 1); Vnum /= Math.pow(16, ai - 1);
|
||||
} else if(ai == -1) {
|
||||
E += 4 * (O.length - 1); Vnum /= Math.pow(16, O.length - 1);
|
||||
}
|
||||
|
||||
/* at this point 1 <= Vnum < 16 */
|
||||
|
||||
if(bytes > 8) {
|
||||
if(ac < 50) { E -= 3; Vnum *= 8; }
|
||||
else if(ac < 52) { E -= 2; Vnum *= 4; }
|
||||
else if(ac < 56) { E -= 1; Vnum *= 2; }
|
||||
/* at this point 8 <= Vnum < 16 */
|
||||
} else {
|
||||
if(ac >= 56) { E += 3; Vnum /= 8; }
|
||||
else if(ac >= 52) { E += 2; Vnum /= 4; }
|
||||
else if(ac >= 50) { E += 1; Vnum /= 2; }
|
||||
/* at this point 1 <= Vnum < 2 */
|
||||
}
|
||||
|
||||
O = Vnum.toString(16);
|
||||
if(O.length > 1) {
|
||||
if(O.length > prec+2 && O.charCodeAt(prec+2) >= 56) {
|
||||
var _f = O.charCodeAt(0) == 102;
|
||||
O = (Vnum + 8 * Math.pow(16, -prec-1)).toString(16);
|
||||
if(_f && O.charCodeAt(0) == 49) E += 4;
|
||||
}
|
||||
if(prec > 0) {
|
||||
O = O.substr(0, prec + 2);
|
||||
if(O.length < prec + 2) {
|
||||
if(O.charCodeAt(0) < 48) O = O.charAt(0) + ((prec + 2 - O.length) >= 0 ? "0".repeat((prec + 2 - O.length)) : "") + O.substr(1);
|
||||
else O += ((prec + 2 - O.length) >= 0 ? "0".repeat((prec + 2 - O.length)) : "");
|
||||
}
|
||||
} else if(prec === 0) O = O.charAt(0) + (alt ? "." : "");
|
||||
} else if(prec > 0) O = O + "." + (prec >= 0 ? "0".repeat(prec) : "");
|
||||
else if(alt) O = O + ".";
|
||||
O = "0x" + O + "p" + (E>=0 ? "+" + E : E);
|
||||
break;
|
||||
}
|
||||
|
||||
if(sg === "") {
|
||||
if(flags.indexOf("+") > -1) sg = "+";
|
||||
else if(flags.indexOf(" ") > -1) sg = " ";
|
||||
}
|
||||
|
||||
O = sg + O;
|
||||
}
|
||||
|
||||
/* width */
|
||||
if(width > O.length) {
|
||||
if(flags.indexOf("-") > -1) {
|
||||
O = O + ((width - O.length) >= 0 ? " ".repeat((width - O.length)) : "");
|
||||
} else if(flags.indexOf("0") > -1 && O.length > 0 && isf) {
|
||||
pad = ((width - O.length) >= 0 ? "0".repeat((width - O.length)) : "");
|
||||
if(O.charCodeAt(0) < 48) {
|
||||
if(O.charAt(2).toLowerCase() == "x") O = O.substr(0,3) + pad + O.substring(3);
|
||||
else O = O.substr(0,1) + pad + O.substring(1);
|
||||
}
|
||||
else if(O.charAt(1).toLowerCase() == "x") O = O.substr(0,2) + pad + O.substring(2);
|
||||
else O = pad + O;
|
||||
} else {
|
||||
O = ((width - O.length) >= 0 ? " ".repeat((width - O.length)) : "") + O;
|
||||
}
|
||||
}
|
||||
if(c < 96) O = O.toUpperCase();
|
||||
|
||||
}
|
||||
|
||||
o += /*.push*/(O);
|
||||
}
|
||||
return o/*.join("")*/;
|
||||
}
|
||||
|
||||
function vsprintf(fmt, args) { return doit(tokenize(fmt), args); }
|
||||
|
||||
function sprintf() {
|
||||
var args = new Array(arguments.length - 1);
|
||||
for(var i = 0; i < args.length; ++i) args[i] = arguments[i+1];
|
||||
return doit(tokenize(arguments[0]), args);
|
||||
}
|
||||
|
||||
PRINTJ.sprintf = sprintf;
|
||||
PRINTJ.vsprintf = vsprintf;
|
||||
PRINTJ._doit = doit;
|
||||
PRINTJ._tokenize = tokenize;
|
||||
|
||||
}));
|
||||
|
||||
2
node_modules/crc-32/node_modules/printj/dist/printj.min.js
generated
vendored
Normal file
2
node_modules/crc-32/node_modules/printj/dist/printj.min.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
node_modules/crc-32/node_modules/printj/dist/printj.min.map
generated
vendored
Normal file
1
node_modules/crc-32/node_modules/printj/dist/printj.min.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
71
node_modules/crc-32/node_modules/printj/package.json
generated
vendored
Normal file
71
node_modules/crc-32/node_modules/printj/package.json
generated
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
{
|
||||
"name": "printj",
|
||||
"version": "1.3.1",
|
||||
"author": "sheetjs",
|
||||
"description": "Pure-JS printf",
|
||||
"keywords": [
|
||||
"printf",
|
||||
"sprintf",
|
||||
"format",
|
||||
"string"
|
||||
],
|
||||
"bin": {
|
||||
"printj": "bin/printj.njs"
|
||||
},
|
||||
"main": "printj.js",
|
||||
"module": "printj.mjs",
|
||||
"types": "types",
|
||||
"browser": {
|
||||
"process": false,
|
||||
"util": false
|
||||
},
|
||||
"dependencies": {
|
||||
},
|
||||
"devDependencies": {
|
||||
"@sheetjs/uglify-js": "~2.7.3",
|
||||
"@types/node": "^8.0.7",
|
||||
"alex": "10.0.0",
|
||||
"blanket": "~1.2.3",
|
||||
"dtslint": "4.2.1",
|
||||
"eslint": "6.8.0",
|
||||
"eslint-plugin-html": "6.0.0",
|
||||
"eslint-plugin-json": "1.4.0",
|
||||
"jscs": "3.0.7",
|
||||
"jshint": "2.9.6",
|
||||
"markdown-spellcheck": "1.3.1",
|
||||
"mocha": "~2.5.3"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/SheetJS/printj.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "make test",
|
||||
"build": "make",
|
||||
"lint": "make fullint",
|
||||
"dtslint": "dtslint types"
|
||||
},
|
||||
"config": {
|
||||
"blanket": {
|
||||
"pattern": "printj.js"
|
||||
}
|
||||
},
|
||||
"alex": {
|
||||
"allow": [
|
||||
"whitespace",
|
||||
"special",
|
||||
"period",
|
||||
"just",
|
||||
"invalid"
|
||||
]
|
||||
},
|
||||
"homepage": "https://sheetjs.com/",
|
||||
"files": ["printj.js", "printj.mjs", "bin/printj.njs", "LICENSE", "README.md", "shim.js", "dist/*.js", "dist/*.map", "dist/LICENSE", "types/index.d.ts", "types/*.json"],
|
||||
"bugs": {
|
||||
"url": "https://github.com/SheetJS/printj/issues"
|
||||
},
|
||||
"license": "Apache-2.0",
|
||||
"engines": {
|
||||
"node": ">=0.8"
|
||||
}
|
||||
}
|
||||
602
node_modules/crc-32/node_modules/printj/printj.js
generated
vendored
Normal file
602
node_modules/crc-32/node_modules/printj/printj.js
generated
vendored
Normal file
@@ -0,0 +1,602 @@
|
||||
/* printj.js (C) 2016-present SheetJS -- http://sheetjs.com */
|
||||
/* vim: set ts=2: */
|
||||
/*jshint sub:true, eqnull:true */
|
||||
/*exported PRINTJ */
|
||||
var PRINTJ;
|
||||
(function (factory) {
|
||||
/*jshint ignore:start */
|
||||
/*eslint-disable */
|
||||
if(typeof DO_NOT_EXPORT_PRINTJ === 'undefined') {
|
||||
if('object' === typeof exports) {
|
||||
factory(exports);
|
||||
} else if ('function' === typeof define && define.amd) {
|
||||
define(function () {
|
||||
var module = {};
|
||||
factory(module);
|
||||
return module;
|
||||
});
|
||||
} else {
|
||||
factory(PRINTJ = {});
|
||||
}
|
||||
} else {
|
||||
factory(PRINTJ = {});
|
||||
}
|
||||
/*eslint-enable */
|
||||
/*jshint ignore:end */
|
||||
}(function(PRINTJ) {
|
||||
|
||||
PRINTJ.version = '1.3.1';
|
||||
|
||||
var tcache = {};
|
||||
|
||||
function tokenize(fmt) {
|
||||
if(tcache[fmt]) return tcache[fmt];
|
||||
var out = [];
|
||||
var start = 0;
|
||||
|
||||
var i = 0;
|
||||
var infmt = false;
|
||||
var fmtparam = "", fmtflags = "", fmtwidth = "", fmtprec = "", fmtlen = "";
|
||||
|
||||
var c = 0;
|
||||
|
||||
var L = fmt.length;
|
||||
|
||||
for(; i < L; ++i) {
|
||||
c = fmt.charCodeAt(i);
|
||||
if(!infmt) {
|
||||
|
||||
if(c !== 37) continue;
|
||||
|
||||
if(start < i) out.push(["L", fmt.substring(start, i)]);
|
||||
start = i;
|
||||
infmt = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
if(c >= 48 && c < 58) {
|
||||
if(fmtprec.length) fmtprec += String.fromCharCode(c);
|
||||
else if(c == 48 && !fmtwidth.length) fmtflags += String.fromCharCode(c);
|
||||
else fmtwidth += String.fromCharCode(c);
|
||||
} else switch(c) {
|
||||
/* positional */
|
||||
case 36:
|
||||
if(fmtprec.length) fmtprec += "$";
|
||||
else if(fmtwidth.charAt(0) == "*") fmtwidth += "$";
|
||||
else { fmtparam = fmtwidth + "$"; fmtwidth = ""; }
|
||||
break;
|
||||
|
||||
/* flags */
|
||||
case 39: fmtflags += "'"; break;
|
||||
case 45: fmtflags += "-"; break;
|
||||
case 43: fmtflags += "+"; break;
|
||||
case 32: fmtflags += " "; break;
|
||||
case 35: fmtflags += "#"; break;
|
||||
|
||||
/* width and precision */
|
||||
case 46: fmtprec = "."; break;
|
||||
case 42:
|
||||
if(fmtprec.charAt(0) == ".") fmtprec += "*";
|
||||
else fmtwidth += "*";
|
||||
break;
|
||||
|
||||
/* length */
|
||||
case 104:
|
||||
case 108:
|
||||
if(fmtlen.length > 1) throw "bad length " + fmtlen + String(c);
|
||||
fmtlen += String.fromCharCode(c);
|
||||
break;
|
||||
|
||||
case 76:
|
||||
case 106:
|
||||
case 122:
|
||||
case 116:
|
||||
case 113:
|
||||
case 90:
|
||||
case 119:
|
||||
if(fmtlen !== "") throw "bad length " + fmtlen + String.fromCharCode(c);
|
||||
fmtlen = String.fromCharCode(c);
|
||||
break;
|
||||
|
||||
case 73:
|
||||
if(fmtlen !== "") throw "bad length " + fmtlen + 'I';
|
||||
fmtlen = 'I';
|
||||
break;
|
||||
|
||||
/* conversion */
|
||||
case 100:
|
||||
case 105:
|
||||
case 111:
|
||||
case 117:
|
||||
case 120:
|
||||
case 88:
|
||||
case 102:
|
||||
case 70:
|
||||
case 101:
|
||||
case 69:
|
||||
case 103:
|
||||
case 71:
|
||||
case 97:
|
||||
case 65:
|
||||
case 99:
|
||||
case 67:
|
||||
case 115:
|
||||
case 83:
|
||||
case 112:
|
||||
case 110:
|
||||
case 68:
|
||||
case 85:
|
||||
case 79:
|
||||
case 109:
|
||||
case 98:
|
||||
case 66:
|
||||
case 121:
|
||||
case 89:
|
||||
case 74:
|
||||
case 86:
|
||||
case 84:
|
||||
case 37:
|
||||
infmt = false;
|
||||
if(fmtprec.length > 1) fmtprec = fmtprec.substr(1);
|
||||
out.push([String.fromCharCode(c), fmt.substring(start, i+1), fmtparam, fmtflags, fmtwidth, fmtprec, fmtlen]);
|
||||
start = i+1;
|
||||
fmtlen = fmtprec = fmtwidth = fmtflags = fmtparam = "";
|
||||
break;
|
||||
default:
|
||||
throw new Error("Invalid format string starting with |" + fmt.substring(start, i+1) + "|");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(start < fmt.length) out.push(["L", fmt.substring(start)]);
|
||||
return (tcache[fmt] = out);
|
||||
}
|
||||
|
||||
/*global process:true, util:true, require:true */
|
||||
if(typeof process !== 'undefined' && !!process.versions && !!process.versions.node) util=require("util");
|
||||
var u_inspect = (typeof util != 'undefined') ? util.inspect : JSON.stringify;
|
||||
|
||||
function doit(t, args) {
|
||||
//var o = [];
|
||||
var o = "";
|
||||
var argidx = 0, idx = 0;
|
||||
var Vnum = 0;
|
||||
var pad = "";
|
||||
for(var i = 0; i < t.length; ++i) {
|
||||
var m = t[i], c = (m[0]).charCodeAt(0);
|
||||
/* m order: conv full param flags width prec length */
|
||||
|
||||
if(c === /*L*/ 76) { o += /*o.push*/(m[1]); continue; }
|
||||
if(c === /*%*/ 37) { o += /*o.push*/("%"); continue; }
|
||||
|
||||
var O = "";
|
||||
var isnum = 0, radix = 10, bytes = 4, sign = false;
|
||||
|
||||
/* flags */
|
||||
var flags = m[3]/*||""*/;
|
||||
var alt = flags.indexOf("#") > -1;
|
||||
|
||||
/* position */
|
||||
if(m[2]) argidx = parseInt(m[2], 10)-1;
|
||||
/* %m special case */
|
||||
else if(c === /*m*/ 109 && !alt) { o += /*.push*/("Success"); continue; }
|
||||
|
||||
/* grab width */
|
||||
var width = 0; if( m[ 4].length > 0) { if(m[ 4].charAt(0) !== '*') width = parseInt(m[ 4], 10); else if(m[ 4].length === 1) width = args[idx++]; else width = args[parseInt(m[ 4].substr(1), 10)-1]; }
|
||||
|
||||
/* grab precision */
|
||||
var prec = -1; if( m[ 5].length > 0) { if(m[ 5].charAt(0) !== '*') prec = parseInt(m[ 5], 10); else if(m[ 5].length === 1) prec = args[idx++]; else prec = args[parseInt(m[ 5].substr(1), 10)-1]; }
|
||||
|
||||
/* position not specified */
|
||||
if(!m[2]) argidx = idx++;
|
||||
|
||||
/* grab argument */
|
||||
var arg = args[argidx];
|
||||
|
||||
/* grab length */
|
||||
var len = m[6]/* || ""*/;
|
||||
|
||||
switch(c) {
|
||||
/* str cCsS */
|
||||
|
||||
case /*S*/ 83:
|
||||
case /*s*/ 115:
|
||||
/* only valid flag is "-" for left justification */
|
||||
O = String(arg);
|
||||
if( prec >= 0) O = O.substr(0, prec);
|
||||
if( width > O.length || - width > O.length) { if(( flags.indexOf("-") == -1 || width < 0) && flags.indexOf("0") != -1) { pad = ( width - O.length >= 0 ? "0".repeat( width - O.length) : ""); O = pad + O; } else { pad = ( width - O.length >= 0 ? " ".repeat( width - O.length) : ""); O = flags.indexOf("-") > -1 ? O + pad : pad + O; } }
|
||||
break;
|
||||
|
||||
/* first char of string or convert */
|
||||
case /*C*/ 67:
|
||||
case /*c*/ 99:
|
||||
switch(typeof arg) {
|
||||
case "number":
|
||||
var cc = arg;
|
||||
if(c == 67 || len.charCodeAt(0) === /*l*/ 108) { cc &= 0xFFFFFFFF; O = String.fromCharCode( cc); }
|
||||
else { cc &= 0xFF; O = String.fromCharCode( cc); }
|
||||
break;
|
||||
case "string": O = arg.charAt(0); break;
|
||||
default: O = String(arg).charAt(0);
|
||||
}
|
||||
if( width > O.length || - width > O.length) { if(( flags.indexOf("-") == -1 || width < 0) && flags.indexOf("0") != -1) { pad = ( width - O.length >= 0 ? "0".repeat( width - O.length) : ""); O = pad + O; } else { pad = ( width - O.length >= 0 ? " ".repeat( width - O.length) : ""); O = flags.indexOf("-") > -1 ? O + pad : pad + O; } }
|
||||
break;
|
||||
|
||||
/* int diDuUoOxXbB */
|
||||
|
||||
/* signed integer */
|
||||
case /*D*/ 68: bytes = 8;
|
||||
/* falls through */
|
||||
case /*d*/ 100:
|
||||
case /*i*/ 105: isnum = -1; sign = true; break;
|
||||
|
||||
/* unsigned integer */
|
||||
case /*U*/ 85: bytes = 8;
|
||||
/* falls through */
|
||||
case /*u*/ 117: isnum = -1; break;
|
||||
|
||||
/* unsigned octal */
|
||||
case /*O*/ 79: bytes = 8;
|
||||
/* falls through */
|
||||
case /*o*/ 111: isnum = -1; radix = (8); break;
|
||||
|
||||
/* unsigned hex */
|
||||
case /*x*/ 120: isnum = -1; radix = (-16); break;
|
||||
case /*X*/ 88: isnum = -1; radix = (16); break;
|
||||
|
||||
/* unsigned binary (extension) */
|
||||
case /*B*/ 66: bytes = 8;
|
||||
/* falls through */
|
||||
case /*b*/ 98: isnum = -1; radix = (2); break;
|
||||
|
||||
/* flt fegFEGaA */
|
||||
|
||||
/* floating point logic */
|
||||
case /*F*/ 70:
|
||||
case /*f*/ 102: isnum = (1); break;
|
||||
|
||||
case /*E*/ 69:
|
||||
case /*e*/ 101: isnum = (2); break;
|
||||
|
||||
case /*G*/ 71:
|
||||
case /*g*/ 103: isnum = (3); break;
|
||||
|
||||
/* floating hex */
|
||||
case /*A*/ 65:
|
||||
case /*a*/ 97: isnum = (4); break;
|
||||
|
||||
/* misc pnmJVTyY */
|
||||
|
||||
/* JS has no concept of pointers so interpret the `l` key as an address */
|
||||
case /*p*/ 112:
|
||||
Vnum = typeof arg == "number" ? arg : arg ? Number(arg.l) : -1;
|
||||
if(isNaN(Vnum)) Vnum = -1;
|
||||
if(alt) O = Vnum.toString(10);
|
||||
else {
|
||||
Vnum = Math.abs(Vnum);
|
||||
O = "0x" + Vnum.toString(16).toLowerCase();
|
||||
}
|
||||
break;
|
||||
|
||||
/* store length in the `len` key */
|
||||
case /*n*/ 110:
|
||||
if(arg) { arg.len = o.length; }
|
||||
//if(arg) { arg.len=0; for(var oo = 0; oo < o.length; ++oo) arg.len += o[oo].length; }
|
||||
continue;
|
||||
|
||||
/* process error */
|
||||
case /*m*/ 109:
|
||||
if(!(arg instanceof Error)) O = "Success";
|
||||
else if(arg.message) O = arg.message;
|
||||
else if(arg.errno) O = "Error number " + arg.errno;
|
||||
else O = "Error " + String(arg);
|
||||
break;
|
||||
|
||||
/* JS-specific conversions (extension) */
|
||||
case /*J*/ 74: O = (alt ? u_inspect : JSON.stringify)(arg); break;
|
||||
case /*V*/ 86: O = arg == null ? "null" : String(arg.valueOf()); break;
|
||||
case /*T*/ 84:
|
||||
if(alt) { /* from '[object %s]' extract %s */
|
||||
O = Object.prototype.toString.call(arg).substr(8);
|
||||
O = O.substr(0, O.length - 1);
|
||||
} else O = typeof arg;
|
||||
break;
|
||||
|
||||
/* boolean (extension) */
|
||||
case /*Y*/ 89:
|
||||
case /*y*/ 121:
|
||||
O = (arg) ? (alt ? "yes" : "true") : (alt ? "no" : "false");
|
||||
if(c == /*Y*/ 89) O = O.toUpperCase();
|
||||
if( prec >= 0) O = O.substr(0, prec);
|
||||
if( width > O.length || - width > O.length) { if(( flags.indexOf("-") == -1 || width < 0) && flags.indexOf("0") != -1) { pad = ( width - O.length >= 0 ? "0".repeat( width - O.length) : ""); O = pad + O; } else { pad = ( width - O.length >= 0 ? " ".repeat( width - O.length) : ""); O = flags.indexOf("-") > -1 ? O + pad : pad + O; } }
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
if(width < 0) { width = -width; flags += "-"; }
|
||||
|
||||
if(isnum == -1) {
|
||||
|
||||
Vnum = Number(arg);
|
||||
|
||||
/* parse byte length field */
|
||||
|
||||
switch(len) {
|
||||
/* char */
|
||||
case "hh": { bytes = 1; } break;
|
||||
/* short */
|
||||
case "h": { bytes = 2; } break;
|
||||
|
||||
/* long */
|
||||
case "l": { if(bytes == 4) bytes = 8; } break;
|
||||
|
||||
/* long long */
|
||||
case "L":
|
||||
case "q":
|
||||
case "ll": { if(bytes == 4) bytes = 8; } break;
|
||||
|
||||
/* intmax_t */
|
||||
case "j": { if(bytes == 4) bytes = 8; } break;
|
||||
|
||||
/* ptrdiff_t */
|
||||
case "t": { if(bytes == 4) bytes = 8; } break;
|
||||
|
||||
/* size_t */
|
||||
case "z":
|
||||
case "Z": { if(bytes == 4) bytes = 8; } break;
|
||||
|
||||
/* CRT size_t or ptrdiff_t */
|
||||
case "I":
|
||||
|
||||
{ if(bytes == 4) bytes = 8; }
|
||||
|
||||
break;
|
||||
|
||||
/* CRT wchar_t */
|
||||
case "w": break;
|
||||
}
|
||||
|
||||
/* restrict value */
|
||||
|
||||
switch(bytes) {
|
||||
case 1: Vnum = (Vnum & 0xFF); if(sign && (Vnum > 0x7F)) Vnum -= (0xFF + 1); break;
|
||||
case 2: Vnum = (Vnum & 0xFFFF); if(sign && (Vnum > 0x7FFF)) Vnum -= (0xFFFF + 1); break;
|
||||
case 4: Vnum = sign ? (Vnum | 0) : (Vnum >>> 0); break;
|
||||
default: Vnum = isNaN(Vnum) ? 0 : Math.round(Vnum); break;
|
||||
}
|
||||
|
||||
/* generate string */
|
||||
if(bytes > 4 && Vnum < 0 && !sign) {
|
||||
if(radix == 16 || radix == -16) {
|
||||
O = (Vnum>>>0).toString(16);
|
||||
Vnum = Math.floor((Vnum - (Vnum >>> 0)) / Math.pow(2,32));
|
||||
O = (Vnum>>>0).toString(16) + (8 - O.length >= 0 ? "0".repeat(8 - O.length) : "") + O;
|
||||
O = (16 - O.length >= 0 ? "f".repeat(16 - O.length) : "") + O;
|
||||
if(radix == 16) O = O.toUpperCase();
|
||||
} else if(radix == 8) {
|
||||
O = (Vnum>>>0).toString(8);
|
||||
O = (10 - O.length >= 0 ? "0".repeat(10 - O.length) : "") + O;
|
||||
Vnum = Math.floor((Vnum - ((Vnum >>> 0)&0x3FFFFFFF)) / Math.pow(2,30));
|
||||
O = (Vnum>>>0).toString(8) + O.substr(O.length - 10);
|
||||
O = O.substr(O.length - 20);
|
||||
O = "1" + (21 - O.length >= 0 ? "7".repeat(21 - O.length) : "") + O;
|
||||
} else {
|
||||
Vnum = (-Vnum) % 1e16;
|
||||
var d1 = [1,8,4,4,6,7,4,4,0,7,3,7,0,9,5,5,1,6,1,6];
|
||||
var di = d1.length - 1;
|
||||
while(Vnum > 0) {
|
||||
if((d1[di] -= (Vnum % 10)) < 0) { d1[di] += 10; d1[di-1]--; }
|
||||
--di; Vnum = Math.floor(Vnum / 10);
|
||||
}
|
||||
O = d1.join("");
|
||||
}
|
||||
} else {
|
||||
if(radix === -16) O = Vnum.toString(16).toLowerCase();
|
||||
else if(radix === 16) O = Vnum.toString(16).toUpperCase();
|
||||
else O = Vnum.toString(radix);
|
||||
}
|
||||
|
||||
/* apply precision */
|
||||
if(prec ===0 && O == "0" && !(radix == 8 && alt)) O = ""; /* bail out */
|
||||
else {
|
||||
if(O.length < prec + (O.substr(0,1) == "-" ? 1 : 0)) {
|
||||
if(O.substr(0,1) != "-") O = (prec - O.length >= 0 ? "0".repeat(prec - O.length) : "") + O;
|
||||
else O = O.substr(0,1) + (prec + 1 - O.length >= 0 ? "0".repeat(prec + 1 - O.length) : "") + O.substr(1);
|
||||
}
|
||||
|
||||
/* add prefix for # form */
|
||||
if(!sign && alt && Vnum !== 0) switch(radix) {
|
||||
case -16: O = "0x" + O; break;
|
||||
case 16: O = "0X" + O; break;
|
||||
case 8: if(O.charAt(0) != "0") O = "0" + O; break;
|
||||
case 2: O = "0b" + O; break;
|
||||
}
|
||||
}
|
||||
|
||||
/* add sign character */
|
||||
if(sign && O.charAt(0) != "-") {
|
||||
if(flags.indexOf("+") > -1) O = "+" + O;
|
||||
else if(flags.indexOf(" ") > -1) O = " " + O;
|
||||
}
|
||||
/* width */
|
||||
if(width > 0) {
|
||||
if(O.length < width) {
|
||||
if(flags.indexOf("-") > -1) {
|
||||
O = O + ((width - O.length) >= 0 ? " ".repeat((width - O.length)) : "");
|
||||
} else if(flags.indexOf("0") > -1 && prec < 0 && O.length > 0) {
|
||||
if(prec > O.length) O = ((prec - O.length) >= 0 ? "0".repeat((prec - O.length)) : "") + O;
|
||||
pad = ((width - O.length) >= 0 ? (prec > 0 ? " " : "0").repeat((width - O.length)) : "");
|
||||
if(O.charCodeAt(0) < 48) {
|
||||
if(O.charAt(2).toLowerCase() == "x") O = O.substr(0,3) + pad + O.substring(3);
|
||||
else O = O.substr(0,1) + pad + O.substring(1);
|
||||
}
|
||||
else if(O.charAt(1).toLowerCase() == "x") O = O.substr(0,2) + pad + O.substring(2);
|
||||
else O = pad + O;
|
||||
} else {
|
||||
O = ((width - O.length) >= 0 ? " ".repeat((width - O.length)) : "") + O;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} else if(isnum > 0) {
|
||||
|
||||
Vnum = Number(arg);
|
||||
if(arg === null) Vnum = 0/0;
|
||||
if(len == "L") bytes = 12;
|
||||
var isf = isFinite(Vnum);
|
||||
if(!isf) { /* Infinity or NaN */
|
||||
if(Vnum < 0) O = "-";
|
||||
else if(flags.indexOf("+") > -1) O = "+";
|
||||
else if(flags.indexOf(" ") > -1) O = " ";
|
||||
O += (isNaN(Vnum)) ? "nan" : "inf";
|
||||
} else {
|
||||
var E = 0;
|
||||
|
||||
if(prec == -1 && isnum != 4) prec = 6;
|
||||
|
||||
/* g/G conditional behavior */
|
||||
if(isnum == 3) {
|
||||
O = Vnum.toExponential(1);
|
||||
E = +O.substr(O.indexOf("e") + 1);
|
||||
if(prec === 0) prec = 1;
|
||||
if(prec > E && E >= -4) { isnum = (11); prec = prec -(E + 1); }
|
||||
else { isnum = (12); prec = prec - 1; }
|
||||
}
|
||||
|
||||
/* sign: workaround for negative zero */
|
||||
var sg = (Vnum < 0 || 1/Vnum == -Infinity) ? "-" : "";
|
||||
if(Vnum < 0) Vnum = -Vnum;
|
||||
|
||||
switch(isnum) {
|
||||
/* f/F standard */
|
||||
case 1: case 11:
|
||||
if(Vnum < 1e21) {
|
||||
O = Vnum.toFixed(prec);
|
||||
if(isnum == 1) { if(prec===0 &&alt&& O.indexOf(".")==-1) O+="."; }
|
||||
else if(!alt) O=O.replace(/(\.\d*[1-9])0*$/,"$1").replace(/\.0*$/,"");
|
||||
else if(O.indexOf(".") == -1) O+= ".";
|
||||
break;
|
||||
}
|
||||
O = Vnum.toExponential(20);
|
||||
E = +O.substr(O.indexOf("e")+1);
|
||||
O = O.charAt(0) + O.substr(2,O.indexOf("e")-2);
|
||||
O = O + (E - O.length + 1 >= 0 ? "0".repeat(E - O.length + 1) : "");
|
||||
if(alt || (prec > 0 && isnum !== 11)) O = O + "." + (prec >= 0 ? "0".repeat(prec) : "");
|
||||
break;
|
||||
|
||||
/* e/E exponential */
|
||||
case 2: case 12:
|
||||
O = Vnum.toExponential(prec);
|
||||
E = O.indexOf("e");
|
||||
if(O.length - E === 3) O = O.substr(0, E+2) + "0" + O.substr(E+2);
|
||||
if(alt && O.indexOf(".") == -1) O = O.substr(0,E) +"."+ O.substr(E);
|
||||
else if(!alt && isnum == 12) O = O.replace(/\.0*e/, "e").replace(/\.(\d*[1-9])0*e/, ".$1e");
|
||||
break;
|
||||
|
||||
/* a/A hex */
|
||||
case 4:
|
||||
if(Vnum===0){O= "0x0"+((alt||prec>0)?"."+(prec >= 0 ? "0".repeat(prec) : ""):"")+"p+0"; break;}
|
||||
O = Vnum.toString(16);
|
||||
/* First char 0-9 */
|
||||
var ac = O.charCodeAt(0);
|
||||
if(ac == 48) {
|
||||
ac = 2; E = -4; Vnum *= 16;
|
||||
while(O.charCodeAt(ac++) == 48) { E -= 4; Vnum *= 16; }
|
||||
O = Vnum.toString(16);
|
||||
ac = O.charCodeAt(0);
|
||||
}
|
||||
|
||||
var ai = O.indexOf(".");
|
||||
if(O.indexOf("(") > -1) {
|
||||
/* IE exponential form */
|
||||
var am = O.match(/\(e(.*)\)/);
|
||||
var ae = am ? (+am[1]) : 0;
|
||||
E += 4 * ae; Vnum /= Math.pow(16, ae);
|
||||
} else if(ai > 1) {
|
||||
E += 4 * (ai - 1); Vnum /= Math.pow(16, ai - 1);
|
||||
} else if(ai == -1) {
|
||||
E += 4 * (O.length - 1); Vnum /= Math.pow(16, O.length - 1);
|
||||
}
|
||||
|
||||
/* at this point 1 <= Vnum < 16 */
|
||||
|
||||
if(bytes > 8) {
|
||||
if(ac < 50) { E -= 3; Vnum *= 8; }
|
||||
else if(ac < 52) { E -= 2; Vnum *= 4; }
|
||||
else if(ac < 56) { E -= 1; Vnum *= 2; }
|
||||
/* at this point 8 <= Vnum < 16 */
|
||||
} else {
|
||||
if(ac >= 56) { E += 3; Vnum /= 8; }
|
||||
else if(ac >= 52) { E += 2; Vnum /= 4; }
|
||||
else if(ac >= 50) { E += 1; Vnum /= 2; }
|
||||
/* at this point 1 <= Vnum < 2 */
|
||||
}
|
||||
|
||||
O = Vnum.toString(16);
|
||||
if(O.length > 1) {
|
||||
if(O.length > prec+2 && O.charCodeAt(prec+2) >= 56) {
|
||||
var _f = O.charCodeAt(0) == 102;
|
||||
O = (Vnum + 8 * Math.pow(16, -prec-1)).toString(16);
|
||||
if(_f && O.charCodeAt(0) == 49) E += 4;
|
||||
}
|
||||
if(prec > 0) {
|
||||
O = O.substr(0, prec + 2);
|
||||
if(O.length < prec + 2) {
|
||||
if(O.charCodeAt(0) < 48) O = O.charAt(0) + ((prec + 2 - O.length) >= 0 ? "0".repeat((prec + 2 - O.length)) : "") + O.substr(1);
|
||||
else O += ((prec + 2 - O.length) >= 0 ? "0".repeat((prec + 2 - O.length)) : "");
|
||||
}
|
||||
} else if(prec === 0) O = O.charAt(0) + (alt ? "." : "");
|
||||
} else if(prec > 0) O = O + "." + (prec >= 0 ? "0".repeat(prec) : "");
|
||||
else if(alt) O = O + ".";
|
||||
O = "0x" + O + "p" + (E>=0 ? "+" + E : E);
|
||||
break;
|
||||
}
|
||||
|
||||
if(sg === "") {
|
||||
if(flags.indexOf("+") > -1) sg = "+";
|
||||
else if(flags.indexOf(" ") > -1) sg = " ";
|
||||
}
|
||||
|
||||
O = sg + O;
|
||||
}
|
||||
|
||||
/* width */
|
||||
if(width > O.length) {
|
||||
if(flags.indexOf("-") > -1) {
|
||||
O = O + ((width - O.length) >= 0 ? " ".repeat((width - O.length)) : "");
|
||||
} else if(flags.indexOf("0") > -1 && O.length > 0 && isf) {
|
||||
pad = ((width - O.length) >= 0 ? "0".repeat((width - O.length)) : "");
|
||||
if(O.charCodeAt(0) < 48) {
|
||||
if(O.charAt(2).toLowerCase() == "x") O = O.substr(0,3) + pad + O.substring(3);
|
||||
else O = O.substr(0,1) + pad + O.substring(1);
|
||||
}
|
||||
else if(O.charAt(1).toLowerCase() == "x") O = O.substr(0,2) + pad + O.substring(2);
|
||||
else O = pad + O;
|
||||
} else {
|
||||
O = ((width - O.length) >= 0 ? " ".repeat((width - O.length)) : "") + O;
|
||||
}
|
||||
}
|
||||
if(c < 96) O = O.toUpperCase();
|
||||
|
||||
}
|
||||
|
||||
o += /*.push*/(O);
|
||||
}
|
||||
return o/*.join("")*/;
|
||||
}
|
||||
|
||||
function vsprintf(fmt, args) { return doit(tokenize(fmt), args); }
|
||||
|
||||
function sprintf() {
|
||||
var args = new Array(arguments.length - 1);
|
||||
for(var i = 0; i < args.length; ++i) args[i] = arguments[i+1];
|
||||
return doit(tokenize(arguments[0]), args);
|
||||
}
|
||||
|
||||
PRINTJ.sprintf = sprintf;
|
||||
PRINTJ.vsprintf = vsprintf;
|
||||
PRINTJ._doit = doit;
|
||||
PRINTJ._tokenize = tokenize;
|
||||
|
||||
}));
|
||||
|
||||
579
node_modules/crc-32/node_modules/printj/printj.mjs
generated
vendored
Normal file
579
node_modules/crc-32/node_modules/printj/printj.mjs
generated
vendored
Normal file
@@ -0,0 +1,579 @@
|
||||
/* printj.js (C) 2016-present SheetJS -- http://sheetjs.com */
|
||||
/* vim: set ts=2: */
|
||||
/*jshint sub:true, eqnull:true */
|
||||
/*exported PRINTJ */
|
||||
/*:: declare var DO_NOT_EXPORT_PRINTJ:?boolean; */
|
||||
/*:: declare function define(cb:()=>any):void; */
|
||||
|
||||
var PRINTJ/*:PRINTJModule*/ = /*::(*/{}/*:: :any)*/;
|
||||
|
||||
PRINTJ.version = '1.3.1';
|
||||
|
||||
export const version = PRINTJ.version;
|
||||
|
||||
var tcache = {};
|
||||
|
||||
function tokenize(fmt/*:string*/)/*:ParsedFmt*/ {
|
||||
if(tcache[fmt]) return tcache[fmt];
|
||||
var out/*:ParsedFmt*/ = [];
|
||||
var start/*:number*/ = 0;
|
||||
|
||||
var i/*:number*/ = 0;
|
||||
var infmt/*:boolean*/ = false;
|
||||
var fmtparam/*:string*/ = "", fmtflags/*:string*/ = "", fmtwidth/*:string*/ = "", fmtprec/*:string*/ = "", fmtlen/*:string*/ = "";
|
||||
|
||||
var c/*:number*/ = 0;
|
||||
|
||||
var L/*:number*/ = fmt.length;
|
||||
|
||||
for(; i < L; ++i) {
|
||||
c = fmt.charCodeAt(i);
|
||||
if(!infmt) {
|
||||
|
||||
if(c !== 37) continue;
|
||||
|
||||
if(start < i) out.push(["L", fmt.substring(start, i)]);
|
||||
start = i;
|
||||
infmt = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
if(c >= 48 && c < 58) {
|
||||
if(fmtprec.length) fmtprec += String.fromCharCode(c);
|
||||
else if(c == 48 && !fmtwidth.length) fmtflags += String.fromCharCode(c);
|
||||
else fmtwidth += String.fromCharCode(c);
|
||||
} else switch(c) {
|
||||
/* positional */
|
||||
case 36:
|
||||
if(fmtprec.length) fmtprec += "$";
|
||||
else if(fmtwidth.charAt(0) == "*") fmtwidth += "$";
|
||||
else { fmtparam = fmtwidth + "$"; fmtwidth = ""; }
|
||||
break;
|
||||
|
||||
/* flags */
|
||||
case 39: fmtflags += "'"; break;
|
||||
case 45: fmtflags += "-"; break;
|
||||
case 43: fmtflags += "+"; break;
|
||||
case 32: fmtflags += " "; break;
|
||||
case 35: fmtflags += "#"; break;
|
||||
|
||||
/* width and precision */
|
||||
case 46: fmtprec = "."; break;
|
||||
case 42:
|
||||
if(fmtprec.charAt(0) == ".") fmtprec += "*";
|
||||
else fmtwidth += "*";
|
||||
break;
|
||||
|
||||
/* length */
|
||||
case 104:
|
||||
case 108:
|
||||
if(fmtlen.length > 1) throw "bad length " + fmtlen + String(c);
|
||||
fmtlen += String.fromCharCode(c);
|
||||
break;
|
||||
|
||||
case 76:
|
||||
case 106:
|
||||
case 122:
|
||||
case 116:
|
||||
case 113:
|
||||
case 90:
|
||||
case 119:
|
||||
if(fmtlen !== "") throw "bad length " + fmtlen + String.fromCharCode(c);
|
||||
fmtlen = String.fromCharCode(c);
|
||||
break;
|
||||
|
||||
case 73:
|
||||
if(fmtlen !== "") throw "bad length " + fmtlen + 'I';
|
||||
fmtlen = 'I';
|
||||
break;
|
||||
|
||||
/* conversion */
|
||||
case 100:
|
||||
case 105:
|
||||
case 111:
|
||||
case 117:
|
||||
case 120:
|
||||
case 88:
|
||||
case 102:
|
||||
case 70:
|
||||
case 101:
|
||||
case 69:
|
||||
case 103:
|
||||
case 71:
|
||||
case 97:
|
||||
case 65:
|
||||
case 99:
|
||||
case 67:
|
||||
case 115:
|
||||
case 83:
|
||||
case 112:
|
||||
case 110:
|
||||
case 68:
|
||||
case 85:
|
||||
case 79:
|
||||
case 109:
|
||||
case 98:
|
||||
case 66:
|
||||
case 121:
|
||||
case 89:
|
||||
case 74:
|
||||
case 86:
|
||||
case 84:
|
||||
case 37:
|
||||
infmt = false;
|
||||
if(fmtprec.length > 1) fmtprec = fmtprec.substr(1);
|
||||
out.push([String.fromCharCode(c), fmt.substring(start, i+1), fmtparam, fmtflags, fmtwidth, fmtprec, fmtlen]);
|
||||
start = i+1;
|
||||
fmtlen = fmtprec = fmtwidth = fmtflags = fmtparam = "";
|
||||
break;
|
||||
default:
|
||||
throw new Error("Invalid format string starting with |" + fmt.substring(start, i+1) + "|");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(start < fmt.length) out.push(["L", fmt.substring(start)]);
|
||||
return (tcache[fmt] = out);
|
||||
}
|
||||
|
||||
var u_inspect/*:(o:any)=>string*/ = JSON.stringify;
|
||||
|
||||
function doit(t/*:ParsedFmt*/, args/*:Array<any>*/)/*:string*/ {
|
||||
//var o/*:Array<string>*/ = [];
|
||||
var o = "";
|
||||
var argidx/*:number*/ = 0, idx/*:number*/ = 0;
|
||||
var Vnum/*:number*/ = 0;
|
||||
var pad/*:string*/ = "";
|
||||
for(var i/*:number*/ = 0; i < t.length; ++i) {
|
||||
var m/*:ParsedEntry*/ = t[i], c/*:number*/ = (m[0]/*:string*/).charCodeAt(0);
|
||||
/* m order: conv full param flags width prec length */
|
||||
|
||||
if(c === /*L*/ 76) { o += /*o.push*/(m[1]); continue; }
|
||||
if(c === /*%*/ 37) { o += /*o.push*/("%"); continue; }
|
||||
|
||||
var O/*:string*/ = "";
|
||||
var isnum/*:number*/ = 0, radix/*:number*/ = 10, bytes/*:number*/ = 4, sign/*:boolean*/ = false;
|
||||
|
||||
/* flags */
|
||||
var flags/*:string*/ = m[3]/*||""*/;
|
||||
var alt/*:boolean*/ = flags.indexOf("#") > -1;
|
||||
|
||||
/* position */
|
||||
if(m[2]) argidx = parseInt(m[2], 10)-1;
|
||||
/* %m special case */
|
||||
else if(c === /*m*/ 109 && !alt) { o += /*.push*/("Success"); continue; }
|
||||
|
||||
/* grab width */
|
||||
var width = 0; if( m[ 4].length > 0) { if(m[ 4].charAt(0) !== '*') width = parseInt(m[ 4], 10); else if(m[ 4].length === 1) width = args[idx++]; else width = args[parseInt(m[ 4].substr(1), 10)-1]; }
|
||||
|
||||
/* grab precision */
|
||||
var prec = -1; if( m[ 5].length > 0) { if(m[ 5].charAt(0) !== '*') prec = parseInt(m[ 5], 10); else if(m[ 5].length === 1) prec = args[idx++]; else prec = args[parseInt(m[ 5].substr(1), 10)-1]; }
|
||||
|
||||
/* position not specified */
|
||||
if(!m[2]) argidx = idx++;
|
||||
|
||||
/* grab argument */
|
||||
var arg/*:any*/ = args[argidx];
|
||||
|
||||
/* grab length */
|
||||
var len/*:string*/ = m[6]/* || ""*/;
|
||||
|
||||
switch(c) {
|
||||
/* str cCsS */
|
||||
|
||||
case /*S*/ 83:
|
||||
case /*s*/ 115:
|
||||
/* only valid flag is "-" for left justification */
|
||||
O = String(arg);
|
||||
if( prec >= 0) O = O.substr(0, prec);
|
||||
if( width > O.length || - width > O.length) { if(( flags.indexOf("-") == -1 || width < 0) && flags.indexOf("0") != -1) { pad = ( width - O.length >= 0 ? "0".repeat( width - O.length) : ""); O = pad + O; } else { pad = ( width - O.length >= 0 ? " ".repeat( width - O.length) : ""); O = flags.indexOf("-") > -1 ? O + pad : pad + O; } }
|
||||
break;
|
||||
|
||||
/* first char of string or convert */
|
||||
case /*C*/ 67:
|
||||
case /*c*/ 99:
|
||||
switch(typeof arg) {
|
||||
case "number":
|
||||
var cc/*:number*/ = arg;
|
||||
if(c == 67 || len.charCodeAt(0) === /*l*/ 108) { cc &= 0xFFFFFFFF; O = String.fromCharCode( cc); }
|
||||
else { cc &= 0xFF; O = String.fromCharCode( cc); }
|
||||
break;
|
||||
case "string": O = /*::(*/arg/*:: :string)*/.charAt(0); break;
|
||||
default: O = String(arg).charAt(0);
|
||||
}
|
||||
if( width > O.length || - width > O.length) { if(( flags.indexOf("-") == -1 || width < 0) && flags.indexOf("0") != -1) { pad = ( width - O.length >= 0 ? "0".repeat( width - O.length) : ""); O = pad + O; } else { pad = ( width - O.length >= 0 ? " ".repeat( width - O.length) : ""); O = flags.indexOf("-") > -1 ? O + pad : pad + O; } }
|
||||
break;
|
||||
|
||||
/* int diDuUoOxXbB */
|
||||
|
||||
/* signed integer */
|
||||
case /*D*/ 68: bytes = 8;
|
||||
/* falls through */
|
||||
case /*d*/ 100:
|
||||
case /*i*/ 105: isnum = -1; sign = true; break;
|
||||
|
||||
/* unsigned integer */
|
||||
case /*U*/ 85: bytes = 8;
|
||||
/* falls through */
|
||||
case /*u*/ 117: isnum = -1; break;
|
||||
|
||||
/* unsigned octal */
|
||||
case /*O*/ 79: bytes = 8;
|
||||
/* falls through */
|
||||
case /*o*/ 111: isnum = -1; radix = (8); break;
|
||||
|
||||
/* unsigned hex */
|
||||
case /*x*/ 120: isnum = -1; radix = (-16); break;
|
||||
case /*X*/ 88: isnum = -1; radix = (16); break;
|
||||
|
||||
/* unsigned binary (extension) */
|
||||
case /*B*/ 66: bytes = 8;
|
||||
/* falls through */
|
||||
case /*b*/ 98: isnum = -1; radix = (2); break;
|
||||
|
||||
/* flt fegFEGaA */
|
||||
|
||||
/* floating point logic */
|
||||
case /*F*/ 70:
|
||||
case /*f*/ 102: isnum = (1); break;
|
||||
|
||||
case /*E*/ 69:
|
||||
case /*e*/ 101: isnum = (2); break;
|
||||
|
||||
case /*G*/ 71:
|
||||
case /*g*/ 103: isnum = (3); break;
|
||||
|
||||
/* floating hex */
|
||||
case /*A*/ 65:
|
||||
case /*a*/ 97: isnum = (4); break;
|
||||
|
||||
/* misc pnmJVTyY */
|
||||
|
||||
/* JS has no concept of pointers so interpret the `l` key as an address */
|
||||
case /*p*/ 112:
|
||||
Vnum = typeof arg == "number" ? arg : arg ? Number(arg.l) : -1;
|
||||
if(isNaN(Vnum)) Vnum = -1;
|
||||
if(alt) O = Vnum.toString(10);
|
||||
else {
|
||||
Vnum = Math.abs(Vnum);
|
||||
O = "0x" + Vnum.toString(16).toLowerCase();
|
||||
}
|
||||
break;
|
||||
|
||||
/* store length in the `len` key */
|
||||
case /*n*/ 110:
|
||||
if(arg) { arg.len = o.length; }
|
||||
//if(arg) { arg.len=0; for(var oo/*:number*/ = 0; oo < o.length; ++oo) arg.len += o[oo].length; }
|
||||
continue;
|
||||
|
||||
/* process error */
|
||||
case /*m*/ 109:
|
||||
if(!(arg instanceof Error)) O = "Success";
|
||||
else if(arg.message) O = arg.message;
|
||||
else if(arg.errno) O = "Error number " + arg.errno;
|
||||
else O = "Error " + String(arg);
|
||||
break;
|
||||
|
||||
/* JS-specific conversions (extension) */
|
||||
case /*J*/ 74: O = (alt ? u_inspect : JSON.stringify)(arg); break;
|
||||
case /*V*/ 86: O = arg == null ? "null" : String(arg.valueOf()); break;
|
||||
case /*T*/ 84:
|
||||
if(alt) { /* from '[object %s]' extract %s */
|
||||
O = Object.prototype.toString.call(arg).substr(8);
|
||||
O = O.substr(0, O.length - 1);
|
||||
} else O = typeof arg;
|
||||
break;
|
||||
|
||||
/* boolean (extension) */
|
||||
case /*Y*/ 89:
|
||||
case /*y*/ 121:
|
||||
O = (arg) ? (alt ? "yes" : "true") : (alt ? "no" : "false");
|
||||
if(c == /*Y*/ 89) O = O.toUpperCase();
|
||||
if( prec >= 0) O = O.substr(0, prec);
|
||||
if( width > O.length || - width > O.length) { if(( flags.indexOf("-") == -1 || width < 0) && flags.indexOf("0") != -1) { pad = ( width - O.length >= 0 ? "0".repeat( width - O.length) : ""); O = pad + O; } else { pad = ( width - O.length >= 0 ? " ".repeat( width - O.length) : ""); O = flags.indexOf("-") > -1 ? O + pad : pad + O; } }
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
if(width < 0) { width = -width; flags += "-"; }
|
||||
|
||||
if(isnum == -1) {
|
||||
|
||||
Vnum = Number(arg);
|
||||
|
||||
/* parse byte length field */
|
||||
|
||||
switch(len) {
|
||||
/* char */
|
||||
case "hh": { bytes = 1; } break;
|
||||
/* short */
|
||||
case "h": { bytes = 2; } break;
|
||||
|
||||
/* long */
|
||||
case "l": { if(bytes == 4) bytes = 8; } break;
|
||||
|
||||
/* long long */
|
||||
case "L":
|
||||
case "q":
|
||||
case "ll": { if(bytes == 4) bytes = 8; } break;
|
||||
|
||||
/* intmax_t */
|
||||
case "j": { if(bytes == 4) bytes = 8; } break;
|
||||
|
||||
/* ptrdiff_t */
|
||||
case "t": { if(bytes == 4) bytes = 8; } break;
|
||||
|
||||
/* size_t */
|
||||
case "z":
|
||||
case "Z": { if(bytes == 4) bytes = 8; } break;
|
||||
|
||||
/* CRT size_t or ptrdiff_t */
|
||||
case "I":
|
||||
|
||||
{ if(bytes == 4) bytes = 8; }
|
||||
|
||||
break;
|
||||
|
||||
/* CRT wchar_t */
|
||||
case "w": break;
|
||||
}
|
||||
|
||||
/* restrict value */
|
||||
|
||||
switch(bytes) {
|
||||
case 1: Vnum = (Vnum & 0xFF); if(sign && (Vnum > 0x7F)) Vnum -= (0xFF + 1); break;
|
||||
case 2: Vnum = (Vnum & 0xFFFF); if(sign && (Vnum > 0x7FFF)) Vnum -= (0xFFFF + 1); break;
|
||||
case 4: Vnum = sign ? (Vnum | 0) : (Vnum >>> 0); break;
|
||||
default: Vnum = isNaN(Vnum) ? 0 : Math.round(Vnum); break;
|
||||
}
|
||||
|
||||
/* generate string */
|
||||
if(bytes > 4 && Vnum < 0 && !sign) {
|
||||
if(radix == 16 || radix == -16) {
|
||||
O = (Vnum>>>0).toString(16);
|
||||
Vnum = Math.floor((Vnum - (Vnum >>> 0)) / Math.pow(2,32));
|
||||
O = (Vnum>>>0).toString(16) + (8 - O.length >= 0 ? "0".repeat(8 - O.length) : "") + O;
|
||||
O = (16 - O.length >= 0 ? "f".repeat(16 - O.length) : "") + O;
|
||||
if(radix == 16) O = O.toUpperCase();
|
||||
} else if(radix == 8) {
|
||||
O = (Vnum>>>0).toString(8);
|
||||
O = (10 - O.length >= 0 ? "0".repeat(10 - O.length) : "") + O;
|
||||
Vnum = Math.floor((Vnum - ((Vnum >>> 0)&0x3FFFFFFF)) / Math.pow(2,30));
|
||||
O = (Vnum>>>0).toString(8) + O.substr(O.length - 10);
|
||||
O = O.substr(O.length - 20);
|
||||
O = "1" + (21 - O.length >= 0 ? "7".repeat(21 - O.length) : "") + O;
|
||||
} else {
|
||||
Vnum = (-Vnum) % 1e16;
|
||||
var d1/*:Array<number>*/ = [1,8,4,4,6,7,4,4,0,7,3,7,0,9,5,5,1,6,1,6];
|
||||
var di/*:number*/ = d1.length - 1;
|
||||
while(Vnum > 0) {
|
||||
if((d1[di] -= (Vnum % 10)) < 0) { d1[di] += 10; d1[di-1]--; }
|
||||
--di; Vnum = Math.floor(Vnum / 10);
|
||||
}
|
||||
O = d1.join("");
|
||||
}
|
||||
} else {
|
||||
if(radix === -16) O = Vnum.toString(16).toLowerCase();
|
||||
else if(radix === 16) O = Vnum.toString(16).toUpperCase();
|
||||
else O = Vnum.toString(radix);
|
||||
}
|
||||
|
||||
/* apply precision */
|
||||
if(prec ===0 && O == "0" && !(radix == 8 && alt)) O = ""; /* bail out */
|
||||
else {
|
||||
if(O.length < prec + (O.substr(0,1) == "-" ? 1 : 0)) {
|
||||
if(O.substr(0,1) != "-") O = (prec - O.length >= 0 ? "0".repeat(prec - O.length) : "") + O;
|
||||
else O = O.substr(0,1) + (prec + 1 - O.length >= 0 ? "0".repeat(prec + 1 - O.length) : "") + O.substr(1);
|
||||
}
|
||||
|
||||
/* add prefix for # form */
|
||||
if(!sign && alt && Vnum !== 0) switch(radix) {
|
||||
case -16: O = "0x" + O; break;
|
||||
case 16: O = "0X" + O; break;
|
||||
case 8: if(O.charAt(0) != "0") O = "0" + O; break;
|
||||
case 2: O = "0b" + O; break;
|
||||
}
|
||||
}
|
||||
|
||||
/* add sign character */
|
||||
if(sign && O.charAt(0) != "-") {
|
||||
if(flags.indexOf("+") > -1) O = "+" + O;
|
||||
else if(flags.indexOf(" ") > -1) O = " " + O;
|
||||
}
|
||||
/* width */
|
||||
if(width > 0) {
|
||||
if(O.length < width) {
|
||||
if(flags.indexOf("-") > -1) {
|
||||
O = O + ((width - O.length) >= 0 ? " ".repeat((width - O.length)) : "");
|
||||
} else if(flags.indexOf("0") > -1 && prec < 0 && O.length > 0) {
|
||||
if(prec > O.length) O = ((prec - O.length) >= 0 ? "0".repeat((prec - O.length)) : "") + O;
|
||||
pad = ((width - O.length) >= 0 ? (prec > 0 ? " " : "0").repeat((width - O.length)) : "");
|
||||
if(O.charCodeAt(0) < 48) {
|
||||
if(O.charAt(2).toLowerCase() == "x") O = O.substr(0,3) + pad + O.substring(3);
|
||||
else O = O.substr(0,1) + pad + O.substring(1);
|
||||
}
|
||||
else if(O.charAt(1).toLowerCase() == "x") O = O.substr(0,2) + pad + O.substring(2);
|
||||
else O = pad + O;
|
||||
} else {
|
||||
O = ((width - O.length) >= 0 ? " ".repeat((width - O.length)) : "") + O;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} else if(isnum > 0) {
|
||||
|
||||
Vnum = Number(arg);
|
||||
if(arg === null) Vnum = 0/0;
|
||||
if(len == "L") bytes = 12;
|
||||
var isf/*:boolean*/ = isFinite(Vnum);
|
||||
if(!isf) { /* Infinity or NaN */
|
||||
if(Vnum < 0) O = "-";
|
||||
else if(flags.indexOf("+") > -1) O = "+";
|
||||
else if(flags.indexOf(" ") > -1) O = " ";
|
||||
O += (isNaN(Vnum)) ? "nan" : "inf";
|
||||
} else {
|
||||
var E/*:number*/ = 0;
|
||||
|
||||
if(prec == -1 && isnum != 4) prec = 6;
|
||||
|
||||
/* g/G conditional behavior */
|
||||
if(isnum == 3) {
|
||||
O = Vnum.toExponential(1);
|
||||
E = +O.substr(O.indexOf("e") + 1);
|
||||
if(prec === 0) prec = 1;
|
||||
if(prec > E && E >= -4) { isnum = (11); prec = prec -(E + 1); }
|
||||
else { isnum = (12); prec = prec - 1; }
|
||||
}
|
||||
|
||||
/* sign: workaround for negative zero */
|
||||
var sg/*:string*/ = (Vnum < 0 || 1/Vnum == -Infinity) ? "-" : "";
|
||||
if(Vnum < 0) Vnum = -Vnum;
|
||||
|
||||
switch(isnum) {
|
||||
/* f/F standard */
|
||||
case 1: case 11:
|
||||
if(Vnum < 1e21) {
|
||||
O = Vnum.toFixed(prec);
|
||||
if(isnum == 1) { if(prec===0 &&alt&& O.indexOf(".")==-1) O+="."; }
|
||||
else if(!alt) O=O.replace(/(\.\d*[1-9])0*$/,"$1").replace(/\.0*$/,"");
|
||||
else if(O.indexOf(".") == -1) O+= ".";
|
||||
break;
|
||||
}
|
||||
O = Vnum.toExponential(20);
|
||||
E = +O.substr(O.indexOf("e")+1);
|
||||
O = O.charAt(0) + O.substr(2,O.indexOf("e")-2);
|
||||
O = O + (E - O.length + 1 >= 0 ? "0".repeat(E - O.length + 1) : "");
|
||||
if(alt || (prec > 0 && isnum !== 11)) O = O + "." + (prec >= 0 ? "0".repeat(prec) : "");
|
||||
break;
|
||||
|
||||
/* e/E exponential */
|
||||
case 2: case 12:
|
||||
O = Vnum.toExponential(prec);
|
||||
E = O.indexOf("e");
|
||||
if(O.length - E === 3) O = O.substr(0, E+2) + "0" + O.substr(E+2);
|
||||
if(alt && O.indexOf(".") == -1) O = O.substr(0,E) +"."+ O.substr(E);
|
||||
else if(!alt && isnum == 12) O = O.replace(/\.0*e/, "e").replace(/\.(\d*[1-9])0*e/, ".$1e");
|
||||
break;
|
||||
|
||||
/* a/A hex */
|
||||
case 4:
|
||||
if(Vnum===0){O= "0x0"+((alt||prec>0)?"."+(prec >= 0 ? "0".repeat(prec) : ""):"")+"p+0"; break;}
|
||||
O = Vnum.toString(16);
|
||||
/* First char 0-9 */
|
||||
var ac/*:number*/ = O.charCodeAt(0);
|
||||
if(ac == 48) {
|
||||
ac = 2; E = -4; Vnum *= 16;
|
||||
while(O.charCodeAt(ac++) == 48) { E -= 4; Vnum *= 16; }
|
||||
O = Vnum.toString(16);
|
||||
ac = O.charCodeAt(0);
|
||||
}
|
||||
|
||||
var ai/*:number*/ = O.indexOf(".");
|
||||
if(O.indexOf("(") > -1) {
|
||||
/* IE exponential form */
|
||||
var am/*:?Array<any>*/ = O.match(/\(e(.*)\)/);
|
||||
var ae/*:number*/ = am ? (+am[1]) : 0;
|
||||
E += 4 * ae; Vnum /= Math.pow(16, ae);
|
||||
} else if(ai > 1) {
|
||||
E += 4 * (ai - 1); Vnum /= Math.pow(16, ai - 1);
|
||||
} else if(ai == -1) {
|
||||
E += 4 * (O.length - 1); Vnum /= Math.pow(16, O.length - 1);
|
||||
}
|
||||
|
||||
/* at this point 1 <= Vnum < 16 */
|
||||
|
||||
if(bytes > 8) {
|
||||
if(ac < 50) { E -= 3; Vnum *= 8; }
|
||||
else if(ac < 52) { E -= 2; Vnum *= 4; }
|
||||
else if(ac < 56) { E -= 1; Vnum *= 2; }
|
||||
/* at this point 8 <= Vnum < 16 */
|
||||
} else {
|
||||
if(ac >= 56) { E += 3; Vnum /= 8; }
|
||||
else if(ac >= 52) { E += 2; Vnum /= 4; }
|
||||
else if(ac >= 50) { E += 1; Vnum /= 2; }
|
||||
/* at this point 1 <= Vnum < 2 */
|
||||
}
|
||||
|
||||
O = Vnum.toString(16);
|
||||
if(O.length > 1) {
|
||||
if(O.length > prec+2 && O.charCodeAt(prec+2) >= 56) {
|
||||
var _f/*:boolean*/ = O.charCodeAt(0) == 102;
|
||||
O = (Vnum + 8 * Math.pow(16, -prec-1)).toString(16);
|
||||
if(_f && O.charCodeAt(0) == 49) E += 4;
|
||||
}
|
||||
if(prec > 0) {
|
||||
O = O.substr(0, prec + 2);
|
||||
if(O.length < prec + 2) {
|
||||
if(O.charCodeAt(0) < 48) O = O.charAt(0) + ((prec + 2 - O.length) >= 0 ? "0".repeat((prec + 2 - O.length)) : "") + O.substr(1);
|
||||
else O += ((prec + 2 - O.length) >= 0 ? "0".repeat((prec + 2 - O.length)) : "");
|
||||
}
|
||||
} else if(prec === 0) O = O.charAt(0) + (alt ? "." : "");
|
||||
} else if(prec > 0) O = O + "." + (prec >= 0 ? "0".repeat(prec) : "");
|
||||
else if(alt) O = O + ".";
|
||||
O = "0x" + O + "p" + (E>=0 ? "+" + E : E);
|
||||
break;
|
||||
}
|
||||
|
||||
if(sg === "") {
|
||||
if(flags.indexOf("+") > -1) sg = "+";
|
||||
else if(flags.indexOf(" ") > -1) sg = " ";
|
||||
}
|
||||
|
||||
O = sg + O;
|
||||
}
|
||||
|
||||
/* width */
|
||||
if(width > O.length) {
|
||||
if(flags.indexOf("-") > -1) {
|
||||
O = O + ((width - O.length) >= 0 ? " ".repeat((width - O.length)) : "");
|
||||
} else if(flags.indexOf("0") > -1 && O.length > 0 && isf) {
|
||||
pad = ((width - O.length) >= 0 ? "0".repeat((width - O.length)) : "");
|
||||
if(O.charCodeAt(0) < 48) {
|
||||
if(O.charAt(2).toLowerCase() == "x") O = O.substr(0,3) + pad + O.substring(3);
|
||||
else O = O.substr(0,1) + pad + O.substring(1);
|
||||
}
|
||||
else if(O.charAt(1).toLowerCase() == "x") O = O.substr(0,2) + pad + O.substring(2);
|
||||
else O = pad + O;
|
||||
} else {
|
||||
O = ((width - O.length) >= 0 ? " ".repeat((width - O.length)) : "") + O;
|
||||
}
|
||||
}
|
||||
if(c < 96) O = O.toUpperCase();
|
||||
|
||||
}
|
||||
|
||||
o += /*.push*/(O);
|
||||
}
|
||||
return o/*.join("")*/;
|
||||
}
|
||||
|
||||
function vsprintf(fmt/*:string*/, args/*:Args*/)/*:string*/ { return doit(tokenize(fmt), args); }
|
||||
|
||||
function sprintf(/*:: ...argz*/)/*:string*/ {
|
||||
var args/*:Array<any>*/ = new Array(arguments.length - 1);
|
||||
for(var i/*:number*/ = 0; i < args.length; ++i) args[i] = arguments[i+1];
|
||||
return doit(tokenize(arguments[0]), args);
|
||||
}
|
||||
|
||||
export { sprintf, vsprintf };
|
||||
|
||||
276
node_modules/crc-32/node_modules/printj/shim.js
generated
vendored
Normal file
276
node_modules/crc-32/node_modules/printj/shim.js
generated
vendored
Normal file
@@ -0,0 +1,276 @@
|
||||
// From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys
|
||||
if (!Object.keys) {
|
||||
Object.keys = (function () {
|
||||
var hasOwnProperty = Object.prototype.hasOwnProperty,
|
||||
hasDontEnumBug = !({toString: null}).propertyIsEnumerable('toString'),
|
||||
dontEnums = [
|
||||
'toString',
|
||||
'toLocaleString',
|
||||
'valueOf',
|
||||
'hasOwnProperty',
|
||||
'isPrototypeOf',
|
||||
'propertyIsEnumerable',
|
||||
'constructor'
|
||||
],
|
||||
dontEnumsLength = dontEnums.length;
|
||||
|
||||
return function (obj) {
|
||||
if (typeof obj !== 'object' && typeof obj !== 'function' || obj === null) throw new TypeError('Object.keys called on non-object');
|
||||
|
||||
var result = [];
|
||||
|
||||
for (var prop in obj) {
|
||||
if (hasOwnProperty.call(obj, prop)) result.push(prop);
|
||||
}
|
||||
|
||||
if (hasDontEnumBug) {
|
||||
for (var i=0; i < dontEnumsLength; i++) {
|
||||
if (hasOwnProperty.call(obj, dontEnums[i])) result.push(dontEnums[i]);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
};
|
||||
})();
|
||||
}
|
||||
|
||||
// From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter
|
||||
if (!Array.prototype.filter)
|
||||
{
|
||||
Array.prototype.filter = function(fun /*, thisp */)
|
||||
{
|
||||
"use strict";
|
||||
|
||||
if (this == null)
|
||||
throw new TypeError();
|
||||
|
||||
var t = Object(this);
|
||||
var len = t.length >>> 0;
|
||||
if (typeof fun != "function")
|
||||
throw new TypeError();
|
||||
|
||||
var res = [];
|
||||
var thisp = arguments[1];
|
||||
for (var i = 0; i < len; i++)
|
||||
{
|
||||
if (i in t)
|
||||
{
|
||||
var val = t[i]; // in case fun mutates this
|
||||
if (fun.call(thisp, val, i, t))
|
||||
res.push(val);
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
};
|
||||
}
|
||||
|
||||
// From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/Trim
|
||||
if (!String.prototype.trim) {
|
||||
String.prototype.trim = function () {
|
||||
return this.replace(/^\s+|\s+$/g, '');
|
||||
};
|
||||
}
|
||||
|
||||
// From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach
|
||||
if (!Array.prototype.forEach)
|
||||
{
|
||||
Array.prototype.forEach = function(fun /*, thisArg */)
|
||||
{
|
||||
"use strict";
|
||||
|
||||
if (this === void 0 || this === null)
|
||||
throw new TypeError();
|
||||
|
||||
var t = Object(this);
|
||||
var len = t.length >>> 0;
|
||||
if (typeof fun !== "function")
|
||||
throw new TypeError();
|
||||
|
||||
var thisArg = arguments.length >= 2 ? arguments[1] : void 0;
|
||||
for (var i = 0; i < len; i++)
|
||||
{
|
||||
if (i in t)
|
||||
fun.call(thisArg, t[i], i, t);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// Production steps of ECMA-262, Edition 5, 15.4.4.19
|
||||
// Reference: http://es5.github.com/#x15.4.4.19
|
||||
if (!Array.prototype.map) {
|
||||
Array.prototype.map = function(callback, thisArg) {
|
||||
|
||||
var T, A, k;
|
||||
|
||||
if (this == null) {
|
||||
throw new TypeError(" this is null or not defined");
|
||||
}
|
||||
|
||||
// 1. Let O be the result of calling ToObject passing the |this| value as the argument.
|
||||
var O = Object(this);
|
||||
|
||||
// 2. Let lenValue be the result of calling the Get internal method of O with the argument "length".
|
||||
// 3. Let len be ToUint32(lenValue).
|
||||
var len = O.length >>> 0;
|
||||
|
||||
// 4. If IsCallable(callback) is false, throw a TypeError exception.
|
||||
// See: http://es5.github.com/#x9.11
|
||||
if (typeof callback !== "function") {
|
||||
throw new TypeError(callback + " is not a function");
|
||||
}
|
||||
|
||||
// 5. If thisArg was supplied, let T be thisArg; else let T be undefined.
|
||||
if (thisArg) {
|
||||
T = thisArg;
|
||||
}
|
||||
|
||||
// 6. Let A be a new array created as if by the expression new Array(len) where Array is
|
||||
// the standard built-in constructor with that name and len is the value of len.
|
||||
A = new Array(len);
|
||||
|
||||
// 7. Let k be 0
|
||||
k = 0;
|
||||
|
||||
// 8. Repeat, while k < len
|
||||
while(k < len) {
|
||||
|
||||
var kValue, mappedValue;
|
||||
|
||||
// a. Let Pk be ToString(k).
|
||||
// This is implicit for LHS operands of the in operator
|
||||
// b. Let kPresent be the result of calling the HasProperty internal method of O with argument Pk.
|
||||
// This step can be combined with c
|
||||
// c. If kPresent is true, then
|
||||
if (k in O) {
|
||||
|
||||
// i. Let kValue be the result of calling the Get internal method of O with argument Pk.
|
||||
kValue = O[ k ];
|
||||
|
||||
// ii. Let mappedValue be the result of calling the Call internal method of callback
|
||||
// with T as the this value and argument list containing kValue, k, and O.
|
||||
mappedValue = callback.call(T, kValue, k, O);
|
||||
|
||||
// iii. Call the DefineOwnProperty internal method of A with arguments
|
||||
// Pk, Property Descriptor {Value: mappedValue, : true, Enumerable: true, Configurable: true},
|
||||
// and false.
|
||||
|
||||
// In browsers that support Object.defineProperty, use the following:
|
||||
// Object.defineProperty(A, Pk, { value: mappedValue, writable: true, enumerable: true, configurable: true });
|
||||
|
||||
// For best browser support, use the following:
|
||||
A[ k ] = mappedValue;
|
||||
}
|
||||
// d. Increase k by 1.
|
||||
k++;
|
||||
}
|
||||
|
||||
// 9. return A
|
||||
return A;
|
||||
};
|
||||
}
|
||||
|
||||
// From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf
|
||||
if (!Array.prototype.indexOf) {
|
||||
Array.prototype.indexOf = function (searchElement, fromIndex) {
|
||||
if ( this === undefined || this === null ) {
|
||||
throw new TypeError( '"this" is null or not defined' );
|
||||
}
|
||||
|
||||
var length = this.length >>> 0; // Hack to convert object.length to a UInt32
|
||||
|
||||
fromIndex = +fromIndex || 0;
|
||||
|
||||
if (Math.abs(fromIndex) === Infinity) {
|
||||
fromIndex = 0;
|
||||
}
|
||||
|
||||
if (fromIndex < 0) {
|
||||
fromIndex += length;
|
||||
if (fromIndex < 0) {
|
||||
fromIndex = 0;
|
||||
}
|
||||
}
|
||||
|
||||
for (;fromIndex < length; fromIndex++) {
|
||||
if (this[fromIndex] === searchElement) {
|
||||
return fromIndex;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
};
|
||||
}
|
||||
// Based on https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray
|
||||
|
||||
if (! Array.isArray) {
|
||||
Array.isArray = function(obj) {
|
||||
return Object.prototype.toString.call(obj) === "[object Array]";
|
||||
};
|
||||
}
|
||||
|
||||
// https://github.com/ttaubert/node-arraybuffer-slice
|
||||
// (c) 2013 Tim Taubert <tim@timtaubert.de>
|
||||
// arraybuffer-slice may be freely distributed under the MIT license.
|
||||
|
||||
"use strict";
|
||||
|
||||
if (typeof ArrayBuffer !== 'undefined' && !ArrayBuffer.prototype.slice) {
|
||||
ArrayBuffer.prototype.slice = function (begin, end) {
|
||||
begin = (begin|0) || 0;
|
||||
var num = this.byteLength;
|
||||
end = end === (void 0) ? num : (end|0);
|
||||
|
||||
// Handle negative values.
|
||||
if (begin < 0) begin += num;
|
||||
if (end < 0) end += num;
|
||||
|
||||
if (num === 0 || begin >= num || begin >= end) {
|
||||
return new ArrayBuffer(0);
|
||||
}
|
||||
|
||||
var length = Math.min(num - begin, end - begin);
|
||||
var target = new ArrayBuffer(length);
|
||||
var targetArray = new Uint8Array(target);
|
||||
targetArray.set(new Uint8Array(this, begin, length));
|
||||
return target;
|
||||
};
|
||||
}
|
||||
|
||||
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat
|
||||
if (!String.prototype.repeat) {
|
||||
String.prototype.repeat = function(count) {
|
||||
'use strict';
|
||||
if (this == null) {
|
||||
throw new TypeError('can\'t convert ' + this + ' to object');
|
||||
}
|
||||
var str = '' + this;
|
||||
count = +count;
|
||||
if (count != count) {
|
||||
count = 0;
|
||||
}
|
||||
if (count < 0) {
|
||||
throw new RangeError('repeat count must be non-negative');
|
||||
}
|
||||
if (count == Infinity) {
|
||||
throw new RangeError('repeat count must be less than infinity');
|
||||
}
|
||||
count = Math.floor(count);
|
||||
if (str.length == 0 || count == 0) {
|
||||
return '';
|
||||
}
|
||||
// Ensuring count is a 31-bit integer allows us to heavily optimize the
|
||||
// main part. But anyway, most current (August 2014) browsers can't handle
|
||||
// strings 1 << 28 chars or longer, so:
|
||||
if (str.length * count >= 1 << 28) {
|
||||
throw new RangeError('repeat count must not overflow maximum string size');
|
||||
}
|
||||
var maxCount = str.length * count;
|
||||
count = Math.floor(Math.log(count) / Math.log(2));
|
||||
while (count) {
|
||||
str += str;
|
||||
count--;
|
||||
}
|
||||
str += str.substring(0, maxCount - str.length);
|
||||
return str;
|
||||
};
|
||||
}
|
||||
10
node_modules/crc-32/node_modules/printj/types/index.d.ts
generated
vendored
Normal file
10
node_modules/crc-32/node_modules/printj/types/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
/* index.d.ts (C) 2015-present SheetJS */
|
||||
|
||||
/** Version string */
|
||||
export const version: string;
|
||||
|
||||
/** Generate formatted string from format and subsequent arguments */
|
||||
export function sprintf(fmt: string, ...args: any[]): string;
|
||||
|
||||
/** Generate formatted string from format and array of variables */
|
||||
export function vsprintf(fmt: string, args: any[]): string;
|
||||
15
node_modules/crc-32/node_modules/printj/types/tsconfig.json
generated
vendored
Normal file
15
node_modules/crc-32/node_modules/printj/types/tsconfig.json
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [ "es5", "dom" ],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": ".",
|
||||
"paths": { "printj": ["."] },
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"strictFunctionTypes": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
}
|
||||
}
|
||||
13
node_modules/crc-32/node_modules/printj/types/tslint.json
generated
vendored
Normal file
13
node_modules/crc-32/node_modules/printj/types/tslint.json
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"extends": "dtslint/dtslint.json",
|
||||
"rules": {
|
||||
"no-implicit-dependencies": false,
|
||||
"whitespace": false,
|
||||
"no-sparse-arrays": false,
|
||||
"only-arrow-functions": false,
|
||||
"no-consecutive-blank-lines": false,
|
||||
"prefer-conditional-expression": false,
|
||||
"prefer-const": true,
|
||||
"one-variable-per-declaration": false
|
||||
}
|
||||
}
|
||||
43
node_modules/crc-32/package.json
generated
vendored
Normal file
43
node_modules/crc-32/package.json
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
{
|
||||
"name": "crc-32",
|
||||
"version": "1.2.1",
|
||||
"author": "sheetjs",
|
||||
"description": "Pure-JS CRC-32",
|
||||
"keywords": [ "crc", "crc32", "checksum" ],
|
||||
"bin": {
|
||||
"crc32": "bin/crc32.njs"
|
||||
},
|
||||
"main": "crc32.js",
|
||||
"types": "types/index.d.ts",
|
||||
"typesVersions": { "*": { "*": ["types/index.d.ts" ] } },
|
||||
"dependencies": {
|
||||
"printj": "~1.3.1",
|
||||
"exit-on-epipe": "~1.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"mocha": "~2.5.3",
|
||||
"blanket": "~1.2.3",
|
||||
"codepage": "~1.10.0",
|
||||
"@sheetjs/uglify-js": "~2.7.3",
|
||||
"@types/node": "^8.0.7",
|
||||
"dtslint": "^0.1.2",
|
||||
"typescript": "2.2.0"
|
||||
},
|
||||
"repository": { "type": "git", "url": "git://github.com/SheetJS/js-crc32.git" },
|
||||
"scripts": {
|
||||
"test": "make test",
|
||||
"build": "make",
|
||||
"lint": "make fullint",
|
||||
"dtslint": "dtslint types"
|
||||
},
|
||||
"config": {
|
||||
"blanket": {
|
||||
"pattern": "crc32.js"
|
||||
}
|
||||
},
|
||||
"homepage": "https://sheetjs.com/",
|
||||
"files": ["crc32.js", "crc32c.js", "bin/crc32.njs", "LICENSE", "README.md", "types/index.d.ts", "types/*.json"],
|
||||
"bugs": { "url": "https://github.com/SheetJS/js-crc32/issues" },
|
||||
"license": "Apache-2.0",
|
||||
"engines": { "node": ">=0.8" }
|
||||
}
|
||||
14
node_modules/crc-32/types/index.d.ts
generated
vendored
Normal file
14
node_modules/crc-32/types/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
/* crc32.js (C) 2014-present SheetJS -- http://sheetjs.com */
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
/** Version string */
|
||||
export const version: string;
|
||||
|
||||
/** Process a node buffer or byte array */
|
||||
export function buf(data: number[] | Uint8Array, seed?: number): number;
|
||||
|
||||
/** Process a binary string */
|
||||
export function bstr(data: string, seed?: number): number;
|
||||
|
||||
/** Process a JS string based on the UTF8 encoding */
|
||||
export function str(data: string, seed?: number): number;
|
||||
14
node_modules/crc-32/types/tsconfig.json
generated
vendored
Normal file
14
node_modules/crc-32/types/tsconfig.json
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [ "es5" ],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"baseUrl": ".",
|
||||
"paths": { "crc-32": ["."] },
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
}
|
||||
}
|
||||
11
node_modules/crc-32/types/tslint.json
generated
vendored
Normal file
11
node_modules/crc-32/types/tslint.json
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"extends": "dtslint/dtslint.json",
|
||||
"rules": {
|
||||
"whitespace": false,
|
||||
"no-sparse-arrays": false,
|
||||
"only-arrow-functions": false,
|
||||
"no-consecutive-blank-lines": false,
|
||||
"prefer-conditional-expression": false,
|
||||
"one-variable-per-declaration": false
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user