flow like the river
This commit is contained in:
commit
013fe673f3
42435 changed files with 5764238 additions and 0 deletions
21
BACK_BACK/node_modules/vlq/CHANGELOG.md
generated
vendored
Executable file
21
BACK_BACK/node_modules/vlq/CHANGELOG.md
generated
vendored
Executable file
|
|
@ -0,0 +1,21 @@
|
|||
# changelog
|
||||
|
||||
## 0.2.3
|
||||
|
||||
* Add LICENSE to npm package
|
||||
|
||||
## 0.2.2
|
||||
|
||||
* Expose `pkg.module`, not `jsnext:main`
|
||||
|
||||
## 0.2.1
|
||||
|
||||
* Performance boost - vlq no longer checks that you've passed a number or an array into `vlq.encode()`, making it significantly faster
|
||||
|
||||
## 0.2.0
|
||||
|
||||
* Author as ES6 module, accessible to ES6-aware systems via the `jsnext:main` field in `package.json`
|
||||
|
||||
## 0.1.0
|
||||
|
||||
* First release
|
||||
7
BACK_BACK/node_modules/vlq/LICENSE
generated
vendored
Executable file
7
BACK_BACK/node_modules/vlq/LICENSE
generated
vendored
Executable file
|
|
@ -0,0 +1,7 @@
|
|||
Copyright (c) 2017 [these people](https://github.com/Rich-Harris/vlq/graphs/contributors)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
73
BACK_BACK/node_modules/vlq/README.md
generated
vendored
Executable file
73
BACK_BACK/node_modules/vlq/README.md
generated
vendored
Executable file
|
|
@ -0,0 +1,73 @@
|
|||
# vlq.js
|
||||
|
||||
Convert integers to a Base64-encoded VLQ string, and vice versa. No dependencies, works in node.js or browsers, supports AMD.
|
||||
|
||||
|
||||
## Why would you want to do that?
|
||||
|
||||
Sourcemaps are the most likely use case. Mappings from original source to generated content are encoded as a sequence of VLQ strings.
|
||||
|
||||
|
||||
## What is a VLQ string?
|
||||
|
||||
A [variable-length quantity](http://en.wikipedia.org/wiki/Variable-length_quantity) is a compact way of encoding large integers in text (i.e. in situations where you can't transmit raw binary data). An integer represented as digits will always take up more space than the equivalent VLQ representation:
|
||||
|
||||
| Integer | VLQ |
|
||||
| :------------------ | :--------- |
|
||||
| 0 | A |
|
||||
| 1 | C |
|
||||
| -1 | D |
|
||||
| 123 | 2H |
|
||||
| 123456789 | qxmvrH |
|
||||
| 123456789123456789 | gxvh6sB |
|
||||
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
npm install vlq
|
||||
```
|
||||
|
||||
...or...
|
||||
|
||||
```bash
|
||||
bower install vlq
|
||||
```
|
||||
|
||||
...or grab the vlq.js file and include it with a `<script src='vlq.js'>` tag.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
### Encoding
|
||||
|
||||
`vlq.encode` accepts an integer, or an array of integers, and returns a string:
|
||||
|
||||
```js
|
||||
vlq.encode( 123 ); // '2H';
|
||||
vlq.encode([ 123, 456, 789 ]); // '2HwcqxB'
|
||||
```
|
||||
|
||||
### Decoding
|
||||
|
||||
`vlq.decode` accepts a string and always returns an array:
|
||||
|
||||
```js
|
||||
vlq.decode( '2H' ); // [ 123 ]
|
||||
vlq.decode( '2HwcqxB' ); // [ 123, 456, 789 ]
|
||||
```
|
||||
|
||||
|
||||
## Using vlq.js with sourcemaps
|
||||
|
||||
[See here for an example of using vlq.js with sourcemaps.](https://github.com/Rich-Harris/vlq/tree/master/sourcemaps)
|
||||
|
||||
|
||||
## Credits
|
||||
|
||||
Adapted from [murzwin.com/base64vlq.html](http://murzwin.com/base64vlq.html) by Alexander Pavlov.
|
||||
|
||||
|
||||
## License
|
||||
|
||||
[MIT](LICENSE).
|
||||
91
BACK_BACK/node_modules/vlq/dist/vlq.js
generated
vendored
Executable file
91
BACK_BACK/node_modules/vlq/dist/vlq.js
generated
vendored
Executable file
|
|
@ -0,0 +1,91 @@
|
|||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
||||
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
||||
(factory((global.vlq = global.vlq || {})));
|
||||
}(this, (function (exports) { 'use strict';
|
||||
|
||||
var charToInteger = {};
|
||||
var integerToChar = {};
|
||||
|
||||
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='.split( '' ).forEach( function ( char, i ) {
|
||||
charToInteger[ char ] = i;
|
||||
integerToChar[ i ] = char;
|
||||
});
|
||||
|
||||
function decode ( string ) {
|
||||
var result = [];
|
||||
var shift = 0;
|
||||
var value = 0;
|
||||
|
||||
for ( var i = 0; i < string.length; i += 1 ) {
|
||||
var integer = charToInteger[ string[i] ];
|
||||
|
||||
if ( integer === undefined ) {
|
||||
throw new Error( 'Invalid character (' + string[i] + ')' );
|
||||
}
|
||||
|
||||
var hasContinuationBit = integer & 32;
|
||||
|
||||
integer &= 31;
|
||||
value += integer << shift;
|
||||
|
||||
if ( hasContinuationBit ) {
|
||||
shift += 5;
|
||||
} else {
|
||||
var shouldNegate = value & 1;
|
||||
value >>= 1;
|
||||
|
||||
result.push( shouldNegate ? -value : value );
|
||||
|
||||
// reset
|
||||
value = shift = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
function encode ( value ) {
|
||||
var result;
|
||||
|
||||
if ( typeof value === 'number' ) {
|
||||
result = encodeInteger( value );
|
||||
} else {
|
||||
result = '';
|
||||
for ( var i = 0; i < value.length; i += 1 ) {
|
||||
result += encodeInteger( value[i] );
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
function encodeInteger ( num ) {
|
||||
var result = '';
|
||||
|
||||
if ( num < 0 ) {
|
||||
num = ( -num << 1 ) | 1;
|
||||
} else {
|
||||
num <<= 1;
|
||||
}
|
||||
|
||||
do {
|
||||
var clamped = num & 31;
|
||||
num >>= 5;
|
||||
|
||||
if ( num > 0 ) {
|
||||
clamped |= 32;
|
||||
}
|
||||
|
||||
result += integerToChar[ clamped ];
|
||||
} while ( num > 0 );
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
exports.decode = decode;
|
||||
exports.encode = encode;
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
})));
|
||||
27
BACK_BACK/node_modules/vlq/package.json
generated
vendored
Executable file
27
BACK_BACK/node_modules/vlq/package.json
generated
vendored
Executable file
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"name": "vlq",
|
||||
"description": "Generate, and decode, base64 VLQ mappings for source maps and other uses",
|
||||
"author": "Rich Harris",
|
||||
"repository": "https://github.com/Rich-Harris/vlq",
|
||||
"license": "MIT",
|
||||
"version": "0.2.3",
|
||||
"main": "dist/vlq.js",
|
||||
"module": "src/vlq.js",
|
||||
"files": [
|
||||
"README.md",
|
||||
"LICENSE",
|
||||
"src/vlq.js",
|
||||
"dist/vlq.js"
|
||||
],
|
||||
"devDependencies": {
|
||||
"eslint": "^3.19.0",
|
||||
"rollup": "^0.41.6"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "rollup src/vlq.js -n vlq -f umd > dist/vlq.js",
|
||||
"lint": "eslint src",
|
||||
"test": "node test",
|
||||
"pretest": "npm run build",
|
||||
"prepublish": "npm test"
|
||||
}
|
||||
}
|
||||
78
BACK_BACK/node_modules/vlq/src/vlq.js
generated
vendored
Executable file
78
BACK_BACK/node_modules/vlq/src/vlq.js
generated
vendored
Executable file
|
|
@ -0,0 +1,78 @@
|
|||
var charToInteger = {};
|
||||
var integerToChar = {};
|
||||
|
||||
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='.split( '' ).forEach( function ( char, i ) {
|
||||
charToInteger[ char ] = i;
|
||||
integerToChar[ i ] = char;
|
||||
});
|
||||
|
||||
export function decode ( string ) {
|
||||
var result = [];
|
||||
var shift = 0;
|
||||
var value = 0;
|
||||
|
||||
for ( var i = 0; i < string.length; i += 1 ) {
|
||||
var integer = charToInteger[ string[i] ];
|
||||
|
||||
if ( integer === undefined ) {
|
||||
throw new Error( 'Invalid character (' + string[i] + ')' );
|
||||
}
|
||||
|
||||
var hasContinuationBit = integer & 32;
|
||||
|
||||
integer &= 31;
|
||||
value += integer << shift;
|
||||
|
||||
if ( hasContinuationBit ) {
|
||||
shift += 5;
|
||||
} else {
|
||||
var shouldNegate = value & 1;
|
||||
value >>= 1;
|
||||
|
||||
result.push( shouldNegate ? -value : value );
|
||||
|
||||
// reset
|
||||
value = shift = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
export function encode ( value ) {
|
||||
var result;
|
||||
|
||||
if ( typeof value === 'number' ) {
|
||||
result = encodeInteger( value );
|
||||
} else {
|
||||
result = '';
|
||||
for ( var i = 0; i < value.length; i += 1 ) {
|
||||
result += encodeInteger( value[i] );
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
function encodeInteger ( num ) {
|
||||
var result = '';
|
||||
|
||||
if ( num < 0 ) {
|
||||
num = ( -num << 1 ) | 1;
|
||||
} else {
|
||||
num <<= 1;
|
||||
}
|
||||
|
||||
do {
|
||||
var clamped = num & 31;
|
||||
num >>= 5;
|
||||
|
||||
if ( num > 0 ) {
|
||||
clamped |= 32;
|
||||
}
|
||||
|
||||
result += integerToChar[ clamped ];
|
||||
} while ( num > 0 );
|
||||
|
||||
return result;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue