Compare commits

...

61 Commits

Author SHA1 Message Date
Christopher J. Brody
a0cb7da1e3 Set VERSION to 7.1.5-dev 2018-11-23 13:01:25 -05:00
Christopher J. Brody
a68f9fd752 Update VERSION & RELEASENOTES for 7.1.4
NOTE: VERSION was updated based on e1befac.
2018-11-22 22:38:38 -05:00
Christopher J. Brody
84cb08b23e Revert "Other minor dependencies updates in 7.1.x patch"
This reverts commit 5a5f544a48.

Rationale: base64-js update in 5a5f544 causes extra
base64-js version to be installed under plist
(node_modules/plist/node_modules/base64-js),
which would need to be committed to satisfy the needs
of the deprecated Node.js 4 version.

The extra base64-js version in
node_modules/plist/node_modules/base64-js
was missed at the time 5a5f544 was committed.

The base64-js update in 5a5f544 is now deemed as
not wanted due to the extra base64-js version that
would need to be committed.

The other dependencies updates in 5a5f544
may be nice to have but not considered necessary
for the patch release.

Reverting now to unblock the upcoming 7.1.4 patch release.

Note that neither 5a5f544 nor this revert will
show up in the master branch.
2018-11-22 22:18:32 -05:00
Chris Brody
b7643a3712
Merge pull request #573 from brodybits/7.1.4-patch-updates
7.1.4 patch updates
2018-11-22 14:45:04 -05:00
Chris Brody
8586d4a7ba Resolve issue with plugin target-dir="app*" subdirs (#572)
(subdirectories) such as "appco", with unit tests to verify

Needed for @katzer plugins that use de/appplant subdirectory,
for example:
* cordova-plugin-local-notifications
* cordova-plugin-badge
* cordova-plugin-background-mode

Also needed for cordova-plugin-inappbrowser

Co-authored-by: Christopher J. Brody <chris.brody@gmail.com>
Co-authored-by: Julio César <jcesarmobile@gmail.com>
Co-authored-by: Jan Piotrowski <piotrowski+github@gmail.com>
2018-11-22 10:01:27 -05:00
Jan Piotrowski
f2d700515d Output current package name if package name can't be validated (#567)
We have this of the package name. It only outputs that the current one
is bad, not what the current one actually is. Added an output of the
current one to the error.
2018-11-22 10:00:36 -05:00
Christopher J. Brody
5a5f544a48 Other minor dependencies updates in 7.1.x patch 2018-11-22 09:57:22 -05:00
Christopher J. Brody
d918c7a83c android-versions@1.4.0 update in 7.1.x (add Pie) 2018-11-22 09:49:22 -05:00
Christopher J. Brody
afdffe4028 Set Version to 7.1.4-dev
(based on e1befaca5a)
2018-11-22 09:25:57 -05:00
Christopher J. Brody
e1befaca5a Update VERSION & RELEASENOTES for 7.1.3
NOTE: The version was manually updated in the following files:
* RELEASENOTES.md
* VERSION
* bin/templates/cordova/version
* bin/templates/project/assets/www/cordova.js
* framework/build.gradle
* framework/src/org/apache/cordova/CordovaWebView.java
* package.json

with help from git & bash tricks based on changes in the following
commits for 7.1.2 & 7.1.3-dev versions:
- 725e75fa0d
- f86519b158

FUTURE TBD: it is desired that we can set the version in
one place as discussed in: apache/cordova#50
2018-11-19 16:37:39 -05:00
Chris Brody
7b33517339
Mark some 7.1.3 bundled dependency versions (#566)
to resolve red entries from npm outdated
2018-11-19 11:30:29 -05:00
Chris Brody
442734dc47
Merge pull request #555 from brodybits/7.1.3-patch-updates
7.1.3 patch updates
2018-11-17 19:32:57 -05:00
David Boho
32e3eae83e GH-552 (android) check for build-extras.gradle in the app-parent directory (#553)
as documented in https://cordova.apache.org/docs/en/latest/guide/platforms/android/?#extending-buildgradle

and deal with multiple build-extras.gradle locations

Co-authored-by: David Boho <david.boho@tu-ilmenau.de>
Co-authored-by: Christopher J. Brody <chris.brody@gmail.com>
2018-11-16 13:22:43 -05:00
David Boho
0ebc9a6f8d add missing cast for cdvMinSdkVersion (GH-551) 2018-11-16 13:22:43 -05:00
Christopher J. Brody
9848aa885f GH-547 Fix for old plugins with non-Java sources (PR #550)
(source-file entries)

including aidl, aar, jar, and so files
2018-11-16 13:22:43 -05:00
Christopher J. Brody
298f1e3cc8 Fix comments in getInstallDestination (PR #550)
(in pluginHandlers.js)
2018-11-16 13:22:43 -05:00
Christopher J. Brody
07e1fe18ff Cleanup getInstallDestination in pluginHandlers.js (PR #550) 2018-11-16 13:22:43 -05:00
Christopher J. Brody
9537e3468b Test old plugin aidl & lib mapping - repros GH-547 (PR #550)
(reproduces GH-547)
2018-11-16 13:22:43 -05:00
Christopher J. Brody
dea6846918 Check old compat of other extension (CB-14125) (PR #550)
of plugin source file installed into app/src/main with
old target-dir scheme

NOTE: These tests do *not* check compatibility of
plugins with old lib target-dir scheme.
2018-11-16 13:22:43 -05:00
Christopher J. Brody
e3468c66a3 Check target-dir mapping of plugin xml source file (PR #550)
Possibly related to: CB-13830: Add handlers for plugins
that use non-Java source files, such as Camera
2018-11-16 13:22:42 -05:00
Christopher J. Brody
5222a0f605 Fix tests of plugin files with new app dir scheme (PR #542)
(new app target-dir scheme)
2018-11-16 13:22:42 -05:00
Christopher J. Brody
717d768cec GH-540 fix for source-file with app target-dir (PR #542) 2018-11-16 13:22:42 -05:00
Christopher J. Brody
951ff5552e unit test uninstall of <source-file> with app dest (PR #542)
for Java source, JAR, and AAR

Co-authored-by: Christopher J. Brody <chris.brody@gmail.com>
Co-authored-by: Kyle Kirbatski <kkirbatski@gmrmarketing.com>
Co-authored-by: Antonio Facciolo <afdev82@users.noreply.github.com>
2018-11-16 13:22:42 -05:00
Christopher J. Brody
f8584c63e6 unit test source-file with custom lib target-dir (PR #542)
for JAR and AAR

(GH-540)

Co-Authored-By: Kyle Kirbatski <kkirbatski@gmrmarketing.com>
Co-Authored-By: Christopher J. Brody <chris.brody@gmail.com>
Co-Authored-By: @afdev82 (Antonio Facciolo)
2018-11-16 13:22:42 -05:00
Christopher J. Brody
4d151d3057 GH-539 fix destination path fallback (PR #542)
Fallback to old path mapping if no Android Studio path mapping exists

(with slight difference on 7.1.x branch)

Co-authored-by: Christopher J. Brody <chris.brody@gmail.com>
Co-authored-by: Kyle Kirbatski <kkirbatski@gmrmarketing.com>
2018-11-16 13:22:42 -05:00
Christopher J. Brody
55f2986b85 unit test uninstall of <source-file> with app dest (PR #542)
for Java source only (GH-539)

Co-Authored-By: Christopher J. Brody <chris.brody@gmail.com>
Co-Authored-By: Kyle Kirbatski <kkirbatski@gmrmarketing.com>
2018-11-16 13:22:42 -05:00
Kyle Kirbatski
c0e9f25150 Add a unit test to test source-file target-dir /app/src/main/… (PR #542) 2018-11-16 13:22:42 -05:00
Chris Brody
9f6c332b8c Remove obsolete check for JellyBean (GH-534) (#544)
to work properly on Android Pie

was introduced in dc0bfeb0c (CB-11828)

Resolves #534

Co-authored-by: <pradiv-kumar@users.noreply.github.com>
Co-authored-by: Christopher J. Brody <chris.brody@gmail.com>
2018-11-16 13:22:41 -05:00
Chris Brody
dbc99e8f4c Update comments (#496)
as followup to GH-495
2018-11-16 13:22:41 -05:00
Darshan-Chauhan
00134cf9f3 Incorrect default sdk version issue fix (PR #495) 2018-11-16 13:22:37 -05:00
Darryl Pogue
f86519b158
Bump version to 7.1.3-dev 2018-11-05 12:23:23 -08:00
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
597 changed files with 4187 additions and 31278 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

@ -20,6 +20,38 @@
-->
## Release Notes for Cordova (Android) ##
### 7.1.4 (Nov 22, 2018)
* Update android-versions to `1.4.0`, with added support for Android Pie ([#573](https://github.com/apache/cordova-android/pull/573))
* Output current package name if package name can't be validated ([#567](https://github.com/apache/cordova-android/pull/567))
* Resolve issue with plugin `target-dir="*app*"` subdirs ([#572](https://github.com/apache/cordova-android/pull/572))
### 7.1.3 (Nov 19, 2018)
* [GH-495](https://github.com/apache/cordova-android/pull/495) Incorrect default sdk version issue fix
* [GH-496](https://github.com/apache/cordova-android/pull/496) update comments in `build.gradle`
* [GH-539](https://github.com/apache/cordova-android/pull/539) Fix dest overwrite, in case of of plugin `source-file` element with `target-dir` that does not need remapping
* [GH-540](https://github.com/apache/cordova-android/issues/540) support plugin `source-file` element with any app `target-dir` value
* [GH-547](https://github.com/apache/cordova-android/issues/547) Compatibility of old plugins with non-Java `source-file` entries (individual files)
* [GH-551](https://github.com/apache/cordova-android/pull/551) add missing cast for cdvMinSdkVersion to `build.gradle`
* [GH-552](https://github.com/apache/cordova-android/issues/552) check for `build-extras.gradle` in the parent app directory
### 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.

View File

@ -1 +1 @@
7.1.0-dev
7.1.5-dev

View File

@ -194,7 +194,7 @@ function validatePackageName (package_name) {
var msg = 'Error validating package name. ';
if (!/^[a-zA-Z][a-zA-Z0-9_]+(\.[a-zA-Z][a-zA-Z0-9_]*)+$/.test(package_name)) {
return Q.reject(new CordovaError(msg + 'Package name must look like: com.company.Name'));
return Q.reject(new CordovaError(msg + 'Must look like: `com.company.Name`. Currently is: `' + package_name + '`'));
}
// Class is a reserved word

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

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

@ -344,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 = getInstallDestination(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 = getInstallDestination(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,30 @@ function removeFileAndParents (baseDir, destFile, stopper) {
function generateAttributeError (attribute, element, id) {
return 'Required attribute "' + attribute + '" not specified in <' + element + '> element from plugin: ' + id;
}
function getInstallDestination (obj) {
var APP_MAIN_PREFIX = 'app/src/main';
if (obj.targetDir.startsWith('app')) {
// If any source file is using the new app directory structure,
// don't penalize it
return path.join(obj.targetDir, path.basename(obj.src));
} else if (obj.src.endsWith('.java')) {
return path.join(APP_MAIN_PREFIX, 'java', obj.targetDir.substring(4), path.basename(obj.src));
} else if (obj.src.endsWith('.aidl')) {
return path.join(APP_MAIN_PREFIX, 'aidl', obj.targetDir.substring(4), path.basename(obj.src));
} else if (obj.targetDir.includes('libs')) {
if (obj.src.endsWith('.so')) {
return path.join(APP_MAIN_PREFIX, 'jniLibs', obj.targetDir.substring(5), path.basename(obj.src));
} else {
return path.join('app', obj.targetDir, path.basename(obj.src));
}
} else if (obj.targetDir.includes('src/main')) {
return path.join('app', obj.targetDir, path.basename(obj.src));
} else {
// For all other source files not using the new app directory structure,
// add 'app/src/main' to the targetDir
return path.join(APP_MAIN_PREFIX, 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 = "7.1.0-dev";
var VERSION = "7.1.5-dev";
module.exports.version = VERSION;

View File

@ -22,10 +22,10 @@ apply plugin: 'com.android.application'
buildscript {
repositories {
mavenCentral()
jcenter()
maven {
url "https://maven.google.com"
}
jcenter()
}
dependencies {
@ -69,7 +69,7 @@ ext {
if (!project.hasProperty('cdvBuildMultipleApks')) {
cdvBuildMultipleApks = null
}
// Whether to append a 0 "abi digit" to versionCode when only a single APK is build
// Whether to append a 0 "abi digit" to versionCode when only a single APK is build
if (!project.hasProperty('cdvVersionCodeForceAbiDigit')) {
cdvVersionCodeForceAbiDigit = null
}
@ -93,11 +93,16 @@ ext {
// PLUGIN GRADLE EXTENSIONS START
// PLUGIN GRADLE EXTENSIONS END
def hasBuildExtras = file('build-extras.gradle').exists()
if (hasBuildExtras) {
def hasBuildExtras1 = file('build-extras.gradle').exists()
if (hasBuildExtras1) {
apply from: 'build-extras.gradle'
}
def hasBuildExtras2 = file('../build-extras.gradle').exists()
if (hasBuildExtras2) {
apply from: '../build-extras.gradle'
}
// Set property defaults after extension .gradle files.
if (ext.cdvCompileSdkVersion == null) {
ext.cdvCompileSdkVersion = privateHelpers.getProjectTarget()
@ -117,7 +122,7 @@ if (ext.cdvReleaseSigningPropertiesFile == null && file('../release-signing.prop
// Cast to appropriate types.
ext.cdvBuildMultipleApks = cdvBuildMultipleApks == null ? false : cdvBuildMultipleApks.toBoolean();
ext.cdvVersionCodeForceAbiDigit = cdvVersionCodeForceAbiDigit == null ? false : cdvVersionCodeForceAbiDigit.toBoolean();
ext.cdvMinSdkVersion = cdvMinSdkVersion == null ? null : defaultMinSdkVersion
ext.cdvMinSdkVersion = cdvMinSdkVersion == null ? defaultMinSdkVersion : Integer.parseInt('' + cdvMinSdkVersion)
ext.cdvVersionCode = cdvVersionCode == null ? null : Integer.parseInt('' + cdvVersionCode)
def computeBuildTargetName(debugBuild) {
@ -174,10 +179,11 @@ android {
compileSdkVersion cdvCompileSdkVersion
buildToolsVersion cdvBuildToolsVersion
//This code exists for Crosswalk and other Native APIs.
//By default, we multiply the existing version code in the Android Manifest by 10 and
//add a number for each architecture. If you are not using Crosswalk or SQLite, you can
//ignore this chunk of code, and your version codes will be respected.
// This code exists for Crosswalk and other Native APIs.
// By default, we multiply the existing version code in the
// Android Manifest by 10 and add a number for each architecture.
// If you are not using Crosswalk or SQLite, you can
// ignore this chunk of code, and your version codes will be respected.
if (Boolean.valueOf(cdvBuildMultipleApks)) {
flavorDimensions "default"

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 = '7.1.0-dev';
var PLATFORM_VERSION_BUILD_LABEL = '7.1.5-dev';
// 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,10 +20,10 @@
buildscript {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
jcenter()
}
dependencies {
@ -35,10 +35,10 @@ buildscript {
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
jcenter()
}
//This replaces project.properties w.r.t. build settings
project.ext {

View File

@ -109,17 +109,6 @@ function androidExec(success, fail, service, action, args) {
}
androidExec.init = function() {
//CB-11828
//This failsafe checks the version of Android and if it's Jellybean, it switches it to
//using the Online Event bridge for communicating from Native to JS
//
//It's ugly, but it's necessary.
var check = navigator.userAgent.toLowerCase().match(/android\s[0-9].[0-9]/);
var version_code = check && check[0].match(/4.[0-3].*/);
if (version_code != null && nativeToJsBridgeMode == nativeToJsModes.EVAL_BRIDGE) {
nativeToJsBridgeMode = nativeToJsModes.ONLINE_EVENT;
}
bridgeSecret = +prompt('', 'gap_init:' + nativeToJsBridgeMode);
channel.onNativeReady.fire();
};

View File

@ -24,10 +24,10 @@ ext {
buildscript {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
jcenter()
}
dependencies {
@ -42,7 +42,7 @@ apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'
group = 'org.apache.cordova'
version = '7.1.0-dev'
version = '7.1.5-dev'
android {
compileSdkVersion cdvCompileSdkVersion
@ -129,9 +129,9 @@ bintray {
licenses = ['Apache-2.0']
labels = ['android', 'cordova', 'phonegap']
version {
name = '7.1.0-dev'
name = '7.1.5-dev'
released = new Date()
vcsTag = '7.1.0-dev'
vcsTag = '7.1.5-dev'
}
}
}

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 = "7.1.0-dev";
public static final String CORDOVA_VERSION = "7.1.5-dev";
void init(CordovaInterface cordova, List<PluginEntry> pluginEntries, CordovaPreferences preferences);

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/steveng/repo/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/steveng/repo/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

@ -1,4 +1,5 @@
{
"esversion": 6,
"indent": 2,
"forin": true,
"noarg": true,

View File

@ -30,35 +30,42 @@
*/
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.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" }
BASE: { api: 1, ndk: 0, semver: "1.0", name: "(no code name)", },
BASE_1_1: { api: 2, ndk: 0, semver: "1.1", name: "(no code name)", },
CUPCAKE: { api: 3, ndk: 1, semver: "1.5", name: "Cupcake", },
DONUT: { api: 4, ndk: 2, semver: "1.6", name: "Donut", },
ECLAIR: { api: 5, ndk: 2, semver: "2.0", name: "Eclair", },
ECLAIR_0_1: { api: 6, ndk: 2, semver: "2.0.1", name: "Eclair", },
ECLAIR_MR1: { api: 7, ndk: 3, semver: "2.1", name: "Eclair", },
FROYO: { api: 8, ndk: 4, semver: "2.2.x", name: "Froyo", },
GINGERBREAD: { api: 9, ndk: 5, semver: "2.3.0 - 2.3.2", name: "Gingerbread", },
GINGERBREAD_MR1: { api: 10, ndk: 5, semver: "2.3.3 - 2.3.7", name: "Gingerbread", },
HONEYCOMB: { api: 11, ndk: 5, semver: "3.0", name: "Honeycomb", },
HONEYCOMB_MR1: { api: 12, ndk: 6, semver: "3.1", name: "Honeycomb", },
HONEYCOMB_MR2: { api: 13, ndk: 6, semver: "3.2.x", name: "Honeycomb", },
ICE_CREAM_SANDWICH: { api: 14, ndk: 7, semver: "4.0.1 - 4.0.2", name: "Ice Cream Sandwich", },
ICE_CREAM_SANDWICH_MR1: { api: 15, ndk: 8, semver: "4.0.3 - 4.0.4", name: "Ice Cream Sandwich", },
JELLY_BEAN: { api: 16, ndk: 8, semver: "4.1.x", name: "Jellybean", },
JELLY_BEAN_MR1: { api: 17, ndk: 8, semver: "4.2.x", name: "Jellybean", },
JELLY_BEAN_MR2: { api: 18, ndk: 8, semver: "4.3.x", name: "Jellybean", },
KITKAT: { api: 19, ndk: 8, semver: "4.4.0 - 4.4.4", name: "KitKat", },
KITKAT_WATCH: { api: 20, ndk: 8, semver: "4.4", name: "KitKat Watch", },
LOLLIPOP: { api: 21, ndk: 8, semver: "5.0", name: "Lollipop", },
LOLLIPOP_MR1: { api: 22, ndk: 8, semver: "5.1", name: "Lollipop", },
M: { api: 23, ndk: 8, semver: "6.0", name: "Marshmallow", },
N: { api: 24, ndk: 8, semver: "7.0", name: "Nougat", },
N_MR1: { api: 25, ndk: 8, semver: "7.1", name: "Nougat", },
O: { api: 26, ndk: 8, semver: "8.0.0", name: "Oreo", },
O_MR1: { api: 27, ndk: 8, semver: "8.1.0", name: "Oreo", },
P: { api: 28, ndk: 8, semver: "9", name: "Pie", }
}
// Add a key to each version of Android for the "versionCode".
// This is the same key we use in the VERSIONS map above.
Object.keys(VERSIONS).forEach(function(version) {
VERSIONS[version].versionCode = version
})
var semver = require('semver');
// semver format requires <major>.<minor>.<patch> but we allow just <major>.<minor> format.
@ -82,8 +89,8 @@ function getFromDefaultPredicate(arg) {
return true
}
let argSemver = formatSemver(arg);
let versionSemver = formatSemver(version.semver);
var argSemver = formatSemver(arg)
var versionSemver = formatSemver(version.semver)
if (semver.valid(argSemver) && semver.satisfies(argSemver, versionSemver)) {
return true

View File

@ -1,71 +1,44 @@
{
"_args": [
[
{
"raw": "android-versions@^1.3.0",
"scope": null,
"escapedName": "android-versions",
"name": "android-versions",
"rawSpec": "^1.3.0",
"spec": ">=1.3.0 <2.0.0",
"type": "range"
},
"/Users/steveng/repo/cordova/cordova-android"
]
],
"_from": "android-versions@>=1.3.0 <2.0.0",
"_id": "android-versions@1.3.0",
"_inCache": true,
"_from": "android-versions@1",
"_id": "android-versions@1.4.0",
"_inBundle": false,
"_integrity": "sha512-GnomfYsBq+nZh3c3UH/4r9Jt6FuTxdhUJbeHIdYOH5xBhQ8I0ZzC2/RM5IFFIjrzuNWSHb8JWP1lPK0/a26jrg==",
"_location": "/android-versions",
"_nodeVersion": "8.9.1",
"_npmOperationalInternal": {
"host": "s3://npm-registry-packages",
"tmp": "tmp/android-versions-1.3.0.tgz_1516678569554_0.20621655881404877"
},
"_npmUser": {
"name": "dvoiss",
"email": "davidvoiss@gmail.com"
},
"_npmVersion": "5.5.1",
"_phantomChildren": {},
"_requested": {
"raw": "android-versions@^1.3.0",
"scope": null,
"escapedName": "android-versions",
"type": "range",
"registry": true,
"raw": "android-versions@1",
"name": "android-versions",
"rawSpec": "^1.3.0",
"spec": ">=1.3.0 <2.0.0",
"type": "range"
"escapedName": "android-versions",
"rawSpec": "1",
"saveSpec": null,
"fetchSpec": "1"
},
"_requiredBy": [
"#USER",
"/"
],
"_resolved": "https://registry.npmjs.org/android-versions/-/android-versions-1.3.0.tgz",
"_shasum": "ce6f3eae2e165ce4ed49b89beb68014741093044",
"_shrinkwrap": null,
"_spec": "android-versions@^1.3.0",
"_where": "/Users/steveng/repo/cordova/cordova-android",
"_resolved": "https://registry.npmjs.org/android-versions/-/android-versions-1.4.0.tgz",
"_shasum": "807ea2941d7e5780e6dd61c5d9b7b6f3c0706e09",
"_spec": "android-versions@1",
"_where": "/Users/brodybits/Documents/cordova/cordova-android",
"author": {
"name": "dvoiss"
},
"bugs": {
"url": "https://github.com/dvoiss/android-versions/issues"
},
"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": {
"jshint": "^2.9.2",
"tape": "^4.6.0"
},
"directories": {},
"dist": {
"integrity": "sha512-d/i1G16Oaw/T1EvskUA7Oo1vIQVK/0ZlpQgZfYVBwg6v/9FBE3QV66g5N1/bTHpRml8tFLxh+KoTw5DokK9c+A==",
"shasum": "ce6f3eae2e165ce4ed49b89beb68014741093044",
"tarball": "https://registry.npmjs.org/android-versions/-/android-versions-1.3.0.tgz"
},
"gitHead": "f9772c197a75709df703a2cf339b4427032b08d3",
"homepage": "https://github.com/dvoiss/android-versions#readme",
"keywords": [
"android",
@ -79,18 +52,10 @@
],
"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"
@ -99,5 +64,5 @@
"jshint": "jshint .",
"test": "tape tests/**/*.js"
},
"version": "1.3.0"
"version": "1.4.0"
}

View File

@ -1,7 +1,7 @@
"use strict";
var test = require('tape')
var android = require('..')
const test = require('tape')
const android = require('..')
test('get specific version by API level', (t) => {
t.plan(1)
@ -16,7 +16,7 @@ test('getAll versions by API level', (t) => {
test('get specific version by predicate', (t) => {
t.plan(2)
var actual = android.get((version) => {
let actual = android.get((version) => {
return version.name.indexOf("on") !== -1
})
t.equal(actual.name, "Donut")
@ -30,7 +30,7 @@ test('get specific version by predicate', (t) => {
test('getAll versions by predicate', (t) => {
t.plan(3)
var actual = android.getAll((version) => {
let actual = android.getAll((version) => {
return version.name.indexOf("on") !== -1
}).map((version) => version.name)
t.deepEqual(actual, ["Donut", "Honeycomb", "Honeycomb", "Honeycomb"])
@ -43,7 +43,7 @@ test('getAll versions by predicate', (t) => {
actual = android.getAll((version) => {
return version.api > 22
}).map((version) => version.versionCode)
t.deepEqual(actual, ["M", "N", "N_MR1", "O", "O_MR1"])
t.deepEqual(actual, ["M", "N", "N_MR1", "O", "O_MR1", "P"])
})
test('get version by semantic version', (t) => {
@ -54,32 +54,31 @@ test('get version by semantic version', (t) => {
t.equal(android.get("2.3.3").versionCode, android.GINGERBREAD_MR1.versionCode)
})
test('support major version only', (t) => {
t.plan(2)
t.equal(android.get("9.0").versionCode, android.P.versionCode)
t.equal(android.get("9.0.0").versionCode, android.P.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);
t.plan(7)
let tests = [ "4.4", "4.4.0", "4.4.1", "4.4.2", "4.4.3", "4.4.4" ]
tests.forEach((versionCode) => {
t.equal(android.get(versionCode).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);
});
t.plan(12)
let tests = [
"4.1", "4.1.0", "4.1.1", "4.1.2", "4.1.3", "4.1.4",
"4.1.5", "4.1.6", "4.1.7", "4.1.8", "4.1.9", "4.1.10"
]
tests.forEach((versionCode) => {
t.equal(android.get(versionCode).versionCode, android.JELLY_BEAN.versionCode)
})
})
test('access version codes object', (t) => {
t.plan(1)
@ -87,7 +86,7 @@ test('access version codes object', (t) => {
})
test('access specific versions directly', (t) => {
t.plan(27)
t.plan(28)
t.ok(android.BASE)
t.ok(android.BASE_1_1)
t.ok(android.CUPCAKE)
@ -115,4 +114,5 @@ test('access specific versions directly', (t) => {
t.ok(android.N_MR1)
t.ok(android.O)
t.ok(android.O_MR1)
t.ok(android.P)
})

62
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/steveng/repo/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": "http://registry.npmjs.org/ansi/-/ansi-0.3.1.tgz",
"_resolved": "https://registry.npmjs.org/ansi/-/ansi-0.3.1.tgz",
"_shasum": "0c42d4fb17160d5a9af1e484bace1c66922c1b21",
"_shrinkwrap": null,
"_spec": "ansi@^0.3.1",
"_where": "/Users/steveng/repo/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/steveng/repo/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/steveng/repo/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/steveng/repo/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/steveng/repo/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/steveng/repo/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/steveng/repo/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/steveng/repo/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": "http://registry.npmjs.org/bplist-parser/-/bplist-parser-0.1.1.tgz",
"_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/steveng/repo/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,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/steveng/repo/cordova/cordova-android/node_modules/minimatch"
]
],
"_from": "brace-expansion@>=1.1.7 <2.0.0",
"_from": "brace-expansion@^1.1.7",
"_id": "brace-expansion@1.1.11",
"_inCache": true,
"_inBundle": false,
"_integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
"_location": "/brace-expansion",
"_nodeVersion": "9.0.0",
"_npmOperationalInternal": {
"host": "s3://npm-registry-packages",
"tmp": "tmp/brace-expansion_1.1.11_1518248541320_0.33962849281003904"
},
"_npmUser": {
"name": "juliangruber",
"email": "julian@juliangruber.com"
},
"_npmVersion": "5.5.1",
"_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.11.tgz",
"_shasum": "3c7fcbf529d87226f3d2f52b966ff5271eb441dd",
"_shrinkwrap": null,
"_spec": "brace-expansion@^1.1.7",
"_where": "/Users/steveng/repo/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,41 +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": {
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
"shasum": "3c7fcbf529d87226f3d2f52b966ff5271eb441dd",
"tarball": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
"fileCount": 4,
"unpackedSize": 11059
},
"gitHead": "01a21de7441549d26ac0c0a9ff91385d16e5c21c",
"homepage": "https://github.com/juliangruber/brace-expansion",
"keywords": [],
"license": "MIT",
"main": "index.js",
"maintainers": [
{
"name": "isaacs",
"email": "isaacs@npmjs.com"
},
{
"name": "juliangruber",
"email": "julian@juliangruber.com"
}
],
"name": "brace-expansion",
"optionalDependencies": {},
"readme": "ERROR: No README data found!",
"repository": {
"type": "git",
"url": "git://github.com/juliangruber/brace-expansion.git"

53
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/steveng/repo/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": "http://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
"_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/steveng/repo/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"
]
}

2
node_modules/cordova-common/.npmignore generated vendored Normal file
View File

@ -0,0 +1,2 @@
spec
coverage

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,29 @@
-->
# 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

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/steveng/repo/cordova/cordova-android"
]
],
"_from": "cordova-common@>=2.2.0 <3.0.0",
"_id": "cordova-common@2.2.1",
"_inCache": true,
"_from": "cordova-common@2.2.5",
"_id": "cordova-common@2.2.5",
"_inBundle": false,
"_integrity": "sha1-+TzvKtSUz8v1bEbj1hKqqctfzDI=",
"_location": "/cordova-common",
"_nodeVersion": "8.9.3",
"_npmOperationalInternal": {
"host": "s3://npm-registry-packages",
"tmp": "tmp/cordova-common-2.2.1.tgz_1513711030961_0.7797101123724133"
},
"_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": "file:cordova-dist/tools/cordova-common-2.2.1.tgz",
"_shasum": "7009bc591729caa7285a588cfd6a7b54cd834f0c",
"_shrinkwrap": null,
"_spec": "cordova-common@^2.2.0",
"_where": "/Users/steveng/repo/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": "7009bc591729caa7285a588cfd6a7b54cd834f0c",
"tarball": "https://registry.npmjs.org/cordova-common/-/cordova-common-2.2.1.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.1"
"version": "2.2.5"
}

View File

@ -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');
}
}
}

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

@ -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/steveng/repo/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": "http://registry.npmjs.org/cordova-registry-mapper/-/cordova-registry-mapper-1.1.15.tgz",
"_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/steveng/repo/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,52 +1,35 @@
{
"_args": [
[
{
"raw": "elementtree@0.1.6",
"scope": null,
"escapedName": "elementtree",
"name": "elementtree",
"rawSpec": "0.1.6",
"spec": "0.1.6",
"type": "version"
},
"/Users/steveng/repo/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": [
"/",
"/cordova-common"
],
"_resolved": "http://registry.npmjs.org/elementtree/-/elementtree-0.1.6.tgz",
"_resolved": "https://registry.npmjs.org/elementtree/-/elementtree-0.1.6.tgz",
"_shasum": "2ac4c46ea30516c8c4cbdb5e3ac7418e592de20c",
"_shrinkwrap": null,
"_spec": "elementtree@0.1.6",
"_where": "/Users/steveng/repo/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"

58
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/steveng/repo/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": "http://registry.npmjs.org/glob/-/glob-5.0.15.tgz",
"_resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz",
"_shasum": "1bc936b9e02f4a603fcc222ecf7633d30b8b93b1",
"_shrinkwrap": null,
"_spec": "glob@^5.0.13",
"_where": "/Users/steveng/repo/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"

77
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/steveng/repo/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": "http://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
"_resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
"_shasum": "49bd6331d7d02d0c09bc910a1075ba8165b56df9",
"_shrinkwrap": null,
"_spec": "inflight@^1.0.4",
"_where": "/Users/steveng/repo/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"

68
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/steveng/repo/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": "http://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
"_resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
"_shasum": "633c2c83e3da42a502f52466022480f4208261de",
"_shrinkwrap": null,
"_spec": "inherits@2",
"_where": "/Users/steveng/repo/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;

19
node_modules/lodash/array/last.js generated vendored
View File

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

View File

@ -1,60 +0,0 @@
var binaryIndex = require('../internal/binaryIndex'),
indexOfNaN = require('../internal/indexOfNaN');
/* Native method references for those with the same name as other `lodash` methods. */
var nativeMax = Math.max,
nativeMin = Math.min;
/**
* This method is like `_.indexOf` except that it iterates over elements of
* `array` from right to left.
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array to search.
* @param {*} value The value to search for.
* @param {boolean|number} [fromIndex=array.length-1] 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
*
* _.lastIndexOf([1, 2, 1, 2], 2);
* // => 3
*
* // using `fromIndex`
* _.lastIndexOf([1, 2, 1, 2], 2, 2);
* // => 1
*
* // performing a binary search
* _.lastIndexOf([1, 1, 2, 2], 2, true);
* // => 3
*/
function lastIndexOf(array, value, fromIndex) {
var length = array ? array.length : 0;
if (!length) {
return -1;
}
var index = length;
if (typeof fromIndex == 'number') {
index = (fromIndex < 0 ? nativeMax(length + fromIndex, 0) : nativeMin(fromIndex || 0, length - 1)) + 1;
} else if (fromIndex) {
index = binaryIndex(array, value, true) - 1;
var other = array[index];
if (value === value ? (value === other) : (other !== other)) {
return index;
}
return -1;
}
if (value !== value) {
return indexOfNaN(array, index, true);
}
while (index--) {
if (array[index] === value) {
return index;
}
}
return -1;
}
module.exports = lastIndexOf;

View File

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

52
node_modules/lodash/array/pull.js generated vendored
View File

@ -1,52 +0,0 @@
var baseIndexOf = require('../internal/baseIndexOf');
/** Used for native method references. */
var arrayProto = Array.prototype;
/** Native method references. */
var splice = arrayProto.splice;
/**
* Removes all provided values from `array` using
* [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
* for equality comparisons.
*
* **Note:** Unlike `_.without`, this method mutates `array`.
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array to modify.
* @param {...*} [values] The values to remove.
* @returns {Array} Returns `array`.
* @example
*
* var array = [1, 2, 3, 1, 2, 3];
*
* _.pull(array, 2, 3);
* console.log(array);
* // => [1, 1]
*/
function pull() {
var args = arguments,
array = args[0];
if (!(array && array.length)) {
return array;
}
var index = 0,
indexOf = baseIndexOf,
length = args.length;
while (++index < length) {
var fromIndex = 0,
value = args[index];
while ((fromIndex = indexOf(array, value, fromIndex)) > -1) {
splice.call(array, fromIndex, 1);
}
}
return array;
}
module.exports = pull;

40
node_modules/lodash/array/pullAt.js generated vendored
View File

@ -1,40 +0,0 @@
var baseAt = require('../internal/baseAt'),
baseCompareAscending = require('../internal/baseCompareAscending'),
baseFlatten = require('../internal/baseFlatten'),
basePullAt = require('../internal/basePullAt'),
restParam = require('../function/restParam');
/**
* Removes elements from `array` corresponding to the given indexes and returns
* an array of the removed elements. Indexes may be specified as an array of
* indexes or as individual arguments.
*
* **Note:** Unlike `_.at`, this method mutates `array`.
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array to modify.
* @param {...(number|number[])} [indexes] The indexes of elements to remove,
* specified as individual indexes or arrays of indexes.
* @returns {Array} Returns the new array of removed elements.
* @example
*
* var array = [5, 10, 15, 20];
* var evens = _.pullAt(array, 1, 3);
*
* console.log(array);
* // => [5, 15]
*
* console.log(evens);
* // => [10, 20]
*/
var pullAt = restParam(function(array, indexes) {
indexes = baseFlatten(indexes);
var result = baseAt(array, indexes);
basePullAt(array, indexes.sort(baseCompareAscending));
return result;
});
module.exports = pullAt;

64
node_modules/lodash/array/remove.js generated vendored
View File

@ -1,64 +0,0 @@
var baseCallback = require('../internal/baseCallback'),
basePullAt = require('../internal/basePullAt');
/**
* Removes all elements from `array` that `predicate` returns truthy for
* and returns an array of the removed elements. 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`.
*
* **Note:** Unlike `_.filter`, this method mutates `array`.
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array to modify.
* @param {Function|Object|string} [predicate=_.identity] The function invoked
* per iteration.
* @param {*} [thisArg] The `this` binding of `predicate`.
* @returns {Array} Returns the new array of removed elements.
* @example
*
* var array = [1, 2, 3, 4];
* var evens = _.remove(array, function(n) {
* return n % 2 == 0;
* });
*
* console.log(array);
* // => [1, 3]
*
* console.log(evens);
* // => [2, 4]
*/
function remove(array, predicate, thisArg) {
var result = [];
if (!(array && array.length)) {
return result;
}
var index = -1,
indexes = [],
length = array.length;
predicate = baseCallback(predicate, thisArg, 3);
while (++index < length) {
var value = array[index];
if (predicate(value, index, array)) {
result.push(value);
indexes.push(index);
}
}
basePullAt(array, indexes);
return result;
}
module.exports = remove;

21
node_modules/lodash/array/rest.js generated vendored
View File

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

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

@ -1,30 +0,0 @@
var baseSlice = require('../internal/baseSlice'),
isIterateeCall = require('../internal/isIterateeCall');
/**
* Creates a slice of `array` from `start` up to, but not including, `end`.
*
* **Note:** This method is used instead of `Array#slice` to support node
* lists in IE < 9 and to ensure dense arrays are returned.
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array to slice.
* @param {number} [start=0] The start position.
* @param {number} [end=array.length] The end position.
* @returns {Array} Returns the slice of `array`.
*/
function slice(array, start, end) {
var length = array ? array.length : 0;
if (!length) {
return [];
}
if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
start = 0;
end = length;
}
return baseSlice(array, start, end);
}
module.exports = slice;

View File

@ -1,53 +0,0 @@
var createSortedIndex = require('../internal/createSortedIndex');
/**
* Uses a binary search to determine the lowest index at which `value` should
* be inserted into `array` in order to maintain its sort order. If an iteratee
* function is provided it's invoked for `value` and each element of `array`
* to compute their sort ranking. The iteratee is bound to `thisArg` and
* invoked with one argument; (value).
*
* If a property name is provided for `iteratee` 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 `iteratee` 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 sorted array to inspect.
* @param {*} value The value to evaluate.
* @param {Function|Object|string} [iteratee=_.identity] The function invoked
* per iteration.
* @param {*} [thisArg] The `this` binding of `iteratee`.
* @returns {number} Returns the index at which `value` should be inserted
* into `array`.
* @example
*
* _.sortedIndex([30, 50], 40);
* // => 1
*
* _.sortedIndex([4, 4, 5, 5], 5);
* // => 2
*
* var dict = { 'data': { 'thirty': 30, 'forty': 40, 'fifty': 50 } };
*
* // using an iteratee function
* _.sortedIndex(['thirty', 'fifty'], 'forty', function(word) {
* return this.data[word];
* }, dict);
* // => 1
*
* // using the `_.property` callback shorthand
* _.sortedIndex([{ 'x': 30 }, { 'x': 50 }], { 'x': 40 }, 'x');
* // => 1
*/
var sortedIndex = createSortedIndex();
module.exports = sortedIndex;

View File

@ -1,25 +0,0 @@
var createSortedIndex = require('../internal/createSortedIndex');
/**
* This method is like `_.sortedIndex` except that it returns the highest
* index at which `value` should be inserted into `array` in order to
* maintain its sort order.
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The sorted array to inspect.
* @param {*} value The value to evaluate.
* @param {Function|Object|string} [iteratee=_.identity] The function invoked
* per iteration.
* @param {*} [thisArg] The `this` binding of `iteratee`.
* @returns {number} Returns the index at which `value` should be inserted
* into `array`.
* @example
*
* _.sortedLastIndex([4, 4, 5, 5], 5);
* // => 4
*/
var sortedLastIndex = createSortedIndex(true);
module.exports = sortedLastIndex;

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