mirror of
https://github.com/apache/cordova-android.git
synced 2026-04-23 00:00:09 +08:00
CB-14145 remove old node_modules before patch fix
This commit is contained in:
-5
@@ -1,5 +0,0 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- "0.8"
|
||||
- "0.10"
|
||||
- "0.11"
|
||||
-21
@@ -1,21 +0,0 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014
|
||||
|
||||
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.
|
||||
-31
@@ -1,31 +0,0 @@
|
||||
base64-js
|
||||
=========
|
||||
|
||||
`base64-js` does basic base64 encoding/decoding in pure JS.
|
||||
|
||||
[](http://travis-ci.org/beatgammit/base64-js)
|
||||
|
||||
[](https://ci.testling.com/beatgammit/base64-js)
|
||||
|
||||
Many browsers already have base64 encoding/decoding functionality, but it is for text data, not all-purpose binary data.
|
||||
|
||||
Sometimes encoding/decoding binary data in the browser is useful, and that is what this module does.
|
||||
|
||||
## install
|
||||
|
||||
With [npm](https://npmjs.org) do:
|
||||
|
||||
`npm install base64-js`
|
||||
|
||||
## methods
|
||||
|
||||
`var base64 = require('base64-js')`
|
||||
|
||||
`base64` has two exposed functions, `toByteArray` and `fromByteArray`, which both take a single argument.
|
||||
|
||||
* `toByteArray` - Takes a base64 string and returns a byte array
|
||||
* `fromByteArray` - Takes a byte array and returns a base64 string
|
||||
|
||||
## license
|
||||
|
||||
MIT
|
||||
-19
@@ -1,19 +0,0 @@
|
||||
var random = require('crypto').pseudoRandomBytes
|
||||
|
||||
var b64 = require('../')
|
||||
var fs = require('fs')
|
||||
var path = require('path')
|
||||
var data = random(1e6).toString('base64')
|
||||
//fs.readFileSync(path.join(__dirname, 'example.b64'), 'ascii').split('\n').join('')
|
||||
var start = Date.now()
|
||||
var raw = b64.toByteArray(data)
|
||||
var middle = Date.now()
|
||||
var data = b64.fromByteArray(raw)
|
||||
var end = Date.now()
|
||||
|
||||
console.log('decode ms, decode ops/ms, encode ms, encode ops/ms')
|
||||
console.log(
|
||||
middle - start, data.length / (middle - start),
|
||||
end - middle, data.length / (end - middle))
|
||||
//console.log(data)
|
||||
|
||||
-124
@@ -1,124 +0,0 @@
|
||||
var lookup = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
|
||||
|
||||
;(function (exports) {
|
||||
'use strict';
|
||||
|
||||
var Arr = (typeof Uint8Array !== 'undefined')
|
||||
? Uint8Array
|
||||
: Array
|
||||
|
||||
var PLUS = '+'.charCodeAt(0)
|
||||
var SLASH = '/'.charCodeAt(0)
|
||||
var NUMBER = '0'.charCodeAt(0)
|
||||
var LOWER = 'a'.charCodeAt(0)
|
||||
var UPPER = 'A'.charCodeAt(0)
|
||||
var PLUS_URL_SAFE = '-'.charCodeAt(0)
|
||||
var SLASH_URL_SAFE = '_'.charCodeAt(0)
|
||||
|
||||
function decode (elt) {
|
||||
var code = elt.charCodeAt(0)
|
||||
if (code === PLUS ||
|
||||
code === PLUS_URL_SAFE)
|
||||
return 62 // '+'
|
||||
if (code === SLASH ||
|
||||
code === SLASH_URL_SAFE)
|
||||
return 63 // '/'
|
||||
if (code < NUMBER)
|
||||
return -1 //no match
|
||||
if (code < NUMBER + 10)
|
||||
return code - NUMBER + 26 + 26
|
||||
if (code < UPPER + 26)
|
||||
return code - UPPER
|
||||
if (code < LOWER + 26)
|
||||
return code - LOWER + 26
|
||||
}
|
||||
|
||||
function b64ToByteArray (b64) {
|
||||
var i, j, l, tmp, placeHolders, arr
|
||||
|
||||
if (b64.length % 4 > 0) {
|
||||
throw new Error('Invalid string. Length must be a multiple of 4')
|
||||
}
|
||||
|
||||
// the number of equal signs (place holders)
|
||||
// if there are two placeholders, than the two characters before it
|
||||
// represent one byte
|
||||
// if there is only one, then the three characters before it represent 2 bytes
|
||||
// this is just a cheap hack to not do indexOf twice
|
||||
var len = b64.length
|
||||
placeHolders = '=' === b64.charAt(len - 2) ? 2 : '=' === b64.charAt(len - 1) ? 1 : 0
|
||||
|
||||
// base64 is 4/3 + up to two characters of the original data
|
||||
arr = new Arr(b64.length * 3 / 4 - placeHolders)
|
||||
|
||||
// if there are placeholders, only get up to the last complete 4 chars
|
||||
l = placeHolders > 0 ? b64.length - 4 : b64.length
|
||||
|
||||
var L = 0
|
||||
|
||||
function push (v) {
|
||||
arr[L++] = v
|
||||
}
|
||||
|
||||
for (i = 0, j = 0; i < l; i += 4, j += 3) {
|
||||
tmp = (decode(b64.charAt(i)) << 18) | (decode(b64.charAt(i + 1)) << 12) | (decode(b64.charAt(i + 2)) << 6) | decode(b64.charAt(i + 3))
|
||||
push((tmp & 0xFF0000) >> 16)
|
||||
push((tmp & 0xFF00) >> 8)
|
||||
push(tmp & 0xFF)
|
||||
}
|
||||
|
||||
if (placeHolders === 2) {
|
||||
tmp = (decode(b64.charAt(i)) << 2) | (decode(b64.charAt(i + 1)) >> 4)
|
||||
push(tmp & 0xFF)
|
||||
} else if (placeHolders === 1) {
|
||||
tmp = (decode(b64.charAt(i)) << 10) | (decode(b64.charAt(i + 1)) << 4) | (decode(b64.charAt(i + 2)) >> 2)
|
||||
push((tmp >> 8) & 0xFF)
|
||||
push(tmp & 0xFF)
|
||||
}
|
||||
|
||||
return arr
|
||||
}
|
||||
|
||||
function uint8ToBase64 (uint8) {
|
||||
var i,
|
||||
extraBytes = uint8.length % 3, // if we have 1 byte left, pad 2 bytes
|
||||
output = "",
|
||||
temp, length
|
||||
|
||||
function encode (num) {
|
||||
return lookup.charAt(num)
|
||||
}
|
||||
|
||||
function tripletToBase64 (num) {
|
||||
return encode(num >> 18 & 0x3F) + encode(num >> 12 & 0x3F) + encode(num >> 6 & 0x3F) + encode(num & 0x3F)
|
||||
}
|
||||
|
||||
// go through the array every three bytes, we'll deal with trailing stuff later
|
||||
for (i = 0, length = uint8.length - extraBytes; i < length; i += 3) {
|
||||
temp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2])
|
||||
output += tripletToBase64(temp)
|
||||
}
|
||||
|
||||
// pad the end with zeros, but make sure to not forget the extra bytes
|
||||
switch (extraBytes) {
|
||||
case 1:
|
||||
temp = uint8[uint8.length - 1]
|
||||
output += encode(temp >> 2)
|
||||
output += encode((temp << 4) & 0x3F)
|
||||
output += '=='
|
||||
break
|
||||
case 2:
|
||||
temp = (uint8[uint8.length - 2] << 8) + (uint8[uint8.length - 1])
|
||||
output += encode(temp >> 10)
|
||||
output += encode((temp >> 4) & 0x3F)
|
||||
output += encode((temp << 2) & 0x3F)
|
||||
output += '='
|
||||
break
|
||||
}
|
||||
|
||||
return output
|
||||
}
|
||||
|
||||
exports.toByteArray = b64ToByteArray
|
||||
exports.fromByteArray = uint8ToBase64
|
||||
}(typeof exports === 'undefined' ? (this.base64js = {}) : exports))
|
||||
-101
@@ -1,101 +0,0 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
{
|
||||
"raw": "base64-js@0.0.8",
|
||||
"scope": null,
|
||||
"escapedName": "base64-js",
|
||||
"name": "base64-js",
|
||||
"rawSpec": "0.0.8",
|
||||
"spec": "0.0.8",
|
||||
"type": "version"
|
||||
},
|
||||
"/Users/steveng/repo/cordova/cordova-android/node_modules/plist"
|
||||
]
|
||||
],
|
||||
"_from": "base64-js@0.0.8",
|
||||
"_id": "base64-js@0.0.8",
|
||||
"_inCache": true,
|
||||
"_location": "/base64-js",
|
||||
"_nodeVersion": "0.10.35",
|
||||
"_npmUser": {
|
||||
"name": "feross",
|
||||
"email": "feross@feross.org"
|
||||
},
|
||||
"_npmVersion": "2.1.16",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"raw": "base64-js@0.0.8",
|
||||
"scope": null,
|
||||
"escapedName": "base64-js",
|
||||
"name": "base64-js",
|
||||
"rawSpec": "0.0.8",
|
||||
"spec": "0.0.8",
|
||||
"type": "version"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/plist"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/base64-js/-/base64-js-0.0.8.tgz",
|
||||
"_shasum": "1101e9544f4a76b1bc3b26d452ca96d7a35e7978",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "base64-js@0.0.8",
|
||||
"_where": "/Users/steveng/repo/cordova/cordova-android/node_modules/plist",
|
||||
"author": {
|
||||
"name": "T. Jameson Little",
|
||||
"email": "t.jameson.little@gmail.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/beatgammit/base64-js/issues"
|
||||
},
|
||||
"dependencies": {},
|
||||
"description": "Base64 encoding/decoding in pure JS",
|
||||
"devDependencies": {
|
||||
"tape": "~2.3.2"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "1101e9544f4a76b1bc3b26d452ca96d7a35e7978",
|
||||
"tarball": "https://registry.npmjs.org/base64-js/-/base64-js-0.0.8.tgz"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"gitHead": "b4a8a5fa9b0caeddb5ad94dd1108253d8f2a315f",
|
||||
"homepage": "https://github.com/beatgammit/base64-js",
|
||||
"license": "MIT",
|
||||
"main": "lib/b64.js",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "beatgammit",
|
||||
"email": "t.jameson.little@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "feross",
|
||||
"email": "feross@feross.org"
|
||||
}
|
||||
],
|
||||
"name": "base64-js",
|
||||
"optionalDependencies": {},
|
||||
"readme": "ERROR: No README data found!",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/beatgammit/base64-js.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "tape test/*.js"
|
||||
},
|
||||
"testling": {
|
||||
"files": "test/*.js",
|
||||
"browsers": [
|
||||
"ie/6..latest",
|
||||
"chrome/4..latest",
|
||||
"firefox/3..latest",
|
||||
"safari/5.1..latest",
|
||||
"opera/11.0..latest",
|
||||
"iphone/6",
|
||||
"ipad/6"
|
||||
]
|
||||
},
|
||||
"version": "0.0.8"
|
||||
}
|
||||
-51
@@ -1,51 +0,0 @@
|
||||
var test = require('tape'),
|
||||
b64 = require('../lib/b64'),
|
||||
checks = [
|
||||
'a',
|
||||
'aa',
|
||||
'aaa',
|
||||
'hi',
|
||||
'hi!',
|
||||
'hi!!',
|
||||
'sup',
|
||||
'sup?',
|
||||
'sup?!'
|
||||
];
|
||||
|
||||
test('convert to base64 and back', function (t) {
|
||||
t.plan(checks.length);
|
||||
|
||||
for (var i = 0; i < checks.length; i++) {
|
||||
var check = checks[i],
|
||||
b64Str,
|
||||
arr,
|
||||
str;
|
||||
|
||||
b64Str = b64.fromByteArray(map(check, function (char) { return char.charCodeAt(0); }));
|
||||
|
||||
arr = b64.toByteArray(b64Str);
|
||||
str = map(arr, function (byte) { return String.fromCharCode(byte); }).join('');
|
||||
|
||||
t.equal(check, str, 'Checked ' + check);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
function map (arr, callback) {
|
||||
var res = [],
|
||||
kValue,
|
||||
mappedValue;
|
||||
|
||||
for (var k = 0, len = arr.length; k < len; k++) {
|
||||
if ((typeof arr === 'string' && !!arr.charAt(k))) {
|
||||
kValue = arr.charAt(k);
|
||||
mappedValue = callback(kValue, k, arr);
|
||||
res[k] = mappedValue;
|
||||
} else if (typeof arr !== 'string' && k in arr) {
|
||||
kValue = arr[k];
|
||||
mappedValue = callback(kValue, k, arr);
|
||||
res[k] = mappedValue;
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
-18
@@ -1,18 +0,0 @@
|
||||
var test = require('tape'),
|
||||
b64 = require('../lib/b64');
|
||||
|
||||
test('decode url-safe style base64 strings', function (t) {
|
||||
var expected = [0xff, 0xff, 0xbe, 0xff, 0xef, 0xbf, 0xfb, 0xef, 0xff];
|
||||
|
||||
var actual = b64.toByteArray('//++/++/++//');
|
||||
for (var i = 0; i < actual.length; i++) {
|
||||
t.equal(actual[i], expected[i])
|
||||
}
|
||||
|
||||
actual = b64.toByteArray('__--_--_--__');
|
||||
for (var i = 0; i < actual.length; i++) {
|
||||
t.equal(actual[i], expected[i])
|
||||
}
|
||||
|
||||
t.end();
|
||||
});
|
||||
Reference in New Issue
Block a user