Compare commits

...

61 Commits

Author SHA1 Message Date
Darryl Pogue
725e75fa0d Update RELEASENOTES & version for v7.1.2 2018-11-05 12:17:08 -08:00
Darryl Pogue
36c6f44697 Always put the Google repo above jcenter 2018-10-23 20:17:21 -07:00
Rizal M. S
750531c4bc CB-14165 Emulator: handle "device still connecting" error (#457)
Keep waiting for emulator when connection fails with "device still connecting" error
2018-08-02 13:18:25 -04:00
Julio César
8a69e32800 CB-14125:(android) Increase old plugin compatibility 2018-08-02 13:18:25 -04:00
Joe Bowser
ea6477f4d3 CB-13830: Add handlers for plugins that use non-Java source files, such as Camera 2018-08-02 13:18:25 -04:00
Julio César
e32bcd88aa CB-14038 (android): fix false positive detecting project type 2018-08-02 13:18:25 -04:00
Christopher J. Brody
1efcbfa1d5 CB-14240 Set version & VERSION to 7.1.2-dev (coho) 2018-08-02 13:04:46 -04:00
Christopher J. Brody
f19ffd7abd CB-14240 Update JS to version 7.1.2-dev (via coho) 2018-08-02 13:04:45 -04:00
Christopher J. Brody
7a97fd7e34 Set VERSION to 7.1.1 (via coho) 2018-07-11 21:36:34 -04:00
Christopher J. Brody
cc87a9da1e Update JS snapshot to version 7.1.1 (via coho) 2018-07-11 21:36:33 -04:00
Christopher J. Brody
b84034da6c CB-14203 Update RELEASENOTES & version for 7.1.1 2018-07-11 19:29:29 -04:00
Christopher J. Brody
97ea735e53 pin some added bundled dependencies in 7.1.x only
Needed to clear the red highlights in npm outdated --depth=0
2018-07-11 18:55:03 -04:00
Gearoid M
c26082d362 Fix unsafe property access in run.js (#445) 2018-07-11 08:57:13 -04:00
Raphael von der Grün
9f33b0bb71 Emit log event instead of logging directly (#452)
in builder scripts
2018-07-11 08:57:13 -04:00
Raphael von der Grün
3570ca8113 CB-14101 Fix Java version check for Java >= 9 (#446)
This also checks that we have exactly 1.8 since nothing else works with
the Android SDK. The user facing error was updated accordingly.
2018-07-11 08:57:13 -04:00
Julio César
a1bd9e7d73 CB-14127: (android) Move google maven repo ahead of jcenter 2018-07-11 08:57:13 -04:00
Anthony Ward
1702b6470f CB-13923 (android) fix -1 length for compressed files 2018-07-11 08:57:13 -04:00
Christopher J. Brody
7a155259e9 package.json more bundledDependencies - 7.1.x only
(indirect production dependencies needed by deprecated Node.js 4.x)
2018-07-11 08:57:13 -04:00
Christopher J. Brody
6758793f09 CB-14145 commit updated node_modules in 7.1.x only
(installed by npm@6.1.0)
2018-07-11 08:57:13 -04:00
Christopher J. Brody
3071bb313f .gitignore updates (7.1.x patch)
- ignore all contents of node_modules/.bin
- explicitly ignore some node_modules contents not needed
- ignore package-lock.json in 7.1.x only
2018-07-11 08:57:13 -04:00
Christopher J. Brody
975e3a12f3 package.json pin other dependencies in 7.1.x only
- android-versions@1.3.0
- nopt@3.0.1
- properties-parser@0.2.3
- q@1.4.1
- shelljs@0.5.3

(elementtree@0.1.6 was already pinned)
2018-07-11 08:57:13 -04:00
Christopher J. Brody
566bca805e CB-14145 cordova-common@2 update&pin in 7.1.x only
resolves npm audit issue
2018-07-11 08:57:13 -04:00
Christopher J. Brody
94ea252259 CB-14145 remove old node_modules before patch fix 2018-07-11 08:57:13 -04:00
Christopher J. Brody
efb387b6ee CB-9366 log error.stack in cordova.js
(update JS snapshot from cordova-js@4.2.4 via coho)
2018-07-11 08:57:13 -04:00
Christopher J. Brody
0bd3309323 Set VERSION to 7.1.1-dev (via coho) 2018-06-19 15:01:50 -04:00
Christopher J. Brody
e73d8384f5 Update JS snapshot to version 7.1.1-dev (via coho) 2018-06-19 15:01:49 -04:00
Christopher J. Brody
4aeb892457 Revert "package.json mark 7.1.1-dev"
This reverts commit 3a83b5e8ee.

(leave it to coho)
2018-06-19 14:31:48 -04:00
Christopher J. Brody
3a83b5e8ee package.json mark 7.1.1-dev 2018-06-19 13:46:52 -04:00
Steve Gill
f7d122bd8e Set VERSION to 7.1.0 (via coho) 2018-02-21 10:52:01 -08:00
Steve Gill
152984855b Update JS snapshot to version 7.1.0 (via coho) 2018-02-21 10:52:00 -08:00
Steve Gill
8d9a1b82dd CB-13912 Updated RELEASENOTES and Version for release 7.1.0 2018-02-21 10:50:50 -08:00
Steve Gill
f1b57dd9b4 CB-13912: updated .ratignore to include build diectory 2018-02-20 11:36:55 -08:00
Steve Gill
d2a0323ae4 CB-13912 Updated checked-in node_modules 2018-02-20 11:17:05 -08:00
Simon MacDonald
3a339ba37f ⬆️ Bump gradle tools dependency to 3.0.1 for project template 2018-02-15 17:42:10 -05:00
Steve Gill
e9603b0738 CB-13879 updated gradle plugin 2018-02-14 16:54:06 -08:00
Joe Bowser
3d83fd784b Merge pull request #431 from sunday18/patch-1
CB-13818: (android) Update android_sdk.js to support Android Oreo 8.0 (API 26) emulator
2018-01-26 12:32:53 -08:00
Joe Bowser
38a5f891a4 Merge pull request #430 from abernix/abernix/bump-android-versions
CB-13831: (android) Update `android-versions` to 1.3.0 to support SDK 27.
2018-01-26 08:02:35 -08:00
sunday18
8563c8beef Update android_sdk.js
Update `android_sdk.js` to support Android Oreo (API 26) emulator
2018-01-26 06:21:53 +00:00
Jesse Rosenberger
f91102ee07 CB-13831: (android) Update android-versions to 1.3.0 to support SDK 27.
The `android-versions@1.3.0` version now has support for Android SDK level
27 thanks to 230957205e.

As the `android-versions` npm is a "bundled dependency" this will only
take effect when a new version of `cordova-android` is published, since
bundled dependencies are packed within the npm at publish time, not
automatically fetched as dependencies at publish time (which would have
normally been covered for new installations of cordova-android@7.0.0
thanks to semver caret notation).
2018-01-25 20:08:10 +02:00
Joe Bowser
cc08e9d84a Merge pull request #429 from BBosman/cb13800
CB-13800: Drop pre-KitKat specific code
2018-01-19 11:09:40 -08:00
Bas Bosman
075d38117a CB-13800: (android) Drop pre-KitKat specific code 2018-01-19 13:58:24 +01:00
Joe Bowser
6cc4896690 Merge pull request #426 from infil00p/api_level_bump
CB-13724: Bump Target SDK to API 27
2018-01-17 11:48:51 -08:00
Joe Bowser
673a6773b2 Merge pull request #427 from infil00p/deleteDeprecatedNdk
CB-13646: End of an era.  Using the deprecated NDK by default breaks …
2018-01-10 12:08:46 -08:00
Joe Bowser
3a6923988d CB-13646: End of an era. Using the deprecated NDK by default breaks the build. Crosswalk users need to specify the Gradle parameters to keep it working. 2018-01-08 14:52:46 -08:00
Joe Bowser
0d1692681f CB-13724: Updated the Android Tooling required for the latest version on both the test project, and the template 2018-01-04 15:35:04 -08:00
Joe Bowser
fcf705e007 Merge pull request #425 from deton/fix-nullresult-fromthread
CB-12218: (android) Fix consistency of null result message
2018-01-03 11:24:24 -08:00
Joe Bowser
5c93c214b9 CB-13724: Bump Target SDK to API 27 2018-01-02 14:38:03 -08:00
Joe Bowser
7cbb8401a2 Merge pull request #422 from themightychris/patch-2
Prevent crash when unrecognized android version encounterd
2018-01-02 14:34:17 -08:00
Joe Bowser
b3c262cd47 Merge pull request #424 from jcesarmobile/CB-13721
CB-13721 (Android): fix build apps that use cdvHelpers.getConfigPreference
2018-01-02 13:41:45 -08:00
KIHARA Hideto
45a7b90c6c CB-12218: (android) Fix consistency of null result message
Fix problem that JavaScript receives ""(empty string) instead of null
if plugin sends null result from new thread.
2018-01-02 12:41:17 +09:00
Julio César
e1c3b4fd94 CB-13721 (Android): fix build apps that use cdvHelpers.getConfigPreference 2017-12-30 01:07:45 +01:00
Chris Alfano
109112ae75 CB-13571: (android) Prevent crash with unrecognized android version
Fixes issue where commands that list images will crash when an image with a version not present in `android-versions` is encountered, as is presently the case with API 27:

```
cordova run android --list
Available android devices:
Available android virtual devices:
LEVEL: null
ERROR: TypeError: Cannot read property 'semver' of null
An unexpected error has occured while running list-emulator-images with code 2: Error: /home/chris/Repositories/acp-guidelines/cordova/platforms/android/cordova/lib/list-emulator-images: Command failed with exit code 2
```

Signed-off-by: Chris Alfano <chris@jarv.us>
2017-12-22 15:56:26 -05:00
Joe Bowser
a24ba41eda Merge pull request #421 from infil00p/test-sdk-bump
CB-12914: Test needs SDK bumps
2017-12-18 12:19:24 -08:00
Joe Bowser
be3f8ef80d CB-12914: Test needs SDK bumps 2017-12-14 13:48:19 -08:00
Joe Bowser
d50dedb5d0 Merge pull request #420 from infil00p/CB12914
CB-12914: Forgot to bump AndroidManifest.xml for play store reasons
2017-12-14 09:58:18 -08:00
Joe Bowser
74e9e213d6 Forgot to bump AndroidManifest.xml for play store reasons 2017-12-12 12:49:54 -08:00
Joe Bowser
d8d92cae61 CB-13621: eslint error 2017-11-30 11:08:39 -08:00
Joe Bowser
99d5b4d982 CB-13622: Testing commit 2017-11-30 10:56:28 -08:00
Joe Bowser
52fd32c837 CB-13621: Wrote similar warning to CB-12948 on iOS. We no longer support update. 2017-11-30 10:40:07 -08:00
Joe Bowser
061f08bc03 Update JS snapshot to version 7.1.0-dev (via coho) 2017-11-30 10:01:30 -08:00
Joe Bowser
735bc98243 Set VERSION to 7.1.0-dev (via coho) 2017-11-30 10:01:28 -08:00
608 changed files with 4237 additions and 31554 deletions

21
.gitignore vendored
View File

@@ -43,28 +43,14 @@ tmp/**/*
**/.idea/**/*
*.iml
npm-debug.log
node_modules/.bin
node_modules/concat-map/example
node_modules/properties-parser/test
node_modules/jshint
node_modules/promise-matchers
node_modules/jasmine
node_modules/rewire
node_modules/istanbul
node_modules/.bin/cake
node_modules/.bin/coffee
node_modules/.bin/escodegen
node_modules/.bin/esgenerate
node_modules/.bin/esparse
node_modules/.bin/esvalidate
node_modules/.bin/handlebars
node_modules/.bin/istanbul
node_modules/.bin/jasmine
node_modules/.bin/js-yaml
node_modules/.bin/jshint
node_modules/.bin/mkdirp
node_modules/.bin/r.js
node_modules/.bin/r_js
node_modules/.bin/strip-json-comments
node_modules/.bin/uglifyjs
node_modules/.bin/which
node_modules/align-text/
node_modules/amdefine/
node_modules/argparse/
@@ -133,3 +119,4 @@ node_modules/wordwrap/
node_modules/yargs/
node_modules/jasmine-core/
node_modules/fs.realpath/
package-lock.json

View File

@@ -6,3 +6,4 @@ spec
appveyor.yml
framework/build
ic_launcher.png
build

View File

@@ -20,6 +20,34 @@
-->
## Release Notes for Cordova (Android) ##
### 7.1.2 (Nov 08, 2018)
* [CB-14127](https://issues.apache.org/jira/browse/CB-14127): Always put the Google repo above jcenter
* [CB-14165](https://issues.apache.org/jira/browse/CB-14165): Emulator: handle "device still connecting" error (#457)
* [CB-14125](https://issues.apache.org/jira/browse/CB-14125): Increase old plugin compatibility
* [CB-13830](https://issues.apache.org/jira/browse/CB-13830): Add handlers for plugins that use non-Java source files, such as Camera
* [CB-14038](https://issues.apache.org/jira/browse/CB-14038): fix false positive detecting project type
### 7.1.1 (Jul 11, 2018)
* Fix unsafe property access in run.js (#445)
* Emit log event instead of logging directly (#452)
* [CB-14101](https://issues.apache.org/jira/browse/CB-14101) Fix Java version check for Java >= 9 (#446)
* [CB-14127](https://issues.apache.org/jira/browse/CB-14127) (android) Move google maven repo ahead of jcenter
* [CB-13923](https://issues.apache.org/jira/browse/CB-13923) (android) fix -1 length for compressed files
* [CB-14145](https://issues.apache.org/jira/browse/CB-14145) use cordova-common@2.2.5 and update other dependencies to resolve `npm audit` warnings
* [CB-9366](https://issues.apache.org/jira/browse/CB-9366) log error.stack in cordova.js
### 7.1.0 (Feb 20, 2018)
* [CB-13879](https://issues.apache.org/jira/browse/CB-13879) updated gradle tools dependency to 3.0.1 for project template
* [CB-13831](https://issues.apache.org/jira/browse/CB-13831) Update `android-versions` to 1.3.0 to support SDK 27.
* [CB-13800](https://issues.apache.org/jira/browse/CB-13800) Drop pre-KitKat specific code
* [CB-13724](https://issues.apache.org/jira/browse/CB-13724) Updated the **Android** Tooling required for the latest version on both the test project, and the template
* [CB-13724](https://issues.apache.org/jira/browse/CB-13724) Bump Target SDK to API 27
* [CB-13646](https://issues.apache.org/jira/browse/CB-13646) Using the deprecated `NDK` by default breaks the build. Crosswalk users need to specify the Gradle parameters to keep it working.
* [CB-12218](https://issues.apache.org/jira/browse/CB-12218) Fix consistency of null result message
* [CB-13571](https://issues.apache.org/jira/browse/CB-13571) Prevent crash with unrecognized **Android** version
* [CB-13721](https://issues.apache.org/jira/browse/CB-13721) Fix build apps that use `cdvHelpers.getConfigPreference`
* [CB-13621](https://issues.apache.org/jira/browse/CB-13621) Wrote similar warning to [CB-12948](https://issues.apache.org/jira/browse/CB-12948) on **iOS**. We no longer support `cordova update` command.
### 7.0.0 (Nov 30, 2017)
* [CB-13612](https://issues.apache.org/jira/browse/CB-13612) Fix the remapper so that XML files copy over and the Camera works again.
* [CB-13741](https://issues.apache.org/jira/browse/CB-13741) Bump `package.json` so we can install plugins

View File

@@ -1 +1 @@
6.5.0-dev
7.1.2

View File

@@ -26,10 +26,7 @@ var fs = require('fs');
var check_reqs = require('./../templates/cordova/lib/check_reqs');
var ROOT = path.join(__dirname, '..', '..');
var MIN_SDK_VERSION = 19;
var CordovaError = require('cordova-common').CordovaError;
var AndroidStudio = require('../templates/cordova/lib/AndroidStudio');
var AndroidManifest = require('../templates/cordova/lib/AndroidManifest');
// Export all helper functions, and make sure internally within this module, we
@@ -348,39 +345,16 @@ function generateDoneMessage (type, link) {
// Returns a promise.
exports.update = function (projectPath, options, events) {
options = options || {};
return Q()
.then(function () {
var errorString =
'An in-place platform update is not supported. \n' +
'The `platforms` folder is always treated as a build artifact in the CLI workflow.\n' +
'To update your platform, you have to remove, then add your android platform again.\n' +
'Make sure you save your plugins beforehand using `cordova plugin save`, and save \n' + 'a copy of the platform first if you had manual changes in it.\n' +
'\tcordova plugin save\n' +
'\tcordova platform rm android\n' +
'\tcordova platform add android\n'
;
var isAndroidStudio = AndroidStudio.isAndroidStudioProject(projectPath);
var isLegacy = !isAndroidStudio;
var manifest = null;
var builder = 'gradle';
if (isAndroidStudio) {
manifest = new AndroidManifest(path.join(projectPath, 'app', 'main', 'AndroidManifest.xml'));
builder = 'studio';
} else {
manifest = new AndroidManifest(path.join(projectPath, 'AndroidManifest.xml'));
builder = 'gradle';
}
if (Number(manifest.getMinSdkVersion()) < MIN_SDK_VERSION) {
events.emit('verbose', 'Updating minSdkVersion to ' + MIN_SDK_VERSION + ' in AndroidManifest.xml');
manifest.setMinSdkVersion(MIN_SDK_VERSION);
}
manifest.setDebuggable(false).write();
var projectName = manifest.getActivity().getName();
var target_api = check_reqs.get_target();
exports.copyJsAndLibrary(projectPath, options.link, projectName, isLegacy);
exports.copyScripts(projectPath);
exports.copyBuildRules(projectPath, isLegacy);
exports.writeProjectProperties(projectPath, target_api);
exports.prepBuildFiles(projectPath, builder);
events.emit('log', generateDoneMessage('update', options.link));
}).thenResolve(projectPath);
return Q.reject(errorString);
};

View File

@@ -248,7 +248,7 @@ Api.prototype.addPlugin = function (plugin, installOptions) {
}).then(function () {
if (plugin.getFrameworks(this.platform).length === 0) return;
selfEvents.emit('verbose', 'Updating build files since android plugin contained <framework>');
// This should pick the correct builder, not just get gradle
// This should pick the correct builder, not just get gradle
require('./lib/builders/builders').getBuilder(this.builder).prepBuildFiles();
}.bind(this))
// CB-11022 Return truthy value to prevent running prepare after

View File

@@ -6,37 +6,6 @@
/* jshint esnext: false */
var path = require('path');
var fs = require('fs');
var CordovaError = require('cordova-common').CordovaError;
module.exports.isAndroidStudioProject = function isAndroidStudioProject (root) {
var eclipseFiles = ['AndroidManifest.xml', 'libs', 'res'];
var androidStudioFiles = ['app', 'app/src/main'];
// assume it is an AS project and not an Eclipse project
var isEclipse = false;
var isAS = true;
if (!fs.existsSync(root)) {
throw new CordovaError('AndroidStudio.js:inAndroidStudioProject root does not exist: ' + root);
}
// if any of the following exists, then we are not an ASProj
eclipseFiles.forEach(function (file) {
if (fs.existsSync(path.join(root, file))) {
isEclipse = true;
}
});
// if it is NOT an eclipse project, check that all required files exist
if (!isEclipse) {
androidStudioFiles.forEach(function (file) {
if (!fs.existsSync(path.join(root, file))) {
console.log('missing file :: ' + file);
isAS = false;
}
});
}
return (!isEclipse && isAS);
return true;
};

View File

@@ -62,7 +62,8 @@ module.exports.version_string_to_api_level = {
'5.1': 22,
'6.0': 23,
'7.0': 24,
'7.1.1': 25
'7.1.1': 25,
'8.0': 26
};
function parse_targets (output) {

View File

@@ -24,6 +24,7 @@ var path = require('path');
var shell = require('shelljs');
var superspawn = require('cordova-common').superspawn;
var CordovaError = require('cordova-common').CordovaError;
var events = require('cordova-common').events;
var check_reqs = require('../check_reqs');
var GenericBuilder = require('./GenericBuilder');
@@ -178,7 +179,7 @@ GradleBuilder.prototype.prepBuildFiles = function () {
};
subProjects.forEach(function (p) {
console.log('Subproject Path: ' + p);
events.emit('log', 'Subproject Path: ' + p);
var libName = p.replace(/[/\\]/g, ':').replace(name + '-', '');
depsList += ' implementation(project(path: "' + libName + '"))';
insertExclude(p);

View File

@@ -23,6 +23,7 @@ var util = require('util');
var path = require('path');
var shell = require('shelljs');
var spawn = require('cordova-common').superspawn.spawn;
var events = require('cordova-common').events;
var CordovaError = require('cordova-common').CordovaError;
var check_reqs = require('../check_reqs');
@@ -58,7 +59,7 @@ StudioBuilder.prototype.getArgs = function (cmd, opts) {
// to allow dex in process
args.push('-Dorg.gradle.jvmargs=-Xmx2048m');
// allow NDK to be used - required by Gradle 1.5 plugin
args.push('-Pandroid.useDeprecatedNdk=true');
// args.push('-Pandroid.useDeprecatedNdk=true');
args.push.apply(args, opts.extraArgs);
// Shaves another 100ms, but produces a "try at own risk" warning. Not worth it (yet):
// args.push('-Dorg.gradle.parallel=true');
@@ -167,7 +168,7 @@ StudioBuilder.prototype.prepBuildFiles = function () {
}
};
subProjects.forEach(function (p) {
console.log('Subproject Path: ' + p);
events.emit('log', 'Subproject Path: ' + p);
var libName = p.replace(/[/\\]/g, ':').replace(name + '-', '');
if (libName !== 'app') {
depsList += ' implementation(project(path: ":' + libName + '"))';
@@ -214,28 +215,28 @@ StudioBuilder.prototype.prepBuildFiles = function () {
StudioBuilder.prototype.prepEnv = function (opts) {
var self = this;
return check_reqs.check_gradle()
.then(function (gradlePath) {
return self.runGradleWrapper(gradlePath);
}).then(function () {
return self.prepBuildFiles();
}).then(function () {
// If the gradle distribution URL is set, make sure it points to version we want.
// If it's not set, do nothing, assuming that we're using a future version of gradle that we don't want to mess with.
// For some reason, using ^ and $ don't work. This does the job, though.
var distributionUrlRegex = /distributionUrl.*zip/;
var distributionUrl = process.env['CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL'] || 'https\\://services.gradle.org/distributions/gradle-4.1-all.zip';
var gradleWrapperPropertiesPath = path.join(self.root, 'gradle', 'wrapper', 'gradle-wrapper.properties');
shell.chmod('u+w', gradleWrapperPropertiesPath);
shell.sed('-i', distributionUrlRegex, 'distributionUrl=' + distributionUrl, gradleWrapperPropertiesPath);
.then(function (gradlePath) {
return self.runGradleWrapper(gradlePath);
}).then(function () {
return self.prepBuildFiles();
}).then(function () {
// If the gradle distribution URL is set, make sure it points to version we want.
// If it's not set, do nothing, assuming that we're using a future version of gradle that we don't want to mess with.
// For some reason, using ^ and $ don't work. This does the job, though.
var distributionUrlRegex = /distributionUrl.*zip/;
var distributionUrl = process.env['CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL'] || 'https\\://services.gradle.org/distributions/gradle-4.1-all.zip';
var gradleWrapperPropertiesPath = path.join(self.root, 'gradle', 'wrapper', 'gradle-wrapper.properties');
shell.chmod('u+w', gradleWrapperPropertiesPath);
shell.sed('-i', distributionUrlRegex, 'distributionUrl=' + distributionUrl, gradleWrapperPropertiesPath);
var propertiesFile = opts.buildType + SIGNING_PROPERTIES;
var propertiesFilePath = path.join(self.root, propertiesFile);
if (opts.packageInfo) {
fs.writeFileSync(propertiesFilePath, TEMPLATE + opts.packageInfo.toProperties());
} else if (isAutoGenerated(propertiesFilePath)) {
shell.rm('-f', propertiesFilePath);
}
});
var propertiesFile = opts.buildType + SIGNING_PROPERTIES;
var propertiesFilePath = path.join(self.root, propertiesFile);
if (opts.packageInfo) {
fs.writeFileSync(propertiesFilePath, TEMPLATE + opts.packageInfo.toProperties());
} else if (isAutoGenerated(propertiesFilePath)) {
shell.rm('-f', propertiesFilePath);
}
});
};
/*
@@ -247,33 +248,33 @@ StudioBuilder.prototype.build = function (opts) {
var args = this.getArgs(opts.buildType === 'debug' ? 'debug' : 'release', opts);
return spawn(wrapper, args, {stdio: 'pipe'})
.progress(function (stdio) {
if (stdio.stderr) {
/*
* Workaround for the issue with Java printing some unwanted information to
* stderr instead of stdout.
* This function suppresses 'Picked up _JAVA_OPTIONS' message from being
* printed to stderr. See https://issues.apache.org/jira/browse/CB-9971 for
* explanation.
*/
var suppressThisLine = /^Picked up _JAVA_OPTIONS: /i.test(stdio.stderr.toString());
if (suppressThisLine) {
return;
.progress(function (stdio) {
if (stdio.stderr) {
/*
* Workaround for the issue with Java printing some unwanted information to
* stderr instead of stdout.
* This function suppresses 'Picked up _JAVA_OPTIONS' message from being
* printed to stderr. See https://issues.apache.org/jira/browse/CB-9971 for
* explanation.
*/
var suppressThisLine = /^Picked up _JAVA_OPTIONS: /i.test(stdio.stderr.toString());
if (suppressThisLine) {
return;
}
process.stderr.write(stdio.stderr);
} else {
process.stdout.write(stdio.stdout);
}
process.stderr.write(stdio.stderr);
} else {
process.stdout.write(stdio.stdout);
}
}).catch(function (error) {
if (error.toString().indexOf('failed to find target with hash string') >= 0) {
return check_reqs.check_android_target(error).then(function () {
// If due to some odd reason - check_android_target succeeds
// we should still fail here.
return Q.reject(error);
});
}
return Q.reject(error);
});
}).catch(function (error) {
if (error.toString().indexOf('failed to find target with hash string') >= 0) {
return check_reqs.check_android_target(error).then(function () {
// If due to some odd reason - check_android_target succeeds
// we should still fail here.
return Q.reject(error);
});
}
return Q.reject(error);
});
};
StudioBuilder.prototype.clean = function (opts) {
@@ -283,16 +284,16 @@ StudioBuilder.prototype.clean = function (opts) {
return Q().then(function () {
return spawn(wrapper, args, {stdio: 'inherit'});
})
.then(function () {
shell.rm('-rf', path.join(builder.root, 'out'));
.then(function () {
shell.rm('-rf', path.join(builder.root, 'out'));
['debug', 'release'].forEach(function (config) {
var propertiesFilePath = path.join(builder.root, config + SIGNING_PROPERTIES);
if (isAutoGenerated(propertiesFilePath)) {
shell.rm('-f', propertiesFilePath);
}
['debug', 'release'].forEach(function (config) {
var propertiesFilePath = path.join(builder.root, config + SIGNING_PROPERTIES);
if (isAutoGenerated(propertiesFilePath)) {
shell.rm('-f', propertiesFilePath);
}
});
});
});
};
module.exports = StudioBuilder;

View File

@@ -41,17 +41,6 @@ function forgivingWhichSync (cmd) {
}
}
function tryCommand (cmd, errMsg, catchStderr) {
var d = Q.defer();
child_process.exec(cmd, function (err, stdout, stderr) {
if (err) d.reject(new CordovaError(errMsg));
// Sometimes it is necessary to return an stderr instead of stdout in case of success, since
// some commands prints theirs output to stderr instead of stdout. 'javac' is the example
else d.resolve((catchStderr ? stderr : stdout).trim());
});
return d.promise;
}
module.exports.isWindows = function () {
return (os.platform() === 'win32');
};
@@ -207,19 +196,22 @@ module.exports.check_java = function () {
}
}
}).then(function () {
var msg =
'Failed to run "javac -version", make sure that you have a JDK installed.\n' +
'You can get it from: http://www.oracle.com/technetwork/java/javase/downloads.\n';
if (process.env['JAVA_HOME']) {
msg += 'Your JAVA_HOME is invalid: ' + process.env['JAVA_HOME'] + '\n';
}
// We use tryCommand with catchStderr = true, because
// javac writes version info to stderr instead of stdout
return tryCommand('javac -version', msg, true).then(function (output) {
// Let's check for at least Java 8, and keep it future proof so we can support Java 10
var match = /javac ((?:1\.)(?:[8-9]\.)(?:\d+))|((?:1\.)(?:[1-9]\d+\.)(?:\d+))/i.exec(output);
return match && match[1];
});
return Q.denodeify(child_process.exec)('javac -version')
.then(outputs => {
// outputs contains two entries: stdout and stderr
// Java <= 8 writes version info to stderr, Java >= 9 to stdout
const output = outputs.join('').trim();
const match = /javac\s+([\d.]+)/i.exec(output);
return match && match[1];
}, () => {
var msg =
'Failed to run "javac -version", make sure that you have a JDK installed.\n' +
'You can get it from: http://www.oracle.com/technetwork/java/javase/downloads.\n';
if (process.env['JAVA_HOME']) {
msg += 'Your JAVA_HOME is invalid: ' + process.env['JAVA_HOME'] + '\n';
}
throw new CordovaError(msg);
});
});
};
@@ -366,8 +358,8 @@ module.exports.run = function () {
console.log('ANDROID_HOME=' + process.env['ANDROID_HOME']);
console.log('JAVA_HOME=' + process.env['JAVA_HOME']);
if (!values[0]) {
throw new CordovaError('Requirements check failed for JDK 1.8 or greater');
if (!String(values[0]).startsWith('1.8.')) {
throw new CordovaError('Requirements check failed for JDK 1.8');
}
if (!values[1]) {

View File

@@ -187,7 +187,9 @@ module.exports.list_images = function () {
var api_level = avd.target.match(/\d+/);
if (api_level) {
var level = android_versions.get(api_level);
avd.target = 'Android ' + level.semver + ' (API level ' + api_level + ')';
if (level) {
avd.target = 'Android ' + level.semver + ' (API level ' + api_level + ')';
}
}
}
return avd;
@@ -342,7 +344,8 @@ module.exports.wait_for_emulator = function (port) {
}, function (error) {
if ((error && error.message &&
(error.message.indexOf('not found') > -1)) ||
(error.message.indexOf('device offline') > -1)) {
(error.message.indexOf('device offline') > -1) ||
(error.message.indexOf('device still connecting') > -1)) {
// emulator not yet started, continue waiting
return self.wait_for_emulator(port);
} else {

View File

@@ -20,10 +20,10 @@
buildscript {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
jcenter()
}
// Switch the Android Gradle plugin version requirement depending on the

View File

@@ -34,15 +34,7 @@ var handlers = {
// a later plugins release. This is for legacy plugins to work with Cordova.
if (options && options.android_studio === true) {
// If a Java file is using the new directory structure, don't penalize it
if (!obj.targetDir.includes('app/src/main')) {
if (obj.src.endsWith('.java')) {
dest = path.join('app/src/main/java', obj.targetDir.substring(4), path.basename(obj.src));
} else if (obj.src.endsWith('.xml')) {
// We are making a huge assumption here that XML files will be going to res/xml or values/xml
dest = path.join('app/src/main', obj.targetDir, path.basename(obj.src));
}
}
dest = studioPathRemap(obj);
}
if (options && options.force) {
@@ -55,10 +47,16 @@ var handlers = {
var dest = path.join(obj.targetDir, path.basename(obj.src));
if (options && options.android_studio === true) {
dest = path.join('app/src/main/java', obj.targetDir.substring(4), path.basename(obj.src));
dest = studioPathRemap(obj);
}
deleteJava(project.projectDir, dest);
// TODO: Add Koltin extension to uninstall, since they are handled like Java files
if (obj.src.endsWith('java')) {
deleteJava(project.projectDir, dest);
} else {
// Just remove the file, not the whole parent directory
removeFile(project.projectDir, dest);
}
}
},
'lib-file': {
@@ -318,3 +316,16 @@ function removeFileAndParents (baseDir, destFile, stopper) {
function generateAttributeError (attribute, element, id) {
return 'Required attribute "' + attribute + '" not specified in <' + element + '> element from plugin: ' + id;
}
function studioPathRemap (obj) {
// If a Java file is using the new directory structure, don't penalize it
if (!obj.targetDir.includes('app/src/main')) {
if (obj.src.endsWith('.java')) {
return path.join('app/src/main/java', obj.targetDir.substring(4), path.basename(obj.src));
} else {
// For all other files, add 'app/src/main' to the targetDir if it didn't have it already
return path.join('app/src/main', obj.targetDir, path.basename(obj.src));
}
}
}

View File

@@ -108,7 +108,7 @@ module.exports.run = function (runOptions) {
// format than emulator.install expects.
// TODO: Update emulator/device.install to handle this change
return build.run.call(self, runOptions, resolvedTarget).then(function (buildResults) {
if (resolvedTarget.isEmulator) {
if (resolvedTarget && resolvedTarget.isEmulator) {
return emulator.wait_for_boot(resolvedTarget.target).then(function () {
return emulator.install(resolvedTarget, buildResults);
});

View File

@@ -20,7 +20,7 @@
*/
// Coho updates this line:
var VERSION = "6.5.0-dev";
var VERSION = "7.1.2";
module.exports.version = VERSION;

View File

@@ -45,5 +45,5 @@
</activity>
</application>
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="__APILEVEL__"/>
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="__APILEVEL__"/>
</manifest>

View File

@@ -22,14 +22,14 @@ apply plugin: 'com.android.application'
buildscript {
repositories {
mavenCentral()
jcenter()
maven {
url "https://maven.google.com"
}
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'com.android.tools.build:gradle:3.0.1'
}
}

View File

@@ -1,5 +1,5 @@
// Platform: android
// 4450a4cea50616e080a82e8ede9e3d6a1fe3c3ec
// 9e8e1b716252c4a08abcd31a13013b868d6f4141
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
@@ -19,7 +19,7 @@
under the License.
*/
;(function() {
var PLATFORM_VERSION_BUILD_LABEL = '6.5.0-dev';
var PLATFORM_VERSION_BUILD_LABEL = '7.1.2';
// file: src/scripts/require.js
/* jshint -W079 */
@@ -307,6 +307,7 @@ var cordova = {
} catch (err) {
var msg = 'Error in ' + (isSuccess ? 'Success' : 'Error') + ' callbackId: ' + callbackId + ' : ' + err;
console && console.log && console.log(msg);
console && console.log && err.stack && console.log(err.stack);
cordova.fireWindowEvent('cordovacallbackerror', { 'message': msg });
throw err;
}
@@ -326,7 +327,7 @@ module.exports = cordova;
});
// file: /Users/jbowser/cordova/cordova-android/cordova-js-src/android/nativeapiprovider.js
// file: /Users/brodybits/Documents/cordova/cordova-android/cordova-js-src/android/nativeapiprovider.js
define("cordova/android/nativeapiprovider", function(require, exports, module) {
/**
@@ -349,7 +350,7 @@ module.exports = {
});
// file: /Users/jbowser/cordova/cordova-android/cordova-js-src/android/promptbasednativeapi.js
// file: /Users/brodybits/Documents/cordova/cordova-android/cordova-js-src/android/promptbasednativeapi.js
define("cordova/android/promptbasednativeapi", function(require, exports, module) {
/**
@@ -881,7 +882,7 @@ module.exports = channel;
});
// file: /Users/jbowser/cordova/cordova-android/cordova-js-src/exec.js
// file: /Users/brodybits/Documents/cordova/cordova-android/cordova-js-src/exec.js
define("cordova/exec", function(require, exports, module) {
/**
@@ -1639,7 +1640,7 @@ exports.reset();
});
// file: /Users/jbowser/cordova/cordova-android/cordova-js-src/platform.js
// file: /Users/brodybits/Documents/cordova/cordova-android/cordova-js-src/platform.js
define("cordova/platform", function(require, exports, module) {
// The last resume event that was received that had the result of a plugin call.
@@ -1749,7 +1750,7 @@ function onMessageFromNative(msg) {
});
// file: /Users/jbowser/cordova/cordova-android/cordova-js-src/plugin/android/app.js
// file: /Users/brodybits/Documents/cordova/cordova-android/cordova-js-src/plugin/android/app.js
define("cordova/plugin/android/app", function(require, exports, module) {
var exec = require('cordova/exec');
@@ -2185,4 +2186,4 @@ window.cordova = require('cordova');
require('cordova/init');
})();
})();

View File

@@ -20,32 +20,32 @@
buildscript {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
jcenter()
}
dependencies {
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'com.android.tools.build:gradle:3.0.1'
}
}
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
jcenter()
}
//This replaces project.properties w.r.t. build settings
project.ext {
defaultBuildToolsVersion="25.0.2" //String
defaultBuildToolsVersion="27.0.1" //String
defaultMinSdkVersion=19 //Integer - Minimum requirement is Android 4.4
defaultTargetSdkVersion=26 //Integer - We ALWAYS target the latest by default
defaultCompileSdkVersion=26 //Integer - We ALWAYS compile with the latest by default
defaultTargetSdkVersion=27 //Integer - We ALWAYS target the latest by default
defaultCompileSdkVersion=27 //Integer - We ALWAYS compile with the latest by default
}
}

View File

@@ -19,5 +19,5 @@
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.apache.cordova" android:versionName="1.0" android:versionCode="1">
<uses-sdk android:minSdkVersion="16" />
<uses-sdk android:minSdkVersion="19" />
</manifest>

View File

@@ -24,14 +24,14 @@ ext {
buildscript {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
}
@@ -42,7 +42,7 @@ apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'
group = 'org.apache.cordova'
version = '7.0.0'
version = '7.1.2'
android {
compileSdkVersion cdvCompileSdkVersion
@@ -129,9 +129,9 @@ bintray {
licenses = ['Apache-2.0']
labels = ['android', 'cordova', 'phonegap']
version {
name = '6.5.0-dev'
name = '7.1.2'
released = new Date()
vcsTag = '6.5.0-dev'
vcsTag = '7.1.2'
}
}
}

View File

@@ -165,7 +165,7 @@ def doPromptForPassword(msg) {
}
def doGetConfigXml() {
def xml = file("res/xml/config.xml").getText()
def xml = file("src/main/res/xml/config.xml").getText()
// Disable namespace awareness since Cordova doesn't use them properly
return new XmlParser(false, false).parseText(xml)
}

View File

@@ -10,7 +10,7 @@
# Indicates whether an apk should be generated for each density.
split.density=false
# Project target.
target=android-26
target=android-27
apk-configurations=
renderscript.opt.level=O0
android.library=true

View File

@@ -123,7 +123,7 @@ public class CordovaActivity extends Activity {
if (preferences.getBoolean("Fullscreen", false)) {
// NOTE: use the FullscreenNotImmersive configuration key to set the activity in a REAL full screen
// (as was the case in previous cordova versions)
if ((Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) && !preferences.getBoolean("FullscreenNotImmersive", false)) {
if (!preferences.getBoolean("FullscreenNotImmersive", false)) {
immersiveMode = true;
} else {
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,

View File

@@ -263,6 +263,7 @@ public class CordovaResourceApi {
} catch (FileNotFoundException e) {
// Will occur if the file is compressed.
inputStream = assetManager.open(assetPath);
length = inputStream.available();
}
String mimeType = getMimeTypeFromPath(assetPath);
return new OpenForReadResult(uri, inputStream, mimeType, length, assetFd);

View File

@@ -31,7 +31,7 @@ import android.webkit.WebChromeClient.CustomViewCallback;
* are not expected to implement it.
*/
public interface CordovaWebView {
public static final String CORDOVA_VERSION = "6.5.0-dev";
public static final String CORDOVA_VERSION = "7.1.2";
void init(CordovaInterface cordova, List<PluginEntry> pluginEntries, CordovaPreferences preferences);

View File

@@ -511,6 +511,9 @@ public class NativeToJsMessageQueue {
.append(pluginResult.getMessage())
.append("')");
break;
case PluginResult.MESSAGE_TYPE_NULL:
sb.append("null");
break;
default:
sb.append(pluginResult.getMessage());
}

View File

@@ -149,21 +149,6 @@ public class SystemWebChromeClient extends WebChromeClient {
quotaUpdater.updateQuota(MAX_QUOTA);
}
// console.log in api level 7: http://developer.android.com/guide/developing/debug-tasks.html
// Expect this to not compile in a future Android release!
@SuppressWarnings("deprecation")
@Override
public void onConsoleMessage(String message, int lineNumber, String sourceID)
{
//This is only for Android 2.1
if(android.os.Build.VERSION.SDK_INT == android.os.Build.VERSION_CODES.ECLAIR_MR1)
{
LOG.d(LOG_TAG, "%s: Line %d : %s", sourceID, lineNumber, message);
super.onConsoleMessage(message, lineNumber, sourceID);
}
}
@TargetApi(8)
@Override
public boolean onConsoleMessage(ConsoleMessage consoleMessage)
{

View File

@@ -112,7 +112,7 @@ public class SystemWebViewClient extends WebViewClient {
* @param request
*/
@Override
@TargetApi(21)
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public void onReceivedClientCertRequest (WebView view, ClientCertRequest request)
{
@@ -219,7 +219,6 @@ public class SystemWebViewClient extends WebViewClient {
* @param handler An SslErrorHandler object that will handle the user's response.
* @param error The SSL error object.
*/
@TargetApi(8)
@Override
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
@@ -316,7 +315,6 @@ public class SystemWebViewClient extends WebViewClient {
this.authenticationTokens.clear();
}
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
@Override
public WebResourceResponse shouldInterceptRequest(WebView view, String url) {
try {
@@ -349,7 +347,7 @@ public class SystemWebViewClient extends WebViewClient {
}
private static boolean needsKitKatContentUrlFix(Uri uri) {
return android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT && "content".equals(uri.getScheme());
return "content".equals(uri.getScheme());
}
private static boolean needsSpecialsInAssetUrlFix(Uri uri) {
@@ -364,11 +362,6 @@ public class SystemWebViewClient extends WebViewClient {
return false;
}
switch(android.os.Build.VERSION.SDK_INT){
case android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH:
case android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1:
return true;
}
return false;
}
}

View File

@@ -121,9 +121,8 @@ public class SystemWebViewEngine implements CordovaWebViewEngine {
SystemWebViewEngine.this.cordova.getActivity().runOnUiThread(r);
}
}));
if(Build.VERSION.SDK_INT > Build.VERSION_CODES.JELLY_BEAN_MR2)
nativeToJsMessageQueue.addBridgeMode(new NativeToJsMessageQueue.EvalBridgeMode(this, cordova));
bridge = new CordovaBridge(pluginManager, nativeToJsMessageQueue);
nativeToJsMessageQueue.addBridgeMode(new NativeToJsMessageQueue.EvalBridgeMode(this, cordova));
bridge = new CordovaBridge(pluginManager, nativeToJsMessageQueue);
exposeJsInterface(webView, bridge);
}
@@ -153,26 +152,8 @@ public class SystemWebViewEngine implements CordovaWebViewEngine {
settings.setJavaScriptCanOpenWindowsAutomatically(true);
settings.setLayoutAlgorithm(LayoutAlgorithm.NORMAL);
// Set the nav dump for HTC 2.x devices (disabling for ICS, deprecated entirely for Jellybean 4.2)
try {
Method gingerbread_getMethod = WebSettings.class.getMethod("setNavDump", new Class[] { boolean.class });
String manufacturer = android.os.Build.MANUFACTURER;
LOG.d(TAG, "CordovaWebView is running on device made by: " + manufacturer);
if(android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.HONEYCOMB &&
android.os.Build.MANUFACTURER.contains("HTC"))
{
gingerbread_getMethod.invoke(settings, true);
}
} catch (NoSuchMethodException e) {
LOG.d(TAG, "We are on a modern version of Android, we will deprecate HTC 2.3 devices in 2.8");
} catch (IllegalArgumentException e) {
LOG.d(TAG, "Doing the NavDump failed with bad arguments");
} catch (IllegalAccessException e) {
LOG.d(TAG, "This should never happen: IllegalAccessException means this isn't Android anymore");
} catch (InvocationTargetException e) {
LOG.d(TAG, "This should never happen: InvocationTargetException means this isn't Android anymore.");
}
String manufacturer = android.os.Build.MANUFACTURER;
LOG.d(TAG, "CordovaWebView is running on device made by: " + manufacturer);
//We don't save any form data in the application
settings.setSaveFormData(false);
@@ -180,12 +161,9 @@ public class SystemWebViewEngine implements CordovaWebViewEngine {
// Jellybean rightfully tried to lock this down. Too bad they didn't give us a whitelist
// while we do this
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN) {
settings.setAllowUniversalAccessFromFileURLs(true);
}
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN_MR1) {
settings.setMediaPlaybackRequiresUserGesture(false);
}
settings.setAllowUniversalAccessFromFileURLs(true);
settings.setMediaPlaybackRequiresUserGesture(false);
// Enable database
// We keep this disabled because we use or shim to get around DOM_EXCEPTION_ERROR_16
String databasePath = webView.getContext().getApplicationContext().getDir("database", Context.MODE_PRIVATE).getPath();
@@ -195,8 +173,7 @@ public class SystemWebViewEngine implements CordovaWebViewEngine {
//Determine whether we're in debug or release mode, and turn on Debugging!
ApplicationInfo appInfo = webView.getContext().getApplicationContext().getApplicationInfo();
if ((appInfo.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0 &&
android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT) {
if ((appInfo.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0) {
enableRemoteDebugging();
}
@@ -244,7 +221,6 @@ public class SystemWebViewEngine implements CordovaWebViewEngine {
// end CB-1405
}
@TargetApi(Build.VERSION_CODES.KITKAT)
private void enableRemoteDebugging() {
try {
WebView.setWebContentsDebuggingEnabled(true);
@@ -254,17 +230,9 @@ public class SystemWebViewEngine implements CordovaWebViewEngine {
}
}
// Yeah, we know, which is why we makes ure that we don't do this if the bridge is
// below JELLYBEAN_MR1. It'd be great if lint was just a little smarter.
// Yeah, we know. It'd be great if lint was just a little smarter.
@SuppressLint("AddJavascriptInterface")
private static void exposeJsInterface(WebView webView, CordovaBridge bridge) {
if ((Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1)) {
LOG.i(TAG, "Disabled addJavascriptInterface() bridge since Android version is old.");
// Bug being that Java Strings do not get converted to JS strings automatically.
// This isn't hard to work-around on the JS side, but it's easier to just
// use the prompt bridge instead.
return;
}
SystemExposedJsApi exposedJsApi = new SystemExposedJsApi(bridge);
webView.addJavascriptInterface(exposedJsApi, "_cordovaNative");
}
@@ -346,12 +314,6 @@ public class SystemWebViewEngine implements CordovaWebViewEngine {
@Override
public void evaluateJavascript(String js, ValueCallback<String> callback) {
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
webView.evaluateJavascript(js, callback);
}
else
{
LOG.d(TAG, "This webview is using the old bridge");
}
webView.evaluateJavascript(js, callback);
}
}

1
node_modules/.bin/nopt generated vendored
View File

@@ -1 +0,0 @@
../nopt/bin/nopt.js

1
node_modules/.bin/semver generated vendored
View File

@@ -1 +0,0 @@
../semver/bin/semver

1
node_modules/.bin/shjs generated vendored
View File

@@ -1 +0,0 @@
../shelljs/bin/shjs

63
node_modules/abbrev/package.json generated vendored
View File

@@ -1,50 +1,27 @@
{
"_args": [
[
{
"raw": "abbrev@1",
"scope": null,
"escapedName": "abbrev",
"name": "abbrev",
"rawSpec": "1",
"spec": ">=1.0.0 <2.0.0",
"type": "range"
},
"/Users/jbowser/cordova/cordova-android/node_modules/nopt"
]
],
"_from": "abbrev@>=1.0.0 <2.0.0",
"_from": "abbrev@1",
"_id": "abbrev@1.1.1",
"_inCache": true,
"_inBundle": false,
"_integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==",
"_location": "/abbrev",
"_nodeVersion": "8.5.0",
"_npmOperationalInternal": {
"host": "s3://npm-registry-packages",
"tmp": "tmp/abbrev-1.1.1.tgz_1506566833068_0.05750026390887797"
},
"_npmUser": {
"name": "isaacs",
"email": "i@izs.me"
},
"_npmVersion": "5.4.2",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "abbrev@1",
"scope": null,
"escapedName": "abbrev",
"name": "abbrev",
"escapedName": "abbrev",
"rawSpec": "1",
"spec": ">=1.0.0 <2.0.0",
"type": "range"
"saveSpec": null,
"fetchSpec": "1"
},
"_requiredBy": [
"/nopt"
],
"_resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
"_shasum": "f8f2c887ad10bf67f634f005b6987fed3179aac8",
"_shrinkwrap": null,
"_spec": "abbrev@1",
"_where": "/Users/jbowser/cordova/cordova-android/node_modules/nopt",
"_where": "/Users/brodybits/Documents/cordova/cordova-android/node_modules/nopt",
"author": {
"name": "Isaac Z. Schlueter",
"email": "i@izs.me"
@@ -52,37 +29,19 @@
"bugs": {
"url": "https://github.com/isaacs/abbrev-js/issues"
},
"dependencies": {},
"bundleDependencies": false,
"deprecated": false,
"description": "Like ruby's abbrev module, but in js",
"devDependencies": {
"tap": "^10.1"
},
"directories": {},
"dist": {
"integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==",
"shasum": "f8f2c887ad10bf67f634f005b6987fed3179aac8",
"tarball": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz"
},
"files": [
"abbrev.js"
],
"gitHead": "a9ee72ebc8fe3975f1b0c7aeb3a8f2a806a432eb",
"homepage": "https://github.com/isaacs/abbrev-js#readme",
"license": "ISC",
"main": "abbrev.js",
"maintainers": [
{
"name": "gabra",
"email": "jerry+1@npmjs.com"
},
{
"name": "isaacs",
"email": "i@izs.me"
}
],
"name": "abbrev",
"optionalDependencies": {},
"readme": "ERROR: No README data found!",
"repository": {
"type": "git",
"url": "git+ssh://git@github.com/isaacs/abbrev-js.git"

View File

@@ -30,41 +30,41 @@
*/
var VERSIONS = {
BASE: { api: 1, ndk: 0, semver: "1.0", name: "(no code name)", versionCode: "BASE" },
BASE_1_1: { api: 2, ndk: 0, semver: "1.1", name: "(no code name)", versionCode: "BASE_1_1" },
CUPCAKE: { api: 3, ndk: 1, semver: "1.5", name: "Cupcake", versionCode: "CUPCAKE" },
DONUT: { api: 4, ndk: 2, semver: "1.6", name: "Donut", versionCode: "DONUT" },
ECLAIR: { api: 5, ndk: 2, semver: "2.0", name: "Eclair", versionCode: "ECLAIR" },
ECLAIR_0_1: { api: 6, ndk: 2, semver: "2.0.1", name: "Eclair", versionCode: "ECLAIR_0_1" },
ECLAIR_MR1: { api: 7, ndk: 3, semver: "2.1", name: "Eclair", versionCode: "ECLAIR_MR1" },
FROYO: { api: 8, ndk: 4, semver: "2.2", name: "Froyo", versionCode: "FROYO" },
GINGERBREAD: { api: 9, ndk: 5, semver: "2.3", name: "Gingerbread", versionCode: "GINGERBREAD" },
GINGERBREAD_MR1: { api: 10, ndk: 5, semver: "2.3.3", name: "Gingerbread", versionCode: "GINGERBREAD_MR1" },
HONEYCOMB: { api: 11, ndk: 5, semver: "3.0", name: "Honeycomb", versionCode: "HONEYCOMB" },
HONEYCOMB_MR1: { api: 12, ndk: 6, semver: "3.1", name: "Honeycomb", versionCode: "HONEYCOMB_MR1" },
HONEYCOMB_MR2: { api: 13, ndk: 6, semver: "3.2", name: "Honeycomb", versionCode: "HONEYCOMB_MR2" },
ICE_CREAM_SANDWICH: { api: 14, ndk: 7, semver: "4.0", name: "Ice Cream Sandwich", versionCode: "ICE_CREAM_SANDWICH" },
ICE_CREAM_SANDWICH_MR1: { api: 15, ndk: 8, semver: "4.0.3", name: "Ice Cream Sandwich", versionCode: "ICE_CREAM_SANDWICH_MR1" },
JELLY_BEAN: { api: 16, ndk: 8, semver: "4.1", name: "Jellybean", versionCode: "JELLY_BEAN" },
JELLY_BEAN_MR1: { api: 17, ndk: 8, semver: "4.2", name: "Jellybean", versionCode: "JELLY_BEAN_MR1" },
JELLY_BEAN_MR2: { api: 18, ndk: 8, semver: "4.3", name: "Jellybean", versionCode: "JELLY_BEAN_MR2" },
KITKAT: { api: 19, ndk: 8, semver: "4.4", name: "KitKat", versionCode: "KITKAT" },
KITKAT_WATCH: { api: 20, ndk: 8, semver: "4.4", name: "KitKat Watch", versionCode: "KITKAT_WATCH" },
LOLLIPOP: { api: 21, ndk: 8, semver: "5.0", name: "Lollipop", versionCode: "LOLLIPOP" },
LOLLIPOP_MR1: { api: 22, ndk: 8, semver: "5.1", name: "Lollipop", versionCode: "LOLLIPOP_MR1" },
M: { api: 23, ndk: 8, semver: "6.0", name: "Marshmallow", versionCode: "M" },
N: { api: 24, ndk: 8, semver: "7.0", name: "Nougat", versionCode: "N" },
N_MR1: { api: 25, ndk: 8, semver: "7.1", name: "Nougat", versionCode: "N_MR1" },
O: { api: 26, ndk: 8, semver: "8.0.0", name: "Oreo", versionCode: "O" }
BASE: { api: 1, ndk: 0, semver: "1.0", name: "(no code name)", versionCode: "BASE" },
BASE_1_1: { api: 2, ndk: 0, semver: "1.1", name: "(no code name)", versionCode: "BASE_1_1" },
CUPCAKE: { api: 3, ndk: 1, semver: "1.5", name: "Cupcake", versionCode: "CUPCAKE" },
DONUT: { api: 4, ndk: 2, semver: "1.6", name: "Donut", versionCode: "DONUT" },
ECLAIR: { api: 5, ndk: 2, semver: "2.0", name: "Eclair", versionCode: "ECLAIR" },
ECLAIR_0_1: { api: 6, ndk: 2, semver: "2.0.1", name: "Eclair", versionCode: "ECLAIR_0_1" },
ECLAIR_MR1: { api: 7, ndk: 3, semver: "2.1", name: "Eclair", versionCode: "ECLAIR_MR1" },
FROYO: { api: 8, ndk: 4, semver: "2.2.x", name: "Froyo", versionCode: "FROYO" },
GINGERBREAD: { api: 9, ndk: 5, semver: "2.3.0 - 2.3.2", name: "Gingerbread", versionCode: "GINGERBREAD" },
GINGERBREAD_MR1: { api: 10, ndk: 5, semver: "2.3.3 - 2.3.7", name: "Gingerbread", versionCode: "GINGERBREAD_MR1" },
HONEYCOMB: { api: 11, ndk: 5, semver: "3.0", name: "Honeycomb", versionCode: "HONEYCOMB" },
HONEYCOMB_MR1: { api: 12, ndk: 6, semver: "3.1", name: "Honeycomb", versionCode: "HONEYCOMB_MR1" },
HONEYCOMB_MR2: { api: 13, ndk: 6, semver: "3.2.x", name: "Honeycomb", versionCode: "HONEYCOMB_MR2" },
ICE_CREAM_SANDWICH: { api: 14, ndk: 7, semver: "4.0.1 - 4.0.2", name: "Ice Cream Sandwich", versionCode: "ICE_CREAM_SANDWICH" },
ICE_CREAM_SANDWICH_MR1: { api: 15, ndk: 8, semver: "4.0.3 - 4.0.4", name: "Ice Cream Sandwich", versionCode: "ICE_CREAM_SANDWICH_MR1" },
JELLY_BEAN: { api: 16, ndk: 8, semver: "4.1.x", name: "Jellybean", versionCode: "JELLY_BEAN" },
JELLY_BEAN_MR1: { api: 17, ndk: 8, semver: "4.2.x", name: "Jellybean", versionCode: "JELLY_BEAN_MR1" },
JELLY_BEAN_MR2: { api: 18, ndk: 8, semver: "4.3.x", name: "Jellybean", versionCode: "JELLY_BEAN_MR2" },
KITKAT: { api: 19, ndk: 8, semver: "4.4.0 - 4.4.4", name: "KitKat", versionCode: "KITKAT" },
KITKAT_WATCH: { api: 20, ndk: 8, semver: "4.4", name: "KitKat Watch", versionCode: "KITKAT_WATCH" },
LOLLIPOP: { api: 21, ndk: 8, semver: "5.0", name: "Lollipop", versionCode: "LOLLIPOP" },
LOLLIPOP_MR1: { api: 22, ndk: 8, semver: "5.1", name: "Lollipop", versionCode: "LOLLIPOP_MR1" },
M: { api: 23, ndk: 8, semver: "6.0", name: "Marshmallow", versionCode: "M" },
N: { api: 24, ndk: 8, semver: "7.0", name: "Nougat", versionCode: "N" },
N_MR1: { api: 25, ndk: 8, semver: "7.1", name: "Nougat", versionCode: "N_MR1" },
O: { api: 26, ndk: 8, semver: "8.0.0", name: "Oreo", versionCode: "O" },
O_MR1: { api: 27, ndk: 8, semver: "8.1.0", name: "Oreo", versionCode: "O_MR1" }
}
// This altSemVer accomodates the variations of semantic versions in the table above.
// For instance, Oreo is 8.0.0 while N is 7.0, searching for "8.0" or "8.0.0" will
// return Oreo, or searching for "7.0" or "7.0.0" will return N. "2.2.0" will return Froyo.
function getAlternateSemVer(semver) {
if (semver.match(/\d+.\d+.0/)) {
return semver.replace(/.\d+$/, '')
} else if (semver.match(/^\d+.\d+$/)) {
var semver = require('semver');
// semver format requires <major>.<minor>.<patch> but we allow just <major>.<minor> format.
// Coerce <major>.<minor> to <major>.<minor>.0
function formatSemver(semver) {
if (semver.match(/^\d+.\d+$/)) {
return semver + '.0'
} else {
return semver
@@ -82,9 +82,10 @@ function getFromDefaultPredicate(arg) {
return true
}
// Compare semver and alternate semver (see above).
var altSemVer = getAlternateSemVer(arg)
if (version.semver === arg || version.semver === altSemVer) {
let argSemver = formatSemver(arg);
let versionSemver = formatSemver(version.semver);
if (semver.valid(argSemver) && semver.satisfies(argSemver, versionSemver)) {
return true
}

View File

@@ -1,70 +1,43 @@
{
"_args": [
[
{
"raw": "android-versions@^1.2.1",
"scope": null,
"escapedName": "android-versions",
"name": "android-versions",
"rawSpec": "^1.2.1",
"spec": ">=1.2.1 <2.0.0",
"type": "range"
},
"/Users/jbowser/cordova/cordova-android"
]
],
"_from": "android-versions@>=1.2.1 <2.0.0",
"_id": "android-versions@1.2.1",
"_inCache": true,
"_from": "android-versions@1.3.0",
"_id": "android-versions@1.3.0",
"_inBundle": false,
"_integrity": "sha512-d/i1G16Oaw/T1EvskUA7Oo1vIQVK/0ZlpQgZfYVBwg6v/9FBE3QV66g5N1/bTHpRml8tFLxh+KoTw5DokK9c+A==",
"_location": "/android-versions",
"_nodeVersion": "8.0.0",
"_npmOperationalInternal": {
"host": "s3://npm-registry-packages",
"tmp": "tmp/android-versions-1.2.1.tgz_1505373302036_0.5689644906669855"
},
"_npmUser": {
"name": "dvoiss",
"email": "davidvoiss@gmail.com"
},
"_npmVersion": "5.4.0",
"_phantomChildren": {},
"_requested": {
"raw": "android-versions@^1.2.1",
"scope": null,
"escapedName": "android-versions",
"type": "version",
"registry": true,
"raw": "android-versions@1.3.0",
"name": "android-versions",
"rawSpec": "^1.2.1",
"spec": ">=1.2.1 <2.0.0",
"type": "range"
"escapedName": "android-versions",
"rawSpec": "1.3.0",
"saveSpec": null,
"fetchSpec": "1.3.0"
},
"_requiredBy": [
"/"
],
"_resolved": "https://registry.npmjs.org/android-versions/-/android-versions-1.2.1.tgz",
"_shasum": "3f50baf693e73a512c3c5403542291cead900063",
"_shrinkwrap": null,
"_spec": "android-versions@^1.2.1",
"_where": "/Users/jbowser/cordova/cordova-android",
"_resolved": "https://registry.npmjs.org/android-versions/-/android-versions-1.3.0.tgz",
"_shasum": "ce6f3eae2e165ce4ed49b89beb68014741093044",
"_spec": "android-versions@1.3.0",
"_where": "/Users/brodybits/Documents/cordova/cordova-android",
"author": {
"name": "dvoiss"
},
"bugs": {
"url": "https://github.com/dvoiss/android-versions/issues"
},
"dependencies": {},
"bundleDependencies": false,
"dependencies": {
"semver": "^5.4.1"
},
"deprecated": false,
"description": "Get the name, API level, version level, NDK level, or version code from any version of Android.",
"devDependencies": {
"jsdoc": "^3.4.0",
"jshint": "^2.9.2",
"tape": "^4.6.0"
},
"directories": {},
"dist": {
"integrity": "sha512-k6zlrtWbJ3tx1ZsyyJ0Bo3r6cqPA3JUnFGv7pnIaLr1XVxSi2Tcem2lg3kBebFp27v/A40tZqdlouPyakpyKrw==",
"shasum": "3f50baf693e73a512c3c5403542291cead900063",
"tarball": "https://registry.npmjs.org/android-versions/-/android-versions-1.2.1.tgz"
},
"gitHead": "7e2def6e70634a4ebcaaa639a4c4955ae2a566e7",
"homepage": "https://github.com/dvoiss/android-versions#readme",
"keywords": [
"android",
@@ -78,26 +51,17 @@
],
"license": "MIT",
"main": "index.js",
"maintainers": [
{
"name": "dvoiss",
"email": "davidvoiss@gmail.com"
}
],
"name": "android-versions",
"optionalDependencies": {},
"pre-commit": [
"jshint"
],
"readme": "ERROR: No README data found!",
"repository": {
"type": "git",
"url": "git+https://github.com/dvoiss/android-versions.git"
},
"scripts": {
"docs": "jsdoc index.js -d ./docs/ -R README.md --debug",
"jshint": "jshint .",
"test": "tape tests/**/*.js"
},
"version": "1.2.1"
"version": "1.3.0"
}

118
node_modules/android-versions/tests/index.test.js generated vendored Normal file
View File

@@ -0,0 +1,118 @@
"use strict";
var test = require('tape')
var android = require('..')
test('get specific version by API level', (t) => {
t.plan(1)
t.equal(android.get(24).name, "Nougat")
})
test('getAll versions by API level', (t) => {
t.plan(1)
t.equal(android.getAll(24)[0].name, "Nougat")
})
test('get specific version by predicate', (t) => {
t.plan(2)
var actual = android.get((version) => {
return version.name.indexOf("on") !== -1
})
t.equal(actual.name, "Donut")
actual = android.get((version) => {
return version.ndk > 5 && version.api < 15
})
t.equal(actual.versionCode, "HONEYCOMB_MR1")
})
test('getAll versions by predicate', (t) => {
t.plan(3)
var actual = android.getAll((version) => {
return version.name.indexOf("on") !== -1
}).map((version) => version.name)
t.deepEqual(actual, ["Donut", "Honeycomb", "Honeycomb", "Honeycomb"])
actual = android.getAll((version) => {
return version.ndk > 5 && version.api < 15
}).map((version) => version.versionCode)
t.deepEqual(actual, ["HONEYCOMB_MR1", "HONEYCOMB_MR2", "ICE_CREAM_SANDWICH"])
actual = android.getAll((version) => {
return version.api > 22
}).map((version) => version.versionCode)
t.deepEqual(actual, ["M", "N", "N_MR1", "O", "O_MR1"])
})
test('get version by semantic version', (t) => {
t.plan(4)
t.equal(android.get("6.0").versionCode, android.M.versionCode)
t.equal(android.get("6.0.0").versionCode, android.M.versionCode)
t.equal(android.get("2.3").versionCode, android.GINGERBREAD.versionCode)
t.equal(android.get("2.3.3").versionCode, android.GINGERBREAD_MR1.versionCode)
})
test('support version ranges', (t) => {
t.plan(7);
t.equal(android.get("4.4").versionCode, android.KITKAT.versionCode);
t.equal(android.get("4.4.0").versionCode, android.KITKAT.versionCode);
t.equal(android.get("4.4.1").versionCode, android.KITKAT.versionCode);
t.equal(android.get("4.4.2").versionCode, android.KITKAT.versionCode);
t.equal(android.get("4.4.3").versionCode, android.KITKAT.versionCode);
t.equal(android.get("4.4.4").versionCode, android.KITKAT.versionCode);
t.equal(android.get("4.4.5"), null);
})
test('support x-ranges', (t) => {
t.plan(12);
t.equal(android.get("4.1").versionCode, android.JELLY_BEAN.versionCode);
t.equal(android.get("4.1.0").versionCode, android.JELLY_BEAN.versionCode);
t.equal(android.get("4.1.1").versionCode, android.JELLY_BEAN.versionCode);
t.equal(android.get("4.1.2").versionCode, android.JELLY_BEAN.versionCode);
t.equal(android.get("4.1.3").versionCode, android.JELLY_BEAN.versionCode);
t.equal(android.get("4.1.4").versionCode, android.JELLY_BEAN.versionCode);
t.equal(android.get("4.1.5").versionCode, android.JELLY_BEAN.versionCode);
t.equal(android.get("4.1.6").versionCode, android.JELLY_BEAN.versionCode);
t.equal(android.get("4.1.7").versionCode, android.JELLY_BEAN.versionCode);
t.equal(android.get("4.1.8").versionCode, android.JELLY_BEAN.versionCode);
t.equal(android.get("4.1.9").versionCode, android.JELLY_BEAN.versionCode);
t.equal(android.get("4.1.10").versionCode, android.JELLY_BEAN.versionCode);
});
test('access version codes object', (t) => {
t.plan(1)
t.ok(android.VERSIONS)
})
test('access specific versions directly', (t) => {
t.plan(27)
t.ok(android.BASE)
t.ok(android.BASE_1_1)
t.ok(android.CUPCAKE)
t.ok(android.DONUT)
t.ok(android.ECLAIR)
t.ok(android.ECLAIR_0_1)
t.ok(android.ECLAIR_MR1)
t.ok(android.FROYO)
t.ok(android.GINGERBREAD)
t.ok(android.GINGERBREAD_MR1)
t.ok(android.HONEYCOMB)
t.ok(android.HONEYCOMB_MR1)
t.ok(android.HONEYCOMB_MR2)
t.ok(android.ICE_CREAM_SANDWICH)
t.ok(android.ICE_CREAM_SANDWICH_MR1)
t.ok(android.JELLY_BEAN)
t.ok(android.JELLY_BEAN_MR1)
t.ok(android.JELLY_BEAN_MR2)
t.ok(android.KITKAT)
t.ok(android.KITKAT_WATCH)
t.ok(android.LOLLIPOP)
t.ok(android.LOLLIPOP_MR1)
t.ok(android.M)
t.ok(android.N)
t.ok(android.N_MR1)
t.ok(android.O)
t.ok(android.O_MR1)
})

60
node_modules/ansi/package.json generated vendored
View File

@@ -1,46 +1,27 @@
{
"_args": [
[
{
"raw": "ansi@^0.3.1",
"scope": null,
"escapedName": "ansi",
"name": "ansi",
"rawSpec": "^0.3.1",
"spec": ">=0.3.1 <0.4.0",
"type": "range"
},
"/Users/jbowser/cordova/cordova-android/node_modules/cordova-common"
]
],
"_from": "ansi@>=0.3.1 <0.4.0",
"_from": "ansi@^0.3.1",
"_id": "ansi@0.3.1",
"_inCache": true,
"_inBundle": false,
"_integrity": "sha1-DELU+xcWDVqa8eSEus4cZpIsGyE=",
"_location": "/ansi",
"_nodeVersion": "5.3.0",
"_npmUser": {
"name": "tootallnate",
"email": "nathan@tootallnate.net"
},
"_npmVersion": "3.3.12",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "ansi@^0.3.1",
"scope": null,
"escapedName": "ansi",
"name": "ansi",
"escapedName": "ansi",
"rawSpec": "^0.3.1",
"spec": ">=0.3.1 <0.4.0",
"type": "range"
"saveSpec": null,
"fetchSpec": "^0.3.1"
},
"_requiredBy": [
"/cordova-common"
],
"_resolved": "https://registry.npmjs.org/ansi/-/ansi-0.3.1.tgz",
"_shasum": "0c42d4fb17160d5a9af1e484bace1c66922c1b21",
"_shrinkwrap": null,
"_spec": "ansi@^0.3.1",
"_where": "/Users/jbowser/cordova/cordova-android/node_modules/cordova-common",
"_where": "/Users/brodybits/Documents/cordova/cordova-android/node_modules/cordova-common",
"author": {
"name": "Nathan Rajlich",
"email": "nathan@tootallnate.net",
@@ -49,15 +30,9 @@
"bugs": {
"url": "https://github.com/TooTallNate/ansi.js/issues"
},
"dependencies": {},
"bundleDependencies": false,
"deprecated": false,
"description": "Advanced ANSI formatting tool for Node.js",
"devDependencies": {},
"directories": {},
"dist": {
"shasum": "0c42d4fb17160d5a9af1e484bace1c66922c1b21",
"tarball": "https://registry.npmjs.org/ansi/-/ansi-0.3.1.tgz"
},
"gitHead": "4d0d4af94e0bdaa648bd7262acd3bde4b98d5246",
"homepage": "https://github.com/TooTallNate/ansi.js#readme",
"keywords": [
"ansi",
@@ -71,23 +46,10 @@
],
"license": "MIT",
"main": "./lib/ansi.js",
"maintainers": [
{
"name": "TooTallNate",
"email": "nathan@tootallnate.net"
},
{
"name": "tootallnate",
"email": "nathan@tootallnate.net"
}
],
"name": "ansi",
"optionalDependencies": {},
"readme": "ERROR: No README data found!",
"repository": {
"type": "git",
"url": "git://github.com/TooTallNate/ansi.js.git"
},
"scripts": {},
"version": "0.3.1"
}

View File

@@ -1,50 +1,27 @@
{
"_args": [
[
{
"raw": "balanced-match@^1.0.0",
"scope": null,
"escapedName": "balanced-match",
"name": "balanced-match",
"rawSpec": "^1.0.0",
"spec": ">=1.0.0 <2.0.0",
"type": "range"
},
"/Users/jbowser/cordova/cordova-android/node_modules/brace-expansion"
]
],
"_from": "balanced-match@>=1.0.0 <2.0.0",
"_from": "balanced-match@^1.0.0",
"_id": "balanced-match@1.0.0",
"_inCache": true,
"_inBundle": false,
"_integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
"_location": "/balanced-match",
"_nodeVersion": "7.8.0",
"_npmOperationalInternal": {
"host": "s3://npm-registry-packages",
"tmp": "tmp/balanced-match-1.0.0.tgz_1497251909645_0.8755026108119637"
},
"_npmUser": {
"name": "juliangruber",
"email": "julian@juliangruber.com"
},
"_npmVersion": "4.2.0",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "balanced-match@^1.0.0",
"scope": null,
"escapedName": "balanced-match",
"name": "balanced-match",
"escapedName": "balanced-match",
"rawSpec": "^1.0.0",
"spec": ">=1.0.0 <2.0.0",
"type": "range"
"saveSpec": null,
"fetchSpec": "^1.0.0"
},
"_requiredBy": [
"/brace-expansion"
],
"_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
"_shasum": "89b4d199ab2bee49de164ea02b89ce462d71b767",
"_shrinkwrap": null,
"_spec": "balanced-match@^1.0.0",
"_where": "/Users/jbowser/cordova/cordova-android/node_modules/brace-expansion",
"_where": "/Users/brodybits/Documents/cordova/cordova-android/node_modules/brace-expansion",
"author": {
"name": "Julian Gruber",
"email": "mail@juliangruber.com",
@@ -53,18 +30,14 @@
"bugs": {
"url": "https://github.com/juliangruber/balanced-match/issues"
},
"bundleDependencies": false,
"dependencies": {},
"deprecated": false,
"description": "Match balanced character pairs, like \"{\" and \"}\"",
"devDependencies": {
"matcha": "^0.7.0",
"tape": "^4.6.0"
},
"directories": {},
"dist": {
"shasum": "89b4d199ab2bee49de164ea02b89ce462d71b767",
"tarball": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz"
},
"gitHead": "d701a549a7653a874eebce7eca25d3577dc868ac",
"homepage": "https://github.com/juliangruber/balanced-match",
"keywords": [
"match",
@@ -75,15 +48,7 @@
],
"license": "MIT",
"main": "index.js",
"maintainers": [
{
"name": "juliangruber",
"email": "julian@juliangruber.com"
}
],
"name": "balanced-match",
"optionalDependencies": {},
"readme": "ERROR: No README data found!",
"repository": {
"type": "git",
"url": "git://github.com/juliangruber/balanced-match.git"

5
node_modules/base64-js/.travis.yml generated vendored
View File

@@ -1,5 +0,0 @@
language: node_js
node_js:
- "0.8"
- "0.10"
- "0.11"

5
node_modules/base64-js/README.md generated vendored
View File

@@ -21,11 +21,12 @@ With [npm](https://npmjs.org) do:
`var base64 = require('base64-js')`
`base64` has two exposed functions, `toByteArray` and `fromByteArray`, which both take a single argument.
`base64` has three exposed functions, `byteLength`, `toByteArray` and `fromByteArray`, which both take a single argument.
* `byteLength` - Takes a base64 string and returns length of byte array
* `toByteArray` - Takes a base64 string and returns a byte array
* `fromByteArray` - Takes a byte array and returns a base64 string
## license
MIT
MIT

1
node_modules/base64-js/base64js.min.js generated vendored Normal file
View File

@@ -0,0 +1 @@
(function(r){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=r()}else if(typeof define==="function"&&define.amd){define([],r)}else{var e;if(typeof window!=="undefined"){e=window}else if(typeof global!=="undefined"){e=global}else if(typeof self!=="undefined"){e=self}else{e=this}e.base64js=r()}})(function(){var r,e,t;return function r(e,t,n){function o(i,a){if(!t[i]){if(!e[i]){var u=typeof require=="function"&&require;if(!a&&u)return u(i,!0);if(f)return f(i,!0);var d=new Error("Cannot find module '"+i+"'");throw d.code="MODULE_NOT_FOUND",d}var c=t[i]={exports:{}};e[i][0].call(c.exports,function(r){var t=e[i][1][r];return o(t?t:r)},c,c.exports,r,e,t,n)}return t[i].exports}var f=typeof require=="function"&&require;for(var i=0;i<n.length;i++)o(n[i]);return o}({"/":[function(r,e,t){"use strict";t.byteLength=c;t.toByteArray=v;t.fromByteArray=s;var n=[];var o=[];var f=typeof Uint8Array!=="undefined"?Uint8Array:Array;var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var a=0,u=i.length;a<u;++a){n[a]=i[a];o[i.charCodeAt(a)]=a}o["-".charCodeAt(0)]=62;o["_".charCodeAt(0)]=63;function d(r){var e=r.length;if(e%4>0){throw new Error("Invalid string. Length must be a multiple of 4")}return r[e-2]==="="?2:r[e-1]==="="?1:0}function c(r){return r.length*3/4-d(r)}function v(r){var e,t,n,i,a,u;var c=r.length;a=d(r);u=new f(c*3/4-a);n=a>0?c-4:c;var v=0;for(e=0,t=0;e<n;e+=4,t+=3){i=o[r.charCodeAt(e)]<<18|o[r.charCodeAt(e+1)]<<12|o[r.charCodeAt(e+2)]<<6|o[r.charCodeAt(e+3)];u[v++]=i>>16&255;u[v++]=i>>8&255;u[v++]=i&255}if(a===2){i=o[r.charCodeAt(e)]<<2|o[r.charCodeAt(e+1)]>>4;u[v++]=i&255}else if(a===1){i=o[r.charCodeAt(e)]<<10|o[r.charCodeAt(e+1)]<<4|o[r.charCodeAt(e+2)]>>2;u[v++]=i>>8&255;u[v++]=i&255}return u}function l(r){return n[r>>18&63]+n[r>>12&63]+n[r>>6&63]+n[r&63]}function h(r,e,t){var n;var o=[];for(var f=e;f<t;f+=3){n=(r[f]<<16)+(r[f+1]<<8)+r[f+2];o.push(l(n))}return o.join("")}function s(r){var e;var t=r.length;var o=t%3;var f="";var i=[];var a=16383;for(var u=0,d=t-o;u<d;u+=a){i.push(h(r,u,u+a>d?d:u+a))}if(o===1){e=r[t-1];f+=n[e>>2];f+=n[e<<4&63];f+="=="}else if(o===2){e=(r[t-2]<<8)+r[t-1];f+=n[e>>10];f+=n[e>>4&63];f+=n[e<<2&63];f+="="}i.push(f);return i.join("")}},{}]},{},[])("/")});

View File

@@ -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)

114
node_modules/base64-js/index.js generated vendored Normal file
View File

@@ -0,0 +1,114 @@
'use strict'
exports.byteLength = byteLength
exports.toByteArray = toByteArray
exports.fromByteArray = fromByteArray
var lookup = []
var revLookup = []
var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
for (var i = 0, len = code.length; i < len; ++i) {
lookup[i] = code[i]
revLookup[code.charCodeAt(i)] = i
}
revLookup['-'.charCodeAt(0)] = 62
revLookup['_'.charCodeAt(0)] = 63
function placeHoldersCount (b64) {
var len = b64.length
if (len % 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
return b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0
}
function byteLength (b64) {
// base64 is 4/3 + up to two characters of the original data
return b64.length * 3 / 4 - placeHoldersCount(b64)
}
function toByteArray (b64) {
var i, j, l, tmp, placeHolders, arr
var len = b64.length
placeHolders = placeHoldersCount(b64)
arr = new Arr(len * 3 / 4 - placeHolders)
// if there are placeholders, only get up to the last complete 4 chars
l = placeHolders > 0 ? len - 4 : len
var L = 0
for (i = 0, j = 0; i < l; i += 4, j += 3) {
tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)]
arr[L++] = (tmp >> 16) & 0xFF
arr[L++] = (tmp >> 8) & 0xFF
arr[L++] = tmp & 0xFF
}
if (placeHolders === 2) {
tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4)
arr[L++] = tmp & 0xFF
} else if (placeHolders === 1) {
tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2)
arr[L++] = (tmp >> 8) & 0xFF
arr[L++] = tmp & 0xFF
}
return arr
}
function tripletToBase64 (num) {
return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]
}
function encodeChunk (uint8, start, end) {
var tmp
var output = []
for (var i = start; i < end; i += 3) {
tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2])
output.push(tripletToBase64(tmp))
}
return output.join('')
}
function fromByteArray (uint8) {
var tmp
var len = uint8.length
var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
var output = ''
var parts = []
var maxChunkLength = 16383 // must be multiple of 3
// go through the array every three bytes, we'll deal with trailing stuff later
for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))
}
// pad the end with zeros, but make sure to not forget the extra bytes
if (extraBytes === 1) {
tmp = uint8[len - 1]
output += lookup[tmp >> 2]
output += lookup[(tmp << 4) & 0x3F]
output += '=='
} else if (extraBytes === 2) {
tmp = (uint8[len - 2] << 8) + (uint8[len - 1])
output += lookup[tmp >> 10]
output += lookup[(tmp >> 4) & 0x3F]
output += lookup[(tmp << 2) & 0x3F]
output += '='
}
parts.push(output)
return parts.join('')
}

124
node_modules/base64-js/lib/b64.js generated vendored
View File

@@ -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))

110
node_modules/base64-js/package.json generated vendored
View File

@@ -1,46 +1,27 @@
{
"_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/jbowser/cordova/cordova-android/node_modules/plist"
]
],
"_from": "base64-js@0.0.8",
"_id": "base64-js@0.0.8",
"_inCache": true,
"_from": "base64-js@1.2.0",
"_id": "base64-js@1.2.0",
"_inBundle": false,
"_integrity": "sha1-o5mS1yNYSBGYK+XikLtqU9hnAPE=",
"_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",
"type": "version",
"registry": true,
"raw": "base64-js@1.2.0",
"name": "base64-js",
"rawSpec": "0.0.8",
"spec": "0.0.8",
"type": "version"
"escapedName": "base64-js",
"rawSpec": "1.2.0",
"saveSpec": null,
"fetchSpec": "1.2.0"
},
"_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/jbowser/cordova/cordova-android/node_modules/plist",
"_resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.2.0.tgz",
"_shasum": "a39992d723584811982be5e290bb6a53d86700f1",
"_spec": "base64-js@1.2.0",
"_where": "/Users/brodybits/Documents/cordova/cordova-android/node_modules/plist",
"author": {
"name": "T. Jameson Little",
"email": "t.jameson.little@gmail.com"
@@ -48,54 +29,37 @@
"bugs": {
"url": "https://github.com/beatgammit/base64-js/issues"
},
"dependencies": {},
"bundleDependencies": false,
"deprecated": false,
"description": "Base64 encoding/decoding in pure JS",
"devDependencies": {
"tape": "~2.3.2"
"benchmark": "^2.1.0",
"browserify": "^13.0.0",
"standard": "*",
"tape": "4.x",
"uglify-js": "^2.6.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"
}
"files": [
"test",
"index.js",
"base64js.min.js"
],
"homepage": "https://github.com/beatgammit/base64-js",
"keywords": [
"base64"
],
"license": "MIT",
"main": "index.js",
"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"
"build": "browserify -s base64js -r ./ | uglifyjs -m > base64js.min.js",
"lint": "standard",
"test": "npm run lint && npm run unit",
"unit": "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"
"version": "1.2.0"
}

24
node_modules/base64-js/test/big-data.js generated vendored Normal file
View File

@@ -0,0 +1,24 @@
var test = require('tape')
var b64 = require('../')
test('convert big data to base64', function (t) {
var b64str, arr, i, length
var big = new Uint8Array(64 * 1024 * 1024)
for (i = 0, length = big.length; i < length; ++i) {
big[i] = i % 256
}
b64str = b64.fromByteArray(big)
arr = b64.toByteArray(b64str)
t.ok(equal(arr, big))
t.end()
})
function equal (a, b) {
var i
var length = a.length
if (length !== b.length) return false
for (i = 0; i < length; ++i) {
if (a[i] !== b[i]) return false
}
return true
}

View File

@@ -1,51 +1,48 @@
var test = require('tape'),
b64 = require('../lib/b64'),
checks = [
'a',
'aa',
'aaa',
'hi',
'hi!',
'hi!!',
'sup',
'sup?',
'sup?!'
];
var test = require('tape')
var b64 = require('../')
var checks = [
'a',
'aa',
'aaa',
'hi',
'hi!',
'hi!!',
'sup',
'sup?',
'sup?!'
]
test('convert to base64 and back', function (t) {
t.plan(checks.length);
t.plan(checks.length * 2)
for (var i = 0; i < checks.length; i++) {
var check = checks[i],
b64Str,
arr,
str;
var check = checks[i]
var b64Str, arr, str
b64Str = b64.fromByteArray(map(check, function (char) { return char.charCodeAt(0); }));
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('');
arr = b64.toByteArray(b64Str)
str = map(arr, function (byte) { return String.fromCharCode(byte) }).join('')
t.equal(check, str, 'Checked ' + check);
t.equal(check, str, 'Checked ' + check)
t.equal(b64.byteLength(b64Str), arr.length, 'Checked length for ' + check)
}
});
})
function map (arr, callback) {
var res = [],
kValue,
mappedValue;
var res = []
var 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;
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
}

View File

@@ -1,18 +1,18 @@
var test = require('tape'),
b64 = require('../lib/b64');
var test = require('tape')
var b64 = require('../')
test('decode url-safe style base64 strings', function (t) {
var expected = [0xff, 0xff, 0xbe, 0xff, 0xef, 0xbf, 0xfb, 0xef, 0xff];
var expected = [0xff, 0xff, 0xbe, 0xff, 0xef, 0xbf, 0xfb, 0xef, 0xff]
var actual = b64.toByteArray('//++/++/++//');
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++) {
actual = b64.toByteArray('__--_--_--__')
for (i = 0; i < actual.length; i++) {
t.equal(actual[i], expected[i])
}
t.end();
});
t.end()
})

View File

@@ -100,6 +100,11 @@ declare namespace bigInt {
*/
and(number: BigNumber): BigInteger;
/**
* Returns the number of digits required to represent a bigInt in binary.
*/
bitLength(): BigInteger;
/**
* Performs a comparison between two numbers. If the numbers are equal, it returns 0.
* If the first number is greater, it returns 1. If the first number is lesser, it returns -1.
@@ -337,6 +342,12 @@ declare namespace bigInt {
*/
times(number: BigNumber): BigInteger;
/**
*
* Converts a bigInt to an object representing it as an array of integers module the given radix.
*/
toArray(radix: number): BaseArray;
/**
* Converts a bigInt into a native Javascript number. Loses precision for numbers outside the range.
*/
@@ -2366,4 +2377,9 @@ declare namespace bigInt {
'998': BigInteger;
'999': BigInteger;
}
interface BaseArray {
value: number[],
isNegative: boolean
}
}

View File

@@ -179,7 +179,7 @@ var bigInt = (function (undefined) {
function subtractAny(a, b, sign) {
var value;
if (compareAbs(a, b) >= 0) {
value = subtract(a,b);
value = subtract(a, b);
} else {
value = subtract(b, a);
sign = !sign;
@@ -354,16 +354,16 @@ var bigInt = (function (undefined) {
return new BigInteger(multiplyLong(b, smallToArray(a)), sign);
}
SmallInteger.prototype._multiplyBySmall = function (a) {
if (isPrecise(a.value * this.value)) {
return new SmallInteger(a.value * this.value);
}
return multiplySmallAndArray(Math.abs(a.value), smallToArray(Math.abs(this.value)), this.sign !== a.sign);
if (isPrecise(a.value * this.value)) {
return new SmallInteger(a.value * this.value);
}
return multiplySmallAndArray(Math.abs(a.value), smallToArray(Math.abs(this.value)), this.sign !== a.sign);
};
BigInteger.prototype._multiplyBySmall = function (a) {
if (a.value === 0) return Integer[0];
if (a.value === 1) return this;
if (a.value === -1) return this.negate();
return multiplySmallAndArray(Math.abs(a.value), this.value, this.sign !== a.sign);
if (a.value === 0) return Integer[0];
if (a.value === 1) return this;
if (a.value === -1) return this.negate();
return multiplySmallAndArray(Math.abs(a.value), this.value, this.sign !== a.sign);
};
SmallInteger.prototype.multiply = function (v) {
return parseValue(v)._multiplyBySmall(this);
@@ -371,19 +371,21 @@ var bigInt = (function (undefined) {
SmallInteger.prototype.times = SmallInteger.prototype.multiply;
function square(a) {
//console.assert(2 * BASE * BASE < MAX_INT);
var l = a.length,
r = createArray(l + l),
base = BASE,
product, carry, i, a_i, a_j;
for (i = 0; i < l; i++) {
a_i = a[i];
for (var j = 0; j < l; j++) {
carry = 0 - a_i * a_i;
for (var j = i; j < l; j++) {
a_j = a[j];
product = a_i * a_j + r[i + j];
product = 2 * (a_i * a_j) + r[i + j] + carry;
carry = Math.floor(product / base);
r[i + j] = product - carry * base;
r[i + j + 1] += carry;
}
r[i + l] = carry;
}
trim(r);
return r;
@@ -416,7 +418,7 @@ var bigInt = (function (undefined) {
for (shift = a_l - b_l; shift >= 0; shift--) {
quotientDigit = base - 1;
if (remainder[shift + b_l] !== divisorMostSignificantDigit) {
quotientDigit = Math.floor((remainder[shift + b_l] * base + remainder[shift + b_l - 1]) / divisorMostSignificantDigit);
quotientDigit = Math.floor((remainder[shift + b_l] * base + remainder[shift + b_l - 1]) / divisorMostSignificantDigit);
}
// quotientDigit <= base - 1
carry = 0;
@@ -799,7 +801,7 @@ var bigInt = (function (undefined) {
for (i = 0; i < a.length; i++) {
x = bigInt(a[i]).modPow(b, n);
if (x.equals(Integer[1]) || x.equals(nPrev)) continue;
for (t = true, d = b; t && d.lesser(nPrev) ; d = d.multiply(2)) {
for (t = true, d = b; t && d.lesser(nPrev); d = d.multiply(2)) {
x = x.square().mod(n);
if (x.equals(nPrev)) t = false;
}
@@ -888,6 +890,7 @@ var bigInt = (function (undefined) {
n = +n;
if (n < 0) return this.shiftRight(-n);
var result = this;
if (result.isZero()) return result;
while (n >= powers2Length) {
result = result.multiply(highestPower2);
n -= powers2Length - 1;
@@ -905,7 +908,7 @@ var bigInt = (function (undefined) {
if (n < 0) return this.shiftLeft(-n);
var result = this;
while (n >= powers2Length) {
if (result.isZero()) return result;
if (result.isZero() || (result.isNegative() && result.isUnit())) return result;
remQuo = divModAny(result, highestPower2);
result = remQuo[1].isNegative() ? remQuo[0].prev() : remQuo[0];
n -= powers2Length - 1;
@@ -975,6 +978,29 @@ var bigInt = (function (undefined) {
return x & -x;
}
function integerLogarithm(value, base) {
if (base.compareTo(value) <= 0) {
var tmp = integerLogarithm(value, base.square(base));
var p = tmp.p;
var e = tmp.e;
var t = p.multiply(base);
return t.compareTo(value) <= 0 ? { p: t, e: e * 2 + 1 } : { p: p, e: e * 2 };
}
return { p: bigInt(1), e: 0 };
}
BigInteger.prototype.bitLength = function () {
var n = this;
if (n.compareTo(bigInt(0)) < 0) {
n = n.negate().subtract(bigInt(1));
}
if (n.compareTo(bigInt(0)) === 0) {
return bigInt(0);
}
return bigInt(integerLogarithm(n, bigInt(2)).e).add(bigInt(1));
}
SmallInteger.prototype.bitLength = BigInteger.prototype.bitLength;
function max(a, b) {
a = parseValue(a);
b = parseValue(b);
@@ -1036,26 +1062,26 @@ var bigInt = (function (undefined) {
}
var parseBase = function (text, base) {
var length = text.length;
var i;
var absBase = Math.abs(base);
for(var i = 0; i < length; i++) {
var c = text[i].toLowerCase();
if(c === "-") continue;
if(/[a-z0-9]/.test(c)) {
if(/[0-9]/.test(c) && +c >= absBase) {
if(c === "1" && absBase === 1) continue;
var i;
var absBase = Math.abs(base);
for (var i = 0; i < length; i++) {
var c = text[i].toLowerCase();
if (c === "-") continue;
if (/[a-z0-9]/.test(c)) {
if (/[0-9]/.test(c) && +c >= absBase) {
if (c === "1" && absBase === 1) continue;
throw new Error(c + " is not a valid digit in base " + base + ".");
} else if(c.charCodeAt(0) - 87 >= absBase) {
throw new Error(c + " is not a valid digit in base " + base + ".");
}
}
}
} else if (c.charCodeAt(0) - 87 >= absBase) {
throw new Error(c + " is not a valid digit in base " + base + ".");
}
}
}
if (2 <= base && base <= 36) {
if (length <= LOG_MAX_INT / Math.log(base)) {
var result = parseInt(text, base);
if(isNaN(result)) {
throw new Error(c + " is not a valid digit in base " + base + ".");
}
var result = parseInt(text, base);
if (isNaN(result)) {
throw new Error(c + " is not a valid digit in base " + base + ".");
}
return new SmallInteger(parseInt(text, base));
}
}
@@ -1087,32 +1113,50 @@ var bigInt = (function (undefined) {
}
function stringify(digit) {
var v = digit.value;
if (typeof v === "number") v = [v];
if (v.length === 1 && v[0] <= 35) {
return "0123456789abcdefghijklmnopqrstuvwxyz".charAt(v[0]);
if (digit <= 35) {
return "0123456789abcdefghijklmnopqrstuvwxyz".charAt(digit);
}
return "<" + v + ">";
return "<" + digit + ">";
}
function toBase(n, base) {
base = bigInt(base);
if (base.isZero()) {
if (n.isZero()) return "0";
if (n.isZero()) return { value: [0], isNegative: false };
throw new Error("Cannot convert nonzero numbers to base 0.");
}
if (base.equals(-1)) {
if (n.isZero()) return "0";
if (n.isNegative()) return new Array(1 - n).join("10");
return "1" + new Array(+n).join("01");
if (n.isZero()) return { value: [0], isNegative: false };
if (n.isNegative())
return {
value: [].concat.apply([], Array.apply(null, Array(-n))
.map(Array.prototype.valueOf, [1, 0])
),
isNegative: false
};
var arr = Array.apply(null, Array(+n - 1))
.map(Array.prototype.valueOf, [0, 1]);
arr.unshift([1]);
return {
value: [].concat.apply([], arr),
isNegative: false
};
}
var minusSign = "";
var neg = false;
if (n.isNegative() && base.isPositive()) {
minusSign = "-";
neg = true;
n = n.abs();
}
if (base.equals(1)) {
if (n.isZero()) return "0";
return minusSign + new Array(+n + 1).join(1);
if (n.isZero()) return { value: [0], isNegative: false };
return {
value: Array.apply(null, Array(+n))
.map(Number.prototype.valueOf, 1),
isNegative: neg
};
}
var out = [];
var left = n, divmod;
@@ -1124,15 +1168,28 @@ var bigInt = (function (undefined) {
digit = base.minus(digit).abs();
left = left.next();
}
out.push(stringify(digit));
out.push(digit.toJSNumber());
}
out.push(stringify(left));
return minusSign + out.reverse().join("");
out.push(left.toJSNumber());
return { value: out.reverse(), isNegative: neg };
}
function toBaseString(n, base) {
var arr = toBase(n, base);
return (arr.isNegative ? "-" : "") + arr.value.map(stringify).join('');
}
BigInteger.prototype.toArray = function (radix) {
return toBase(this, radix);
};
SmallInteger.prototype.toArray = function (radix) {
return toBase(this, radix);
};
BigInteger.prototype.toString = function (radix) {
if (radix === undefined) radix = 10;
if (radix !== 10) return toBase(this, radix);
if (radix !== 10) return toBaseString(this, radix);
var v = this.value, l = v.length, str = String(v[--l]), zeros = "0000000", digit;
while (--l >= 0) {
digit = String(v[l]);
@@ -1144,13 +1201,13 @@ var bigInt = (function (undefined) {
SmallInteger.prototype.toString = function (radix) {
if (radix === undefined) radix = 10;
if (radix != 10) return toBase(this, radix);
if (radix != 10) return toBaseString(this, radix);
return String(this.value);
};
BigInteger.prototype.toJSON = SmallInteger.prototype.toJSON = function() { return this.toString(); }
BigInteger.prototype.toJSON = SmallInteger.prototype.toJSON = function () { return this.toString(); }
BigInteger.prototype.valueOf = function () {
return +this.toString();
return parseInt(this.toString(), 10);
};
BigInteger.prototype.toJSNumber = BigInteger.prototype.valueOf;
@@ -1160,42 +1217,42 @@ var bigInt = (function (undefined) {
SmallInteger.prototype.toJSNumber = SmallInteger.prototype.valueOf;
function parseStringValue(v) {
if (isPrecise(+v)) {
var x = +v;
if (x === truncate(x))
return new SmallInteger(x);
throw "Invalid integer: " + v;
if (isPrecise(+v)) {
var x = +v;
if (x === truncate(x))
return new SmallInteger(x);
throw new Error("Invalid integer: " + v);
}
var sign = v[0] === "-";
if (sign) v = v.slice(1);
var split = v.split(/e/i);
if (split.length > 2) throw new Error("Invalid integer: " + split.join("e"));
if (split.length === 2) {
var exp = split[1];
if (exp[0] === "+") exp = exp.slice(1);
exp = +exp;
if (exp !== truncate(exp) || !isPrecise(exp)) throw new Error("Invalid integer: " + exp + " is not a valid exponent.");
var text = split[0];
var decimalPlace = text.indexOf(".");
if (decimalPlace >= 0) {
exp -= text.length - decimalPlace - 1;
text = text.slice(0, decimalPlace) + text.slice(decimalPlace + 1);
}
var sign = v[0] === "-";
if (sign) v = v.slice(1);
var split = v.split(/e/i);
if (split.length > 2) throw new Error("Invalid integer: " + split.join("e"));
if (split.length === 2) {
var exp = split[1];
if (exp[0] === "+") exp = exp.slice(1);
exp = +exp;
if (exp !== truncate(exp) || !isPrecise(exp)) throw new Error("Invalid integer: " + exp + " is not a valid exponent.");
var text = split[0];
var decimalPlace = text.indexOf(".");
if (decimalPlace >= 0) {
exp -= text.length - decimalPlace - 1;
text = text.slice(0, decimalPlace) + text.slice(decimalPlace + 1);
}
if (exp < 0) throw new Error("Cannot include negative exponent part for integers");
text += (new Array(exp + 1)).join("0");
v = text;
}
var isValid = /^([0-9][0-9]*)$/.test(v);
if (!isValid) throw new Error("Invalid integer: " + v);
var r = [], max = v.length, l = LOG_BASE, min = max - l;
while (max > 0) {
r.push(+v.slice(min, max));
min -= l;
if (min < 0) min = 0;
max -= l;
}
trim(r);
return new BigInteger(r, sign);
if (exp < 0) throw new Error("Cannot include negative exponent part for integers");
text += (new Array(exp + 1)).join("0");
v = text;
}
var isValid = /^([0-9][0-9]*)$/.test(v);
if (!isValid) throw new Error("Invalid integer: " + v);
var r = [], max = v.length, l = LOG_BASE, min = max - l;
while (max > 0) {
r.push(+v.slice(min, max));
min -= l;
if (min < 0) min = 0;
max -= l;
}
trim(r);
return new BigInteger(r, sign);
}
function parseNumberValue(v) {
@@ -1244,8 +1301,8 @@ if (typeof module !== "undefined" && module.hasOwnProperty("exports")) {
}
//amd check
if ( typeof define === "function" && define.amd ) {
define( "big-integer", [], function() {
return bigInt;
});
if (typeof define === "function" && define.amd) {
define("big-integer", [], function () {
return bigInt;
});
}

File diff suppressed because one or more lines are too long

50
node_modules/big-integer/README.md generated vendored
View File

@@ -92,6 +92,12 @@ Performs the bitwise AND operation. The operands are treated as if they were rep
- `bigInt(6).and(3)` => `2`
- `bigInt(6).and(-3)` => `4`
#### `bitLength()`
Returns the number of digits required to represent a bigInt in binary.
- `bigInt(5)` => `3` (since 5 is `101` in binary, which is three digits long)
#### `compare(number)`
Performs a comparison between two numbers. If the numbers are equal, it returns `0`. If the first number is greater, it returns `1`. If the first number is lesser, it returns `-1`.
@@ -406,6 +412,50 @@ Alias for the `multiply` method.
[View benchmarks for this method](http://peterolson.github.io/BigInteger.js/benchmark/#Multiplication)
#### `toArray(radix)`
Converts a bigInt into an object with the properties "value" and "isNegative." "Value" is an array of integers modulo the given radix. "isNegative" is a boolean that represents the sign of the result.
- `bigInt("1e9").toArray(10)` => {
value: [1, 0, 0, 0, 0, 0, 0, 0, 0, 0],
isNegative: false
}
- `bigInt("1e9").toArray(16)` => {
value: [3, 11, 9, 10, 12, 10, 0, 0],
isNegative: false
}
- `bigInt(567890).toArray(100)` => {
value: [56, 78, 90],
isNegative: false
}
Negative bases are supported.
- `bigInt(12345).toArray(-10)` => {
value: [2, 8, 4, 6, 5],
isNegative: false
}
Base 1 and base -1 are also supported.
- `bigInt(-15).toArray(1)` => {
value: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
isNegative: true
}
- `bigInt(-15).toArray(-1)` => {
value: [1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1,
0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0],
isNegative: false
}
Base 0 is only allowed for the number zero.
- `bigInt(0).toArray(0)` => {
value: [0],
isNegative: false
}
- `bigInt(1).toArray(0)` => `Error: Cannot convert nonzero numbers to base 0.`
#### `toJSNumber()`
Converts a bigInt into a native Javascript number. Loses precision for numbers outside the range `[-9007199254740992, 9007199254740992]`.

View File

@@ -1,50 +1,27 @@
{
"_args": [
[
{
"raw": "big-integer@^1.6.7",
"scope": null,
"escapedName": "big-integer",
"name": "big-integer",
"rawSpec": "^1.6.7",
"spec": ">=1.6.7 <2.0.0",
"type": "range"
},
"/Users/jbowser/cordova/cordova-android/node_modules/bplist-parser"
]
],
"_from": "big-integer@>=1.6.7 <2.0.0",
"_id": "big-integer@1.6.26",
"_inCache": true,
"_from": "big-integer@^1.6.7",
"_id": "big-integer@1.6.32",
"_inBundle": false,
"_integrity": "sha512-ljKJdR3wk9thHfLj4DtrNiOSTxvGFaMjWrG4pW75juXC4j7+XuKJVFdg4kgFMYp85PVkO05dFMj2dk2xVsH4xw==",
"_location": "/big-integer",
"_nodeVersion": "6.10.3",
"_npmOperationalInternal": {
"host": "s3://npm-registry-packages",
"tmp": "tmp/big-integer-1.6.26.tgz_1510889021794_0.842821853235364"
},
"_npmUser": {
"name": "peterolson",
"email": "peter.e.c.olson+npm@gmail.com"
},
"_npmVersion": "3.10.10",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "big-integer@^1.6.7",
"scope": null,
"escapedName": "big-integer",
"name": "big-integer",
"escapedName": "big-integer",
"rawSpec": "^1.6.7",
"spec": ">=1.6.7 <2.0.0",
"type": "range"
"saveSpec": null,
"fetchSpec": "^1.6.7"
},
"_requiredBy": [
"/bplist-parser"
],
"_resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.26.tgz",
"_shasum": "3af1672fa62daf2d5ecafacf6e5aa0d25e02c1c8",
"_shrinkwrap": null,
"_resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.32.tgz",
"_shasum": "5867458b25ecd5bcb36b627c30bb501a13c07e89",
"_spec": "big-integer@^1.6.7",
"_where": "/Users/jbowser/cordova/cordova-android/node_modules/bplist-parser",
"_where": "/Users/brodybits/Documents/cordova/cordova-android/node_modules/bplist-parser",
"author": {
"name": "Peter Olson",
"email": "peter.e.c.olson+npm@gmail.com"
@@ -53,16 +30,18 @@
"bugs": {
"url": "https://github.com/peterolson/BigInteger.js/issues"
},
"bundleDependencies": false,
"contributors": [],
"dependencies": {},
"deprecated": false,
"description": "An arbitrary length integer library for Javascript",
"devDependencies": {
"@types/lodash": "^4.14.64",
"@types/node": "^7.0.22",
"@types/lodash": "^4.14.109",
"@types/node": "^7.0.65",
"coveralls": "^2.11.4",
"jasmine": "2.1.x",
"jasmine-core": "^2.3.4",
"karma": "^0.13.3",
"karma": "^0.13.22",
"karma-cli": "^1.0.1",
"karma-coverage": "^0.4.2",
"karma-jasmine": "^0.3.6",
"karma-phantomjs-launcher": "^1.0.4",
@@ -70,15 +49,9 @@
"typescript": "^2.3.3",
"uglifyjs": "^2.4.10"
},
"directories": {},
"dist": {
"shasum": "3af1672fa62daf2d5ecafacf6e5aa0d25e02c1c8",
"tarball": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.26.tgz"
},
"engines": {
"node": ">=0.6"
},
"gitHead": "b1c6e0e95eca0a0d19ebbb9cc81ec492448a9e8a",
"homepage": "https://github.com/peterolson/BigInteger.js#readme",
"keywords": [
"math",
@@ -93,23 +66,15 @@
],
"license": "Unlicense",
"main": "./BigInteger",
"maintainers": [
{
"name": "peterolson",
"email": "peter.e.c.olson+npm@gmail.com"
}
],
"name": "big-integer",
"optionalDependencies": {},
"readme": "ERROR: No README data found!",
"repository": {
"type": "git",
"url": "git+ssh://git@github.com/peterolson/BigInteger.js.git"
},
"scripts": {
"minify": "uglifyjs BigInteger.js -o BigInteger.min.js",
"test": "tsc && node_modules/.bin/karma start my.conf.js && node spec/tsDefinitions.js"
"test": "tsc && karma start my.conf.js && node spec/tsDefinitions.js"
},
"typings": "./BigInteger.d.ts",
"version": "1.6.26"
"version": "1.6.32"
}

View File

@@ -1,46 +1,27 @@
{
"_args": [
[
{
"raw": "bplist-parser@^0.1.0",
"scope": null,
"escapedName": "bplist-parser",
"name": "bplist-parser",
"rawSpec": "^0.1.0",
"spec": ">=0.1.0 <0.2.0",
"type": "range"
},
"/Users/jbowser/cordova/cordova-android/node_modules/cordova-common"
]
],
"_from": "bplist-parser@>=0.1.0 <0.2.0",
"_from": "bplist-parser@^0.1.0",
"_id": "bplist-parser@0.1.1",
"_inCache": true,
"_inBundle": false,
"_integrity": "sha1-1g1dzCDLptx+HymbNdPh+V2vuuY=",
"_location": "/bplist-parser",
"_nodeVersion": "5.1.0",
"_npmUser": {
"name": "joeferner",
"email": "joe@fernsroth.com"
},
"_npmVersion": "3.4.0",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "bplist-parser@^0.1.0",
"scope": null,
"escapedName": "bplist-parser",
"name": "bplist-parser",
"escapedName": "bplist-parser",
"rawSpec": "^0.1.0",
"spec": ">=0.1.0 <0.2.0",
"type": "range"
"saveSpec": null,
"fetchSpec": "^0.1.0"
},
"_requiredBy": [
"/cordova-common"
],
"_resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.1.1.tgz",
"_shasum": "d60d5dcc20cba6dc7e1f299b35d3e1f95dafbae6",
"_shrinkwrap": null,
"_spec": "bplist-parser@^0.1.0",
"_where": "/Users/jbowser/cordova/cordova-android/node_modules/cordova-common",
"_where": "/Users/brodybits/Documents/cordova/cordova-android/node_modules/cordova-common",
"author": {
"name": "Joe Ferner",
"email": "joe.ferner@nearinfinity.com"
@@ -48,19 +29,15 @@
"bugs": {
"url": "https://github.com/nearinfinity/node-bplist-parser/issues"
},
"bundleDependencies": false,
"dependencies": {
"big-integer": "^1.6.7"
},
"deprecated": false,
"description": "Binary plist parser.",
"devDependencies": {
"nodeunit": "~0.9.1"
},
"directories": {},
"dist": {
"shasum": "d60d5dcc20cba6dc7e1f299b35d3e1f95dafbae6",
"tarball": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.1.1.tgz"
},
"gitHead": "c4f22650de2cc95edd21a6e609ff0654a2b951bd",
"homepage": "https://github.com/nearinfinity/node-bplist-parser#readme",
"keywords": [
"bplist",
@@ -69,15 +46,7 @@
],
"license": "MIT",
"main": "bplistParser.js",
"maintainers": [
{
"name": "joeferner",
"email": "joe@fernsroth.com"
}
],
"name": "bplist-parser",
"optionalDependencies": {},
"readme": "ERROR: No README data found!",
"repository": {
"type": "git",
"url": "git+https://github.com/nearinfinity/node-bplist-parser.git"

View File

@@ -1,6 +1,6 @@
The MIT License (MIT)
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Copyright (c) 2013 Julian Gruber <julian@juliangruber.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -9,13 +9,13 @@ 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 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.
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -63,7 +63,7 @@ Valid expansions are:
// {a,b,...}
```
A comma seperated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`.
A comma separated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`.
```js
/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/
@@ -98,6 +98,12 @@ npm install brace-expansion
- [Julian Gruber](https://github.com/juliangruber)
- [Isaac Z. Schlueter](https://github.com/isaacs)
## Sponsors
This module is proudly supported by my [Sponsors](https://github.com/juliangruber/sponsors)!
Do you want to support modules like this to improve their quality, stability and weigh in on new features? Then please consider donating to my [Patreon](https://www.patreon.com/juliangruber). Not sure how much of my modules you're using? Try [feross/thanks](https://github.com/feross/thanks)!
## License
(MIT)

View File

@@ -1,50 +1,27 @@
{
"_args": [
[
{
"raw": "brace-expansion@^1.1.7",
"scope": null,
"escapedName": "brace-expansion",
"name": "brace-expansion",
"rawSpec": "^1.1.7",
"spec": ">=1.1.7 <2.0.0",
"type": "range"
},
"/Users/jbowser/cordova/cordova-android/node_modules/minimatch"
]
],
"_from": "brace-expansion@>=1.1.7 <2.0.0",
"_id": "brace-expansion@1.1.8",
"_inCache": true,
"_from": "brace-expansion@^1.1.7",
"_id": "brace-expansion@1.1.11",
"_inBundle": false,
"_integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
"_location": "/brace-expansion",
"_nodeVersion": "7.8.0",
"_npmOperationalInternal": {
"host": "s3://npm-registry-packages",
"tmp": "tmp/brace-expansion-1.1.8.tgz_1497251980593_0.6575565172825009"
},
"_npmUser": {
"name": "juliangruber",
"email": "julian@juliangruber.com"
},
"_npmVersion": "4.2.0",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "brace-expansion@^1.1.7",
"scope": null,
"escapedName": "brace-expansion",
"name": "brace-expansion",
"escapedName": "brace-expansion",
"rawSpec": "^1.1.7",
"spec": ">=1.1.7 <2.0.0",
"type": "range"
"saveSpec": null,
"fetchSpec": "^1.1.7"
},
"_requiredBy": [
"/minimatch"
],
"_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz",
"_shasum": "c07b211c7c952ec1f8efd51a77ef0d1d3990a292",
"_shrinkwrap": null,
"_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
"_shasum": "3c7fcbf529d87226f3d2f52b966ff5271eb441dd",
"_spec": "brace-expansion@^1.1.7",
"_where": "/Users/jbowser/cordova/cordova-android/node_modules/minimatch",
"_where": "/Users/brodybits/Documents/cordova/cordova-android/node_modules/minimatch",
"author": {
"name": "Julian Gruber",
"email": "mail@juliangruber.com",
@@ -53,38 +30,22 @@
"bugs": {
"url": "https://github.com/juliangruber/brace-expansion/issues"
},
"bundleDependencies": false,
"dependencies": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
},
"deprecated": false,
"description": "Brace expansion as known from sh/bash",
"devDependencies": {
"matcha": "^0.7.0",
"tape": "^4.6.0"
},
"directories": {},
"dist": {
"shasum": "c07b211c7c952ec1f8efd51a77ef0d1d3990a292",
"tarball": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz"
},
"gitHead": "8f59e68bd5c915a0d624e8e39354e1ccf672edf6",
"homepage": "https://github.com/juliangruber/brace-expansion",
"keywords": [],
"license": "MIT",
"main": "index.js",
"maintainers": [
{
"name": "juliangruber",
"email": "julian@juliangruber.com"
},
{
"name": "isaacs",
"email": "isaacs@npmjs.com"
}
],
"name": "brace-expansion",
"optionalDependencies": {},
"readme": "ERROR: No README data found!",
"repository": {
"type": "git",
"url": "git://github.com/juliangruber/brace-expansion.git"
@@ -110,5 +71,5 @@
"android-browser/4.2..latest"
]
},
"version": "1.1.8"
"version": "1.1.11"
}

51
node_modules/concat-map/package.json generated vendored
View File

@@ -1,45 +1,27 @@
{
"_args": [
[
{
"raw": "concat-map@0.0.1",
"scope": null,
"escapedName": "concat-map",
"name": "concat-map",
"rawSpec": "0.0.1",
"spec": "0.0.1",
"type": "version"
},
"/Users/jbowser/cordova/cordova-android/node_modules/brace-expansion"
]
],
"_from": "concat-map@0.0.1",
"_id": "concat-map@0.0.1",
"_inCache": true,
"_inBundle": false,
"_integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
"_location": "/concat-map",
"_npmUser": {
"name": "substack",
"email": "mail@substack.net"
},
"_npmVersion": "1.3.21",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "concat-map@0.0.1",
"scope": null,
"escapedName": "concat-map",
"name": "concat-map",
"escapedName": "concat-map",
"rawSpec": "0.0.1",
"spec": "0.0.1",
"type": "version"
"saveSpec": null,
"fetchSpec": "0.0.1"
},
"_requiredBy": [
"/brace-expansion"
],
"_resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
"_shasum": "d8a96bd77fd68df7793a73036a3ba0d5405d477b",
"_shrinkwrap": null,
"_spec": "concat-map@0.0.1",
"_where": "/Users/jbowser/cordova/cordova-android/node_modules/brace-expansion",
"_where": "/Users/brodybits/Documents/cordova/cordova-android/node_modules/brace-expansion",
"author": {
"name": "James Halliday",
"email": "mail@substack.net",
@@ -48,7 +30,8 @@
"bugs": {
"url": "https://github.com/substack/node-concat-map/issues"
},
"dependencies": {},
"bundleDependencies": false,
"deprecated": false,
"description": "concatenative mapdashery",
"devDependencies": {
"tape": "~2.4.0"
@@ -57,11 +40,7 @@
"example": "example",
"test": "test"
},
"dist": {
"shasum": "d8a96bd77fd68df7793a73036a3ba0d5405d477b",
"tarball": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz"
},
"homepage": "https://github.com/substack/node-concat-map",
"homepage": "https://github.com/substack/node-concat-map#readme",
"keywords": [
"concat",
"concatMap",
@@ -71,15 +50,7 @@
],
"license": "MIT",
"main": "index.js",
"maintainers": [
{
"name": "substack",
"email": "mail@substack.net"
}
],
"name": "concat-map",
"optionalDependencies": {},
"readme": "ERROR: No README data found!",
"repository": {
"type": "git",
"url": "git://github.com/substack/node-concat-map.git"

View File

@@ -8,4 +8,6 @@ rules:
padded-blocks: off
operator-linebreak: off
no-throw-literal: off
no-unused-vars:
- error
- args: after-used

View File

@@ -0,0 +1,22 @@
<!--
Please make sure the checklist boxes are all checked before submitting the PR. The checklist
is intended as a quick reference, for complete details please see our Contributor Guidelines:
http://cordova.apache.org/contribute/contribute_guidelines.html
Thanks!
-->
### Platforms affected
### What does this PR do?
### What testing has been done on this change?
### Checklist
- [ ] [Reported an issue](http://cordova.apache.org/contribute/issues.html) in the JIRA database
- [ ] Commit message follows the format: "CB-3232: (android) Fix bug with resolving file paths", where CB-xxxx is the JIRA ID & "android" is the platform affected.
- [ ] Added automated test coverage as appropriate for this change.

View File

@@ -1,24 +0,0 @@
{
"disallowMixedSpacesAndTabs": true,
"disallowTrailingWhitespace": true,
"validateLineBreaks": "LF",
"validateIndentation": 4,
"requireLineFeedAtFileEnd": true,
"disallowSpaceAfterPrefixUnaryOperators": true,
"disallowSpaceBeforePostfixUnaryOperators": true,
"requireSpaceAfterLineComment": true,
"requireCapitalizedConstructors": true,
"disallowSpacesInNamedFunctionExpression": {
"beforeOpeningRoundBrace": true
},
"requireSpaceAfterKeywords": [
"if",
"else",
"for",
"while",
"do"
]
}

View File

@@ -6,6 +6,7 @@ node_js:
- "4"
- "6"
- "8"
- "10"
install:
- npm install
- npm install -g codecov

View File

@@ -24,11 +24,11 @@
[![NPM](https://nodei.co/npm/cordova-common.png)](https://nodei.co/npm/cordova-common/)
# cordova-common
Expoeses shared functionality used by [cordova-lib](https://github.com/apache/cordova-lib/) and Cordova platforms.
Exposes shared functionality used by [cordova-lib](https://github.com/apache/cordova-lib/) and Cordova platforms.
## Exposed APIs
### `events`
Represents special instance of NodeJS EventEmitter which is intended to be used to post events to cordova-lib and cordova-cli
Usage:
@@ -122,7 +122,7 @@ superspawn.spawn('adb', ['devices'])
### `xmlHelpers`
A set of utility methods for dealing with xml files.
A set of utility methods for dealing with XML files.
Usage:
```js
@@ -148,10 +148,8 @@ mungeUtil
## Setup
* Clone this repository onto your local machine
`git clone https://git-wip-us.apache.org/repos/asf/cordova-lib.git`
* In terminal, navigate to the inner cordova-common directory
`cd cordova-lib/cordova-common`
* Install dependencies and npm-link
`npm install && npm link`
`git clone https://github.com/apache/cordova-common.git`
* Navigate to cordova-common directory, install dependencies and npm-link
`cd cordova-common && npm install && npm link`
* Navigate to cordova-lib directory and link cordova-common
`cd ../cordova-lib && npm link cordova-common && npm install`
`cd <cordova-lib directory> && npm link cordova-common && npm install`

View File

@@ -20,6 +20,32 @@
-->
# Cordova-common Release Notes
### 2.2.5 (Jun 26, 2018)
* Use plist@2 (^2.1.0) to avoid engine warning message on Node.js 4
### 2.2.4 (June 15, 2018)
* Revert change to update dependencies in package.json (needed to resolve issues with cordova-ios@4)
* Revert change to use strip-bom package to strip BOM
* Continue to use plist@^3.0.1 in package.json
### 2.2.3 (June 1, 2018)
* Revert a minor refactoring that was incompatible with NodeJS 4.x. No change to functionality.
### 2.2.2 (May 30, 2018)
* [CB-13979](https://issues.apache.org/jira/browse/CB-13979) More consistency for `config.xml` lookups
* [CB-14064](https://issues.apache.org/jira/browse/CB-14064) Remove Node 4 from CI matrix
* [CB-14088](https://issues.apache.org/jira/browse/CB-14088) Update dependencies
* [CB-11691](https://issues.apache.org/jira/browse/CB-11691) Fix for modifying binary plists
* [CB-13770](https://issues.apache.org/jira/browse/CB-13770) Warn when <edit-config> or <config-file> not found
* [CB-13471](https://issues.apache.org/jira/browse/CB-13471) Fix tests and path issues for **Windows**
* [CB-13471](https://issues.apache.org/jira/browse/CB-13471) added unit test for config file provider
* [CB-13744](https://issues.apache.org/jira/browse/CB-13744) Recognize storyboards as XML files
* [CB-13674](https://issues.apache.org/jira/browse/CB-13674) Incremented package version to -dev
### 2.2.1 (Dec 14, 2017)
* [CB-13674](https://issues.apache.org/jira/browse/CB-13674): updated dependencies
### 2.2.0 (Nov 22, 2017)
* [CB-13471](https://issues.apache.org/jira/browse/CB-13471) File Provider fix belongs in cordova-common
* [CB-11244](https://issues.apache.org/jira/browse/CB-11244) Spot fix for upcoming `cordova-android@7` changes. https://github.com/apache/cordova-android/pull/389

View File

@@ -6,7 +6,8 @@ environment:
- nodejs_version: "4"
- nodejs_version: "6"
- nodejs_version: "8"
- nodejs_version: "10"
install:
- ps: Install-Product node $env:nodejs_version
- npm install

View File

@@ -1,50 +1,27 @@
{
"_args": [
[
{
"raw": "cordova-common@^2.2.0",
"scope": null,
"escapedName": "cordova-common",
"name": "cordova-common",
"rawSpec": "^2.2.0",
"spec": ">=2.2.0 <3.0.0",
"type": "range"
},
"/Users/jbowser/cordova/cordova-android"
]
],
"_from": "cordova-common@>=2.2.0 <3.0.0",
"_id": "cordova-common@2.2.0",
"_inCache": true,
"_from": "cordova-common@2.2.5",
"_id": "cordova-common@2.2.5",
"_inBundle": false,
"_integrity": "sha1-+TzvKtSUz8v1bEbj1hKqqctfzDI=",
"_location": "/cordova-common",
"_nodeVersion": "6.6.0",
"_npmOperationalInternal": {
"host": "s3://npm-registry-packages",
"tmp": "tmp/cordova-common-2.2.0.tgz_1511807085778_0.6969101736322045"
},
"_npmUser": {
"name": "stevegill",
"email": "stevengill97@gmail.com"
},
"_npmVersion": "4.6.1",
"_phantomChildren": {},
"_requested": {
"raw": "cordova-common@^2.2.0",
"scope": null,
"escapedName": "cordova-common",
"type": "version",
"registry": true,
"raw": "cordova-common@2.2.5",
"name": "cordova-common",
"rawSpec": "^2.2.0",
"spec": ">=2.2.0 <3.0.0",
"type": "range"
"escapedName": "cordova-common",
"rawSpec": "2.2.5",
"saveSpec": null,
"fetchSpec": "2.2.5"
},
"_requiredBy": [
"/"
],
"_resolved": "https://registry.npmjs.org/cordova-common/-/cordova-common-2.2.0.tgz",
"_shasum": "0d00f5bcd2bc6c7d06b1ddc0328aea3fe38bcf07",
"_shrinkwrap": null,
"_spec": "cordova-common@^2.2.0",
"_where": "/Users/jbowser/cordova/cordova-android",
"_resolved": "https://registry.npmjs.org/cordova-common/-/cordova-common-2.2.5.tgz",
"_shasum": "f93cef2ad494cfcbf56c46e3d612aaa9cb5fcc32",
"_spec": "cordova-common@2.2.5",
"_where": "/Users/brodybits/Documents/cordova/cordova-android",
"author": {
"name": "Apache Software Foundation"
},
@@ -52,6 +29,7 @@
"url": "https://issues.apache.org/jira/browse/CB",
"email": "dev@cordova.apache.org"
},
"bundleDependencies": false,
"contributors": [],
"dependencies": {
"ansi": "^0.3.1",
@@ -60,14 +38,13 @@
"elementtree": "0.1.6",
"glob": "^5.0.13",
"minimatch": "^3.0.0",
"osenv": "^0.1.3",
"plist": "^1.2.0",
"plist": "^2.1.0",
"q": "^1.4.1",
"semver": "^5.0.1",
"shelljs": "^0.5.3",
"underscore": "^1.8.3",
"unorm": "^1.3.3"
},
"deprecated": false,
"description": "Apache Cordova tools and platforms shared routines",
"devDependencies": {
"eslint": "^4.0.0",
@@ -79,70 +56,26 @@
"eslint-plugin-standard": "^3.0.1",
"istanbul": "^0.4.5",
"jasmine": "^2.5.2",
"osenv": "^0.1.3",
"promise-matchers": "^0.9.6",
"rewire": "^2.5.1"
},
"directories": {},
"dist": {
"shasum": "0d00f5bcd2bc6c7d06b1ddc0328aea3fe38bcf07",
"tarball": "https://registry.npmjs.org/cordova-common/-/cordova-common-2.2.0.tgz"
},
"engines": {
"node": ">=4.0.0"
},
"homepage": "https://github.com/apache/cordova-lib#readme",
"homepage": "https://github.com/apache/cordova-common#readme",
"license": "Apache-2.0",
"main": "cordova-common.js",
"maintainers": [
{
"name": "audreyso",
"email": "audreyeso@gmail.com"
},
{
"name": "apachebuilds",
"email": "root@apache.org"
},
{
"name": "filmaj",
"email": "maj.fil@gmail.com"
},
{
"name": "timbarham",
"email": "npmjs@barhams.info"
},
{
"name": "shazron",
"email": "shazron@gmail.com"
},
{
"name": "bowserj",
"email": "bowserj@apache.org"
},
{
"name": "purplecabbage",
"email": "purplecabbage@gmail.com"
},
{
"name": "stevegill",
"email": "stevengill97@gmail.com"
},
{
"name": "kotikov.vladimir",
"email": "kotikov.vladimir@gmail.com"
}
],
"name": "cordova-common",
"optionalDependencies": {},
"readme": "ERROR: No README data found!",
"repository": {
"type": "git",
"url": "git+https://github.com/apache/cordova-lib.git"
"url": "git+https://github.com/apache/cordova-common.git"
},
"scripts": {
"cover": "istanbul cover --root src --print detail jasmine",
"eslint": "eslint src && eslint spec",
"eslint": "eslint src spec",
"jasmine": "jasmine JASMINE_CONFIG_PATH=spec/support/jasmine.json",
"test": "npm run eslint && npm run jasmine"
},
"version": "2.2.0"
"version": "2.2.5"
}

View File

@@ -32,7 +32,7 @@
var path = require('path');
var et = require('elementtree');
var ConfigKeeper = require('./ConfigKeeper');
var CordovaLogger = require('../CordovaLogger');
var events = require('../events');
var mungeutil = require('./munge-util');
var xml_helpers = require('../util/xml-helpers');
@@ -79,6 +79,8 @@ function PlatformMunger_apply_file_munge (file, munge, remove) {
if (config_file.exists) {
if (remove) config_file.prune_child(selector, munge.parents[selector][xml_child]);
else config_file.graft_child(selector, munge.parents[selector][xml_child]);
} else {
events.emit('warn', 'config file ' + file + ' requested for changes not found at ' + config_file.filepath + ', ignoring');
}
}
}
@@ -134,7 +136,7 @@ function add_plugin_changes (pluginInfo, plugin_vars, is_top_level, should_incre
' cannot be added. <edit-config> changes in this plugin conflicts with <edit-config> changes in config.xml. Conflicts must be resolved before plugin can be added.');
}
if (plugin_force) {
CordovaLogger.get().log(CordovaLogger.WARN, '--force is used. edit-config will overwrite conflicts if any. Conflicting plugins may not work as expected.');
events.emit('warn', '--force is used. edit-config will overwrite conflicts if any. Conflicting plugins may not work as expected.');
// remove conflicting munges
var conflict_munge = mungeutil.decrement_munge(platform_config.config_munge, isConflictingInfo.conflictingMunge);
@@ -198,7 +200,7 @@ function add_config_changes (config, should_increment) {
}
}
if (Object.keys(isConflictingInfo.conflictingMunge.files).length !== 0) {
CordovaLogger.get().log(CordovaLogger.WARN, 'Conflict found, edit-config changes from config.xml will overwrite plugin.xml changes');
events.emit('warn', 'Conflict found, edit-config changes from config.xml will overwrite plugin.xml changes');
// remove conflicting plugin.xml munges
conflict_munge = mungeutil.decrement_munge(platform_config.config_munge, isConflictingInfo.conflictingMunge);

View File

@@ -71,7 +71,7 @@ function ConfigFile_load () {
var ext = path.extname(filepath);
// Windows8 uses an appxmanifest, and wp8 will likely use
// the same in a future release
if (ext === '.xml' || ext === '.appxmanifest') {
if (ext === '.xml' || ext === '.appxmanifest' || ext === '.storyboard') {
self.type = 'xml';
self.data = modules.xml_helpers.parseElementtreeSync(filepath);
} else {
@@ -82,7 +82,7 @@ function ConfigFile_load () {
// Do we still need to support binary plist?
// If yes, use plist.parseStringSync() and read the file once.
self.data = isBinaryPlist(filepath) ?
modules.bplist.parseBuffer(fs.readFileSync(filepath)) :
modules.bplist.parseBuffer(fs.readFileSync(filepath))[0] :
modules.plist.parse(fs.readFileSync(filepath, 'utf8'));
}
}
@@ -166,6 +166,8 @@ function resolveConfigFilePath (project_dir, platform, file) {
var filepath = path.join(project_dir, file);
var matches;
file = path.normalize(file);
if (file.indexOf('*') > -1) {
// handle wildcards in targets using glob.
matches = modules.glob.sync(path.join(project_dir, '**', file));
@@ -195,7 +197,7 @@ function resolveConfigFilePath (project_dir, platform, file) {
} else if (file.endsWith('strings.xml')) {
// Plugins really shouldn't mess with strings.xml, since it's able to be localized
filepath = path.join(project_dir, 'app', 'src', 'main', 'res', 'values', 'strings.xml');
} else if (file.match(/res\/xml/)) {
} else if (file.includes(path.join('res', 'xml'))) {
// Catch-all for all other stored XML configuration in legacy plugins
var config_file = path.basename(file);
filepath = path.join(project_dir, 'app', 'src', 'main', 'res', 'xml', config_file);

View File

@@ -31,7 +31,7 @@ function ConfigParser (path) {
this.cdvNamespacePrefix = getCordovaNamespacePrefix(this.doc);
et.register_namespace(this.cdvNamespacePrefix, 'http://cordova.apache.org/ns/1.0');
} catch (e) {
console.error('Parsing ' + path + ' failed');
events.emit('error', 'Parsing ' + path + ' failed');
throw e;
}
var r = this.doc.getroot();
@@ -86,12 +86,17 @@ function findElementAttributeValue (attributeName, elems) {
return value || '';
}
function removeChildren (el, selector) {
const matches = el.findall(selector);
matches.forEach(child => el.remove(child));
}
ConfigParser.prototype = {
getAttribute: function (attr) {
return this.doc.getroot().attrib[attr];
},
packageName: function (id) {
packageName: function () {
return this.getAttribute('id');
},
setPackageName: function (id) {
@@ -161,7 +166,7 @@ ConfigParser.prototype = {
pref.attrib.value = value;
},
getPlatformPreference: function (name, platform) {
return findElementAttributeValue(name, this.doc.findall('platform[@name=\'' + platform + '\']/preference'));
return findElementAttributeValue(name, this.doc.findall('./platform[@name="' + platform + '"]/preference'));
},
getPreference: function (name, platform) {
@@ -185,7 +190,7 @@ ConfigParser.prototype = {
var ret = [];
var staticResources = [];
if (platform) { // platform specific icons
this.doc.findall('platform[@name=\'' + platform + '\']/' + resourceName).forEach(function (elt) {
this.doc.findall('./platform[@name="' + platform + '"]/' + resourceName).forEach(function (elt) {
elt.platform = platform; // mark as platform specific resource
staticResources.push(elt);
});
@@ -274,7 +279,7 @@ ConfigParser.prototype = {
var fileResources = [];
if (platform) { // platform specific resources
fileResources = this.doc.findall('platform[@name=\'' + platform + '\']/resource-file').map(function (tag) {
fileResources = this.doc.findall('./platform[@name="' + platform + '"]/resource-file').map(function (tag) {
return {
platform: platform,
src: tag.attrib.src,
@@ -428,17 +433,10 @@ ConfigParser.prototype = {
* @param id name of the plugin
*/
removePlugin: function (id) {
if (id) {
var plugins = this.doc.findall('./plugin/[@name="' + id + '"]')
.concat(this.doc.findall('./feature/param[@name="id"][@value="' + id + '"]/..'));
var children = this.doc.getroot().getchildren();
plugins.forEach(function (plugin) {
var idx = children.indexOf(plugin);
if (idx > -1) {
children.splice(idx, 1);
}
});
}
if (!id) return;
const root = this.doc.getroot();
removeChildren(root, `./plugin/[@name="${id}"]`);
removeChildren(root, `./feature/param[@name="id"][@value="${id}"]/..`);
},
// Add any element to the root
@@ -469,14 +467,7 @@ ConfigParser.prototype = {
* @param {String} name the engine name.
*/
removeEngine: function (name) {
var engines = this.doc.findall('./engine/[@name="' + name + '"]');
for (var i = 0; i < engines.length; i++) {
var children = this.doc.getroot().getchildren();
var idx = children.indexOf(engines[i]);
if (idx > -1) {
children.splice(idx, 1);
}
}
removeChildren(this.doc.getroot(), `./engine/[@name="${name}"]`);
},
getEngines: function () {
var engines = this.doc.findall('./engine');
@@ -539,9 +530,7 @@ ConfigParser.prototype = {
},
/* Get all edit-config tags */
getEditConfigs: function (platform) {
var platform_tag = this.doc.find('./platform[@name="' + platform + '"]');
var platform_edit_configs = platform_tag ? platform_tag.findall('edit-config') : [];
var platform_edit_configs = this.doc.findall('./platform[@name="' + platform + '"]/edit-config');
var edit_configs = this.doc.findall('edit-config').concat(platform_edit_configs);
return edit_configs.map(function (tag) {
@@ -559,9 +548,7 @@ ConfigParser.prototype = {
/* Get all config-file tags */
getConfigFiles: function (platform) {
var platform_tag = this.doc.find('./platform[@name="' + platform + '"]');
var platform_config_files = platform_tag ? platform_tag.findall('config-file') : [];
var platform_config_files = this.doc.findall('./platform[@name="' + platform + '"]/config-file');
var config_files = this.doc.findall('config-file').concat(platform_config_files);
return config_files.map(function (tag) {

View File

@@ -1,86 +0,0 @@
<!--
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you 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.
#
-->
# Cordova-Lib
## ConfigParser
wraps a valid cordova config.xml file
### Usage
### Include the ConfigParser module in a projet
var ConfigParser = require('cordova-lib').configparser;
### Create a new ConfigParser
var config = new ConfigParser('path/to/config/xml/');
### Utility Functions
#### packageName(id)
returns document root 'id' attribute value
#### Usage
config.packageName: function(id)
/*
* sets document root element 'id' attribute to @id
*
* @id - new id value
*
*/
#### setPackageName(id)
set document root 'id' attribute to
function(id) {
this.doc.getroot().attrib['id'] = id;
},
###
name: function() {
return getNodeTextSafe(this.doc.find('name'));
},
setName: function(name) {
var el = findOrCreate(this.doc, 'name');
el.text = name;
},
### read the description element
config.description()
var text = "New and improved description of App"
setDescription(text)
### version management
version()
android_versionCode()
ios_CFBundleVersion()
setVersion()
### read author element
config.author();
### read preference
config.getPreference(name);

View File

@@ -186,7 +186,7 @@ function updatePath (sourcePath, targetPath, options, log) {
throw new Error('A target path is required.');
}
log = log || function (message) { };
log = log || function () { };
return updatePathInternal(sourcePath, targetPath, options, log);
}
@@ -213,7 +213,7 @@ function updatePaths (pathMap, options, log) {
throw new Error('An object mapping from target paths to source paths is required.');
}
log = log || function (message) { };
log = log || function () { };
var updated = false;
@@ -266,7 +266,7 @@ function mergeAndUpdateDir (sourceDirs, targetDir, options, log) {
throw new Error('A target directory path is required.');
}
log = log || function (message) { };
log = log || function () { };
var rootDir = (options && options.rootDir) || '';

View File

@@ -328,7 +328,7 @@ function mergeXml (src, dest, platform, clobber) {
});
// write new preferences
Object.keys(prefHash).forEach(function (key, index) {
Object.keys(prefHash).forEach(function (key) {
var element = et.SubElement(xml, 'preference');
element.set('name', key);
element.set('value', this[key]);

View File

@@ -1,63 +1,39 @@
{
"_args": [
[
{
"raw": "cordova-registry-mapper@^1.1.8",
"scope": null,
"escapedName": "cordova-registry-mapper",
"name": "cordova-registry-mapper",
"rawSpec": "^1.1.8",
"spec": ">=1.1.8 <2.0.0",
"type": "range"
},
"/Users/jbowser/cordova/cordova-android/node_modules/cordova-common"
]
],
"_from": "cordova-registry-mapper@>=1.1.8 <2.0.0",
"_from": "cordova-registry-mapper@^1.1.8",
"_id": "cordova-registry-mapper@1.1.15",
"_inCache": true,
"_inBundle": false,
"_integrity": "sha1-4kS5GFuBdUc7/2B5MkkFEV+D3Hw=",
"_location": "/cordova-registry-mapper",
"_nodeVersion": "5.4.1",
"_npmUser": {
"name": "stevegill",
"email": "stevengill97@gmail.com"
},
"_npmVersion": "3.5.3",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "cordova-registry-mapper@^1.1.8",
"scope": null,
"escapedName": "cordova-registry-mapper",
"name": "cordova-registry-mapper",
"escapedName": "cordova-registry-mapper",
"rawSpec": "^1.1.8",
"spec": ">=1.1.8 <2.0.0",
"type": "range"
"saveSpec": null,
"fetchSpec": "^1.1.8"
},
"_requiredBy": [
"/cordova-common"
],
"_resolved": "https://registry.npmjs.org/cordova-registry-mapper/-/cordova-registry-mapper-1.1.15.tgz",
"_shasum": "e244b9185b8175473bff6079324905115f83dc7c",
"_shrinkwrap": null,
"_spec": "cordova-registry-mapper@^1.1.8",
"_where": "/Users/jbowser/cordova/cordova-android/node_modules/cordova-common",
"_where": "/Users/brodybits/Documents/cordova/cordova-android/node_modules/cordova-common",
"author": {
"name": "Steve Gill"
},
"bugs": {
"url": "https://github.com/stevengill/cordova-registry-mapper/issues"
},
"dependencies": {},
"bundleDependencies": false,
"deprecated": false,
"description": "Maps old plugin ids to new plugin names for fetching from npm",
"devDependencies": {
"tape": "^3.5.0"
},
"directories": {},
"dist": {
"shasum": "e244b9185b8175473bff6079324905115f83dc7c",
"tarball": "https://registry.npmjs.org/cordova-registry-mapper/-/cordova-registry-mapper-1.1.15.tgz"
},
"gitHead": "00af0f028ec94154a364eeabe38b8e22320647bd",
"homepage": "https://github.com/stevengill/cordova-registry-mapper#readme",
"keywords": [
"cordova",
@@ -65,15 +41,7 @@
],
"license": "Apache version 2.0",
"main": "index.js",
"maintainers": [
{
"name": "stevegill",
"email": "stevengill97@gmail.com"
}
],
"name": "cordova-registry-mapper",
"optionalDependencies": {},
"readme": "ERROR: No README data found!",
"repository": {
"type": "git",
"url": "git+https://github.com/stevengill/cordova-registry-mapper.git"

View File

@@ -1,36 +1,19 @@
{
"_args": [
[
{
"raw": "elementtree@0.1.6",
"scope": null,
"escapedName": "elementtree",
"name": "elementtree",
"rawSpec": "0.1.6",
"spec": "0.1.6",
"type": "version"
},
"/Users/jbowser/cordova/cordova-android"
]
],
"_from": "elementtree@0.1.6",
"_id": "elementtree@0.1.6",
"_inCache": true,
"_inBundle": false,
"_integrity": "sha1-KsTEbqMFFsjEy9teOsdBjlkt4gw=",
"_location": "/elementtree",
"_npmUser": {
"name": "rphillips",
"email": "ryan@trolocsis.com"
},
"_npmVersion": "1.3.24",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "elementtree@0.1.6",
"scope": null,
"escapedName": "elementtree",
"name": "elementtree",
"escapedName": "elementtree",
"rawSpec": "0.1.6",
"spec": "0.1.6",
"type": "version"
"saveSpec": null,
"fetchSpec": "0.1.6"
},
"_requiredBy": [
"/",
@@ -38,15 +21,15 @@
],
"_resolved": "https://registry.npmjs.org/elementtree/-/elementtree-0.1.6.tgz",
"_shasum": "2ac4c46ea30516c8c4cbdb5e3ac7418e592de20c",
"_shrinkwrap": null,
"_spec": "elementtree@0.1.6",
"_where": "/Users/jbowser/cordova/cordova-android",
"_where": "/Users/brodybits/Documents/cordova/cordova-android",
"author": {
"name": "Rackspace US, Inc."
},
"bugs": {
"url": "https://github.com/racker/node-elementtree/issues"
},
"bundleDependencies": false,
"contributors": [
{
"name": "Paul Querna",
@@ -60,6 +43,7 @@
"dependencies": {
"sax": "0.3.5"
},
"deprecated": false,
"description": "XML Serialization and Parsing module based on Python's ElementTree.",
"devDependencies": {
"whiskey": "0.8.x"
@@ -67,10 +51,6 @@
"directories": {
"lib": "lib"
},
"dist": {
"shasum": "2ac4c46ea30516c8c4cbdb5e3ac7418e592de20c",
"tarball": "https://registry.npmjs.org/elementtree/-/elementtree-0.1.6.tgz"
},
"engines": {
"node": ">= 0.4.0"
},
@@ -89,15 +69,7 @@
}
],
"main": "lib/elementtree.js",
"maintainers": [
{
"name": "rphillips",
"email": "ryan@trolocsis.com"
}
],
"name": "elementtree",
"optionalDependencies": {},
"readme": "ERROR: No README data found!",
"repository": {
"type": "git",
"url": "git://github.com/racker/node-elementtree.git"

56
node_modules/glob/package.json generated vendored
View File

@@ -1,46 +1,28 @@
{
"_args": [
[
{
"raw": "glob@^5.0.13",
"scope": null,
"escapedName": "glob",
"name": "glob",
"rawSpec": "^5.0.13",
"spec": ">=5.0.13 <6.0.0",
"type": "range"
},
"/Users/jbowser/cordova/cordova-android/node_modules/cordova-common"
]
],
"_from": "glob@>=5.0.13 <6.0.0",
"_from": "glob@^5.0.13",
"_id": "glob@5.0.15",
"_inCache": true,
"_inBundle": false,
"_integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=",
"_location": "/glob",
"_nodeVersion": "4.0.0",
"_npmUser": {
"name": "isaacs",
"email": "isaacs@npmjs.com"
},
"_npmVersion": "3.3.2",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "glob@^5.0.13",
"scope": null,
"escapedName": "glob",
"name": "glob",
"escapedName": "glob",
"rawSpec": "^5.0.13",
"spec": ">=5.0.13 <6.0.0",
"type": "range"
"saveSpec": null,
"fetchSpec": "^5.0.13"
},
"_requiredBy": [
"/cordova-common"
"/cordova-common",
"/istanbul"
],
"_resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz",
"_shasum": "1bc936b9e02f4a603fcc222ecf7633d30b8b93b1",
"_shrinkwrap": null,
"_spec": "glob@^5.0.13",
"_where": "/Users/jbowser/cordova/cordova-android/node_modules/cordova-common",
"_where": "/Users/brodybits/Documents/cordova/cordova-android/node_modules/cordova-common",
"author": {
"name": "Isaac Z. Schlueter",
"email": "i@izs.me",
@@ -49,6 +31,7 @@
"bugs": {
"url": "https://github.com/isaacs/node-glob/issues"
},
"bundleDependencies": false,
"dependencies": {
"inflight": "^1.0.4",
"inherits": "2",
@@ -56,6 +39,7 @@
"once": "^1.3.0",
"path-is-absolute": "^1.0.0"
},
"deprecated": false,
"description": "a little globber",
"devDependencies": {
"mkdirp": "0",
@@ -63,11 +47,6 @@
"tap": "^1.1.4",
"tick": "0.0.6"
},
"directories": {},
"dist": {
"shasum": "1bc936b9e02f4a603fcc222ecf7633d30b8b93b1",
"tarball": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz"
},
"engines": {
"node": "*"
},
@@ -76,19 +55,10 @@
"sync.js",
"common.js"
],
"gitHead": "3a7e71d453dd80e75b196fd262dd23ed54beeceb",
"homepage": "https://github.com/isaacs/node-glob#readme",
"license": "ISC",
"main": "glob.js",
"maintainers": [
{
"name": "isaacs",
"email": "i@izs.me"
}
],
"name": "glob",
"optionalDependencies": {},
"readme": "ERROR: No README data found!",
"repository": {
"type": "git",
"url": "git://github.com/isaacs/node-glob.git"

75
node_modules/inflight/package.json generated vendored
View File

@@ -1,50 +1,31 @@
{
"_args": [
[
{
"raw": "inflight@^1.0.4",
"scope": null,
"escapedName": "inflight",
"name": "inflight",
"rawSpec": "^1.0.4",
"spec": ">=1.0.4 <2.0.0",
"type": "range"
},
"/Users/jbowser/cordova/cordova-android/node_modules/glob"
]
],
"_from": "inflight@>=1.0.4 <2.0.0",
"_from": "inflight@^1.0.4",
"_id": "inflight@1.0.6",
"_inCache": true,
"_inBundle": false,
"_integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
"_location": "/inflight",
"_nodeVersion": "6.5.0",
"_npmOperationalInternal": {
"host": "packages-16-east.internal.npmjs.com",
"tmp": "tmp/inflight-1.0.6.tgz_1476330807696_0.10388551792129874"
},
"_npmUser": {
"name": "isaacs",
"email": "i@izs.me"
},
"_npmVersion": "3.10.7",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "inflight@^1.0.4",
"scope": null,
"escapedName": "inflight",
"name": "inflight",
"escapedName": "inflight",
"rawSpec": "^1.0.4",
"spec": ">=1.0.4 <2.0.0",
"type": "range"
"saveSpec": null,
"fetchSpec": "^1.0.4"
},
"_requiredBy": [
"/glob"
"/eslint/glob",
"/glob",
"/globby/glob",
"/jasmine/glob",
"/rimraf/glob"
],
"_resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
"_shasum": "49bd6331d7d02d0c09bc910a1075ba8165b56df9",
"_shrinkwrap": null,
"_spec": "inflight@^1.0.4",
"_where": "/Users/jbowser/cordova/cordova-android/node_modules/glob",
"_where": "/Users/brodybits/Documents/cordova/cordova-android/node_modules/glob",
"author": {
"name": "Isaac Z. Schlueter",
"email": "i@izs.me",
@@ -53,47 +34,23 @@
"bugs": {
"url": "https://github.com/isaacs/inflight/issues"
},
"bundleDependencies": false,
"dependencies": {
"once": "^1.3.0",
"wrappy": "1"
},
"deprecated": false,
"description": "Add callbacks to requests in flight to avoid async duplication",
"devDependencies": {
"tap": "^7.1.2"
},
"directories": {},
"dist": {
"shasum": "49bd6331d7d02d0c09bc910a1075ba8165b56df9",
"tarball": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz"
},
"files": [
"inflight.js"
],
"gitHead": "a547881738c8f57b27795e584071d67cf6ac1a57",
"homepage": "https://github.com/isaacs/inflight",
"license": "ISC",
"main": "inflight.js",
"maintainers": [
{
"name": "iarna",
"email": "me@re-becca.org"
},
{
"name": "isaacs",
"email": "i@izs.me"
},
{
"name": "othiym23",
"email": "ogd@aoaioxxysz.net"
},
{
"name": "zkat",
"email": "kat@sykosomatic.org"
}
],
"name": "inflight",
"optionalDependencies": {},
"readme": "ERROR: No README data found!",
"repository": {
"type": "git",
"url": "git+https://github.com/npm/inflight.git"

66
node_modules/inherits/package.json generated vendored
View File

@@ -1,69 +1,47 @@
{
"_args": [
[
{
"raw": "inherits@2",
"scope": null,
"escapedName": "inherits",
"name": "inherits",
"rawSpec": "2",
"spec": ">=2.0.0 <3.0.0",
"type": "range"
},
"/Users/jbowser/cordova/cordova-android/node_modules/glob"
]
],
"_from": "inherits@>=2.0.0 <3.0.0",
"_from": "inherits@2",
"_id": "inherits@2.0.3",
"_inCache": true,
"_inBundle": false,
"_integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=",
"_location": "/inherits",
"_nodeVersion": "6.5.0",
"_npmOperationalInternal": {
"host": "packages-16-east.internal.npmjs.com",
"tmp": "tmp/inherits-2.0.3.tgz_1473295776489_0.08142363070510328"
},
"_npmUser": {
"name": "isaacs",
"email": "i@izs.me"
},
"_npmVersion": "3.10.7",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "inherits@2",
"scope": null,
"escapedName": "inherits",
"name": "inherits",
"escapedName": "inherits",
"rawSpec": "2",
"spec": ">=2.0.0 <3.0.0",
"type": "range"
"saveSpec": null,
"fetchSpec": "2"
},
"_requiredBy": [
"/glob"
"/concat-stream",
"/eslint/glob",
"/glob",
"/globby/glob",
"/jasmine/glob",
"/readable-stream",
"/rimraf/glob"
],
"_resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
"_shasum": "633c2c83e3da42a502f52466022480f4208261de",
"_shrinkwrap": null,
"_spec": "inherits@2",
"_where": "/Users/jbowser/cordova/cordova-android/node_modules/glob",
"_where": "/Users/brodybits/Documents/cordova/cordova-android/node_modules/glob",
"browser": "./inherits_browser.js",
"bugs": {
"url": "https://github.com/isaacs/inherits/issues"
},
"dependencies": {},
"bundleDependencies": false,
"deprecated": false,
"description": "Browser-friendly inheritance fully compatible with standard node.js inherits()",
"devDependencies": {
"tap": "^7.1.0"
},
"directories": {},
"dist": {
"shasum": "633c2c83e3da42a502f52466022480f4208261de",
"tarball": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz"
},
"files": [
"inherits.js",
"inherits_browser.js"
],
"gitHead": "e05d0fb27c61a3ec687214f0476386b765364d5f",
"homepage": "https://github.com/isaacs/inherits#readme",
"keywords": [
"inheritance",
@@ -77,15 +55,7 @@
],
"license": "ISC",
"main": "./inherits.js",
"maintainers": [
{
"name": "isaacs",
"email": "i@izs.me"
}
],
"name": "inherits",
"optionalDependencies": {},
"readme": "ERROR: No README data found!",
"repository": {
"type": "git",
"url": "git://github.com/isaacs/inherits.git"

22
node_modules/lodash/LICENSE generated vendored
View File

@@ -1,22 +0,0 @@
Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas,
DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
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.

121
node_modules/lodash/README.md generated vendored
View File

@@ -1,121 +0,0 @@
# lodash v3.10.1
The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash](https://lodash.com/) exported as [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) modules.
Generated using [lodash-cli](https://www.npmjs.com/package/lodash-cli):
```bash
$ lodash modularize modern exports=node -o ./
$ lodash modern -d -o ./index.js
```
## Installation
Using npm:
```bash
$ {sudo -H} npm i -g npm
$ npm i --save lodash
```
In Node.js/io.js:
```js
// load the modern build
var _ = require('lodash');
// or a method category
var array = require('lodash/array');
// or a method (great for smaller builds with browserify/webpack)
var chunk = require('lodash/array/chunk');
```
See the [package source](https://github.com/lodash/lodash/tree/3.10.1-npm) for more details.
**Note:**<br>
Dont assign values to the [special variable](http://nodejs.org/api/repl.html#repl_repl_features) `_` when in the REPL.<br>
Install [n_](https://www.npmjs.com/package/n_) for a REPL that includes lodash by default.
## Module formats
lodash is also available in a variety of other builds & module formats.
* npm packages for [modern](https://www.npmjs.com/package/lodash), [compatibility](https://www.npmjs.com/package/lodash-compat), & [per method](https://www.npmjs.com/browse/keyword/lodash-modularized) builds
* AMD modules for [modern](https://github.com/lodash/lodash/tree/3.10.1-amd) & [compatibility](https://github.com/lodash/lodash-compat/tree/3.10.1-amd) builds
* ES modules for the [modern](https://github.com/lodash/lodash/tree/3.10.1-es) build
## Further Reading
* [API Documentation](https://lodash.com/docs)
* [Build Differences](https://github.com/lodash/lodash/wiki/Build-Differences)
* [Changelog](https://github.com/lodash/lodash/wiki/Changelog)
* [Roadmap](https://github.com/lodash/lodash/wiki/Roadmap)
* [More Resources](https://github.com/lodash/lodash/wiki/Resources)
## Features
* ~100% [code coverage](https://coveralls.io/r/lodash)
* Follows [semantic versioning](http://semver.org/) for releases
* [Lazily evaluated](http://filimanjaro.com/blog/2014/introducing-lazy-evaluation/) chaining
* [_(…)](https://lodash.com/docs#_) supports implicit chaining
* [_.ary](https://lodash.com/docs#ary) & [_.rearg](https://lodash.com/docs#rearg) to change function argument limits & order
* [_.at](https://lodash.com/docs#at) for cherry-picking collection values
* [_.attempt](https://lodash.com/docs#attempt) to execute functions which may error without a try-catch
* [_.before](https://lodash.com/docs#before) to complement [_.after](https://lodash.com/docs#after)
* [_.bindKey](https://lodash.com/docs#bindKey) for binding [*“lazy”*](http://michaux.ca/articles/lazy-function-definition-pattern) defined methods
* [_.chunk](https://lodash.com/docs#chunk) for splitting an array into chunks of a given size
* [_.clone](https://lodash.com/docs#clone) supports shallow cloning of `Date` & `RegExp` objects
* [_.cloneDeep](https://lodash.com/docs#cloneDeep) for deep cloning arrays & objects
* [_.curry](https://lodash.com/docs#curry) & [_.curryRight](https://lodash.com/docs#curryRight) for creating [curried](http://hughfdjackson.com/javascript/why-curry-helps/) functions
* [_.debounce](https://lodash.com/docs#debounce) & [_.throttle](https://lodash.com/docs#throttle) are cancelable & accept options for more control
* [_.defaultsDeep](https://lodash.com/docs#defaultsDeep) for recursively assigning default properties
* [_.fill](https://lodash.com/docs#fill) to fill arrays with values
* [_.findKey](https://lodash.com/docs#findKey) for finding keys
* [_.flow](https://lodash.com/docs#flow) to complement [_.flowRight](https://lodash.com/docs#flowRight) (a.k.a `_.compose`)
* [_.forEach](https://lodash.com/docs#forEach) supports exiting early
* [_.forIn](https://lodash.com/docs#forIn) for iterating all enumerable properties
* [_.forOwn](https://lodash.com/docs#forOwn) for iterating own properties
* [_.get](https://lodash.com/docs#get) & [_.set](https://lodash.com/docs#set) for deep property getting & setting
* [_.gt](https://lodash.com/docs#gt), [_.gte](https://lodash.com/docs#gte), [_.lt](https://lodash.com/docs#lt), & [_.lte](https://lodash.com/docs#lte) relational methods
* [_.inRange](https://lodash.com/docs#inRange) for checking whether a number is within a given range
* [_.isNative](https://lodash.com/docs#isNative) to check for native functions
* [_.isPlainObject](https://lodash.com/docs#isPlainObject) & [_.toPlainObject](https://lodash.com/docs#toPlainObject) to check for & convert to `Object` objects
* [_.isTypedArray](https://lodash.com/docs#isTypedArray) to check for typed arrays
* [_.mapKeys](https://lodash.com/docs#mapKeys) for mapping keys to an object
* [_.matches](https://lodash.com/docs#matches) supports deep object comparisons
* [_.matchesProperty](https://lodash.com/docs#matchesProperty) to complement [_.matches](https://lodash.com/docs#matches) & [_.property](https://lodash.com/docs#property)
* [_.merge](https://lodash.com/docs#merge) for a deep [_.extend](https://lodash.com/docs#extend)
* [_.method](https://lodash.com/docs#method) & [_.methodOf](https://lodash.com/docs#methodOf) to create functions that invoke methods
* [_.modArgs](https://lodash.com/docs#modArgs) for more advanced functional composition
* [_.parseInt](https://lodash.com/docs#parseInt) for consistent cross-environment behavior
* [_.pull](https://lodash.com/docs#pull), [_.pullAt](https://lodash.com/docs#pullAt), & [_.remove](https://lodash.com/docs#remove) for mutating arrays
* [_.random](https://lodash.com/docs#random) supports returning floating-point numbers
* [_.restParam](https://lodash.com/docs#restParam) & [_.spread](https://lodash.com/docs#spread) for applying rest parameters & spreading arguments to functions
* [_.runInContext](https://lodash.com/docs#runInContext) for collisionless mixins & easier mocking
* [_.slice](https://lodash.com/docs#slice) for creating subsets of array-like values
* [_.sortByAll](https://lodash.com/docs#sortByAll) & [_.sortByOrder](https://lodash.com/docs#sortByOrder) for sorting by multiple properties & orders
* [_.support](https://lodash.com/docs#support) for flagging environment features
* [_.template](https://lodash.com/docs#template) supports [*“imports”*](https://lodash.com/docs#templateSettings-imports) options & [ES template delimiters](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-template-literal-lexical-components)
* [_.transform](https://lodash.com/docs#transform) as a powerful alternative to [_.reduce](https://lodash.com/docs#reduce) for transforming objects
* [_.unzipWith](https://lodash.com/docs#unzipWith) & [_.zipWith](https://lodash.com/docs#zipWith) to specify how grouped values should be combined
* [_.valuesIn](https://lodash.com/docs#valuesIn) for getting values of all enumerable properties
* [_.xor](https://lodash.com/docs#xor) to complement [_.difference](https://lodash.com/docs#difference), [_.intersection](https://lodash.com/docs#intersection), & [_.union](https://lodash.com/docs#union)
* [_.add](https://lodash.com/docs#add), [_.round](https://lodash.com/docs#round), [_.sum](https://lodash.com/docs#sum), &
[more](https://lodash.com/docs "_.ceil & _.floor") math methods
* [_.bind](https://lodash.com/docs#bind), [_.curry](https://lodash.com/docs#curry), [_.partial](https://lodash.com/docs#partial), &
[more](https://lodash.com/docs "_.bindKey, _.curryRight, _.partialRight") support customizable argument placeholders
* [_.capitalize](https://lodash.com/docs#capitalize), [_.trim](https://lodash.com/docs#trim), &
[more](https://lodash.com/docs "_.camelCase, _.deburr, _.endsWith, _.escapeRegExp, _.kebabCase, _.pad, _.padLeft, _.padRight, _.repeat, _.snakeCase, _.startCase, _.startsWith, _.trimLeft, _.trimRight, _.trunc, _.words") string methods
* [_.clone](https://lodash.com/docs#clone), [_.isEqual](https://lodash.com/docs#isEqual), &
[more](https://lodash.com/docs "_.assign, _.cloneDeep, _.merge") accept customizer callbacks
* [_.dropWhile](https://lodash.com/docs#dropWhile), [_.takeWhile](https://lodash.com/docs#takeWhile), &
[more](https://lodash.com/docs "_.drop, _.dropRight, _.dropRightWhile, _.take, _.takeRight, _.takeRightWhile") to complement [_.first](https://lodash.com/docs#first), [_.initial](https://lodash.com/docs#initial), [_.last](https://lodash.com/docs#last), & [_.rest](https://lodash.com/docs#rest)
* [_.findLast](https://lodash.com/docs#findLast), [_.findLastKey](https://lodash.com/docs#findLastKey), &
[more](https://lodash.com/docs "_.curryRight, _.dropRight, _.dropRightWhile, _.flowRight, _.forEachRight, _.forInRight, _.forOwnRight, _.padRight, partialRight, _.takeRight, _.trimRight, _.takeRightWhile") right-associative methods
* [_.includes](https://lodash.com/docs#includes), [_.toArray](https://lodash.com/docs#toArray), &
[more](https://lodash.com/docs "_.at, _.countBy, _.every, _.filter, _.find, _.findLast, _.findWhere, _.forEach, _.forEachRight, _.groupBy, _.indexBy, _.invoke, _.map, _.max, _.min, _.partition, _.pluck, _.reduce, _.reduceRight, _.reject, _.shuffle, _.size, _.some, _.sortBy, _.sortByAll, _.sortByOrder, _.sum, _.where") accept strings
* [_#commit](https://lodash.com/docs#prototype-commit) & [_#plant](https://lodash.com/docs#prototype-plant) for working with chain sequences
* [_#thru](https://lodash.com/docs#thru) to pass values thru a chain sequence
## Support
Tested in Chrome 43-44, Firefox 38-39, IE 6-11, MS Edge, Safari 5-8, ChakraNode 0.12.2, io.js 2.5.0, Node.js 0.8.28, 0.10.40, & 0.12.7, PhantomJS 1.9.8, RingoJS 0.11, & Rhino 1.7.6.
Automated [browser](https://saucelabs.com/u/lodash) & [CI](https://travis-ci.org/lodash/lodash/) test runs are available. Special thanks to [Sauce Labs](https://saucelabs.com/) for providing automated browser testing.

44
node_modules/lodash/array.js generated vendored
View File

@@ -1,44 +0,0 @@
module.exports = {
'chunk': require('./array/chunk'),
'compact': require('./array/compact'),
'difference': require('./array/difference'),
'drop': require('./array/drop'),
'dropRight': require('./array/dropRight'),
'dropRightWhile': require('./array/dropRightWhile'),
'dropWhile': require('./array/dropWhile'),
'fill': require('./array/fill'),
'findIndex': require('./array/findIndex'),
'findLastIndex': require('./array/findLastIndex'),
'first': require('./array/first'),
'flatten': require('./array/flatten'),
'flattenDeep': require('./array/flattenDeep'),
'head': require('./array/head'),
'indexOf': require('./array/indexOf'),
'initial': require('./array/initial'),
'intersection': require('./array/intersection'),
'last': require('./array/last'),
'lastIndexOf': require('./array/lastIndexOf'),
'object': require('./array/object'),
'pull': require('./array/pull'),
'pullAt': require('./array/pullAt'),
'remove': require('./array/remove'),
'rest': require('./array/rest'),
'slice': require('./array/slice'),
'sortedIndex': require('./array/sortedIndex'),
'sortedLastIndex': require('./array/sortedLastIndex'),
'tail': require('./array/tail'),
'take': require('./array/take'),
'takeRight': require('./array/takeRight'),
'takeRightWhile': require('./array/takeRightWhile'),
'takeWhile': require('./array/takeWhile'),
'union': require('./array/union'),
'uniq': require('./array/uniq'),
'unique': require('./array/unique'),
'unzip': require('./array/unzip'),
'unzipWith': require('./array/unzipWith'),
'without': require('./array/without'),
'xor': require('./array/xor'),
'zip': require('./array/zip'),
'zipObject': require('./array/zipObject'),
'zipWith': require('./array/zipWith')
};

46
node_modules/lodash/array/chunk.js generated vendored
View File

@@ -1,46 +0,0 @@
var baseSlice = require('../internal/baseSlice'),
isIterateeCall = require('../internal/isIterateeCall');
/* Native method references for those with the same name as other `lodash` methods. */
var nativeCeil = Math.ceil,
nativeFloor = Math.floor,
nativeMax = Math.max;
/**
* Creates an array of elements split into groups the length of `size`.
* If `collection` can't be split evenly, the final chunk will be the remaining
* elements.
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array to process.
* @param {number} [size=1] The length of each chunk.
* @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
* @returns {Array} Returns the new array containing chunks.
* @example
*
* _.chunk(['a', 'b', 'c', 'd'], 2);
* // => [['a', 'b'], ['c', 'd']]
*
* _.chunk(['a', 'b', 'c', 'd'], 3);
* // => [['a', 'b', 'c'], ['d']]
*/
function chunk(array, size, guard) {
if (guard ? isIterateeCall(array, size, guard) : size == null) {
size = 1;
} else {
size = nativeMax(nativeFloor(size) || 1, 1);
}
var index = 0,
length = array ? array.length : 0,
resIndex = -1,
result = Array(nativeCeil(length / size));
while (index < length) {
result[++resIndex] = baseSlice(array, index, (index += size));
}
return result;
}
module.exports = chunk;

30
node_modules/lodash/array/compact.js generated vendored
View File

@@ -1,30 +0,0 @@
/**
* Creates an array with all falsey values removed. The values `false`, `null`,
* `0`, `""`, `undefined`, and `NaN` are falsey.
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array to compact.
* @returns {Array} Returns the new array of filtered values.
* @example
*
* _.compact([0, 1, false, 2, '', 3]);
* // => [1, 2, 3]
*/
function compact(array) {
var index = -1,
length = array ? array.length : 0,
resIndex = -1,
result = [];
while (++index < length) {
var value = array[index];
if (value) {
result[++resIndex] = value;
}
}
return result;
}
module.exports = compact;

View File

@@ -1,29 +0,0 @@
var baseDifference = require('../internal/baseDifference'),
baseFlatten = require('../internal/baseFlatten'),
isArrayLike = require('../internal/isArrayLike'),
isObjectLike = require('../internal/isObjectLike'),
restParam = require('../function/restParam');
/**
* Creates an array of unique `array` values not included in the other
* provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
* for equality comparisons.
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array to inspect.
* @param {...Array} [values] The arrays of values to exclude.
* @returns {Array} Returns the new array of filtered values.
* @example
*
* _.difference([1, 2, 3], [4, 2]);
* // => [1, 3]
*/
var difference = restParam(function(array, values) {
return (isObjectLike(array) && isArrayLike(array))
? baseDifference(array, baseFlatten(values, false, true))
: [];
});
module.exports = difference;

39
node_modules/lodash/array/drop.js generated vendored
View File

@@ -1,39 +0,0 @@
var baseSlice = require('../internal/baseSlice'),
isIterateeCall = require('../internal/isIterateeCall');
/**
* Creates a slice of `array` with `n` elements dropped from the beginning.
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array to query.
* @param {number} [n=1] The number of elements to drop.
* @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
* @returns {Array} Returns the slice of `array`.
* @example
*
* _.drop([1, 2, 3]);
* // => [2, 3]
*
* _.drop([1, 2, 3], 2);
* // => [3]
*
* _.drop([1, 2, 3], 5);
* // => []
*
* _.drop([1, 2, 3], 0);
* // => [1, 2, 3]
*/
function drop(array, n, guard) {
var length = array ? array.length : 0;
if (!length) {
return [];
}
if (guard ? isIterateeCall(array, n, guard) : n == null) {
n = 1;
}
return baseSlice(array, n < 0 ? 0 : n);
}
module.exports = drop;

View File

@@ -1,40 +0,0 @@
var baseSlice = require('../internal/baseSlice'),
isIterateeCall = require('../internal/isIterateeCall');
/**
* Creates a slice of `array` with `n` elements dropped from the end.
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array to query.
* @param {number} [n=1] The number of elements to drop.
* @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
* @returns {Array} Returns the slice of `array`.
* @example
*
* _.dropRight([1, 2, 3]);
* // => [1, 2]
*
* _.dropRight([1, 2, 3], 2);
* // => [1]
*
* _.dropRight([1, 2, 3], 5);
* // => []
*
* _.dropRight([1, 2, 3], 0);
* // => [1, 2, 3]
*/
function dropRight(array, n, guard) {
var length = array ? array.length : 0;
if (!length) {
return [];
}
if (guard ? isIterateeCall(array, n, guard) : n == null) {
n = 1;
}
n = length - (+n || 0);
return baseSlice(array, 0, n < 0 ? 0 : n);
}
module.exports = dropRight;

View File

@@ -1,59 +0,0 @@
var baseCallback = require('../internal/baseCallback'),
baseWhile = require('../internal/baseWhile');
/**
* Creates a slice of `array` excluding elements dropped from the end.
* Elements are dropped until `predicate` returns falsey. The predicate is
* bound to `thisArg` and invoked with three arguments: (value, index, array).
*
* If a property name is provided for `predicate` the created `_.property`
* style callback returns the property value of the given element.
*
* If a value is also provided for `thisArg` the created `_.matchesProperty`
* style callback returns `true` for elements that have a matching property
* value, else `false`.
*
* If an object is provided for `predicate` the created `_.matches` style
* callback returns `true` for elements that match the properties of the given
* object, else `false`.
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array to query.
* @param {Function|Object|string} [predicate=_.identity] The function invoked
* per iteration.
* @param {*} [thisArg] The `this` binding of `predicate`.
* @returns {Array} Returns the slice of `array`.
* @example
*
* _.dropRightWhile([1, 2, 3], function(n) {
* return n > 1;
* });
* // => [1]
*
* var users = [
* { 'user': 'barney', 'active': true },
* { 'user': 'fred', 'active': false },
* { 'user': 'pebbles', 'active': false }
* ];
*
* // using the `_.matches` callback shorthand
* _.pluck(_.dropRightWhile(users, { 'user': 'pebbles', 'active': false }), 'user');
* // => ['barney', 'fred']
*
* // using the `_.matchesProperty` callback shorthand
* _.pluck(_.dropRightWhile(users, 'active', false), 'user');
* // => ['barney']
*
* // using the `_.property` callback shorthand
* _.pluck(_.dropRightWhile(users, 'active'), 'user');
* // => ['barney', 'fred', 'pebbles']
*/
function dropRightWhile(array, predicate, thisArg) {
return (array && array.length)
? baseWhile(array, baseCallback(predicate, thisArg, 3), true, true)
: [];
}
module.exports = dropRightWhile;

View File

@@ -1,59 +0,0 @@
var baseCallback = require('../internal/baseCallback'),
baseWhile = require('../internal/baseWhile');
/**
* Creates a slice of `array` excluding elements dropped from the beginning.
* Elements are dropped until `predicate` returns falsey. The predicate is
* bound to `thisArg` and invoked with three arguments: (value, index, array).
*
* If a property name is provided for `predicate` the created `_.property`
* style callback returns the property value of the given element.
*
* If a value is also provided for `thisArg` the created `_.matchesProperty`
* style callback returns `true` for elements that have a matching property
* value, else `false`.
*
* If an object is provided for `predicate` the created `_.matches` style
* callback returns `true` for elements that have the properties of the given
* object, else `false`.
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array to query.
* @param {Function|Object|string} [predicate=_.identity] The function invoked
* per iteration.
* @param {*} [thisArg] The `this` binding of `predicate`.
* @returns {Array} Returns the slice of `array`.
* @example
*
* _.dropWhile([1, 2, 3], function(n) {
* return n < 3;
* });
* // => [3]
*
* var users = [
* { 'user': 'barney', 'active': false },
* { 'user': 'fred', 'active': false },
* { 'user': 'pebbles', 'active': true }
* ];
*
* // using the `_.matches` callback shorthand
* _.pluck(_.dropWhile(users, { 'user': 'barney', 'active': false }), 'user');
* // => ['fred', 'pebbles']
*
* // using the `_.matchesProperty` callback shorthand
* _.pluck(_.dropWhile(users, 'active', false), 'user');
* // => ['pebbles']
*
* // using the `_.property` callback shorthand
* _.pluck(_.dropWhile(users, 'active'), 'user');
* // => ['barney', 'fred', 'pebbles']
*/
function dropWhile(array, predicate, thisArg) {
return (array && array.length)
? baseWhile(array, baseCallback(predicate, thisArg, 3), true)
: [];
}
module.exports = dropWhile;

44
node_modules/lodash/array/fill.js generated vendored
View File

@@ -1,44 +0,0 @@
var baseFill = require('../internal/baseFill'),
isIterateeCall = require('../internal/isIterateeCall');
/**
* Fills elements of `array` with `value` from `start` up to, but not
* including, `end`.
*
* **Note:** This method mutates `array`.
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array to fill.
* @param {*} value The value to fill `array` with.
* @param {number} [start=0] The start position.
* @param {number} [end=array.length] The end position.
* @returns {Array} Returns `array`.
* @example
*
* var array = [1, 2, 3];
*
* _.fill(array, 'a');
* console.log(array);
* // => ['a', 'a', 'a']
*
* _.fill(Array(3), 2);
* // => [2, 2, 2]
*
* _.fill([4, 6, 8], '*', 1, 2);
* // => [4, '*', 8]
*/
function fill(array, value, start, end) {
var length = array ? array.length : 0;
if (!length) {
return [];
}
if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
start = 0;
end = length;
}
return baseFill(array, value, start, end);
}
module.exports = fill;

View File

@@ -1,53 +0,0 @@
var createFindIndex = require('../internal/createFindIndex');
/**
* This method is like `_.find` except that it returns the index of the first
* element `predicate` returns truthy for instead of the element itself.
*
* If a property name is provided for `predicate` the created `_.property`
* style callback returns the property value of the given element.
*
* If a value is also provided for `thisArg` the created `_.matchesProperty`
* style callback returns `true` for elements that have a matching property
* value, else `false`.
*
* If an object is provided for `predicate` the created `_.matches` style
* callback returns `true` for elements that have the properties of the given
* object, else `false`.
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array to search.
* @param {Function|Object|string} [predicate=_.identity] The function invoked
* per iteration.
* @param {*} [thisArg] The `this` binding of `predicate`.
* @returns {number} Returns the index of the found element, else `-1`.
* @example
*
* var users = [
* { 'user': 'barney', 'active': false },
* { 'user': 'fred', 'active': false },
* { 'user': 'pebbles', 'active': true }
* ];
*
* _.findIndex(users, function(chr) {
* return chr.user == 'barney';
* });
* // => 0
*
* // using the `_.matches` callback shorthand
* _.findIndex(users, { 'user': 'fred', 'active': false });
* // => 1
*
* // using the `_.matchesProperty` callback shorthand
* _.findIndex(users, 'active', false);
* // => 0
*
* // using the `_.property` callback shorthand
* _.findIndex(users, 'active');
* // => 2
*/
var findIndex = createFindIndex();
module.exports = findIndex;

View File

@@ -1,53 +0,0 @@
var createFindIndex = require('../internal/createFindIndex');
/**
* This method is like `_.findIndex` except that it iterates over elements
* of `collection` from right to left.
*
* If a property name is provided for `predicate` the created `_.property`
* style callback returns the property value of the given element.
*
* If a value is also provided for `thisArg` the created `_.matchesProperty`
* style callback returns `true` for elements that have a matching property
* value, else `false`.
*
* If an object is provided for `predicate` the created `_.matches` style
* callback returns `true` for elements that have the properties of the given
* object, else `false`.
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array to search.
* @param {Function|Object|string} [predicate=_.identity] The function invoked
* per iteration.
* @param {*} [thisArg] The `this` binding of `predicate`.
* @returns {number} Returns the index of the found element, else `-1`.
* @example
*
* var users = [
* { 'user': 'barney', 'active': true },
* { 'user': 'fred', 'active': false },
* { 'user': 'pebbles', 'active': false }
* ];
*
* _.findLastIndex(users, function(chr) {
* return chr.user == 'pebbles';
* });
* // => 2
*
* // using the `_.matches` callback shorthand
* _.findLastIndex(users, { 'user': 'barney', 'active': true });
* // => 0
*
* // using the `_.matchesProperty` callback shorthand
* _.findLastIndex(users, 'active', false);
* // => 2
*
* // using the `_.property` callback shorthand
* _.findLastIndex(users, 'active');
* // => 0
*/
var findLastIndex = createFindIndex(true);
module.exports = findLastIndex;

22
node_modules/lodash/array/first.js generated vendored
View File

@@ -1,22 +0,0 @@
/**
* Gets the first element of `array`.
*
* @static
* @memberOf _
* @alias head
* @category Array
* @param {Array} array The array to query.
* @returns {*} Returns the first element of `array`.
* @example
*
* _.first([1, 2, 3]);
* // => 1
*
* _.first([]);
* // => undefined
*/
function first(array) {
return array ? array[0] : undefined;
}
module.exports = first;

32
node_modules/lodash/array/flatten.js generated vendored
View File

@@ -1,32 +0,0 @@
var baseFlatten = require('../internal/baseFlatten'),
isIterateeCall = require('../internal/isIterateeCall');
/**
* Flattens a nested array. If `isDeep` is `true` the array is recursively
* flattened, otherwise it's only flattened a single level.
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array to flatten.
* @param {boolean} [isDeep] Specify a deep flatten.
* @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
* @returns {Array} Returns the new flattened array.
* @example
*
* _.flatten([1, [2, 3, [4]]]);
* // => [1, 2, 3, [4]]
*
* // using `isDeep`
* _.flatten([1, [2, 3, [4]]], true);
* // => [1, 2, 3, 4]
*/
function flatten(array, isDeep, guard) {
var length = array ? array.length : 0;
if (guard && isIterateeCall(array, isDeep, guard)) {
isDeep = false;
}
return length ? baseFlatten(array, isDeep) : [];
}
module.exports = flatten;

View File

@@ -1,21 +0,0 @@
var baseFlatten = require('../internal/baseFlatten');
/**
* Recursively flattens a nested array.
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array to recursively flatten.
* @returns {Array} Returns the new flattened array.
* @example
*
* _.flattenDeep([1, [2, 3, [4]]]);
* // => [1, 2, 3, 4]
*/
function flattenDeep(array) {
var length = array ? array.length : 0;
return length ? baseFlatten(array, true) : [];
}
module.exports = flattenDeep;

1
node_modules/lodash/array/head.js generated vendored
View File

@@ -1 +0,0 @@
module.exports = require('./first');

53
node_modules/lodash/array/indexOf.js generated vendored
View File

@@ -1,53 +0,0 @@
var baseIndexOf = require('../internal/baseIndexOf'),
binaryIndex = require('../internal/binaryIndex');
/* Native method references for those with the same name as other `lodash` methods. */
var nativeMax = Math.max;
/**
* Gets the index at which the first occurrence of `value` is found in `array`
* using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
* for equality comparisons. If `fromIndex` is negative, it's used as the offset
* from the end of `array`. If `array` is sorted providing `true` for `fromIndex`
* performs a faster binary search.
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array to search.
* @param {*} value The value to search for.
* @param {boolean|number} [fromIndex=0] The index to search from or `true`
* to perform a binary search on a sorted array.
* @returns {number} Returns the index of the matched value, else `-1`.
* @example
*
* _.indexOf([1, 2, 1, 2], 2);
* // => 1
*
* // using `fromIndex`
* _.indexOf([1, 2, 1, 2], 2, 2);
* // => 3
*
* // performing a binary search
* _.indexOf([1, 1, 2, 2], 2, true);
* // => 2
*/
function indexOf(array, value, fromIndex) {
var length = array ? array.length : 0;
if (!length) {
return -1;
}
if (typeof fromIndex == 'number') {
fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : fromIndex;
} else if (fromIndex) {
var index = binaryIndex(array, value);
if (index < length &&
(value === value ? (value === array[index]) : (array[index] !== array[index]))) {
return index;
}
return -1;
}
return baseIndexOf(array, value, fromIndex || 0);
}
module.exports = indexOf;

20
node_modules/lodash/array/initial.js generated vendored
View File

@@ -1,20 +0,0 @@
var dropRight = require('./dropRight');
/**
* Gets all but the last element of `array`.
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array to query.
* @returns {Array} Returns the slice of `array`.
* @example
*
* _.initial([1, 2, 3]);
* // => [1, 2]
*/
function initial(array) {
return dropRight(array, 1);
}
module.exports = initial;

View File

@@ -1,58 +0,0 @@
var baseIndexOf = require('../internal/baseIndexOf'),
cacheIndexOf = require('../internal/cacheIndexOf'),
createCache = require('../internal/createCache'),
isArrayLike = require('../internal/isArrayLike'),
restParam = require('../function/restParam');
/**
* Creates an array of unique values that are included in all of the provided
* arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
* for equality comparisons.
*
* @static
* @memberOf _
* @category Array
* @param {...Array} [arrays] The arrays to inspect.
* @returns {Array} Returns the new array of shared values.
* @example
* _.intersection([1, 2], [4, 2], [2, 1]);
* // => [2]
*/
var intersection = restParam(function(arrays) {
var othLength = arrays.length,
othIndex = othLength,
caches = Array(length),
indexOf = baseIndexOf,
isCommon = true,
result = [];
while (othIndex--) {
var value = arrays[othIndex] = isArrayLike(value = arrays[othIndex]) ? value : [];
caches[othIndex] = (isCommon && value.length >= 120) ? createCache(othIndex && value) : null;
}
var array = arrays[0],
index = -1,
length = array ? array.length : 0,
seen = caches[0];
outer:
while (++index < length) {
value = array[index];
if ((seen ? cacheIndexOf(seen, value) : indexOf(result, value, 0)) < 0) {
var othIndex = othLength;
while (--othIndex) {
var cache = caches[othIndex];
if ((cache ? cacheIndexOf(cache, value) : indexOf(arrays[othIndex], value, 0)) < 0) {
continue outer;
}
}
if (seen) {
seen.push(value);
}
result.push(value);
}
}
return result;
});
module.exports = intersection;

Some files were not shown because too many files have changed in this diff Show More