dd
This commit is contained in:
1
extensions/Excel转JSON/node_modules/cfb/node_modules/.bin/adler32
generated
vendored
Normal file
1
extensions/Excel转JSON/node_modules/cfb/node_modules/.bin/adler32
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
../adler-32/bin/adler32.njs
|
||||
1
extensions/Excel转JSON/node_modules/cfb/node_modules/.bin/crc32
generated
vendored
Normal file
1
extensions/Excel转JSON/node_modules/cfb/node_modules/.bin/crc32
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
../crc-32/bin/crc32.njs
|
||||
1
extensions/Excel转JSON/node_modules/cfb/node_modules/.bin/printj
generated
vendored
Normal file
1
extensions/Excel转JSON/node_modules/cfb/node_modules/.bin/printj
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
../printj/bin/printj.njs
|
||||
14
extensions/Excel转JSON/node_modules/cfb/node_modules/adler-32/LICENSE
generated
vendored
Normal file
14
extensions/Excel转JSON/node_modules/cfb/node_modules/adler-32/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
Copyright (C) 2014-present SheetJS
|
||||
|
||||
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.
|
||||
|
||||
139
extensions/Excel转JSON/node_modules/cfb/node_modules/adler-32/README.md
generated
vendored
Normal file
139
extensions/Excel转JSON/node_modules/cfb/node_modules/adler-32/README.md
generated
vendored
Normal file
@@ -0,0 +1,139 @@
|
||||
# adler32
|
||||
|
||||
Signed ADLER-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/adler-32):
|
||||
|
||||
```bash
|
||||
$ npm install adler-32
|
||||
```
|
||||
|
||||
In the browser:
|
||||
|
||||
```html
|
||||
<script src="adler32.js"></script>
|
||||
```
|
||||
|
||||
The browser exposes a variable `ADLER32`.
|
||||
|
||||
When installed globally, npm installs a script `adler32` that computes the
|
||||
checksum for a specified file or standard input.
|
||||
|
||||
The script will manipulate `module.exports` if available . This is not always
|
||||
desirable. To prevent the behavior, define `DO_NOT_EXPORT_ADLER`.
|
||||
|
||||
## Usage
|
||||
|
||||
In all cases, the relevant function takes an argument representing data and an
|
||||
optional second argument representing the starting "seed" (for running hash).
|
||||
|
||||
The return value is a signed 32-bit integer.
|
||||
|
||||
- `ADLER32.buf(byte array or buffer[, seed])` assumes the argument is a sequence
|
||||
of 8-bit unsigned integers (nodejs `Buffer`, `Uint8Array` or array of bytes).
|
||||
|
||||
- `ADLER32.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`
|
||||
|
||||
- `ADLER32.str(string)` assumes the argument is a standard JS string and
|
||||
calculates the hash of the UTF-8 encoding.
|
||||
|
||||
For example:
|
||||
|
||||
```js
|
||||
// var ADLER32 = require('adler-32'); // uncomment if in node
|
||||
ADLER32.str("SheetJS") // 176947863
|
||||
ADLER32.bstr("SheetJS") // 176947863
|
||||
ADLER32.buf([ 83, 104, 101, 101, 116, 74, 83 ]) // 176947863
|
||||
|
||||
adler32 = ADLER32.buf([83, 104]) // 17825980 "Sh"
|
||||
adler32 = ADLER32.str("eet", adler32) // 95486458 "Sheet"
|
||||
ADLER32.bstr("JS", adler32) // 176947863 "SheetJS"
|
||||
|
||||
[ADLER32.str("\u2603"), ADLER32.str("\u0003")] // [ 73138686, 262148 ]
|
||||
[ADLER32.bstr("\u2603"), ADLER32.bstr("\u0003")] // [ 262148, 262148 ]
|
||||
[ADLER32.buf([0x2603]), ADLER32.buf([0x0003])] // [ 262148, 262148 ]
|
||||
```
|
||||
|
||||
## 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 `adler32` function from python `zlib`:
|
||||
|
||||
```python
|
||||
>>> from zlib import adler32
|
||||
>>> x="foo bar baz٪☃🍣"
|
||||
>>> adler32(x)
|
||||
1543572022
|
||||
>>> adler32(x+x)
|
||||
-2076896149
|
||||
>>> adler32(x+x+x)
|
||||
2023497376
|
||||
```
|
||||
|
||||
The included `adler32.njs` script can process files or standard input:
|
||||
|
||||
```bash
|
||||
$ echo "this is a test" > t.txt
|
||||
$ bin/adler32.njs t.txt
|
||||
726861088
|
||||
```
|
||||
|
||||
For comparison, the included `adler32.py` script uses python `zlib`:
|
||||
|
||||
```bash
|
||||
$ bin/adler32.py t.txt
|
||||
726861088
|
||||
```
|
||||
|
||||
## Performance
|
||||
|
||||
`make perf` will run algorithmic performance tests (which should justify certain
|
||||
decisions in the code).
|
||||
|
||||
Bit twiddling is much faster than taking the mod in Safari and Firefox browsers.
|
||||
Instead of taking the literal mod 65521, it is faster to keep it in the integers
|
||||
by bit-shifting: `65536 ~ 15 mod 65521` so for nonnegative integer `a`:
|
||||
|
||||
```
|
||||
a = (a >>> 16) * 65536 + (a & 65535) [equality]
|
||||
a ~ (a >>> 16) * 15 + (a & 65535) mod 65521
|
||||
```
|
||||
|
||||
The mod is taken at the very end, since the intermediate result may exceed 65521
|
||||
|
||||
## Magic Number
|
||||
|
||||
The magic numbers were chosen so as to not overflow a 31-bit integer:
|
||||
|
||||
```mathematica
|
||||
F[n_] := Reduce[x*(x + 1)*n/2 + (x + 1)*(65521) < (2^31 - 1) && x > 0, x, Integers]
|
||||
F[255] (* bstr: x \[Element] Integers && 1 <= x <= 3854 *)
|
||||
F[127] (* ascii: x \[Element] Integers && 1 <= x <= 5321 *)
|
||||
```
|
||||
|
||||
Subtract up to 4 elements for the Unicode case.
|
||||
|
||||
## 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/adler32)
|
||||
|
||||
[](https://travis-ci.org/SheetJS/js-adler32)
|
||||
|
||||
[](https://coveralls.io/r/SheetJS/js-adler32?branch=master)
|
||||
|
||||
[](https://github.com/SheetJS/js-adler32)
|
||||
92
extensions/Excel转JSON/node_modules/cfb/node_modules/adler-32/adler32.js
generated
vendored
Normal file
92
extensions/Excel转JSON/node_modules/cfb/node_modules/adler-32/adler32.js
generated
vendored
Normal file
@@ -0,0 +1,92 @@
|
||||
/* adler32.js (C) 2014-present SheetJS -- http://sheetjs.com */
|
||||
/* vim: set ts=2: */
|
||||
/*exported ADLER32 */
|
||||
var ADLER32;
|
||||
(function (factory) {
|
||||
/*jshint ignore:start */
|
||||
/*eslint-disable */
|
||||
if(typeof DO_NOT_EXPORT_ADLER === 'undefined') {
|
||||
if('object' === typeof exports) {
|
||||
factory(exports);
|
||||
} else if ('function' === typeof define && define.amd) {
|
||||
define(function () {
|
||||
var module = {};
|
||||
factory(module);
|
||||
return module;
|
||||
});
|
||||
} else {
|
||||
factory(ADLER32 = {});
|
||||
}
|
||||
} else {
|
||||
factory(ADLER32 = {});
|
||||
}
|
||||
/*eslint-enable */
|
||||
/*jshint ignore:end */
|
||||
}(function(ADLER32) {
|
||||
ADLER32.version = '1.2.0';
|
||||
function adler32_bstr(bstr, seed) {
|
||||
var a = 1, b = 0, L = bstr.length, M = 0;
|
||||
if(typeof seed === 'number') { a = seed & 0xFFFF; b = seed >>> 16; }
|
||||
for(var i = 0; i < L;) {
|
||||
M = Math.min(L-i, 3850)+i;
|
||||
for(;i<M;i++) {
|
||||
a += bstr.charCodeAt(i)&0xFF;
|
||||
b += a;
|
||||
}
|
||||
a = (15*(a>>>16)+(a&65535));
|
||||
b = (15*(b>>>16)+(b&65535));
|
||||
}
|
||||
return ((b%65521) << 16) | (a%65521);
|
||||
}
|
||||
|
||||
function adler32_buf(buf, seed) {
|
||||
var a = 1, b = 0, L = buf.length, M = 0;
|
||||
if(typeof seed === 'number') { a = seed & 0xFFFF; b = (seed >>> 16) & 0xFFFF; }
|
||||
for(var i = 0; i < L;) {
|
||||
M = Math.min(L-i, 3850)+i;
|
||||
for(;i<M;i++) {
|
||||
a += buf[i]&0xFF;
|
||||
b += a;
|
||||
}
|
||||
a = (15*(a>>>16)+(a&65535));
|
||||
b = (15*(b>>>16)+(b&65535));
|
||||
}
|
||||
return ((b%65521) << 16) | (a%65521);
|
||||
}
|
||||
|
||||
function adler32_str(str, seed) {
|
||||
var a = 1, b = 0, L = str.length, M = 0, c = 0, d = 0;
|
||||
if(typeof seed === 'number') { a = seed & 0xFFFF; b = seed >>> 16; }
|
||||
for(var i = 0; i < L;) {
|
||||
M = Math.min(L-i, 3850);
|
||||
while(M>0) {
|
||||
c = str.charCodeAt(i++);
|
||||
if(c < 0x80) { a += c; }
|
||||
else if(c < 0x800) {
|
||||
a += 192|((c>>6)&31); b += a; --M;
|
||||
a += 128|(c&63);
|
||||
} else if(c >= 0xD800 && c < 0xE000) {
|
||||
c = (c&1023)+64; d = str.charCodeAt(i++) & 1023;
|
||||
a += 240|((c>>8)&7); b += a; --M;
|
||||
a += 128|((c>>2)&63); b += a; --M;
|
||||
a += 128|((d>>6)&15)|((c&3)<<4); b += a; --M;
|
||||
a += 128|(d&63);
|
||||
} else {
|
||||
a += 224|((c>>12)&15); b += a; --M;
|
||||
a += 128|((c>>6)&63); b += a; --M;
|
||||
a += 128|(c&63);
|
||||
}
|
||||
b += a; --M;
|
||||
}
|
||||
a = (15*(a>>>16)+(a&65535));
|
||||
b = (15*(b>>>16)+(b&65535));
|
||||
}
|
||||
return ((b%65521) << 16) | (a%65521);
|
||||
}
|
||||
// $FlowIgnore
|
||||
ADLER32.bstr = adler32_bstr;
|
||||
// $FlowIgnore
|
||||
ADLER32.buf = adler32_buf;
|
||||
// $FlowIgnore
|
||||
ADLER32.str = adler32_str;
|
||||
}));
|
||||
89
extensions/Excel转JSON/node_modules/cfb/node_modules/adler-32/package.json
generated
vendored
Normal file
89
extensions/Excel转JSON/node_modules/cfb/node_modules/adler-32/package.json
generated
vendored
Normal file
@@ -0,0 +1,89 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"adler-32@1.2.0",
|
||||
"/Users/wuyu/Desktop/61/Git/h5game_ailesson_v2.4/packages/excel_to_json"
|
||||
]
|
||||
],
|
||||
"_from": "adler-32@1.2.0",
|
||||
"_id": "adler-32@1.2.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-aj5r8KY5ALoVZSgIyxXGgT0aXyU=",
|
||||
"_location": "/cfb/adler-32",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "adler-32@1.2.0",
|
||||
"name": "adler-32",
|
||||
"escapedName": "adler-32",
|
||||
"rawSpec": "1.2.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "1.2.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/cfb"
|
||||
],
|
||||
"_resolved": "https://registry.nlark.com/adler-32/download/adler-32-1.2.0.tgz",
|
||||
"_spec": "1.2.0",
|
||||
"_where": "/Users/wuyu/Desktop/61/Git/h5game_ailesson_v2.4/packages/excel_to_json",
|
||||
"author": {
|
||||
"name": "sheetjs"
|
||||
},
|
||||
"bin": {
|
||||
"adler32": "./bin/adler32.njs"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/SheetJS/js-adler32/issues"
|
||||
},
|
||||
"config": {
|
||||
"blanket": {
|
||||
"pattern": "adler32.js"
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"exit-on-epipe": "~1.0.1",
|
||||
"printj": "~1.1.0"
|
||||
},
|
||||
"description": "Pure-JS ADLER-32",
|
||||
"devDependencies": {
|
||||
"@sheetjs/uglify-js": "~2.7.3",
|
||||
"@types/node": "^8.0.7",
|
||||
"blanket": "~1.2.3",
|
||||
"codepage": "~1.10.0",
|
||||
"dtslint": "^0.1.2",
|
||||
"mocha": "~2.5.3",
|
||||
"typescript": "2.2.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.8"
|
||||
},
|
||||
"files": [
|
||||
"adler32.js",
|
||||
"bin/adler32.njs",
|
||||
"LICENSE",
|
||||
"README.md",
|
||||
"types/index.d.ts",
|
||||
"types/*.json"
|
||||
],
|
||||
"homepage": "http://sheetjs.com/opensource",
|
||||
"keywords": [
|
||||
"adler32",
|
||||
"checksum"
|
||||
],
|
||||
"license": "Apache-2.0",
|
||||
"main": "./adler32",
|
||||
"name": "adler-32",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/SheetJS/js-adler32.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "make",
|
||||
"dtslint": "dtslint types",
|
||||
"lint": "make fullint",
|
||||
"test": "make test"
|
||||
},
|
||||
"types": "types",
|
||||
"version": "1.2.0"
|
||||
}
|
||||
14
extensions/Excel转JSON/node_modules/cfb/node_modules/adler-32/types/index.d.ts
generated
vendored
Normal file
14
extensions/Excel转JSON/node_modules/cfb/node_modules/adler-32/types/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
/* adler32.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
extensions/Excel转JSON/node_modules/cfb/node_modules/adler-32/types/tsconfig.json
generated
vendored
Normal file
14
extensions/Excel转JSON/node_modules/cfb/node_modules/adler-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": { "adler-32": ["."] },
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
}
|
||||
}
|
||||
11
extensions/Excel转JSON/node_modules/cfb/node_modules/adler-32/types/tslint.json
generated
vendored
Normal file
11
extensions/Excel转JSON/node_modules/cfb/node_modules/adler-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
|
||||
}
|
||||
}
|
||||
14
extensions/Excel转JSON/node_modules/cfb/node_modules/crc-32/LICENSE
generated
vendored
Normal file
14
extensions/Excel转JSON/node_modules/cfb/node_modules/crc-32/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
Copyright (C) 2014-present SheetJS
|
||||
|
||||
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.
|
||||
|
||||
128
extensions/Excel转JSON/node_modules/cfb/node_modules/crc-32/README.md
generated
vendored
Normal file
128
extensions/Excel转JSON/node_modules/cfb/node_modules/crc-32/README.md
generated
vendored
Normal file
@@ -0,0 +1,128 @@
|
||||
# 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
|
||||
```
|
||||
|
||||
In the browser:
|
||||
|
||||
```html
|
||||
<script src="crc32.js"></script>
|
||||
```
|
||||
|
||||
The browser exposes a variable `CRC32`.
|
||||
|
||||
When installed globally, npm installs a script `crc32` that computes the
|
||||
checksum for a specified file or standard input.
|
||||
|
||||
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 ]
|
||||
```
|
||||
|
||||
## 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)
|
||||
118
extensions/Excel转JSON/node_modules/cfb/node_modules/crc-32/crc32.js
generated
vendored
Normal file
118
extensions/Excel转JSON/node_modules/cfb/node_modules/crc-32/crc32.js
generated
vendored
Normal file
@@ -0,0 +1,118 @@
|
||||
/* 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.0';
|
||||
/* see perf/crc32table.js */
|
||||
/*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 T = signed_crc_table();
|
||||
function crc32_bstr(bstr, seed) {
|
||||
var C = seed ^ -1, L = bstr.length - 1;
|
||||
for(var i = 0; i < L;) {
|
||||
C = (C>>>8) ^ T[(C^bstr.charCodeAt(i++))&0xFF];
|
||||
C = (C>>>8) ^ T[(C^bstr.charCodeAt(i++))&0xFF];
|
||||
}
|
||||
if(i === L) C = (C>>>8) ^ T[(C ^ bstr.charCodeAt(i))&0xFF];
|
||||
return C ^ -1;
|
||||
}
|
||||
|
||||
function crc32_buf(buf, seed) {
|
||||
if(buf.length > 10000) return crc32_buf_8(buf, seed);
|
||||
var C = seed ^ -1, L = buf.length - 3;
|
||||
for(var i = 0; i < L;) {
|
||||
C = (C>>>8) ^ T[(C^buf[i++])&0xFF];
|
||||
C = (C>>>8) ^ T[(C^buf[i++])&0xFF];
|
||||
C = (C>>>8) ^ T[(C^buf[i++])&0xFF];
|
||||
C = (C>>>8) ^ T[(C^buf[i++])&0xFF];
|
||||
}
|
||||
while(i < L+3) C = (C>>>8) ^ T[(C^buf[i++])&0xFF];
|
||||
return C ^ -1;
|
||||
}
|
||||
|
||||
function crc32_buf_8(buf, seed) {
|
||||
var C = seed ^ -1, L = buf.length - 7;
|
||||
for(var i = 0; i < L;) {
|
||||
C = (C>>>8) ^ T[(C^buf[i++])&0xFF];
|
||||
C = (C>>>8) ^ T[(C^buf[i++])&0xFF];
|
||||
C = (C>>>8) ^ T[(C^buf[i++])&0xFF];
|
||||
C = (C>>>8) ^ T[(C^buf[i++])&0xFF];
|
||||
C = (C>>>8) ^ T[(C^buf[i++])&0xFF];
|
||||
C = (C>>>8) ^ T[(C^buf[i++])&0xFF];
|
||||
C = (C>>>8) ^ T[(C^buf[i++])&0xFF];
|
||||
C = (C>>>8) ^ T[(C^buf[i++])&0xFF];
|
||||
}
|
||||
while(i < L+7) C = (C>>>8) ^ T[(C^buf[i++])&0xFF];
|
||||
return C ^ -1;
|
||||
}
|
||||
|
||||
function crc32_str(str, seed) {
|
||||
var C = seed ^ -1;
|
||||
for(var i = 0, L=str.length, c, d; i < L;) {
|
||||
c = str.charCodeAt(i++);
|
||||
if(c < 0x80) {
|
||||
C = (C>>>8) ^ T[(C ^ c)&0xFF];
|
||||
} else if(c < 0x800) {
|
||||
C = (C>>>8) ^ T[(C ^ (192|((c>>6)&31)))&0xFF];
|
||||
C = (C>>>8) ^ T[(C ^ (128|(c&63)))&0xFF];
|
||||
} else if(c >= 0xD800 && c < 0xE000) {
|
||||
c = (c&1023)+64; d = str.charCodeAt(i++)&1023;
|
||||
C = (C>>>8) ^ T[(C ^ (240|((c>>8)&7)))&0xFF];
|
||||
C = (C>>>8) ^ T[(C ^ (128|((c>>2)&63)))&0xFF];
|
||||
C = (C>>>8) ^ T[(C ^ (128|((d>>6)&15)|((c&3)<<4)))&0xFF];
|
||||
C = (C>>>8) ^ T[(C ^ (128|(d&63)))&0xFF];
|
||||
} else {
|
||||
C = (C>>>8) ^ T[(C ^ (224|((c>>12)&15)))&0xFF];
|
||||
C = (C>>>8) ^ T[(C ^ (128|((c>>6)&63)))&0xFF];
|
||||
C = (C>>>8) ^ T[(C ^ (128|(c&63)))&0xFF];
|
||||
}
|
||||
}
|
||||
return C ^ -1;
|
||||
}
|
||||
CRC32.table = T;
|
||||
// $FlowIgnore
|
||||
CRC32.bstr = crc32_bstr;
|
||||
// $FlowIgnore
|
||||
CRC32.buf = crc32_buf;
|
||||
// $FlowIgnore
|
||||
CRC32.str = crc32_str;
|
||||
}));
|
||||
90
extensions/Excel转JSON/node_modules/cfb/node_modules/crc-32/package.json
generated
vendored
Normal file
90
extensions/Excel转JSON/node_modules/cfb/node_modules/crc-32/package.json
generated
vendored
Normal file
@@ -0,0 +1,90 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"crc-32@1.2.0",
|
||||
"/Users/wuyu/Desktop/61/Git/h5game_ailesson_v2.4/packages/excel_to_json"
|
||||
]
|
||||
],
|
||||
"_from": "crc-32@1.2.0",
|
||||
"_id": "crc-32@1.2.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-yy224puIUI4y2d0OwWk+e0Ghggg=",
|
||||
"_location": "/cfb/crc-32",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "crc-32@1.2.0",
|
||||
"name": "crc-32",
|
||||
"escapedName": "crc-32",
|
||||
"rawSpec": "1.2.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "1.2.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/cfb"
|
||||
],
|
||||
"_resolved": "https://registry.npm.taobao.org/crc-32/download/crc-32-1.2.0.tgz",
|
||||
"_spec": "1.2.0",
|
||||
"_where": "/Users/wuyu/Desktop/61/Git/h5game_ailesson_v2.4/packages/excel_to_json",
|
||||
"author": {
|
||||
"name": "sheetjs"
|
||||
},
|
||||
"bin": {
|
||||
"crc32": "./bin/crc32.njs"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/SheetJS/js-crc32/issues"
|
||||
},
|
||||
"config": {
|
||||
"blanket": {
|
||||
"pattern": "crc32.js"
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"exit-on-epipe": "~1.0.1",
|
||||
"printj": "~1.1.0"
|
||||
},
|
||||
"description": "Pure-JS CRC-32",
|
||||
"devDependencies": {
|
||||
"@sheetjs/uglify-js": "~2.7.3",
|
||||
"@types/node": "^8.0.7",
|
||||
"blanket": "~1.2.3",
|
||||
"codepage": "~1.10.0",
|
||||
"dtslint": "^0.1.2",
|
||||
"mocha": "~2.5.3",
|
||||
"typescript": "2.2.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.8"
|
||||
},
|
||||
"files": [
|
||||
"crc32.js",
|
||||
"bin/crc32.njs",
|
||||
"LICENSE",
|
||||
"README.md",
|
||||
"types/index.d.ts",
|
||||
"types/*.json"
|
||||
],
|
||||
"homepage": "http://sheetjs.com/opensource",
|
||||
"keywords": [
|
||||
"crc",
|
||||
"crc32",
|
||||
"checksum"
|
||||
],
|
||||
"license": "Apache-2.0",
|
||||
"main": "./crc32",
|
||||
"name": "crc-32",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/SheetJS/js-crc32.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "make",
|
||||
"dtslint": "dtslint types",
|
||||
"lint": "make fullint",
|
||||
"test": "make test"
|
||||
},
|
||||
"types": "types",
|
||||
"version": "1.2.0"
|
||||
}
|
||||
14
extensions/Excel转JSON/node_modules/cfb/node_modules/crc-32/types/index.d.ts
generated
vendored
Normal file
14
extensions/Excel转JSON/node_modules/cfb/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
extensions/Excel转JSON/node_modules/cfb/node_modules/crc-32/types/tsconfig.json
generated
vendored
Normal file
14
extensions/Excel转JSON/node_modules/cfb/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
extensions/Excel转JSON/node_modules/cfb/node_modules/crc-32/types/tslint.json
generated
vendored
Normal file
11
extensions/Excel转JSON/node_modules/cfb/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
|
||||
}
|
||||
}
|
||||
14
extensions/Excel转JSON/node_modules/cfb/node_modules/printj/LICENSE
generated
vendored
Normal file
14
extensions/Excel转JSON/node_modules/cfb/node_modules/printj/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
Copyright (C) 2016-present SheetJS
|
||||
|
||||
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.
|
||||
|
||||
1003
extensions/Excel转JSON/node_modules/cfb/node_modules/printj/README.md
generated
vendored
Normal file
1003
extensions/Excel转JSON/node_modules/cfb/node_modules/printj/README.md
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
14
extensions/Excel转JSON/node_modules/cfb/node_modules/printj/dist/LICENSE
generated
vendored
Normal file
14
extensions/Excel转JSON/node_modules/cfb/node_modules/printj/dist/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
Copyright (C) 2016-present SheetJS
|
||||
|
||||
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.
|
||||
|
||||
605
extensions/Excel转JSON/node_modules/cfb/node_modules/printj/dist/printj.js
generated
vendored
Normal file
605
extensions/Excel转JSON/node_modules/cfb/node_modules/printj/dist/printj.js
generated
vendored
Normal file
@@ -0,0 +1,605 @@
|
||||
/* 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.1.2';
|
||||
|
||||
function tokenize(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 out;
|
||||
}
|
||||
|
||||
//#define PAD_(x,c) (x >= 0 ? new Array(((x)|0) + 1).join((c)) : "")
|
||||
var padstr = {
|
||||
" ": " ",
|
||||
"0": "000000000000000000000000000000000",
|
||||
"7": "777777777777777777777777777777777",
|
||||
"f": "fffffffffffffffffffffffffffffffff"
|
||||
};
|
||||
|
||||
/*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 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.push(m[1]); continue; }
|
||||
if(c === /*%*/ 37) { 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])-1;
|
||||
/* %m special case */
|
||||
else if(c === /*m*/ 109 && !alt) { o.push("Success"); continue; }
|
||||
|
||||
/* grab width */
|
||||
var width = 0; if(m[ 4] != null && 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] != null && 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 ? padstr["0"].substr(0, width - O.length) : ""); O = pad + O; } else { pad = ( width - O.length >= 0 ? padstr[" "].substr(0, 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 ? padstr["0"].substr(0, width - O.length) : ""); O = pad + O; } else { pad = ( width - O.length >= 0 ? padstr[" "].substr(0, 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=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 = Boolean(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 ? padstr["0"].substr(0, width - O.length) : ""); O = pad + O; } else { pad = ( width - O.length >= 0 ? padstr[" "].substr(0, 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 ? padstr[ "0"].substr(0,8 - O.length) : "") + O;
|
||||
O = (16 - O.length >= 0 ? padstr[ "f"].substr(0,16 - O.length) : "") + O;
|
||||
if(radix == 16) O = O.toUpperCase();
|
||||
} else if(radix == 8) {
|
||||
O = (Vnum>>>0).toString(8);
|
||||
O = (10 - O.length >= 0 ? padstr[ "0"].substr(0,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 ? padstr[ "7"].substr(0,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 ? padstr[ "0"].substr(0,prec - O.length) : "") + O;
|
||||
else O = O.substr(0,1) + (prec + 1 - O.length >= 0 ? padstr[ "0"].substr(0,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 ? padstr[ " "].substr(0,(width - O.length)) : "");
|
||||
} else if(flags.indexOf("0") > -1 && prec < 0 && O.length > 0) {
|
||||
if(prec > O.length) O = ((prec - O.length) >= 0 ? padstr[ "0"].substr(0,(prec - O.length)) : "") + O;
|
||||
pad = ((width - O.length) >= 0 ? padstr[ (prec > 0 ? " " : "0")].substr(0,(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 ? padstr[ " "].substr(0,(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 ? padstr[ "0"].substr(0,E - O.length + 1) : "");
|
||||
if(alt || (prec > 0 && isnum !== 11)) O = O + "." + (prec >= 0 ? padstr[ "0"].substr(0,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 ? padstr["0"].substr(0,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 ? padstr[ "0"].substr(0,(prec + 2 - O.length)) : "") + O.substr(1);
|
||||
else O += ((prec + 2 - O.length) >= 0 ? padstr[ "0"].substr(0,(prec + 2 - O.length)) : "");
|
||||
}
|
||||
} else if(prec === 0) O = O.charAt(0) + (alt ? "." : "");
|
||||
} else if(prec > 0) O = O + "." + (prec >= 0 ? padstr["0"].substr(0,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 ? padstr[ " "].substr(0,(width - O.length)) : "");
|
||||
} else if(flags.indexOf("0") > -1 && O.length > 0 && isf) {
|
||||
pad = ((width - O.length) >= 0 ? padstr[ "0"].substr(0,(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 ? padstr[ " "].substr(0,(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
extensions/Excel转JSON/node_modules/cfb/node_modules/printj/dist/printj.min.js
generated
vendored
Normal file
2
extensions/Excel转JSON/node_modules/cfb/node_modules/printj/dist/printj.min.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
extensions/Excel转JSON/node_modules/cfb/node_modules/printj/dist/printj.min.map
generated
vendored
Normal file
1
extensions/Excel转JSON/node_modules/cfb/node_modules/printj/dist/printj.min.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
101
extensions/Excel转JSON/node_modules/cfb/node_modules/printj/package.json
generated
vendored
Normal file
101
extensions/Excel转JSON/node_modules/cfb/node_modules/printj/package.json
generated
vendored
Normal file
@@ -0,0 +1,101 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"printj@1.1.2",
|
||||
"/Users/wuyu/Desktop/61/Git/h5game_ailesson_v2.4/packages/excel_to_json"
|
||||
]
|
||||
],
|
||||
"_from": "printj@1.1.2",
|
||||
"_id": "printj@1.1.2",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-2Q3rKXWoufYA+zoclOP0xTx4oiI=",
|
||||
"_location": "/cfb/printj",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "printj@1.1.2",
|
||||
"name": "printj",
|
||||
"escapedName": "printj",
|
||||
"rawSpec": "1.1.2",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "1.1.2"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/cfb",
|
||||
"/cfb/adler-32",
|
||||
"/cfb/crc-32"
|
||||
],
|
||||
"_resolved": "https://registry.nlark.com/printj/download/printj-1.1.2.tgz",
|
||||
"_spec": "1.1.2",
|
||||
"_where": "/Users/wuyu/Desktop/61/Git/h5game_ailesson_v2.4/packages/excel_to_json",
|
||||
"alex": {
|
||||
"allow": [
|
||||
"period"
|
||||
]
|
||||
},
|
||||
"author": {
|
||||
"name": "sheetjs"
|
||||
},
|
||||
"bin": {
|
||||
"printj": "./bin/printj.njs"
|
||||
},
|
||||
"browser": {
|
||||
"process": false,
|
||||
"util": false
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/SheetJS/printj/issues"
|
||||
},
|
||||
"config": {
|
||||
"blanket": {
|
||||
"pattern": "printj.js"
|
||||
}
|
||||
},
|
||||
"dependencies": {},
|
||||
"description": "Pure-JS printf",
|
||||
"devDependencies": {
|
||||
"@sheetjs/uglify-js": "~2.7.3",
|
||||
"@types/node": "^8.0.7",
|
||||
"blanket": "~1.2.3",
|
||||
"dtslint": "^0.1.2",
|
||||
"mocha": "~2.5.3",
|
||||
"typescript": "2.2.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.8"
|
||||
},
|
||||
"files": [
|
||||
"printj.js",
|
||||
"bin/printj.njs",
|
||||
"LICENSE",
|
||||
"README.md",
|
||||
"dist/*.js",
|
||||
"dist/*.map",
|
||||
"dist/LICENSE",
|
||||
"types/index.d.ts",
|
||||
"types/*.json"
|
||||
],
|
||||
"homepage": "http://sheetjs.com/opensource",
|
||||
"keywords": [
|
||||
"printf",
|
||||
"sprintf",
|
||||
"format",
|
||||
"string"
|
||||
],
|
||||
"license": "Apache-2.0",
|
||||
"main": "./printj",
|
||||
"name": "printj",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/SheetJS/printj.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "make",
|
||||
"dtslint": "dtslint types",
|
||||
"lint": "make fullint",
|
||||
"test": "make test"
|
||||
},
|
||||
"types": "types",
|
||||
"version": "1.1.2"
|
||||
}
|
||||
605
extensions/Excel转JSON/node_modules/cfb/node_modules/printj/printj.js
generated
vendored
Normal file
605
extensions/Excel转JSON/node_modules/cfb/node_modules/printj/printj.js
generated
vendored
Normal file
@@ -0,0 +1,605 @@
|
||||
/* 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.1.2';
|
||||
|
||||
function tokenize(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 out;
|
||||
}
|
||||
|
||||
//#define PAD_(x,c) (x >= 0 ? new Array(((x)|0) + 1).join((c)) : "")
|
||||
var padstr = {
|
||||
" ": " ",
|
||||
"0": "000000000000000000000000000000000",
|
||||
"7": "777777777777777777777777777777777",
|
||||
"f": "fffffffffffffffffffffffffffffffff"
|
||||
};
|
||||
|
||||
/*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 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.push(m[1]); continue; }
|
||||
if(c === /*%*/ 37) { 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])-1;
|
||||
/* %m special case */
|
||||
else if(c === /*m*/ 109 && !alt) { o.push("Success"); continue; }
|
||||
|
||||
/* grab width */
|
||||
var width = 0; if(m[ 4] != null && 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] != null && 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 ? padstr["0"].substr(0, width - O.length) : ""); O = pad + O; } else { pad = ( width - O.length >= 0 ? padstr[" "].substr(0, 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 ? padstr["0"].substr(0, width - O.length) : ""); O = pad + O; } else { pad = ( width - O.length >= 0 ? padstr[" "].substr(0, 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=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 = Boolean(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 ? padstr["0"].substr(0, width - O.length) : ""); O = pad + O; } else { pad = ( width - O.length >= 0 ? padstr[" "].substr(0, 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 ? padstr[ "0"].substr(0,8 - O.length) : "") + O;
|
||||
O = (16 - O.length >= 0 ? padstr[ "f"].substr(0,16 - O.length) : "") + O;
|
||||
if(radix == 16) O = O.toUpperCase();
|
||||
} else if(radix == 8) {
|
||||
O = (Vnum>>>0).toString(8);
|
||||
O = (10 - O.length >= 0 ? padstr[ "0"].substr(0,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 ? padstr[ "7"].substr(0,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 ? padstr[ "0"].substr(0,prec - O.length) : "") + O;
|
||||
else O = O.substr(0,1) + (prec + 1 - O.length >= 0 ? padstr[ "0"].substr(0,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 ? padstr[ " "].substr(0,(width - O.length)) : "");
|
||||
} else if(flags.indexOf("0") > -1 && prec < 0 && O.length > 0) {
|
||||
if(prec > O.length) O = ((prec - O.length) >= 0 ? padstr[ "0"].substr(0,(prec - O.length)) : "") + O;
|
||||
pad = ((width - O.length) >= 0 ? padstr[ (prec > 0 ? " " : "0")].substr(0,(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 ? padstr[ " "].substr(0,(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 ? padstr[ "0"].substr(0,E - O.length + 1) : "");
|
||||
if(alt || (prec > 0 && isnum !== 11)) O = O + "." + (prec >= 0 ? padstr[ "0"].substr(0,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 ? padstr["0"].substr(0,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 ? padstr[ "0"].substr(0,(prec + 2 - O.length)) : "") + O.substr(1);
|
||||
else O += ((prec + 2 - O.length) >= 0 ? padstr[ "0"].substr(0,(prec + 2 - O.length)) : "");
|
||||
}
|
||||
} else if(prec === 0) O = O.charAt(0) + (alt ? "." : "");
|
||||
} else if(prec > 0) O = O + "." + (prec >= 0 ? padstr["0"].substr(0,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 ? padstr[ " "].substr(0,(width - O.length)) : "");
|
||||
} else if(flags.indexOf("0") > -1 && O.length > 0 && isf) {
|
||||
pad = ((width - O.length) >= 0 ? padstr[ "0"].substr(0,(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 ? padstr[ " "].substr(0,(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;
|
||||
|
||||
}));
|
||||
|
||||
11
extensions/Excel转JSON/node_modules/cfb/node_modules/printj/types/index.d.ts
generated
vendored
Normal file
11
extensions/Excel转JSON/node_modules/cfb/node_modules/printj/types/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
/* index.d.ts (C) 2015-present SheetJS */
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
/** 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;
|
||||
14
extensions/Excel转JSON/node_modules/cfb/node_modules/printj/types/tsconfig.json
generated
vendored
Normal file
14
extensions/Excel转JSON/node_modules/cfb/node_modules/printj/types/tsconfig.json
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [ "es5", "dom" ],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"baseUrl": ".",
|
||||
"paths": { "printj": ["."] },
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
}
|
||||
}
|
||||
11
extensions/Excel转JSON/node_modules/cfb/node_modules/printj/types/tslint.json
generated
vendored
Normal file
11
extensions/Excel转JSON/node_modules/cfb/node_modules/printj/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