getPluginEntries() {
- return pluginEntries;
- }
-
- public String getLaunchUrl() {
- return launchUrl;
- }
-
- public void parse(Context action) {
- // First checking the class namespace for config.xml
- int id = action.getResources().getIdentifier("config", "xml", action.getClass().getPackage().getName());
- if (id == 0) {
- // If we couldn't find config.xml there, we'll look in the namespace from AndroidManifest.xml
- id = action.getResources().getIdentifier("config", "xml", action.getPackageName());
- if (id == 0) {
- LOG.e(TAG, "res/xml/config.xml is missing!");
- return;
- }
- }
- parse(action.getResources().getXml(id));
- }
-
- boolean insideFeature = false;
- String service = "", pluginClass = "", paramType = "";
- boolean onload = false;
-
- public void parse(XmlPullParser xml) {
- int eventType = -1;
-
- while (eventType != XmlPullParser.END_DOCUMENT) {
- if (eventType == XmlPullParser.START_TAG) {
- handleStartTag(xml);
- }
- else if (eventType == XmlPullParser.END_TAG)
- {
- handleEndTag(xml);
- }
- try {
- eventType = xml.next();
- } catch (XmlPullParserException e) {
- e.printStackTrace();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- }
-
- public void handleStartTag(XmlPullParser xml) {
- String strNode = xml.getName();
- if (strNode.equals("feature")) {
- //Check for supported feature sets aka. plugins (Accelerometer, Geolocation, etc)
- //Set the bit for reading params
- insideFeature = true;
- service = xml.getAttributeValue(null, "name");
- }
- else if (insideFeature && strNode.equals("param")) {
- paramType = xml.getAttributeValue(null, "name");
- if (paramType.equals("service")) // check if it is using the older service param
- service = xml.getAttributeValue(null, "value");
- else if (paramType.equals("package") || paramType.equals("android-package"))
- pluginClass = xml.getAttributeValue(null,"value");
- else if (paramType.equals("onload"))
- onload = "true".equals(xml.getAttributeValue(null, "value"));
- }
- else if (strNode.equals("preference")) {
- String name = xml.getAttributeValue(null, "name").toLowerCase(Locale.ENGLISH);
- String value = xml.getAttributeValue(null, "value");
- prefs.set(name, value);
- }
- else if (strNode.equals("content")) {
- String src = xml.getAttributeValue(null, "src");
- if (src != null) {
- setStartUrl(src);
- }
- }
- }
-
- public void handleEndTag(XmlPullParser xml) {
- String strNode = xml.getName();
- if (strNode.equals("feature")) {
- pluginEntries.add(new PluginEntry(service, pluginClass, onload));
-
- service = "";
- pluginClass = "";
- insideFeature = false;
- onload = false;
- }
- }
-
- private void setStartUrl(String src) {
- Pattern schemeRegex = Pattern.compile("^[a-z-]+://");
- Matcher matcher = schemeRegex.matcher(src);
- if (matcher.find()) {
- launchUrl = src;
- } else {
- if (src.charAt(0) == '/') {
- src = src.substring(1);
- }
- launchUrl = "file:///android_asset/www/" + src;
- }
- }
-}
diff --git a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/CordovaActivity.java b/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/CordovaActivity.java
deleted file mode 100644
index 85eeb53..0000000
--- a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/CordovaActivity.java
+++ /dev/null
@@ -1,518 +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.
-*/
-package org.apache.cordova;
-
-import java.util.ArrayList;
-import java.util.Locale;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import android.app.Activity;
-import android.app.AlertDialog;
-import android.annotation.SuppressLint;
-import android.content.DialogInterface;
-import android.content.Intent;
-import android.content.res.Configuration;
-import android.graphics.Color;
-import android.media.AudioManager;
-import android.os.Build;
-import android.os.Bundle;
-import android.view.Menu;
-import android.view.MenuItem;
-import android.view.View;
-import android.view.ViewGroup;
-import android.view.Window;
-import android.view.WindowManager;
-import android.webkit.WebViewClient;
-import android.widget.FrameLayout;
-
-/**
- * This class is the main Android activity that represents the Cordova
- * application. It should be extended by the user to load the specific
- * html file that contains the application.
- *
- * As an example:
- *
- *
- * package org.apache.cordova.examples;
- *
- * import android.os.Bundle;
- * import org.apache.cordova.*;
- *
- * public class Example extends CordovaActivity {
- * @Override
- * public void onCreate(Bundle savedInstanceState) {
- * super.onCreate(savedInstanceState);
- * super.init();
- * // Load your application
- * loadUrl(launchUrl);
- * }
- * }
- *
- *
- * Cordova xml configuration: Cordova uses a configuration file at
- * res/xml/config.xml to specify its settings. See "The config.xml File"
- * guide in cordova-docs at http://cordova.apache.org/docs for the documentation
- * for the configuration. The use of the set*Property() methods is
- * deprecated in favor of the config.xml file.
- *
- */
-public class CordovaActivity extends Activity {
- public static String TAG = "CordovaActivity";
-
- // The webview for our app
- protected CordovaWebView appView;
-
- private static int ACTIVITY_STARTING = 0;
- private static int ACTIVITY_RUNNING = 1;
- private static int ACTIVITY_EXITING = 2;
-
- // Keep app running when pause is received. (default = true)
- // If true, then the JavaScript and native code continue to run in the background
- // when another application (activity) is started.
- protected boolean keepRunning = true;
-
- // Flag to keep immersive mode if set to fullscreen
- protected boolean immersiveMode;
-
- // Read from config.xml:
- protected CordovaPreferences preferences;
- protected String launchUrl;
- protected ArrayList pluginEntries;
- protected CordovaInterfaceImpl cordovaInterface;
-
- /**
- * Called when the activity is first created.
- */
- @Override
- public void onCreate(Bundle savedInstanceState) {
- // need to activate preferences before super.onCreate to avoid "requestFeature() must be called before adding content" exception
- loadConfig();
-
- String logLevel = preferences.getString("loglevel", "ERROR");
- LOG.setLogLevel(logLevel);
-
- LOG.i(TAG, "Apache Cordova native platform version " + CordovaWebView.CORDOVA_VERSION + " is starting");
- LOG.d(TAG, "CordovaActivity.onCreate()");
-
- if (!preferences.getBoolean("ShowTitle", false)) {
- getWindow().requestFeature(Window.FEATURE_NO_TITLE);
- }
-
- if (preferences.getBoolean("SetFullscreen", false)) {
- LOG.d(TAG, "The SetFullscreen configuration is deprecated in favor of Fullscreen, and will be removed in a future version.");
- preferences.set("Fullscreen", true);
- }
- if (preferences.getBoolean("Fullscreen", false)) {
- // NOTE: use the FullscreenNotImmersive configuration key to set the activity in a REAL full screen
- // (as was the case in previous cordova versions)
- if ((Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) && !preferences.getBoolean("FullscreenNotImmersive", false)) {
- immersiveMode = true;
- } else {
- getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
- WindowManager.LayoutParams.FLAG_FULLSCREEN);
- }
- } else {
- getWindow().setFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN,
- WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
- }
-
- super.onCreate(savedInstanceState);
-
- cordovaInterface = makeCordovaInterface();
- if (savedInstanceState != null) {
- cordovaInterface.restoreInstanceState(savedInstanceState);
- }
- }
-
- protected void init() {
- appView = makeWebView();
- createViews();
- if (!appView.isInitialized()) {
- appView.init(cordovaInterface, pluginEntries, preferences);
- }
- cordovaInterface.onCordovaInit(appView.getPluginManager());
-
- // Wire the hardware volume controls to control media if desired.
- String volumePref = preferences.getString("DefaultVolumeStream", "");
- if ("media".equals(volumePref.toLowerCase(Locale.ENGLISH))) {
- setVolumeControlStream(AudioManager.STREAM_MUSIC);
- }
- }
-
- @SuppressWarnings("deprecation")
- protected void loadConfig() {
- ConfigXmlParser parser = new ConfigXmlParser();
- parser.parse(this);
- preferences = parser.getPreferences();
- preferences.setPreferencesBundle(getIntent().getExtras());
- launchUrl = parser.getLaunchUrl();
- pluginEntries = parser.getPluginEntries();
- Config.parser = parser;
- }
-
- //Suppressing warnings in AndroidStudio
- @SuppressWarnings({"deprecation", "ResourceType"})
- protected void createViews() {
- //Why are we setting a constant as the ID? This should be investigated
- appView.getView().setId(100);
- appView.getView().setLayoutParams(new FrameLayout.LayoutParams(
- ViewGroup.LayoutParams.MATCH_PARENT,
- ViewGroup.LayoutParams.MATCH_PARENT));
-
- setContentView(appView.getView());
-
- if (preferences.contains("BackgroundColor")) {
- try {
- int backgroundColor = preferences.getInteger("BackgroundColor", Color.BLACK);
- // Background of activity:
- appView.getView().setBackgroundColor(backgroundColor);
- }
- catch (NumberFormatException e){
- e.printStackTrace();
- }
- }
-
- appView.getView().requestFocusFromTouch();
- }
-
- /**
- * Construct the default web view object.
- *
- * Override this to customize the webview that is used.
- */
- protected CordovaWebView makeWebView() {
- return new CordovaWebViewImpl(makeWebViewEngine());
- }
-
- protected CordovaWebViewEngine makeWebViewEngine() {
- return CordovaWebViewImpl.createEngine(this, preferences);
- }
-
- protected CordovaInterfaceImpl makeCordovaInterface() {
- return new CordovaInterfaceImpl(this) {
- @Override
- public Object onMessage(String id, Object data) {
- // Plumb this to CordovaActivity.onMessage for backwards compatibility
- return CordovaActivity.this.onMessage(id, data);
- }
- };
- }
-
- /**
- * Load the url into the webview.
- */
- public void loadUrl(String url) {
- if (appView == null) {
- init();
- }
-
- // If keepRunning
- this.keepRunning = preferences.getBoolean("KeepRunning", true);
-
- appView.loadUrlIntoView(url, true);
- }
-
- /**
- * Called when the system is about to start resuming a previous activity.
- */
- @Override
- protected void onPause() {
- super.onPause();
- LOG.d(TAG, "Paused the activity.");
-
- if (this.appView != null) {
- // CB-9382 If there is an activity that started for result and main activity is waiting for callback
- // result, we shoudn't stop WebView Javascript timers, as activity for result might be using them
- boolean keepRunning = this.keepRunning || this.cordovaInterface.activityResultCallback != null;
- this.appView.handlePause(keepRunning);
- }
- }
-
- /**
- * Called when the activity receives a new intent
- */
- @Override
- protected void onNewIntent(Intent intent) {
- super.onNewIntent(intent);
- //Forward to plugins
- if (this.appView != null)
- this.appView.onNewIntent(intent);
- }
-
- /**
- * Called when the activity will start interacting with the user.
- */
- @Override
- protected void onResume() {
- super.onResume();
- LOG.d(TAG, "Resumed the activity.");
-
- if (this.appView == null) {
- return;
- }
- // Force window to have focus, so application always
- // receive user input. Workaround for some devices (Samsung Galaxy Note 3 at least)
- this.getWindow().getDecorView().requestFocus();
-
- this.appView.handleResume(this.keepRunning);
- }
-
- /**
- * Called when the activity is no longer visible to the user.
- */
- @Override
- protected void onStop() {
- super.onStop();
- LOG.d(TAG, "Stopped the activity.");
-
- if (this.appView == null) {
- return;
- }
- this.appView.handleStop();
- }
-
- /**
- * Called when the activity is becoming visible to the user.
- */
- @Override
- protected void onStart() {
- super.onStart();
- LOG.d(TAG, "Started the activity.");
-
- if (this.appView == null) {
- return;
- }
- this.appView.handleStart();
- }
-
- /**
- * The final call you receive before your activity is destroyed.
- */
- @Override
- public void onDestroy() {
- LOG.d(TAG, "CordovaActivity.onDestroy()");
- super.onDestroy();
-
- if (this.appView != null) {
- appView.handleDestroy();
- }
- }
-
- /**
- * Called when view focus is changed
- */
- @Override
- public void onWindowFocusChanged(boolean hasFocus) {
- super.onWindowFocusChanged(hasFocus);
- if (hasFocus && immersiveMode) {
- final int uiOptions = View.SYSTEM_UI_FLAG_LAYOUT_STABLE
- | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
- | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
- | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
- | View.SYSTEM_UI_FLAG_FULLSCREEN
- | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
-
- getWindow().getDecorView().setSystemUiVisibility(uiOptions);
- }
- }
-
- @SuppressLint("NewApi")
- @Override
- public void startActivityForResult(Intent intent, int requestCode, Bundle options) {
- // Capture requestCode here so that it is captured in the setActivityResultCallback() case.
- cordovaInterface.setActivityResultRequestCode(requestCode);
- super.startActivityForResult(intent, requestCode, options);
- }
-
- /**
- * Called when an activity you launched exits, giving you the requestCode you started it with,
- * the resultCode it returned, and any additional data from it.
- *
- * @param requestCode The request code originally supplied to startActivityForResult(),
- * allowing you to identify who this result came from.
- * @param resultCode The integer result code returned by the child activity through its setResult().
- * @param intent An Intent, which can return result data to the caller (various data can be attached to Intent "extras").
- */
- @Override
- protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
- LOG.d(TAG, "Incoming Result. Request code = " + requestCode);
- super.onActivityResult(requestCode, resultCode, intent);
- cordovaInterface.onActivityResult(requestCode, resultCode, intent);
- }
-
- /**
- * Report an error to the host application. These errors are unrecoverable (i.e. the main resource is unavailable).
- * The errorCode parameter corresponds to one of the ERROR_* constants.
- *
- * @param errorCode The error code corresponding to an ERROR_* value.
- * @param description A String describing the error.
- * @param failingUrl The url that failed to load.
- */
- public void onReceivedError(final int errorCode, final String description, final String failingUrl) {
- final CordovaActivity me = this;
-
- // If errorUrl specified, then load it
- final String errorUrl = preferences.getString("errorUrl", null);
- if ((errorUrl != null) && (!failingUrl.equals(errorUrl)) && (appView != null)) {
- // Load URL on UI thread
- me.runOnUiThread(new Runnable() {
- public void run() {
- me.appView.showWebPage(errorUrl, false, true, null);
- }
- });
- }
- // If not, then display error dialog
- else {
- final boolean exit = !(errorCode == WebViewClient.ERROR_HOST_LOOKUP);
- me.runOnUiThread(new Runnable() {
- public void run() {
- if (exit) {
- me.appView.getView().setVisibility(View.GONE);
- me.displayError("Application Error", description + " (" + failingUrl + ")", "OK", exit);
- }
- }
- });
- }
- }
-
- /**
- * Display an error dialog and optionally exit application.
- */
- public void displayError(final String title, final String message, final String button, final boolean exit) {
- final CordovaActivity me = this;
- me.runOnUiThread(new Runnable() {
- public void run() {
- try {
- AlertDialog.Builder dlg = new AlertDialog.Builder(me);
- dlg.setMessage(message);
- dlg.setTitle(title);
- dlg.setCancelable(false);
- dlg.setPositiveButton(button,
- new AlertDialog.OnClickListener() {
- public void onClick(DialogInterface dialog, int which) {
- dialog.dismiss();
- if (exit) {
- finish();
- }
- }
- });
- dlg.create();
- dlg.show();
- } catch (Exception e) {
- finish();
- }
- }
- });
- }
-
- /*
- * Hook in Cordova for menu plugins
- */
- @Override
- public boolean onCreateOptionsMenu(Menu menu) {
- if (appView != null) {
- appView.getPluginManager().postMessage("onCreateOptionsMenu", menu);
- }
- return super.onCreateOptionsMenu(menu);
- }
-
- @Override
- public boolean onPrepareOptionsMenu(Menu menu) {
- if (appView != null) {
- appView.getPluginManager().postMessage("onPrepareOptionsMenu", menu);
- }
- return true;
- }
-
- @Override
- public boolean onOptionsItemSelected(MenuItem item) {
- if (appView != null) {
- appView.getPluginManager().postMessage("onOptionsItemSelected", item);
- }
- return true;
- }
-
- /**
- * Called when a message is sent to plugin.
- *
- * @param id The message id
- * @param data The message data
- * @return Object or null
- */
- public Object onMessage(String id, Object data) {
- if ("onReceivedError".equals(id)) {
- JSONObject d = (JSONObject) data;
- try {
- this.onReceivedError(d.getInt("errorCode"), d.getString("description"), d.getString("url"));
- } catch (JSONException e) {
- e.printStackTrace();
- }
- } else if ("exit".equals(id)) {
- finish();
- }
- return null;
- }
-
- protected void onSaveInstanceState(Bundle outState) {
- cordovaInterface.onSaveInstanceState(outState);
- super.onSaveInstanceState(outState);
- }
-
- /**
- * Called by the system when the device configuration changes while your activity is running.
- *
- * @param newConfig The new device configuration
- */
- @Override
- public void onConfigurationChanged(Configuration newConfig) {
- super.onConfigurationChanged(newConfig);
- if (this.appView == null) {
- return;
- }
- PluginManager pm = this.appView.getPluginManager();
- if (pm != null) {
- pm.onConfigurationChanged(newConfig);
- }
- }
-
- /**
- * Called by the system when the user grants permissions
- *
- * @param requestCode
- * @param permissions
- * @param grantResults
- */
- @Override
- public void onRequestPermissionsResult(int requestCode, String permissions[],
- int[] grantResults) {
- try
- {
- cordovaInterface.onRequestPermissionResult(requestCode, permissions, grantResults);
- }
- catch (JSONException e)
- {
- LOG.d(TAG, "JSONException: Parameters fed into the method are not valid");
- e.printStackTrace();
- }
-
- }
-
-}
diff --git a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/CordovaArgs.java b/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/CordovaArgs.java
deleted file mode 100644
index d40d26e..0000000
--- a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/CordovaArgs.java
+++ /dev/null
@@ -1,113 +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.
-*/
-package org.apache.cordova;
-
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import android.util.Base64;
-
-public class CordovaArgs {
- private JSONArray baseArgs;
-
- public CordovaArgs(JSONArray args) {
- this.baseArgs = args;
- }
-
-
- // Pass through the basics to the base args.
- public Object get(int index) throws JSONException {
- return baseArgs.get(index);
- }
-
- public boolean getBoolean(int index) throws JSONException {
- return baseArgs.getBoolean(index);
- }
-
- public double getDouble(int index) throws JSONException {
- return baseArgs.getDouble(index);
- }
-
- public int getInt(int index) throws JSONException {
- return baseArgs.getInt(index);
- }
-
- public JSONArray getJSONArray(int index) throws JSONException {
- return baseArgs.getJSONArray(index);
- }
-
- public JSONObject getJSONObject(int index) throws JSONException {
- return baseArgs.getJSONObject(index);
- }
-
- public long getLong(int index) throws JSONException {
- return baseArgs.getLong(index);
- }
-
- public String getString(int index) throws JSONException {
- return baseArgs.getString(index);
- }
-
-
- public Object opt(int index) {
- return baseArgs.opt(index);
- }
-
- public boolean optBoolean(int index) {
- return baseArgs.optBoolean(index);
- }
-
- public double optDouble(int index) {
- return baseArgs.optDouble(index);
- }
-
- public int optInt(int index) {
- return baseArgs.optInt(index);
- }
-
- public JSONArray optJSONArray(int index) {
- return baseArgs.optJSONArray(index);
- }
-
- public JSONObject optJSONObject(int index) {
- return baseArgs.optJSONObject(index);
- }
-
- public long optLong(int index) {
- return baseArgs.optLong(index);
- }
-
- public String optString(int index) {
- return baseArgs.optString(index);
- }
-
- public boolean isNull(int index) {
- return baseArgs.isNull(index);
- }
-
-
- // The interesting custom helpers.
- public byte[] getArrayBuffer(int index) throws JSONException {
- String encoded = baseArgs.getString(index);
- return Base64.decode(encoded, Base64.DEFAULT);
- }
-}
-
-
diff --git a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/CordovaBridge.java b/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/CordovaBridge.java
deleted file mode 100644
index 9459a11..0000000
--- a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/CordovaBridge.java
+++ /dev/null
@@ -1,182 +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.
-*/
-package org.apache.cordova;
-
-import java.security.SecureRandom;
-
-import org.json.JSONArray;
-import org.json.JSONException;
-
-/**
- * Contains APIs that the JS can call. All functions in here should also have
- * an equivalent entry in CordovaChromeClient.java, and be added to
- * cordova-js/lib/android/plugin/android/promptbasednativeapi.js
- */
-public class CordovaBridge {
- private static final String LOG_TAG = "CordovaBridge";
- private PluginManager pluginManager;
- private NativeToJsMessageQueue jsMessageQueue;
- private volatile int expectedBridgeSecret = -1; // written by UI thread, read by JS thread.
-
- public CordovaBridge(PluginManager pluginManager, NativeToJsMessageQueue jsMessageQueue) {
- this.pluginManager = pluginManager;
- this.jsMessageQueue = jsMessageQueue;
- }
-
- public String jsExec(int bridgeSecret, String service, String action, String callbackId, String arguments) throws JSONException, IllegalAccessException {
- if (!verifySecret("exec()", bridgeSecret)) {
- return null;
- }
- // If the arguments weren't received, send a message back to JS. It will switch bridge modes and try again. See CB-2666.
- // We send a message meant specifically for this case. It starts with "@" so no other message can be encoded into the same string.
- if (arguments == null) {
- return "@Null arguments.";
- }
-
- jsMessageQueue.setPaused(true);
- try {
- // Tell the resourceApi what thread the JS is running on.
- CordovaResourceApi.jsThread = Thread.currentThread();
-
- pluginManager.exec(service, action, callbackId, arguments);
- String ret = null;
- if (!NativeToJsMessageQueue.DISABLE_EXEC_CHAINING) {
- ret = jsMessageQueue.popAndEncode(false);
- }
- return ret;
- } catch (Throwable e) {
- e.printStackTrace();
- return "";
- } finally {
- jsMessageQueue.setPaused(false);
- }
- }
-
- public void jsSetNativeToJsBridgeMode(int bridgeSecret, int value) throws IllegalAccessException {
- if (!verifySecret("setNativeToJsBridgeMode()", bridgeSecret)) {
- return;
- }
- jsMessageQueue.setBridgeMode(value);
- }
-
- public String jsRetrieveJsMessages(int bridgeSecret, boolean fromOnlineEvent) throws IllegalAccessException {
- if (!verifySecret("retrieveJsMessages()", bridgeSecret)) {
- return null;
- }
- return jsMessageQueue.popAndEncode(fromOnlineEvent);
- }
-
- private boolean verifySecret(String action, int bridgeSecret) throws IllegalAccessException {
- if (!jsMessageQueue.isBridgeEnabled()) {
- if (bridgeSecret == -1) {
- LOG.d(LOG_TAG, action + " call made before bridge was enabled.");
- } else {
- LOG.d(LOG_TAG, "Ignoring " + action + " from previous page load.");
- }
- return false;
- }
- // Bridge secret wrong and bridge not due to it being from the previous page.
- if (expectedBridgeSecret < 0 || bridgeSecret != expectedBridgeSecret) {
- LOG.e(LOG_TAG, "Bridge access attempt with wrong secret token, possibly from malicious code. Disabling exec() bridge!");
- clearBridgeSecret();
- throw new IllegalAccessException();
- }
- return true;
- }
-
- /** Called on page transitions */
- void clearBridgeSecret() {
- expectedBridgeSecret = -1;
- }
-
- public boolean isSecretEstablished() {
- return expectedBridgeSecret != -1;
- }
-
- /** Called by cordova.js to initialize the bridge. */
- int generateBridgeSecret() {
- SecureRandom randGen = new SecureRandom();
- expectedBridgeSecret = randGen.nextInt(Integer.MAX_VALUE);
- return expectedBridgeSecret;
- }
-
- public void reset() {
- jsMessageQueue.reset();
- clearBridgeSecret();
- }
-
- public String promptOnJsPrompt(String origin, String message, String defaultValue) {
- if (defaultValue != null && defaultValue.length() > 3 && defaultValue.startsWith("gap:")) {
- JSONArray array;
- try {
- array = new JSONArray(defaultValue.substring(4));
- int bridgeSecret = array.getInt(0);
- String service = array.getString(1);
- String action = array.getString(2);
- String callbackId = array.getString(3);
- String r = jsExec(bridgeSecret, service, action, callbackId, message);
- return r == null ? "" : r;
- } catch (JSONException e) {
- e.printStackTrace();
- } catch (IllegalAccessException e) {
- e.printStackTrace();
- }
- return "";
- }
- // Sets the native->JS bridge mode.
- else if (defaultValue != null && defaultValue.startsWith("gap_bridge_mode:")) {
- try {
- int bridgeSecret = Integer.parseInt(defaultValue.substring(16));
- jsSetNativeToJsBridgeMode(bridgeSecret, Integer.parseInt(message));
- } catch (NumberFormatException e){
- e.printStackTrace();
- } catch (IllegalAccessException e) {
- e.printStackTrace();
- }
- return "";
- }
- // Polling for JavaScript messages
- else if (defaultValue != null && defaultValue.startsWith("gap_poll:")) {
- int bridgeSecret = Integer.parseInt(defaultValue.substring(9));
- try {
- String r = jsRetrieveJsMessages(bridgeSecret, "1".equals(message));
- return r == null ? "" : r;
- } catch (IllegalAccessException e) {
- e.printStackTrace();
- }
- return "";
- }
- else if (defaultValue != null && defaultValue.startsWith("gap_init:")) {
- // Protect against random iframes being able to talk through the bridge.
- // Trust only pages which the app would have been allowed to navigate to anyway.
- if (pluginManager.shouldAllowBridgeAccess(origin)) {
- // Enable the bridge
- int bridgeMode = Integer.parseInt(defaultValue.substring(9));
- jsMessageQueue.setBridgeMode(bridgeMode);
- // Tell JS the bridge secret.
- int secret = generateBridgeSecret();
- return ""+secret;
- } else {
- LOG.e(LOG_TAG, "gap_init called from restricted origin: " + origin);
- }
- return "";
- }
- return null;
- }
-}
diff --git a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/CordovaClientCertRequest.java b/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/CordovaClientCertRequest.java
deleted file mode 100644
index 5dd0eca..0000000
--- a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/CordovaClientCertRequest.java
+++ /dev/null
@@ -1,96 +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.
-*/
-package org.apache.cordova;
-
-import java.security.Principal;
-import java.security.PrivateKey;
-import java.security.cert.X509Certificate;
-
-import android.webkit.ClientCertRequest;
-
-/**
- * Implementation of the ICordovaClientCertRequest for Android WebView.
- */
-public class CordovaClientCertRequest implements ICordovaClientCertRequest {
-
- private final ClientCertRequest request;
-
- public CordovaClientCertRequest(ClientCertRequest request) {
- this.request = request;
- }
-
- /**
- * Cancel this request
- */
- public void cancel()
- {
- request.cancel();
- }
-
- /*
- * Returns the host name of the server requesting the certificate.
- */
- public String getHost()
- {
- return request.getHost();
- }
-
- /*
- * Returns the acceptable types of asymmetric keys (can be null).
- */
- public String[] getKeyTypes()
- {
- return request.getKeyTypes();
- }
-
- /*
- * Returns the port number of the server requesting the certificate.
- */
- public int getPort()
- {
- return request.getPort();
- }
-
- /*
- * Returns the acceptable certificate issuers for the certificate matching the private key (can be null).
- */
- public Principal[] getPrincipals()
- {
- return request.getPrincipals();
- }
-
- /*
- * Ignore the request for now. Do not remember user's choice.
- */
- public void ignore()
- {
- request.ignore();
- }
-
- /*
- * Proceed with the specified private key and client certificate chain. Remember the user's positive choice and use it for future requests.
- *
- * @param privateKey The privateKey
- * @param chain The certificate chain
- */
- public void proceed(PrivateKey privateKey, X509Certificate[] chain)
- {
- request.proceed(privateKey, chain);
- }
-}
diff --git a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/CordovaDialogsHelper.java b/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/CordovaDialogsHelper.java
deleted file mode 100644
index a219c99..0000000
--- a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/CordovaDialogsHelper.java
+++ /dev/null
@@ -1,152 +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.
-*/
-package org.apache.cordova;
-
-import android.app.AlertDialog;
-import android.content.Context;
-import android.content.DialogInterface;
-import android.view.KeyEvent;
-import android.widget.EditText;
-
-/**
- * Helper class for WebViews to implement prompt(), alert(), confirm() dialogs.
- */
-public class CordovaDialogsHelper {
- private final Context context;
- private AlertDialog lastHandledDialog;
-
- public CordovaDialogsHelper(Context context) {
- this.context = context;
- }
-
- public void showAlert(String message, final Result result) {
- AlertDialog.Builder dlg = new AlertDialog.Builder(context);
- dlg.setMessage(message);
- dlg.setTitle("Alert");
- //Don't let alerts break the back button
- dlg.setCancelable(true);
- dlg.setPositiveButton(android.R.string.ok,
- new AlertDialog.OnClickListener() {
- public void onClick(DialogInterface dialog, int which) {
- result.gotResult(true, null);
- }
- });
- dlg.setOnCancelListener(
- new DialogInterface.OnCancelListener() {
- public void onCancel(DialogInterface dialog) {
- result.gotResult(false, null);
- }
- });
- dlg.setOnKeyListener(new DialogInterface.OnKeyListener() {
- //DO NOTHING
- public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent event) {
- if (keyCode == KeyEvent.KEYCODE_BACK)
- {
- result.gotResult(true, null);
- return false;
- }
- else
- return true;
- }
- });
- lastHandledDialog = dlg.show();
- }
-
- public void showConfirm(String message, final Result result) {
- AlertDialog.Builder dlg = new AlertDialog.Builder(context);
- dlg.setMessage(message);
- dlg.setTitle("Confirm");
- dlg.setCancelable(true);
- dlg.setPositiveButton(android.R.string.ok,
- new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int which) {
- result.gotResult(true, null);
- }
- });
- dlg.setNegativeButton(android.R.string.cancel,
- new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int which) {
- result.gotResult(false, null);
- }
- });
- dlg.setOnCancelListener(
- new DialogInterface.OnCancelListener() {
- public void onCancel(DialogInterface dialog) {
- result.gotResult(false, null);
- }
- });
- dlg.setOnKeyListener(new DialogInterface.OnKeyListener() {
- //DO NOTHING
- public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent event) {
- if (keyCode == KeyEvent.KEYCODE_BACK)
- {
- result.gotResult(false, null);
- return false;
- }
- else
- return true;
- }
- });
- lastHandledDialog = dlg.show();
- }
-
- /**
- * Tell the client to display a prompt dialog to the user.
- * If the client returns true, WebView will assume that the client will
- * handle the prompt dialog and call the appropriate JsPromptResult method.
- *
- * Since we are hacking prompts for our own purposes, we should not be using them for
- * this purpose, perhaps we should hack console.log to do this instead!
- */
- public void showPrompt(String message, String defaultValue, final Result result) {
- // Returning false would also show a dialog, but the default one shows the origin (ugly).
- AlertDialog.Builder dlg = new AlertDialog.Builder(context);
- dlg.setMessage(message);
- final EditText input = new EditText(context);
- if (defaultValue != null) {
- input.setText(defaultValue);
- }
- dlg.setView(input);
- dlg.setCancelable(false);
- dlg.setPositiveButton(android.R.string.ok,
- new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int which) {
- String userText = input.getText().toString();
- result.gotResult(true, userText);
- }
- });
- dlg.setNegativeButton(android.R.string.cancel,
- new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int which) {
- result.gotResult(false, null);
- }
- });
- lastHandledDialog = dlg.show();
- }
-
- public void destroyLastDialog(){
- if (lastHandledDialog != null){
- lastHandledDialog.cancel();
- }
- }
-
- public interface Result {
- public void gotResult(boolean success, String value);
- }
-}
\ No newline at end of file
diff --git a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/CordovaHttpAuthHandler.java b/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/CordovaHttpAuthHandler.java
deleted file mode 100644
index 724381e..0000000
--- a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/CordovaHttpAuthHandler.java
+++ /dev/null
@@ -1,51 +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.
-*/
-package org.apache.cordova;
-
-import android.webkit.HttpAuthHandler;
-
-/**
- * Specifies interface for HTTP auth handler object which is used to handle auth requests and
- * specifying user credentials.
- */
-public class CordovaHttpAuthHandler implements ICordovaHttpAuthHandler {
-
- private final HttpAuthHandler handler;
-
- public CordovaHttpAuthHandler(HttpAuthHandler handler) {
- this.handler = handler;
- }
-
- /**
- * Instructs the WebView to cancel the authentication request.
- */
- public void cancel () {
- this.handler.cancel();
- }
-
- /**
- * Instructs the WebView to proceed with the authentication with the given credentials.
- *
- * @param username
- * @param password
- */
- public void proceed (String username, String password) {
- this.handler.proceed(username, password);
- }
-}
diff --git a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/CordovaInterface.java b/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/CordovaInterface.java
deleted file mode 100644
index 3b8468f..0000000
--- a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/CordovaInterface.java
+++ /dev/null
@@ -1,88 +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.
-*/
-package org.apache.cordova;
-
-import android.app.Activity;
-import android.content.Intent;
-
-import org.apache.cordova.CordovaPlugin;
-
-import java.util.concurrent.ExecutorService;
-
-/**
- * The Activity interface that is implemented by CordovaActivity.
- * It is used to isolate plugin development, and remove dependency on entire Cordova library.
- */
-public interface CordovaInterface {
-
- /**
- * Launch an activity for which you would like a result when it finished. When this activity exits,
- * your onActivityResult() method will be called.
- *
- * @param command The command object
- * @param intent The intent to start
- * @param requestCode The request code that is passed to callback to identify the activity
- */
- abstract public void startActivityForResult(CordovaPlugin command, Intent intent, int requestCode);
-
- /**
- * Set the plugin to be called when a sub-activity exits.
- *
- * @param plugin The plugin on which onActivityResult is to be called
- */
- abstract public void setActivityResultCallback(CordovaPlugin plugin);
-
- /**
- * Get the Android activity.
- *
- * @return the Activity
- */
- public abstract Activity getActivity();
-
-
- /**
- * Called when a message is sent to plugin.
- *
- * @param id The message id
- * @param data The message data
- * @return Object or null
- */
- public Object onMessage(String id, Object data);
-
- /**
- * Returns a shared thread pool that can be used for background tasks.
- */
- public ExecutorService getThreadPool();
-
- /**
- * Sends a permission request to the activity for one permission.
- */
- public void requestPermission(CordovaPlugin plugin, int requestCode, String permission);
-
- /**
- * Sends a permission request to the activity for a group of permissions
- */
- public void requestPermissions(CordovaPlugin plugin, int requestCode, String [] permissions);
-
- /**
- * Check for a permission. Returns true if the permission is granted, false otherwise.
- */
- public boolean hasPermission(String permission);
-
-}
diff --git a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/CordovaInterfaceImpl.java b/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/CordovaInterfaceImpl.java
deleted file mode 100644
index 71dcb78..0000000
--- a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/CordovaInterfaceImpl.java
+++ /dev/null
@@ -1,241 +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.
-*/
-
-package org.apache.cordova;
-
-import android.app.Activity;
-import android.content.Intent;
-import android.content.pm.PackageManager;
-import android.os.Build;
-import android.os.Bundle;
-import android.util.Pair;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-/**
- * Default implementation of CordovaInterface.
- */
-public class CordovaInterfaceImpl implements CordovaInterface {
- private static final String TAG = "CordovaInterfaceImpl";
- protected Activity activity;
- protected ExecutorService threadPool;
- protected PluginManager pluginManager;
-
- protected ActivityResultHolder savedResult;
- protected CallbackMap permissionResultCallbacks;
- protected CordovaPlugin activityResultCallback;
- protected String initCallbackService;
- protected int activityResultRequestCode;
- protected boolean activityWasDestroyed = false;
- protected Bundle savedPluginState;
-
- public CordovaInterfaceImpl(Activity activity) {
- this(activity, Executors.newCachedThreadPool());
- }
-
- public CordovaInterfaceImpl(Activity activity, ExecutorService threadPool) {
- this.activity = activity;
- this.threadPool = threadPool;
- this.permissionResultCallbacks = new CallbackMap();
- }
-
- @Override
- public void startActivityForResult(CordovaPlugin command, Intent intent, int requestCode) {
- setActivityResultCallback(command);
- try {
- activity.startActivityForResult(intent, requestCode);
- } catch (RuntimeException e) { // E.g.: ActivityNotFoundException
- activityResultCallback = null;
- throw e;
- }
- }
-
- @Override
- public void setActivityResultCallback(CordovaPlugin plugin) {
- // Cancel any previously pending activity.
- if (activityResultCallback != null) {
- activityResultCallback.onActivityResult(activityResultRequestCode, Activity.RESULT_CANCELED, null);
- }
- activityResultCallback = plugin;
- }
-
- @Override
- public Activity getActivity() {
- return activity;
- }
-
- @Override
- public Object onMessage(String id, Object data) {
- if ("exit".equals(id)) {
- activity.finish();
- }
- return null;
- }
-
- @Override
- public ExecutorService getThreadPool() {
- return threadPool;
- }
-
- /**
- * Dispatches any pending onActivityResult callbacks and sends the resume event if the
- * Activity was destroyed by the OS.
- */
- public void onCordovaInit(PluginManager pluginManager) {
- this.pluginManager = pluginManager;
- if (savedResult != null) {
- onActivityResult(savedResult.requestCode, savedResult.resultCode, savedResult.intent);
- } else if(activityWasDestroyed) {
- // If there was no Activity result, we still need to send out the resume event if the
- // Activity was destroyed by the OS
- activityWasDestroyed = false;
- if(pluginManager != null)
- {
- CoreAndroid appPlugin = (CoreAndroid) pluginManager.getPlugin(CoreAndroid.PLUGIN_NAME);
- if(appPlugin != null) {
- JSONObject obj = new JSONObject();
- try {
- obj.put("action", "resume");
- } catch (JSONException e) {
- LOG.e(TAG, "Failed to create event message", e);
- }
- appPlugin.sendResumeEvent(new PluginResult(PluginResult.Status.OK, obj));
- }
- }
-
- }
- }
-
- /**
- * Routes the result to the awaiting plugin. Returns false if no plugin was waiting.
- */
- public boolean onActivityResult(int requestCode, int resultCode, Intent intent) {
- CordovaPlugin callback = activityResultCallback;
- if(callback == null && initCallbackService != null) {
- // The application was restarted, but had defined an initial callback
- // before being shut down.
- savedResult = new ActivityResultHolder(requestCode, resultCode, intent);
- if (pluginManager != null) {
- callback = pluginManager.getPlugin(initCallbackService);
- if(callback != null) {
- callback.onRestoreStateForActivityResult(savedPluginState.getBundle(callback.getServiceName()),
- new ResumeCallback(callback.getServiceName(), pluginManager));
- }
- }
- }
- activityResultCallback = null;
-
- if (callback != null) {
- LOG.d(TAG, "Sending activity result to plugin");
- initCallbackService = null;
- savedResult = null;
- callback.onActivityResult(requestCode, resultCode, intent);
- return true;
- }
- LOG.w(TAG, "Got an activity result, but no plugin was registered to receive it" + (savedResult != null ? " yet!" : "."));
- return false;
- }
-
- /**
- * Call this from your startActivityForResult() overload. This is required to catch the case
- * where plugins use Activity.startActivityForResult() + CordovaInterface.setActivityResultCallback()
- * rather than CordovaInterface.startActivityForResult().
- */
- public void setActivityResultRequestCode(int requestCode) {
- activityResultRequestCode = requestCode;
- }
-
- /**
- * Saves parameters for startActivityForResult().
- */
- public void onSaveInstanceState(Bundle outState) {
- if (activityResultCallback != null) {
- String serviceName = activityResultCallback.getServiceName();
- outState.putString("callbackService", serviceName);
- }
- if(pluginManager != null){
- outState.putBundle("plugin", pluginManager.onSaveInstanceState());
- }
-
- }
-
- /**
- * Call this from onCreate() so that any saved startActivityForResult parameters will be restored.
- */
- public void restoreInstanceState(Bundle savedInstanceState) {
- initCallbackService = savedInstanceState.getString("callbackService");
- savedPluginState = savedInstanceState.getBundle("plugin");
- activityWasDestroyed = true;
- }
-
- private static class ActivityResultHolder {
- private int requestCode;
- private int resultCode;
- private Intent intent;
-
- public ActivityResultHolder(int requestCode, int resultCode, Intent intent) {
- this.requestCode = requestCode;
- this.resultCode = resultCode;
- this.intent = intent;
- }
- }
-
- /**
- * Called by the system when the user grants permissions
- *
- * @param requestCode
- * @param permissions
- * @param grantResults
- */
- public void onRequestPermissionResult(int requestCode, String[] permissions,
- int[] grantResults) throws JSONException {
- Pair callback = permissionResultCallbacks.getAndRemoveCallback(requestCode);
- if(callback != null) {
- callback.first.onRequestPermissionResult(callback.second, permissions, grantResults);
- }
- }
-
- public void requestPermission(CordovaPlugin plugin, int requestCode, String permission) {
- String[] permissions = new String [1];
- permissions[0] = permission;
- requestPermissions(plugin, requestCode, permissions);
- }
-
- public void requestPermissions(CordovaPlugin plugin, int requestCode, String [] permissions) {
- int mappedRequestCode = permissionResultCallbacks.registerCallback(plugin, requestCode);
- getActivity().requestPermissions(permissions, mappedRequestCode);
- }
-
- public boolean hasPermission(String permission)
- {
- if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
- {
- int result = activity.checkSelfPermission(permission);
- return PackageManager.PERMISSION_GRANTED == result;
- }
- else
- {
- return true;
- }
- }
-}
diff --git a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/CordovaPlugin.java b/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/CordovaPlugin.java
deleted file mode 100644
index 41af1db..0000000
--- a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/CordovaPlugin.java
+++ /dev/null
@@ -1,422 +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.
-*/
-package org.apache.cordova;
-
-import org.apache.cordova.CordovaArgs;
-import org.apache.cordova.CordovaWebView;
-import org.apache.cordova.CordovaInterface;
-import org.apache.cordova.CallbackContext;
-import org.json.JSONArray;
-import org.json.JSONException;
-
-import android.content.Intent;
-import android.content.pm.PackageManager;
-import android.content.res.Configuration;
-import android.net.Uri;
-import android.os.Build;
-import android.os.Bundle;
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-
-/**
- * Plugins must extend this class and override one of the execute methods.
- */
-public class CordovaPlugin {
- public CordovaWebView webView;
- public CordovaInterface cordova;
- protected CordovaPreferences preferences;
- private String serviceName;
-
- /**
- * Call this after constructing to initialize the plugin.
- * Final because we want to be able to change args without breaking plugins.
- */
- public final void privateInitialize(String serviceName, CordovaInterface cordova, CordovaWebView webView, CordovaPreferences preferences) {
- assert this.cordova == null;
- this.serviceName = serviceName;
- this.cordova = cordova;
- this.webView = webView;
- this.preferences = preferences;
- initialize(cordova, webView);
- pluginInitialize();
- }
-
- /**
- * Called after plugin construction and fields have been initialized.
- * Prefer to use pluginInitialize instead since there is no value in
- * having parameters on the initialize() function.
- */
- public void initialize(CordovaInterface cordova, CordovaWebView webView) {
- }
-
- /**
- * Called after plugin construction and fields have been initialized.
- */
- protected void pluginInitialize() {
- }
-
- /**
- * Returns the plugin's service name (what you'd use when calling pluginManger.getPlugin())
- */
- public String getServiceName() {
- return serviceName;
- }
-
- /**
- * Executes the request.
- *
- * This method is called from the WebView thread. To do a non-trivial amount of work, use:
- * cordova.getThreadPool().execute(runnable);
- *
- * To run on the UI thread, use:
- * cordova.getActivity().runOnUiThread(runnable);
- *
- * @param action The action to execute.
- * @param rawArgs The exec() arguments in JSON form.
- * @param callbackContext The callback context used when calling back into JavaScript.
- * @return Whether the action was valid.
- */
- public boolean execute(String action, String rawArgs, CallbackContext callbackContext) throws JSONException {
- JSONArray args = new JSONArray(rawArgs);
- return execute(action, args, callbackContext);
- }
-
- /**
- * Executes the request.
- *
- * This method is called from the WebView thread. To do a non-trivial amount of work, use:
- * cordova.getThreadPool().execute(runnable);
- *
- * To run on the UI thread, use:
- * cordova.getActivity().runOnUiThread(runnable);
- *
- * @param action The action to execute.
- * @param args The exec() arguments.
- * @param callbackContext The callback context used when calling back into JavaScript.
- * @return Whether the action was valid.
- */
- public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
- CordovaArgs cordovaArgs = new CordovaArgs(args);
- return execute(action, cordovaArgs, callbackContext);
- }
-
- /**
- * Executes the request.
- *
- * This method is called from the WebView thread. To do a non-trivial amount of work, use:
- * cordova.getThreadPool().execute(runnable);
- *
- * To run on the UI thread, use:
- * cordova.getActivity().runOnUiThread(runnable);
- *
- * @param action The action to execute.
- * @param args The exec() arguments, wrapped with some Cordova helpers.
- * @param callbackContext The callback context used when calling back into JavaScript.
- * @return Whether the action was valid.
- */
- public boolean execute(String action, CordovaArgs args, CallbackContext callbackContext) throws JSONException {
- return false;
- }
-
- /**
- * Called when the system is about to start resuming a previous activity.
- *
- * @param multitasking Flag indicating if multitasking is turned on for app
- */
- public void onPause(boolean multitasking) {
- }
-
- /**
- * Called when the activity will start interacting with the user.
- *
- * @param multitasking Flag indicating if multitasking is turned on for app
- */
- public void onResume(boolean multitasking) {
- }
-
- /**
- * Called when the activity is becoming visible to the user.
- */
- public void onStart() {
- }
-
- /**
- * Called when the activity is no longer visible to the user.
- */
- public void onStop() {
- }
-
- /**
- * Called when the activity receives a new intent.
- */
- public void onNewIntent(Intent intent) {
- }
-
- /**
- * The final call you receive before your activity is destroyed.
- */
- public void onDestroy() {
- }
-
- /**
- * Called when the Activity is being destroyed (e.g. if a plugin calls out to an external
- * Activity and the OS kills the CordovaActivity in the background). The plugin should save its
- * state in this method only if it is awaiting the result of an external Activity and needs
- * to preserve some information so as to handle that result; onRestoreStateForActivityResult()
- * will only be called if the plugin is the recipient of an Activity result
- *
- * @return Bundle containing the state of the plugin or null if state does not need to be saved
- */
- public Bundle onSaveInstanceState() {
- return null;
- }
-
- /**
- * Called when a plugin is the recipient of an Activity result after the CordovaActivity has
- * been destroyed. The Bundle will be the same as the one the plugin returned in
- * onSaveInstanceState()
- *
- * @param state Bundle containing the state of the plugin
- * @param callbackContext Replacement Context to return the plugin result to
- */
- public void onRestoreStateForActivityResult(Bundle state, CallbackContext callbackContext) {}
-
- /**
- * Called when a message is sent to plugin.
- *
- * @param id The message id
- * @param data The message data
- * @return Object to stop propagation or null
- */
- public Object onMessage(String id, Object data) {
- return null;
- }
-
- /**
- * Called when an activity you launched exits, giving you the requestCode you started it with,
- * the resultCode it returned, and any additional data from it.
- *
- * @param requestCode The request code originally supplied to startActivityForResult(),
- * allowing you to identify who this result came from.
- * @param resultCode The integer result code returned by the child activity through its setResult().
- * @param intent An Intent, which can return result data to the caller (various data can be
- * attached to Intent "extras").
- */
- public void onActivityResult(int requestCode, int resultCode, Intent intent) {
- }
-
- /**
- * Hook for blocking the loading of external resources.
- *
- * This will be called when the WebView's shouldInterceptRequest wants to
- * know whether to open a connection to an external resource. Return false
- * to block the request: if any plugin returns false, Cordova will block
- * the request. If all plugins return null, the default policy will be
- * enforced. If at least one plugin returns true, and no plugins return
- * false, then the request will proceed.
- *
- * Note that this only affects resource requests which are routed through
- * WebViewClient.shouldInterceptRequest, such as XMLHttpRequest requests and
- * img tag loads. WebSockets and media requests (such as and
- * tags) are not affected by this method. Use CSP headers to control access
- * to such resources.
- */
- public Boolean shouldAllowRequest(String url) {
- return null;
- }
-
- /**
- * Hook for blocking navigation by the Cordova WebView. This applies both to top-level and
- * iframe navigations.
- *
- * This will be called when the WebView's needs to know whether to navigate
- * to a new page. Return false to block the navigation: if any plugin
- * returns false, Cordova will block the navigation. If all plugins return
- * null, the default policy will be enforced. It at least one plugin returns
- * true, and no plugins return false, then the navigation will proceed.
- */
- public Boolean shouldAllowNavigation(String url) {
- return null;
- }
-
- /**
- * Hook for allowing page to call exec(). By default, this returns the result of
- * shouldAllowNavigation(). It's generally unsafe to allow untrusted content to be loaded
- * into a CordovaWebView, even within an iframe, so it's best not to touch this.
- */
- public Boolean shouldAllowBridgeAccess(String url) {
- return shouldAllowNavigation(url);
- }
-
- /**
- * Hook for blocking the launching of Intents by the Cordova application.
- *
- * This will be called when the WebView will not navigate to a page, but
- * could launch an intent to handle the URL. Return false to block this: if
- * any plugin returns false, Cordova will block the navigation. If all
- * plugins return null, the default policy will be enforced. If at least one
- * plugin returns true, and no plugins return false, then the URL will be
- * opened.
- */
- public Boolean shouldOpenExternalUrl(String url) {
- return null;
- }
-
- /**
- * Allows plugins to handle a link being clicked. Return true here to cancel the navigation.
- *
- * @param url The URL that is trying to be loaded in the Cordova webview.
- * @return Return true to prevent the URL from loading. Default is false.
- */
- public boolean onOverrideUrlLoading(String url) {
- return false;
- }
-
- /**
- * Hook for redirecting requests. Applies to WebView requests as well as requests made by plugins.
- * To handle the request directly, return a URI in the form:
- *
- * cdvplugin://pluginId/...
- *
- * And implement handleOpenForRead().
- * To make this easier, use the toPluginUri() and fromPluginUri() helpers:
- *
- * public Uri remapUri(Uri uri) { return toPluginUri(uri); }
- *
- * public CordovaResourceApi.OpenForReadResult handleOpenForRead(Uri uri) throws IOException {
- * Uri origUri = fromPluginUri(uri);
- * ...
- * }
- */
- public Uri remapUri(Uri uri) {
- return null;
- }
-
- /**
- * Called to handle CordovaResourceApi.openForRead() calls for a cdvplugin://pluginId/ URL.
- * Should never return null.
- * Added in cordova-android@4.0.0
- */
- public CordovaResourceApi.OpenForReadResult handleOpenForRead(Uri uri) throws IOException {
- throw new FileNotFoundException("Plugin can't handle uri: " + uri);
- }
-
- /**
- * Refer to remapUri()
- * Added in cordova-android@4.0.0
- */
- protected Uri toPluginUri(Uri origUri) {
- return new Uri.Builder()
- .scheme(CordovaResourceApi.PLUGIN_URI_SCHEME)
- .authority(serviceName)
- .appendQueryParameter("origUri", origUri.toString())
- .build();
- }
-
- /**
- * Refer to remapUri()
- * Added in cordova-android@4.0.0
- */
- protected Uri fromPluginUri(Uri pluginUri) {
- return Uri.parse(pluginUri.getQueryParameter("origUri"));
- }
-
- /**
- * Called when the WebView does a top-level navigation or refreshes.
- *
- * Plugins should stop any long-running processes and clean up internal state.
- *
- * Does nothing by default.
- */
- public void onReset() {
- }
-
- /**
- * Called when the system received an HTTP authentication request. Plugin can use
- * the supplied HttpAuthHandler to process this auth challenge.
- *
- * @param view The WebView that is initiating the callback
- * @param handler The HttpAuthHandler used to set the WebView's response
- * @param host The host requiring authentication
- * @param realm The realm for which authentication is required
- *
- * @return Returns True if plugin will resolve this auth challenge, otherwise False
- *
- */
- public boolean onReceivedHttpAuthRequest(CordovaWebView view, ICordovaHttpAuthHandler handler, String host, String realm) {
- return false;
- }
-
- /**
- * Called when he system received an SSL client certificate request. Plugin can use
- * the supplied ClientCertRequest to process this certificate challenge.
- *
- * @param view The WebView that is initiating the callback
- * @param request The client certificate request
- *
- * @return Returns True if plugin will resolve this auth challenge, otherwise False
- *
- */
- public boolean onReceivedClientCertRequest(CordovaWebView view, ICordovaClientCertRequest request) {
- return false;
- }
-
- /**
- * Called by the system when the device configuration changes while your activity is running.
- *
- * @param newConfig The new device configuration
- */
- public void onConfigurationChanged(Configuration newConfig) {
- }
-
- /**
- * Called by the Plugin Manager when we need to actually request permissions
- *
- * @param requestCode Passed to the activity to track the request
- *
- * @return Returns the permission that was stored in the plugin
- */
-
- public void requestPermissions(int requestCode) {
- }
-
- /*
- * Called by the WebView implementation to check for geolocation permissions, can be used
- * by other Java methods in the event that a plugin is using this as a dependency.
- *
- * @return Returns true if the plugin has all the permissions it needs to operate.
- */
-
- public boolean hasPermisssion() {
- return true;
- }
-
- /**
- * Called by the system when the user grants permissions
- *
- * @param requestCode
- * @param permissions
- * @param grantResults
- */
- public void onRequestPermissionResult(int requestCode, String[] permissions,
- int[] grantResults) throws JSONException {
-
- }
-}
diff --git a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/CordovaPreferences.java b/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/CordovaPreferences.java
deleted file mode 100644
index 4dbc93e..0000000
--- a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/CordovaPreferences.java
+++ /dev/null
@@ -1,101 +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.
-*/
-
-package org.apache.cordova;
-
-import java.util.HashMap;
-import java.util.Locale;
-import java.util.Map;
-
-import org.apache.cordova.LOG;
-
-import android.app.Activity;
-import android.os.Bundle;
-
-public class CordovaPreferences {
- private HashMap prefs = new HashMap(20);
- private Bundle preferencesBundleExtras;
-
- public void setPreferencesBundle(Bundle extras) {
- preferencesBundleExtras = extras;
- }
-
- public void set(String name, String value) {
- prefs.put(name.toLowerCase(Locale.ENGLISH), value);
- }
-
- public void set(String name, boolean value) {
- set(name, "" + value);
- }
-
- public void set(String name, int value) {
- set(name, "" + value);
- }
-
- public void set(String name, double value) {
- set(name, "" + value);
- }
-
- public Map getAll() {
- return prefs;
- }
-
- public boolean getBoolean(String name, boolean defaultValue) {
- name = name.toLowerCase(Locale.ENGLISH);
- String value = prefs.get(name);
- if (value != null) {
- return Boolean.parseBoolean(value);
- }
- return defaultValue;
- }
-
- // Added in 4.0.0
- public boolean contains(String name) {
- return getString(name, null) != null;
- }
-
- public int getInteger(String name, int defaultValue) {
- name = name.toLowerCase(Locale.ENGLISH);
- String value = prefs.get(name);
- if (value != null) {
- // Use Integer.decode() can't handle it if the highest bit is set.
- return (int)(long)Long.decode(value);
- }
- return defaultValue;
- }
-
- public double getDouble(String name, double defaultValue) {
- name = name.toLowerCase(Locale.ENGLISH);
- String value = prefs.get(name);
- if (value != null) {
- return Double.valueOf(value);
- }
- return defaultValue;
- }
-
- public String getString(String name, String defaultValue) {
- name = name.toLowerCase(Locale.ENGLISH);
- String value = prefs.get(name);
- if (value != null) {
- return value;
- }
- return defaultValue;
- }
-
-}
diff --git a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/CordovaResourceApi.java b/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/CordovaResourceApi.java
deleted file mode 100644
index e725e25..0000000
--- a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/CordovaResourceApi.java
+++ /dev/null
@@ -1,471 +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.
- */
-package org.apache.cordova;
-
-import android.content.ContentResolver;
-import android.content.Context;
-import android.content.res.AssetFileDescriptor;
-import android.content.res.AssetManager;
-import android.database.Cursor;
-import android.net.Uri;
-import android.os.Looper;
-import android.util.Base64;
-import android.webkit.MimeTypeMap;
-
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
-import java.net.HttpURLConnection;
-import java.net.URL;
-import java.nio.channels.FileChannel;
-import java.util.Locale;
-
-/**
- * What this class provides:
- * 1. Helpers for reading & writing to URLs.
- * - E.g. handles assets, resources, content providers, files, data URIs, http[s]
- * - E.g. Can be used to query for mime-type & content length.
- *
- * 2. To allow plugins to redirect URLs (via remapUrl).
- * - All plugins should call remapUrl() on URLs they receive from JS *before*
- * passing the URL onto other utility functions in this class.
- * - For an example usage of this, refer to the org.apache.cordova.file plugin.
- *
- * Future Work:
- * - Consider using a Cursor to query content URLs for their size (like the file plugin does).
- * - Allow plugins to remapUri to "cdv-plugin://plugin-name/foo", which CordovaResourceApi
- * would then delegate to pluginManager.getPlugin(plugin-name).openForRead(url)
- * - Currently, plugins *can* do this by remapping to a data: URL, but it's inefficient
- * for large payloads.
- */
-public class CordovaResourceApi {
- @SuppressWarnings("unused")
- private static final String LOG_TAG = "CordovaResourceApi";
-
- public static final int URI_TYPE_FILE = 0;
- public static final int URI_TYPE_ASSET = 1;
- public static final int URI_TYPE_CONTENT = 2;
- public static final int URI_TYPE_RESOURCE = 3;
- public static final int URI_TYPE_DATA = 4;
- public static final int URI_TYPE_HTTP = 5;
- public static final int URI_TYPE_HTTPS = 6;
- public static final int URI_TYPE_PLUGIN = 7;
- public static final int URI_TYPE_UNKNOWN = -1;
-
- public static final String PLUGIN_URI_SCHEME = "cdvplugin";
-
- private static final String[] LOCAL_FILE_PROJECTION = { "_data" };
-
- public static Thread jsThread;
-
- private final AssetManager assetManager;
- private final ContentResolver contentResolver;
- private final PluginManager pluginManager;
- private boolean threadCheckingEnabled = true;
-
-
- public CordovaResourceApi(Context context, PluginManager pluginManager) {
- this.contentResolver = context.getContentResolver();
- this.assetManager = context.getAssets();
- this.pluginManager = pluginManager;
- }
-
- public void setThreadCheckingEnabled(boolean value) {
- threadCheckingEnabled = value;
- }
-
- public boolean isThreadCheckingEnabled() {
- return threadCheckingEnabled;
- }
-
-
- public static int getUriType(Uri uri) {
- assertNonRelative(uri);
- String scheme = uri.getScheme();
- if (ContentResolver.SCHEME_CONTENT.equalsIgnoreCase(scheme)) {
- return URI_TYPE_CONTENT;
- }
- if (ContentResolver.SCHEME_ANDROID_RESOURCE.equalsIgnoreCase(scheme)) {
- return URI_TYPE_RESOURCE;
- }
- if (ContentResolver.SCHEME_FILE.equalsIgnoreCase(scheme)) {
- if (uri.getPath().startsWith("/android_asset/")) {
- return URI_TYPE_ASSET;
- }
- return URI_TYPE_FILE;
- }
- if ("data".equalsIgnoreCase(scheme)) {
- return URI_TYPE_DATA;
- }
- if ("http".equalsIgnoreCase(scheme)) {
- return URI_TYPE_HTTP;
- }
- if ("https".equalsIgnoreCase(scheme)) {
- return URI_TYPE_HTTPS;
- }
- if (PLUGIN_URI_SCHEME.equalsIgnoreCase(scheme)) {
- return URI_TYPE_PLUGIN;
- }
- return URI_TYPE_UNKNOWN;
- }
-
- public Uri remapUri(Uri uri) {
- assertNonRelative(uri);
- Uri pluginUri = pluginManager.remapUri(uri);
- return pluginUri != null ? pluginUri : uri;
- }
-
- public String remapPath(String path) {
- return remapUri(Uri.fromFile(new File(path))).getPath();
- }
-
- /**
- * Returns a File that points to the resource, or null if the resource
- * is not on the local filesystem.
- */
- public File mapUriToFile(Uri uri) {
- assertBackgroundThread();
- switch (getUriType(uri)) {
- case URI_TYPE_FILE:
- return new File(uri.getPath());
- case URI_TYPE_CONTENT: {
- Cursor cursor = contentResolver.query(uri, LOCAL_FILE_PROJECTION, null, null, null);
- if (cursor != null) {
- try {
- int columnIndex = cursor.getColumnIndex(LOCAL_FILE_PROJECTION[0]);
- if (columnIndex != -1 && cursor.getCount() > 0) {
- cursor.moveToFirst();
- String realPath = cursor.getString(columnIndex);
- if (realPath != null) {
- return new File(realPath);
- }
- }
- } finally {
- cursor.close();
- }
- }
- }
- }
- return null;
- }
-
- public String getMimeType(Uri uri) {
- switch (getUriType(uri)) {
- case URI_TYPE_FILE:
- case URI_TYPE_ASSET:
- return getMimeTypeFromPath(uri.getPath());
- case URI_TYPE_CONTENT:
- case URI_TYPE_RESOURCE:
- return contentResolver.getType(uri);
- case URI_TYPE_DATA: {
- return getDataUriMimeType(uri);
- }
- case URI_TYPE_HTTP:
- case URI_TYPE_HTTPS: {
- try {
- HttpURLConnection conn = (HttpURLConnection)new URL(uri.toString()).openConnection();
- conn.setDoInput(false);
- conn.setRequestMethod("HEAD");
- String mimeType = conn.getHeaderField("Content-Type");
- if (mimeType != null) {
- mimeType = mimeType.split(";")[0];
- }
- return mimeType;
- } catch (IOException e) {
- }
- }
- }
-
- return null;
- }
-
-
- //This already exists
- private String getMimeTypeFromPath(String path) {
- String extension = path;
- int lastDot = extension.lastIndexOf('.');
- if (lastDot != -1) {
- extension = extension.substring(lastDot + 1);
- }
- // Convert the URI string to lower case to ensure compatibility with MimeTypeMap (see CB-2185).
- extension = extension.toLowerCase(Locale.getDefault());
- if (extension.equals("3ga")) {
- return "audio/3gpp";
- } else if (extension.equals("js")) {
- // Missing from the map :(.
- return "text/javascript";
- }
- return MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension);
- }
-
- /**
- * Opens a stream to the given URI, also providing the MIME type & length.
- * @return Never returns null.
- * @throws Throws an InvalidArgumentException for relative URIs. Relative URIs should be
- * resolved before being passed into this function.
- * @throws Throws an IOException if the URI cannot be opened.
- * @throws Throws an IllegalStateException if called on a foreground thread.
- */
- public OpenForReadResult openForRead(Uri uri) throws IOException {
- return openForRead(uri, false);
- }
-
- /**
- * Opens a stream to the given URI, also providing the MIME type & length.
- * @return Never returns null.
- * @throws Throws an InvalidArgumentException for relative URIs. Relative URIs should be
- * resolved before being passed into this function.
- * @throws Throws an IOException if the URI cannot be opened.
- * @throws Throws an IllegalStateException if called on a foreground thread and skipThreadCheck is false.
- */
- public OpenForReadResult openForRead(Uri uri, boolean skipThreadCheck) throws IOException {
- if (!skipThreadCheck) {
- assertBackgroundThread();
- }
- switch (getUriType(uri)) {
- case URI_TYPE_FILE: {
- FileInputStream inputStream = new FileInputStream(uri.getPath());
- String mimeType = getMimeTypeFromPath(uri.getPath());
- long length = inputStream.getChannel().size();
- return new OpenForReadResult(uri, inputStream, mimeType, length, null);
- }
- case URI_TYPE_ASSET: {
- String assetPath = uri.getPath().substring(15);
- AssetFileDescriptor assetFd = null;
- InputStream inputStream;
- long length = -1;
- try {
- assetFd = assetManager.openFd(assetPath);
- inputStream = assetFd.createInputStream();
- length = assetFd.getLength();
- } catch (FileNotFoundException e) {
- // Will occur if the file is compressed.
- inputStream = assetManager.open(assetPath);
- }
- String mimeType = getMimeTypeFromPath(assetPath);
- return new OpenForReadResult(uri, inputStream, mimeType, length, assetFd);
- }
- case URI_TYPE_CONTENT:
- case URI_TYPE_RESOURCE: {
- String mimeType = contentResolver.getType(uri);
- AssetFileDescriptor assetFd = contentResolver.openAssetFileDescriptor(uri, "r");
- InputStream inputStream = assetFd.createInputStream();
- long length = assetFd.getLength();
- return new OpenForReadResult(uri, inputStream, mimeType, length, assetFd);
- }
- case URI_TYPE_DATA: {
- OpenForReadResult ret = readDataUri(uri);
- if (ret == null) {
- break;
- }
- return ret;
- }
- case URI_TYPE_HTTP:
- case URI_TYPE_HTTPS: {
- HttpURLConnection conn = (HttpURLConnection)new URL(uri.toString()).openConnection();
- conn.setDoInput(true);
- String mimeType = conn.getHeaderField("Content-Type");
- if (mimeType != null) {
- mimeType = mimeType.split(";")[0];
- }
- int length = conn.getContentLength();
- InputStream inputStream = conn.getInputStream();
- return new OpenForReadResult(uri, inputStream, mimeType, length, null);
- }
- case URI_TYPE_PLUGIN: {
- String pluginId = uri.getHost();
- CordovaPlugin plugin = pluginManager.getPlugin(pluginId);
- if (plugin == null) {
- throw new FileNotFoundException("Invalid plugin ID in URI: " + uri);
- }
- return plugin.handleOpenForRead(uri);
- }
- }
- throw new FileNotFoundException("URI not supported by CordovaResourceApi: " + uri);
- }
-
- public OutputStream openOutputStream(Uri uri) throws IOException {
- return openOutputStream(uri, false);
- }
-
- /**
- * Opens a stream to the given URI.
- * @return Never returns null.
- * @throws Throws an InvalidArgumentException for relative URIs. Relative URIs should be
- * resolved before being passed into this function.
- * @throws Throws an IOException if the URI cannot be opened.
- */
- public OutputStream openOutputStream(Uri uri, boolean append) throws IOException {
- assertBackgroundThread();
- switch (getUriType(uri)) {
- case URI_TYPE_FILE: {
- File localFile = new File(uri.getPath());
- File parent = localFile.getParentFile();
- if (parent != null) {
- parent.mkdirs();
- }
- return new FileOutputStream(localFile, append);
- }
- case URI_TYPE_CONTENT:
- case URI_TYPE_RESOURCE: {
- AssetFileDescriptor assetFd = contentResolver.openAssetFileDescriptor(uri, append ? "wa" : "w");
- return assetFd.createOutputStream();
- }
- }
- throw new FileNotFoundException("URI not supported by CordovaResourceApi: " + uri);
- }
-
- public HttpURLConnection createHttpConnection(Uri uri) throws IOException {
- assertBackgroundThread();
- return (HttpURLConnection)new URL(uri.toString()).openConnection();
- }
-
- // Copies the input to the output in the most efficient manner possible.
- // Closes both streams.
- public void copyResource(OpenForReadResult input, OutputStream outputStream) throws IOException {
- assertBackgroundThread();
- try {
- InputStream inputStream = input.inputStream;
- if (inputStream instanceof FileInputStream && outputStream instanceof FileOutputStream) {
- FileChannel inChannel = ((FileInputStream)input.inputStream).getChannel();
- FileChannel outChannel = ((FileOutputStream)outputStream).getChannel();
- long offset = 0;
- long length = input.length;
- if (input.assetFd != null) {
- offset = input.assetFd.getStartOffset();
- }
- // transferFrom()'s 2nd arg is a relative position. Need to set the absolute
- // position first.
- inChannel.position(offset);
- outChannel.transferFrom(inChannel, 0, length);
- } else {
- final int BUFFER_SIZE = 8192;
- byte[] buffer = new byte[BUFFER_SIZE];
-
- for (;;) {
- int bytesRead = inputStream.read(buffer, 0, BUFFER_SIZE);
-
- if (bytesRead <= 0) {
- break;
- }
- outputStream.write(buffer, 0, bytesRead);
- }
- }
- } finally {
- input.inputStream.close();
- if (outputStream != null) {
- outputStream.close();
- }
- }
- }
-
- public void copyResource(Uri sourceUri, OutputStream outputStream) throws IOException {
- copyResource(openForRead(sourceUri), outputStream);
- }
-
- // Added in 3.5.0.
- public void copyResource(Uri sourceUri, Uri dstUri) throws IOException {
- copyResource(openForRead(sourceUri), openOutputStream(dstUri));
- }
-
- private void assertBackgroundThread() {
- if (threadCheckingEnabled) {
- Thread curThread = Thread.currentThread();
- if (curThread == Looper.getMainLooper().getThread()) {
- throw new IllegalStateException("Do not perform IO operations on the UI thread. Use CordovaInterface.getThreadPool() instead.");
- }
- if (curThread == jsThread) {
- throw new IllegalStateException("Tried to perform an IO operation on the WebCore thread. Use CordovaInterface.getThreadPool() instead.");
- }
- }
- }
-
- private String getDataUriMimeType(Uri uri) {
- String uriAsString = uri.getSchemeSpecificPart();
- int commaPos = uriAsString.indexOf(',');
- if (commaPos == -1) {
- return null;
- }
- String[] mimeParts = uriAsString.substring(0, commaPos).split(";");
- if (mimeParts.length > 0) {
- return mimeParts[0];
- }
- return null;
- }
-
- private OpenForReadResult readDataUri(Uri uri) {
- String uriAsString = uri.getSchemeSpecificPart();
- int commaPos = uriAsString.indexOf(',');
- if (commaPos == -1) {
- return null;
- }
- String[] mimeParts = uriAsString.substring(0, commaPos).split(";");
- String contentType = null;
- boolean base64 = false;
- if (mimeParts.length > 0) {
- contentType = mimeParts[0];
- }
- for (int i = 1; i < mimeParts.length; ++i) {
- if ("base64".equalsIgnoreCase(mimeParts[i])) {
- base64 = true;
- }
- }
- String dataPartAsString = uriAsString.substring(commaPos + 1);
- byte[] data;
- if (base64) {
- data = Base64.decode(dataPartAsString, Base64.DEFAULT);
- } else {
- try {
- data = dataPartAsString.getBytes("UTF-8");
- } catch (UnsupportedEncodingException e) {
- data = dataPartAsString.getBytes();
- }
- }
- InputStream inputStream = new ByteArrayInputStream(data);
- return new OpenForReadResult(uri, inputStream, contentType, data.length, null);
- }
-
- private static void assertNonRelative(Uri uri) {
- if (!uri.isAbsolute()) {
- throw new IllegalArgumentException("Relative URIs are not supported.");
- }
- }
-
- public static final class OpenForReadResult {
- public final Uri uri;
- public final InputStream inputStream;
- public final String mimeType;
- public final long length;
- public final AssetFileDescriptor assetFd;
-
- public OpenForReadResult(Uri uri, InputStream inputStream, String mimeType, long length, AssetFileDescriptor assetFd) {
- this.uri = uri;
- this.inputStream = inputStream;
- this.mimeType = mimeType;
- this.length = length;
- this.assetFd = assetFd;
- }
- }
-}
diff --git a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebView.java b/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebView.java
deleted file mode 100644
index 2eebd0d..0000000
--- a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebView.java
+++ /dev/null
@@ -1,142 +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.
-*/
-package org.apache.cordova;
-
-import java.util.List;
-import java.util.Map;
-
-import android.content.Context;
-import android.content.Intent;
-import android.view.View;
-import android.webkit.WebChromeClient.CustomViewCallback;
-
-/**
- * Main interface for interacting with a Cordova webview - implemented by CordovaWebViewImpl.
- * This is an interface so that it can be easily mocked in tests.
- * Methods may be added to this interface without a major version bump, as plugins & embedders
- * are not expected to implement it.
- */
-public interface CordovaWebView {
- public static final String CORDOVA_VERSION = "6.1.2";
-
- void init(CordovaInterface cordova, List pluginEntries, CordovaPreferences preferences);
-
- boolean isInitialized();
-
- View getView();
-
- void loadUrlIntoView(String url, boolean recreatePlugins);
-
- void stopLoading();
-
- boolean canGoBack();
-
- void clearCache();
-
- /** Use parameter-less overload */
- @Deprecated
- void clearCache(boolean b);
-
- void clearHistory();
-
- boolean backHistory();
-
- void handlePause(boolean keepRunning);
-
- void onNewIntent(Intent intent);
-
- void handleResume(boolean keepRunning);
-
- void handleStart();
-
- void handleStop();
-
- void handleDestroy();
-
- /**
- * Send JavaScript statement back to JavaScript.
- *
- * Deprecated (https://issues.apache.org/jira/browse/CB-6851)
- * Instead of executing snippets of JS, you should use the exec bridge
- * to create a Java->JS communication channel.
- * To do this:
- * 1. Within plugin.xml (to have your JS run before deviceready):
- *
- * 2. Within your .js (call exec on start-up):
- * require('cordova/channel').onCordovaReady.subscribe(function() {
- * require('cordova/exec')(win, null, 'Plugin', 'method', []);
- * function win(message) {
- * ... process message from java here ...
- * }
- * });
- * 3. Within your .java:
- * PluginResult dataResult = new PluginResult(PluginResult.Status.OK, CODE);
- * dataResult.setKeepCallback(true);
- * savedCallbackContext.sendPluginResult(dataResult);
- */
- @Deprecated
- void sendJavascript(String statememt);
-
- /**
- * Load the specified URL in the Cordova webview or a new browser instance.
- *
- * NOTE: If openExternal is false, only whitelisted URLs can be loaded.
- *
- * @param url The url to load.
- * @param openExternal Load url in browser instead of Cordova webview.
- * @param clearHistory Clear the history stack, so new page becomes top of history
- * @param params Parameters for new app
- */
- void showWebPage(String url, boolean openExternal, boolean clearHistory, Map params);
-
- /**
- * Deprecated in 4.0.0. Use your own View-toggling logic.
- */
- @Deprecated
- boolean isCustomViewShowing();
-
- /**
- * Deprecated in 4.0.0. Use your own View-toggling logic.
- */
- @Deprecated
- void showCustomView(View view, CustomViewCallback callback);
-
- /**
- * Deprecated in 4.0.0. Use your own View-toggling logic.
- */
- @Deprecated
- void hideCustomView();
-
- CordovaResourceApi getResourceApi();
-
- void setButtonPlumbedToJs(int keyCode, boolean override);
- boolean isButtonPlumbedToJs(int keyCode);
-
- void sendPluginResult(PluginResult cr, String callbackId);
-
- PluginManager getPluginManager();
- CordovaWebViewEngine getEngine();
- CordovaPreferences getPreferences();
- ICordovaCookieManager getCookieManager();
-
- String getUrl();
-
- // TODO: Work on deleting these by removing refs from plugins.
- Context getContext();
- void loadUrl(String url);
- Object postMessage(String id, Object data);
-}
diff --git a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebViewEngine.java b/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebViewEngine.java
deleted file mode 100644
index c8e5a55..0000000
--- a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebViewEngine.java
+++ /dev/null
@@ -1,85 +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.
-*/
-package org.apache.cordova;
-
-import android.view.KeyEvent;
-import android.view.View;
-import android.webkit.ValueCallback;
-
-/**
- * Interface for all Cordova engines.
- * No methods will be added to this class (in order to be compatible with existing engines).
- * Instead, we will create a new interface: e.g. CordovaWebViewEngineV2
- */
-public interface CordovaWebViewEngine {
- void init(CordovaWebView parentWebView, CordovaInterface cordova, Client client,
- CordovaResourceApi resourceApi, PluginManager pluginManager,
- NativeToJsMessageQueue nativeToJsMessageQueue);
-
- CordovaWebView getCordovaWebView();
- ICordovaCookieManager getCookieManager();
- View getView();
-
- void loadUrl(String url, boolean clearNavigationStack);
-
- void stopLoading();
-
- /** Return the currently loaded URL */
- String getUrl();
-
- void clearCache();
-
- /** After calling clearHistory(), canGoBack() should be false. */
- void clearHistory();
-
- boolean canGoBack();
-
- /** Returns whether a navigation occurred */
- boolean goBack();
-
- /** Pauses / resumes the WebView's event loop. */
- void setPaused(boolean value);
-
- /** Clean up all resources associated with the WebView. */
- void destroy();
-
- /** Add the evaulate Javascript method **/
- void evaluateJavascript(String js, ValueCallback callback);
-
- /**
- * Used to retrieve the associated CordovaWebView given a View without knowing the type of Engine.
- * E.g. ((CordovaWebView.EngineView)activity.findViewById(android.R.id.webView)).getCordovaWebView();
- */
- public interface EngineView {
- CordovaWebView getCordovaWebView();
- }
-
- /**
- * Contains methods that an engine uses to communicate with the parent CordovaWebView.
- * Methods may be added in future cordova versions, but never removed.
- */
- public interface Client {
- Boolean onDispatchKeyEvent(KeyEvent event);
- void clearLoadTimeoutTimer();
- void onPageStarted(String newUrl);
- void onReceivedError(int errorCode, String description, String failingUrl);
- void onPageFinishedLoading(String url);
- boolean onNavigationAttempt(String url);
- }
-}
diff --git a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebViewImpl.java b/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebViewImpl.java
deleted file mode 100644
index 85a0b5f..0000000
--- a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebViewImpl.java
+++ /dev/null
@@ -1,613 +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.
-*/
-package org.apache.cordova;
-
-import android.content.Context;
-import android.content.Intent;
-import android.net.Uri;
-import android.view.Gravity;
-import android.view.KeyEvent;
-import android.view.View;
-import android.view.ViewGroup;
-import android.webkit.WebChromeClient;
-import android.widget.FrameLayout;
-
-import org.apache.cordova.engine.SystemWebViewEngine;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import java.lang.reflect.Constructor;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * Main class for interacting with a Cordova webview. Manages plugins, events, and a CordovaWebViewEngine.
- * Class uses two-phase initialization. You must call init() before calling any other methods.
- */
-public class CordovaWebViewImpl implements CordovaWebView {
-
- public static final String TAG = "CordovaWebViewImpl";
-
- private PluginManager pluginManager;
-
- protected final CordovaWebViewEngine engine;
- private CordovaInterface cordova;
-
- // Flag to track that a loadUrl timeout occurred
- private int loadUrlTimeout = 0;
-
- private CordovaResourceApi resourceApi;
- private CordovaPreferences preferences;
- private CoreAndroid appPlugin;
- private NativeToJsMessageQueue nativeToJsMessageQueue;
- private EngineClient engineClient = new EngineClient();
- private boolean hasPausedEver;
-
- // The URL passed to loadUrl(), not necessarily the URL of the current page.
- String loadedUrl;
-
- /** custom view created by the browser (a video player for example) */
- private View mCustomView;
- private WebChromeClient.CustomViewCallback mCustomViewCallback;
-
- private Set boundKeyCodes = new HashSet();
-
- public static CordovaWebViewEngine createEngine(Context context, CordovaPreferences preferences) {
- String className = preferences.getString("webview", SystemWebViewEngine.class.getCanonicalName());
- try {
- Class> webViewClass = Class.forName(className);
- Constructor> constructor = webViewClass.getConstructor(Context.class, CordovaPreferences.class);
- return (CordovaWebViewEngine) constructor.newInstance(context, preferences);
- } catch (Exception e) {
- throw new RuntimeException("Failed to create webview. ", e);
- }
- }
-
- public CordovaWebViewImpl(CordovaWebViewEngine cordovaWebViewEngine) {
- this.engine = cordovaWebViewEngine;
- }
-
- // Convenience method for when creating programmatically (not from Config.xml).
- public void init(CordovaInterface cordova) {
- init(cordova, new ArrayList(), new CordovaPreferences());
- }
-
- @Override
- public void init(CordovaInterface cordova, List pluginEntries, CordovaPreferences preferences) {
- if (this.cordova != null) {
- throw new IllegalStateException();
- }
- this.cordova = cordova;
- this.preferences = preferences;
- pluginManager = new PluginManager(this, this.cordova, pluginEntries);
- resourceApi = new CordovaResourceApi(engine.getView().getContext(), pluginManager);
- nativeToJsMessageQueue = new NativeToJsMessageQueue();
- nativeToJsMessageQueue.addBridgeMode(new NativeToJsMessageQueue.NoOpBridgeMode());
- nativeToJsMessageQueue.addBridgeMode(new NativeToJsMessageQueue.LoadUrlBridgeMode(engine, cordova));
-
- if (preferences.getBoolean("DisallowOverscroll", false)) {
- engine.getView().setOverScrollMode(View.OVER_SCROLL_NEVER);
- }
- engine.init(this, cordova, engineClient, resourceApi, pluginManager, nativeToJsMessageQueue);
- // This isn't enforced by the compiler, so assert here.
- assert engine.getView() instanceof CordovaWebViewEngine.EngineView;
-
- pluginManager.addService(CoreAndroid.PLUGIN_NAME, "org.apache.cordova.CoreAndroid");
- pluginManager.init();
-
- }
-
- @Override
- public boolean isInitialized() {
- return cordova != null;
- }
-
- @Override
- public void loadUrlIntoView(final String url, boolean recreatePlugins) {
- LOG.d(TAG, ">>> loadUrl(" + url + ")");
- if (url.equals("about:blank") || url.startsWith("javascript:")) {
- engine.loadUrl(url, false);
- return;
- }
-
- recreatePlugins = recreatePlugins || (loadedUrl == null);
-
- if (recreatePlugins) {
- // Don't re-initialize on first load.
- if (loadedUrl != null) {
- appPlugin = null;
- pluginManager.init();
- }
- loadedUrl = url;
- }
-
- // Create a timeout timer for loadUrl
- final int currentLoadUrlTimeout = loadUrlTimeout;
- final int loadUrlTimeoutValue = preferences.getInteger("LoadUrlTimeoutValue", 20000);
-
- // Timeout error method
- final Runnable loadError = new Runnable() {
- public void run() {
- stopLoading();
- LOG.e(TAG, "CordovaWebView: TIMEOUT ERROR!");
-
- // Handle other errors by passing them to the webview in JS
- JSONObject data = new JSONObject();
- try {
- data.put("errorCode", -6);
- data.put("description", "The connection to the server was unsuccessful.");
- data.put("url", url);
- } catch (JSONException e) {
- // Will never happen.
- }
- pluginManager.postMessage("onReceivedError", data);
- }
- };
-
- // Timeout timer method
- final Runnable timeoutCheck = new Runnable() {
- public void run() {
- try {
- synchronized (this) {
- wait(loadUrlTimeoutValue);
- }
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
-
- // If timeout, then stop loading and handle error
- if (loadUrlTimeout == currentLoadUrlTimeout) {
- cordova.getActivity().runOnUiThread(loadError);
- }
- }
- };
-
- final boolean _recreatePlugins = recreatePlugins;
- cordova.getActivity().runOnUiThread(new Runnable() {
- public void run() {
- if (loadUrlTimeoutValue > 0) {
- cordova.getThreadPool().execute(timeoutCheck);
- }
- engine.loadUrl(url, _recreatePlugins);
- }
- });
- }
-
-
- @Override
- public void loadUrl(String url) {
- loadUrlIntoView(url, true);
- }
-
- @Override
- public void showWebPage(String url, boolean openExternal, boolean clearHistory, Map params) {
- LOG.d(TAG, "showWebPage(%s, %b, %b, HashMap)", url, openExternal, clearHistory);
-
- // If clearing history
- if (clearHistory) {
- engine.clearHistory();
- }
-
- // If loading into our webview
- if (!openExternal) {
- // Make sure url is in whitelist
- if (pluginManager.shouldAllowNavigation(url)) {
- // TODO: What about params?
- // Load new URL
- loadUrlIntoView(url, true);
- } else {
- LOG.w(TAG, "showWebPage: Refusing to load URL into webview since it is not in the whitelist. URL=" + url);
- }
- }
- if (!pluginManager.shouldOpenExternalUrl(url)) {
- LOG.w(TAG, "showWebPage: Refusing to send intent for URL since it is not in the whitelist. URL=" + url);
- return;
- }
- try {
- Intent intent = new Intent(Intent.ACTION_VIEW);
- // To send an intent without CATEGORY_BROWSER, a custom plugin should be used.
- intent.addCategory(Intent.CATEGORY_BROWSABLE);
- Uri uri = Uri.parse(url);
- // Omitting the MIME type for file: URLs causes "No Activity found to handle Intent".
- // Adding the MIME type to http: URLs causes them to not be handled by the downloader.
- if ("file".equals(uri.getScheme())) {
- intent.setDataAndType(uri, resourceApi.getMimeType(uri));
- } else {
- intent.setData(uri);
- }
- cordova.getActivity().startActivity(intent);
- } catch (android.content.ActivityNotFoundException e) {
- LOG.e(TAG, "Error loading url " + url, e);
- }
- }
-
- @Override
- @Deprecated
- public void showCustomView(View view, WebChromeClient.CustomViewCallback callback) {
- // This code is adapted from the original Android Browser code, licensed under the Apache License, Version 2.0
- LOG.d(TAG, "showing Custom View");
- // if a view already exists then immediately terminate the new one
- if (mCustomView != null) {
- callback.onCustomViewHidden();
- return;
- }
-
- // Store the view and its callback for later (to kill it properly)
- mCustomView = view;
- mCustomViewCallback = callback;
-
- // Add the custom view to its container.
- ViewGroup parent = (ViewGroup) engine.getView().getParent();
- parent.addView(view, new FrameLayout.LayoutParams(
- ViewGroup.LayoutParams.MATCH_PARENT,
- ViewGroup.LayoutParams.MATCH_PARENT,
- Gravity.CENTER));
-
- // Hide the content view.
- engine.getView().setVisibility(View.GONE);
-
- // Finally show the custom view container.
- parent.setVisibility(View.VISIBLE);
- parent.bringToFront();
- }
-
- @Override
- @Deprecated
- public void hideCustomView() {
- // This code is adapted from the original Android Browser code, licensed under the Apache License, Version 2.0
- if (mCustomView == null) return;
- LOG.d(TAG, "Hiding Custom View");
-
- // Hide the custom view.
- mCustomView.setVisibility(View.GONE);
-
- // Remove the custom view from its container.
- ViewGroup parent = (ViewGroup) engine.getView().getParent();
- parent.removeView(mCustomView);
- mCustomView = null;
- mCustomViewCallback.onCustomViewHidden();
-
- // Show the content view.
- engine.getView().setVisibility(View.VISIBLE);
- }
-
- @Override
- @Deprecated
- public boolean isCustomViewShowing() {
- return mCustomView != null;
- }
-
- @Override
- @Deprecated
- public void sendJavascript(String statement) {
- nativeToJsMessageQueue.addJavaScript(statement);
- }
-
- @Override
- public void sendPluginResult(PluginResult cr, String callbackId) {
- nativeToJsMessageQueue.addPluginResult(cr, callbackId);
- }
-
- @Override
- public PluginManager getPluginManager() {
- return pluginManager;
- }
- @Override
- public CordovaPreferences getPreferences() {
- return preferences;
- }
- @Override
- public ICordovaCookieManager getCookieManager() {
- return engine.getCookieManager();
- }
- @Override
- public CordovaResourceApi getResourceApi() {
- return resourceApi;
- }
- @Override
- public CordovaWebViewEngine getEngine() {
- return engine;
- }
- @Override
- public View getView() {
- return engine.getView();
- }
- @Override
- public Context getContext() {
- return engine.getView().getContext();
- }
-
- private void sendJavascriptEvent(String event) {
- if (appPlugin == null) {
- appPlugin = (CoreAndroid)pluginManager.getPlugin(CoreAndroid.PLUGIN_NAME);
- }
-
- if (appPlugin == null) {
- LOG.w(TAG, "Unable to fire event without existing plugin");
- return;
- }
- appPlugin.fireJavascriptEvent(event);
- }
-
- @Override
- public void setButtonPlumbedToJs(int keyCode, boolean override) {
- switch (keyCode) {
- case KeyEvent.KEYCODE_VOLUME_DOWN:
- case KeyEvent.KEYCODE_VOLUME_UP:
- case KeyEvent.KEYCODE_BACK:
- case KeyEvent.KEYCODE_MENU:
- // TODO: Why are search and menu buttons handled separately?
- if (override) {
- boundKeyCodes.add(keyCode);
- } else {
- boundKeyCodes.remove(keyCode);
- }
- return;
- default:
- throw new IllegalArgumentException("Unsupported keycode: " + keyCode);
- }
- }
-
- @Override
- public boolean isButtonPlumbedToJs(int keyCode) {
- return boundKeyCodes.contains(keyCode);
- }
-
- @Override
- public Object postMessage(String id, Object data) {
- return pluginManager.postMessage(id, data);
- }
-
- // Engine method proxies:
- @Override
- public String getUrl() {
- return engine.getUrl();
- }
-
- @Override
- public void stopLoading() {
- // Clear timeout flag
- loadUrlTimeout++;
- }
-
- @Override
- public boolean canGoBack() {
- return engine.canGoBack();
- }
-
- @Override
- public void clearCache() {
- engine.clearCache();
- }
-
- @Override
- @Deprecated
- public void clearCache(boolean b) {
- engine.clearCache();
- }
-
- @Override
- public void clearHistory() {
- engine.clearHistory();
- }
-
- @Override
- public boolean backHistory() {
- return engine.goBack();
- }
-
- /////// LifeCycle methods ///////
- @Override
- public void onNewIntent(Intent intent) {
- if (this.pluginManager != null) {
- this.pluginManager.onNewIntent(intent);
- }
- }
- @Override
- public void handlePause(boolean keepRunning) {
- if (!isInitialized()) {
- return;
- }
- hasPausedEver = true;
- pluginManager.onPause(keepRunning);
- sendJavascriptEvent("pause");
-
- // If app doesn't want to run in background
- if (!keepRunning) {
- // Pause JavaScript timers. This affects all webviews within the app!
- engine.setPaused(true);
- }
- }
- @Override
- public void handleResume(boolean keepRunning) {
- if (!isInitialized()) {
- return;
- }
-
- // Resume JavaScript timers. This affects all webviews within the app!
- engine.setPaused(false);
- this.pluginManager.onResume(keepRunning);
-
- // In order to match the behavior of the other platforms, we only send onResume after an
- // onPause has occurred. The resume event might still be sent if the Activity was killed
- // while waiting for the result of an external Activity once the result is obtained
- if (hasPausedEver) {
- sendJavascriptEvent("resume");
- }
- }
- @Override
- public void handleStart() {
- if (!isInitialized()) {
- return;
- }
- pluginManager.onStart();
- }
- @Override
- public void handleStop() {
- if (!isInitialized()) {
- return;
- }
- pluginManager.onStop();
- }
- @Override
- public void handleDestroy() {
- if (!isInitialized()) {
- return;
- }
- // Cancel pending timeout timer.
- loadUrlTimeout++;
-
- // Forward to plugins
- this.pluginManager.onDestroy();
-
- // TODO: about:blank is a bit special (and the default URL for new frames)
- // We should use a blank data: url instead so it's more obvious
- this.loadUrl("about:blank");
-
- // TODO: Should not destroy webview until after about:blank is done loading.
- engine.destroy();
- hideCustomView();
- }
-
- protected class EngineClient implements CordovaWebViewEngine.Client {
- @Override
- public void clearLoadTimeoutTimer() {
- loadUrlTimeout++;
- }
-
- @Override
- public void onPageStarted(String newUrl) {
- LOG.d(TAG, "onPageDidNavigate(" + newUrl + ")");
- boundKeyCodes.clear();
- pluginManager.onReset();
- pluginManager.postMessage("onPageStarted", newUrl);
- }
-
- @Override
- public void onReceivedError(int errorCode, String description, String failingUrl) {
- clearLoadTimeoutTimer();
- JSONObject data = new JSONObject();
- try {
- data.put("errorCode", errorCode);
- data.put("description", description);
- data.put("url", failingUrl);
- } catch (JSONException e) {
- e.printStackTrace();
- }
- pluginManager.postMessage("onReceivedError", data);
- }
-
- @Override
- public void onPageFinishedLoading(String url) {
- LOG.d(TAG, "onPageFinished(" + url + ")");
-
- clearLoadTimeoutTimer();
-
- // Broadcast message that page has loaded
- pluginManager.postMessage("onPageFinished", url);
-
- // Make app visible after 2 sec in case there was a JS error and Cordova JS never initialized correctly
- if (engine.getView().getVisibility() != View.VISIBLE) {
- Thread t = new Thread(new Runnable() {
- public void run() {
- try {
- Thread.sleep(2000);
- cordova.getActivity().runOnUiThread(new Runnable() {
- public void run() {
- pluginManager.postMessage("spinner", "stop");
- }
- });
- } catch (InterruptedException e) {
- }
- }
- });
- t.start();
- }
-
- // Shutdown if blank loaded
- if (url.equals("about:blank")) {
- pluginManager.postMessage("exit", null);
- }
- }
-
- @Override
- public Boolean onDispatchKeyEvent(KeyEvent event) {
- int keyCode = event.getKeyCode();
- boolean isBackButton = keyCode == KeyEvent.KEYCODE_BACK;
- if (event.getAction() == KeyEvent.ACTION_DOWN) {
- if (isBackButton && mCustomView != null) {
- return true;
- } else if (boundKeyCodes.contains(keyCode)) {
- return true;
- } else if (isBackButton) {
- return engine.canGoBack();
- }
- } else if (event.getAction() == KeyEvent.ACTION_UP) {
- if (isBackButton && mCustomView != null) {
- hideCustomView();
- return true;
- } else if (boundKeyCodes.contains(keyCode)) {
- String eventName = null;
- switch (keyCode) {
- case KeyEvent.KEYCODE_VOLUME_DOWN:
- eventName = "volumedownbutton";
- break;
- case KeyEvent.KEYCODE_VOLUME_UP:
- eventName = "volumeupbutton";
- break;
- case KeyEvent.KEYCODE_SEARCH:
- eventName = "searchbutton";
- break;
- case KeyEvent.KEYCODE_MENU:
- eventName = "menubutton";
- break;
- case KeyEvent.KEYCODE_BACK:
- eventName = "backbutton";
- break;
- }
- if (eventName != null) {
- sendJavascriptEvent(eventName);
- return true;
- }
- } else if (isBackButton) {
- return engine.goBack();
- }
- }
- return null;
- }
-
- @Override
- public boolean onNavigationAttempt(String url) {
- // Give plugins the chance to handle the url
- if (pluginManager.onOverrideUrlLoading(url)) {
- return true;
- } else if (pluginManager.shouldAllowNavigation(url)) {
- return false;
- } else if (pluginManager.shouldOpenExternalUrl(url)) {
- showWebPage(url, true, false, null);
- return true;
- }
- LOG.w(TAG, "Blocked (possibly sub-frame) navigation to non-allowed URL: " + url);
- return true;
- }
- }
-}
diff --git a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/CoreAndroid.java b/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/CoreAndroid.java
deleted file mode 100644
index e384f8d..0000000
--- a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/CoreAndroid.java
+++ /dev/null
@@ -1,390 +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.
-*/
-
-package org.apache.cordova;
-
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import android.content.BroadcastReceiver;
-import android.content.Context;
-import android.content.Intent;
-import android.content.IntentFilter;
-import android.telephony.TelephonyManager;
-import android.view.KeyEvent;
-
-import java.lang.reflect.Field;
-import java.util.HashMap;
-
-/**
- * This class exposes methods in Cordova that can be called from JavaScript.
- */
-public class CoreAndroid extends CordovaPlugin {
-
- public static final String PLUGIN_NAME = "CoreAndroid";
- protected static final String TAG = "CordovaApp";
- private BroadcastReceiver telephonyReceiver;
- private CallbackContext messageChannel;
- private PluginResult pendingResume;
- private final Object messageChannelLock = new Object();
-
- /**
- * Send an event to be fired on the Javascript side.
- *
- * @param action The name of the event to be fired
- */
- public void fireJavascriptEvent(String action) {
- sendEventMessage(action);
- }
-
- /**
- * Sets the context of the Command. This can then be used to do things like
- * get file paths associated with the Activity.
- */
- @Override
- public void pluginInitialize() {
- this.initTelephonyReceiver();
- }
-
- /**
- * Executes the request and returns PluginResult.
- *
- * @param action The action to execute.
- * @param args JSONArry of arguments for the plugin.
- * @param callbackContext The callback context from which we were invoked.
- * @return A PluginResult object with a status and message.
- */
- public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
- PluginResult.Status status = PluginResult.Status.OK;
- String result = "";
-
- try {
- if (action.equals("clearCache")) {
- this.clearCache();
- }
- else if (action.equals("show")) {
- // This gets called from JavaScript onCordovaReady to show the webview.
- // I recommend we change the name of the Message as spinner/stop is not
- // indicative of what this actually does (shows the webview).
- cordova.getActivity().runOnUiThread(new Runnable() {
- public void run() {
- webView.getPluginManager().postMessage("spinner", "stop");
- }
- });
- }
- else if (action.equals("loadUrl")) {
- this.loadUrl(args.getString(0), args.optJSONObject(1));
- }
- else if (action.equals("cancelLoadUrl")) {
- //this.cancelLoadUrl();
- }
- else if (action.equals("clearHistory")) {
- this.clearHistory();
- }
- else if (action.equals("backHistory")) {
- this.backHistory();
- }
- else if (action.equals("overrideButton")) {
- this.overrideButton(args.getString(0), args.getBoolean(1));
- }
- else if (action.equals("overrideBackbutton")) {
- this.overrideBackbutton(args.getBoolean(0));
- }
- else if (action.equals("exitApp")) {
- this.exitApp();
- }
- else if (action.equals("messageChannel")) {
- synchronized(messageChannelLock) {
- messageChannel = callbackContext;
- if (pendingResume != null) {
- sendEventMessage(pendingResume);
- pendingResume = null;
- }
- }
- return true;
- }
-
- callbackContext.sendPluginResult(new PluginResult(status, result));
- return true;
- } catch (JSONException e) {
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.JSON_EXCEPTION));
- return false;
- }
- }
-
- //--------------------------------------------------------------------------
- // LOCAL METHODS
- //--------------------------------------------------------------------------
-
- /**
- * Clear the resource cache.
- */
- public void clearCache() {
- cordova.getActivity().runOnUiThread(new Runnable() {
- public void run() {
- webView.clearCache(true);
- }
- });
- }
-
- /**
- * Load the url into the webview.
- *
- * @param url
- * @param props Properties that can be passed in to the Cordova activity (i.e. loadingDialog, wait, ...)
- * @throws JSONException
- */
- public void loadUrl(String url, JSONObject props) throws JSONException {
- LOG.d("App", "App.loadUrl("+url+","+props+")");
- int wait = 0;
- boolean openExternal = false;
- boolean clearHistory = false;
-
- // If there are properties, then set them on the Activity
- HashMap params = new HashMap();
- if (props != null) {
- JSONArray keys = props.names();
- for (int i = 0; i < keys.length(); i++) {
- String key = keys.getString(i);
- if (key.equals("wait")) {
- wait = props.getInt(key);
- }
- else if (key.equalsIgnoreCase("openexternal")) {
- openExternal = props.getBoolean(key);
- }
- else if (key.equalsIgnoreCase("clearhistory")) {
- clearHistory = props.getBoolean(key);
- }
- else {
- Object value = props.get(key);
- if (value == null) {
-
- }
- else if (value.getClass().equals(String.class)) {
- params.put(key, (String)value);
- }
- else if (value.getClass().equals(Boolean.class)) {
- params.put(key, (Boolean)value);
- }
- else if (value.getClass().equals(Integer.class)) {
- params.put(key, (Integer)value);
- }
- }
- }
- }
-
- // If wait property, then delay loading
-
- if (wait > 0) {
- try {
- synchronized(this) {
- this.wait(wait);
- }
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- this.webView.showWebPage(url, openExternal, clearHistory, params);
- }
-
- /**
- * Clear page history for the app.
- */
- public void clearHistory() {
- cordova.getActivity().runOnUiThread(new Runnable() {
- public void run() {
- webView.clearHistory();
- }
- });
- }
-
- /**
- * Go to previous page displayed.
- * This is the same as pressing the backbutton on Android device.
- */
- public void backHistory() {
- cordova.getActivity().runOnUiThread(new Runnable() {
- public void run() {
- webView.backHistory();
- }
- });
- }
-
- /**
- * Override the default behavior of the Android back button.
- * If overridden, when the back button is pressed, the "backKeyDown" JavaScript event will be fired.
- *
- * @param override T=override, F=cancel override
- */
- public void overrideBackbutton(boolean override) {
- LOG.i("App", "WARNING: Back Button Default Behavior will be overridden. The backbutton event will be fired!");
- webView.setButtonPlumbedToJs(KeyEvent.KEYCODE_BACK, override);
- }
-
- /**
- * Override the default behavior of the Android volume buttons.
- * If overridden, when the volume button is pressed, the "volume[up|down]button" JavaScript event will be fired.
- *
- * @param button volumeup, volumedown
- * @param override T=override, F=cancel override
- */
- public void overrideButton(String button, boolean override) {
- LOG.i("App", "WARNING: Volume Button Default Behavior will be overridden. The volume event will be fired!");
- if (button.equals("volumeup")) {
- webView.setButtonPlumbedToJs(KeyEvent.KEYCODE_VOLUME_UP, override);
- }
- else if (button.equals("volumedown")) {
- webView.setButtonPlumbedToJs(KeyEvent.KEYCODE_VOLUME_DOWN, override);
- }
- else if (button.equals("menubutton")) {
- webView.setButtonPlumbedToJs(KeyEvent.KEYCODE_MENU, override);
- }
- }
-
- /**
- * Return whether the Android back button is overridden by the user.
- *
- * @return boolean
- */
- public boolean isBackbuttonOverridden() {
- return webView.isButtonPlumbedToJs(KeyEvent.KEYCODE_BACK);
- }
-
- /**
- * Exit the Android application.
- */
- public void exitApp() {
- this.webView.getPluginManager().postMessage("exit", null);
- }
-
-
- /**
- * Listen for telephony events: RINGING, OFFHOOK and IDLE
- * Send these events to all plugins using
- * CordovaActivity.onMessage("telephone", "ringing" | "offhook" | "idle")
- */
- private void initTelephonyReceiver() {
- IntentFilter intentFilter = new IntentFilter();
- intentFilter.addAction(TelephonyManager.ACTION_PHONE_STATE_CHANGED);
- //final CordovaInterface mycordova = this.cordova;
- this.telephonyReceiver = new BroadcastReceiver() {
-
- @Override
- public void onReceive(Context context, Intent intent) {
-
- // If state has changed
- if ((intent != null) && intent.getAction().equals(TelephonyManager.ACTION_PHONE_STATE_CHANGED)) {
- if (intent.hasExtra(TelephonyManager.EXTRA_STATE)) {
- String extraData = intent.getStringExtra(TelephonyManager.EXTRA_STATE);
- if (extraData.equals(TelephonyManager.EXTRA_STATE_RINGING)) {
- LOG.i(TAG, "Telephone RINGING");
- webView.getPluginManager().postMessage("telephone", "ringing");
- }
- else if (extraData.equals(TelephonyManager.EXTRA_STATE_OFFHOOK)) {
- LOG.i(TAG, "Telephone OFFHOOK");
- webView.getPluginManager().postMessage("telephone", "offhook");
- }
- else if (extraData.equals(TelephonyManager.EXTRA_STATE_IDLE)) {
- LOG.i(TAG, "Telephone IDLE");
- webView.getPluginManager().postMessage("telephone", "idle");
- }
- }
- }
- }
- };
-
- // Register the receiver
- webView.getContext().registerReceiver(this.telephonyReceiver, intentFilter);
- }
-
- private void sendEventMessage(String action) {
- JSONObject obj = new JSONObject();
- try {
- obj.put("action", action);
- } catch (JSONException e) {
- LOG.e(TAG, "Failed to create event message", e);
- }
- sendEventMessage(new PluginResult(PluginResult.Status.OK, obj));
- }
-
- private void sendEventMessage(PluginResult payload) {
- payload.setKeepCallback(true);
- if (messageChannel != null) {
- messageChannel.sendPluginResult(payload);
- }
- }
-
- /*
- * Unregister the receiver
- *
- */
- public void onDestroy()
- {
- webView.getContext().unregisterReceiver(this.telephonyReceiver);
- }
-
- /**
- * Used to send the resume event in the case that the Activity is destroyed by the OS
- *
- * @param resumeEvent PluginResult containing the payload for the resume event to be fired
- */
- public void sendResumeEvent(PluginResult resumeEvent) {
- // This operation must be synchronized because plugin results that trigger resume
- // events can be processed asynchronously
- synchronized(messageChannelLock) {
- if (messageChannel != null) {
- sendEventMessage(resumeEvent);
- } else {
- // Might get called before the page loads, so we need to store it until the
- // messageChannel gets created
- this.pendingResume = resumeEvent;
- }
- }
- }
-
- /*
- * This needs to be implemented if you wish to use the Camera Plugin or other plugins
- * that read the Build Configuration.
- *
- * Thanks to Phil@Medtronic and Graham Borland for finding the answer and posting it to
- * StackOverflow. This is annoying as hell!
- *
- */
-
- public static Object getBuildConfigValue(Context ctx, String key)
- {
- try
- {
- Class> clazz = Class.forName(ctx.getPackageName() + ".BuildConfig");
- Field field = clazz.getField(key);
- return field.get(null);
- } catch (ClassNotFoundException e) {
- LOG.d(TAG, "Unable to get the BuildConfig, is this built with ANT?");
- e.printStackTrace();
- } catch (NoSuchFieldException e) {
- LOG.d(TAG, key + " is not a valid field. Check your build.gradle");
- } catch (IllegalAccessException e) {
- LOG.d(TAG, "Illegal Access Exception: Let's print a stack trace.");
- e.printStackTrace();
- }
-
- return null;
- }
-}
diff --git a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/ExposedJsApi.java b/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/ExposedJsApi.java
deleted file mode 100644
index acc65c6..0000000
--- a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/ExposedJsApi.java
+++ /dev/null
@@ -1,31 +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.
-*/
-
-package org.apache.cordova;
-
-import org.json.JSONException;
-
-/*
- * Any exposed Javascript API MUST implement these three things!
- */
-public interface ExposedJsApi {
- public String exec(int bridgeSecret, String service, String action, String callbackId, String arguments) throws JSONException, IllegalAccessException;
- public void setNativeToJsBridgeMode(int bridgeSecret, int value) throws IllegalAccessException;
- public String retrieveJsMessages(int bridgeSecret, boolean fromOnlineEvent) throws IllegalAccessException;
-}
diff --git a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/ICordovaClientCertRequest.java b/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/ICordovaClientCertRequest.java
deleted file mode 100644
index 455d2f9..0000000
--- a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/ICordovaClientCertRequest.java
+++ /dev/null
@@ -1,66 +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.
-*/
-package org.apache.cordova;
-
-import java.security.Principal;
-import java.security.PrivateKey;
-import java.security.cert.X509Certificate;
-
-/**
- * Specifies interface for handling certificate requests.
- */
-public interface ICordovaClientCertRequest {
- /**
- * Cancel this request
- */
- public void cancel();
-
- /*
- * Returns the host name of the server requesting the certificate.
- */
- public String getHost();
-
- /*
- * Returns the acceptable types of asymmetric keys (can be null).
- */
- public String[] getKeyTypes();
-
- /*
- * Returns the port number of the server requesting the certificate.
- */
- public int getPort();
-
- /*
- * Returns the acceptable certificate issuers for the certificate matching the private key (can be null).
- */
- public Principal[] getPrincipals();
-
- /*
- * Ignore the request for now. Do not remember user's choice.
- */
- public void ignore();
-
- /*
- * Proceed with the specified private key and client certificate chain. Remember the user's positive choice and use it for future requests.
- *
- * @param privateKey The privateKey
- * @param chain The certificate chain
- */
- public void proceed(PrivateKey privateKey, X509Certificate[] chain);
-}
\ No newline at end of file
diff --git a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/ICordovaCookieManager.java b/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/ICordovaCookieManager.java
deleted file mode 100644
index e776194..0000000
--- a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/ICordovaCookieManager.java
+++ /dev/null
@@ -1,33 +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.
-*/
-
-package org.apache.cordova;
-
-public interface ICordovaCookieManager {
-
- public void setCookiesEnabled(boolean accept);
-
- public void setCookie(final String url, final String value);
-
- public String getCookie(final String url);
-
- public void clearCookies();
-
- public void flush();
-};
diff --git a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/ICordovaHttpAuthHandler.java b/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/ICordovaHttpAuthHandler.java
deleted file mode 100644
index c55818a..0000000
--- a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/ICordovaHttpAuthHandler.java
+++ /dev/null
@@ -1,38 +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.
-*/
-package org.apache.cordova;
-
-/**
- * Specifies interface for HTTP auth handler object which is used to handle auth requests and
- * specifying user credentials.
- */
- public interface ICordovaHttpAuthHandler {
- /**
- * Instructs the WebView to cancel the authentication request.
- */
- public void cancel ();
-
- /**
- * Instructs the WebView to proceed with the authentication with the given credentials.
- *
- * @param username The user name
- * @param password The password
- */
- public void proceed (String username, String password);
-}
\ No newline at end of file
diff --git a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/LOG.java b/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/LOG.java
deleted file mode 100644
index 9fe7a7d..0000000
--- a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/LOG.java
+++ /dev/null
@@ -1,244 +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.
-*/
-package org.apache.cordova;
-
-import android.util.Log;
-
-/**
- * Log to Android logging system.
- *
- * Log message can be a string or a printf formatted string with arguments.
- * See http://developer.android.com/reference/java/util/Formatter.html
- */
-public class LOG {
-
- public static final int VERBOSE = Log.VERBOSE;
- public static final int DEBUG = Log.DEBUG;
- public static final int INFO = Log.INFO;
- public static final int WARN = Log.WARN;
- public static final int ERROR = Log.ERROR;
-
- // Current log level
- public static int LOGLEVEL = Log.ERROR;
-
- /**
- * Set the current log level.
- *
- * @param logLevel
- */
- public static void setLogLevel(int logLevel) {
- LOGLEVEL = logLevel;
- Log.i("CordovaLog", "Changing log level to " + logLevel);
- }
-
- /**
- * Set the current log level.
- *
- * @param logLevel
- */
- public static void setLogLevel(String logLevel) {
- if ("VERBOSE".equals(logLevel)) LOGLEVEL = VERBOSE;
- else if ("DEBUG".equals(logLevel)) LOGLEVEL = DEBUG;
- else if ("INFO".equals(logLevel)) LOGLEVEL = INFO;
- else if ("WARN".equals(logLevel)) LOGLEVEL = WARN;
- else if ("ERROR".equals(logLevel)) LOGLEVEL = ERROR;
- Log.i("CordovaLog", "Changing log level to " + logLevel + "(" + LOGLEVEL + ")");
- }
-
- /**
- * Determine if log level will be logged
- *
- * @param logLevel
- * @return true if the parameter passed in is greater than or equal to the current log level
- */
- public static boolean isLoggable(int logLevel) {
- return (logLevel >= LOGLEVEL);
- }
-
- /**
- * Verbose log message.
- *
- * @param tag
- * @param s
- */
- public static void v(String tag, String s) {
- if (LOG.VERBOSE >= LOGLEVEL) Log.v(tag, s);
- }
-
- /**
- * Debug log message.
- *
- * @param tag
- * @param s
- */
- public static void d(String tag, String s) {
- if (LOG.DEBUG >= LOGLEVEL) Log.d(tag, s);
- }
-
- /**
- * Info log message.
- *
- * @param tag
- * @param s
- */
- public static void i(String tag, String s) {
- if (LOG.INFO >= LOGLEVEL) Log.i(tag, s);
- }
-
- /**
- * Warning log message.
- *
- * @param tag
- * @param s
- */
- public static void w(String tag, String s) {
- if (LOG.WARN >= LOGLEVEL) Log.w(tag, s);
- }
-
- /**
- * Error log message.
- *
- * @param tag
- * @param s
- */
- public static void e(String tag, String s) {
- if (LOG.ERROR >= LOGLEVEL) Log.e(tag, s);
- }
-
- /**
- * Verbose log message.
- *
- * @param tag
- * @param s
- * @param e
- */
- public static void v(String tag, String s, Throwable e) {
- if (LOG.VERBOSE >= LOGLEVEL) Log.v(tag, s, e);
- }
-
- /**
- * Debug log message.
- *
- * @param tag
- * @param s
- * @param e
- */
- public static void d(String tag, String s, Throwable e) {
- if (LOG.DEBUG >= LOGLEVEL) Log.d(tag, s, e);
- }
-
- /**
- * Info log message.
- *
- * @param tag
- * @param s
- * @param e
- */
- public static void i(String tag, String s, Throwable e) {
- if (LOG.INFO >= LOGLEVEL) Log.i(tag, s, e);
- }
-
- /**
- * Warning log message.
- *
- * @param tag
- * @param e
- */
- public static void w(String tag, Throwable e) {
- if (LOG.WARN >= LOGLEVEL) Log.w(tag, e);
- }
-
- /**
- * Warning log message.
- *
- * @param tag
- * @param s
- * @param e
- */
- public static void w(String tag, String s, Throwable e) {
- if (LOG.WARN >= LOGLEVEL) Log.w(tag, s, e);
- }
-
- /**
- * Error log message.
- *
- * @param tag
- * @param s
- * @param e
- */
- public static void e(String tag, String s, Throwable e) {
- if (LOG.ERROR >= LOGLEVEL) Log.e(tag, s, e);
- }
-
- /**
- * Verbose log message with printf formatting.
- *
- * @param tag
- * @param s
- * @param args
- */
- public static void v(String tag, String s, Object... args) {
- if (LOG.VERBOSE >= LOGLEVEL) Log.v(tag, String.format(s, args));
- }
-
- /**
- * Debug log message with printf formatting.
- *
- * @param tag
- * @param s
- * @param args
- */
- public static void d(String tag, String s, Object... args) {
- if (LOG.DEBUG >= LOGLEVEL) Log.d(tag, String.format(s, args));
- }
-
- /**
- * Info log message with printf formatting.
- *
- * @param tag
- * @param s
- * @param args
- */
- public static void i(String tag, String s, Object... args) {
- if (LOG.INFO >= LOGLEVEL) Log.i(tag, String.format(s, args));
- }
-
- /**
- * Warning log message with printf formatting.
- *
- * @param tag
- * @param s
- * @param args
- */
- public static void w(String tag, String s, Object... args) {
- if (LOG.WARN >= LOGLEVEL) Log.w(tag, String.format(s, args));
- }
-
- /**
- * Error log message with printf formatting.
- *
- * @param tag
- * @param s
- * @param args
- */
- public static void e(String tag, String s, Object... args) {
- if (LOG.ERROR >= LOGLEVEL) Log.e(tag, String.format(s, args));
- }
-
-}
diff --git a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/NativeToJsMessageQueue.java b/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/NativeToJsMessageQueue.java
deleted file mode 100644
index 61d04f1..0000000
--- a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/NativeToJsMessageQueue.java
+++ /dev/null
@@ -1,524 +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.
-*/
-package org.apache.cordova;
-
-import java.util.ArrayList;
-import java.util.LinkedList;
-
-/**
- * Holds the list of messages to be sent to the WebView.
- */
-public class NativeToJsMessageQueue {
- private static final String LOG_TAG = "JsMessageQueue";
-
- // Set this to true to force plugin results to be encoding as
- // JS instead of the custom format (useful for benchmarking).
- // Doesn't work for multipart messages.
- private static final boolean FORCE_ENCODE_USING_EVAL = false;
-
- // Disable sending back native->JS messages during an exec() when the active
- // exec() is asynchronous. Set this to true when running bridge benchmarks.
- static final boolean DISABLE_EXEC_CHAINING = false;
-
- // Arbitrarily chosen upper limit for how much data to send to JS in one shot.
- // This currently only chops up on message boundaries. It may be useful
- // to allow it to break up messages.
- private static int MAX_PAYLOAD_SIZE = 50 * 1024 * 10240;
-
- /**
- * When true, the active listener is not fired upon enqueue. When set to false,
- * the active listener will be fired if the queue is non-empty.
- */
- private boolean paused;
-
- /**
- * The list of JavaScript statements to be sent to JavaScript.
- */
- private final LinkedList queue = new LinkedList();
-
- /**
- * The array of listeners that can be used to send messages to JS.
- */
- private ArrayList bridgeModes = new ArrayList();
-
- /**
- * When null, the bridge is disabled. This occurs during page transitions.
- * When disabled, all callbacks are dropped since they are assumed to be
- * relevant to the previous page.
- */
- private BridgeMode activeBridgeMode;
-
- public void addBridgeMode(BridgeMode bridgeMode) {
- bridgeModes.add(bridgeMode);
- }
-
- public boolean isBridgeEnabled() {
- return activeBridgeMode != null;
- }
-
- public boolean isEmpty() {
- return queue.isEmpty();
- }
-
- /**
- * Changes the bridge mode.
- */
- public void setBridgeMode(int value) {
- if (value < -1 || value >= bridgeModes.size()) {
- LOG.d(LOG_TAG, "Invalid NativeToJsBridgeMode: " + value);
- } else {
- BridgeMode newMode = value < 0 ? null : bridgeModes.get(value);
- if (newMode != activeBridgeMode) {
- LOG.d(LOG_TAG, "Set native->JS mode to " + (newMode == null ? "null" : newMode.getClass().getSimpleName()));
- synchronized (this) {
- activeBridgeMode = newMode;
- if (newMode != null) {
- newMode.reset();
- if (!paused && !queue.isEmpty()) {
- newMode.onNativeToJsMessageAvailable(this);
- }
- }
- }
- }
- }
- }
-
- /**
- * Clears all messages and resets to the default bridge mode.
- */
- public void reset() {
- synchronized (this) {
- queue.clear();
- setBridgeMode(-1);
- }
- }
-
- private int calculatePackedMessageLength(JsMessage message) {
- int messageLen = message.calculateEncodedLength();
- String messageLenStr = String.valueOf(messageLen);
- return messageLenStr.length() + messageLen + 1;
- }
-
- private void packMessage(JsMessage message, StringBuilder sb) {
- int len = message.calculateEncodedLength();
- sb.append(len)
- .append(' ');
- message.encodeAsMessage(sb);
- }
-
- /**
- * Combines and returns queued messages combined into a single string.
- * Combines as many messages as possible, while staying under MAX_PAYLOAD_SIZE.
- * Returns null if the queue is empty.
- */
- public String popAndEncode(boolean fromOnlineEvent) {
- synchronized (this) {
- if (activeBridgeMode == null) {
- return null;
- }
- activeBridgeMode.notifyOfFlush(this, fromOnlineEvent);
- if (queue.isEmpty()) {
- return null;
- }
- int totalPayloadLen = 0;
- int numMessagesToSend = 0;
- for (JsMessage message : queue) {
- int messageSize = calculatePackedMessageLength(message);
- if (numMessagesToSend > 0 && totalPayloadLen + messageSize > MAX_PAYLOAD_SIZE && MAX_PAYLOAD_SIZE > 0) {
- break;
- }
- totalPayloadLen += messageSize;
- numMessagesToSend += 1;
- }
-
- StringBuilder sb = new StringBuilder(totalPayloadLen);
- for (int i = 0; i < numMessagesToSend; ++i) {
- JsMessage message = queue.removeFirst();
- packMessage(message, sb);
- }
-
- if (!queue.isEmpty()) {
- // Attach a char to indicate that there are more messages pending.
- sb.append('*');
- }
- String ret = sb.toString();
- return ret;
- }
- }
-
- /**
- * Same as popAndEncode(), except encodes in a form that can be executed as JS.
- */
- public String popAndEncodeAsJs() {
- synchronized (this) {
- int length = queue.size();
- if (length == 0) {
- return null;
- }
- int totalPayloadLen = 0;
- int numMessagesToSend = 0;
- for (JsMessage message : queue) {
- int messageSize = message.calculateEncodedLength() + 50; // overestimate.
- if (numMessagesToSend > 0 && totalPayloadLen + messageSize > MAX_PAYLOAD_SIZE && MAX_PAYLOAD_SIZE > 0) {
- break;
- }
- totalPayloadLen += messageSize;
- numMessagesToSend += 1;
- }
- boolean willSendAllMessages = numMessagesToSend == queue.size();
- StringBuilder sb = new StringBuilder(totalPayloadLen + (willSendAllMessages ? 0 : 100));
- // Wrap each statement in a try/finally so that if one throws it does
- // not affect the next.
- for (int i = 0; i < numMessagesToSend; ++i) {
- JsMessage message = queue.removeFirst();
- if (willSendAllMessages && (i + 1 == numMessagesToSend)) {
- message.encodeAsJsMessage(sb);
- } else {
- sb.append("try{");
- message.encodeAsJsMessage(sb);
- sb.append("}finally{");
- }
- }
- if (!willSendAllMessages) {
- sb.append("window.setTimeout(function(){cordova.require('cordova/plugin/android/polling').pollOnce();},0);");
- }
- for (int i = willSendAllMessages ? 1 : 0; i < numMessagesToSend; ++i) {
- sb.append('}');
- }
- String ret = sb.toString();
- return ret;
- }
- }
-
- /**
- * Add a JavaScript statement to the list.
- */
- public void addJavaScript(String statement) {
- enqueueMessage(new JsMessage(statement));
- }
-
- /**
- * Add a JavaScript statement to the list.
- */
- public void addPluginResult(PluginResult result, String callbackId) {
- if (callbackId == null) {
- LOG.e(LOG_TAG, "Got plugin result with no callbackId", new Throwable());
- return;
- }
- // Don't send anything if there is no result and there is no need to
- // clear the callbacks.
- boolean noResult = result.getStatus() == PluginResult.Status.NO_RESULT.ordinal();
- boolean keepCallback = result.getKeepCallback();
- if (noResult && keepCallback) {
- return;
- }
- JsMessage message = new JsMessage(result, callbackId);
- if (FORCE_ENCODE_USING_EVAL) {
- StringBuilder sb = new StringBuilder(message.calculateEncodedLength() + 50);
- message.encodeAsJsMessage(sb);
- message = new JsMessage(sb.toString());
- }
-
- enqueueMessage(message);
- }
-
- private void enqueueMessage(JsMessage message) {
- synchronized (this) {
- if (activeBridgeMode == null) {
- LOG.d(LOG_TAG, "Dropping Native->JS message due to disabled bridge");
- return;
- }
- queue.add(message);
- if (!paused) {
- activeBridgeMode.onNativeToJsMessageAvailable(this);
- }
- }
- }
-
- public void setPaused(boolean value) {
- if (paused && value) {
- // This should never happen. If a use-case for it comes up, we should
- // change pause to be a counter.
- LOG.e(LOG_TAG, "nested call to setPaused detected.", new Throwable());
- }
- paused = value;
- if (!value) {
- synchronized (this) {
- if (!queue.isEmpty() && activeBridgeMode != null) {
- activeBridgeMode.onNativeToJsMessageAvailable(this);
- }
- }
- }
- }
-
- public static abstract class BridgeMode {
- public abstract void onNativeToJsMessageAvailable(NativeToJsMessageQueue queue);
- public void notifyOfFlush(NativeToJsMessageQueue queue, boolean fromOnlineEvent) {}
- public void reset() {}
- }
-
- /** Uses JS polls for messages on a timer.. */
- public static class NoOpBridgeMode extends BridgeMode {
- @Override public void onNativeToJsMessageAvailable(NativeToJsMessageQueue queue) {
- }
- }
-
- /** Uses webView.loadUrl("javascript:") to execute messages. */
- public static class LoadUrlBridgeMode extends BridgeMode {
- private final CordovaWebViewEngine engine;
- private final CordovaInterface cordova;
-
- public LoadUrlBridgeMode(CordovaWebViewEngine engine, CordovaInterface cordova) {
- this.engine = engine;
- this.cordova = cordova;
- }
-
- @Override
- public void onNativeToJsMessageAvailable(final NativeToJsMessageQueue queue) {
- cordova.getActivity().runOnUiThread(new Runnable() {
- public void run() {
- String js = queue.popAndEncodeAsJs();
- if (js != null) {
- engine.loadUrl("javascript:" + js, false);
- }
- }
- });
- }
- }
-
- /** Uses online/offline events to tell the JS when to poll for messages. */
- public static class OnlineEventsBridgeMode extends BridgeMode {
- private final OnlineEventsBridgeModeDelegate delegate;
- private boolean online;
- private boolean ignoreNextFlush;
-
- public interface OnlineEventsBridgeModeDelegate {
- void setNetworkAvailable(boolean value);
- void runOnUiThread(Runnable r);
- }
-
- public OnlineEventsBridgeMode(OnlineEventsBridgeModeDelegate delegate) {
- this.delegate = delegate;
- }
-
- @Override
- public void reset() {
- delegate.runOnUiThread(new Runnable() {
- public void run() {
- online = false;
- // If the following call triggers a notifyOfFlush, then ignore it.
- ignoreNextFlush = true;
- delegate.setNetworkAvailable(true);
- }
- });
- }
-
- @Override
- public void onNativeToJsMessageAvailable(final NativeToJsMessageQueue queue) {
- delegate.runOnUiThread(new Runnable() {
- public void run() {
- if (!queue.isEmpty()) {
- ignoreNextFlush = false;
- delegate.setNetworkAvailable(online);
- }
- }
- });
- }
- // Track when online/offline events are fired so that we don't fire excess events.
- @Override
- public void notifyOfFlush(final NativeToJsMessageQueue queue, boolean fromOnlineEvent) {
- if (fromOnlineEvent && !ignoreNextFlush) {
- online = !online;
- }
- }
- }
-
- /** Uses webView.evaluateJavascript to execute messages. */
- public static class EvalBridgeMode extends BridgeMode {
- private final CordovaWebViewEngine engine;
- private final CordovaInterface cordova;
-
- public EvalBridgeMode(CordovaWebViewEngine engine, CordovaInterface cordova) {
- this.engine = engine;
- this.cordova = cordova;
- }
-
- @Override
- public void onNativeToJsMessageAvailable(final NativeToJsMessageQueue queue) {
- cordova.getActivity().runOnUiThread(new Runnable() {
- public void run() {
- String js = queue.popAndEncodeAsJs();
- if (js != null) {
- engine.evaluateJavascript(js, null);
- }
- }
- });
- }
- }
-
-
-
- private static class JsMessage {
- final String jsPayloadOrCallbackId;
- final PluginResult pluginResult;
- JsMessage(String js) {
- if (js == null) {
- throw new NullPointerException();
- }
- jsPayloadOrCallbackId = js;
- pluginResult = null;
- }
- JsMessage(PluginResult pluginResult, String callbackId) {
- if (callbackId == null || pluginResult == null) {
- throw new NullPointerException();
- }
- jsPayloadOrCallbackId = callbackId;
- this.pluginResult = pluginResult;
- }
-
- static int calculateEncodedLengthHelper(PluginResult pluginResult) {
- switch (pluginResult.getMessageType()) {
- case PluginResult.MESSAGE_TYPE_BOOLEAN: // f or t
- case PluginResult.MESSAGE_TYPE_NULL: // N
- return 1;
- case PluginResult.MESSAGE_TYPE_NUMBER: // n
- return 1 + pluginResult.getMessage().length();
- case PluginResult.MESSAGE_TYPE_STRING: // s
- return 1 + pluginResult.getStrMessage().length();
- case PluginResult.MESSAGE_TYPE_BINARYSTRING:
- return 1 + pluginResult.getMessage().length();
- case PluginResult.MESSAGE_TYPE_ARRAYBUFFER:
- return 1 + pluginResult.getMessage().length();
- case PluginResult.MESSAGE_TYPE_MULTIPART:
- int ret = 1;
- for (int i = 0; i < pluginResult.getMultipartMessagesSize(); i++) {
- int length = calculateEncodedLengthHelper(pluginResult.getMultipartMessage(i));
- int argLength = String.valueOf(length).length();
- ret += argLength + 1 + length;
- }
- return ret;
- case PluginResult.MESSAGE_TYPE_JSON:
- default:
- return pluginResult.getMessage().length();
- }
- }
-
- int calculateEncodedLength() {
- if (pluginResult == null) {
- return jsPayloadOrCallbackId.length() + 1;
- }
- int statusLen = String.valueOf(pluginResult.getStatus()).length();
- int ret = 2 + statusLen + 1 + jsPayloadOrCallbackId.length() + 1;
- return ret + calculateEncodedLengthHelper(pluginResult);
- }
-
- static void encodeAsMessageHelper(StringBuilder sb, PluginResult pluginResult) {
- switch (pluginResult.getMessageType()) {
- case PluginResult.MESSAGE_TYPE_BOOLEAN:
- sb.append(pluginResult.getMessage().charAt(0)); // t or f.
- break;
- case PluginResult.MESSAGE_TYPE_NULL: // N
- sb.append('N');
- break;
- case PluginResult.MESSAGE_TYPE_NUMBER: // n
- sb.append('n')
- .append(pluginResult.getMessage());
- break;
- case PluginResult.MESSAGE_TYPE_STRING: // s
- sb.append('s');
- sb.append(pluginResult.getStrMessage());
- break;
- case PluginResult.MESSAGE_TYPE_BINARYSTRING: // S
- sb.append('S');
- sb.append(pluginResult.getMessage());
- break;
- case PluginResult.MESSAGE_TYPE_ARRAYBUFFER: // A
- sb.append('A');
- sb.append(pluginResult.getMessage());
- break;
- case PluginResult.MESSAGE_TYPE_MULTIPART:
- sb.append('M');
- for (int i = 0; i < pluginResult.getMultipartMessagesSize(); i++) {
- PluginResult multipartMessage = pluginResult.getMultipartMessage(i);
- sb.append(String.valueOf(calculateEncodedLengthHelper(multipartMessage)));
- sb.append(' ');
- encodeAsMessageHelper(sb, multipartMessage);
- }
- break;
- case PluginResult.MESSAGE_TYPE_JSON:
- default:
- sb.append(pluginResult.getMessage()); // [ or {
- }
- }
-
- void encodeAsMessage(StringBuilder sb) {
- if (pluginResult == null) {
- sb.append('J')
- .append(jsPayloadOrCallbackId);
- return;
- }
- int status = pluginResult.getStatus();
- boolean noResult = status == PluginResult.Status.NO_RESULT.ordinal();
- boolean resultOk = status == PluginResult.Status.OK.ordinal();
- boolean keepCallback = pluginResult.getKeepCallback();
-
- sb.append((noResult || resultOk) ? 'S' : 'F')
- .append(keepCallback ? '1' : '0')
- .append(status)
- .append(' ')
- .append(jsPayloadOrCallbackId)
- .append(' ');
-
- encodeAsMessageHelper(sb, pluginResult);
- }
-
- void encodeAsJsMessage(StringBuilder sb) {
- if (pluginResult == null) {
- sb.append(jsPayloadOrCallbackId);
- } else {
- int status = pluginResult.getStatus();
- boolean success = (status == PluginResult.Status.OK.ordinal()) || (status == PluginResult.Status.NO_RESULT.ordinal());
- sb.append("cordova.callbackFromNative('")
- .append(jsPayloadOrCallbackId)
- .append("',")
- .append(success)
- .append(",")
- .append(status)
- .append(",[");
- switch (pluginResult.getMessageType()) {
- case PluginResult.MESSAGE_TYPE_BINARYSTRING:
- sb.append("atob('")
- .append(pluginResult.getMessage())
- .append("')");
- break;
- case PluginResult.MESSAGE_TYPE_ARRAYBUFFER:
- sb.append("cordova.require('cordova/base64').toArrayBuffer('")
- .append(pluginResult.getMessage())
- .append("')");
- break;
- default:
- sb.append(pluginResult.getMessage());
- }
- sb.append("],")
- .append(pluginResult.getKeepCallback())
- .append(");");
- }
- }
- }
-}
diff --git a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/PluginEntry.java b/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/PluginEntry.java
deleted file mode 100644
index c56c453..0000000
--- a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/PluginEntry.java
+++ /dev/null
@@ -1,70 +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.
- */
-package org.apache.cordova;
-
-import org.apache.cordova.CordovaPlugin;
-
-/**
- * This class represents a service entry object.
- */
-public final class PluginEntry {
-
- /**
- * The name of the service that this plugin implements
- */
- public final String service;
-
- /**
- * The plugin class name that implements the service.
- */
- public final String pluginClass;
-
- /**
- * The pre-instantiated plugin to use for this entry.
- */
- public final CordovaPlugin plugin;
-
- /**
- * Flag that indicates the plugin object should be created when PluginManager is initialized.
- */
- public final boolean onload;
-
- /**
- * Constructs with a CordovaPlugin already instantiated.
- */
- public PluginEntry(String service, CordovaPlugin plugin) {
- this(service, plugin.getClass().getName(), true, plugin);
- }
-
- /**
- * @param service The name of the service
- * @param pluginClass The plugin class name
- * @param onload Create plugin object when HTML page is loaded
- */
- public PluginEntry(String service, String pluginClass, boolean onload) {
- this(service, pluginClass, onload, null);
- }
-
- private PluginEntry(String service, String pluginClass, boolean onload, CordovaPlugin plugin) {
- this.service = service;
- this.pluginClass = pluginClass;
- this.onload = onload;
- this.plugin = plugin;
- }
-}
diff --git a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/PluginManager.java b/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/PluginManager.java
deleted file mode 100644
index c9576a6..0000000
--- a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/PluginManager.java
+++ /dev/null
@@ -1,526 +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.
- */
-package org.apache.cordova;
-
-import java.util.Collection;
-import java.util.LinkedHashMap;
-
-import org.json.JSONException;
-
-import android.content.Intent;
-import android.content.res.Configuration;
-import android.net.Uri;
-import android.os.Bundle;
-import android.os.Debug;
-
-/**
- * PluginManager is exposed to JavaScript in the Cordova WebView.
- *
- * Calling native plugin code can be done by calling PluginManager.exec(...)
- * from JavaScript.
- */
-public class PluginManager {
- private static String TAG = "PluginManager";
- private static final int SLOW_EXEC_WARNING_THRESHOLD = Debug.isDebuggerConnected() ? 60 : 16;
-
- // List of service entries
- private final LinkedHashMap pluginMap = new LinkedHashMap();
- private final LinkedHashMap entryMap = new LinkedHashMap();
-
- private final CordovaInterface ctx;
- private final CordovaWebView app;
- private boolean isInitialized;
-
- private CordovaPlugin permissionRequester;
-
- public PluginManager(CordovaWebView cordovaWebView, CordovaInterface cordova, Collection pluginEntries) {
- this.ctx = cordova;
- this.app = cordovaWebView;
- setPluginEntries(pluginEntries);
- }
-
- public Collection getPluginEntries() {
- return entryMap.values();
- }
-
- public void setPluginEntries(Collection pluginEntries) {
- if (isInitialized) {
- this.onPause(false);
- this.onDestroy();
- pluginMap.clear();
- entryMap.clear();
- }
- for (PluginEntry entry : pluginEntries) {
- addService(entry);
- }
- if (isInitialized) {
- startupPlugins();
- }
- }
-
- /**
- * Init when loading a new HTML page into webview.
- */
- public void init() {
- LOG.d(TAG, "init()");
- isInitialized = true;
- this.onPause(false);
- this.onDestroy();
- pluginMap.clear();
- this.startupPlugins();
- }
-
- /**
- * Create plugins objects that have onload set.
- */
- private void startupPlugins() {
- for (PluginEntry entry : entryMap.values()) {
- // Add a null entry to for each non-startup plugin to avoid ConcurrentModificationException
- // When iterating plugins.
- if (entry.onload) {
- getPlugin(entry.service);
- } else {
- pluginMap.put(entry.service, null);
- }
- }
- }
-
- /**
- * Receives a request for execution and fulfills it by finding the appropriate
- * Java class and calling it's execute method.
- *
- * PluginManager.exec can be used either synchronously or async. In either case, a JSON encoded
- * string is returned that will indicate if any errors have occurred when trying to find
- * or execute the class denoted by the clazz argument.
- *
- * @param service String containing the service to run
- * @param action String containing the action that the class is supposed to perform. This is
- * passed to the plugin execute method and it is up to the plugin developer
- * how to deal with it.
- * @param callbackId String containing the id of the callback that is execute in JavaScript if
- * this is an async plugin call.
- * @param rawArgs An Array literal string containing any arguments needed in the
- * plugin execute method.
- */
- public void exec(final String service, final String action, final String callbackId, final String rawArgs) {
- CordovaPlugin plugin = getPlugin(service);
- if (plugin == null) {
- LOG.d(TAG, "exec() call to unknown plugin: " + service);
- PluginResult cr = new PluginResult(PluginResult.Status.CLASS_NOT_FOUND_EXCEPTION);
- app.sendPluginResult(cr, callbackId);
- return;
- }
- CallbackContext callbackContext = new CallbackContext(callbackId, app);
- try {
- long pluginStartTime = System.currentTimeMillis();
- boolean wasValidAction = plugin.execute(action, rawArgs, callbackContext);
- long duration = System.currentTimeMillis() - pluginStartTime;
-
- if (duration > SLOW_EXEC_WARNING_THRESHOLD) {
- LOG.w(TAG, "THREAD WARNING: exec() call to " + service + "." + action + " blocked the main thread for " + duration + "ms. Plugin should use CordovaInterface.getThreadPool().");
- }
- if (!wasValidAction) {
- PluginResult cr = new PluginResult(PluginResult.Status.INVALID_ACTION);
- callbackContext.sendPluginResult(cr);
- }
- } catch (JSONException e) {
- PluginResult cr = new PluginResult(PluginResult.Status.JSON_EXCEPTION);
- callbackContext.sendPluginResult(cr);
- } catch (Exception e) {
- LOG.e(TAG, "Uncaught exception from plugin", e);
- callbackContext.error(e.getMessage());
- }
- }
-
- /**
- * Get the plugin object that implements the service.
- * If the plugin object does not already exist, then create it.
- * If the service doesn't exist, then return null.
- *
- * @param service The name of the service.
- * @return CordovaPlugin or null
- */
- public CordovaPlugin getPlugin(String service) {
- CordovaPlugin ret = pluginMap.get(service);
- if (ret == null) {
- PluginEntry pe = entryMap.get(service);
- if (pe == null) {
- return null;
- }
- if (pe.plugin != null) {
- ret = pe.plugin;
- } else {
- ret = instantiatePlugin(pe.pluginClass);
- }
- ret.privateInitialize(service, ctx, app, app.getPreferences());
- pluginMap.put(service, ret);
- }
- return ret;
- }
-
- /**
- * Add a plugin class that implements a service to the service entry table.
- * This does not create the plugin object instance.
- *
- * @param service The service name
- * @param className The plugin class name
- */
- public void addService(String service, String className) {
- PluginEntry entry = new PluginEntry(service, className, false);
- this.addService(entry);
- }
-
- /**
- * Add a plugin class that implements a service to the service entry table.
- * This does not create the plugin object instance.
- *
- * @param entry The plugin entry
- */
- public void addService(PluginEntry entry) {
- this.entryMap.put(entry.service, entry);
- if (entry.plugin != null) {
- entry.plugin.privateInitialize(entry.service, ctx, app, app.getPreferences());
- pluginMap.put(entry.service, entry.plugin);
- }
- }
-
- /**
- * Called when the system is about to start resuming a previous activity.
- *
- * @param multitasking Flag indicating if multitasking is turned on for app
- */
- public void onPause(boolean multitasking) {
- for (CordovaPlugin plugin : this.pluginMap.values()) {
- if (plugin != null) {
- plugin.onPause(multitasking);
- }
- }
- }
-
- /**
- * Called when the system received an HTTP authentication request. Plugins can use
- * the supplied HttpAuthHandler to process this auth challenge.
- *
- * @param view The WebView that is initiating the callback
- * @param handler The HttpAuthHandler used to set the WebView's response
- * @param host The host requiring authentication
- * @param realm The realm for which authentication is required
- *
- * @return Returns True if there is a plugin which will resolve this auth challenge, otherwise False
- *
- */
- public boolean onReceivedHttpAuthRequest(CordovaWebView view, ICordovaHttpAuthHandler handler, String host, String realm) {
- for (CordovaPlugin plugin : this.pluginMap.values()) {
- if (plugin != null && plugin.onReceivedHttpAuthRequest(app, handler, host, realm)) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Called when he system received an SSL client certificate request. Plugin can use
- * the supplied ClientCertRequest to process this certificate challenge.
- *
- * @param view The WebView that is initiating the callback
- * @param request The client certificate request
- *
- * @return Returns True if plugin will resolve this auth challenge, otherwise False
- *
- */
- public boolean onReceivedClientCertRequest(CordovaWebView view, ICordovaClientCertRequest request) {
- for (CordovaPlugin plugin : this.pluginMap.values()) {
- if (plugin != null && plugin.onReceivedClientCertRequest(app, request)) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Called when the activity will start interacting with the user.
- *
- * @param multitasking Flag indicating if multitasking is turned on for app
- */
- public void onResume(boolean multitasking) {
- for (CordovaPlugin plugin : this.pluginMap.values()) {
- if (plugin != null) {
- plugin.onResume(multitasking);
- }
- }
- }
-
- /**
- * Called when the activity is becoming visible to the user.
- */
- public void onStart() {
- for (CordovaPlugin plugin : this.pluginMap.values()) {
- if (plugin != null) {
- plugin.onStart();
- }
- }
- }
-
- /**
- * Called when the activity is no longer visible to the user.
- */
- public void onStop() {
- for (CordovaPlugin plugin : this.pluginMap.values()) {
- if (plugin != null) {
- plugin.onStop();
- }
- }
- }
-
- /**
- * The final call you receive before your activity is destroyed.
- */
- public void onDestroy() {
- for (CordovaPlugin plugin : this.pluginMap.values()) {
- if (plugin != null) {
- plugin.onDestroy();
- }
- }
- }
-
- /**
- * Send a message to all plugins.
- *
- * @param id The message id
- * @param data The message data
- * @return Object to stop propagation or null
- */
- public Object postMessage(String id, Object data) {
- for (CordovaPlugin plugin : this.pluginMap.values()) {
- if (plugin != null) {
- Object obj = plugin.onMessage(id, data);
- if (obj != null) {
- return obj;
- }
- }
- }
- return ctx.onMessage(id, data);
- }
-
- /**
- * Called when the activity receives a new intent.
- */
- public void onNewIntent(Intent intent) {
- for (CordovaPlugin plugin : this.pluginMap.values()) {
- if (plugin != null) {
- plugin.onNewIntent(intent);
- }
- }
- }
-
- /**
- * Called when the webview is going to request an external resource.
- *
- * This delegates to the installed plugins, and returns true/false for the
- * first plugin to provide a non-null result. If no plugins respond, then
- * the default policy is applied.
- *
- * @param url The URL that is being requested.
- * @return Returns true to allow the resource to load,
- * false to block the resource.
- */
- public boolean shouldAllowRequest(String url) {
- for (PluginEntry entry : this.entryMap.values()) {
- CordovaPlugin plugin = pluginMap.get(entry.service);
- if (plugin != null) {
- Boolean result = plugin.shouldAllowRequest(url);
- if (result != null) {
- return result;
- }
- }
- }
-
- // Default policy:
- if (url.startsWith("blob:") || url.startsWith("data:") || url.startsWith("about:blank")) {
- return true;
- }
- // TalkBack requires this, so allow it by default.
- if (url.startsWith("https://ssl.gstatic.com/accessibility/javascript/android/")) {
- return true;
- }
- if (url.startsWith("file://")) {
- //This directory on WebKit/Blink based webviews contains SQLite databases!
- //DON'T CHANGE THIS UNLESS YOU KNOW WHAT YOU'RE DOING!
- return !url.contains("/app_webview/");
- }
- return false;
- }
-
- /**
- * Called when the webview is going to change the URL of the loaded content.
- *
- * This delegates to the installed plugins, and returns true/false for the
- * first plugin to provide a non-null result. If no plugins respond, then
- * the default policy is applied.
- *
- * @param url The URL that is being requested.
- * @return Returns true to allow the navigation,
- * false to block the navigation.
- */
- public boolean shouldAllowNavigation(String url) {
- for (PluginEntry entry : this.entryMap.values()) {
- CordovaPlugin plugin = pluginMap.get(entry.service);
- if (plugin != null) {
- Boolean result = plugin.shouldAllowNavigation(url);
- if (result != null) {
- return result;
- }
- }
- }
-
- // Default policy:
- return url.startsWith("file://") || url.startsWith("about:blank");
- }
-
-
- /**
- * Called when the webview is requesting the exec() bridge be enabled.
- */
- public boolean shouldAllowBridgeAccess(String url) {
- for (PluginEntry entry : this.entryMap.values()) {
- CordovaPlugin plugin = pluginMap.get(entry.service);
- if (plugin != null) {
- Boolean result = plugin.shouldAllowBridgeAccess(url);
- if (result != null) {
- return result;
- }
- }
- }
-
- // Default policy:
- return url.startsWith("file://");
- }
-
- /**
- * Called when the webview is going not going to navigate, but may launch
- * an Intent for an URL.
- *
- * This delegates to the installed plugins, and returns true/false for the
- * first plugin to provide a non-null result. If no plugins respond, then
- * the default policy is applied.
- *
- * @param url The URL that is being requested.
- * @return Returns true to allow the URL to launch an intent,
- * false to block the intent.
- */
- public Boolean shouldOpenExternalUrl(String url) {
- for (PluginEntry entry : this.entryMap.values()) {
- CordovaPlugin plugin = pluginMap.get(entry.service);
- if (plugin != null) {
- Boolean result = plugin.shouldOpenExternalUrl(url);
- if (result != null) {
- return result;
- }
- }
- }
- // Default policy:
- // External URLs are not allowed
- return false;
- }
-
- /**
- * Called when the URL of the webview changes.
- *
- * @param url The URL that is being changed to.
- * @return Return false to allow the URL to load, return true to prevent the URL from loading.
- */
- public boolean onOverrideUrlLoading(String url) {
- for (PluginEntry entry : this.entryMap.values()) {
- CordovaPlugin plugin = pluginMap.get(entry.service);
- if (plugin != null && plugin.onOverrideUrlLoading(url)) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Called when the app navigates or refreshes.
- */
- public void onReset() {
- for (CordovaPlugin plugin : this.pluginMap.values()) {
- if (plugin != null) {
- plugin.onReset();
- }
- }
- }
-
- Uri remapUri(Uri uri) {
- for (CordovaPlugin plugin : this.pluginMap.values()) {
- if (plugin != null) {
- Uri ret = plugin.remapUri(uri);
- if (ret != null) {
- return ret;
- }
- }
- }
- return null;
- }
-
- /**
- * Create a plugin based on class name.
- */
- private CordovaPlugin instantiatePlugin(String className) {
- CordovaPlugin ret = null;
- try {
- Class> c = null;
- if ((className != null) && !("".equals(className))) {
- c = Class.forName(className);
- }
- if (c != null & CordovaPlugin.class.isAssignableFrom(c)) {
- ret = (CordovaPlugin) c.newInstance();
- }
- } catch (Exception e) {
- e.printStackTrace();
- System.out.println("Error adding plugin " + className + ".");
- }
- return ret;
- }
-
- /**
- * Called by the system when the device configuration changes while your activity is running.
- *
- * @param newConfig The new device configuration
- */
- public void onConfigurationChanged(Configuration newConfig) {
- for (CordovaPlugin plugin : this.pluginMap.values()) {
- if (plugin != null) {
- plugin.onConfigurationChanged(newConfig);
- }
- }
- }
-
- public Bundle onSaveInstanceState() {
- Bundle state = new Bundle();
- for (CordovaPlugin plugin : this.pluginMap.values()) {
- if (plugin != null) {
- Bundle pluginState = plugin.onSaveInstanceState();
- if(pluginState != null) {
- state.putBundle(plugin.getServiceName(), pluginState);
- }
- }
- }
- return state;
- }
-}
diff --git a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/PluginResult.java b/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/PluginResult.java
deleted file mode 100644
index 2b3ac72..0000000
--- a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/PluginResult.java
+++ /dev/null
@@ -1,198 +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.
-*/
-package org.apache.cordova;
-
-import java.util.List;
-
-import org.json.JSONArray;
-import org.json.JSONObject;
-
-import android.util.Base64;
-
-public class PluginResult {
- private final int status;
- private final int messageType;
- private boolean keepCallback = false;
- private String strMessage;
- private String encodedMessage;
- private List multipartMessages;
-
- public PluginResult(Status status) {
- this(status, PluginResult.StatusMessages[status.ordinal()]);
- }
-
- public PluginResult(Status status, String message) {
- this.status = status.ordinal();
- this.messageType = message == null ? MESSAGE_TYPE_NULL : MESSAGE_TYPE_STRING;
- this.strMessage = message;
- }
-
- public PluginResult(Status status, JSONArray message) {
- this.status = status.ordinal();
- this.messageType = MESSAGE_TYPE_JSON;
- encodedMessage = message.toString();
- }
-
- public PluginResult(Status status, JSONObject message) {
- this.status = status.ordinal();
- this.messageType = MESSAGE_TYPE_JSON;
- encodedMessage = message.toString();
- }
-
- public PluginResult(Status status, int i) {
- this.status = status.ordinal();
- this.messageType = MESSAGE_TYPE_NUMBER;
- this.encodedMessage = ""+i;
- }
-
- public PluginResult(Status status, float f) {
- this.status = status.ordinal();
- this.messageType = MESSAGE_TYPE_NUMBER;
- this.encodedMessage = ""+f;
- }
-
- public PluginResult(Status status, boolean b) {
- this.status = status.ordinal();
- this.messageType = MESSAGE_TYPE_BOOLEAN;
- this.encodedMessage = Boolean.toString(b);
- }
-
- public PluginResult(Status status, byte[] data) {
- this(status, data, false);
- }
-
- public PluginResult(Status status, byte[] data, boolean binaryString) {
- this.status = status.ordinal();
- this.messageType = binaryString ? MESSAGE_TYPE_BINARYSTRING : MESSAGE_TYPE_ARRAYBUFFER;
- this.encodedMessage = Base64.encodeToString(data, Base64.NO_WRAP);
- }
-
- // The keepCallback and status of multipartMessages are ignored.
- public PluginResult(Status status, List multipartMessages) {
- this.status = status.ordinal();
- this.messageType = MESSAGE_TYPE_MULTIPART;
- this.multipartMessages = multipartMessages;
- }
-
- public void setKeepCallback(boolean b) {
- this.keepCallback = b;
- }
-
- public int getStatus() {
- return status;
- }
-
- public int getMessageType() {
- return messageType;
- }
-
- public String getMessage() {
- if (encodedMessage == null) {
- encodedMessage = JSONObject.quote(strMessage);
- }
- return encodedMessage;
- }
-
- public int getMultipartMessagesSize() {
- return multipartMessages.size();
- }
-
- public PluginResult getMultipartMessage(int index) {
- return multipartMessages.get(index);
- }
-
- /**
- * If messageType == MESSAGE_TYPE_STRING, then returns the message string.
- * Otherwise, returns null.
- */
- public String getStrMessage() {
- return strMessage;
- }
-
- public boolean getKeepCallback() {
- return this.keepCallback;
- }
-
- @Deprecated // Use sendPluginResult instead of sendJavascript.
- public String getJSONString() {
- return "{\"status\":" + this.status + ",\"message\":" + this.getMessage() + ",\"keepCallback\":" + this.keepCallback + "}";
- }
-
- @Deprecated // Use sendPluginResult instead of sendJavascript.
- public String toCallbackString(String callbackId) {
- // If no result to be sent and keeping callback, then no need to sent back to JavaScript
- if ((status == PluginResult.Status.NO_RESULT.ordinal()) && keepCallback) {
- return null;
- }
-
- // Check the success (OK, NO_RESULT & !KEEP_CALLBACK)
- if ((status == PluginResult.Status.OK.ordinal()) || (status == PluginResult.Status.NO_RESULT.ordinal())) {
- return toSuccessCallbackString(callbackId);
- }
-
- return toErrorCallbackString(callbackId);
- }
-
- @Deprecated // Use sendPluginResult instead of sendJavascript.
- public String toSuccessCallbackString(String callbackId) {
- return "cordova.callbackSuccess('"+callbackId+"',"+this.getJSONString()+");";
- }
-
- @Deprecated // Use sendPluginResult instead of sendJavascript.
- public String toErrorCallbackString(String callbackId) {
- return "cordova.callbackError('"+callbackId+"', " + this.getJSONString()+ ");";
- }
-
- public static final int MESSAGE_TYPE_STRING = 1;
- public static final int MESSAGE_TYPE_JSON = 2;
- public static final int MESSAGE_TYPE_NUMBER = 3;
- public static final int MESSAGE_TYPE_BOOLEAN = 4;
- public static final int MESSAGE_TYPE_NULL = 5;
- public static final int MESSAGE_TYPE_ARRAYBUFFER = 6;
- // Use BINARYSTRING when your string may contain null characters.
- // This is required to work around a bug in the platform :(.
- public static final int MESSAGE_TYPE_BINARYSTRING = 7;
- public static final int MESSAGE_TYPE_MULTIPART = 8;
-
- public static String[] StatusMessages = new String[] {
- "No result",
- "OK",
- "Class not found",
- "Illegal access",
- "Instantiation error",
- "Malformed url",
- "IO error",
- "Invalid action",
- "JSON error",
- "Error"
- };
-
- public enum Status {
- NO_RESULT,
- OK,
- CLASS_NOT_FOUND_EXCEPTION,
- ILLEGAL_ACCESS_EXCEPTION,
- INSTANTIATION_EXCEPTION,
- MALFORMED_URL_EXCEPTION,
- IO_EXCEPTION,
- INVALID_ACTION,
- JSON_EXCEPTION,
- ERROR
- }
-}
diff --git a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/ResumeCallback.java b/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/ResumeCallback.java
deleted file mode 100644
index 49a43b5..0000000
--- a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/ResumeCallback.java
+++ /dev/null
@@ -1,76 +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.
-*/
-package org.apache.cordova;
-
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class ResumeCallback extends CallbackContext {
- private final String TAG = "CordovaResumeCallback";
- private String serviceName;
- private PluginManager pluginManager;
-
- public ResumeCallback(String serviceName, PluginManager pluginManager) {
- super("resumecallback", null);
- this.serviceName = serviceName;
- this.pluginManager = pluginManager;
- }
-
- @Override
- public void sendPluginResult(PluginResult pluginResult) {
- synchronized (this) {
- if (finished) {
- LOG.w(TAG, serviceName + " attempted to send a second callback to ResumeCallback\nResult was: " + pluginResult.getMessage());
- return;
- } else {
- finished = true;
- }
- }
-
- JSONObject event = new JSONObject();
- JSONObject pluginResultObject = new JSONObject();
-
- try {
- pluginResultObject.put("pluginServiceName", this.serviceName);
- pluginResultObject.put("pluginStatus", PluginResult.StatusMessages[pluginResult.getStatus()]);
-
- event.put("action", "resume");
- event.put("pendingResult", pluginResultObject);
- } catch (JSONException e) {
- LOG.e(TAG, "Unable to create resume object for Activity Result");
- }
-
- PluginResult eventResult = new PluginResult(PluginResult.Status.OK, event);
-
- // We send a list of results to the js so that we don't have to decode
- // the PluginResult passed to this CallbackContext into JSON twice.
- // The results are combined into an event payload before the event is
- // fired on the js side of things (see platform.js)
- List result = new ArrayList();
- result.add(eventResult);
- result.add(pluginResult);
-
- CoreAndroid appPlugin = (CoreAndroid) pluginManager.getPlugin(CoreAndroid.PLUGIN_NAME);
- appPlugin.sendResumeEvent(new PluginResult(PluginResult.Status.OK, result));
- }
-}
diff --git a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/Whitelist.java b/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/Whitelist.java
deleted file mode 100644
index d0f823c..0000000
--- a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/Whitelist.java
+++ /dev/null
@@ -1,170 +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.
-*/
-package org.apache.cordova;
-
-import java.net.MalformedURLException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.apache.cordova.LOG;
-
-import android.net.Uri;
-
-public class Whitelist {
- private static class URLPattern {
- public Pattern scheme;
- public Pattern host;
- public Integer port;
- public Pattern path;
-
- private String regexFromPattern(String pattern, boolean allowWildcards) {
- final String toReplace = "\\.[]{}()^$?+|";
- StringBuilder regex = new StringBuilder();
- for (int i=0; i < pattern.length(); i++) {
- char c = pattern.charAt(i);
- if (c == '*' && allowWildcards) {
- regex.append(".");
- } else if (toReplace.indexOf(c) > -1) {
- regex.append('\\');
- }
- regex.append(c);
- }
- return regex.toString();
- }
-
- public URLPattern(String scheme, String host, String port, String path) throws MalformedURLException {
- try {
- if (scheme == null || "*".equals(scheme)) {
- this.scheme = null;
- } else {
- this.scheme = Pattern.compile(regexFromPattern(scheme, false), Pattern.CASE_INSENSITIVE);
- }
- if ("*".equals(host)) {
- this.host = null;
- } else if (host.startsWith("*.")) {
- this.host = Pattern.compile("([a-z0-9.-]*\\.)?" + regexFromPattern(host.substring(2), false), Pattern.CASE_INSENSITIVE);
- } else {
- this.host = Pattern.compile(regexFromPattern(host, false), Pattern.CASE_INSENSITIVE);
- }
- if (port == null || "*".equals(port)) {
- this.port = null;
- } else {
- this.port = Integer.parseInt(port,10);
- }
- if (path == null || "/*".equals(path)) {
- this.path = null;
- } else {
- this.path = Pattern.compile(regexFromPattern(path, true));
- }
- } catch (NumberFormatException e) {
- throw new MalformedURLException("Port must be a number");
- }
- }
-
- public boolean matches(Uri uri) {
- try {
- return ((scheme == null || scheme.matcher(uri.getScheme()).matches()) &&
- (host == null || host.matcher(uri.getHost()).matches()) &&
- (port == null || port.equals(uri.getPort())) &&
- (path == null || path.matcher(uri.getPath()).matches()));
- } catch (Exception e) {
- LOG.d(TAG, e.toString());
- return false;
- }
- }
- }
-
- private ArrayList whiteList;
-
- public static final String TAG = "Whitelist";
-
- public Whitelist() {
- this.whiteList = new ArrayList();
- }
-
- /* Match patterns (from http://developer.chrome.com/extensions/match_patterns.html)
- *
- * := ://
- * := '*' | 'http' | 'https' | 'file' | 'ftp' | 'chrome-extension'
- * := '*' | '*.' +
- * := '/'
- *
- * We extend this to explicitly allow a port attached to the host, and we allow
- * the scheme to be omitted for backwards compatibility. (Also host is not required
- * to begin with a "*" or "*.".)
- */
- public void addWhiteListEntry(String origin, boolean subdomains) {
- if (whiteList != null) {
- try {
- // Unlimited access to network resources
- if (origin.compareTo("*") == 0) {
- LOG.d(TAG, "Unlimited access to network resources");
- whiteList = null;
- }
- else { // specific access
- Pattern parts = Pattern.compile("^((\\*|[A-Za-z-]+):(//)?)?(\\*|((\\*\\.)?[^*/:]+))?(:(\\d+))?(/.*)?");
- Matcher m = parts.matcher(origin);
- if (m.matches()) {
- String scheme = m.group(2);
- String host = m.group(4);
- // Special case for two urls which are allowed to have empty hosts
- if (("file".equals(scheme) || "content".equals(scheme)) && host == null) host = "*";
- String port = m.group(8);
- String path = m.group(9);
- if (scheme == null) {
- // XXX making it stupid friendly for people who forget to include protocol/SSL
- whiteList.add(new URLPattern("http", host, port, path));
- whiteList.add(new URLPattern("https", host, port, path));
- } else {
- whiteList.add(new URLPattern(scheme, host, port, path));
- }
- }
- }
- } catch (Exception e) {
- LOG.d(TAG, "Failed to add origin %s", origin);
- }
- }
- }
-
-
- /**
- * Determine if URL is in approved list of URLs to load.
- *
- * @param uri
- * @return true if wide open or whitelisted
- */
- public boolean isUrlWhiteListed(String uri) {
- // If there is no whitelist, then it's wide open
- if (whiteList == null) return true;
-
- Uri parsedUri = Uri.parse(uri);
- // Look for match in white list
- Iterator pit = whiteList.iterator();
- while (pit.hasNext()) {
- URLPattern p = pit.next();
- if (p.matches(parsedUri)) {
- return true;
- }
- }
- return false;
- }
-
-}
diff --git a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemCookieManager.java b/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemCookieManager.java
deleted file mode 100644
index acf795f..0000000
--- a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemCookieManager.java
+++ /dev/null
@@ -1,69 +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.
-*/
-
-package org.apache.cordova.engine;
-
-import android.annotation.TargetApi;
-import android.os.Build;
-import android.webkit.CookieManager;
-import android.webkit.WebView;
-
-import org.apache.cordova.ICordovaCookieManager;
-
-class SystemCookieManager implements ICordovaCookieManager {
-
- protected final WebView webView;
- private final CookieManager cookieManager;
-
- //Added because lint can't see the conditional RIGHT ABOVE this
- @TargetApi(Build.VERSION_CODES.LOLLIPOP)
- public SystemCookieManager(WebView webview) {
- webView = webview;
- cookieManager = CookieManager.getInstance();
-
- //REALLY? Nobody has seen this UNTIL NOW?
- cookieManager.setAcceptFileSchemeCookies(true);
-
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
- cookieManager.setAcceptThirdPartyCookies(webView, true);
- }
- }
-
- public void setCookiesEnabled(boolean accept) {
- cookieManager.setAcceptCookie(accept);
- }
-
- public void setCookie(final String url, final String value) {
- cookieManager.setCookie(url, value);
- }
-
- public String getCookie(final String url) {
- return cookieManager.getCookie(url);
- }
-
- public void clearCookies() {
- cookieManager.removeAllCookie();
- }
-
- public void flush() {
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
- cookieManager.flush();
- }
- }
-};
diff --git a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemExposedJsApi.java b/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemExposedJsApi.java
deleted file mode 100644
index 94c3d93..0000000
--- a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemExposedJsApi.java
+++ /dev/null
@@ -1,53 +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.
-*/
-package org.apache.cordova.engine;
-
-import android.webkit.JavascriptInterface;
-
-import org.apache.cordova.CordovaBridge;
-import org.apache.cordova.ExposedJsApi;
-import org.json.JSONException;
-
-/**
- * Contains APIs that the JS can call. All functions in here should also have
- * an equivalent entry in CordovaChromeClient.java, and be added to
- * cordova-js/lib/android/plugin/android/promptbasednativeapi.js
- */
-class SystemExposedJsApi implements ExposedJsApi {
- private final CordovaBridge bridge;
-
- SystemExposedJsApi(CordovaBridge bridge) {
- this.bridge = bridge;
- }
-
- @JavascriptInterface
- public String exec(int bridgeSecret, String service, String action, String callbackId, String arguments) throws JSONException, IllegalAccessException {
- return bridge.jsExec(bridgeSecret, service, action, callbackId, arguments);
- }
-
- @JavascriptInterface
- public void setNativeToJsBridgeMode(int bridgeSecret, int value) throws IllegalAccessException {
- bridge.jsSetNativeToJsBridgeMode(bridgeSecret, value);
- }
-
- @JavascriptInterface
- public String retrieveJsMessages(int bridgeSecret, boolean fromOnlineEvent) throws IllegalAccessException {
- return bridge.jsRetrieveJsMessages(bridgeSecret, fromOnlineEvent);
- }
-}
diff --git a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemWebChromeClient.java b/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemWebChromeClient.java
deleted file mode 100644
index 3ea5e57..0000000
--- a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemWebChromeClient.java
+++ /dev/null
@@ -1,292 +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.
-*/
-package org.apache.cordova.engine;
-
-import java.util.Arrays;
-import android.annotation.TargetApi;
-import android.app.Activity;
-import android.content.Context;
-import android.content.ActivityNotFoundException;
-import android.content.Intent;
-import android.net.Uri;
-import android.os.Build;
-import android.view.Gravity;
-import android.view.View;
-import android.view.ViewGroup.LayoutParams;
-import android.webkit.ConsoleMessage;
-import android.webkit.GeolocationPermissions.Callback;
-import android.webkit.JsPromptResult;
-import android.webkit.JsResult;
-import android.webkit.ValueCallback;
-import android.webkit.WebChromeClient;
-import android.webkit.WebStorage;
-import android.webkit.WebView;
-import android.webkit.PermissionRequest;
-import android.widget.LinearLayout;
-import android.widget.ProgressBar;
-import android.widget.RelativeLayout;
-
-import org.apache.cordova.CordovaDialogsHelper;
-import org.apache.cordova.CordovaPlugin;
-import org.apache.cordova.LOG;
-
-/**
- * This class is the WebChromeClient that implements callbacks for our web view.
- * The kind of callbacks that happen here are on the chrome outside the document,
- * such as onCreateWindow(), onConsoleMessage(), onProgressChanged(), etc. Related
- * to but different than CordovaWebViewClient.
- */
-public class SystemWebChromeClient extends WebChromeClient {
-
- private static final int FILECHOOSER_RESULTCODE = 5173;
- private static final String LOG_TAG = "SystemWebChromeClient";
- private long MAX_QUOTA = 100 * 1024 * 1024;
- protected final SystemWebViewEngine parentEngine;
-
- // the video progress view
- private View mVideoProgressView;
-
- private CordovaDialogsHelper dialogsHelper;
- private Context appContext;
-
- private WebChromeClient.CustomViewCallback mCustomViewCallback;
- private View mCustomView;
-
- public SystemWebChromeClient(SystemWebViewEngine parentEngine) {
- this.parentEngine = parentEngine;
- appContext = parentEngine.webView.getContext();
- dialogsHelper = new CordovaDialogsHelper(appContext);
- }
-
- /**
- * Tell the client to display a javascript alert dialog.
- */
- @Override
- public boolean onJsAlert(WebView view, String url, String message, final JsResult result) {
- dialogsHelper.showAlert(message, new CordovaDialogsHelper.Result() {
- @Override public void gotResult(boolean success, String value) {
- if (success) {
- result.confirm();
- } else {
- result.cancel();
- }
- }
- });
- return true;
- }
-
- /**
- * Tell the client to display a confirm dialog to the user.
- */
- @Override
- public boolean onJsConfirm(WebView view, String url, String message, final JsResult result) {
- dialogsHelper.showConfirm(message, new CordovaDialogsHelper.Result() {
- @Override
- public void gotResult(boolean success, String value) {
- if (success) {
- result.confirm();
- } else {
- result.cancel();
- }
- }
- });
- return true;
- }
-
- /**
- * Tell the client to display a prompt dialog to the user.
- * If the client returns true, WebView will assume that the client will
- * handle the prompt dialog and call the appropriate JsPromptResult method.
- *
- * Since we are hacking prompts for our own purposes, we should not be using them for
- * this purpose, perhaps we should hack console.log to do this instead!
- */
- @Override
- public boolean onJsPrompt(WebView view, String origin, String message, String defaultValue, final JsPromptResult result) {
- // Unlike the @JavascriptInterface bridge, this method is always called on the UI thread.
- String handledRet = parentEngine.bridge.promptOnJsPrompt(origin, message, defaultValue);
- if (handledRet != null) {
- result.confirm(handledRet);
- } else {
- dialogsHelper.showPrompt(message, defaultValue, new CordovaDialogsHelper.Result() {
- @Override
- public void gotResult(boolean success, String value) {
- if (success) {
- result.confirm(value);
- } else {
- result.cancel();
- }
- }
- });
- }
- return true;
- }
-
- /**
- * Handle database quota exceeded notification.
- */
- @Override
- public void onExceededDatabaseQuota(String url, String databaseIdentifier, long currentQuota, long estimatedSize,
- long totalUsedQuota, WebStorage.QuotaUpdater quotaUpdater)
- {
- LOG.d(LOG_TAG, "onExceededDatabaseQuota estimatedSize: %d currentQuota: %d totalUsedQuota: %d", estimatedSize, currentQuota, totalUsedQuota);
- quotaUpdater.updateQuota(MAX_QUOTA);
- }
-
- // console.log in api level 7: http://developer.android.com/guide/developing/debug-tasks.html
- // Expect this to not compile in a future Android release!
- @SuppressWarnings("deprecation")
- @Override
- public void onConsoleMessage(String message, int lineNumber, String sourceID)
- {
- //This is only for Android 2.1
- if(android.os.Build.VERSION.SDK_INT == android.os.Build.VERSION_CODES.ECLAIR_MR1)
- {
- LOG.d(LOG_TAG, "%s: Line %d : %s", sourceID, lineNumber, message);
- super.onConsoleMessage(message, lineNumber, sourceID);
- }
- }
-
- @TargetApi(8)
- @Override
- public boolean onConsoleMessage(ConsoleMessage consoleMessage)
- {
- if (consoleMessage.message() != null)
- LOG.d(LOG_TAG, "%s: Line %d : %s" , consoleMessage.sourceId() , consoleMessage.lineNumber(), consoleMessage.message());
- return super.onConsoleMessage(consoleMessage);
- }
-
- @Override
- /**
- * Instructs the client to show a prompt to ask the user to set the Geolocation permission state for the specified origin.
- *
- * This also checks for the Geolocation Plugin and requests permission from the application to use Geolocation.
- *
- * @param origin
- * @param callback
- */
- public void onGeolocationPermissionsShowPrompt(String origin, Callback callback) {
- super.onGeolocationPermissionsShowPrompt(origin, callback);
- callback.invoke(origin, true, false);
- //Get the plugin, it should be loaded
- CordovaPlugin geolocation = parentEngine.pluginManager.getPlugin("Geolocation");
- if(geolocation != null && !geolocation.hasPermisssion())
- {
- geolocation.requestPermissions(0);
- }
-
- }
-
- // API level 7 is required for this, see if we could lower this using something else
- @Override
- public void onShowCustomView(View view, WebChromeClient.CustomViewCallback callback) {
- parentEngine.getCordovaWebView().showCustomView(view, callback);
- }
-
- @Override
- public void onHideCustomView() {
- parentEngine.getCordovaWebView().hideCustomView();
- }
-
- @Override
- /**
- * Ask the host application for a custom progress view to show while
- * a is loading.
- * @return View The progress view.
- */
- public View getVideoLoadingProgressView() {
-
- if (mVideoProgressView == null) {
- // Create a new Loading view programmatically.
-
- // create the linear layout
- LinearLayout layout = new LinearLayout(parentEngine.getView().getContext());
- layout.setOrientation(LinearLayout.VERTICAL);
- RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
- layoutParams.addRule(RelativeLayout.CENTER_IN_PARENT);
- layout.setLayoutParams(layoutParams);
- // the proress bar
- ProgressBar bar = new ProgressBar(parentEngine.getView().getContext());
- LinearLayout.LayoutParams barLayoutParams = new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
- barLayoutParams.gravity = Gravity.CENTER;
- bar.setLayoutParams(barLayoutParams);
- layout.addView(bar);
-
- mVideoProgressView = layout;
- }
- return mVideoProgressView;
- }
-
- // support:
- // openFileChooser() is for pre KitKat and in KitKat mr1 (it's known broken in KitKat).
- // For Lollipop, we use onShowFileChooser().
- public void openFileChooser(ValueCallback uploadMsg) {
- this.openFileChooser(uploadMsg, "*/*");
- }
-
- public void openFileChooser( ValueCallback uploadMsg, String acceptType ) {
- this.openFileChooser(uploadMsg, acceptType, null);
- }
-
- public void openFileChooser(final ValueCallback uploadMsg, String acceptType, String capture)
- {
- Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
- intent.addCategory(Intent.CATEGORY_OPENABLE);
- intent.setType("*/*");
- parentEngine.cordova.startActivityForResult(new CordovaPlugin() {
- @Override
- public void onActivityResult(int requestCode, int resultCode, Intent intent) {
- Uri result = intent == null || resultCode != Activity.RESULT_OK ? null : intent.getData();
- LOG.d(LOG_TAG, "Receive file chooser URL: " + result);
- uploadMsg.onReceiveValue(result);
- }
- }, intent, FILECHOOSER_RESULTCODE);
- }
-
- @TargetApi(Build.VERSION_CODES.LOLLIPOP)
- @Override
- public boolean onShowFileChooser(WebView webView, final ValueCallback filePathsCallback, final WebChromeClient.FileChooserParams fileChooserParams) {
- Intent intent = fileChooserParams.createIntent();
- try {
- parentEngine.cordova.startActivityForResult(new CordovaPlugin() {
- @Override
- public void onActivityResult(int requestCode, int resultCode, Intent intent) {
- Uri[] result = WebChromeClient.FileChooserParams.parseResult(resultCode, intent);
- LOG.d(LOG_TAG, "Receive file chooser URL: " + result);
- filePathsCallback.onReceiveValue(result);
- }
- }, intent, FILECHOOSER_RESULTCODE);
- } catch (ActivityNotFoundException e) {
- LOG.w("No activity found to handle file chooser intent.", e);
- filePathsCallback.onReceiveValue(null);
- }
- return true;
- }
-
- @TargetApi(Build.VERSION_CODES.LOLLIPOP)
- @Override
- public void onPermissionRequest(final PermissionRequest request) {
- LOG.d(LOG_TAG, "onPermissionRequest: " + Arrays.toString(request.getResources()));
- request.grant(request.getResources());
- }
-
- public void destroyLastDialog(){
- dialogsHelper.destroyLastDialog();
- }
-}
diff --git a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemWebView.java b/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemWebView.java
deleted file mode 100644
index 01c2f00..0000000
--- a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemWebView.java
+++ /dev/null
@@ -1,88 +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.
-*/
-
-package org.apache.cordova.engine;
-
-import android.content.Context;
-import android.util.AttributeSet;
-import android.view.KeyEvent;
-import android.webkit.WebChromeClient;
-import android.webkit.WebView;
-import android.webkit.WebViewClient;
-
-import org.apache.cordova.CordovaInterface;
-import org.apache.cordova.CordovaWebView;
-import org.apache.cordova.CordovaWebViewEngine;
-
-/**
- * Custom WebView subclass that enables us to capture events needed for Cordova.
- */
-public class SystemWebView extends WebView implements CordovaWebViewEngine.EngineView {
- private SystemWebViewClient viewClient;
- SystemWebChromeClient chromeClient;
- private SystemWebViewEngine parentEngine;
- private CordovaInterface cordova;
-
- public SystemWebView(Context context) {
- this(context, null);
- }
-
- public SystemWebView(Context context, AttributeSet attrs) {
- super(context, attrs);
- }
-
- // Package visibility to enforce that only SystemWebViewEngine should call this method.
- void init(SystemWebViewEngine parentEngine, CordovaInterface cordova) {
- this.cordova = cordova;
- this.parentEngine = parentEngine;
- if (this.viewClient == null) {
- setWebViewClient(new SystemWebViewClient(parentEngine));
- }
-
- if (this.chromeClient == null) {
- setWebChromeClient(new SystemWebChromeClient(parentEngine));
- }
- }
-
- @Override
- public CordovaWebView getCordovaWebView() {
- return parentEngine != null ? parentEngine.getCordovaWebView() : null;
- }
-
- @Override
- public void setWebViewClient(WebViewClient client) {
- viewClient = (SystemWebViewClient)client;
- super.setWebViewClient(client);
- }
-
- @Override
- public void setWebChromeClient(WebChromeClient client) {
- chromeClient = (SystemWebChromeClient)client;
- super.setWebChromeClient(client);
- }
-
- @Override
- public boolean dispatchKeyEvent(KeyEvent event) {
- Boolean ret = parentEngine.client.onDispatchKeyEvent(event);
- if (ret != null) {
- return ret.booleanValue();
- }
- return super.dispatchKeyEvent(event);
- }
-}
diff --git a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemWebViewClient.java b/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemWebViewClient.java
deleted file mode 100644
index d176502..0000000
--- a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemWebViewClient.java
+++ /dev/null
@@ -1,374 +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.
-*/
-package org.apache.cordova.engine;
-
-import android.annotation.TargetApi;
-import android.content.pm.ApplicationInfo;
-import android.content.pm.PackageManager;
-import android.content.pm.PackageManager.NameNotFoundException;
-import android.graphics.Bitmap;
-import android.net.Uri;
-import android.net.http.SslError;
-import android.os.Build;
-import android.webkit.ClientCertRequest;
-import android.webkit.HttpAuthHandler;
-import android.webkit.SslErrorHandler;
-import android.webkit.WebResourceResponse;
-import android.webkit.WebView;
-import android.webkit.WebViewClient;
-
-import org.apache.cordova.AuthenticationToken;
-import org.apache.cordova.CordovaClientCertRequest;
-import org.apache.cordova.CordovaHttpAuthHandler;
-import org.apache.cordova.CordovaResourceApi;
-import org.apache.cordova.LOG;
-import org.apache.cordova.PluginManager;
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.util.Hashtable;
-
-
-/**
- * This class is the WebViewClient that implements callbacks for our web view.
- * The kind of callbacks that happen here are regarding the rendering of the
- * document instead of the chrome surrounding it, such as onPageStarted(),
- * shouldOverrideUrlLoading(), etc. Related to but different than
- * CordovaChromeClient.
- */
-public class SystemWebViewClient extends WebViewClient {
-
- private static final String TAG = "SystemWebViewClient";
- protected final SystemWebViewEngine parentEngine;
- private boolean doClearHistory = false;
- boolean isCurrentlyLoading;
-
- /** The authorization tokens. */
- private Hashtable authenticationTokens = new Hashtable();
-
- public SystemWebViewClient(SystemWebViewEngine parentEngine) {
- this.parentEngine = parentEngine;
- }
-
- /**
- * Give the host application a chance to take over the control when a new url
- * is about to be loaded in the current WebView.
- *
- * @param view The WebView that is initiating the callback.
- * @param url The url to be loaded.
- * @return true to override, false for default behavior
- */
- @Override
- public boolean shouldOverrideUrlLoading(WebView view, String url) {
- return parentEngine.client.onNavigationAttempt(url);
- }
-
- /**
- * On received http auth request.
- * The method reacts on all registered authentication tokens. There is one and only one authentication token for any host + realm combination
- */
- @Override
- public void onReceivedHttpAuthRequest(WebView view, HttpAuthHandler handler, String host, String realm) {
-
- // Get the authentication token (if specified)
- AuthenticationToken token = this.getAuthenticationToken(host, realm);
- if (token != null) {
- handler.proceed(token.getUserName(), token.getPassword());
- return;
- }
-
- // Check if there is some plugin which can resolve this auth challenge
- PluginManager pluginManager = this.parentEngine.pluginManager;
- if (pluginManager != null && pluginManager.onReceivedHttpAuthRequest(null, new CordovaHttpAuthHandler(handler), host, realm)) {
- parentEngine.client.clearLoadTimeoutTimer();
- return;
- }
-
- // By default handle 401 like we'd normally do!
- super.onReceivedHttpAuthRequest(view, handler, host, realm);
- }
-
- /**
- * On received client cert request.
- * The method forwards the request to any running plugins before using the default implementation.
- *
- * @param view
- * @param request
- */
- @Override
- @TargetApi(21)
- public void onReceivedClientCertRequest (WebView view, ClientCertRequest request)
- {
-
- // Check if there is some plugin which can resolve this certificate request
- PluginManager pluginManager = this.parentEngine.pluginManager;
- if (pluginManager != null && pluginManager.onReceivedClientCertRequest(null, new CordovaClientCertRequest(request))) {
- parentEngine.client.clearLoadTimeoutTimer();
- return;
- }
-
- // By default pass to WebViewClient
- super.onReceivedClientCertRequest(view, request);
- }
-
- /**
- * Notify the host application that a page has started loading.
- * This method is called once for each main frame load so a page with iframes or framesets will call onPageStarted
- * one time for the main frame. This also means that onPageStarted will not be called when the contents of an
- * embedded frame changes, i.e. clicking a link whose target is an iframe.
- *
- * @param view The webview initiating the callback.
- * @param url The url of the page.
- */
- @Override
- public void onPageStarted(WebView view, String url, Bitmap favicon) {
- super.onPageStarted(view, url, favicon);
- isCurrentlyLoading = true;
- // Flush stale messages & reset plugins.
- parentEngine.bridge.reset();
- parentEngine.client.onPageStarted(url);
- }
-
- /**
- * Notify the host application that a page has finished loading.
- * This method is called only for main frame. When onPageFinished() is called, the rendering picture may not be updated yet.
- *
- *
- * @param view The webview initiating the callback.
- * @param url The url of the page.
- */
- @Override
- public void onPageFinished(WebView view, String url) {
- super.onPageFinished(view, url);
- // Ignore excessive calls, if url is not about:blank (CB-8317).
- if (!isCurrentlyLoading && !url.startsWith("about:")) {
- return;
- }
- isCurrentlyLoading = false;
-
- /**
- * Because of a timing issue we need to clear this history in onPageFinished as well as
- * onPageStarted. However we only want to do this if the doClearHistory boolean is set to
- * true. You see when you load a url with a # in it which is common in jQuery applications
- * onPageStared is not called. Clearing the history at that point would break jQuery apps.
- */
- if (this.doClearHistory) {
- view.clearHistory();
- this.doClearHistory = false;
- }
- parentEngine.client.onPageFinishedLoading(url);
-
- }
-
- /**
- * Report an error to the host application. These errors are unrecoverable (i.e. the main resource is unavailable).
- * The errorCode parameter corresponds to one of the ERROR_* constants.
- *
- * @param view The WebView that is initiating the callback.
- * @param errorCode The error code corresponding to an ERROR_* value.
- * @param description A String describing the error.
- * @param failingUrl The url that failed to load.
- */
- @Override
- public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
- // Ignore error due to stopLoading().
- if (!isCurrentlyLoading) {
- return;
- }
- LOG.d(TAG, "CordovaWebViewClient.onReceivedError: Error code=%s Description=%s URL=%s", errorCode, description, failingUrl);
-
- // If this is a "Protocol Not Supported" error, then revert to the previous
- // page. If there was no previous page, then punt. The application's config
- // is likely incorrect (start page set to sms: or something like that)
- if (errorCode == WebViewClient.ERROR_UNSUPPORTED_SCHEME) {
- parentEngine.client.clearLoadTimeoutTimer();
-
- if (view.canGoBack()) {
- view.goBack();
- return;
- } else {
- super.onReceivedError(view, errorCode, description, failingUrl);
- }
- }
- parentEngine.client.onReceivedError(errorCode, description, failingUrl);
- }
-
- /**
- * Notify the host application that an SSL error occurred while loading a resource.
- * The host application must call either handler.cancel() or handler.proceed().
- * Note that the decision may be retained for use in response to future SSL errors.
- * The default behavior is to cancel the load.
- *
- * @param view The WebView that is initiating the callback.
- * @param handler An SslErrorHandler object that will handle the user's response.
- * @param error The SSL error object.
- */
- @TargetApi(8)
- @Override
- public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
-
- final String packageName = parentEngine.cordova.getActivity().getPackageName();
- final PackageManager pm = parentEngine.cordova.getActivity().getPackageManager();
-
- ApplicationInfo appInfo;
- try {
- appInfo = pm.getApplicationInfo(packageName, PackageManager.GET_META_DATA);
- if ((appInfo.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0) {
- // debug = true
- handler.proceed();
- return;
- } else {
- // debug = false
- super.onReceivedSslError(view, handler, error);
- }
- } catch (NameNotFoundException e) {
- // When it doubt, lock it out!
- super.onReceivedSslError(view, handler, error);
- }
- }
-
-
- /**
- * Sets the authentication token.
- *
- * @param authenticationToken
- * @param host
- * @param realm
- */
- public void setAuthenticationToken(AuthenticationToken authenticationToken, String host, String realm) {
- if (host == null) {
- host = "";
- }
- if (realm == null) {
- realm = "";
- }
- this.authenticationTokens.put(host.concat(realm), authenticationToken);
- }
-
- /**
- * Removes the authentication token.
- *
- * @param host
- * @param realm
- *
- * @return the authentication token or null if did not exist
- */
- public AuthenticationToken removeAuthenticationToken(String host, String realm) {
- return this.authenticationTokens.remove(host.concat(realm));
- }
-
- /**
- * Gets the authentication token.
- *
- * In order it tries:
- * 1- host + realm
- * 2- host
- * 3- realm
- * 4- no host, no realm
- *
- * @param host
- * @param realm
- *
- * @return the authentication token
- */
- public AuthenticationToken getAuthenticationToken(String host, String realm) {
- AuthenticationToken token = null;
- token = this.authenticationTokens.get(host.concat(realm));
-
- if (token == null) {
- // try with just the host
- token = this.authenticationTokens.get(host);
-
- // Try the realm
- if (token == null) {
- token = this.authenticationTokens.get(realm);
- }
-
- // if no host found, just query for default
- if (token == null) {
- token = this.authenticationTokens.get("");
- }
- }
-
- return token;
- }
-
- /**
- * Clear all authentication tokens.
- */
- public void clearAuthenticationTokens() {
- this.authenticationTokens.clear();
- }
-
- @TargetApi(Build.VERSION_CODES.HONEYCOMB)
- @Override
- public WebResourceResponse shouldInterceptRequest(WebView view, String url) {
- try {
- // Check the against the whitelist and lock out access to the WebView directory
- // Changing this will cause problems for your application
- if (!parentEngine.pluginManager.shouldAllowRequest(url)) {
- LOG.w(TAG, "URL blocked by whitelist: " + url);
- // Results in a 404.
- return new WebResourceResponse("text/plain", "UTF-8", null);
- }
-
- CordovaResourceApi resourceApi = parentEngine.resourceApi;
- Uri origUri = Uri.parse(url);
- // Allow plugins to intercept WebView requests.
- Uri remappedUri = resourceApi.remapUri(origUri);
-
- if (!origUri.equals(remappedUri) || needsSpecialsInAssetUrlFix(origUri) || needsKitKatContentUrlFix(origUri)) {
- CordovaResourceApi.OpenForReadResult result = resourceApi.openForRead(remappedUri, true);
- return new WebResourceResponse(result.mimeType, "UTF-8", result.inputStream);
- }
- // If we don't need to special-case the request, let the browser load it.
- return null;
- } catch (IOException e) {
- if (!(e instanceof FileNotFoundException)) {
- LOG.e(TAG, "Error occurred while loading a file (returning a 404).", e);
- }
- // Results in a 404.
- return new WebResourceResponse("text/plain", "UTF-8", null);
- }
- }
-
- private static boolean needsKitKatContentUrlFix(Uri uri) {
- return android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT && "content".equals(uri.getScheme());
- }
-
- private static boolean needsSpecialsInAssetUrlFix(Uri uri) {
- if (CordovaResourceApi.getUriType(uri) != CordovaResourceApi.URI_TYPE_ASSET) {
- return false;
- }
- if (uri.getQuery() != null || uri.getFragment() != null) {
- return true;
- }
-
- if (!uri.toString().contains("%")) {
- return false;
- }
-
- switch(android.os.Build.VERSION.SDK_INT){
- case android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH:
- case android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1:
- return true;
- }
- return false;
- }
-}
diff --git a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemWebViewEngine.java b/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemWebViewEngine.java
deleted file mode 100644
index 0fa0276..0000000
--- a/Zombie/ZombieDetector/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemWebViewEngine.java
+++ /dev/null
@@ -1,350 +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.
-*/
-
-package org.apache.cordova.engine;
-
-import android.annotation.SuppressLint;
-import android.annotation.TargetApi;
-import android.content.BroadcastReceiver;
-import android.content.Context;
-import android.content.Intent;
-import android.content.IntentFilter;
-import android.content.pm.ApplicationInfo;
-import android.os.Build;
-import android.view.View;
-import android.webkit.ValueCallback;
-import android.webkit.WebSettings;
-import android.webkit.WebSettings.LayoutAlgorithm;
-import android.webkit.WebView;
-
-import org.apache.cordova.CordovaBridge;
-import org.apache.cordova.CordovaInterface;
-import org.apache.cordova.CordovaPreferences;
-import org.apache.cordova.CordovaResourceApi;
-import org.apache.cordova.CordovaWebView;
-import org.apache.cordova.CordovaWebViewEngine;
-import org.apache.cordova.ICordovaCookieManager;
-import org.apache.cordova.LOG;
-import org.apache.cordova.NativeToJsMessageQueue;
-import org.apache.cordova.PluginManager;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
-
-/**
- * Glue class between CordovaWebView (main Cordova logic) and SystemWebView (the actual View).
- * We make the Engine separate from the actual View so that:
- * A) We don't need to worry about WebView methods clashing with CordovaWebViewEngine methods
- * (e.g.: goBack() is void for WebView, and boolean for CordovaWebViewEngine)
- * B) Separating the actual View from the Engine makes API surfaces smaller.
- * Class uses two-phase initialization. However, CordovaWebView is responsible for calling .init().
- */
-public class SystemWebViewEngine implements CordovaWebViewEngine {
- public static final String TAG = "SystemWebViewEngine";
-
- protected final SystemWebView webView;
- protected final SystemCookieManager cookieManager;
- protected CordovaPreferences preferences;
- protected CordovaBridge bridge;
- protected CordovaWebViewEngine.Client client;
- protected CordovaWebView parentWebView;
- protected CordovaInterface cordova;
- protected PluginManager pluginManager;
- protected CordovaResourceApi resourceApi;
- protected NativeToJsMessageQueue nativeToJsMessageQueue;
- private BroadcastReceiver receiver;
-
- /** Used when created via reflection. */
- public SystemWebViewEngine(Context context, CordovaPreferences preferences) {
- this(new SystemWebView(context), preferences);
- }
-
- public SystemWebViewEngine(SystemWebView webView) {
- this(webView, null);
- }
-
- public SystemWebViewEngine(SystemWebView webView, CordovaPreferences preferences) {
- this.preferences = preferences;
- this.webView = webView;
- cookieManager = new SystemCookieManager(webView);
- }
-
- @Override
- public void init(CordovaWebView parentWebView, CordovaInterface cordova, CordovaWebViewEngine.Client client,
- CordovaResourceApi resourceApi, PluginManager pluginManager,
- NativeToJsMessageQueue nativeToJsMessageQueue) {
- if (this.cordova != null) {
- throw new IllegalStateException();
- }
- // Needed when prefs are not passed by the constructor
- if (preferences == null) {
- preferences = parentWebView.getPreferences();
- }
- this.parentWebView = parentWebView;
- this.cordova = cordova;
- this.client = client;
- this.resourceApi = resourceApi;
- this.pluginManager = pluginManager;
- this.nativeToJsMessageQueue = nativeToJsMessageQueue;
- webView.init(this, cordova);
-
- initWebViewSettings();
-
- nativeToJsMessageQueue.addBridgeMode(new NativeToJsMessageQueue.OnlineEventsBridgeMode(new NativeToJsMessageQueue.OnlineEventsBridgeMode.OnlineEventsBridgeModeDelegate() {
- @Override
- public void setNetworkAvailable(boolean value) {
- webView.setNetworkAvailable(value);
- }
- @Override
- public void runOnUiThread(Runnable r) {
- SystemWebViewEngine.this.cordova.getActivity().runOnUiThread(r);
- }
- }));
- if(Build.VERSION.SDK_INT > Build.VERSION_CODES.JELLY_BEAN_MR2)
- nativeToJsMessageQueue.addBridgeMode(new NativeToJsMessageQueue.EvalBridgeMode(this, cordova));
- bridge = new CordovaBridge(pluginManager, nativeToJsMessageQueue);
- exposeJsInterface(webView, bridge);
- }
-
- @Override
- public CordovaWebView getCordovaWebView() {
- return parentWebView;
- }
-
- @Override
- public ICordovaCookieManager getCookieManager() {
- return cookieManager;
- }
-
- @Override
- public View getView() {
- return webView;
- }
-
- @SuppressLint({"NewApi", "SetJavaScriptEnabled"})
- @SuppressWarnings("deprecation")
- private void initWebViewSettings() {
- webView.setInitialScale(0);
- webView.setVerticalScrollBarEnabled(false);
- // Enable JavaScript
- final WebSettings settings = webView.getSettings();
- settings.setJavaScriptEnabled(true);
- settings.setJavaScriptCanOpenWindowsAutomatically(true);
- settings.setLayoutAlgorithm(LayoutAlgorithm.NORMAL);
-
- // Set the nav dump for HTC 2.x devices (disabling for ICS, deprecated entirely for Jellybean 4.2)
- try {
- Method gingerbread_getMethod = WebSettings.class.getMethod("setNavDump", new Class[] { boolean.class });
-
- String manufacturer = android.os.Build.MANUFACTURER;
- LOG.d(TAG, "CordovaWebView is running on device made by: " + manufacturer);
- if(android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.HONEYCOMB &&
- android.os.Build.MANUFACTURER.contains("HTC"))
- {
- gingerbread_getMethod.invoke(settings, true);
- }
- } catch (NoSuchMethodException e) {
- LOG.d(TAG, "We are on a modern version of Android, we will deprecate HTC 2.3 devices in 2.8");
- } catch (IllegalArgumentException e) {
- LOG.d(TAG, "Doing the NavDump failed with bad arguments");
- } catch (IllegalAccessException e) {
- LOG.d(TAG, "This should never happen: IllegalAccessException means this isn't Android anymore");
- } catch (InvocationTargetException e) {
- LOG.d(TAG, "This should never happen: InvocationTargetException means this isn't Android anymore.");
- }
-
- //We don't save any form data in the application
- settings.setSaveFormData(false);
- settings.setSavePassword(false);
-
- // Jellybean rightfully tried to lock this down. Too bad they didn't give us a whitelist
- // while we do this
- if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN) {
- settings.setAllowUniversalAccessFromFileURLs(true);
- }
- if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN_MR1) {
- settings.setMediaPlaybackRequiresUserGesture(false);
- }
- // Enable database
- // We keep this disabled because we use or shim to get around DOM_EXCEPTION_ERROR_16
- String databasePath = webView.getContext().getApplicationContext().getDir("database", Context.MODE_PRIVATE).getPath();
- settings.setDatabaseEnabled(true);
- settings.setDatabasePath(databasePath);
-
-
- //Determine whether we're in debug or release mode, and turn on Debugging!
- ApplicationInfo appInfo = webView.getContext().getApplicationContext().getApplicationInfo();
- if ((appInfo.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0 &&
- android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT) {
- enableRemoteDebugging();
- }
-
- settings.setGeolocationDatabasePath(databasePath);
-
- // Enable DOM storage
- settings.setDomStorageEnabled(true);
-
- // Enable built-in geolocation
- settings.setGeolocationEnabled(true);
-
- // Enable AppCache
- // Fix for CB-2282
- settings.setAppCacheMaxSize(5 * 1048576);
- settings.setAppCachePath(databasePath);
- settings.setAppCacheEnabled(true);
-
- // Fix for CB-1405
- // Google issue 4641
- String defaultUserAgent = settings.getUserAgentString();
-
- // Fix for CB-3360
- String overrideUserAgent = preferences.getString("OverrideUserAgent", null);
- if (overrideUserAgent != null) {
- settings.setUserAgentString(overrideUserAgent);
- } else {
- String appendUserAgent = preferences.getString("AppendUserAgent", null);
- if (appendUserAgent != null) {
- settings.setUserAgentString(defaultUserAgent + " " + appendUserAgent);
- }
- }
- // End CB-3360
-
- IntentFilter intentFilter = new IntentFilter();
- intentFilter.addAction(Intent.ACTION_CONFIGURATION_CHANGED);
- if (this.receiver == null) {
- this.receiver = new BroadcastReceiver() {
- @Override
- public void onReceive(Context context, Intent intent) {
- settings.getUserAgentString();
- }
- };
- webView.getContext().registerReceiver(this.receiver, intentFilter);
- }
- // end CB-1405
- }
-
- @TargetApi(Build.VERSION_CODES.KITKAT)
- private void enableRemoteDebugging() {
- try {
- WebView.setWebContentsDebuggingEnabled(true);
- } catch (IllegalArgumentException e) {
- LOG.d(TAG, "You have one job! To turn on Remote Web Debugging! YOU HAVE FAILED! ");
- e.printStackTrace();
- }
- }
-
- private static void exposeJsInterface(WebView webView, CordovaBridge bridge) {
- if ((Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1)) {
- LOG.i(TAG, "Disabled addJavascriptInterface() bridge since Android version is old.");
- // Bug being that Java Strings do not get converted to JS strings automatically.
- // This isn't hard to work-around on the JS side, but it's easier to just
- // use the prompt bridge instead.
- return;
- }
- SystemExposedJsApi exposedJsApi = new SystemExposedJsApi(bridge);
- webView.addJavascriptInterface(exposedJsApi, "_cordovaNative");
- }
-
-
- /**
- * Load the url into the webview.
- */
- @Override
- public void loadUrl(final String url, boolean clearNavigationStack) {
- webView.loadUrl(url);
- }
-
- @Override
- public String getUrl() {
- return webView.getUrl();
- }
-
- @Override
- public void stopLoading() {
- webView.stopLoading();
- }
-
- @Override
- public void clearCache() {
- webView.clearCache(true);
- }
-
- @Override
- public void clearHistory() {
- webView.clearHistory();
- }
-
- @Override
- public boolean canGoBack() {
- return webView.canGoBack();
- }
-
- /**
- * Go to previous page in history. (We manage our own history)
- *
- * @return true if we went back, false if we are already at top
- */
- @Override
- public boolean goBack() {
- // Check webview first to see if there is a history
- // This is needed to support curPage#diffLink, since they are added to parentEngine's history, but not our history url array (JQMobile behavior)
- if (webView.canGoBack()) {
- webView.goBack();
- return true;
- }
- return false;
- }
-
- @Override
- public void setPaused(boolean value) {
- if (value) {
- webView.onPause();
- webView.pauseTimers();
- } else {
- webView.onResume();
- webView.resumeTimers();
- }
- }
-
- @Override
- public void destroy() {
- webView.chromeClient.destroyLastDialog();
- webView.destroy();
- // unregister the receiver
- if (receiver != null) {
- try {
- webView.getContext().unregisterReceiver(receiver);
- } catch (Exception e) {
- LOG.e(TAG, "Error unregistering configuration receiver: " + e.getMessage(), e);
- }
- }
- }
-
- @Override
- public void evaluateJavascript(String js, ValueCallback callback) {
- if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
- webView.evaluateJavascript(js, callback);
- }
- else
- {
- LOG.d(TAG, "This webview is using the old bridge");
- }
- }
-}
diff --git a/Zombie/ZombieDetector/platforms/android/android.json b/Zombie/ZombieDetector/platforms/android/android.json
deleted file mode 100644
index db28cc6..0000000
--- a/Zombie/ZombieDetector/platforms/android/android.json
+++ /dev/null
@@ -1,105 +0,0 @@
-{
- "prepare_queue": {
- "installed": [],
- "uninstalled": []
- },
- "config_munge": {
- "files": {
- "res/xml/config.xml": {
- "parents": {
- "/*": [
- {
- "xml": " ",
- "count": 1
- },
- {
- "xml": " ",
- "count": 1
- },
- {
- "xml": " ",
- "count": 1
- },
- {
- "xml": " ",
- "count": 1
- }
- ]
- }
- },
- "AndroidManifest.xml": {
- "parents": {
- "/*": [
- {
- "xml": " ",
- "count": 3
- },
- {
- "xml": " ",
- "count": 3
- },
- {
- "xml": " ",
- "count": 3
- },
- {
- "xml": " ",
- "count": 3
- }
- ]
- }
- }
- }
- },
- "installed_plugins": {
- "cordova-plugin-whitelist": {
- "PACKAGE_NAME": "com.intel.zombiedetector"
- },
- "cordova-plugin-compat": {
- "PACKAGE_NAME": "com.intel.zombiedetector"
- },
- "com.example.ATmraa": {
- "PACKAGE_NAME": "com.intel.zombiedetector"
- },
- "com.example.ATCamara": {
- "PACKAGE_NAME": "com.intel.zombiedetector"
- },
- "com.example.ATTensorflow": {
- "PACKAGE_NAME": "com.intel.zombiedetector"
- }
- },
- "dependent_plugins": {},
- "modules": [
- {
- "id": "com.example.ATmraa.ATmraa",
- "file": "plugins/com.example.ATmraa/www/ATmraa.js",
- "pluginId": "com.example.ATmraa",
- "clobbers": [
- "ATmraa"
- ]
- },
- {
- "id": "com.example.ATCamara.ATCamara",
- "file": "plugins/com.example.ATCamara/www/ATCamara.js",
- "pluginId": "com.example.ATCamara",
- "clobbers": [
- "ATCamara"
- ]
- },
- {
- "id": "com.example.ATTensorflow.ATTensorflow",
- "file": "plugins/com.example.ATTensorflow/www/ATTensorflow.js",
- "pluginId": "com.example.ATTensorflow",
- "clobbers": [
- "ATTensorflow"
- ]
- }
- ],
- "plugin_metadata": {
- "cordova-plugin-whitelist": "1.3.2",
- "cordova-plugin-compat": "1.1.0",
- "com.example.ATmraa": "0.1.1",
- "com.example.ATCamara": "0.1.0",
- "com.example.ATTensorflow": "0.1.1"
- }
-}
\ No newline at end of file
diff --git a/Zombie/ZombieDetector/platforms/android/assets/www/LICENSE b/Zombie/ZombieDetector/platforms/android/assets/www/LICENSE
deleted file mode 100644
index d3da228..0000000
--- a/Zombie/ZombieDetector/platforms/android/assets/www/LICENSE
+++ /dev/null
@@ -1,203 +0,0 @@
-Copyright 2015 The TensorFlow Authors. All rights reserved.
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright 2015, The TensorFlow Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/Zombie/ZombieDetector/platforms/android/assets/www/cordova-js-src/android/nativeapiprovider.js b/Zombie/ZombieDetector/platforms/android/assets/www/cordova-js-src/android/nativeapiprovider.js
deleted file mode 100644
index 2e9aa67..0000000
--- a/Zombie/ZombieDetector/platforms/android/assets/www/cordova-js-src/android/nativeapiprovider.js
+++ /dev/null
@@ -1,36 +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.
-*/
-
-/**
- * Exports the ExposedJsApi.java object if available, otherwise exports the PromptBasedNativeApi.
- */
-
-var nativeApi = this._cordovaNative || require('cordova/android/promptbasednativeapi');
-var currentApi = nativeApi;
-
-module.exports = {
- get: function() { return currentApi; },
- setPreferPrompt: function(value) {
- currentApi = value ? require('cordova/android/promptbasednativeapi') : nativeApi;
- },
- // Used only by tests.
- set: function(value) {
- currentApi = value;
- }
-};
diff --git a/Zombie/ZombieDetector/platforms/android/assets/www/cordova-js-src/android/promptbasednativeapi.js b/Zombie/ZombieDetector/platforms/android/assets/www/cordova-js-src/android/promptbasednativeapi.js
deleted file mode 100644
index f7fb6bc..0000000
--- a/Zombie/ZombieDetector/platforms/android/assets/www/cordova-js-src/android/promptbasednativeapi.js
+++ /dev/null
@@ -1,35 +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.
-*/
-
-/**
- * Implements the API of ExposedJsApi.java, but uses prompt() to communicate.
- * This is used pre-JellyBean, where addJavascriptInterface() is disabled.
- */
-
-module.exports = {
- exec: function(bridgeSecret, service, action, callbackId, argsJson) {
- return prompt(argsJson, 'gap:'+JSON.stringify([bridgeSecret, service, action, callbackId]));
- },
- setNativeToJsBridgeMode: function(bridgeSecret, value) {
- prompt(value, 'gap_bridge_mode:' + bridgeSecret);
- },
- retrieveJsMessages: function(bridgeSecret, fromOnlineEvent) {
- return prompt(+fromOnlineEvent, 'gap_poll:' + bridgeSecret);
- }
-};
diff --git a/Zombie/ZombieDetector/platforms/android/assets/www/cordova-js-src/exec.js b/Zombie/ZombieDetector/platforms/android/assets/www/cordova-js-src/exec.js
deleted file mode 100644
index f73d87a..0000000
--- a/Zombie/ZombieDetector/platforms/android/assets/www/cordova-js-src/exec.js
+++ /dev/null
@@ -1,297 +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.
- *
-*/
-
-/**
- * Execute a cordova command. It is up to the native side whether this action
- * is synchronous or asynchronous. The native side can return:
- * Synchronous: PluginResult object as a JSON string
- * Asynchronous: Empty string ""
- * If async, the native side will cordova.callbackSuccess or cordova.callbackError,
- * depending upon the result of the action.
- *
- * @param {Function} success The success callback
- * @param {Function} fail The fail callback
- * @param {String} service The name of the service to use
- * @param {String} action Action to be run in cordova
- * @param {String[]} [args] Zero or more arguments to pass to the method
- */
-var cordova = require('cordova'),
- nativeApiProvider = require('cordova/android/nativeapiprovider'),
- utils = require('cordova/utils'),
- base64 = require('cordova/base64'),
- channel = require('cordova/channel'),
- jsToNativeModes = {
- PROMPT: 0,
- JS_OBJECT: 1
- },
- nativeToJsModes = {
- // Polls for messages using the JS->Native bridge.
- POLLING: 0,
- // For LOAD_URL to be viable, it would need to have a work-around for
- // the bug where the soft-keyboard gets dismissed when a message is sent.
- LOAD_URL: 1,
- // For the ONLINE_EVENT to be viable, it would need to intercept all event
- // listeners (both through addEventListener and window.ononline) as well
- // as set the navigator property itself.
- ONLINE_EVENT: 2,
- EVAL_BRIDGE: 3
- },
- jsToNativeBridgeMode, // Set lazily.
- nativeToJsBridgeMode = nativeToJsModes.EVAL_BRIDGE,
- pollEnabled = false,
- bridgeSecret = -1;
-
-var messagesFromNative = [];
-var isProcessing = false;
-var resolvedPromise = typeof Promise == 'undefined' ? null : Promise.resolve();
-var nextTick = resolvedPromise ? function(fn) { resolvedPromise.then(fn); } : function(fn) { setTimeout(fn); };
-
-function androidExec(success, fail, service, action, args) {
- if (bridgeSecret < 0) {
- // If we ever catch this firing, we'll need to queue up exec()s
- // and fire them once we get a secret. For now, I don't think
- // it's possible for exec() to be called since plugins are parsed but
- // not run until until after onNativeReady.
- throw new Error('exec() called without bridgeSecret');
- }
- // Set default bridge modes if they have not already been set.
- // By default, we use the failsafe, since addJavascriptInterface breaks too often
- if (jsToNativeBridgeMode === undefined) {
- androidExec.setJsToNativeBridgeMode(jsToNativeModes.JS_OBJECT);
- }
-
- // If args is not provided, default to an empty array
- args = args || [];
-
- // Process any ArrayBuffers in the args into a string.
- for (var i = 0; i < args.length; i++) {
- if (utils.typeName(args[i]) == 'ArrayBuffer') {
- args[i] = base64.fromArrayBuffer(args[i]);
- }
- }
-
- var callbackId = service + cordova.callbackId++,
- argsJson = JSON.stringify(args);
- if (success || fail) {
- cordova.callbacks[callbackId] = {success:success, fail:fail};
- }
-
- var msgs = nativeApiProvider.get().exec(bridgeSecret, service, action, callbackId, argsJson);
- // If argsJson was received by Java as null, try again with the PROMPT bridge mode.
- // This happens in rare circumstances, such as when certain Unicode characters are passed over the bridge on a Galaxy S2. See CB-2666.
- if (jsToNativeBridgeMode == jsToNativeModes.JS_OBJECT && msgs === "@Null arguments.") {
- androidExec.setJsToNativeBridgeMode(jsToNativeModes.PROMPT);
- androidExec(success, fail, service, action, args);
- androidExec.setJsToNativeBridgeMode(jsToNativeModes.JS_OBJECT);
- } else if (msgs) {
- messagesFromNative.push(msgs);
- // Always process async to avoid exceptions messing up stack.
- nextTick(processMessages);
- }
-}
-
-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();
-};
-
-function pollOnceFromOnlineEvent() {
- pollOnce(true);
-}
-
-function pollOnce(opt_fromOnlineEvent) {
- if (bridgeSecret < 0) {
- // This can happen when the NativeToJsMessageQueue resets the online state on page transitions.
- // We know there's nothing to retrieve, so no need to poll.
- return;
- }
- var msgs = nativeApiProvider.get().retrieveJsMessages(bridgeSecret, !!opt_fromOnlineEvent);
- if (msgs) {
- messagesFromNative.push(msgs);
- // Process sync since we know we're already top-of-stack.
- processMessages();
- }
-}
-
-function pollingTimerFunc() {
- if (pollEnabled) {
- pollOnce();
- setTimeout(pollingTimerFunc, 50);
- }
-}
-
-function hookOnlineApis() {
- function proxyEvent(e) {
- cordova.fireWindowEvent(e.type);
- }
- // The network module takes care of firing online and offline events.
- // It currently fires them only on document though, so we bridge them
- // to window here (while first listening for exec()-releated online/offline
- // events).
- window.addEventListener('online', pollOnceFromOnlineEvent, false);
- window.addEventListener('offline', pollOnceFromOnlineEvent, false);
- cordova.addWindowEventHandler('online');
- cordova.addWindowEventHandler('offline');
- document.addEventListener('online', proxyEvent, false);
- document.addEventListener('offline', proxyEvent, false);
-}
-
-hookOnlineApis();
-
-androidExec.jsToNativeModes = jsToNativeModes;
-androidExec.nativeToJsModes = nativeToJsModes;
-
-androidExec.setJsToNativeBridgeMode = function(mode) {
- if (mode == jsToNativeModes.JS_OBJECT && !window._cordovaNative) {
- mode = jsToNativeModes.PROMPT;
- }
- nativeApiProvider.setPreferPrompt(mode == jsToNativeModes.PROMPT);
- jsToNativeBridgeMode = mode;
-};
-
-androidExec.setNativeToJsBridgeMode = function(mode) {
- if (mode == nativeToJsBridgeMode) {
- return;
- }
- if (nativeToJsBridgeMode == nativeToJsModes.POLLING) {
- pollEnabled = false;
- }
-
- nativeToJsBridgeMode = mode;
- // Tell the native side to switch modes.
- // Otherwise, it will be set by androidExec.init()
- if (bridgeSecret >= 0) {
- nativeApiProvider.get().setNativeToJsBridgeMode(bridgeSecret, mode);
- }
-
- if (mode == nativeToJsModes.POLLING) {
- pollEnabled = true;
- setTimeout(pollingTimerFunc, 1);
- }
-};
-
-function buildPayload(payload, message) {
- var payloadKind = message.charAt(0);
- if (payloadKind == 's') {
- payload.push(message.slice(1));
- } else if (payloadKind == 't') {
- payload.push(true);
- } else if (payloadKind == 'f') {
- payload.push(false);
- } else if (payloadKind == 'N') {
- payload.push(null);
- } else if (payloadKind == 'n') {
- payload.push(+message.slice(1));
- } else if (payloadKind == 'A') {
- var data = message.slice(1);
- payload.push(base64.toArrayBuffer(data));
- } else if (payloadKind == 'S') {
- payload.push(window.atob(message.slice(1)));
- } else if (payloadKind == 'M') {
- var multipartMessages = message.slice(1);
- while (multipartMessages !== "") {
- var spaceIdx = multipartMessages.indexOf(' ');
- var msgLen = +multipartMessages.slice(0, spaceIdx);
- var multipartMessage = multipartMessages.substr(spaceIdx + 1, msgLen);
- multipartMessages = multipartMessages.slice(spaceIdx + msgLen + 1);
- buildPayload(payload, multipartMessage);
- }
- } else {
- payload.push(JSON.parse(message));
- }
-}
-
-// Processes a single message, as encoded by NativeToJsMessageQueue.java.
-function processMessage(message) {
- var firstChar = message.charAt(0);
- if (firstChar == 'J') {
- // This is deprecated on the .java side. It doesn't work with CSP enabled.
- eval(message.slice(1));
- } else if (firstChar == 'S' || firstChar == 'F') {
- var success = firstChar == 'S';
- var keepCallback = message.charAt(1) == '1';
- var spaceIdx = message.indexOf(' ', 2);
- var status = +message.slice(2, spaceIdx);
- var nextSpaceIdx = message.indexOf(' ', spaceIdx + 1);
- var callbackId = message.slice(spaceIdx + 1, nextSpaceIdx);
- var payloadMessage = message.slice(nextSpaceIdx + 1);
- var payload = [];
- buildPayload(payload, payloadMessage);
- cordova.callbackFromNative(callbackId, success, status, payload, keepCallback);
- } else {
- console.log("processMessage failed: invalid message: " + JSON.stringify(message));
- }
-}
-
-function processMessages() {
- // Check for the reentrant case.
- if (isProcessing) {
- return;
- }
- if (messagesFromNative.length === 0) {
- return;
- }
- isProcessing = true;
- try {
- var msg = popMessageFromQueue();
- // The Java side can send a * message to indicate that it
- // still has messages waiting to be retrieved.
- if (msg == '*' && messagesFromNative.length === 0) {
- nextTick(pollOnce);
- return;
- }
- processMessage(msg);
- } finally {
- isProcessing = false;
- if (messagesFromNative.length > 0) {
- nextTick(processMessages);
- }
- }
-}
-
-function popMessageFromQueue() {
- var messageBatch = messagesFromNative.shift();
- if (messageBatch == '*') {
- return '*';
- }
-
- var spaceIdx = messageBatch.indexOf(' ');
- var msgLen = +messageBatch.slice(0, spaceIdx);
- var message = messageBatch.substr(spaceIdx + 1, msgLen);
- messageBatch = messageBatch.slice(spaceIdx + msgLen + 1);
- if (messageBatch) {
- messagesFromNative.unshift(messageBatch);
- }
- return message;
-}
-
-module.exports = androidExec;
diff --git a/Zombie/ZombieDetector/platforms/android/assets/www/cordova-js-src/platform.js b/Zombie/ZombieDetector/platforms/android/assets/www/cordova-js-src/platform.js
deleted file mode 100644
index 2bfd024..0000000
--- a/Zombie/ZombieDetector/platforms/android/assets/www/cordova-js-src/platform.js
+++ /dev/null
@@ -1,125 +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.
- *
-*/
-
-// The last resume event that was received that had the result of a plugin call.
-var lastResumeEvent = null;
-
-module.exports = {
- id: 'android',
- bootstrap: function() {
- var channel = require('cordova/channel'),
- cordova = require('cordova'),
- exec = require('cordova/exec'),
- modulemapper = require('cordova/modulemapper');
-
- // Get the shared secret needed to use the bridge.
- exec.init();
-
- // TODO: Extract this as a proper plugin.
- modulemapper.clobbers('cordova/plugin/android/app', 'navigator.app');
-
- var APP_PLUGIN_NAME = Number(cordova.platformVersion.split('.')[0]) >= 4 ? 'CoreAndroid' : 'App';
-
- // Inject a listener for the backbutton on the document.
- var backButtonChannel = cordova.addDocumentEventHandler('backbutton');
- backButtonChannel.onHasSubscribersChange = function() {
- // If we just attached the first handler or detached the last handler,
- // let native know we need to override the back button.
- exec(null, null, APP_PLUGIN_NAME, "overrideBackbutton", [this.numHandlers == 1]);
- };
-
- // Add hardware MENU and SEARCH button handlers
- cordova.addDocumentEventHandler('menubutton');
- cordova.addDocumentEventHandler('searchbutton');
-
- function bindButtonChannel(buttonName) {
- // generic button bind used for volumeup/volumedown buttons
- var volumeButtonChannel = cordova.addDocumentEventHandler(buttonName + 'button');
- volumeButtonChannel.onHasSubscribersChange = function() {
- exec(null, null, APP_PLUGIN_NAME, "overrideButton", [buttonName, this.numHandlers == 1]);
- };
- }
- // Inject a listener for the volume buttons on the document.
- bindButtonChannel('volumeup');
- bindButtonChannel('volumedown');
-
- // The resume event is not "sticky", but it is possible that the event
- // will contain the result of a plugin call. We need to ensure that the
- // plugin result is delivered even after the event is fired (CB-10498)
- var cordovaAddEventListener = document.addEventListener;
-
- document.addEventListener = function(evt, handler, capture) {
- cordovaAddEventListener(evt, handler, capture);
-
- if (evt === 'resume' && lastResumeEvent) {
- handler(lastResumeEvent);
- }
- };
-
- // Let native code know we are all done on the JS side.
- // Native code will then un-hide the WebView.
- channel.onCordovaReady.subscribe(function() {
- exec(onMessageFromNative, null, APP_PLUGIN_NAME, 'messageChannel', []);
- exec(null, null, APP_PLUGIN_NAME, "show", []);
- });
- }
-};
-
-function onMessageFromNative(msg) {
- var cordova = require('cordova');
- var action = msg.action;
-
- switch (action)
- {
- // Button events
- case 'backbutton':
- case 'menubutton':
- case 'searchbutton':
- // App life cycle events
- case 'pause':
- // Volume events
- case 'volumedownbutton':
- case 'volumeupbutton':
- cordova.fireDocumentEvent(action);
- break;
- case 'resume':
- if(arguments.length > 1 && msg.pendingResult) {
- if(arguments.length === 2) {
- msg.pendingResult.result = arguments[1];
- } else {
- // The plugin returned a multipart message
- var res = [];
- for(var i = 1; i < arguments.length; i++) {
- res.push(arguments[i]);
- }
- msg.pendingResult.result = res;
- }
-
- // Save the plugin result so that it can be delivered to the js
- // even if they miss the initial firing of the event
- lastResumeEvent = msg;
- }
- cordova.fireDocumentEvent(action, msg);
- break;
- default:
- throw new Error('Unknown event action ' + action);
- }
-}
diff --git a/Zombie/ZombieDetector/platforms/android/assets/www/cordova-js-src/plugin/android/app.js b/Zombie/ZombieDetector/platforms/android/assets/www/cordova-js-src/plugin/android/app.js
deleted file mode 100644
index 22cf96e..0000000
--- a/Zombie/ZombieDetector/platforms/android/assets/www/cordova-js-src/plugin/android/app.js
+++ /dev/null
@@ -1,108 +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.
- *
-*/
-
-var exec = require('cordova/exec');
-var APP_PLUGIN_NAME = Number(require('cordova').platformVersion.split('.')[0]) >= 4 ? 'CoreAndroid' : 'App';
-
-module.exports = {
- /**
- * Clear the resource cache.
- */
- clearCache:function() {
- exec(null, null, APP_PLUGIN_NAME, "clearCache", []);
- },
-
- /**
- * Load the url into the webview or into new browser instance.
- *
- * @param url The URL to load
- * @param props Properties that can be passed in to the activity:
- * wait: int => wait msec before loading URL
- * loadingDialog: "Title,Message" => display a native loading dialog
- * loadUrlTimeoutValue: int => time in msec to wait before triggering a timeout error
- * clearHistory: boolean => clear webview history (default=false)
- * openExternal: boolean => open in a new browser (default=false)
- *
- * Example:
- * navigator.app.loadUrl("http://server/myapp/index.html", {wait:2000, loadingDialog:"Wait,Loading App", loadUrlTimeoutValue: 60000});
- */
- loadUrl:function(url, props) {
- exec(null, null, APP_PLUGIN_NAME, "loadUrl", [url, props]);
- },
-
- /**
- * Cancel loadUrl that is waiting to be loaded.
- */
- cancelLoadUrl:function() {
- exec(null, null, APP_PLUGIN_NAME, "cancelLoadUrl", []);
- },
-
- /**
- * Clear web history in this web view.
- * Instead of BACK button loading the previous web page, it will exit the app.
- */
- clearHistory:function() {
- exec(null, null, APP_PLUGIN_NAME, "clearHistory", []);
- },
-
- /**
- * Go to previous page displayed.
- * This is the same as pressing the backbutton on Android device.
- */
- backHistory:function() {
- exec(null, null, APP_PLUGIN_NAME, "backHistory", []);
- },
-
- /**
- * Override the default behavior of the Android back button.
- * If overridden, when the back button is pressed, the "backKeyDown" JavaScript event will be fired.
- *
- * Note: The user should not have to call this method. Instead, when the user
- * registers for the "backbutton" event, this is automatically done.
- *
- * @param override T=override, F=cancel override
- */
- overrideBackbutton:function(override) {
- exec(null, null, APP_PLUGIN_NAME, "overrideBackbutton", [override]);
- },
-
- /**
- * Override the default behavior of the Android volume button.
- * If overridden, when the volume button is pressed, the "volume[up|down]button"
- * JavaScript event will be fired.
- *
- * Note: The user should not have to call this method. Instead, when the user
- * registers for the "volume[up|down]button" event, this is automatically done.
- *
- * @param button volumeup, volumedown
- * @param override T=override, F=cancel override
- */
- overrideButton:function(button, override) {
- exec(null, null, APP_PLUGIN_NAME, "overrideButton", [button, override]);
- },
-
- /**
- * Exit and terminate the application.
- */
- exitApp:function() {
- return exec(null, null, APP_PLUGIN_NAME, "exitApp", []);
- }
-};
diff --git a/Zombie/ZombieDetector/platforms/android/assets/www/cordova.js b/Zombie/ZombieDetector/platforms/android/assets/www/cordova.js
deleted file mode 100644
index 18c020e..0000000
--- a/Zombie/ZombieDetector/platforms/android/assets/www/cordova.js
+++ /dev/null
@@ -1,2208 +0,0 @@
-// Platform: android
-// 7c5fcc5a5adfbf3fb8ceaf36fbdd4bd970bd9c20
-/*
- 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.
-*/
-;(function() {
-var PLATFORM_VERSION_BUILD_LABEL = '6.1.2';
-// file: src/scripts/require.js
-
-/*jshint -W079 */
-/*jshint -W020 */
-
-var require,
- define;
-
-(function () {
- var modules = {},
- // Stack of moduleIds currently being built.
- requireStack = [],
- // Map of module ID -> index into requireStack of modules currently being built.
- inProgressModules = {},
- SEPARATOR = ".";
-
-
-
- function build(module) {
- var factory = module.factory,
- localRequire = function (id) {
- var resultantId = id;
- //Its a relative path, so lop off the last portion and add the id (minus "./")
- if (id.charAt(0) === ".") {
- resultantId = module.id.slice(0, module.id.lastIndexOf(SEPARATOR)) + SEPARATOR + id.slice(2);
- }
- return require(resultantId);
- };
- module.exports = {};
- delete module.factory;
- factory(localRequire, module.exports, module);
- return module.exports;
- }
-
- require = function (id) {
- if (!modules[id]) {
- throw "module " + id + " not found";
- } else if (id in inProgressModules) {
- var cycle = requireStack.slice(inProgressModules[id]).join('->') + '->' + id;
- throw "Cycle in require graph: " + cycle;
- }
- if (modules[id].factory) {
- try {
- inProgressModules[id] = requireStack.length;
- requireStack.push(id);
- return build(modules[id]);
- } finally {
- delete inProgressModules[id];
- requireStack.pop();
- }
- }
- return modules[id].exports;
- };
-
- define = function (id, factory) {
- if (modules[id]) {
- throw "module " + id + " already defined";
- }
-
- modules[id] = {
- id: id,
- factory: factory
- };
- };
-
- define.remove = function (id) {
- delete modules[id];
- };
-
- define.moduleMap = modules;
-})();
-
-//Export for use in node
-if (typeof module === "object" && typeof require === "function") {
- module.exports.require = require;
- module.exports.define = define;
-}
-
-// file: src/cordova.js
-define("cordova", function(require, exports, module) {
-
-// Workaround for Windows 10 in hosted environment case
-// http://www.w3.org/html/wg/drafts/html/master/browsers.html#named-access-on-the-window-object
-if (window.cordova && !(window.cordova instanceof HTMLElement)) {
- throw new Error("cordova already defined");
-}
-
-
-var channel = require('cordova/channel');
-var platform = require('cordova/platform');
-
-
-/**
- * Intercept calls to addEventListener + removeEventListener and handle deviceready,
- * resume, and pause events.
- */
-var m_document_addEventListener = document.addEventListener;
-var m_document_removeEventListener = document.removeEventListener;
-var m_window_addEventListener = window.addEventListener;
-var m_window_removeEventListener = window.removeEventListener;
-
-/**
- * Houses custom event handlers to intercept on document + window event listeners.
- */
-var documentEventHandlers = {},
- windowEventHandlers = {};
-
-document.addEventListener = function(evt, handler, capture) {
- var e = evt.toLowerCase();
- if (typeof documentEventHandlers[e] != 'undefined') {
- documentEventHandlers[e].subscribe(handler);
- } else {
- m_document_addEventListener.call(document, evt, handler, capture);
- }
-};
-
-window.addEventListener = function(evt, handler, capture) {
- var e = evt.toLowerCase();
- if (typeof windowEventHandlers[e] != 'undefined') {
- windowEventHandlers[e].subscribe(handler);
- } else {
- m_window_addEventListener.call(window, evt, handler, capture);
- }
-};
-
-document.removeEventListener = function(evt, handler, capture) {
- var e = evt.toLowerCase();
- // If unsubscribing from an event that is handled by a plugin
- if (typeof documentEventHandlers[e] != "undefined") {
- documentEventHandlers[e].unsubscribe(handler);
- } else {
- m_document_removeEventListener.call(document, evt, handler, capture);
- }
-};
-
-window.removeEventListener = function(evt, handler, capture) {
- var e = evt.toLowerCase();
- // If unsubscribing from an event that is handled by a plugin
- if (typeof windowEventHandlers[e] != "undefined") {
- windowEventHandlers[e].unsubscribe(handler);
- } else {
- m_window_removeEventListener.call(window, evt, handler, capture);
- }
-};
-
-function createEvent(type, data) {
- var event = document.createEvent('Events');
- event.initEvent(type, false, false);
- if (data) {
- for (var i in data) {
- if (data.hasOwnProperty(i)) {
- event[i] = data[i];
- }
- }
- }
- return event;
-}
-
-
-var cordova = {
- define:define,
- require:require,
- version:PLATFORM_VERSION_BUILD_LABEL,
- platformVersion:PLATFORM_VERSION_BUILD_LABEL,
- platformId:platform.id,
- /**
- * Methods to add/remove your own addEventListener hijacking on document + window.
- */
- addWindowEventHandler:function(event) {
- return (windowEventHandlers[event] = channel.create(event));
- },
- addStickyDocumentEventHandler:function(event) {
- return (documentEventHandlers[event] = channel.createSticky(event));
- },
- addDocumentEventHandler:function(event) {
- return (documentEventHandlers[event] = channel.create(event));
- },
- removeWindowEventHandler:function(event) {
- delete windowEventHandlers[event];
- },
- removeDocumentEventHandler:function(event) {
- delete documentEventHandlers[event];
- },
- /**
- * Retrieve original event handlers that were replaced by Cordova
- *
- * @return object
- */
- getOriginalHandlers: function() {
- return {'document': {'addEventListener': m_document_addEventListener, 'removeEventListener': m_document_removeEventListener},
- 'window': {'addEventListener': m_window_addEventListener, 'removeEventListener': m_window_removeEventListener}};
- },
- /**
- * Method to fire event from native code
- * bNoDetach is required for events which cause an exception which needs to be caught in native code
- */
- fireDocumentEvent: function(type, data, bNoDetach) {
- var evt = createEvent(type, data);
- if (typeof documentEventHandlers[type] != 'undefined') {
- if( bNoDetach ) {
- documentEventHandlers[type].fire(evt);
- }
- else {
- setTimeout(function() {
- // Fire deviceready on listeners that were registered before cordova.js was loaded.
- if (type == 'deviceready') {
- document.dispatchEvent(evt);
- }
- documentEventHandlers[type].fire(evt);
- }, 0);
- }
- } else {
- document.dispatchEvent(evt);
- }
- },
- fireWindowEvent: function(type, data) {
- var evt = createEvent(type,data);
- if (typeof windowEventHandlers[type] != 'undefined') {
- setTimeout(function() {
- windowEventHandlers[type].fire(evt);
- }, 0);
- } else {
- window.dispatchEvent(evt);
- }
- },
-
- /**
- * Plugin callback mechanism.
- */
- // Randomize the starting callbackId to avoid collisions after refreshing or navigating.
- // This way, it's very unlikely that any new callback would get the same callbackId as an old callback.
- callbackId: Math.floor(Math.random() * 2000000000),
- callbacks: {},
- callbackStatus: {
- NO_RESULT: 0,
- OK: 1,
- CLASS_NOT_FOUND_EXCEPTION: 2,
- ILLEGAL_ACCESS_EXCEPTION: 3,
- INSTANTIATION_EXCEPTION: 4,
- MALFORMED_URL_EXCEPTION: 5,
- IO_EXCEPTION: 6,
- INVALID_ACTION: 7,
- JSON_EXCEPTION: 8,
- ERROR: 9
- },
-
- /**
- * Called by native code when returning successful result from an action.
- */
- callbackSuccess: function(callbackId, args) {
- cordova.callbackFromNative(callbackId, true, args.status, [args.message], args.keepCallback);
- },
-
- /**
- * Called by native code when returning error result from an action.
- */
- callbackError: function(callbackId, args) {
- // TODO: Deprecate callbackSuccess and callbackError in favour of callbackFromNative.
- // Derive success from status.
- cordova.callbackFromNative(callbackId, false, args.status, [args.message], args.keepCallback);
- },
-
- /**
- * Called by native code when returning the result from an action.
- */
- callbackFromNative: function(callbackId, isSuccess, status, args, keepCallback) {
- try {
- var callback = cordova.callbacks[callbackId];
- if (callback) {
- if (isSuccess && status == cordova.callbackStatus.OK) {
- callback.success && callback.success.apply(null, args);
- } else if (!isSuccess) {
- callback.fail && callback.fail.apply(null, args);
- }
- /*
- else
- Note, this case is intentionally not caught.
- this can happen if isSuccess is true, but callbackStatus is NO_RESULT
- which is used to remove a callback from the list without calling the callbacks
- typically keepCallback is false in this case
- */
- // Clear callback if not expecting any more results
- if (!keepCallback) {
- delete cordova.callbacks[callbackId];
- }
- }
- }
- catch (err) {
- var msg = "Error in " + (isSuccess ? "Success" : "Error") + " callbackId: " + callbackId + " : " + err;
- console && console.log && console.log(msg);
- cordova.fireWindowEvent("cordovacallbackerror", { 'message': msg });
- throw err;
- }
- },
- addConstructor: function(func) {
- channel.onCordovaReady.subscribe(function() {
- try {
- func();
- } catch(e) {
- console.log("Failed to run constructor: " + e);
- }
- });
- }
-};
-
-
-module.exports = cordova;
-
-});
-
-// file: /Users/steveng/repo/cordova/cordova-android/cordova-js-src/android/nativeapiprovider.js
-define("cordova/android/nativeapiprovider", function(require, exports, module) {
-
-/**
- * Exports the ExposedJsApi.java object if available, otherwise exports the PromptBasedNativeApi.
- */
-
-var nativeApi = this._cordovaNative || require('cordova/android/promptbasednativeapi');
-var currentApi = nativeApi;
-
-module.exports = {
- get: function() { return currentApi; },
- setPreferPrompt: function(value) {
- currentApi = value ? require('cordova/android/promptbasednativeapi') : nativeApi;
- },
- // Used only by tests.
- set: function(value) {
- currentApi = value;
- }
-};
-
-});
-
-// file: /Users/steveng/repo/cordova/cordova-android/cordova-js-src/android/promptbasednativeapi.js
-define("cordova/android/promptbasednativeapi", function(require, exports, module) {
-
-/**
- * Implements the API of ExposedJsApi.java, but uses prompt() to communicate.
- * This is used pre-JellyBean, where addJavascriptInterface() is disabled.
- */
-
-module.exports = {
- exec: function(bridgeSecret, service, action, callbackId, argsJson) {
- return prompt(argsJson, 'gap:'+JSON.stringify([bridgeSecret, service, action, callbackId]));
- },
- setNativeToJsBridgeMode: function(bridgeSecret, value) {
- prompt(value, 'gap_bridge_mode:' + bridgeSecret);
- },
- retrieveJsMessages: function(bridgeSecret, fromOnlineEvent) {
- return prompt(+fromOnlineEvent, 'gap_poll:' + bridgeSecret);
- }
-};
-
-});
-
-// file: src/common/argscheck.js
-define("cordova/argscheck", function(require, exports, module) {
-
-var utils = require('cordova/utils');
-
-var moduleExports = module.exports;
-
-var typeMap = {
- 'A': 'Array',
- 'D': 'Date',
- 'N': 'Number',
- 'S': 'String',
- 'F': 'Function',
- 'O': 'Object'
-};
-
-function extractParamName(callee, argIndex) {
- return (/.*?\((.*?)\)/).exec(callee)[1].split(', ')[argIndex];
-}
-
-function checkArgs(spec, functionName, args, opt_callee) {
- if (!moduleExports.enableChecks) {
- return;
- }
- var errMsg = null;
- var typeName;
- for (var i = 0; i < spec.length; ++i) {
- var c = spec.charAt(i),
- cUpper = c.toUpperCase(),
- arg = args[i];
- // Asterix means allow anything.
- if (c == '*') {
- continue;
- }
- typeName = utils.typeName(arg);
- if ((arg === null || arg === undefined) && c == cUpper) {
- continue;
- }
- if (typeName != typeMap[cUpper]) {
- errMsg = 'Expected ' + typeMap[cUpper];
- break;
- }
- }
- if (errMsg) {
- errMsg += ', but got ' + typeName + '.';
- errMsg = 'Wrong type for parameter "' + extractParamName(opt_callee || args.callee, i) + '" of ' + functionName + ': ' + errMsg;
- // Don't log when running unit tests.
- if (typeof jasmine == 'undefined') {
- console.error(errMsg);
- }
- throw TypeError(errMsg);
- }
-}
-
-function getValue(value, defaultValue) {
- return value === undefined ? defaultValue : value;
-}
-
-moduleExports.checkArgs = checkArgs;
-moduleExports.getValue = getValue;
-moduleExports.enableChecks = true;
-
-
-});
-
-// file: src/common/base64.js
-define("cordova/base64", function(require, exports, module) {
-
-var base64 = exports;
-
-base64.fromArrayBuffer = function(arrayBuffer) {
- var array = new Uint8Array(arrayBuffer);
- return uint8ToBase64(array);
-};
-
-base64.toArrayBuffer = function(str) {
- var decodedStr = typeof atob != 'undefined' ? atob(str) : new Buffer(str,'base64').toString('binary');
- var arrayBuffer = new ArrayBuffer(decodedStr.length);
- var array = new Uint8Array(arrayBuffer);
- for (var i=0, len=decodedStr.length; i < len; i++) {
- array[i] = decodedStr.charCodeAt(i);
- }
- return arrayBuffer;
-};
-
-//------------------------------------------------------------------------------
-
-/* This code is based on the performance tests at http://jsperf.com/b64tests
- * This 12-bit-at-a-time algorithm was the best performing version on all
- * platforms tested.
- */
-
-var b64_6bit = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-var b64_12bit;
-
-var b64_12bitTable = function() {
- b64_12bit = [];
- for (var i=0; i<64; i++) {
- for (var j=0; j<64; j++) {
- b64_12bit[i*64+j] = b64_6bit[i] + b64_6bit[j];
- }
- }
- b64_12bitTable = function() { return b64_12bit; };
- return b64_12bit;
-};
-
-function uint8ToBase64(rawData) {
- var numBytes = rawData.byteLength;
- var output="";
- var segment;
- var table = b64_12bitTable();
- for (var i=0;i> 12];
- output += table[segment & 0xfff];
- }
- if (numBytes - i == 2) {
- segment = (rawData[i] << 16) + (rawData[i+1] << 8);
- output += table[segment >> 12];
- output += b64_6bit[(segment & 0xfff) >> 6];
- output += '=';
- } else if (numBytes - i == 1) {
- segment = (rawData[i] << 16);
- output += table[segment >> 12];
- output += '==';
- }
- return output;
-}
-
-});
-
-// file: src/common/builder.js
-define("cordova/builder", function(require, exports, module) {
-
-var utils = require('cordova/utils');
-
-function each(objects, func, context) {
- for (var prop in objects) {
- if (objects.hasOwnProperty(prop)) {
- func.apply(context, [objects[prop], prop]);
- }
- }
-}
-
-function clobber(obj, key, value) {
- exports.replaceHookForTesting(obj, key);
- var needsProperty = false;
- try {
- obj[key] = value;
- } catch (e) {
- needsProperty = true;
- }
- // Getters can only be overridden by getters.
- if (needsProperty || obj[key] !== value) {
- utils.defineGetter(obj, key, function() {
- return value;
- });
- }
-}
-
-function assignOrWrapInDeprecateGetter(obj, key, value, message) {
- if (message) {
- utils.defineGetter(obj, key, function() {
- console.log(message);
- delete obj[key];
- clobber(obj, key, value);
- return value;
- });
- } else {
- clobber(obj, key, value);
- }
-}
-
-function include(parent, objects, clobber, merge) {
- each(objects, function (obj, key) {
- try {
- var result = obj.path ? require(obj.path) : {};
-
- if (clobber) {
- // Clobber if it doesn't exist.
- if (typeof parent[key] === 'undefined') {
- assignOrWrapInDeprecateGetter(parent, key, result, obj.deprecated);
- } else if (typeof obj.path !== 'undefined') {
- // If merging, merge properties onto parent, otherwise, clobber.
- if (merge) {
- recursiveMerge(parent[key], result);
- } else {
- assignOrWrapInDeprecateGetter(parent, key, result, obj.deprecated);
- }
- }
- result = parent[key];
- } else {
- // Overwrite if not currently defined.
- if (typeof parent[key] == 'undefined') {
- assignOrWrapInDeprecateGetter(parent, key, result, obj.deprecated);
- } else {
- // Set result to what already exists, so we can build children into it if they exist.
- result = parent[key];
- }
- }
-
- if (obj.children) {
- include(result, obj.children, clobber, merge);
- }
- } catch(e) {
- utils.alert('Exception building Cordova JS globals: ' + e + ' for key "' + key + '"');
- }
- });
-}
-
-/**
- * Merge properties from one object onto another recursively. Properties from
- * the src object will overwrite existing target property.
- *
- * @param target Object to merge properties into.
- * @param src Object to merge properties from.
- */
-function recursiveMerge(target, src) {
- for (var prop in src) {
- if (src.hasOwnProperty(prop)) {
- if (target.prototype && target.prototype.constructor === target) {
- // If the target object is a constructor override off prototype.
- clobber(target.prototype, prop, src[prop]);
- } else {
- if (typeof src[prop] === 'object' && typeof target[prop] === 'object') {
- recursiveMerge(target[prop], src[prop]);
- } else {
- clobber(target, prop, src[prop]);
- }
- }
- }
- }
-}
-
-exports.buildIntoButDoNotClobber = function(objects, target) {
- include(target, objects, false, false);
-};
-exports.buildIntoAndClobber = function(objects, target) {
- include(target, objects, true, false);
-};
-exports.buildIntoAndMerge = function(objects, target) {
- include(target, objects, true, true);
-};
-exports.recursiveMerge = recursiveMerge;
-exports.assignOrWrapInDeprecateGetter = assignOrWrapInDeprecateGetter;
-exports.replaceHookForTesting = function() {};
-
-});
-
-// file: src/common/channel.js
-define("cordova/channel", function(require, exports, module) {
-
-var utils = require('cordova/utils'),
- nextGuid = 1;
-
-/**
- * Custom pub-sub "channel" that can have functions subscribed to it
- * This object is used to define and control firing of events for
- * cordova initialization, as well as for custom events thereafter.
- *
- * The order of events during page load and Cordova startup is as follows:
- *
- * onDOMContentLoaded* Internal event that is received when the web page is loaded and parsed.
- * onNativeReady* Internal event that indicates the Cordova native side is ready.
- * onCordovaReady* Internal event fired when all Cordova JavaScript objects have been created.
- * onDeviceReady* User event fired to indicate that Cordova is ready
- * onResume User event fired to indicate a start/resume lifecycle event
- * onPause User event fired to indicate a pause lifecycle event
- *
- * The events marked with an * are sticky. Once they have fired, they will stay in the fired state.
- * All listeners that subscribe after the event is fired will be executed right away.
- *
- * The only Cordova events that user code should register for are:
- * deviceready Cordova native code is initialized and Cordova APIs can be called from JavaScript
- * pause App has moved to background
- * resume App has returned to foreground
- *
- * Listeners can be registered as:
- * document.addEventListener("deviceready", myDeviceReadyListener, false);
- * document.addEventListener("resume", myResumeListener, false);
- * document.addEventListener("pause", myPauseListener, false);
- *
- * The DOM lifecycle events should be used for saving and restoring state
- * window.onload
- * window.onunload
- *
- */
-
-/**
- * Channel
- * @constructor
- * @param type String the channel name
- */
-var Channel = function(type, sticky) {
- this.type = type;
- // Map of guid -> function.
- this.handlers = {};
- // 0 = Non-sticky, 1 = Sticky non-fired, 2 = Sticky fired.
- this.state = sticky ? 1 : 0;
- // Used in sticky mode to remember args passed to fire().
- this.fireArgs = null;
- // Used by onHasSubscribersChange to know if there are any listeners.
- this.numHandlers = 0;
- // Function that is called when the first listener is subscribed, or when
- // the last listener is unsubscribed.
- this.onHasSubscribersChange = null;
-},
- channel = {
- /**
- * Calls the provided function only after all of the channels specified
- * have been fired. All channels must be sticky channels.
- */
- join: function(h, c) {
- var len = c.length,
- i = len,
- f = function() {
- if (!(--i)) h();
- };
- for (var j=0; jNative bridge.
- POLLING: 0,
- // For LOAD_URL to be viable, it would need to have a work-around for
- // the bug where the soft-keyboard gets dismissed when a message is sent.
- LOAD_URL: 1,
- // For the ONLINE_EVENT to be viable, it would need to intercept all event
- // listeners (both through addEventListener and window.ononline) as well
- // as set the navigator property itself.
- ONLINE_EVENT: 2,
- EVAL_BRIDGE: 3
- },
- jsToNativeBridgeMode, // Set lazily.
- nativeToJsBridgeMode = nativeToJsModes.EVAL_BRIDGE,
- pollEnabled = false,
- bridgeSecret = -1;
-
-var messagesFromNative = [];
-var isProcessing = false;
-var resolvedPromise = typeof Promise == 'undefined' ? null : Promise.resolve();
-var nextTick = resolvedPromise ? function(fn) { resolvedPromise.then(fn); } : function(fn) { setTimeout(fn); };
-
-function androidExec(success, fail, service, action, args) {
- if (bridgeSecret < 0) {
- // If we ever catch this firing, we'll need to queue up exec()s
- // and fire them once we get a secret. For now, I don't think
- // it's possible for exec() to be called since plugins are parsed but
- // not run until until after onNativeReady.
- throw new Error('exec() called without bridgeSecret');
- }
- // Set default bridge modes if they have not already been set.
- // By default, we use the failsafe, since addJavascriptInterface breaks too often
- if (jsToNativeBridgeMode === undefined) {
- androidExec.setJsToNativeBridgeMode(jsToNativeModes.JS_OBJECT);
- }
-
- // If args is not provided, default to an empty array
- args = args || [];
-
- // Process any ArrayBuffers in the args into a string.
- for (var i = 0; i < args.length; i++) {
- if (utils.typeName(args[i]) == 'ArrayBuffer') {
- args[i] = base64.fromArrayBuffer(args[i]);
- }
- }
-
- var callbackId = service + cordova.callbackId++,
- argsJson = JSON.stringify(args);
- if (success || fail) {
- cordova.callbacks[callbackId] = {success:success, fail:fail};
- }
-
- var msgs = nativeApiProvider.get().exec(bridgeSecret, service, action, callbackId, argsJson);
- // If argsJson was received by Java as null, try again with the PROMPT bridge mode.
- // This happens in rare circumstances, such as when certain Unicode characters are passed over the bridge on a Galaxy S2. See CB-2666.
- if (jsToNativeBridgeMode == jsToNativeModes.JS_OBJECT && msgs === "@Null arguments.") {
- androidExec.setJsToNativeBridgeMode(jsToNativeModes.PROMPT);
- androidExec(success, fail, service, action, args);
- androidExec.setJsToNativeBridgeMode(jsToNativeModes.JS_OBJECT);
- } else if (msgs) {
- messagesFromNative.push(msgs);
- // Always process async to avoid exceptions messing up stack.
- nextTick(processMessages);
- }
-}
-
-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();
-};
-
-function pollOnceFromOnlineEvent() {
- pollOnce(true);
-}
-
-function pollOnce(opt_fromOnlineEvent) {
- if (bridgeSecret < 0) {
- // This can happen when the NativeToJsMessageQueue resets the online state on page transitions.
- // We know there's nothing to retrieve, so no need to poll.
- return;
- }
- var msgs = nativeApiProvider.get().retrieveJsMessages(bridgeSecret, !!opt_fromOnlineEvent);
- if (msgs) {
- messagesFromNative.push(msgs);
- // Process sync since we know we're already top-of-stack.
- processMessages();
- }
-}
-
-function pollingTimerFunc() {
- if (pollEnabled) {
- pollOnce();
- setTimeout(pollingTimerFunc, 50);
- }
-}
-
-function hookOnlineApis() {
- function proxyEvent(e) {
- cordova.fireWindowEvent(e.type);
- }
- // The network module takes care of firing online and offline events.
- // It currently fires them only on document though, so we bridge them
- // to window here (while first listening for exec()-releated online/offline
- // events).
- window.addEventListener('online', pollOnceFromOnlineEvent, false);
- window.addEventListener('offline', pollOnceFromOnlineEvent, false);
- cordova.addWindowEventHandler('online');
- cordova.addWindowEventHandler('offline');
- document.addEventListener('online', proxyEvent, false);
- document.addEventListener('offline', proxyEvent, false);
-}
-
-hookOnlineApis();
-
-androidExec.jsToNativeModes = jsToNativeModes;
-androidExec.nativeToJsModes = nativeToJsModes;
-
-androidExec.setJsToNativeBridgeMode = function(mode) {
- if (mode == jsToNativeModes.JS_OBJECT && !window._cordovaNative) {
- mode = jsToNativeModes.PROMPT;
- }
- nativeApiProvider.setPreferPrompt(mode == jsToNativeModes.PROMPT);
- jsToNativeBridgeMode = mode;
-};
-
-androidExec.setNativeToJsBridgeMode = function(mode) {
- if (mode == nativeToJsBridgeMode) {
- return;
- }
- if (nativeToJsBridgeMode == nativeToJsModes.POLLING) {
- pollEnabled = false;
- }
-
- nativeToJsBridgeMode = mode;
- // Tell the native side to switch modes.
- // Otherwise, it will be set by androidExec.init()
- if (bridgeSecret >= 0) {
- nativeApiProvider.get().setNativeToJsBridgeMode(bridgeSecret, mode);
- }
-
- if (mode == nativeToJsModes.POLLING) {
- pollEnabled = true;
- setTimeout(pollingTimerFunc, 1);
- }
-};
-
-function buildPayload(payload, message) {
- var payloadKind = message.charAt(0);
- if (payloadKind == 's') {
- payload.push(message.slice(1));
- } else if (payloadKind == 't') {
- payload.push(true);
- } else if (payloadKind == 'f') {
- payload.push(false);
- } else if (payloadKind == 'N') {
- payload.push(null);
- } else if (payloadKind == 'n') {
- payload.push(+message.slice(1));
- } else if (payloadKind == 'A') {
- var data = message.slice(1);
- payload.push(base64.toArrayBuffer(data));
- } else if (payloadKind == 'S') {
- payload.push(window.atob(message.slice(1)));
- } else if (payloadKind == 'M') {
- var multipartMessages = message.slice(1);
- while (multipartMessages !== "") {
- var spaceIdx = multipartMessages.indexOf(' ');
- var msgLen = +multipartMessages.slice(0, spaceIdx);
- var multipartMessage = multipartMessages.substr(spaceIdx + 1, msgLen);
- multipartMessages = multipartMessages.slice(spaceIdx + msgLen + 1);
- buildPayload(payload, multipartMessage);
- }
- } else {
- payload.push(JSON.parse(message));
- }
-}
-
-// Processes a single message, as encoded by NativeToJsMessageQueue.java.
-function processMessage(message) {
- var firstChar = message.charAt(0);
- if (firstChar == 'J') {
- // This is deprecated on the .java side. It doesn't work with CSP enabled.
- eval(message.slice(1));
- } else if (firstChar == 'S' || firstChar == 'F') {
- var success = firstChar == 'S';
- var keepCallback = message.charAt(1) == '1';
- var spaceIdx = message.indexOf(' ', 2);
- var status = +message.slice(2, spaceIdx);
- var nextSpaceIdx = message.indexOf(' ', spaceIdx + 1);
- var callbackId = message.slice(spaceIdx + 1, nextSpaceIdx);
- var payloadMessage = message.slice(nextSpaceIdx + 1);
- var payload = [];
- buildPayload(payload, payloadMessage);
- cordova.callbackFromNative(callbackId, success, status, payload, keepCallback);
- } else {
- console.log("processMessage failed: invalid message: " + JSON.stringify(message));
- }
-}
-
-function processMessages() {
- // Check for the reentrant case.
- if (isProcessing) {
- return;
- }
- if (messagesFromNative.length === 0) {
- return;
- }
- isProcessing = true;
- try {
- var msg = popMessageFromQueue();
- // The Java side can send a * message to indicate that it
- // still has messages waiting to be retrieved.
- if (msg == '*' && messagesFromNative.length === 0) {
- nextTick(pollOnce);
- return;
- }
- processMessage(msg);
- } finally {
- isProcessing = false;
- if (messagesFromNative.length > 0) {
- nextTick(processMessages);
- }
- }
-}
-
-function popMessageFromQueue() {
- var messageBatch = messagesFromNative.shift();
- if (messageBatch == '*') {
- return '*';
- }
-
- var spaceIdx = messageBatch.indexOf(' ');
- var msgLen = +messageBatch.slice(0, spaceIdx);
- var message = messageBatch.substr(spaceIdx + 1, msgLen);
- messageBatch = messageBatch.slice(spaceIdx + msgLen + 1);
- if (messageBatch) {
- messagesFromNative.unshift(messageBatch);
- }
- return message;
-}
-
-module.exports = androidExec;
-
-});
-
-// file: src/common/exec/proxy.js
-define("cordova/exec/proxy", function(require, exports, module) {
-
-
-// internal map of proxy function
-var CommandProxyMap = {};
-
-module.exports = {
-
- // example: cordova.commandProxy.add("Accelerometer",{getCurrentAcceleration: function(successCallback, errorCallback, options) {...},...);
- add:function(id,proxyObj) {
- console.log("adding proxy for " + id);
- CommandProxyMap[id] = proxyObj;
- return proxyObj;
- },
-
- // cordova.commandProxy.remove("Accelerometer");
- remove:function(id) {
- var proxy = CommandProxyMap[id];
- delete CommandProxyMap[id];
- CommandProxyMap[id] = null;
- return proxy;
- },
-
- get:function(service,action) {
- return ( CommandProxyMap[service] ? CommandProxyMap[service][action] : null );
- }
-};
-});
-
-// file: src/common/init.js
-define("cordova/init", function(require, exports, module) {
-
-var channel = require('cordova/channel');
-var cordova = require('cordova');
-var modulemapper = require('cordova/modulemapper');
-var platform = require('cordova/platform');
-var pluginloader = require('cordova/pluginloader');
-var utils = require('cordova/utils');
-
-var platformInitChannelsArray = [channel.onNativeReady, channel.onPluginsReady];
-
-function logUnfiredChannels(arr) {
- for (var i = 0; i < arr.length; ++i) {
- if (arr[i].state != 2) {
- console.log('Channel not fired: ' + arr[i].type);
- }
- }
-}
-
-window.setTimeout(function() {
- if (channel.onDeviceReady.state != 2) {
- console.log('deviceready has not fired after 5 seconds.');
- logUnfiredChannels(platformInitChannelsArray);
- logUnfiredChannels(channel.deviceReadyChannelsArray);
- }
-}, 5000);
-
-// Replace navigator before any modules are required(), to ensure it happens as soon as possible.
-// We replace it so that properties that can't be clobbered can instead be overridden.
-function replaceNavigator(origNavigator) {
- var CordovaNavigator = function() {};
- CordovaNavigator.prototype = origNavigator;
- var newNavigator = new CordovaNavigator();
- // This work-around really only applies to new APIs that are newer than Function.bind.
- // Without it, APIs such as getGamepads() break.
- if (CordovaNavigator.bind) {
- for (var key in origNavigator) {
- if (typeof origNavigator[key] == 'function') {
- newNavigator[key] = origNavigator[key].bind(origNavigator);
- }
- else {
- (function(k) {
- utils.defineGetterSetter(newNavigator,key,function() {
- return origNavigator[k];
- });
- })(key);
- }
- }
- }
- return newNavigator;
-}
-
-if (window.navigator) {
- window.navigator = replaceNavigator(window.navigator);
-}
-
-if (!window.console) {
- window.console = {
- log: function(){}
- };
-}
-if (!window.console.warn) {
- window.console.warn = function(msg) {
- this.log("warn: " + msg);
- };
-}
-
-// Register pause, resume and deviceready channels as events on document.
-channel.onPause = cordova.addDocumentEventHandler('pause');
-channel.onResume = cordova.addDocumentEventHandler('resume');
-channel.onActivated = cordova.addDocumentEventHandler('activated');
-channel.onDeviceReady = cordova.addStickyDocumentEventHandler('deviceready');
-
-// Listen for DOMContentLoaded and notify our channel subscribers.
-if (document.readyState == 'complete' || document.readyState == 'interactive') {
- channel.onDOMContentLoaded.fire();
-} else {
- document.addEventListener('DOMContentLoaded', function() {
- channel.onDOMContentLoaded.fire();
- }, false);
-}
-
-// _nativeReady is global variable that the native side can set
-// to signify that the native code is ready. It is a global since
-// it may be called before any cordova JS is ready.
-if (window._nativeReady) {
- channel.onNativeReady.fire();
-}
-
-modulemapper.clobbers('cordova', 'cordova');
-modulemapper.clobbers('cordova/exec', 'cordova.exec');
-modulemapper.clobbers('cordova/exec', 'Cordova.exec');
-
-// Call the platform-specific initialization.
-platform.bootstrap && platform.bootstrap();
-
-// Wrap in a setTimeout to support the use-case of having plugin JS appended to cordova.js.
-// The delay allows the attached modules to be defined before the plugin loader looks for them.
-setTimeout(function() {
- pluginloader.load(function() {
- channel.onPluginsReady.fire();
- });
-}, 0);
-
-/**
- * Create all cordova objects once native side is ready.
- */
-channel.join(function() {
- modulemapper.mapModules(window);
-
- platform.initialize && platform.initialize();
-
- // Fire event to notify that all objects are created
- channel.onCordovaReady.fire();
-
- // Fire onDeviceReady event once page has fully loaded, all
- // constructors have run and cordova info has been received from native
- // side.
- channel.join(function() {
- require('cordova').fireDocumentEvent('deviceready');
- }, channel.deviceReadyChannelsArray);
-
-}, platformInitChannelsArray);
-
-
-});
-
-// file: src/common/init_b.js
-define("cordova/init_b", function(require, exports, module) {
-
-var channel = require('cordova/channel');
-var cordova = require('cordova');
-var modulemapper = require('cordova/modulemapper');
-var platform = require('cordova/platform');
-var pluginloader = require('cordova/pluginloader');
-var utils = require('cordova/utils');
-
-var platformInitChannelsArray = [channel.onDOMContentLoaded, channel.onNativeReady, channel.onPluginsReady];
-
-// setting exec
-cordova.exec = require('cordova/exec');
-
-function logUnfiredChannels(arr) {
- for (var i = 0; i < arr.length; ++i) {
- if (arr[i].state != 2) {
- console.log('Channel not fired: ' + arr[i].type);
- }
- }
-}
-
-window.setTimeout(function() {
- if (channel.onDeviceReady.state != 2) {
- console.log('deviceready has not fired after 5 seconds.');
- logUnfiredChannels(platformInitChannelsArray);
- logUnfiredChannels(channel.deviceReadyChannelsArray);
- }
-}, 5000);
-
-// Replace navigator before any modules are required(), to ensure it happens as soon as possible.
-// We replace it so that properties that can't be clobbered can instead be overridden.
-function replaceNavigator(origNavigator) {
- var CordovaNavigator = function() {};
- CordovaNavigator.prototype = origNavigator;
- var newNavigator = new CordovaNavigator();
- // This work-around really only applies to new APIs that are newer than Function.bind.
- // Without it, APIs such as getGamepads() break.
- if (CordovaNavigator.bind) {
- for (var key in origNavigator) {
- if (typeof origNavigator[key] == 'function') {
- newNavigator[key] = origNavigator[key].bind(origNavigator);
- }
- else {
- (function(k) {
- utils.defineGetterSetter(newNavigator,key,function() {
- return origNavigator[k];
- });
- })(key);
- }
- }
- }
- return newNavigator;
-}
-if (window.navigator) {
- window.navigator = replaceNavigator(window.navigator);
-}
-
-if (!window.console) {
- window.console = {
- log: function(){}
- };
-}
-if (!window.console.warn) {
- window.console.warn = function(msg) {
- this.log("warn: " + msg);
- };
-}
-
-// Register pause, resume and deviceready channels as events on document.
-channel.onPause = cordova.addDocumentEventHandler('pause');
-channel.onResume = cordova.addDocumentEventHandler('resume');
-channel.onActivated = cordova.addDocumentEventHandler('activated');
-channel.onDeviceReady = cordova.addStickyDocumentEventHandler('deviceready');
-
-// Listen for DOMContentLoaded and notify our channel subscribers.
-if (document.readyState == 'complete' || document.readyState == 'interactive') {
- channel.onDOMContentLoaded.fire();
-} else {
- document.addEventListener('DOMContentLoaded', function() {
- channel.onDOMContentLoaded.fire();
- }, false);
-}
-
-// _nativeReady is global variable that the native side can set
-// to signify that the native code is ready. It is a global since
-// it may be called before any cordova JS is ready.
-if (window._nativeReady) {
- channel.onNativeReady.fire();
-}
-
-// Call the platform-specific initialization.
-platform.bootstrap && platform.bootstrap();
-
-// Wrap in a setTimeout to support the use-case of having plugin JS appended to cordova.js.
-// The delay allows the attached modules to be defined before the plugin loader looks for them.
-setTimeout(function() {
- pluginloader.load(function() {
- channel.onPluginsReady.fire();
- });
-}, 0);
-
-/**
- * Create all cordova objects once native side is ready.
- */
-channel.join(function() {
- modulemapper.mapModules(window);
-
- platform.initialize && platform.initialize();
-
- // Fire event to notify that all objects are created
- channel.onCordovaReady.fire();
-
- // Fire onDeviceReady event once page has fully loaded, all
- // constructors have run and cordova info has been received from native
- // side.
- channel.join(function() {
- require('cordova').fireDocumentEvent('deviceready');
- }, channel.deviceReadyChannelsArray);
-
-}, platformInitChannelsArray);
-
-});
-
-// file: src/common/modulemapper.js
-define("cordova/modulemapper", function(require, exports, module) {
-
-var builder = require('cordova/builder'),
- moduleMap = define.moduleMap,
- symbolList,
- deprecationMap;
-
-exports.reset = function() {
- symbolList = [];
- deprecationMap = {};
-};
-
-function addEntry(strategy, moduleName, symbolPath, opt_deprecationMessage) {
- if (!(moduleName in moduleMap)) {
- throw new Error('Module ' + moduleName + ' does not exist.');
- }
- symbolList.push(strategy, moduleName, symbolPath);
- if (opt_deprecationMessage) {
- deprecationMap[symbolPath] = opt_deprecationMessage;
- }
-}
-
-// Note: Android 2.3 does have Function.bind().
-exports.clobbers = function(moduleName, symbolPath, opt_deprecationMessage) {
- addEntry('c', moduleName, symbolPath, opt_deprecationMessage);
-};
-
-exports.merges = function(moduleName, symbolPath, opt_deprecationMessage) {
- addEntry('m', moduleName, symbolPath, opt_deprecationMessage);
-};
-
-exports.defaults = function(moduleName, symbolPath, opt_deprecationMessage) {
- addEntry('d', moduleName, symbolPath, opt_deprecationMessage);
-};
-
-exports.runs = function(moduleName) {
- addEntry('r', moduleName, null);
-};
-
-function prepareNamespace(symbolPath, context) {
- if (!symbolPath) {
- return context;
- }
- var parts = symbolPath.split('.');
- var cur = context;
- for (var i = 0, part; part = parts[i]; ++i) {
- cur = cur[part] = cur[part] || {};
- }
- return cur;
-}
-
-exports.mapModules = function(context) {
- var origSymbols = {};
- context.CDV_origSymbols = origSymbols;
- for (var i = 0, len = symbolList.length; i < len; i += 3) {
- var strategy = symbolList[i];
- var moduleName = symbolList[i + 1];
- var module = require(moduleName);
- //
- if (strategy == 'r') {
- continue;
- }
- var symbolPath = symbolList[i + 2];
- var lastDot = symbolPath.lastIndexOf('.');
- var namespace = symbolPath.substr(0, lastDot);
- var lastName = symbolPath.substr(lastDot + 1);
-
- var deprecationMsg = symbolPath in deprecationMap ? 'Access made to deprecated symbol: ' + symbolPath + '. ' + deprecationMsg : null;
- var parentObj = prepareNamespace(namespace, context);
- var target = parentObj[lastName];
-
- if (strategy == 'm' && target) {
- builder.recursiveMerge(target, module);
- } else if ((strategy == 'd' && !target) || (strategy != 'd')) {
- if (!(symbolPath in origSymbols)) {
- origSymbols[symbolPath] = target;
- }
- builder.assignOrWrapInDeprecateGetter(parentObj, lastName, module, deprecationMsg);
- }
- }
-};
-
-exports.getOriginalSymbol = function(context, symbolPath) {
- var origSymbols = context.CDV_origSymbols;
- if (origSymbols && (symbolPath in origSymbols)) {
- return origSymbols[symbolPath];
- }
- var parts = symbolPath.split('.');
- var obj = context;
- for (var i = 0; i < parts.length; ++i) {
- obj = obj && obj[parts[i]];
- }
- return obj;
-};
-
-exports.reset();
-
-
-});
-
-// file: src/common/modulemapper_b.js
-define("cordova/modulemapper_b", function(require, exports, module) {
-
-var builder = require('cordova/builder'),
- symbolList = [],
- deprecationMap;
-
-exports.reset = function() {
- symbolList = [];
- deprecationMap = {};
-};
-
-function addEntry(strategy, moduleName, symbolPath, opt_deprecationMessage) {
- symbolList.push(strategy, moduleName, symbolPath);
- if (opt_deprecationMessage) {
- deprecationMap[symbolPath] = opt_deprecationMessage;
- }
-}
-
-// Note: Android 2.3 does have Function.bind().
-exports.clobbers = function(moduleName, symbolPath, opt_deprecationMessage) {
- addEntry('c', moduleName, symbolPath, opt_deprecationMessage);
-};
-
-exports.merges = function(moduleName, symbolPath, opt_deprecationMessage) {
- addEntry('m', moduleName, symbolPath, opt_deprecationMessage);
-};
-
-exports.defaults = function(moduleName, symbolPath, opt_deprecationMessage) {
- addEntry('d', moduleName, symbolPath, opt_deprecationMessage);
-};
-
-exports.runs = function(moduleName) {
- addEntry('r', moduleName, null);
-};
-
-function prepareNamespace(symbolPath, context) {
- if (!symbolPath) {
- return context;
- }
- var parts = symbolPath.split('.');
- var cur = context;
- for (var i = 0, part; part = parts[i]; ++i) {
- cur = cur[part] = cur[part] || {};
- }
- return cur;
-}
-
-exports.mapModules = function(context) {
- var origSymbols = {};
- context.CDV_origSymbols = origSymbols;
- for (var i = 0, len = symbolList.length; i < len; i += 3) {
- var strategy = symbolList[i];
- var moduleName = symbolList[i + 1];
- var module = require(moduleName);
- //
- if (strategy == 'r') {
- continue;
- }
- var symbolPath = symbolList[i + 2];
- var lastDot = symbolPath.lastIndexOf('.');
- var namespace = symbolPath.substr(0, lastDot);
- var lastName = symbolPath.substr(lastDot + 1);
-
- var deprecationMsg = symbolPath in deprecationMap ? 'Access made to deprecated symbol: ' + symbolPath + '. ' + deprecationMsg : null;
- var parentObj = prepareNamespace(namespace, context);
- var target = parentObj[lastName];
-
- if (strategy == 'm' && target) {
- builder.recursiveMerge(target, module);
- } else if ((strategy == 'd' && !target) || (strategy != 'd')) {
- if (!(symbolPath in origSymbols)) {
- origSymbols[symbolPath] = target;
- }
- builder.assignOrWrapInDeprecateGetter(parentObj, lastName, module, deprecationMsg);
- }
- }
-};
-
-exports.getOriginalSymbol = function(context, symbolPath) {
- var origSymbols = context.CDV_origSymbols;
- if (origSymbols && (symbolPath in origSymbols)) {
- return origSymbols[symbolPath];
- }
- var parts = symbolPath.split('.');
- var obj = context;
- for (var i = 0; i < parts.length; ++i) {
- obj = obj && obj[parts[i]];
- }
- return obj;
-};
-
-exports.reset();
-
-
-});
-
-// file: /Users/steveng/repo/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.
-var lastResumeEvent = null;
-
-module.exports = {
- id: 'android',
- bootstrap: function() {
- var channel = require('cordova/channel'),
- cordova = require('cordova'),
- exec = require('cordova/exec'),
- modulemapper = require('cordova/modulemapper');
-
- // Get the shared secret needed to use the bridge.
- exec.init();
-
- // TODO: Extract this as a proper plugin.
- modulemapper.clobbers('cordova/plugin/android/app', 'navigator.app');
-
- var APP_PLUGIN_NAME = Number(cordova.platformVersion.split('.')[0]) >= 4 ? 'CoreAndroid' : 'App';
-
- // Inject a listener for the backbutton on the document.
- var backButtonChannel = cordova.addDocumentEventHandler('backbutton');
- backButtonChannel.onHasSubscribersChange = function() {
- // If we just attached the first handler or detached the last handler,
- // let native know we need to override the back button.
- exec(null, null, APP_PLUGIN_NAME, "overrideBackbutton", [this.numHandlers == 1]);
- };
-
- // Add hardware MENU and SEARCH button handlers
- cordova.addDocumentEventHandler('menubutton');
- cordova.addDocumentEventHandler('searchbutton');
-
- function bindButtonChannel(buttonName) {
- // generic button bind used for volumeup/volumedown buttons
- var volumeButtonChannel = cordova.addDocumentEventHandler(buttonName + 'button');
- volumeButtonChannel.onHasSubscribersChange = function() {
- exec(null, null, APP_PLUGIN_NAME, "overrideButton", [buttonName, this.numHandlers == 1]);
- };
- }
- // Inject a listener for the volume buttons on the document.
- bindButtonChannel('volumeup');
- bindButtonChannel('volumedown');
-
- // The resume event is not "sticky", but it is possible that the event
- // will contain the result of a plugin call. We need to ensure that the
- // plugin result is delivered even after the event is fired (CB-10498)
- var cordovaAddEventListener = document.addEventListener;
-
- document.addEventListener = function(evt, handler, capture) {
- cordovaAddEventListener(evt, handler, capture);
-
- if (evt === 'resume' && lastResumeEvent) {
- handler(lastResumeEvent);
- }
- };
-
- // Let native code know we are all done on the JS side.
- // Native code will then un-hide the WebView.
- channel.onCordovaReady.subscribe(function() {
- exec(onMessageFromNative, null, APP_PLUGIN_NAME, 'messageChannel', []);
- exec(null, null, APP_PLUGIN_NAME, "show", []);
- });
- }
-};
-
-function onMessageFromNative(msg) {
- var cordova = require('cordova');
- var action = msg.action;
-
- switch (action)
- {
- // Button events
- case 'backbutton':
- case 'menubutton':
- case 'searchbutton':
- // App life cycle events
- case 'pause':
- // Volume events
- case 'volumedownbutton':
- case 'volumeupbutton':
- cordova.fireDocumentEvent(action);
- break;
- case 'resume':
- if(arguments.length > 1 && msg.pendingResult) {
- if(arguments.length === 2) {
- msg.pendingResult.result = arguments[1];
- } else {
- // The plugin returned a multipart message
- var res = [];
- for(var i = 1; i < arguments.length; i++) {
- res.push(arguments[i]);
- }
- msg.pendingResult.result = res;
- }
-
- // Save the plugin result so that it can be delivered to the js
- // even if they miss the initial firing of the event
- lastResumeEvent = msg;
- }
- cordova.fireDocumentEvent(action, msg);
- break;
- default:
- throw new Error('Unknown event action ' + action);
- }
-}
-
-});
-
-// file: /Users/steveng/repo/cordova/cordova-android/cordova-js-src/plugin/android/app.js
-define("cordova/plugin/android/app", function(require, exports, module) {
-
-var exec = require('cordova/exec');
-var APP_PLUGIN_NAME = Number(require('cordova').platformVersion.split('.')[0]) >= 4 ? 'CoreAndroid' : 'App';
-
-module.exports = {
- /**
- * Clear the resource cache.
- */
- clearCache:function() {
- exec(null, null, APP_PLUGIN_NAME, "clearCache", []);
- },
-
- /**
- * Load the url into the webview or into new browser instance.
- *
- * @param url The URL to load
- * @param props Properties that can be passed in to the activity:
- * wait: int => wait msec before loading URL
- * loadingDialog: "Title,Message" => display a native loading dialog
- * loadUrlTimeoutValue: int => time in msec to wait before triggering a timeout error
- * clearHistory: boolean => clear webview history (default=false)
- * openExternal: boolean => open in a new browser (default=false)
- *
- * Example:
- * navigator.app.loadUrl("http://server/myapp/index.html", {wait:2000, loadingDialog:"Wait,Loading App", loadUrlTimeoutValue: 60000});
- */
- loadUrl:function(url, props) {
- exec(null, null, APP_PLUGIN_NAME, "loadUrl", [url, props]);
- },
-
- /**
- * Cancel loadUrl that is waiting to be loaded.
- */
- cancelLoadUrl:function() {
- exec(null, null, APP_PLUGIN_NAME, "cancelLoadUrl", []);
- },
-
- /**
- * Clear web history in this web view.
- * Instead of BACK button loading the previous web page, it will exit the app.
- */
- clearHistory:function() {
- exec(null, null, APP_PLUGIN_NAME, "clearHistory", []);
- },
-
- /**
- * Go to previous page displayed.
- * This is the same as pressing the backbutton on Android device.
- */
- backHistory:function() {
- exec(null, null, APP_PLUGIN_NAME, "backHistory", []);
- },
-
- /**
- * Override the default behavior of the Android back button.
- * If overridden, when the back button is pressed, the "backKeyDown" JavaScript event will be fired.
- *
- * Note: The user should not have to call this method. Instead, when the user
- * registers for the "backbutton" event, this is automatically done.
- *
- * @param override T=override, F=cancel override
- */
- overrideBackbutton:function(override) {
- exec(null, null, APP_PLUGIN_NAME, "overrideBackbutton", [override]);
- },
-
- /**
- * Override the default behavior of the Android volume button.
- * If overridden, when the volume button is pressed, the "volume[up|down]button"
- * JavaScript event will be fired.
- *
- * Note: The user should not have to call this method. Instead, when the user
- * registers for the "volume[up|down]button" event, this is automatically done.
- *
- * @param button volumeup, volumedown
- * @param override T=override, F=cancel override
- */
- overrideButton:function(button, override) {
- exec(null, null, APP_PLUGIN_NAME, "overrideButton", [button, override]);
- },
-
- /**
- * Exit and terminate the application.
- */
- exitApp:function() {
- return exec(null, null, APP_PLUGIN_NAME, "exitApp", []);
- }
-};
-
-});
-
-// file: src/common/pluginloader.js
-define("cordova/pluginloader", function(require, exports, module) {
-
-var modulemapper = require('cordova/modulemapper');
-var urlutil = require('cordova/urlutil');
-
-// Helper function to inject a
-
-If you are using node, you can install BigInteger with [npm](https://npmjs.org/).
-
- npm install big-integer
-
-Then you can include it in your code:
-
- var bigInt = require("big-integer");
-
-
-## Usage
-### `bigInt(number, [base])`
-
-You can create a bigInt by calling the `bigInt` function. You can pass in
-
- - a string, which it will parse as an bigInt and throw an `"Invalid integer"` error if the parsing fails.
- - a Javascript number, which it will parse as an bigInt and throw an `"Invalid integer"` error if the parsing fails.
- - another bigInt.
- - nothing, and it will return `bigInt.zero`.
-
- If you provide a second parameter, then it will parse `number` as a number in base `base`. Note that `base` can be any bigInt (even negative or zero). The letters "a-z" and "A-Z" will be interpreted as the numbers 10 to 35. Higher digits can be specified in angle brackets (`<` and `>`).
-
-Examples:
-
- var zero = bigInt();
- var ninetyThree = bigInt(93);
- var largeNumber = bigInt("75643564363473453456342378564387956906736546456235345");
- var googol = bigInt("1e100");
- var bigNumber = bigInt(largeNumber);
-
- var maximumByte = bigInt("FF", 16);
- var fiftyFiveGoogol = bigInt("<55>0", googol);
-
-Note that Javascript numbers larger than `9007199254740992` and smaller than `-9007199254740992` are not precisely represented numbers and will not produce exact results. If you are dealing with numbers outside that range, it is better to pass in strings.
-
-### Method Chaining
-
-Note that bigInt operations return bigInts, which allows you to chain methods, for example:
-
- var salary = bigInt(dollarsPerHour).times(hoursWorked).plus(randomBonuses)
-
-### Constants
-
-There are three named constants already stored that you do not have to construct with the `bigInt` function yourself:
-
- - `bigInt.one`, equivalent to `bigInt(1)`
- - `bigInt.zero`, equivalent to `bigInt(0)`
- - `bigInt.minusOne`, equivalent to `bigInt(-1)`
-
-The numbers from -999 to 999 are also already prestored and can be accessed using `bigInt[index]`, for example:
-
- - `bigInt[-999]`, equivalent to `bigInt(-999)`
- - `bigInt[256]`, equivalent to `bigInt(256)`
-
-### Methods
-
-#### `abs()`
-
-Returns the absolute value of a bigInt.
-
- - `bigInt(-45).abs()` => `45`
- - `bigInt(45).abs()` => `45`
-
-#### `add(number)`
-
-Performs addition.
-
- - `bigInt(5).add(7)` => `12`
-
-[View benchmarks for this method](http://peterolson.github.io/BigInteger.js/benchmark/#Addition)
-
-#### `and(number)`
-
-Performs the bitwise AND operation. The operands are treated as if they were represented using [two's complement representation](http://en.wikipedia.org/wiki/Two%27s_complement).
-
- - `bigInt(6).and(3)` => `2`
- - `bigInt(6).and(-3)` => `4`
-
-#### `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`.
-
- - `bigInt(5).compare(5)` => `0`
- - `bigInt(5).compare(4)` => `1`
- - `bigInt(4).compare(5)` => `-1`
-
-#### `compareAbs(number)`
-
-Performs a comparison between the absolute value of two numbers.
-
- - `bigInt(5).compareAbs(-5)` => `0`
- - `bigInt(5).compareAbs(4)` => `1`
- - `bigInt(4).compareAbs(-5)` => `-1`
-
-#### `compareTo(number)`
-
-Alias for the `compare` method.
-
-#### `divide(number)`
-
-Performs integer division, disregarding the remainder.
-
- - `bigInt(59).divide(5)` => `11`
-
-[View benchmarks for this method](http://peterolson.github.io/BigInteger.js/benchmark/#Division)
-
-#### `divmod(number)`
-
-Performs division and returns an object with two properties: `quotient` and `remainder`. The sign of the remainder will match the sign of the dividend.
-
- - `bigInt(59).divmod(5)` => `{quotient: bigInt(11), remainder: bigInt(4) }`
- - `bigInt(-5).divmod(2)` => `{quotient: bigInt(-2), remainder: bigInt(-1) }`
-
-[View benchmarks for this method](http://peterolson.github.io/BigInteger.js/benchmark/#Division)
-
-#### `eq(number)`
-
-Alias for the `equals` method.
-
-#### `equals(number)`
-
-Checks if two numbers are equal.
-
- - `bigInt(5).equals(5)` => `true`
- - `bigInt(4).equals(7)` => `false`
-
-#### `geq(number)`
-
-Alias for the `greaterOrEquals` method.
-
-
-#### `greater(number)`
-
-Checks if the first number is greater than the second.
-
- - `bigInt(5).greater(6)` => `false`
- - `bigInt(5).greater(5)` => `false`
- - `bigInt(5).greater(4)` => `true`
-
-#### `greaterOrEquals(number)`
-
-Checks if the first number is greater than or equal to the second.
-
- - `bigInt(5).greaterOrEquals(6)` => `false`
- - `bigInt(5).greaterOrEquals(5)` => `true`
- - `bigInt(5).greaterOrEquals(4)` => `true`
-
-#### `gt(number)`
-
-Alias for the `greater` method.
-
-#### `isDivisibleBy(number)`
-
-Returns `true` if the first number is divisible by the second number, `false` otherwise.
-
- - `bigInt(999).isDivisibleBy(333)` => `true`
- - `bigInt(99).isDivisibleBy(5)` => `false`
-
-#### `isEven()`
-
-Returns `true` if the number is even, `false` otherwise.
-
- - `bigInt(6).isEven()` => `true`
- - `bigInt(3).isEven()` => `false`
-
-#### `isNegative()`
-
-Returns `true` if the number is negative, `false` otherwise.
-Returns `false` for `0` and `-0`.
-
- - `bigInt(-23).isNegative()` => `true`
- - `bigInt(50).isNegative()` => `false`
-
-#### `isOdd()`
-
-Returns `true` if the number is odd, `false` otherwise.
-
- - `bigInt(13).isOdd()` => `true`
- - `bigInt(40).isOdd()` => `false`
-
-#### `isPositive()`
-
-Return `true` if the number is positive, `false` otherwise.
-Returns `false` for `0` and `-0`.
-
- - `bigInt(54).isPositive()` => `true`
- - `bigInt(-1).isPositive()` => `false`
-
-#### `isPrime()`
-
-Returns `true` if the number is prime, `false` otherwise.
-
- - `bigInt(5).isPrime()` => `true`
- - `bigInt(6).isPrime()` => `false`
-
-#### `isProbablePrime([iterations])`
-
-Returns `true` if the number is very likely to be positive, `false` otherwise.
-Argument is optional and determines the amount of iterations of the test (default: `5`). The more iterations, the lower chance of getting a false positive.
-This uses the [Fermat primality test](https://en.wikipedia.org/wiki/Fermat_primality_test).
-
- - `bigInt(5).isProbablePrime()` => `true`
- - `bigInt(49).isProbablePrime()` => `false`
- - `bigInt(1729).isProbablePrime(50)` => `false`
-
-Note that this function is not deterministic, since it relies on random sampling of factors, so the result for some numbers is not always the same. [Carmichael numbers](https://en.wikipedia.org/wiki/Carmichael_number) are particularly prone to give unreliable results.
-
-For example, `bigInt(1729).isProbablePrime()` returns `false` about 76% of the time and `true` about 24% of the time. The correct result is `false`.
-
-#### `isUnit()`
-
-Returns `true` if the number is `1` or `-1`, `false` otherwise.
-
- - `bigInt.one.isUnit()` => `true`
- - `bigInt.minusOne.isUnit()` => `true`
- - `bigInt(5).isUnit()` => `false`
-
-#### `isZero()`
-
-Return `true` if the number is `0` or `-0`, `false` otherwise.
-
- - `bigInt.zero.isZero()` => `true`
- - `bigInt("-0").isZero()` => `true`
- - `bigInt(50).isZero()` => `false`
-
-#### `leq(number)`
-
-Alias for the `lesserOrEquals` method.
-
-#### `lesser(number)`
-
-Checks if the first number is lesser than the second.
-
- - `bigInt(5).lesser(6)` => `true`
- - `bigInt(5).lesser(5)` => `false`
- - `bigInt(5).lesser(4)` => `false`
-
-#### `lesserOrEquals(number)`
-
-Checks if the first number is less than or equal to the second.
-
- - `bigInt(5).lesserOrEquals(6)` => `true`
- - `bigInt(5).lesserOrEquals(5)` => `true`
- - `bigInt(5).lesserOrEquals(4)` => `false`
-
-#### `lt(number)`
-
-Alias for the `lesser` method.
-
-#### `minus(number)`
-
-Alias for the `subtract` method.
-
- - `bigInt(3).minus(5)` => `-2`
-
-[View benchmarks for this method](http://peterolson.github.io/BigInteger.js/benchmark/#Subtraction)
-
-#### `mod(number)`
-
-Performs division and returns the remainder, disregarding the quotient. The sign of the remainder will match the sign of the dividend.
-
- - `bigInt(59).mod(5)` => `4`
- - `bigInt(-5).mod(2)` => `-1`
-
-[View benchmarks for this method](http://peterolson.github.io/BigInteger.js/benchmark/#Division)
-
-#### `modInv(mod)`
-
-Finds the [multiplicative inverse](https://en.wikipedia.org/wiki/Modular_multiplicative_inverse) of the number modulo `mod`.
-
- - `bigInt(3).modInv(11)` => `4`
- - `bigInt(42).modInv(2017)` => `1969`
-
-#### `modPow(exp, mod)`
-
-Takes the number to the power `exp` modulo `mod`.
-
- - `bigInt(10).modPow(3, 30)` => `10`
-
-#### `multiply(number)`
-
-Performs multiplication.
-
- - `bigInt(111).multiply(111)` => `12321`
-
-[View benchmarks for this method](http://peterolson.github.io/BigInteger.js/benchmark/#Multiplication)
-
-#### `neq(number)`
-
-Alias for the `notEquals` method.
-
-#### `next()`
-
-Adds one to the number.
-
- - `bigInt(6).next()` => `7`
-
-#### `not()`
-
-Performs the bitwise NOT operation. The operands are treated as if they were represented using [two's complement representation](http://en.wikipedia.org/wiki/Two%27s_complement).
-
- - `bigInt(10).not()` => `-11`
- - `bigInt(0).not()` => `-1`
-
-#### `notEquals(number)`
-
-Checks if two numbers are not equal.
-
- - `bigInt(5).notEquals(5)` => `false`
- - `bigInt(4).notEquals(7)` => `true`
-
-#### `or(number)`
-
-Performs the bitwise OR operation. The operands are treated as if they were represented using [two's complement representation](http://en.wikipedia.org/wiki/Two%27s_complement).
-
- - `bigInt(13).or(10)` => `15`
- - `bigInt(13).or(-8)` => `-3`
-
-#### `over(number)`
-
-Alias for the `divide` method.
-
- - `bigInt(59).over(5)` => `11`
-
-[View benchmarks for this method](http://peterolson.github.io/BigInteger.js/benchmark/#Division)
-
-#### `plus(number)`
-
-Alias for the `add` method.
-
- - `bigInt(5).plus(7)` => `12`
-
-[View benchmarks for this method](http://peterolson.github.io/BigInteger.js/benchmark/#Addition)
-
-#### `pow(number)`
-
-Performs exponentiation. If the exponent is less than `0`, `pow` returns `0`. `bigInt.zero.pow(0)` returns `1`.
-
- - `bigInt(16).pow(16)` => `18446744073709551616`
-
-[View benchmarks for this method](http://peterolson.github.io/BigInteger.js/benchmark/#Exponentiation)
-
-#### `prev(number)`
-
-Subtracts one from the number.
-
- - `bigInt(6).prev()` => `5`
-
-#### `remainder(number)`
-
-Alias for the `mod` method.
-
-[View benchmarks for this method](http://peterolson.github.io/BigInteger.js/benchmark/#Division)
-
-#### `shiftLeft(n)`
-
-Shifts the number left by `n` places in its binary representation. If a negative number is provided, it will shift right. Throws an error if `n` is outside of the range `[-9007199254740992, 9007199254740992]`.
-
- - `bigInt(8).shiftLeft(2)` => `32`
- - `bigInt(8).shiftLeft(-2)` => `2`
-
-#### `shiftRight(n)`
-
-Shifts the number right by `n` places in its binary representation. If a negative number is provided, it will shift left. Throws an error if `n` is outside of the range `[-9007199254740992, 9007199254740992]`.
-
- - `bigInt(8).shiftRight(2)` => `2`
- - `bigInt(8).shiftRight(-2)` => `32`
-
-#### `square()`
-
-Squares the number
-
- - `bigInt(3).square()` => `9`
-
-[View benchmarks for this method](http://peterolson.github.io/BigInteger.js/benchmark/#Squaring)
-
-#### `subtract(number)`
-
-Performs subtraction.
-
- - `bigInt(3).subtract(5)` => `-2`
-
-[View benchmarks for this method](http://peterolson.github.io/BigInteger.js/benchmark/#Subtraction)
-
-#### `times(number)`
-
-Alias for the `multiply` method.
-
- - `bigInt(111).times(111)` => `12321`
-
-[View benchmarks for this method](http://peterolson.github.io/BigInteger.js/benchmark/#Multiplication)
-
-#### `toJSNumber()`
-
-Converts a bigInt into a native Javascript number. Loses precision for numbers outside the range `[-9007199254740992, 9007199254740992]`.
-
- - `bigInt("18446744073709551616").toJSNumber()` => `18446744073709552000`
-
-#### `xor(number)`
-
-Performs the bitwise XOR operation. The operands are treated as if they were represented using [two's complement representation](http://en.wikipedia.org/wiki/Two%27s_complement).
-
- - `bigInt(12).xor(5)` => `9`
- - `bigInt(12).xor(-5)` => `-9`
-
-### Static Methods
-
-#### `gcd(a, b)`
-
-Finds the greatest common denominator of `a` and `b`.
-
- - `bigInt.gcd(42,56)` => `14`
-
-#### `isInstance(x)`
-
-Returns `true` if `x` is a BigInteger, `false` otherwise.
-
- - `bigInt.isInstance(bigInt(14))` => `true`
- - `bigInt.isInstance(14)` => `false`
-
-#### `lcm(a,b)`
-
-Finds the least common multiple of `a` and `b`.
-
- - `bigInt.lcm(21, 6)` => `42`
-
-#### `max(a,b)`
-
-Returns the largest of `a` and `b`.
-
- - `bigInt.max(77, 432)` => `432`
-
-#### `min(a,b)`
-
-Returns the smallest of `a` and `b`.
-
- - `bigInt.min(77, 432)` => `77`
-
-#### `randBetween(min, max)`
-
-Returns a random number between `min` and `max`.
-
- - `bigInt.randBetween("-1e100", "1e100")` => (for example) `8494907165436643479673097939554427056789510374838494147955756275846226209006506706784609314471378745`
-
-
-### Override Methods
-
-#### `toString(radix = 10)`
-
-Converts a bigInt to a string. There is an optional radix parameter (which defaults to 10) that converts the number to the given radix. Digits in the range `10-35` will use the letters `a-z`.
-
- - `bigInt("1e9").toString()` => `"1000000000"`
- - `bigInt("1e9").toString(16)` => `"3b9aca00"`
-
-**Note that arithmetical operators will trigger the `valueOf` function rather than the `toString` function.** When converting a bigInteger to a string, you should use the `toString` method or the `String` function instead of adding the empty string.
-
- - `bigInt("999999999999999999").toString()` => `"999999999999999999"`
- - `String(bigInt("999999999999999999"))` => `"999999999999999999"`
- - `bigInt("999999999999999999") + ""` => `1000000000000000000`
-
-Bases larger than 36 are supported. If a digit is greater than or equal to 36, it will be enclosed in angle brackets.
-
- - `bigInt(567890).toString(100)` => `"<56><78><90>"`
-
-Negative bases are also supported.
-
- - `bigInt(12345).toString(-10)` => `"28465"`
-
-Base 1 and base -1 are also supported.
-
- - `bigInt(-15).toString(1)` => `"-111111111111111"`
- - `bigInt(-15).toString(-1)` => `"101010101010101010101010101010"`
-
-Base 0 is only allowed for the number zero.
-
- - `bigInt(0).toString(0)` => `0`
- - `bigInt(1).toString(0)` => `Error: Cannot convert nonzero numbers to base 0.`
-
-[View benchmarks for this method](http://peterolson.github.io/BigInteger.js/benchmark/#toString)
-
-#### `valueOf()`
-
-Converts a bigInt to a native Javascript number. This override allows you to use native arithmetic operators without explicit conversion:
-
- - `bigInt("100") + bigInt("200") === 300; //true`
-
-## Contributors
-
-To contribute, just fork the project, make some changes, and submit a pull request. Please verify that the unit tests pass before submitting.
-
-The unit tests are contained in the `spec/spec.js` file. You can run them locally by opening the `spec/SpecRunner.html` or file or running `npm test`. You can also [run the tests online from GitHub](http://peterolson.github.io/BigInteger.js/spec/SpecRunner.html).
-
-There are performance benchmarks that can be viewed from the `benchmarks/index.html` page. You can [run them online from GitHub](http://peterolson.github.io/BigInteger.js/benchmark/).
-
-## License
-
-This project is public domain. For more details, read about the [Unlicense](http://unlicense.org/).
\ No newline at end of file
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/big-integer/bower.json b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/big-integer/bower.json
deleted file mode 100644
index c7c7291..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/big-integer/bower.json
+++ /dev/null
@@ -1,30 +0,0 @@
-{
- "name": "big-integer",
- "description": "An arbitrary length integer library for Javascript",
- "main": "./BigInteger.js",
- "authors": [
- "Peter Olson"
- ],
- "license": "Unlicense",
- "keywords": [
- "math",
- "big",
- "bignum",
- "bigint",
- "biginteger",
- "integer",
- "arbitrary",
- "precision",
- "arithmetic"
- ],
- "homepage": "https://github.com/peterolson/BigInteger.js",
- "ignore": [
- "**/.*",
- "node_modules",
- "bower_components",
- "test",
- "coverage",
- "spec",
- "tests"
- ]
-}
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/big-integer/package.json b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/big-integer/package.json
deleted file mode 100644
index b604dbe..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/big-integer/package.json
+++ /dev/null
@@ -1,109 +0,0 @@
-{
- "_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.16",
- "_inCache": true,
- "_installable": true,
- "_location": "/big-integer",
- "_nodeVersion": "4.4.5",
- "_npmOperationalInternal": {
- "host": "packages-16-east.internal.npmjs.com",
- "tmp": "tmp/big-integer-1.6.16.tgz_1473665148825_0.5824211346916854"
- },
- "_npmUser": {
- "name": "peterolson",
- "email": "peter.e.c.olson+npm@gmail.com"
- },
- "_npmVersion": "2.15.5",
- "_phantomChildren": {},
- "_requested": {
- "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"
- },
- "_requiredBy": [
- "/bplist-parser"
- ],
- "_resolved": "http://registry.npmjs.org/big-integer/-/big-integer-1.6.16.tgz",
- "_shasum": "0ca30b58013db46b10084a09242ca1d8954724cc",
- "_shrinkwrap": null,
- "_spec": "big-integer@^1.6.7",
- "_where": "/Users/steveng/repo/cordova/cordova-android/node_modules/bplist-parser",
- "author": {
- "name": "Peter Olson",
- "email": "peter.e.c.olson+npm@gmail.com"
- },
- "bin": {},
- "bugs": {
- "url": "https://github.com/peterolson/BigInteger.js/issues"
- },
- "contributors": [],
- "dependencies": {},
- "description": "An arbitrary length integer library for Javascript",
- "devDependencies": {
- "coveralls": "^2.11.4",
- "jasmine": "2.1.x",
- "jasmine-core": "^2.3.4",
- "karma": "^0.13.3",
- "karma-coverage": "^0.4.2",
- "karma-jasmine": "^0.3.6",
- "karma-phantomjs-launcher": "~0.1"
- },
- "directories": {},
- "dist": {
- "shasum": "0ca30b58013db46b10084a09242ca1d8954724cc",
- "tarball": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.16.tgz"
- },
- "engines": {
- "node": ">=0.6"
- },
- "gitHead": "09b50ab4e701a2ec4d403fa3ecf12ae327227190",
- "homepage": "https://github.com/peterolson/BigInteger.js#readme",
- "keywords": [
- "math",
- "big",
- "bignum",
- "bigint",
- "biginteger",
- "integer",
- "arbitrary",
- "precision",
- "arithmetic"
- ],
- "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": {
- "test": "karma start my.conf.js"
- },
- "version": "1.6.16"
-}
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/bplist-parser/.npmignore b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/bplist-parser/.npmignore
deleted file mode 100644
index a9b46ea..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/bplist-parser/.npmignore
+++ /dev/null
@@ -1,8 +0,0 @@
-/build/*
-node_modules
-*.node
-*.sh
-*.swp
-.lock*
-npm-debug.log
-.idea
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/bplist-parser/README.md b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/bplist-parser/README.md
deleted file mode 100644
index 37e5e1c..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/bplist-parser/README.md
+++ /dev/null
@@ -1,47 +0,0 @@
-bplist-parser
-=============
-
-Binary Mac OS X Plist (property list) parser.
-
-## Installation
-
-```bash
-$ npm install bplist-parser
-```
-
-## Quick Examples
-
-```javascript
-var bplist = require('bplist-parser');
-
-bplist.parseFile('myPlist.bplist', function(err, obj) {
- if (err) throw err;
-
- console.log(JSON.stringify(obj));
-});
-```
-
-## License
-
-(The MIT License)
-
-Copyright (c) 2012 Near Infinity Corporation
-
-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.
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/bplist-parser/bplistParser.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/bplist-parser/bplistParser.js
deleted file mode 100644
index f8335bc..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/bplist-parser/bplistParser.js
+++ /dev/null
@@ -1,357 +0,0 @@
-'use strict';
-
-// adapted from http://code.google.com/p/plist/source/browse/trunk/src/com/dd/plist/BinaryPropertyListParser.java
-
-var fs = require('fs');
-var bigInt = require("big-integer");
-var debug = false;
-
-exports.maxObjectSize = 100 * 1000 * 1000; // 100Meg
-exports.maxObjectCount = 32768;
-
-// EPOCH = new SimpleDateFormat("yyyy MM dd zzz").parse("2001 01 01 GMT").getTime();
-// ...but that's annoying in a static initializer because it can throw exceptions, ick.
-// So we just hardcode the correct value.
-var EPOCH = 978307200000;
-
-// UID object definition
-var UID = exports.UID = function(id) {
- this.UID = id;
-}
-
-var parseFile = exports.parseFile = function (fileNameOrBuffer, callback) {
- function tryParseBuffer(buffer) {
- var err = null;
- var result;
- try {
- result = parseBuffer(buffer);
- } catch (ex) {
- err = ex;
- }
- callback(err, result);
- }
-
- if (Buffer.isBuffer(fileNameOrBuffer)) {
- return tryParseBuffer(fileNameOrBuffer);
- } else {
- fs.readFile(fileNameOrBuffer, function (err, data) {
- if (err) { return callback(err); }
- tryParseBuffer(data);
- });
- }
-};
-
-var parseBuffer = exports.parseBuffer = function (buffer) {
- var result = {};
-
- // check header
- var header = buffer.slice(0, 'bplist'.length).toString('utf8');
- if (header !== 'bplist') {
- throw new Error("Invalid binary plist. Expected 'bplist' at offset 0.");
- }
-
- // Handle trailer, last 32 bytes of the file
- var trailer = buffer.slice(buffer.length - 32, buffer.length);
- // 6 null bytes (index 0 to 5)
- var offsetSize = trailer.readUInt8(6);
- if (debug) {
- console.log("offsetSize: " + offsetSize);
- }
- var objectRefSize = trailer.readUInt8(7);
- if (debug) {
- console.log("objectRefSize: " + objectRefSize);
- }
- var numObjects = readUInt64BE(trailer, 8);
- if (debug) {
- console.log("numObjects: " + numObjects);
- }
- var topObject = readUInt64BE(trailer, 16);
- if (debug) {
- console.log("topObject: " + topObject);
- }
- var offsetTableOffset = readUInt64BE(trailer, 24);
- if (debug) {
- console.log("offsetTableOffset: " + offsetTableOffset);
- }
-
- if (numObjects > exports.maxObjectCount) {
- throw new Error("maxObjectCount exceeded");
- }
-
- // Handle offset table
- var offsetTable = [];
-
- for (var i = 0; i < numObjects; i++) {
- var offsetBytes = buffer.slice(offsetTableOffset + i * offsetSize, offsetTableOffset + (i + 1) * offsetSize);
- offsetTable[i] = readUInt(offsetBytes, 0);
- if (debug) {
- console.log("Offset for Object #" + i + " is " + offsetTable[i] + " [" + offsetTable[i].toString(16) + "]");
- }
- }
-
- // Parses an object inside the currently parsed binary property list.
- // For the format specification check
- //
- // Apple's binary property list parser implementation .
- function parseObject(tableOffset) {
- var offset = offsetTable[tableOffset];
- var type = buffer[offset];
- var objType = (type & 0xF0) >> 4; //First 4 bits
- var objInfo = (type & 0x0F); //Second 4 bits
- switch (objType) {
- case 0x0:
- return parseSimple();
- case 0x1:
- return parseInteger();
- case 0x8:
- return parseUID();
- case 0x2:
- return parseReal();
- case 0x3:
- return parseDate();
- case 0x4:
- return parseData();
- case 0x5: // ASCII
- return parsePlistString();
- case 0x6: // UTF-16
- return parsePlistString(true);
- case 0xA:
- return parseArray();
- case 0xD:
- return parseDictionary();
- default:
- throw new Error("Unhandled type 0x" + objType.toString(16));
- }
-
- function parseSimple() {
- //Simple
- switch (objInfo) {
- case 0x0: // null
- return null;
- case 0x8: // false
- return false;
- case 0x9: // true
- return true;
- case 0xF: // filler byte
- return null;
- default:
- throw new Error("Unhandled simple type 0x" + objType.toString(16));
- }
- }
-
- function bufferToHexString(buffer) {
- var str = '';
- var i;
- for (i = 0; i < buffer.length; i++) {
- if (buffer[i] != 0x00) {
- break;
- }
- }
- for (; i < buffer.length; i++) {
- var part = '00' + buffer[i].toString(16);
- str += part.substr(part.length - 2);
- }
- return str;
- }
-
- function parseInteger() {
- var length = Math.pow(2, objInfo);
- if (length > 4) {
- var data = buffer.slice(offset + 1, offset + 1 + length);
- var str = bufferToHexString(data);
- return bigInt(str, 16);
- } if (length < exports.maxObjectSize) {
- return readUInt(buffer.slice(offset + 1, offset + 1 + length));
- } else {
- throw new Error("To little heap space available! Wanted to read " + length + " bytes, but only " + exports.maxObjectSize + " are available.");
- }
- }
-
- function parseUID() {
- var length = objInfo + 1;
- if (length < exports.maxObjectSize) {
- return new UID(readUInt(buffer.slice(offset + 1, offset + 1 + length)));
- } else {
- throw new Error("To little heap space available! Wanted to read " + length + " bytes, but only " + exports.maxObjectSize + " are available.");
- }
- }
-
- function parseReal() {
- var length = Math.pow(2, objInfo);
- if (length < exports.maxObjectSize) {
- var realBuffer = buffer.slice(offset + 1, offset + 1 + length);
- if (length === 4) {
- return realBuffer.readFloatBE(0);
- }
- else if (length === 8) {
- return realBuffer.readDoubleBE(0);
- }
- } else {
- throw new Error("To little heap space available! Wanted to read " + length + " bytes, but only " + exports.maxObjectSize + " are available.");
- }
- }
-
- function parseDate() {
- if (objInfo != 0x3) {
- console.error("Unknown date type :" + objInfo + ". Parsing anyway...");
- }
- var dateBuffer = buffer.slice(offset + 1, offset + 9);
- return new Date(EPOCH + (1000 * dateBuffer.readDoubleBE(0)));
- }
-
- function parseData() {
- var dataoffset = 1;
- var length = objInfo;
- if (objInfo == 0xF) {
- var int_type = buffer[offset + 1];
- var intType = (int_type & 0xF0) / 0x10;
- if (intType != 0x1) {
- console.error("0x4: UNEXPECTED LENGTH-INT TYPE! " + intType);
- }
- var intInfo = int_type & 0x0F;
- var intLength = Math.pow(2, intInfo);
- dataoffset = 2 + intLength;
- if (intLength < 3) {
- length = readUInt(buffer.slice(offset + 2, offset + 2 + intLength));
- } else {
- length = readUInt(buffer.slice(offset + 2, offset + 2 + intLength));
- }
- }
- if (length < exports.maxObjectSize) {
- return buffer.slice(offset + dataoffset, offset + dataoffset + length);
- } else {
- throw new Error("To little heap space available! Wanted to read " + length + " bytes, but only " + exports.maxObjectSize + " are available.");
- }
- }
-
- function parsePlistString (isUtf16) {
- isUtf16 = isUtf16 || 0;
- var enc = "utf8";
- var length = objInfo;
- var stroffset = 1;
- if (objInfo == 0xF) {
- var int_type = buffer[offset + 1];
- var intType = (int_type & 0xF0) / 0x10;
- if (intType != 0x1) {
- console.err("UNEXPECTED LENGTH-INT TYPE! " + intType);
- }
- var intInfo = int_type & 0x0F;
- var intLength = Math.pow(2, intInfo);
- var stroffset = 2 + intLength;
- if (intLength < 3) {
- length = readUInt(buffer.slice(offset + 2, offset + 2 + intLength));
- } else {
- length = readUInt(buffer.slice(offset + 2, offset + 2 + intLength));
- }
- }
- // length is String length -> to get byte length multiply by 2, as 1 character takes 2 bytes in UTF-16
- length *= (isUtf16 + 1);
- if (length < exports.maxObjectSize) {
- var plistString = new Buffer(buffer.slice(offset + stroffset, offset + stroffset + length));
- if (isUtf16) {
- plistString = swapBytes(plistString);
- enc = "ucs2";
- }
- return plistString.toString(enc);
- } else {
- throw new Error("To little heap space available! Wanted to read " + length + " bytes, but only " + exports.maxObjectSize + " are available.");
- }
- }
-
- function parseArray() {
- var length = objInfo;
- var arrayoffset = 1;
- if (objInfo == 0xF) {
- var int_type = buffer[offset + 1];
- var intType = (int_type & 0xF0) / 0x10;
- if (intType != 0x1) {
- console.error("0xa: UNEXPECTED LENGTH-INT TYPE! " + intType);
- }
- var intInfo = int_type & 0x0F;
- var intLength = Math.pow(2, intInfo);
- arrayoffset = 2 + intLength;
- if (intLength < 3) {
- length = readUInt(buffer.slice(offset + 2, offset + 2 + intLength));
- } else {
- length = readUInt(buffer.slice(offset + 2, offset + 2 + intLength));
- }
- }
- if (length * objectRefSize > exports.maxObjectSize) {
- throw new Error("To little heap space available!");
- }
- var array = [];
- for (var i = 0; i < length; i++) {
- var objRef = readUInt(buffer.slice(offset + arrayoffset + i * objectRefSize, offset + arrayoffset + (i + 1) * objectRefSize));
- array[i] = parseObject(objRef);
- }
- return array;
- }
-
- function parseDictionary() {
- var length = objInfo;
- var dictoffset = 1;
- if (objInfo == 0xF) {
- var int_type = buffer[offset + 1];
- var intType = (int_type & 0xF0) / 0x10;
- if (intType != 0x1) {
- console.error("0xD: UNEXPECTED LENGTH-INT TYPE! " + intType);
- }
- var intInfo = int_type & 0x0F;
- var intLength = Math.pow(2, intInfo);
- dictoffset = 2 + intLength;
- if (intLength < 3) {
- length = readUInt(buffer.slice(offset + 2, offset + 2 + intLength));
- } else {
- length = readUInt(buffer.slice(offset + 2, offset + 2 + intLength));
- }
- }
- if (length * 2 * objectRefSize > exports.maxObjectSize) {
- throw new Error("To little heap space available!");
- }
- if (debug) {
- console.log("Parsing dictionary #" + tableOffset);
- }
- var dict = {};
- for (var i = 0; i < length; i++) {
- var keyRef = readUInt(buffer.slice(offset + dictoffset + i * objectRefSize, offset + dictoffset + (i + 1) * objectRefSize));
- var valRef = readUInt(buffer.slice(offset + dictoffset + (length * objectRefSize) + i * objectRefSize, offset + dictoffset + (length * objectRefSize) + (i + 1) * objectRefSize));
- var key = parseObject(keyRef);
- var val = parseObject(valRef);
- if (debug) {
- console.log(" DICT #" + tableOffset + ": Mapped " + key + " to " + val);
- }
- dict[key] = val;
- }
- return dict;
- }
- }
-
- return [ parseObject(topObject) ];
-};
-
-function readUInt(buffer, start) {
- start = start || 0;
-
- var l = 0;
- for (var i = start; i < buffer.length; i++) {
- l <<= 8;
- l |= buffer[i] & 0xFF;
- }
- return l;
-}
-
-// we're just going to toss the high order bits because javascript doesn't have 64-bit ints
-function readUInt64BE(buffer, start) {
- var data = buffer.slice(start, start + 8);
- return data.readUInt32BE(4, 8);
-}
-
-function swapBytes(buffer) {
- var len = buffer.length;
- for (var i = 0; i < len; i += 2) {
- var a = buffer[i];
- buffer[i] = buffer[i+1];
- buffer[i+1] = a;
- }
- return buffer;
-}
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/bplist-parser/package.json b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/bplist-parser/package.json
deleted file mode 100644
index 8865539..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/bplist-parser/package.json
+++ /dev/null
@@ -1,90 +0,0 @@
-{
- "_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",
- "_id": "bplist-parser@0.1.1",
- "_inCache": true,
- "_installable": true,
- "_location": "/bplist-parser",
- "_nodeVersion": "5.1.0",
- "_npmUser": {
- "name": "joeferner",
- "email": "joe@fernsroth.com"
- },
- "_npmVersion": "3.4.0",
- "_phantomChildren": {},
- "_requested": {
- "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"
- },
- "_requiredBy": [
- "/cordova-common"
- ],
- "_resolved": "http://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",
- "author": {
- "name": "Joe Ferner",
- "email": "joe.ferner@nearinfinity.com"
- },
- "bugs": {
- "url": "https://github.com/nearinfinity/node-bplist-parser/issues"
- },
- "dependencies": {
- "big-integer": "^1.6.7"
- },
- "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",
- "plist",
- "parser"
- ],
- "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"
- },
- "scripts": {
- "test": "./node_modules/nodeunit/bin/nodeunit test"
- },
- "version": "0.1.1"
-}
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/bplist-parser/test/airplay.bplist b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/bplist-parser/test/airplay.bplist
deleted file mode 100644
index 931adea..0000000
Binary files a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/bplist-parser/test/airplay.bplist and /dev/null differ
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/bplist-parser/test/iTunes-small.bplist b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/bplist-parser/test/iTunes-small.bplist
deleted file mode 100644
index b7edb14..0000000
Binary files a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/bplist-parser/test/iTunes-small.bplist and /dev/null differ
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/bplist-parser/test/int64.bplist b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/bplist-parser/test/int64.bplist
deleted file mode 100644
index 6da9c04..0000000
Binary files a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/bplist-parser/test/int64.bplist and /dev/null differ
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/bplist-parser/test/int64.xml b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/bplist-parser/test/int64.xml
deleted file mode 100644
index cc6cb03..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/bplist-parser/test/int64.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
- zero
- 0
- int64item
- 12345678901234567890
-
-
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/bplist-parser/test/parseTest.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/bplist-parser/test/parseTest.js
deleted file mode 100644
index 67e7bfa..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/bplist-parser/test/parseTest.js
+++ /dev/null
@@ -1,159 +0,0 @@
-'use strict';
-
-// tests are adapted from https://github.com/TooTallNate/node-plist
-
-var path = require('path');
-var nodeunit = require('nodeunit');
-var bplist = require('../');
-
-module.exports = {
- 'iTunes Small': function (test) {
- var file = path.join(__dirname, "iTunes-small.bplist");
- var startTime1 = new Date();
-
- bplist.parseFile(file, function (err, dicts) {
- if (err) {
- throw err;
- }
-
- var endTime = new Date();
- console.log('Parsed "' + file + '" in ' + (endTime - startTime1) + 'ms');
- var dict = dicts[0];
- test.equal(dict['Application Version'], "9.0.3");
- test.equal(dict['Library Persistent ID'], "6F81D37F95101437");
- test.done();
- });
- },
-
- 'sample1': function (test) {
- var file = path.join(__dirname, "sample1.bplist");
- var startTime = new Date();
-
- bplist.parseFile(file, function (err, dicts) {
- if (err) {
- throw err;
- }
-
- var endTime = new Date();
- console.log('Parsed "' + file + '" in ' + (endTime - startTime) + 'ms');
- var dict = dicts[0];
- test.equal(dict['CFBundleIdentifier'], 'com.apple.dictionary.MySample');
- test.done();
- });
- },
-
- 'sample2': function (test) {
- var file = path.join(__dirname, "sample2.bplist");
- var startTime = new Date();
-
- bplist.parseFile(file, function (err, dicts) {
- if (err) {
- throw err;
- }
-
- var endTime = new Date();
- console.log('Parsed "' + file + '" in ' + (endTime - startTime) + 'ms');
- var dict = dicts[0];
- test.equal(dict['PopupMenu'][2]['Key'], "\n #import \n\n#import \n\nint main(int argc, char *argv[])\n{\n return macruby_main(\"rb_main.rb\", argc, argv);\n}\n");
- test.done();
- });
- },
-
- 'airplay': function (test) {
- var file = path.join(__dirname, "airplay.bplist");
- var startTime = new Date();
-
- bplist.parseFile(file, function (err, dicts) {
- if (err) {
- throw err;
- }
-
- var endTime = new Date();
- console.log('Parsed "' + file + '" in ' + (endTime - startTime) + 'ms');
-
- var dict = dicts[0];
- test.equal(dict['duration'], 5555.0495000000001);
- test.equal(dict['position'], 4.6269989039999997);
- test.done();
- });
- },
-
- 'utf16': function (test) {
- var file = path.join(__dirname, "utf16.bplist");
- var startTime = new Date();
-
- bplist.parseFile(file, function (err, dicts) {
- if (err) {
- throw err;
- }
-
- var endTime = new Date();
- console.log('Parsed "' + file + '" in ' + (endTime - startTime) + 'ms');
-
- var dict = dicts[0];
- test.equal(dict['CFBundleName'], 'sellStuff');
- test.equal(dict['CFBundleShortVersionString'], '2.6.1');
- test.equal(dict['NSHumanReadableCopyright'], '©2008-2012, sellStuff, Inc.');
- test.done();
- });
- },
-
- 'utf16chinese': function (test) {
- var file = path.join(__dirname, "utf16_chinese.plist");
- var startTime = new Date();
-
- bplist.parseFile(file, function (err, dicts) {
- if (err) {
- throw err;
- }
-
- var endTime = new Date();
- console.log('Parsed "' + file + '" in ' + (endTime - startTime) + 'ms');
-
- var dict = dicts[0];
- test.equal(dict['CFBundleName'], '天翼阅读');
- test.equal(dict['CFBundleDisplayName'], '天翼阅读');
- test.done();
- });
- },
-
-
-
- 'uid': function (test) {
- var file = path.join(__dirname, "uid.bplist");
- var startTime = new Date();
-
- bplist.parseFile(file, function (err, dicts) {
- if (err) {
- throw err;
- }
-
- var endTime = new Date();
- console.log('Parsed "' + file + '" in ' + (endTime - startTime) + 'ms');
-
- var dict = dicts[0];
- test.deepEqual(dict['$objects'][1]['NS.keys'], [{UID:2}, {UID:3}, {UID:4}]);
- test.deepEqual(dict['$objects'][1]['NS.objects'], [{UID: 5}, {UID:6}, {UID:7}]);
- test.deepEqual(dict['$top']['root'], {UID:1});
- test.done();
- });
- },
-
- 'int64': function (test) {
- var file = path.join(__dirname, "int64.bplist");
- var startTime = new Date();
-
- bplist.parseFile(file, function (err, dicts) {
- if (err) {
- throw err;
- }
-
- var endTime = new Date();
- console.log('Parsed "' + file + '" in ' + (endTime - startTime) + 'ms');
- var dict = dicts[0];
- test.equal(dict['zero'], '0');
- test.equal(dict['int64item'], '12345678901234567890');
- test.done();
- });
- }
-};
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/bplist-parser/test/sample1.bplist b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/bplist-parser/test/sample1.bplist
deleted file mode 100644
index 5b808ff..0000000
Binary files a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/bplist-parser/test/sample1.bplist and /dev/null differ
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/bplist-parser/test/sample2.bplist b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/bplist-parser/test/sample2.bplist
deleted file mode 100644
index fc42979..0000000
Binary files a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/bplist-parser/test/sample2.bplist and /dev/null differ
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/bplist-parser/test/uid.bplist b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/bplist-parser/test/uid.bplist
deleted file mode 100644
index 59f341e..0000000
Binary files a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/bplist-parser/test/uid.bplist and /dev/null differ
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/bplist-parser/test/utf16.bplist b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/bplist-parser/test/utf16.bplist
deleted file mode 100644
index ba4bcfa..0000000
Binary files a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/bplist-parser/test/utf16.bplist and /dev/null differ
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/bplist-parser/test/utf16_chinese.plist b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/bplist-parser/test/utf16_chinese.plist
deleted file mode 100644
index ba1e2d7..0000000
Binary files a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/bplist-parser/test/utf16_chinese.plist and /dev/null differ
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/brace-expansion/README.md b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/brace-expansion/README.md
deleted file mode 100644
index 1793929..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/brace-expansion/README.md
+++ /dev/null
@@ -1,122 +0,0 @@
-# brace-expansion
-
-[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html),
-as known from sh/bash, in JavaScript.
-
-[](http://travis-ci.org/juliangruber/brace-expansion)
-[](https://www.npmjs.org/package/brace-expansion)
-
-[](https://ci.testling.com/juliangruber/brace-expansion)
-
-## Example
-
-```js
-var expand = require('brace-expansion');
-
-expand('file-{a,b,c}.jpg')
-// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg']
-
-expand('-v{,,}')
-// => ['-v', '-v', '-v']
-
-expand('file{0..2}.jpg')
-// => ['file0.jpg', 'file1.jpg', 'file2.jpg']
-
-expand('file-{a..c}.jpg')
-// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg']
-
-expand('file{2..0}.jpg')
-// => ['file2.jpg', 'file1.jpg', 'file0.jpg']
-
-expand('file{0..4..2}.jpg')
-// => ['file0.jpg', 'file2.jpg', 'file4.jpg']
-
-expand('file-{a..e..2}.jpg')
-// => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg']
-
-expand('file{00..10..5}.jpg')
-// => ['file00.jpg', 'file05.jpg', 'file10.jpg']
-
-expand('{{A..C},{a..c}}')
-// => ['A', 'B', 'C', 'a', 'b', 'c']
-
-expand('ppp{,config,oe{,conf}}')
-// => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf']
-```
-
-## API
-
-```js
-var expand = require('brace-expansion');
-```
-
-### var expanded = expand(str)
-
-Return an array of all possible and valid expansions of `str`. If none are
-found, `[str]` is returned.
-
-Valid expansions are:
-
-```js
-/^(.*,)+(.+)?$/
-// {a,b,...}
-```
-
-A comma seperated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`.
-
-```js
-/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/
-// {x..y[..incr]}
-```
-
-A numeric sequence from `x` to `y` inclusive, with optional increment.
-If `x` or `y` start with a leading `0`, all the numbers will be padded
-to have equal length. Negative numbers and backwards iteration work too.
-
-```js
-/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/
-// {x..y[..incr]}
-```
-
-An alphabetic sequence from `x` to `y` inclusive, with optional increment.
-`x` and `y` must be exactly one character, and if given, `incr` must be a
-number.
-
-For compatibility reasons, the string `${` is not eligible for brace expansion.
-
-## Installation
-
-With [npm](https://npmjs.org) do:
-
-```bash
-npm install brace-expansion
-```
-
-## Contributors
-
-- [Julian Gruber](https://github.com/juliangruber)
-- [Isaac Z. Schlueter](https://github.com/isaacs)
-
-## License
-
-(MIT)
-
-Copyright (c) 2013 Julian Gruber <julian@juliangruber.com>
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of
-this software and associated documentation files (the "Software"), to deal 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.
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/brace-expansion/index.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/brace-expansion/index.js
deleted file mode 100644
index 955f27c..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/brace-expansion/index.js
+++ /dev/null
@@ -1,201 +0,0 @@
-var concatMap = require('concat-map');
-var balanced = require('balanced-match');
-
-module.exports = expandTop;
-
-var escSlash = '\0SLASH'+Math.random()+'\0';
-var escOpen = '\0OPEN'+Math.random()+'\0';
-var escClose = '\0CLOSE'+Math.random()+'\0';
-var escComma = '\0COMMA'+Math.random()+'\0';
-var escPeriod = '\0PERIOD'+Math.random()+'\0';
-
-function numeric(str) {
- return parseInt(str, 10) == str
- ? parseInt(str, 10)
- : str.charCodeAt(0);
-}
-
-function escapeBraces(str) {
- return str.split('\\\\').join(escSlash)
- .split('\\{').join(escOpen)
- .split('\\}').join(escClose)
- .split('\\,').join(escComma)
- .split('\\.').join(escPeriod);
-}
-
-function unescapeBraces(str) {
- return str.split(escSlash).join('\\')
- .split(escOpen).join('{')
- .split(escClose).join('}')
- .split(escComma).join(',')
- .split(escPeriod).join('.');
-}
-
-
-// Basically just str.split(","), but handling cases
-// where we have nested braced sections, which should be
-// treated as individual members, like {a,{b,c},d}
-function parseCommaParts(str) {
- if (!str)
- return [''];
-
- var parts = [];
- var m = balanced('{', '}', str);
-
- if (!m)
- return str.split(',');
-
- var pre = m.pre;
- var body = m.body;
- var post = m.post;
- var p = pre.split(',');
-
- p[p.length-1] += '{' + body + '}';
- var postParts = parseCommaParts(post);
- if (post.length) {
- p[p.length-1] += postParts.shift();
- p.push.apply(p, postParts);
- }
-
- parts.push.apply(parts, p);
-
- return parts;
-}
-
-function expandTop(str) {
- if (!str)
- return [];
-
- // I don't know why Bash 4.3 does this, but it does.
- // Anything starting with {} will have the first two bytes preserved
- // but *only* at the top level, so {},a}b will not expand to anything,
- // but a{},b}c will be expanded to [a}c,abc].
- // One could argue that this is a bug in Bash, but since the goal of
- // this module is to match Bash's rules, we escape a leading {}
- if (str.substr(0, 2) === '{}') {
- str = '\\{\\}' + str.substr(2);
- }
-
- return expand(escapeBraces(str), true).map(unescapeBraces);
-}
-
-function identity(e) {
- return e;
-}
-
-function embrace(str) {
- return '{' + str + '}';
-}
-function isPadded(el) {
- return /^-?0\d/.test(el);
-}
-
-function lte(i, y) {
- return i <= y;
-}
-function gte(i, y) {
- return i >= y;
-}
-
-function expand(str, isTop) {
- var expansions = [];
-
- var m = balanced('{', '}', str);
- if (!m || /\$$/.test(m.pre)) return [str];
-
- var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
- var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
- var isSequence = isNumericSequence || isAlphaSequence;
- var isOptions = /^(.*,)+(.+)?$/.test(m.body);
- if (!isSequence && !isOptions) {
- // {a},b}
- if (m.post.match(/,.*\}/)) {
- str = m.pre + '{' + m.body + escClose + m.post;
- return expand(str);
- }
- return [str];
- }
-
- var n;
- if (isSequence) {
- n = m.body.split(/\.\./);
- } else {
- n = parseCommaParts(m.body);
- if (n.length === 1) {
- // x{{a,b}}y ==> x{a}y x{b}y
- n = expand(n[0], false).map(embrace);
- if (n.length === 1) {
- var post = m.post.length
- ? expand(m.post, false)
- : [''];
- return post.map(function(p) {
- return m.pre + n[0] + p;
- });
- }
- }
- }
-
- // at this point, n is the parts, and we know it's not a comma set
- // with a single entry.
-
- // no need to expand pre, since it is guaranteed to be free of brace-sets
- var pre = m.pre;
- var post = m.post.length
- ? expand(m.post, false)
- : [''];
-
- var N;
-
- if (isSequence) {
- var x = numeric(n[0]);
- var y = numeric(n[1]);
- var width = Math.max(n[0].length, n[1].length)
- var incr = n.length == 3
- ? Math.abs(numeric(n[2]))
- : 1;
- var test = lte;
- var reverse = y < x;
- if (reverse) {
- incr *= -1;
- test = gte;
- }
- var pad = n.some(isPadded);
-
- N = [];
-
- for (var i = x; test(i, y); i += incr) {
- var c;
- if (isAlphaSequence) {
- c = String.fromCharCode(i);
- if (c === '\\')
- c = '';
- } else {
- c = String(i);
- if (pad) {
- var need = width - c.length;
- if (need > 0) {
- var z = new Array(need + 1).join('0');
- if (i < 0)
- c = '-' + z + c.slice(1);
- else
- c = z + c;
- }
- }
- }
- N.push(c);
- }
- } else {
- N = concatMap(n, function(el) { return expand(el, false) });
- }
-
- for (var j = 0; j < N.length; j++) {
- for (var k = 0; k < post.length; k++) {
- var expansion = pre + N[j] + post[k];
- if (!isTop || isSequence || expansion)
- expansions.push(expansion);
- }
- }
-
- return expansions;
-}
-
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/brace-expansion/package.json b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/brace-expansion/package.json
deleted file mode 100644
index 33a4d08..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/brace-expansion/package.json
+++ /dev/null
@@ -1,113 +0,0 @@
-{
- "_args": [
- [
- {
- "raw": "brace-expansion@^1.0.0",
- "scope": null,
- "escapedName": "brace-expansion",
- "name": "brace-expansion",
- "rawSpec": "^1.0.0",
- "spec": ">=1.0.0 <2.0.0",
- "type": "range"
- },
- "/Users/steveng/repo/cordova/cordova-android/node_modules/minimatch"
- ]
- ],
- "_from": "brace-expansion@>=1.0.0 <2.0.0",
- "_id": "brace-expansion@1.1.6",
- "_inCache": true,
- "_installable": true,
- "_location": "/brace-expansion",
- "_nodeVersion": "4.4.7",
- "_npmOperationalInternal": {
- "host": "packages-16-east.internal.npmjs.com",
- "tmp": "tmp/brace-expansion-1.1.6.tgz_1469047715600_0.9362958471756428"
- },
- "_npmUser": {
- "name": "juliangruber",
- "email": "julian@juliangruber.com"
- },
- "_npmVersion": "2.15.8",
- "_phantomChildren": {},
- "_requested": {
- "raw": "brace-expansion@^1.0.0",
- "scope": null,
- "escapedName": "brace-expansion",
- "name": "brace-expansion",
- "rawSpec": "^1.0.0",
- "spec": ">=1.0.0 <2.0.0",
- "type": "range"
- },
- "_requiredBy": [
- "/minimatch"
- ],
- "_resolved": "http://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz",
- "_shasum": "7197d7eaa9b87e648390ea61fc66c84427420df9",
- "_shrinkwrap": null,
- "_spec": "brace-expansion@^1.0.0",
- "_where": "/Users/steveng/repo/cordova/cordova-android/node_modules/minimatch",
- "author": {
- "name": "Julian Gruber",
- "email": "mail@juliangruber.com",
- "url": "http://juliangruber.com"
- },
- "bugs": {
- "url": "https://github.com/juliangruber/brace-expansion/issues"
- },
- "dependencies": {
- "balanced-match": "^0.4.1",
- "concat-map": "0.0.1"
- },
- "description": "Brace expansion as known from sh/bash",
- "devDependencies": {
- "tape": "^4.6.0"
- },
- "directories": {},
- "dist": {
- "shasum": "7197d7eaa9b87e648390ea61fc66c84427420df9",
- "tarball": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz"
- },
- "gitHead": "791262fa06625e9c5594cde529a21d82086af5f2",
- "homepage": "https://github.com/juliangruber/brace-expansion",
- "keywords": [],
- "license": "MIT",
- "main": "index.js",
- "maintainers": [
- {
- "name": "juliangruber",
- "email": "julian@juliangruber.com"
- },
- {
- "name": "isaacs",
- "email": "isaacs@npmjs.com"
- }
- ],
- "name": "brace-expansion",
- "optionalDependencies": {},
- "readme": "ERROR: No README data found!",
- "repository": {
- "type": "git",
- "url": "git://github.com/juliangruber/brace-expansion.git"
- },
- "scripts": {
- "gentest": "bash test/generate.sh",
- "test": "tape test/*.js"
- },
- "testling": {
- "files": "test/*.js",
- "browsers": [
- "ie/8..latest",
- "firefox/20..latest",
- "firefox/nightly",
- "chrome/25..latest",
- "chrome/canary",
- "opera/12..latest",
- "opera/next",
- "safari/5.1..latest",
- "ipad/6.0..latest",
- "iphone/6.0..latest",
- "android-browser/4.2..latest"
- ]
- },
- "version": "1.1.6"
-}
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/concat-map/.travis.yml b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/concat-map/.travis.yml
deleted file mode 100644
index f1d0f13..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/concat-map/.travis.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-language: node_js
-node_js:
- - 0.4
- - 0.6
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/concat-map/LICENSE b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/concat-map/LICENSE
deleted file mode 100644
index ee27ba4..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/concat-map/LICENSE
+++ /dev/null
@@ -1,18 +0,0 @@
-This software is released under the MIT license:
-
-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.
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/concat-map/README.markdown b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/concat-map/README.markdown
deleted file mode 100644
index 408f70a..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/concat-map/README.markdown
+++ /dev/null
@@ -1,62 +0,0 @@
-concat-map
-==========
-
-Concatenative mapdashery.
-
-[](http://ci.testling.com/substack/node-concat-map)
-
-[](http://travis-ci.org/substack/node-concat-map)
-
-example
-=======
-
-``` js
-var concatMap = require('concat-map');
-var xs = [ 1, 2, 3, 4, 5, 6 ];
-var ys = concatMap(xs, function (x) {
- return x % 2 ? [ x - 0.1, x, x + 0.1 ] : [];
-});
-console.dir(ys);
-```
-
-***
-
-```
-[ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ]
-```
-
-methods
-=======
-
-``` js
-var concatMap = require('concat-map')
-```
-
-concatMap(xs, fn)
------------------
-
-Return an array of concatenated elements by calling `fn(x, i)` for each element
-`x` and each index `i` in the array `xs`.
-
-When `fn(x, i)` returns an array, its result will be concatenated with the
-result array. If `fn(x, i)` returns anything else, that value will be pushed
-onto the end of the result array.
-
-install
-=======
-
-With [npm](http://npmjs.org) do:
-
-```
-npm install concat-map
-```
-
-license
-=======
-
-MIT
-
-notes
-=====
-
-This module was written while sitting high above the ground in a tree.
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/concat-map/example/map.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/concat-map/example/map.js
deleted file mode 100644
index 3365621..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/concat-map/example/map.js
+++ /dev/null
@@ -1,6 +0,0 @@
-var concatMap = require('../');
-var xs = [ 1, 2, 3, 4, 5, 6 ];
-var ys = concatMap(xs, function (x) {
- return x % 2 ? [ x - 0.1, x, x + 0.1 ] : [];
-});
-console.dir(ys);
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/concat-map/index.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/concat-map/index.js
deleted file mode 100644
index b29a781..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/concat-map/index.js
+++ /dev/null
@@ -1,13 +0,0 @@
-module.exports = function (xs, fn) {
- var res = [];
- for (var i = 0; i < xs.length; i++) {
- var x = fn(xs[i], i);
- if (isArray(x)) res.push.apply(res, x);
- else res.push(x);
- }
- return res;
-};
-
-var isArray = Array.isArray || function (xs) {
- return Object.prototype.toString.call(xs) === '[object Array]';
-};
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/concat-map/package.json b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/concat-map/package.json
deleted file mode 100644
index fcb5849..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/concat-map/package.json
+++ /dev/null
@@ -1,118 +0,0 @@
-{
- "_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,
- "_installable": true,
- "_location": "/concat-map",
- "_npmUser": {
- "name": "substack",
- "email": "mail@substack.net"
- },
- "_npmVersion": "1.3.21",
- "_phantomChildren": {},
- "_requested": {
- "raw": "concat-map@0.0.1",
- "scope": null,
- "escapedName": "concat-map",
- "name": "concat-map",
- "rawSpec": "0.0.1",
- "spec": "0.0.1",
- "type": "version"
- },
- "_requiredBy": [
- "/brace-expansion"
- ],
- "_resolved": "http://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",
- "author": {
- "name": "James Halliday",
- "email": "mail@substack.net",
- "url": "http://substack.net"
- },
- "bugs": {
- "url": "https://github.com/substack/node-concat-map/issues"
- },
- "dependencies": {},
- "description": "concatenative mapdashery",
- "devDependencies": {
- "tape": "~2.4.0"
- },
- "directories": {
- "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",
- "keywords": [
- "concat",
- "concatMap",
- "map",
- "functional",
- "higher-order"
- ],
- "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"
- },
- "scripts": {
- "test": "tape test/*.js"
- },
- "testling": {
- "files": "test/*.js",
- "browsers": {
- "ie": [
- 6,
- 7,
- 8,
- 9
- ],
- "ff": [
- 3.5,
- 10,
- 15
- ],
- "chrome": [
- 10,
- 22
- ],
- "safari": [
- 5.1
- ],
- "opera": [
- 12
- ]
- }
- },
- "version": "0.0.1"
-}
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/concat-map/test/map.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/concat-map/test/map.js
deleted file mode 100644
index fdbd702..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/concat-map/test/map.js
+++ /dev/null
@@ -1,39 +0,0 @@
-var concatMap = require('../');
-var test = require('tape');
-
-test('empty or not', function (t) {
- var xs = [ 1, 2, 3, 4, 5, 6 ];
- var ixes = [];
- var ys = concatMap(xs, function (x, ix) {
- ixes.push(ix);
- return x % 2 ? [ x - 0.1, x, x + 0.1 ] : [];
- });
- t.same(ys, [ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ]);
- t.same(ixes, [ 0, 1, 2, 3, 4, 5 ]);
- t.end();
-});
-
-test('always something', function (t) {
- var xs = [ 'a', 'b', 'c', 'd' ];
- var ys = concatMap(xs, function (x) {
- return x === 'b' ? [ 'B', 'B', 'B' ] : [ x ];
- });
- t.same(ys, [ 'a', 'B', 'B', 'B', 'c', 'd' ]);
- t.end();
-});
-
-test('scalars', function (t) {
- var xs = [ 'a', 'b', 'c', 'd' ];
- var ys = concatMap(xs, function (x) {
- return x === 'b' ? [ 'B', 'B', 'B' ] : x;
- });
- t.same(ys, [ 'a', 'B', 'B', 'B', 'c', 'd' ]);
- t.end();
-});
-
-test('undefs', function (t) {
- var xs = [ 'a', 'b', 'c', 'd' ];
- var ys = concatMap(xs, function () {});
- t.same(ys, [ undefined, undefined, undefined, undefined ]);
- t.end();
-});
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/.jscs.json b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/.jscs.json
deleted file mode 100644
index 5cc7e26..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/.jscs.json
+++ /dev/null
@@ -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"
- ]
-}
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/.jshintignore b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/.jshintignore
deleted file mode 100644
index d606f61..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/.jshintignore
+++ /dev/null
@@ -1 +0,0 @@
-spec/fixtures/*
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/.npmignore b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/.npmignore
deleted file mode 100644
index 5d14118..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/.npmignore
+++ /dev/null
@@ -1,2 +0,0 @@
-spec
-coverage
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/.ratignore b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/.ratignore
deleted file mode 100644
index 26f7205..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/.ratignore
+++ /dev/null
@@ -1,2 +0,0 @@
-fixtures
-coverage
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/README.md b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/README.md
deleted file mode 100644
index c5dcfd5..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/README.md
+++ /dev/null
@@ -1,153 +0,0 @@
-
-
-# cordova-common
-Expoeses 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:
-```js
-var events = require('cordova-common').events;
-events.emit('warn', 'Some warning message')
-```
-
-There are the following events supported by cordova-cli: `verbose`, `log`, `info`, `warn`, `error`.
-
-### `CordovaError`
-
-An error class used by Cordova to throw cordova-specific errors. The CordovaError class is inherited from Error, so CordovaError instances is also valid Error instances (`instanceof` check succeeds).
-
-Usage:
-
-```js
-var CordovaError = require('cordova-common').CordovaError;
-throw new CordovaError('Some error message', SOME_ERR_CODE);
-```
-
-See [CordovaError](src/CordovaError/CordovaError.js) for supported error codes.
-
-### `ConfigParser`
-
-Exposes functionality to deal with cordova project `config.xml` files. For ConfigParser API reference check [ConfigParser Readme](src/ConfigParser/README.md).
-
-Usage:
-```js
-var ConfigParser = require('cordova-common').ConfigParser;
-var appConfig = new ConfigParser('path/to/cordova-app/config.xml');
-console.log(appconfig.name() + ':' + appConfig.version());
-```
-
-### `PluginInfoProvider` and `PluginInfo`
-
-`PluginInfo` is a wrapper for cordova plugins' `plugin.xml` files. This class may be instantiated directly or via `PluginInfoProvider`. The difference is that `PluginInfoProvider` caches `PluginInfo` instances based on plugin source directory.
-
-Usage:
-```js
-var PluginInfo: require('cordova-common').PluginInfo;
-var PluginInfoProvider: require('cordova-common').PluginInfoProvider;
-
-// The following instances are equal
-var plugin1 = new PluginInfo('path/to/plugin_directory');
-var plugin2 = new PluginInfoProvider().get('path/to/plugin_directory');
-
-console.log('The plugin ' + plugin1.id + ' has version ' + plugin1.version)
-```
-
-### `ActionStack`
-
-Utility module for dealing with sequential tasks. Provides a set of tasks that are needed to be done and reverts all tasks that are already completed if one of those tasks fail to complete. Used internally by cordova-lib and platform's plugin installation routines.
-
-Usage:
-```js
-var ActionStack = require('cordova-common').ActionStack;
-var stack = new ActionStack()
-
-var action1 = stack.createAction(task1, [], task1_reverter, []);
-var action2 = stack.createAction(task2, [], task2_reverter, []);
-
-stack.push(action1);
-stack.push(action2);
-
-stack.process()
-.then(function() {
- // all actions succeded
-})
-.catch(function(error){
- // One of actions failed with error
-})
-```
-
-### `superspawn`
-
-Module for spawning child processes with some advanced logic.
-
-Usage:
-```js
-var superspawn = require('cordova-common').superspawn;
-superspawn.spawn('adb', ['devices'])
-.progress(function(data){
- if (data.stderr)
- console.error('"adb devices" raised an error: ' + data.stderr);
-})
-.then(function(devices){
- // Do something...
-})
-```
-
-### `xmlHelpers`
-
-A set of utility methods for dealing with xml files.
-
-Usage:
-```js
-var xml = require('cordova-common').xmlHelpers;
-
-var xmlDoc1 = xml.parseElementtreeSync('some/xml/file');
-var xmlDoc2 = xml.parseElementtreeSync('another/xml/file');
-
-xml.mergeXml(doc1, doc2); // doc2 now contains all the nodes from doc1
-```
-
-### Other APIs
-
-The APIs listed below are also exposed but are intended to be only used internally by cordova plugin installation routines.
-
-```
-PlatformJson
-ConfigChanges
-ConfigKeeper
-ConfigFile
-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`
-* Navigate to cordova-lib directory and link cordova-common
- `cd ../cordova-lib && npm link cordova-common && npm install`
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/RELEASENOTES.md b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/RELEASENOTES.md
deleted file mode 100644
index 02dbcee..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/RELEASENOTES.md
+++ /dev/null
@@ -1,87 +0,0 @@
-
-# Cordova-common Release Notes
-
-### 1.5.1 (Oct 12, 2016)
-* [CB-12002](https://issues.apache.org/jira/browse/CB-12002) Add `getAllowIntents()` to `ConfigParser`
-* [CB-11998](https://issues.apache.org/jira/browse/CB-11998) `cordova platform add` error with `cordova-common@1.5.0`
-
-### 1.5.0 (Oct 06, 2016)
-* [CB-11776](https://issues.apache.org/jira/browse/CB-11776) Add test case for different `edit-config` targets
-* [CB-11908](https://issues.apache.org/jira/browse/CB-11908) Add `edit-config` to `config.xml`
-* [CB-11936](https://issues.apache.org/jira/browse/CB-11936) Support four new **App Transport Security (ATS)** keys
-* update `config.xml` location if it is a **Android Studio** project.
-* use `array` methods and `object.keys` for iterating. avoiding `for-in` loops
-* [CB-11517](https://issues.apache.org/jira/browse/CB-11517) Allow `.folder` matches
-* [CB-11776](https://issues.apache.org/jira/browse/CB-11776) check `edit-config` target exists
-
-### 1.4.1 (Aug 09, 2016)
-* Add general purpose `ConfigParser.getAttribute` API
-* [CB-11653](https://issues.apache.org/jira/browse/CB-11653) moved `findProjectRoot` from `cordova-lib` to `cordova-common`
-* [CB-11636](https://issues.apache.org/jira/browse/CB-11636) Handle attributes with quotes correctly
-* [CB-11645](https://issues.apache.org/jira/browse/CB-11645) added check to see if `getEditConfig` exists before trying to use it
-* [CB-9825](https://issues.apache.org/jira/browse/CB-9825) framework tag spec parsing
-
-### 1.4.0 (Jul 12, 2016)
-* [CB-11023](https://issues.apache.org/jira/browse/CB-11023) Add edit-config functionality
-
-### 1.3.0 (May 12, 2016)
-* [CB-11259](https://issues.apache.org/jira/browse/CB-11259): Improving prepare and build logging
-* [CB-11194](https://issues.apache.org/jira/browse/CB-11194) Improve cordova load time
-* [CB-1117](https://issues.apache.org/jira/browse/CB-1117) Add `FileUpdater` module to `cordova-common`.
-* [CB-11131](https://issues.apache.org/jira/browse/CB-11131) Fix `TypeError: message.toUpperCase` is not a function in `CordovaLogger`
-
-### 1.2.0 (Apr 18, 2016)
-* [CB-11022](https://issues.apache.org/jira/browse/CB-11022) Save modulesMetadata to both www and platform_www when necessary
-* [CB-10833](https://issues.apache.org/jira/browse/CB-10833) Deduplicate common logic for plugin installation/uninstallation
-* [CB-10822](https://issues.apache.org/jira/browse/CB-10822) Manage plugins/modules metadata using PlatformJson
-* [CB-10940](https://issues.apache.org/jira/browse/CB-10940) Can't add Android platform from path
-* [CB-10965](https://issues.apache.org/jira/browse/CB-10965) xml helper allows multiple instances to be merge in config.xml
-
-### 1.1.1 (Mar 18, 2016)
-* [CB-10694](https://issues.apache.org/jira/browse/CB-10694) Update test to reflect merging of [CB-9264](https://issues.apache.org/jira/browse/CB-9264) fix
-* [CB-10694](https://issues.apache.org/jira/browse/CB-10694) Platform-specific configuration preferences don't override global settings
-* [CB-9264](https://issues.apache.org/jira/browse/CB-9264) Duplicate entries in `config.xml`
-* [CB-10791](https://issues.apache.org/jira/browse/CB-10791) Add `adjustLoggerLevel` to `cordova-common.CordovaLogger`
-* [CB-10662](https://issues.apache.org/jira/browse/CB-10662) Add tests for `ConfigParser.getStaticResources`
-* [CB-10622](https://issues.apache.org/jira/browse/CB-10622) fix target attribute being ignored for images in `config.xml`.
-* [CB-10583](https://issues.apache.org/jira/browse/CB-10583) Protect plugin preferences from adding extra Array properties.
-
-### 1.1.0 (Feb 16, 2016)
-* [CB-10482](https://issues.apache.org/jira/browse/CB-10482) Remove references to windows8 from cordova-lib/cli
-* [CB-10430](https://issues.apache.org/jira/browse/CB-10430) Adds forwardEvents method to easily connect two EventEmitters
-* [CB-10176](https://issues.apache.org/jira/browse/CB-10176) Adds CordovaLogger class, based on logger module from cordova-cli
-* [CB-10052](https://issues.apache.org/jira/browse/CB-10052) Expose child process' io streams via promise progress notification
-* [CB-10497](https://issues.apache.org/jira/browse/CB-10497) Prefer .bat over .cmd on windows platform
-* [CB-9984](https://issues.apache.org/jira/browse/CB-9984) Bumps plist version and fixes failing cordova-common test
-
-### 1.0.0 (Oct 29, 2015)
-
-* [CB-9890](https://issues.apache.org/jira/browse/CB-9890) Documents cordova-common
-* [CB-9598](https://issues.apache.org/jira/browse/CB-9598) Correct cordova-lib -> cordova-common in README
-* Pick ConfigParser changes from apache@0c3614e
-* [CB-9743](https://issues.apache.org/jira/browse/CB-9743) Removes system frameworks handling from ConfigChanges
-* [CB-9598](https://issues.apache.org/jira/browse/CB-9598) Cleans out code which has been moved to `cordova-common`
-* Pick ConfigParser changes from apache@ddb027b
-* Picking CordovaError changes from apache@a3b1fca
-* [CB-9598](https://issues.apache.org/jira/browse/CB-9598) Adds tests and fixtures based on existing cordova-lib ones
-* [CB-9598](https://issues.apache.org/jira/browse/CB-9598) Initial implementation for cordova-common
-
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/cordova-common.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/cordova-common.js
deleted file mode 100644
index 801d510..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/cordova-common.js
+++ /dev/null
@@ -1,47 +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.
-*/
-
-var addProperty = require('./src/util/addProperty');
-
-module.exports = { };
-
-addProperty(module, 'events', './src/events');
-addProperty(module, 'superspawn', './src/superspawn');
-
-addProperty(module, 'ActionStack', './src/ActionStack');
-addProperty(module, 'CordovaError', './src/CordovaError/CordovaError');
-addProperty(module, 'CordovaLogger', './src/CordovaLogger');
-addProperty(module, 'CordovaCheck', './src/CordovaCheck');
-addProperty(module, 'CordovaExternalToolErrorContext', './src/CordovaError/CordovaExternalToolErrorContext');
-addProperty(module, 'PlatformJson', './src/PlatformJson');
-addProperty(module, 'ConfigParser', './src/ConfigParser/ConfigParser');
-addProperty(module, 'FileUpdater', './src/FileUpdater');
-
-addProperty(module, 'PluginInfo', './src/PluginInfo/PluginInfo');
-addProperty(module, 'PluginInfoProvider', './src/PluginInfo/PluginInfoProvider');
-
-addProperty(module, 'PluginManager', './src/PluginManager');
-
-addProperty(module, 'ConfigChanges', './src/ConfigChanges/ConfigChanges');
-addProperty(module, 'ConfigKeeper', './src/ConfigChanges/ConfigKeeper');
-addProperty(module, 'ConfigFile', './src/ConfigChanges/ConfigFile');
-addProperty(module, 'mungeUtil', './src/ConfigChanges/munge-util');
-
-addProperty(module, 'xmlHelpers', './src/util/xml-helpers');
-
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/package.json b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/package.json
deleted file mode 100644
index e81f478..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/package.json
+++ /dev/null
@@ -1,131 +0,0 @@
-{
- "_args": [
- [
- {
- "raw": "cordova-common@^1.5.0",
- "scope": null,
- "escapedName": "cordova-common",
- "name": "cordova-common",
- "rawSpec": "^1.5.0",
- "spec": ">=1.5.0 <2.0.0",
- "type": "range"
- },
- "/Users/steveng/repo/cordova/cordova-android"
- ]
- ],
- "_from": "cordova-common@>=1.5.0 <2.0.0",
- "_id": "cordova-common@1.5.1",
- "_inCache": true,
- "_installable": true,
- "_location": "/cordova-common",
- "_nodeVersion": "6.6.0",
- "_npmOperationalInternal": {
- "host": "packages-12-west.internal.npmjs.com",
- "tmp": "tmp/cordova-common-1.5.1.tgz_1476725179180_0.39604957425035536"
- },
- "_npmUser": {
- "name": "stevegill",
- "email": "stevengill97@gmail.com"
- },
- "_npmVersion": "3.10.3",
- "_phantomChildren": {},
- "_requested": {
- "raw": "cordova-common@^1.5.0",
- "scope": null,
- "escapedName": "cordova-common",
- "name": "cordova-common",
- "rawSpec": "^1.5.0",
- "spec": ">=1.5.0 <2.0.0",
- "type": "range"
- },
- "_requiredBy": [
- "/"
- ],
- "_resolved": "file:cordova-dist/tools/cordova-common-1.5.1.tgz",
- "_shasum": "6770de0d6200ad6f94a1abe8939b5bd9ece139e3",
- "_shrinkwrap": null,
- "_spec": "cordova-common@^1.5.0",
- "_where": "/Users/steveng/repo/cordova/cordova-android",
- "author": {
- "name": "Apache Software Foundation"
- },
- "bugs": {
- "url": "https://issues.apache.org/jira/browse/CB",
- "email": "dev@cordova.apache.org"
- },
- "contributors": [],
- "dependencies": {
- "ansi": "^0.3.1",
- "bplist-parser": "^0.1.0",
- "cordova-registry-mapper": "^1.1.8",
- "elementtree": "^0.1.6",
- "glob": "^5.0.13",
- "minimatch": "^3.0.0",
- "osenv": "^0.1.3",
- "plist": "^1.2.0",
- "q": "^1.4.1",
- "semver": "^5.0.1",
- "shelljs": "^0.5.3",
- "underscore": "^1.8.3",
- "unorm": "^1.3.3"
- },
- "description": "Apache Cordova tools and platforms shared routines",
- "devDependencies": {
- "istanbul": "^0.3.17",
- "jasmine-node": "^1.14.5",
- "jshint": "^2.8.0",
- "promise-matchers": "^0.9.6",
- "rewire": "^2.5.1"
- },
- "directories": {},
- "dist": {
- "shasum": "6770de0d6200ad6f94a1abe8939b5bd9ece139e3",
- "tarball": "https://registry.npmjs.org/cordova-common/-/cordova-common-1.5.1.tgz"
- },
- "engineStrict": true,
- "engines": {
- "node": ">=0.9.9"
- },
- "license": "Apache-2.0",
- "main": "cordova-common.js",
- "maintainers": [
- {
- "name": "bowserj",
- "email": "bowserj@apache.org"
- },
- {
- "name": "kotikov.vladimir",
- "email": "kotikov.vladimir@gmail.com"
- },
- {
- "name": "purplecabbage",
- "email": "purplecabbage@gmail.com"
- },
- {
- "name": "shazron",
- "email": "shazron@gmail.com"
- },
- {
- "name": "stevegill",
- "email": "stevengill97@gmail.com"
- },
- {
- "name": "timbarham",
- "email": "npmjs@barhams.info"
- }
- ],
- "name": "cordova-common",
- "optionalDependencies": {},
- "readme": "ERROR: No README data found!",
- "repository": {
- "type": "git",
- "url": "git://git-wip-us.apache.org/repos/asf/cordova-common.git"
- },
- "scripts": {
- "cover": "node node_modules/istanbul/lib/cli.js cover --root src --print detail node_modules/jasmine-node/bin/jasmine-node -- spec",
- "jasmine": "node node_modules/jasmine-node/bin/jasmine-node --captureExceptions --color spec",
- "jshint": "node node_modules/jshint/bin/jshint src && node node_modules/jshint/bin/jshint spec",
- "test": "npm run jshint && npm run jasmine"
- },
- "version": "1.5.1"
-}
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/.jshintrc b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/.jshintrc
deleted file mode 100644
index 89a121c..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/.jshintrc
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "node": true
- , "bitwise": true
- , "undef": true
- , "trailing": true
- , "quotmark": true
- , "indent": 4
- , "unused": "vars"
- , "latedef": "nofunc"
-}
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/ActionStack.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/ActionStack.js
deleted file mode 100644
index 5ef6f84..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/ActionStack.js
+++ /dev/null
@@ -1,85 +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.
-*/
-
-/* jshint quotmark:false */
-
-var events = require('./events'),
- Q = require('q');
-
-function ActionStack() {
- this.stack = [];
- this.completed = [];
-}
-
-ActionStack.prototype = {
- createAction:function(handler, action_params, reverter, revert_params) {
- return {
- handler:{
- run:handler,
- params:action_params
- },
- reverter:{
- run:reverter,
- params:revert_params
- }
- };
- },
- push:function(tx) {
- this.stack.push(tx);
- },
- // Returns a promise.
- process:function(platform) {
- events.emit('verbose', 'Beginning processing of action stack for ' + platform + ' project...');
-
- while (this.stack.length) {
- var action = this.stack.shift();
- var handler = action.handler.run;
- var action_params = action.handler.params;
-
- try {
- handler.apply(null, action_params);
- } catch(e) {
- events.emit('warn', 'Error during processing of action! Attempting to revert...');
- this.stack.unshift(action);
- var issue = 'Uh oh!\n';
- // revert completed tasks
- while(this.completed.length) {
- var undo = this.completed.shift();
- var revert = undo.reverter.run;
- var revert_params = undo.reverter.params;
-
- try {
- revert.apply(null, revert_params);
- } catch(err) {
- events.emit('warn', 'Error during reversion of action! We probably really messed up your project now, sorry! D:');
- issue += 'A reversion action failed: ' + err.message + '\n';
- }
- }
- e.message = issue + e.message;
- return Q.reject(e);
- }
- this.completed.push(action);
- }
- events.emit('verbose', 'Action stack processing complete.');
-
- return Q();
- }
-};
-
-module.exports = ActionStack;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/ConfigChanges/ConfigChanges.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/ConfigChanges/ConfigChanges.js
deleted file mode 100644
index 6a80730..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/ConfigChanges/ConfigChanges.js
+++ /dev/null
@@ -1,544 +0,0 @@
-/*
- *
- * Copyright 2013 Anis Kadri
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/*
- * This module deals with shared configuration / dependency "stuff". That is:
- * - XML configuration files such as config.xml, AndroidManifest.xml or WMAppManifest.xml.
- * - plist files in iOS
- * Essentially, any type of shared resources that we need to handle with awareness
- * of how potentially multiple plugins depend on a single shared resource, should be
- * handled in this module.
- *
- * The implementation uses an object as a hash table, with "leaves" of the table tracking
- * reference counts.
- */
-
-/* jshint sub:true */
-
-var fs = require('fs'),
- path = require('path'),
- et = require('elementtree'),
- semver = require('semver'),
- events = require('../events'),
- ConfigKeeper = require('./ConfigKeeper'),
- CordovaLogger = require('../CordovaLogger');
-
-var mungeutil = require('./munge-util');
-var xml_helpers = require('../util/xml-helpers');
-
-exports.PlatformMunger = PlatformMunger;
-
-exports.process = function(plugins_dir, project_dir, platform, platformJson, pluginInfoProvider) {
- var munger = new PlatformMunger(platform, project_dir, platformJson, pluginInfoProvider);
- munger.process(plugins_dir);
- munger.save_all();
-};
-
-/******************************************************************************
-* PlatformMunger class
-*
-* Can deal with config file of a single project.
-* Parsed config files are cached in a ConfigKeeper object.
-******************************************************************************/
-function PlatformMunger(platform, project_dir, platformJson, pluginInfoProvider) {
- this.platform = platform;
- this.project_dir = project_dir;
- this.config_keeper = new ConfigKeeper(project_dir);
- this.platformJson = platformJson;
- this.pluginInfoProvider = pluginInfoProvider;
-}
-
-// Write out all unsaved files.
-PlatformMunger.prototype.save_all = PlatformMunger_save_all;
-function PlatformMunger_save_all() {
- this.config_keeper.save_all();
- this.platformJson.save();
-}
-
-// Apply a munge object to a single config file.
-// The remove parameter tells whether to add the change or remove it.
-PlatformMunger.prototype.apply_file_munge = PlatformMunger_apply_file_munge;
-function PlatformMunger_apply_file_munge(file, munge, remove) {
- var self = this;
-
- for (var selector in munge.parents) {
- for (var xml_child in munge.parents[selector]) {
- // this xml child is new, graft it (only if config file exists)
- var config_file = self.config_keeper.get(self.project_dir, self.platform, file);
- 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]);
- }
- }
- }
-}
-
-
-PlatformMunger.prototype.remove_plugin_changes = remove_plugin_changes;
-function remove_plugin_changes(pluginInfo, is_top_level) {
- var self = this;
- var platform_config = self.platformJson.root;
- var plugin_vars = is_top_level ?
- platform_config.installed_plugins[pluginInfo.id] :
- platform_config.dependent_plugins[pluginInfo.id];
- var edit_config_changes = null;
- if(pluginInfo.getEditConfigs) {
- edit_config_changes = pluginInfo.getEditConfigs(self.platform);
- }
-
- // get config munge, aka how did this plugin change various config files
- var config_munge = self.generate_plugin_config_munge(pluginInfo, plugin_vars, edit_config_changes);
- // global munge looks at all plugins' changes to config files
- var global_munge = platform_config.config_munge;
- var munge = mungeutil.decrement_munge(global_munge, config_munge);
-
- for (var file in munge.files) {
- // CB-6976 Windows Universal Apps. Compatibility fix for existing plugins.
- if (self.platform == 'windows' && file == 'package.appxmanifest' &&
- !fs.existsSync(path.join(self.project_dir, 'package.appxmanifest'))) {
- // New windows template separate manifest files for Windows10, Windows8.1 and WP8.1
- var substs = ['package.phone.appxmanifest', 'package.windows.appxmanifest', 'package.windows10.appxmanifest'];
- /* jshint loopfunc:true */
- substs.forEach(function(subst) {
- events.emit('verbose', 'Applying munge to ' + subst);
- self.apply_file_munge(subst, munge.files[file], true);
- });
- /* jshint loopfunc:false */
- }
- self.apply_file_munge(file, munge.files[file], /* remove = */ true);
- }
-
- // Remove from installed_plugins
- self.platformJson.removePlugin(pluginInfo.id, is_top_level);
- return self;
-}
-
-
-PlatformMunger.prototype.add_plugin_changes = add_plugin_changes;
-function add_plugin_changes(pluginInfo, plugin_vars, is_top_level, should_increment, plugin_force) {
- var self = this;
- var platform_config = self.platformJson.root;
-
- var edit_config_changes = null;
- if(pluginInfo.getEditConfigs) {
- edit_config_changes = pluginInfo.getEditConfigs(self.platform);
- }
-
- var config_munge;
-
- if (!edit_config_changes || edit_config_changes.length === 0) {
- // get config munge, aka how should this plugin change various config files
- config_munge = self.generate_plugin_config_munge(pluginInfo, plugin_vars);
- }
- else {
- var isConflictingInfo = is_conflicting(edit_config_changes, platform_config.config_munge, self, plugin_force);
-
- if (isConflictingInfo.conflictWithConfigxml) {
- throw new Error(pluginInfo.id +
- ' cannot be added. changes in this plugin conflicts with changes in config.xml. Conflicts must be resolved before plugin can be added.');
- }
- if (plugin_force) {
- CordovaLogger.get().log(CordovaLogger.WARN, '--force is used. edit-config will overwrite conflicts if any. Conflicting plugins may not work as expected.');
-
- // remove conflicting munges
- var conflict_munge = mungeutil.decrement_munge(platform_config.config_munge, isConflictingInfo.conflictingMunge);
- for (var conflict_file in conflict_munge.files) {
- self.apply_file_munge(conflict_file, conflict_munge.files[conflict_file], /* remove = */ true);
- }
-
- // force add new munges
- config_munge = self.generate_plugin_config_munge(pluginInfo, plugin_vars, edit_config_changes);
- }
- else if(isConflictingInfo.conflictFound) {
- throw new Error('There was a conflict trying to modify attributes with in plugin ' + pluginInfo.id +
- '. The conflicting plugin, ' + isConflictingInfo.conflictingPlugin + ', already modified the same attributes. The conflict must be resolved before ' +
- pluginInfo.id + ' can be added. You may use --force to add the plugin and overwrite the conflicting attributes.');
- }
- else {
- // no conflicts, will handle edit-config
- config_munge = self.generate_plugin_config_munge(pluginInfo, plugin_vars, edit_config_changes);
- }
- }
-
- self = munge_helper(should_increment, self, platform_config, config_munge);
-
- // Move to installed/dependent_plugins
- self.platformJson.addPlugin(pluginInfo.id, plugin_vars || {}, is_top_level);
- return self;
-}
-
-
-// Handle edit-config changes from config.xml
-PlatformMunger.prototype.add_config_changes = add_config_changes;
-function add_config_changes(config, should_increment) {
- var self = this;
- var platform_config = self.platformJson.root;
-
- var config_munge;
- var edit_config_changes = null;
- if(config.getEditConfigs) {
- edit_config_changes = config.getEditConfigs(self.platform);
- }
-
- if (!edit_config_changes || edit_config_changes.length === 0) {
- // There are no edit-config changes to add, return here
- return self;
- }
- else {
- var isConflictingInfo = is_conflicting(edit_config_changes, platform_config.config_munge, self, true /*always force overwrite other edit-config*/);
-
- if(isConflictingInfo.conflictFound) {
- var conflict_munge;
- var conflict_file;
-
- if (Object.keys(isConflictingInfo.configxmlMunge.files).length !== 0) {
- // silently remove conflicting config.xml munges so new munges can be added
- conflict_munge = mungeutil.decrement_munge(platform_config.config_munge, isConflictingInfo.configxmlMunge);
- for (conflict_file in conflict_munge.files) {
- self.apply_file_munge(conflict_file, conflict_munge.files[conflict_file], /* remove = */ true);
- }
- }
- if (Object.keys(isConflictingInfo.conflictingMunge.files).length !== 0) {
- CordovaLogger.get().log(CordovaLogger.WARN, 'Conflict found, edit-config changes from config.xml will overwrite plugin.xml changes');
-
- // remove conflicting plugin.xml munges
- conflict_munge = mungeutil.decrement_munge(platform_config.config_munge, isConflictingInfo.conflictingMunge);
- for (conflict_file in conflict_munge.files) {
- self.apply_file_munge(conflict_file, conflict_munge.files[conflict_file], /* remove = */ true);
- }
- }
- }
- // Add config.xml edit-config munges
- config_munge = self.generate_config_xml_munge(config, edit_config_changes, 'config.xml');
- }
-
- self = munge_helper(should_increment, self, platform_config, config_munge);
-
- // Move to installed/dependent_plugins
- return self;
-}
-
-function munge_helper(should_increment, self, platform_config, config_munge) {
- // global munge looks at all changes to config files
-
- // TODO: The should_increment param is only used by cordova-cli and is going away soon.
- // If should_increment is set to false, avoid modifying the global_munge (use clone)
- // and apply the entire config_munge because it's already a proper subset of the global_munge.
- var munge, global_munge;
- if (should_increment) {
- global_munge = platform_config.config_munge;
- munge = mungeutil.increment_munge(global_munge, config_munge);
- } else {
- global_munge = mungeutil.clone_munge(platform_config.config_munge);
- munge = config_munge;
- }
-
- for (var file in munge.files) {
- // CB-6976 Windows Universal Apps. Compatibility fix for existing plugins.
- if (self.platform == 'windows' && file == 'package.appxmanifest' &&
- !fs.existsSync(path.join(self.project_dir, 'package.appxmanifest'))) {
- var substs = ['package.phone.appxmanifest', 'package.windows.appxmanifest', 'package.windows10.appxmanifest'];
- /* jshint loopfunc:true */
- substs.forEach(function(subst) {
- events.emit('verbose', 'Applying munge to ' + subst);
- self.apply_file_munge(subst, munge.files[file]);
- });
- /* jshint loopfunc:false */
- }
-
- self.apply_file_munge(file, munge.files[file]);
- }
-
- return self;
-}
-
-
-// Load the global munge from platform json and apply all of it.
-// Used by cordova prepare to re-generate some config file from platform
-// defaults and the global munge.
-PlatformMunger.prototype.reapply_global_munge = reapply_global_munge ;
-function reapply_global_munge () {
- var self = this;
-
- var platform_config = self.platformJson.root;
- var global_munge = platform_config.config_munge;
- for (var file in global_munge.files) {
- self.apply_file_munge(file, global_munge.files[file]);
- }
-
- return self;
-}
-
-// generate_plugin_config_munge
-// Generate the munge object from config.xml
-PlatformMunger.prototype.generate_config_xml_munge = generate_config_xml_munge;
-function generate_config_xml_munge(config, edit_config_changes, type) {
-
- var munge = { files: {} };
- var changes = edit_config_changes;
- var id;
-
- if(!changes) {
- return munge;
- }
-
- if (type === 'config.xml') {
- id = type;
- }
- else {
- id = config.id;
- }
-
- changes.forEach(function(change) {
- change.xmls.forEach(function(xml) {
- // 1. stringify each xml
- var stringified = (new et.ElementTree(xml)).write({xml_declaration:false});
- // 2. add into munge
- if (change.mode) {
- mungeutil.deep_add(munge, change.file, change.target, { xml: stringified, count: 1, mode: change.mode, id: id });
- }
- });
- });
- return munge;
-}
-
-
-// generate_plugin_config_munge
-// Generate the munge object from plugin.xml + vars
-PlatformMunger.prototype.generate_plugin_config_munge = generate_plugin_config_munge;
-function generate_plugin_config_munge(pluginInfo, vars, edit_config_changes) {
- var self = this;
-
- vars = vars || {};
- var munge = { files: {} };
- var changes = pluginInfo.getConfigFiles(self.platform);
-
- if(edit_config_changes) {
- Array.prototype.push.apply(changes, edit_config_changes);
- }
-
- // Demux 'package.appxmanifest' into relevant platform-specific appx manifests.
- // Only spend the cycles if there are version-specific plugin settings
- if (self.platform === 'windows' &&
- changes.some(function(change) {
- return ((typeof change.versions !== 'undefined') ||
- (typeof change.deviceTarget !== 'undefined'));
- }))
- {
- var manifests = {
- 'windows': {
- '8.1.0': 'package.windows.appxmanifest',
- '10.0.0': 'package.windows10.appxmanifest'
- },
- 'phone': {
- '8.1.0': 'package.phone.appxmanifest',
- '10.0.0': 'package.windows10.appxmanifest'
- },
- 'all': {
- '8.1.0': ['package.windows.appxmanifest', 'package.phone.appxmanifest'],
- '10.0.0': 'package.windows10.appxmanifest'
- }
- };
-
- var oldChanges = changes;
- changes = [];
-
- oldChanges.forEach(function(change, changeIndex) {
- // Only support semver/device-target demux for package.appxmanifest
- // Pass through in case something downstream wants to use it
- if (change.target !== 'package.appxmanifest') {
- changes.push(change);
- return;
- }
-
- var hasVersion = (typeof change.versions !== 'undefined');
- var hasTargets = (typeof change.deviceTarget !== 'undefined');
-
- // No semver/device-target for this config-file, pass it through
- if (!(hasVersion || hasTargets)) {
- changes.push(change);
- return;
- }
-
- var targetDeviceSet = hasTargets ? change.deviceTarget : 'all';
- if (['windows', 'phone', 'all'].indexOf(targetDeviceSet) === -1) {
- // target-device couldn't be resolved, fix it up here to a valid value
- targetDeviceSet = 'all';
- }
- var knownWindowsVersionsForTargetDeviceSet = Object.keys(manifests[targetDeviceSet]);
-
- // at this point, 'change' targets package.appxmanifest and has a version attribute
- knownWindowsVersionsForTargetDeviceSet.forEach(function(winver) {
- // This is a local function that creates the new replacement representing the
- // mutation. Used to save code further down.
- var createReplacement = function(manifestFile, originalChange) {
- var replacement = {
- target: manifestFile,
- parent: originalChange.parent,
- after: originalChange.after,
- xmls: originalChange.xmls,
- versions: originalChange.versions,
- deviceTarget: originalChange.deviceTarget
- };
- return replacement;
- };
-
- // version doesn't satisfy, so skip
- if (hasVersion && !semver.satisfies(winver, change.versions)) {
- return;
- }
-
- var versionSpecificManifests = manifests[targetDeviceSet][winver];
- if (versionSpecificManifests.constructor === Array) {
- // e.g. all['8.1.0'] === ['pkg.windows.appxmanifest', 'pkg.phone.appxmanifest']
- versionSpecificManifests.forEach(function(manifestFile) {
- changes.push(createReplacement(manifestFile, change));
- });
- }
- else {
- // versionSpecificManifests is actually a single string
- changes.push(createReplacement(versionSpecificManifests, change));
- }
- });
- });
- }
-
- changes.forEach(function(change) {
- change.xmls.forEach(function(xml) {
- // 1. stringify each xml
- var stringified = (new et.ElementTree(xml)).write({xml_declaration:false});
- // interp vars
- if (vars) {
- Object.keys(vars).forEach(function(key) {
- var regExp = new RegExp('\\$' + key, 'g');
- stringified = stringified.replace(regExp, vars[key]);
- });
- }
- // 2. add into munge
- if (change.mode) {
- if (change.mode !== 'remove') {
- mungeutil.deep_add(munge, change.file, change.target, { xml: stringified, count: 1, mode: change.mode, plugin: pluginInfo.id });
- }
- }
- else {
- mungeutil.deep_add(munge, change.target, change.parent, { xml: stringified, count: 1, after: change.after });
- }
- });
- });
- return munge;
-}
-
-function is_conflicting(editchanges, config_munge, self, force) {
- var files = config_munge.files;
- var conflictFound = false;
- var conflictWithConfigxml = false;
- var conflictingMunge = { files: {} };
- var configxmlMunge = { files: {} };
- var conflictingParent;
- var conflictingPlugin;
-
- editchanges.forEach(function(editchange) {
- if (files[editchange.file]) {
- var parents = files[editchange.file].parents;
- var target = parents[editchange.target];
-
- // Check if the edit target will resolve to an existing target
- if (!target || target.length === 0) {
- var file_xml = self.config_keeper.get(self.project_dir, self.platform, editchange.file).data;
- var resolveEditTarget = xml_helpers.resolveParent(file_xml, editchange.target);
- var resolveTarget;
-
- if (resolveEditTarget) {
- for (var parent in parents) {
- resolveTarget = xml_helpers.resolveParent(file_xml, parent);
- if (resolveEditTarget === resolveTarget) {
- conflictingParent = parent;
- target = parents[parent];
- break;
- }
- }
- }
- }
- else {
- conflictingParent = editchange.target;
- }
-
- if (target && target.length !== 0) {
- // conflict has been found
- conflictFound = true;
-
- if (editchange.id === 'config.xml') {
- if (target[0].id === 'config.xml') {
- // Keep track of config.xml/config.xml edit-config conflicts
- mungeutil.deep_add(configxmlMunge, editchange.file, conflictingParent, target[0]);
- }
- else {
- // Keep track of config.xml x plugin.xml edit-config conflicts
- mungeutil.deep_add(conflictingMunge, editchange.file, conflictingParent, target[0]);
- }
- }
- else {
- if (target[0].id === 'config.xml') {
- // plugin.xml cannot overwrite config.xml changes even if --force is used
- conflictWithConfigxml = true;
- return;
- }
-
- if (force) {
- // Need to find all conflicts when --force is used, track conflicting munges
- mungeutil.deep_add(conflictingMunge, editchange.file, conflictingParent, target[0]);
- }
- else {
- // plugin cannot overwrite other plugin changes without --force
- conflictingPlugin = target[0].plugin;
- return;
- }
- }
- }
- }
- });
-
- return {conflictFound: conflictFound, conflictingPlugin: conflictingPlugin, conflictingMunge: conflictingMunge,
- configxmlMunge: configxmlMunge, conflictWithConfigxml:conflictWithConfigxml};
-}
-
-// Go over the prepare queue and apply the config munges for each plugin
-// that has been (un)installed.
-PlatformMunger.prototype.process = PlatformMunger_process;
-function PlatformMunger_process(plugins_dir) {
- var self = this;
- var platform_config = self.platformJson.root;
-
- // Uninstallation first
- platform_config.prepare_queue.uninstalled.forEach(function(u) {
- var pluginInfo = self.pluginInfoProvider.get(path.join(plugins_dir, u.plugin));
- self.remove_plugin_changes(pluginInfo, u.topLevel);
- });
-
- // Now handle installation
- platform_config.prepare_queue.installed.forEach(function(u) {
- var pluginInfo = self.pluginInfoProvider.get(path.join(plugins_dir, u.plugin));
- self.add_plugin_changes(pluginInfo, u.vars, u.topLevel, true, u.force);
- });
-
- // Empty out installed/ uninstalled queues.
- platform_config.prepare_queue.uninstalled = [];
- platform_config.prepare_queue.installed = [];
-}
-/**** END of PlatformMunger ****/
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/ConfigChanges/ConfigFile.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/ConfigChanges/ConfigFile.js
deleted file mode 100644
index 4a58008..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/ConfigChanges/ConfigFile.js
+++ /dev/null
@@ -1,240 +0,0 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var fs = require('fs');
-var path = require('path');
-
-var modules = {};
-var addProperty = require('../util/addProperty');
-
-// Use delay loading to ensure plist and other node modules to not get loaded
-// on Android, Windows platforms
-addProperty(module, 'bplist', 'bplist-parser', modules);
-addProperty(module, 'et', 'elementtree', modules);
-addProperty(module, 'glob', 'glob', modules);
-addProperty(module, 'plist', 'plist', modules);
-addProperty(module, 'plist_helpers', '../util/plist-helpers', modules);
-addProperty(module, 'xml_helpers', '../util/xml-helpers', modules);
-
-/******************************************************************************
-* ConfigFile class
-*
-* Can load and keep various types of config files. Provides some functionality
-* specific to some file types such as grafting XML children. In most cases it
-* should be instantiated by ConfigKeeper.
-*
-* For plugin.xml files use as:
-* plugin_config = self.config_keeper.get(plugin_dir, '', 'plugin.xml');
-*
-* TODO: Consider moving it out to a separate file and maybe partially with
-* overrides in platform handlers.
-******************************************************************************/
-function ConfigFile(project_dir, platform, file_tag) {
- this.project_dir = project_dir;
- this.platform = platform;
- this.file_tag = file_tag;
- this.is_changed = false;
-
- this.load();
-}
-
-// ConfigFile.load()
-ConfigFile.prototype.load = ConfigFile_load;
-function ConfigFile_load() {
- var self = this;
-
- // config file may be in a place not exactly specified in the target
- var filepath = self.filepath = resolveConfigFilePath(self.project_dir, self.platform, self.file_tag);
-
- if ( !filepath || !fs.existsSync(filepath) ) {
- self.exists = false;
- return;
- }
- self.exists = true;
- self.mtime = fs.statSync(self.filepath).mtime;
-
- 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') {
- self.type = 'xml';
- self.data = modules.xml_helpers.parseElementtreeSync(filepath);
- } else {
- // plist file
- self.type = 'plist';
- // TODO: isBinaryPlist() reads the file and then parse re-reads it again.
- // We always write out text plist, not binary.
- // 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.plist.parse(fs.readFileSync(filepath, 'utf8'));
- }
-}
-
-ConfigFile.prototype.save = function ConfigFile_save() {
- var self = this;
- if (self.type === 'xml') {
- fs.writeFileSync(self.filepath, self.data.write({indent: 4}), 'utf-8');
- } else {
- // plist
- var regExp = new RegExp('[ \t\r\n]+? ', 'g');
- fs.writeFileSync(self.filepath, modules.plist.build(self.data).replace(regExp, ' '));
- }
- self.is_changed = false;
-};
-
-ConfigFile.prototype.graft_child = function ConfigFile_graft_child(selector, xml_child) {
- var self = this;
- var filepath = self.filepath;
- var result;
- if (self.type === 'xml') {
- var xml_to_graft = [modules.et.XML(xml_child.xml)];
- switch (xml_child.mode) {
- case 'merge':
- result = modules.xml_helpers.graftXMLMerge(self.data, xml_to_graft, selector, xml_child);
- break;
- case 'overwrite':
- result = modules.xml_helpers.graftXMLOverwrite(self.data, xml_to_graft, selector, xml_child);
- break;
- case 'remove':
- result= true;
- break;
- default:
- result = modules.xml_helpers.graftXML(self.data, xml_to_graft, selector, xml_child.after);
- }
- if ( !result) {
- throw new Error('Unable to graft xml at selector "' + selector + '" from "' + filepath + '" during config install');
- }
- } else {
- // plist file
- result = modules.plist_helpers.graftPLIST(self.data, xml_child.xml, selector);
- if ( !result ) {
- throw new Error('Unable to graft plist "' + filepath + '" during config install');
- }
- }
- self.is_changed = true;
-};
-
-ConfigFile.prototype.prune_child = function ConfigFile_prune_child(selector, xml_child) {
- var self = this;
- var filepath = self.filepath;
- var result;
- if (self.type === 'xml') {
- var xml_to_graft = [modules.et.XML(xml_child.xml)];
- switch (xml_child.mode) {
- case 'merge':
- case 'overwrite':
- result = modules.xml_helpers.pruneXMLRestore(self.data, selector, xml_child);
- break;
- case 'remove':
- result = modules.xml_helpers.prunXMLRemove(self.data, selector, xml_to_graft);
- break;
- default:
- result = modules.xml_helpers.pruneXML(self.data, xml_to_graft, selector);
- }
- } else {
- // plist file
- result = modules.plist_helpers.prunePLIST(self.data, xml_child.xml, selector);
- }
- if (!result) {
- var err_msg = 'Pruning at selector "' + selector + '" from "' + filepath + '" went bad.';
- throw new Error(err_msg);
- }
- self.is_changed = true;
-};
-
-// Some config-file target attributes are not qualified with a full leading directory, or contain wildcards.
-// Resolve to a real path in this function.
-// TODO: getIOSProjectname is slow because of glob, try to avoid calling it several times per project.
-function resolveConfigFilePath(project_dir, platform, file) {
- var filepath = path.join(project_dir, file);
- var matches;
-
- if (file.indexOf('*') > -1) {
- // handle wildcards in targets using glob.
- matches = modules.glob.sync(path.join(project_dir, '**', file));
- if (matches.length) filepath = matches[0];
-
- // [CB-5989] multiple Info.plist files may exist. default to $PROJECT_NAME-Info.plist
- if(matches.length > 1 && file.indexOf('-Info.plist')>-1){
- var plistName = getIOSProjectname(project_dir)+'-Info.plist';
- for (var i=0; i < matches.length; i++) {
- if(matches[i].indexOf(plistName) > -1){
- filepath = matches[i];
- break;
- }
- }
- }
- return filepath;
- }
-
- // special-case config.xml target that is just "config.xml". This should be resolved to the real location of the file.
- // TODO: move the logic that contains the locations of config.xml from cordova CLI into plugman.
- if (file == 'config.xml') {
- if (platform == 'ubuntu') {
- filepath = path.join(project_dir, 'config.xml');
- } else if (platform == 'ios') {
- var iospath = getIOSProjectname(project_dir);
- filepath = path.join(project_dir,iospath, 'config.xml');
- } else if (platform == 'android') {
- filepath = path.join(project_dir, 'res', 'xml', 'config.xml');
- } else {
- matches = modules.glob.sync(path.join(project_dir, '**', 'config.xml'));
- if (matches.length) filepath = matches[0];
- }
- return filepath;
- }
-
- // XXX this checks for android studio projects
- // only if none of the options above are satisfied does this get called
- if(platform === 'android' && !fs.existsSync(filepath)) {
- filepath = path.join(project_dir, 'app', 'src', 'main', 'res', 'xml', 'config.xml');
- }
-
- // None of the special cases matched, returning project_dir/file.
- return filepath;
-}
-
-// Find out the real name of an iOS project
-// TODO: glob is slow, need a better way or caching, or avoid using more than once.
-function getIOSProjectname(project_dir) {
- var matches = modules.glob.sync(path.join(project_dir, '*.xcodeproj'));
- var iospath;
- if (matches.length === 1) {
- iospath = path.basename(matches[0],'.xcodeproj');
- } else {
- var msg;
- if (matches.length === 0) {
- msg = 'Does not appear to be an xcode project, no xcode project file in ' + project_dir;
- } else {
- msg = 'There are multiple *.xcodeproj dirs in ' + project_dir;
- }
- throw new Error(msg);
- }
- return iospath;
-}
-
-// determine if a plist file is binary
-function isBinaryPlist(filename) {
- // I wish there was a synchronous way to read only the first 6 bytes of a
- // file. This is wasteful :/
- var buf = '' + fs.readFileSync(filename, 'utf8');
- // binary plists start with a magic header, "bplist"
- return buf.substring(0, 6) === 'bplist';
-}
-
-module.exports = ConfigFile;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/ConfigChanges/ConfigKeeper.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/ConfigChanges/ConfigKeeper.js
deleted file mode 100644
index 894e922..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/ConfigChanges/ConfigKeeper.js
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-/* jshint sub:true */
-
-var path = require('path');
-var ConfigFile = require('./ConfigFile');
-
-/******************************************************************************
-* ConfigKeeper class
-*
-* Used to load and store config files to avoid re-parsing and writing them out
-* multiple times.
-*
-* The config files are referred to by a fake path constructed as
-* project_dir/platform/file
-* where file is the name used for the file in config munges.
-******************************************************************************/
-function ConfigKeeper(project_dir, plugins_dir) {
- this.project_dir = project_dir;
- this.plugins_dir = plugins_dir;
- this._cached = {};
-}
-
-ConfigKeeper.prototype.get = function ConfigKeeper_get(project_dir, platform, file) {
- var self = this;
-
- // This fixes a bug with older plugins - when specifying config xml instead of res/xml/config.xml
- // https://issues.apache.org/jira/browse/CB-6414
- if(file == 'config.xml' && platform == 'android'){
- file = 'res/xml/config.xml';
- }
- var fake_path = path.join(project_dir, platform, file);
-
- if (self._cached[fake_path]) {
- return self._cached[fake_path];
- }
- // File was not cached, need to load.
- var config_file = new ConfigFile(project_dir, platform, file);
- self._cached[fake_path] = config_file;
- return config_file;
-};
-
-
-ConfigKeeper.prototype.save_all = function ConfigKeeper_save_all() {
- var self = this;
- Object.keys(self._cached).forEach(function (fake_path) {
- var config_file = self._cached[fake_path];
- if (config_file.is_changed) config_file.save();
- });
-};
-
-module.exports = ConfigKeeper;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/ConfigChanges/munge-util.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/ConfigChanges/munge-util.js
deleted file mode 100644
index 0149bab..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/ConfigChanges/munge-util.js
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-/* jshint sub:true */
-
-var _ = require('underscore');
-
-// add the count of [key1][key2]...[keyN] to obj
-// return true if it didn't exist before
-exports.deep_add = function deep_add(obj, keys /* or key1, key2 .... */ ) {
- if ( !Array.isArray(keys) ) {
- keys = Array.prototype.slice.call(arguments, 1);
- }
-
- return exports.process_munge(obj, true/*createParents*/, function (parentArray, k) {
- var found = _.find(parentArray, function(element) {
- return element.xml == k.xml;
- });
- if (found) {
- found.after = found.after || k.after;
- found.count += k.count;
- } else {
- parentArray.push(k);
- }
- return !found;
- }, keys);
-};
-
-// decrement the count of [key1][key2]...[keyN] from obj and remove if it reaches 0
-// return true if it was removed or not found
-exports.deep_remove = function deep_remove(obj, keys /* or key1, key2 .... */ ) {
- if ( !Array.isArray(keys) ) {
- keys = Array.prototype.slice.call(arguments, 1);
- }
-
- var result = exports.process_munge(obj, false/*createParents*/, function (parentArray, k) {
- var index = -1;
- var found = _.find(parentArray, function (element) {
- index++;
- return element.xml == k.xml;
- });
- if (found) {
- if (parentArray[index].oldAttrib) {
- k.oldAttrib = _.extend({}, parentArray[index].oldAttrib);
- }
- found.count -= k.count;
- if (found.count > 0) {
- return false;
- }
- else {
- parentArray.splice(index, 1);
- }
- }
- return undefined;
- }, keys);
-
- return typeof result === 'undefined' ? true : result;
-};
-
-// search for [key1][key2]...[keyN]
-// return the object or undefined if not found
-exports.deep_find = function deep_find(obj, keys /* or key1, key2 .... */ ) {
- if ( !Array.isArray(keys) ) {
- keys = Array.prototype.slice.call(arguments, 1);
- }
-
- return exports.process_munge(obj, false/*createParents?*/, function (parentArray, k) {
- return _.find(parentArray, function (element) {
- return element.xml == (k.xml || k);
- });
- }, keys);
-};
-
-// Execute func passing it the parent array and the xmlChild key.
-// When createParents is true, add the file and parent items they are missing
-// When createParents is false, stop and return undefined if the file and/or parent items are missing
-
-exports.process_munge = function process_munge(obj, createParents, func, keys /* or key1, key2 .... */ ) {
- if ( !Array.isArray(keys) ) {
- keys = Array.prototype.slice.call(arguments, 1);
- }
- var k = keys[0];
- if (keys.length == 1) {
- return func(obj, k);
- } else if (keys.length == 2) {
- if (!obj.parents[k] && !createParents) {
- return undefined;
- }
- obj.parents[k] = obj.parents[k] || [];
- return exports.process_munge(obj.parents[k], createParents, func, keys.slice(1));
- } else if (keys.length == 3){
- if (!obj.files[k] && !createParents) {
- return undefined;
- }
- obj.files[k] = obj.files[k] || { parents: {} };
- return exports.process_munge(obj.files[k], createParents, func, keys.slice(1));
- } else {
- throw new Error('Invalid key format. Must contain at most 3 elements (file, parent, xmlChild).');
- }
-};
-
-// All values from munge are added to base as
-// base[file][selector][child] += munge[file][selector][child]
-// Returns a munge object containing values that exist in munge
-// but not in base.
-exports.increment_munge = function increment_munge(base, munge) {
- var diff = { files: {} };
-
- for (var file in munge.files) {
- for (var selector in munge.files[file].parents) {
- for (var xml_child in munge.files[file].parents[selector]) {
- var val = munge.files[file].parents[selector][xml_child];
- // if node not in base, add it to diff and base
- // else increment it's value in base without adding to diff
- var newlyAdded = exports.deep_add(base, [file, selector, val]);
- if (newlyAdded) {
- exports.deep_add(diff, file, selector, val);
- }
- }
- }
- }
- return diff;
-};
-
-// Update the base munge object as
-// base[file][selector][child] -= munge[file][selector][child]
-// nodes that reached zero value are removed from base and added to the returned munge
-// object.
-exports.decrement_munge = function decrement_munge(base, munge) {
- var zeroed = { files: {} };
-
- for (var file in munge.files) {
- for (var selector in munge.files[file].parents) {
- for (var xml_child in munge.files[file].parents[selector]) {
- var val = munge.files[file].parents[selector][xml_child];
- // if node not in base, add it to diff and base
- // else increment it's value in base without adding to diff
- var removed = exports.deep_remove(base, [file, selector, val]);
- if (removed) {
- exports.deep_add(zeroed, file, selector, val);
- }
- }
- }
- }
- return zeroed;
-};
-
-// For better readability where used
-exports.clone_munge = function clone_munge(munge) {
- return exports.increment_munge({}, munge);
-};
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/ConfigParser/ConfigParser.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/ConfigParser/ConfigParser.js
deleted file mode 100644
index 6e74ce3..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/ConfigParser/ConfigParser.js
+++ /dev/null
@@ -1,544 +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.
-*/
-
-/* jshint sub:true */
-
-var et = require('elementtree'),
- xml= require('../util/xml-helpers'),
- CordovaError = require('../CordovaError/CordovaError'),
- fs = require('fs'),
- events = require('../events');
-
-
-/** Wraps a config.xml file */
-function ConfigParser(path) {
- this.path = path;
- try {
- this.doc = xml.parseElementtreeSync(path);
- this.cdvNamespacePrefix = getCordovaNamespacePrefix(this.doc);
- et.register_namespace(this.cdvNamespacePrefix, 'http://cordova.apache.org/ns/1.0');
- } catch (e) {
- console.error('Parsing '+path+' failed');
- throw e;
- }
- var r = this.doc.getroot();
- if (r.tag !== 'widget') {
- throw new CordovaError(path + ' has incorrect root node name (expected "widget", was "' + r.tag + '")');
- }
-}
-
-function getNodeTextSafe(el) {
- return el && el.text && el.text.trim();
-}
-
-function findOrCreate(doc, name) {
- var ret = doc.find(name);
- if (!ret) {
- ret = new et.Element(name);
- doc.getroot().append(ret);
- }
- return ret;
-}
-
-function getCordovaNamespacePrefix(doc){
- var rootAtribs = Object.getOwnPropertyNames(doc.getroot().attrib);
- var prefix = 'cdv';
- for (var j = 0; j < rootAtribs.length; j++ ) {
- if(rootAtribs[j].indexOf('xmlns:') === 0 &&
- doc.getroot().attrib[rootAtribs[j]] === 'http://cordova.apache.org/ns/1.0'){
- var strings = rootAtribs[j].split(':');
- prefix = strings[1];
- break;
- }
- }
- return prefix;
-}
-
-/**
- * Finds the value of an element's attribute
- * @param {String} attributeName Name of the attribute to search for
- * @param {Array} elems An array of ElementTree nodes
- * @return {String}
- */
-function findElementAttributeValue(attributeName, elems) {
-
- elems = Array.isArray(elems) ? elems : [ elems ];
-
- var value = elems.filter(function (elem) {
- return elem.attrib.name.toLowerCase() === attributeName.toLowerCase();
- }).map(function (filteredElems) {
- return filteredElems.attrib.value;
- }).pop();
-
- return value ? value : '';
-}
-
-ConfigParser.prototype = {
- getAttribute: function(attr) {
- return this.doc.getroot().attrib[attr];
- },
-
- packageName: function(id) {
- return this.getAttribute('id');
- },
- setPackageName: function(id) {
- this.doc.getroot().attrib['id'] = id;
- },
- android_packageName: function() {
- return this.getAttribute('android-packageName');
- },
- android_activityName: function() {
- return this.getAttribute('android-activityName');
- },
- ios_CFBundleIdentifier: function() {
- return this.getAttribute('ios-CFBundleIdentifier');
- },
- name: function() {
- return getNodeTextSafe(this.doc.find('name'));
- },
- setName: function(name) {
- var el = findOrCreate(this.doc, 'name');
- el.text = name;
- },
- description: function() {
- return getNodeTextSafe(this.doc.find('description'));
- },
- setDescription: function(text) {
- var el = findOrCreate(this.doc, 'description');
- el.text = text;
- },
- version: function() {
- return this.getAttribute('version');
- },
- windows_packageVersion: function() {
- return this.getAttribute('windows-packageVersion');
- },
- android_versionCode: function() {
- return this.getAttribute('android-versionCode');
- },
- ios_CFBundleVersion: function() {
- return this.getAttribute('ios-CFBundleVersion');
- },
- setVersion: function(value) {
- this.doc.getroot().attrib['version'] = value;
- },
- author: function() {
- return getNodeTextSafe(this.doc.find('author'));
- },
- getGlobalPreference: function (name) {
- return findElementAttributeValue(name, this.doc.findall('preference'));
- },
- setGlobalPreference: function (name, value) {
- var pref = this.doc.find('preference[@name="' + name + '"]');
- if (!pref) {
- pref = new et.Element('preference');
- pref.attrib.name = name;
- this.doc.getroot().append(pref);
- }
- pref.attrib.value = value;
- },
- getPlatformPreference: function (name, platform) {
- return findElementAttributeValue(name, this.doc.findall('platform[@name=\'' + platform + '\']/preference'));
- },
- getPreference: function(name, platform) {
-
- var platformPreference = '';
-
- if (platform) {
- platformPreference = this.getPlatformPreference(name, platform);
- }
-
- return platformPreference ? platformPreference : this.getGlobalPreference(name);
-
- },
- /**
- * Returns all resources for the platform specified.
- * @param {String} platform The platform.
- * @param {string} resourceName Type of static resources to return.
- * "icon" and "splash" currently supported.
- * @return {Array} Resources for the platform specified.
- */
- getStaticResources: function(platform, resourceName) {
- var ret = [],
- staticResources = [];
- if (platform) { // platform specific icons
- this.doc.findall('platform[@name=\'' + platform + '\']/' + resourceName).forEach(function(elt){
- elt.platform = platform; // mark as platform specific resource
- staticResources.push(elt);
- });
- }
- // root level resources
- staticResources = staticResources.concat(this.doc.findall(resourceName));
- // parse resource elements
- var that = this;
- staticResources.forEach(function (elt) {
- var res = {};
- res.src = elt.attrib.src;
- res.target = elt.attrib.target || undefined;
- res.density = elt.attrib['density'] || elt.attrib[that.cdvNamespacePrefix+':density'] || elt.attrib['gap:density'];
- res.platform = elt.platform || null; // null means icon represents default icon (shared between platforms)
- res.width = +elt.attrib.width || undefined;
- res.height = +elt.attrib.height || undefined;
-
- // default icon
- if (!res.width && !res.height && !res.density) {
- ret.defaultResource = res;
- }
- ret.push(res);
- });
-
- /**
- * Returns resource with specified width and/or height.
- * @param {number} width Width of resource.
- * @param {number} height Height of resource.
- * @return {Resource} Resource object or null if not found.
- */
- ret.getBySize = function(width, height) {
- return ret.filter(function(res) {
- if (!res.width && !res.height) {
- return false;
- }
- return ((!res.width || (width == res.width)) &&
- (!res.height || (height == res.height)));
- })[0] || null;
- };
-
- /**
- * Returns resource with specified density.
- * @param {string} density Density of resource.
- * @return {Resource} Resource object or null if not found.
- */
- ret.getByDensity = function(density) {
- return ret.filter(function(res) {
- return res.density == density;
- })[0] || null;
- };
-
- /** Returns default icons */
- ret.getDefault = function() {
- return ret.defaultResource;
- };
-
- return ret;
- },
-
- /**
- * Returns all icons for specific platform.
- * @param {string} platform Platform name
- * @return {Resource[]} Array of icon objects.
- */
- getIcons: function(platform) {
- return this.getStaticResources(platform, 'icon');
- },
-
- /**
- * Returns all splash images for specific platform.
- * @param {string} platform Platform name
- * @return {Resource[]} Array of Splash objects.
- */
- getSplashScreens: function(platform) {
- return this.getStaticResources(platform, 'splash');
- },
-
- /**
- * Returns all hook scripts for the hook type specified.
- * @param {String} hook The hook type.
- * @param {Array} platforms Platforms to look for scripts into (root scripts will be included as well).
- * @return {Array} Script elements.
- */
- getHookScripts: function(hook, platforms) {
- var self = this;
- var scriptElements = self.doc.findall('./hook');
-
- if(platforms) {
- platforms.forEach(function (platform) {
- scriptElements = scriptElements.concat(self.doc.findall('./platform[@name="' + platform + '"]/hook'));
- });
- }
-
- function filterScriptByHookType(el) {
- return el.attrib.src && el.attrib.type && el.attrib.type.toLowerCase() === hook;
- }
-
- return scriptElements.filter(filterScriptByHookType);
- },
- /**
- * Returns a list of plugin (IDs).
- *
- * This function also returns any plugin's that
- * were defined using the legacy tags.
- * @return {string[]} Array of plugin IDs
- */
- getPluginIdList: function () {
- var plugins = this.doc.findall('plugin');
- var result = plugins.map(function(plugin){
- return plugin.attrib.name;
- });
- var features = this.doc.findall('feature');
- features.forEach(function(element ){
- var idTag = element.find('./param[@name="id"]');
- if(idTag){
- result.push(idTag.attrib.value);
- }
- });
- return result;
- },
- getPlugins: function () {
- return this.getPluginIdList().map(function (pluginId) {
- return this.getPlugin(pluginId);
- }, this);
- },
- /**
- * Adds a plugin element. Does not check for duplicates.
- * @name addPlugin
- * @function
- * @param {object} attributes name and spec are supported
- * @param {Array|object} variables name, value or arbitary object
- */
- addPlugin: function (attributes, variables) {
- if (!attributes && !attributes.name) return;
- var el = new et.Element('plugin');
- el.attrib.name = attributes.name;
- if (attributes.spec) {
- el.attrib.spec = attributes.spec;
- }
-
- // support arbitrary object as variables source
- if (variables && typeof variables === 'object' && !Array.isArray(variables)) {
- variables = Object.keys(variables)
- .map(function (variableName) {
- return {name: variableName, value: variables[variableName]};
- });
- }
-
- if (variables) {
- variables.forEach(function (variable) {
- el.append(new et.Element('variable', { name: variable.name, value: variable.value }));
- });
- }
- this.doc.getroot().append(el);
- },
- /**
- * Retrives the plugin with the given id or null if not found.
- *
- * This function also returns any plugin's that
- * were defined using the legacy tags.
- * @name getPlugin
- * @function
- * @param {String} id
- * @returns {object} plugin including any variables
- */
- getPlugin: function(id){
- if(!id){
- return undefined;
- }
- var pluginElement = this.doc.find('./plugin/[@name="' + id + '"]');
- if (null === pluginElement) {
- var legacyFeature = this.doc.find('./feature/param[@name="id"][@value="' + id + '"]/..');
- if(legacyFeature){
- events.emit('log', 'Found deprecated feature entry for ' + id +' in config.xml.');
- return featureToPlugin(legacyFeature);
- }
- return undefined;
- }
- var plugin = {};
-
- plugin.name = pluginElement.attrib.name;
- plugin.spec = pluginElement.attrib.spec || pluginElement.attrib.src || pluginElement.attrib.version;
- plugin.variables = {};
- var variableElements = pluginElement.findall('variable');
- variableElements.forEach(function(varElement){
- var name = varElement.attrib.name;
- var value = varElement.attrib.value;
- if(name){
- plugin.variables[name] = value;
- }
- });
- return plugin;
- },
- /**
- * Remove the plugin entry with give name (id).
- *
- * This function also operates on any plugin's that
- * were defined using the legacy tags.
- * @name removePlugin
- * @function
- * @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);
- }
- });
- }
- },
-
- // Add any element to the root
- addElement: function(name, attributes) {
- var el = et.Element(name);
- for (var a in attributes) {
- el.attrib[a] = attributes[a];
- }
- this.doc.getroot().append(el);
- },
-
- /**
- * Adds an engine. Does not check for duplicates.
- * @param {String} name the engine name
- * @param {String} spec engine source location or version (optional)
- */
- addEngine: function(name, spec){
- if(!name) return;
- var el = et.Element('engine');
- el.attrib.name = name;
- if(spec){
- el.attrib.spec = spec;
- }
- this.doc.getroot().append(el);
- },
- /**
- * Removes all the engines with given name
- * @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);
- }
- }
- },
- getEngines: function(){
- var engines = this.doc.findall('./engine');
- return engines.map(function(engine){
- var spec = engine.attrib.spec || engine.attrib.version;
- return {
- 'name': engine.attrib.name,
- 'spec': spec ? spec : null
- };
- });
- },
- /* Get all the access tags */
- getAccesses: function() {
- var accesses = this.doc.findall('./access');
- return accesses.map(function(access){
- var minimum_tls_version = access.attrib['minimum-tls-version']; /* String */
- var requires_forward_secrecy = access.attrib['requires-forward-secrecy']; /* Boolean */
- var requires_certificate_transparency = access.attrib['requires-certificate-transparency']; /* Boolean */
- var allows_arbitrary_loads_in_web_content = access.attrib['allows-arbitrary-loads-in-web-content']; /* Boolean */
- var allows_arbitrary_loads_in_media = access.attrib['allows-arbitrary-loads-in-media']; /* Boolean */
- var allows_local_networking = access.attrib['allows-local-networking']; /* Boolean */
-
- return {
- 'origin': access.attrib.origin,
- 'minimum_tls_version': minimum_tls_version,
- 'requires_forward_secrecy' : requires_forward_secrecy,
- 'requires_certificate_transparency' : requires_certificate_transparency,
- 'allows_arbitrary_loads_in_web_content' : allows_arbitrary_loads_in_web_content,
- 'allows_arbitrary_loads_in_media' : allows_arbitrary_loads_in_media,
- 'allows_local_networking' : allows_local_networking
- };
- });
- },
- /* Get all the allow-navigation tags */
- getAllowNavigations: function() {
- var allow_navigations = this.doc.findall('./allow-navigation');
- return allow_navigations.map(function(allow_navigation){
- var minimum_tls_version = allow_navigation.attrib['minimum-tls-version']; /* String */
- var requires_forward_secrecy = allow_navigation.attrib['requires-forward-secrecy']; /* Boolean */
- var requires_certificate_transparency = allow_navigation.attrib['requires-certificate-transparency']; /* Boolean */
-
- return {
- 'href': allow_navigation.attrib.href,
- 'minimum_tls_version': minimum_tls_version,
- 'requires_forward_secrecy' : requires_forward_secrecy,
- 'requires_certificate_transparency' : requires_certificate_transparency
- };
- });
- },
- /* Get all the allow-intent tags */
- getAllowIntents: function() {
- var allow_intents = this.doc.findall('./allow-intent');
- return allow_intents.map(function(allow_intent){
- return {
- 'href': allow_intent.attrib.href
- };
- });
- },
- /* 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 edit_configs = this.doc.findall('edit-config').concat(platform_edit_configs);
-
- return edit_configs.map(function(tag) {
- var editConfig =
- {
- file : tag.attrib['file'],
- target : tag.attrib['target'],
- mode : tag.attrib['mode'],
- id : 'config.xml',
- xmls : tag.getchildren()
- };
- return editConfig;
- });
- },
- write:function() {
- fs.writeFileSync(this.path, this.doc.write({indent: 4}), 'utf-8');
- }
-};
-
-function featureToPlugin(featureElement) {
- var plugin = {};
- plugin.variables = [];
- var pluginVersion,
- pluginSrc;
-
- var nodes = featureElement.findall('param');
- nodes.forEach(function (element) {
- var n = element.attrib.name;
- var v = element.attrib.value;
- if (n === 'id') {
- plugin.name = v;
- } else if (n === 'version') {
- pluginVersion = v;
- } else if (n === 'url' || n === 'installPath') {
- pluginSrc = v;
- } else {
- plugin.variables[n] = v;
- }
- });
-
- var spec = pluginSrc || pluginVersion;
- if (spec) {
- plugin.spec = spec;
- }
-
- return plugin;
-}
-module.exports = ConfigParser;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/ConfigParser/README.md b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/ConfigParser/README.md
deleted file mode 100644
index e5cd1bf..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/ConfigParser/README.md
+++ /dev/null
@@ -1,86 +0,0 @@
-
-
-# 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);
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/CordovaCheck.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/CordovaCheck.js
deleted file mode 100644
index 46e733f..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/CordovaCheck.js
+++ /dev/null
@@ -1,76 +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.
-*/
-
-var fs = require('fs'),
- path = require('path');
-
-function isRootDir(dir) {
- if (fs.existsSync(path.join(dir, 'www'))) {
- if (fs.existsSync(path.join(dir, 'config.xml'))) {
- // For sure is.
- if (fs.existsSync(path.join(dir, 'platforms'))) {
- return 2;
- } else {
- return 1;
- }
- }
- // Might be (or may be under platforms/).
- if (fs.existsSync(path.join(dir, 'www', 'config.xml'))) {
- return 1;
- }
- }
- return 0;
-}
-
-// Runs up the directory chain looking for a .cordova directory.
-// IF it is found we are in a Cordova project.
-// Omit argument to use CWD.
-function isCordova(dir) {
- if (!dir) {
- // Prefer PWD over cwd so that symlinked dirs within your PWD work correctly (CB-5687).
- var pwd = process.env.PWD;
- var cwd = process.cwd();
- if (pwd && pwd != cwd && pwd != 'undefined') {
- return isCordova(pwd) || isCordova(cwd);
- }
- return isCordova(cwd);
- }
- var bestReturnValueSoFar = false;
- for (var i = 0; i < 1000; ++i) {
- var result = isRootDir(dir);
- if (result === 2) {
- return dir;
- }
- if (result === 1) {
- bestReturnValueSoFar = dir;
- }
- var parentDir = path.normalize(path.join(dir, '..'));
- // Detect fs root.
- if (parentDir == dir) {
- return bestReturnValueSoFar;
- }
- dir = parentDir;
- }
- console.error('Hit an unhandled case in CordovaCheck.isCordova');
- return false;
-}
-
-module.exports = {
- findProjectRoot : isCordova
-};
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/CordovaError/CordovaError.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/CordovaError/CordovaError.js
deleted file mode 100644
index 7262448..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/CordovaError/CordovaError.js
+++ /dev/null
@@ -1,91 +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.
-*/
-
-/* jshint proto:true */
-
-var EOL = require('os').EOL;
-
-/**
- * A derived exception class. See usage example in cli.js
- * Based on:
- * stackoverflow.com/questions/1382107/whats-a-good-way-to-extend-error-in-javascript/8460753#8460753
- * @param {String} message Error message
- * @param {Number} [code=0] Error code
- * @param {CordovaExternalToolErrorContext} [context] External tool error context object
- * @constructor
- */
-function CordovaError(message, code, context) {
- Error.captureStackTrace(this, this.constructor);
- this.name = this.constructor.name;
- this.message = message;
- this.code = code || CordovaError.UNKNOWN_ERROR;
- this.context = context;
-}
-CordovaError.prototype.__proto__ = Error.prototype;
-
-// TODO: Extend error codes according the projects specifics
-CordovaError.UNKNOWN_ERROR = 0;
-CordovaError.EXTERNAL_TOOL_ERROR = 1;
-
-/**
- * Translates instance's error code number into error code name, e.g. 0 -> UNKNOWN_ERROR
- * @returns {string} Error code string name
- */
-CordovaError.prototype.getErrorCodeName = function() {
- for(var key in CordovaError) {
- if(CordovaError.hasOwnProperty(key)) {
- if(CordovaError[key] === this.code) {
- return key;
- }
- }
- }
-};
-
-/**
- * Converts CordovaError instance to string representation
- * @param {Boolean} [isVerbose] Set up verbose mode. Used to provide more
- * details including information about error code name and context
- * @return {String} Stringified error representation
- */
-CordovaError.prototype.toString = function(isVerbose) {
- var message = '', codePrefix = '';
-
- if(this.code !== CordovaError.UNKNOWN_ERROR) {
- codePrefix = 'code: ' + this.code + (isVerbose ? (' (' + this.getErrorCodeName() + ')') : '') + ' ';
- }
-
- if(this.code === CordovaError.EXTERNAL_TOOL_ERROR) {
- if(typeof this.context !== 'undefined') {
- if(isVerbose) {
- message = codePrefix + EOL + this.context.toString(isVerbose) + '\n failed with an error: ' +
- this.message + EOL + 'Stack trace: ' + this.stack;
- } else {
- message = codePrefix + '\'' + this.context.toString(isVerbose) + '\' ' + this.message;
- }
- } else {
- message = 'External tool failed with an error: ' + this.message;
- }
- } else {
- message = isVerbose ? codePrefix + this.stack : codePrefix + this.message;
- }
-
- return message;
-};
-
-module.exports = CordovaError;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/CordovaError/CordovaExternalToolErrorContext.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/CordovaError/CordovaExternalToolErrorContext.js
deleted file mode 100644
index ca9a4aa..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/CordovaError/CordovaExternalToolErrorContext.js
+++ /dev/null
@@ -1,48 +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.
- */
-
-/* jshint proto:true */
-
-var path = require('path');
-
-/**
- * @param {String} cmd Command full path
- * @param {String[]} args Command args
- * @param {String} [cwd] Command working directory
- * @constructor
- */
-function CordovaExternalToolErrorContext(cmd, args, cwd) {
- this.cmd = cmd;
- // Helper field for readability
- this.cmdShortName = path.basename(cmd);
- this.args = args;
- this.cwd = cwd;
-}
-
-CordovaExternalToolErrorContext.prototype.toString = function(isVerbose) {
- if(isVerbose) {
- return 'External tool \'' + this.cmdShortName + '\'' +
- '\nCommand full path: ' + this.cmd + '\nCommand args: ' + this.args +
- (typeof this.cwd !== 'undefined' ? '\nCommand cwd: ' + this.cwd : '');
- }
-
- return this.cmdShortName;
-};
-
-module.exports = CordovaExternalToolErrorContext;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/CordovaLogger.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/CordovaLogger.js
deleted file mode 100644
index 71bc7e8..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/CordovaLogger.js
+++ /dev/null
@@ -1,220 +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.
- */
-
-var ansi = require('ansi');
-var EventEmitter = require('events').EventEmitter;
-var CordovaError = require('./CordovaError/CordovaError');
-var EOL = require('os').EOL;
-
-var INSTANCE;
-
-/**
- * @class CordovaLogger
- *
- * Implements logging facility that anybody could use. Should not be
- * instantiated directly, `CordovaLogger.get()` method should be used instead
- * to acquire logger instance
- */
-function CordovaLogger () {
- this.levels = {};
- this.colors = {};
- this.stdout = process.stdout;
- this.stderr = process.stderr;
-
- this.stdoutCursor = ansi(this.stdout);
- this.stderrCursor = ansi(this.stderr);
-
- this.addLevel('verbose', 1000, 'grey');
- this.addLevel('normal' , 2000);
- this.addLevel('warn' , 2000, 'yellow');
- this.addLevel('info' , 3000, 'blue');
- this.addLevel('error' , 5000, 'red');
- this.addLevel('results' , 10000);
-
- this.setLevel('normal');
-}
-
-/**
- * Static method to create new or acquire existing instance.
- *
- * @return {CordovaLogger} Logger instance
- */
-CordovaLogger.get = function () {
- return INSTANCE || (INSTANCE = new CordovaLogger());
-};
-
-CordovaLogger.VERBOSE = 'verbose';
-CordovaLogger.NORMAL = 'normal';
-CordovaLogger.WARN = 'warn';
-CordovaLogger.INFO = 'info';
-CordovaLogger.ERROR = 'error';
-CordovaLogger.RESULTS = 'results';
-
-/**
- * Emits log message to process' stdout/stderr depending on message's severity
- * and current log level. If severity is less than current logger's level,
- * then the message is ignored.
- *
- * @param {String} logLevel The message's log level. The logger should have
- * corresponding level added (via logger.addLevel), otherwise
- * `CordovaLogger.NORMAL` level will be used.
- * @param {String} message The message, that should be logged to process'
- * stdio
- *
- * @return {CordovaLogger} Current instance, to allow calls chaining.
- */
-CordovaLogger.prototype.log = function (logLevel, message) {
- // if there is no such logLevel defined, or provided level has
- // less severity than active level, then just ignore this call and return
- if (!this.levels[logLevel] || this.levels[logLevel] < this.levels[this.logLevel])
- // return instance to allow to chain calls
- return this;
-
- var isVerbose = this.logLevel === 'verbose';
- var cursor = this.stdoutCursor;
-
- if (message instanceof Error || logLevel === CordovaLogger.ERROR) {
- message = formatError(message, isVerbose);
- cursor = this.stderrCursor;
- }
-
- var color = this.colors[logLevel];
- if (color) {
- cursor.bold().fg[color]();
- }
-
- cursor.write(message).reset().write(EOL);
-
- return this;
-};
-
-/**
- * Adds a new level to logger instance. This method also creates a shortcut
- * method to log events with the level provided (i.e. after adding new level
- * 'debug', the method `debug(message)`, equal to logger.log('debug', message),
- * will be added to logger instance)
- *
- * @param {String} level A log level name. The levels with the following
- * names added by default to every instance: 'verbose', 'normal', 'warn',
- * 'info', 'error', 'results'
- * @param {Number} severity A number that represents level's severity.
- * @param {String} color A valid color name, that will be used to log
- * messages with this level. Any CSS color code or RGB value is allowed
- * (according to ansi documentation:
- * https://github.com/TooTallNate/ansi.js#features)
- *
- * @return {CordovaLogger} Current instance, to allow calls chaining.
- */
-CordovaLogger.prototype.addLevel = function (level, severity, color) {
-
- this.levels[level] = severity;
-
- if (color) {
- this.colors[level] = color;
- }
-
- // Define own method with corresponding name
- if (!this[level]) {
- this[level] = this.log.bind(this, level);
- }
-
- return this;
-};
-
-/**
- * Sets the current logger level to provided value. If logger doesn't have level
- * with this name, `CordovaLogger.NORMAL` will be used.
- *
- * @param {String} logLevel Level name. The level with this name should be
- * added to logger before.
- *
- * @return {CordovaLogger} Current instance, to allow calls chaining.
- */
-CordovaLogger.prototype.setLevel = function (logLevel) {
- this.logLevel = this.levels[logLevel] ? logLevel : CordovaLogger.NORMAL;
-
- return this;
-};
-
-/**
- * Adjusts the current logger level according to the passed options.
- *
- * @param {Object|Array} opts An object or args array with options
- *
- * @return {CordovaLogger} Current instance, to allow calls chaining.
- */
-CordovaLogger.prototype.adjustLevel = function (opts) {
- if (opts.verbose || (Array.isArray(opts) && opts.indexOf('--verbose') !== -1)) {
- this.setLevel('verbose');
- } else if (opts.silent || (Array.isArray(opts) && opts.indexOf('--silent') !== -1)) {
- this.setLevel('error');
- }
-
- return this;
-};
-
-/**
- * Attaches logger to EventEmitter instance provided.
- *
- * @param {EventEmitter} eventEmitter An EventEmitter instance to attach
- * logger to.
- *
- * @return {CordovaLogger} Current instance, to allow calls chaining.
- */
-CordovaLogger.prototype.subscribe = function (eventEmitter) {
-
- if (!(eventEmitter instanceof EventEmitter))
- throw new Error('Subscribe method only accepts an EventEmitter instance as argument');
-
- eventEmitter.on('verbose', this.verbose)
- .on('log', this.normal)
- .on('info', this.info)
- .on('warn', this.warn)
- .on('warning', this.warn)
- // Set up event handlers for logging and results emitted as events.
- .on('results', this.results);
-
- return this;
-};
-
-function formatError(error, isVerbose) {
- var message = '';
-
- if (error instanceof CordovaError) {
- message = error.toString(isVerbose);
- } else if (error instanceof Error) {
- if (isVerbose) {
- message = error.stack;
- } else {
- message = error.message;
- }
- } else {
- // Plain text error message
- message = error;
- }
-
- if (typeof message === 'string' && message.toUpperCase().indexOf('ERROR:') !== 0) {
- // Needed for backward compatibility with external tools
- message = 'Error: ' + message;
- }
-
- return message;
-}
-
-module.exports = CordovaLogger;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/FileUpdater.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/FileUpdater.js
deleted file mode 100644
index 8b6876b..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/FileUpdater.js
+++ /dev/null
@@ -1,416 +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.
-*/
-
-"use strict";
-
-var fs = require("fs");
-var path = require("path");
-var shell = require("shelljs");
-var minimatch = require("minimatch");
-
-/**
- * Logging callback used in the FileUpdater methods.
- * @callback loggingCallback
- * @param {string} message A message describing a single file update operation.
- */
-
-/**
- * Updates a target file or directory with a source file or directory. (Directory updates are
- * not recursive.) Stats for target and source items must be passed in. This is an internal
- * helper function used by other methods in this module.
- *
- * @param {?string} sourcePath Source file or directory to be used to update the
- * destination. If the source is null, then the destination is deleted if it exists.
- * @param {?fs.Stats} sourceStats An instance of fs.Stats for the source path, or null if
- * the source does not exist.
- * @param {string} targetPath Required destination file or directory to be updated. If it does
- * not exist, it will be created.
- * @param {?fs.Stats} targetStats An instance of fs.Stats for the target path, or null if
- * the target does not exist.
- * @param {Object} [options] Optional additional parameters for the update.
- * @param {string} [options.rootDir] Optional root directory (such as a project) to which target
- * and source path parameters are relative; may be omitted if the paths are absolute. The
- * rootDir is always omitted from any logged paths, to make the logs easier to read.
- * @param {boolean} [options.all] If true, all files are copied regardless of last-modified times.
- * Otherwise, a file is copied if the source's last-modified time is greather than or
- * equal to the target's last-modified time, or if the file sizes are different.
- * @param {loggingCallback} [log] Optional logging callback that takes a string message
- * describing any file operations that are performed.
- * @return {boolean} true if any changes were made, or false if the force flag is not set
- * and everything was up to date
- */
-function updatePathWithStats(sourcePath, sourceStats, targetPath, targetStats, options, log) {
- var updated = false;
-
- var rootDir = (options && options.rootDir) || "";
- var copyAll = (options && options.all) || false;
-
- var targetFullPath = path.join(rootDir || "", targetPath);
-
- if (sourceStats) {
- var sourceFullPath = path.join(rootDir || "", sourcePath);
-
- if (targetStats) {
- // The target exists. But if the directory status doesn't match the source, delete it.
- if (targetStats.isDirectory() && !sourceStats.isDirectory()) {
- log("rmdir " + targetPath + " (source is a file)");
- shell.rm("-rf", targetFullPath);
- targetStats = null;
- updated = true;
- } else if (!targetStats.isDirectory() && sourceStats.isDirectory()) {
- log("delete " + targetPath + " (source is a directory)");
- shell.rm("-f", targetFullPath);
- targetStats = null;
- updated = true;
- }
- }
-
- if (!targetStats) {
- if (sourceStats.isDirectory()) {
- // The target directory does not exist, so it should be created.
- log("mkdir " + targetPath);
- shell.mkdir("-p", targetFullPath);
- updated = true;
- } else if (sourceStats.isFile()) {
- // The target file does not exist, so it should be copied from the source.
- log("copy " + sourcePath + " " + targetPath + (copyAll ? "" : " (new file)"));
- shell.cp("-f", sourceFullPath, targetFullPath);
- updated = true;
- }
- } else if (sourceStats.isFile() && targetStats.isFile()) {
- // The source and target paths both exist and are files.
- if (copyAll) {
- // The caller specified all files should be copied.
- log("copy " + sourcePath + " " + targetPath);
- shell.cp("-f", sourceFullPath, targetFullPath);
- updated = true;
- } else {
- // Copy if the source has been modified since it was copied to the target, or if
- // the file sizes are different. (The latter catches most cases in which something
- // was done to the file after copying.) Comparison is >= rather than > to allow
- // for timestamps lacking sub-second precision in some filesystems.
- if (sourceStats.mtime.getTime() >= targetStats.mtime.getTime() ||
- sourceStats.size !== targetStats.size) {
- log("copy " + sourcePath + " " + targetPath + " (updated file)");
- shell.cp("-f", sourceFullPath, targetFullPath);
- updated = true;
- }
- }
- }
- } else if (targetStats) {
- // The target exists but the source is null, so the target should be deleted.
- if (targetStats.isDirectory()) {
- log("rmdir " + targetPath + (copyAll ? "" : " (no source)"));
- shell.rm("-rf", targetFullPath);
- } else {
- log("delete " + targetPath + (copyAll ? "" : " (no source)"));
- shell.rm("-f", targetFullPath);
- }
- updated = true;
- }
-
- return updated;
-}
-
-/**
- * Helper for updatePath and updatePaths functions. Queries stats for source and target
- * and ensures target directory exists before copying a file.
- */
-function updatePathInternal(sourcePath, targetPath, options, log) {
- var rootDir = (options && options.rootDir) || "";
- var targetFullPath = path.join(rootDir, targetPath);
- var targetStats = fs.existsSync(targetFullPath) ? fs.statSync(targetFullPath) : null;
- var sourceStats = null;
-
- if (sourcePath) {
- // A non-null source path was specified. It should exist.
- var sourceFullPath = path.join(rootDir, sourcePath);
- if (!fs.existsSync(sourceFullPath)) {
- throw new Error("Source path does not exist: " + sourcePath);
- }
-
- sourceStats = fs.statSync(sourceFullPath);
-
- // Create the target's parent directory if it doesn't exist.
- var parentDir = path.dirname(targetFullPath);
- if (!fs.existsSync(parentDir)) {
- shell.mkdir("-p", parentDir);
- }
- }
-
- return updatePathWithStats(sourcePath, sourceStats, targetPath, targetStats, options, log);
-}
-
-/**
- * Updates a target file or directory with a source file or directory. (Directory updates are
- * not recursive.)
- *
- * @param {?string} sourcePath Source file or directory to be used to update the
- * destination. If the source is null, then the destination is deleted if it exists.
- * @param {string} targetPath Required destination file or directory to be updated. If it does
- * not exist, it will be created.
- * @param {Object} [options] Optional additional parameters for the update.
- * @param {string} [options.rootDir] Optional root directory (such as a project) to which target
- * and source path parameters are relative; may be omitted if the paths are absolute. The
- * rootDir is always omitted from any logged paths, to make the logs easier to read.
- * @param {boolean} [options.all] If true, all files are copied regardless of last-modified times.
- * Otherwise, a file is copied if the source's last-modified time is greather than or
- * equal to the target's last-modified time, or if the file sizes are different.
- * @param {loggingCallback} [log] Optional logging callback that takes a string message
- * describing any file operations that are performed.
- * @return {boolean} true if any changes were made, or false if the force flag is not set
- * and everything was up to date
- */
-function updatePath(sourcePath, targetPath, options, log) {
- if (sourcePath !== null && typeof sourcePath !== "string") {
- throw new Error("A source path (or null) is required.");
- }
-
- if (!targetPath || typeof targetPath !== "string") {
- throw new Error("A target path is required.");
- }
-
- log = log || function(message) { };
-
- return updatePathInternal(sourcePath, targetPath, options, log);
-}
-
-/**
- * Updates files and directories based on a mapping from target paths to source paths. Targets
- * with null sources in the map are deleted.
- *
- * @param {Object} pathMap A dictionary mapping from target paths to source paths.
- * @param {Object} [options] Optional additional parameters for the update.
- * @param {string} [options.rootDir] Optional root directory (such as a project) to which target
- * and source path parameters are relative; may be omitted if the paths are absolute. The
- * rootDir is always omitted from any logged paths, to make the logs easier to read.
- * @param {boolean} [options.all] If true, all files are copied regardless of last-modified times.
- * Otherwise, a file is copied if the source's last-modified time is greather than or
- * equal to the target's last-modified time, or if the file sizes are different.
- * @param {loggingCallback} [log] Optional logging callback that takes a string message
- * describing any file operations that are performed.
- * @return {boolean} true if any changes were made, or false if the force flag is not set
- * and everything was up to date
- */
-function updatePaths(pathMap, options, log) {
- if (!pathMap || typeof pathMap !== "object" || Array.isArray(pathMap)) {
- throw new Error("An object mapping from target paths to source paths is required.");
- }
-
- log = log || function(message) { };
-
- var updated = false;
-
- // Iterate in sorted order to ensure directories are created before files under them.
- Object.keys(pathMap).sort().forEach(function (targetPath) {
- var sourcePath = pathMap[targetPath];
- updated = updatePathInternal(sourcePath, targetPath, options, log) || updated;
- });
-
- return updated;
-}
-
-/**
- * Updates a target directory with merged files and subdirectories from source directories.
- *
- * @param {string|string[]} sourceDirs Required source directory or array of source directories
- * to be merged into the target. The directories are listed in order of precedence; files in
- * directories later in the array supersede files in directories earlier in the array
- * (regardless of timestamps).
- * @param {string} targetDir Required destination directory to be updated. If it does not exist,
- * it will be created. If it exists, newer files from source directories will be copied over,
- * and files missing in the source directories will be deleted.
- * @param {Object} [options] Optional additional parameters for the update.
- * @param {string} [options.rootDir] Optional root directory (such as a project) to which target
- * and source path parameters are relative; may be omitted if the paths are absolute. The
- * rootDir is always omitted from any logged paths, to make the logs easier to read.
- * @param {boolean} [options.all] If true, all files are copied regardless of last-modified times.
- * Otherwise, a file is copied if the source's last-modified time is greather than or
- * equal to the target's last-modified time, or if the file sizes are different.
- * @param {string|string[]} [options.include] Optional glob string or array of glob strings that
- * are tested against both target and source relative paths to determine if they are included
- * in the merge-and-update. If unspecified, all items are included.
- * @param {string|string[]} [options.exclude] Optional glob string or array of glob strings that
- * are tested against both target and source relative paths to determine if they are excluded
- * from the merge-and-update. Exclusions override inclusions. If unspecified, no items are
- * excluded.
- * @param {loggingCallback} [log] Optional logging callback that takes a string message
- * describing any file operations that are performed.
- * @return {boolean} true if any changes were made, or false if the force flag is not set
- * and everything was up to date
- */
-function mergeAndUpdateDir(sourceDirs, targetDir, options, log) {
- if (sourceDirs && typeof sourceDirs === "string") {
- sourceDirs = [ sourceDirs ];
- } else if (!Array.isArray(sourceDirs)) {
- throw new Error("A source directory path or array of paths is required.");
- }
-
- if (!targetDir || typeof targetDir !== "string") {
- throw new Error("A target directory path is required.");
- }
-
- log = log || function(message) { };
-
- var rootDir = (options && options.rootDir) || "";
-
- var include = (options && options.include) || [ "**" ];
- if (typeof include === "string") {
- include = [ include ];
- } else if (!Array.isArray(include)) {
- throw new Error("Include parameter must be a glob string or array of glob strings.");
- }
-
- var exclude = (options && options.exclude) || [];
- if (typeof exclude === "string") {
- exclude = [ exclude ];
- } else if (!Array.isArray(exclude)) {
- throw new Error("Exclude parameter must be a glob string or array of glob strings.");
- }
-
- // Scan the files in each of the source directories.
- var sourceMaps = sourceDirs.map(function (sourceDir) {
- return path.join(rootDir, sourceDir);
- }).map(function (sourcePath) {
- if (!fs.existsSync(sourcePath)) {
- throw new Error("Source directory does not exist: " + sourcePath);
- }
- return mapDirectory(rootDir, path.relative(rootDir, sourcePath), include, exclude);
- });
-
- // Scan the files in the target directory, if it exists.
- var targetMap = {};
- var targetFullPath = path.join(rootDir, targetDir);
- if (fs.existsSync(targetFullPath)) {
- targetMap = mapDirectory(rootDir, targetDir, include, exclude);
- }
-
- var pathMap = mergePathMaps(sourceMaps, targetMap, targetDir);
-
- var updated = false;
-
- // Iterate in sorted order to ensure directories are created before files under them.
- Object.keys(pathMap).sort().forEach(function (subPath) {
- var entry = pathMap[subPath];
- updated = updatePathWithStats(
- entry.sourcePath,
- entry.sourceStats,
- entry.targetPath,
- entry.targetStats,
- options,
- log) || updated;
- });
-
- return updated;
-}
-
-/**
- * Creates a dictionary map of all files and directories under a path.
- */
-function mapDirectory(rootDir, subDir, include, exclude) {
- var dirMap = { "": { subDir: subDir, stats: fs.statSync(path.join(rootDir, subDir)) } };
- mapSubdirectory(rootDir, subDir, "", include, exclude, dirMap);
- return dirMap;
-
- function mapSubdirectory(rootDir, subDir, relativeDir, include, exclude, dirMap) {
- var itemMapped = false;
- var items = fs.readdirSync(path.join(rootDir, subDir, relativeDir));
-
- items.forEach(function(item) {
- var relativePath = path.join(relativeDir, item);
- if(!matchGlobArray(relativePath, exclude)) {
- // Stats obtained here (required at least to know where to recurse in directories)
- // are saved for later, where the modified times may also be used. This minimizes
- // the number of file I/O operations performed.
- var fullPath = path.join(rootDir, subDir, relativePath);
- var stats = fs.statSync(fullPath);
-
- if (stats.isDirectory()) {
- // Directories are included if either something under them is included or they
- // match an include glob.
- if (mapSubdirectory(rootDir, subDir, relativePath, include, exclude, dirMap) ||
- matchGlobArray(relativePath, include)) {
- dirMap[relativePath] = { subDir: subDir, stats: stats };
- itemMapped = true;
- }
- } else if (stats.isFile()) {
- // Files are included only if they match an include glob.
- if (matchGlobArray(relativePath, include)) {
- dirMap[relativePath] = { subDir: subDir, stats: stats };
- itemMapped = true;
- }
- }
- }
- });
- return itemMapped;
- }
-
- function matchGlobArray(path, globs) {
- return globs.some(function(elem) {
- return minimatch(path, elem, {dot:true});
- });
- }
-}
-
-/**
- * Merges together multiple source maps and a target map into a single mapping from
- * relative paths to objects with target and source paths and stats.
- */
-function mergePathMaps(sourceMaps, targetMap, targetDir) {
- // Merge multiple source maps together, along with target path info.
- // Entries in later source maps override those in earlier source maps.
- // Target stats will be filled in below for targets that exist.
- var pathMap = {};
- sourceMaps.forEach(function (sourceMap) {
- Object.keys(sourceMap).forEach(function(sourceSubPath){
- var sourceEntry = sourceMap[sourceSubPath];
- pathMap[sourceSubPath] = {
- targetPath: path.join(targetDir, sourceSubPath),
- targetStats: null,
- sourcePath: path.join(sourceEntry.subDir, sourceSubPath),
- sourceStats: sourceEntry.stats
- };
- });
- });
-
- // Fill in target stats for targets that exist, and create entries
- // for targets that don't have any corresponding sources.
- Object.keys(targetMap).forEach(function(subPath){
- var entry = pathMap[subPath];
- if (entry) {
- entry.targetStats = targetMap[subPath].stats;
- } else {
- pathMap[subPath] = {
- targetPath: path.join(targetDir, subPath),
- targetStats: targetMap[subPath].stats,
- sourcePath: null,
- sourceStats: null
- };
- }
- });
-
- return pathMap;
-}
-
-module.exports = {
- updatePath: updatePath,
- updatePaths: updatePaths,
- mergeAndUpdateDir: mergeAndUpdateDir
-};
-
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/PlatformJson.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/PlatformJson.js
deleted file mode 100644
index ab94b5f..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/PlatformJson.js
+++ /dev/null
@@ -1,278 +0,0 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-/* jshint sub:true */
-
-var fs = require('fs');
-var path = require('path');
-var shelljs = require('shelljs');
-var mungeutil = require('./ConfigChanges/munge-util');
-var pluginMappernto = require('cordova-registry-mapper').newToOld;
-var pluginMapperotn = require('cordova-registry-mapper').oldToNew;
-
-function PlatformJson(filePath, platform, root) {
- this.filePath = filePath;
- this.platform = platform;
- this.root = fix_munge(root || {});
-}
-
-PlatformJson.load = function(plugins_dir, platform) {
- var filePath = path.join(plugins_dir, platform + '.json');
- var root = null;
- if (fs.existsSync(filePath)) {
- root = JSON.parse(fs.readFileSync(filePath, 'utf-8'));
- }
- return new PlatformJson(filePath, platform, root);
-};
-
-PlatformJson.prototype.save = function() {
- shelljs.mkdir('-p', path.dirname(this.filePath));
- fs.writeFileSync(this.filePath, JSON.stringify(this.root, null, 4), 'utf-8');
-};
-
-/**
- * Indicates whether the specified plugin is installed as a top-level (not as
- * dependency to others)
- * @method function
- * @param {String} pluginId A plugin id to check for.
- * @return {Boolean} true if plugin installed as top-level, otherwise false.
- */
-PlatformJson.prototype.isPluginTopLevel = function(pluginId) {
- var installedPlugins = this.root.installed_plugins;
- return installedPlugins[pluginId] ||
- installedPlugins[pluginMappernto[pluginId]] ||
- installedPlugins[pluginMapperotn[pluginId]];
-};
-
-/**
- * Indicates whether the specified plugin is installed as a dependency to other
- * plugin.
- * @method function
- * @param {String} pluginId A plugin id to check for.
- * @return {Boolean} true if plugin installed as a dependency, otherwise false.
- */
-PlatformJson.prototype.isPluginDependent = function(pluginId) {
- var dependentPlugins = this.root.dependent_plugins;
- return dependentPlugins[pluginId] ||
- dependentPlugins[pluginMappernto[pluginId]] ||
- dependentPlugins[pluginMapperotn[pluginId]];
-};
-
-/**
- * Indicates whether plugin is installed either as top-level or as dependency.
- * @method function
- * @param {String} pluginId A plugin id to check for.
- * @return {Boolean} true if plugin installed, otherwise false.
- */
-PlatformJson.prototype.isPluginInstalled = function(pluginId) {
- return this.isPluginTopLevel(pluginId) ||
- this.isPluginDependent(pluginId);
-};
-
-PlatformJson.prototype.addPlugin = function(pluginId, variables, isTopLevel) {
- var pluginsList = isTopLevel ?
- this.root.installed_plugins :
- this.root.dependent_plugins;
-
- pluginsList[pluginId] = variables;
-
- return this;
-};
-
-/**
- * @chaining
- * Generates and adds metadata for provided plugin into associated .json file
- *
- * @param {PluginInfo} pluginInfo A pluginInfo instance to add metadata from
- * @returns {this} Current PlatformJson instance to allow calls chaining
- */
-PlatformJson.prototype.addPluginMetadata = function (pluginInfo) {
-
- var installedModules = this.root.modules || [];
-
- var installedPaths = installedModules.map(function (installedModule) {
- return installedModule.file;
- });
-
- var modulesToInstall = pluginInfo.getJsModules(this.platform)
- .map(function (module) {
- return new ModuleMetadata(pluginInfo.id, module);
- })
- .filter(function (metadata) {
- // Filter out modules which are already added to metadata
- return installedPaths.indexOf(metadata.file) === -1;
- });
-
- this.root.modules = installedModules.concat(modulesToInstall);
-
- this.root.plugin_metadata = this.root.plugin_metadata || {};
- this.root.plugin_metadata[pluginInfo.id] = pluginInfo.version;
-
- return this;
-};
-
-PlatformJson.prototype.removePlugin = function(pluginId, isTopLevel) {
- var pluginsList = isTopLevel ?
- this.root.installed_plugins :
- this.root.dependent_plugins;
-
- delete pluginsList[pluginId];
-
- return this;
-};
-
-/**
- * @chaining
- * Removes metadata for provided plugin from associated file
- *
- * @param {PluginInfo} pluginInfo A PluginInfo instance to which modules' metadata
- * we need to remove
- *
- * @returns {this} Current PlatformJson instance to allow calls chaining
- */
-PlatformJson.prototype.removePluginMetadata = function (pluginInfo) {
- var modulesToRemove = pluginInfo.getJsModules(this.platform)
- .map(function (jsModule) {
- return ['plugins', pluginInfo.id, jsModule.src].join('/');
- });
-
- var installedModules = this.root.modules || [];
- this.root.modules = installedModules
- .filter(function (installedModule) {
- // Leave only those metadatas which 'file' is not in removed modules
- return (modulesToRemove.indexOf(installedModule.file) === -1);
- });
-
- if (this.root.plugin_metadata) {
- delete this.root.plugin_metadata[pluginInfo.id];
- }
-
- return this;
-};
-
-PlatformJson.prototype.addInstalledPluginToPrepareQueue = function(pluginDirName, vars, is_top_level, force) {
- this.root.prepare_queue.installed.push({'plugin':pluginDirName, 'vars':vars, 'topLevel':is_top_level, 'force':force});
-};
-
-PlatformJson.prototype.addUninstalledPluginToPrepareQueue = function(pluginId, is_top_level) {
- this.root.prepare_queue.uninstalled.push({'plugin':pluginId, 'id':pluginId, 'topLevel':is_top_level});
-};
-
-/**
- * Moves plugin, specified by id to top-level plugins. If plugin is top-level
- * already, then does nothing.
- * @method function
- * @param {String} pluginId A plugin id to make top-level.
- * @return {PlatformJson} PlatformJson instance.
- */
-PlatformJson.prototype.makeTopLevel = function(pluginId) {
- var plugin = this.root.dependent_plugins[pluginId];
- if (plugin) {
- delete this.root.dependent_plugins[pluginId];
- this.root.installed_plugins[pluginId] = plugin;
- }
- return this;
-};
-
-/**
- * Generates a metadata for all installed plugins and js modules. The resultant
- * string is ready to be written to 'cordova_plugins.js'
- *
- * @returns {String} cordova_plugins.js contents
- */
-PlatformJson.prototype.generateMetadata = function () {
- return [
- 'cordova.define(\'cordova/plugin_list\', function(require, exports, module) {',
- 'module.exports = ' + JSON.stringify(this.root.modules, null, 4) + ';',
- 'module.exports.metadata = ',
- '// TOP OF METADATA',
- JSON.stringify(this.root.plugin_metadata, null, 4) + ';',
- '// BOTTOM OF METADATA',
- '});' // Close cordova.define.
- ].join('\n');
-};
-
-/**
- * @chaining
- * Generates and then saves metadata to specified file. Doesn't check if file exists.
- *
- * @param {String} destination File metadata will be written to
- * @return {PlatformJson} PlatformJson instance
- */
-PlatformJson.prototype.generateAndSaveMetadata = function (destination) {
- var meta = this.generateMetadata();
- shelljs.mkdir('-p', path.dirname(destination));
- fs.writeFileSync(destination, meta, 'utf-8');
-
- return this;
-};
-
-// convert a munge from the old format ([file][parent][xml] = count) to the current one
-function fix_munge(root) {
- root.prepare_queue = root.prepare_queue || {installed:[], uninstalled:[]};
- root.config_munge = root.config_munge || {files: {}};
- root.installed_plugins = root.installed_plugins || {};
- root.dependent_plugins = root.dependent_plugins || {};
-
- var munge = root.config_munge;
- if (!munge.files) {
- var new_munge = { files: {} };
- for (var file in munge) {
- for (var selector in munge[file]) {
- for (var xml_child in munge[file][selector]) {
- var val = parseInt(munge[file][selector][xml_child]);
- for (var i = 0; i < val; i++) {
- mungeutil.deep_add(new_munge, [file, selector, { xml: xml_child, count: val }]);
- }
- }
- }
- }
- root.config_munge = new_munge;
- }
-
- return root;
-}
-
-/**
- * @constructor
- * @class ModuleMetadata
- *
- * Creates a ModuleMetadata object that represents module entry in 'cordova_plugins.js'
- * file at run time
- *
- * @param {String} pluginId Plugin id where this module installed from
- * @param (JsModule|Object) jsModule A js-module entry from PluginInfo class to generate metadata for
- */
-function ModuleMetadata (pluginId, jsModule) {
-
- if (!pluginId) throw new TypeError('pluginId argument must be a valid plugin id');
- if (!jsModule.src && !jsModule.name) throw new TypeError('jsModule argument must contain src or/and name properties');
-
- this.id = pluginId + '.' + ( jsModule.name || jsModule.src.match(/([^\/]+)\.js/)[1] );
- this.file = ['plugins', pluginId, jsModule.src].join('/');
- this.pluginId = pluginId;
-
- if (jsModule.clobbers && jsModule.clobbers.length > 0) {
- this.clobbers = jsModule.clobbers.map(function(o) { return o.target; });
- }
- if (jsModule.merges && jsModule.merges.length > 0) {
- this.merges = jsModule.merges.map(function(o) { return o.target; });
- }
- if (jsModule.runs) {
- this.runs = true;
- }
-}
-
-module.exports = PlatformJson;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/PluginInfo/PluginInfo.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/PluginInfo/PluginInfo.js
deleted file mode 100644
index 0be0c41..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/PluginInfo/PluginInfo.js
+++ /dev/null
@@ -1,423 +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.
-*/
-
-/* jshint sub:true, laxcomma:true, laxbreak:true */
-
-/*
-A class for holidng the information currently stored in plugin.xml
-It should also be able to answer questions like whether the plugin
-is compatible with a given engine version.
-
-TODO (kamrik): refactor this to not use sync functions and return promises.
-*/
-
-
-var path = require('path')
- , fs = require('fs')
- , xml_helpers = require('../util/xml-helpers')
- , CordovaError = require('../CordovaError/CordovaError')
- ;
-
-function PluginInfo(dirname) {
- var self = this;
-
- // METHODS
- // Defined inside the constructor to avoid the "this" binding problems.
-
- // tag
- // Example:
- // Used to require a variable to be specified via --variable when installing the plugin.
- // returns { key : default | null}
- self.getPreferences = getPreferences;
- function getPreferences(platform) {
- return _getTags(self._et, 'preference', platform, _parsePreference)
- .reduce(function (preferences, pref) {
- preferences[pref.preference] = pref.default;
- return preferences;
- }, {});
- }
-
- function _parsePreference(prefTag) {
- var name = prefTag.attrib.name.toUpperCase();
- var def = prefTag.attrib.default || null;
- return {preference: name, default: def};
- }
-
- //
- self.getAssets = getAssets;
- function getAssets(platform) {
- var assets = _getTags(self._et, 'asset', platform, _parseAsset);
- return assets;
- }
-
- function _parseAsset(tag) {
- var src = tag.attrib.src;
- var target = tag.attrib.target;
-
- if ( !src || !target) {
- var msg =
- 'Malformed tag. Both "src" and "target" attributes'
- + 'must be specified in\n'
- + self.filepath
- ;
- throw new Error(msg);
- }
-
- var asset = {
- itemType: 'asset',
- src: src,
- target: target
- };
- return asset;
- }
-
-
- //
- // Example:
- //
- self.getDependencies = getDependencies;
- function getDependencies(platform) {
- var deps = _getTags(
- self._et,
- 'dependency',
- platform,
- _parseDependency
- );
- return deps;
- }
-
- function _parseDependency(tag) {
- var dep =
- { id : tag.attrib.id
- , url : tag.attrib.url || ''
- , subdir : tag.attrib.subdir || ''
- , commit : tag.attrib.commit
- };
-
- dep.git_ref = dep.commit;
-
- if ( !dep.id ) {
- var msg =
- ' tag is missing id attribute in '
- + self.filepath
- ;
- throw new CordovaError(msg);
- }
- return dep;
- }
-
-
- // tag
- self.getConfigFiles = getConfigFiles;
- function getConfigFiles(platform) {
- var configFiles = _getTags(self._et, 'config-file', platform, _parseConfigFile);
- return configFiles;
- }
-
- function _parseConfigFile(tag) {
- var configFile =
- { target : tag.attrib['target']
- , parent : tag.attrib['parent']
- , after : tag.attrib['after']
- , xmls : tag.getchildren()
- // To support demuxing via versions
- , versions : tag.attrib['versions']
- , deviceTarget: tag.attrib['device-target']
- };
- return configFile;
- }
-
- self.getEditConfigs = getEditConfigs;
- function getEditConfigs(platform) {
- var editConfigs = _getTags(self._et, 'edit-config', platform, _parseEditConfigs);
- return editConfigs;
- }
-
- function _parseEditConfigs(tag) {
- var editConfig =
- { file : tag.attrib['file']
- , target : tag.attrib['target']
- , mode : tag.attrib['mode']
- , xmls : tag.getchildren()
- };
- return editConfig;
- }
-
- // tags, both global and within a
- // TODO (kamrik): Do we ever use under ? Example wanted.
- self.getInfo = getInfo;
- function getInfo(platform) {
- var infos = _getTags(
- self._et,
- 'info',
- platform,
- function(elem) { return elem.text; }
- );
- // Filter out any undefined or empty strings.
- infos = infos.filter(Boolean);
- return infos;
- }
-
- //
- // Examples:
- //
- //
- self.getSourceFiles = getSourceFiles;
- function getSourceFiles(platform) {
- var sourceFiles = _getTagsInPlatform(self._et, 'source-file', platform, _parseSourceFile);
- return sourceFiles;
- }
-
- function _parseSourceFile(tag) {
- return {
- itemType: 'source-file',
- src: tag.attrib.src,
- framework: isStrTrue(tag.attrib.framework),
- weak: isStrTrue(tag.attrib.weak),
- compilerFlags: tag.attrib['compiler-flags'],
- targetDir: tag.attrib['target-dir']
- };
- }
-
- //
- // Example:
- //
- self.getHeaderFiles = getHeaderFiles;
- function getHeaderFiles(platform) {
- var headerFiles = _getTagsInPlatform(self._et, 'header-file', platform, function(tag) {
- return {
- itemType: 'header-file',
- src: tag.attrib.src,
- targetDir: tag.attrib['target-dir']
- };
- });
- return headerFiles;
- }
-
- //
- // Example:
- //
- self.getResourceFiles = getResourceFiles;
- function getResourceFiles(platform) {
- var resourceFiles = _getTagsInPlatform(self._et, 'resource-file', platform, function(tag) {
- return {
- itemType: 'resource-file',
- src: tag.attrib.src,
- target: tag.attrib.target,
- versions: tag.attrib.versions,
- deviceTarget: tag.attrib['device-target'],
- arch: tag.attrib.arch
- };
- });
- return resourceFiles;
- }
-
- //
- // Example:
- //
- self.getLibFiles = getLibFiles;
- function getLibFiles(platform) {
- var libFiles = _getTagsInPlatform(self._et, 'lib-file', platform, function(tag) {
- return {
- itemType: 'lib-file',
- src: tag.attrib.src,
- arch: tag.attrib.arch,
- Include: tag.attrib.Include,
- versions: tag.attrib.versions,
- deviceTarget: tag.attrib['device-target'] || tag.attrib.target
- };
- });
- return libFiles;
- }
-
- //
- // Example:
- //
- self.getHookScripts = getHookScripts;
- function getHookScripts(hook, platforms) {
- var scriptElements = self._et.findall('./hook');
-
- if(platforms) {
- platforms.forEach(function (platform) {
- scriptElements = scriptElements.concat(self._et.findall('./platform[@name="' + platform + '"]/hook'));
- });
- }
-
- function filterScriptByHookType(el) {
- return el.attrib.src && el.attrib.type && el.attrib.type.toLowerCase() === hook;
- }
-
- return scriptElements.filter(filterScriptByHookType);
- }
-
- self.getJsModules = getJsModules;
- function getJsModules(platform) {
- var modules = _getTags(self._et, 'js-module', platform, _parseJsModule);
- return modules;
- }
-
- function _parseJsModule(tag) {
- var ret = {
- itemType: 'js-module',
- name: tag.attrib.name,
- src: tag.attrib.src,
- clobbers: tag.findall('clobbers').map(function(tag) { return { target: tag.attrib.target }; }),
- merges: tag.findall('merges').map(function(tag) { return { target: tag.attrib.target }; }),
- runs: tag.findall('runs').length > 0
- };
-
- return ret;
- }
-
- self.getEngines = function() {
- return self._et.findall('engines/engine').map(function(n) {
- return {
- name: n.attrib.name,
- version: n.attrib.version,
- platform: n.attrib.platform,
- scriptSrc: n.attrib.scriptSrc
- };
- });
- };
-
- self.getPlatforms = function() {
- return self._et.findall('platform').map(function(n) {
- return { name: n.attrib.name };
- });
- };
-
- self.getPlatformsArray = function() {
- return self._et.findall('platform').map(function(n) {
- return n.attrib.name;
- });
- };
- self.getFrameworks = function(platform) {
- return _getTags(self._et, 'framework', platform, function(el) {
- var ret = {
- itemType: 'framework',
- type: el.attrib.type,
- parent: el.attrib.parent,
- custom: isStrTrue(el.attrib.custom),
- src: el.attrib.src,
- spec: el.attrib.spec,
- weak: isStrTrue(el.attrib.weak),
- versions: el.attrib.versions,
- targetDir: el.attrib['target-dir'],
- deviceTarget: el.attrib['device-target'] || el.attrib.target,
- arch: el.attrib.arch
- };
- return ret;
- });
- };
-
- self.getFilesAndFrameworks = getFilesAndFrameworks;
- function getFilesAndFrameworks(platform) {
- // Please avoid changing the order of the calls below, files will be
- // installed in this order.
- var items = [].concat(
- self.getSourceFiles(platform),
- self.getHeaderFiles(platform),
- self.getResourceFiles(platform),
- self.getFrameworks(platform),
- self.getLibFiles(platform)
- );
- return items;
- }
- ///// End of PluginInfo methods /////
-
-
- ///// PluginInfo Constructor logic /////
- self.filepath = path.join(dirname, 'plugin.xml');
- if (!fs.existsSync(self.filepath)) {
- throw new CordovaError('Cannot find plugin.xml for plugin "' + path.basename(dirname) + '". Please try adding it again.');
- }
-
- self.dir = dirname;
- var et = self._et = xml_helpers.parseElementtreeSync(self.filepath);
- var pelem = et.getroot();
- self.id = pelem.attrib.id;
- self.version = pelem.attrib.version;
-
- // Optional fields
- self.name = pelem.findtext('name');
- self.description = pelem.findtext('description');
- self.license = pelem.findtext('license');
- self.repo = pelem.findtext('repo');
- self.issue = pelem.findtext('issue');
- self.keywords = pelem.findtext('keywords');
- self.info = pelem.findtext('info');
- if (self.keywords) {
- self.keywords = self.keywords.split(',').map( function(s) { return s.trim(); } );
- }
- self.getKeywordsAndPlatforms = function () {
- var ret = self.keywords || [];
- return ret.concat('ecosystem:cordova').concat(addCordova(self.getPlatformsArray()));
- };
-} // End of PluginInfo constructor.
-
-// Helper function used to prefix every element of an array with cordova-
-// Useful when we want to modify platforms to be cordova-platform
-function addCordova(someArray) {
- var newArray = someArray.map(function(element) {
- return 'cordova-' + element;
- });
- return newArray;
-}
-
-// Helper function used by most of the getSomething methods of PluginInfo.
-// Get all elements of a given name. Both in root and in platform sections
-// for the given platform. If transform is given and is a function, it is
-// applied to each element.
-function _getTags(pelem, tag, platform, transform) {
- var platformTag = pelem.find('./platform[@name="' + platform + '"]');
- var tagsInRoot = pelem.findall(tag);
- tagsInRoot = tagsInRoot || [];
- var tagsInPlatform = platformTag ? platformTag.findall(tag) : [];
- var tags = tagsInRoot.concat(tagsInPlatform);
- if ( typeof transform === 'function' ) {
- tags = tags.map(transform);
- }
- return tags;
-}
-
-// Same as _getTags() but only looks inside a platform section.
-function _getTagsInPlatform(pelem, tag, platform, transform) {
- var platformTag = pelem.find('./platform[@name="' + platform + '"]');
- var tags = platformTag ? platformTag.findall(tag) : [];
- if ( typeof transform === 'function' ) {
- tags = tags.map(transform);
- }
- return tags;
-}
-
-// Check if x is a string 'true'.
-function isStrTrue(x) {
- return String(x).toLowerCase() == 'true';
-}
-
-module.exports = PluginInfo;
-// Backwards compat:
-PluginInfo.PluginInfo = PluginInfo;
-PluginInfo.loadPluginsDir = function(dir) {
- var PluginInfoProvider = require('./PluginInfoProvider');
- return new PluginInfoProvider().getAllWithinSearchPath(dir);
-};
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/PluginInfo/PluginInfoProvider.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/PluginInfo/PluginInfoProvider.js
deleted file mode 100644
index 6240119..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/PluginInfo/PluginInfoProvider.js
+++ /dev/null
@@ -1,82 +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.
-*/
-
-/* jshint sub:true, laxcomma:true, laxbreak:true */
-
-var fs = require('fs');
-var path = require('path');
-var PluginInfo = require('./PluginInfo');
-var events = require('../events');
-
-function PluginInfoProvider() {
- this._cache = {};
- this._getAllCache = {};
-}
-
-PluginInfoProvider.prototype.get = function(dirName) {
- var absPath = path.resolve(dirName);
- if (!this._cache[absPath]) {
- this._cache[absPath] = new PluginInfo(dirName);
- }
- return this._cache[absPath];
-};
-
-// Normally you don't need to put() entries, but it's used
-// when copying plugins, and in unit tests.
-PluginInfoProvider.prototype.put = function(pluginInfo) {
- var absPath = path.resolve(pluginInfo.dir);
- this._cache[absPath] = pluginInfo;
-};
-
-// Used for plugin search path processing.
-// Given a dir containing multiple plugins, create a PluginInfo object for
-// each of them and return as array.
-// Should load them all in parallel and return a promise, but not yet.
-PluginInfoProvider.prototype.getAllWithinSearchPath = function(dirName) {
- var absPath = path.resolve(dirName);
- if (!this._getAllCache[absPath]) {
- this._getAllCache[absPath] = getAllHelper(absPath, this);
- }
- return this._getAllCache[absPath];
-};
-
-function getAllHelper(absPath, provider) {
- if (!fs.existsSync(absPath)){
- return [];
- }
- // If dir itself is a plugin, return it in an array with one element.
- if (fs.existsSync(path.join(absPath, 'plugin.xml'))) {
- return [provider.get(absPath)];
- }
- var subdirs = fs.readdirSync(absPath);
- var plugins = [];
- subdirs.forEach(function(subdir) {
- var d = path.join(absPath, subdir);
- if (fs.existsSync(path.join(d, 'plugin.xml'))) {
- try {
- plugins.push(provider.get(d));
- } catch (e) {
- events.emit('warn', 'Error parsing ' + path.join(d, 'plugin.xml.\n' + e.stack));
- }
- }
- });
- return plugins;
-}
-
-module.exports = PluginInfoProvider;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/PluginManager.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/PluginManager.js
deleted file mode 100644
index e8968f1..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/PluginManager.js
+++ /dev/null
@@ -1,152 +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.
-*/
-
-var Q = require('q');
-var fs = require('fs');
-var path = require('path');
-
-var ActionStack = require('./ActionStack');
-var PlatformJson = require('./PlatformJson');
-var CordovaError = require('./CordovaError/CordovaError');
-var PlatformMunger = require('./ConfigChanges/ConfigChanges').PlatformMunger;
-var PluginInfoProvider = require('./PluginInfo/PluginInfoProvider');
-
-/**
- * @constructor
- * @class PluginManager
- * Represents an entity for adding/removing plugins for platforms
- *
- * @param {String} platform Platform name
- * @param {Object} locations - Platform files and directories
- * @param {IDEProject} ideProject The IDE project to add/remove plugin changes to/from
- */
-function PluginManager(platform, locations, ideProject) {
- this.platform = platform;
- this.locations = locations;
- this.project = ideProject;
-
- var platformJson = PlatformJson.load(locations.root, platform);
- this.munger = new PlatformMunger(platform, locations.root, platformJson, new PluginInfoProvider());
-}
-
-
-/**
- * @constructs PluginManager
- * A convenience shortcut to new PluginManager(...)
- *
- * @param {String} platform Platform name
- * @param {Object} locations - Platform files and directories
- * @param {IDEProject} ideProject The IDE project to add/remove plugin changes to/from
- * @returns new PluginManager instance
- */
-PluginManager.get = function(platform, locations, ideProject) {
- return new PluginManager(platform, locations, ideProject);
-};
-
-PluginManager.INSTALL = 'install';
-PluginManager.UNINSTALL = 'uninstall';
-
-module.exports = PluginManager;
-
-/**
- * Describes and implements common plugin installation/uninstallation routine. The flow is the following:
- * * Validate and set defaults for options. Note that options are empty by default. Everything
- * needed for platform IDE project must be passed from outside. Plugin variables (which
- * are the part of the options) also must be already populated with 'PACKAGE_NAME' variable.
- * * Collect all plugin's native and web files, get installers/uninstallers and process
- * all these via ActionStack.
- * * Save the IDE project, so the changes made by installers are persisted.
- * * Generate config changes munge for plugin and apply it to all required files
- * * Generate metadata for plugin and plugin modules and save it to 'cordova_plugins.js'
- *
- * @param {PluginInfo} plugin A PluginInfo structure representing plugin to install
- * @param {Object} [options={}] An installation options. It is expected but is not necessary
- * that options would contain 'variables' inner object with 'PACKAGE_NAME' field set by caller.
- *
- * @returns {Promise} Returns a Q promise, either resolved in case of success, rejected otherwise.
- */
-PluginManager.prototype.doOperation = function (operation, plugin, options) {
- if (operation !== PluginManager.INSTALL && operation !== PluginManager.UNINSTALL)
- return Q.reject(new CordovaError('The parameter is incorrect. The opeation must be either "add" or "remove"'));
-
- if (!plugin || plugin.constructor.name !== 'PluginInfo')
- return Q.reject(new CordovaError('The parameter is incorrect. The first parameter should be a PluginInfo instance'));
-
- // Set default to empty object to play safe when accesing properties
- options = options || {};
-
- var self = this;
- var actions = new ActionStack();
-
- // gather all files need to be handled during operation ...
- plugin.getFilesAndFrameworks(this.platform)
- .concat(plugin.getAssets(this.platform))
- .concat(plugin.getJsModules(this.platform))
- // ... put them into stack ...
- .forEach(function(item) {
- var installer = self.project.getInstaller(item.itemType);
- var uninstaller = self.project.getUninstaller(item.itemType);
- var actionArgs = [item, plugin, self.project, options];
-
- var action;
- if (operation === PluginManager.INSTALL) {
- action = actions.createAction.apply(actions, [installer, actionArgs, uninstaller, actionArgs]);
- } else /* op === PluginManager.UNINSTALL */{
- action = actions.createAction.apply(actions, [uninstaller, actionArgs, installer, actionArgs]);
- }
- actions.push(action);
- });
-
- // ... and run through the action stack
- return actions.process(this.platform)
- .then(function () {
- if (self.project.write) {
- self.project.write();
- }
-
- if (operation === PluginManager.INSTALL) {
- // Ignore passed `is_top_level` option since platform itself doesn't know
- // anything about managing dependencies - it's responsibility of caller.
- self.munger.add_plugin_changes(plugin, options.variables, /*is_top_level=*/true, /*should_increment=*/true, options.force);
- self.munger.platformJson.addPluginMetadata(plugin);
- } else {
- self.munger.remove_plugin_changes(plugin, /*is_top_level=*/true);
- self.munger.platformJson.removePluginMetadata(plugin);
- }
-
- // Save everything (munge and plugin/modules metadata)
- self.munger.save_all();
-
- var metadata = self.munger.platformJson.generateMetadata();
- fs.writeFileSync(path.join(self.locations.www, 'cordova_plugins.js'), metadata, 'utf-8');
-
- // CB-11022 save plugin metadata to both www and platform_www if options.usePlatformWww is specified
- if (options.usePlatformWww) {
- fs.writeFileSync(path.join(self.locations.platformWww, 'cordova_plugins.js'), metadata, 'utf-8');
- }
- });
-};
-
-PluginManager.prototype.addPlugin = function (plugin, installOptions) {
- return this.doOperation(PluginManager.INSTALL, plugin, installOptions);
-};
-
-PluginManager.prototype.removePlugin = function (plugin, uninstallOptions) {
- return this.doOperation(PluginManager.UNINSTALL, plugin, uninstallOptions);
-};
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/events.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/events.js
deleted file mode 100644
index e702bd8..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/events.js
+++ /dev/null
@@ -1,72 +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.
-*/
-
-var EventEmitter = require('events').EventEmitter;
-
-var INSTANCE = new EventEmitter();
-var EVENTS_RECEIVER;
-
-module.exports = INSTANCE;
-
-/**
- * Sets up current instance to forward emitted events to another EventEmitter
- * instance.
- *
- * @param {EventEmitter} [eventEmitter] The emitter instance to forward
- * events to. Falsy value, when passed, disables forwarding.
- */
-module.exports.forwardEventsTo = function (eventEmitter) {
-
- // If no argument is specified disable events forwarding
- if (!eventEmitter) {
- EVENTS_RECEIVER = undefined;
- return;
- }
-
- if (!(eventEmitter instanceof EventEmitter))
- throw new Error('Cordova events can be redirected to another EventEmitter instance only');
-
- // CB-10940 Skipping forwarding to self to avoid infinite recursion.
- // This is the case when the modules are npm-linked.
- if (this !== eventEmitter) {
- EVENTS_RECEIVER = eventEmitter;
- } else {
- // Reset forwarding if we are subscribing to self
- EVENTS_RECEIVER = undefined;
- }
-};
-
-var emit = INSTANCE.emit;
-
-/**
- * This method replaces original 'emit' method to allow events forwarding.
- *
- * @return {eventEmitter} Current instance to allow calls chaining, as
- * original 'emit' does
- */
-module.exports.emit = function () {
-
- var args = Array.prototype.slice.call(arguments);
-
- if (EVENTS_RECEIVER) {
- EVENTS_RECEIVER.emit.apply(EVENTS_RECEIVER, args);
- }
-
- return emit.apply(this, args);
-};
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/superspawn.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/superspawn.js
deleted file mode 100644
index a3f1431..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/superspawn.js
+++ /dev/null
@@ -1,184 +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.
-*/
-
-var child_process = require('child_process');
-var fs = require('fs');
-var path = require('path');
-var _ = require('underscore');
-var Q = require('q');
-var shell = require('shelljs');
-var events = require('./events');
-var iswin32 = process.platform == 'win32';
-
-// On Windows, spawn() for batch files requires absolute path & having the extension.
-function resolveWindowsExe(cmd) {
- var winExtensions = ['.exe', '.bat', '.cmd', '.js', '.vbs'];
- function isValidExe(c) {
- return winExtensions.indexOf(path.extname(c)) !== -1 && fs.existsSync(c);
- }
- if (isValidExe(cmd)) {
- return cmd;
- }
- cmd = shell.which(cmd) || cmd;
- if (!isValidExe(cmd)) {
- winExtensions.some(function(ext) {
- if (fs.existsSync(cmd + ext)) {
- cmd = cmd + ext;
- return true;
- }
- });
- }
- return cmd;
-}
-
-function maybeQuote(a) {
- if (/^[^"].*[ &].*[^"]/.test(a)) return '"' + a + '"';
- return a;
-}
-
-/**
- * A special implementation for child_process.spawn that handles
- * Windows-specific issues with batch files and spaces in paths. Returns a
- * promise that succeeds only for return code 0. It is also possible to
- * subscribe on spawned process' stdout and stderr streams using progress
- * handler for resultant promise.
- *
- * @example spawn('mycommand', [], {stdio: 'pipe'}) .progress(function (stdio){
- * if (stdio.stderr) { console.error(stdio.stderr); } })
- * .then(function(result){ // do other stuff })
- *
- * @param {String} cmd A command to spawn
- * @param {String[]} [args=[]] An array of arguments, passed to spawned
- * process
- * @param {Object} [opts={}] A configuration object
- * @param {String|String[]|Object} opts.stdio Property that configures how
- * spawned process' stdio will behave. Has the same meaning and possible
- * values as 'stdio' options for child_process.spawn method
- * (https://nodejs.org/api/child_process.html#child_process_options_stdio).
- * @param {Object} [env={}] A map of extra environment variables
- * @param {String} [cwd=process.cwd()] Working directory for the command
- * @param {Boolean} [chmod=false] If truthy, will attempt to set the execute
- * bit before executing on non-Windows platforms
- *
- * @return {Promise} A promise that is either fulfilled if the spawned
- * process is exited with zero error code or rejected otherwise. If the
- * 'stdio' option set to 'default' or 'pipe', the promise also emits progress
- * messages with the following contents:
- * {
- * 'stdout': ...,
- * 'stderr': ...
- * }
- */
-exports.spawn = function(cmd, args, opts) {
- args = args || [];
- opts = opts || {};
- var spawnOpts = {};
- var d = Q.defer();
-
- if (iswin32) {
- cmd = resolveWindowsExe(cmd);
- // If we couldn't find the file, likely we'll end up failing,
- // but for things like "del", cmd will do the trick.
- if (path.extname(cmd) != '.exe') {
- var cmdArgs = '"' + [cmd].concat(args).map(maybeQuote).join(' ') + '"';
- // We need to use /s to ensure that spaces are parsed properly with cmd spawned content
- args = [['/s', '/c', cmdArgs].join(' ')];
- cmd = 'cmd';
- spawnOpts.windowsVerbatimArguments = true;
- } else if (!fs.existsSync(cmd)) {
- // We need to use /s to ensure that spaces are parsed properly with cmd spawned content
- args = ['/s', '/c', cmd].concat(args).map(maybeQuote);
- }
- }
-
- if (opts.stdio !== 'default') {
- // Ignore 'default' value for stdio because it corresponds to child_process's default 'pipe' option
- spawnOpts.stdio = opts.stdio;
- }
-
- if (opts.cwd) {
- spawnOpts.cwd = opts.cwd;
- }
-
- if (opts.env) {
- spawnOpts.env = _.extend(_.extend({}, process.env), opts.env);
- }
-
- if (opts.chmod && !iswin32) {
- try {
- // This fails when module is installed in a system directory (e.g. via sudo npm install)
- fs.chmodSync(cmd, '755');
- } catch (e) {
- // If the perms weren't set right, then this will come as an error upon execution.
- }
- }
-
- events.emit(opts.printCommand ? 'log' : 'verbose', 'Running command: ' + maybeQuote(cmd) + ' ' + args.map(maybeQuote).join(' '));
-
- var child = child_process.spawn(cmd, args, spawnOpts);
- var capturedOut = '';
- var capturedErr = '';
-
- if (child.stdout) {
- child.stdout.setEncoding('utf8');
- child.stdout.on('data', function(data) {
- capturedOut += data;
- d.notify({'stdout': data});
- });
- }
-
- if (child.stderr) {
- child.stderr.setEncoding('utf8');
- child.stderr.on('data', function(data) {
- capturedErr += data;
- d.notify({'stderr': data});
- });
- }
-
- child.on('close', whenDone);
- child.on('error', whenDone);
- function whenDone(arg) {
- child.removeListener('close', whenDone);
- child.removeListener('error', whenDone);
- var code = typeof arg == 'number' ? arg : arg && arg.code;
-
- events.emit('verbose', 'Command finished with error code ' + code + ': ' + cmd + ' ' + args);
- if (code === 0) {
- d.resolve(capturedOut.trim());
- } else {
- var errMsg = cmd + ': Command failed with exit code ' + code;
- if (capturedErr) {
- errMsg += ' Error output:\n' + capturedErr.trim();
- }
- var err = new Error(errMsg);
- err.code = code;
- d.reject(err);
- }
- }
-
- return d.promise;
-};
-
-exports.maybeSpawn = function(cmd, args, opts) {
- if (fs.existsSync(cmd)) {
- return exports.spawn(cmd, args, opts);
- }
- return Q(null);
-};
-
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/util/addProperty.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/util/addProperty.js
deleted file mode 100644
index 7dc4dc1..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/util/addProperty.js
+++ /dev/null
@@ -1,32 +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.
-*/
-
-module.exports = function addProperty(module, property, modulePath, obj) {
-
- obj = obj || module.exports;
- // Add properties as getter to delay load the modules on first invocation
- Object.defineProperty(obj, property, {
- configurable: true,
- get: function () {
- var delayLoadedModule = module.require(modulePath);
- obj[property] = delayLoadedModule;
- return delayLoadedModule;
- }
- });
-};
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/util/plist-helpers.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/util/plist-helpers.js
deleted file mode 100644
index 9dee5c6..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/util/plist-helpers.js
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- *
- * Copyright 2013 Brett Rudd
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-// contains PLIST utility functions
-var __ = require('underscore');
-var plist = require('plist');
-
-// adds node to doc at selector
-module.exports.graftPLIST = graftPLIST;
-function graftPLIST(doc, xml, selector) {
- var obj = plist.parse(''+xml+' ');
-
- var node = doc[selector];
- if (node && Array.isArray(node) && Array.isArray(obj)){
- node = node.concat(obj);
- for (var i =0;i. If we have two dicts we merge them instead of
- // overriding the old one. See CB-6472
- if (node && __.isObject(node) && __.isObject(obj) && !__.isDate(node) && !__.isDate(obj)){//arrays checked above
- __.extend(obj,node);
- }
- doc[selector] = obj;
- }
-
- return true;
-}
-
-// removes node from doc at selector
-module.exports.prunePLIST = prunePLIST;
-function prunePLIST(doc, xml, selector) {
- var obj = plist.parse(''+xml+' ');
-
- pruneOBJECT(doc, selector, obj);
-
- return true;
-}
-
-function pruneOBJECT(doc, selector, fragment) {
- if (Array.isArray(fragment) && Array.isArray(doc[selector])) {
- var empty = true;
- for (var i in fragment) {
- for (var j in doc[selector]) {
- empty = pruneOBJECT(doc[selector], j, fragment[i]) && empty;
- }
- }
- if (empty)
- {
- delete doc[selector];
- return true;
- }
- }
- else if (nodeEqual(doc[selector], fragment)) {
- delete doc[selector];
- return true;
- }
-
- return false;
-}
-
-function nodeEqual(node1, node2) {
- if (typeof node1 != typeof node2)
- return false;
- else if (typeof node1 == 'string') {
- node2 = escapeRE(node2).replace(new RegExp('\\$[a-zA-Z0-9-_]+','gm'),'(.*?)');
- return new RegExp('^' + node2 + '$').test(node1);
- }
- else {
- for (var key in node2) {
- if (!nodeEqual(node1[key], node2[key])) return false;
- }
- return true;
- }
-}
-
-// escape string for use in regex
-function escapeRE(str) {
- return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '$&');
-}
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/util/xml-helpers.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/util/xml-helpers.js
deleted file mode 100644
index 9a1e82d..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-common/src/util/xml-helpers.js
+++ /dev/null
@@ -1,366 +0,0 @@
-/*
- *
- * Copyright 2013 Anis Kadri
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/* jshint sub:true, laxcomma:true */
-
-/**
- * contains XML utility functions, some of which are specific to elementtree
- */
-
-var fs = require('fs')
- , path = require('path')
- , _ = require('underscore')
- , et = require('elementtree')
- ;
-
- var ROOT = /^\/([^\/]*)/,
- ABSOLUTE = /^\/([^\/]*)\/(.*)/;
-
-module.exports = {
- // compare two et.XML nodes, see if they match
- // compares tagName, text, attributes and children (recursively)
- equalNodes: function(one, two) {
- if (one.tag != two.tag) {
- return false;
- } else if (one.text.trim() != two.text.trim()) {
- return false;
- } else if (one._children.length != two._children.length) {
- return false;
- }
-
- if (!attribMatch(one, two)) return false;
-
- for (var i = 0; i < one._children.length; i++) {
- if (!module.exports.equalNodes(one._children[i], two._children[i])) {
- return false;
- }
- }
-
- return true;
- },
-
- // adds node to doc at selector, creating parent if it doesn't exist
- graftXML: function(doc, nodes, selector, after) {
- var parent = module.exports.resolveParent(doc, selector);
- if (!parent) {
- //Try to create the parent recursively if necessary
- try {
- var parentToCreate = et.XML('<' + path.basename(selector) + '>'),
- parentSelector = path.dirname(selector);
-
- this.graftXML(doc, [parentToCreate], parentSelector);
- } catch (e) {
- return false;
- }
- parent = module.exports.resolveParent(doc, selector);
- if (!parent) return false;
- }
-
- nodes.forEach(function (node) {
- // check if child is unique first
- if (uniqueChild(node, parent)) {
- var children = parent.getchildren();
- var insertIdx = after ? findInsertIdx(children, after) : children.length;
-
- //TODO: replace with parent.insert after the bug in ElementTree is fixed
- parent.getchildren().splice(insertIdx, 0, node);
- }
- });
-
- return true;
- },
-
- // adds new attributes to doc at selector
- // Will only merge if attribute has not been modified already or --force is used
- graftXMLMerge: function(doc, nodes, selector, xml) {
- var target = module.exports.resolveParent(doc, selector);
- if (!target) return false;
-
- // saves the attributes of the original xml before making changes
- xml.oldAttrib = _.extend({}, target.attrib);
-
- nodes.forEach(function (node) {
- var attributes = node.attrib;
- for (var attribute in attributes) {
- target.attrib[attribute] = node.attrib[attribute];
- }
- });
-
- return true;
- },
-
- // overwrite all attributes to doc at selector with new attributes
- // Will only overwrite if attribute has not been modified already or --force is used
- graftXMLOverwrite: function(doc, nodes, selector, xml) {
- var target = module.exports.resolveParent(doc, selector);
- if (!target) return false;
-
- // saves the attributes of the original xml before making changes
- xml.oldAttrib = _.extend({}, target.attrib);
-
- // remove old attributes from target
- var targetAttributes = target.attrib;
- for (var targetAttribute in targetAttributes) {
- delete targetAttributes[targetAttribute];
- }
-
- // add new attributes to target
- nodes.forEach(function (node) {
- var attributes = node.attrib;
- for (var attribute in attributes) {
- target.attrib[attribute] = node.attrib[attribute];
- }
- });
-
- return true;
- },
-
- // removes node from doc at selector
- pruneXML: function(doc, nodes, selector) {
- var parent = module.exports.resolveParent(doc, selector);
- if (!parent) return false;
-
- nodes.forEach(function (node) {
- var matchingKid = null;
- if ((matchingKid = findChild(node, parent)) !== null) {
- // stupid elementtree takes an index argument it doesn't use
- // and does not conform to the python lib
- parent.remove(matchingKid);
- }
- });
-
- return true;
- },
-
- // restores attributes from doc at selector
- pruneXMLRestore: function(doc, selector, xml) {
- var target = module.exports.resolveParent(doc, selector);
- if (!target) return false;
-
- if (xml.oldAttrib) {
- target.attrib = _.extend({}, xml.oldAttrib);
- }
-
- return true;
- },
-
- prunXMLRemove: function(doc, selector, nodes) {
- var target = module.exports.resolveParent(doc, selector);
- if (!target) return false;
-
- nodes.forEach(function (node) {
- var attributes = node.attrib;
- for (var attribute in attributes) {
- if (target.attrib[attribute]) {
- delete target.attrib[attribute];
- }
- }
- });
-
- return true;
-
- },
-
-
- parseElementtreeSync: function (filename) {
- var contents = fs.readFileSync(filename, 'utf-8');
- if(contents) {
- //Windows is the BOM. Skip the Byte Order Mark.
- contents = contents.substring(contents.indexOf('<'));
- }
- return new et.ElementTree(et.XML(contents));
- },
-
- resolveParent: function (doc, selector) {
- var parent, tagName, subSelector;
-
- // handle absolute selector (which elementtree doesn't like)
- if (ROOT.test(selector)) {
- tagName = selector.match(ROOT)[1];
- // test for wildcard "any-tag" root selector
- if (tagName == '*' || tagName === doc._root.tag) {
- parent = doc._root;
-
- // could be an absolute path, but not selecting the root
- if (ABSOLUTE.test(selector)) {
- subSelector = selector.match(ABSOLUTE)[2];
- parent = parent.find(subSelector);
- }
- } else {
- return false;
- }
- } else {
- parent = doc.find(selector);
- }
- return parent;
- }
-};
-
-function findChild(node, parent) {
- var matchingKids = parent.findall(node.tag)
- , i, j;
-
- for (i = 0, j = matchingKids.length ; i < j ; i++) {
- if (module.exports.equalNodes(node, matchingKids[i])) {
- return matchingKids[i];
- }
- }
- return null;
-}
-
-function uniqueChild(node, parent) {
- var matchingKids = parent.findall(node.tag)
- , i = 0;
-
- if (matchingKids.length === 0) {
- return true;
- } else {
- for (i; i < matchingKids.length; i++) {
- if (module.exports.equalNodes(node, matchingKids[i])) {
- return false;
- }
- }
- return true;
- }
-}
-
-// Find the index at which to insert an entry. After is a ;-separated priority list
-// of tags after which the insertion should be made. E.g. If we need to
-// insert an element C, and the rule is that the order of children has to be
-// As, Bs, Cs. After will be equal to "C;B;A".
-function findInsertIdx(children, after) {
- var childrenTags = children.map(function(child) { return child.tag; });
- var afters = after.split(';');
- var afterIndexes = afters.map(function(current) { return childrenTags.lastIndexOf(current); });
- var foundIndex = _.find(afterIndexes, function(index) { return index != -1; });
-
- //add to the beginning if no matching nodes are found
- return typeof foundIndex === 'undefined' ? 0 : foundIndex+1;
-}
-
-var BLACKLIST = ['platform', 'feature','plugin','engine'];
-var SINGLETONS = ['content', 'author', 'name'];
-function mergeXml(src, dest, platform, clobber) {
- // Do nothing for blacklisted tags.
- if (BLACKLIST.indexOf(src.tag) != -1) return;
-
- //Handle attributes
- Object.getOwnPropertyNames(src.attrib).forEach(function (attribute) {
- if (clobber || !dest.attrib[attribute]) {
- dest.attrib[attribute] = src.attrib[attribute];
- }
- });
- //Handle text
- if (src.text && (clobber || !dest.text)) {
- dest.text = src.text;
- }
- //Handle children
- src.getchildren().forEach(mergeChild);
-
- //Handle platform
- if (platform) {
- src.findall('platform[@name="' + platform + '"]').forEach(function (platformElement) {
- platformElement.getchildren().forEach(mergeChild);
- });
- }
-
- //Handle duplicate preference tags (by name attribute)
- removeDuplicatePreferences(dest);
-
- function mergeChild (srcChild) {
- var srcTag = srcChild.tag,
- destChild = new et.Element(srcTag),
- foundChild,
- query = srcTag + '',
- shouldMerge = true;
-
- if (BLACKLIST.indexOf(srcTag) !== -1) return;
-
- if (SINGLETONS.indexOf(srcTag) !== -1) {
- foundChild = dest.find(query);
- if (foundChild) {
- destChild = foundChild;
- dest.remove(destChild);
- }
- } else {
- //Check for an exact match and if you find one don't add
- var mergeCandidates = dest.findall(query)
- .filter(function (foundChild) {
- return foundChild && textMatch(srcChild, foundChild) && attribMatch(srcChild, foundChild);
- });
-
- if (mergeCandidates.length > 0) {
- destChild = mergeCandidates[0];
- dest.remove(destChild);
- shouldMerge = false;
- }
- }
-
- mergeXml(srcChild, destChild, platform, clobber && shouldMerge);
- dest.append(destChild);
- }
-
- function removeDuplicatePreferences(xml) {
- // reduce preference tags to a hashtable to remove dupes
- var prefHash = xml.findall('preference[@name][@value]').reduce(function(previousValue, currentValue) {
- previousValue[ currentValue.attrib.name ] = currentValue.attrib.value;
- return previousValue;
- }, {});
-
- // remove all preferences
- xml.findall('preference[@name][@value]').forEach(function(pref) {
- xml.remove(pref);
- });
-
- // write new preferences
- Object.keys(prefHash).forEach(function(key, index) {
- var element = et.SubElement(xml, 'preference');
- element.set('name', key);
- element.set('value', this[key]);
- }, prefHash);
- }
-}
-
-// Expose for testing.
-module.exports.mergeXml = mergeXml;
-
-function textMatch(elm1, elm2) {
- var text1 = elm1.text ? elm1.text.replace(/\s+/, '') : '',
- text2 = elm2.text ? elm2.text.replace(/\s+/, '') : '';
- return (text1 === '' || text1 === text2);
-}
-
-function attribMatch(one, two) {
- var oneAttribKeys = Object.keys(one.attrib);
- var twoAttribKeys = Object.keys(two.attrib);
-
- if (oneAttribKeys.length != twoAttribKeys.length) {
- return false;
- }
-
- for (var i = 0; i < oneAttribKeys.length; i++) {
- var attribName = oneAttribKeys[i];
-
- if (one.attrib[attribName] != two.attrib[attribName]) {
- return false;
- }
- }
-
- return true;
-}
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-registry-mapper/.npmignore b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-registry-mapper/.npmignore
deleted file mode 100644
index 3c3629e..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-registry-mapper/.npmignore
+++ /dev/null
@@ -1 +0,0 @@
-node_modules
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-registry-mapper/.travis.yml b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-registry-mapper/.travis.yml
deleted file mode 100644
index ae381fc..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-registry-mapper/.travis.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-language: node_js
-sudo: false
-node_js:
- - "0.10"
-install: npm install
-script:
- - npm test
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-registry-mapper/README.md b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-registry-mapper/README.md
deleted file mode 100644
index 3b93e5f..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-registry-mapper/README.md
+++ /dev/null
@@ -1,14 +0,0 @@
-[](https://travis-ci.org/stevengill/cordova-registry-mapper)
-
-#Cordova Registry Mapper
-
-This module is used to map Cordova plugin ids to package names and vice versa.
-
-When Cordova users add plugins to their projects using ids
-(e.g. `cordova plugin add org.apache.cordova.device`),
-this module will map that id to the corresponding package name so `cordova-lib` knows what to fetch from **npm**.
-
-This module was created so the Apache Cordova project could migrate its plugins from
-the [Cordova Registry](http://registry.cordova.io/)
-to [npm](https://registry.npmjs.com/)
-instead of having to maintain a registry.
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-registry-mapper/index.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-registry-mapper/index.js
deleted file mode 100644
index 4550774..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-registry-mapper/index.js
+++ /dev/null
@@ -1,204 +0,0 @@
-var map = {
- 'org.apache.cordova.battery-status':'cordova-plugin-battery-status',
- 'org.apache.cordova.camera':'cordova-plugin-camera',
- 'org.apache.cordova.console':'cordova-plugin-console',
- 'org.apache.cordova.contacts':'cordova-plugin-contacts',
- 'org.apache.cordova.device':'cordova-plugin-device',
- 'org.apache.cordova.device-motion':'cordova-plugin-device-motion',
- 'org.apache.cordova.device-orientation':'cordova-plugin-device-orientation',
- 'org.apache.cordova.dialogs':'cordova-plugin-dialogs',
- 'org.apache.cordova.file':'cordova-plugin-file',
- 'org.apache.cordova.file-transfer':'cordova-plugin-file-transfer',
- 'org.apache.cordova.geolocation':'cordova-plugin-geolocation',
- 'org.apache.cordova.globalization':'cordova-plugin-globalization',
- 'org.apache.cordova.inappbrowser':'cordova-plugin-inappbrowser',
- 'org.apache.cordova.media':'cordova-plugin-media',
- 'org.apache.cordova.media-capture':'cordova-plugin-media-capture',
- 'org.apache.cordova.network-information':'cordova-plugin-network-information',
- 'org.apache.cordova.splashscreen':'cordova-plugin-splashscreen',
- 'org.apache.cordova.statusbar':'cordova-plugin-statusbar',
- 'org.apache.cordova.vibration':'cordova-plugin-vibration',
- 'org.apache.cordova.test-framework':'cordova-plugin-test-framework',
- 'com.msopentech.websql' : 'cordova-plugin-websql',
- 'com.msopentech.indexeddb' : 'cordova-plugin-indexeddb',
- 'com.microsoft.aad.adal' : 'cordova-plugin-ms-adal',
- 'com.microsoft.capptain' : 'capptain-cordova',
- 'com.microsoft.services.aadgraph' : 'cordova-plugin-ms-aad-graph',
- 'com.microsoft.services.files' : 'cordova-plugin-ms-files',
- 'om.microsoft.services.outlook' : 'cordova-plugin-ms-outlook',
- 'com.pbakondy.sim' : 'cordova-plugin-sim',
- 'android.support.v4' : 'cordova-plugin-android-support-v4',
- 'android.support.v7-appcompat' : 'cordova-plugin-android-support-v7-appcompat',
- 'com.google.playservices' : 'cordova-plugin-googleplayservices',
- 'com.google.cordova.admob' : 'cordova-plugin-admobpro',
- 'com.rjfun.cordova.extension' : 'cordova-plugin-extension',
- 'com.rjfun.cordova.plugin.admob' : 'cordova-plugin-admob',
- 'com.rjfun.cordova.flurryads' : 'cordova-plugin-flurry',
- 'com.rjfun.cordova.facebookads' : 'cordova-plugin-facebookads',
- 'com.rjfun.cordova.httpd' : 'cordova-plugin-httpd',
- 'com.rjfun.cordova.iad' : 'cordova-plugin-iad',
- 'com.rjfun.cordova.iflyspeech' : 'cordova-plugin-iflyspeech',
- 'com.rjfun.cordova.lianlianpay' : 'cordova-plugin-lianlianpay',
- 'com.rjfun.cordova.mobfox' : 'cordova-plugin-mobfox',
- 'com.rjfun.cordova.mopub' : 'cordova-plugin-mopub',
- 'com.rjfun.cordova.mmedia' : 'cordova-plugin-mmedia',
- 'com.rjfun.cordova.nativeaudio' : 'cordova-plugin-nativeaudio',
- 'com.rjfun.cordova.plugin.paypalmpl' : 'cordova-plugin-paypalmpl',
- 'com.rjfun.cordova.smartadserver' : 'cordova-plugin-smartadserver',
- 'com.rjfun.cordova.sms' : 'cordova-plugin-sms',
- 'com.rjfun.cordova.wifi' : 'cordova-plugin-wifi',
- 'com.ohh2ahh.plugins.appavailability' : 'cordova-plugin-appavailability',
- 'org.adapt-it.cordova.fonts' : 'cordova-plugin-fonts',
- 'de.martinreinhardt.cordova.plugins.barcodeScanner' : 'cordova-plugin-barcodescanner',
- 'de.martinreinhardt.cordova.plugins.urlhandler' : 'cordova-plugin-urlhandler',
- 'de.martinreinhardt.cordova.plugins.email' : 'cordova-plugin-email',
- 'de.martinreinhardt.cordova.plugins.certificates' : 'cordova-plugin-certificates',
- 'de.martinreinhardt.cordova.plugins.sqlite' : 'cordova-plugin-sqlite',
- 'fr.smile.cordova.fileopener' : 'cordova-plugin-fileopener',
- 'org.smile.websqldatabase.initializer' : 'cordova-plugin-websqldatabase-initializer',
- 'org.smile.websqldatabase.wpdb' : 'cordova-plugin-websqldatabase',
- 'org.jboss.aerogear.cordova.push' : 'aerogear-cordova-push',
- 'org.jboss.aerogear.cordova.oauth2' : 'aerogear-cordova-oauth2',
- 'org.jboss.aerogear.cordova.geo' : 'aerogear-cordova-geo',
- 'org.jboss.aerogear.cordova.crypto' : 'aerogear-cordova-crypto',
- 'org.jboss.aerogaer.cordova.otp' : 'aerogear-cordova-otp',
- 'uk.co.ilee.applewatch' : 'cordova-plugin-apple-watch',
- 'uk.co.ilee.directions' : 'cordova-plugin-directions',
- 'uk.co.ilee.gamecenter' : 'cordova-plugin-game-center',
- 'uk.co.ilee.jailbreakdetection' : 'cordova-plugin-jailbreak-detection',
- 'uk.co.ilee.nativetransitions' : 'cordova-plugin-native-transitions',
- 'uk.co.ilee.pedometer' : 'cordova-plugin-pedometer',
- 'uk.co.ilee.shake' : 'cordova-plugin-shake',
- 'uk.co.ilee.touchid' : 'cordova-plugin-touchid',
- 'com.knowledgecode.cordova.websocket' : 'cordova-plugin-websocket',
- 'com.elixel.plugins.settings' : 'cordova-plugin-settings',
- 'com.cowbell.cordova.geofence' : 'cordova-plugin-geofence',
- 'com.blackberry.community.preventsleep' : 'cordova-plugin-preventsleep',
- 'com.blackberry.community.gamepad' : 'cordova-plugin-gamepad',
- 'com.blackberry.community.led' : 'cordova-plugin-led',
- 'com.blackberry.community.thumbnail' : 'cordova-plugin-thumbnail',
- 'com.blackberry.community.mediakeys' : 'cordova-plugin-mediakeys',
- 'com.blackberry.community.simplebtlehrplugin' : 'cordova-plugin-bluetoothheartmonitor',
- 'com.blackberry.community.simplebeaconplugin' : 'cordova-plugin-bluetoothibeacon',
- 'com.blackberry.community.simplebtsppplugin' : 'cordova-plugin-bluetoothspp',
- 'com.blackberry.community.clipboard' : 'cordova-plugin-clipboard',
- 'com.blackberry.community.curl' : 'cordova-plugin-curl',
- 'com.blackberry.community.qt' : 'cordova-plugin-qtbridge',
- 'com.blackberry.community.upnp' : 'cordova-plugin-upnp',
- 'com.blackberry.community.PasswordCrypto' : 'cordova-plugin-password-crypto',
- 'com.blackberry.community.deviceinfoplugin' : 'cordova-plugin-deviceinfo',
- 'com.blackberry.community.gsecrypto' : 'cordova-plugin-bb-crypto',
- 'com.blackberry.community.mongoose' : 'cordova-plugin-mongoose',
- 'com.blackberry.community.sysdialog' : 'cordova-plugin-bb-sysdialog',
- 'com.blackberry.community.screendisplay' : 'cordova-plugin-screendisplay',
- 'com.blackberry.community.messageplugin' : 'cordova-plugin-bb-messageretrieve',
- 'com.blackberry.community.emailsenderplugin' : 'cordova-plugin-emailsender',
- 'com.blackberry.community.audiometadata' : 'cordova-plugin-audiometadata',
- 'com.blackberry.community.deviceemails' : 'cordova-plugin-deviceemails',
- 'com.blackberry.community.audiorecorder' : 'cordova-plugin-audiorecorder',
- 'com.blackberry.community.vibration' : 'cordova-plugin-vibrate-intense',
- 'com.blackberry.community.SMSPlugin' : 'cordova-plugin-bb-sms',
- 'com.blackberry.community.extractZipFile' : 'cordova-plugin-bb-zip',
- 'com.blackberry.community.lowlatencyaudio' : 'cordova-plugin-bb-nativeaudio',
- 'com.blackberry.community.barcodescanner' : 'phonegap-plugin-barcodescanner',
- 'com.blackberry.app' : 'cordova-plugin-bb-app',
- 'com.blackberry.bbm.platform' : 'cordova-plugin-bbm',
- 'com.blackberry.connection' : 'cordova-plugin-bb-connection',
- 'com.blackberry.identity' : 'cordova-plugin-bb-identity',
- 'com.blackberry.invoke.card' : 'cordova-plugin-bb-card',
- 'com.blackberry.invoke' : 'cordova-plugin-bb-invoke',
- 'com.blackberry.invoked' : 'cordova-plugin-bb-invoked',
- 'com.blackberry.io.filetransfer' : 'cordova-plugin-bb-filetransfer',
- 'com.blackberry.io' : 'cordova-plugin-bb-io',
- 'com.blackberry.notification' : 'cordova-plugin-bb-notification',
- 'com.blackberry.payment' : 'cordova-plugin-bb-payment',
- 'com.blackberry.pim.calendar' : 'cordova-plugin-bb-calendar',
- 'com.blackberry.pim.contacts' : 'cordova-plugin-bb-contacts',
- 'com.blackberry.pim.lib' : 'cordova-plugin-bb-pimlib',
- 'com.blackberry.push' : 'cordova-plugin-bb-push',
- 'com.blackberry.screenshot' : 'cordova-plugin-screenshot',
- 'com.blackberry.sensors' : 'cordova-plugin-bb-sensors',
- 'com.blackberry.system' : 'cordova-plugin-bb-system',
- 'com.blackberry.ui.contextmenu' : 'cordova-plugin-bb-ctxmenu',
- 'com.blackberry.ui.cover' : 'cordova-plugin-bb-cover',
- 'com.blackberry.ui.dialog' : 'cordova-plugin-bb-dialog',
- 'com.blackberry.ui.input' : 'cordova-plugin-touch-keyboard',
- 'com.blackberry.ui.toast' : 'cordova-plugin-toast',
- 'com.blackberry.user.identity' : 'cordova-plugin-bb-idservice',
- 'com.blackberry.utils' : 'cordova-plugin-bb-utils',
- 'net.yoik.cordova.plugins.screenorientation' : 'cordova-plugin-screen-orientation',
- 'com.phonegap.plugins.barcodescanner' : 'phonegap-plugin-barcodescanner',
- 'com.manifoldjs.hostedwebapp' : 'cordova-plugin-hostedwebapp',
- 'com.initialxy.cordova.themeablebrowser' : 'cordova-plugin-themeablebrowser',
- 'gr.denton.photosphere' : 'cordova-plugin-panoramaviewer',
- 'nl.x-services.plugins.actionsheet' : 'cordova-plugin-actionsheet',
- 'nl.x-services.plugins.socialsharing' : 'cordova-plugin-x-socialsharing',
- 'nl.x-services.plugins.googleplus' : 'cordova-plugin-googleplus',
- 'nl.x-services.plugins.insomnia' : 'cordova-plugin-insomnia',
- 'nl.x-services.plugins.toast' : 'cordova-plugin-x-toast',
- 'nl.x-services.plugins.calendar' : 'cordova-plugin-calendar',
- 'nl.x-services.plugins.launchmyapp' : 'cordova-plugin-customurlscheme',
- 'nl.x-services.plugins.flashlight' : 'cordova-plugin-flashlight',
- 'nl.x-services.plugins.sslcertificatechecker' : 'cordova-plugin-sslcertificatechecker',
- 'com.bridge.open' : 'cordova-open',
- 'com.bridge.safe' : 'cordova-safe',
- 'com.disusered.open' : 'cordova-open',
- 'com.disusered.safe' : 'cordova-safe',
- 'me.apla.cordova.app-preferences' : 'cordova-plugin-app-preferences',
- 'com.konotor.cordova' : 'cordova-plugin-konotor',
- 'io.intercom.cordova' : 'cordova-plugin-intercom',
- 'com.onesignal.plugins.onesignal' : 'onesignal-cordova-plugin',
- 'com.danjarvis.document-contract': 'cordova-plugin-document-contract',
- 'com.eface2face.iosrtc' : 'cordova-plugin-iosrtc',
- 'com.mobileapptracking.matplugin' : 'cordova-plugin-tune',
- 'com.marianhello.cordova.background-geolocation' : 'cordova-plugin-mauron85-background-geolocation',
- 'fr.louisbl.cordova.locationservices' : 'cordova-plugin-locationservices',
- 'fr.louisbl.cordova.gpslocation' : 'cordova-plugin-gpslocation',
- 'com.hiliaox.weibo' : 'cordova-plugin-weibo',
- 'com.uxcam.cordova.plugin' : 'cordova-uxcam',
- 'de.fastr.phonegap.plugins.downloader' : 'cordova-plugin-fastrde-downloader',
- 'de.fastr.phonegap.plugins.injectView' : 'cordova-plugin-fastrde-injectview',
- 'de.fastr.phonegap.plugins.CheckGPS' : 'cordova-plugin-fastrde-checkgps',
- 'de.fastr.phonegap.plugins.md5chksum' : 'cordova-plugin-fastrde-md5',
- 'io.repro.cordova' : 'cordova-plugin-repro',
- 're.notifica.cordova': 'cordova-plugin-notificare-push',
- 'com.megster.cordova.ble': 'cordova-plugin-ble-central',
- 'com.megster.cordova.bluetoothserial': 'cordova-plugin-bluetooth-serial',
- 'com.megster.cordova.rfduino': 'cordova-plugin-rfduino',
- 'cz.velda.cordova.plugin.devicefeedback': 'cordova-plugin-velda-devicefeedback',
- 'cz.Velda.cordova.plugin.devicefeedback': 'cordova-plugin-velda-devicefeedback',
- 'org.scriptotek.appinfo': 'cordova-plugin-appinfo',
- 'com.yezhiming.cordova.appinfo': 'cordova-plugin-appinfo',
- 'pl.makingwaves.estimotebeacons': 'cordova-plugin-estimote',
- 'com.evothings.ble': 'cordova-plugin-ble',
- 'com.appsee.plugin' : 'cordova-plugin-appsee',
- 'am.armsoft.plugins.listpicker': 'cordova-plugin-listpicker',
- 'com.pushbots.push': 'pushbots-cordova-plugin',
- 'com.admob.google': 'cordova-admob',
- 'admob.ads.google': 'cordova-admob-ads',
- 'admob.google.plugin': 'admob-google',
- 'com.admob.admobads': 'admob-ads',
- 'com.connectivity.monitor': 'cordova-connectivity-monitor',
- 'com.ios.libgoogleadmobads': 'cordova-libgoogleadmobads',
- 'com.google.play.services': 'cordova-google-play-services',
- 'android.support.v13': 'cordova-android-support-v13',
- 'android.support.v4': 'cordova-android-support-v4', // Duplicated key ;)
- 'com.analytics.google': 'cordova-plugin-analytics',
- 'com.analytics.adid.google': 'cordova-plugin-analytics-adid',
- 'com.chariotsolutions.nfc.plugin': 'phonegap-nfc',
- 'com.samz.mixpanel': 'cordova-plugin-mixpanel',
- 'de.appplant.cordova.common.RegisterUserNotificationSettings': 'cordova-plugin-registerusernotificationsettings',
- 'plugin.google.maps': 'cordova-plugin-googlemaps',
- 'xu.li.cordova.wechat': 'cordova-plugin-wechat',
- 'es.keensoft.fullscreenimage': 'cordova-plugin-fullscreenimage',
- 'com.arcoirislabs.plugin.mqtt' : 'cordova-plugin-mqtt'
-};
-
-module.exports.oldToNew = map;
-
-var reverseMap = {};
-Object.keys(map).forEach(function(elem){
- reverseMap[map[elem]] = elem;
-});
-
-module.exports.newToOld = reverseMap;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-registry-mapper/package.json b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-registry-mapper/package.json
deleted file mode 100644
index f835196..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-registry-mapper/package.json
+++ /dev/null
@@ -1,86 +0,0 @@
-{
- "_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",
- "_id": "cordova-registry-mapper@1.1.15",
- "_inCache": true,
- "_installable": true,
- "_location": "/cordova-registry-mapper",
- "_nodeVersion": "5.4.1",
- "_npmUser": {
- "name": "stevegill",
- "email": "stevengill97@gmail.com"
- },
- "_npmVersion": "3.5.3",
- "_phantomChildren": {},
- "_requested": {
- "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"
- },
- "_requiredBy": [
- "/cordova-common"
- ],
- "_resolved": "http://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",
- "author": {
- "name": "Steve Gill"
- },
- "bugs": {
- "url": "https://github.com/stevengill/cordova-registry-mapper/issues"
- },
- "dependencies": {},
- "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",
- "plugins"
- ],
- "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"
- },
- "scripts": {
- "test": "node tests/test.js"
- },
- "version": "1.1.15"
-}
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-registry-mapper/tests/test.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-registry-mapper/tests/test.js
deleted file mode 100644
index 35343be..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/cordova-registry-mapper/tests/test.js
+++ /dev/null
@@ -1,11 +0,0 @@
-var test = require('tape');
-var oldToNew = require('../index').oldToNew;
-var newToOld = require('../index').newToOld;
-
-test('plugin mappings exist', function(t) {
- t.plan(2);
-
- t.equal('cordova-plugin-device', oldToNew['org.apache.cordova.device']);
-
- t.equal('org.apache.cordova.device', newToOld['cordova-plugin-device']);
-})
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/.npmignore b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/.npmignore
deleted file mode 100644
index 3c3629e..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/.npmignore
+++ /dev/null
@@ -1 +0,0 @@
-node_modules
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/.travis.yml b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/.travis.yml
deleted file mode 100644
index 6f27c96..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/.travis.yml
+++ /dev/null
@@ -1,10 +0,0 @@
-language: node_js
-
-node_js:
- - 0.6
-
-script: make test
-
-notifications:
- email:
- - tomaz+travisci@tomaz.me
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/CHANGES.md b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/CHANGES.md
deleted file mode 100644
index 50d415d..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/CHANGES.md
+++ /dev/null
@@ -1,39 +0,0 @@
-elementtree v0.1.6 (in development)
-
-* Add support for CData elements. (#14)
- [hermannpencole]
-
-elementtree v0.1.5 - 2012-11-14
-
-* Fix a bug in the find() and findtext() method which could manifest itself
- under some conditions.
- [metagriffin]
-
-elementtree v0.1.4 - 2012-10-15
-
-* Allow user to use namespaced attributes when using find* functions.
- [Andrew Lunny]
-
-elementtree v0.1.3 - 2012-09-21
-
-* Improve the output of text content in the tags (strip unnecessary line break
- characters).
-
-[Darryl Pogue]
-
-elementtree v0.1.2 - 2012-09-04
-
- * Allow user to pass 'indent' option to ElementTree.write method. If this
- option is specified (e.g. {'indent': 4}). XML will be pretty printed.
- [Darryl Pogue, Tomaz Muraus]
-
- * Bump sax dependency version.
-
-elementtree v0.1.1 - 2011-09-23
-
- * Improve special character escaping.
- [Ryan Phillips]
-
-elementtree v0.1.0 - 2011-09-05
-
- * Initial release.
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/LICENSE.txt b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/LICENSE.txt
deleted file mode 100644
index 6b0b127..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/LICENSE.txt
+++ /dev/null
@@ -1,203 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/Makefile b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/Makefile
deleted file mode 100644
index ab7c4e0..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/Makefile
+++ /dev/null
@@ -1,21 +0,0 @@
-TESTS := \
- tests/test-simple.js
-
-
-
-PATH := ./node_modules/.bin:$(PATH)
-
-WHISKEY := $(shell bash -c 'PATH=$(PATH) type -p whiskey')
-
-default: test
-
-test:
- NODE_PATH=`pwd`/lib/ ${WHISKEY} --scope-leaks --sequential --real-time --tests "${TESTS}"
-
-tap:
- NODE_PATH=`pwd`/lib/ ${WHISKEY} --test-reporter tap --sequential --real-time --tests "${TESTS}"
-
-coverage:
- NODE_PATH=`pwd`/lib/ ${WHISKEY} --sequential --coverage --coverage-reporter html --coverage-dir coverage_html --tests "${TESTS}"
-
-.PHONY: default test coverage tap scope
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/NOTICE b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/NOTICE
deleted file mode 100644
index 28ad70a..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/NOTICE
+++ /dev/null
@@ -1,5 +0,0 @@
-node-elementtree
-Copyright (c) 2011, Rackspace, Inc.
-
-The ElementTree toolkit is Copyright (c) 1999-2007 by Fredrik Lundh
-
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/README.md b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/README.md
deleted file mode 100644
index 738420c..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/README.md
+++ /dev/null
@@ -1,141 +0,0 @@
-node-elementtree
-====================
-
-node-elementtree is a [Node.js](http://nodejs.org) XML parser and serializer based upon the [Python ElementTree v1.3](http://effbot.org/zone/element-index.htm) module.
-
-Installation
-====================
-
- $ npm install elementtree
-
-Using the library
-====================
-
-For the usage refer to the Python ElementTree library documentation - [http://effbot.org/zone/element-index.htm#usage](http://effbot.org/zone/element-index.htm#usage).
-
-Supported XPath expressions in `find`, `findall` and `findtext` methods are listed on [http://effbot.org/zone/element-xpath.htm](http://effbot.org/zone/element-xpath.htm).
-
-Example 1 – Creating An XML Document
-====================
-
-This example shows how to build a valid XML document that can be published to
-Atom Hopper. Atom Hopper is used internally as a bridge from products all the
-way to collecting revenue, called “Usage.” MaaS and other products send similar
-events to it every time user performs an action on a resource
-(e.g. creates,updates or deletes). Below is an example of leveraging the API
-to create a new XML document.
-
-```javascript
-var et = require('elementtree');
-var XML = et.XML;
-var ElementTree = et.ElementTree;
-var element = et.Element;
-var subElement = et.SubElement;
-
-var date, root, tenantId, serviceName, eventType, usageId, dataCenter, region,
-checks, resourceId, category, startTime, resourceName, etree, xml;
-
-date = new Date();
-
-root = element('entry');
-root.set('xmlns', 'http://www.w3.org/2005/Atom');
-
-tenantId = subElement(root, 'TenantId');
-tenantId.text = '12345';
-
-serviceName = subElement(root, 'ServiceName');
-serviceName.text = 'MaaS';
-
-resourceId = subElement(root, 'ResourceID');
-resourceId.text = 'enAAAA';
-
-usageId = subElement(root, 'UsageID');
-usageId.text = '550e8400-e29b-41d4-a716-446655440000';
-
-eventType = subElement(root, 'EventType');
-eventType.text = 'create';
-
-category = subElement(root, 'category');
-category.set('term', 'monitoring.entity.create');
-
-dataCenter = subElement(root, 'DataCenter');
-dataCenter.text = 'global';
-
-region = subElement(root, 'Region');
-region.text = 'global';
-
-startTime = subElement(root, 'StartTime');
-startTime.text = date;
-
-resourceName = subElement(root, 'ResourceName');
-resourceName.text = 'entity';
-
-etree = new ElementTree(root);
-xml = etree.write({'xml_declaration': false});
-console.log(xml);
-```
-
-As you can see, both et.Element and et.SubElement are factory methods which
-return a new instance of Element and SubElement class, respectively.
-When you create a new element (tag) you can use set method to set an attribute.
-To set the tag value, assign a value to the .text attribute.
-
-This example would output a document that looks like this:
-
-```xml
-
- 12345
- MaaS
- enAAAA
- 550e8400-e29b-41d4-a716-446655440000
- create
-
- global
- global
- Sun Apr 29 2012 16:37:32 GMT-0700 (PDT)
- entity
-
-```
-
-Example 2 – Parsing An XML Document
-====================
-
-This example shows how to parse an XML document and use simple XPath selectors.
-For demonstration purposes, we will use the XML document located at
-https://gist.github.com/2554343.
-
-Behind the scenes, node-elementtree uses Isaac’s sax library for parsing XML,
-but the library has a concept of “parsers,” which means it’s pretty simple to
-add support for a different parser.
-
-```javascript
-var fs = require('fs');
-
-var et = require('elementtree');
-
-var XML = et.XML;
-var ElementTree = et.ElementTree;
-var element = et.Element;
-var subElement = et.SubElement;
-
-var data, etree;
-
-data = fs.readFileSync('document.xml').toString();
-etree = et.parse(data);
-
-console.log(etree.findall('./entry/TenantId').length); // 2
-console.log(etree.findtext('./entry/ServiceName')); // MaaS
-console.log(etree.findall('./entry/category')[0].get('term')); // monitoring.entity.create
-console.log(etree.findall('*/category/[@term="monitoring.entity.update"]').length); // 1
-```
-
-Build status
-====================
-
-[](http://travis-ci.org/racker/node-elementtree)
-
-
-License
-====================
-
-node-elementtree is distributed under the [Apache license](http://www.apache.org/licenses/LICENSE-2.0.html).
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/lib/constants.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/lib/constants.js
deleted file mode 100644
index b057faf..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/lib/constants.js
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright 2011 Rackspace
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-var DEFAULT_PARSER = 'sax';
-
-exports.DEFAULT_PARSER = DEFAULT_PARSER;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/lib/elementpath.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/lib/elementpath.js
deleted file mode 100644
index 2e93f47..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/lib/elementpath.js
+++ /dev/null
@@ -1,343 +0,0 @@
-/**
- * Copyright 2011 Rackspace
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-var sprintf = require('./sprintf').sprintf;
-
-var utils = require('./utils');
-var SyntaxError = require('./errors').SyntaxError;
-
-var _cache = {};
-
-var RE = new RegExp(
- "(" +
- "'[^']*'|\"[^\"]*\"|" +
- "::|" +
- "//?|" +
- "\\.\\.|" +
- "\\(\\)|" +
- "[/.*:\\[\\]\\(\\)@=])|" +
- "((?:\\{[^}]+\\})?[^/\\[\\]\\(\\)@=\\s]+)|" +
- "\\s+", 'g'
-);
-
-var xpath_tokenizer = utils.findall.bind(null, RE);
-
-function prepare_tag(next, token) {
- var tag = token[0];
-
- function select(context, result) {
- var i, len, elem, rv = [];
-
- for (i = 0, len = result.length; i < len; i++) {
- elem = result[i];
- elem._children.forEach(function(e) {
- if (e.tag === tag) {
- rv.push(e);
- }
- });
- }
-
- return rv;
- }
-
- return select;
-}
-
-function prepare_star(next, token) {
- function select(context, result) {
- var i, len, elem, rv = [];
-
- for (i = 0, len = result.length; i < len; i++) {
- elem = result[i];
- elem._children.forEach(function(e) {
- rv.push(e);
- });
- }
-
- return rv;
- }
-
- return select;
-}
-
-function prepare_dot(next, token) {
- function select(context, result) {
- var i, len, elem, rv = [];
-
- for (i = 0, len = result.length; i < len; i++) {
- elem = result[i];
- rv.push(elem);
- }
-
- return rv;
- }
-
- return select;
-}
-
-function prepare_iter(next, token) {
- var tag;
- token = next();
-
- if (token[1] === '*') {
- tag = '*';
- }
- else if (!token[1]) {
- tag = token[0] || '';
- }
- else {
- throw new SyntaxError(token);
- }
-
- function select(context, result) {
- var i, len, elem, rv = [];
-
- for (i = 0, len = result.length; i < len; i++) {
- elem = result[i];
- elem.iter(tag, function(e) {
- if (e !== elem) {
- rv.push(e);
- }
- });
- }
-
- return rv;
- }
-
- return select;
-}
-
-function prepare_dot_dot(next, token) {
- function select(context, result) {
- var i, len, elem, rv = [], parent_map = context.parent_map;
-
- if (!parent_map) {
- context.parent_map = parent_map = {};
-
- context.root.iter(null, function(p) {
- p._children.forEach(function(e) {
- parent_map[e] = p;
- });
- });
- }
-
- for (i = 0, len = result.length; i < len; i++) {
- elem = result[i];
-
- if (parent_map.hasOwnProperty(elem)) {
- rv.push(parent_map[elem]);
- }
- }
-
- return rv;
- }
-
- return select;
-}
-
-
-function prepare_predicate(next, token) {
- var tag, key, value, select;
- token = next();
-
- if (token[1] === '@') {
- // attribute
- token = next();
-
- if (token[1]) {
- throw new SyntaxError(token, 'Invalid attribute predicate');
- }
-
- key = token[0];
- token = next();
-
- if (token[1] === ']') {
- select = function(context, result) {
- var i, len, elem, rv = [];
-
- for (i = 0, len = result.length; i < len; i++) {
- elem = result[i];
-
- if (elem.get(key)) {
- rv.push(elem);
- }
- }
-
- return rv;
- };
- }
- else if (token[1] === '=') {
- value = next()[1];
-
- if (value[0] === '"' || value[value.length - 1] === '\'') {
- value = value.slice(1, value.length - 1);
- }
- else {
- throw new SyntaxError(token, 'Ivalid comparison target');
- }
-
- token = next();
- select = function(context, result) {
- var i, len, elem, rv = [];
-
- for (i = 0, len = result.length; i < len; i++) {
- elem = result[i];
-
- if (elem.get(key) === value) {
- rv.push(elem);
- }
- }
-
- return rv;
- };
- }
-
- if (token[1] !== ']') {
- throw new SyntaxError(token, 'Invalid attribute predicate');
- }
- }
- else if (!token[1]) {
- tag = token[0] || '';
- token = next();
-
- if (token[1] !== ']') {
- throw new SyntaxError(token, 'Invalid node predicate');
- }
-
- select = function(context, result) {
- var i, len, elem, rv = [];
-
- for (i = 0, len = result.length; i < len; i++) {
- elem = result[i];
-
- if (elem.find(tag)) {
- rv.push(elem);
- }
- }
-
- return rv;
- };
- }
- else {
- throw new SyntaxError(null, 'Invalid predicate');
- }
-
- return select;
-}
-
-
-
-var ops = {
- "": prepare_tag,
- "*": prepare_star,
- ".": prepare_dot,
- "..": prepare_dot_dot,
- "//": prepare_iter,
- "[": prepare_predicate,
-};
-
-function _SelectorContext(root) {
- this.parent_map = null;
- this.root = root;
-}
-
-function findall(elem, path) {
- var selector, result, i, len, token, value, select, context;
-
- if (_cache.hasOwnProperty(path)) {
- selector = _cache[path];
- }
- else {
- // TODO: Use smarter cache purging approach
- if (Object.keys(_cache).length > 100) {
- _cache = {};
- }
-
- if (path.charAt(0) === '/') {
- throw new SyntaxError(null, 'Cannot use absolute path on element');
- }
-
- result = xpath_tokenizer(path);
- selector = [];
-
- function getToken() {
- return result.shift();
- }
-
- token = getToken();
- while (true) {
- var c = token[1] || '';
- value = ops[c](getToken, token);
-
- if (!value) {
- throw new SyntaxError(null, sprintf('Invalid path: %s', path));
- }
-
- selector.push(value);
- token = getToken();
-
- if (!token) {
- break;
- }
- else if (token[1] === '/') {
- token = getToken();
- }
-
- if (!token) {
- break;
- }
- }
-
- _cache[path] = selector;
- }
-
- // Execute slector pattern
- result = [elem];
- context = new _SelectorContext(elem);
-
- for (i = 0, len = selector.length; i < len; i++) {
- select = selector[i];
- result = select(context, result);
- }
-
- return result || [];
-}
-
-function find(element, path) {
- var resultElements = findall(element, path);
-
- if (resultElements && resultElements.length > 0) {
- return resultElements[0];
- }
-
- return null;
-}
-
-function findtext(element, path, defvalue) {
- var resultElements = findall(element, path);
-
- if (resultElements && resultElements.length > 0) {
- return resultElements[0].text;
- }
-
- return defvalue;
-}
-
-
-exports.find = find;
-exports.findall = findall;
-exports.findtext = findtext;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/lib/elementtree.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/lib/elementtree.js
deleted file mode 100644
index 61d9276..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/lib/elementtree.js
+++ /dev/null
@@ -1,611 +0,0 @@
-/**
- * Copyright 2011 Rackspace
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-var sprintf = require('./sprintf').sprintf;
-
-var utils = require('./utils');
-var ElementPath = require('./elementpath');
-var TreeBuilder = require('./treebuilder').TreeBuilder;
-var get_parser = require('./parser').get_parser;
-var constants = require('./constants');
-
-var element_ids = 0;
-
-function Element(tag, attrib)
-{
- this._id = element_ids++;
- this.tag = tag;
- this.attrib = {};
- this.text = null;
- this.tail = null;
- this._children = [];
-
- if (attrib) {
- this.attrib = utils.merge(this.attrib, attrib);
- }
-}
-
-Element.prototype.toString = function()
-{
- return sprintf("", this.tag, this._id);
-};
-
-Element.prototype.makeelement = function(tag, attrib)
-{
- return new Element(tag, attrib);
-};
-
-Element.prototype.len = function()
-{
- return this._children.length;
-};
-
-Element.prototype.getItem = function(index)
-{
- return this._children[index];
-};
-
-Element.prototype.setItem = function(index, element)
-{
- this._children[index] = element;
-};
-
-Element.prototype.delItem = function(index)
-{
- this._children.splice(index, 1);
-};
-
-Element.prototype.getSlice = function(start, stop)
-{
- return this._children.slice(start, stop);
-};
-
-Element.prototype.setSlice = function(start, stop, elements)
-{
- var i;
- var k = 0;
- for (i = start; i < stop; i++, k++) {
- this._children[i] = elements[k];
- }
-};
-
-Element.prototype.delSlice = function(start, stop)
-{
- this._children.splice(start, stop - start);
-};
-
-Element.prototype.append = function(element)
-{
- this._children.push(element);
-};
-
-Element.prototype.extend = function(elements)
-{
- this._children.concat(elements);
-};
-
-Element.prototype.insert = function(index, element)
-{
- this._children[index] = element;
-};
-
-Element.prototype.remove = function(element)
-{
- this._children = this._children.filter(function(e) {
- /* TODO: is this the right way to do this? */
- if (e._id === element._id) {
- return false;
- }
- return true;
- });
-};
-
-Element.prototype.getchildren = function() {
- return this._children;
-};
-
-Element.prototype.find = function(path)
-{
- return ElementPath.find(this, path);
-};
-
-Element.prototype.findtext = function(path, defvalue)
-{
- return ElementPath.findtext(this, path, defvalue);
-};
-
-Element.prototype.findall = function(path, defvalue)
-{
- return ElementPath.findall(this, path, defvalue);
-};
-
-Element.prototype.clear = function()
-{
- this.attrib = {};
- this._children = [];
- this.text = null;
- this.tail = null;
-};
-
-Element.prototype.get = function(key, defvalue)
-{
- if (this.attrib[key] !== undefined) {
- return this.attrib[key];
- }
- else {
- return defvalue;
- }
-};
-
-Element.prototype.set = function(key, value)
-{
- this.attrib[key] = value;
-};
-
-Element.prototype.keys = function()
-{
- return Object.keys(this.attrib);
-};
-
-Element.prototype.items = function()
-{
- return utils.items(this.attrib);
-};
-
-/*
- * In python this uses a generator, but in v8 we don't have em,
- * so we use a callback instead.
- **/
-Element.prototype.iter = function(tag, callback)
-{
- var self = this;
- var i, child;
-
- if (tag === "*") {
- tag = null;
- }
-
- if (tag === null || this.tag === tag) {
- callback(self);
- }
-
- for (i = 0; i < this._children.length; i++) {
- child = this._children[i];
- child.iter(tag, function(e) {
- callback(e);
- });
- }
-};
-
-Element.prototype.itertext = function(callback)
-{
- this.iter(null, function(e) {
- if (e.text) {
- callback(e.text);
- }
-
- if (e.tail) {
- callback(e.tail);
- }
- });
-};
-
-
-function SubElement(parent, tag, attrib) {
- var element = parent.makeelement(tag, attrib);
- parent.append(element);
- return element;
-}
-
-function Comment(text) {
- var element = new Element(Comment);
- if (text) {
- element.text = text;
- }
- return element;
-}
-
-function CData(text) {
- var element = new Element(CData);
- if (text) {
- element.text = text;
- }
- return element;
-}
-
-function ProcessingInstruction(target, text)
-{
- var element = new Element(ProcessingInstruction);
- element.text = target;
- if (text) {
- element.text = element.text + " " + text;
- }
- return element;
-}
-
-function QName(text_or_uri, tag)
-{
- if (tag) {
- text_or_uri = sprintf("{%s}%s", text_or_uri, tag);
- }
- this.text = text_or_uri;
-}
-
-QName.prototype.toString = function() {
- return this.text;
-};
-
-function ElementTree(element)
-{
- this._root = element;
-}
-
-ElementTree.prototype.getroot = function() {
- return this._root;
-};
-
-ElementTree.prototype._setroot = function(element) {
- this._root = element;
-};
-
-ElementTree.prototype.parse = function(source, parser) {
- if (!parser) {
- parser = get_parser(constants.DEFAULT_PARSER);
- parser = new parser.XMLParser(new TreeBuilder());
- }
-
- parser.feed(source);
- this._root = parser.close();
- return this._root;
-};
-
-ElementTree.prototype.iter = function(tag, callback) {
- this._root.iter(tag, callback);
-};
-
-ElementTree.prototype.find = function(path) {
- return this._root.find(path);
-};
-
-ElementTree.prototype.findtext = function(path, defvalue) {
- return this._root.findtext(path, defvalue);
-};
-
-ElementTree.prototype.findall = function(path) {
- return this._root.findall(path);
-};
-
-/**
- * Unlike ElementTree, we don't write to a file, we return you a string.
- */
-ElementTree.prototype.write = function(options) {
- var sb = [];
- options = utils.merge({
- encoding: 'utf-8',
- xml_declaration: null,
- default_namespace: null,
- method: 'xml'}, options);
-
- if (options.xml_declaration !== false) {
- sb.push("\n");
- }
-
- if (options.method === "text") {
- _serialize_text(sb, self._root, encoding);
- }
- else {
- var qnames, namespaces, indent, indent_string;
- var x = _namespaces(this._root, options.encoding, options.default_namespace);
- qnames = x[0];
- namespaces = x[1];
-
- if (options.hasOwnProperty('indent')) {
- indent = 0;
- indent_string = new Array(options.indent + 1).join(' ');
- }
- else {
- indent = false;
- }
-
- if (options.method === "xml") {
- _serialize_xml(function(data) {
- sb.push(data);
- }, this._root, options.encoding, qnames, namespaces, indent, indent_string);
- }
- else {
- /* TODO: html */
- throw new Error("unknown serialization method "+ options.method);
- }
- }
-
- return sb.join("");
-};
-
-var _namespace_map = {
- /* "well-known" namespace prefixes */
- "http://www.w3.org/XML/1998/namespace": "xml",
- "http://www.w3.org/1999/xhtml": "html",
- "http://www.w3.org/1999/02/22-rdf-syntax-ns#": "rdf",
- "http://schemas.xmlsoap.org/wsdl/": "wsdl",
- /* xml schema */
- "http://www.w3.org/2001/XMLSchema": "xs",
- "http://www.w3.org/2001/XMLSchema-instance": "xsi",
- /* dublic core */
- "http://purl.org/dc/elements/1.1/": "dc",
-};
-
-function register_namespace(prefix, uri) {
- if (/ns\d+$/.test(prefix)) {
- throw new Error('Prefix format reserved for internal use');
- }
-
- if (_namespace_map.hasOwnProperty(uri) && _namespace_map[uri] === prefix) {
- delete _namespace_map[uri];
- }
-
- _namespace_map[uri] = prefix;
-}
-
-
-function _escape(text, encoding, isAttribute, isText) {
- if (text) {
- text = text.toString();
- text = text.replace(/&/g, '&');
- text = text.replace(//g, '>');
- if (!isText) {
- text = text.replace(/\n/g, '
');
- text = text.replace(/\r/g, '
');
- }
- if (isAttribute) {
- text = text.replace(/"/g, '"');
- }
- }
- return text;
-}
-
-/* TODO: benchmark single regex */
-function _escape_attrib(text, encoding) {
- return _escape(text, encoding, true);
-}
-
-function _escape_cdata(text, encoding) {
- return _escape(text, encoding, false);
-}
-
-function _escape_text(text, encoding) {
- return _escape(text, encoding, false, true);
-}
-
-function _namespaces(elem, encoding, default_namespace) {
- var qnames = {};
- var namespaces = {};
-
- if (default_namespace) {
- namespaces[default_namespace] = "";
- }
-
- function encode(text) {
- return text;
- }
-
- function add_qname(qname) {
- if (qname[0] === "{") {
- var tmp = qname.substring(1).split("}", 2);
- var uri = tmp[0];
- var tag = tmp[1];
- var prefix = namespaces[uri];
-
- if (prefix === undefined) {
- prefix = _namespace_map[uri];
- if (prefix === undefined) {
- prefix = "ns" + Object.keys(namespaces).length;
- }
- if (prefix !== "xml") {
- namespaces[uri] = prefix;
- }
- }
-
- if (prefix) {
- qnames[qname] = sprintf("%s:%s", prefix, tag);
- }
- else {
- qnames[qname] = tag;
- }
- }
- else {
- if (default_namespace) {
- throw new Error('cannot use non-qualified names with default_namespace option');
- }
-
- qnames[qname] = qname;
- }
- }
-
-
- elem.iter(null, function(e) {
- var i;
- var tag = e.tag;
- var text = e.text;
- var items = e.items();
-
- if (tag instanceof QName && qnames[tag.text] === undefined) {
- add_qname(tag.text);
- }
- else if (typeof(tag) === "string") {
- add_qname(tag);
- }
- else if (tag !== null && tag !== Comment && tag !== CData && tag !== ProcessingInstruction) {
- throw new Error('Invalid tag type for serialization: '+ tag);
- }
-
- if (text instanceof QName && qnames[text.text] === undefined) {
- add_qname(text.text);
- }
-
- items.forEach(function(item) {
- var key = item[0],
- value = item[1];
- if (key instanceof QName) {
- key = key.text;
- }
-
- if (qnames[key] === undefined) {
- add_qname(key);
- }
-
- if (value instanceof QName && qnames[value.text] === undefined) {
- add_qname(value.text);
- }
- });
- });
- return [qnames, namespaces];
-}
-
-function _serialize_xml(write, elem, encoding, qnames, namespaces, indent, indent_string) {
- var tag = elem.tag;
- var text = elem.text;
- var items;
- var i;
-
- var newlines = indent || (indent === 0);
- write(Array(indent + 1).join(indent_string));
-
- if (tag === Comment) {
- write(sprintf("", _escape_cdata(text, encoding)));
- }
- else if (tag === ProcessingInstruction) {
- write(sprintf("%s?>", _escape_cdata(text, encoding)));
- }
- else if (tag === CData) {
- text = text || '';
- write(sprintf("", text));
- }
- else {
- tag = qnames[tag];
- if (tag === undefined) {
- if (text) {
- write(_escape_text(text, encoding));
- }
- elem.iter(function(e) {
- _serialize_xml(write, e, encoding, qnames, null, newlines ? indent + 1 : false, indent_string);
- });
- }
- else {
- write("<" + tag);
- items = elem.items();
-
- if (items || namespaces) {
- items.sort(); // lexical order
-
- items.forEach(function(item) {
- var k = item[0],
- v = item[1];
-
- if (k instanceof QName) {
- k = k.text;
- }
-
- if (v instanceof QName) {
- v = qnames[v.text];
- }
- else {
- v = _escape_attrib(v, encoding);
- }
- write(sprintf(" %s=\"%s\"", qnames[k], v));
- });
-
- if (namespaces) {
- items = utils.items(namespaces);
- items.sort(function(a, b) { return a[1] < b[1]; });
-
- items.forEach(function(item) {
- var k = item[1],
- v = item[0];
-
- if (k) {
- k = ':' + k;
- }
-
- write(sprintf(" xmlns%s=\"%s\"", k, _escape_attrib(v, encoding)));
- });
- }
- }
-
- if (text || elem.len()) {
- if (text && text.toString().match(/^\s*$/)) {
- text = null;
- }
-
- write(">");
- if (!text && newlines) {
- write("\n");
- }
-
- if (text) {
- write(_escape_text(text, encoding));
- }
- elem._children.forEach(function(e) {
- _serialize_xml(write, e, encoding, qnames, null, newlines ? indent + 1 : false, indent_string);
- });
-
- if (!text && indent) {
- write(Array(indent + 1).join(indent_string));
- }
- write("" + tag + ">");
- }
- else {
- write(" />");
- }
- }
- }
-
- if (newlines) {
- write("\n");
- }
-}
-
-function parse(source, parser) {
- var tree = new ElementTree();
- tree.parse(source, parser);
- return tree;
-}
-
-function tostring(element, options) {
- return new ElementTree(element).write(options);
-}
-
-exports.PI = ProcessingInstruction;
-exports.Comment = Comment;
-exports.CData = CData;
-exports.ProcessingInstruction = ProcessingInstruction;
-exports.SubElement = SubElement;
-exports.QName = QName;
-exports.ElementTree = ElementTree;
-exports.ElementPath = ElementPath;
-exports.Element = function(tag, attrib) {
- return new Element(tag, attrib);
-};
-
-exports.XML = function(data) {
- var et = new ElementTree();
- return et.parse(data);
-};
-
-exports.parse = parse;
-exports.register_namespace = register_namespace;
-exports.tostring = tostring;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/lib/errors.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/lib/errors.js
deleted file mode 100644
index e8742be..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/lib/errors.js
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * Copyright 2011 Rackspace
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-var util = require('util');
-
-var sprintf = require('./sprintf').sprintf;
-
-function SyntaxError(token, msg) {
- msg = msg || sprintf('Syntax Error at token %s', token.toString());
- this.token = token;
- this.message = msg;
- Error.call(this, msg);
-}
-
-util.inherits(SyntaxError, Error);
-
-exports.SyntaxError = SyntaxError;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/lib/parser.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/lib/parser.js
deleted file mode 100644
index 7307ee4..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/lib/parser.js
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright 2011 Rackspace
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/* TODO: support node-expat C++ module optionally */
-
-var util = require('util');
-var parsers = require('./parsers/index');
-
-function get_parser(name) {
- if (name === 'sax') {
- return parsers.sax;
- }
- else {
- throw new Error('Invalid parser: ' + name);
- }
-}
-
-
-exports.get_parser = get_parser;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/lib/parsers/index.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/lib/parsers/index.js
deleted file mode 100644
index 5eac5c8..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/lib/parsers/index.js
+++ /dev/null
@@ -1 +0,0 @@
-exports.sax = require('./sax');
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/lib/parsers/sax.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/lib/parsers/sax.js
deleted file mode 100644
index 69b0a59..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/lib/parsers/sax.js
+++ /dev/null
@@ -1,56 +0,0 @@
-var util = require('util');
-
-var sax = require('sax');
-
-var TreeBuilder = require('./../treebuilder').TreeBuilder;
-
-function XMLParser(target) {
- this.parser = sax.parser(true);
-
- this.target = (target) ? target : new TreeBuilder();
-
- this.parser.onopentag = this._handleOpenTag.bind(this);
- this.parser.ontext = this._handleText.bind(this);
- this.parser.oncdata = this._handleCdata.bind(this);
- this.parser.ondoctype = this._handleDoctype.bind(this);
- this.parser.oncomment = this._handleComment.bind(this);
- this.parser.onclosetag = this._handleCloseTag.bind(this);
- this.parser.onerror = this._handleError.bind(this);
-}
-
-XMLParser.prototype._handleOpenTag = function(tag) {
- this.target.start(tag.name, tag.attributes);
-};
-
-XMLParser.prototype._handleText = function(text) {
- this.target.data(text);
-};
-
-XMLParser.prototype._handleCdata = function(text) {
- this.target.data(text);
-};
-
-XMLParser.prototype._handleDoctype = function(text) {
-};
-
-XMLParser.prototype._handleComment = function(comment) {
-};
-
-XMLParser.prototype._handleCloseTag = function(tag) {
- this.target.end(tag);
-};
-
-XMLParser.prototype._handleError = function(err) {
- throw err;
-};
-
-XMLParser.prototype.feed = function(chunk) {
- this.parser.write(chunk);
-};
-
-XMLParser.prototype.close = function() {
- this.parser.close();
- return this.target.close();
-};
-
-exports.XMLParser = XMLParser;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/lib/sprintf.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/lib/sprintf.js
deleted file mode 100644
index f802c1b..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/lib/sprintf.js
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright 2011 Rackspace
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-var cache = {};
-
-
-// Do any others need escaping?
-var TO_ESCAPE = {
- '\'': '\\\'',
- '\n': '\\n'
-};
-
-
-function populate(formatter) {
- var i, type,
- key = formatter,
- prev = 0,
- arg = 1,
- builder = 'return \'';
-
- for (i = 0; i < formatter.length; i++) {
- if (formatter[i] === '%') {
- type = formatter[i + 1];
-
- switch (type) {
- case 's':
- builder += formatter.slice(prev, i) + '\' + arguments[' + arg + '] + \'';
- prev = i + 2;
- arg++;
- break;
- case 'j':
- builder += formatter.slice(prev, i) + '\' + JSON.stringify(arguments[' + arg + ']) + \'';
- prev = i + 2;
- arg++;
- break;
- case '%':
- builder += formatter.slice(prev, i + 1);
- prev = i + 2;
- i++;
- break;
- }
-
-
- } else if (TO_ESCAPE[formatter[i]]) {
- builder += formatter.slice(prev, i) + TO_ESCAPE[formatter[i]];
- prev = i + 1;
- }
- }
-
- builder += formatter.slice(prev) + '\';';
- cache[key] = new Function(builder);
-}
-
-
-/**
- * A fast version of sprintf(), which currently only supports the %s and %j.
- * This caches a formatting function for each format string that is used, so
- * you should only use this sprintf() will be called many times with a single
- * format string and a limited number of format strings will ever be used (in
- * general this means that format strings should be string literals).
- *
- * @param {String} formatter A format string.
- * @param {...String} var_args Values that will be formatted by %s and %j.
- * @return {String} The formatted output.
- */
-exports.sprintf = function(formatter, var_args) {
- if (!cache[formatter]) {
- populate(formatter);
- }
-
- return cache[formatter].apply(null, arguments);
-};
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/lib/treebuilder.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/lib/treebuilder.js
deleted file mode 100644
index 393a98f..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/lib/treebuilder.js
+++ /dev/null
@@ -1,60 +0,0 @@
-function TreeBuilder(element_factory) {
- this._data = [];
- this._elem = [];
- this._last = null;
- this._tail = null;
- if (!element_factory) {
- /* evil circular dep */
- element_factory = require('./elementtree').Element;
- }
- this._factory = element_factory;
-}
-
-TreeBuilder.prototype.close = function() {
- return this._last;
-};
-
-TreeBuilder.prototype._flush = function() {
- if (this._data) {
- if (this._last !== null) {
- var text = this._data.join("");
- if (this._tail) {
- this._last.tail = text;
- }
- else {
- this._last.text = text;
- }
- }
- this._data = [];
- }
-};
-
-TreeBuilder.prototype.data = function(data) {
- this._data.push(data);
-};
-
-TreeBuilder.prototype.start = function(tag, attrs) {
- this._flush();
- var elem = this._factory(tag, attrs);
- this._last = elem;
-
- if (this._elem.length) {
- this._elem[this._elem.length - 1].append(elem);
- }
-
- this._elem.push(elem);
-
- this._tail = null;
-};
-
-TreeBuilder.prototype.end = function(tag) {
- this._flush();
- this._last = this._elem.pop();
- if (this._last.tag !== tag) {
- throw new Error("end tag mismatch");
- }
- this._tail = 1;
- return this._last;
-};
-
-exports.TreeBuilder = TreeBuilder;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/lib/utils.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/lib/utils.js
deleted file mode 100644
index b08a670..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/lib/utils.js
+++ /dev/null
@@ -1,72 +0,0 @@
-/**
- * Copyright 2011 Rackspace
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/**
- * @param {Object} hash.
- * @param {Array} ignored.
- */
-function items(hash, ignored) {
- ignored = ignored || null;
- var k, rv = [];
-
- function is_ignored(key) {
- if (!ignored || ignored.length === 0) {
- return false;
- }
-
- return ignored.indexOf(key);
- }
-
- for (k in hash) {
- if (hash.hasOwnProperty(k) && !(is_ignored(ignored))) {
- rv.push([k, hash[k]]);
- }
- }
-
- return rv;
-}
-
-
-function findall(re, str) {
- var match, matches = [];
-
- while ((match = re.exec(str))) {
- matches.push(match);
- }
-
- return matches;
-}
-
-function merge(a, b) {
- var c = {}, attrname;
-
- for (attrname in a) {
- if (a.hasOwnProperty(attrname)) {
- c[attrname] = a[attrname];
- }
- }
- for (attrname in b) {
- if (b.hasOwnProperty(attrname)) {
- c[attrname] = b[attrname];
- }
- }
- return c;
-}
-
-exports.items = items;
-exports.findall = findall;
-exports.merge = merge;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/package.json b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/package.json
deleted file mode 100644
index 5a8ff65..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/package.json
+++ /dev/null
@@ -1,110 +0,0 @@
-{
- "_args": [
- [
- {
- "raw": "elementtree@^0.1.6",
- "scope": null,
- "escapedName": "elementtree",
- "name": "elementtree",
- "rawSpec": "^0.1.6",
- "spec": ">=0.1.6 <0.2.0",
- "type": "range"
- },
- "/Users/steveng/repo/cordova/cordova-android"
- ]
- ],
- "_from": "elementtree@>=0.1.6 <0.2.0",
- "_id": "elementtree@0.1.6",
- "_inCache": true,
- "_installable": true,
- "_location": "/elementtree",
- "_npmUser": {
- "name": "rphillips",
- "email": "ryan@trolocsis.com"
- },
- "_npmVersion": "1.3.24",
- "_phantomChildren": {},
- "_requested": {
- "raw": "elementtree@^0.1.6",
- "scope": null,
- "escapedName": "elementtree",
- "name": "elementtree",
- "rawSpec": "^0.1.6",
- "spec": ">=0.1.6 <0.2.0",
- "type": "range"
- },
- "_requiredBy": [
- "/",
- "/cordova-common"
- ],
- "_resolved": "http://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",
- "author": {
- "name": "Rackspace US, Inc."
- },
- "bugs": {
- "url": "https://github.com/racker/node-elementtree/issues"
- },
- "contributors": [
- {
- "name": "Paul Querna",
- "email": "paul.querna@rackspace.com"
- },
- {
- "name": "Tomaz Muraus",
- "email": "tomaz.muraus@rackspace.com"
- }
- ],
- "dependencies": {
- "sax": "0.3.5"
- },
- "description": "XML Serialization and Parsing module based on Python's ElementTree.",
- "devDependencies": {
- "whiskey": "0.8.x"
- },
- "directories": {
- "lib": "lib"
- },
- "dist": {
- "shasum": "2ac4c46ea30516c8c4cbdb5e3ac7418e592de20c",
- "tarball": "https://registry.npmjs.org/elementtree/-/elementtree-0.1.6.tgz"
- },
- "engines": {
- "node": ">= 0.4.0"
- },
- "homepage": "https://github.com/racker/node-elementtree",
- "keywords": [
- "xml",
- "sax",
- "parser",
- "seralization",
- "elementtree"
- ],
- "licenses": [
- {
- "type": "Apache",
- "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
- }
- ],
- "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"
- },
- "scripts": {
- "test": "make test"
- },
- "version": "0.1.6"
-}
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/tests/data/xml1.xml b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/tests/data/xml1.xml
deleted file mode 100644
index 72c33ae..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/tests/data/xml1.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
- dd
- test_object_1
- 4281c348eaf83e70ddce0e07221c3d28
- 14
- application/octetstream
- 2009-02-03T05:26:32.612278
-
-
- test_object_2
- b039efe731ad111bc1b0ef221c3849d0
- 64
- application/octetstream
- 2009-02-03T05:26:32.612278
-
-
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/tests/data/xml2.xml b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/tests/data/xml2.xml
deleted file mode 100644
index 5f94bbd..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/tests/data/xml2.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
- Hello World
-
-
-
-
-
-
-
-
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/tests/test-simple.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/tests/test-simple.js
deleted file mode 100644
index 1fc04b8..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/elementtree/tests/test-simple.js
+++ /dev/null
@@ -1,339 +0,0 @@
-/**
- * Copyright 2011 Rackspace
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-var fs = require('fs');
-var path = require('path');
-
-var sprintf = require('./../lib/sprintf').sprintf;
-var et = require('elementtree');
-var XML = et.XML;
-var ElementTree = et.ElementTree;
-var Element = et.Element;
-var SubElement = et.SubElement;
-var SyntaxError = require('./../lib/errors').SyntaxError;
-
-function readFile(name) {
- return fs.readFileSync(path.join(__dirname, '/data/', name), 'utf8');
-}
-
-exports['test_simplest'] = function(test, assert) {
- /* Ported from */
- var Element = et.Element;
- var root = Element('root');
- root.append(Element('one'));
- root.append(Element('two'));
- root.append(Element('three'));
- assert.equal(3, root.len());
- assert.equal('one', root.getItem(0).tag);
- assert.equal('two', root.getItem(1).tag);
- assert.equal('three', root.getItem(2).tag);
- test.finish();
-};
-
-
-exports['test_attribute_values'] = function(test, assert) {
- var XML = et.XML;
- var root = XML(' ');
- assert.equal('Alpha', root.attrib['alpha']);
- assert.equal('Beta', root.attrib['beta']);
- assert.equal('Gamma', root.attrib['gamma']);
- test.finish();
-};
-
-
-exports['test_findall'] = function(test, assert) {
- var XML = et.XML;
- var root = XML(' ');
-
- assert.equal(root.findall("c").length, 1);
- assert.equal(root.findall(".//c").length, 2);
- assert.equal(root.findall(".//b").length, 3);
- assert.equal(root.findall(".//b")[0]._children.length, 1);
- assert.equal(root.findall(".//b")[1]._children.length, 0);
- assert.equal(root.findall(".//b")[2]._children.length, 0);
- assert.deepEqual(root.findall('.//b')[0], root.getchildren()[0]);
-
- test.finish();
-};
-
-exports['test_find'] = function(test, assert) {
- var a = Element('a');
- var b = SubElement(a, 'b');
- var c = SubElement(a, 'c');
-
- assert.deepEqual(a.find('./b/..'), a);
- test.finish();
-};
-
-exports['test_elementtree_find_qname'] = function(test, assert) {
- var tree = new et.ElementTree(XML(' '));
- assert.deepEqual(tree.find(new et.QName('c')), tree.getroot()._children[2]);
- test.finish();
-};
-
-exports['test_attrib_ns_clear'] = function(test, assert) {
- var attribNS = '{http://foo/bar}x';
-
- var par = Element('par');
- par.set(attribNS, 'a');
- var child = SubElement(par, 'child');
- child.set(attribNS, 'b');
-
- assert.equal('a', par.get(attribNS));
- assert.equal('b', child.get(attribNS));
-
- par.clear();
- assert.equal(null, par.get(attribNS));
- assert.equal('b', child.get(attribNS));
- test.finish();
-};
-
-exports['test_create_tree_and_parse_simple'] = function(test, assert) {
- var i = 0;
- var e = new Element('bar', {});
- var expected = "\n" +
- 'ponies ';
-
- SubElement(e, "blah", {a: 11});
- SubElement(e, "blah", {a: 12});
- var se = et.SubElement(e, "gag", {a: '13', b: 'abc'});
- se.text = 'ponies';
-
- se.itertext(function(text) {
- assert.equal(text, 'ponies');
- i++;
- });
-
- assert.equal(i, 1);
- var etree = new ElementTree(e);
- var xml = etree.write();
- assert.equal(xml, expected);
- test.finish();
-};
-
-exports['test_write_with_options'] = function(test, assert) {
- var i = 0;
- var e = new Element('bar', {});
- var expected1 = "\n" +
- '\n' +
- ' \n' +
- ' test \n' +
- ' \n' +
- ' \n' +
- ' ponies \n' +
- ' \n';
- var expected2 = "\n" +
- '\n' +
- ' \n' +
- ' test \n' +
- ' \n' +
- ' \n' +
- ' ponies \n' +
- ' \n';
-
- var expected3 = "\n" +
- '\n' +
- ' \n' +
- ' Hello World\n' +
- ' \n' +
- ' \n' +
- ' \n' +
- ' \n' +
- ' \n' +
- ' \n' +
- ' \n' +
- ' Test & Test & Test\n' +
- ' \n' +
- ' \n';
-
- var se1 = SubElement(e, "blah", {a: 11});
- var se2 = SubElement(se1, "baz", {d: 11});
- se2.text = 'test';
- SubElement(e, "blah", {a: 12});
- var se = et.SubElement(e, "gag", {a: '13', b: 'abc'});
- se.text = 'ponies';
-
- se.itertext(function(text) {
- assert.equal(text, 'ponies');
- i++;
- });
-
- assert.equal(i, 1);
- var etree = new ElementTree(e);
- var xml1 = etree.write({'indent': 4});
- var xml2 = etree.write({'indent': 2});
- assert.equal(xml1, expected1);
- assert.equal(xml2, expected2);
-
- var file = readFile('xml2.xml');
- var etree2 = et.parse(file);
- var xml3 = etree2.write({'indent': 4});
- assert.equal(xml3, expected3);
- test.finish();
-};
-
-exports['test_parse_and_find_2'] = function(test, assert) {
- var data = readFile('xml1.xml');
- var etree = et.parse(data);
-
- assert.equal(etree.findall('./object').length, 2);
- assert.equal(etree.findall('[@name]').length, 1);
- assert.equal(etree.findall('[@name="test_container_1"]').length, 1);
- assert.equal(etree.findall('[@name=\'test_container_1\']').length, 1);
- assert.equal(etree.findall('./object')[0].findtext('name'), 'test_object_1');
- assert.equal(etree.findtext('./object/name'), 'test_object_1');
- assert.equal(etree.findall('.//bytes').length, 2);
- assert.equal(etree.findall('*/bytes').length, 2);
- assert.equal(etree.findall('*/foobar').length, 0);
-
- test.finish();
-};
-
-exports['test_namespaced_attribute'] = function(test, assert) {
- var data = readFile('xml1.xml');
- var etree = et.parse(data);
-
- assert.equal(etree.findall('*/bytes[@android:type="cool"]').length, 1);
-
- test.finish();
-}
-
-exports['test_syntax_errors'] = function(test, assert) {
- var expressions = [ './/@bar', '[@bar', '[@foo=bar]', '[@', '/bar' ];
- var errCount = 0;
- var data = readFile('xml1.xml');
- var etree = et.parse(data);
-
- expressions.forEach(function(expression) {
- try {
- etree.findall(expression);
- }
- catch (err) {
- errCount++;
- }
- });
-
- assert.equal(errCount, expressions.length);
- test.finish();
-};
-
-exports['test_register_namespace'] = function(test, assert){
- var prefix = 'TESTPREFIX';
- var namespace = 'http://seriously.unknown/namespace/URI';
- var errCount = 0;
-
- var etree = Element(sprintf('{%s}test', namespace));
- assert.equal(et.tostring(etree, { 'xml_declaration': false}),
- sprintf(' ', namespace));
-
- et.register_namespace(prefix, namespace);
- var etree = Element(sprintf('{%s}test', namespace));
- assert.equal(et.tostring(etree, { 'xml_declaration': false}),
- sprintf('<%s:test xmlns:%s="%s" />', prefix, prefix, namespace));
-
- try {
- et.register_namespace('ns25', namespace);
- }
- catch (err) {
- errCount++;
- }
-
- assert.equal(errCount, 1, 'Reserved prefix used, but exception was not thrown');
- test.finish();
-};
-
-exports['test_tostring'] = function(test, assert) {
- var a = Element('a');
- var b = SubElement(a, 'b');
- var c = SubElement(a, 'c');
- c.text = 543;
-
- assert.equal(et.tostring(a, { 'xml_declaration': false }), '543 ');
- assert.equal(et.tostring(c, { 'xml_declaration': false }), '543 ');
- test.finish();
-};
-
-exports['test_escape'] = function(test, assert) {
- var a = Element('a');
- var b = SubElement(a, 'b');
- b.text = '&&&&<>"\n\r';
-
- assert.equal(et.tostring(a, { 'xml_declaration': false }), '&&&&<>\"\n\r ');
- test.finish();
-};
-
-exports['test_find_null'] = function(test, assert) {
- var root = Element('root');
- var node = SubElement(root, 'node');
- var leaf = SubElement(node, 'leaf');
- leaf.text = 'ipsum';
-
- assert.equal(root.find('node/leaf'), leaf);
- assert.equal(root.find('no-such-node/leaf'), null);
- test.finish();
-};
-
-exports['test_findtext_null'] = function(test, assert) {
- var root = Element('root');
- var node = SubElement(root, 'node');
- var leaf = SubElement(node, 'leaf');
- leaf.text = 'ipsum';
-
- assert.equal(root.findtext('node/leaf'), 'ipsum');
- assert.equal(root.findtext('no-such-node/leaf'), null);
- test.finish();
-};
-
-exports['test_remove'] = function(test, assert) {
- var root = Element('root');
- var node1 = SubElement(root, 'node1');
- var node2 = SubElement(root, 'node2');
- var node3 = SubElement(root, 'node3');
-
- assert.equal(root.len(), 3);
-
- root.remove(node2);
-
- assert.equal(root.len(), 2);
- assert.equal(root.getItem(0).tag, 'node1')
- assert.equal(root.getItem(1).tag, 'node3')
-
- test.finish();
-};
-
-exports['test_cdata_write'] = function(test, assert) {
- var root, etree, xml, values, value, i;
-
- values = [
- 'if(0>1) then true;',
- 'ponies hello ',
- ''
- ];
-
- for (i = 0; i < values.length; i++) {
- value = values[i];
-
- root = Element('root');
- root.append(et.CData(value));
- etree = new ElementTree(root);
- xml = etree.write({'xml_declaration': false});
-
- assert.equal(xml, sprintf(' ', value));
- }
-
- test.finish();
-};
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/glob/LICENSE b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/glob/LICENSE
deleted file mode 100644
index 19129e3..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/glob/LICENSE
+++ /dev/null
@@ -1,15 +0,0 @@
-The ISC License
-
-Copyright (c) Isaac Z. Schlueter and Contributors
-
-Permission to use, copy, modify, and/or distribute this software for any
-purpose with or without fee is hereby granted, provided that the above
-copyright notice and this permission notice appear in all copies.
-
-THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
-IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/glob/README.md b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/glob/README.md
deleted file mode 100644
index 063cf95..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/glob/README.md
+++ /dev/null
@@ -1,377 +0,0 @@
-[](https://travis-ci.org/isaacs/node-glob/) [](https://david-dm.org/isaacs/node-glob) [](https://david-dm.org/isaacs/node-glob#info=devDependencies) [](https://david-dm.org/isaacs/node-glob#info=optionalDependencies)
-
-# Glob
-
-Match files using the patterns the shell uses, like stars and stuff.
-
-This is a glob implementation in JavaScript. It uses the `minimatch`
-library to do its matching.
-
-
-
-## Usage
-
-```javascript
-var glob = require("glob")
-
-// options is optional
-glob("**/*.js", options, function (er, files) {
- // files is an array of filenames.
- // If the `nonull` option is set, and nothing
- // was found, then files is ["**/*.js"]
- // er is an error object or null.
-})
-```
-
-## Glob Primer
-
-"Globs" are the patterns you type when you do stuff like `ls *.js` on
-the command line, or put `build/*` in a `.gitignore` file.
-
-Before parsing the path part patterns, braced sections are expanded
-into a set. Braced sections start with `{` and end with `}`, with any
-number of comma-delimited sections within. Braced sections may contain
-slash characters, so `a{/b/c,bcd}` would expand into `a/b/c` and `abcd`.
-
-The following characters have special magic meaning when used in a
-path portion:
-
-* `*` Matches 0 or more characters in a single path portion
-* `?` Matches 1 character
-* `[...]` Matches a range of characters, similar to a RegExp range.
- If the first character of the range is `!` or `^` then it matches
- any character not in the range.
-* `!(pattern|pattern|pattern)` Matches anything that does not match
- any of the patterns provided.
-* `?(pattern|pattern|pattern)` Matches zero or one occurrence of the
- patterns provided.
-* `+(pattern|pattern|pattern)` Matches one or more occurrences of the
- patterns provided.
-* `*(a|b|c)` Matches zero or more occurrences of the patterns provided
-* `@(pattern|pat*|pat?erN)` Matches exactly one of the patterns
- provided
-* `**` If a "globstar" is alone in a path portion, then it matches
- zero or more directories and subdirectories searching for matches.
- It does not crawl symlinked directories.
-
-### Dots
-
-If a file or directory path portion has a `.` as the first character,
-then it will not match any glob pattern unless that pattern's
-corresponding path part also has a `.` as its first character.
-
-For example, the pattern `a/.*/c` would match the file at `a/.b/c`.
-However the pattern `a/*/c` would not, because `*` does not start with
-a dot character.
-
-You can make glob treat dots as normal characters by setting
-`dot:true` in the options.
-
-### Basename Matching
-
-If you set `matchBase:true` in the options, and the pattern has no
-slashes in it, then it will seek for any file anywhere in the tree
-with a matching basename. For example, `*.js` would match
-`test/simple/basic.js`.
-
-### Negation
-
-The intent for negation would be for a pattern starting with `!` to
-match everything that *doesn't* match the supplied pattern. However,
-the implementation is weird, and for the time being, this should be
-avoided. The behavior is deprecated in version 5, and will be removed
-entirely in version 6.
-
-### Empty Sets
-
-If no matching files are found, then an empty array is returned. This
-differs from the shell, where the pattern itself is returned. For
-example:
-
- $ echo a*s*d*f
- a*s*d*f
-
-To get the bash-style behavior, set the `nonull:true` in the options.
-
-### See Also:
-
-* `man sh`
-* `man bash` (Search for "Pattern Matching")
-* `man 3 fnmatch`
-* `man 5 gitignore`
-* [minimatch documentation](https://github.com/isaacs/minimatch)
-
-## glob.hasMagic(pattern, [options])
-
-Returns `true` if there are any special characters in the pattern, and
-`false` otherwise.
-
-Note that the options affect the results. If `noext:true` is set in
-the options object, then `+(a|b)` will not be considered a magic
-pattern. If the pattern has a brace expansion, like `a/{b/c,x/y}`
-then that is considered magical, unless `nobrace:true` is set in the
-options.
-
-## glob(pattern, [options], cb)
-
-* `pattern` {String} Pattern to be matched
-* `options` {Object}
-* `cb` {Function}
- * `err` {Error | null}
- * `matches` {Array} filenames found matching the pattern
-
-Perform an asynchronous glob search.
-
-## glob.sync(pattern, [options])
-
-* `pattern` {String} Pattern to be matched
-* `options` {Object}
-* return: {Array} filenames found matching the pattern
-
-Perform a synchronous glob search.
-
-## Class: glob.Glob
-
-Create a Glob object by instantiating the `glob.Glob` class.
-
-```javascript
-var Glob = require("glob").Glob
-var mg = new Glob(pattern, options, cb)
-```
-
-It's an EventEmitter, and starts walking the filesystem to find matches
-immediately.
-
-### new glob.Glob(pattern, [options], [cb])
-
-* `pattern` {String} pattern to search for
-* `options` {Object}
-* `cb` {Function} Called when an error occurs, or matches are found
- * `err` {Error | null}
- * `matches` {Array} filenames found matching the pattern
-
-Note that if the `sync` flag is set in the options, then matches will
-be immediately available on the `g.found` member.
-
-### Properties
-
-* `minimatch` The minimatch object that the glob uses.
-* `options` The options object passed in.
-* `aborted` Boolean which is set to true when calling `abort()`. There
- is no way at this time to continue a glob search after aborting, but
- you can re-use the statCache to avoid having to duplicate syscalls.
-* `cache` Convenience object. Each field has the following possible
- values:
- * `false` - Path does not exist
- * `true` - Path exists
- * `'DIR'` - Path exists, and is not a directory
- * `'FILE'` - Path exists, and is a directory
- * `[file, entries, ...]` - Path exists, is a directory, and the
- array value is the results of `fs.readdir`
-* `statCache` Cache of `fs.stat` results, to prevent statting the same
- path multiple times.
-* `symlinks` A record of which paths are symbolic links, which is
- relevant in resolving `**` patterns.
-* `realpathCache` An optional object which is passed to `fs.realpath`
- to minimize unnecessary syscalls. It is stored on the instantiated
- Glob object, and may be re-used.
-
-### Events
-
-* `end` When the matching is finished, this is emitted with all the
- matches found. If the `nonull` option is set, and no match was found,
- then the `matches` list contains the original pattern. The matches
- are sorted, unless the `nosort` flag is set.
-* `match` Every time a match is found, this is emitted with the matched.
-* `error` Emitted when an unexpected error is encountered, or whenever
- any fs error occurs if `options.strict` is set.
-* `abort` When `abort()` is called, this event is raised.
-
-### Methods
-
-* `pause` Temporarily stop the search
-* `resume` Resume the search
-* `abort` Stop the search forever
-
-### Options
-
-All the options that can be passed to Minimatch can also be passed to
-Glob to change pattern matching behavior. Also, some have been added,
-or have glob-specific ramifications.
-
-All options are false by default, unless otherwise noted.
-
-All options are added to the Glob object, as well.
-
-If you are running many `glob` operations, you can pass a Glob object
-as the `options` argument to a subsequent operation to shortcut some
-`stat` and `readdir` calls. At the very least, you may pass in shared
-`symlinks`, `statCache`, `realpathCache`, and `cache` options, so that
-parallel glob operations will be sped up by sharing information about
-the filesystem.
-
-* `cwd` The current working directory in which to search. Defaults
- to `process.cwd()`.
-* `root` The place where patterns starting with `/` will be mounted
- onto. Defaults to `path.resolve(options.cwd, "/")` (`/` on Unix
- systems, and `C:\` or some such on Windows.)
-* `dot` Include `.dot` files in normal matches and `globstar` matches.
- Note that an explicit dot in a portion of the pattern will always
- match dot files.
-* `nomount` By default, a pattern starting with a forward-slash will be
- "mounted" onto the root setting, so that a valid filesystem path is
- returned. Set this flag to disable that behavior.
-* `mark` Add a `/` character to directory matches. Note that this
- requires additional stat calls.
-* `nosort` Don't sort the results.
-* `stat` Set to true to stat *all* results. This reduces performance
- somewhat, and is completely unnecessary, unless `readdir` is presumed
- to be an untrustworthy indicator of file existence.
-* `silent` When an unusual error is encountered when attempting to
- read a directory, a warning will be printed to stderr. Set the
- `silent` option to true to suppress these warnings.
-* `strict` When an unusual error is encountered when attempting to
- read a directory, the process will just continue on in search of
- other matches. Set the `strict` option to raise an error in these
- cases.
-* `cache` See `cache` property above. Pass in a previously generated
- cache object to save some fs calls.
-* `statCache` A cache of results of filesystem information, to prevent
- unnecessary stat calls. While it should not normally be necessary
- to set this, you may pass the statCache from one glob() call to the
- options object of another, if you know that the filesystem will not
- change between calls. (See "Race Conditions" below.)
-* `symlinks` A cache of known symbolic links. You may pass in a
- previously generated `symlinks` object to save `lstat` calls when
- resolving `**` matches.
-* `sync` DEPRECATED: use `glob.sync(pattern, opts)` instead.
-* `nounique` In some cases, brace-expanded patterns can result in the
- same file showing up multiple times in the result set. By default,
- this implementation prevents duplicates in the result set. Set this
- flag to disable that behavior.
-* `nonull` Set to never return an empty set, instead returning a set
- containing the pattern itself. This is the default in glob(3).
-* `debug` Set to enable debug logging in minimatch and glob.
-* `nobrace` Do not expand `{a,b}` and `{1..3}` brace sets.
-* `noglobstar` Do not match `**` against multiple filenames. (Ie,
- treat it as a normal `*` instead.)
-* `noext` Do not match `+(a|b)` "extglob" patterns.
-* `nocase` Perform a case-insensitive match. Note: on
- case-insensitive filesystems, non-magic patterns will match by
- default, since `stat` and `readdir` will not raise errors.
-* `matchBase` Perform a basename-only match if the pattern does not
- contain any slash characters. That is, `*.js` would be treated as
- equivalent to `**/*.js`, matching all js files in all directories.
-* `nodir` Do not match directories, only files. (Note: to match
- *only* directories, simply put a `/` at the end of the pattern.)
-* `ignore` Add a pattern or an array of patterns to exclude matches.
-* `follow` Follow symlinked directories when expanding `**` patterns.
- Note that this can result in a lot of duplicate references in the
- presence of cyclic links.
-* `realpath` Set to true to call `fs.realpath` on all of the results.
- In the case of a symlink that cannot be resolved, the full absolute
- path to the matched entry is returned (though it will usually be a
- broken symlink)
-* `nonegate` Suppress deprecated `negate` behavior. (See below.)
- Default=true
-* `nocomment` Suppress deprecated `comment` behavior. (See below.)
- Default=true
-
-## Comparisons to other fnmatch/glob implementations
-
-While strict compliance with the existing standards is a worthwhile
-goal, some discrepancies exist between node-glob and other
-implementations, and are intentional.
-
-The double-star character `**` is supported by default, unless the
-`noglobstar` flag is set. This is supported in the manner of bsdglob
-and bash 4.3, where `**` only has special significance if it is the only
-thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but
-`a/**b` will not.
-
-Note that symlinked directories are not crawled as part of a `**`,
-though their contents may match against subsequent portions of the
-pattern. This prevents infinite loops and duplicates and the like.
-
-If an escaped pattern has no matches, and the `nonull` flag is set,
-then glob returns the pattern as-provided, rather than
-interpreting the character escapes. For example,
-`glob.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than
-`"*a?"`. This is akin to setting the `nullglob` option in bash, except
-that it does not resolve escaped pattern characters.
-
-If brace expansion is not disabled, then it is performed before any
-other interpretation of the glob pattern. Thus, a pattern like
-`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded
-**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are
-checked for validity. Since those two are valid, matching proceeds.
-
-### Comments and Negation
-
-**Note**: In version 5 of this module, negation and comments are
-**disabled** by default. You can explicitly set `nonegate:false` or
-`nocomment:false` to re-enable them. They are going away entirely in
-version 6.
-
-The intent for negation would be for a pattern starting with `!` to
-match everything that *doesn't* match the supplied pattern. However,
-the implementation is weird. It is better to use the `ignore` option
-to set a pattern or set of patterns to exclude from matches. If you
-want the "everything except *x*" type of behavior, you can use `**` as
-the main pattern, and set an `ignore` for the things to exclude.
-
-The comments feature is added in minimatch, primarily to more easily
-support use cases like ignore files, where a `#` at the start of a
-line makes the pattern "empty". However, in the context of a
-straightforward filesystem globber, "comments" don't make much sense.
-
-## Windows
-
-**Please only use forward-slashes in glob expressions.**
-
-Though windows uses either `/` or `\` as its path separator, only `/`
-characters are used by this glob implementation. You must use
-forward-slashes **only** in glob expressions. Back-slashes will always
-be interpreted as escape characters, not path separators.
-
-Results from absolute patterns such as `/foo/*` are mounted onto the
-root setting using `path.join`. On windows, this will by default result
-in `/foo/*` matching `C:\foo\bar.txt`.
-
-## Race Conditions
-
-Glob searching, by its very nature, is susceptible to race conditions,
-since it relies on directory walking and such.
-
-As a result, it is possible that a file that exists when glob looks for
-it may have been deleted or modified by the time it returns the result.
-
-As part of its internal implementation, this program caches all stat
-and readdir calls that it makes, in order to cut down on system
-overhead. However, this also makes it even more susceptible to races,
-especially if the cache or statCache objects are reused between glob
-calls.
-
-Users are thus advised not to use a glob result as a guarantee of
-filesystem state in the face of rapid changes. For the vast majority
-of operations, this is never a problem.
-
-## Contributing
-
-Any change to behavior (including bugfixes) must come with a test.
-
-Patches that fail tests or reduce performance will be rejected.
-
-```
-# to run tests
-npm test
-
-# to re-generate test fixtures
-npm run test-regen
-
-# to benchmark against bash/zsh
-npm run bench
-
-# to profile javascript
-npm run prof
-```
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/glob/common.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/glob/common.js
deleted file mode 100644
index e36a631..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/glob/common.js
+++ /dev/null
@@ -1,245 +0,0 @@
-exports.alphasort = alphasort
-exports.alphasorti = alphasorti
-exports.setopts = setopts
-exports.ownProp = ownProp
-exports.makeAbs = makeAbs
-exports.finish = finish
-exports.mark = mark
-exports.isIgnored = isIgnored
-exports.childrenIgnored = childrenIgnored
-
-function ownProp (obj, field) {
- return Object.prototype.hasOwnProperty.call(obj, field)
-}
-
-var path = require("path")
-var minimatch = require("minimatch")
-var isAbsolute = require("path-is-absolute")
-var Minimatch = minimatch.Minimatch
-
-function alphasorti (a, b) {
- return a.toLowerCase().localeCompare(b.toLowerCase())
-}
-
-function alphasort (a, b) {
- return a.localeCompare(b)
-}
-
-function setupIgnores (self, options) {
- self.ignore = options.ignore || []
-
- if (!Array.isArray(self.ignore))
- self.ignore = [self.ignore]
-
- if (self.ignore.length) {
- self.ignore = self.ignore.map(ignoreMap)
- }
-}
-
-function ignoreMap (pattern) {
- var gmatcher = null
- if (pattern.slice(-3) === '/**') {
- var gpattern = pattern.replace(/(\/\*\*)+$/, '')
- gmatcher = new Minimatch(gpattern)
- }
-
- return {
- matcher: new Minimatch(pattern),
- gmatcher: gmatcher
- }
-}
-
-function setopts (self, pattern, options) {
- if (!options)
- options = {}
-
- // base-matching: just use globstar for that.
- if (options.matchBase && -1 === pattern.indexOf("/")) {
- if (options.noglobstar) {
- throw new Error("base matching requires globstar")
- }
- pattern = "**/" + pattern
- }
-
- self.silent = !!options.silent
- self.pattern = pattern
- self.strict = options.strict !== false
- self.realpath = !!options.realpath
- self.realpathCache = options.realpathCache || Object.create(null)
- self.follow = !!options.follow
- self.dot = !!options.dot
- self.mark = !!options.mark
- self.nodir = !!options.nodir
- if (self.nodir)
- self.mark = true
- self.sync = !!options.sync
- self.nounique = !!options.nounique
- self.nonull = !!options.nonull
- self.nosort = !!options.nosort
- self.nocase = !!options.nocase
- self.stat = !!options.stat
- self.noprocess = !!options.noprocess
-
- self.maxLength = options.maxLength || Infinity
- self.cache = options.cache || Object.create(null)
- self.statCache = options.statCache || Object.create(null)
- self.symlinks = options.symlinks || Object.create(null)
-
- setupIgnores(self, options)
-
- self.changedCwd = false
- var cwd = process.cwd()
- if (!ownProp(options, "cwd"))
- self.cwd = cwd
- else {
- self.cwd = options.cwd
- self.changedCwd = path.resolve(options.cwd) !== cwd
- }
-
- self.root = options.root || path.resolve(self.cwd, "/")
- self.root = path.resolve(self.root)
- if (process.platform === "win32")
- self.root = self.root.replace(/\\/g, "/")
-
- self.nomount = !!options.nomount
-
- // disable comments and negation unless the user explicitly
- // passes in false as the option.
- options.nonegate = options.nonegate === false ? false : true
- options.nocomment = options.nocomment === false ? false : true
- deprecationWarning(options)
-
- self.minimatch = new Minimatch(pattern, options)
- self.options = self.minimatch.options
-}
-
-// TODO(isaacs): remove entirely in v6
-// exported to reset in tests
-exports.deprecationWarned
-function deprecationWarning(options) {
- if (!options.nonegate || !options.nocomment) {
- if (process.noDeprecation !== true && !exports.deprecationWarned) {
- var msg = 'glob WARNING: comments and negation will be disabled in v6'
- if (process.throwDeprecation)
- throw new Error(msg)
- else if (process.traceDeprecation)
- console.trace(msg)
- else
- console.error(msg)
-
- exports.deprecationWarned = true
- }
- }
-}
-
-function finish (self) {
- var nou = self.nounique
- var all = nou ? [] : Object.create(null)
-
- for (var i = 0, l = self.matches.length; i < l; i ++) {
- var matches = self.matches[i]
- if (!matches || Object.keys(matches).length === 0) {
- if (self.nonull) {
- // do like the shell, and spit out the literal glob
- var literal = self.minimatch.globSet[i]
- if (nou)
- all.push(literal)
- else
- all[literal] = true
- }
- } else {
- // had matches
- var m = Object.keys(matches)
- if (nou)
- all.push.apply(all, m)
- else
- m.forEach(function (m) {
- all[m] = true
- })
- }
- }
-
- if (!nou)
- all = Object.keys(all)
-
- if (!self.nosort)
- all = all.sort(self.nocase ? alphasorti : alphasort)
-
- // at *some* point we statted all of these
- if (self.mark) {
- for (var i = 0; i < all.length; i++) {
- all[i] = self._mark(all[i])
- }
- if (self.nodir) {
- all = all.filter(function (e) {
- return !(/\/$/.test(e))
- })
- }
- }
-
- if (self.ignore.length)
- all = all.filter(function(m) {
- return !isIgnored(self, m)
- })
-
- self.found = all
-}
-
-function mark (self, p) {
- var abs = makeAbs(self, p)
- var c = self.cache[abs]
- var m = p
- if (c) {
- var isDir = c === 'DIR' || Array.isArray(c)
- var slash = p.slice(-1) === '/'
-
- if (isDir && !slash)
- m += '/'
- else if (!isDir && slash)
- m = m.slice(0, -1)
-
- if (m !== p) {
- var mabs = makeAbs(self, m)
- self.statCache[mabs] = self.statCache[abs]
- self.cache[mabs] = self.cache[abs]
- }
- }
-
- return m
-}
-
-// lotta situps...
-function makeAbs (self, f) {
- var abs = f
- if (f.charAt(0) === '/') {
- abs = path.join(self.root, f)
- } else if (isAbsolute(f) || f === '') {
- abs = f
- } else if (self.changedCwd) {
- abs = path.resolve(self.cwd, f)
- } else {
- abs = path.resolve(f)
- }
- return abs
-}
-
-
-// Return true, if pattern ends with globstar '**', for the accompanying parent directory.
-// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents
-function isIgnored (self, path) {
- if (!self.ignore.length)
- return false
-
- return self.ignore.some(function(item) {
- return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))
- })
-}
-
-function childrenIgnored (self, path) {
- if (!self.ignore.length)
- return false
-
- return self.ignore.some(function(item) {
- return !!(item.gmatcher && item.gmatcher.match(path))
- })
-}
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/glob/glob.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/glob/glob.js
deleted file mode 100644
index 022d2ac..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/glob/glob.js
+++ /dev/null
@@ -1,752 +0,0 @@
-// Approach:
-//
-// 1. Get the minimatch set
-// 2. For each pattern in the set, PROCESS(pattern, false)
-// 3. Store matches per-set, then uniq them
-//
-// PROCESS(pattern, inGlobStar)
-// Get the first [n] items from pattern that are all strings
-// Join these together. This is PREFIX.
-// If there is no more remaining, then stat(PREFIX) and
-// add to matches if it succeeds. END.
-//
-// If inGlobStar and PREFIX is symlink and points to dir
-// set ENTRIES = []
-// else readdir(PREFIX) as ENTRIES
-// If fail, END
-//
-// with ENTRIES
-// If pattern[n] is GLOBSTAR
-// // handle the case where the globstar match is empty
-// // by pruning it out, and testing the resulting pattern
-// PROCESS(pattern[0..n] + pattern[n+1 .. $], false)
-// // handle other cases.
-// for ENTRY in ENTRIES (not dotfiles)
-// // attach globstar + tail onto the entry
-// // Mark that this entry is a globstar match
-// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true)
-//
-// else // not globstar
-// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot)
-// Test ENTRY against pattern[n]
-// If fails, continue
-// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $])
-//
-// Caveat:
-// Cache all stats and readdirs results to minimize syscall. Since all
-// we ever care about is existence and directory-ness, we can just keep
-// `true` for files, and [children,...] for directories, or `false` for
-// things that don't exist.
-
-module.exports = glob
-
-var fs = require('fs')
-var minimatch = require('minimatch')
-var Minimatch = minimatch.Minimatch
-var inherits = require('inherits')
-var EE = require('events').EventEmitter
-var path = require('path')
-var assert = require('assert')
-var isAbsolute = require('path-is-absolute')
-var globSync = require('./sync.js')
-var common = require('./common.js')
-var alphasort = common.alphasort
-var alphasorti = common.alphasorti
-var setopts = common.setopts
-var ownProp = common.ownProp
-var inflight = require('inflight')
-var util = require('util')
-var childrenIgnored = common.childrenIgnored
-var isIgnored = common.isIgnored
-
-var once = require('once')
-
-function glob (pattern, options, cb) {
- if (typeof options === 'function') cb = options, options = {}
- if (!options) options = {}
-
- if (options.sync) {
- if (cb)
- throw new TypeError('callback provided to sync glob')
- return globSync(pattern, options)
- }
-
- return new Glob(pattern, options, cb)
-}
-
-glob.sync = globSync
-var GlobSync = glob.GlobSync = globSync.GlobSync
-
-// old api surface
-glob.glob = glob
-
-glob.hasMagic = function (pattern, options_) {
- var options = util._extend({}, options_)
- options.noprocess = true
-
- var g = new Glob(pattern, options)
- var set = g.minimatch.set
- if (set.length > 1)
- return true
-
- for (var j = 0; j < set[0].length; j++) {
- if (typeof set[0][j] !== 'string')
- return true
- }
-
- return false
-}
-
-glob.Glob = Glob
-inherits(Glob, EE)
-function Glob (pattern, options, cb) {
- if (typeof options === 'function') {
- cb = options
- options = null
- }
-
- if (options && options.sync) {
- if (cb)
- throw new TypeError('callback provided to sync glob')
- return new GlobSync(pattern, options)
- }
-
- if (!(this instanceof Glob))
- return new Glob(pattern, options, cb)
-
- setopts(this, pattern, options)
- this._didRealPath = false
-
- // process each pattern in the minimatch set
- var n = this.minimatch.set.length
-
- // The matches are stored as {: true,...} so that
- // duplicates are automagically pruned.
- // Later, we do an Object.keys() on these.
- // Keep them as a list so we can fill in when nonull is set.
- this.matches = new Array(n)
-
- if (typeof cb === 'function') {
- cb = once(cb)
- this.on('error', cb)
- this.on('end', function (matches) {
- cb(null, matches)
- })
- }
-
- var self = this
- var n = this.minimatch.set.length
- this._processing = 0
- this.matches = new Array(n)
-
- this._emitQueue = []
- this._processQueue = []
- this.paused = false
-
- if (this.noprocess)
- return this
-
- if (n === 0)
- return done()
-
- for (var i = 0; i < n; i ++) {
- this._process(this.minimatch.set[i], i, false, done)
- }
-
- function done () {
- --self._processing
- if (self._processing <= 0)
- self._finish()
- }
-}
-
-Glob.prototype._finish = function () {
- assert(this instanceof Glob)
- if (this.aborted)
- return
-
- if (this.realpath && !this._didRealpath)
- return this._realpath()
-
- common.finish(this)
- this.emit('end', this.found)
-}
-
-Glob.prototype._realpath = function () {
- if (this._didRealpath)
- return
-
- this._didRealpath = true
-
- var n = this.matches.length
- if (n === 0)
- return this._finish()
-
- var self = this
- for (var i = 0; i < this.matches.length; i++)
- this._realpathSet(i, next)
-
- function next () {
- if (--n === 0)
- self._finish()
- }
-}
-
-Glob.prototype._realpathSet = function (index, cb) {
- var matchset = this.matches[index]
- if (!matchset)
- return cb()
-
- var found = Object.keys(matchset)
- var self = this
- var n = found.length
-
- if (n === 0)
- return cb()
-
- var set = this.matches[index] = Object.create(null)
- found.forEach(function (p, i) {
- // If there's a problem with the stat, then it means that
- // one or more of the links in the realpath couldn't be
- // resolved. just return the abs value in that case.
- p = self._makeAbs(p)
- fs.realpath(p, self.realpathCache, function (er, real) {
- if (!er)
- set[real] = true
- else if (er.syscall === 'stat')
- set[p] = true
- else
- self.emit('error', er) // srsly wtf right here
-
- if (--n === 0) {
- self.matches[index] = set
- cb()
- }
- })
- })
-}
-
-Glob.prototype._mark = function (p) {
- return common.mark(this, p)
-}
-
-Glob.prototype._makeAbs = function (f) {
- return common.makeAbs(this, f)
-}
-
-Glob.prototype.abort = function () {
- this.aborted = true
- this.emit('abort')
-}
-
-Glob.prototype.pause = function () {
- if (!this.paused) {
- this.paused = true
- this.emit('pause')
- }
-}
-
-Glob.prototype.resume = function () {
- if (this.paused) {
- this.emit('resume')
- this.paused = false
- if (this._emitQueue.length) {
- var eq = this._emitQueue.slice(0)
- this._emitQueue.length = 0
- for (var i = 0; i < eq.length; i ++) {
- var e = eq[i]
- this._emitMatch(e[0], e[1])
- }
- }
- if (this._processQueue.length) {
- var pq = this._processQueue.slice(0)
- this._processQueue.length = 0
- for (var i = 0; i < pq.length; i ++) {
- var p = pq[i]
- this._processing--
- this._process(p[0], p[1], p[2], p[3])
- }
- }
- }
-}
-
-Glob.prototype._process = function (pattern, index, inGlobStar, cb) {
- assert(this instanceof Glob)
- assert(typeof cb === 'function')
-
- if (this.aborted)
- return
-
- this._processing++
- if (this.paused) {
- this._processQueue.push([pattern, index, inGlobStar, cb])
- return
- }
-
- //console.error('PROCESS %d', this._processing, pattern)
-
- // Get the first [n] parts of pattern that are all strings.
- var n = 0
- while (typeof pattern[n] === 'string') {
- n ++
- }
- // now n is the index of the first one that is *not* a string.
-
- // see if there's anything else
- var prefix
- switch (n) {
- // if not, then this is rather simple
- case pattern.length:
- this._processSimple(pattern.join('/'), index, cb)
- return
-
- case 0:
- // pattern *starts* with some non-trivial item.
- // going to readdir(cwd), but not include the prefix in matches.
- prefix = null
- break
-
- default:
- // pattern has some string bits in the front.
- // whatever it starts with, whether that's 'absolute' like /foo/bar,
- // or 'relative' like '../baz'
- prefix = pattern.slice(0, n).join('/')
- break
- }
-
- var remain = pattern.slice(n)
-
- // get the list of entries.
- var read
- if (prefix === null)
- read = '.'
- else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) {
- if (!prefix || !isAbsolute(prefix))
- prefix = '/' + prefix
- read = prefix
- } else
- read = prefix
-
- var abs = this._makeAbs(read)
-
- //if ignored, skip _processing
- if (childrenIgnored(this, read))
- return cb()
-
- var isGlobStar = remain[0] === minimatch.GLOBSTAR
- if (isGlobStar)
- this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb)
- else
- this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb)
-}
-
-Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) {
- var self = this
- this._readdir(abs, inGlobStar, function (er, entries) {
- return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb)
- })
-}
-
-Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) {
-
- // if the abs isn't a dir, then nothing can match!
- if (!entries)
- return cb()
-
- // It will only match dot entries if it starts with a dot, or if
- // dot is set. Stuff like @(.foo|.bar) isn't allowed.
- var pn = remain[0]
- var negate = !!this.minimatch.negate
- var rawGlob = pn._glob
- var dotOk = this.dot || rawGlob.charAt(0) === '.'
-
- var matchedEntries = []
- for (var i = 0; i < entries.length; i++) {
- var e = entries[i]
- if (e.charAt(0) !== '.' || dotOk) {
- var m
- if (negate && !prefix) {
- m = !e.match(pn)
- } else {
- m = e.match(pn)
- }
- if (m)
- matchedEntries.push(e)
- }
- }
-
- //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries)
-
- var len = matchedEntries.length
- // If there are no matched entries, then nothing matches.
- if (len === 0)
- return cb()
-
- // if this is the last remaining pattern bit, then no need for
- // an additional stat *unless* the user has specified mark or
- // stat explicitly. We know they exist, since readdir returned
- // them.
-
- if (remain.length === 1 && !this.mark && !this.stat) {
- if (!this.matches[index])
- this.matches[index] = Object.create(null)
-
- for (var i = 0; i < len; i ++) {
- var e = matchedEntries[i]
- if (prefix) {
- if (prefix !== '/')
- e = prefix + '/' + e
- else
- e = prefix + e
- }
-
- if (e.charAt(0) === '/' && !this.nomount) {
- e = path.join(this.root, e)
- }
- this._emitMatch(index, e)
- }
- // This was the last one, and no stats were needed
- return cb()
- }
-
- // now test all matched entries as stand-ins for that part
- // of the pattern.
- remain.shift()
- for (var i = 0; i < len; i ++) {
- var e = matchedEntries[i]
- var newPattern
- if (prefix) {
- if (prefix !== '/')
- e = prefix + '/' + e
- else
- e = prefix + e
- }
- this._process([e].concat(remain), index, inGlobStar, cb)
- }
- cb()
-}
-
-Glob.prototype._emitMatch = function (index, e) {
- if (this.aborted)
- return
-
- if (this.matches[index][e])
- return
-
- if (isIgnored(this, e))
- return
-
- if (this.paused) {
- this._emitQueue.push([index, e])
- return
- }
-
- var abs = this._makeAbs(e)
-
- if (this.nodir) {
- var c = this.cache[abs]
- if (c === 'DIR' || Array.isArray(c))
- return
- }
-
- if (this.mark)
- e = this._mark(e)
-
- this.matches[index][e] = true
-
- var st = this.statCache[abs]
- if (st)
- this.emit('stat', e, st)
-
- this.emit('match', e)
-}
-
-Glob.prototype._readdirInGlobStar = function (abs, cb) {
- if (this.aborted)
- return
-
- // follow all symlinked directories forever
- // just proceed as if this is a non-globstar situation
- if (this.follow)
- return this._readdir(abs, false, cb)
-
- var lstatkey = 'lstat\0' + abs
- var self = this
- var lstatcb = inflight(lstatkey, lstatcb_)
-
- if (lstatcb)
- fs.lstat(abs, lstatcb)
-
- function lstatcb_ (er, lstat) {
- if (er)
- return cb()
-
- var isSym = lstat.isSymbolicLink()
- self.symlinks[abs] = isSym
-
- // If it's not a symlink or a dir, then it's definitely a regular file.
- // don't bother doing a readdir in that case.
- if (!isSym && !lstat.isDirectory()) {
- self.cache[abs] = 'FILE'
- cb()
- } else
- self._readdir(abs, false, cb)
- }
-}
-
-Glob.prototype._readdir = function (abs, inGlobStar, cb) {
- if (this.aborted)
- return
-
- cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb)
- if (!cb)
- return
-
- //console.error('RD %j %j', +inGlobStar, abs)
- if (inGlobStar && !ownProp(this.symlinks, abs))
- return this._readdirInGlobStar(abs, cb)
-
- if (ownProp(this.cache, abs)) {
- var c = this.cache[abs]
- if (!c || c === 'FILE')
- return cb()
-
- if (Array.isArray(c))
- return cb(null, c)
- }
-
- var self = this
- fs.readdir(abs, readdirCb(this, abs, cb))
-}
-
-function readdirCb (self, abs, cb) {
- return function (er, entries) {
- if (er)
- self._readdirError(abs, er, cb)
- else
- self._readdirEntries(abs, entries, cb)
- }
-}
-
-Glob.prototype._readdirEntries = function (abs, entries, cb) {
- if (this.aborted)
- return
-
- // if we haven't asked to stat everything, then just
- // assume that everything in there exists, so we can avoid
- // having to stat it a second time.
- if (!this.mark && !this.stat) {
- for (var i = 0; i < entries.length; i ++) {
- var e = entries[i]
- if (abs === '/')
- e = abs + e
- else
- e = abs + '/' + e
- this.cache[e] = true
- }
- }
-
- this.cache[abs] = entries
- return cb(null, entries)
-}
-
-Glob.prototype._readdirError = function (f, er, cb) {
- if (this.aborted)
- return
-
- // handle errors, and cache the information
- switch (er.code) {
- case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205
- case 'ENOTDIR': // totally normal. means it *does* exist.
- this.cache[this._makeAbs(f)] = 'FILE'
- break
-
- case 'ENOENT': // not terribly unusual
- case 'ELOOP':
- case 'ENAMETOOLONG':
- case 'UNKNOWN':
- this.cache[this._makeAbs(f)] = false
- break
-
- default: // some unusual error. Treat as failure.
- this.cache[this._makeAbs(f)] = false
- if (this.strict) {
- this.emit('error', er)
- // If the error is handled, then we abort
- // if not, we threw out of here
- this.abort()
- }
- if (!this.silent)
- console.error('glob error', er)
- break
- }
-
- return cb()
-}
-
-Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) {
- var self = this
- this._readdir(abs, inGlobStar, function (er, entries) {
- self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb)
- })
-}
-
-
-Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) {
- //console.error('pgs2', prefix, remain[0], entries)
-
- // no entries means not a dir, so it can never have matches
- // foo.txt/** doesn't match foo.txt
- if (!entries)
- return cb()
-
- // test without the globstar, and with every child both below
- // and replacing the globstar.
- var remainWithoutGlobStar = remain.slice(1)
- var gspref = prefix ? [ prefix ] : []
- var noGlobStar = gspref.concat(remainWithoutGlobStar)
-
- // the noGlobStar pattern exits the inGlobStar state
- this._process(noGlobStar, index, false, cb)
-
- var isSym = this.symlinks[abs]
- var len = entries.length
-
- // If it's a symlink, and we're in a globstar, then stop
- if (isSym && inGlobStar)
- return cb()
-
- for (var i = 0; i < len; i++) {
- var e = entries[i]
- if (e.charAt(0) === '.' && !this.dot)
- continue
-
- // these two cases enter the inGlobStar state
- var instead = gspref.concat(entries[i], remainWithoutGlobStar)
- this._process(instead, index, true, cb)
-
- var below = gspref.concat(entries[i], remain)
- this._process(below, index, true, cb)
- }
-
- cb()
-}
-
-Glob.prototype._processSimple = function (prefix, index, cb) {
- // XXX review this. Shouldn't it be doing the mounting etc
- // before doing stat? kinda weird?
- var self = this
- this._stat(prefix, function (er, exists) {
- self._processSimple2(prefix, index, er, exists, cb)
- })
-}
-Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) {
-
- //console.error('ps2', prefix, exists)
-
- if (!this.matches[index])
- this.matches[index] = Object.create(null)
-
- // If it doesn't exist, then just mark the lack of results
- if (!exists)
- return cb()
-
- if (prefix && isAbsolute(prefix) && !this.nomount) {
- var trail = /[\/\\]$/.test(prefix)
- if (prefix.charAt(0) === '/') {
- prefix = path.join(this.root, prefix)
- } else {
- prefix = path.resolve(this.root, prefix)
- if (trail)
- prefix += '/'
- }
- }
-
- if (process.platform === 'win32')
- prefix = prefix.replace(/\\/g, '/')
-
- // Mark this as a match
- this._emitMatch(index, prefix)
- cb()
-}
-
-// Returns either 'DIR', 'FILE', or false
-Glob.prototype._stat = function (f, cb) {
- var abs = this._makeAbs(f)
- var needDir = f.slice(-1) === '/'
-
- if (f.length > this.maxLength)
- return cb()
-
- if (!this.stat && ownProp(this.cache, abs)) {
- var c = this.cache[abs]
-
- if (Array.isArray(c))
- c = 'DIR'
-
- // It exists, but maybe not how we need it
- if (!needDir || c === 'DIR')
- return cb(null, c)
-
- if (needDir && c === 'FILE')
- return cb()
-
- // otherwise we have to stat, because maybe c=true
- // if we know it exists, but not what it is.
- }
-
- var exists
- var stat = this.statCache[abs]
- if (stat !== undefined) {
- if (stat === false)
- return cb(null, stat)
- else {
- var type = stat.isDirectory() ? 'DIR' : 'FILE'
- if (needDir && type === 'FILE')
- return cb()
- else
- return cb(null, type, stat)
- }
- }
-
- var self = this
- var statcb = inflight('stat\0' + abs, lstatcb_)
- if (statcb)
- fs.lstat(abs, statcb)
-
- function lstatcb_ (er, lstat) {
- if (lstat && lstat.isSymbolicLink()) {
- // If it's a symlink, then treat it as the target, unless
- // the target does not exist, then treat it as a file.
- return fs.stat(abs, function (er, stat) {
- if (er)
- self._stat2(f, abs, null, lstat, cb)
- else
- self._stat2(f, abs, er, stat, cb)
- })
- } else {
- self._stat2(f, abs, er, lstat, cb)
- }
- }
-}
-
-Glob.prototype._stat2 = function (f, abs, er, stat, cb) {
- if (er) {
- this.statCache[abs] = false
- return cb()
- }
-
- var needDir = f.slice(-1) === '/'
- this.statCache[abs] = stat
-
- if (abs.slice(-1) === '/' && !stat.isDirectory())
- return cb(null, false, stat)
-
- var c = stat.isDirectory() ? 'DIR' : 'FILE'
- this.cache[abs] = this.cache[abs] || c
-
- if (needDir && c !== 'DIR')
- return cb()
-
- return cb(null, c, stat)
-}
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/glob/package.json b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/glob/package.json
deleted file mode 100644
index 2823a1c..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/glob/package.json
+++ /dev/null
@@ -1,108 +0,0 @@
-{
- "_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",
- "_id": "glob@5.0.15",
- "_inCache": true,
- "_installable": true,
- "_location": "/glob",
- "_nodeVersion": "4.0.0",
- "_npmUser": {
- "name": "isaacs",
- "email": "isaacs@npmjs.com"
- },
- "_npmVersion": "3.3.2",
- "_phantomChildren": {},
- "_requested": {
- "raw": "glob@^5.0.13",
- "scope": null,
- "escapedName": "glob",
- "name": "glob",
- "rawSpec": "^5.0.13",
- "spec": ">=5.0.13 <6.0.0",
- "type": "range"
- },
- "_requiredBy": [
- "/cordova-common",
- "/istanbul"
- ],
- "_resolved": "http://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",
- "author": {
- "name": "Isaac Z. Schlueter",
- "email": "i@izs.me",
- "url": "http://blog.izs.me/"
- },
- "bugs": {
- "url": "https://github.com/isaacs/node-glob/issues"
- },
- "dependencies": {
- "inflight": "^1.0.4",
- "inherits": "2",
- "minimatch": "2 || 3",
- "once": "^1.3.0",
- "path-is-absolute": "^1.0.0"
- },
- "description": "a little globber",
- "devDependencies": {
- "mkdirp": "0",
- "rimraf": "^2.2.8",
- "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": "*"
- },
- "files": [
- "glob.js",
- "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"
- },
- "scripts": {
- "bench": "bash benchmark.sh",
- "benchclean": "node benchclean.js",
- "prepublish": "npm run benchclean",
- "prof": "bash prof.sh && cat profile.txt",
- "profclean": "rm -f v8.log profile.txt",
- "test": "tap test/*.js --cov",
- "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js"
- },
- "version": "5.0.15"
-}
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/glob/sync.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/glob/sync.js
deleted file mode 100644
index 09883d2..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/glob/sync.js
+++ /dev/null
@@ -1,460 +0,0 @@
-module.exports = globSync
-globSync.GlobSync = GlobSync
-
-var fs = require('fs')
-var minimatch = require('minimatch')
-var Minimatch = minimatch.Minimatch
-var Glob = require('./glob.js').Glob
-var util = require('util')
-var path = require('path')
-var assert = require('assert')
-var isAbsolute = require('path-is-absolute')
-var common = require('./common.js')
-var alphasort = common.alphasort
-var alphasorti = common.alphasorti
-var setopts = common.setopts
-var ownProp = common.ownProp
-var childrenIgnored = common.childrenIgnored
-
-function globSync (pattern, options) {
- if (typeof options === 'function' || arguments.length === 3)
- throw new TypeError('callback provided to sync glob\n'+
- 'See: https://github.com/isaacs/node-glob/issues/167')
-
- return new GlobSync(pattern, options).found
-}
-
-function GlobSync (pattern, options) {
- if (!pattern)
- throw new Error('must provide pattern')
-
- if (typeof options === 'function' || arguments.length === 3)
- throw new TypeError('callback provided to sync glob\n'+
- 'See: https://github.com/isaacs/node-glob/issues/167')
-
- if (!(this instanceof GlobSync))
- return new GlobSync(pattern, options)
-
- setopts(this, pattern, options)
-
- if (this.noprocess)
- return this
-
- var n = this.minimatch.set.length
- this.matches = new Array(n)
- for (var i = 0; i < n; i ++) {
- this._process(this.minimatch.set[i], i, false)
- }
- this._finish()
-}
-
-GlobSync.prototype._finish = function () {
- assert(this instanceof GlobSync)
- if (this.realpath) {
- var self = this
- this.matches.forEach(function (matchset, index) {
- var set = self.matches[index] = Object.create(null)
- for (var p in matchset) {
- try {
- p = self._makeAbs(p)
- var real = fs.realpathSync(p, self.realpathCache)
- set[real] = true
- } catch (er) {
- if (er.syscall === 'stat')
- set[self._makeAbs(p)] = true
- else
- throw er
- }
- }
- })
- }
- common.finish(this)
-}
-
-
-GlobSync.prototype._process = function (pattern, index, inGlobStar) {
- assert(this instanceof GlobSync)
-
- // Get the first [n] parts of pattern that are all strings.
- var n = 0
- while (typeof pattern[n] === 'string') {
- n ++
- }
- // now n is the index of the first one that is *not* a string.
-
- // See if there's anything else
- var prefix
- switch (n) {
- // if not, then this is rather simple
- case pattern.length:
- this._processSimple(pattern.join('/'), index)
- return
-
- case 0:
- // pattern *starts* with some non-trivial item.
- // going to readdir(cwd), but not include the prefix in matches.
- prefix = null
- break
-
- default:
- // pattern has some string bits in the front.
- // whatever it starts with, whether that's 'absolute' like /foo/bar,
- // or 'relative' like '../baz'
- prefix = pattern.slice(0, n).join('/')
- break
- }
-
- var remain = pattern.slice(n)
-
- // get the list of entries.
- var read
- if (prefix === null)
- read = '.'
- else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) {
- if (!prefix || !isAbsolute(prefix))
- prefix = '/' + prefix
- read = prefix
- } else
- read = prefix
-
- var abs = this._makeAbs(read)
-
- //if ignored, skip processing
- if (childrenIgnored(this, read))
- return
-
- var isGlobStar = remain[0] === minimatch.GLOBSTAR
- if (isGlobStar)
- this._processGlobStar(prefix, read, abs, remain, index, inGlobStar)
- else
- this._processReaddir(prefix, read, abs, remain, index, inGlobStar)
-}
-
-
-GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) {
- var entries = this._readdir(abs, inGlobStar)
-
- // if the abs isn't a dir, then nothing can match!
- if (!entries)
- return
-
- // It will only match dot entries if it starts with a dot, or if
- // dot is set. Stuff like @(.foo|.bar) isn't allowed.
- var pn = remain[0]
- var negate = !!this.minimatch.negate
- var rawGlob = pn._glob
- var dotOk = this.dot || rawGlob.charAt(0) === '.'
-
- var matchedEntries = []
- for (var i = 0; i < entries.length; i++) {
- var e = entries[i]
- if (e.charAt(0) !== '.' || dotOk) {
- var m
- if (negate && !prefix) {
- m = !e.match(pn)
- } else {
- m = e.match(pn)
- }
- if (m)
- matchedEntries.push(e)
- }
- }
-
- var len = matchedEntries.length
- // If there are no matched entries, then nothing matches.
- if (len === 0)
- return
-
- // if this is the last remaining pattern bit, then no need for
- // an additional stat *unless* the user has specified mark or
- // stat explicitly. We know they exist, since readdir returned
- // them.
-
- if (remain.length === 1 && !this.mark && !this.stat) {
- if (!this.matches[index])
- this.matches[index] = Object.create(null)
-
- for (var i = 0; i < len; i ++) {
- var e = matchedEntries[i]
- if (prefix) {
- if (prefix.slice(-1) !== '/')
- e = prefix + '/' + e
- else
- e = prefix + e
- }
-
- if (e.charAt(0) === '/' && !this.nomount) {
- e = path.join(this.root, e)
- }
- this.matches[index][e] = true
- }
- // This was the last one, and no stats were needed
- return
- }
-
- // now test all matched entries as stand-ins for that part
- // of the pattern.
- remain.shift()
- for (var i = 0; i < len; i ++) {
- var e = matchedEntries[i]
- var newPattern
- if (prefix)
- newPattern = [prefix, e]
- else
- newPattern = [e]
- this._process(newPattern.concat(remain), index, inGlobStar)
- }
-}
-
-
-GlobSync.prototype._emitMatch = function (index, e) {
- var abs = this._makeAbs(e)
- if (this.mark)
- e = this._mark(e)
-
- if (this.matches[index][e])
- return
-
- if (this.nodir) {
- var c = this.cache[this._makeAbs(e)]
- if (c === 'DIR' || Array.isArray(c))
- return
- }
-
- this.matches[index][e] = true
- if (this.stat)
- this._stat(e)
-}
-
-
-GlobSync.prototype._readdirInGlobStar = function (abs) {
- // follow all symlinked directories forever
- // just proceed as if this is a non-globstar situation
- if (this.follow)
- return this._readdir(abs, false)
-
- var entries
- var lstat
- var stat
- try {
- lstat = fs.lstatSync(abs)
- } catch (er) {
- // lstat failed, doesn't exist
- return null
- }
-
- var isSym = lstat.isSymbolicLink()
- this.symlinks[abs] = isSym
-
- // If it's not a symlink or a dir, then it's definitely a regular file.
- // don't bother doing a readdir in that case.
- if (!isSym && !lstat.isDirectory())
- this.cache[abs] = 'FILE'
- else
- entries = this._readdir(abs, false)
-
- return entries
-}
-
-GlobSync.prototype._readdir = function (abs, inGlobStar) {
- var entries
-
- if (inGlobStar && !ownProp(this.symlinks, abs))
- return this._readdirInGlobStar(abs)
-
- if (ownProp(this.cache, abs)) {
- var c = this.cache[abs]
- if (!c || c === 'FILE')
- return null
-
- if (Array.isArray(c))
- return c
- }
-
- try {
- return this._readdirEntries(abs, fs.readdirSync(abs))
- } catch (er) {
- this._readdirError(abs, er)
- return null
- }
-}
-
-GlobSync.prototype._readdirEntries = function (abs, entries) {
- // if we haven't asked to stat everything, then just
- // assume that everything in there exists, so we can avoid
- // having to stat it a second time.
- if (!this.mark && !this.stat) {
- for (var i = 0; i < entries.length; i ++) {
- var e = entries[i]
- if (abs === '/')
- e = abs + e
- else
- e = abs + '/' + e
- this.cache[e] = true
- }
- }
-
- this.cache[abs] = entries
-
- // mark and cache dir-ness
- return entries
-}
-
-GlobSync.prototype._readdirError = function (f, er) {
- // handle errors, and cache the information
- switch (er.code) {
- case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205
- case 'ENOTDIR': // totally normal. means it *does* exist.
- this.cache[this._makeAbs(f)] = 'FILE'
- break
-
- case 'ENOENT': // not terribly unusual
- case 'ELOOP':
- case 'ENAMETOOLONG':
- case 'UNKNOWN':
- this.cache[this._makeAbs(f)] = false
- break
-
- default: // some unusual error. Treat as failure.
- this.cache[this._makeAbs(f)] = false
- if (this.strict)
- throw er
- if (!this.silent)
- console.error('glob error', er)
- break
- }
-}
-
-GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) {
-
- var entries = this._readdir(abs, inGlobStar)
-
- // no entries means not a dir, so it can never have matches
- // foo.txt/** doesn't match foo.txt
- if (!entries)
- return
-
- // test without the globstar, and with every child both below
- // and replacing the globstar.
- var remainWithoutGlobStar = remain.slice(1)
- var gspref = prefix ? [ prefix ] : []
- var noGlobStar = gspref.concat(remainWithoutGlobStar)
-
- // the noGlobStar pattern exits the inGlobStar state
- this._process(noGlobStar, index, false)
-
- var len = entries.length
- var isSym = this.symlinks[abs]
-
- // If it's a symlink, and we're in a globstar, then stop
- if (isSym && inGlobStar)
- return
-
- for (var i = 0; i < len; i++) {
- var e = entries[i]
- if (e.charAt(0) === '.' && !this.dot)
- continue
-
- // these two cases enter the inGlobStar state
- var instead = gspref.concat(entries[i], remainWithoutGlobStar)
- this._process(instead, index, true)
-
- var below = gspref.concat(entries[i], remain)
- this._process(below, index, true)
- }
-}
-
-GlobSync.prototype._processSimple = function (prefix, index) {
- // XXX review this. Shouldn't it be doing the mounting etc
- // before doing stat? kinda weird?
- var exists = this._stat(prefix)
-
- if (!this.matches[index])
- this.matches[index] = Object.create(null)
-
- // If it doesn't exist, then just mark the lack of results
- if (!exists)
- return
-
- if (prefix && isAbsolute(prefix) && !this.nomount) {
- var trail = /[\/\\]$/.test(prefix)
- if (prefix.charAt(0) === '/') {
- prefix = path.join(this.root, prefix)
- } else {
- prefix = path.resolve(this.root, prefix)
- if (trail)
- prefix += '/'
- }
- }
-
- if (process.platform === 'win32')
- prefix = prefix.replace(/\\/g, '/')
-
- // Mark this as a match
- this.matches[index][prefix] = true
-}
-
-// Returns either 'DIR', 'FILE', or false
-GlobSync.prototype._stat = function (f) {
- var abs = this._makeAbs(f)
- var needDir = f.slice(-1) === '/'
-
- if (f.length > this.maxLength)
- return false
-
- if (!this.stat && ownProp(this.cache, abs)) {
- var c = this.cache[abs]
-
- if (Array.isArray(c))
- c = 'DIR'
-
- // It exists, but maybe not how we need it
- if (!needDir || c === 'DIR')
- return c
-
- if (needDir && c === 'FILE')
- return false
-
- // otherwise we have to stat, because maybe c=true
- // if we know it exists, but not what it is.
- }
-
- var exists
- var stat = this.statCache[abs]
- if (!stat) {
- var lstat
- try {
- lstat = fs.lstatSync(abs)
- } catch (er) {
- return false
- }
-
- if (lstat.isSymbolicLink()) {
- try {
- stat = fs.statSync(abs)
- } catch (er) {
- stat = lstat
- }
- } else {
- stat = lstat
- }
- }
-
- this.statCache[abs] = stat
-
- var c = stat.isDirectory() ? 'DIR' : 'FILE'
- this.cache[abs] = this.cache[abs] || c
-
- if (needDir && c !== 'DIR')
- return false
-
- return c
-}
-
-GlobSync.prototype._mark = function (p) {
- return common.mark(this, p)
-}
-
-GlobSync.prototype._makeAbs = function (f) {
- return common.makeAbs(this, f)
-}
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/inflight/LICENSE b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/inflight/LICENSE
deleted file mode 100644
index 05eeeb8..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/inflight/LICENSE
+++ /dev/null
@@ -1,15 +0,0 @@
-The ISC License
-
-Copyright (c) Isaac Z. Schlueter
-
-Permission to use, copy, modify, and/or distribute this software for any
-purpose with or without fee is hereby granted, provided that the above
-copyright notice and this permission notice appear in all copies.
-
-THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
-IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/inflight/README.md b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/inflight/README.md
deleted file mode 100644
index 6dc8929..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/inflight/README.md
+++ /dev/null
@@ -1,37 +0,0 @@
-# inflight
-
-Add callbacks to requests in flight to avoid async duplication
-
-## USAGE
-
-```javascript
-var inflight = require('inflight')
-
-// some request that does some stuff
-function req(key, callback) {
- // key is any random string. like a url or filename or whatever.
- //
- // will return either a falsey value, indicating that the
- // request for this key is already in flight, or a new callback
- // which when called will call all callbacks passed to inflightk
- // with the same key
- callback = inflight(key, callback)
-
- // If we got a falsey value back, then there's already a req going
- if (!callback) return
-
- // this is where you'd fetch the url or whatever
- // callback is also once()-ified, so it can safely be assigned
- // to multiple events etc. First call wins.
- setTimeout(function() {
- callback(null, key)
- }, 100)
-}
-
-// only assigns a single setTimeout
-// when it dings, all cbs get called
-req('foo', cb1)
-req('foo', cb2)
-req('foo', cb3)
-req('foo', cb4)
-```
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/inflight/inflight.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/inflight/inflight.js
deleted file mode 100644
index 48202b3..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/inflight/inflight.js
+++ /dev/null
@@ -1,54 +0,0 @@
-var wrappy = require('wrappy')
-var reqs = Object.create(null)
-var once = require('once')
-
-module.exports = wrappy(inflight)
-
-function inflight (key, cb) {
- if (reqs[key]) {
- reqs[key].push(cb)
- return null
- } else {
- reqs[key] = [cb]
- return makeres(key)
- }
-}
-
-function makeres (key) {
- return once(function RES () {
- var cbs = reqs[key]
- var len = cbs.length
- var args = slice(arguments)
-
- // XXX It's somewhat ambiguous whether a new callback added in this
- // pass should be queued for later execution if something in the
- // list of callbacks throws, or if it should just be discarded.
- // However, it's such an edge case that it hardly matters, and either
- // choice is likely as surprising as the other.
- // As it happens, we do go ahead and schedule it for later execution.
- try {
- for (var i = 0; i < len; i++) {
- cbs[i].apply(null, args)
- }
- } finally {
- if (cbs.length > len) {
- // added more in the interim.
- // de-zalgo, just in case, but don't call again.
- cbs.splice(0, len)
- process.nextTick(function () {
- RES.apply(null, args)
- })
- } else {
- delete reqs[key]
- }
- }
- })
-}
-
-function slice (args) {
- var length = args.length
- var array = []
-
- for (var i = 0; i < length; i++) array[i] = args[i]
- return array
-}
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/inflight/package.json b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/inflight/package.json
deleted file mode 100644
index 2d30258..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/inflight/package.json
+++ /dev/null
@@ -1,107 +0,0 @@
-{
- "_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",
- "_id": "inflight@1.0.6",
- "_inCache": true,
- "_installable": true,
- "_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": {
- "raw": "inflight@^1.0.4",
- "scope": null,
- "escapedName": "inflight",
- "name": "inflight",
- "rawSpec": "^1.0.4",
- "spec": ">=1.0.4 <2.0.0",
- "type": "range"
- },
- "_requiredBy": [
- "/cli/glob",
- "/glob"
- ],
- "_resolved": "http://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",
- "author": {
- "name": "Isaac Z. Schlueter",
- "email": "i@izs.me",
- "url": "http://blog.izs.me/"
- },
- "bugs": {
- "url": "https://github.com/isaacs/inflight/issues"
- },
- "dependencies": {
- "once": "^1.3.0",
- "wrappy": "1"
- },
- "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"
- },
- "scripts": {
- "test": "tap test.js --100"
- },
- "version": "1.0.6"
-}
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/inherits/LICENSE b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/inherits/LICENSE
deleted file mode 100644
index dea3013..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/inherits/LICENSE
+++ /dev/null
@@ -1,16 +0,0 @@
-The ISC License
-
-Copyright (c) Isaac Z. Schlueter
-
-Permission to use, copy, modify, and/or distribute this software for any
-purpose with or without fee is hereby granted, provided that the above
-copyright notice and this permission notice appear in all copies.
-
-THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
-REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
-FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
-INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-PERFORMANCE OF THIS SOFTWARE.
-
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/inherits/README.md b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/inherits/README.md
deleted file mode 100644
index b1c5665..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/inherits/README.md
+++ /dev/null
@@ -1,42 +0,0 @@
-Browser-friendly inheritance fully compatible with standard node.js
-[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor).
-
-This package exports standard `inherits` from node.js `util` module in
-node environment, but also provides alternative browser-friendly
-implementation through [browser
-field](https://gist.github.com/shtylman/4339901). Alternative
-implementation is a literal copy of standard one located in standalone
-module to avoid requiring of `util`. It also has a shim for old
-browsers with no `Object.create` support.
-
-While keeping you sure you are using standard `inherits`
-implementation in node.js environment, it allows bundlers such as
-[browserify](https://github.com/substack/node-browserify) to not
-include full `util` package to your client code if all you need is
-just `inherits` function. It worth, because browser shim for `util`
-package is large and `inherits` is often the single function you need
-from it.
-
-It's recommended to use this package instead of
-`require('util').inherits` for any code that has chances to be used
-not only in node.js but in browser too.
-
-## usage
-
-```js
-var inherits = require('inherits');
-// then use exactly as the standard one
-```
-
-## note on version ~1.0
-
-Version ~1.0 had completely different motivation and is not compatible
-neither with 2.0 nor with standard node.js `inherits`.
-
-If you are using version ~1.0 and planning to switch to ~2.0, be
-careful:
-
-* new version uses `super_` instead of `super` for referencing
- superclass
-* new version overwrites current prototype while old one preserves any
- existing fields on it
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/inherits/inherits.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/inherits/inherits.js
deleted file mode 100644
index 3b94763..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/inherits/inherits.js
+++ /dev/null
@@ -1,7 +0,0 @@
-try {
- var util = require('util');
- if (typeof util.inherits !== 'function') throw '';
- module.exports = util.inherits;
-} catch (e) {
- module.exports = require('./inherits_browser.js');
-}
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/inherits/inherits_browser.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/inherits/inherits_browser.js
deleted file mode 100644
index c1e78a7..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/inherits/inherits_browser.js
+++ /dev/null
@@ -1,23 +0,0 @@
-if (typeof Object.create === 'function') {
- // implementation from standard node.js 'util' module
- module.exports = function inherits(ctor, superCtor) {
- ctor.super_ = superCtor
- ctor.prototype = Object.create(superCtor.prototype, {
- constructor: {
- value: ctor,
- enumerable: false,
- writable: true,
- configurable: true
- }
- });
- };
-} else {
- // old school shim for old browsers
- module.exports = function inherits(ctor, superCtor) {
- ctor.super_ = superCtor
- var TempCtor = function () {}
- TempCtor.prototype = superCtor.prototype
- ctor.prototype = new TempCtor()
- ctor.prototype.constructor = ctor
- }
-}
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/inherits/package.json b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/inherits/package.json
deleted file mode 100644
index 740569d..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/inherits/package.json
+++ /dev/null
@@ -1,101 +0,0 @@
-{
- "_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",
- "_id": "inherits@2.0.3",
- "_inCache": true,
- "_installable": true,
- "_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": {
- "raw": "inherits@2",
- "scope": null,
- "escapedName": "inherits",
- "name": "inherits",
- "rawSpec": "2",
- "spec": ">=2.0.0 <3.0.0",
- "type": "range"
- },
- "_requiredBy": [
- "/cli/glob",
- "/fileset/glob",
- "/glob",
- "/readable-stream"
- ],
- "_resolved": "http://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",
- "browser": "./inherits_browser.js",
- "bugs": {
- "url": "https://github.com/isaacs/inherits/issues"
- },
- "dependencies": {},
- "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",
- "class",
- "klass",
- "oop",
- "object-oriented",
- "inherits",
- "browser",
- "browserify"
- ],
- "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"
- },
- "scripts": {
- "test": "node test"
- },
- "version": "2.0.3"
-}
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/LICENSE b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/LICENSE
deleted file mode 100644
index 9cd87e5..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/LICENSE
+++ /dev/null
@@ -1,22 +0,0 @@
-Copyright 2012-2015 The Dojo Foundation
-Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas,
-DocumentCloud and Investigative Reporters & Editors
-
-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.
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/README.md b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/README.md
deleted file mode 100644
index fd98e5c..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/README.md
+++ /dev/null
@@ -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:**
-Don’t assign values to the [special variable](http://nodejs.org/api/repl.html#repl_repl_features) `_` when in the REPL.
-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.
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array.js
deleted file mode 100644
index e5121fa..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array.js
+++ /dev/null
@@ -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')
-};
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/chunk.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/chunk.js
deleted file mode 100644
index c8be1fb..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/chunk.js
+++ /dev/null
@@ -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;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/compact.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/compact.js
deleted file mode 100644
index 1dc1c55..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/compact.js
+++ /dev/null
@@ -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;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/difference.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/difference.js
deleted file mode 100644
index 128932a..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/difference.js
+++ /dev/null
@@ -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;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/drop.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/drop.js
deleted file mode 100644
index 039a0b5..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/drop.js
+++ /dev/null
@@ -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;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/dropRight.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/dropRight.js
deleted file mode 100644
index 14b5eb6..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/dropRight.js
+++ /dev/null
@@ -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;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/dropRightWhile.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/dropRightWhile.js
deleted file mode 100644
index be158bd..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/dropRightWhile.js
+++ /dev/null
@@ -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;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/dropWhile.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/dropWhile.js
deleted file mode 100644
index d9eabae..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/dropWhile.js
+++ /dev/null
@@ -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;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/fill.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/fill.js
deleted file mode 100644
index 2c8f6da..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/fill.js
+++ /dev/null
@@ -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;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/findIndex.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/findIndex.js
deleted file mode 100644
index 2a6b8e1..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/findIndex.js
+++ /dev/null
@@ -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;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/findLastIndex.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/findLastIndex.js
deleted file mode 100644
index d6d8eca..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/findLastIndex.js
+++ /dev/null
@@ -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;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/first.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/first.js
deleted file mode 100644
index b3b9c79..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/first.js
+++ /dev/null
@@ -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;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/flatten.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/flatten.js
deleted file mode 100644
index dc2eff8..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/flatten.js
+++ /dev/null
@@ -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;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/flattenDeep.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/flattenDeep.js
deleted file mode 100644
index 9f775fe..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/flattenDeep.js
+++ /dev/null
@@ -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;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/head.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/head.js
deleted file mode 100644
index 1961b08..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/head.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('./first');
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/indexOf.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/indexOf.js
deleted file mode 100644
index 4cfc682..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/indexOf.js
+++ /dev/null
@@ -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;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/initial.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/initial.js
deleted file mode 100644
index 59b7a7d..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/initial.js
+++ /dev/null
@@ -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;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/intersection.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/intersection.js
deleted file mode 100644
index f218432..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/intersection.js
+++ /dev/null
@@ -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;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/last.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/last.js
deleted file mode 100644
index 299af31..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/last.js
+++ /dev/null
@@ -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;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/lastIndexOf.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/lastIndexOf.js
deleted file mode 100644
index 02b8062..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/lastIndexOf.js
+++ /dev/null
@@ -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;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/object.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/object.js
deleted file mode 100644
index f4a3453..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/object.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('./zipObject');
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/pull.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/pull.js
deleted file mode 100644
index 7bcbb4a..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/pull.js
+++ /dev/null
@@ -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;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/pullAt.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/pullAt.js
deleted file mode 100644
index 4ca2476..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/pullAt.js
+++ /dev/null
@@ -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;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/remove.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/remove.js
deleted file mode 100644
index 0cf979b..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/remove.js
+++ /dev/null
@@ -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;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/rest.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/rest.js
deleted file mode 100644
index 9bfb734..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/rest.js
+++ /dev/null
@@ -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;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/slice.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/slice.js
deleted file mode 100644
index 48ef1a1..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/slice.js
+++ /dev/null
@@ -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;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/sortedIndex.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/sortedIndex.js
deleted file mode 100644
index 6903bca..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/sortedIndex.js
+++ /dev/null
@@ -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;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/sortedLastIndex.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/sortedLastIndex.js
deleted file mode 100644
index 81a4a86..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/sortedLastIndex.js
+++ /dev/null
@@ -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;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/tail.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/tail.js
deleted file mode 100644
index c5dfe77..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/tail.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('./rest');
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/take.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/take.js
deleted file mode 100644
index 875917a..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/take.js
+++ /dev/null
@@ -1,39 +0,0 @@
-var baseSlice = require('../internal/baseSlice'),
- isIterateeCall = require('../internal/isIterateeCall');
-
-/**
- * Creates a slice of `array` with `n` elements taken from the beginning.
- *
- * @static
- * @memberOf _
- * @category Array
- * @param {Array} array The array to query.
- * @param {number} [n=1] The number of elements to take.
- * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
- * @returns {Array} Returns the slice of `array`.
- * @example
- *
- * _.take([1, 2, 3]);
- * // => [1]
- *
- * _.take([1, 2, 3], 2);
- * // => [1, 2]
- *
- * _.take([1, 2, 3], 5);
- * // => [1, 2, 3]
- *
- * _.take([1, 2, 3], 0);
- * // => []
- */
-function take(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, 0, n < 0 ? 0 : n);
-}
-
-module.exports = take;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/takeRight.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/takeRight.js
deleted file mode 100644
index 6e89c87..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/takeRight.js
+++ /dev/null
@@ -1,40 +0,0 @@
-var baseSlice = require('../internal/baseSlice'),
- isIterateeCall = require('../internal/isIterateeCall');
-
-/**
- * Creates a slice of `array` with `n` elements taken from the end.
- *
- * @static
- * @memberOf _
- * @category Array
- * @param {Array} array The array to query.
- * @param {number} [n=1] The number of elements to take.
- * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
- * @returns {Array} Returns the slice of `array`.
- * @example
- *
- * _.takeRight([1, 2, 3]);
- * // => [3]
- *
- * _.takeRight([1, 2, 3], 2);
- * // => [2, 3]
- *
- * _.takeRight([1, 2, 3], 5);
- * // => [1, 2, 3]
- *
- * _.takeRight([1, 2, 3], 0);
- * // => []
- */
-function takeRight(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, n < 0 ? 0 : n);
-}
-
-module.exports = takeRight;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/takeRightWhile.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/takeRightWhile.js
deleted file mode 100644
index 5464d13..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/takeRightWhile.js
+++ /dev/null
@@ -1,59 +0,0 @@
-var baseCallback = require('../internal/baseCallback'),
- baseWhile = require('../internal/baseWhile');
-
-/**
- * Creates a slice of `array` with elements taken from the end. Elements are
- * taken 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
- *
- * _.takeRightWhile([1, 2, 3], function(n) {
- * return n > 1;
- * });
- * // => [2, 3]
- *
- * var users = [
- * { 'user': 'barney', 'active': true },
- * { 'user': 'fred', 'active': false },
- * { 'user': 'pebbles', 'active': false }
- * ];
- *
- * // using the `_.matches` callback shorthand
- * _.pluck(_.takeRightWhile(users, { 'user': 'pebbles', 'active': false }), 'user');
- * // => ['pebbles']
- *
- * // using the `_.matchesProperty` callback shorthand
- * _.pluck(_.takeRightWhile(users, 'active', false), 'user');
- * // => ['fred', 'pebbles']
- *
- * // using the `_.property` callback shorthand
- * _.pluck(_.takeRightWhile(users, 'active'), 'user');
- * // => []
- */
-function takeRightWhile(array, predicate, thisArg) {
- return (array && array.length)
- ? baseWhile(array, baseCallback(predicate, thisArg, 3), false, true)
- : [];
-}
-
-module.exports = takeRightWhile;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/takeWhile.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/takeWhile.js
deleted file mode 100644
index f7e28a1..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/takeWhile.js
+++ /dev/null
@@ -1,59 +0,0 @@
-var baseCallback = require('../internal/baseCallback'),
- baseWhile = require('../internal/baseWhile');
-
-/**
- * Creates a slice of `array` with elements taken from the beginning. Elements
- * are taken 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
- *
- * _.takeWhile([1, 2, 3], function(n) {
- * return n < 3;
- * });
- * // => [1, 2]
- *
- * var users = [
- * { 'user': 'barney', 'active': false },
- * { 'user': 'fred', 'active': false},
- * { 'user': 'pebbles', 'active': true }
- * ];
- *
- * // using the `_.matches` callback shorthand
- * _.pluck(_.takeWhile(users, { 'user': 'barney', 'active': false }), 'user');
- * // => ['barney']
- *
- * // using the `_.matchesProperty` callback shorthand
- * _.pluck(_.takeWhile(users, 'active', false), 'user');
- * // => ['barney', 'fred']
- *
- * // using the `_.property` callback shorthand
- * _.pluck(_.takeWhile(users, 'active'), 'user');
- * // => []
- */
-function takeWhile(array, predicate, thisArg) {
- return (array && array.length)
- ? baseWhile(array, baseCallback(predicate, thisArg, 3))
- : [];
-}
-
-module.exports = takeWhile;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/union.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/union.js
deleted file mode 100644
index 53cefe4..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/union.js
+++ /dev/null
@@ -1,24 +0,0 @@
-var baseFlatten = require('../internal/baseFlatten'),
- baseUniq = require('../internal/baseUniq'),
- restParam = require('../function/restParam');
-
-/**
- * Creates an array of unique values, in order, from 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 combined values.
- * @example
- *
- * _.union([1, 2], [4, 2], [2, 1]);
- * // => [1, 2, 4]
- */
-var union = restParam(function(arrays) {
- return baseUniq(baseFlatten(arrays, false, true));
-});
-
-module.exports = union;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/uniq.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/uniq.js
deleted file mode 100644
index ae937ef..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/uniq.js
+++ /dev/null
@@ -1,71 +0,0 @@
-var baseCallback = require('../internal/baseCallback'),
- baseUniq = require('../internal/baseUniq'),
- isIterateeCall = require('../internal/isIterateeCall'),
- sortedUniq = require('../internal/sortedUniq');
-
-/**
- * Creates a duplicate-free version of an array, using
- * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
- * for equality comparisons, in which only the first occurence of each element
- * is kept. Providing `true` for `isSorted` performs a faster search algorithm
- * for sorted arrays. If an iteratee function is provided it's invoked for
- * each element in the array to generate the criterion by which uniqueness
- * is computed. The `iteratee` is bound to `thisArg` and invoked with three
- * arguments: (value, index, array).
- *
- * 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 _
- * @alias unique
- * @category Array
- * @param {Array} array The array to inspect.
- * @param {boolean} [isSorted] Specify the array is sorted.
- * @param {Function|Object|string} [iteratee] The function invoked per iteration.
- * @param {*} [thisArg] The `this` binding of `iteratee`.
- * @returns {Array} Returns the new duplicate-value-free array.
- * @example
- *
- * _.uniq([2, 1, 2]);
- * // => [2, 1]
- *
- * // using `isSorted`
- * _.uniq([1, 1, 2], true);
- * // => [1, 2]
- *
- * // using an iteratee function
- * _.uniq([1, 2.5, 1.5, 2], function(n) {
- * return this.floor(n);
- * }, Math);
- * // => [1, 2.5]
- *
- * // using the `_.property` callback shorthand
- * _.uniq([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
- * // => [{ 'x': 1 }, { 'x': 2 }]
- */
-function uniq(array, isSorted, iteratee, thisArg) {
- var length = array ? array.length : 0;
- if (!length) {
- return [];
- }
- if (isSorted != null && typeof isSorted != 'boolean') {
- thisArg = iteratee;
- iteratee = isIterateeCall(array, isSorted, thisArg) ? undefined : isSorted;
- isSorted = false;
- }
- iteratee = iteratee == null ? iteratee : baseCallback(iteratee, thisArg, 3);
- return (isSorted)
- ? sortedUniq(array, iteratee)
- : baseUniq(array, iteratee);
-}
-
-module.exports = uniq;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/unique.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/unique.js
deleted file mode 100644
index 396de1b..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/unique.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('./uniq');
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/unzip.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/unzip.js
deleted file mode 100644
index 0a539fa..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/unzip.js
+++ /dev/null
@@ -1,47 +0,0 @@
-var arrayFilter = require('../internal/arrayFilter'),
- arrayMap = require('../internal/arrayMap'),
- baseProperty = require('../internal/baseProperty'),
- isArrayLike = require('../internal/isArrayLike');
-
-/* Native method references for those with the same name as other `lodash` methods. */
-var nativeMax = Math.max;
-
-/**
- * This method is like `_.zip` except that it accepts an array of grouped
- * elements and creates an array regrouping the elements to their pre-zip
- * configuration.
- *
- * @static
- * @memberOf _
- * @category Array
- * @param {Array} array The array of grouped elements to process.
- * @returns {Array} Returns the new array of regrouped elements.
- * @example
- *
- * var zipped = _.zip(['fred', 'barney'], [30, 40], [true, false]);
- * // => [['fred', 30, true], ['barney', 40, false]]
- *
- * _.unzip(zipped);
- * // => [['fred', 'barney'], [30, 40], [true, false]]
- */
-function unzip(array) {
- if (!(array && array.length)) {
- return [];
- }
- var index = -1,
- length = 0;
-
- array = arrayFilter(array, function(group) {
- if (isArrayLike(group)) {
- length = nativeMax(group.length, length);
- return true;
- }
- });
- var result = Array(length);
- while (++index < length) {
- result[index] = arrayMap(array, baseProperty(index));
- }
- return result;
-}
-
-module.exports = unzip;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/unzipWith.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/unzipWith.js
deleted file mode 100644
index 324a2b1..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/unzipWith.js
+++ /dev/null
@@ -1,41 +0,0 @@
-var arrayMap = require('../internal/arrayMap'),
- arrayReduce = require('../internal/arrayReduce'),
- bindCallback = require('../internal/bindCallback'),
- unzip = require('./unzip');
-
-/**
- * This method is like `_.unzip` except that it accepts an iteratee to specify
- * how regrouped values should be combined. The `iteratee` is bound to `thisArg`
- * and invoked with four arguments: (accumulator, value, index, group).
- *
- * @static
- * @memberOf _
- * @category Array
- * @param {Array} array The array of grouped elements to process.
- * @param {Function} [iteratee] The function to combine regrouped values.
- * @param {*} [thisArg] The `this` binding of `iteratee`.
- * @returns {Array} Returns the new array of regrouped elements.
- * @example
- *
- * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
- * // => [[1, 10, 100], [2, 20, 200]]
- *
- * _.unzipWith(zipped, _.add);
- * // => [3, 30, 300]
- */
-function unzipWith(array, iteratee, thisArg) {
- var length = array ? array.length : 0;
- if (!length) {
- return [];
- }
- var result = unzip(array);
- if (iteratee == null) {
- return result;
- }
- iteratee = bindCallback(iteratee, thisArg, 4);
- return arrayMap(result, function(group) {
- return arrayReduce(group, iteratee, undefined, true);
- });
-}
-
-module.exports = unzipWith;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/without.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/without.js
deleted file mode 100644
index 2ac3d11..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/without.js
+++ /dev/null
@@ -1,27 +0,0 @@
-var baseDifference = require('../internal/baseDifference'),
- isArrayLike = require('../internal/isArrayLike'),
- restParam = require('../function/restParam');
-
-/**
- * Creates an array excluding all provided values 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 filter.
- * @param {...*} [values] The values to exclude.
- * @returns {Array} Returns the new array of filtered values.
- * @example
- *
- * _.without([1, 2, 1, 3], 1, 2);
- * // => [3]
- */
-var without = restParam(function(array, values) {
- return isArrayLike(array)
- ? baseDifference(array, values)
- : [];
-});
-
-module.exports = without;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/xor.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/xor.js
deleted file mode 100644
index 04ef32a..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/xor.js
+++ /dev/null
@@ -1,35 +0,0 @@
-var arrayPush = require('../internal/arrayPush'),
- baseDifference = require('../internal/baseDifference'),
- baseUniq = require('../internal/baseUniq'),
- isArrayLike = require('../internal/isArrayLike');
-
-/**
- * Creates an array of unique values that is the [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
- * of the provided arrays.
- *
- * @static
- * @memberOf _
- * @category Array
- * @param {...Array} [arrays] The arrays to inspect.
- * @returns {Array} Returns the new array of values.
- * @example
- *
- * _.xor([1, 2], [4, 2]);
- * // => [1, 4]
- */
-function xor() {
- var index = -1,
- length = arguments.length;
-
- while (++index < length) {
- var array = arguments[index];
- if (isArrayLike(array)) {
- var result = result
- ? arrayPush(baseDifference(result, array), baseDifference(array, result))
- : array;
- }
- }
- return result ? baseUniq(result) : [];
-}
-
-module.exports = xor;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/zip.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/zip.js
deleted file mode 100644
index 53a6f69..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/zip.js
+++ /dev/null
@@ -1,21 +0,0 @@
-var restParam = require('../function/restParam'),
- unzip = require('./unzip');
-
-/**
- * Creates an array of grouped elements, the first of which contains the first
- * elements of the given arrays, the second of which contains the second elements
- * of the given arrays, and so on.
- *
- * @static
- * @memberOf _
- * @category Array
- * @param {...Array} [arrays] The arrays to process.
- * @returns {Array} Returns the new array of grouped elements.
- * @example
- *
- * _.zip(['fred', 'barney'], [30, 40], [true, false]);
- * // => [['fred', 30, true], ['barney', 40, false]]
- */
-var zip = restParam(unzip);
-
-module.exports = zip;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/zipObject.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/zipObject.js
deleted file mode 100644
index dec7a21..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/zipObject.js
+++ /dev/null
@@ -1,43 +0,0 @@
-var isArray = require('../lang/isArray');
-
-/**
- * The inverse of `_.pairs`; this method returns an object composed from arrays
- * of property names and values. Provide either a single two dimensional array,
- * e.g. `[[key1, value1], [key2, value2]]` or two arrays, one of property names
- * and one of corresponding values.
- *
- * @static
- * @memberOf _
- * @alias object
- * @category Array
- * @param {Array} props The property names.
- * @param {Array} [values=[]] The property values.
- * @returns {Object} Returns the new object.
- * @example
- *
- * _.zipObject([['fred', 30], ['barney', 40]]);
- * // => { 'fred': 30, 'barney': 40 }
- *
- * _.zipObject(['fred', 'barney'], [30, 40]);
- * // => { 'fred': 30, 'barney': 40 }
- */
-function zipObject(props, values) {
- var index = -1,
- length = props ? props.length : 0,
- result = {};
-
- if (length && !values && !isArray(props[0])) {
- values = [];
- }
- while (++index < length) {
- var key = props[index];
- if (values) {
- result[key] = values[index];
- } else if (key) {
- result[key[0]] = key[1];
- }
- }
- return result;
-}
-
-module.exports = zipObject;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/zipWith.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/zipWith.js
deleted file mode 100644
index ad10374..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/array/zipWith.js
+++ /dev/null
@@ -1,36 +0,0 @@
-var restParam = require('../function/restParam'),
- unzipWith = require('./unzipWith');
-
-/**
- * This method is like `_.zip` except that it accepts an iteratee to specify
- * how grouped values should be combined. The `iteratee` is bound to `thisArg`
- * and invoked with four arguments: (accumulator, value, index, group).
- *
- * @static
- * @memberOf _
- * @category Array
- * @param {...Array} [arrays] The arrays to process.
- * @param {Function} [iteratee] The function to combine grouped values.
- * @param {*} [thisArg] The `this` binding of `iteratee`.
- * @returns {Array} Returns the new array of grouped elements.
- * @example
- *
- * _.zipWith([1, 2], [10, 20], [100, 200], _.add);
- * // => [111, 222]
- */
-var zipWith = restParam(function(arrays) {
- var length = arrays.length,
- iteratee = length > 2 ? arrays[length - 2] : undefined,
- thisArg = length > 1 ? arrays[length - 1] : undefined;
-
- if (length > 2 && typeof iteratee == 'function') {
- length -= 2;
- } else {
- iteratee = (length > 1 && typeof thisArg == 'function') ? (--length, thisArg) : undefined;
- thisArg = undefined;
- }
- arrays.length = length;
- return unzipWith(arrays, iteratee, thisArg);
-});
-
-module.exports = zipWith;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain.js
deleted file mode 100644
index 6439627..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain.js
+++ /dev/null
@@ -1,16 +0,0 @@
-module.exports = {
- 'chain': require('./chain/chain'),
- 'commit': require('./chain/commit'),
- 'concat': require('./chain/concat'),
- 'lodash': require('./chain/lodash'),
- 'plant': require('./chain/plant'),
- 'reverse': require('./chain/reverse'),
- 'run': require('./chain/run'),
- 'tap': require('./chain/tap'),
- 'thru': require('./chain/thru'),
- 'toJSON': require('./chain/toJSON'),
- 'toString': require('./chain/toString'),
- 'value': require('./chain/value'),
- 'valueOf': require('./chain/valueOf'),
- 'wrapperChain': require('./chain/wrapperChain')
-};
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain/chain.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain/chain.js
deleted file mode 100644
index 453ba1e..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain/chain.js
+++ /dev/null
@@ -1,35 +0,0 @@
-var lodash = require('./lodash');
-
-/**
- * Creates a `lodash` object that wraps `value` with explicit method
- * chaining enabled.
- *
- * @static
- * @memberOf _
- * @category Chain
- * @param {*} value The value to wrap.
- * @returns {Object} Returns the new `lodash` wrapper instance.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'age': 36 },
- * { 'user': 'fred', 'age': 40 },
- * { 'user': 'pebbles', 'age': 1 }
- * ];
- *
- * var youngest = _.chain(users)
- * .sortBy('age')
- * .map(function(chr) {
- * return chr.user + ' is ' + chr.age;
- * })
- * .first()
- * .value();
- * // => 'pebbles is 1'
- */
-function chain(value) {
- var result = lodash(value);
- result.__chain__ = true;
- return result;
-}
-
-module.exports = chain;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain/commit.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain/commit.js
deleted file mode 100644
index c732d1b..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain/commit.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('./wrapperCommit');
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain/concat.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain/concat.js
deleted file mode 100644
index 90607d1..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain/concat.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('./wrapperConcat');
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain/lodash.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain/lodash.js
deleted file mode 100644
index 1c3467e..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain/lodash.js
+++ /dev/null
@@ -1,125 +0,0 @@
-var LazyWrapper = require('../internal/LazyWrapper'),
- LodashWrapper = require('../internal/LodashWrapper'),
- baseLodash = require('../internal/baseLodash'),
- isArray = require('../lang/isArray'),
- isObjectLike = require('../internal/isObjectLike'),
- wrapperClone = require('../internal/wrapperClone');
-
-/** Used for native method references. */
-var objectProto = Object.prototype;
-
-/** Used to check objects for own properties. */
-var hasOwnProperty = objectProto.hasOwnProperty;
-
-/**
- * Creates a `lodash` object which wraps `value` to enable implicit chaining.
- * Methods that operate on and return arrays, collections, and functions can
- * be chained together. Methods that retrieve a single value or may return a
- * primitive value will automatically end the chain returning the unwrapped
- * value. Explicit chaining may be enabled using `_.chain`. The execution of
- * chained methods is lazy, that is, execution is deferred until `_#value`
- * is implicitly or explicitly called.
- *
- * Lazy evaluation allows several methods to support shortcut fusion. Shortcut
- * fusion is an optimization strategy which merge iteratee calls; this can help
- * to avoid the creation of intermediate data structures and greatly reduce the
- * number of iteratee executions.
- *
- * Chaining is supported in custom builds as long as the `_#value` method is
- * directly or indirectly included in the build.
- *
- * In addition to lodash methods, wrappers have `Array` and `String` methods.
- *
- * The wrapper `Array` methods are:
- * `concat`, `join`, `pop`, `push`, `reverse`, `shift`, `slice`, `sort`,
- * `splice`, and `unshift`
- *
- * The wrapper `String` methods are:
- * `replace` and `split`
- *
- * The wrapper methods that support shortcut fusion are:
- * `compact`, `drop`, `dropRight`, `dropRightWhile`, `dropWhile`, `filter`,
- * `first`, `initial`, `last`, `map`, `pluck`, `reject`, `rest`, `reverse`,
- * `slice`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, `toArray`,
- * and `where`
- *
- * The chainable wrapper methods are:
- * `after`, `ary`, `assign`, `at`, `before`, `bind`, `bindAll`, `bindKey`,
- * `callback`, `chain`, `chunk`, `commit`, `compact`, `concat`, `constant`,
- * `countBy`, `create`, `curry`, `debounce`, `defaults`, `defaultsDeep`,
- * `defer`, `delay`, `difference`, `drop`, `dropRight`, `dropRightWhile`,
- * `dropWhile`, `fill`, `filter`, `flatten`, `flattenDeep`, `flow`, `flowRight`,
- * `forEach`, `forEachRight`, `forIn`, `forInRight`, `forOwn`, `forOwnRight`,
- * `functions`, `groupBy`, `indexBy`, `initial`, `intersection`, `invert`,
- * `invoke`, `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`,
- * `matchesProperty`, `memoize`, `merge`, `method`, `methodOf`, `mixin`,
- * `modArgs`, `negate`, `omit`, `once`, `pairs`, `partial`, `partialRight`,
- * `partition`, `pick`, `plant`, `pluck`, `property`, `propertyOf`, `pull`,
- * `pullAt`, `push`, `range`, `rearg`, `reject`, `remove`, `rest`, `restParam`,
- * `reverse`, `set`, `shuffle`, `slice`, `sort`, `sortBy`, `sortByAll`,
- * `sortByOrder`, `splice`, `spread`, `take`, `takeRight`, `takeRightWhile`,
- * `takeWhile`, `tap`, `throttle`, `thru`, `times`, `toArray`, `toPlainObject`,
- * `transform`, `union`, `uniq`, `unshift`, `unzip`, `unzipWith`, `values`,
- * `valuesIn`, `where`, `without`, `wrap`, `xor`, `zip`, `zipObject`, `zipWith`
- *
- * The wrapper methods that are **not** chainable by default are:
- * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clone`, `cloneDeep`,
- * `deburr`, `endsWith`, `escape`, `escapeRegExp`, `every`, `find`, `findIndex`,
- * `findKey`, `findLast`, `findLastIndex`, `findLastKey`, `findWhere`, `first`,
- * `floor`, `get`, `gt`, `gte`, `has`, `identity`, `includes`, `indexOf`,
- * `inRange`, `isArguments`, `isArray`, `isBoolean`, `isDate`, `isElement`,
- * `isEmpty`, `isEqual`, `isError`, `isFinite` `isFunction`, `isMatch`,
- * `isNative`, `isNaN`, `isNull`, `isNumber`, `isObject`, `isPlainObject`,
- * `isRegExp`, `isString`, `isUndefined`, `isTypedArray`, `join`, `kebabCase`,
- * `last`, `lastIndexOf`, `lt`, `lte`, `max`, `min`, `noConflict`, `noop`,
- * `now`, `pad`, `padLeft`, `padRight`, `parseInt`, `pop`, `random`, `reduce`,
- * `reduceRight`, `repeat`, `result`, `round`, `runInContext`, `shift`, `size`,
- * `snakeCase`, `some`, `sortedIndex`, `sortedLastIndex`, `startCase`,
- * `startsWith`, `sum`, `template`, `trim`, `trimLeft`, `trimRight`, `trunc`,
- * `unescape`, `uniqueId`, `value`, and `words`
- *
- * The wrapper method `sample` will return a wrapped value when `n` is provided,
- * otherwise an unwrapped value is returned.
- *
- * @name _
- * @constructor
- * @category Chain
- * @param {*} value The value to wrap in a `lodash` instance.
- * @returns {Object} Returns the new `lodash` wrapper instance.
- * @example
- *
- * var wrapped = _([1, 2, 3]);
- *
- * // returns an unwrapped value
- * wrapped.reduce(function(total, n) {
- * return total + n;
- * });
- * // => 6
- *
- * // returns a wrapped value
- * var squares = wrapped.map(function(n) {
- * return n * n;
- * });
- *
- * _.isArray(squares);
- * // => false
- *
- * _.isArray(squares.value());
- * // => true
- */
-function lodash(value) {
- if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
- if (value instanceof LodashWrapper) {
- return value;
- }
- if (hasOwnProperty.call(value, '__chain__') && hasOwnProperty.call(value, '__wrapped__')) {
- return wrapperClone(value);
- }
- }
- return new LodashWrapper(value);
-}
-
-// Ensure wrappers are instances of `baseLodash`.
-lodash.prototype = baseLodash.prototype;
-
-module.exports = lodash;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain/plant.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain/plant.js
deleted file mode 100644
index 04099f2..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain/plant.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('./wrapperPlant');
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain/reverse.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain/reverse.js
deleted file mode 100644
index f72a64a..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain/reverse.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('./wrapperReverse');
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain/run.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain/run.js
deleted file mode 100644
index 5e751a2..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain/run.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('./wrapperValue');
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain/tap.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain/tap.js
deleted file mode 100644
index 3d0257e..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain/tap.js
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * This method invokes `interceptor` and returns `value`. The interceptor is
- * bound to `thisArg` and invoked with one argument; (value). The purpose of
- * this method is to "tap into" a method chain in order to perform operations
- * on intermediate results within the chain.
- *
- * @static
- * @memberOf _
- * @category Chain
- * @param {*} value The value to provide to `interceptor`.
- * @param {Function} interceptor The function to invoke.
- * @param {*} [thisArg] The `this` binding of `interceptor`.
- * @returns {*} Returns `value`.
- * @example
- *
- * _([1, 2, 3])
- * .tap(function(array) {
- * array.pop();
- * })
- * .reverse()
- * .value();
- * // => [2, 1]
- */
-function tap(value, interceptor, thisArg) {
- interceptor.call(thisArg, value);
- return value;
-}
-
-module.exports = tap;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain/thru.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain/thru.js
deleted file mode 100644
index a715780..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain/thru.js
+++ /dev/null
@@ -1,26 +0,0 @@
-/**
- * This method is like `_.tap` except that it returns the result of `interceptor`.
- *
- * @static
- * @memberOf _
- * @category Chain
- * @param {*} value The value to provide to `interceptor`.
- * @param {Function} interceptor The function to invoke.
- * @param {*} [thisArg] The `this` binding of `interceptor`.
- * @returns {*} Returns the result of `interceptor`.
- * @example
- *
- * _(' abc ')
- * .chain()
- * .trim()
- * .thru(function(value) {
- * return [value];
- * })
- * .value();
- * // => ['abc']
- */
-function thru(value, interceptor, thisArg) {
- return interceptor.call(thisArg, value);
-}
-
-module.exports = thru;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain/toJSON.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain/toJSON.js
deleted file mode 100644
index 5e751a2..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain/toJSON.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('./wrapperValue');
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain/toString.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain/toString.js
deleted file mode 100644
index c7bcbf9..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain/toString.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('./wrapperToString');
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain/value.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain/value.js
deleted file mode 100644
index 5e751a2..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain/value.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('./wrapperValue');
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain/valueOf.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain/valueOf.js
deleted file mode 100644
index 5e751a2..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain/valueOf.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('./wrapperValue');
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain/wrapperChain.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain/wrapperChain.js
deleted file mode 100644
index 3823481..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain/wrapperChain.js
+++ /dev/null
@@ -1,32 +0,0 @@
-var chain = require('./chain');
-
-/**
- * Enables explicit method chaining on the wrapper object.
- *
- * @name chain
- * @memberOf _
- * @category Chain
- * @returns {Object} Returns the new `lodash` wrapper instance.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'age': 36 },
- * { 'user': 'fred', 'age': 40 }
- * ];
- *
- * // without explicit chaining
- * _(users).first();
- * // => { 'user': 'barney', 'age': 36 }
- *
- * // with explicit chaining
- * _(users).chain()
- * .first()
- * .pick('user')
- * .value();
- * // => { 'user': 'barney' }
- */
-function wrapperChain() {
- return chain(this);
-}
-
-module.exports = wrapperChain;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain/wrapperCommit.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain/wrapperCommit.js
deleted file mode 100644
index c3d2898..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain/wrapperCommit.js
+++ /dev/null
@@ -1,32 +0,0 @@
-var LodashWrapper = require('../internal/LodashWrapper');
-
-/**
- * Executes the chained sequence and returns the wrapped result.
- *
- * @name commit
- * @memberOf _
- * @category Chain
- * @returns {Object} Returns the new `lodash` wrapper instance.
- * @example
- *
- * var array = [1, 2];
- * var wrapped = _(array).push(3);
- *
- * console.log(array);
- * // => [1, 2]
- *
- * wrapped = wrapped.commit();
- * console.log(array);
- * // => [1, 2, 3]
- *
- * wrapped.last();
- * // => 3
- *
- * console.log(array);
- * // => [1, 2, 3]
- */
-function wrapperCommit() {
- return new LodashWrapper(this.value(), this.__chain__);
-}
-
-module.exports = wrapperCommit;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain/wrapperConcat.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain/wrapperConcat.js
deleted file mode 100644
index 799156c..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain/wrapperConcat.js
+++ /dev/null
@@ -1,34 +0,0 @@
-var arrayConcat = require('../internal/arrayConcat'),
- baseFlatten = require('../internal/baseFlatten'),
- isArray = require('../lang/isArray'),
- restParam = require('../function/restParam'),
- toObject = require('../internal/toObject');
-
-/**
- * Creates a new array joining a wrapped array with any additional arrays
- * and/or values.
- *
- * @name concat
- * @memberOf _
- * @category Chain
- * @param {...*} [values] The values to concatenate.
- * @returns {Array} Returns the new concatenated array.
- * @example
- *
- * var array = [1];
- * var wrapped = _(array).concat(2, [3], [[4]]);
- *
- * console.log(wrapped.value());
- * // => [1, 2, 3, [4]]
- *
- * console.log(array);
- * // => [1]
- */
-var wrapperConcat = restParam(function(values) {
- values = baseFlatten(values);
- return this.thru(function(array) {
- return arrayConcat(isArray(array) ? array : [toObject(array)], values);
- });
-});
-
-module.exports = wrapperConcat;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain/wrapperPlant.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain/wrapperPlant.js
deleted file mode 100644
index 234fe41..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain/wrapperPlant.js
+++ /dev/null
@@ -1,45 +0,0 @@
-var baseLodash = require('../internal/baseLodash'),
- wrapperClone = require('../internal/wrapperClone');
-
-/**
- * Creates a clone of the chained sequence planting `value` as the wrapped value.
- *
- * @name plant
- * @memberOf _
- * @category Chain
- * @returns {Object} Returns the new `lodash` wrapper instance.
- * @example
- *
- * var array = [1, 2];
- * var wrapped = _(array).map(function(value) {
- * return Math.pow(value, 2);
- * });
- *
- * var other = [3, 4];
- * var otherWrapped = wrapped.plant(other);
- *
- * otherWrapped.value();
- * // => [9, 16]
- *
- * wrapped.value();
- * // => [1, 4]
- */
-function wrapperPlant(value) {
- var result,
- parent = this;
-
- while (parent instanceof baseLodash) {
- var clone = wrapperClone(parent);
- if (result) {
- previous.__wrapped__ = clone;
- } else {
- result = clone;
- }
- var previous = clone;
- parent = parent.__wrapped__;
- }
- previous.__wrapped__ = value;
- return result;
-}
-
-module.exports = wrapperPlant;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain/wrapperReverse.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain/wrapperReverse.js
deleted file mode 100644
index 6ba546d..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain/wrapperReverse.js
+++ /dev/null
@@ -1,43 +0,0 @@
-var LazyWrapper = require('../internal/LazyWrapper'),
- LodashWrapper = require('../internal/LodashWrapper'),
- thru = require('./thru');
-
-/**
- * Reverses the wrapped array so the first element becomes the last, the
- * second element becomes the second to last, and so on.
- *
- * **Note:** This method mutates the wrapped array.
- *
- * @name reverse
- * @memberOf _
- * @category Chain
- * @returns {Object} Returns the new reversed `lodash` wrapper instance.
- * @example
- *
- * var array = [1, 2, 3];
- *
- * _(array).reverse().value()
- * // => [3, 2, 1]
- *
- * console.log(array);
- * // => [3, 2, 1]
- */
-function wrapperReverse() {
- var value = this.__wrapped__;
-
- var interceptor = function(value) {
- return value.reverse();
- };
- if (value instanceof LazyWrapper) {
- var wrapped = value;
- if (this.__actions__.length) {
- wrapped = new LazyWrapper(this);
- }
- wrapped = wrapped.reverse();
- wrapped.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
- return new LodashWrapper(wrapped, this.__chain__);
- }
- return this.thru(interceptor);
-}
-
-module.exports = wrapperReverse;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain/wrapperToString.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain/wrapperToString.js
deleted file mode 100644
index db975a5..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain/wrapperToString.js
+++ /dev/null
@@ -1,17 +0,0 @@
-/**
- * Produces the result of coercing the unwrapped value to a string.
- *
- * @name toString
- * @memberOf _
- * @category Chain
- * @returns {string} Returns the coerced string value.
- * @example
- *
- * _([1, 2, 3]).toString();
- * // => '1,2,3'
- */
-function wrapperToString() {
- return (this.value() + '');
-}
-
-module.exports = wrapperToString;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain/wrapperValue.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain/wrapperValue.js
deleted file mode 100644
index 2734e41..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/chain/wrapperValue.js
+++ /dev/null
@@ -1,20 +0,0 @@
-var baseWrapperValue = require('../internal/baseWrapperValue');
-
-/**
- * Executes the chained sequence to extract the unwrapped value.
- *
- * @name value
- * @memberOf _
- * @alias run, toJSON, valueOf
- * @category Chain
- * @returns {*} Returns the resolved unwrapped value.
- * @example
- *
- * _([1, 2, 3]).value();
- * // => [1, 2, 3]
- */
-function wrapperValue() {
- return baseWrapperValue(this.__wrapped__, this.__actions__);
-}
-
-module.exports = wrapperValue;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection.js
deleted file mode 100644
index 0338857..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection.js
+++ /dev/null
@@ -1,44 +0,0 @@
-module.exports = {
- 'all': require('./collection/all'),
- 'any': require('./collection/any'),
- 'at': require('./collection/at'),
- 'collect': require('./collection/collect'),
- 'contains': require('./collection/contains'),
- 'countBy': require('./collection/countBy'),
- 'detect': require('./collection/detect'),
- 'each': require('./collection/each'),
- 'eachRight': require('./collection/eachRight'),
- 'every': require('./collection/every'),
- 'filter': require('./collection/filter'),
- 'find': require('./collection/find'),
- 'findLast': require('./collection/findLast'),
- 'findWhere': require('./collection/findWhere'),
- 'foldl': require('./collection/foldl'),
- 'foldr': require('./collection/foldr'),
- 'forEach': require('./collection/forEach'),
- 'forEachRight': require('./collection/forEachRight'),
- 'groupBy': require('./collection/groupBy'),
- 'include': require('./collection/include'),
- 'includes': require('./collection/includes'),
- 'indexBy': require('./collection/indexBy'),
- 'inject': require('./collection/inject'),
- 'invoke': require('./collection/invoke'),
- 'map': require('./collection/map'),
- 'max': require('./math/max'),
- 'min': require('./math/min'),
- 'partition': require('./collection/partition'),
- 'pluck': require('./collection/pluck'),
- 'reduce': require('./collection/reduce'),
- 'reduceRight': require('./collection/reduceRight'),
- 'reject': require('./collection/reject'),
- 'sample': require('./collection/sample'),
- 'select': require('./collection/select'),
- 'shuffle': require('./collection/shuffle'),
- 'size': require('./collection/size'),
- 'some': require('./collection/some'),
- 'sortBy': require('./collection/sortBy'),
- 'sortByAll': require('./collection/sortByAll'),
- 'sortByOrder': require('./collection/sortByOrder'),
- 'sum': require('./math/sum'),
- 'where': require('./collection/where')
-};
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/all.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/all.js
deleted file mode 100644
index d0839f7..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/all.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('./every');
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/any.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/any.js
deleted file mode 100644
index 900ac25..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/any.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('./some');
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/at.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/at.js
deleted file mode 100644
index 29236e5..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/at.js
+++ /dev/null
@@ -1,29 +0,0 @@
-var baseAt = require('../internal/baseAt'),
- baseFlatten = require('../internal/baseFlatten'),
- restParam = require('../function/restParam');
-
-/**
- * Creates an array of elements corresponding to the given keys, or indexes,
- * of `collection`. Keys may be specified as individual arguments or as arrays
- * of keys.
- *
- * @static
- * @memberOf _
- * @category Collection
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {...(number|number[]|string|string[])} [props] The property names
- * or indexes of elements to pick, specified individually or in arrays.
- * @returns {Array} Returns the new array of picked elements.
- * @example
- *
- * _.at(['a', 'b', 'c'], [0, 2]);
- * // => ['a', 'c']
- *
- * _.at(['barney', 'fred', 'pebbles'], 0, 2);
- * // => ['barney', 'pebbles']
- */
-var at = restParam(function(collection, props) {
- return baseAt(collection, baseFlatten(props));
-});
-
-module.exports = at;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/collect.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/collect.js
deleted file mode 100644
index 0d1e1ab..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/collect.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('./map');
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/contains.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/contains.js
deleted file mode 100644
index 594722a..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/contains.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('./includes');
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/countBy.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/countBy.js
deleted file mode 100644
index e97dbb7..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/countBy.js
+++ /dev/null
@@ -1,54 +0,0 @@
-var createAggregator = require('../internal/createAggregator');
-
-/** Used for native method references. */
-var objectProto = Object.prototype;
-
-/** Used to check objects for own properties. */
-var hasOwnProperty = objectProto.hasOwnProperty;
-
-/**
- * Creates an object composed of keys generated from the results of running
- * each element of `collection` through `iteratee`. The corresponding value
- * of each key is the number of times the key was returned by `iteratee`.
- * The `iteratee` is bound to `thisArg` and invoked with three arguments:
- * (value, index|key, collection).
- *
- * 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 Collection
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function|Object|string} [iteratee=_.identity] The function invoked
- * per iteration.
- * @param {*} [thisArg] The `this` binding of `iteratee`.
- * @returns {Object} Returns the composed aggregate object.
- * @example
- *
- * _.countBy([4.3, 6.1, 6.4], function(n) {
- * return Math.floor(n);
- * });
- * // => { '4': 1, '6': 2 }
- *
- * _.countBy([4.3, 6.1, 6.4], function(n) {
- * return this.floor(n);
- * }, Math);
- * // => { '4': 1, '6': 2 }
- *
- * _.countBy(['one', 'two', 'three'], 'length');
- * // => { '3': 2, '5': 1 }
- */
-var countBy = createAggregator(function(result, value, key) {
- hasOwnProperty.call(result, key) ? ++result[key] : (result[key] = 1);
-});
-
-module.exports = countBy;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/detect.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/detect.js
deleted file mode 100644
index 2fb6303..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/detect.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('./find');
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/each.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/each.js
deleted file mode 100644
index 8800f42..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/each.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('./forEach');
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/eachRight.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/eachRight.js
deleted file mode 100644
index 3252b2a..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/eachRight.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('./forEachRight');
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/every.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/every.js
deleted file mode 100644
index 5a2d0f5..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/every.js
+++ /dev/null
@@ -1,66 +0,0 @@
-var arrayEvery = require('../internal/arrayEvery'),
- baseCallback = require('../internal/baseCallback'),
- baseEvery = require('../internal/baseEvery'),
- isArray = require('../lang/isArray'),
- isIterateeCall = require('../internal/isIterateeCall');
-
-/**
- * Checks if `predicate` returns truthy for **all** elements of `collection`.
- * The predicate is bound to `thisArg` and invoked with three arguments:
- * (value, index|key, collection).
- *
- * 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 _
- * @alias all
- * @category Collection
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function|Object|string} [predicate=_.identity] The function invoked
- * per iteration.
- * @param {*} [thisArg] The `this` binding of `predicate`.
- * @returns {boolean} Returns `true` if all elements pass the predicate check,
- * else `false`.
- * @example
- *
- * _.every([true, 1, null, 'yes'], Boolean);
- * // => false
- *
- * var users = [
- * { 'user': 'barney', 'active': false },
- * { 'user': 'fred', 'active': false }
- * ];
- *
- * // using the `_.matches` callback shorthand
- * _.every(users, { 'user': 'barney', 'active': false });
- * // => false
- *
- * // using the `_.matchesProperty` callback shorthand
- * _.every(users, 'active', false);
- * // => true
- *
- * // using the `_.property` callback shorthand
- * _.every(users, 'active');
- * // => false
- */
-function every(collection, predicate, thisArg) {
- var func = isArray(collection) ? arrayEvery : baseEvery;
- if (thisArg && isIterateeCall(collection, predicate, thisArg)) {
- predicate = undefined;
- }
- if (typeof predicate != 'function' || thisArg !== undefined) {
- predicate = baseCallback(predicate, thisArg, 3);
- }
- return func(collection, predicate);
-}
-
-module.exports = every;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/filter.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/filter.js
deleted file mode 100644
index 7620aa7..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/filter.js
+++ /dev/null
@@ -1,61 +0,0 @@
-var arrayFilter = require('../internal/arrayFilter'),
- baseCallback = require('../internal/baseCallback'),
- baseFilter = require('../internal/baseFilter'),
- isArray = require('../lang/isArray');
-
-/**
- * Iterates over elements of `collection`, returning an array of all elements
- * `predicate` returns truthy for. The predicate is bound to `thisArg` and
- * invoked with three arguments: (value, index|key, collection).
- *
- * 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 _
- * @alias select
- * @category Collection
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function|Object|string} [predicate=_.identity] The function invoked
- * per iteration.
- * @param {*} [thisArg] The `this` binding of `predicate`.
- * @returns {Array} Returns the new filtered array.
- * @example
- *
- * _.filter([4, 5, 6], function(n) {
- * return n % 2 == 0;
- * });
- * // => [4, 6]
- *
- * var users = [
- * { 'user': 'barney', 'age': 36, 'active': true },
- * { 'user': 'fred', 'age': 40, 'active': false }
- * ];
- *
- * // using the `_.matches` callback shorthand
- * _.pluck(_.filter(users, { 'age': 36, 'active': true }), 'user');
- * // => ['barney']
- *
- * // using the `_.matchesProperty` callback shorthand
- * _.pluck(_.filter(users, 'active', false), 'user');
- * // => ['fred']
- *
- * // using the `_.property` callback shorthand
- * _.pluck(_.filter(users, 'active'), 'user');
- * // => ['barney']
- */
-function filter(collection, predicate, thisArg) {
- var func = isArray(collection) ? arrayFilter : baseFilter;
- predicate = baseCallback(predicate, thisArg, 3);
- return func(collection, predicate);
-}
-
-module.exports = filter;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/find.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/find.js
deleted file mode 100644
index 7358cfe..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/find.js
+++ /dev/null
@@ -1,56 +0,0 @@
-var baseEach = require('../internal/baseEach'),
- createFind = require('../internal/createFind');
-
-/**
- * Iterates over elements of `collection`, returning the first element
- * `predicate` returns truthy for. The predicate is bound to `thisArg` and
- * invoked with three arguments: (value, index|key, collection).
- *
- * 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 _
- * @alias detect
- * @category Collection
- * @param {Array|Object|string} collection The collection to search.
- * @param {Function|Object|string} [predicate=_.identity] The function invoked
- * per iteration.
- * @param {*} [thisArg] The `this` binding of `predicate`.
- * @returns {*} Returns the matched element, else `undefined`.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'age': 36, 'active': true },
- * { 'user': 'fred', 'age': 40, 'active': false },
- * { 'user': 'pebbles', 'age': 1, 'active': true }
- * ];
- *
- * _.result(_.find(users, function(chr) {
- * return chr.age < 40;
- * }), 'user');
- * // => 'barney'
- *
- * // using the `_.matches` callback shorthand
- * _.result(_.find(users, { 'age': 1, 'active': true }), 'user');
- * // => 'pebbles'
- *
- * // using the `_.matchesProperty` callback shorthand
- * _.result(_.find(users, 'active', false), 'user');
- * // => 'fred'
- *
- * // using the `_.property` callback shorthand
- * _.result(_.find(users, 'active'), 'user');
- * // => 'barney'
- */
-var find = createFind(baseEach);
-
-module.exports = find;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/findLast.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/findLast.js
deleted file mode 100644
index 75dbadc..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/findLast.js
+++ /dev/null
@@ -1,25 +0,0 @@
-var baseEachRight = require('../internal/baseEachRight'),
- createFind = require('../internal/createFind');
-
-/**
- * This method is like `_.find` except that it iterates over elements of
- * `collection` from right to left.
- *
- * @static
- * @memberOf _
- * @category Collection
- * @param {Array|Object|string} collection The collection to search.
- * @param {Function|Object|string} [predicate=_.identity] The function invoked
- * per iteration.
- * @param {*} [thisArg] The `this` binding of `predicate`.
- * @returns {*} Returns the matched element, else `undefined`.
- * @example
- *
- * _.findLast([1, 2, 3, 4], function(n) {
- * return n % 2 == 1;
- * });
- * // => 3
- */
-var findLast = createFind(baseEachRight, true);
-
-module.exports = findLast;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/findWhere.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/findWhere.js
deleted file mode 100644
index 2d62065..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/findWhere.js
+++ /dev/null
@@ -1,37 +0,0 @@
-var baseMatches = require('../internal/baseMatches'),
- find = require('./find');
-
-/**
- * Performs a deep comparison between each element in `collection` and the
- * source object, returning the first element that has equivalent property
- * values.
- *
- * **Note:** This method supports comparing arrays, booleans, `Date` objects,
- * numbers, `Object` objects, regexes, and strings. Objects are compared by
- * their own, not inherited, enumerable properties. For comparing a single
- * own or inherited property value see `_.matchesProperty`.
- *
- * @static
- * @memberOf _
- * @category Collection
- * @param {Array|Object|string} collection The collection to search.
- * @param {Object} source The object of property values to match.
- * @returns {*} Returns the matched element, else `undefined`.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'age': 36, 'active': true },
- * { 'user': 'fred', 'age': 40, 'active': false }
- * ];
- *
- * _.result(_.findWhere(users, { 'age': 36, 'active': true }), 'user');
- * // => 'barney'
- *
- * _.result(_.findWhere(users, { 'age': 40, 'active': false }), 'user');
- * // => 'fred'
- */
-function findWhere(collection, source) {
- return find(collection, baseMatches(source));
-}
-
-module.exports = findWhere;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/foldl.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/foldl.js
deleted file mode 100644
index 26f53cf..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/foldl.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('./reduce');
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/foldr.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/foldr.js
deleted file mode 100644
index 8fb199e..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/foldr.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('./reduceRight');
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/forEach.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/forEach.js
deleted file mode 100644
index 05a8e21..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/forEach.js
+++ /dev/null
@@ -1,37 +0,0 @@
-var arrayEach = require('../internal/arrayEach'),
- baseEach = require('../internal/baseEach'),
- createForEach = require('../internal/createForEach');
-
-/**
- * Iterates over elements of `collection` invoking `iteratee` for each element.
- * The `iteratee` is bound to `thisArg` and invoked with three arguments:
- * (value, index|key, collection). Iteratee functions may exit iteration early
- * by explicitly returning `false`.
- *
- * **Note:** As with other "Collections" methods, objects with a "length" property
- * are iterated like arrays. To avoid this behavior `_.forIn` or `_.forOwn`
- * may be used for object iteration.
- *
- * @static
- * @memberOf _
- * @alias each
- * @category Collection
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @param {*} [thisArg] The `this` binding of `iteratee`.
- * @returns {Array|Object|string} Returns `collection`.
- * @example
- *
- * _([1, 2]).forEach(function(n) {
- * console.log(n);
- * }).value();
- * // => logs each value from left to right and returns the array
- *
- * _.forEach({ 'a': 1, 'b': 2 }, function(n, key) {
- * console.log(n, key);
- * });
- * // => logs each value-key pair and returns the object (iteration order is not guaranteed)
- */
-var forEach = createForEach(arrayEach, baseEach);
-
-module.exports = forEach;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/forEachRight.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/forEachRight.js
deleted file mode 100644
index 3499711..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/forEachRight.js
+++ /dev/null
@@ -1,26 +0,0 @@
-var arrayEachRight = require('../internal/arrayEachRight'),
- baseEachRight = require('../internal/baseEachRight'),
- createForEach = require('../internal/createForEach');
-
-/**
- * This method is like `_.forEach` except that it iterates over elements of
- * `collection` from right to left.
- *
- * @static
- * @memberOf _
- * @alias eachRight
- * @category Collection
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @param {*} [thisArg] The `this` binding of `iteratee`.
- * @returns {Array|Object|string} Returns `collection`.
- * @example
- *
- * _([1, 2]).forEachRight(function(n) {
- * console.log(n);
- * }).value();
- * // => logs each value from right to left and returns the array
- */
-var forEachRight = createForEach(arrayEachRight, baseEachRight);
-
-module.exports = forEachRight;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/groupBy.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/groupBy.js
deleted file mode 100644
index a925c89..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/groupBy.js
+++ /dev/null
@@ -1,59 +0,0 @@
-var createAggregator = require('../internal/createAggregator');
-
-/** Used for native method references. */
-var objectProto = Object.prototype;
-
-/** Used to check objects for own properties. */
-var hasOwnProperty = objectProto.hasOwnProperty;
-
-/**
- * Creates an object composed of keys generated from the results of running
- * each element of `collection` through `iteratee`. The corresponding value
- * of each key is an array of the elements responsible for generating the key.
- * The `iteratee` is bound to `thisArg` and invoked with three arguments:
- * (value, index|key, collection).
- *
- * 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 Collection
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function|Object|string} [iteratee=_.identity] The function invoked
- * per iteration.
- * @param {*} [thisArg] The `this` binding of `iteratee`.
- * @returns {Object} Returns the composed aggregate object.
- * @example
- *
- * _.groupBy([4.2, 6.1, 6.4], function(n) {
- * return Math.floor(n);
- * });
- * // => { '4': [4.2], '6': [6.1, 6.4] }
- *
- * _.groupBy([4.2, 6.1, 6.4], function(n) {
- * return this.floor(n);
- * }, Math);
- * // => { '4': [4.2], '6': [6.1, 6.4] }
- *
- * // using the `_.property` callback shorthand
- * _.groupBy(['one', 'two', 'three'], 'length');
- * // => { '3': ['one', 'two'], '5': ['three'] }
- */
-var groupBy = createAggregator(function(result, value, key) {
- if (hasOwnProperty.call(result, key)) {
- result[key].push(value);
- } else {
- result[key] = [value];
- }
-});
-
-module.exports = groupBy;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/include.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/include.js
deleted file mode 100644
index 594722a..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/include.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('./includes');
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/includes.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/includes.js
deleted file mode 100644
index 329486a..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/includes.js
+++ /dev/null
@@ -1,57 +0,0 @@
-var baseIndexOf = require('../internal/baseIndexOf'),
- getLength = require('../internal/getLength'),
- isArray = require('../lang/isArray'),
- isIterateeCall = require('../internal/isIterateeCall'),
- isLength = require('../internal/isLength'),
- isString = require('../lang/isString'),
- values = require('../object/values');
-
-/* Native method references for those with the same name as other `lodash` methods. */
-var nativeMax = Math.max;
-
-/**
- * Checks if `target` is in `collection` 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 `collection`.
- *
- * @static
- * @memberOf _
- * @alias contains, include
- * @category Collection
- * @param {Array|Object|string} collection The collection to search.
- * @param {*} target The value to search for.
- * @param {number} [fromIndex=0] The index to search from.
- * @param- {Object} [guard] Enables use as a callback for functions like `_.reduce`.
- * @returns {boolean} Returns `true` if a matching element is found, else `false`.
- * @example
- *
- * _.includes([1, 2, 3], 1);
- * // => true
- *
- * _.includes([1, 2, 3], 1, 2);
- * // => false
- *
- * _.includes({ 'user': 'fred', 'age': 40 }, 'fred');
- * // => true
- *
- * _.includes('pebbles', 'eb');
- * // => true
- */
-function includes(collection, target, fromIndex, guard) {
- var length = collection ? getLength(collection) : 0;
- if (!isLength(length)) {
- collection = values(collection);
- length = collection.length;
- }
- if (typeof fromIndex != 'number' || (guard && isIterateeCall(target, fromIndex, guard))) {
- fromIndex = 0;
- } else {
- fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : (fromIndex || 0);
- }
- return (typeof collection == 'string' || !isArray(collection) && isString(collection))
- ? (fromIndex <= length && collection.indexOf(target, fromIndex) > -1)
- : (!!length && baseIndexOf(collection, target, fromIndex) > -1);
-}
-
-module.exports = includes;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/indexBy.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/indexBy.js
deleted file mode 100644
index 34a941e..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/indexBy.js
+++ /dev/null
@@ -1,53 +0,0 @@
-var createAggregator = require('../internal/createAggregator');
-
-/**
- * Creates an object composed of keys generated from the results of running
- * each element of `collection` through `iteratee`. The corresponding value
- * of each key is the last element responsible for generating the key. The
- * iteratee function is bound to `thisArg` and invoked with three arguments:
- * (value, index|key, collection).
- *
- * 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 Collection
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function|Object|string} [iteratee=_.identity] The function invoked
- * per iteration.
- * @param {*} [thisArg] The `this` binding of `iteratee`.
- * @returns {Object} Returns the composed aggregate object.
- * @example
- *
- * var keyData = [
- * { 'dir': 'left', 'code': 97 },
- * { 'dir': 'right', 'code': 100 }
- * ];
- *
- * _.indexBy(keyData, 'dir');
- * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
- *
- * _.indexBy(keyData, function(object) {
- * return String.fromCharCode(object.code);
- * });
- * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
- *
- * _.indexBy(keyData, function(object) {
- * return this.fromCharCode(object.code);
- * }, String);
- * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
- */
-var indexBy = createAggregator(function(result, value, key) {
- result[key] = value;
-});
-
-module.exports = indexBy;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/inject.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/inject.js
deleted file mode 100644
index 26f53cf..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/inject.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('./reduce');
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/invoke.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/invoke.js
deleted file mode 100644
index 6e71721..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/invoke.js
+++ /dev/null
@@ -1,42 +0,0 @@
-var baseEach = require('../internal/baseEach'),
- invokePath = require('../internal/invokePath'),
- isArrayLike = require('../internal/isArrayLike'),
- isKey = require('../internal/isKey'),
- restParam = require('../function/restParam');
-
-/**
- * Invokes the method at `path` of each element in `collection`, returning
- * an array of the results of each invoked method. Any additional arguments
- * are provided to each invoked method. If `methodName` is a function it's
- * invoked for, and `this` bound to, each element in `collection`.
- *
- * @static
- * @memberOf _
- * @category Collection
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Array|Function|string} path The path of the method to invoke or
- * the function invoked per iteration.
- * @param {...*} [args] The arguments to invoke the method with.
- * @returns {Array} Returns the array of results.
- * @example
- *
- * _.invoke([[5, 1, 7], [3, 2, 1]], 'sort');
- * // => [[1, 5, 7], [1, 2, 3]]
- *
- * _.invoke([123, 456], String.prototype.split, '');
- * // => [['1', '2', '3'], ['4', '5', '6']]
- */
-var invoke = restParam(function(collection, path, args) {
- var index = -1,
- isFunc = typeof path == 'function',
- isProp = isKey(path),
- result = isArrayLike(collection) ? Array(collection.length) : [];
-
- baseEach(collection, function(value) {
- var func = isFunc ? path : ((isProp && value != null) ? value[path] : undefined);
- result[++index] = func ? func.apply(value, args) : invokePath(value, path, args);
- });
- return result;
-});
-
-module.exports = invoke;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/map.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/map.js
deleted file mode 100644
index 5381110..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/map.js
+++ /dev/null
@@ -1,68 +0,0 @@
-var arrayMap = require('../internal/arrayMap'),
- baseCallback = require('../internal/baseCallback'),
- baseMap = require('../internal/baseMap'),
- isArray = require('../lang/isArray');
-
-/**
- * Creates an array of values by running each element in `collection` through
- * `iteratee`. The `iteratee` is bound to `thisArg` and invoked with three
- * arguments: (value, index|key, collection).
- *
- * 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`.
- *
- * Many lodash methods are guarded to work as iteratees for methods like
- * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
- *
- * The guarded methods are:
- * `ary`, `callback`, `chunk`, `clone`, `create`, `curry`, `curryRight`,
- * `drop`, `dropRight`, `every`, `fill`, `flatten`, `invert`, `max`, `min`,
- * `parseInt`, `slice`, `sortBy`, `take`, `takeRight`, `template`, `trim`,
- * `trimLeft`, `trimRight`, `trunc`, `random`, `range`, `sample`, `some`,
- * `sum`, `uniq`, and `words`
- *
- * @static
- * @memberOf _
- * @alias collect
- * @category Collection
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function|Object|string} [iteratee=_.identity] The function invoked
- * per iteration.
- * @param {*} [thisArg] The `this` binding of `iteratee`.
- * @returns {Array} Returns the new mapped array.
- * @example
- *
- * function timesThree(n) {
- * return n * 3;
- * }
- *
- * _.map([1, 2], timesThree);
- * // => [3, 6]
- *
- * _.map({ 'a': 1, 'b': 2 }, timesThree);
- * // => [3, 6] (iteration order is not guaranteed)
- *
- * var users = [
- * { 'user': 'barney' },
- * { 'user': 'fred' }
- * ];
- *
- * // using the `_.property` callback shorthand
- * _.map(users, 'user');
- * // => ['barney', 'fred']
- */
-function map(collection, iteratee, thisArg) {
- var func = isArray(collection) ? arrayMap : baseMap;
- iteratee = baseCallback(iteratee, thisArg, 3);
- return func(collection, iteratee);
-}
-
-module.exports = map;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/max.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/max.js
deleted file mode 100644
index bb1d213..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/max.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('../math/max');
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/min.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/min.js
deleted file mode 100644
index eef13d0..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/min.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('../math/min');
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/partition.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/partition.js
deleted file mode 100644
index ee35f27..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/partition.js
+++ /dev/null
@@ -1,66 +0,0 @@
-var createAggregator = require('../internal/createAggregator');
-
-/**
- * Creates an array of elements split into two groups, the first of which
- * contains elements `predicate` returns truthy for, while the second of which
- * contains elements `predicate` returns falsey for. The predicate is bound
- * to `thisArg` and invoked with three arguments: (value, index|key, collection).
- *
- * 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 Collection
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function|Object|string} [predicate=_.identity] The function invoked
- * per iteration.
- * @param {*} [thisArg] The `this` binding of `predicate`.
- * @returns {Array} Returns the array of grouped elements.
- * @example
- *
- * _.partition([1, 2, 3], function(n) {
- * return n % 2;
- * });
- * // => [[1, 3], [2]]
- *
- * _.partition([1.2, 2.3, 3.4], function(n) {
- * return this.floor(n) % 2;
- * }, Math);
- * // => [[1.2, 3.4], [2.3]]
- *
- * var users = [
- * { 'user': 'barney', 'age': 36, 'active': false },
- * { 'user': 'fred', 'age': 40, 'active': true },
- * { 'user': 'pebbles', 'age': 1, 'active': false }
- * ];
- *
- * var mapper = function(array) {
- * return _.pluck(array, 'user');
- * };
- *
- * // using the `_.matches` callback shorthand
- * _.map(_.partition(users, { 'age': 1, 'active': false }), mapper);
- * // => [['pebbles'], ['barney', 'fred']]
- *
- * // using the `_.matchesProperty` callback shorthand
- * _.map(_.partition(users, 'active', false), mapper);
- * // => [['barney', 'pebbles'], ['fred']]
- *
- * // using the `_.property` callback shorthand
- * _.map(_.partition(users, 'active'), mapper);
- * // => [['fred'], ['barney', 'pebbles']]
- */
-var partition = createAggregator(function(result, value, key) {
- result[key ? 0 : 1].push(value);
-}, function() { return [[], []]; });
-
-module.exports = partition;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/pluck.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/pluck.js
deleted file mode 100644
index 5ee1ec8..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/pluck.js
+++ /dev/null
@@ -1,31 +0,0 @@
-var map = require('./map'),
- property = require('../utility/property');
-
-/**
- * Gets the property value of `path` from all elements in `collection`.
- *
- * @static
- * @memberOf _
- * @category Collection
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Array|string} path The path of the property to pluck.
- * @returns {Array} Returns the property values.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'age': 36 },
- * { 'user': 'fred', 'age': 40 }
- * ];
- *
- * _.pluck(users, 'user');
- * // => ['barney', 'fred']
- *
- * var userIndex = _.indexBy(users, 'user');
- * _.pluck(userIndex, 'age');
- * // => [36, 40] (iteration order is not guaranteed)
- */
-function pluck(collection, path) {
- return map(collection, property(path));
-}
-
-module.exports = pluck;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/reduce.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/reduce.js
deleted file mode 100644
index 5d5e8c9..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/reduce.js
+++ /dev/null
@@ -1,44 +0,0 @@
-var arrayReduce = require('../internal/arrayReduce'),
- baseEach = require('../internal/baseEach'),
- createReduce = require('../internal/createReduce');
-
-/**
- * Reduces `collection` to a value which is the accumulated result of running
- * each element in `collection` through `iteratee`, where each successive
- * invocation is supplied the return value of the previous. If `accumulator`
- * is not provided the first element of `collection` is used as the initial
- * value. The `iteratee` is bound to `thisArg` and invoked with four arguments:
- * (accumulator, value, index|key, collection).
- *
- * Many lodash methods are guarded to work as iteratees for methods like
- * `_.reduce`, `_.reduceRight`, and `_.transform`.
- *
- * The guarded methods are:
- * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `sortByAll`,
- * and `sortByOrder`
- *
- * @static
- * @memberOf _
- * @alias foldl, inject
- * @category Collection
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @param {*} [accumulator] The initial value.
- * @param {*} [thisArg] The `this` binding of `iteratee`.
- * @returns {*} Returns the accumulated value.
- * @example
- *
- * _.reduce([1, 2], function(total, n) {
- * return total + n;
- * });
- * // => 3
- *
- * _.reduce({ 'a': 1, 'b': 2 }, function(result, n, key) {
- * result[key] = n * 3;
- * return result;
- * }, {});
- * // => { 'a': 3, 'b': 6 } (iteration order is not guaranteed)
- */
-var reduce = createReduce(arrayReduce, baseEach);
-
-module.exports = reduce;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/reduceRight.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/reduceRight.js
deleted file mode 100644
index 5a5753b..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/reduceRight.js
+++ /dev/null
@@ -1,29 +0,0 @@
-var arrayReduceRight = require('../internal/arrayReduceRight'),
- baseEachRight = require('../internal/baseEachRight'),
- createReduce = require('../internal/createReduce');
-
-/**
- * This method is like `_.reduce` except that it iterates over elements of
- * `collection` from right to left.
- *
- * @static
- * @memberOf _
- * @alias foldr
- * @category Collection
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @param {*} [accumulator] The initial value.
- * @param {*} [thisArg] The `this` binding of `iteratee`.
- * @returns {*} Returns the accumulated value.
- * @example
- *
- * var array = [[0, 1], [2, 3], [4, 5]];
- *
- * _.reduceRight(array, function(flattened, other) {
- * return flattened.concat(other);
- * }, []);
- * // => [4, 5, 2, 3, 0, 1]
- */
-var reduceRight = createReduce(arrayReduceRight, baseEachRight);
-
-module.exports = reduceRight;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/reject.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/reject.js
deleted file mode 100644
index 5592453..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/reject.js
+++ /dev/null
@@ -1,50 +0,0 @@
-var arrayFilter = require('../internal/arrayFilter'),
- baseCallback = require('../internal/baseCallback'),
- baseFilter = require('../internal/baseFilter'),
- isArray = require('../lang/isArray');
-
-/**
- * The opposite of `_.filter`; this method returns the elements of `collection`
- * that `predicate` does **not** return truthy for.
- *
- * @static
- * @memberOf _
- * @category Collection
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function|Object|string} [predicate=_.identity] The function invoked
- * per iteration.
- * @param {*} [thisArg] The `this` binding of `predicate`.
- * @returns {Array} Returns the new filtered array.
- * @example
- *
- * _.reject([1, 2, 3, 4], function(n) {
- * return n % 2 == 0;
- * });
- * // => [1, 3]
- *
- * var users = [
- * { 'user': 'barney', 'age': 36, 'active': false },
- * { 'user': 'fred', 'age': 40, 'active': true }
- * ];
- *
- * // using the `_.matches` callback shorthand
- * _.pluck(_.reject(users, { 'age': 40, 'active': true }), 'user');
- * // => ['barney']
- *
- * // using the `_.matchesProperty` callback shorthand
- * _.pluck(_.reject(users, 'active', false), 'user');
- * // => ['fred']
- *
- * // using the `_.property` callback shorthand
- * _.pluck(_.reject(users, 'active'), 'user');
- * // => ['barney']
- */
-function reject(collection, predicate, thisArg) {
- var func = isArray(collection) ? arrayFilter : baseFilter;
- predicate = baseCallback(predicate, thisArg, 3);
- return func(collection, function(value, index, collection) {
- return !predicate(value, index, collection);
- });
-}
-
-module.exports = reject;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/sample.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/sample.js
deleted file mode 100644
index 8e01533..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/sample.js
+++ /dev/null
@@ -1,50 +0,0 @@
-var baseRandom = require('../internal/baseRandom'),
- isIterateeCall = require('../internal/isIterateeCall'),
- toArray = require('../lang/toArray'),
- toIterable = require('../internal/toIterable');
-
-/* Native method references for those with the same name as other `lodash` methods. */
-var nativeMin = Math.min;
-
-/**
- * Gets a random element or `n` random elements from a collection.
- *
- * @static
- * @memberOf _
- * @category Collection
- * @param {Array|Object|string} collection The collection to sample.
- * @param {number} [n] The number of elements to sample.
- * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
- * @returns {*} Returns the random sample(s).
- * @example
- *
- * _.sample([1, 2, 3, 4]);
- * // => 2
- *
- * _.sample([1, 2, 3, 4], 2);
- * // => [3, 1]
- */
-function sample(collection, n, guard) {
- if (guard ? isIterateeCall(collection, n, guard) : n == null) {
- collection = toIterable(collection);
- var length = collection.length;
- return length > 0 ? collection[baseRandom(0, length - 1)] : undefined;
- }
- var index = -1,
- result = toArray(collection),
- length = result.length,
- lastIndex = length - 1;
-
- n = nativeMin(n < 0 ? 0 : (+n || 0), length);
- while (++index < n) {
- var rand = baseRandom(index, lastIndex),
- value = result[rand];
-
- result[rand] = result[index];
- result[index] = value;
- }
- result.length = n;
- return result;
-}
-
-module.exports = sample;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/select.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/select.js
deleted file mode 100644
index ade80f6..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/select.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('./filter');
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/shuffle.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/shuffle.js
deleted file mode 100644
index 949689c..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/shuffle.js
+++ /dev/null
@@ -1,24 +0,0 @@
-var sample = require('./sample');
-
-/** Used as references for `-Infinity` and `Infinity`. */
-var POSITIVE_INFINITY = Number.POSITIVE_INFINITY;
-
-/**
- * Creates an array of shuffled values, using a version of the
- * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
- *
- * @static
- * @memberOf _
- * @category Collection
- * @param {Array|Object|string} collection The collection to shuffle.
- * @returns {Array} Returns the new shuffled array.
- * @example
- *
- * _.shuffle([1, 2, 3, 4]);
- * // => [4, 1, 3, 2]
- */
-function shuffle(collection) {
- return sample(collection, POSITIVE_INFINITY);
-}
-
-module.exports = shuffle;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/size.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/size.js
deleted file mode 100644
index 78dcf4c..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/size.js
+++ /dev/null
@@ -1,30 +0,0 @@
-var getLength = require('../internal/getLength'),
- isLength = require('../internal/isLength'),
- keys = require('../object/keys');
-
-/**
- * Gets the size of `collection` by returning its length for array-like
- * values or the number of own enumerable properties for objects.
- *
- * @static
- * @memberOf _
- * @category Collection
- * @param {Array|Object|string} collection The collection to inspect.
- * @returns {number} Returns the size of `collection`.
- * @example
- *
- * _.size([1, 2, 3]);
- * // => 3
- *
- * _.size({ 'a': 1, 'b': 2 });
- * // => 2
- *
- * _.size('pebbles');
- * // => 7
- */
-function size(collection) {
- var length = collection ? getLength(collection) : 0;
- return isLength(length) ? length : keys(collection).length;
-}
-
-module.exports = size;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/some.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/some.js
deleted file mode 100644
index d0b09a4..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/some.js
+++ /dev/null
@@ -1,67 +0,0 @@
-var arraySome = require('../internal/arraySome'),
- baseCallback = require('../internal/baseCallback'),
- baseSome = require('../internal/baseSome'),
- isArray = require('../lang/isArray'),
- isIterateeCall = require('../internal/isIterateeCall');
-
-/**
- * Checks if `predicate` returns truthy for **any** element of `collection`.
- * The function returns as soon as it finds a passing value and does not iterate
- * over the entire collection. The predicate is bound to `thisArg` and invoked
- * with three arguments: (value, index|key, collection).
- *
- * 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 _
- * @alias any
- * @category Collection
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function|Object|string} [predicate=_.identity] The function invoked
- * per iteration.
- * @param {*} [thisArg] The `this` binding of `predicate`.
- * @returns {boolean} Returns `true` if any element passes the predicate check,
- * else `false`.
- * @example
- *
- * _.some([null, 0, 'yes', false], Boolean);
- * // => true
- *
- * var users = [
- * { 'user': 'barney', 'active': true },
- * { 'user': 'fred', 'active': false }
- * ];
- *
- * // using the `_.matches` callback shorthand
- * _.some(users, { 'user': 'barney', 'active': false });
- * // => false
- *
- * // using the `_.matchesProperty` callback shorthand
- * _.some(users, 'active', false);
- * // => true
- *
- * // using the `_.property` callback shorthand
- * _.some(users, 'active');
- * // => true
- */
-function some(collection, predicate, thisArg) {
- var func = isArray(collection) ? arraySome : baseSome;
- if (thisArg && isIterateeCall(collection, predicate, thisArg)) {
- predicate = undefined;
- }
- if (typeof predicate != 'function' || thisArg !== undefined) {
- predicate = baseCallback(predicate, thisArg, 3);
- }
- return func(collection, predicate);
-}
-
-module.exports = some;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/sortBy.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/sortBy.js
deleted file mode 100644
index 4401c77..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/sortBy.js
+++ /dev/null
@@ -1,71 +0,0 @@
-var baseCallback = require('../internal/baseCallback'),
- baseMap = require('../internal/baseMap'),
- baseSortBy = require('../internal/baseSortBy'),
- compareAscending = require('../internal/compareAscending'),
- isIterateeCall = require('../internal/isIterateeCall');
-
-/**
- * Creates an array of elements, sorted in ascending order by the results of
- * running each element in a collection through `iteratee`. This method performs
- * a stable sort, that is, it preserves the original sort order of equal elements.
- * The `iteratee` is bound to `thisArg` and invoked with three arguments:
- * (value, index|key, collection).
- *
- * 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 Collection
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function|Object|string} [iteratee=_.identity] The function invoked
- * per iteration.
- * @param {*} [thisArg] The `this` binding of `iteratee`.
- * @returns {Array} Returns the new sorted array.
- * @example
- *
- * _.sortBy([1, 2, 3], function(n) {
- * return Math.sin(n);
- * });
- * // => [3, 1, 2]
- *
- * _.sortBy([1, 2, 3], function(n) {
- * return this.sin(n);
- * }, Math);
- * // => [3, 1, 2]
- *
- * var users = [
- * { 'user': 'fred' },
- * { 'user': 'pebbles' },
- * { 'user': 'barney' }
- * ];
- *
- * // using the `_.property` callback shorthand
- * _.pluck(_.sortBy(users, 'user'), 'user');
- * // => ['barney', 'fred', 'pebbles']
- */
-function sortBy(collection, iteratee, thisArg) {
- if (collection == null) {
- return [];
- }
- if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {
- iteratee = undefined;
- }
- var index = -1;
- iteratee = baseCallback(iteratee, thisArg, 3);
-
- var result = baseMap(collection, function(value, key, collection) {
- return { 'criteria': iteratee(value, key, collection), 'index': ++index, 'value': value };
- });
- return baseSortBy(result, compareAscending);
-}
-
-module.exports = sortBy;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/sortByAll.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/sortByAll.js
deleted file mode 100644
index 4766c20..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/sortByAll.js
+++ /dev/null
@@ -1,52 +0,0 @@
-var baseFlatten = require('../internal/baseFlatten'),
- baseSortByOrder = require('../internal/baseSortByOrder'),
- isIterateeCall = require('../internal/isIterateeCall'),
- restParam = require('../function/restParam');
-
-/**
- * This method is like `_.sortBy` except that it can sort by multiple iteratees
- * or property names.
- *
- * If a property name is provided for an iteratee the created `_.property`
- * style callback returns the property value of the given element.
- *
- * If an object is provided for an iteratee the created `_.matches` style
- * callback returns `true` for elements that have the properties of the given
- * object, else `false`.
- *
- * @static
- * @memberOf _
- * @category Collection
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {...(Function|Function[]|Object|Object[]|string|string[])} iteratees
- * The iteratees to sort by, specified as individual values or arrays of values.
- * @returns {Array} Returns the new sorted array.
- * @example
- *
- * var users = [
- * { 'user': 'fred', 'age': 48 },
- * { 'user': 'barney', 'age': 36 },
- * { 'user': 'fred', 'age': 42 },
- * { 'user': 'barney', 'age': 34 }
- * ];
- *
- * _.map(_.sortByAll(users, ['user', 'age']), _.values);
- * // => [['barney', 34], ['barney', 36], ['fred', 42], ['fred', 48]]
- *
- * _.map(_.sortByAll(users, 'user', function(chr) {
- * return Math.floor(chr.age / 10);
- * }), _.values);
- * // => [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]]
- */
-var sortByAll = restParam(function(collection, iteratees) {
- if (collection == null) {
- return [];
- }
- var guard = iteratees[2];
- if (guard && isIterateeCall(iteratees[0], iteratees[1], guard)) {
- iteratees.length = 1;
- }
- return baseSortByOrder(collection, baseFlatten(iteratees), []);
-});
-
-module.exports = sortByAll;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/sortByOrder.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/sortByOrder.js
deleted file mode 100644
index 8b4fc19..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/sortByOrder.js
+++ /dev/null
@@ -1,55 +0,0 @@
-var baseSortByOrder = require('../internal/baseSortByOrder'),
- isArray = require('../lang/isArray'),
- isIterateeCall = require('../internal/isIterateeCall');
-
-/**
- * This method is like `_.sortByAll` except that it allows specifying the
- * sort orders of the iteratees to sort by. If `orders` is unspecified, all
- * values are sorted in ascending order. Otherwise, a value is sorted in
- * ascending order if its corresponding order is "asc", and descending if "desc".
- *
- * If a property name is provided for an iteratee the created `_.property`
- * style callback returns the property value of the given element.
- *
- * If an object is provided for an iteratee the created `_.matches` style
- * callback returns `true` for elements that have the properties of the given
- * object, else `false`.
- *
- * @static
- * @memberOf _
- * @category Collection
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
- * @param {boolean[]} [orders] The sort orders of `iteratees`.
- * @param- {Object} [guard] Enables use as a callback for functions like `_.reduce`.
- * @returns {Array} Returns the new sorted array.
- * @example
- *
- * var users = [
- * { 'user': 'fred', 'age': 48 },
- * { 'user': 'barney', 'age': 34 },
- * { 'user': 'fred', 'age': 42 },
- * { 'user': 'barney', 'age': 36 }
- * ];
- *
- * // sort by `user` in ascending order and by `age` in descending order
- * _.map(_.sortByOrder(users, ['user', 'age'], ['asc', 'desc']), _.values);
- * // => [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]]
- */
-function sortByOrder(collection, iteratees, orders, guard) {
- if (collection == null) {
- return [];
- }
- if (guard && isIterateeCall(iteratees, orders, guard)) {
- orders = undefined;
- }
- if (!isArray(iteratees)) {
- iteratees = iteratees == null ? [] : [iteratees];
- }
- if (!isArray(orders)) {
- orders = orders == null ? [] : [orders];
- }
- return baseSortByOrder(collection, iteratees, orders);
-}
-
-module.exports = sortByOrder;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/sum.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/sum.js
deleted file mode 100644
index a2e9380..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/sum.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('../math/sum');
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/where.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/where.js
deleted file mode 100644
index f603bf8..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/collection/where.js
+++ /dev/null
@@ -1,37 +0,0 @@
-var baseMatches = require('../internal/baseMatches'),
- filter = require('./filter');
-
-/**
- * Performs a deep comparison between each element in `collection` and the
- * source object, returning an array of all elements that have equivalent
- * property values.
- *
- * **Note:** This method supports comparing arrays, booleans, `Date` objects,
- * numbers, `Object` objects, regexes, and strings. Objects are compared by
- * their own, not inherited, enumerable properties. For comparing a single
- * own or inherited property value see `_.matchesProperty`.
- *
- * @static
- * @memberOf _
- * @category Collection
- * @param {Array|Object|string} collection The collection to search.
- * @param {Object} source The object of property values to match.
- * @returns {Array} Returns the new filtered array.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'age': 36, 'active': false, 'pets': ['hoppy'] },
- * { 'user': 'fred', 'age': 40, 'active': true, 'pets': ['baby puss', 'dino'] }
- * ];
- *
- * _.pluck(_.where(users, { 'age': 36, 'active': false }), 'user');
- * // => ['barney']
- *
- * _.pluck(_.where(users, { 'pets': ['dino'] }), 'user');
- * // => ['fred']
- */
-function where(collection, source) {
- return filter(collection, baseMatches(source));
-}
-
-module.exports = where;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/date.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/date.js
deleted file mode 100644
index 195366e..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/date.js
+++ /dev/null
@@ -1,3 +0,0 @@
-module.exports = {
- 'now': require('./date/now')
-};
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/date/now.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/date/now.js
deleted file mode 100644
index ffe3060..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/date/now.js
+++ /dev/null
@@ -1,24 +0,0 @@
-var getNative = require('../internal/getNative');
-
-/* Native method references for those with the same name as other `lodash` methods. */
-var nativeNow = getNative(Date, 'now');
-
-/**
- * Gets the number of milliseconds that have elapsed since the Unix epoch
- * (1 January 1970 00:00:00 UTC).
- *
- * @static
- * @memberOf _
- * @category Date
- * @example
- *
- * _.defer(function(stamp) {
- * console.log(_.now() - stamp);
- * }, _.now());
- * // => logs the number of milliseconds it took for the deferred function to be invoked
- */
-var now = nativeNow || function() {
- return new Date().getTime();
-};
-
-module.exports = now;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function.js
deleted file mode 100644
index 71f8ebe..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function.js
+++ /dev/null
@@ -1,28 +0,0 @@
-module.exports = {
- 'after': require('./function/after'),
- 'ary': require('./function/ary'),
- 'backflow': require('./function/backflow'),
- 'before': require('./function/before'),
- 'bind': require('./function/bind'),
- 'bindAll': require('./function/bindAll'),
- 'bindKey': require('./function/bindKey'),
- 'compose': require('./function/compose'),
- 'curry': require('./function/curry'),
- 'curryRight': require('./function/curryRight'),
- 'debounce': require('./function/debounce'),
- 'defer': require('./function/defer'),
- 'delay': require('./function/delay'),
- 'flow': require('./function/flow'),
- 'flowRight': require('./function/flowRight'),
- 'memoize': require('./function/memoize'),
- 'modArgs': require('./function/modArgs'),
- 'negate': require('./function/negate'),
- 'once': require('./function/once'),
- 'partial': require('./function/partial'),
- 'partialRight': require('./function/partialRight'),
- 'rearg': require('./function/rearg'),
- 'restParam': require('./function/restParam'),
- 'spread': require('./function/spread'),
- 'throttle': require('./function/throttle'),
- 'wrap': require('./function/wrap')
-};
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/after.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/after.js
deleted file mode 100644
index 96a51fd..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/after.js
+++ /dev/null
@@ -1,48 +0,0 @@
-/** Used as the `TypeError` message for "Functions" methods. */
-var FUNC_ERROR_TEXT = 'Expected a function';
-
-/* Native method references for those with the same name as other `lodash` methods. */
-var nativeIsFinite = global.isFinite;
-
-/**
- * The opposite of `_.before`; this method creates a function that invokes
- * `func` once it's called `n` or more times.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {number} n The number of calls before `func` is invoked.
- * @param {Function} func The function to restrict.
- * @returns {Function} Returns the new restricted function.
- * @example
- *
- * var saves = ['profile', 'settings'];
- *
- * var done = _.after(saves.length, function() {
- * console.log('done saving!');
- * });
- *
- * _.forEach(saves, function(type) {
- * asyncSave({ 'type': type, 'complete': done });
- * });
- * // => logs 'done saving!' after the two async saves have completed
- */
-function after(n, func) {
- if (typeof func != 'function') {
- if (typeof n == 'function') {
- var temp = n;
- n = func;
- func = temp;
- } else {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- }
- n = nativeIsFinite(n = +n) ? n : 0;
- return function() {
- if (--n < 1) {
- return func.apply(this, arguments);
- }
- };
-}
-
-module.exports = after;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/ary.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/ary.js
deleted file mode 100644
index 53a6913..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/ary.js
+++ /dev/null
@@ -1,34 +0,0 @@
-var createWrapper = require('../internal/createWrapper'),
- isIterateeCall = require('../internal/isIterateeCall');
-
-/** Used to compose bitmasks for wrapper metadata. */
-var ARY_FLAG = 128;
-
-/* Native method references for those with the same name as other `lodash` methods. */
-var nativeMax = Math.max;
-
-/**
- * Creates a function that accepts up to `n` arguments ignoring any
- * additional arguments.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {Function} func The function to cap arguments for.
- * @param {number} [n=func.length] The arity cap.
- * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
- * @returns {Function} Returns the new function.
- * @example
- *
- * _.map(['6', '8', '10'], _.ary(parseInt, 1));
- * // => [6, 8, 10]
- */
-function ary(func, n, guard) {
- if (guard && isIterateeCall(func, n, guard)) {
- n = undefined;
- }
- n = (func && n == null) ? func.length : nativeMax(+n || 0, 0);
- return createWrapper(func, ARY_FLAG, undefined, undefined, undefined, undefined, n);
-}
-
-module.exports = ary;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/backflow.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/backflow.js
deleted file mode 100644
index 1954e94..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/backflow.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('./flowRight');
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/before.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/before.js
deleted file mode 100644
index 3d94216..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/before.js
+++ /dev/null
@@ -1,42 +0,0 @@
-/** Used as the `TypeError` message for "Functions" methods. */
-var FUNC_ERROR_TEXT = 'Expected a function';
-
-/**
- * Creates a function that invokes `func`, with the `this` binding and arguments
- * of the created function, while it's called less than `n` times. Subsequent
- * calls to the created function return the result of the last `func` invocation.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {number} n The number of calls at which `func` is no longer invoked.
- * @param {Function} func The function to restrict.
- * @returns {Function} Returns the new restricted function.
- * @example
- *
- * jQuery('#add').on('click', _.before(5, addContactToList));
- * // => allows adding up to 4 contacts to the list
- */
-function before(n, func) {
- var result;
- if (typeof func != 'function') {
- if (typeof n == 'function') {
- var temp = n;
- n = func;
- func = temp;
- } else {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- }
- return function() {
- if (--n > 0) {
- result = func.apply(this, arguments);
- }
- if (n <= 1) {
- func = undefined;
- }
- return result;
- };
-}
-
-module.exports = before;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/bind.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/bind.js
deleted file mode 100644
index 0de126a..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/bind.js
+++ /dev/null
@@ -1,56 +0,0 @@
-var createWrapper = require('../internal/createWrapper'),
- replaceHolders = require('../internal/replaceHolders'),
- restParam = require('./restParam');
-
-/** Used to compose bitmasks for wrapper metadata. */
-var BIND_FLAG = 1,
- PARTIAL_FLAG = 32;
-
-/**
- * Creates a function that invokes `func` with the `this` binding of `thisArg`
- * and prepends any additional `_.bind` arguments to those provided to the
- * bound function.
- *
- * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
- * may be used as a placeholder for partially applied arguments.
- *
- * **Note:** Unlike native `Function#bind` this method does not set the "length"
- * property of bound functions.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {Function} func The function to bind.
- * @param {*} thisArg The `this` binding of `func`.
- * @param {...*} [partials] The arguments to be partially applied.
- * @returns {Function} Returns the new bound function.
- * @example
- *
- * var greet = function(greeting, punctuation) {
- * return greeting + ' ' + this.user + punctuation;
- * };
- *
- * var object = { 'user': 'fred' };
- *
- * var bound = _.bind(greet, object, 'hi');
- * bound('!');
- * // => 'hi fred!'
- *
- * // using placeholders
- * var bound = _.bind(greet, object, _, '!');
- * bound('hi');
- * // => 'hi fred!'
- */
-var bind = restParam(function(func, thisArg, partials) {
- var bitmask = BIND_FLAG;
- if (partials.length) {
- var holders = replaceHolders(partials, bind.placeholder);
- bitmask |= PARTIAL_FLAG;
- }
- return createWrapper(func, bitmask, thisArg, partials, holders);
-});
-
-// Assign default placeholders.
-bind.placeholder = {};
-
-module.exports = bind;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/bindAll.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/bindAll.js
deleted file mode 100644
index a09e948..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/bindAll.js
+++ /dev/null
@@ -1,50 +0,0 @@
-var baseFlatten = require('../internal/baseFlatten'),
- createWrapper = require('../internal/createWrapper'),
- functions = require('../object/functions'),
- restParam = require('./restParam');
-
-/** Used to compose bitmasks for wrapper metadata. */
-var BIND_FLAG = 1;
-
-/**
- * Binds methods of an object to the object itself, overwriting the existing
- * method. Method names may be specified as individual arguments or as arrays
- * of method names. If no method names are provided all enumerable function
- * properties, own and inherited, of `object` are bound.
- *
- * **Note:** This method does not set the "length" property of bound functions.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {Object} object The object to bind and assign the bound methods to.
- * @param {...(string|string[])} [methodNames] The object method names to bind,
- * specified as individual method names or arrays of method names.
- * @returns {Object} Returns `object`.
- * @example
- *
- * var view = {
- * 'label': 'docs',
- * 'onClick': function() {
- * console.log('clicked ' + this.label);
- * }
- * };
- *
- * _.bindAll(view);
- * jQuery('#docs').on('click', view.onClick);
- * // => logs 'clicked docs' when the element is clicked
- */
-var bindAll = restParam(function(object, methodNames) {
- methodNames = methodNames.length ? baseFlatten(methodNames) : functions(object);
-
- var index = -1,
- length = methodNames.length;
-
- while (++index < length) {
- var key = methodNames[index];
- object[key] = createWrapper(object[key], BIND_FLAG, object);
- }
- return object;
-});
-
-module.exports = bindAll;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/bindKey.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/bindKey.js
deleted file mode 100644
index b787fe7..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/bindKey.js
+++ /dev/null
@@ -1,66 +0,0 @@
-var createWrapper = require('../internal/createWrapper'),
- replaceHolders = require('../internal/replaceHolders'),
- restParam = require('./restParam');
-
-/** Used to compose bitmasks for wrapper metadata. */
-var BIND_FLAG = 1,
- BIND_KEY_FLAG = 2,
- PARTIAL_FLAG = 32;
-
-/**
- * Creates a function that invokes the method at `object[key]` and prepends
- * any additional `_.bindKey` arguments to those provided to the bound function.
- *
- * This method differs from `_.bind` by allowing bound functions to reference
- * methods that may be redefined or don't yet exist.
- * See [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
- * for more details.
- *
- * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
- * builds, may be used as a placeholder for partially applied arguments.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {Object} object The object the method belongs to.
- * @param {string} key The key of the method.
- * @param {...*} [partials] The arguments to be partially applied.
- * @returns {Function} Returns the new bound function.
- * @example
- *
- * var object = {
- * 'user': 'fred',
- * 'greet': function(greeting, punctuation) {
- * return greeting + ' ' + this.user + punctuation;
- * }
- * };
- *
- * var bound = _.bindKey(object, 'greet', 'hi');
- * bound('!');
- * // => 'hi fred!'
- *
- * object.greet = function(greeting, punctuation) {
- * return greeting + 'ya ' + this.user + punctuation;
- * };
- *
- * bound('!');
- * // => 'hiya fred!'
- *
- * // using placeholders
- * var bound = _.bindKey(object, 'greet', _, '!');
- * bound('hi');
- * // => 'hiya fred!'
- */
-var bindKey = restParam(function(object, key, partials) {
- var bitmask = BIND_FLAG | BIND_KEY_FLAG;
- if (partials.length) {
- var holders = replaceHolders(partials, bindKey.placeholder);
- bitmask |= PARTIAL_FLAG;
- }
- return createWrapper(key, bitmask, object, partials, holders);
-});
-
-// Assign default placeholders.
-bindKey.placeholder = {};
-
-module.exports = bindKey;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/compose.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/compose.js
deleted file mode 100644
index 1954e94..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/compose.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('./flowRight');
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/curry.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/curry.js
deleted file mode 100644
index b7db3fd..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/curry.js
+++ /dev/null
@@ -1,51 +0,0 @@
-var createCurry = require('../internal/createCurry');
-
-/** Used to compose bitmasks for wrapper metadata. */
-var CURRY_FLAG = 8;
-
-/**
- * Creates a function that accepts one or more arguments of `func` that when
- * called either invokes `func` returning its result, if all `func` arguments
- * have been provided, or returns a function that accepts one or more of the
- * remaining `func` arguments, and so on. The arity of `func` may be specified
- * if `func.length` is not sufficient.
- *
- * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
- * may be used as a placeholder for provided arguments.
- *
- * **Note:** This method does not set the "length" property of curried functions.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {Function} func The function to curry.
- * @param {number} [arity=func.length] The arity of `func`.
- * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
- * @returns {Function} Returns the new curried function.
- * @example
- *
- * var abc = function(a, b, c) {
- * return [a, b, c];
- * };
- *
- * var curried = _.curry(abc);
- *
- * curried(1)(2)(3);
- * // => [1, 2, 3]
- *
- * curried(1, 2)(3);
- * // => [1, 2, 3]
- *
- * curried(1, 2, 3);
- * // => [1, 2, 3]
- *
- * // using placeholders
- * curried(1)(_, 3)(2);
- * // => [1, 2, 3]
- */
-var curry = createCurry(CURRY_FLAG);
-
-// Assign default placeholders.
-curry.placeholder = {};
-
-module.exports = curry;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/curryRight.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/curryRight.js
deleted file mode 100644
index 11c5403..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/curryRight.js
+++ /dev/null
@@ -1,48 +0,0 @@
-var createCurry = require('../internal/createCurry');
-
-/** Used to compose bitmasks for wrapper metadata. */
-var CURRY_RIGHT_FLAG = 16;
-
-/**
- * This method is like `_.curry` except that arguments are applied to `func`
- * in the manner of `_.partialRight` instead of `_.partial`.
- *
- * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
- * builds, may be used as a placeholder for provided arguments.
- *
- * **Note:** This method does not set the "length" property of curried functions.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {Function} func The function to curry.
- * @param {number} [arity=func.length] The arity of `func`.
- * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
- * @returns {Function} Returns the new curried function.
- * @example
- *
- * var abc = function(a, b, c) {
- * return [a, b, c];
- * };
- *
- * var curried = _.curryRight(abc);
- *
- * curried(3)(2)(1);
- * // => [1, 2, 3]
- *
- * curried(2, 3)(1);
- * // => [1, 2, 3]
- *
- * curried(1, 2, 3);
- * // => [1, 2, 3]
- *
- * // using placeholders
- * curried(3)(1, _)(2);
- * // => [1, 2, 3]
- */
-var curryRight = createCurry(CURRY_RIGHT_FLAG);
-
-// Assign default placeholders.
-curryRight.placeholder = {};
-
-module.exports = curryRight;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/debounce.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/debounce.js
deleted file mode 100644
index 163af90..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/debounce.js
+++ /dev/null
@@ -1,181 +0,0 @@
-var isObject = require('../lang/isObject'),
- now = require('../date/now');
-
-/** Used as the `TypeError` message for "Functions" methods. */
-var FUNC_ERROR_TEXT = 'Expected a function';
-
-/* Native method references for those with the same name as other `lodash` methods. */
-var nativeMax = Math.max;
-
-/**
- * Creates a debounced function that delays invoking `func` until after `wait`
- * milliseconds have elapsed since the last time the debounced function was
- * invoked. The debounced function comes with a `cancel` method to cancel
- * delayed invocations. Provide an options object to indicate that `func`
- * should be invoked on the leading and/or trailing edge of the `wait` timeout.
- * Subsequent calls to the debounced function return the result of the last
- * `func` invocation.
- *
- * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked
- * on the trailing edge of the timeout only if the the debounced function is
- * invoked more than once during the `wait` timeout.
- *
- * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)
- * for details over the differences between `_.debounce` and `_.throttle`.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {Function} func The function to debounce.
- * @param {number} [wait=0] The number of milliseconds to delay.
- * @param {Object} [options] The options object.
- * @param {boolean} [options.leading=false] Specify invoking on the leading
- * edge of the timeout.
- * @param {number} [options.maxWait] The maximum time `func` is allowed to be
- * delayed before it's invoked.
- * @param {boolean} [options.trailing=true] Specify invoking on the trailing
- * edge of the timeout.
- * @returns {Function} Returns the new debounced function.
- * @example
- *
- * // avoid costly calculations while the window size is in flux
- * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
- *
- * // invoke `sendMail` when the click event is fired, debouncing subsequent calls
- * jQuery('#postbox').on('click', _.debounce(sendMail, 300, {
- * 'leading': true,
- * 'trailing': false
- * }));
- *
- * // ensure `batchLog` is invoked once after 1 second of debounced calls
- * var source = new EventSource('/stream');
- * jQuery(source).on('message', _.debounce(batchLog, 250, {
- * 'maxWait': 1000
- * }));
- *
- * // cancel a debounced call
- * var todoChanges = _.debounce(batchLog, 1000);
- * Object.observe(models.todo, todoChanges);
- *
- * Object.observe(models, function(changes) {
- * if (_.find(changes, { 'user': 'todo', 'type': 'delete'})) {
- * todoChanges.cancel();
- * }
- * }, ['delete']);
- *
- * // ...at some point `models.todo` is changed
- * models.todo.completed = true;
- *
- * // ...before 1 second has passed `models.todo` is deleted
- * // which cancels the debounced `todoChanges` call
- * delete models.todo;
- */
-function debounce(func, wait, options) {
- var args,
- maxTimeoutId,
- result,
- stamp,
- thisArg,
- timeoutId,
- trailingCall,
- lastCalled = 0,
- maxWait = false,
- trailing = true;
-
- if (typeof func != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- wait = wait < 0 ? 0 : (+wait || 0);
- if (options === true) {
- var leading = true;
- trailing = false;
- } else if (isObject(options)) {
- leading = !!options.leading;
- maxWait = 'maxWait' in options && nativeMax(+options.maxWait || 0, wait);
- trailing = 'trailing' in options ? !!options.trailing : trailing;
- }
-
- function cancel() {
- if (timeoutId) {
- clearTimeout(timeoutId);
- }
- if (maxTimeoutId) {
- clearTimeout(maxTimeoutId);
- }
- lastCalled = 0;
- maxTimeoutId = timeoutId = trailingCall = undefined;
- }
-
- function complete(isCalled, id) {
- if (id) {
- clearTimeout(id);
- }
- maxTimeoutId = timeoutId = trailingCall = undefined;
- if (isCalled) {
- lastCalled = now();
- result = func.apply(thisArg, args);
- if (!timeoutId && !maxTimeoutId) {
- args = thisArg = undefined;
- }
- }
- }
-
- function delayed() {
- var remaining = wait - (now() - stamp);
- if (remaining <= 0 || remaining > wait) {
- complete(trailingCall, maxTimeoutId);
- } else {
- timeoutId = setTimeout(delayed, remaining);
- }
- }
-
- function maxDelayed() {
- complete(trailing, timeoutId);
- }
-
- function debounced() {
- args = arguments;
- stamp = now();
- thisArg = this;
- trailingCall = trailing && (timeoutId || !leading);
-
- if (maxWait === false) {
- var leadingCall = leading && !timeoutId;
- } else {
- if (!maxTimeoutId && !leading) {
- lastCalled = stamp;
- }
- var remaining = maxWait - (stamp - lastCalled),
- isCalled = remaining <= 0 || remaining > maxWait;
-
- if (isCalled) {
- if (maxTimeoutId) {
- maxTimeoutId = clearTimeout(maxTimeoutId);
- }
- lastCalled = stamp;
- result = func.apply(thisArg, args);
- }
- else if (!maxTimeoutId) {
- maxTimeoutId = setTimeout(maxDelayed, remaining);
- }
- }
- if (isCalled && timeoutId) {
- timeoutId = clearTimeout(timeoutId);
- }
- else if (!timeoutId && wait !== maxWait) {
- timeoutId = setTimeout(delayed, wait);
- }
- if (leadingCall) {
- isCalled = true;
- result = func.apply(thisArg, args);
- }
- if (isCalled && !timeoutId && !maxTimeoutId) {
- args = thisArg = undefined;
- }
- return result;
- }
- debounced.cancel = cancel;
- return debounced;
-}
-
-module.exports = debounce;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/defer.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/defer.js
deleted file mode 100644
index 3accbf9..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/defer.js
+++ /dev/null
@@ -1,25 +0,0 @@
-var baseDelay = require('../internal/baseDelay'),
- restParam = require('./restParam');
-
-/**
- * Defers invoking the `func` until the current call stack has cleared. Any
- * additional arguments are provided to `func` when it's invoked.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {Function} func The function to defer.
- * @param {...*} [args] The arguments to invoke the function with.
- * @returns {number} Returns the timer id.
- * @example
- *
- * _.defer(function(text) {
- * console.log(text);
- * }, 'deferred');
- * // logs 'deferred' after one or more milliseconds
- */
-var defer = restParam(function(func, args) {
- return baseDelay(func, 1, args);
-});
-
-module.exports = defer;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/delay.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/delay.js
deleted file mode 100644
index d5eef27..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/delay.js
+++ /dev/null
@@ -1,26 +0,0 @@
-var baseDelay = require('../internal/baseDelay'),
- restParam = require('./restParam');
-
-/**
- * Invokes `func` after `wait` milliseconds. Any additional arguments are
- * provided to `func` when it's invoked.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {Function} func The function to delay.
- * @param {number} wait The number of milliseconds to delay invocation.
- * @param {...*} [args] The arguments to invoke the function with.
- * @returns {number} Returns the timer id.
- * @example
- *
- * _.delay(function(text) {
- * console.log(text);
- * }, 1000, 'later');
- * // => logs 'later' after one second
- */
-var delay = restParam(function(func, wait, args) {
- return baseDelay(func, wait, args);
-});
-
-module.exports = delay;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/flow.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/flow.js
deleted file mode 100644
index a435a3d..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/flow.js
+++ /dev/null
@@ -1,25 +0,0 @@
-var createFlow = require('../internal/createFlow');
-
-/**
- * Creates a function that returns the result of invoking the provided
- * functions with the `this` binding of the created function, where each
- * successive invocation is supplied the return value of the previous.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {...Function} [funcs] Functions to invoke.
- * @returns {Function} Returns the new function.
- * @example
- *
- * function square(n) {
- * return n * n;
- * }
- *
- * var addSquare = _.flow(_.add, square);
- * addSquare(1, 2);
- * // => 9
- */
-var flow = createFlow();
-
-module.exports = flow;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/flowRight.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/flowRight.js
deleted file mode 100644
index 23b9d76..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/flowRight.js
+++ /dev/null
@@ -1,25 +0,0 @@
-var createFlow = require('../internal/createFlow');
-
-/**
- * This method is like `_.flow` except that it creates a function that
- * invokes the provided functions from right to left.
- *
- * @static
- * @memberOf _
- * @alias backflow, compose
- * @category Function
- * @param {...Function} [funcs] Functions to invoke.
- * @returns {Function} Returns the new function.
- * @example
- *
- * function square(n) {
- * return n * n;
- * }
- *
- * var addSquare = _.flowRight(square, _.add);
- * addSquare(1, 2);
- * // => 9
- */
-var flowRight = createFlow(true);
-
-module.exports = flowRight;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/memoize.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/memoize.js
deleted file mode 100644
index f3b8d69..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/memoize.js
+++ /dev/null
@@ -1,80 +0,0 @@
-var MapCache = require('../internal/MapCache');
-
-/** Used as the `TypeError` message for "Functions" methods. */
-var FUNC_ERROR_TEXT = 'Expected a function';
-
-/**
- * Creates a function that memoizes the result of `func`. If `resolver` is
- * provided it determines the cache key for storing the result based on the
- * arguments provided to the memoized function. By default, the first argument
- * provided to the memoized function is coerced to a string and used as the
- * cache key. The `func` is invoked with the `this` binding of the memoized
- * function.
- *
- * **Note:** The cache is exposed as the `cache` property on the memoized
- * function. Its creation may be customized by replacing the `_.memoize.Cache`
- * constructor with one whose instances implement the [`Map`](http://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-map-prototype-object)
- * method interface of `get`, `has`, and `set`.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {Function} func The function to have its output memoized.
- * @param {Function} [resolver] The function to resolve the cache key.
- * @returns {Function} Returns the new memoizing function.
- * @example
- *
- * var upperCase = _.memoize(function(string) {
- * return string.toUpperCase();
- * });
- *
- * upperCase('fred');
- * // => 'FRED'
- *
- * // modifying the result cache
- * upperCase.cache.set('fred', 'BARNEY');
- * upperCase('fred');
- * // => 'BARNEY'
- *
- * // replacing `_.memoize.Cache`
- * var object = { 'user': 'fred' };
- * var other = { 'user': 'barney' };
- * var identity = _.memoize(_.identity);
- *
- * identity(object);
- * // => { 'user': 'fred' }
- * identity(other);
- * // => { 'user': 'fred' }
- *
- * _.memoize.Cache = WeakMap;
- * var identity = _.memoize(_.identity);
- *
- * identity(object);
- * // => { 'user': 'fred' }
- * identity(other);
- * // => { 'user': 'barney' }
- */
-function memoize(func, resolver) {
- if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- var memoized = function() {
- var args = arguments,
- key = resolver ? resolver.apply(this, args) : args[0],
- cache = memoized.cache;
-
- if (cache.has(key)) {
- return cache.get(key);
- }
- var result = func.apply(this, args);
- memoized.cache = cache.set(key, result);
- return result;
- };
- memoized.cache = new memoize.Cache;
- return memoized;
-}
-
-// Assign cache to `_.memoize`.
-memoize.Cache = MapCache;
-
-module.exports = memoize;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/modArgs.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/modArgs.js
deleted file mode 100644
index 49b9b5e..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/modArgs.js
+++ /dev/null
@@ -1,58 +0,0 @@
-var arrayEvery = require('../internal/arrayEvery'),
- baseFlatten = require('../internal/baseFlatten'),
- baseIsFunction = require('../internal/baseIsFunction'),
- restParam = require('./restParam');
-
-/** Used as the `TypeError` message for "Functions" methods. */
-var FUNC_ERROR_TEXT = 'Expected a function';
-
-/* Native method references for those with the same name as other `lodash` methods. */
-var nativeMin = Math.min;
-
-/**
- * Creates a function that runs each argument through a corresponding
- * transform function.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {Function} func The function to wrap.
- * @param {...(Function|Function[])} [transforms] The functions to transform
- * arguments, specified as individual functions or arrays of functions.
- * @returns {Function} Returns the new function.
- * @example
- *
- * function doubled(n) {
- * return n * 2;
- * }
- *
- * function square(n) {
- * return n * n;
- * }
- *
- * var modded = _.modArgs(function(x, y) {
- * return [x, y];
- * }, square, doubled);
- *
- * modded(1, 2);
- * // => [1, 4]
- *
- * modded(5, 10);
- * // => [25, 20]
- */
-var modArgs = restParam(function(func, transforms) {
- transforms = baseFlatten(transforms);
- if (typeof func != 'function' || !arrayEvery(transforms, baseIsFunction)) {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- var length = transforms.length;
- return restParam(function(args) {
- var index = nativeMin(args.length, length);
- while (index--) {
- args[index] = transforms[index](args[index]);
- }
- return func.apply(this, args);
- });
-});
-
-module.exports = modArgs;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/negate.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/negate.js
deleted file mode 100644
index 8247939..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/negate.js
+++ /dev/null
@@ -1,32 +0,0 @@
-/** Used as the `TypeError` message for "Functions" methods. */
-var FUNC_ERROR_TEXT = 'Expected a function';
-
-/**
- * Creates a function that negates the result of the predicate `func`. The
- * `func` predicate is invoked with the `this` binding and arguments of the
- * created function.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {Function} predicate The predicate to negate.
- * @returns {Function} Returns the new function.
- * @example
- *
- * function isEven(n) {
- * return n % 2 == 0;
- * }
- *
- * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
- * // => [1, 3, 5]
- */
-function negate(predicate) {
- if (typeof predicate != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- return function() {
- return !predicate.apply(this, arguments);
- };
-}
-
-module.exports = negate;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/once.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/once.js
deleted file mode 100644
index 0b5bd85..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/once.js
+++ /dev/null
@@ -1,24 +0,0 @@
-var before = require('./before');
-
-/**
- * Creates a function that is restricted to invoking `func` once. Repeat calls
- * to the function return the value of the first call. The `func` is invoked
- * with the `this` binding and arguments of the created function.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {Function} func The function to restrict.
- * @returns {Function} Returns the new restricted function.
- * @example
- *
- * var initialize = _.once(createApplication);
- * initialize();
- * initialize();
- * // `initialize` invokes `createApplication` once
- */
-function once(func) {
- return before(2, func);
-}
-
-module.exports = once;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/partial.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/partial.js
deleted file mode 100644
index fb1d04f..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/partial.js
+++ /dev/null
@@ -1,43 +0,0 @@
-var createPartial = require('../internal/createPartial');
-
-/** Used to compose bitmasks for wrapper metadata. */
-var PARTIAL_FLAG = 32;
-
-/**
- * Creates a function that invokes `func` with `partial` arguments prepended
- * to those provided to the new function. This method is like `_.bind` except
- * it does **not** alter the `this` binding.
- *
- * The `_.partial.placeholder` value, which defaults to `_` in monolithic
- * builds, may be used as a placeholder for partially applied arguments.
- *
- * **Note:** This method does not set the "length" property of partially
- * applied functions.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {Function} func The function to partially apply arguments to.
- * @param {...*} [partials] The arguments to be partially applied.
- * @returns {Function} Returns the new partially applied function.
- * @example
- *
- * var greet = function(greeting, name) {
- * return greeting + ' ' + name;
- * };
- *
- * var sayHelloTo = _.partial(greet, 'hello');
- * sayHelloTo('fred');
- * // => 'hello fred'
- *
- * // using placeholders
- * var greetFred = _.partial(greet, _, 'fred');
- * greetFred('hi');
- * // => 'hi fred'
- */
-var partial = createPartial(PARTIAL_FLAG);
-
-// Assign default placeholders.
-partial.placeholder = {};
-
-module.exports = partial;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/partialRight.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/partialRight.js
deleted file mode 100644
index 634e6a4..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/partialRight.js
+++ /dev/null
@@ -1,42 +0,0 @@
-var createPartial = require('../internal/createPartial');
-
-/** Used to compose bitmasks for wrapper metadata. */
-var PARTIAL_RIGHT_FLAG = 64;
-
-/**
- * This method is like `_.partial` except that partially applied arguments
- * are appended to those provided to the new function.
- *
- * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
- * builds, may be used as a placeholder for partially applied arguments.
- *
- * **Note:** This method does not set the "length" property of partially
- * applied functions.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {Function} func The function to partially apply arguments to.
- * @param {...*} [partials] The arguments to be partially applied.
- * @returns {Function} Returns the new partially applied function.
- * @example
- *
- * var greet = function(greeting, name) {
- * return greeting + ' ' + name;
- * };
- *
- * var greetFred = _.partialRight(greet, 'fred');
- * greetFred('hi');
- * // => 'hi fred'
- *
- * // using placeholders
- * var sayHelloTo = _.partialRight(greet, 'hello', _);
- * sayHelloTo('fred');
- * // => 'hello fred'
- */
-var partialRight = createPartial(PARTIAL_RIGHT_FLAG);
-
-// Assign default placeholders.
-partialRight.placeholder = {};
-
-module.exports = partialRight;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/rearg.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/rearg.js
deleted file mode 100644
index f2bd9c4..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/rearg.js
+++ /dev/null
@@ -1,40 +0,0 @@
-var baseFlatten = require('../internal/baseFlatten'),
- createWrapper = require('../internal/createWrapper'),
- restParam = require('./restParam');
-
-/** Used to compose bitmasks for wrapper metadata. */
-var REARG_FLAG = 256;
-
-/**
- * Creates a function that invokes `func` with arguments arranged according
- * to the specified indexes where the argument value at the first index is
- * provided as the first argument, the argument value at the second index is
- * provided as the second argument, and so on.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {Function} func The function to rearrange arguments for.
- * @param {...(number|number[])} indexes The arranged argument indexes,
- * specified as individual indexes or arrays of indexes.
- * @returns {Function} Returns the new function.
- * @example
- *
- * var rearged = _.rearg(function(a, b, c) {
- * return [a, b, c];
- * }, 2, 0, 1);
- *
- * rearged('b', 'c', 'a')
- * // => ['a', 'b', 'c']
- *
- * var map = _.rearg(_.map, [1, 0]);
- * map(function(n) {
- * return n * 3;
- * }, [1, 2, 3]);
- * // => [3, 6, 9]
- */
-var rearg = restParam(function(func, indexes) {
- return createWrapper(func, REARG_FLAG, undefined, undefined, undefined, baseFlatten(indexes));
-});
-
-module.exports = rearg;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/restParam.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/restParam.js
deleted file mode 100644
index 8852286..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/restParam.js
+++ /dev/null
@@ -1,58 +0,0 @@
-/** Used as the `TypeError` message for "Functions" methods. */
-var FUNC_ERROR_TEXT = 'Expected a function';
-
-/* Native method references for those with the same name as other `lodash` methods. */
-var nativeMax = Math.max;
-
-/**
- * Creates a function that invokes `func` with the `this` binding of the
- * created function and arguments from `start` and beyond provided as an array.
- *
- * **Note:** This method is based on the [rest parameter](https://developer.mozilla.org/Web/JavaScript/Reference/Functions/rest_parameters).
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {Function} func The function to apply a rest parameter to.
- * @param {number} [start=func.length-1] The start position of the rest parameter.
- * @returns {Function} Returns the new function.
- * @example
- *
- * var say = _.restParam(function(what, names) {
- * return what + ' ' + _.initial(names).join(', ') +
- * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
- * });
- *
- * say('hello', 'fred', 'barney', 'pebbles');
- * // => 'hello fred, barney, & pebbles'
- */
-function restParam(func, start) {
- if (typeof func != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0);
- return function() {
- var args = arguments,
- index = -1,
- length = nativeMax(args.length - start, 0),
- rest = Array(length);
-
- while (++index < length) {
- rest[index] = args[start + index];
- }
- switch (start) {
- case 0: return func.call(this, rest);
- case 1: return func.call(this, args[0], rest);
- case 2: return func.call(this, args[0], args[1], rest);
- }
- var otherArgs = Array(start + 1);
- index = -1;
- while (++index < start) {
- otherArgs[index] = args[index];
- }
- otherArgs[start] = rest;
- return func.apply(this, otherArgs);
- };
-}
-
-module.exports = restParam;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/spread.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/spread.js
deleted file mode 100644
index 780f504..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/spread.js
+++ /dev/null
@@ -1,44 +0,0 @@
-/** Used as the `TypeError` message for "Functions" methods. */
-var FUNC_ERROR_TEXT = 'Expected a function';
-
-/**
- * Creates a function that invokes `func` with the `this` binding of the created
- * function and an array of arguments much like [`Function#apply`](https://es5.github.io/#x15.3.4.3).
- *
- * **Note:** This method is based on the [spread operator](https://developer.mozilla.org/Web/JavaScript/Reference/Operators/Spread_operator).
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {Function} func The function to spread arguments over.
- * @returns {Function} Returns the new function.
- * @example
- *
- * var say = _.spread(function(who, what) {
- * return who + ' says ' + what;
- * });
- *
- * say(['fred', 'hello']);
- * // => 'fred says hello'
- *
- * // with a Promise
- * var numbers = Promise.all([
- * Promise.resolve(40),
- * Promise.resolve(36)
- * ]);
- *
- * numbers.then(_.spread(function(x, y) {
- * return x + y;
- * }));
- * // => a Promise of 76
- */
-function spread(func) {
- if (typeof func != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- return function(array) {
- return func.apply(this, array);
- };
-}
-
-module.exports = spread;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/throttle.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/throttle.js
deleted file mode 100644
index 1dd00ea..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/throttle.js
+++ /dev/null
@@ -1,62 +0,0 @@
-var debounce = require('./debounce'),
- isObject = require('../lang/isObject');
-
-/** Used as the `TypeError` message for "Functions" methods. */
-var FUNC_ERROR_TEXT = 'Expected a function';
-
-/**
- * Creates a throttled function that only invokes `func` at most once per
- * every `wait` milliseconds. The throttled function comes with a `cancel`
- * method to cancel delayed invocations. Provide an options object to indicate
- * that `func` should be invoked on the leading and/or trailing edge of the
- * `wait` timeout. Subsequent calls to the throttled function return the
- * result of the last `func` call.
- *
- * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked
- * on the trailing edge of the timeout only if the the throttled function is
- * invoked more than once during the `wait` timeout.
- *
- * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)
- * for details over the differences between `_.throttle` and `_.debounce`.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {Function} func The function to throttle.
- * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
- * @param {Object} [options] The options object.
- * @param {boolean} [options.leading=true] Specify invoking on the leading
- * edge of the timeout.
- * @param {boolean} [options.trailing=true] Specify invoking on the trailing
- * edge of the timeout.
- * @returns {Function} Returns the new throttled function.
- * @example
- *
- * // avoid excessively updating the position while scrolling
- * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
- *
- * // invoke `renewToken` when the click event is fired, but not more than once every 5 minutes
- * jQuery('.interactive').on('click', _.throttle(renewToken, 300000, {
- * 'trailing': false
- * }));
- *
- * // cancel a trailing throttled call
- * jQuery(window).on('popstate', throttled.cancel);
- */
-function throttle(func, wait, options) {
- var leading = true,
- trailing = true;
-
- if (typeof func != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- if (options === false) {
- leading = false;
- } else if (isObject(options)) {
- leading = 'leading' in options ? !!options.leading : leading;
- trailing = 'trailing' in options ? !!options.trailing : trailing;
- }
- return debounce(func, wait, { 'leading': leading, 'maxWait': +wait, 'trailing': trailing });
-}
-
-module.exports = throttle;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/wrap.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/wrap.js
deleted file mode 100644
index 6a33c5e..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/function/wrap.js
+++ /dev/null
@@ -1,33 +0,0 @@
-var createWrapper = require('../internal/createWrapper'),
- identity = require('../utility/identity');
-
-/** Used to compose bitmasks for wrapper metadata. */
-var PARTIAL_FLAG = 32;
-
-/**
- * Creates a function that provides `value` to the wrapper function as its
- * first argument. Any additional arguments provided to the function are
- * appended to those provided to the wrapper function. The wrapper is invoked
- * with the `this` binding of the created function.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {*} value The value to wrap.
- * @param {Function} wrapper The wrapper function.
- * @returns {Function} Returns the new function.
- * @example
- *
- * var p = _.wrap(_.escape, function(func, text) {
- * return '' + func(text) + '
';
- * });
- *
- * p('fred, barney, & pebbles');
- * // => 'fred, barney, & pebbles
'
- */
-function wrap(value, wrapper) {
- wrapper = wrapper == null ? identity : wrapper;
- return createWrapper(wrapper, PARTIAL_FLAG, undefined, [value], []);
-}
-
-module.exports = wrap;
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/index.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/index.js
deleted file mode 100644
index 5f17319..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/lodash/index.js
+++ /dev/null
@@ -1,12351 +0,0 @@
-/**
- * @license
- * lodash 3.10.1 (Custom Build)
- * Build: `lodash modern -d -o ./index.js`
- * Copyright 2012-2015 The Dojo Foundation
- * Based on Underscore.js 1.8.3
- * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
- * Available under MIT license
- */
-;(function() {
-
- /** Used as a safe reference for `undefined` in pre-ES5 environments. */
- var undefined;
-
- /** Used as the semantic version number. */
- var VERSION = '3.10.1';
-
- /** Used to compose bitmasks for wrapper metadata. */
- var BIND_FLAG = 1,
- BIND_KEY_FLAG = 2,
- CURRY_BOUND_FLAG = 4,
- CURRY_FLAG = 8,
- CURRY_RIGHT_FLAG = 16,
- PARTIAL_FLAG = 32,
- PARTIAL_RIGHT_FLAG = 64,
- ARY_FLAG = 128,
- REARG_FLAG = 256;
-
- /** Used as default options for `_.trunc`. */
- var DEFAULT_TRUNC_LENGTH = 30,
- DEFAULT_TRUNC_OMISSION = '...';
-
- /** Used to detect when a function becomes hot. */
- var HOT_COUNT = 150,
- HOT_SPAN = 16;
-
- /** Used as the size to enable large array optimizations. */
- var LARGE_ARRAY_SIZE = 200;
-
- /** Used to indicate the type of lazy iteratees. */
- var LAZY_FILTER_FLAG = 1,
- LAZY_MAP_FLAG = 2;
-
- /** Used as the `TypeError` message for "Functions" methods. */
- var FUNC_ERROR_TEXT = 'Expected a function';
-
- /** Used as the internal argument placeholder. */
- var PLACEHOLDER = '__lodash_placeholder__';
-
- /** `Object#toString` result references. */
- var argsTag = '[object Arguments]',
- arrayTag = '[object Array]',
- boolTag = '[object Boolean]',
- dateTag = '[object Date]',
- errorTag = '[object Error]',
- funcTag = '[object Function]',
- mapTag = '[object Map]',
- numberTag = '[object Number]',
- objectTag = '[object Object]',
- regexpTag = '[object RegExp]',
- setTag = '[object Set]',
- stringTag = '[object String]',
- weakMapTag = '[object WeakMap]';
-
- var arrayBufferTag = '[object ArrayBuffer]',
- float32Tag = '[object Float32Array]',
- float64Tag = '[object Float64Array]',
- int8Tag = '[object Int8Array]',
- int16Tag = '[object Int16Array]',
- int32Tag = '[object Int32Array]',
- uint8Tag = '[object Uint8Array]',
- uint8ClampedTag = '[object Uint8ClampedArray]',
- uint16Tag = '[object Uint16Array]',
- uint32Tag = '[object Uint32Array]';
-
- /** Used to match empty string literals in compiled template source. */
- var reEmptyStringLeading = /\b__p \+= '';/g,
- reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
- reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
-
- /** Used to match HTML entities and HTML characters. */
- var reEscapedHtml = /&(?:amp|lt|gt|quot|#39|#96);/g,
- reUnescapedHtml = /[&<>"'`]/g,
- reHasEscapedHtml = RegExp(reEscapedHtml.source),
- reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
-
- /** Used to match template delimiters. */
- var reEscape = /<%-([\s\S]+?)%>/g,
- reEvaluate = /<%([\s\S]+?)%>/g,
- reInterpolate = /<%=([\s\S]+?)%>/g;
-
- /** Used to match property names within property paths. */
- var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,
- reIsPlainProp = /^\w*$/,
- rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g;
-
- /**
- * Used to match `RegExp` [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns)
- * and those outlined by [`EscapeRegExpPattern`](http://ecma-international.org/ecma-262/6.0/#sec-escaperegexppattern).
- */
- var reRegExpChars = /^[:!,]|[\\^$.*+?()[\]{}|\/]|(^[0-9a-fA-Fnrtuvx])|([\n\r\u2028\u2029])/g,
- reHasRegExpChars = RegExp(reRegExpChars.source);
-
- /** Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). */
- var reComboMark = /[\u0300-\u036f\ufe20-\ufe23]/g;
-
- /** Used to match backslashes in property paths. */
- var reEscapeChar = /\\(\\)?/g;
-
- /** Used to match [ES template delimiters](http://ecma-international.org/ecma-262/6.0/#sec-template-literal-lexical-components). */
- var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
-
- /** Used to match `RegExp` flags from their coerced string values. */
- var reFlags = /\w*$/;
-
- /** Used to detect hexadecimal string values. */
- var reHasHexPrefix = /^0[xX]/;
-
- /** Used to detect host constructors (Safari > 5). */
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
-
- /** Used to detect unsigned integer values. */
- var reIsUint = /^\d+$/;
-
- /** Used to match latin-1 supplementary letters (excluding mathematical operators). */
- var reLatin1 = /[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g;
-
- /** Used to ensure capturing order of template delimiters. */
- var reNoMatch = /($^)/;
-
- /** Used to match unescaped characters in compiled string literals. */
- var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
-
- /** Used to match words to create compound words. */
- var reWords = (function() {
- var upper = '[A-Z\\xc0-\\xd6\\xd8-\\xde]',
- lower = '[a-z\\xdf-\\xf6\\xf8-\\xff]+';
-
- return RegExp(upper + '+(?=' + upper + lower + ')|' + upper + '?' + lower + '|' + upper + '+|[0-9]+', 'g');
- }());
-
- /** Used to assign default `context` object properties. */
- var contextProps = [
- 'Array', 'ArrayBuffer', 'Date', 'Error', 'Float32Array', 'Float64Array',
- 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Math', 'Number',
- 'Object', 'RegExp', 'Set', 'String', '_', 'clearTimeout', 'isFinite',
- 'parseFloat', 'parseInt', 'setTimeout', 'TypeError', 'Uint8Array',
- 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap'
- ];
-
- /** Used to make template sourceURLs easier to identify. */
- var templateCounter = -1;
-
- /** Used to identify `toStringTag` values of typed arrays. */
- var typedArrayTags = {};
- typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
- typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
- typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
- typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
- typedArrayTags[uint32Tag] = true;
- typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
- typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
- typedArrayTags[dateTag] = typedArrayTags[errorTag] =
- typedArrayTags[funcTag] = typedArrayTags[mapTag] =
- typedArrayTags[numberTag] = typedArrayTags[objectTag] =
- typedArrayTags[regexpTag] = typedArrayTags[setTag] =
- typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
-
- /** Used to identify `toStringTag` values supported by `_.clone`. */
- var cloneableTags = {};
- cloneableTags[argsTag] = cloneableTags[arrayTag] =
- cloneableTags[arrayBufferTag] = cloneableTags[boolTag] =
- cloneableTags[dateTag] = cloneableTags[float32Tag] =
- cloneableTags[float64Tag] = cloneableTags[int8Tag] =
- cloneableTags[int16Tag] = cloneableTags[int32Tag] =
- cloneableTags[numberTag] = cloneableTags[objectTag] =
- cloneableTags[regexpTag] = cloneableTags[stringTag] =
- cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
- cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
- cloneableTags[errorTag] = cloneableTags[funcTag] =
- cloneableTags[mapTag] = cloneableTags[setTag] =
- cloneableTags[weakMapTag] = false;
-
- /** Used to map latin-1 supplementary letters to basic latin letters. */
- var deburredLetters = {
- '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
- '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
- '\xc7': 'C', '\xe7': 'c',
- '\xd0': 'D', '\xf0': 'd',
- '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
- '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
- '\xcC': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
- '\xeC': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
- '\xd1': 'N', '\xf1': 'n',
- '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
- '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
- '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
- '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
- '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
- '\xc6': 'Ae', '\xe6': 'ae',
- '\xde': 'Th', '\xfe': 'th',
- '\xdf': 'ss'
- };
-
- /** Used to map characters to HTML entities. */
- var htmlEscapes = {
- '&': '&',
- '<': '<',
- '>': '>',
- '"': '"',
- "'": ''',
- '`': '`'
- };
-
- /** Used to map HTML entities to characters. */
- var htmlUnescapes = {
- '&': '&',
- '<': '<',
- '>': '>',
- '"': '"',
- ''': "'",
- '`': '`'
- };
-
- /** Used to determine if values are of the language type `Object`. */
- var objectTypes = {
- 'function': true,
- 'object': true
- };
-
- /** Used to escape characters for inclusion in compiled regexes. */
- var regexpEscapes = {
- '0': 'x30', '1': 'x31', '2': 'x32', '3': 'x33', '4': 'x34',
- '5': 'x35', '6': 'x36', '7': 'x37', '8': 'x38', '9': 'x39',
- 'A': 'x41', 'B': 'x42', 'C': 'x43', 'D': 'x44', 'E': 'x45', 'F': 'x46',
- 'a': 'x61', 'b': 'x62', 'c': 'x63', 'd': 'x64', 'e': 'x65', 'f': 'x66',
- 'n': 'x6e', 'r': 'x72', 't': 'x74', 'u': 'x75', 'v': 'x76', 'x': 'x78'
- };
-
- /** Used to escape characters for inclusion in compiled string literals. */
- var stringEscapes = {
- '\\': '\\',
- "'": "'",
- '\n': 'n',
- '\r': 'r',
- '\u2028': 'u2028',
- '\u2029': 'u2029'
- };
-
- /** Detect free variable `exports`. */
- var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports;
-
- /** Detect free variable `module`. */
- var freeModule = objectTypes[typeof module] && module && !module.nodeType && module;
-
- /** Detect free variable `global` from Node.js. */
- var freeGlobal = freeExports && freeModule && typeof global == 'object' && global && global.Object && global;
-
- /** Detect free variable `self`. */
- var freeSelf = objectTypes[typeof self] && self && self.Object && self;
-
- /** Detect free variable `window`. */
- var freeWindow = objectTypes[typeof window] && window && window.Object && window;
-
- /** Detect the popular CommonJS extension `module.exports`. */
- var moduleExports = freeModule && freeModule.exports === freeExports && freeExports;
-
- /**
- * Used as a reference to the global object.
- *
- * The `this` value is used if it's the global object to avoid Greasemonkey's
- * restricted `window` object, otherwise the `window` object is used.
- */
- var root = freeGlobal || ((freeWindow !== (this && this.window)) && freeWindow) || freeSelf || this;
-
- /*--------------------------------------------------------------------------*/
-
- /**
- * The base implementation of `compareAscending` which compares values and
- * sorts them in ascending order without guaranteeing a stable sort.
- *
- * @private
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @returns {number} Returns the sort order indicator for `value`.
- */
- function baseCompareAscending(value, other) {
- if (value !== other) {
- var valIsNull = value === null,
- valIsUndef = value === undefined,
- valIsReflexive = value === value;
-
- var othIsNull = other === null,
- othIsUndef = other === undefined,
- othIsReflexive = other === other;
-
- if ((value > other && !othIsNull) || !valIsReflexive ||
- (valIsNull && !othIsUndef && othIsReflexive) ||
- (valIsUndef && othIsReflexive)) {
- return 1;
- }
- if ((value < other && !valIsNull) || !othIsReflexive ||
- (othIsNull && !valIsUndef && valIsReflexive) ||
- (othIsUndef && valIsReflexive)) {
- return -1;
- }
- }
- return 0;
- }
-
- /**
- * The base implementation of `_.findIndex` and `_.findLastIndex` without
- * support for callback shorthands and `this` binding.
- *
- * @private
- * @param {Array} array The array to search.
- * @param {Function} predicate The function invoked per iteration.
- * @param {boolean} [fromRight] Specify iterating from right to left.
- * @returns {number} Returns the index of the matched value, else `-1`.
- */
- function baseFindIndex(array, predicate, fromRight) {
- var length = array.length,
- index = fromRight ? length : -1;
-
- while ((fromRight ? index-- : ++index < length)) {
- if (predicate(array[index], index, array)) {
- return index;
- }
- }
- return -1;
- }
-
- /**
- * The base implementation of `_.indexOf` without support for binary searches.
- *
- * @private
- * @param {Array} array The array to search.
- * @param {*} value The value to search for.
- * @param {number} fromIndex The index to search from.
- * @returns {number} Returns the index of the matched value, else `-1`.
- */
- function baseIndexOf(array, value, fromIndex) {
- if (value !== value) {
- return indexOfNaN(array, fromIndex);
- }
- var index = fromIndex - 1,
- length = array.length;
-
- while (++index < length) {
- if (array[index] === value) {
- return index;
- }
- }
- return -1;
- }
-
- /**
- * The base implementation of `_.isFunction` without support for environments
- * with incorrect `typeof` results.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
- */
- function baseIsFunction(value) {
- // Avoid a Chakra JIT bug in compatibility modes of IE 11.
- // See https://github.com/jashkenas/underscore/issues/1621 for more details.
- return typeof value == 'function' || false;
- }
-
- /**
- * Converts `value` to a string if it's not one. An empty string is returned
- * for `null` or `undefined` values.
- *
- * @private
- * @param {*} value The value to process.
- * @returns {string} Returns the string.
- */
- function baseToString(value) {
- return value == null ? '' : (value + '');
- }
-
- /**
- * Used by `_.trim` and `_.trimLeft` to get the index of the first character
- * of `string` that is not found in `chars`.
- *
- * @private
- * @param {string} string The string to inspect.
- * @param {string} chars The characters to find.
- * @returns {number} Returns the index of the first character not found in `chars`.
- */
- function charsLeftIndex(string, chars) {
- var index = -1,
- length = string.length;
-
- while (++index < length && chars.indexOf(string.charAt(index)) > -1) {}
- return index;
- }
-
- /**
- * Used by `_.trim` and `_.trimRight` to get the index of the last character
- * of `string` that is not found in `chars`.
- *
- * @private
- * @param {string} string The string to inspect.
- * @param {string} chars The characters to find.
- * @returns {number} Returns the index of the last character not found in `chars`.
- */
- function charsRightIndex(string, chars) {
- var index = string.length;
-
- while (index-- && chars.indexOf(string.charAt(index)) > -1) {}
- return index;
- }
-
- /**
- * Used by `_.sortBy` to compare transformed elements of a collection and stable
- * sort them in ascending order.
- *
- * @private
- * @param {Object} object The object to compare.
- * @param {Object} other The other object to compare.
- * @returns {number} Returns the sort order indicator for `object`.
- */
- function compareAscending(object, other) {
- return baseCompareAscending(object.criteria, other.criteria) || (object.index - other.index);
- }
-
- /**
- * Used by `_.sortByOrder` to compare multiple properties of a value to another
- * and stable sort them.
- *
- * If `orders` is unspecified, all valuess are sorted in ascending order. Otherwise,
- * a value is sorted in ascending order if its corresponding order is "asc", and
- * descending if "desc".
- *
- * @private
- * @param {Object} object The object to compare.
- * @param {Object} other The other object to compare.
- * @param {boolean[]} orders The order to sort by for each property.
- * @returns {number} Returns the sort order indicator for `object`.
- */
- function compareMultiple(object, other, orders) {
- var index = -1,
- objCriteria = object.criteria,
- othCriteria = other.criteria,
- length = objCriteria.length,
- ordersLength = orders.length;
-
- while (++index < length) {
- var result = baseCompareAscending(objCriteria[index], othCriteria[index]);
- if (result) {
- if (index >= ordersLength) {
- return result;
- }
- var order = orders[index];
- return result * ((order === 'asc' || order === true) ? 1 : -1);
- }
- }
- // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
- // that causes it, under certain circumstances, to provide the same value for
- // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
- // for more details.
- //
- // This also ensures a stable sort in V8 and other engines.
- // See https://code.google.com/p/v8/issues/detail?id=90 for more details.
- return object.index - other.index;
- }
-
- /**
- * Used by `_.deburr` to convert latin-1 supplementary letters to basic latin letters.
- *
- * @private
- * @param {string} letter The matched letter to deburr.
- * @returns {string} Returns the deburred letter.
- */
- function deburrLetter(letter) {
- return deburredLetters[letter];
- }
-
- /**
- * Used by `_.escape` to convert characters to HTML entities.
- *
- * @private
- * @param {string} chr The matched character to escape.
- * @returns {string} Returns the escaped character.
- */
- function escapeHtmlChar(chr) {
- return htmlEscapes[chr];
- }
-
- /**
- * Used by `_.escapeRegExp` to escape characters for inclusion in compiled regexes.
- *
- * @private
- * @param {string} chr The matched character to escape.
- * @param {string} leadingChar The capture group for a leading character.
- * @param {string} whitespaceChar The capture group for a whitespace character.
- * @returns {string} Returns the escaped character.
- */
- function escapeRegExpChar(chr, leadingChar, whitespaceChar) {
- if (leadingChar) {
- chr = regexpEscapes[chr];
- } else if (whitespaceChar) {
- chr = stringEscapes[chr];
- }
- return '\\' + chr;
- }
-
- /**
- * Used by `_.template` to escape characters for inclusion in compiled string literals.
- *
- * @private
- * @param {string} chr The matched character to escape.
- * @returns {string} Returns the escaped character.
- */
- function escapeStringChar(chr) {
- return '\\' + stringEscapes[chr];
- }
-
- /**
- * Gets the index at which the first occurrence of `NaN` is found in `array`.
- *
- * @private
- * @param {Array} array The array to search.
- * @param {number} fromIndex The index to search from.
- * @param {boolean} [fromRight] Specify iterating from right to left.
- * @returns {number} Returns the index of the matched `NaN`, else `-1`.
- */
- function indexOfNaN(array, fromIndex, fromRight) {
- var length = array.length,
- index = fromIndex + (fromRight ? 0 : -1);
-
- while ((fromRight ? index-- : ++index < length)) {
- var other = array[index];
- if (other !== other) {
- return index;
- }
- }
- return -1;
- }
-
- /**
- * Checks if `value` is object-like.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
- */
- function isObjectLike(value) {
- return !!value && typeof value == 'object';
- }
-
- /**
- * Used by `trimmedLeftIndex` and `trimmedRightIndex` to determine if a
- * character code is whitespace.
- *
- * @private
- * @param {number} charCode The character code to inspect.
- * @returns {boolean} Returns `true` if `charCode` is whitespace, else `false`.
- */
- function isSpace(charCode) {
- return ((charCode <= 160 && (charCode >= 9 && charCode <= 13) || charCode == 32 || charCode == 160) || charCode == 5760 || charCode == 6158 ||
- (charCode >= 8192 && (charCode <= 8202 || charCode == 8232 || charCode == 8233 || charCode == 8239 || charCode == 8287 || charCode == 12288 || charCode == 65279)));
- }
-
- /**
- * Replaces all `placeholder` elements in `array` with an internal placeholder
- * and returns an array of their indexes.
- *
- * @private
- * @param {Array} array The array to modify.
- * @param {*} placeholder The placeholder to replace.
- * @returns {Array} Returns the new array of placeholder indexes.
- */
- function replaceHolders(array, placeholder) {
- var index = -1,
- length = array.length,
- resIndex = -1,
- result = [];
-
- while (++index < length) {
- if (array[index] === placeholder) {
- array[index] = PLACEHOLDER;
- result[++resIndex] = index;
- }
- }
- return result;
- }
-
- /**
- * An implementation of `_.uniq` optimized for sorted arrays without support
- * for callback shorthands and `this` binding.
- *
- * @private
- * @param {Array} array The array to inspect.
- * @param {Function} [iteratee] The function invoked per iteration.
- * @returns {Array} Returns the new duplicate-value-free array.
- */
- function sortedUniq(array, iteratee) {
- var seen,
- index = -1,
- length = array.length,
- resIndex = -1,
- result = [];
-
- while (++index < length) {
- var value = array[index],
- computed = iteratee ? iteratee(value, index, array) : value;
-
- if (!index || seen !== computed) {
- seen = computed;
- result[++resIndex] = value;
- }
- }
- return result;
- }
-
- /**
- * Used by `_.trim` and `_.trimLeft` to get the index of the first non-whitespace
- * character of `string`.
- *
- * @private
- * @param {string} string The string to inspect.
- * @returns {number} Returns the index of the first non-whitespace character.
- */
- function trimmedLeftIndex(string) {
- var index = -1,
- length = string.length;
-
- while (++index < length && isSpace(string.charCodeAt(index))) {}
- return index;
- }
-
- /**
- * Used by `_.trim` and `_.trimRight` to get the index of the last non-whitespace
- * character of `string`.
- *
- * @private
- * @param {string} string The string to inspect.
- * @returns {number} Returns the index of the last non-whitespace character.
- */
- function trimmedRightIndex(string) {
- var index = string.length;
-
- while (index-- && isSpace(string.charCodeAt(index))) {}
- return index;
- }
-
- /**
- * Used by `_.unescape` to convert HTML entities to characters.
- *
- * @private
- * @param {string} chr The matched character to unescape.
- * @returns {string} Returns the unescaped character.
- */
- function unescapeHtmlChar(chr) {
- return htmlUnescapes[chr];
- }
-
- /*--------------------------------------------------------------------------*/
-
- /**
- * Create a new pristine `lodash` function using the given `context` object.
- *
- * @static
- * @memberOf _
- * @category Utility
- * @param {Object} [context=root] The context object.
- * @returns {Function} Returns a new `lodash` function.
- * @example
- *
- * _.mixin({ 'foo': _.constant('foo') });
- *
- * var lodash = _.runInContext();
- * lodash.mixin({ 'bar': lodash.constant('bar') });
- *
- * _.isFunction(_.foo);
- * // => true
- * _.isFunction(_.bar);
- * // => false
- *
- * lodash.isFunction(lodash.foo);
- * // => false
- * lodash.isFunction(lodash.bar);
- * // => true
- *
- * // using `context` to mock `Date#getTime` use in `_.now`
- * var mock = _.runInContext({
- * 'Date': function() {
- * return { 'getTime': getTimeMock };
- * }
- * });
- *
- * // or creating a suped-up `defer` in Node.js
- * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
- */
- function runInContext(context) {
- // Avoid issues with some ES3 environments that attempt to use values, named
- // after built-in constructors like `Object`, for the creation of literals.
- // ES5 clears this up by stating that literals must use built-in constructors.
- // See https://es5.github.io/#x11.1.5 for more details.
- context = context ? _.defaults(root.Object(), context, _.pick(root, contextProps)) : root;
-
- /** Native constructor references. */
- var Array = context.Array,
- Date = context.Date,
- Error = context.Error,
- Function = context.Function,
- Math = context.Math,
- Number = context.Number,
- Object = context.Object,
- RegExp = context.RegExp,
- String = context.String,
- TypeError = context.TypeError;
-
- /** Used for native method references. */
- var arrayProto = Array.prototype,
- objectProto = Object.prototype,
- stringProto = String.prototype;
-
- /** Used to resolve the decompiled source of functions. */
- var fnToString = Function.prototype.toString;
-
- /** Used to check objects for own properties. */
- var hasOwnProperty = objectProto.hasOwnProperty;
-
- /** Used to generate unique IDs. */
- var idCounter = 0;
-
- /**
- * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
- * of values.
- */
- var objToString = objectProto.toString;
-
- /** Used to restore the original `_` reference in `_.noConflict`. */
- var oldDash = root._;
-
- /** Used to detect if a method is native. */
- var reIsNative = RegExp('^' +
- fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&')
- .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
- );
-
- /** Native method references. */
- var ArrayBuffer = context.ArrayBuffer,
- clearTimeout = context.clearTimeout,
- parseFloat = context.parseFloat,
- pow = Math.pow,
- propertyIsEnumerable = objectProto.propertyIsEnumerable,
- Set = getNative(context, 'Set'),
- setTimeout = context.setTimeout,
- splice = arrayProto.splice,
- Uint8Array = context.Uint8Array,
- WeakMap = getNative(context, 'WeakMap');
-
- /* Native method references for those with the same name as other `lodash` methods. */
- var nativeCeil = Math.ceil,
- nativeCreate = getNative(Object, 'create'),
- nativeFloor = Math.floor,
- nativeIsArray = getNative(Array, 'isArray'),
- nativeIsFinite = context.isFinite,
- nativeKeys = getNative(Object, 'keys'),
- nativeMax = Math.max,
- nativeMin = Math.min,
- nativeNow = getNative(Date, 'now'),
- nativeParseInt = context.parseInt,
- nativeRandom = Math.random;
-
- /** Used as references for `-Infinity` and `Infinity`. */
- var NEGATIVE_INFINITY = Number.NEGATIVE_INFINITY,
- POSITIVE_INFINITY = Number.POSITIVE_INFINITY;
-
- /** Used as references for the maximum length and index of an array. */
- var MAX_ARRAY_LENGTH = 4294967295,
- MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
- HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
-
- /**
- * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)
- * of an array-like value.
- */
- var MAX_SAFE_INTEGER = 9007199254740991;
-
- /** Used to store function metadata. */
- var metaMap = WeakMap && new WeakMap;
-
- /** Used to lookup unminified function names. */
- var realNames = {};
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Creates a `lodash` object which wraps `value` to enable implicit chaining.
- * Methods that operate on and return arrays, collections, and functions can
- * be chained together. Methods that retrieve a single value or may return a
- * primitive value will automatically end the chain returning the unwrapped
- * value. Explicit chaining may be enabled using `_.chain`. The execution of
- * chained methods is lazy, that is, execution is deferred until `_#value`
- * is implicitly or explicitly called.
- *
- * Lazy evaluation allows several methods to support shortcut fusion. Shortcut
- * fusion is an optimization strategy which merge iteratee calls; this can help
- * to avoid the creation of intermediate data structures and greatly reduce the
- * number of iteratee executions.
- *
- * Chaining is supported in custom builds as long as the `_#value` method is
- * directly or indirectly included in the build.
- *
- * In addition to lodash methods, wrappers have `Array` and `String` methods.
- *
- * The wrapper `Array` methods are:
- * `concat`, `join`, `pop`, `push`, `reverse`, `shift`, `slice`, `sort`,
- * `splice`, and `unshift`
- *
- * The wrapper `String` methods are:
- * `replace` and `split`
- *
- * The wrapper methods that support shortcut fusion are:
- * `compact`, `drop`, `dropRight`, `dropRightWhile`, `dropWhile`, `filter`,
- * `first`, `initial`, `last`, `map`, `pluck`, `reject`, `rest`, `reverse`,
- * `slice`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, `toArray`,
- * and `where`
- *
- * The chainable wrapper methods are:
- * `after`, `ary`, `assign`, `at`, `before`, `bind`, `bindAll`, `bindKey`,
- * `callback`, `chain`, `chunk`, `commit`, `compact`, `concat`, `constant`,
- * `countBy`, `create`, `curry`, `debounce`, `defaults`, `defaultsDeep`,
- * `defer`, `delay`, `difference`, `drop`, `dropRight`, `dropRightWhile`,
- * `dropWhile`, `fill`, `filter`, `flatten`, `flattenDeep`, `flow`, `flowRight`,
- * `forEach`, `forEachRight`, `forIn`, `forInRight`, `forOwn`, `forOwnRight`,
- * `functions`, `groupBy`, `indexBy`, `initial`, `intersection`, `invert`,
- * `invoke`, `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`,
- * `matchesProperty`, `memoize`, `merge`, `method`, `methodOf`, `mixin`,
- * `modArgs`, `negate`, `omit`, `once`, `pairs`, `partial`, `partialRight`,
- * `partition`, `pick`, `plant`, `pluck`, `property`, `propertyOf`, `pull`,
- * `pullAt`, `push`, `range`, `rearg`, `reject`, `remove`, `rest`, `restParam`,
- * `reverse`, `set`, `shuffle`, `slice`, `sort`, `sortBy`, `sortByAll`,
- * `sortByOrder`, `splice`, `spread`, `take`, `takeRight`, `takeRightWhile`,
- * `takeWhile`, `tap`, `throttle`, `thru`, `times`, `toArray`, `toPlainObject`,
- * `transform`, `union`, `uniq`, `unshift`, `unzip`, `unzipWith`, `values`,
- * `valuesIn`, `where`, `without`, `wrap`, `xor`, `zip`, `zipObject`, `zipWith`
- *
- * The wrapper methods that are **not** chainable by default are:
- * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clone`, `cloneDeep`,
- * `deburr`, `endsWith`, `escape`, `escapeRegExp`, `every`, `find`, `findIndex`,
- * `findKey`, `findLast`, `findLastIndex`, `findLastKey`, `findWhere`, `first`,
- * `floor`, `get`, `gt`, `gte`, `has`, `identity`, `includes`, `indexOf`,
- * `inRange`, `isArguments`, `isArray`, `isBoolean`, `isDate`, `isElement`,
- * `isEmpty`, `isEqual`, `isError`, `isFinite` `isFunction`, `isMatch`,
- * `isNative`, `isNaN`, `isNull`, `isNumber`, `isObject`, `isPlainObject`,
- * `isRegExp`, `isString`, `isUndefined`, `isTypedArray`, `join`, `kebabCase`,
- * `last`, `lastIndexOf`, `lt`, `lte`, `max`, `min`, `noConflict`, `noop`,
- * `now`, `pad`, `padLeft`, `padRight`, `parseInt`, `pop`, `random`, `reduce`,
- * `reduceRight`, `repeat`, `result`, `round`, `runInContext`, `shift`, `size`,
- * `snakeCase`, `some`, `sortedIndex`, `sortedLastIndex`, `startCase`,
- * `startsWith`, `sum`, `template`, `trim`, `trimLeft`, `trimRight`, `trunc`,
- * `unescape`, `uniqueId`, `value`, and `words`
- *
- * The wrapper method `sample` will return a wrapped value when `n` is provided,
- * otherwise an unwrapped value is returned.
- *
- * @name _
- * @constructor
- * @category Chain
- * @param {*} value The value to wrap in a `lodash` instance.
- * @returns {Object} Returns the new `lodash` wrapper instance.
- * @example
- *
- * var wrapped = _([1, 2, 3]);
- *
- * // returns an unwrapped value
- * wrapped.reduce(function(total, n) {
- * return total + n;
- * });
- * // => 6
- *
- * // returns a wrapped value
- * var squares = wrapped.map(function(n) {
- * return n * n;
- * });
- *
- * _.isArray(squares);
- * // => false
- *
- * _.isArray(squares.value());
- * // => true
- */
- function lodash(value) {
- if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
- if (value instanceof LodashWrapper) {
- return value;
- }
- if (hasOwnProperty.call(value, '__chain__') && hasOwnProperty.call(value, '__wrapped__')) {
- return wrapperClone(value);
- }
- }
- return new LodashWrapper(value);
- }
-
- /**
- * The function whose prototype all chaining wrappers inherit from.
- *
- * @private
- */
- function baseLodash() {
- // No operation performed.
- }
-
- /**
- * The base constructor for creating `lodash` wrapper objects.
- *
- * @private
- * @param {*} value The value to wrap.
- * @param {boolean} [chainAll] Enable chaining for all wrapper methods.
- * @param {Array} [actions=[]] Actions to peform to resolve the unwrapped value.
- */
- function LodashWrapper(value, chainAll, actions) {
- this.__wrapped__ = value;
- this.__actions__ = actions || [];
- this.__chain__ = !!chainAll;
- }
-
- /**
- * An object environment feature flags.
- *
- * @static
- * @memberOf _
- * @type Object
- */
- var support = lodash.support = {};
-
- /**
- * By default, the template delimiters used by lodash are like those in
- * embedded Ruby (ERB). Change the following template settings to use
- * alternative delimiters.
- *
- * @static
- * @memberOf _
- * @type Object
- */
- lodash.templateSettings = {
-
- /**
- * Used to detect `data` property values to be HTML-escaped.
- *
- * @memberOf _.templateSettings
- * @type RegExp
- */
- 'escape': reEscape,
-
- /**
- * Used to detect code to be evaluated.
- *
- * @memberOf _.templateSettings
- * @type RegExp
- */
- 'evaluate': reEvaluate,
-
- /**
- * Used to detect `data` property values to inject.
- *
- * @memberOf _.templateSettings
- * @type RegExp
- */
- 'interpolate': reInterpolate,
-
- /**
- * Used to reference the data object in the template text.
- *
- * @memberOf _.templateSettings
- * @type string
- */
- 'variable': '',
-
- /**
- * Used to import variables into the compiled template.
- *
- * @memberOf _.templateSettings
- * @type Object
- */
- 'imports': {
-
- /**
- * A reference to the `lodash` function.
- *
- * @memberOf _.templateSettings.imports
- * @type Function
- */
- '_': lodash
- }
- };
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
- *
- * @private
- * @param {*} value The value to wrap.
- */
- function LazyWrapper(value) {
- this.__wrapped__ = value;
- this.__actions__ = [];
- this.__dir__ = 1;
- this.__filtered__ = false;
- this.__iteratees__ = [];
- this.__takeCount__ = POSITIVE_INFINITY;
- this.__views__ = [];
- }
-
- /**
- * Creates a clone of the lazy wrapper object.
- *
- * @private
- * @name clone
- * @memberOf LazyWrapper
- * @returns {Object} Returns the cloned `LazyWrapper` object.
- */
- function lazyClone() {
- var result = new LazyWrapper(this.__wrapped__);
- result.__actions__ = arrayCopy(this.__actions__);
- result.__dir__ = this.__dir__;
- result.__filtered__ = this.__filtered__;
- result.__iteratees__ = arrayCopy(this.__iteratees__);
- result.__takeCount__ = this.__takeCount__;
- result.__views__ = arrayCopy(this.__views__);
- return result;
- }
-
- /**
- * Reverses the direction of lazy iteration.
- *
- * @private
- * @name reverse
- * @memberOf LazyWrapper
- * @returns {Object} Returns the new reversed `LazyWrapper` object.
- */
- function lazyReverse() {
- if (this.__filtered__) {
- var result = new LazyWrapper(this);
- result.__dir__ = -1;
- result.__filtered__ = true;
- } else {
- result = this.clone();
- result.__dir__ *= -1;
- }
- return result;
- }
-
- /**
- * Extracts the unwrapped value from its lazy wrapper.
- *
- * @private
- * @name value
- * @memberOf LazyWrapper
- * @returns {*} Returns the unwrapped value.
- */
- function lazyValue() {
- var array = this.__wrapped__.value(),
- dir = this.__dir__,
- isArr = isArray(array),
- isRight = dir < 0,
- arrLength = isArr ? array.length : 0,
- view = getView(0, arrLength, this.__views__),
- start = view.start,
- end = view.end,
- length = end - start,
- index = isRight ? end : (start - 1),
- iteratees = this.__iteratees__,
- iterLength = iteratees.length,
- resIndex = 0,
- takeCount = nativeMin(length, this.__takeCount__);
-
- if (!isArr || arrLength < LARGE_ARRAY_SIZE || (arrLength == length && takeCount == length)) {
- return baseWrapperValue((isRight && isArr) ? array.reverse() : array, this.__actions__);
- }
- var result = [];
-
- outer:
- while (length-- && resIndex < takeCount) {
- index += dir;
-
- var iterIndex = -1,
- value = array[index];
-
- while (++iterIndex < iterLength) {
- var data = iteratees[iterIndex],
- iteratee = data.iteratee,
- type = data.type,
- computed = iteratee(value);
-
- if (type == LAZY_MAP_FLAG) {
- value = computed;
- } else if (!computed) {
- if (type == LAZY_FILTER_FLAG) {
- continue outer;
- } else {
- break outer;
- }
- }
- }
- result[resIndex++] = value;
- }
- return result;
- }
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Creates a cache object to store key/value pairs.
- *
- * @private
- * @static
- * @name Cache
- * @memberOf _.memoize
- */
- function MapCache() {
- this.__data__ = {};
- }
-
- /**
- * Removes `key` and its value from the cache.
- *
- * @private
- * @name delete
- * @memberOf _.memoize.Cache
- * @param {string} key The key of the value to remove.
- * @returns {boolean} Returns `true` if the entry was removed successfully, else `false`.
- */
- function mapDelete(key) {
- return this.has(key) && delete this.__data__[key];
- }
-
- /**
- * Gets the cached value for `key`.
- *
- * @private
- * @name get
- * @memberOf _.memoize.Cache
- * @param {string} key The key of the value to get.
- * @returns {*} Returns the cached value.
- */
- function mapGet(key) {
- return key == '__proto__' ? undefined : this.__data__[key];
- }
-
- /**
- * Checks if a cached value for `key` exists.
- *
- * @private
- * @name has
- * @memberOf _.memoize.Cache
- * @param {string} key The key of the entry to check.
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
- */
- function mapHas(key) {
- return key != '__proto__' && hasOwnProperty.call(this.__data__, key);
- }
-
- /**
- * Sets `value` to `key` of the cache.
- *
- * @private
- * @name set
- * @memberOf _.memoize.Cache
- * @param {string} key The key of the value to cache.
- * @param {*} value The value to cache.
- * @returns {Object} Returns the cache object.
- */
- function mapSet(key, value) {
- if (key != '__proto__') {
- this.__data__[key] = value;
- }
- return this;
- }
-
- /*------------------------------------------------------------------------*/
-
- /**
- *
- * Creates a cache object to store unique values.
- *
- * @private
- * @param {Array} [values] The values to cache.
- */
- function SetCache(values) {
- var length = values ? values.length : 0;
-
- this.data = { 'hash': nativeCreate(null), 'set': new Set };
- while (length--) {
- this.push(values[length]);
- }
- }
-
- /**
- * Checks if `value` is in `cache` mimicking the return signature of
- * `_.indexOf` by returning `0` if the value is found, else `-1`.
- *
- * @private
- * @param {Object} cache The cache to search.
- * @param {*} value The value to search for.
- * @returns {number} Returns `0` if `value` is found, else `-1`.
- */
- function cacheIndexOf(cache, value) {
- var data = cache.data,
- result = (typeof value == 'string' || isObject(value)) ? data.set.has(value) : data.hash[value];
-
- return result ? 0 : -1;
- }
-
- /**
- * Adds `value` to the cache.
- *
- * @private
- * @name push
- * @memberOf SetCache
- * @param {*} value The value to cache.
- */
- function cachePush(value) {
- var data = this.data;
- if (typeof value == 'string' || isObject(value)) {
- data.set.add(value);
- } else {
- data.hash[value] = true;
- }
- }
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Creates a new array joining `array` with `other`.
- *
- * @private
- * @param {Array} array The array to join.
- * @param {Array} other The other array to join.
- * @returns {Array} Returns the new concatenated array.
- */
- function arrayConcat(array, other) {
- var index = -1,
- length = array.length,
- othIndex = -1,
- othLength = other.length,
- result = Array(length + othLength);
-
- while (++index < length) {
- result[index] = array[index];
- }
- while (++othIndex < othLength) {
- result[index++] = other[othIndex];
- }
- return result;
- }
-
- /**
- * Copies the values of `source` to `array`.
- *
- * @private
- * @param {Array} source The array to copy values from.
- * @param {Array} [array=[]] The array to copy values to.
- * @returns {Array} Returns `array`.
- */
- function arrayCopy(source, array) {
- var index = -1,
- length = source.length;
-
- array || (array = Array(length));
- while (++index < length) {
- array[index] = source[index];
- }
- return array;
- }
-
- /**
- * A specialized version of `_.forEach` for arrays without support for callback
- * shorthands and `this` binding.
- *
- * @private
- * @param {Array} array The array to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Array} Returns `array`.
- */
- function arrayEach(array, iteratee) {
- var index = -1,
- length = array.length;
-
- while (++index < length) {
- if (iteratee(array[index], index, array) === false) {
- break;
- }
- }
- return array;
- }
-
- /**
- * A specialized version of `_.forEachRight` for arrays without support for
- * callback shorthands and `this` binding.
- *
- * @private
- * @param {Array} array The array to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Array} Returns `array`.
- */
- function arrayEachRight(array, iteratee) {
- var length = array.length;
-
- while (length--) {
- if (iteratee(array[length], length, array) === false) {
- break;
- }
- }
- return array;
- }
-
- /**
- * A specialized version of `_.every` for arrays without support for callback
- * shorthands and `this` binding.
- *
- * @private
- * @param {Array} array The array to iterate over.
- * @param {Function} predicate The function invoked per iteration.
- * @returns {boolean} Returns `true` if all elements pass the predicate check,
- * else `false`.
- */
- function arrayEvery(array, predicate) {
- var index = -1,
- length = array.length;
-
- while (++index < length) {
- if (!predicate(array[index], index, array)) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * A specialized version of `baseExtremum` for arrays which invokes `iteratee`
- * with one argument: (value).
- *
- * @private
- * @param {Array} array The array to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @param {Function} comparator The function used to compare values.
- * @param {*} exValue The initial extremum value.
- * @returns {*} Returns the extremum value.
- */
- function arrayExtremum(array, iteratee, comparator, exValue) {
- var index = -1,
- length = array.length,
- computed = exValue,
- result = computed;
-
- while (++index < length) {
- var value = array[index],
- current = +iteratee(value);
-
- if (comparator(current, computed)) {
- computed = current;
- result = value;
- }
- }
- return result;
- }
-
- /**
- * A specialized version of `_.filter` for arrays without support for callback
- * shorthands and `this` binding.
- *
- * @private
- * @param {Array} array The array to iterate over.
- * @param {Function} predicate The function invoked per iteration.
- * @returns {Array} Returns the new filtered array.
- */
- function arrayFilter(array, predicate) {
- var index = -1,
- length = array.length,
- resIndex = -1,
- result = [];
-
- while (++index < length) {
- var value = array[index];
- if (predicate(value, index, array)) {
- result[++resIndex] = value;
- }
- }
- return result;
- }
-
- /**
- * A specialized version of `_.map` for arrays without support for callback
- * shorthands and `this` binding.
- *
- * @private
- * @param {Array} array The array to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Array} Returns the new mapped array.
- */
- function arrayMap(array, iteratee) {
- var index = -1,
- length = array.length,
- result = Array(length);
-
- while (++index < length) {
- result[index] = iteratee(array[index], index, array);
- }
- return result;
- }
-
- /**
- * Appends the elements of `values` to `array`.
- *
- * @private
- * @param {Array} array The array to modify.
- * @param {Array} values The values to append.
- * @returns {Array} Returns `array`.
- */
- function arrayPush(array, values) {
- var index = -1,
- length = values.length,
- offset = array.length;
-
- while (++index < length) {
- array[offset + index] = values[index];
- }
- return array;
- }
-
- /**
- * A specialized version of `_.reduce` for arrays without support for callback
- * shorthands and `this` binding.
- *
- * @private
- * @param {Array} array The array to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @param {*} [accumulator] The initial value.
- * @param {boolean} [initFromArray] Specify using the first element of `array`
- * as the initial value.
- * @returns {*} Returns the accumulated value.
- */
- function arrayReduce(array, iteratee, accumulator, initFromArray) {
- var index = -1,
- length = array.length;
-
- if (initFromArray && length) {
- accumulator = array[++index];
- }
- while (++index < length) {
- accumulator = iteratee(accumulator, array[index], index, array);
- }
- return accumulator;
- }
-
- /**
- * A specialized version of `_.reduceRight` for arrays without support for
- * callback shorthands and `this` binding.
- *
- * @private
- * @param {Array} array The array to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @param {*} [accumulator] The initial value.
- * @param {boolean} [initFromArray] Specify using the last element of `array`
- * as the initial value.
- * @returns {*} Returns the accumulated value.
- */
- function arrayReduceRight(array, iteratee, accumulator, initFromArray) {
- var length = array.length;
- if (initFromArray && length) {
- accumulator = array[--length];
- }
- while (length--) {
- accumulator = iteratee(accumulator, array[length], length, array);
- }
- return accumulator;
- }
-
- /**
- * A specialized version of `_.some` for arrays without support for callback
- * shorthands and `this` binding.
- *
- * @private
- * @param {Array} array The array to iterate over.
- * @param {Function} predicate The function invoked per iteration.
- * @returns {boolean} Returns `true` if any element passes the predicate check,
- * else `false`.
- */
- function arraySome(array, predicate) {
- var index = -1,
- length = array.length;
-
- while (++index < length) {
- if (predicate(array[index], index, array)) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * A specialized version of `_.sum` for arrays without support for callback
- * shorthands and `this` binding..
- *
- * @private
- * @param {Array} array The array to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {number} Returns the sum.
- */
- function arraySum(array, iteratee) {
- var length = array.length,
- result = 0;
-
- while (length--) {
- result += +iteratee(array[length]) || 0;
- }
- return result;
- }
-
- /**
- * Used by `_.defaults` to customize its `_.assign` use.
- *
- * @private
- * @param {*} objectValue The destination object property value.
- * @param {*} sourceValue The source object property value.
- * @returns {*} Returns the value to assign to the destination object.
- */
- function assignDefaults(objectValue, sourceValue) {
- return objectValue === undefined ? sourceValue : objectValue;
- }
-
- /**
- * Used by `_.template` to customize its `_.assign` use.
- *
- * **Note:** This function is like `assignDefaults` except that it ignores
- * inherited property values when checking if a property is `undefined`.
- *
- * @private
- * @param {*} objectValue The destination object property value.
- * @param {*} sourceValue The source object property value.
- * @param {string} key The key associated with the object and source values.
- * @param {Object} object The destination object.
- * @returns {*} Returns the value to assign to the destination object.
- */
- function assignOwnDefaults(objectValue, sourceValue, key, object) {
- return (objectValue === undefined || !hasOwnProperty.call(object, key))
- ? sourceValue
- : objectValue;
- }
-
- /**
- * A specialized version of `_.assign` for customizing assigned values without
- * support for argument juggling, multiple sources, and `this` binding `customizer`
- * functions.
- *
- * @private
- * @param {Object} object The destination object.
- * @param {Object} source The source object.
- * @param {Function} customizer The function to customize assigned values.
- * @returns {Object} Returns `object`.
- */
- function assignWith(object, source, customizer) {
- var index = -1,
- props = keys(source),
- length = props.length;
-
- while (++index < length) {
- var key = props[index],
- value = object[key],
- result = customizer(value, source[key], key, object, source);
-
- if ((result === result ? (result !== value) : (value === value)) ||
- (value === undefined && !(key in object))) {
- object[key] = result;
- }
- }
- return object;
- }
-
- /**
- * The base implementation of `_.assign` without support for argument juggling,
- * multiple sources, and `customizer` functions.
- *
- * @private
- * @param {Object} object The destination object.
- * @param {Object} source The source object.
- * @returns {Object} Returns `object`.
- */
- function baseAssign(object, source) {
- return source == null
- ? object
- : baseCopy(source, keys(source), object);
- }
-
- /**
- * The base implementation of `_.at` without support for string collections
- * and individual key arguments.
- *
- * @private
- * @param {Array|Object} collection The collection to iterate over.
- * @param {number[]|string[]} props The property names or indexes of elements to pick.
- * @returns {Array} Returns the new array of picked elements.
- */
- function baseAt(collection, props) {
- var index = -1,
- isNil = collection == null,
- isArr = !isNil && isArrayLike(collection),
- length = isArr ? collection.length : 0,
- propsLength = props.length,
- result = Array(propsLength);
-
- while(++index < propsLength) {
- var key = props[index];
- if (isArr) {
- result[index] = isIndex(key, length) ? collection[key] : undefined;
- } else {
- result[index] = isNil ? undefined : collection[key];
- }
- }
- return result;
- }
-
- /**
- * Copies properties of `source` to `object`.
- *
- * @private
- * @param {Object} source The object to copy properties from.
- * @param {Array} props The property names to copy.
- * @param {Object} [object={}] The object to copy properties to.
- * @returns {Object} Returns `object`.
- */
- function baseCopy(source, props, object) {
- object || (object = {});
-
- var index = -1,
- length = props.length;
-
- while (++index < length) {
- var key = props[index];
- object[key] = source[key];
- }
- return object;
- }
-
- /**
- * The base implementation of `_.callback` which supports specifying the
- * number of arguments to provide to `func`.
- *
- * @private
- * @param {*} [func=_.identity] The value to convert to a callback.
- * @param {*} [thisArg] The `this` binding of `func`.
- * @param {number} [argCount] The number of arguments to provide to `func`.
- * @returns {Function} Returns the callback.
- */
- function baseCallback(func, thisArg, argCount) {
- var type = typeof func;
- if (type == 'function') {
- return thisArg === undefined
- ? func
- : bindCallback(func, thisArg, argCount);
- }
- if (func == null) {
- return identity;
- }
- if (type == 'object') {
- return baseMatches(func);
- }
- return thisArg === undefined
- ? property(func)
- : baseMatchesProperty(func, thisArg);
- }
-
- /**
- * The base implementation of `_.clone` without support for argument juggling
- * and `this` binding `customizer` functions.
- *
- * @private
- * @param {*} value The value to clone.
- * @param {boolean} [isDeep] Specify a deep clone.
- * @param {Function} [customizer] The function to customize cloning values.
- * @param {string} [key] The key of `value`.
- * @param {Object} [object] The object `value` belongs to.
- * @param {Array} [stackA=[]] Tracks traversed source objects.
- * @param {Array} [stackB=[]] Associates clones with source counterparts.
- * @returns {*} Returns the cloned value.
- */
- function baseClone(value, isDeep, customizer, key, object, stackA, stackB) {
- var result;
- if (customizer) {
- result = object ? customizer(value, key, object) : customizer(value);
- }
- if (result !== undefined) {
- return result;
- }
- if (!isObject(value)) {
- return value;
- }
- var isArr = isArray(value);
- if (isArr) {
- result = initCloneArray(value);
- if (!isDeep) {
- return arrayCopy(value, result);
- }
- } else {
- var tag = objToString.call(value),
- isFunc = tag == funcTag;
-
- if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
- result = initCloneObject(isFunc ? {} : value);
- if (!isDeep) {
- return baseAssign(result, value);
- }
- } else {
- return cloneableTags[tag]
- ? initCloneByTag(value, tag, isDeep)
- : (object ? value : {});
- }
- }
- // Check for circular references and return its corresponding clone.
- stackA || (stackA = []);
- stackB || (stackB = []);
-
- var length = stackA.length;
- while (length--) {
- if (stackA[length] == value) {
- return stackB[length];
- }
- }
- // Add the source value to the stack of traversed objects and associate it with its clone.
- stackA.push(value);
- stackB.push(result);
-
- // Recursively populate clone (susceptible to call stack limits).
- (isArr ? arrayEach : baseForOwn)(value, function(subValue, key) {
- result[key] = baseClone(subValue, isDeep, customizer, key, value, stackA, stackB);
- });
- return result;
- }
-
- /**
- * The base implementation of `_.create` without support for assigning
- * properties to the created object.
- *
- * @private
- * @param {Object} prototype The object to inherit from.
- * @returns {Object} Returns the new object.
- */
- var baseCreate = (function() {
- function object() {}
- return function(prototype) {
- if (isObject(prototype)) {
- object.prototype = prototype;
- var result = new object;
- object.prototype = undefined;
- }
- return result || {};
- };
- }());
-
- /**
- * The base implementation of `_.delay` and `_.defer` which accepts an index
- * of where to slice the arguments to provide to `func`.
- *
- * @private
- * @param {Function} func The function to delay.
- * @param {number} wait The number of milliseconds to delay invocation.
- * @param {Object} args The arguments provide to `func`.
- * @returns {number} Returns the timer id.
- */
- function baseDelay(func, wait, args) {
- if (typeof func != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- return setTimeout(function() { func.apply(undefined, args); }, wait);
- }
-
- /**
- * The base implementation of `_.difference` which accepts a single array
- * of values to exclude.
- *
- * @private
- * @param {Array} array The array to inspect.
- * @param {Array} values The values to exclude.
- * @returns {Array} Returns the new array of filtered values.
- */
- function baseDifference(array, values) {
- var length = array ? array.length : 0,
- result = [];
-
- if (!length) {
- return result;
- }
- var index = -1,
- indexOf = getIndexOf(),
- isCommon = indexOf == baseIndexOf,
- cache = (isCommon && values.length >= LARGE_ARRAY_SIZE) ? createCache(values) : null,
- valuesLength = values.length;
-
- if (cache) {
- indexOf = cacheIndexOf;
- isCommon = false;
- values = cache;
- }
- outer:
- while (++index < length) {
- var value = array[index];
-
- if (isCommon && value === value) {
- var valuesIndex = valuesLength;
- while (valuesIndex--) {
- if (values[valuesIndex] === value) {
- continue outer;
- }
- }
- result.push(value);
- }
- else if (indexOf(values, value, 0) < 0) {
- result.push(value);
- }
- }
- return result;
- }
-
- /**
- * The base implementation of `_.forEach` without support for callback
- * shorthands and `this` binding.
- *
- * @private
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Array|Object|string} Returns `collection`.
- */
- var baseEach = createBaseEach(baseForOwn);
-
- /**
- * The base implementation of `_.forEachRight` without support for callback
- * shorthands and `this` binding.
- *
- * @private
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Array|Object|string} Returns `collection`.
- */
- var baseEachRight = createBaseEach(baseForOwnRight, true);
-
- /**
- * The base implementation of `_.every` without support for callback
- * shorthands and `this` binding.
- *
- * @private
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function} predicate The function invoked per iteration.
- * @returns {boolean} Returns `true` if all elements pass the predicate check,
- * else `false`
- */
- function baseEvery(collection, predicate) {
- var result = true;
- baseEach(collection, function(value, index, collection) {
- result = !!predicate(value, index, collection);
- return result;
- });
- return result;
- }
-
- /**
- * Gets the extremum value of `collection` invoking `iteratee` for each value
- * in `collection` to generate the criterion by which the value is ranked.
- * The `iteratee` is invoked with three arguments: (value, index|key, collection).
- *
- * @private
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @param {Function} comparator The function used to compare values.
- * @param {*} exValue The initial extremum value.
- * @returns {*} Returns the extremum value.
- */
- function baseExtremum(collection, iteratee, comparator, exValue) {
- var computed = exValue,
- result = computed;
-
- baseEach(collection, function(value, index, collection) {
- var current = +iteratee(value, index, collection);
- if (comparator(current, computed) || (current === exValue && current === result)) {
- computed = current;
- result = value;
- }
- });
- return result;
- }
-
- /**
- * The base implementation of `_.fill` without an iteratee call guard.
- *
- * @private
- * @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`.
- */
- function baseFill(array, value, start, end) {
- var length = array.length;
-
- start = start == null ? 0 : (+start || 0);
- if (start < 0) {
- start = -start > length ? 0 : (length + start);
- }
- end = (end === undefined || end > length) ? length : (+end || 0);
- if (end < 0) {
- end += length;
- }
- length = start > end ? 0 : (end >>> 0);
- start >>>= 0;
-
- while (start < length) {
- array[start++] = value;
- }
- return array;
- }
-
- /**
- * The base implementation of `_.filter` without support for callback
- * shorthands and `this` binding.
- *
- * @private
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function} predicate The function invoked per iteration.
- * @returns {Array} Returns the new filtered array.
- */
- function baseFilter(collection, predicate) {
- var result = [];
- baseEach(collection, function(value, index, collection) {
- if (predicate(value, index, collection)) {
- result.push(value);
- }
- });
- return result;
- }
-
- /**
- * The base implementation of `_.find`, `_.findLast`, `_.findKey`, and `_.findLastKey`,
- * without support for callback shorthands and `this` binding, which iterates
- * over `collection` using the provided `eachFunc`.
- *
- * @private
- * @param {Array|Object|string} collection The collection to search.
- * @param {Function} predicate The function invoked per iteration.
- * @param {Function} eachFunc The function to iterate over `collection`.
- * @param {boolean} [retKey] Specify returning the key of the found element
- * instead of the element itself.
- * @returns {*} Returns the found element or its key, else `undefined`.
- */
- function baseFind(collection, predicate, eachFunc, retKey) {
- var result;
- eachFunc(collection, function(value, key, collection) {
- if (predicate(value, key, collection)) {
- result = retKey ? key : value;
- return false;
- }
- });
- return result;
- }
-
- /**
- * The base implementation of `_.flatten` with added support for restricting
- * flattening and specifying the start index.
- *
- * @private
- * @param {Array} array The array to flatten.
- * @param {boolean} [isDeep] Specify a deep flatten.
- * @param {boolean} [isStrict] Restrict flattening to arrays-like objects.
- * @param {Array} [result=[]] The initial result value.
- * @returns {Array} Returns the new flattened array.
- */
- function baseFlatten(array, isDeep, isStrict, result) {
- result || (result = []);
-
- var index = -1,
- length = array.length;
-
- while (++index < length) {
- var value = array[index];
- if (isObjectLike(value) && isArrayLike(value) &&
- (isStrict || isArray(value) || isArguments(value))) {
- if (isDeep) {
- // Recursively flatten arrays (susceptible to call stack limits).
- baseFlatten(value, isDeep, isStrict, result);
- } else {
- arrayPush(result, value);
- }
- } else if (!isStrict) {
- result[result.length] = value;
- }
- }
- return result;
- }
-
- /**
- * The base implementation of `baseForIn` and `baseForOwn` which iterates
- * over `object` properties returned by `keysFunc` invoking `iteratee` for
- * each property. Iteratee functions may exit iteration early by explicitly
- * returning `false`.
- *
- * @private
- * @param {Object} object The object to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @param {Function} keysFunc The function to get the keys of `object`.
- * @returns {Object} Returns `object`.
- */
- var baseFor = createBaseFor();
-
- /**
- * This function is like `baseFor` except that it iterates over properties
- * in the opposite order.
- *
- * @private
- * @param {Object} object The object to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @param {Function} keysFunc The function to get the keys of `object`.
- * @returns {Object} Returns `object`.
- */
- var baseForRight = createBaseFor(true);
-
- /**
- * The base implementation of `_.forIn` without support for callback
- * shorthands and `this` binding.
- *
- * @private
- * @param {Object} object The object to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Object} Returns `object`.
- */
- function baseForIn(object, iteratee) {
- return baseFor(object, iteratee, keysIn);
- }
-
- /**
- * The base implementation of `_.forOwn` without support for callback
- * shorthands and `this` binding.
- *
- * @private
- * @param {Object} object The object to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Object} Returns `object`.
- */
- function baseForOwn(object, iteratee) {
- return baseFor(object, iteratee, keys);
- }
-
- /**
- * The base implementation of `_.forOwnRight` without support for callback
- * shorthands and `this` binding.
- *
- * @private
- * @param {Object} object The object to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Object} Returns `object`.
- */
- function baseForOwnRight(object, iteratee) {
- return baseForRight(object, iteratee, keys);
- }
-
- /**
- * The base implementation of `_.functions` which creates an array of
- * `object` function property names filtered from those provided.
- *
- * @private
- * @param {Object} object The object to inspect.
- * @param {Array} props The property names to filter.
- * @returns {Array} Returns the new array of filtered property names.
- */
- function baseFunctions(object, props) {
- var index = -1,
- length = props.length,
- resIndex = -1,
- result = [];
-
- while (++index < length) {
- var key = props[index];
- if (isFunction(object[key])) {
- result[++resIndex] = key;
- }
- }
- return result;
- }
-
- /**
- * The base implementation of `get` without support for string paths
- * and default values.
- *
- * @private
- * @param {Object} object The object to query.
- * @param {Array} path The path of the property to get.
- * @param {string} [pathKey] The key representation of path.
- * @returns {*} Returns the resolved value.
- */
- function baseGet(object, path, pathKey) {
- if (object == null) {
- return;
- }
- if (pathKey !== undefined && pathKey in toObject(object)) {
- path = [pathKey];
- }
- var index = 0,
- length = path.length;
-
- while (object != null && index < length) {
- object = object[path[index++]];
- }
- return (index && index == length) ? object : undefined;
- }
-
- /**
- * The base implementation of `_.isEqual` without support for `this` binding
- * `customizer` functions.
- *
- * @private
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @param {Function} [customizer] The function to customize comparing values.
- * @param {boolean} [isLoose] Specify performing partial comparisons.
- * @param {Array} [stackA] Tracks traversed `value` objects.
- * @param {Array} [stackB] Tracks traversed `other` objects.
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
- */
- function baseIsEqual(value, other, customizer, isLoose, stackA, stackB) {
- if (value === other) {
- return true;
- }
- if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) {
- return value !== value && other !== other;
- }
- return baseIsEqualDeep(value, other, baseIsEqual, customizer, isLoose, stackA, stackB);
- }
-
- /**
- * A specialized version of `baseIsEqual` for arrays and objects which performs
- * deep comparisons and tracks traversed objects enabling objects with circular
- * references to be compared.
- *
- * @private
- * @param {Object} object The object to compare.
- * @param {Object} other The other object to compare.
- * @param {Function} equalFunc The function to determine equivalents of values.
- * @param {Function} [customizer] The function to customize comparing objects.
- * @param {boolean} [isLoose] Specify performing partial comparisons.
- * @param {Array} [stackA=[]] Tracks traversed `value` objects.
- * @param {Array} [stackB=[]] Tracks traversed `other` objects.
- * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
- */
- function baseIsEqualDeep(object, other, equalFunc, customizer, isLoose, stackA, stackB) {
- var objIsArr = isArray(object),
- othIsArr = isArray(other),
- objTag = arrayTag,
- othTag = arrayTag;
-
- if (!objIsArr) {
- objTag = objToString.call(object);
- if (objTag == argsTag) {
- objTag = objectTag;
- } else if (objTag != objectTag) {
- objIsArr = isTypedArray(object);
- }
- }
- if (!othIsArr) {
- othTag = objToString.call(other);
- if (othTag == argsTag) {
- othTag = objectTag;
- } else if (othTag != objectTag) {
- othIsArr = isTypedArray(other);
- }
- }
- var objIsObj = objTag == objectTag,
- othIsObj = othTag == objectTag,
- isSameTag = objTag == othTag;
-
- if (isSameTag && !(objIsArr || objIsObj)) {
- return equalByTag(object, other, objTag);
- }
- if (!isLoose) {
- var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
- othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
-
- if (objIsWrapped || othIsWrapped) {
- return equalFunc(objIsWrapped ? object.value() : object, othIsWrapped ? other.value() : other, customizer, isLoose, stackA, stackB);
- }
- }
- if (!isSameTag) {
- return false;
- }
- // Assume cyclic values are equal.
- // For more information on detecting circular references see https://es5.github.io/#JO.
- stackA || (stackA = []);
- stackB || (stackB = []);
-
- var length = stackA.length;
- while (length--) {
- if (stackA[length] == object) {
- return stackB[length] == other;
- }
- }
- // Add `object` and `other` to the stack of traversed objects.
- stackA.push(object);
- stackB.push(other);
-
- var result = (objIsArr ? equalArrays : equalObjects)(object, other, equalFunc, customizer, isLoose, stackA, stackB);
-
- stackA.pop();
- stackB.pop();
-
- return result;
- }
-
- /**
- * The base implementation of `_.isMatch` without support for callback
- * shorthands and `this` binding.
- *
- * @private
- * @param {Object} object The object to inspect.
- * @param {Array} matchData The propery names, values, and compare flags to match.
- * @param {Function} [customizer] The function to customize comparing objects.
- * @returns {boolean} Returns `true` if `object` is a match, else `false`.
- */
- function baseIsMatch(object, matchData, customizer) {
- var index = matchData.length,
- length = index,
- noCustomizer = !customizer;
-
- if (object == null) {
- return !length;
- }
- object = toObject(object);
- while (index--) {
- var data = matchData[index];
- if ((noCustomizer && data[2])
- ? data[1] !== object[data[0]]
- : !(data[0] in object)
- ) {
- return false;
- }
- }
- while (++index < length) {
- data = matchData[index];
- var key = data[0],
- objValue = object[key],
- srcValue = data[1];
-
- if (noCustomizer && data[2]) {
- if (objValue === undefined && !(key in object)) {
- return false;
- }
- } else {
- var result = customizer ? customizer(objValue, srcValue, key) : undefined;
- if (!(result === undefined ? baseIsEqual(srcValue, objValue, customizer, true) : result)) {
- return false;
- }
- }
- }
- return true;
- }
-
- /**
- * The base implementation of `_.map` without support for callback shorthands
- * and `this` binding.
- *
- * @private
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Array} Returns the new mapped array.
- */
- function baseMap(collection, iteratee) {
- var index = -1,
- result = isArrayLike(collection) ? Array(collection.length) : [];
-
- baseEach(collection, function(value, key, collection) {
- result[++index] = iteratee(value, key, collection);
- });
- return result;
- }
-
- /**
- * The base implementation of `_.matches` which does not clone `source`.
- *
- * @private
- * @param {Object} source The object of property values to match.
- * @returns {Function} Returns the new function.
- */
- function baseMatches(source) {
- var matchData = getMatchData(source);
- if (matchData.length == 1 && matchData[0][2]) {
- var key = matchData[0][0],
- value = matchData[0][1];
-
- return function(object) {
- if (object == null) {
- return false;
- }
- return object[key] === value && (value !== undefined || (key in toObject(object)));
- };
- }
- return function(object) {
- return baseIsMatch(object, matchData);
- };
- }
-
- /**
- * The base implementation of `_.matchesProperty` which does not clone `srcValue`.
- *
- * @private
- * @param {string} path The path of the property to get.
- * @param {*} srcValue The value to compare.
- * @returns {Function} Returns the new function.
- */
- function baseMatchesProperty(path, srcValue) {
- var isArr = isArray(path),
- isCommon = isKey(path) && isStrictComparable(srcValue),
- pathKey = (path + '');
-
- path = toPath(path);
- return function(object) {
- if (object == null) {
- return false;
- }
- var key = pathKey;
- object = toObject(object);
- if ((isArr || !isCommon) && !(key in object)) {
- object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
- if (object == null) {
- return false;
- }
- key = last(path);
- object = toObject(object);
- }
- return object[key] === srcValue
- ? (srcValue !== undefined || (key in object))
- : baseIsEqual(srcValue, object[key], undefined, true);
- };
- }
-
- /**
- * The base implementation of `_.merge` without support for argument juggling,
- * multiple sources, and `this` binding `customizer` functions.
- *
- * @private
- * @param {Object} object The destination object.
- * @param {Object} source The source object.
- * @param {Function} [customizer] The function to customize merged values.
- * @param {Array} [stackA=[]] Tracks traversed source objects.
- * @param {Array} [stackB=[]] Associates values with source counterparts.
- * @returns {Object} Returns `object`.
- */
- function baseMerge(object, source, customizer, stackA, stackB) {
- if (!isObject(object)) {
- return object;
- }
- var isSrcArr = isArrayLike(source) && (isArray(source) || isTypedArray(source)),
- props = isSrcArr ? undefined : keys(source);
-
- arrayEach(props || source, function(srcValue, key) {
- if (props) {
- key = srcValue;
- srcValue = source[key];
- }
- if (isObjectLike(srcValue)) {
- stackA || (stackA = []);
- stackB || (stackB = []);
- baseMergeDeep(object, source, key, baseMerge, customizer, stackA, stackB);
- }
- else {
- var value = object[key],
- result = customizer ? customizer(value, srcValue, key, object, source) : undefined,
- isCommon = result === undefined;
-
- if (isCommon) {
- result = srcValue;
- }
- if ((result !== undefined || (isSrcArr && !(key in object))) &&
- (isCommon || (result === result ? (result !== value) : (value === value)))) {
- object[key] = result;
- }
- }
- });
- return object;
- }
-
- /**
- * A specialized version of `baseMerge` for arrays and objects which performs
- * deep merges and tracks traversed objects enabling objects with circular
- * references to be merged.
- *
- * @private
- * @param {Object} object The destination object.
- * @param {Object} source The source object.
- * @param {string} key The key of the value to merge.
- * @param {Function} mergeFunc The function to merge values.
- * @param {Function} [customizer] The function to customize merged values.
- * @param {Array} [stackA=[]] Tracks traversed source objects.
- * @param {Array} [stackB=[]] Associates values with source counterparts.
- * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
- */
- function baseMergeDeep(object, source, key, mergeFunc, customizer, stackA, stackB) {
- var length = stackA.length,
- srcValue = source[key];
-
- while (length--) {
- if (stackA[length] == srcValue) {
- object[key] = stackB[length];
- return;
- }
- }
- var value = object[key],
- result = customizer ? customizer(value, srcValue, key, object, source) : undefined,
- isCommon = result === undefined;
-
- if (isCommon) {
- result = srcValue;
- if (isArrayLike(srcValue) && (isArray(srcValue) || isTypedArray(srcValue))) {
- result = isArray(value)
- ? value
- : (isArrayLike(value) ? arrayCopy(value) : []);
- }
- else if (isPlainObject(srcValue) || isArguments(srcValue)) {
- result = isArguments(value)
- ? toPlainObject(value)
- : (isPlainObject(value) ? value : {});
- }
- else {
- isCommon = false;
- }
- }
- // Add the source value to the stack of traversed objects and associate
- // it with its merged value.
- stackA.push(srcValue);
- stackB.push(result);
-
- if (isCommon) {
- // Recursively merge objects and arrays (susceptible to call stack limits).
- object[key] = mergeFunc(result, srcValue, customizer, stackA, stackB);
- } else if (result === result ? (result !== value) : (value === value)) {
- object[key] = result;
- }
- }
-
- /**
- * The base implementation of `_.property` without support for deep paths.
- *
- * @private
- * @param {string} key The key of the property to get.
- * @returns {Function} Returns the new function.
- */
- function baseProperty(key) {
- return function(object) {
- return object == null ? undefined : object[key];
- };
- }
-
- /**
- * A specialized version of `baseProperty` which supports deep paths.
- *
- * @private
- * @param {Array|string} path The path of the property to get.
- * @returns {Function} Returns the new function.
- */
- function basePropertyDeep(path) {
- var pathKey = (path + '');
- path = toPath(path);
- return function(object) {
- return baseGet(object, path, pathKey);
- };
- }
-
- /**
- * The base implementation of `_.pullAt` without support for individual
- * index arguments and capturing the removed elements.
- *
- * @private
- * @param {Array} array The array to modify.
- * @param {number[]} indexes The indexes of elements to remove.
- * @returns {Array} Returns `array`.
- */
- function basePullAt(array, indexes) {
- var length = array ? indexes.length : 0;
- while (length--) {
- var index = indexes[length];
- if (index != previous && isIndex(index)) {
- var previous = index;
- splice.call(array, index, 1);
- }
- }
- return array;
- }
-
- /**
- * The base implementation of `_.random` without support for argument juggling
- * and returning floating-point numbers.
- *
- * @private
- * @param {number} min The minimum possible value.
- * @param {number} max The maximum possible value.
- * @returns {number} Returns the random number.
- */
- function baseRandom(min, max) {
- return min + nativeFloor(nativeRandom() * (max - min + 1));
- }
-
- /**
- * The base implementation of `_.reduce` and `_.reduceRight` without support
- * for callback shorthands and `this` binding, which iterates over `collection`
- * using the provided `eachFunc`.
- *
- * @private
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @param {*} accumulator The initial value.
- * @param {boolean} initFromCollection Specify using the first or last element
- * of `collection` as the initial value.
- * @param {Function} eachFunc The function to iterate over `collection`.
- * @returns {*} Returns the accumulated value.
- */
- function baseReduce(collection, iteratee, accumulator, initFromCollection, eachFunc) {
- eachFunc(collection, function(value, index, collection) {
- accumulator = initFromCollection
- ? (initFromCollection = false, value)
- : iteratee(accumulator, value, index, collection);
- });
- return accumulator;
- }
-
- /**
- * The base implementation of `setData` without support for hot loop detection.
- *
- * @private
- * @param {Function} func The function to associate metadata with.
- * @param {*} data The metadata.
- * @returns {Function} Returns `func`.
- */
- var baseSetData = !metaMap ? identity : function(func, data) {
- metaMap.set(func, data);
- return func;
- };
-
- /**
- * The base implementation of `_.slice` without an iteratee call guard.
- *
- * @private
- * @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 baseSlice(array, start, end) {
- var index = -1,
- length = array.length;
-
- start = start == null ? 0 : (+start || 0);
- if (start < 0) {
- start = -start > length ? 0 : (length + start);
- }
- end = (end === undefined || end > length) ? length : (+end || 0);
- if (end < 0) {
- end += length;
- }
- length = start > end ? 0 : ((end - start) >>> 0);
- start >>>= 0;
-
- var result = Array(length);
- while (++index < length) {
- result[index] = array[index + start];
- }
- return result;
- }
-
- /**
- * The base implementation of `_.some` without support for callback shorthands
- * and `this` binding.
- *
- * @private
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function} predicate The function invoked per iteration.
- * @returns {boolean} Returns `true` if any element passes the predicate check,
- * else `false`.
- */
- function baseSome(collection, predicate) {
- var result;
-
- baseEach(collection, function(value, index, collection) {
- result = predicate(value, index, collection);
- return !result;
- });
- return !!result;
- }
-
- /**
- * The base implementation of `_.sortBy` which uses `comparer` to define
- * the sort order of `array` and replaces criteria objects with their
- * corresponding values.
- *
- * @private
- * @param {Array} array The array to sort.
- * @param {Function} comparer The function to define sort order.
- * @returns {Array} Returns `array`.
- */
- function baseSortBy(array, comparer) {
- var length = array.length;
-
- array.sort(comparer);
- while (length--) {
- array[length] = array[length].value;
- }
- return array;
- }
-
- /**
- * The base implementation of `_.sortByOrder` without param guards.
- *
- * @private
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
- * @param {boolean[]} orders The sort orders of `iteratees`.
- * @returns {Array} Returns the new sorted array.
- */
- function baseSortByOrder(collection, iteratees, orders) {
- var callback = getCallback(),
- index = -1;
-
- iteratees = arrayMap(iteratees, function(iteratee) { return callback(iteratee); });
-
- var result = baseMap(collection, function(value) {
- var criteria = arrayMap(iteratees, function(iteratee) { return iteratee(value); });
- return { 'criteria': criteria, 'index': ++index, 'value': value };
- });
-
- return baseSortBy(result, function(object, other) {
- return compareMultiple(object, other, orders);
- });
- }
-
- /**
- * The base implementation of `_.sum` without support for callback shorthands
- * and `this` binding.
- *
- * @private
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {number} Returns the sum.
- */
- function baseSum(collection, iteratee) {
- var result = 0;
- baseEach(collection, function(value, index, collection) {
- result += +iteratee(value, index, collection) || 0;
- });
- return result;
- }
-
- /**
- * The base implementation of `_.uniq` without support for callback shorthands
- * and `this` binding.
- *
- * @private
- * @param {Array} array The array to inspect.
- * @param {Function} [iteratee] The function invoked per iteration.
- * @returns {Array} Returns the new duplicate-value-free array.
- */
- function baseUniq(array, iteratee) {
- var index = -1,
- indexOf = getIndexOf(),
- length = array.length,
- isCommon = indexOf == baseIndexOf,
- isLarge = isCommon && length >= LARGE_ARRAY_SIZE,
- seen = isLarge ? createCache() : null,
- result = [];
-
- if (seen) {
- indexOf = cacheIndexOf;
- isCommon = false;
- } else {
- isLarge = false;
- seen = iteratee ? [] : result;
- }
- outer:
- while (++index < length) {
- var value = array[index],
- computed = iteratee ? iteratee(value, index, array) : value;
-
- if (isCommon && value === value) {
- var seenIndex = seen.length;
- while (seenIndex--) {
- if (seen[seenIndex] === computed) {
- continue outer;
- }
- }
- if (iteratee) {
- seen.push(computed);
- }
- result.push(value);
- }
- else if (indexOf(seen, computed, 0) < 0) {
- if (iteratee || isLarge) {
- seen.push(computed);
- }
- result.push(value);
- }
- }
- return result;
- }
-
- /**
- * The base implementation of `_.values` and `_.valuesIn` which creates an
- * array of `object` property values corresponding to the property names
- * of `props`.
- *
- * @private
- * @param {Object} object The object to query.
- * @param {Array} props The property names to get values for.
- * @returns {Object} Returns the array of property values.
- */
- function baseValues(object, props) {
- var index = -1,
- length = props.length,
- result = Array(length);
-
- while (++index < length) {
- result[index] = object[props[index]];
- }
- return result;
- }
-
- /**
- * The base implementation of `_.dropRightWhile`, `_.dropWhile`, `_.takeRightWhile`,
- * and `_.takeWhile` without support for callback shorthands and `this` binding.
- *
- * @private
- * @param {Array} array The array to query.
- * @param {Function} predicate The function invoked per iteration.
- * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
- * @param {boolean} [fromRight] Specify iterating from right to left.
- * @returns {Array} Returns the slice of `array`.
- */
- function baseWhile(array, predicate, isDrop, fromRight) {
- var length = array.length,
- index = fromRight ? length : -1;
-
- while ((fromRight ? index-- : ++index < length) && predicate(array[index], index, array)) {}
- return isDrop
- ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
- : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
- }
-
- /**
- * The base implementation of `wrapperValue` which returns the result of
- * performing a sequence of actions on the unwrapped `value`, where each
- * successive action is supplied the return value of the previous.
- *
- * @private
- * @param {*} value The unwrapped value.
- * @param {Array} actions Actions to peform to resolve the unwrapped value.
- * @returns {*} Returns the resolved value.
- */
- function baseWrapperValue(value, actions) {
- var result = value;
- if (result instanceof LazyWrapper) {
- result = result.value();
- }
- var index = -1,
- length = actions.length;
-
- while (++index < length) {
- var action = actions[index];
- result = action.func.apply(action.thisArg, arrayPush([result], action.args));
- }
- return result;
- }
-
- /**
- * Performs a binary search of `array` to determine the index at which `value`
- * should be inserted into `array` in order to maintain its sort order.
- *
- * @private
- * @param {Array} array The sorted array to inspect.
- * @param {*} value The value to evaluate.
- * @param {boolean} [retHighest] Specify returning the highest qualified index.
- * @returns {number} Returns the index at which `value` should be inserted
- * into `array`.
- */
- function binaryIndex(array, value, retHighest) {
- var low = 0,
- high = array ? array.length : low;
-
- if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
- while (low < high) {
- var mid = (low + high) >>> 1,
- computed = array[mid];
-
- if ((retHighest ? (computed <= value) : (computed < value)) && computed !== null) {
- low = mid + 1;
- } else {
- high = mid;
- }
- }
- return high;
- }
- return binaryIndexBy(array, value, identity, retHighest);
- }
-
- /**
- * This function is like `binaryIndex` except that it invokes `iteratee` for
- * `value` and each element of `array` to compute their sort ranking. The
- * iteratee is invoked with one argument; (value).
- *
- * @private
- * @param {Array} array The sorted array to inspect.
- * @param {*} value The value to evaluate.
- * @param {Function} iteratee The function invoked per iteration.
- * @param {boolean} [retHighest] Specify returning the highest qualified index.
- * @returns {number} Returns the index at which `value` should be inserted
- * into `array`.
- */
- function binaryIndexBy(array, value, iteratee, retHighest) {
- value = iteratee(value);
-
- var low = 0,
- high = array ? array.length : 0,
- valIsNaN = value !== value,
- valIsNull = value === null,
- valIsUndef = value === undefined;
-
- while (low < high) {
- var mid = nativeFloor((low + high) / 2),
- computed = iteratee(array[mid]),
- isDef = computed !== undefined,
- isReflexive = computed === computed;
-
- if (valIsNaN) {
- var setLow = isReflexive || retHighest;
- } else if (valIsNull) {
- setLow = isReflexive && isDef && (retHighest || computed != null);
- } else if (valIsUndef) {
- setLow = isReflexive && (retHighest || isDef);
- } else if (computed == null) {
- setLow = false;
- } else {
- setLow = retHighest ? (computed <= value) : (computed < value);
- }
- if (setLow) {
- low = mid + 1;
- } else {
- high = mid;
- }
- }
- return nativeMin(high, MAX_ARRAY_INDEX);
- }
-
- /**
- * A specialized version of `baseCallback` which only supports `this` binding
- * and specifying the number of arguments to provide to `func`.
- *
- * @private
- * @param {Function} func The function to bind.
- * @param {*} thisArg The `this` binding of `func`.
- * @param {number} [argCount] The number of arguments to provide to `func`.
- * @returns {Function} Returns the callback.
- */
- function bindCallback(func, thisArg, argCount) {
- if (typeof func != 'function') {
- return identity;
- }
- if (thisArg === undefined) {
- return func;
- }
- switch (argCount) {
- case 1: return function(value) {
- return func.call(thisArg, value);
- };
- case 3: return function(value, index, collection) {
- return func.call(thisArg, value, index, collection);
- };
- case 4: return function(accumulator, value, index, collection) {
- return func.call(thisArg, accumulator, value, index, collection);
- };
- case 5: return function(value, other, key, object, source) {
- return func.call(thisArg, value, other, key, object, source);
- };
- }
- return function() {
- return func.apply(thisArg, arguments);
- };
- }
-
- /**
- * Creates a clone of the given array buffer.
- *
- * @private
- * @param {ArrayBuffer} buffer The array buffer to clone.
- * @returns {ArrayBuffer} Returns the cloned array buffer.
- */
- function bufferClone(buffer) {
- var result = new ArrayBuffer(buffer.byteLength),
- view = new Uint8Array(result);
-
- view.set(new Uint8Array(buffer));
- return result;
- }
-
- /**
- * Creates an array that is the composition of partially applied arguments,
- * placeholders, and provided arguments into a single array of arguments.
- *
- * @private
- * @param {Array|Object} args The provided arguments.
- * @param {Array} partials The arguments to prepend to those provided.
- * @param {Array} holders The `partials` placeholder indexes.
- * @returns {Array} Returns the new array of composed arguments.
- */
- function composeArgs(args, partials, holders) {
- var holdersLength = holders.length,
- argsIndex = -1,
- argsLength = nativeMax(args.length - holdersLength, 0),
- leftIndex = -1,
- leftLength = partials.length,
- result = Array(leftLength + argsLength);
-
- while (++leftIndex < leftLength) {
- result[leftIndex] = partials[leftIndex];
- }
- while (++argsIndex < holdersLength) {
- result[holders[argsIndex]] = args[argsIndex];
- }
- while (argsLength--) {
- result[leftIndex++] = args[argsIndex++];
- }
- return result;
- }
-
- /**
- * This function is like `composeArgs` except that the arguments composition
- * is tailored for `_.partialRight`.
- *
- * @private
- * @param {Array|Object} args The provided arguments.
- * @param {Array} partials The arguments to append to those provided.
- * @param {Array} holders The `partials` placeholder indexes.
- * @returns {Array} Returns the new array of composed arguments.
- */
- function composeArgsRight(args, partials, holders) {
- var holdersIndex = -1,
- holdersLength = holders.length,
- argsIndex = -1,
- argsLength = nativeMax(args.length - holdersLength, 0),
- rightIndex = -1,
- rightLength = partials.length,
- result = Array(argsLength + rightLength);
-
- while (++argsIndex < argsLength) {
- result[argsIndex] = args[argsIndex];
- }
- var offset = argsIndex;
- while (++rightIndex < rightLength) {
- result[offset + rightIndex] = partials[rightIndex];
- }
- while (++holdersIndex < holdersLength) {
- result[offset + holders[holdersIndex]] = args[argsIndex++];
- }
- return result;
- }
-
- /**
- * Creates a `_.countBy`, `_.groupBy`, `_.indexBy`, or `_.partition` function.
- *
- * @private
- * @param {Function} setter The function to set keys and values of the accumulator object.
- * @param {Function} [initializer] The function to initialize the accumulator object.
- * @returns {Function} Returns the new aggregator function.
- */
- function createAggregator(setter, initializer) {
- return function(collection, iteratee, thisArg) {
- var result = initializer ? initializer() : {};
- iteratee = getCallback(iteratee, thisArg, 3);
-
- if (isArray(collection)) {
- var index = -1,
- length = collection.length;
-
- while (++index < length) {
- var value = collection[index];
- setter(result, value, iteratee(value, index, collection), collection);
- }
- } else {
- baseEach(collection, function(value, key, collection) {
- setter(result, value, iteratee(value, key, collection), collection);
- });
- }
- return result;
- };
- }
-
- /**
- * Creates a `_.assign`, `_.defaults`, or `_.merge` function.
- *
- * @private
- * @param {Function} assigner The function to assign values.
- * @returns {Function} Returns the new assigner function.
- */
- function createAssigner(assigner) {
- return restParam(function(object, sources) {
- var index = -1,
- length = object == null ? 0 : sources.length,
- customizer = length > 2 ? sources[length - 2] : undefined,
- guard = length > 2 ? sources[2] : undefined,
- thisArg = length > 1 ? sources[length - 1] : undefined;
-
- if (typeof customizer == 'function') {
- customizer = bindCallback(customizer, thisArg, 5);
- length -= 2;
- } else {
- customizer = typeof thisArg == 'function' ? thisArg : undefined;
- length -= (customizer ? 1 : 0);
- }
- if (guard && isIterateeCall(sources[0], sources[1], guard)) {
- customizer = length < 3 ? undefined : customizer;
- length = 1;
- }
- while (++index < length) {
- var source = sources[index];
- if (source) {
- assigner(object, source, customizer);
- }
- }
- return object;
- });
- }
-
- /**
- * Creates a `baseEach` or `baseEachRight` function.
- *
- * @private
- * @param {Function} eachFunc The function to iterate over a collection.
- * @param {boolean} [fromRight] Specify iterating from right to left.
- * @returns {Function} Returns the new base function.
- */
- function createBaseEach(eachFunc, fromRight) {
- return function(collection, iteratee) {
- var length = collection ? getLength(collection) : 0;
- if (!isLength(length)) {
- return eachFunc(collection, iteratee);
- }
- var index = fromRight ? length : -1,
- iterable = toObject(collection);
-
- while ((fromRight ? index-- : ++index < length)) {
- if (iteratee(iterable[index], index, iterable) === false) {
- break;
- }
- }
- return collection;
- };
- }
-
- /**
- * Creates a base function for `_.forIn` or `_.forInRight`.
- *
- * @private
- * @param {boolean} [fromRight] Specify iterating from right to left.
- * @returns {Function} Returns the new base function.
- */
- function createBaseFor(fromRight) {
- return function(object, iteratee, keysFunc) {
- var iterable = toObject(object),
- props = keysFunc(object),
- length = props.length,
- index = fromRight ? length : -1;
-
- while ((fromRight ? index-- : ++index < length)) {
- var key = props[index];
- if (iteratee(iterable[key], key, iterable) === false) {
- break;
- }
- }
- return object;
- };
- }
-
- /**
- * Creates a function that wraps `func` and invokes it with the `this`
- * binding of `thisArg`.
- *
- * @private
- * @param {Function} func The function to bind.
- * @param {*} [thisArg] The `this` binding of `func`.
- * @returns {Function} Returns the new bound function.
- */
- function createBindWrapper(func, thisArg) {
- var Ctor = createCtorWrapper(func);
-
- function wrapper() {
- var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
- return fn.apply(thisArg, arguments);
- }
- return wrapper;
- }
-
- /**
- * Creates a `Set` cache object to optimize linear searches of large arrays.
- *
- * @private
- * @param {Array} [values] The values to cache.
- * @returns {null|Object} Returns the new cache object if `Set` is supported, else `null`.
- */
- function createCache(values) {
- return (nativeCreate && Set) ? new SetCache(values) : null;
- }
-
- /**
- * Creates a function that produces compound words out of the words in a
- * given string.
- *
- * @private
- * @param {Function} callback The function to combine each word.
- * @returns {Function} Returns the new compounder function.
- */
- function createCompounder(callback) {
- return function(string) {
- var index = -1,
- array = words(deburr(string)),
- length = array.length,
- result = '';
-
- while (++index < length) {
- result = callback(result, array[index], index);
- }
- return result;
- };
- }
-
- /**
- * Creates a function that produces an instance of `Ctor` regardless of
- * whether it was invoked as part of a `new` expression or by `call` or `apply`.
- *
- * @private
- * @param {Function} Ctor The constructor to wrap.
- * @returns {Function} Returns the new wrapped function.
- */
- function createCtorWrapper(Ctor) {
- return function() {
- // Use a `switch` statement to work with class constructors.
- // See http://ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
- // for more details.
- var args = arguments;
- switch (args.length) {
- case 0: return new Ctor;
- case 1: return new Ctor(args[0]);
- case 2: return new Ctor(args[0], args[1]);
- case 3: return new Ctor(args[0], args[1], args[2]);
- case 4: return new Ctor(args[0], args[1], args[2], args[3]);
- case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
- case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
- case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
- }
- var thisBinding = baseCreate(Ctor.prototype),
- result = Ctor.apply(thisBinding, args);
-
- // Mimic the constructor's `return` behavior.
- // See https://es5.github.io/#x13.2.2 for more details.
- return isObject(result) ? result : thisBinding;
- };
- }
-
- /**
- * Creates a `_.curry` or `_.curryRight` function.
- *
- * @private
- * @param {boolean} flag The curry bit flag.
- * @returns {Function} Returns the new curry function.
- */
- function createCurry(flag) {
- function curryFunc(func, arity, guard) {
- if (guard && isIterateeCall(func, arity, guard)) {
- arity = undefined;
- }
- var result = createWrapper(func, flag, undefined, undefined, undefined, undefined, undefined, arity);
- result.placeholder = curryFunc.placeholder;
- return result;
- }
- return curryFunc;
- }
-
- /**
- * Creates a `_.defaults` or `_.defaultsDeep` function.
- *
- * @private
- * @param {Function} assigner The function to assign values.
- * @param {Function} customizer The function to customize assigned values.
- * @returns {Function} Returns the new defaults function.
- */
- function createDefaults(assigner, customizer) {
- return restParam(function(args) {
- var object = args[0];
- if (object == null) {
- return object;
- }
- args.push(customizer);
- return assigner.apply(undefined, args);
- });
- }
-
- /**
- * Creates a `_.max` or `_.min` function.
- *
- * @private
- * @param {Function} comparator The function used to compare values.
- * @param {*} exValue The initial extremum value.
- * @returns {Function} Returns the new extremum function.
- */
- function createExtremum(comparator, exValue) {
- return function(collection, iteratee, thisArg) {
- if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {
- iteratee = undefined;
- }
- iteratee = getCallback(iteratee, thisArg, 3);
- if (iteratee.length == 1) {
- collection = isArray(collection) ? collection : toIterable(collection);
- var result = arrayExtremum(collection, iteratee, comparator, exValue);
- if (!(collection.length && result === exValue)) {
- return result;
- }
- }
- return baseExtremum(collection, iteratee, comparator, exValue);
- };
- }
-
- /**
- * Creates a `_.find` or `_.findLast` function.
- *
- * @private
- * @param {Function} eachFunc The function to iterate over a collection.
- * @param {boolean} [fromRight] Specify iterating from right to left.
- * @returns {Function} Returns the new find function.
- */
- function createFind(eachFunc, fromRight) {
- return function(collection, predicate, thisArg) {
- predicate = getCallback(predicate, thisArg, 3);
- if (isArray(collection)) {
- var index = baseFindIndex(collection, predicate, fromRight);
- return index > -1 ? collection[index] : undefined;
- }
- return baseFind(collection, predicate, eachFunc);
- };
- }
-
- /**
- * Creates a `_.findIndex` or `_.findLastIndex` function.
- *
- * @private
- * @param {boolean} [fromRight] Specify iterating from right to left.
- * @returns {Function} Returns the new find function.
- */
- function createFindIndex(fromRight) {
- return function(array, predicate, thisArg) {
- if (!(array && array.length)) {
- return -1;
- }
- predicate = getCallback(predicate, thisArg, 3);
- return baseFindIndex(array, predicate, fromRight);
- };
- }
-
- /**
- * Creates a `_.findKey` or `_.findLastKey` function.
- *
- * @private
- * @param {Function} objectFunc The function to iterate over an object.
- * @returns {Function} Returns the new find function.
- */
- function createFindKey(objectFunc) {
- return function(object, predicate, thisArg) {
- predicate = getCallback(predicate, thisArg, 3);
- return baseFind(object, predicate, objectFunc, true);
- };
- }
-
- /**
- * Creates a `_.flow` or `_.flowRight` function.
- *
- * @private
- * @param {boolean} [fromRight] Specify iterating from right to left.
- * @returns {Function} Returns the new flow function.
- */
- function createFlow(fromRight) {
- return function() {
- var wrapper,
- length = arguments.length,
- index = fromRight ? length : -1,
- leftIndex = 0,
- funcs = Array(length);
-
- while ((fromRight ? index-- : ++index < length)) {
- var func = funcs[leftIndex++] = arguments[index];
- if (typeof func != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- if (!wrapper && LodashWrapper.prototype.thru && getFuncName(func) == 'wrapper') {
- wrapper = new LodashWrapper([], true);
- }
- }
- index = wrapper ? -1 : length;
- while (++index < length) {
- func = funcs[index];
-
- var funcName = getFuncName(func),
- data = funcName == 'wrapper' ? getData(func) : undefined;
-
- if (data && isLaziable(data[0]) && data[1] == (ARY_FLAG | CURRY_FLAG | PARTIAL_FLAG | REARG_FLAG) && !data[4].length && data[9] == 1) {
- wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
- } else {
- wrapper = (func.length == 1 && isLaziable(func)) ? wrapper[funcName]() : wrapper.thru(func);
- }
- }
- return function() {
- var args = arguments,
- value = args[0];
-
- if (wrapper && args.length == 1 && isArray(value) && value.length >= LARGE_ARRAY_SIZE) {
- return wrapper.plant(value).value();
- }
- var index = 0,
- result = length ? funcs[index].apply(this, args) : value;
-
- while (++index < length) {
- result = funcs[index].call(this, result);
- }
- return result;
- };
- };
- }
-
- /**
- * Creates a function for `_.forEach` or `_.forEachRight`.
- *
- * @private
- * @param {Function} arrayFunc The function to iterate over an array.
- * @param {Function} eachFunc The function to iterate over a collection.
- * @returns {Function} Returns the new each function.
- */
- function createForEach(arrayFunc, eachFunc) {
- return function(collection, iteratee, thisArg) {
- return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection))
- ? arrayFunc(collection, iteratee)
- : eachFunc(collection, bindCallback(iteratee, thisArg, 3));
- };
- }
-
- /**
- * Creates a function for `_.forIn` or `_.forInRight`.
- *
- * @private
- * @param {Function} objectFunc The function to iterate over an object.
- * @returns {Function} Returns the new each function.
- */
- function createForIn(objectFunc) {
- return function(object, iteratee, thisArg) {
- if (typeof iteratee != 'function' || thisArg !== undefined) {
- iteratee = bindCallback(iteratee, thisArg, 3);
- }
- return objectFunc(object, iteratee, keysIn);
- };
- }
-
- /**
- * Creates a function for `_.forOwn` or `_.forOwnRight`.
- *
- * @private
- * @param {Function} objectFunc The function to iterate over an object.
- * @returns {Function} Returns the new each function.
- */
- function createForOwn(objectFunc) {
- return function(object, iteratee, thisArg) {
- if (typeof iteratee != 'function' || thisArg !== undefined) {
- iteratee = bindCallback(iteratee, thisArg, 3);
- }
- return objectFunc(object, iteratee);
- };
- }
-
- /**
- * Creates a function for `_.mapKeys` or `_.mapValues`.
- *
- * @private
- * @param {boolean} [isMapKeys] Specify mapping keys instead of values.
- * @returns {Function} Returns the new map function.
- */
- function createObjectMapper(isMapKeys) {
- return function(object, iteratee, thisArg) {
- var result = {};
- iteratee = getCallback(iteratee, thisArg, 3);
-
- baseForOwn(object, function(value, key, object) {
- var mapped = iteratee(value, key, object);
- key = isMapKeys ? mapped : key;
- value = isMapKeys ? value : mapped;
- result[key] = value;
- });
- return result;
- };
- }
-
- /**
- * Creates a function for `_.padLeft` or `_.padRight`.
- *
- * @private
- * @param {boolean} [fromRight] Specify padding from the right.
- * @returns {Function} Returns the new pad function.
- */
- function createPadDir(fromRight) {
- return function(string, length, chars) {
- string = baseToString(string);
- return (fromRight ? string : '') + createPadding(string, length, chars) + (fromRight ? '' : string);
- };
- }
-
- /**
- * Creates a `_.partial` or `_.partialRight` function.
- *
- * @private
- * @param {boolean} flag The partial bit flag.
- * @returns {Function} Returns the new partial function.
- */
- function createPartial(flag) {
- var partialFunc = restParam(function(func, partials) {
- var holders = replaceHolders(partials, partialFunc.placeholder);
- return createWrapper(func, flag, undefined, partials, holders);
- });
- return partialFunc;
- }
-
- /**
- * Creates a function for `_.reduce` or `_.reduceRight`.
- *
- * @private
- * @param {Function} arrayFunc The function to iterate over an array.
- * @param {Function} eachFunc The function to iterate over a collection.
- * @returns {Function} Returns the new each function.
- */
- function createReduce(arrayFunc, eachFunc) {
- return function(collection, iteratee, accumulator, thisArg) {
- var initFromArray = arguments.length < 3;
- return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection))
- ? arrayFunc(collection, iteratee, accumulator, initFromArray)
- : baseReduce(collection, getCallback(iteratee, thisArg, 4), accumulator, initFromArray, eachFunc);
- };
- }
-
- /**
- * Creates a function that wraps `func` and invokes it with optional `this`
- * binding of, partial application, and currying.
- *
- * @private
- * @param {Function|string} func The function or method name to reference.
- * @param {number} bitmask The bitmask of flags. See `createWrapper` for more details.
- * @param {*} [thisArg] The `this` binding of `func`.
- * @param {Array} [partials] The arguments to prepend to those provided to the new function.
- * @param {Array} [holders] The `partials` placeholder indexes.
- * @param {Array} [partialsRight] The arguments to append to those provided to the new function.
- * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
- * @param {Array} [argPos] The argument positions of the new function.
- * @param {number} [ary] The arity cap of `func`.
- * @param {number} [arity] The arity of `func`.
- * @returns {Function} Returns the new wrapped function.
- */
- function createHybridWrapper(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
- var isAry = bitmask & ARY_FLAG,
- isBind = bitmask & BIND_FLAG,
- isBindKey = bitmask & BIND_KEY_FLAG,
- isCurry = bitmask & CURRY_FLAG,
- isCurryBound = bitmask & CURRY_BOUND_FLAG,
- isCurryRight = bitmask & CURRY_RIGHT_FLAG,
- Ctor = isBindKey ? undefined : createCtorWrapper(func);
-
- function wrapper() {
- // Avoid `arguments` object use disqualifying optimizations by
- // converting it to an array before providing it to other functions.
- var length = arguments.length,
- index = length,
- args = Array(length);
-
- while (index--) {
- args[index] = arguments[index];
- }
- if (partials) {
- args = composeArgs(args, partials, holders);
- }
- if (partialsRight) {
- args = composeArgsRight(args, partialsRight, holdersRight);
- }
- if (isCurry || isCurryRight) {
- var placeholder = wrapper.placeholder,
- argsHolders = replaceHolders(args, placeholder);
-
- length -= argsHolders.length;
- if (length < arity) {
- var newArgPos = argPos ? arrayCopy(argPos) : undefined,
- newArity = nativeMax(arity - length, 0),
- newsHolders = isCurry ? argsHolders : undefined,
- newHoldersRight = isCurry ? undefined : argsHolders,
- newPartials = isCurry ? args : undefined,
- newPartialsRight = isCurry ? undefined : args;
-
- bitmask |= (isCurry ? PARTIAL_FLAG : PARTIAL_RIGHT_FLAG);
- bitmask &= ~(isCurry ? PARTIAL_RIGHT_FLAG : PARTIAL_FLAG);
-
- if (!isCurryBound) {
- bitmask &= ~(BIND_FLAG | BIND_KEY_FLAG);
- }
- var newData = [func, bitmask, thisArg, newPartials, newsHolders, newPartialsRight, newHoldersRight, newArgPos, ary, newArity],
- result = createHybridWrapper.apply(undefined, newData);
-
- if (isLaziable(func)) {
- setData(result, newData);
- }
- result.placeholder = placeholder;
- return result;
- }
- }
- var thisBinding = isBind ? thisArg : this,
- fn = isBindKey ? thisBinding[func] : func;
-
- if (argPos) {
- args = reorder(args, argPos);
- }
- if (isAry && ary < args.length) {
- args.length = ary;
- }
- if (this && this !== root && this instanceof wrapper) {
- fn = Ctor || createCtorWrapper(func);
- }
- return fn.apply(thisBinding, args);
- }
- return wrapper;
- }
-
- /**
- * Creates the padding required for `string` based on the given `length`.
- * The `chars` string is truncated if the number of characters exceeds `length`.
- *
- * @private
- * @param {string} string The string to create padding for.
- * @param {number} [length=0] The padding length.
- * @param {string} [chars=' '] The string used as padding.
- * @returns {string} Returns the pad for `string`.
- */
- function createPadding(string, length, chars) {
- var strLength = string.length;
- length = +length;
-
- if (strLength >= length || !nativeIsFinite(length)) {
- return '';
- }
- var padLength = length - strLength;
- chars = chars == null ? ' ' : (chars + '');
- return repeat(chars, nativeCeil(padLength / chars.length)).slice(0, padLength);
- }
-
- /**
- * Creates a function that wraps `func` and invokes it with the optional `this`
- * binding of `thisArg` and the `partials` prepended to those provided to
- * the wrapper.
- *
- * @private
- * @param {Function} func The function to partially apply arguments to.
- * @param {number} bitmask The bitmask of flags. See `createWrapper` for more details.
- * @param {*} thisArg The `this` binding of `func`.
- * @param {Array} partials The arguments to prepend to those provided to the new function.
- * @returns {Function} Returns the new bound function.
- */
- function createPartialWrapper(func, bitmask, thisArg, partials) {
- var isBind = bitmask & BIND_FLAG,
- Ctor = createCtorWrapper(func);
-
- function wrapper() {
- // Avoid `arguments` object use disqualifying optimizations by
- // converting it to an array before providing it `func`.
- var argsIndex = -1,
- argsLength = arguments.length,
- leftIndex = -1,
- leftLength = partials.length,
- args = Array(leftLength + argsLength);
-
- while (++leftIndex < leftLength) {
- args[leftIndex] = partials[leftIndex];
- }
- while (argsLength--) {
- args[leftIndex++] = arguments[++argsIndex];
- }
- var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
- return fn.apply(isBind ? thisArg : this, args);
- }
- return wrapper;
- }
-
- /**
- * Creates a `_.ceil`, `_.floor`, or `_.round` function.
- *
- * @private
- * @param {string} methodName The name of the `Math` method to use when rounding.
- * @returns {Function} Returns the new round function.
- */
- function createRound(methodName) {
- var func = Math[methodName];
- return function(number, precision) {
- precision = precision === undefined ? 0 : (+precision || 0);
- if (precision) {
- precision = pow(10, precision);
- return func(number * precision) / precision;
- }
- return func(number);
- };
- }
-
- /**
- * Creates a `_.sortedIndex` or `_.sortedLastIndex` function.
- *
- * @private
- * @param {boolean} [retHighest] Specify returning the highest qualified index.
- * @returns {Function} Returns the new index function.
- */
- function createSortedIndex(retHighest) {
- return function(array, value, iteratee, thisArg) {
- var callback = getCallback(iteratee);
- return (iteratee == null && callback === baseCallback)
- ? binaryIndex(array, value, retHighest)
- : binaryIndexBy(array, value, callback(iteratee, thisArg, 1), retHighest);
- };
- }
-
- /**
- * Creates a function that either curries or invokes `func` with optional
- * `this` binding and partially applied arguments.
- *
- * @private
- * @param {Function|string} func The function or method name to reference.
- * @param {number} bitmask The bitmask of flags.
- * The bitmask may be composed of the following flags:
- * 1 - `_.bind`
- * 2 - `_.bindKey`
- * 4 - `_.curry` or `_.curryRight` of a bound function
- * 8 - `_.curry`
- * 16 - `_.curryRight`
- * 32 - `_.partial`
- * 64 - `_.partialRight`
- * 128 - `_.rearg`
- * 256 - `_.ary`
- * @param {*} [thisArg] The `this` binding of `func`.
- * @param {Array} [partials] The arguments to be partially applied.
- * @param {Array} [holders] The `partials` placeholder indexes.
- * @param {Array} [argPos] The argument positions of the new function.
- * @param {number} [ary] The arity cap of `func`.
- * @param {number} [arity] The arity of `func`.
- * @returns {Function} Returns the new wrapped function.
- */
- function createWrapper(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
- var isBindKey = bitmask & BIND_KEY_FLAG;
- if (!isBindKey && typeof func != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- var length = partials ? partials.length : 0;
- if (!length) {
- bitmask &= ~(PARTIAL_FLAG | PARTIAL_RIGHT_FLAG);
- partials = holders = undefined;
- }
- length -= (holders ? holders.length : 0);
- if (bitmask & PARTIAL_RIGHT_FLAG) {
- var partialsRight = partials,
- holdersRight = holders;
-
- partials = holders = undefined;
- }
- var data = isBindKey ? undefined : getData(func),
- newData = [func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity];
-
- if (data) {
- mergeData(newData, data);
- bitmask = newData[1];
- arity = newData[9];
- }
- newData[9] = arity == null
- ? (isBindKey ? 0 : func.length)
- : (nativeMax(arity - length, 0) || 0);
-
- if (bitmask == BIND_FLAG) {
- var result = createBindWrapper(newData[0], newData[2]);
- } else if ((bitmask == PARTIAL_FLAG || bitmask == (BIND_FLAG | PARTIAL_FLAG)) && !newData[4].length) {
- result = createPartialWrapper.apply(undefined, newData);
- } else {
- result = createHybridWrapper.apply(undefined, newData);
- }
- var setter = data ? baseSetData : setData;
- return setter(result, newData);
- }
-
- /**
- * A specialized version of `baseIsEqualDeep` for arrays with support for
- * partial deep comparisons.
- *
- * @private
- * @param {Array} array The array to compare.
- * @param {Array} other The other array to compare.
- * @param {Function} equalFunc The function to determine equivalents of values.
- * @param {Function} [customizer] The function to customize comparing arrays.
- * @param {boolean} [isLoose] Specify performing partial comparisons.
- * @param {Array} [stackA] Tracks traversed `value` objects.
- * @param {Array} [stackB] Tracks traversed `other` objects.
- * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
- */
- function equalArrays(array, other, equalFunc, customizer, isLoose, stackA, stackB) {
- var index = -1,
- arrLength = array.length,
- othLength = other.length;
-
- if (arrLength != othLength && !(isLoose && othLength > arrLength)) {
- return false;
- }
- // Ignore non-index properties.
- while (++index < arrLength) {
- var arrValue = array[index],
- othValue = other[index],
- result = customizer ? customizer(isLoose ? othValue : arrValue, isLoose ? arrValue : othValue, index) : undefined;
-
- if (result !== undefined) {
- if (result) {
- continue;
- }
- return false;
- }
- // Recursively compare arrays (susceptible to call stack limits).
- if (isLoose) {
- if (!arraySome(other, function(othValue) {
- return arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB);
- })) {
- return false;
- }
- } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB))) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * A specialized version of `baseIsEqualDeep` for comparing objects of
- * the same `toStringTag`.
- *
- * **Note:** This function only supports comparing values with tags of
- * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
- *
- * @private
- * @param {Object} object The object to compare.
- * @param {Object} other The other object to compare.
- * @param {string} tag The `toStringTag` of the objects to compare.
- * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
- */
- function equalByTag(object, other, tag) {
- switch (tag) {
- case boolTag:
- case dateTag:
- // Coerce dates and booleans to numbers, dates to milliseconds and booleans
- // to `1` or `0` treating invalid dates coerced to `NaN` as not equal.
- return +object == +other;
-
- case errorTag:
- return object.name == other.name && object.message == other.message;
-
- case numberTag:
- // Treat `NaN` vs. `NaN` as equal.
- return (object != +object)
- ? other != +other
- : object == +other;
-
- case regexpTag:
- case stringTag:
- // Coerce regexes to strings and treat strings primitives and string
- // objects as equal. See https://es5.github.io/#x15.10.6.4 for more details.
- return object == (other + '');
- }
- return false;
- }
-
- /**
- * A specialized version of `baseIsEqualDeep` for objects with support for
- * partial deep comparisons.
- *
- * @private
- * @param {Object} object The object to compare.
- * @param {Object} other The other object to compare.
- * @param {Function} equalFunc The function to determine equivalents of values.
- * @param {Function} [customizer] The function to customize comparing values.
- * @param {boolean} [isLoose] Specify performing partial comparisons.
- * @param {Array} [stackA] Tracks traversed `value` objects.
- * @param {Array} [stackB] Tracks traversed `other` objects.
- * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
- */
- function equalObjects(object, other, equalFunc, customizer, isLoose, stackA, stackB) {
- var objProps = keys(object),
- objLength = objProps.length,
- othProps = keys(other),
- othLength = othProps.length;
-
- if (objLength != othLength && !isLoose) {
- return false;
- }
- var index = objLength;
- while (index--) {
- var key = objProps[index];
- if (!(isLoose ? key in other : hasOwnProperty.call(other, key))) {
- return false;
- }
- }
- var skipCtor = isLoose;
- while (++index < objLength) {
- key = objProps[index];
- var objValue = object[key],
- othValue = other[key],
- result = customizer ? customizer(isLoose ? othValue : objValue, isLoose? objValue : othValue, key) : undefined;
-
- // Recursively compare objects (susceptible to call stack limits).
- if (!(result === undefined ? equalFunc(objValue, othValue, customizer, isLoose, stackA, stackB) : result)) {
- return false;
- }
- skipCtor || (skipCtor = key == 'constructor');
- }
- if (!skipCtor) {
- var objCtor = object.constructor,
- othCtor = other.constructor;
-
- // Non `Object` object instances with different constructors are not equal.
- if (objCtor != othCtor &&
- ('constructor' in object && 'constructor' in other) &&
- !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
- typeof othCtor == 'function' && othCtor instanceof othCtor)) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * Gets the appropriate "callback" function. If the `_.callback` method is
- * customized this function returns the custom method, otherwise it returns
- * the `baseCallback` function. If arguments are provided the chosen function
- * is invoked with them and its result is returned.
- *
- * @private
- * @returns {Function} Returns the chosen function or its result.
- */
- function getCallback(func, thisArg, argCount) {
- var result = lodash.callback || callback;
- result = result === callback ? baseCallback : result;
- return argCount ? result(func, thisArg, argCount) : result;
- }
-
- /**
- * Gets metadata for `func`.
- *
- * @private
- * @param {Function} func The function to query.
- * @returns {*} Returns the metadata for `func`.
- */
- var getData = !metaMap ? noop : function(func) {
- return metaMap.get(func);
- };
-
- /**
- * Gets the name of `func`.
- *
- * @private
- * @param {Function} func The function to query.
- * @returns {string} Returns the function name.
- */
- function getFuncName(func) {
- var result = func.name,
- array = realNames[result],
- length = array ? array.length : 0;
-
- while (length--) {
- var data = array[length],
- otherFunc = data.func;
- if (otherFunc == null || otherFunc == func) {
- return data.name;
- }
- }
- return result;
- }
-
- /**
- * Gets the appropriate "indexOf" function. If the `_.indexOf` method is
- * customized this function returns the custom method, otherwise it returns
- * the `baseIndexOf` function. If arguments are provided the chosen function
- * is invoked with them and its result is returned.
- *
- * @private
- * @returns {Function|number} Returns the chosen function or its result.
- */
- function getIndexOf(collection, target, fromIndex) {
- var result = lodash.indexOf || indexOf;
- result = result === indexOf ? baseIndexOf : result;
- return collection ? result(collection, target, fromIndex) : result;
- }
-
- /**
- * Gets the "length" property value of `object`.
- *
- * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)
- * that affects Safari on at least iOS 8.1-8.3 ARM64.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {*} Returns the "length" value.
- */
- var getLength = baseProperty('length');
-
- /**
- * Gets the propery names, values, and compare flags of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {Array} Returns the match data of `object`.
- */
- function getMatchData(object) {
- var result = pairs(object),
- length = result.length;
-
- while (length--) {
- result[length][2] = isStrictComparable(result[length][1]);
- }
- return result;
- }
-
- /**
- * Gets the native function at `key` of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @param {string} key The key of the method to get.
- * @returns {*} Returns the function if it's native, else `undefined`.
- */
- function getNative(object, key) {
- var value = object == null ? undefined : object[key];
- return isNative(value) ? value : undefined;
- }
-
- /**
- * Gets the view, applying any `transforms` to the `start` and `end` positions.
- *
- * @private
- * @param {number} start The start of the view.
- * @param {number} end The end of the view.
- * @param {Array} transforms The transformations to apply to the view.
- * @returns {Object} Returns an object containing the `start` and `end`
- * positions of the view.
- */
- function getView(start, end, transforms) {
- var index = -1,
- length = transforms.length;
-
- while (++index < length) {
- var data = transforms[index],
- size = data.size;
-
- switch (data.type) {
- case 'drop': start += size; break;
- case 'dropRight': end -= size; break;
- case 'take': end = nativeMin(end, start + size); break;
- case 'takeRight': start = nativeMax(start, end - size); break;
- }
- }
- return { 'start': start, 'end': end };
- }
-
- /**
- * Initializes an array clone.
- *
- * @private
- * @param {Array} array The array to clone.
- * @returns {Array} Returns the initialized clone.
- */
- function initCloneArray(array) {
- var length = array.length,
- result = new array.constructor(length);
-
- // Add array properties assigned by `RegExp#exec`.
- if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
- result.index = array.index;
- result.input = array.input;
- }
- return result;
- }
-
- /**
- * Initializes an object clone.
- *
- * @private
- * @param {Object} object The object to clone.
- * @returns {Object} Returns the initialized clone.
- */
- function initCloneObject(object) {
- var Ctor = object.constructor;
- if (!(typeof Ctor == 'function' && Ctor instanceof Ctor)) {
- Ctor = Object;
- }
- return new Ctor;
- }
-
- /**
- * Initializes an object clone based on its `toStringTag`.
- *
- * **Note:** This function only supports cloning values with tags of
- * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
- *
- * @private
- * @param {Object} object The object to clone.
- * @param {string} tag The `toStringTag` of the object to clone.
- * @param {boolean} [isDeep] Specify a deep clone.
- * @returns {Object} Returns the initialized clone.
- */
- function initCloneByTag(object, tag, isDeep) {
- var Ctor = object.constructor;
- switch (tag) {
- case arrayBufferTag:
- return bufferClone(object);
-
- case boolTag:
- case dateTag:
- return new Ctor(+object);
-
- case float32Tag: case float64Tag:
- case int8Tag: case int16Tag: case int32Tag:
- case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
- var buffer = object.buffer;
- return new Ctor(isDeep ? bufferClone(buffer) : buffer, object.byteOffset, object.length);
-
- case numberTag:
- case stringTag:
- return new Ctor(object);
-
- case regexpTag:
- var result = new Ctor(object.source, reFlags.exec(object));
- result.lastIndex = object.lastIndex;
- }
- return result;
- }
-
- /**
- * Invokes the method at `path` on `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @param {Array|string} path The path of the method to invoke.
- * @param {Array} args The arguments to invoke the method with.
- * @returns {*} Returns the result of the invoked method.
- */
- function invokePath(object, path, args) {
- if (object != null && !isKey(path, object)) {
- path = toPath(path);
- object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
- path = last(path);
- }
- var func = object == null ? object : object[path];
- return func == null ? undefined : func.apply(object, args);
- }
-
- /**
- * Checks if `value` is array-like.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
- */
- function isArrayLike(value) {
- return value != null && isLength(getLength(value));
- }
-
- /**
- * Checks if `value` is a valid array-like index.
- *
- * @private
- * @param {*} value The value to check.
- * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
- * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
- */
- function isIndex(value, length) {
- value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;
- length = length == null ? MAX_SAFE_INTEGER : length;
- return value > -1 && value % 1 == 0 && value < length;
- }
-
- /**
- * Checks if the provided arguments are from an iteratee call.
- *
- * @private
- * @param {*} value The potential iteratee value argument.
- * @param {*} index The potential iteratee index or key argument.
- * @param {*} object The potential iteratee object argument.
- * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`.
- */
- function isIterateeCall(value, index, object) {
- if (!isObject(object)) {
- return false;
- }
- var type = typeof index;
- if (type == 'number'
- ? (isArrayLike(object) && isIndex(index, object.length))
- : (type == 'string' && index in object)) {
- var other = object[index];
- return value === value ? (value === other) : (other !== other);
- }
- return false;
- }
-
- /**
- * Checks if `value` is a property name and not a property path.
- *
- * @private
- * @param {*} value The value to check.
- * @param {Object} [object] The object to query keys on.
- * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
- */
- function isKey(value, object) {
- var type = typeof value;
- if ((type == 'string' && reIsPlainProp.test(value)) || type == 'number') {
- return true;
- }
- if (isArray(value)) {
- return false;
- }
- var result = !reIsDeepProp.test(value);
- return result || (object != null && value in toObject(object));
- }
-
- /**
- * Checks if `func` has a lazy counterpart.
- *
- * @private
- * @param {Function} func The function to check.
- * @returns {boolean} Returns `true` if `func` has a lazy counterpart, else `false`.
- */
- function isLaziable(func) {
- var funcName = getFuncName(func);
- if (!(funcName in LazyWrapper.prototype)) {
- return false;
- }
- var other = lodash[funcName];
- if (func === other) {
- return true;
- }
- var data = getData(other);
- return !!data && func === data[0];
- }
-
- /**
- * Checks if `value` is a valid array-like length.
- *
- * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
- */
- function isLength(value) {
- return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
- }
-
- /**
- * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` if suitable for strict
- * equality comparisons, else `false`.
- */
- function isStrictComparable(value) {
- return value === value && !isObject(value);
- }
-
- /**
- * Merges the function metadata of `source` into `data`.
- *
- * Merging metadata reduces the number of wrappers required to invoke a function.
- * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
- * may be applied regardless of execution order. Methods like `_.ary` and `_.rearg`
- * augment function arguments, making the order in which they are executed important,
- * preventing the merging of metadata. However, we make an exception for a safe
- * common case where curried functions have `_.ary` and or `_.rearg` applied.
- *
- * @private
- * @param {Array} data The destination metadata.
- * @param {Array} source The source metadata.
- * @returns {Array} Returns `data`.
- */
- function mergeData(data, source) {
- var bitmask = data[1],
- srcBitmask = source[1],
- newBitmask = bitmask | srcBitmask,
- isCommon = newBitmask < ARY_FLAG;
-
- var isCombo =
- (srcBitmask == ARY_FLAG && bitmask == CURRY_FLAG) ||
- (srcBitmask == ARY_FLAG && bitmask == REARG_FLAG && data[7].length <= source[8]) ||
- (srcBitmask == (ARY_FLAG | REARG_FLAG) && bitmask == CURRY_FLAG);
-
- // Exit early if metadata can't be merged.
- if (!(isCommon || isCombo)) {
- return data;
- }
- // Use source `thisArg` if available.
- if (srcBitmask & BIND_FLAG) {
- data[2] = source[2];
- // Set when currying a bound function.
- newBitmask |= (bitmask & BIND_FLAG) ? 0 : CURRY_BOUND_FLAG;
- }
- // Compose partial arguments.
- var value = source[3];
- if (value) {
- var partials = data[3];
- data[3] = partials ? composeArgs(partials, value, source[4]) : arrayCopy(value);
- data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : arrayCopy(source[4]);
- }
- // Compose partial right arguments.
- value = source[5];
- if (value) {
- partials = data[5];
- data[5] = partials ? composeArgsRight(partials, value, source[6]) : arrayCopy(value);
- data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : arrayCopy(source[6]);
- }
- // Use source `argPos` if available.
- value = source[7];
- if (value) {
- data[7] = arrayCopy(value);
- }
- // Use source `ary` if it's smaller.
- if (srcBitmask & ARY_FLAG) {
- data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
- }
- // Use source `arity` if one is not provided.
- if (data[9] == null) {
- data[9] = source[9];
- }
- // Use source `func` and merge bitmasks.
- data[0] = source[0];
- data[1] = newBitmask;
-
- return data;
- }
-
- /**
- * Used by `_.defaultsDeep` to customize its `_.merge` use.
- *
- * @private
- * @param {*} objectValue The destination object property value.
- * @param {*} sourceValue The source object property value.
- * @returns {*} Returns the value to assign to the destination object.
- */
- function mergeDefaults(objectValue, sourceValue) {
- return objectValue === undefined ? sourceValue : merge(objectValue, sourceValue, mergeDefaults);
- }
-
- /**
- * A specialized version of `_.pick` which picks `object` properties specified
- * by `props`.
- *
- * @private
- * @param {Object} object The source object.
- * @param {string[]} props The property names to pick.
- * @returns {Object} Returns the new object.
- */
- function pickByArray(object, props) {
- object = toObject(object);
-
- var index = -1,
- length = props.length,
- result = {};
-
- while (++index < length) {
- var key = props[index];
- if (key in object) {
- result[key] = object[key];
- }
- }
- return result;
- }
-
- /**
- * A specialized version of `_.pick` which picks `object` properties `predicate`
- * returns truthy for.
- *
- * @private
- * @param {Object} object The source object.
- * @param {Function} predicate The function invoked per iteration.
- * @returns {Object} Returns the new object.
- */
- function pickByCallback(object, predicate) {
- var result = {};
- baseForIn(object, function(value, key, object) {
- if (predicate(value, key, object)) {
- result[key] = value;
- }
- });
- return result;
- }
-
- /**
- * Reorder `array` according to the specified indexes where the element at
- * the first index is assigned as the first element, the element at
- * the second index is assigned as the second element, and so on.
- *
- * @private
- * @param {Array} array The array to reorder.
- * @param {Array} indexes The arranged array indexes.
- * @returns {Array} Returns `array`.
- */
- function reorder(array, indexes) {
- var arrLength = array.length,
- length = nativeMin(indexes.length, arrLength),
- oldArray = arrayCopy(array);
-
- while (length--) {
- var index = indexes[length];
- array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
- }
- return array;
- }
-
- /**
- * Sets metadata for `func`.
- *
- * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
- * period of time, it will trip its breaker and transition to an identity function
- * to avoid garbage collection pauses in V8. See [V8 issue 2070](https://code.google.com/p/v8/issues/detail?id=2070)
- * for more details.
- *
- * @private
- * @param {Function} func The function to associate metadata with.
- * @param {*} data The metadata.
- * @returns {Function} Returns `func`.
- */
- var setData = (function() {
- var count = 0,
- lastCalled = 0;
-
- return function(key, value) {
- var stamp = now(),
- remaining = HOT_SPAN - (stamp - lastCalled);
-
- lastCalled = stamp;
- if (remaining > 0) {
- if (++count >= HOT_COUNT) {
- return key;
- }
- } else {
- count = 0;
- }
- return baseSetData(key, value);
- };
- }());
-
- /**
- * A fallback implementation of `Object.keys` which creates an array of the
- * own enumerable property names of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property names.
- */
- function shimKeys(object) {
- var props = keysIn(object),
- propsLength = props.length,
- length = propsLength && object.length;
-
- var allowIndexes = !!length && isLength(length) &&
- (isArray(object) || isArguments(object));
-
- var index = -1,
- result = [];
-
- while (++index < propsLength) {
- var key = props[index];
- if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) {
- result.push(key);
- }
- }
- return result;
- }
-
- /**
- * Converts `value` to an array-like object if it's not one.
- *
- * @private
- * @param {*} value The value to process.
- * @returns {Array|Object} Returns the array-like object.
- */
- function toIterable(value) {
- if (value == null) {
- return [];
- }
- if (!isArrayLike(value)) {
- return values(value);
- }
- return isObject(value) ? value : Object(value);
- }
-
- /**
- * Converts `value` to an object if it's not one.
- *
- * @private
- * @param {*} value The value to process.
- * @returns {Object} Returns the object.
- */
- function toObject(value) {
- return isObject(value) ? value : Object(value);
- }
-
- /**
- * Converts `value` to property path array if it's not one.
- *
- * @private
- * @param {*} value The value to process.
- * @returns {Array} Returns the property path array.
- */
- function toPath(value) {
- if (isArray(value)) {
- return value;
- }
- var result = [];
- baseToString(value).replace(rePropName, function(match, number, quote, string) {
- result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
- });
- return result;
- }
-
- /**
- * Creates a clone of `wrapper`.
- *
- * @private
- * @param {Object} wrapper The wrapper to clone.
- * @returns {Object} Returns the cloned wrapper.
- */
- function wrapperClone(wrapper) {
- return wrapper instanceof LazyWrapper
- ? wrapper.clone()
- : new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__, arrayCopy(wrapper.__actions__));
- }
-
- /*------------------------------------------------------------------------*/
-
- /**
- * 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;
- }
-
- /**
- * 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;
- }
-
- /**
- * 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))
- : [];
- });
-
- /**
- * 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);
- }
-
- /**
- * 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);
- }
-
- /**
- * 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, getCallback(predicate, thisArg, 3), true, true)
- : [];
- }
-
- /**
- * 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, getCallback(predicate, thisArg, 3), true)
- : [];
- }
-
- /**
- * 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);
- }
-
- /**
- * 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();
-
- /**
- * 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);
-
- /**
- * 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;
- }
-
- /**
- * Flattens a nested array. If `isDeep` is `true` the array is recursively
- * flattened, otherwise it is 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) : [];
- }
-
- /**
- * 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) : [];
- }
-
- /**
- * 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 is 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);
- }
-
- /**
- * 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);
- }
-
- /**
- * 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 = getIndexOf(),
- isCommon = indexOf == baseIndexOf,
- 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;
- });
-
- /**
- * 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;
- }
-
- /**
- * 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;
- }
-
- /**
- * 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 = getIndexOf(),
- 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;
- }
-
- /**
- * 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;
- });
-
- /**
- * 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 = getCallback(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;
- }
-
- /**
- * 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);
- }
-
- /**
- * 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);
- }
-
- /**
- * 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 is 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();
-
- /**
- * 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);
-
- /**
- * Creates a slice of `array` with `n` elements taken from the beginning.
- *
- * @static
- * @memberOf _
- * @category Array
- * @param {Array} array The array to query.
- * @param {number} [n=1] The number of elements to take.
- * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
- * @returns {Array} Returns the slice of `array`.
- * @example
- *
- * _.take([1, 2, 3]);
- * // => [1]
- *
- * _.take([1, 2, 3], 2);
- * // => [1, 2]
- *
- * _.take([1, 2, 3], 5);
- * // => [1, 2, 3]
- *
- * _.take([1, 2, 3], 0);
- * // => []
- */
- function take(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, 0, n < 0 ? 0 : n);
- }
-
- /**
- * Creates a slice of `array` with `n` elements taken from the end.
- *
- * @static
- * @memberOf _
- * @category Array
- * @param {Array} array The array to query.
- * @param {number} [n=1] The number of elements to take.
- * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
- * @returns {Array} Returns the slice of `array`.
- * @example
- *
- * _.takeRight([1, 2, 3]);
- * // => [3]
- *
- * _.takeRight([1, 2, 3], 2);
- * // => [2, 3]
- *
- * _.takeRight([1, 2, 3], 5);
- * // => [1, 2, 3]
- *
- * _.takeRight([1, 2, 3], 0);
- * // => []
- */
- function takeRight(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, n < 0 ? 0 : n);
- }
-
- /**
- * Creates a slice of `array` with elements taken from the end. Elements are
- * taken 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
- *
- * _.takeRightWhile([1, 2, 3], function(n) {
- * return n > 1;
- * });
- * // => [2, 3]
- *
- * var users = [
- * { 'user': 'barney', 'active': true },
- * { 'user': 'fred', 'active': false },
- * { 'user': 'pebbles', 'active': false }
- * ];
- *
- * // using the `_.matches` callback shorthand
- * _.pluck(_.takeRightWhile(users, { 'user': 'pebbles', 'active': false }), 'user');
- * // => ['pebbles']
- *
- * // using the `_.matchesProperty` callback shorthand
- * _.pluck(_.takeRightWhile(users, 'active', false), 'user');
- * // => ['fred', 'pebbles']
- *
- * // using the `_.property` callback shorthand
- * _.pluck(_.takeRightWhile(users, 'active'), 'user');
- * // => []
- */
- function takeRightWhile(array, predicate, thisArg) {
- return (array && array.length)
- ? baseWhile(array, getCallback(predicate, thisArg, 3), false, true)
- : [];
- }
-
- /**
- * Creates a slice of `array` with elements taken from the beginning. Elements
- * are taken 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
- *
- * _.takeWhile([1, 2, 3], function(n) {
- * return n < 3;
- * });
- * // => [1, 2]
- *
- * var users = [
- * { 'user': 'barney', 'active': false },
- * { 'user': 'fred', 'active': false},
- * { 'user': 'pebbles', 'active': true }
- * ];
- *
- * // using the `_.matches` callback shorthand
- * _.pluck(_.takeWhile(users, { 'user': 'barney', 'active': false }), 'user');
- * // => ['barney']
- *
- * // using the `_.matchesProperty` callback shorthand
- * _.pluck(_.takeWhile(users, 'active', false), 'user');
- * // => ['barney', 'fred']
- *
- * // using the `_.property` callback shorthand
- * _.pluck(_.takeWhile(users, 'active'), 'user');
- * // => []
- */
- function takeWhile(array, predicate, thisArg) {
- return (array && array.length)
- ? baseWhile(array, getCallback(predicate, thisArg, 3))
- : [];
- }
-
- /**
- * Creates an array of unique values, in order, from 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 combined values.
- * @example
- *
- * _.union([1, 2], [4, 2], [2, 1]);
- * // => [1, 2, 4]
- */
- var union = restParam(function(arrays) {
- return baseUniq(baseFlatten(arrays, false, true));
- });
-
- /**
- * Creates a duplicate-free version of an array, using
- * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
- * for equality comparisons, in which only the first occurence of each element
- * is kept. Providing `true` for `isSorted` performs a faster search algorithm
- * for sorted arrays. If an iteratee function is provided it is invoked for
- * each element in the array to generate the criterion by which uniqueness
- * is computed. The `iteratee` is bound to `thisArg` and invoked with three
- * arguments: (value, index, array).
- *
- * 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 _
- * @alias unique
- * @category Array
- * @param {Array} array The array to inspect.
- * @param {boolean} [isSorted] Specify the array is sorted.
- * @param {Function|Object|string} [iteratee] The function invoked per iteration.
- * @param {*} [thisArg] The `this` binding of `iteratee`.
- * @returns {Array} Returns the new duplicate-value-free array.
- * @example
- *
- * _.uniq([2, 1, 2]);
- * // => [2, 1]
- *
- * // using `isSorted`
- * _.uniq([1, 1, 2], true);
- * // => [1, 2]
- *
- * // using an iteratee function
- * _.uniq([1, 2.5, 1.5, 2], function(n) {
- * return this.floor(n);
- * }, Math);
- * // => [1, 2.5]
- *
- * // using the `_.property` callback shorthand
- * _.uniq([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
- * // => [{ 'x': 1 }, { 'x': 2 }]
- */
- function uniq(array, isSorted, iteratee, thisArg) {
- var length = array ? array.length : 0;
- if (!length) {
- return [];
- }
- if (isSorted != null && typeof isSorted != 'boolean') {
- thisArg = iteratee;
- iteratee = isIterateeCall(array, isSorted, thisArg) ? undefined : isSorted;
- isSorted = false;
- }
- var callback = getCallback();
- if (!(iteratee == null && callback === baseCallback)) {
- iteratee = callback(iteratee, thisArg, 3);
- }
- return (isSorted && getIndexOf() == baseIndexOf)
- ? sortedUniq(array, iteratee)
- : baseUniq(array, iteratee);
- }
-
- /**
- * This method is like `_.zip` except that it accepts an array of grouped
- * elements and creates an array regrouping the elements to their pre-zip
- * configuration.
- *
- * @static
- * @memberOf _
- * @category Array
- * @param {Array} array The array of grouped elements to process.
- * @returns {Array} Returns the new array of regrouped elements.
- * @example
- *
- * var zipped = _.zip(['fred', 'barney'], [30, 40], [true, false]);
- * // => [['fred', 30, true], ['barney', 40, false]]
- *
- * _.unzip(zipped);
- * // => [['fred', 'barney'], [30, 40], [true, false]]
- */
- function unzip(array) {
- if (!(array && array.length)) {
- return [];
- }
- var index = -1,
- length = 0;
-
- array = arrayFilter(array, function(group) {
- if (isArrayLike(group)) {
- length = nativeMax(group.length, length);
- return true;
- }
- });
- var result = Array(length);
- while (++index < length) {
- result[index] = arrayMap(array, baseProperty(index));
- }
- return result;
- }
-
- /**
- * This method is like `_.unzip` except that it accepts an iteratee to specify
- * how regrouped values should be combined. The `iteratee` is bound to `thisArg`
- * and invoked with four arguments: (accumulator, value, index, group).
- *
- * @static
- * @memberOf _
- * @category Array
- * @param {Array} array The array of grouped elements to process.
- * @param {Function} [iteratee] The function to combine regrouped values.
- * @param {*} [thisArg] The `this` binding of `iteratee`.
- * @returns {Array} Returns the new array of regrouped elements.
- * @example
- *
- * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
- * // => [[1, 10, 100], [2, 20, 200]]
- *
- * _.unzipWith(zipped, _.add);
- * // => [3, 30, 300]
- */
- function unzipWith(array, iteratee, thisArg) {
- var length = array ? array.length : 0;
- if (!length) {
- return [];
- }
- var result = unzip(array);
- if (iteratee == null) {
- return result;
- }
- iteratee = bindCallback(iteratee, thisArg, 4);
- return arrayMap(result, function(group) {
- return arrayReduce(group, iteratee, undefined, true);
- });
- }
-
- /**
- * Creates an array excluding all provided values 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 filter.
- * @param {...*} [values] The values to exclude.
- * @returns {Array} Returns the new array of filtered values.
- * @example
- *
- * _.without([1, 2, 1, 3], 1, 2);
- * // => [3]
- */
- var without = restParam(function(array, values) {
- return isArrayLike(array)
- ? baseDifference(array, values)
- : [];
- });
-
- /**
- * Creates an array of unique values that is the [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
- * of the provided arrays.
- *
- * @static
- * @memberOf _
- * @category Array
- * @param {...Array} [arrays] The arrays to inspect.
- * @returns {Array} Returns the new array of values.
- * @example
- *
- * _.xor([1, 2], [4, 2]);
- * // => [1, 4]
- */
- function xor() {
- var index = -1,
- length = arguments.length;
-
- while (++index < length) {
- var array = arguments[index];
- if (isArrayLike(array)) {
- var result = result
- ? arrayPush(baseDifference(result, array), baseDifference(array, result))
- : array;
- }
- }
- return result ? baseUniq(result) : [];
- }
-
- /**
- * Creates an array of grouped elements, the first of which contains the first
- * elements of the given arrays, the second of which contains the second elements
- * of the given arrays, and so on.
- *
- * @static
- * @memberOf _
- * @category Array
- * @param {...Array} [arrays] The arrays to process.
- * @returns {Array} Returns the new array of grouped elements.
- * @example
- *
- * _.zip(['fred', 'barney'], [30, 40], [true, false]);
- * // => [['fred', 30, true], ['barney', 40, false]]
- */
- var zip = restParam(unzip);
-
- /**
- * The inverse of `_.pairs`; this method returns an object composed from arrays
- * of property names and values. Provide either a single two dimensional array,
- * e.g. `[[key1, value1], [key2, value2]]` or two arrays, one of property names
- * and one of corresponding values.
- *
- * @static
- * @memberOf _
- * @alias object
- * @category Array
- * @param {Array} props The property names.
- * @param {Array} [values=[]] The property values.
- * @returns {Object} Returns the new object.
- * @example
- *
- * _.zipObject([['fred', 30], ['barney', 40]]);
- * // => { 'fred': 30, 'barney': 40 }
- *
- * _.zipObject(['fred', 'barney'], [30, 40]);
- * // => { 'fred': 30, 'barney': 40 }
- */
- function zipObject(props, values) {
- var index = -1,
- length = props ? props.length : 0,
- result = {};
-
- if (length && !values && !isArray(props[0])) {
- values = [];
- }
- while (++index < length) {
- var key = props[index];
- if (values) {
- result[key] = values[index];
- } else if (key) {
- result[key[0]] = key[1];
- }
- }
- return result;
- }
-
- /**
- * This method is like `_.zip` except that it accepts an iteratee to specify
- * how grouped values should be combined. The `iteratee` is bound to `thisArg`
- * and invoked with four arguments: (accumulator, value, index, group).
- *
- * @static
- * @memberOf _
- * @category Array
- * @param {...Array} [arrays] The arrays to process.
- * @param {Function} [iteratee] The function to combine grouped values.
- * @param {*} [thisArg] The `this` binding of `iteratee`.
- * @returns {Array} Returns the new array of grouped elements.
- * @example
- *
- * _.zipWith([1, 2], [10, 20], [100, 200], _.add);
- * // => [111, 222]
- */
- var zipWith = restParam(function(arrays) {
- var length = arrays.length,
- iteratee = length > 2 ? arrays[length - 2] : undefined,
- thisArg = length > 1 ? arrays[length - 1] : undefined;
-
- if (length > 2 && typeof iteratee == 'function') {
- length -= 2;
- } else {
- iteratee = (length > 1 && typeof thisArg == 'function') ? (--length, thisArg) : undefined;
- thisArg = undefined;
- }
- arrays.length = length;
- return unzipWith(arrays, iteratee, thisArg);
- });
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Creates a `lodash` object that wraps `value` with explicit method
- * chaining enabled.
- *
- * @static
- * @memberOf _
- * @category Chain
- * @param {*} value The value to wrap.
- * @returns {Object} Returns the new `lodash` wrapper instance.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'age': 36 },
- * { 'user': 'fred', 'age': 40 },
- * { 'user': 'pebbles', 'age': 1 }
- * ];
- *
- * var youngest = _.chain(users)
- * .sortBy('age')
- * .map(function(chr) {
- * return chr.user + ' is ' + chr.age;
- * })
- * .first()
- * .value();
- * // => 'pebbles is 1'
- */
- function chain(value) {
- var result = lodash(value);
- result.__chain__ = true;
- return result;
- }
-
- /**
- * This method invokes `interceptor` and returns `value`. The interceptor is
- * bound to `thisArg` and invoked with one argument; (value). The purpose of
- * this method is to "tap into" a method chain in order to perform operations
- * on intermediate results within the chain.
- *
- * @static
- * @memberOf _
- * @category Chain
- * @param {*} value The value to provide to `interceptor`.
- * @param {Function} interceptor The function to invoke.
- * @param {*} [thisArg] The `this` binding of `interceptor`.
- * @returns {*} Returns `value`.
- * @example
- *
- * _([1, 2, 3])
- * .tap(function(array) {
- * array.pop();
- * })
- * .reverse()
- * .value();
- * // => [2, 1]
- */
- function tap(value, interceptor, thisArg) {
- interceptor.call(thisArg, value);
- return value;
- }
-
- /**
- * This method is like `_.tap` except that it returns the result of `interceptor`.
- *
- * @static
- * @memberOf _
- * @category Chain
- * @param {*} value The value to provide to `interceptor`.
- * @param {Function} interceptor The function to invoke.
- * @param {*} [thisArg] The `this` binding of `interceptor`.
- * @returns {*} Returns the result of `interceptor`.
- * @example
- *
- * _(' abc ')
- * .chain()
- * .trim()
- * .thru(function(value) {
- * return [value];
- * })
- * .value();
- * // => ['abc']
- */
- function thru(value, interceptor, thisArg) {
- return interceptor.call(thisArg, value);
- }
-
- /**
- * Enables explicit method chaining on the wrapper object.
- *
- * @name chain
- * @memberOf _
- * @category Chain
- * @returns {Object} Returns the new `lodash` wrapper instance.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'age': 36 },
- * { 'user': 'fred', 'age': 40 }
- * ];
- *
- * // without explicit chaining
- * _(users).first();
- * // => { 'user': 'barney', 'age': 36 }
- *
- * // with explicit chaining
- * _(users).chain()
- * .first()
- * .pick('user')
- * .value();
- * // => { 'user': 'barney' }
- */
- function wrapperChain() {
- return chain(this);
- }
-
- /**
- * Executes the chained sequence and returns the wrapped result.
- *
- * @name commit
- * @memberOf _
- * @category Chain
- * @returns {Object} Returns the new `lodash` wrapper instance.
- * @example
- *
- * var array = [1, 2];
- * var wrapped = _(array).push(3);
- *
- * console.log(array);
- * // => [1, 2]
- *
- * wrapped = wrapped.commit();
- * console.log(array);
- * // => [1, 2, 3]
- *
- * wrapped.last();
- * // => 3
- *
- * console.log(array);
- * // => [1, 2, 3]
- */
- function wrapperCommit() {
- return new LodashWrapper(this.value(), this.__chain__);
- }
-
- /**
- * Creates a new array joining a wrapped array with any additional arrays
- * and/or values.
- *
- * @name concat
- * @memberOf _
- * @category Chain
- * @param {...*} [values] The values to concatenate.
- * @returns {Array} Returns the new concatenated array.
- * @example
- *
- * var array = [1];
- * var wrapped = _(array).concat(2, [3], [[4]]);
- *
- * console.log(wrapped.value());
- * // => [1, 2, 3, [4]]
- *
- * console.log(array);
- * // => [1]
- */
- var wrapperConcat = restParam(function(values) {
- values = baseFlatten(values);
- return this.thru(function(array) {
- return arrayConcat(isArray(array) ? array : [toObject(array)], values);
- });
- });
-
- /**
- * Creates a clone of the chained sequence planting `value` as the wrapped value.
- *
- * @name plant
- * @memberOf _
- * @category Chain
- * @returns {Object} Returns the new `lodash` wrapper instance.
- * @example
- *
- * var array = [1, 2];
- * var wrapped = _(array).map(function(value) {
- * return Math.pow(value, 2);
- * });
- *
- * var other = [3, 4];
- * var otherWrapped = wrapped.plant(other);
- *
- * otherWrapped.value();
- * // => [9, 16]
- *
- * wrapped.value();
- * // => [1, 4]
- */
- function wrapperPlant(value) {
- var result,
- parent = this;
-
- while (parent instanceof baseLodash) {
- var clone = wrapperClone(parent);
- if (result) {
- previous.__wrapped__ = clone;
- } else {
- result = clone;
- }
- var previous = clone;
- parent = parent.__wrapped__;
- }
- previous.__wrapped__ = value;
- return result;
- }
-
- /**
- * Reverses the wrapped array so the first element becomes the last, the
- * second element becomes the second to last, and so on.
- *
- * **Note:** This method mutates the wrapped array.
- *
- * @name reverse
- * @memberOf _
- * @category Chain
- * @returns {Object} Returns the new reversed `lodash` wrapper instance.
- * @example
- *
- * var array = [1, 2, 3];
- *
- * _(array).reverse().value()
- * // => [3, 2, 1]
- *
- * console.log(array);
- * // => [3, 2, 1]
- */
- function wrapperReverse() {
- var value = this.__wrapped__;
-
- var interceptor = function(value) {
- return (wrapped && wrapped.__dir__ < 0) ? value : value.reverse();
- };
- if (value instanceof LazyWrapper) {
- var wrapped = value;
- if (this.__actions__.length) {
- wrapped = new LazyWrapper(this);
- }
- wrapped = wrapped.reverse();
- wrapped.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
- return new LodashWrapper(wrapped, this.__chain__);
- }
- return this.thru(interceptor);
- }
-
- /**
- * Produces the result of coercing the unwrapped value to a string.
- *
- * @name toString
- * @memberOf _
- * @category Chain
- * @returns {string} Returns the coerced string value.
- * @example
- *
- * _([1, 2, 3]).toString();
- * // => '1,2,3'
- */
- function wrapperToString() {
- return (this.value() + '');
- }
-
- /**
- * Executes the chained sequence to extract the unwrapped value.
- *
- * @name value
- * @memberOf _
- * @alias run, toJSON, valueOf
- * @category Chain
- * @returns {*} Returns the resolved unwrapped value.
- * @example
- *
- * _([1, 2, 3]).value();
- * // => [1, 2, 3]
- */
- function wrapperValue() {
- return baseWrapperValue(this.__wrapped__, this.__actions__);
- }
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Creates an array of elements corresponding to the given keys, or indexes,
- * of `collection`. Keys may be specified as individual arguments or as arrays
- * of keys.
- *
- * @static
- * @memberOf _
- * @category Collection
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {...(number|number[]|string|string[])} [props] The property names
- * or indexes of elements to pick, specified individually or in arrays.
- * @returns {Array} Returns the new array of picked elements.
- * @example
- *
- * _.at(['a', 'b', 'c'], [0, 2]);
- * // => ['a', 'c']
- *
- * _.at(['barney', 'fred', 'pebbles'], 0, 2);
- * // => ['barney', 'pebbles']
- */
- var at = restParam(function(collection, props) {
- return baseAt(collection, baseFlatten(props));
- });
-
- /**
- * Creates an object composed of keys generated from the results of running
- * each element of `collection` through `iteratee`. The corresponding value
- * of each key is the number of times the key was returned by `iteratee`.
- * The `iteratee` is bound to `thisArg` and invoked with three arguments:
- * (value, index|key, collection).
- *
- * 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 Collection
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function|Object|string} [iteratee=_.identity] The function invoked
- * per iteration.
- * @param {*} [thisArg] The `this` binding of `iteratee`.
- * @returns {Object} Returns the composed aggregate object.
- * @example
- *
- * _.countBy([4.3, 6.1, 6.4], function(n) {
- * return Math.floor(n);
- * });
- * // => { '4': 1, '6': 2 }
- *
- * _.countBy([4.3, 6.1, 6.4], function(n) {
- * return this.floor(n);
- * }, Math);
- * // => { '4': 1, '6': 2 }
- *
- * _.countBy(['one', 'two', 'three'], 'length');
- * // => { '3': 2, '5': 1 }
- */
- var countBy = createAggregator(function(result, value, key) {
- hasOwnProperty.call(result, key) ? ++result[key] : (result[key] = 1);
- });
-
- /**
- * Checks if `predicate` returns truthy for **all** elements of `collection`.
- * The predicate is bound to `thisArg` and invoked with three arguments:
- * (value, index|key, collection).
- *
- * 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 _
- * @alias all
- * @category Collection
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function|Object|string} [predicate=_.identity] The function invoked
- * per iteration.
- * @param {*} [thisArg] The `this` binding of `predicate`.
- * @returns {boolean} Returns `true` if all elements pass the predicate check,
- * else `false`.
- * @example
- *
- * _.every([true, 1, null, 'yes'], Boolean);
- * // => false
- *
- * var users = [
- * { 'user': 'barney', 'active': false },
- * { 'user': 'fred', 'active': false }
- * ];
- *
- * // using the `_.matches` callback shorthand
- * _.every(users, { 'user': 'barney', 'active': false });
- * // => false
- *
- * // using the `_.matchesProperty` callback shorthand
- * _.every(users, 'active', false);
- * // => true
- *
- * // using the `_.property` callback shorthand
- * _.every(users, 'active');
- * // => false
- */
- function every(collection, predicate, thisArg) {
- var func = isArray(collection) ? arrayEvery : baseEvery;
- if (thisArg && isIterateeCall(collection, predicate, thisArg)) {
- predicate = undefined;
- }
- if (typeof predicate != 'function' || thisArg !== undefined) {
- predicate = getCallback(predicate, thisArg, 3);
- }
- return func(collection, predicate);
- }
-
- /**
- * Iterates over elements of `collection`, returning an array of all elements
- * `predicate` returns truthy for. The predicate is bound to `thisArg` and
- * invoked with three arguments: (value, index|key, collection).
- *
- * 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 _
- * @alias select
- * @category Collection
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function|Object|string} [predicate=_.identity] The function invoked
- * per iteration.
- * @param {*} [thisArg] The `this` binding of `predicate`.
- * @returns {Array} Returns the new filtered array.
- * @example
- *
- * _.filter([4, 5, 6], function(n) {
- * return n % 2 == 0;
- * });
- * // => [4, 6]
- *
- * var users = [
- * { 'user': 'barney', 'age': 36, 'active': true },
- * { 'user': 'fred', 'age': 40, 'active': false }
- * ];
- *
- * // using the `_.matches` callback shorthand
- * _.pluck(_.filter(users, { 'age': 36, 'active': true }), 'user');
- * // => ['barney']
- *
- * // using the `_.matchesProperty` callback shorthand
- * _.pluck(_.filter(users, 'active', false), 'user');
- * // => ['fred']
- *
- * // using the `_.property` callback shorthand
- * _.pluck(_.filter(users, 'active'), 'user');
- * // => ['barney']
- */
- function filter(collection, predicate, thisArg) {
- var func = isArray(collection) ? arrayFilter : baseFilter;
- predicate = getCallback(predicate, thisArg, 3);
- return func(collection, predicate);
- }
-
- /**
- * Iterates over elements of `collection`, returning the first element
- * `predicate` returns truthy for. The predicate is bound to `thisArg` and
- * invoked with three arguments: (value, index|key, collection).
- *
- * 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 _
- * @alias detect
- * @category Collection
- * @param {Array|Object|string} collection The collection to search.
- * @param {Function|Object|string} [predicate=_.identity] The function invoked
- * per iteration.
- * @param {*} [thisArg] The `this` binding of `predicate`.
- * @returns {*} Returns the matched element, else `undefined`.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'age': 36, 'active': true },
- * { 'user': 'fred', 'age': 40, 'active': false },
- * { 'user': 'pebbles', 'age': 1, 'active': true }
- * ];
- *
- * _.result(_.find(users, function(chr) {
- * return chr.age < 40;
- * }), 'user');
- * // => 'barney'
- *
- * // using the `_.matches` callback shorthand
- * _.result(_.find(users, { 'age': 1, 'active': true }), 'user');
- * // => 'pebbles'
- *
- * // using the `_.matchesProperty` callback shorthand
- * _.result(_.find(users, 'active', false), 'user');
- * // => 'fred'
- *
- * // using the `_.property` callback shorthand
- * _.result(_.find(users, 'active'), 'user');
- * // => 'barney'
- */
- var find = createFind(baseEach);
-
- /**
- * This method is like `_.find` except that it iterates over elements of
- * `collection` from right to left.
- *
- * @static
- * @memberOf _
- * @category Collection
- * @param {Array|Object|string} collection The collection to search.
- * @param {Function|Object|string} [predicate=_.identity] The function invoked
- * per iteration.
- * @param {*} [thisArg] The `this` binding of `predicate`.
- * @returns {*} Returns the matched element, else `undefined`.
- * @example
- *
- * _.findLast([1, 2, 3, 4], function(n) {
- * return n % 2 == 1;
- * });
- * // => 3
- */
- var findLast = createFind(baseEachRight, true);
-
- /**
- * Performs a deep comparison between each element in `collection` and the
- * source object, returning the first element that has equivalent property
- * values.
- *
- * **Note:** This method supports comparing arrays, booleans, `Date` objects,
- * numbers, `Object` objects, regexes, and strings. Objects are compared by
- * their own, not inherited, enumerable properties. For comparing a single
- * own or inherited property value see `_.matchesProperty`.
- *
- * @static
- * @memberOf _
- * @category Collection
- * @param {Array|Object|string} collection The collection to search.
- * @param {Object} source The object of property values to match.
- * @returns {*} Returns the matched element, else `undefined`.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'age': 36, 'active': true },
- * { 'user': 'fred', 'age': 40, 'active': false }
- * ];
- *
- * _.result(_.findWhere(users, { 'age': 36, 'active': true }), 'user');
- * // => 'barney'
- *
- * _.result(_.findWhere(users, { 'age': 40, 'active': false }), 'user');
- * // => 'fred'
- */
- function findWhere(collection, source) {
- return find(collection, baseMatches(source));
- }
-
- /**
- * Iterates over elements of `collection` invoking `iteratee` for each element.
- * The `iteratee` is bound to `thisArg` and invoked with three arguments:
- * (value, index|key, collection). Iteratee functions may exit iteration early
- * by explicitly returning `false`.
- *
- * **Note:** As with other "Collections" methods, objects with a "length" property
- * are iterated like arrays. To avoid this behavior `_.forIn` or `_.forOwn`
- * may be used for object iteration.
- *
- * @static
- * @memberOf _
- * @alias each
- * @category Collection
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @param {*} [thisArg] The `this` binding of `iteratee`.
- * @returns {Array|Object|string} Returns `collection`.
- * @example
- *
- * _([1, 2]).forEach(function(n) {
- * console.log(n);
- * }).value();
- * // => logs each value from left to right and returns the array
- *
- * _.forEach({ 'a': 1, 'b': 2 }, function(n, key) {
- * console.log(n, key);
- * });
- * // => logs each value-key pair and returns the object (iteration order is not guaranteed)
- */
- var forEach = createForEach(arrayEach, baseEach);
-
- /**
- * This method is like `_.forEach` except that it iterates over elements of
- * `collection` from right to left.
- *
- * @static
- * @memberOf _
- * @alias eachRight
- * @category Collection
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @param {*} [thisArg] The `this` binding of `iteratee`.
- * @returns {Array|Object|string} Returns `collection`.
- * @example
- *
- * _([1, 2]).forEachRight(function(n) {
- * console.log(n);
- * }).value();
- * // => logs each value from right to left and returns the array
- */
- var forEachRight = createForEach(arrayEachRight, baseEachRight);
-
- /**
- * Creates an object composed of keys generated from the results of running
- * each element of `collection` through `iteratee`. The corresponding value
- * of each key is an array of the elements responsible for generating the key.
- * The `iteratee` is bound to `thisArg` and invoked with three arguments:
- * (value, index|key, collection).
- *
- * 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 Collection
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function|Object|string} [iteratee=_.identity] The function invoked
- * per iteration.
- * @param {*} [thisArg] The `this` binding of `iteratee`.
- * @returns {Object} Returns the composed aggregate object.
- * @example
- *
- * _.groupBy([4.2, 6.1, 6.4], function(n) {
- * return Math.floor(n);
- * });
- * // => { '4': [4.2], '6': [6.1, 6.4] }
- *
- * _.groupBy([4.2, 6.1, 6.4], function(n) {
- * return this.floor(n);
- * }, Math);
- * // => { '4': [4.2], '6': [6.1, 6.4] }
- *
- * // using the `_.property` callback shorthand
- * _.groupBy(['one', 'two', 'three'], 'length');
- * // => { '3': ['one', 'two'], '5': ['three'] }
- */
- var groupBy = createAggregator(function(result, value, key) {
- if (hasOwnProperty.call(result, key)) {
- result[key].push(value);
- } else {
- result[key] = [value];
- }
- });
-
- /**
- * Checks if `value` is in `collection` using
- * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
- * for equality comparisons. If `fromIndex` is negative, it is used as the offset
- * from the end of `collection`.
- *
- * @static
- * @memberOf _
- * @alias contains, include
- * @category Collection
- * @param {Array|Object|string} collection The collection to search.
- * @param {*} target The value to search for.
- * @param {number} [fromIndex=0] The index to search from.
- * @param- {Object} [guard] Enables use as a callback for functions like `_.reduce`.
- * @returns {boolean} Returns `true` if a matching element is found, else `false`.
- * @example
- *
- * _.includes([1, 2, 3], 1);
- * // => true
- *
- * _.includes([1, 2, 3], 1, 2);
- * // => false
- *
- * _.includes({ 'user': 'fred', 'age': 40 }, 'fred');
- * // => true
- *
- * _.includes('pebbles', 'eb');
- * // => true
- */
- function includes(collection, target, fromIndex, guard) {
- var length = collection ? getLength(collection) : 0;
- if (!isLength(length)) {
- collection = values(collection);
- length = collection.length;
- }
- if (typeof fromIndex != 'number' || (guard && isIterateeCall(target, fromIndex, guard))) {
- fromIndex = 0;
- } else {
- fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : (fromIndex || 0);
- }
- return (typeof collection == 'string' || !isArray(collection) && isString(collection))
- ? (fromIndex <= length && collection.indexOf(target, fromIndex) > -1)
- : (!!length && getIndexOf(collection, target, fromIndex) > -1);
- }
-
- /**
- * Creates an object composed of keys generated from the results of running
- * each element of `collection` through `iteratee`. The corresponding value
- * of each key is the last element responsible for generating the key. The
- * iteratee function is bound to `thisArg` and invoked with three arguments:
- * (value, index|key, collection).
- *
- * 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 Collection
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function|Object|string} [iteratee=_.identity] The function invoked
- * per iteration.
- * @param {*} [thisArg] The `this` binding of `iteratee`.
- * @returns {Object} Returns the composed aggregate object.
- * @example
- *
- * var keyData = [
- * { 'dir': 'left', 'code': 97 },
- * { 'dir': 'right', 'code': 100 }
- * ];
- *
- * _.indexBy(keyData, 'dir');
- * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
- *
- * _.indexBy(keyData, function(object) {
- * return String.fromCharCode(object.code);
- * });
- * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
- *
- * _.indexBy(keyData, function(object) {
- * return this.fromCharCode(object.code);
- * }, String);
- * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
- */
- var indexBy = createAggregator(function(result, value, key) {
- result[key] = value;
- });
-
- /**
- * Invokes the method at `path` of each element in `collection`, returning
- * an array of the results of each invoked method. Any additional arguments
- * are provided to each invoked method. If `methodName` is a function it is
- * invoked for, and `this` bound to, each element in `collection`.
- *
- * @static
- * @memberOf _
- * @category Collection
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Array|Function|string} path The path of the method to invoke or
- * the function invoked per iteration.
- * @param {...*} [args] The arguments to invoke the method with.
- * @returns {Array} Returns the array of results.
- * @example
- *
- * _.invoke([[5, 1, 7], [3, 2, 1]], 'sort');
- * // => [[1, 5, 7], [1, 2, 3]]
- *
- * _.invoke([123, 456], String.prototype.split, '');
- * // => [['1', '2', '3'], ['4', '5', '6']]
- */
- var invoke = restParam(function(collection, path, args) {
- var index = -1,
- isFunc = typeof path == 'function',
- isProp = isKey(path),
- result = isArrayLike(collection) ? Array(collection.length) : [];
-
- baseEach(collection, function(value) {
- var func = isFunc ? path : ((isProp && value != null) ? value[path] : undefined);
- result[++index] = func ? func.apply(value, args) : invokePath(value, path, args);
- });
- return result;
- });
-
- /**
- * Creates an array of values by running each element in `collection` through
- * `iteratee`. The `iteratee` is bound to `thisArg` and invoked with three
- * arguments: (value, index|key, collection).
- *
- * 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`.
- *
- * Many lodash methods are guarded to work as iteratees for methods like
- * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
- *
- * The guarded methods are:
- * `ary`, `callback`, `chunk`, `clone`, `create`, `curry`, `curryRight`,
- * `drop`, `dropRight`, `every`, `fill`, `flatten`, `invert`, `max`, `min`,
- * `parseInt`, `slice`, `sortBy`, `take`, `takeRight`, `template`, `trim`,
- * `trimLeft`, `trimRight`, `trunc`, `random`, `range`, `sample`, `some`,
- * `sum`, `uniq`, and `words`
- *
- * @static
- * @memberOf _
- * @alias collect
- * @category Collection
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function|Object|string} [iteratee=_.identity] The function invoked
- * per iteration.
- * @param {*} [thisArg] The `this` binding of `iteratee`.
- * @returns {Array} Returns the new mapped array.
- * @example
- *
- * function timesThree(n) {
- * return n * 3;
- * }
- *
- * _.map([1, 2], timesThree);
- * // => [3, 6]
- *
- * _.map({ 'a': 1, 'b': 2 }, timesThree);
- * // => [3, 6] (iteration order is not guaranteed)
- *
- * var users = [
- * { 'user': 'barney' },
- * { 'user': 'fred' }
- * ];
- *
- * // using the `_.property` callback shorthand
- * _.map(users, 'user');
- * // => ['barney', 'fred']
- */
- function map(collection, iteratee, thisArg) {
- var func = isArray(collection) ? arrayMap : baseMap;
- iteratee = getCallback(iteratee, thisArg, 3);
- return func(collection, iteratee);
- }
-
- /**
- * Creates an array of elements split into two groups, the first of which
- * contains elements `predicate` returns truthy for, while the second of which
- * contains elements `predicate` returns falsey for. The predicate is bound
- * to `thisArg` and invoked with three arguments: (value, index|key, collection).
- *
- * 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 Collection
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function|Object|string} [predicate=_.identity] The function invoked
- * per iteration.
- * @param {*} [thisArg] The `this` binding of `predicate`.
- * @returns {Array} Returns the array of grouped elements.
- * @example
- *
- * _.partition([1, 2, 3], function(n) {
- * return n % 2;
- * });
- * // => [[1, 3], [2]]
- *
- * _.partition([1.2, 2.3, 3.4], function(n) {
- * return this.floor(n) % 2;
- * }, Math);
- * // => [[1.2, 3.4], [2.3]]
- *
- * var users = [
- * { 'user': 'barney', 'age': 36, 'active': false },
- * { 'user': 'fred', 'age': 40, 'active': true },
- * { 'user': 'pebbles', 'age': 1, 'active': false }
- * ];
- *
- * var mapper = function(array) {
- * return _.pluck(array, 'user');
- * };
- *
- * // using the `_.matches` callback shorthand
- * _.map(_.partition(users, { 'age': 1, 'active': false }), mapper);
- * // => [['pebbles'], ['barney', 'fred']]
- *
- * // using the `_.matchesProperty` callback shorthand
- * _.map(_.partition(users, 'active', false), mapper);
- * // => [['barney', 'pebbles'], ['fred']]
- *
- * // using the `_.property` callback shorthand
- * _.map(_.partition(users, 'active'), mapper);
- * // => [['fred'], ['barney', 'pebbles']]
- */
- var partition = createAggregator(function(result, value, key) {
- result[key ? 0 : 1].push(value);
- }, function() { return [[], []]; });
-
- /**
- * Gets the property value of `path` from all elements in `collection`.
- *
- * @static
- * @memberOf _
- * @category Collection
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Array|string} path The path of the property to pluck.
- * @returns {Array} Returns the property values.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'age': 36 },
- * { 'user': 'fred', 'age': 40 }
- * ];
- *
- * _.pluck(users, 'user');
- * // => ['barney', 'fred']
- *
- * var userIndex = _.indexBy(users, 'user');
- * _.pluck(userIndex, 'age');
- * // => [36, 40] (iteration order is not guaranteed)
- */
- function pluck(collection, path) {
- return map(collection, property(path));
- }
-
- /**
- * Reduces `collection` to a value which is the accumulated result of running
- * each element in `collection` through `iteratee`, where each successive
- * invocation is supplied the return value of the previous. If `accumulator`
- * is not provided the first element of `collection` is used as the initial
- * value. The `iteratee` is bound to `thisArg` and invoked with four arguments:
- * (accumulator, value, index|key, collection).
- *
- * Many lodash methods are guarded to work as iteratees for methods like
- * `_.reduce`, `_.reduceRight`, and `_.transform`.
- *
- * The guarded methods are:
- * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `sortByAll`,
- * and `sortByOrder`
- *
- * @static
- * @memberOf _
- * @alias foldl, inject
- * @category Collection
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @param {*} [accumulator] The initial value.
- * @param {*} [thisArg] The `this` binding of `iteratee`.
- * @returns {*} Returns the accumulated value.
- * @example
- *
- * _.reduce([1, 2], function(total, n) {
- * return total + n;
- * });
- * // => 3
- *
- * _.reduce({ 'a': 1, 'b': 2 }, function(result, n, key) {
- * result[key] = n * 3;
- * return result;
- * }, {});
- * // => { 'a': 3, 'b': 6 } (iteration order is not guaranteed)
- */
- var reduce = createReduce(arrayReduce, baseEach);
-
- /**
- * This method is like `_.reduce` except that it iterates over elements of
- * `collection` from right to left.
- *
- * @static
- * @memberOf _
- * @alias foldr
- * @category Collection
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @param {*} [accumulator] The initial value.
- * @param {*} [thisArg] The `this` binding of `iteratee`.
- * @returns {*} Returns the accumulated value.
- * @example
- *
- * var array = [[0, 1], [2, 3], [4, 5]];
- *
- * _.reduceRight(array, function(flattened, other) {
- * return flattened.concat(other);
- * }, []);
- * // => [4, 5, 2, 3, 0, 1]
- */
- var reduceRight = createReduce(arrayReduceRight, baseEachRight);
-
- /**
- * The opposite of `_.filter`; this method returns the elements of `collection`
- * that `predicate` does **not** return truthy for.
- *
- * @static
- * @memberOf _
- * @category Collection
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function|Object|string} [predicate=_.identity] The function invoked
- * per iteration.
- * @param {*} [thisArg] The `this` binding of `predicate`.
- * @returns {Array} Returns the new filtered array.
- * @example
- *
- * _.reject([1, 2, 3, 4], function(n) {
- * return n % 2 == 0;
- * });
- * // => [1, 3]
- *
- * var users = [
- * { 'user': 'barney', 'age': 36, 'active': false },
- * { 'user': 'fred', 'age': 40, 'active': true }
- * ];
- *
- * // using the `_.matches` callback shorthand
- * _.pluck(_.reject(users, { 'age': 40, 'active': true }), 'user');
- * // => ['barney']
- *
- * // using the `_.matchesProperty` callback shorthand
- * _.pluck(_.reject(users, 'active', false), 'user');
- * // => ['fred']
- *
- * // using the `_.property` callback shorthand
- * _.pluck(_.reject(users, 'active'), 'user');
- * // => ['barney']
- */
- function reject(collection, predicate, thisArg) {
- var func = isArray(collection) ? arrayFilter : baseFilter;
- predicate = getCallback(predicate, thisArg, 3);
- return func(collection, function(value, index, collection) {
- return !predicate(value, index, collection);
- });
- }
-
- /**
- * Gets a random element or `n` random elements from a collection.
- *
- * @static
- * @memberOf _
- * @category Collection
- * @param {Array|Object|string} collection The collection to sample.
- * @param {number} [n] The number of elements to sample.
- * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
- * @returns {*} Returns the random sample(s).
- * @example
- *
- * _.sample([1, 2, 3, 4]);
- * // => 2
- *
- * _.sample([1, 2, 3, 4], 2);
- * // => [3, 1]
- */
- function sample(collection, n, guard) {
- if (guard ? isIterateeCall(collection, n, guard) : n == null) {
- collection = toIterable(collection);
- var length = collection.length;
- return length > 0 ? collection[baseRandom(0, length - 1)] : undefined;
- }
- var index = -1,
- result = toArray(collection),
- length = result.length,
- lastIndex = length - 1;
-
- n = nativeMin(n < 0 ? 0 : (+n || 0), length);
- while (++index < n) {
- var rand = baseRandom(index, lastIndex),
- value = result[rand];
-
- result[rand] = result[index];
- result[index] = value;
- }
- result.length = n;
- return result;
- }
-
- /**
- * Creates an array of shuffled values, using a version of the
- * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
- *
- * @static
- * @memberOf _
- * @category Collection
- * @param {Array|Object|string} collection The collection to shuffle.
- * @returns {Array} Returns the new shuffled array.
- * @example
- *
- * _.shuffle([1, 2, 3, 4]);
- * // => [4, 1, 3, 2]
- */
- function shuffle(collection) {
- return sample(collection, POSITIVE_INFINITY);
- }
-
- /**
- * Gets the size of `collection` by returning its length for array-like
- * values or the number of own enumerable properties for objects.
- *
- * @static
- * @memberOf _
- * @category Collection
- * @param {Array|Object|string} collection The collection to inspect.
- * @returns {number} Returns the size of `collection`.
- * @example
- *
- * _.size([1, 2, 3]);
- * // => 3
- *
- * _.size({ 'a': 1, 'b': 2 });
- * // => 2
- *
- * _.size('pebbles');
- * // => 7
- */
- function size(collection) {
- var length = collection ? getLength(collection) : 0;
- return isLength(length) ? length : keys(collection).length;
- }
-
- /**
- * Checks if `predicate` returns truthy for **any** element of `collection`.
- * The function returns as soon as it finds a passing value and does not iterate
- * over the entire collection. The predicate is bound to `thisArg` and invoked
- * with three arguments: (value, index|key, collection).
- *
- * 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 _
- * @alias any
- * @category Collection
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function|Object|string} [predicate=_.identity] The function invoked
- * per iteration.
- * @param {*} [thisArg] The `this` binding of `predicate`.
- * @returns {boolean} Returns `true` if any element passes the predicate check,
- * else `false`.
- * @example
- *
- * _.some([null, 0, 'yes', false], Boolean);
- * // => true
- *
- * var users = [
- * { 'user': 'barney', 'active': true },
- * { 'user': 'fred', 'active': false }
- * ];
- *
- * // using the `_.matches` callback shorthand
- * _.some(users, { 'user': 'barney', 'active': false });
- * // => false
- *
- * // using the `_.matchesProperty` callback shorthand
- * _.some(users, 'active', false);
- * // => true
- *
- * // using the `_.property` callback shorthand
- * _.some(users, 'active');
- * // => true
- */
- function some(collection, predicate, thisArg) {
- var func = isArray(collection) ? arraySome : baseSome;
- if (thisArg && isIterateeCall(collection, predicate, thisArg)) {
- predicate = undefined;
- }
- if (typeof predicate != 'function' || thisArg !== undefined) {
- predicate = getCallback(predicate, thisArg, 3);
- }
- return func(collection, predicate);
- }
-
- /**
- * Creates an array of elements, sorted in ascending order by the results of
- * running each element in a collection through `iteratee`. This method performs
- * a stable sort, that is, it preserves the original sort order of equal elements.
- * The `iteratee` is bound to `thisArg` and invoked with three arguments:
- * (value, index|key, collection).
- *
- * 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 Collection
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function|Object|string} [iteratee=_.identity] The function invoked
- * per iteration.
- * @param {*} [thisArg] The `this` binding of `iteratee`.
- * @returns {Array} Returns the new sorted array.
- * @example
- *
- * _.sortBy([1, 2, 3], function(n) {
- * return Math.sin(n);
- * });
- * // => [3, 1, 2]
- *
- * _.sortBy([1, 2, 3], function(n) {
- * return this.sin(n);
- * }, Math);
- * // => [3, 1, 2]
- *
- * var users = [
- * { 'user': 'fred' },
- * { 'user': 'pebbles' },
- * { 'user': 'barney' }
- * ];
- *
- * // using the `_.property` callback shorthand
- * _.pluck(_.sortBy(users, 'user'), 'user');
- * // => ['barney', 'fred', 'pebbles']
- */
- function sortBy(collection, iteratee, thisArg) {
- if (collection == null) {
- return [];
- }
- if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {
- iteratee = undefined;
- }
- var index = -1;
- iteratee = getCallback(iteratee, thisArg, 3);
-
- var result = baseMap(collection, function(value, key, collection) {
- return { 'criteria': iteratee(value, key, collection), 'index': ++index, 'value': value };
- });
- return baseSortBy(result, compareAscending);
- }
-
- /**
- * This method is like `_.sortBy` except that it can sort by multiple iteratees
- * or property names.
- *
- * If a property name is provided for an iteratee the created `_.property`
- * style callback returns the property value of the given element.
- *
- * If an object is provided for an iteratee the created `_.matches` style
- * callback returns `true` for elements that have the properties of the given
- * object, else `false`.
- *
- * @static
- * @memberOf _
- * @category Collection
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {...(Function|Function[]|Object|Object[]|string|string[])} iteratees
- * The iteratees to sort by, specified as individual values or arrays of values.
- * @returns {Array} Returns the new sorted array.
- * @example
- *
- * var users = [
- * { 'user': 'fred', 'age': 48 },
- * { 'user': 'barney', 'age': 36 },
- * { 'user': 'fred', 'age': 42 },
- * { 'user': 'barney', 'age': 34 }
- * ];
- *
- * _.map(_.sortByAll(users, ['user', 'age']), _.values);
- * // => [['barney', 34], ['barney', 36], ['fred', 42], ['fred', 48]]
- *
- * _.map(_.sortByAll(users, 'user', function(chr) {
- * return Math.floor(chr.age / 10);
- * }), _.values);
- * // => [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]]
- */
- var sortByAll = restParam(function(collection, iteratees) {
- if (collection == null) {
- return [];
- }
- var guard = iteratees[2];
- if (guard && isIterateeCall(iteratees[0], iteratees[1], guard)) {
- iteratees.length = 1;
- }
- return baseSortByOrder(collection, baseFlatten(iteratees), []);
- });
-
- /**
- * This method is like `_.sortByAll` except that it allows specifying the
- * sort orders of the iteratees to sort by. If `orders` is unspecified, all
- * values are sorted in ascending order. Otherwise, a value is sorted in
- * ascending order if its corresponding order is "asc", and descending if "desc".
- *
- * If a property name is provided for an iteratee the created `_.property`
- * style callback returns the property value of the given element.
- *
- * If an object is provided for an iteratee the created `_.matches` style
- * callback returns `true` for elements that have the properties of the given
- * object, else `false`.
- *
- * @static
- * @memberOf _
- * @category Collection
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
- * @param {boolean[]} [orders] The sort orders of `iteratees`.
- * @param- {Object} [guard] Enables use as a callback for functions like `_.reduce`.
- * @returns {Array} Returns the new sorted array.
- * @example
- *
- * var users = [
- * { 'user': 'fred', 'age': 48 },
- * { 'user': 'barney', 'age': 34 },
- * { 'user': 'fred', 'age': 42 },
- * { 'user': 'barney', 'age': 36 }
- * ];
- *
- * // sort by `user` in ascending order and by `age` in descending order
- * _.map(_.sortByOrder(users, ['user', 'age'], ['asc', 'desc']), _.values);
- * // => [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]]
- */
- function sortByOrder(collection, iteratees, orders, guard) {
- if (collection == null) {
- return [];
- }
- if (guard && isIterateeCall(iteratees, orders, guard)) {
- orders = undefined;
- }
- if (!isArray(iteratees)) {
- iteratees = iteratees == null ? [] : [iteratees];
- }
- if (!isArray(orders)) {
- orders = orders == null ? [] : [orders];
- }
- return baseSortByOrder(collection, iteratees, orders);
- }
-
- /**
- * Performs a deep comparison between each element in `collection` and the
- * source object, returning an array of all elements that have equivalent
- * property values.
- *
- * **Note:** This method supports comparing arrays, booleans, `Date` objects,
- * numbers, `Object` objects, regexes, and strings. Objects are compared by
- * their own, not inherited, enumerable properties. For comparing a single
- * own or inherited property value see `_.matchesProperty`.
- *
- * @static
- * @memberOf _
- * @category Collection
- * @param {Array|Object|string} collection The collection to search.
- * @param {Object} source The object of property values to match.
- * @returns {Array} Returns the new filtered array.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'age': 36, 'active': false, 'pets': ['hoppy'] },
- * { 'user': 'fred', 'age': 40, 'active': true, 'pets': ['baby puss', 'dino'] }
- * ];
- *
- * _.pluck(_.where(users, { 'age': 36, 'active': false }), 'user');
- * // => ['barney']
- *
- * _.pluck(_.where(users, { 'pets': ['dino'] }), 'user');
- * // => ['fred']
- */
- function where(collection, source) {
- return filter(collection, baseMatches(source));
- }
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Gets the number of milliseconds that have elapsed since the Unix epoch
- * (1 January 1970 00:00:00 UTC).
- *
- * @static
- * @memberOf _
- * @category Date
- * @example
- *
- * _.defer(function(stamp) {
- * console.log(_.now() - stamp);
- * }, _.now());
- * // => logs the number of milliseconds it took for the deferred function to be invoked
- */
- var now = nativeNow || function() {
- return new Date().getTime();
- };
-
- /*------------------------------------------------------------------------*/
-
- /**
- * The opposite of `_.before`; this method creates a function that invokes
- * `func` once it is called `n` or more times.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {number} n The number of calls before `func` is invoked.
- * @param {Function} func The function to restrict.
- * @returns {Function} Returns the new restricted function.
- * @example
- *
- * var saves = ['profile', 'settings'];
- *
- * var done = _.after(saves.length, function() {
- * console.log('done saving!');
- * });
- *
- * _.forEach(saves, function(type) {
- * asyncSave({ 'type': type, 'complete': done });
- * });
- * // => logs 'done saving!' after the two async saves have completed
- */
- function after(n, func) {
- if (typeof func != 'function') {
- if (typeof n == 'function') {
- var temp = n;
- n = func;
- func = temp;
- } else {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- }
- n = nativeIsFinite(n = +n) ? n : 0;
- return function() {
- if (--n < 1) {
- return func.apply(this, arguments);
- }
- };
- }
-
- /**
- * Creates a function that accepts up to `n` arguments ignoring any
- * additional arguments.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {Function} func The function to cap arguments for.
- * @param {number} [n=func.length] The arity cap.
- * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
- * @returns {Function} Returns the new function.
- * @example
- *
- * _.map(['6', '8', '10'], _.ary(parseInt, 1));
- * // => [6, 8, 10]
- */
- function ary(func, n, guard) {
- if (guard && isIterateeCall(func, n, guard)) {
- n = undefined;
- }
- n = (func && n == null) ? func.length : nativeMax(+n || 0, 0);
- return createWrapper(func, ARY_FLAG, undefined, undefined, undefined, undefined, n);
- }
-
- /**
- * Creates a function that invokes `func`, with the `this` binding and arguments
- * of the created function, while it is called less than `n` times. Subsequent
- * calls to the created function return the result of the last `func` invocation.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {number} n The number of calls at which `func` is no longer invoked.
- * @param {Function} func The function to restrict.
- * @returns {Function} Returns the new restricted function.
- * @example
- *
- * jQuery('#add').on('click', _.before(5, addContactToList));
- * // => allows adding up to 4 contacts to the list
- */
- function before(n, func) {
- var result;
- if (typeof func != 'function') {
- if (typeof n == 'function') {
- var temp = n;
- n = func;
- func = temp;
- } else {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- }
- return function() {
- if (--n > 0) {
- result = func.apply(this, arguments);
- }
- if (n <= 1) {
- func = undefined;
- }
- return result;
- };
- }
-
- /**
- * Creates a function that invokes `func` with the `this` binding of `thisArg`
- * and prepends any additional `_.bind` arguments to those provided to the
- * bound function.
- *
- * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
- * may be used as a placeholder for partially applied arguments.
- *
- * **Note:** Unlike native `Function#bind` this method does not set the "length"
- * property of bound functions.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {Function} func The function to bind.
- * @param {*} thisArg The `this` binding of `func`.
- * @param {...*} [partials] The arguments to be partially applied.
- * @returns {Function} Returns the new bound function.
- * @example
- *
- * var greet = function(greeting, punctuation) {
- * return greeting + ' ' + this.user + punctuation;
- * };
- *
- * var object = { 'user': 'fred' };
- *
- * var bound = _.bind(greet, object, 'hi');
- * bound('!');
- * // => 'hi fred!'
- *
- * // using placeholders
- * var bound = _.bind(greet, object, _, '!');
- * bound('hi');
- * // => 'hi fred!'
- */
- var bind = restParam(function(func, thisArg, partials) {
- var bitmask = BIND_FLAG;
- if (partials.length) {
- var holders = replaceHolders(partials, bind.placeholder);
- bitmask |= PARTIAL_FLAG;
- }
- return createWrapper(func, bitmask, thisArg, partials, holders);
- });
-
- /**
- * Binds methods of an object to the object itself, overwriting the existing
- * method. Method names may be specified as individual arguments or as arrays
- * of method names. If no method names are provided all enumerable function
- * properties, own and inherited, of `object` are bound.
- *
- * **Note:** This method does not set the "length" property of bound functions.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {Object} object The object to bind and assign the bound methods to.
- * @param {...(string|string[])} [methodNames] The object method names to bind,
- * specified as individual method names or arrays of method names.
- * @returns {Object} Returns `object`.
- * @example
- *
- * var view = {
- * 'label': 'docs',
- * 'onClick': function() {
- * console.log('clicked ' + this.label);
- * }
- * };
- *
- * _.bindAll(view);
- * jQuery('#docs').on('click', view.onClick);
- * // => logs 'clicked docs' when the element is clicked
- */
- var bindAll = restParam(function(object, methodNames) {
- methodNames = methodNames.length ? baseFlatten(methodNames) : functions(object);
-
- var index = -1,
- length = methodNames.length;
-
- while (++index < length) {
- var key = methodNames[index];
- object[key] = createWrapper(object[key], BIND_FLAG, object);
- }
- return object;
- });
-
- /**
- * Creates a function that invokes the method at `object[key]` and prepends
- * any additional `_.bindKey` arguments to those provided to the bound function.
- *
- * This method differs from `_.bind` by allowing bound functions to reference
- * methods that may be redefined or don't yet exist.
- * See [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
- * for more details.
- *
- * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
- * builds, may be used as a placeholder for partially applied arguments.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {Object} object The object the method belongs to.
- * @param {string} key The key of the method.
- * @param {...*} [partials] The arguments to be partially applied.
- * @returns {Function} Returns the new bound function.
- * @example
- *
- * var object = {
- * 'user': 'fred',
- * 'greet': function(greeting, punctuation) {
- * return greeting + ' ' + this.user + punctuation;
- * }
- * };
- *
- * var bound = _.bindKey(object, 'greet', 'hi');
- * bound('!');
- * // => 'hi fred!'
- *
- * object.greet = function(greeting, punctuation) {
- * return greeting + 'ya ' + this.user + punctuation;
- * };
- *
- * bound('!');
- * // => 'hiya fred!'
- *
- * // using placeholders
- * var bound = _.bindKey(object, 'greet', _, '!');
- * bound('hi');
- * // => 'hiya fred!'
- */
- var bindKey = restParam(function(object, key, partials) {
- var bitmask = BIND_FLAG | BIND_KEY_FLAG;
- if (partials.length) {
- var holders = replaceHolders(partials, bindKey.placeholder);
- bitmask |= PARTIAL_FLAG;
- }
- return createWrapper(key, bitmask, object, partials, holders);
- });
-
- /**
- * Creates a function that accepts one or more arguments of `func` that when
- * called either invokes `func` returning its result, if all `func` arguments
- * have been provided, or returns a function that accepts one or more of the
- * remaining `func` arguments, and so on. The arity of `func` may be specified
- * if `func.length` is not sufficient.
- *
- * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
- * may be used as a placeholder for provided arguments.
- *
- * **Note:** This method does not set the "length" property of curried functions.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {Function} func The function to curry.
- * @param {number} [arity=func.length] The arity of `func`.
- * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
- * @returns {Function} Returns the new curried function.
- * @example
- *
- * var abc = function(a, b, c) {
- * return [a, b, c];
- * };
- *
- * var curried = _.curry(abc);
- *
- * curried(1)(2)(3);
- * // => [1, 2, 3]
- *
- * curried(1, 2)(3);
- * // => [1, 2, 3]
- *
- * curried(1, 2, 3);
- * // => [1, 2, 3]
- *
- * // using placeholders
- * curried(1)(_, 3)(2);
- * // => [1, 2, 3]
- */
- var curry = createCurry(CURRY_FLAG);
-
- /**
- * This method is like `_.curry` except that arguments are applied to `func`
- * in the manner of `_.partialRight` instead of `_.partial`.
- *
- * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
- * builds, may be used as a placeholder for provided arguments.
- *
- * **Note:** This method does not set the "length" property of curried functions.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {Function} func The function to curry.
- * @param {number} [arity=func.length] The arity of `func`.
- * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
- * @returns {Function} Returns the new curried function.
- * @example
- *
- * var abc = function(a, b, c) {
- * return [a, b, c];
- * };
- *
- * var curried = _.curryRight(abc);
- *
- * curried(3)(2)(1);
- * // => [1, 2, 3]
- *
- * curried(2, 3)(1);
- * // => [1, 2, 3]
- *
- * curried(1, 2, 3);
- * // => [1, 2, 3]
- *
- * // using placeholders
- * curried(3)(1, _)(2);
- * // => [1, 2, 3]
- */
- var curryRight = createCurry(CURRY_RIGHT_FLAG);
-
- /**
- * Creates a debounced function that delays invoking `func` until after `wait`
- * milliseconds have elapsed since the last time the debounced function was
- * invoked. The debounced function comes with a `cancel` method to cancel
- * delayed invocations. Provide an options object to indicate that `func`
- * should be invoked on the leading and/or trailing edge of the `wait` timeout.
- * Subsequent calls to the debounced function return the result of the last
- * `func` invocation.
- *
- * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked
- * on the trailing edge of the timeout only if the the debounced function is
- * invoked more than once during the `wait` timeout.
- *
- * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)
- * for details over the differences between `_.debounce` and `_.throttle`.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {Function} func The function to debounce.
- * @param {number} [wait=0] The number of milliseconds to delay.
- * @param {Object} [options] The options object.
- * @param {boolean} [options.leading=false] Specify invoking on the leading
- * edge of the timeout.
- * @param {number} [options.maxWait] The maximum time `func` is allowed to be
- * delayed before it is invoked.
- * @param {boolean} [options.trailing=true] Specify invoking on the trailing
- * edge of the timeout.
- * @returns {Function} Returns the new debounced function.
- * @example
- *
- * // avoid costly calculations while the window size is in flux
- * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
- *
- * // invoke `sendMail` when the click event is fired, debouncing subsequent calls
- * jQuery('#postbox').on('click', _.debounce(sendMail, 300, {
- * 'leading': true,
- * 'trailing': false
- * }));
- *
- * // ensure `batchLog` is invoked once after 1 second of debounced calls
- * var source = new EventSource('/stream');
- * jQuery(source).on('message', _.debounce(batchLog, 250, {
- * 'maxWait': 1000
- * }));
- *
- * // cancel a debounced call
- * var todoChanges = _.debounce(batchLog, 1000);
- * Object.observe(models.todo, todoChanges);
- *
- * Object.observe(models, function(changes) {
- * if (_.find(changes, { 'user': 'todo', 'type': 'delete'})) {
- * todoChanges.cancel();
- * }
- * }, ['delete']);
- *
- * // ...at some point `models.todo` is changed
- * models.todo.completed = true;
- *
- * // ...before 1 second has passed `models.todo` is deleted
- * // which cancels the debounced `todoChanges` call
- * delete models.todo;
- */
- function debounce(func, wait, options) {
- var args,
- maxTimeoutId,
- result,
- stamp,
- thisArg,
- timeoutId,
- trailingCall,
- lastCalled = 0,
- maxWait = false,
- trailing = true;
-
- if (typeof func != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- wait = wait < 0 ? 0 : (+wait || 0);
- if (options === true) {
- var leading = true;
- trailing = false;
- } else if (isObject(options)) {
- leading = !!options.leading;
- maxWait = 'maxWait' in options && nativeMax(+options.maxWait || 0, wait);
- trailing = 'trailing' in options ? !!options.trailing : trailing;
- }
-
- function cancel() {
- if (timeoutId) {
- clearTimeout(timeoutId);
- }
- if (maxTimeoutId) {
- clearTimeout(maxTimeoutId);
- }
- lastCalled = 0;
- maxTimeoutId = timeoutId = trailingCall = undefined;
- }
-
- function complete(isCalled, id) {
- if (id) {
- clearTimeout(id);
- }
- maxTimeoutId = timeoutId = trailingCall = undefined;
- if (isCalled) {
- lastCalled = now();
- result = func.apply(thisArg, args);
- if (!timeoutId && !maxTimeoutId) {
- args = thisArg = undefined;
- }
- }
- }
-
- function delayed() {
- var remaining = wait - (now() - stamp);
- if (remaining <= 0 || remaining > wait) {
- complete(trailingCall, maxTimeoutId);
- } else {
- timeoutId = setTimeout(delayed, remaining);
- }
- }
-
- function maxDelayed() {
- complete(trailing, timeoutId);
- }
-
- function debounced() {
- args = arguments;
- stamp = now();
- thisArg = this;
- trailingCall = trailing && (timeoutId || !leading);
-
- if (maxWait === false) {
- var leadingCall = leading && !timeoutId;
- } else {
- if (!maxTimeoutId && !leading) {
- lastCalled = stamp;
- }
- var remaining = maxWait - (stamp - lastCalled),
- isCalled = remaining <= 0 || remaining > maxWait;
-
- if (isCalled) {
- if (maxTimeoutId) {
- maxTimeoutId = clearTimeout(maxTimeoutId);
- }
- lastCalled = stamp;
- result = func.apply(thisArg, args);
- }
- else if (!maxTimeoutId) {
- maxTimeoutId = setTimeout(maxDelayed, remaining);
- }
- }
- if (isCalled && timeoutId) {
- timeoutId = clearTimeout(timeoutId);
- }
- else if (!timeoutId && wait !== maxWait) {
- timeoutId = setTimeout(delayed, wait);
- }
- if (leadingCall) {
- isCalled = true;
- result = func.apply(thisArg, args);
- }
- if (isCalled && !timeoutId && !maxTimeoutId) {
- args = thisArg = undefined;
- }
- return result;
- }
- debounced.cancel = cancel;
- return debounced;
- }
-
- /**
- * Defers invoking the `func` until the current call stack has cleared. Any
- * additional arguments are provided to `func` when it is invoked.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {Function} func The function to defer.
- * @param {...*} [args] The arguments to invoke the function with.
- * @returns {number} Returns the timer id.
- * @example
- *
- * _.defer(function(text) {
- * console.log(text);
- * }, 'deferred');
- * // logs 'deferred' after one or more milliseconds
- */
- var defer = restParam(function(func, args) {
- return baseDelay(func, 1, args);
- });
-
- /**
- * Invokes `func` after `wait` milliseconds. Any additional arguments are
- * provided to `func` when it is invoked.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {Function} func The function to delay.
- * @param {number} wait The number of milliseconds to delay invocation.
- * @param {...*} [args] The arguments to invoke the function with.
- * @returns {number} Returns the timer id.
- * @example
- *
- * _.delay(function(text) {
- * console.log(text);
- * }, 1000, 'later');
- * // => logs 'later' after one second
- */
- var delay = restParam(function(func, wait, args) {
- return baseDelay(func, wait, args);
- });
-
- /**
- * Creates a function that returns the result of invoking the provided
- * functions with the `this` binding of the created function, where each
- * successive invocation is supplied the return value of the previous.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {...Function} [funcs] Functions to invoke.
- * @returns {Function} Returns the new function.
- * @example
- *
- * function square(n) {
- * return n * n;
- * }
- *
- * var addSquare = _.flow(_.add, square);
- * addSquare(1, 2);
- * // => 9
- */
- var flow = createFlow();
-
- /**
- * This method is like `_.flow` except that it creates a function that
- * invokes the provided functions from right to left.
- *
- * @static
- * @memberOf _
- * @alias backflow, compose
- * @category Function
- * @param {...Function} [funcs] Functions to invoke.
- * @returns {Function} Returns the new function.
- * @example
- *
- * function square(n) {
- * return n * n;
- * }
- *
- * var addSquare = _.flowRight(square, _.add);
- * addSquare(1, 2);
- * // => 9
- */
- var flowRight = createFlow(true);
-
- /**
- * Creates a function that memoizes the result of `func`. If `resolver` is
- * provided it determines the cache key for storing the result based on the
- * arguments provided to the memoized function. By default, the first argument
- * provided to the memoized function is coerced to a string and used as the
- * cache key. The `func` is invoked with the `this` binding of the memoized
- * function.
- *
- * **Note:** The cache is exposed as the `cache` property on the memoized
- * function. Its creation may be customized by replacing the `_.memoize.Cache`
- * constructor with one whose instances implement the [`Map`](http://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-map-prototype-object)
- * method interface of `get`, `has`, and `set`.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {Function} func The function to have its output memoized.
- * @param {Function} [resolver] The function to resolve the cache key.
- * @returns {Function} Returns the new memoizing function.
- * @example
- *
- * var upperCase = _.memoize(function(string) {
- * return string.toUpperCase();
- * });
- *
- * upperCase('fred');
- * // => 'FRED'
- *
- * // modifying the result cache
- * upperCase.cache.set('fred', 'BARNEY');
- * upperCase('fred');
- * // => 'BARNEY'
- *
- * // replacing `_.memoize.Cache`
- * var object = { 'user': 'fred' };
- * var other = { 'user': 'barney' };
- * var identity = _.memoize(_.identity);
- *
- * identity(object);
- * // => { 'user': 'fred' }
- * identity(other);
- * // => { 'user': 'fred' }
- *
- * _.memoize.Cache = WeakMap;
- * var identity = _.memoize(_.identity);
- *
- * identity(object);
- * // => { 'user': 'fred' }
- * identity(other);
- * // => { 'user': 'barney' }
- */
- function memoize(func, resolver) {
- if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- var memoized = function() {
- var args = arguments,
- key = resolver ? resolver.apply(this, args) : args[0],
- cache = memoized.cache;
-
- if (cache.has(key)) {
- return cache.get(key);
- }
- var result = func.apply(this, args);
- memoized.cache = cache.set(key, result);
- return result;
- };
- memoized.cache = new memoize.Cache;
- return memoized;
- }
-
- /**
- * Creates a function that runs each argument through a corresponding
- * transform function.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {Function} func The function to wrap.
- * @param {...(Function|Function[])} [transforms] The functions to transform
- * arguments, specified as individual functions or arrays of functions.
- * @returns {Function} Returns the new function.
- * @example
- *
- * function doubled(n) {
- * return n * 2;
- * }
- *
- * function square(n) {
- * return n * n;
- * }
- *
- * var modded = _.modArgs(function(x, y) {
- * return [x, y];
- * }, square, doubled);
- *
- * modded(1, 2);
- * // => [1, 4]
- *
- * modded(5, 10);
- * // => [25, 20]
- */
- var modArgs = restParam(function(func, transforms) {
- transforms = baseFlatten(transforms);
- if (typeof func != 'function' || !arrayEvery(transforms, baseIsFunction)) {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- var length = transforms.length;
- return restParam(function(args) {
- var index = nativeMin(args.length, length);
- while (index--) {
- args[index] = transforms[index](args[index]);
- }
- return func.apply(this, args);
- });
- });
-
- /**
- * Creates a function that negates the result of the predicate `func`. The
- * `func` predicate is invoked with the `this` binding and arguments of the
- * created function.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {Function} predicate The predicate to negate.
- * @returns {Function} Returns the new function.
- * @example
- *
- * function isEven(n) {
- * return n % 2 == 0;
- * }
- *
- * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
- * // => [1, 3, 5]
- */
- function negate(predicate) {
- if (typeof predicate != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- return function() {
- return !predicate.apply(this, arguments);
- };
- }
-
- /**
- * Creates a function that is restricted to invoking `func` once. Repeat calls
- * to the function return the value of the first call. The `func` is invoked
- * with the `this` binding and arguments of the created function.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {Function} func The function to restrict.
- * @returns {Function} Returns the new restricted function.
- * @example
- *
- * var initialize = _.once(createApplication);
- * initialize();
- * initialize();
- * // `initialize` invokes `createApplication` once
- */
- function once(func) {
- return before(2, func);
- }
-
- /**
- * Creates a function that invokes `func` with `partial` arguments prepended
- * to those provided to the new function. This method is like `_.bind` except
- * it does **not** alter the `this` binding.
- *
- * The `_.partial.placeholder` value, which defaults to `_` in monolithic
- * builds, may be used as a placeholder for partially applied arguments.
- *
- * **Note:** This method does not set the "length" property of partially
- * applied functions.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {Function} func The function to partially apply arguments to.
- * @param {...*} [partials] The arguments to be partially applied.
- * @returns {Function} Returns the new partially applied function.
- * @example
- *
- * var greet = function(greeting, name) {
- * return greeting + ' ' + name;
- * };
- *
- * var sayHelloTo = _.partial(greet, 'hello');
- * sayHelloTo('fred');
- * // => 'hello fred'
- *
- * // using placeholders
- * var greetFred = _.partial(greet, _, 'fred');
- * greetFred('hi');
- * // => 'hi fred'
- */
- var partial = createPartial(PARTIAL_FLAG);
-
- /**
- * This method is like `_.partial` except that partially applied arguments
- * are appended to those provided to the new function.
- *
- * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
- * builds, may be used as a placeholder for partially applied arguments.
- *
- * **Note:** This method does not set the "length" property of partially
- * applied functions.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {Function} func The function to partially apply arguments to.
- * @param {...*} [partials] The arguments to be partially applied.
- * @returns {Function} Returns the new partially applied function.
- * @example
- *
- * var greet = function(greeting, name) {
- * return greeting + ' ' + name;
- * };
- *
- * var greetFred = _.partialRight(greet, 'fred');
- * greetFred('hi');
- * // => 'hi fred'
- *
- * // using placeholders
- * var sayHelloTo = _.partialRight(greet, 'hello', _);
- * sayHelloTo('fred');
- * // => 'hello fred'
- */
- var partialRight = createPartial(PARTIAL_RIGHT_FLAG);
-
- /**
- * Creates a function that invokes `func` with arguments arranged according
- * to the specified indexes where the argument value at the first index is
- * provided as the first argument, the argument value at the second index is
- * provided as the second argument, and so on.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {Function} func The function to rearrange arguments for.
- * @param {...(number|number[])} indexes The arranged argument indexes,
- * specified as individual indexes or arrays of indexes.
- * @returns {Function} Returns the new function.
- * @example
- *
- * var rearged = _.rearg(function(a, b, c) {
- * return [a, b, c];
- * }, 2, 0, 1);
- *
- * rearged('b', 'c', 'a')
- * // => ['a', 'b', 'c']
- *
- * var map = _.rearg(_.map, [1, 0]);
- * map(function(n) {
- * return n * 3;
- * }, [1, 2, 3]);
- * // => [3, 6, 9]
- */
- var rearg = restParam(function(func, indexes) {
- return createWrapper(func, REARG_FLAG, undefined, undefined, undefined, baseFlatten(indexes));
- });
-
- /**
- * Creates a function that invokes `func` with the `this` binding of the
- * created function and arguments from `start` and beyond provided as an array.
- *
- * **Note:** This method is based on the [rest parameter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters).
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {Function} func The function to apply a rest parameter to.
- * @param {number} [start=func.length-1] The start position of the rest parameter.
- * @returns {Function} Returns the new function.
- * @example
- *
- * var say = _.restParam(function(what, names) {
- * return what + ' ' + _.initial(names).join(', ') +
- * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
- * });
- *
- * say('hello', 'fred', 'barney', 'pebbles');
- * // => 'hello fred, barney, & pebbles'
- */
- function restParam(func, start) {
- if (typeof func != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0);
- return function() {
- var args = arguments,
- index = -1,
- length = nativeMax(args.length - start, 0),
- rest = Array(length);
-
- while (++index < length) {
- rest[index] = args[start + index];
- }
- switch (start) {
- case 0: return func.call(this, rest);
- case 1: return func.call(this, args[0], rest);
- case 2: return func.call(this, args[0], args[1], rest);
- }
- var otherArgs = Array(start + 1);
- index = -1;
- while (++index < start) {
- otherArgs[index] = args[index];
- }
- otherArgs[start] = rest;
- return func.apply(this, otherArgs);
- };
- }
-
- /**
- * Creates a function that invokes `func` with the `this` binding of the created
- * function and an array of arguments much like [`Function#apply`](https://es5.github.io/#x15.3.4.3).
- *
- * **Note:** This method is based on the [spread operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_operator).
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {Function} func The function to spread arguments over.
- * @returns {Function} Returns the new function.
- * @example
- *
- * var say = _.spread(function(who, what) {
- * return who + ' says ' + what;
- * });
- *
- * say(['fred', 'hello']);
- * // => 'fred says hello'
- *
- * // with a Promise
- * var numbers = Promise.all([
- * Promise.resolve(40),
- * Promise.resolve(36)
- * ]);
- *
- * numbers.then(_.spread(function(x, y) {
- * return x + y;
- * }));
- * // => a Promise of 76
- */
- function spread(func) {
- if (typeof func != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- return function(array) {
- return func.apply(this, array);
- };
- }
-
- /**
- * Creates a throttled function that only invokes `func` at most once per
- * every `wait` milliseconds. The throttled function comes with a `cancel`
- * method to cancel delayed invocations. Provide an options object to indicate
- * that `func` should be invoked on the leading and/or trailing edge of the
- * `wait` timeout. Subsequent calls to the throttled function return the
- * result of the last `func` call.
- *
- * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked
- * on the trailing edge of the timeout only if the the throttled function is
- * invoked more than once during the `wait` timeout.
- *
- * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)
- * for details over the differences between `_.throttle` and `_.debounce`.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {Function} func The function to throttle.
- * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
- * @param {Object} [options] The options object.
- * @param {boolean} [options.leading=true] Specify invoking on the leading
- * edge of the timeout.
- * @param {boolean} [options.trailing=true] Specify invoking on the trailing
- * edge of the timeout.
- * @returns {Function} Returns the new throttled function.
- * @example
- *
- * // avoid excessively updating the position while scrolling
- * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
- *
- * // invoke `renewToken` when the click event is fired, but not more than once every 5 minutes
- * jQuery('.interactive').on('click', _.throttle(renewToken, 300000, {
- * 'trailing': false
- * }));
- *
- * // cancel a trailing throttled call
- * jQuery(window).on('popstate', throttled.cancel);
- */
- function throttle(func, wait, options) {
- var leading = true,
- trailing = true;
-
- if (typeof func != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- if (options === false) {
- leading = false;
- } else if (isObject(options)) {
- leading = 'leading' in options ? !!options.leading : leading;
- trailing = 'trailing' in options ? !!options.trailing : trailing;
- }
- return debounce(func, wait, { 'leading': leading, 'maxWait': +wait, 'trailing': trailing });
- }
-
- /**
- * Creates a function that provides `value` to the wrapper function as its
- * first argument. Any additional arguments provided to the function are
- * appended to those provided to the wrapper function. The wrapper is invoked
- * with the `this` binding of the created function.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {*} value The value to wrap.
- * @param {Function} wrapper The wrapper function.
- * @returns {Function} Returns the new function.
- * @example
- *
- * var p = _.wrap(_.escape, function(func, text) {
- * return '' + func(text) + '
';
- * });
- *
- * p('fred, barney, & pebbles');
- * // => 'fred, barney, & pebbles
'
- */
- function wrap(value, wrapper) {
- wrapper = wrapper == null ? identity : wrapper;
- return createWrapper(wrapper, PARTIAL_FLAG, undefined, [value], []);
- }
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Creates a clone of `value`. If `isDeep` is `true` nested objects are cloned,
- * otherwise they are assigned by reference. If `customizer` is provided it is
- * invoked to produce the cloned values. If `customizer` returns `undefined`
- * cloning is handled by the method instead. The `customizer` is bound to
- * `thisArg` and invoked with two argument; (value [, index|key, object]).
- *
- * **Note:** This method is loosely based on the
- * [structured clone algorithm](http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm).
- * The enumerable properties of `arguments` objects and objects created by
- * constructors other than `Object` are cloned to plain `Object` objects. An
- * empty object is returned for uncloneable values such as functions, DOM nodes,
- * Maps, Sets, and WeakMaps.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to clone.
- * @param {boolean} [isDeep] Specify a deep clone.
- * @param {Function} [customizer] The function to customize cloning values.
- * @param {*} [thisArg] The `this` binding of `customizer`.
- * @returns {*} Returns the cloned value.
- * @example
- *
- * var users = [
- * { 'user': 'barney' },
- * { 'user': 'fred' }
- * ];
- *
- * var shallow = _.clone(users);
- * shallow[0] === users[0];
- * // => true
- *
- * var deep = _.clone(users, true);
- * deep[0] === users[0];
- * // => false
- *
- * // using a customizer callback
- * var el = _.clone(document.body, function(value) {
- * if (_.isElement(value)) {
- * return value.cloneNode(false);
- * }
- * });
- *
- * el === document.body
- * // => false
- * el.nodeName
- * // => BODY
- * el.childNodes.length;
- * // => 0
- */
- function clone(value, isDeep, customizer, thisArg) {
- if (isDeep && typeof isDeep != 'boolean' && isIterateeCall(value, isDeep, customizer)) {
- isDeep = false;
- }
- else if (typeof isDeep == 'function') {
- thisArg = customizer;
- customizer = isDeep;
- isDeep = false;
- }
- return typeof customizer == 'function'
- ? baseClone(value, isDeep, bindCallback(customizer, thisArg, 1))
- : baseClone(value, isDeep);
- }
-
- /**
- * Creates a deep clone of `value`. If `customizer` is provided it is invoked
- * to produce the cloned values. If `customizer` returns `undefined` cloning
- * is handled by the method instead. The `customizer` is bound to `thisArg`
- * and invoked with two argument; (value [, index|key, object]).
- *
- * **Note:** This method is loosely based on the
- * [structured clone algorithm](http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm).
- * The enumerable properties of `arguments` objects and objects created by
- * constructors other than `Object` are cloned to plain `Object` objects. An
- * empty object is returned for uncloneable values such as functions, DOM nodes,
- * Maps, Sets, and WeakMaps.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to deep clone.
- * @param {Function} [customizer] The function to customize cloning values.
- * @param {*} [thisArg] The `this` binding of `customizer`.
- * @returns {*} Returns the deep cloned value.
- * @example
- *
- * var users = [
- * { 'user': 'barney' },
- * { 'user': 'fred' }
- * ];
- *
- * var deep = _.cloneDeep(users);
- * deep[0] === users[0];
- * // => false
- *
- * // using a customizer callback
- * var el = _.cloneDeep(document.body, function(value) {
- * if (_.isElement(value)) {
- * return value.cloneNode(true);
- * }
- * });
- *
- * el === document.body
- * // => false
- * el.nodeName
- * // => BODY
- * el.childNodes.length;
- * // => 20
- */
- function cloneDeep(value, customizer, thisArg) {
- return typeof customizer == 'function'
- ? baseClone(value, true, bindCallback(customizer, thisArg, 1))
- : baseClone(value, true);
- }
-
- /**
- * Checks if `value` is greater than `other`.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @returns {boolean} Returns `true` if `value` is greater than `other`, else `false`.
- * @example
- *
- * _.gt(3, 1);
- * // => true
- *
- * _.gt(3, 3);
- * // => false
- *
- * _.gt(1, 3);
- * // => false
- */
- function gt(value, other) {
- return value > other;
- }
-
- /**
- * Checks if `value` is greater than or equal to `other`.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @returns {boolean} Returns `true` if `value` is greater than or equal to `other`, else `false`.
- * @example
- *
- * _.gte(3, 1);
- * // => true
- *
- * _.gte(3, 3);
- * // => true
- *
- * _.gte(1, 3);
- * // => false
- */
- function gte(value, other) {
- return value >= other;
- }
-
- /**
- * Checks if `value` is classified as an `arguments` object.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
- * @example
- *
- * _.isArguments(function() { return arguments; }());
- * // => true
- *
- * _.isArguments([1, 2, 3]);
- * // => false
- */
- function isArguments(value) {
- return isObjectLike(value) && isArrayLike(value) &&
- hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee');
- }
-
- /**
- * Checks if `value` is classified as an `Array` object.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
- * @example
- *
- * _.isArray([1, 2, 3]);
- * // => true
- *
- * _.isArray(function() { return arguments; }());
- * // => false
- */
- var isArray = nativeIsArray || function(value) {
- return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag;
- };
-
- /**
- * Checks if `value` is classified as a boolean primitive or object.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
- * @example
- *
- * _.isBoolean(false);
- * // => true
- *
- * _.isBoolean(null);
- * // => false
- */
- function isBoolean(value) {
- return value === true || value === false || (isObjectLike(value) && objToString.call(value) == boolTag);
- }
-
- /**
- * Checks if `value` is classified as a `Date` object.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
- * @example
- *
- * _.isDate(new Date);
- * // => true
- *
- * _.isDate('Mon April 23 2012');
- * // => false
- */
- function isDate(value) {
- return isObjectLike(value) && objToString.call(value) == dateTag;
- }
-
- /**
- * Checks if `value` is a DOM element.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
- * @example
- *
- * _.isElement(document.body);
- * // => true
- *
- * _.isElement('');
- * // => false
- */
- function isElement(value) {
- return !!value && value.nodeType === 1 && isObjectLike(value) && !isPlainObject(value);
- }
-
- /**
- * Checks if `value` is empty. A value is considered empty unless it is an
- * `arguments` object, array, string, or jQuery-like collection with a length
- * greater than `0` or an object with own enumerable properties.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {Array|Object|string} value The value to inspect.
- * @returns {boolean} Returns `true` if `value` is empty, else `false`.
- * @example
- *
- * _.isEmpty(null);
- * // => true
- *
- * _.isEmpty(true);
- * // => true
- *
- * _.isEmpty(1);
- * // => true
- *
- * _.isEmpty([1, 2, 3]);
- * // => false
- *
- * _.isEmpty({ 'a': 1 });
- * // => false
- */
- function isEmpty(value) {
- if (value == null) {
- return true;
- }
- if (isArrayLike(value) && (isArray(value) || isString(value) || isArguments(value) ||
- (isObjectLike(value) && isFunction(value.splice)))) {
- return !value.length;
- }
- return !keys(value).length;
- }
-
- /**
- * Performs a deep comparison between two values to determine if they are
- * equivalent. If `customizer` is provided it is invoked to compare values.
- * If `customizer` returns `undefined` comparisons are handled by the method
- * instead. The `customizer` is bound to `thisArg` and invoked with three
- * arguments: (value, other [, index|key]).
- *
- * **Note:** This method supports comparing arrays, booleans, `Date` objects,
- * numbers, `Object` objects, regexes, and strings. Objects are compared by
- * their own, not inherited, enumerable properties. Functions and DOM nodes
- * are **not** supported. Provide a customizer function to extend support
- * for comparing other values.
- *
- * @static
- * @memberOf _
- * @alias eq
- * @category Lang
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @param {Function} [customizer] The function to customize value comparisons.
- * @param {*} [thisArg] The `this` binding of `customizer`.
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
- * @example
- *
- * var object = { 'user': 'fred' };
- * var other = { 'user': 'fred' };
- *
- * object == other;
- * // => false
- *
- * _.isEqual(object, other);
- * // => true
- *
- * // using a customizer callback
- * var array = ['hello', 'goodbye'];
- * var other = ['hi', 'goodbye'];
- *
- * _.isEqual(array, other, function(value, other) {
- * if (_.every([value, other], RegExp.prototype.test, /^h(?:i|ello)$/)) {
- * return true;
- * }
- * });
- * // => true
- */
- function isEqual(value, other, customizer, thisArg) {
- customizer = typeof customizer == 'function' ? bindCallback(customizer, thisArg, 3) : undefined;
- var result = customizer ? customizer(value, other) : undefined;
- return result === undefined ? baseIsEqual(value, other, customizer) : !!result;
- }
-
- /**
- * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
- * `SyntaxError`, `TypeError`, or `URIError` object.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
- * @example
- *
- * _.isError(new Error);
- * // => true
- *
- * _.isError(Error);
- * // => false
- */
- function isError(value) {
- return isObjectLike(value) && typeof value.message == 'string' && objToString.call(value) == errorTag;
- }
-
- /**
- * Checks if `value` is a finite primitive number.
- *
- * **Note:** This method is based on [`Number.isFinite`](http://ecma-international.org/ecma-262/6.0/#sec-number.isfinite).
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
- * @example
- *
- * _.isFinite(10);
- * // => true
- *
- * _.isFinite('10');
- * // => false
- *
- * _.isFinite(true);
- * // => false
- *
- * _.isFinite(Object(10));
- * // => false
- *
- * _.isFinite(Infinity);
- * // => false
- */
- function isFinite(value) {
- return typeof value == 'number' && nativeIsFinite(value);
- }
-
- /**
- * Checks if `value` is classified as a `Function` object.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
- * @example
- *
- * _.isFunction(_);
- * // => true
- *
- * _.isFunction(/abc/);
- * // => false
- */
- function isFunction(value) {
- // The use of `Object#toString` avoids issues with the `typeof` operator
- // in older versions of Chrome and Safari which return 'function' for regexes
- // and Safari 8 equivalents which return 'object' for typed array constructors.
- return isObject(value) && objToString.call(value) == funcTag;
- }
-
- /**
- * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
- * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
- * @example
- *
- * _.isObject({});
- * // => true
- *
- * _.isObject([1, 2, 3]);
- * // => true
- *
- * _.isObject(1);
- * // => false
- */
- function isObject(value) {
- // Avoid a V8 JIT bug in Chrome 19-20.
- // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
- var type = typeof value;
- return !!value && (type == 'object' || type == 'function');
- }
-
- /**
- * Performs a deep comparison between `object` and `source` to determine if
- * `object` contains equivalent property values. If `customizer` is provided
- * it is invoked to compare values. If `customizer` returns `undefined`
- * comparisons are handled by the method instead. The `customizer` is bound
- * to `thisArg` and invoked with three arguments: (value, other, index|key).
- *
- * **Note:** This method supports comparing properties of arrays, booleans,
- * `Date` objects, numbers, `Object` objects, regexes, and strings. Functions
- * and DOM nodes are **not** supported. Provide a customizer function to extend
- * support for comparing other values.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {Object} object The object to inspect.
- * @param {Object} source The object of property values to match.
- * @param {Function} [customizer] The function to customize value comparisons.
- * @param {*} [thisArg] The `this` binding of `customizer`.
- * @returns {boolean} Returns `true` if `object` is a match, else `false`.
- * @example
- *
- * var object = { 'user': 'fred', 'age': 40 };
- *
- * _.isMatch(object, { 'age': 40 });
- * // => true
- *
- * _.isMatch(object, { 'age': 36 });
- * // => false
- *
- * // using a customizer callback
- * var object = { 'greeting': 'hello' };
- * var source = { 'greeting': 'hi' };
- *
- * _.isMatch(object, source, function(value, other) {
- * return _.every([value, other], RegExp.prototype.test, /^h(?:i|ello)$/) || undefined;
- * });
- * // => true
- */
- function isMatch(object, source, customizer, thisArg) {
- customizer = typeof customizer == 'function' ? bindCallback(customizer, thisArg, 3) : undefined;
- return baseIsMatch(object, getMatchData(source), customizer);
- }
-
- /**
- * Checks if `value` is `NaN`.
- *
- * **Note:** This method is not the same as [`isNaN`](https://es5.github.io/#x15.1.2.4)
- * which returns `true` for `undefined` and other non-numeric values.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
- * @example
- *
- * _.isNaN(NaN);
- * // => true
- *
- * _.isNaN(new Number(NaN));
- * // => true
- *
- * isNaN(undefined);
- * // => true
- *
- * _.isNaN(undefined);
- * // => false
- */
- function isNaN(value) {
- // An `NaN` primitive is the only value that is not equal to itself.
- // Perform the `toStringTag` check first to avoid errors with some host objects in IE.
- return isNumber(value) && value != +value;
- }
-
- /**
- * Checks if `value` is a native function.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a native function, else `false`.
- * @example
- *
- * _.isNative(Array.prototype.push);
- * // => true
- *
- * _.isNative(_);
- * // => false
- */
- function isNative(value) {
- if (value == null) {
- return false;
- }
- if (isFunction(value)) {
- return reIsNative.test(fnToString.call(value));
- }
- return isObjectLike(value) && reIsHostCtor.test(value);
- }
-
- /**
- * Checks if `value` is `null`.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
- * @example
- *
- * _.isNull(null);
- * // => true
- *
- * _.isNull(void 0);
- * // => false
- */
- function isNull(value) {
- return value === null;
- }
-
- /**
- * Checks if `value` is classified as a `Number` primitive or object.
- *
- * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are classified
- * as numbers, use the `_.isFinite` method.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
- * @example
- *
- * _.isNumber(8.4);
- * // => true
- *
- * _.isNumber(NaN);
- * // => true
- *
- * _.isNumber('8.4');
- * // => false
- */
- function isNumber(value) {
- return typeof value == 'number' || (isObjectLike(value) && objToString.call(value) == numberTag);
- }
-
- /**
- * Checks if `value` is a plain object, that is, an object created by the
- * `Object` constructor or one with a `[[Prototype]]` of `null`.
- *
- * **Note:** This method assumes objects created by the `Object` constructor
- * have no inherited enumerable properties.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * }
- *
- * _.isPlainObject(new Foo);
- * // => false
- *
- * _.isPlainObject([1, 2, 3]);
- * // => false
- *
- * _.isPlainObject({ 'x': 0, 'y': 0 });
- * // => true
- *
- * _.isPlainObject(Object.create(null));
- * // => true
- */
- function isPlainObject(value) {
- var Ctor;
-
- // Exit early for non `Object` objects.
- if (!(isObjectLike(value) && objToString.call(value) == objectTag && !isArguments(value)) ||
- (!hasOwnProperty.call(value, 'constructor') && (Ctor = value.constructor, typeof Ctor == 'function' && !(Ctor instanceof Ctor)))) {
- return false;
- }
- // IE < 9 iterates inherited properties before own properties. If the first
- // iterated property is an object's own property then there are no inherited
- // enumerable properties.
- var result;
- // In most environments an object's own properties are iterated before
- // its inherited properties. If the last iterated property is an object's
- // own property then there are no inherited enumerable properties.
- baseForIn(value, function(subValue, key) {
- result = key;
- });
- return result === undefined || hasOwnProperty.call(value, result);
- }
-
- /**
- * Checks if `value` is classified as a `RegExp` object.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
- * @example
- *
- * _.isRegExp(/abc/);
- * // => true
- *
- * _.isRegExp('/abc/');
- * // => false
- */
- function isRegExp(value) {
- return isObject(value) && objToString.call(value) == regexpTag;
- }
-
- /**
- * Checks if `value` is classified as a `String` primitive or object.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
- * @example
- *
- * _.isString('abc');
- * // => true
- *
- * _.isString(1);
- * // => false
- */
- function isString(value) {
- return typeof value == 'string' || (isObjectLike(value) && objToString.call(value) == stringTag);
- }
-
- /**
- * Checks if `value` is classified as a typed array.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
- * @example
- *
- * _.isTypedArray(new Uint8Array);
- * // => true
- *
- * _.isTypedArray([]);
- * // => false
- */
- function isTypedArray(value) {
- return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objToString.call(value)];
- }
-
- /**
- * Checks if `value` is `undefined`.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
- * @example
- *
- * _.isUndefined(void 0);
- * // => true
- *
- * _.isUndefined(null);
- * // => false
- */
- function isUndefined(value) {
- return value === undefined;
- }
-
- /**
- * Checks if `value` is less than `other`.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @returns {boolean} Returns `true` if `value` is less than `other`, else `false`.
- * @example
- *
- * _.lt(1, 3);
- * // => true
- *
- * _.lt(3, 3);
- * // => false
- *
- * _.lt(3, 1);
- * // => false
- */
- function lt(value, other) {
- return value < other;
- }
-
- /**
- * Checks if `value` is less than or equal to `other`.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @returns {boolean} Returns `true` if `value` is less than or equal to `other`, else `false`.
- * @example
- *
- * _.lte(1, 3);
- * // => true
- *
- * _.lte(3, 3);
- * // => true
- *
- * _.lte(3, 1);
- * // => false
- */
- function lte(value, other) {
- return value <= other;
- }
-
- /**
- * Converts `value` to an array.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to convert.
- * @returns {Array} Returns the converted array.
- * @example
- *
- * (function() {
- * return _.toArray(arguments).slice(1);
- * }(1, 2, 3));
- * // => [2, 3]
- */
- function toArray(value) {
- var length = value ? getLength(value) : 0;
- if (!isLength(length)) {
- return values(value);
- }
- if (!length) {
- return [];
- }
- return arrayCopy(value);
- }
-
- /**
- * Converts `value` to a plain object flattening inherited enumerable
- * properties of `value` to own properties of the plain object.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to convert.
- * @returns {Object} Returns the converted plain object.
- * @example
- *
- * function Foo() {
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.assign({ 'a': 1 }, new Foo);
- * // => { 'a': 1, 'b': 2 }
- *
- * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
- * // => { 'a': 1, 'b': 2, 'c': 3 }
- */
- function toPlainObject(value) {
- return baseCopy(value, keysIn(value));
- }
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Recursively merges own enumerable properties of the source object(s), that
- * don't resolve to `undefined` into the destination object. Subsequent sources
- * overwrite property assignments of previous sources. If `customizer` is
- * provided it is invoked to produce the merged values of the destination and
- * source properties. If `customizer` returns `undefined` merging is handled
- * by the method instead. The `customizer` is bound to `thisArg` and invoked
- * with five arguments: (objectValue, sourceValue, key, object, source).
- *
- * @static
- * @memberOf _
- * @category Object
- * @param {Object} object The destination object.
- * @param {...Object} [sources] The source objects.
- * @param {Function} [customizer] The function to customize assigned values.
- * @param {*} [thisArg] The `this` binding of `customizer`.
- * @returns {Object} Returns `object`.
- * @example
- *
- * var users = {
- * 'data': [{ 'user': 'barney' }, { 'user': 'fred' }]
- * };
- *
- * var ages = {
- * 'data': [{ 'age': 36 }, { 'age': 40 }]
- * };
- *
- * _.merge(users, ages);
- * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] }
- *
- * // using a customizer callback
- * var object = {
- * 'fruits': ['apple'],
- * 'vegetables': ['beet']
- * };
- *
- * var other = {
- * 'fruits': ['banana'],
- * 'vegetables': ['carrot']
- * };
- *
- * _.merge(object, other, function(a, b) {
- * if (_.isArray(a)) {
- * return a.concat(b);
- * }
- * });
- * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] }
- */
- var merge = createAssigner(baseMerge);
-
- /**
- * Assigns own enumerable properties of source object(s) to the destination
- * object. Subsequent sources overwrite property assignments of previous sources.
- * If `customizer` is provided it is invoked to produce the assigned values.
- * The `customizer` is bound to `thisArg` and invoked with five arguments:
- * (objectValue, sourceValue, key, object, source).
- *
- * **Note:** This method mutates `object` and is based on
- * [`Object.assign`](http://ecma-international.org/ecma-262/6.0/#sec-object.assign).
- *
- * @static
- * @memberOf _
- * @alias extend
- * @category Object
- * @param {Object} object The destination object.
- * @param {...Object} [sources] The source objects.
- * @param {Function} [customizer] The function to customize assigned values.
- * @param {*} [thisArg] The `this` binding of `customizer`.
- * @returns {Object} Returns `object`.
- * @example
- *
- * _.assign({ 'user': 'barney' }, { 'age': 40 }, { 'user': 'fred' });
- * // => { 'user': 'fred', 'age': 40 }
- *
- * // using a customizer callback
- * var defaults = _.partialRight(_.assign, function(value, other) {
- * return _.isUndefined(value) ? other : value;
- * });
- *
- * defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' });
- * // => { 'user': 'barney', 'age': 36 }
- */
- var assign = createAssigner(function(object, source, customizer) {
- return customizer
- ? assignWith(object, source, customizer)
- : baseAssign(object, source);
- });
-
- /**
- * Creates an object that inherits from the given `prototype` object. If a
- * `properties` object is provided its own enumerable properties are assigned
- * to the created object.
- *
- * @static
- * @memberOf _
- * @category Object
- * @param {Object} prototype The object to inherit from.
- * @param {Object} [properties] The properties to assign to the object.
- * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
- * @returns {Object} Returns the new object.
- * @example
- *
- * function Shape() {
- * this.x = 0;
- * this.y = 0;
- * }
- *
- * function Circle() {
- * Shape.call(this);
- * }
- *
- * Circle.prototype = _.create(Shape.prototype, {
- * 'constructor': Circle
- * });
- *
- * var circle = new Circle;
- * circle instanceof Circle;
- * // => true
- *
- * circle instanceof Shape;
- * // => true
- */
- function create(prototype, properties, guard) {
- var result = baseCreate(prototype);
- if (guard && isIterateeCall(prototype, properties, guard)) {
- properties = undefined;
- }
- return properties ? baseAssign(result, properties) : result;
- }
-
- /**
- * Assigns own enumerable properties of source object(s) to the destination
- * object for all destination properties that resolve to `undefined`. Once a
- * property is set, additional values of the same property are ignored.
- *
- * **Note:** This method mutates `object`.
- *
- * @static
- * @memberOf _
- * @category Object
- * @param {Object} object The destination object.
- * @param {...Object} [sources] The source objects.
- * @returns {Object} Returns `object`.
- * @example
- *
- * _.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' });
- * // => { 'user': 'barney', 'age': 36 }
- */
- var defaults = createDefaults(assign, assignDefaults);
-
- /**
- * This method is like `_.defaults` except that it recursively assigns
- * default properties.
- *
- * **Note:** This method mutates `object`.
- *
- * @static
- * @memberOf _
- * @category Object
- * @param {Object} object The destination object.
- * @param {...Object} [sources] The source objects.
- * @returns {Object} Returns `object`.
- * @example
- *
- * _.defaultsDeep({ 'user': { 'name': 'barney' } }, { 'user': { 'name': 'fred', 'age': 36 } });
- * // => { 'user': { 'name': 'barney', 'age': 36 } }
- *
- */
- var defaultsDeep = createDefaults(merge, mergeDefaults);
-
- /**
- * This method is like `_.find` except that it returns the key 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 Object
- * @param {Object} object The object to search.
- * @param {Function|Object|string} [predicate=_.identity] The function invoked
- * per iteration.
- * @param {*} [thisArg] The `this` binding of `predicate`.
- * @returns {string|undefined} Returns the key of the matched element, else `undefined`.
- * @example
- *
- * var users = {
- * 'barney': { 'age': 36, 'active': true },
- * 'fred': { 'age': 40, 'active': false },
- * 'pebbles': { 'age': 1, 'active': true }
- * };
- *
- * _.findKey(users, function(chr) {
- * return chr.age < 40;
- * });
- * // => 'barney' (iteration order is not guaranteed)
- *
- * // using the `_.matches` callback shorthand
- * _.findKey(users, { 'age': 1, 'active': true });
- * // => 'pebbles'
- *
- * // using the `_.matchesProperty` callback shorthand
- * _.findKey(users, 'active', false);
- * // => 'fred'
- *
- * // using the `_.property` callback shorthand
- * _.findKey(users, 'active');
- * // => 'barney'
- */
- var findKey = createFindKey(baseForOwn);
-
- /**
- * This method is like `_.findKey` except that it iterates over elements of
- * a collection in the opposite order.
- *
- * 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 Object
- * @param {Object} object The object to search.
- * @param {Function|Object|string} [predicate=_.identity] The function invoked
- * per iteration.
- * @param {*} [thisArg] The `this` binding of `predicate`.
- * @returns {string|undefined} Returns the key of the matched element, else `undefined`.
- * @example
- *
- * var users = {
- * 'barney': { 'age': 36, 'active': true },
- * 'fred': { 'age': 40, 'active': false },
- * 'pebbles': { 'age': 1, 'active': true }
- * };
- *
- * _.findLastKey(users, function(chr) {
- * return chr.age < 40;
- * });
- * // => returns `pebbles` assuming `_.findKey` returns `barney`
- *
- * // using the `_.matches` callback shorthand
- * _.findLastKey(users, { 'age': 36, 'active': true });
- * // => 'barney'
- *
- * // using the `_.matchesProperty` callback shorthand
- * _.findLastKey(users, 'active', false);
- * // => 'fred'
- *
- * // using the `_.property` callback shorthand
- * _.findLastKey(users, 'active');
- * // => 'pebbles'
- */
- var findLastKey = createFindKey(baseForOwnRight);
-
- /**
- * Iterates over own and inherited enumerable properties of an object invoking
- * `iteratee` for each property. The `iteratee` is bound to `thisArg` and invoked
- * with three arguments: (value, key, object). Iteratee functions may exit
- * iteration early by explicitly returning `false`.
- *
- * @static
- * @memberOf _
- * @category Object
- * @param {Object} object The object to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @param {*} [thisArg] The `this` binding of `iteratee`.
- * @returns {Object} Returns `object`.
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.forIn(new Foo, function(value, key) {
- * console.log(key);
- * });
- * // => logs 'a', 'b', and 'c' (iteration order is not guaranteed)
- */
- var forIn = createForIn(baseFor);
-
- /**
- * This method is like `_.forIn` except that it iterates over properties of
- * `object` in the opposite order.
- *
- * @static
- * @memberOf _
- * @category Object
- * @param {Object} object The object to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @param {*} [thisArg] The `this` binding of `iteratee`.
- * @returns {Object} Returns `object`.
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.forInRight(new Foo, function(value, key) {
- * console.log(key);
- * });
- * // => logs 'c', 'b', and 'a' assuming `_.forIn ` logs 'a', 'b', and 'c'
- */
- var forInRight = createForIn(baseForRight);
-
- /**
- * Iterates over own enumerable properties of an object invoking `iteratee`
- * for each property. The `iteratee` is bound to `thisArg` and invoked with
- * three arguments: (value, key, object). Iteratee functions may exit iteration
- * early by explicitly returning `false`.
- *
- * @static
- * @memberOf _
- * @category Object
- * @param {Object} object The object to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @param {*} [thisArg] The `this` binding of `iteratee`.
- * @returns {Object} Returns `object`.
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.forOwn(new Foo, function(value, key) {
- * console.log(key);
- * });
- * // => logs 'a' and 'b' (iteration order is not guaranteed)
- */
- var forOwn = createForOwn(baseForOwn);
-
- /**
- * This method is like `_.forOwn` except that it iterates over properties of
- * `object` in the opposite order.
- *
- * @static
- * @memberOf _
- * @category Object
- * @param {Object} object The object to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @param {*} [thisArg] The `this` binding of `iteratee`.
- * @returns {Object} Returns `object`.
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.forOwnRight(new Foo, function(value, key) {
- * console.log(key);
- * });
- * // => logs 'b' and 'a' assuming `_.forOwn` logs 'a' and 'b'
- */
- var forOwnRight = createForOwn(baseForOwnRight);
-
- /**
- * Creates an array of function property names from all enumerable properties,
- * own and inherited, of `object`.
- *
- * @static
- * @memberOf _
- * @alias methods
- * @category Object
- * @param {Object} object The object to inspect.
- * @returns {Array} Returns the new array of property names.
- * @example
- *
- * _.functions(_);
- * // => ['after', 'ary', 'assign', ...]
- */
- function functions(object) {
- return baseFunctions(object, keysIn(object));
- }
-
- /**
- * Gets the property value at `path` of `object`. If the resolved value is
- * `undefined` the `defaultValue` is used in its place.
- *
- * @static
- * @memberOf _
- * @category Object
- * @param {Object} object The object to query.
- * @param {Array|string} path The path of the property to get.
- * @param {*} [defaultValue] The value returned if the resolved value is `undefined`.
- * @returns {*} Returns the resolved value.
- * @example
- *
- * var object = { 'a': [{ 'b': { 'c': 3 } }] };
- *
- * _.get(object, 'a[0].b.c');
- * // => 3
- *
- * _.get(object, ['a', '0', 'b', 'c']);
- * // => 3
- *
- * _.get(object, 'a.b.c', 'default');
- * // => 'default'
- */
- function get(object, path, defaultValue) {
- var result = object == null ? undefined : baseGet(object, toPath(path), path + '');
- return result === undefined ? defaultValue : result;
- }
-
- /**
- * Checks if `path` is a direct property.
- *
- * @static
- * @memberOf _
- * @category Object
- * @param {Object} object The object to query.
- * @param {Array|string} path The path to check.
- * @returns {boolean} Returns `true` if `path` is a direct property, else `false`.
- * @example
- *
- * var object = { 'a': { 'b': { 'c': 3 } } };
- *
- * _.has(object, 'a');
- * // => true
- *
- * _.has(object, 'a.b.c');
- * // => true
- *
- * _.has(object, ['a', 'b', 'c']);
- * // => true
- */
- function has(object, path) {
- if (object == null) {
- return false;
- }
- var result = hasOwnProperty.call(object, path);
- if (!result && !isKey(path)) {
- path = toPath(path);
- object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
- if (object == null) {
- return false;
- }
- path = last(path);
- result = hasOwnProperty.call(object, path);
- }
- return result || (isLength(object.length) && isIndex(path, object.length) &&
- (isArray(object) || isArguments(object)));
- }
-
- /**
- * Creates an object composed of the inverted keys and values of `object`.
- * If `object` contains duplicate values, subsequent values overwrite property
- * assignments of previous values unless `multiValue` is `true`.
- *
- * @static
- * @memberOf _
- * @category Object
- * @param {Object} object The object to invert.
- * @param {boolean} [multiValue] Allow multiple values per key.
- * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
- * @returns {Object} Returns the new inverted object.
- * @example
- *
- * var object = { 'a': 1, 'b': 2, 'c': 1 };
- *
- * _.invert(object);
- * // => { '1': 'c', '2': 'b' }
- *
- * // with `multiValue`
- * _.invert(object, true);
- * // => { '1': ['a', 'c'], '2': ['b'] }
- */
- function invert(object, multiValue, guard) {
- if (guard && isIterateeCall(object, multiValue, guard)) {
- multiValue = undefined;
- }
- var index = -1,
- props = keys(object),
- length = props.length,
- result = {};
-
- while (++index < length) {
- var key = props[index],
- value = object[key];
-
- if (multiValue) {
- if (hasOwnProperty.call(result, value)) {
- result[value].push(key);
- } else {
- result[value] = [key];
- }
- }
- else {
- result[value] = key;
- }
- }
- return result;
- }
-
- /**
- * Creates an array of the own enumerable property names of `object`.
- *
- * **Note:** Non-object values are coerced to objects. See the
- * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys)
- * for more details.
- *
- * @static
- * @memberOf _
- * @category Object
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property names.
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.keys(new Foo);
- * // => ['a', 'b'] (iteration order is not guaranteed)
- *
- * _.keys('hi');
- * // => ['0', '1']
- */
- var keys = !nativeKeys ? shimKeys : function(object) {
- var Ctor = object == null ? undefined : object.constructor;
- if ((typeof Ctor == 'function' && Ctor.prototype === object) ||
- (typeof object != 'function' && isArrayLike(object))) {
- return shimKeys(object);
- }
- return isObject(object) ? nativeKeys(object) : [];
- };
-
- /**
- * Creates an array of the own and inherited enumerable property names of `object`.
- *
- * **Note:** Non-object values are coerced to objects.
- *
- * @static
- * @memberOf _
- * @category Object
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property names.
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.keysIn(new Foo);
- * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
- */
- function keysIn(object) {
- if (object == null) {
- return [];
- }
- if (!isObject(object)) {
- object = Object(object);
- }
- var length = object.length;
- length = (length && isLength(length) &&
- (isArray(object) || isArguments(object)) && length) || 0;
-
- var Ctor = object.constructor,
- index = -1,
- isProto = typeof Ctor == 'function' && Ctor.prototype === object,
- result = Array(length),
- skipIndexes = length > 0;
-
- while (++index < length) {
- result[index] = (index + '');
- }
- for (var key in object) {
- if (!(skipIndexes && isIndex(key, length)) &&
- !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
- result.push(key);
- }
- }
- return result;
- }
-
- /**
- * The opposite of `_.mapValues`; this method creates an object with the
- * same values as `object` and keys generated by running each own enumerable
- * property of `object` through `iteratee`.
- *
- * @static
- * @memberOf _
- * @category Object
- * @param {Object} object The object to iterate over.
- * @param {Function|Object|string} [iteratee=_.identity] The function invoked
- * per iteration.
- * @param {*} [thisArg] The `this` binding of `iteratee`.
- * @returns {Object} Returns the new mapped object.
- * @example
- *
- * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
- * return key + value;
- * });
- * // => { 'a1': 1, 'b2': 2 }
- */
- var mapKeys = createObjectMapper(true);
-
- /**
- * Creates an object with the same keys as `object` and values generated by
- * running each own enumerable property of `object` through `iteratee`. The
- * iteratee function is bound to `thisArg` and invoked with three arguments:
- * (value, key, object).
- *
- * 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 Object
- * @param {Object} object The object to iterate over.
- * @param {Function|Object|string} [iteratee=_.identity] The function invoked
- * per iteration.
- * @param {*} [thisArg] The `this` binding of `iteratee`.
- * @returns {Object} Returns the new mapped object.
- * @example
- *
- * _.mapValues({ 'a': 1, 'b': 2 }, function(n) {
- * return n * 3;
- * });
- * // => { 'a': 3, 'b': 6 }
- *
- * var users = {
- * 'fred': { 'user': 'fred', 'age': 40 },
- * 'pebbles': { 'user': 'pebbles', 'age': 1 }
- * };
- *
- * // using the `_.property` callback shorthand
- * _.mapValues(users, 'age');
- * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
- */
- var mapValues = createObjectMapper();
-
- /**
- * The opposite of `_.pick`; this method creates an object composed of the
- * own and inherited enumerable properties of `object` that are not omitted.
- *
- * @static
- * @memberOf _
- * @category Object
- * @param {Object} object The source object.
- * @param {Function|...(string|string[])} [predicate] The function invoked per
- * iteration or property names to omit, specified as individual property
- * names or arrays of property names.
- * @param {*} [thisArg] The `this` binding of `predicate`.
- * @returns {Object} Returns the new object.
- * @example
- *
- * var object = { 'user': 'fred', 'age': 40 };
- *
- * _.omit(object, 'age');
- * // => { 'user': 'fred' }
- *
- * _.omit(object, _.isNumber);
- * // => { 'user': 'fred' }
- */
- var omit = restParam(function(object, props) {
- if (object == null) {
- return {};
- }
- if (typeof props[0] != 'function') {
- var props = arrayMap(baseFlatten(props), String);
- return pickByArray(object, baseDifference(keysIn(object), props));
- }
- var predicate = bindCallback(props[0], props[1], 3);
- return pickByCallback(object, function(value, key, object) {
- return !predicate(value, key, object);
- });
- });
-
- /**
- * Creates a two dimensional array of the key-value pairs for `object`,
- * e.g. `[[key1, value1], [key2, value2]]`.
- *
- * @static
- * @memberOf _
- * @category Object
- * @param {Object} object The object to query.
- * @returns {Array} Returns the new array of key-value pairs.
- * @example
- *
- * _.pairs({ 'barney': 36, 'fred': 40 });
- * // => [['barney', 36], ['fred', 40]] (iteration order is not guaranteed)
- */
- function pairs(object) {
- object = toObject(object);
-
- var index = -1,
- props = keys(object),
- length = props.length,
- result = Array(length);
-
- while (++index < length) {
- var key = props[index];
- result[index] = [key, object[key]];
- }
- return result;
- }
-
- /**
- * Creates an object composed of the picked `object` properties. Property
- * names may be specified as individual arguments or as arrays of property
- * names. If `predicate` is provided it is invoked for each property of `object`
- * picking the properties `predicate` returns truthy for. The predicate is
- * bound to `thisArg` and invoked with three arguments: (value, key, object).
- *
- * @static
- * @memberOf _
- * @category Object
- * @param {Object} object The source object.
- * @param {Function|...(string|string[])} [predicate] The function invoked per
- * iteration or property names to pick, specified as individual property
- * names or arrays of property names.
- * @param {*} [thisArg] The `this` binding of `predicate`.
- * @returns {Object} Returns the new object.
- * @example
- *
- * var object = { 'user': 'fred', 'age': 40 };
- *
- * _.pick(object, 'user');
- * // => { 'user': 'fred' }
- *
- * _.pick(object, _.isString);
- * // => { 'user': 'fred' }
- */
- var pick = restParam(function(object, props) {
- if (object == null) {
- return {};
- }
- return typeof props[0] == 'function'
- ? pickByCallback(object, bindCallback(props[0], props[1], 3))
- : pickByArray(object, baseFlatten(props));
- });
-
- /**
- * This method is like `_.get` except that if the resolved value is a function
- * it is invoked with the `this` binding of its parent object and its result
- * is returned.
- *
- * @static
- * @memberOf _
- * @category Object
- * @param {Object} object The object to query.
- * @param {Array|string} path The path of the property to resolve.
- * @param {*} [defaultValue] The value returned if the resolved value is `undefined`.
- * @returns {*} Returns the resolved value.
- * @example
- *
- * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
- *
- * _.result(object, 'a[0].b.c1');
- * // => 3
- *
- * _.result(object, 'a[0].b.c2');
- * // => 4
- *
- * _.result(object, 'a.b.c', 'default');
- * // => 'default'
- *
- * _.result(object, 'a.b.c', _.constant('default'));
- * // => 'default'
- */
- function result(object, path, defaultValue) {
- var result = object == null ? undefined : object[path];
- if (result === undefined) {
- if (object != null && !isKey(path, object)) {
- path = toPath(path);
- object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
- result = object == null ? undefined : object[last(path)];
- }
- result = result === undefined ? defaultValue : result;
- }
- return isFunction(result) ? result.call(object) : result;
- }
-
- /**
- * Sets the property value of `path` on `object`. If a portion of `path`
- * does not exist it is created.
- *
- * @static
- * @memberOf _
- * @category Object
- * @param {Object} object The object to augment.
- * @param {Array|string} path The path of the property to set.
- * @param {*} value The value to set.
- * @returns {Object} Returns `object`.
- * @example
- *
- * var object = { 'a': [{ 'b': { 'c': 3 } }] };
- *
- * _.set(object, 'a[0].b.c', 4);
- * console.log(object.a[0].b.c);
- * // => 4
- *
- * _.set(object, 'x[0].y.z', 5);
- * console.log(object.x[0].y.z);
- * // => 5
- */
- function set(object, path, value) {
- if (object == null) {
- return object;
- }
- var pathKey = (path + '');
- path = (object[pathKey] != null || isKey(path, object)) ? [pathKey] : toPath(path);
-
- var index = -1,
- length = path.length,
- lastIndex = length - 1,
- nested = object;
-
- while (nested != null && ++index < length) {
- var key = path[index];
- if (isObject(nested)) {
- if (index == lastIndex) {
- nested[key] = value;
- } else if (nested[key] == null) {
- nested[key] = isIndex(path[index + 1]) ? [] : {};
- }
- }
- nested = nested[key];
- }
- return object;
- }
-
- /**
- * An alternative to `_.reduce`; this method transforms `object` to a new
- * `accumulator` object which is the result of running each of its own enumerable
- * properties through `iteratee`, with each invocation potentially mutating
- * the `accumulator` object. The `iteratee` is bound to `thisArg` and invoked
- * with four arguments: (accumulator, value, key, object). Iteratee functions
- * may exit iteration early by explicitly returning `false`.
- *
- * @static
- * @memberOf _
- * @category Object
- * @param {Array|Object} object The object to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @param {*} [accumulator] The custom accumulator value.
- * @param {*} [thisArg] The `this` binding of `iteratee`.
- * @returns {*} Returns the accumulated value.
- * @example
- *
- * _.transform([2, 3, 4], function(result, n) {
- * result.push(n *= n);
- * return n % 2 == 0;
- * });
- * // => [4, 9]
- *
- * _.transform({ 'a': 1, 'b': 2 }, function(result, n, key) {
- * result[key] = n * 3;
- * });
- * // => { 'a': 3, 'b': 6 }
- */
- function transform(object, iteratee, accumulator, thisArg) {
- var isArr = isArray(object) || isTypedArray(object);
- iteratee = getCallback(iteratee, thisArg, 4);
-
- if (accumulator == null) {
- if (isArr || isObject(object)) {
- var Ctor = object.constructor;
- if (isArr) {
- accumulator = isArray(object) ? new Ctor : [];
- } else {
- accumulator = baseCreate(isFunction(Ctor) ? Ctor.prototype : undefined);
- }
- } else {
- accumulator = {};
- }
- }
- (isArr ? arrayEach : baseForOwn)(object, function(value, index, object) {
- return iteratee(accumulator, value, index, object);
- });
- return accumulator;
- }
-
- /**
- * Creates an array of the own enumerable property values of `object`.
- *
- * **Note:** Non-object values are coerced to objects.
- *
- * @static
- * @memberOf _
- * @category Object
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property values.
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.values(new Foo);
- * // => [1, 2] (iteration order is not guaranteed)
- *
- * _.values('hi');
- * // => ['h', 'i']
- */
- function values(object) {
- return baseValues(object, keys(object));
- }
-
- /**
- * Creates an array of the own and inherited enumerable property values
- * of `object`.
- *
- * **Note:** Non-object values are coerced to objects.
- *
- * @static
- * @memberOf _
- * @category Object
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property values.
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.valuesIn(new Foo);
- * // => [1, 2, 3] (iteration order is not guaranteed)
- */
- function valuesIn(object) {
- return baseValues(object, keysIn(object));
- }
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Checks if `n` is between `start` and up to but not including, `end`. If
- * `end` is not specified it is set to `start` with `start` then set to `0`.
- *
- * @static
- * @memberOf _
- * @category Number
- * @param {number} n The number to check.
- * @param {number} [start=0] The start of the range.
- * @param {number} end The end of the range.
- * @returns {boolean} Returns `true` if `n` is in the range, else `false`.
- * @example
- *
- * _.inRange(3, 2, 4);
- * // => true
- *
- * _.inRange(4, 8);
- * // => true
- *
- * _.inRange(4, 2);
- * // => false
- *
- * _.inRange(2, 2);
- * // => false
- *
- * _.inRange(1.2, 2);
- * // => true
- *
- * _.inRange(5.2, 4);
- * // => false
- */
- function inRange(value, start, end) {
- start = +start || 0;
- if (end === undefined) {
- end = start;
- start = 0;
- } else {
- end = +end || 0;
- }
- return value >= nativeMin(start, end) && value < nativeMax(start, end);
- }
-
- /**
- * Produces a random number between `min` and `max` (inclusive). If only one
- * argument is provided a number between `0` and the given number is returned.
- * If `floating` is `true`, or either `min` or `max` are floats, a floating-point
- * number is returned instead of an integer.
- *
- * @static
- * @memberOf _
- * @category Number
- * @param {number} [min=0] The minimum possible value.
- * @param {number} [max=1] The maximum possible value.
- * @param {boolean} [floating] Specify returning a floating-point number.
- * @returns {number} Returns the random number.
- * @example
- *
- * _.random(0, 5);
- * // => an integer between 0 and 5
- *
- * _.random(5);
- * // => also an integer between 0 and 5
- *
- * _.random(5, true);
- * // => a floating-point number between 0 and 5
- *
- * _.random(1.2, 5.2);
- * // => a floating-point number between 1.2 and 5.2
- */
- function random(min, max, floating) {
- if (floating && isIterateeCall(min, max, floating)) {
- max = floating = undefined;
- }
- var noMin = min == null,
- noMax = max == null;
-
- if (floating == null) {
- if (noMax && typeof min == 'boolean') {
- floating = min;
- min = 1;
- }
- else if (typeof max == 'boolean') {
- floating = max;
- noMax = true;
- }
- }
- if (noMin && noMax) {
- max = 1;
- noMax = false;
- }
- min = +min || 0;
- if (noMax) {
- max = min;
- min = 0;
- } else {
- max = +max || 0;
- }
- if (floating || min % 1 || max % 1) {
- var rand = nativeRandom();
- return nativeMin(min + (rand * (max - min + parseFloat('1e-' + ((rand + '').length - 1)))), max);
- }
- return baseRandom(min, max);
- }
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
- *
- * @static
- * @memberOf _
- * @category String
- * @param {string} [string=''] The string to convert.
- * @returns {string} Returns the camel cased string.
- * @example
- *
- * _.camelCase('Foo Bar');
- * // => 'fooBar'
- *
- * _.camelCase('--foo-bar');
- * // => 'fooBar'
- *
- * _.camelCase('__foo_bar__');
- * // => 'fooBar'
- */
- var camelCase = createCompounder(function(result, word, index) {
- word = word.toLowerCase();
- return result + (index ? (word.charAt(0).toUpperCase() + word.slice(1)) : word);
- });
-
- /**
- * Capitalizes the first character of `string`.
- *
- * @static
- * @memberOf _
- * @category String
- * @param {string} [string=''] The string to capitalize.
- * @returns {string} Returns the capitalized string.
- * @example
- *
- * _.capitalize('fred');
- * // => 'Fred'
- */
- function capitalize(string) {
- string = baseToString(string);
- return string && (string.charAt(0).toUpperCase() + string.slice(1));
- }
-
- /**
- * Deburrs `string` by converting [latin-1 supplementary letters](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
- * to basic latin letters and removing [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
- *
- * @static
- * @memberOf _
- * @category String
- * @param {string} [string=''] The string to deburr.
- * @returns {string} Returns the deburred string.
- * @example
- *
- * _.deburr('déjà vu');
- * // => 'deja vu'
- */
- function deburr(string) {
- string = baseToString(string);
- return string && string.replace(reLatin1, deburrLetter).replace(reComboMark, '');
- }
-
- /**
- * Checks if `string` ends with the given target string.
- *
- * @static
- * @memberOf _
- * @category String
- * @param {string} [string=''] The string to search.
- * @param {string} [target] The string to search for.
- * @param {number} [position=string.length] The position to search from.
- * @returns {boolean} Returns `true` if `string` ends with `target`, else `false`.
- * @example
- *
- * _.endsWith('abc', 'c');
- * // => true
- *
- * _.endsWith('abc', 'b');
- * // => false
- *
- * _.endsWith('abc', 'b', 2);
- * // => true
- */
- function endsWith(string, target, position) {
- string = baseToString(string);
- target = (target + '');
-
- var length = string.length;
- position = position === undefined
- ? length
- : nativeMin(position < 0 ? 0 : (+position || 0), length);
-
- position -= target.length;
- return position >= 0 && string.indexOf(target, position) == position;
- }
-
- /**
- * Converts the characters "&", "<", ">", '"', "'", and "\`", in `string` to
- * their corresponding HTML entities.
- *
- * **Note:** No other characters are escaped. To escape additional characters
- * use a third-party library like [_he_](https://mths.be/he).
- *
- * Though the ">" character is escaped for symmetry, characters like
- * ">" and "/" don't need escaping in HTML and have no special meaning
- * unless they're part of a tag or unquoted attribute value.
- * See [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
- * (under "semi-related fun fact") for more details.
- *
- * Backticks are escaped because in Internet Explorer < 9, they can break out
- * of attribute values or HTML comments. See [#59](https://html5sec.org/#59),
- * [#102](https://html5sec.org/#102), [#108](https://html5sec.org/#108), and
- * [#133](https://html5sec.org/#133) of the [HTML5 Security Cheatsheet](https://html5sec.org/)
- * for more details.
- *
- * When working with HTML you should always [quote attribute values](http://wonko.com/post/html-escaping)
- * to reduce XSS vectors.
- *
- * @static
- * @memberOf _
- * @category String
- * @param {string} [string=''] The string to escape.
- * @returns {string} Returns the escaped string.
- * @example
- *
- * _.escape('fred, barney, & pebbles');
- * // => 'fred, barney, & pebbles'
- */
- function escape(string) {
- // Reset `lastIndex` because in IE < 9 `String#replace` does not.
- string = baseToString(string);
- return (string && reHasUnescapedHtml.test(string))
- ? string.replace(reUnescapedHtml, escapeHtmlChar)
- : string;
- }
-
- /**
- * Escapes the `RegExp` special characters "\", "/", "^", "$", ".", "|", "?",
- * "*", "+", "(", ")", "[", "]", "{" and "}" in `string`.
- *
- * @static
- * @memberOf _
- * @category String
- * @param {string} [string=''] The string to escape.
- * @returns {string} Returns the escaped string.
- * @example
- *
- * _.escapeRegExp('[lodash](https://lodash.com/)');
- * // => '\[lodash\]\(https:\/\/lodash\.com\/\)'
- */
- function escapeRegExp(string) {
- string = baseToString(string);
- return (string && reHasRegExpChars.test(string))
- ? string.replace(reRegExpChars, escapeRegExpChar)
- : (string || '(?:)');
- }
-
- /**
- * Converts `string` to [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
- *
- * @static
- * @memberOf _
- * @category String
- * @param {string} [string=''] The string to convert.
- * @returns {string} Returns the kebab cased string.
- * @example
- *
- * _.kebabCase('Foo Bar');
- * // => 'foo-bar'
- *
- * _.kebabCase('fooBar');
- * // => 'foo-bar'
- *
- * _.kebabCase('__foo_bar__');
- * // => 'foo-bar'
- */
- var kebabCase = createCompounder(function(result, word, index) {
- return result + (index ? '-' : '') + word.toLowerCase();
- });
-
- /**
- * Pads `string` on the left and right sides if it's shorter than `length`.
- * Padding characters are truncated if they can't be evenly divided by `length`.
- *
- * @static
- * @memberOf _
- * @category String
- * @param {string} [string=''] The string to pad.
- * @param {number} [length=0] The padding length.
- * @param {string} [chars=' '] The string used as padding.
- * @returns {string} Returns the padded string.
- * @example
- *
- * _.pad('abc', 8);
- * // => ' abc '
- *
- * _.pad('abc', 8, '_-');
- * // => '_-abc_-_'
- *
- * _.pad('abc', 3);
- * // => 'abc'
- */
- function pad(string, length, chars) {
- string = baseToString(string);
- length = +length;
-
- var strLength = string.length;
- if (strLength >= length || !nativeIsFinite(length)) {
- return string;
- }
- var mid = (length - strLength) / 2,
- leftLength = nativeFloor(mid),
- rightLength = nativeCeil(mid);
-
- chars = createPadding('', rightLength, chars);
- return chars.slice(0, leftLength) + string + chars;
- }
-
- /**
- * Pads `string` on the left side if it's shorter than `length`. Padding
- * characters are truncated if they exceed `length`.
- *
- * @static
- * @memberOf _
- * @category String
- * @param {string} [string=''] The string to pad.
- * @param {number} [length=0] The padding length.
- * @param {string} [chars=' '] The string used as padding.
- * @returns {string} Returns the padded string.
- * @example
- *
- * _.padLeft('abc', 6);
- * // => ' abc'
- *
- * _.padLeft('abc', 6, '_-');
- * // => '_-_abc'
- *
- * _.padLeft('abc', 3);
- * // => 'abc'
- */
- var padLeft = createPadDir();
-
- /**
- * Pads `string` on the right side if it's shorter than `length`. Padding
- * characters are truncated if they exceed `length`.
- *
- * @static
- * @memberOf _
- * @category String
- * @param {string} [string=''] The string to pad.
- * @param {number} [length=0] The padding length.
- * @param {string} [chars=' '] The string used as padding.
- * @returns {string} Returns the padded string.
- * @example
- *
- * _.padRight('abc', 6);
- * // => 'abc '
- *
- * _.padRight('abc', 6, '_-');
- * // => 'abc_-_'
- *
- * _.padRight('abc', 3);
- * // => 'abc'
- */
- var padRight = createPadDir(true);
-
- /**
- * Converts `string` to an integer of the specified radix. If `radix` is
- * `undefined` or `0`, a `radix` of `10` is used unless `value` is a hexadecimal,
- * in which case a `radix` of `16` is used.
- *
- * **Note:** This method aligns with the [ES5 implementation](https://es5.github.io/#E)
- * of `parseInt`.
- *
- * @static
- * @memberOf _
- * @category String
- * @param {string} string The string to convert.
- * @param {number} [radix] The radix to interpret `value` by.
- * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
- * @returns {number} Returns the converted integer.
- * @example
- *
- * _.parseInt('08');
- * // => 8
- *
- * _.map(['6', '08', '10'], _.parseInt);
- * // => [6, 8, 10]
- */
- function parseInt(string, radix, guard) {
- // Firefox < 21 and Opera < 15 follow ES3 for `parseInt`.
- // Chrome fails to trim leading whitespace characters.
- // See https://code.google.com/p/v8/issues/detail?id=3109 for more details.
- if (guard ? isIterateeCall(string, radix, guard) : radix == null) {
- radix = 0;
- } else if (radix) {
- radix = +radix;
- }
- string = trim(string);
- return nativeParseInt(string, radix || (reHasHexPrefix.test(string) ? 16 : 10));
- }
-
- /**
- * Repeats the given string `n` times.
- *
- * @static
- * @memberOf _
- * @category String
- * @param {string} [string=''] The string to repeat.
- * @param {number} [n=0] The number of times to repeat the string.
- * @returns {string} Returns the repeated string.
- * @example
- *
- * _.repeat('*', 3);
- * // => '***'
- *
- * _.repeat('abc', 2);
- * // => 'abcabc'
- *
- * _.repeat('abc', 0);
- * // => ''
- */
- function repeat(string, n) {
- var result = '';
- string = baseToString(string);
- n = +n;
- if (n < 1 || !string || !nativeIsFinite(n)) {
- return result;
- }
- // Leverage the exponentiation by squaring algorithm for a faster repeat.
- // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
- do {
- if (n % 2) {
- result += string;
- }
- n = nativeFloor(n / 2);
- string += string;
- } while (n);
-
- return result;
- }
-
- /**
- * Converts `string` to [snake case](https://en.wikipedia.org/wiki/Snake_case).
- *
- * @static
- * @memberOf _
- * @category String
- * @param {string} [string=''] The string to convert.
- * @returns {string} Returns the snake cased string.
- * @example
- *
- * _.snakeCase('Foo Bar');
- * // => 'foo_bar'
- *
- * _.snakeCase('fooBar');
- * // => 'foo_bar'
- *
- * _.snakeCase('--foo-bar');
- * // => 'foo_bar'
- */
- var snakeCase = createCompounder(function(result, word, index) {
- return result + (index ? '_' : '') + word.toLowerCase();
- });
-
- /**
- * Converts `string` to [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
- *
- * @static
- * @memberOf _
- * @category String
- * @param {string} [string=''] The string to convert.
- * @returns {string} Returns the start cased string.
- * @example
- *
- * _.startCase('--foo-bar');
- * // => 'Foo Bar'
- *
- * _.startCase('fooBar');
- * // => 'Foo Bar'
- *
- * _.startCase('__foo_bar__');
- * // => 'Foo Bar'
- */
- var startCase = createCompounder(function(result, word, index) {
- return result + (index ? ' ' : '') + (word.charAt(0).toUpperCase() + word.slice(1));
- });
-
- /**
- * Checks if `string` starts with the given target string.
- *
- * @static
- * @memberOf _
- * @category String
- * @param {string} [string=''] The string to search.
- * @param {string} [target] The string to search for.
- * @param {number} [position=0] The position to search from.
- * @returns {boolean} Returns `true` if `string` starts with `target`, else `false`.
- * @example
- *
- * _.startsWith('abc', 'a');
- * // => true
- *
- * _.startsWith('abc', 'b');
- * // => false
- *
- * _.startsWith('abc', 'b', 1);
- * // => true
- */
- function startsWith(string, target, position) {
- string = baseToString(string);
- position = position == null
- ? 0
- : nativeMin(position < 0 ? 0 : (+position || 0), string.length);
-
- return string.lastIndexOf(target, position) == position;
- }
-
- /**
- * Creates a compiled template function that can interpolate data properties
- * in "interpolate" delimiters, HTML-escape interpolated data properties in
- * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
- * properties may be accessed as free variables in the template. If a setting
- * object is provided it takes precedence over `_.templateSettings` values.
- *
- * **Note:** In the development build `_.template` utilizes
- * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
- * for easier debugging.
- *
- * For more information on precompiling templates see
- * [lodash's custom builds documentation](https://lodash.com/custom-builds).
- *
- * For more information on Chrome extension sandboxes see
- * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
- *
- * @static
- * @memberOf _
- * @category String
- * @param {string} [string=''] The template string.
- * @param {Object} [options] The options object.
- * @param {RegExp} [options.escape] The HTML "escape" delimiter.
- * @param {RegExp} [options.evaluate] The "evaluate" delimiter.
- * @param {Object} [options.imports] An object to import into the template as free variables.
- * @param {RegExp} [options.interpolate] The "interpolate" delimiter.
- * @param {string} [options.sourceURL] The sourceURL of the template's compiled source.
- * @param {string} [options.variable] The data object variable name.
- * @param- {Object} [otherOptions] Enables the legacy `options` param signature.
- * @returns {Function} Returns the compiled template function.
- * @example
- *
- * // using the "interpolate" delimiter to create a compiled template
- * var compiled = _.template('hello <%= user %>!');
- * compiled({ 'user': 'fred' });
- * // => 'hello fred!'
- *
- * // using the HTML "escape" delimiter to escape data property values
- * var compiled = _.template('<%- value %> ');
- * compiled({ 'value': '
-
-```
-
-
-## API
-
-### Parsing
-
-Parsing a plist from filename:
-
-``` javascript
-var fs = require('fs');
-var plist = require('plist');
-
-var obj = plist.parse(fs.readFileSync('myPlist.plist', 'utf8'));
-console.log(JSON.stringify(obj));
-```
-
-Parsing a plist from string payload:
-
-``` javascript
-var plist = require('plist');
-
-var obj = plist.parse('Hello World! ');
-console.log(obj); // Hello World!
-```
-
-### Building
-
-Given an existing JavaScript Object, you can turn it into an XML document
-that complies with the plist DTD:
-
-``` javascript
-var plist = require('plist');
-
-console.log(plist.build({ foo: 'bar' }));
-```
-
-
-## License
-
-(The MIT License)
-
-Copyright (c) 2010-2014 Nathan Rajlich
-
-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.
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/plist/dist/plist-build.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/plist/dist/plist-build.js
deleted file mode 100644
index 4fcd378..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/plist/dist/plist-build.js
+++ /dev/null
@@ -1,3982 +0,0 @@
-(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.plist = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o 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))
-
-},{}],3:[function(require,module,exports){
-/**
- * Determine if an object is Buffer
- *
- * Author: Feross Aboukhadijeh
- * License: MIT
- *
- * `npm install is-buffer`
- */
-
-module.exports = function (obj) {
- return !!(obj != null &&
- (obj._isBuffer || // For Safari 5-7 (missing Object.prototype.constructor)
- (obj.constructor &&
- typeof obj.constructor.isBuffer === 'function' &&
- obj.constructor.isBuffer(obj))
- ))
-}
-
-},{}],4:[function(require,module,exports){
-/**
- * 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;
-
-},{}],5:[function(require,module,exports){
-var arrayEvery = require('../internal/arrayEvery'),
- baseCallback = require('../internal/baseCallback'),
- baseEvery = require('../internal/baseEvery'),
- isArray = require('../lang/isArray'),
- isIterateeCall = require('../internal/isIterateeCall');
-
-/**
- * Checks if `predicate` returns truthy for **all** elements of `collection`.
- * The predicate is bound to `thisArg` and invoked with three arguments:
- * (value, index|key, collection).
- *
- * 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 _
- * @alias all
- * @category Collection
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function|Object|string} [predicate=_.identity] The function invoked
- * per iteration.
- * @param {*} [thisArg] The `this` binding of `predicate`.
- * @returns {boolean} Returns `true` if all elements pass the predicate check,
- * else `false`.
- * @example
- *
- * _.every([true, 1, null, 'yes'], Boolean);
- * // => false
- *
- * var users = [
- * { 'user': 'barney', 'active': false },
- * { 'user': 'fred', 'active': false }
- * ];
- *
- * // using the `_.matches` callback shorthand
- * _.every(users, { 'user': 'barney', 'active': false });
- * // => false
- *
- * // using the `_.matchesProperty` callback shorthand
- * _.every(users, 'active', false);
- * // => true
- *
- * // using the `_.property` callback shorthand
- * _.every(users, 'active');
- * // => false
- */
-function every(collection, predicate, thisArg) {
- var func = isArray(collection) ? arrayEvery : baseEvery;
- if (thisArg && isIterateeCall(collection, predicate, thisArg)) {
- predicate = undefined;
- }
- if (typeof predicate != 'function' || thisArg !== undefined) {
- predicate = baseCallback(predicate, thisArg, 3);
- }
- return func(collection, predicate);
-}
-
-module.exports = every;
-
-},{"../internal/arrayEvery":7,"../internal/baseCallback":11,"../internal/baseEvery":15,"../internal/isIterateeCall":40,"../lang/isArray":49}],6:[function(require,module,exports){
-/** Used as the `TypeError` message for "Functions" methods. */
-var FUNC_ERROR_TEXT = 'Expected a function';
-
-/* Native method references for those with the same name as other `lodash` methods. */
-var nativeMax = Math.max;
-
-/**
- * Creates a function that invokes `func` with the `this` binding of the
- * created function and arguments from `start` and beyond provided as an array.
- *
- * **Note:** This method is based on the [rest parameter](https://developer.mozilla.org/Web/JavaScript/Reference/Functions/rest_parameters).
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {Function} func The function to apply a rest parameter to.
- * @param {number} [start=func.length-1] The start position of the rest parameter.
- * @returns {Function} Returns the new function.
- * @example
- *
- * var say = _.restParam(function(what, names) {
- * return what + ' ' + _.initial(names).join(', ') +
- * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
- * });
- *
- * say('hello', 'fred', 'barney', 'pebbles');
- * // => 'hello fred, barney, & pebbles'
- */
-function restParam(func, start) {
- if (typeof func != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0);
- return function() {
- var args = arguments,
- index = -1,
- length = nativeMax(args.length - start, 0),
- rest = Array(length);
-
- while (++index < length) {
- rest[index] = args[start + index];
- }
- switch (start) {
- case 0: return func.call(this, rest);
- case 1: return func.call(this, args[0], rest);
- case 2: return func.call(this, args[0], args[1], rest);
- }
- var otherArgs = Array(start + 1);
- index = -1;
- while (++index < start) {
- otherArgs[index] = args[index];
- }
- otherArgs[start] = rest;
- return func.apply(this, otherArgs);
- };
-}
-
-module.exports = restParam;
-
-},{}],7:[function(require,module,exports){
-/**
- * A specialized version of `_.every` for arrays without support for callback
- * shorthands and `this` binding.
- *
- * @private
- * @param {Array} array The array to iterate over.
- * @param {Function} predicate The function invoked per iteration.
- * @returns {boolean} Returns `true` if all elements pass the predicate check,
- * else `false`.
- */
-function arrayEvery(array, predicate) {
- var index = -1,
- length = array.length;
-
- while (++index < length) {
- if (!predicate(array[index], index, array)) {
- return false;
- }
- }
- return true;
-}
-
-module.exports = arrayEvery;
-
-},{}],8:[function(require,module,exports){
-/**
- * A specialized version of `_.some` for arrays without support for callback
- * shorthands and `this` binding.
- *
- * @private
- * @param {Array} array The array to iterate over.
- * @param {Function} predicate The function invoked per iteration.
- * @returns {boolean} Returns `true` if any element passes the predicate check,
- * else `false`.
- */
-function arraySome(array, predicate) {
- var index = -1,
- length = array.length;
-
- while (++index < length) {
- if (predicate(array[index], index, array)) {
- return true;
- }
- }
- return false;
-}
-
-module.exports = arraySome;
-
-},{}],9:[function(require,module,exports){
-var keys = require('../object/keys');
-
-/**
- * A specialized version of `_.assign` for customizing assigned values without
- * support for argument juggling, multiple sources, and `this` binding `customizer`
- * functions.
- *
- * @private
- * @param {Object} object The destination object.
- * @param {Object} source The source object.
- * @param {Function} customizer The function to customize assigned values.
- * @returns {Object} Returns `object`.
- */
-function assignWith(object, source, customizer) {
- var index = -1,
- props = keys(source),
- length = props.length;
-
- while (++index < length) {
- var key = props[index],
- value = object[key],
- result = customizer(value, source[key], key, object, source);
-
- if ((result === result ? (result !== value) : (value === value)) ||
- (value === undefined && !(key in object))) {
- object[key] = result;
- }
- }
- return object;
-}
-
-module.exports = assignWith;
-
-},{"../object/keys":58}],10:[function(require,module,exports){
-var baseCopy = require('./baseCopy'),
- keys = require('../object/keys');
-
-/**
- * The base implementation of `_.assign` without support for argument juggling,
- * multiple sources, and `customizer` functions.
- *
- * @private
- * @param {Object} object The destination object.
- * @param {Object} source The source object.
- * @returns {Object} Returns `object`.
- */
-function baseAssign(object, source) {
- return source == null
- ? object
- : baseCopy(source, keys(source), object);
-}
-
-module.exports = baseAssign;
-
-},{"../object/keys":58,"./baseCopy":12}],11:[function(require,module,exports){
-var baseMatches = require('./baseMatches'),
- baseMatchesProperty = require('./baseMatchesProperty'),
- bindCallback = require('./bindCallback'),
- identity = require('../utility/identity'),
- property = require('../utility/property');
-
-/**
- * The base implementation of `_.callback` which supports specifying the
- * number of arguments to provide to `func`.
- *
- * @private
- * @param {*} [func=_.identity] The value to convert to a callback.
- * @param {*} [thisArg] The `this` binding of `func`.
- * @param {number} [argCount] The number of arguments to provide to `func`.
- * @returns {Function} Returns the callback.
- */
-function baseCallback(func, thisArg, argCount) {
- var type = typeof func;
- if (type == 'function') {
- return thisArg === undefined
- ? func
- : bindCallback(func, thisArg, argCount);
- }
- if (func == null) {
- return identity;
- }
- if (type == 'object') {
- return baseMatches(func);
- }
- return thisArg === undefined
- ? property(func)
- : baseMatchesProperty(func, thisArg);
-}
-
-module.exports = baseCallback;
-
-},{"../utility/identity":61,"../utility/property":62,"./baseMatches":22,"./baseMatchesProperty":23,"./bindCallback":28}],12:[function(require,module,exports){
-/**
- * Copies properties of `source` to `object`.
- *
- * @private
- * @param {Object} source The object to copy properties from.
- * @param {Array} props The property names to copy.
- * @param {Object} [object={}] The object to copy properties to.
- * @returns {Object} Returns `object`.
- */
-function baseCopy(source, props, object) {
- object || (object = {});
-
- var index = -1,
- length = props.length;
-
- while (++index < length) {
- var key = props[index];
- object[key] = source[key];
- }
- return object;
-}
-
-module.exports = baseCopy;
-
-},{}],13:[function(require,module,exports){
-var isObject = require('../lang/isObject');
-
-/**
- * The base implementation of `_.create` without support for assigning
- * properties to the created object.
- *
- * @private
- * @param {Object} prototype The object to inherit from.
- * @returns {Object} Returns the new object.
- */
-var baseCreate = (function() {
- function object() {}
- return function(prototype) {
- if (isObject(prototype)) {
- object.prototype = prototype;
- var result = new object;
- object.prototype = undefined;
- }
- return result || {};
- };
-}());
-
-module.exports = baseCreate;
-
-},{"../lang/isObject":53}],14:[function(require,module,exports){
-var baseForOwn = require('./baseForOwn'),
- createBaseEach = require('./createBaseEach');
-
-/**
- * The base implementation of `_.forEach` without support for callback
- * shorthands and `this` binding.
- *
- * @private
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Array|Object|string} Returns `collection`.
- */
-var baseEach = createBaseEach(baseForOwn);
-
-module.exports = baseEach;
-
-},{"./baseForOwn":17,"./createBaseEach":30}],15:[function(require,module,exports){
-var baseEach = require('./baseEach');
-
-/**
- * The base implementation of `_.every` without support for callback
- * shorthands and `this` binding.
- *
- * @private
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function} predicate The function invoked per iteration.
- * @returns {boolean} Returns `true` if all elements pass the predicate check,
- * else `false`
- */
-function baseEvery(collection, predicate) {
- var result = true;
- baseEach(collection, function(value, index, collection) {
- result = !!predicate(value, index, collection);
- return result;
- });
- return result;
-}
-
-module.exports = baseEvery;
-
-},{"./baseEach":14}],16:[function(require,module,exports){
-var createBaseFor = require('./createBaseFor');
-
-/**
- * The base implementation of `baseForIn` and `baseForOwn` which iterates
- * over `object` properties returned by `keysFunc` invoking `iteratee` for
- * each property. Iteratee functions may exit iteration early by explicitly
- * returning `false`.
- *
- * @private
- * @param {Object} object The object to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @param {Function} keysFunc The function to get the keys of `object`.
- * @returns {Object} Returns `object`.
- */
-var baseFor = createBaseFor();
-
-module.exports = baseFor;
-
-},{"./createBaseFor":31}],17:[function(require,module,exports){
-var baseFor = require('./baseFor'),
- keys = require('../object/keys');
-
-/**
- * The base implementation of `_.forOwn` without support for callback
- * shorthands and `this` binding.
- *
- * @private
- * @param {Object} object The object to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Object} Returns `object`.
- */
-function baseForOwn(object, iteratee) {
- return baseFor(object, iteratee, keys);
-}
-
-module.exports = baseForOwn;
-
-},{"../object/keys":58,"./baseFor":16}],18:[function(require,module,exports){
-var toObject = require('./toObject');
-
-/**
- * The base implementation of `get` without support for string paths
- * and default values.
- *
- * @private
- * @param {Object} object The object to query.
- * @param {Array} path The path of the property to get.
- * @param {string} [pathKey] The key representation of path.
- * @returns {*} Returns the resolved value.
- */
-function baseGet(object, path, pathKey) {
- if (object == null) {
- return;
- }
- if (pathKey !== undefined && pathKey in toObject(object)) {
- path = [pathKey];
- }
- var index = 0,
- length = path.length;
-
- while (object != null && index < length) {
- object = object[path[index++]];
- }
- return (index && index == length) ? object : undefined;
-}
-
-module.exports = baseGet;
-
-},{"./toObject":46}],19:[function(require,module,exports){
-var baseIsEqualDeep = require('./baseIsEqualDeep'),
- isObject = require('../lang/isObject'),
- isObjectLike = require('./isObjectLike');
-
-/**
- * The base implementation of `_.isEqual` without support for `this` binding
- * `customizer` functions.
- *
- * @private
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @param {Function} [customizer] The function to customize comparing values.
- * @param {boolean} [isLoose] Specify performing partial comparisons.
- * @param {Array} [stackA] Tracks traversed `value` objects.
- * @param {Array} [stackB] Tracks traversed `other` objects.
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
- */
-function baseIsEqual(value, other, customizer, isLoose, stackA, stackB) {
- if (value === other) {
- return true;
- }
- if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) {
- return value !== value && other !== other;
- }
- return baseIsEqualDeep(value, other, baseIsEqual, customizer, isLoose, stackA, stackB);
-}
-
-module.exports = baseIsEqual;
-
-},{"../lang/isObject":53,"./baseIsEqualDeep":20,"./isObjectLike":43}],20:[function(require,module,exports){
-var equalArrays = require('./equalArrays'),
- equalByTag = require('./equalByTag'),
- equalObjects = require('./equalObjects'),
- isArray = require('../lang/isArray'),
- isTypedArray = require('../lang/isTypedArray');
-
-/** `Object#toString` result references. */
-var argsTag = '[object Arguments]',
- arrayTag = '[object Array]',
- objectTag = '[object Object]';
-
-/** Used for native method references. */
-var objectProto = Object.prototype;
-
-/** Used to check objects for own properties. */
-var hasOwnProperty = objectProto.hasOwnProperty;
-
-/**
- * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
- * of values.
- */
-var objToString = objectProto.toString;
-
-/**
- * A specialized version of `baseIsEqual` for arrays and objects which performs
- * deep comparisons and tracks traversed objects enabling objects with circular
- * references to be compared.
- *
- * @private
- * @param {Object} object The object to compare.
- * @param {Object} other The other object to compare.
- * @param {Function} equalFunc The function to determine equivalents of values.
- * @param {Function} [customizer] The function to customize comparing objects.
- * @param {boolean} [isLoose] Specify performing partial comparisons.
- * @param {Array} [stackA=[]] Tracks traversed `value` objects.
- * @param {Array} [stackB=[]] Tracks traversed `other` objects.
- * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
- */
-function baseIsEqualDeep(object, other, equalFunc, customizer, isLoose, stackA, stackB) {
- var objIsArr = isArray(object),
- othIsArr = isArray(other),
- objTag = arrayTag,
- othTag = arrayTag;
-
- if (!objIsArr) {
- objTag = objToString.call(object);
- if (objTag == argsTag) {
- objTag = objectTag;
- } else if (objTag != objectTag) {
- objIsArr = isTypedArray(object);
- }
- }
- if (!othIsArr) {
- othTag = objToString.call(other);
- if (othTag == argsTag) {
- othTag = objectTag;
- } else if (othTag != objectTag) {
- othIsArr = isTypedArray(other);
- }
- }
- var objIsObj = objTag == objectTag,
- othIsObj = othTag == objectTag,
- isSameTag = objTag == othTag;
-
- if (isSameTag && !(objIsArr || objIsObj)) {
- return equalByTag(object, other, objTag);
- }
- if (!isLoose) {
- var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
- othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
-
- if (objIsWrapped || othIsWrapped) {
- return equalFunc(objIsWrapped ? object.value() : object, othIsWrapped ? other.value() : other, customizer, isLoose, stackA, stackB);
- }
- }
- if (!isSameTag) {
- return false;
- }
- // Assume cyclic values are equal.
- // For more information on detecting circular references see https://es5.github.io/#JO.
- stackA || (stackA = []);
- stackB || (stackB = []);
-
- var length = stackA.length;
- while (length--) {
- if (stackA[length] == object) {
- return stackB[length] == other;
- }
- }
- // Add `object` and `other` to the stack of traversed objects.
- stackA.push(object);
- stackB.push(other);
-
- var result = (objIsArr ? equalArrays : equalObjects)(object, other, equalFunc, customizer, isLoose, stackA, stackB);
-
- stackA.pop();
- stackB.pop();
-
- return result;
-}
-
-module.exports = baseIsEqualDeep;
-
-},{"../lang/isArray":49,"../lang/isTypedArray":55,"./equalArrays":32,"./equalByTag":33,"./equalObjects":34}],21:[function(require,module,exports){
-var baseIsEqual = require('./baseIsEqual'),
- toObject = require('./toObject');
-
-/**
- * The base implementation of `_.isMatch` without support for callback
- * shorthands and `this` binding.
- *
- * @private
- * @param {Object} object The object to inspect.
- * @param {Array} matchData The propery names, values, and compare flags to match.
- * @param {Function} [customizer] The function to customize comparing objects.
- * @returns {boolean} Returns `true` if `object` is a match, else `false`.
- */
-function baseIsMatch(object, matchData, customizer) {
- var index = matchData.length,
- length = index,
- noCustomizer = !customizer;
-
- if (object == null) {
- return !length;
- }
- object = toObject(object);
- while (index--) {
- var data = matchData[index];
- if ((noCustomizer && data[2])
- ? data[1] !== object[data[0]]
- : !(data[0] in object)
- ) {
- return false;
- }
- }
- while (++index < length) {
- data = matchData[index];
- var key = data[0],
- objValue = object[key],
- srcValue = data[1];
-
- if (noCustomizer && data[2]) {
- if (objValue === undefined && !(key in object)) {
- return false;
- }
- } else {
- var result = customizer ? customizer(objValue, srcValue, key) : undefined;
- if (!(result === undefined ? baseIsEqual(srcValue, objValue, customizer, true) : result)) {
- return false;
- }
- }
- }
- return true;
-}
-
-module.exports = baseIsMatch;
-
-},{"./baseIsEqual":19,"./toObject":46}],22:[function(require,module,exports){
-var baseIsMatch = require('./baseIsMatch'),
- getMatchData = require('./getMatchData'),
- toObject = require('./toObject');
-
-/**
- * The base implementation of `_.matches` which does not clone `source`.
- *
- * @private
- * @param {Object} source The object of property values to match.
- * @returns {Function} Returns the new function.
- */
-function baseMatches(source) {
- var matchData = getMatchData(source);
- if (matchData.length == 1 && matchData[0][2]) {
- var key = matchData[0][0],
- value = matchData[0][1];
-
- return function(object) {
- if (object == null) {
- return false;
- }
- return object[key] === value && (value !== undefined || (key in toObject(object)));
- };
- }
- return function(object) {
- return baseIsMatch(object, matchData);
- };
-}
-
-module.exports = baseMatches;
-
-},{"./baseIsMatch":21,"./getMatchData":36,"./toObject":46}],23:[function(require,module,exports){
-var baseGet = require('./baseGet'),
- baseIsEqual = require('./baseIsEqual'),
- baseSlice = require('./baseSlice'),
- isArray = require('../lang/isArray'),
- isKey = require('./isKey'),
- isStrictComparable = require('./isStrictComparable'),
- last = require('../array/last'),
- toObject = require('./toObject'),
- toPath = require('./toPath');
-
-/**
- * The base implementation of `_.matchesProperty` which does not clone `srcValue`.
- *
- * @private
- * @param {string} path The path of the property to get.
- * @param {*} srcValue The value to compare.
- * @returns {Function} Returns the new function.
- */
-function baseMatchesProperty(path, srcValue) {
- var isArr = isArray(path),
- isCommon = isKey(path) && isStrictComparable(srcValue),
- pathKey = (path + '');
-
- path = toPath(path);
- return function(object) {
- if (object == null) {
- return false;
- }
- var key = pathKey;
- object = toObject(object);
- if ((isArr || !isCommon) && !(key in object)) {
- object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
- if (object == null) {
- return false;
- }
- key = last(path);
- object = toObject(object);
- }
- return object[key] === srcValue
- ? (srcValue !== undefined || (key in object))
- : baseIsEqual(srcValue, object[key], undefined, true);
- };
-}
-
-module.exports = baseMatchesProperty;
-
-},{"../array/last":4,"../lang/isArray":49,"./baseGet":18,"./baseIsEqual":19,"./baseSlice":26,"./isKey":41,"./isStrictComparable":44,"./toObject":46,"./toPath":47}],24:[function(require,module,exports){
-/**
- * The base implementation of `_.property` without support for deep paths.
- *
- * @private
- * @param {string} key The key of the property to get.
- * @returns {Function} Returns the new function.
- */
-function baseProperty(key) {
- return function(object) {
- return object == null ? undefined : object[key];
- };
-}
-
-module.exports = baseProperty;
-
-},{}],25:[function(require,module,exports){
-var baseGet = require('./baseGet'),
- toPath = require('./toPath');
-
-/**
- * A specialized version of `baseProperty` which supports deep paths.
- *
- * @private
- * @param {Array|string} path The path of the property to get.
- * @returns {Function} Returns the new function.
- */
-function basePropertyDeep(path) {
- var pathKey = (path + '');
- path = toPath(path);
- return function(object) {
- return baseGet(object, path, pathKey);
- };
-}
-
-module.exports = basePropertyDeep;
-
-},{"./baseGet":18,"./toPath":47}],26:[function(require,module,exports){
-/**
- * The base implementation of `_.slice` without an iteratee call guard.
- *
- * @private
- * @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 baseSlice(array, start, end) {
- var index = -1,
- length = array.length;
-
- start = start == null ? 0 : (+start || 0);
- if (start < 0) {
- start = -start > length ? 0 : (length + start);
- }
- end = (end === undefined || end > length) ? length : (+end || 0);
- if (end < 0) {
- end += length;
- }
- length = start > end ? 0 : ((end - start) >>> 0);
- start >>>= 0;
-
- var result = Array(length);
- while (++index < length) {
- result[index] = array[index + start];
- }
- return result;
-}
-
-module.exports = baseSlice;
-
-},{}],27:[function(require,module,exports){
-/**
- * Converts `value` to a string if it's not one. An empty string is returned
- * for `null` or `undefined` values.
- *
- * @private
- * @param {*} value The value to process.
- * @returns {string} Returns the string.
- */
-function baseToString(value) {
- return value == null ? '' : (value + '');
-}
-
-module.exports = baseToString;
-
-},{}],28:[function(require,module,exports){
-var identity = require('../utility/identity');
-
-/**
- * A specialized version of `baseCallback` which only supports `this` binding
- * and specifying the number of arguments to provide to `func`.
- *
- * @private
- * @param {Function} func The function to bind.
- * @param {*} thisArg The `this` binding of `func`.
- * @param {number} [argCount] The number of arguments to provide to `func`.
- * @returns {Function} Returns the callback.
- */
-function bindCallback(func, thisArg, argCount) {
- if (typeof func != 'function') {
- return identity;
- }
- if (thisArg === undefined) {
- return func;
- }
- switch (argCount) {
- case 1: return function(value) {
- return func.call(thisArg, value);
- };
- case 3: return function(value, index, collection) {
- return func.call(thisArg, value, index, collection);
- };
- case 4: return function(accumulator, value, index, collection) {
- return func.call(thisArg, accumulator, value, index, collection);
- };
- case 5: return function(value, other, key, object, source) {
- return func.call(thisArg, value, other, key, object, source);
- };
- }
- return function() {
- return func.apply(thisArg, arguments);
- };
-}
-
-module.exports = bindCallback;
-
-},{"../utility/identity":61}],29:[function(require,module,exports){
-var bindCallback = require('./bindCallback'),
- isIterateeCall = require('./isIterateeCall'),
- restParam = require('../function/restParam');
-
-/**
- * Creates a `_.assign`, `_.defaults`, or `_.merge` function.
- *
- * @private
- * @param {Function} assigner The function to assign values.
- * @returns {Function} Returns the new assigner function.
- */
-function createAssigner(assigner) {
- return restParam(function(object, sources) {
- var index = -1,
- length = object == null ? 0 : sources.length,
- customizer = length > 2 ? sources[length - 2] : undefined,
- guard = length > 2 ? sources[2] : undefined,
- thisArg = length > 1 ? sources[length - 1] : undefined;
-
- if (typeof customizer == 'function') {
- customizer = bindCallback(customizer, thisArg, 5);
- length -= 2;
- } else {
- customizer = typeof thisArg == 'function' ? thisArg : undefined;
- length -= (customizer ? 1 : 0);
- }
- if (guard && isIterateeCall(sources[0], sources[1], guard)) {
- customizer = length < 3 ? undefined : customizer;
- length = 1;
- }
- while (++index < length) {
- var source = sources[index];
- if (source) {
- assigner(object, source, customizer);
- }
- }
- return object;
- });
-}
-
-module.exports = createAssigner;
-
-},{"../function/restParam":6,"./bindCallback":28,"./isIterateeCall":40}],30:[function(require,module,exports){
-var getLength = require('./getLength'),
- isLength = require('./isLength'),
- toObject = require('./toObject');
-
-/**
- * Creates a `baseEach` or `baseEachRight` function.
- *
- * @private
- * @param {Function} eachFunc The function to iterate over a collection.
- * @param {boolean} [fromRight] Specify iterating from right to left.
- * @returns {Function} Returns the new base function.
- */
-function createBaseEach(eachFunc, fromRight) {
- return function(collection, iteratee) {
- var length = collection ? getLength(collection) : 0;
- if (!isLength(length)) {
- return eachFunc(collection, iteratee);
- }
- var index = fromRight ? length : -1,
- iterable = toObject(collection);
-
- while ((fromRight ? index-- : ++index < length)) {
- if (iteratee(iterable[index], index, iterable) === false) {
- break;
- }
- }
- return collection;
- };
-}
-
-module.exports = createBaseEach;
-
-},{"./getLength":35,"./isLength":42,"./toObject":46}],31:[function(require,module,exports){
-var toObject = require('./toObject');
-
-/**
- * Creates a base function for `_.forIn` or `_.forInRight`.
- *
- * @private
- * @param {boolean} [fromRight] Specify iterating from right to left.
- * @returns {Function} Returns the new base function.
- */
-function createBaseFor(fromRight) {
- return function(object, iteratee, keysFunc) {
- var iterable = toObject(object),
- props = keysFunc(object),
- length = props.length,
- index = fromRight ? length : -1;
-
- while ((fromRight ? index-- : ++index < length)) {
- var key = props[index];
- if (iteratee(iterable[key], key, iterable) === false) {
- break;
- }
- }
- return object;
- };
-}
-
-module.exports = createBaseFor;
-
-},{"./toObject":46}],32:[function(require,module,exports){
-var arraySome = require('./arraySome');
-
-/**
- * A specialized version of `baseIsEqualDeep` for arrays with support for
- * partial deep comparisons.
- *
- * @private
- * @param {Array} array The array to compare.
- * @param {Array} other The other array to compare.
- * @param {Function} equalFunc The function to determine equivalents of values.
- * @param {Function} [customizer] The function to customize comparing arrays.
- * @param {boolean} [isLoose] Specify performing partial comparisons.
- * @param {Array} [stackA] Tracks traversed `value` objects.
- * @param {Array} [stackB] Tracks traversed `other` objects.
- * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
- */
-function equalArrays(array, other, equalFunc, customizer, isLoose, stackA, stackB) {
- var index = -1,
- arrLength = array.length,
- othLength = other.length;
-
- if (arrLength != othLength && !(isLoose && othLength > arrLength)) {
- return false;
- }
- // Ignore non-index properties.
- while (++index < arrLength) {
- var arrValue = array[index],
- othValue = other[index],
- result = customizer ? customizer(isLoose ? othValue : arrValue, isLoose ? arrValue : othValue, index) : undefined;
-
- if (result !== undefined) {
- if (result) {
- continue;
- }
- return false;
- }
- // Recursively compare arrays (susceptible to call stack limits).
- if (isLoose) {
- if (!arraySome(other, function(othValue) {
- return arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB);
- })) {
- return false;
- }
- } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB))) {
- return false;
- }
- }
- return true;
-}
-
-module.exports = equalArrays;
-
-},{"./arraySome":8}],33:[function(require,module,exports){
-/** `Object#toString` result references. */
-var boolTag = '[object Boolean]',
- dateTag = '[object Date]',
- errorTag = '[object Error]',
- numberTag = '[object Number]',
- regexpTag = '[object RegExp]',
- stringTag = '[object String]';
-
-/**
- * A specialized version of `baseIsEqualDeep` for comparing objects of
- * the same `toStringTag`.
- *
- * **Note:** This function only supports comparing values with tags of
- * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
- *
- * @private
- * @param {Object} object The object to compare.
- * @param {Object} other The other object to compare.
- * @param {string} tag The `toStringTag` of the objects to compare.
- * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
- */
-function equalByTag(object, other, tag) {
- switch (tag) {
- case boolTag:
- case dateTag:
- // Coerce dates and booleans to numbers, dates to milliseconds and booleans
- // to `1` or `0` treating invalid dates coerced to `NaN` as not equal.
- return +object == +other;
-
- case errorTag:
- return object.name == other.name && object.message == other.message;
-
- case numberTag:
- // Treat `NaN` vs. `NaN` as equal.
- return (object != +object)
- ? other != +other
- : object == +other;
-
- case regexpTag:
- case stringTag:
- // Coerce regexes to strings and treat strings primitives and string
- // objects as equal. See https://es5.github.io/#x15.10.6.4 for more details.
- return object == (other + '');
- }
- return false;
-}
-
-module.exports = equalByTag;
-
-},{}],34:[function(require,module,exports){
-var keys = require('../object/keys');
-
-/** Used for native method references. */
-var objectProto = Object.prototype;
-
-/** Used to check objects for own properties. */
-var hasOwnProperty = objectProto.hasOwnProperty;
-
-/**
- * A specialized version of `baseIsEqualDeep` for objects with support for
- * partial deep comparisons.
- *
- * @private
- * @param {Object} object The object to compare.
- * @param {Object} other The other object to compare.
- * @param {Function} equalFunc The function to determine equivalents of values.
- * @param {Function} [customizer] The function to customize comparing values.
- * @param {boolean} [isLoose] Specify performing partial comparisons.
- * @param {Array} [stackA] Tracks traversed `value` objects.
- * @param {Array} [stackB] Tracks traversed `other` objects.
- * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
- */
-function equalObjects(object, other, equalFunc, customizer, isLoose, stackA, stackB) {
- var objProps = keys(object),
- objLength = objProps.length,
- othProps = keys(other),
- othLength = othProps.length;
-
- if (objLength != othLength && !isLoose) {
- return false;
- }
- var index = objLength;
- while (index--) {
- var key = objProps[index];
- if (!(isLoose ? key in other : hasOwnProperty.call(other, key))) {
- return false;
- }
- }
- var skipCtor = isLoose;
- while (++index < objLength) {
- key = objProps[index];
- var objValue = object[key],
- othValue = other[key],
- result = customizer ? customizer(isLoose ? othValue : objValue, isLoose? objValue : othValue, key) : undefined;
-
- // Recursively compare objects (susceptible to call stack limits).
- if (!(result === undefined ? equalFunc(objValue, othValue, customizer, isLoose, stackA, stackB) : result)) {
- return false;
- }
- skipCtor || (skipCtor = key == 'constructor');
- }
- if (!skipCtor) {
- var objCtor = object.constructor,
- othCtor = other.constructor;
-
- // Non `Object` object instances with different constructors are not equal.
- if (objCtor != othCtor &&
- ('constructor' in object && 'constructor' in other) &&
- !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
- typeof othCtor == 'function' && othCtor instanceof othCtor)) {
- return false;
- }
- }
- return true;
-}
-
-module.exports = equalObjects;
-
-},{"../object/keys":58}],35:[function(require,module,exports){
-var baseProperty = require('./baseProperty');
-
-/**
- * Gets the "length" property value of `object`.
- *
- * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)
- * that affects Safari on at least iOS 8.1-8.3 ARM64.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {*} Returns the "length" value.
- */
-var getLength = baseProperty('length');
-
-module.exports = getLength;
-
-},{"./baseProperty":24}],36:[function(require,module,exports){
-var isStrictComparable = require('./isStrictComparable'),
- pairs = require('../object/pairs');
-
-/**
- * Gets the propery names, values, and compare flags of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {Array} Returns the match data of `object`.
- */
-function getMatchData(object) {
- var result = pairs(object),
- length = result.length;
-
- while (length--) {
- result[length][2] = isStrictComparable(result[length][1]);
- }
- return result;
-}
-
-module.exports = getMatchData;
-
-},{"../object/pairs":60,"./isStrictComparable":44}],37:[function(require,module,exports){
-var isNative = require('../lang/isNative');
-
-/**
- * Gets the native function at `key` of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @param {string} key The key of the method to get.
- * @returns {*} Returns the function if it's native, else `undefined`.
- */
-function getNative(object, key) {
- var value = object == null ? undefined : object[key];
- return isNative(value) ? value : undefined;
-}
-
-module.exports = getNative;
-
-},{"../lang/isNative":52}],38:[function(require,module,exports){
-var getLength = require('./getLength'),
- isLength = require('./isLength');
-
-/**
- * Checks if `value` is array-like.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
- */
-function isArrayLike(value) {
- return value != null && isLength(getLength(value));
-}
-
-module.exports = isArrayLike;
-
-},{"./getLength":35,"./isLength":42}],39:[function(require,module,exports){
-/** Used to detect unsigned integer values. */
-var reIsUint = /^\d+$/;
-
-/**
- * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)
- * of an array-like value.
- */
-var MAX_SAFE_INTEGER = 9007199254740991;
-
-/**
- * Checks if `value` is a valid array-like index.
- *
- * @private
- * @param {*} value The value to check.
- * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
- * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
- */
-function isIndex(value, length) {
- value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;
- length = length == null ? MAX_SAFE_INTEGER : length;
- return value > -1 && value % 1 == 0 && value < length;
-}
-
-module.exports = isIndex;
-
-},{}],40:[function(require,module,exports){
-var isArrayLike = require('./isArrayLike'),
- isIndex = require('./isIndex'),
- isObject = require('../lang/isObject');
-
-/**
- * Checks if the provided arguments are from an iteratee call.
- *
- * @private
- * @param {*} value The potential iteratee value argument.
- * @param {*} index The potential iteratee index or key argument.
- * @param {*} object The potential iteratee object argument.
- * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`.
- */
-function isIterateeCall(value, index, object) {
- if (!isObject(object)) {
- return false;
- }
- var type = typeof index;
- if (type == 'number'
- ? (isArrayLike(object) && isIndex(index, object.length))
- : (type == 'string' && index in object)) {
- var other = object[index];
- return value === value ? (value === other) : (other !== other);
- }
- return false;
-}
-
-module.exports = isIterateeCall;
-
-},{"../lang/isObject":53,"./isArrayLike":38,"./isIndex":39}],41:[function(require,module,exports){
-var isArray = require('../lang/isArray'),
- toObject = require('./toObject');
-
-/** Used to match property names within property paths. */
-var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,
- reIsPlainProp = /^\w*$/;
-
-/**
- * Checks if `value` is a property name and not a property path.
- *
- * @private
- * @param {*} value The value to check.
- * @param {Object} [object] The object to query keys on.
- * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
- */
-function isKey(value, object) {
- var type = typeof value;
- if ((type == 'string' && reIsPlainProp.test(value)) || type == 'number') {
- return true;
- }
- if (isArray(value)) {
- return false;
- }
- var result = !reIsDeepProp.test(value);
- return result || (object != null && value in toObject(object));
-}
-
-module.exports = isKey;
-
-},{"../lang/isArray":49,"./toObject":46}],42:[function(require,module,exports){
-/**
- * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)
- * of an array-like value.
- */
-var MAX_SAFE_INTEGER = 9007199254740991;
-
-/**
- * Checks if `value` is a valid array-like length.
- *
- * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
- */
-function isLength(value) {
- return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
-}
-
-module.exports = isLength;
-
-},{}],43:[function(require,module,exports){
-/**
- * Checks if `value` is object-like.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
- */
-function isObjectLike(value) {
- return !!value && typeof value == 'object';
-}
-
-module.exports = isObjectLike;
-
-},{}],44:[function(require,module,exports){
-var isObject = require('../lang/isObject');
-
-/**
- * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` if suitable for strict
- * equality comparisons, else `false`.
- */
-function isStrictComparable(value) {
- return value === value && !isObject(value);
-}
-
-module.exports = isStrictComparable;
-
-},{"../lang/isObject":53}],45:[function(require,module,exports){
-var isArguments = require('../lang/isArguments'),
- isArray = require('../lang/isArray'),
- isIndex = require('./isIndex'),
- isLength = require('./isLength'),
- keysIn = require('../object/keysIn');
-
-/** Used for native method references. */
-var objectProto = Object.prototype;
-
-/** Used to check objects for own properties. */
-var hasOwnProperty = objectProto.hasOwnProperty;
-
-/**
- * A fallback implementation of `Object.keys` which creates an array of the
- * own enumerable property names of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property names.
- */
-function shimKeys(object) {
- var props = keysIn(object),
- propsLength = props.length,
- length = propsLength && object.length;
-
- var allowIndexes = !!length && isLength(length) &&
- (isArray(object) || isArguments(object));
-
- var index = -1,
- result = [];
-
- while (++index < propsLength) {
- var key = props[index];
- if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) {
- result.push(key);
- }
- }
- return result;
-}
-
-module.exports = shimKeys;
-
-},{"../lang/isArguments":48,"../lang/isArray":49,"../object/keysIn":59,"./isIndex":39,"./isLength":42}],46:[function(require,module,exports){
-var isObject = require('../lang/isObject');
-
-/**
- * Converts `value` to an object if it's not one.
- *
- * @private
- * @param {*} value The value to process.
- * @returns {Object} Returns the object.
- */
-function toObject(value) {
- return isObject(value) ? value : Object(value);
-}
-
-module.exports = toObject;
-
-},{"../lang/isObject":53}],47:[function(require,module,exports){
-var baseToString = require('./baseToString'),
- isArray = require('../lang/isArray');
-
-/** Used to match property names within property paths. */
-var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g;
-
-/** Used to match backslashes in property paths. */
-var reEscapeChar = /\\(\\)?/g;
-
-/**
- * Converts `value` to property path array if it's not one.
- *
- * @private
- * @param {*} value The value to process.
- * @returns {Array} Returns the property path array.
- */
-function toPath(value) {
- if (isArray(value)) {
- return value;
- }
- var result = [];
- baseToString(value).replace(rePropName, function(match, number, quote, string) {
- result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
- });
- return result;
-}
-
-module.exports = toPath;
-
-},{"../lang/isArray":49,"./baseToString":27}],48:[function(require,module,exports){
-var isArrayLike = require('../internal/isArrayLike'),
- isObjectLike = require('../internal/isObjectLike');
-
-/** Used for native method references. */
-var objectProto = Object.prototype;
-
-/** Used to check objects for own properties. */
-var hasOwnProperty = objectProto.hasOwnProperty;
-
-/** Native method references. */
-var propertyIsEnumerable = objectProto.propertyIsEnumerable;
-
-/**
- * Checks if `value` is classified as an `arguments` object.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
- * @example
- *
- * _.isArguments(function() { return arguments; }());
- * // => true
- *
- * _.isArguments([1, 2, 3]);
- * // => false
- */
-function isArguments(value) {
- return isObjectLike(value) && isArrayLike(value) &&
- hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee');
-}
-
-module.exports = isArguments;
-
-},{"../internal/isArrayLike":38,"../internal/isObjectLike":43}],49:[function(require,module,exports){
-var getNative = require('../internal/getNative'),
- isLength = require('../internal/isLength'),
- isObjectLike = require('../internal/isObjectLike');
-
-/** `Object#toString` result references. */
-var arrayTag = '[object Array]';
-
-/** Used for native method references. */
-var objectProto = Object.prototype;
-
-/**
- * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
- * of values.
- */
-var objToString = objectProto.toString;
-
-/* Native method references for those with the same name as other `lodash` methods. */
-var nativeIsArray = getNative(Array, 'isArray');
-
-/**
- * Checks if `value` is classified as an `Array` object.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
- * @example
- *
- * _.isArray([1, 2, 3]);
- * // => true
- *
- * _.isArray(function() { return arguments; }());
- * // => false
- */
-var isArray = nativeIsArray || function(value) {
- return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag;
-};
-
-module.exports = isArray;
-
-},{"../internal/getNative":37,"../internal/isLength":42,"../internal/isObjectLike":43}],50:[function(require,module,exports){
-var isArguments = require('./isArguments'),
- isArray = require('./isArray'),
- isArrayLike = require('../internal/isArrayLike'),
- isFunction = require('./isFunction'),
- isObjectLike = require('../internal/isObjectLike'),
- isString = require('./isString'),
- keys = require('../object/keys');
-
-/**
- * Checks if `value` is empty. A value is considered empty unless it's an
- * `arguments` object, array, string, or jQuery-like collection with a length
- * greater than `0` or an object with own enumerable properties.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {Array|Object|string} value The value to inspect.
- * @returns {boolean} Returns `true` if `value` is empty, else `false`.
- * @example
- *
- * _.isEmpty(null);
- * // => true
- *
- * _.isEmpty(true);
- * // => true
- *
- * _.isEmpty(1);
- * // => true
- *
- * _.isEmpty([1, 2, 3]);
- * // => false
- *
- * _.isEmpty({ 'a': 1 });
- * // => false
- */
-function isEmpty(value) {
- if (value == null) {
- return true;
- }
- if (isArrayLike(value) && (isArray(value) || isString(value) || isArguments(value) ||
- (isObjectLike(value) && isFunction(value.splice)))) {
- return !value.length;
- }
- return !keys(value).length;
-}
-
-module.exports = isEmpty;
-
-},{"../internal/isArrayLike":38,"../internal/isObjectLike":43,"../object/keys":58,"./isArguments":48,"./isArray":49,"./isFunction":51,"./isString":54}],51:[function(require,module,exports){
-var isObject = require('./isObject');
-
-/** `Object#toString` result references. */
-var funcTag = '[object Function]';
-
-/** Used for native method references. */
-var objectProto = Object.prototype;
-
-/**
- * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
- * of values.
- */
-var objToString = objectProto.toString;
-
-/**
- * Checks if `value` is classified as a `Function` object.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
- * @example
- *
- * _.isFunction(_);
- * // => true
- *
- * _.isFunction(/abc/);
- * // => false
- */
-function isFunction(value) {
- // The use of `Object#toString` avoids issues with the `typeof` operator
- // in older versions of Chrome and Safari which return 'function' for regexes
- // and Safari 8 which returns 'object' for typed array constructors.
- return isObject(value) && objToString.call(value) == funcTag;
-}
-
-module.exports = isFunction;
-
-},{"./isObject":53}],52:[function(require,module,exports){
-var isFunction = require('./isFunction'),
- isObjectLike = require('../internal/isObjectLike');
-
-/** Used to detect host constructors (Safari > 5). */
-var reIsHostCtor = /^\[object .+?Constructor\]$/;
-
-/** Used for native method references. */
-var objectProto = Object.prototype;
-
-/** Used to resolve the decompiled source of functions. */
-var fnToString = Function.prototype.toString;
-
-/** Used to check objects for own properties. */
-var hasOwnProperty = objectProto.hasOwnProperty;
-
-/** Used to detect if a method is native. */
-var reIsNative = RegExp('^' +
- fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&')
- .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
-);
-
-/**
- * Checks if `value` is a native function.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a native function, else `false`.
- * @example
- *
- * _.isNative(Array.prototype.push);
- * // => true
- *
- * _.isNative(_);
- * // => false
- */
-function isNative(value) {
- if (value == null) {
- return false;
- }
- if (isFunction(value)) {
- return reIsNative.test(fnToString.call(value));
- }
- return isObjectLike(value) && reIsHostCtor.test(value);
-}
-
-module.exports = isNative;
-
-},{"../internal/isObjectLike":43,"./isFunction":51}],53:[function(require,module,exports){
-/**
- * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
- * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
- * @example
- *
- * _.isObject({});
- * // => true
- *
- * _.isObject([1, 2, 3]);
- * // => true
- *
- * _.isObject(1);
- * // => false
- */
-function isObject(value) {
- // Avoid a V8 JIT bug in Chrome 19-20.
- // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
- var type = typeof value;
- return !!value && (type == 'object' || type == 'function');
-}
-
-module.exports = isObject;
-
-},{}],54:[function(require,module,exports){
-var isObjectLike = require('../internal/isObjectLike');
-
-/** `Object#toString` result references. */
-var stringTag = '[object String]';
-
-/** Used for native method references. */
-var objectProto = Object.prototype;
-
-/**
- * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
- * of values.
- */
-var objToString = objectProto.toString;
-
-/**
- * Checks if `value` is classified as a `String` primitive or object.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
- * @example
- *
- * _.isString('abc');
- * // => true
- *
- * _.isString(1);
- * // => false
- */
-function isString(value) {
- return typeof value == 'string' || (isObjectLike(value) && objToString.call(value) == stringTag);
-}
-
-module.exports = isString;
-
-},{"../internal/isObjectLike":43}],55:[function(require,module,exports){
-var isLength = require('../internal/isLength'),
- isObjectLike = require('../internal/isObjectLike');
-
-/** `Object#toString` result references. */
-var argsTag = '[object Arguments]',
- arrayTag = '[object Array]',
- boolTag = '[object Boolean]',
- dateTag = '[object Date]',
- errorTag = '[object Error]',
- funcTag = '[object Function]',
- mapTag = '[object Map]',
- numberTag = '[object Number]',
- objectTag = '[object Object]',
- regexpTag = '[object RegExp]',
- setTag = '[object Set]',
- stringTag = '[object String]',
- weakMapTag = '[object WeakMap]';
-
-var arrayBufferTag = '[object ArrayBuffer]',
- float32Tag = '[object Float32Array]',
- float64Tag = '[object Float64Array]',
- int8Tag = '[object Int8Array]',
- int16Tag = '[object Int16Array]',
- int32Tag = '[object Int32Array]',
- uint8Tag = '[object Uint8Array]',
- uint8ClampedTag = '[object Uint8ClampedArray]',
- uint16Tag = '[object Uint16Array]',
- uint32Tag = '[object Uint32Array]';
-
-/** Used to identify `toStringTag` values of typed arrays. */
-var typedArrayTags = {};
-typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
-typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
-typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
-typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
-typedArrayTags[uint32Tag] = true;
-typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
-typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
-typedArrayTags[dateTag] = typedArrayTags[errorTag] =
-typedArrayTags[funcTag] = typedArrayTags[mapTag] =
-typedArrayTags[numberTag] = typedArrayTags[objectTag] =
-typedArrayTags[regexpTag] = typedArrayTags[setTag] =
-typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
-
-/** Used for native method references. */
-var objectProto = Object.prototype;
-
-/**
- * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
- * of values.
- */
-var objToString = objectProto.toString;
-
-/**
- * Checks if `value` is classified as a typed array.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
- * @example
- *
- * _.isTypedArray(new Uint8Array);
- * // => true
- *
- * _.isTypedArray([]);
- * // => false
- */
-function isTypedArray(value) {
- return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objToString.call(value)];
-}
-
-module.exports = isTypedArray;
-
-},{"../internal/isLength":42,"../internal/isObjectLike":43}],56:[function(require,module,exports){
-var assignWith = require('../internal/assignWith'),
- baseAssign = require('../internal/baseAssign'),
- createAssigner = require('../internal/createAssigner');
-
-/**
- * Assigns own enumerable properties of source object(s) to the destination
- * object. Subsequent sources overwrite property assignments of previous sources.
- * If `customizer` is provided it's invoked to produce the assigned values.
- * The `customizer` is bound to `thisArg` and invoked with five arguments:
- * (objectValue, sourceValue, key, object, source).
- *
- * **Note:** This method mutates `object` and is based on
- * [`Object.assign`](http://ecma-international.org/ecma-262/6.0/#sec-object.assign).
- *
- * @static
- * @memberOf _
- * @alias extend
- * @category Object
- * @param {Object} object The destination object.
- * @param {...Object} [sources] The source objects.
- * @param {Function} [customizer] The function to customize assigned values.
- * @param {*} [thisArg] The `this` binding of `customizer`.
- * @returns {Object} Returns `object`.
- * @example
- *
- * _.assign({ 'user': 'barney' }, { 'age': 40 }, { 'user': 'fred' });
- * // => { 'user': 'fred', 'age': 40 }
- *
- * // using a customizer callback
- * var defaults = _.partialRight(_.assign, function(value, other) {
- * return _.isUndefined(value) ? other : value;
- * });
- *
- * defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' });
- * // => { 'user': 'barney', 'age': 36 }
- */
-var assign = createAssigner(function(object, source, customizer) {
- return customizer
- ? assignWith(object, source, customizer)
- : baseAssign(object, source);
-});
-
-module.exports = assign;
-
-},{"../internal/assignWith":9,"../internal/baseAssign":10,"../internal/createAssigner":29}],57:[function(require,module,exports){
-var baseAssign = require('../internal/baseAssign'),
- baseCreate = require('../internal/baseCreate'),
- isIterateeCall = require('../internal/isIterateeCall');
-
-/**
- * Creates an object that inherits from the given `prototype` object. If a
- * `properties` object is provided its own enumerable properties are assigned
- * to the created object.
- *
- * @static
- * @memberOf _
- * @category Object
- * @param {Object} prototype The object to inherit from.
- * @param {Object} [properties] The properties to assign to the object.
- * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
- * @returns {Object} Returns the new object.
- * @example
- *
- * function Shape() {
- * this.x = 0;
- * this.y = 0;
- * }
- *
- * function Circle() {
- * Shape.call(this);
- * }
- *
- * Circle.prototype = _.create(Shape.prototype, {
- * 'constructor': Circle
- * });
- *
- * var circle = new Circle;
- * circle instanceof Circle;
- * // => true
- *
- * circle instanceof Shape;
- * // => true
- */
-function create(prototype, properties, guard) {
- var result = baseCreate(prototype);
- if (guard && isIterateeCall(prototype, properties, guard)) {
- properties = undefined;
- }
- return properties ? baseAssign(result, properties) : result;
-}
-
-module.exports = create;
-
-},{"../internal/baseAssign":10,"../internal/baseCreate":13,"../internal/isIterateeCall":40}],58:[function(require,module,exports){
-var getNative = require('../internal/getNative'),
- isArrayLike = require('../internal/isArrayLike'),
- isObject = require('../lang/isObject'),
- shimKeys = require('../internal/shimKeys');
-
-/* Native method references for those with the same name as other `lodash` methods. */
-var nativeKeys = getNative(Object, 'keys');
-
-/**
- * Creates an array of the own enumerable property names of `object`.
- *
- * **Note:** Non-object values are coerced to objects. See the
- * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys)
- * for more details.
- *
- * @static
- * @memberOf _
- * @category Object
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property names.
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.keys(new Foo);
- * // => ['a', 'b'] (iteration order is not guaranteed)
- *
- * _.keys('hi');
- * // => ['0', '1']
- */
-var keys = !nativeKeys ? shimKeys : function(object) {
- var Ctor = object == null ? undefined : object.constructor;
- if ((typeof Ctor == 'function' && Ctor.prototype === object) ||
- (typeof object != 'function' && isArrayLike(object))) {
- return shimKeys(object);
- }
- return isObject(object) ? nativeKeys(object) : [];
-};
-
-module.exports = keys;
-
-},{"../internal/getNative":37,"../internal/isArrayLike":38,"../internal/shimKeys":45,"../lang/isObject":53}],59:[function(require,module,exports){
-var isArguments = require('../lang/isArguments'),
- isArray = require('../lang/isArray'),
- isIndex = require('../internal/isIndex'),
- isLength = require('../internal/isLength'),
- isObject = require('../lang/isObject');
-
-/** Used for native method references. */
-var objectProto = Object.prototype;
-
-/** Used to check objects for own properties. */
-var hasOwnProperty = objectProto.hasOwnProperty;
-
-/**
- * Creates an array of the own and inherited enumerable property names of `object`.
- *
- * **Note:** Non-object values are coerced to objects.
- *
- * @static
- * @memberOf _
- * @category Object
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property names.
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.keysIn(new Foo);
- * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
- */
-function keysIn(object) {
- if (object == null) {
- return [];
- }
- if (!isObject(object)) {
- object = Object(object);
- }
- var length = object.length;
- length = (length && isLength(length) &&
- (isArray(object) || isArguments(object)) && length) || 0;
-
- var Ctor = object.constructor,
- index = -1,
- isProto = typeof Ctor == 'function' && Ctor.prototype === object,
- result = Array(length),
- skipIndexes = length > 0;
-
- while (++index < length) {
- result[index] = (index + '');
- }
- for (var key in object) {
- if (!(skipIndexes && isIndex(key, length)) &&
- !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
- result.push(key);
- }
- }
- return result;
-}
-
-module.exports = keysIn;
-
-},{"../internal/isIndex":39,"../internal/isLength":42,"../lang/isArguments":48,"../lang/isArray":49,"../lang/isObject":53}],60:[function(require,module,exports){
-var keys = require('./keys'),
- toObject = require('../internal/toObject');
-
-/**
- * Creates a two dimensional array of the key-value pairs for `object`,
- * e.g. `[[key1, value1], [key2, value2]]`.
- *
- * @static
- * @memberOf _
- * @category Object
- * @param {Object} object The object to query.
- * @returns {Array} Returns the new array of key-value pairs.
- * @example
- *
- * _.pairs({ 'barney': 36, 'fred': 40 });
- * // => [['barney', 36], ['fred', 40]] (iteration order is not guaranteed)
- */
-function pairs(object) {
- object = toObject(object);
-
- var index = -1,
- props = keys(object),
- length = props.length,
- result = Array(length);
-
- while (++index < length) {
- var key = props[index];
- result[index] = [key, object[key]];
- }
- return result;
-}
-
-module.exports = pairs;
-
-},{"../internal/toObject":46,"./keys":58}],61:[function(require,module,exports){
-/**
- * This method returns the first argument provided to it.
- *
- * @static
- * @memberOf _
- * @category Utility
- * @param {*} value Any value.
- * @returns {*} Returns `value`.
- * @example
- *
- * var object = { 'user': 'fred' };
- *
- * _.identity(object) === object;
- * // => true
- */
-function identity(value) {
- return value;
-}
-
-module.exports = identity;
-
-},{}],62:[function(require,module,exports){
-var baseProperty = require('../internal/baseProperty'),
- basePropertyDeep = require('../internal/basePropertyDeep'),
- isKey = require('../internal/isKey');
-
-/**
- * Creates a function that returns the property value at `path` on a
- * given object.
- *
- * @static
- * @memberOf _
- * @category Utility
- * @param {Array|string} path The path of the property to get.
- * @returns {Function} Returns the new function.
- * @example
- *
- * var objects = [
- * { 'a': { 'b': { 'c': 2 } } },
- * { 'a': { 'b': { 'c': 1 } } }
- * ];
- *
- * _.map(objects, _.property('a.b.c'));
- * // => [2, 1]
- *
- * _.pluck(_.sortBy(objects, _.property(['a', 'b', 'c'])), 'a.b.c');
- * // => [1, 2]
- */
-function property(path) {
- return isKey(path) ? baseProperty(path) : basePropertyDeep(path);
-}
-
-module.exports = property;
-
-},{"../internal/baseProperty":24,"../internal/basePropertyDeep":25,"../internal/isKey":41}],63:[function(require,module,exports){
-// Generated by CoffeeScript 1.9.1
-(function() {
- var XMLAttribute, create;
-
- create = require('lodash/object/create');
-
- module.exports = XMLAttribute = (function() {
- function XMLAttribute(parent, name, value) {
- this.stringify = parent.stringify;
- if (name == null) {
- throw new Error("Missing attribute name of element " + parent.name);
- }
- if (value == null) {
- throw new Error("Missing attribute value for attribute " + name + " of element " + parent.name);
- }
- this.name = this.stringify.attName(name);
- this.value = this.stringify.attValue(value);
- }
-
- XMLAttribute.prototype.clone = function() {
- return create(XMLAttribute.prototype, this);
- };
-
- XMLAttribute.prototype.toString = function(options, level) {
- return ' ' + this.name + '="' + this.value + '"';
- };
-
- return XMLAttribute;
-
- })();
-
-}).call(this);
-
-},{"lodash/object/create":57}],64:[function(require,module,exports){
-// Generated by CoffeeScript 1.9.1
-(function() {
- var XMLBuilder, XMLDeclaration, XMLDocType, XMLElement, XMLStringifier;
-
- XMLStringifier = require('./XMLStringifier');
-
- XMLDeclaration = require('./XMLDeclaration');
-
- XMLDocType = require('./XMLDocType');
-
- XMLElement = require('./XMLElement');
-
- module.exports = XMLBuilder = (function() {
- function XMLBuilder(name, options) {
- var root, temp;
- if (name == null) {
- throw new Error("Root element needs a name");
- }
- if (options == null) {
- options = {};
- }
- this.options = options;
- this.stringify = new XMLStringifier(options);
- temp = new XMLElement(this, 'doc');
- root = temp.element(name);
- root.isRoot = true;
- root.documentObject = this;
- this.rootObject = root;
- if (!options.headless) {
- root.declaration(options);
- if ((options.pubID != null) || (options.sysID != null)) {
- root.doctype(options);
- }
- }
- }
-
- XMLBuilder.prototype.root = function() {
- return this.rootObject;
- };
-
- XMLBuilder.prototype.end = function(options) {
- return this.toString(options);
- };
-
- XMLBuilder.prototype.toString = function(options) {
- var indent, newline, offset, pretty, r, ref, ref1, ref2;
- pretty = (options != null ? options.pretty : void 0) || false;
- indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' ';
- offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0;
- newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n';
- r = '';
- if (this.xmldec != null) {
- r += this.xmldec.toString(options);
- }
- if (this.doctype != null) {
- r += this.doctype.toString(options);
- }
- r += this.rootObject.toString(options);
- if (pretty && r.slice(-newline.length) === newline) {
- r = r.slice(0, -newline.length);
- }
- return r;
- };
-
- return XMLBuilder;
-
- })();
-
-}).call(this);
-
-},{"./XMLDeclaration":71,"./XMLDocType":72,"./XMLElement":73,"./XMLStringifier":77}],65:[function(require,module,exports){
-// Generated by CoffeeScript 1.9.1
-(function() {
- var XMLCData, XMLNode, create,
- extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
- hasProp = {}.hasOwnProperty;
-
- create = require('lodash/object/create');
-
- XMLNode = require('./XMLNode');
-
- module.exports = XMLCData = (function(superClass) {
- extend(XMLCData, superClass);
-
- function XMLCData(parent, text) {
- XMLCData.__super__.constructor.call(this, parent);
- if (text == null) {
- throw new Error("Missing CDATA text");
- }
- this.text = this.stringify.cdata(text);
- }
-
- XMLCData.prototype.clone = function() {
- return create(XMLCData.prototype, this);
- };
-
- XMLCData.prototype.toString = function(options, level) {
- var indent, newline, offset, pretty, r, ref, ref1, ref2, space;
- pretty = (options != null ? options.pretty : void 0) || false;
- indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' ';
- offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0;
- newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n';
- level || (level = 0);
- space = new Array(level + offset + 1).join(indent);
- r = '';
- if (pretty) {
- r += space;
- }
- r += '';
- if (pretty) {
- r += newline;
- }
- return r;
- };
-
- return XMLCData;
-
- })(XMLNode);
-
-}).call(this);
-
-},{"./XMLNode":74,"lodash/object/create":57}],66:[function(require,module,exports){
-// Generated by CoffeeScript 1.9.1
-(function() {
- var XMLComment, XMLNode, create,
- extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
- hasProp = {}.hasOwnProperty;
-
- create = require('lodash/object/create');
-
- XMLNode = require('./XMLNode');
-
- module.exports = XMLComment = (function(superClass) {
- extend(XMLComment, superClass);
-
- function XMLComment(parent, text) {
- XMLComment.__super__.constructor.call(this, parent);
- if (text == null) {
- throw new Error("Missing comment text");
- }
- this.text = this.stringify.comment(text);
- }
-
- XMLComment.prototype.clone = function() {
- return create(XMLComment.prototype, this);
- };
-
- XMLComment.prototype.toString = function(options, level) {
- var indent, newline, offset, pretty, r, ref, ref1, ref2, space;
- pretty = (options != null ? options.pretty : void 0) || false;
- indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' ';
- offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0;
- newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n';
- level || (level = 0);
- space = new Array(level + offset + 1).join(indent);
- r = '';
- if (pretty) {
- r += space;
- }
- r += '';
- if (pretty) {
- r += newline;
- }
- return r;
- };
-
- return XMLComment;
-
- })(XMLNode);
-
-}).call(this);
-
-},{"./XMLNode":74,"lodash/object/create":57}],67:[function(require,module,exports){
-// Generated by CoffeeScript 1.9.1
-(function() {
- var XMLDTDAttList, create;
-
- create = require('lodash/object/create');
-
- module.exports = XMLDTDAttList = (function() {
- function XMLDTDAttList(parent, elementName, attributeName, attributeType, defaultValueType, defaultValue) {
- this.stringify = parent.stringify;
- if (elementName == null) {
- throw new Error("Missing DTD element name");
- }
- if (attributeName == null) {
- throw new Error("Missing DTD attribute name");
- }
- if (!attributeType) {
- throw new Error("Missing DTD attribute type");
- }
- if (!defaultValueType) {
- throw new Error("Missing DTD attribute default");
- }
- if (defaultValueType.indexOf('#') !== 0) {
- defaultValueType = '#' + defaultValueType;
- }
- if (!defaultValueType.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/)) {
- throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT");
- }
- if (defaultValue && !defaultValueType.match(/^(#FIXED|#DEFAULT)$/)) {
- throw new Error("Default value only applies to #FIXED or #DEFAULT");
- }
- this.elementName = this.stringify.eleName(elementName);
- this.attributeName = this.stringify.attName(attributeName);
- this.attributeType = this.stringify.dtdAttType(attributeType);
- this.defaultValue = this.stringify.dtdAttDefault(defaultValue);
- this.defaultValueType = defaultValueType;
- }
-
- XMLDTDAttList.prototype.toString = function(options, level) {
- var indent, newline, offset, pretty, r, ref, ref1, ref2, space;
- pretty = (options != null ? options.pretty : void 0) || false;
- indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' ';
- offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0;
- newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n';
- level || (level = 0);
- space = new Array(level + offset + 1).join(indent);
- r = '';
- if (pretty) {
- r += space;
- }
- r += '';
- if (pretty) {
- r += newline;
- }
- return r;
- };
-
- return XMLDTDAttList;
-
- })();
-
-}).call(this);
-
-},{"lodash/object/create":57}],68:[function(require,module,exports){
-// Generated by CoffeeScript 1.9.1
-(function() {
- var XMLDTDElement, create;
-
- create = require('lodash/object/create');
-
- module.exports = XMLDTDElement = (function() {
- function XMLDTDElement(parent, name, value) {
- this.stringify = parent.stringify;
- if (name == null) {
- throw new Error("Missing DTD element name");
- }
- if (!value) {
- value = '(#PCDATA)';
- }
- if (Array.isArray(value)) {
- value = '(' + value.join(',') + ')';
- }
- this.name = this.stringify.eleName(name);
- this.value = this.stringify.dtdElementValue(value);
- }
-
- XMLDTDElement.prototype.toString = function(options, level) {
- var indent, newline, offset, pretty, r, ref, ref1, ref2, space;
- pretty = (options != null ? options.pretty : void 0) || false;
- indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' ';
- offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0;
- newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n';
- level || (level = 0);
- space = new Array(level + offset + 1).join(indent);
- r = '';
- if (pretty) {
- r += space;
- }
- r += '';
- if (pretty) {
- r += newline;
- }
- return r;
- };
-
- return XMLDTDElement;
-
- })();
-
-}).call(this);
-
-},{"lodash/object/create":57}],69:[function(require,module,exports){
-// Generated by CoffeeScript 1.9.1
-(function() {
- var XMLDTDEntity, create, isObject;
-
- create = require('lodash/object/create');
-
- isObject = require('lodash/lang/isObject');
-
- module.exports = XMLDTDEntity = (function() {
- function XMLDTDEntity(parent, pe, name, value) {
- this.stringify = parent.stringify;
- if (name == null) {
- throw new Error("Missing entity name");
- }
- if (value == null) {
- throw new Error("Missing entity value");
- }
- this.pe = !!pe;
- this.name = this.stringify.eleName(name);
- if (!isObject(value)) {
- this.value = this.stringify.dtdEntityValue(value);
- } else {
- if (!value.pubID && !value.sysID) {
- throw new Error("Public and/or system identifiers are required for an external entity");
- }
- if (value.pubID && !value.sysID) {
- throw new Error("System identifier is required for a public external entity");
- }
- if (value.pubID != null) {
- this.pubID = this.stringify.dtdPubID(value.pubID);
- }
- if (value.sysID != null) {
- this.sysID = this.stringify.dtdSysID(value.sysID);
- }
- if (value.nData != null) {
- this.nData = this.stringify.dtdNData(value.nData);
- }
- if (this.pe && this.nData) {
- throw new Error("Notation declaration is not allowed in a parameter entity");
- }
- }
- }
-
- XMLDTDEntity.prototype.toString = function(options, level) {
- var indent, newline, offset, pretty, r, ref, ref1, ref2, space;
- pretty = (options != null ? options.pretty : void 0) || false;
- indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' ';
- offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0;
- newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n';
- level || (level = 0);
- space = new Array(level + offset + 1).join(indent);
- r = '';
- if (pretty) {
- r += space;
- }
- r += '';
- if (pretty) {
- r += newline;
- }
- return r;
- };
-
- return XMLDTDEntity;
-
- })();
-
-}).call(this);
-
-},{"lodash/lang/isObject":53,"lodash/object/create":57}],70:[function(require,module,exports){
-// Generated by CoffeeScript 1.9.1
-(function() {
- var XMLDTDNotation, create;
-
- create = require('lodash/object/create');
-
- module.exports = XMLDTDNotation = (function() {
- function XMLDTDNotation(parent, name, value) {
- this.stringify = parent.stringify;
- if (name == null) {
- throw new Error("Missing notation name");
- }
- if (!value.pubID && !value.sysID) {
- throw new Error("Public or system identifiers are required for an external entity");
- }
- this.name = this.stringify.eleName(name);
- if (value.pubID != null) {
- this.pubID = this.stringify.dtdPubID(value.pubID);
- }
- if (value.sysID != null) {
- this.sysID = this.stringify.dtdSysID(value.sysID);
- }
- }
-
- XMLDTDNotation.prototype.toString = function(options, level) {
- var indent, newline, offset, pretty, r, ref, ref1, ref2, space;
- pretty = (options != null ? options.pretty : void 0) || false;
- indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' ';
- offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0;
- newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n';
- level || (level = 0);
- space = new Array(level + offset + 1).join(indent);
- r = '';
- if (pretty) {
- r += space;
- }
- r += '';
- if (pretty) {
- r += newline;
- }
- return r;
- };
-
- return XMLDTDNotation;
-
- })();
-
-}).call(this);
-
-},{"lodash/object/create":57}],71:[function(require,module,exports){
-// Generated by CoffeeScript 1.9.1
-(function() {
- var XMLDeclaration, XMLNode, create, isObject,
- extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
- hasProp = {}.hasOwnProperty;
-
- create = require('lodash/object/create');
-
- isObject = require('lodash/lang/isObject');
-
- XMLNode = require('./XMLNode');
-
- module.exports = XMLDeclaration = (function(superClass) {
- extend(XMLDeclaration, superClass);
-
- function XMLDeclaration(parent, version, encoding, standalone) {
- var ref;
- XMLDeclaration.__super__.constructor.call(this, parent);
- if (isObject(version)) {
- ref = version, version = ref.version, encoding = ref.encoding, standalone = ref.standalone;
- }
- if (!version) {
- version = '1.0';
- }
- this.version = this.stringify.xmlVersion(version);
- if (encoding != null) {
- this.encoding = this.stringify.xmlEncoding(encoding);
- }
- if (standalone != null) {
- this.standalone = this.stringify.xmlStandalone(standalone);
- }
- }
-
- XMLDeclaration.prototype.toString = function(options, level) {
- var indent, newline, offset, pretty, r, ref, ref1, ref2, space;
- pretty = (options != null ? options.pretty : void 0) || false;
- indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' ';
- offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0;
- newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n';
- level || (level = 0);
- space = new Array(level + offset + 1).join(indent);
- r = '';
- if (pretty) {
- r += space;
- }
- r += '';
- if (pretty) {
- r += newline;
- }
- return r;
- };
-
- return XMLDeclaration;
-
- })(XMLNode);
-
-}).call(this);
-
-},{"./XMLNode":74,"lodash/lang/isObject":53,"lodash/object/create":57}],72:[function(require,module,exports){
-// Generated by CoffeeScript 1.9.1
-(function() {
- var XMLCData, XMLComment, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDocType, XMLProcessingInstruction, create, isObject;
-
- create = require('lodash/object/create');
-
- isObject = require('lodash/lang/isObject');
-
- XMLCData = require('./XMLCData');
-
- XMLComment = require('./XMLComment');
-
- XMLDTDAttList = require('./XMLDTDAttList');
-
- XMLDTDEntity = require('./XMLDTDEntity');
-
- XMLDTDElement = require('./XMLDTDElement');
-
- XMLDTDNotation = require('./XMLDTDNotation');
-
- XMLProcessingInstruction = require('./XMLProcessingInstruction');
-
- module.exports = XMLDocType = (function() {
- function XMLDocType(parent, pubID, sysID) {
- var ref, ref1;
- this.documentObject = parent;
- this.stringify = this.documentObject.stringify;
- this.children = [];
- if (isObject(pubID)) {
- ref = pubID, pubID = ref.pubID, sysID = ref.sysID;
- }
- if (sysID == null) {
- ref1 = [pubID, sysID], sysID = ref1[0], pubID = ref1[1];
- }
- if (pubID != null) {
- this.pubID = this.stringify.dtdPubID(pubID);
- }
- if (sysID != null) {
- this.sysID = this.stringify.dtdSysID(sysID);
- }
- }
-
- XMLDocType.prototype.element = function(name, value) {
- var child;
- child = new XMLDTDElement(this, name, value);
- this.children.push(child);
- return this;
- };
-
- XMLDocType.prototype.attList = function(elementName, attributeName, attributeType, defaultValueType, defaultValue) {
- var child;
- child = new XMLDTDAttList(this, elementName, attributeName, attributeType, defaultValueType, defaultValue);
- this.children.push(child);
- return this;
- };
-
- XMLDocType.prototype.entity = function(name, value) {
- var child;
- child = new XMLDTDEntity(this, false, name, value);
- this.children.push(child);
- return this;
- };
-
- XMLDocType.prototype.pEntity = function(name, value) {
- var child;
- child = new XMLDTDEntity(this, true, name, value);
- this.children.push(child);
- return this;
- };
-
- XMLDocType.prototype.notation = function(name, value) {
- var child;
- child = new XMLDTDNotation(this, name, value);
- this.children.push(child);
- return this;
- };
-
- XMLDocType.prototype.cdata = function(value) {
- var child;
- child = new XMLCData(this, value);
- this.children.push(child);
- return this;
- };
-
- XMLDocType.prototype.comment = function(value) {
- var child;
- child = new XMLComment(this, value);
- this.children.push(child);
- return this;
- };
-
- XMLDocType.prototype.instruction = function(target, value) {
- var child;
- child = new XMLProcessingInstruction(this, target, value);
- this.children.push(child);
- return this;
- };
-
- XMLDocType.prototype.root = function() {
- return this.documentObject.root();
- };
-
- XMLDocType.prototype.document = function() {
- return this.documentObject;
- };
-
- XMLDocType.prototype.toString = function(options, level) {
- var child, i, indent, len, newline, offset, pretty, r, ref, ref1, ref2, ref3, space;
- pretty = (options != null ? options.pretty : void 0) || false;
- indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' ';
- offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0;
- newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n';
- level || (level = 0);
- space = new Array(level + offset + 1).join(indent);
- r = '';
- if (pretty) {
- r += space;
- }
- r += ' 0) {
- r += ' [';
- if (pretty) {
- r += newline;
- }
- ref3 = this.children;
- for (i = 0, len = ref3.length; i < len; i++) {
- child = ref3[i];
- r += child.toString(options, level + 1);
- }
- r += ']';
- }
- r += '>';
- if (pretty) {
- r += newline;
- }
- return r;
- };
-
- XMLDocType.prototype.ele = function(name, value) {
- return this.element(name, value);
- };
-
- XMLDocType.prototype.att = function(elementName, attributeName, attributeType, defaultValueType, defaultValue) {
- return this.attList(elementName, attributeName, attributeType, defaultValueType, defaultValue);
- };
-
- XMLDocType.prototype.ent = function(name, value) {
- return this.entity(name, value);
- };
-
- XMLDocType.prototype.pent = function(name, value) {
- return this.pEntity(name, value);
- };
-
- XMLDocType.prototype.not = function(name, value) {
- return this.notation(name, value);
- };
-
- XMLDocType.prototype.dat = function(value) {
- return this.cdata(value);
- };
-
- XMLDocType.prototype.com = function(value) {
- return this.comment(value);
- };
-
- XMLDocType.prototype.ins = function(target, value) {
- return this.instruction(target, value);
- };
-
- XMLDocType.prototype.up = function() {
- return this.root();
- };
-
- XMLDocType.prototype.doc = function() {
- return this.document();
- };
-
- return XMLDocType;
-
- })();
-
-}).call(this);
-
-},{"./XMLCData":65,"./XMLComment":66,"./XMLDTDAttList":67,"./XMLDTDElement":68,"./XMLDTDEntity":69,"./XMLDTDNotation":70,"./XMLProcessingInstruction":75,"lodash/lang/isObject":53,"lodash/object/create":57}],73:[function(require,module,exports){
-// Generated by CoffeeScript 1.9.1
-(function() {
- var XMLAttribute, XMLElement, XMLNode, XMLProcessingInstruction, create, every, isFunction, isObject,
- extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
- hasProp = {}.hasOwnProperty;
-
- create = require('lodash/object/create');
-
- isObject = require('lodash/lang/isObject');
-
- isFunction = require('lodash/lang/isFunction');
-
- every = require('lodash/collection/every');
-
- XMLNode = require('./XMLNode');
-
- XMLAttribute = require('./XMLAttribute');
-
- XMLProcessingInstruction = require('./XMLProcessingInstruction');
-
- module.exports = XMLElement = (function(superClass) {
- extend(XMLElement, superClass);
-
- function XMLElement(parent, name, attributes) {
- XMLElement.__super__.constructor.call(this, parent);
- if (name == null) {
- throw new Error("Missing element name");
- }
- this.name = this.stringify.eleName(name);
- this.children = [];
- this.instructions = [];
- this.attributes = {};
- if (attributes != null) {
- this.attribute(attributes);
- }
- }
-
- XMLElement.prototype.clone = function() {
- var att, attName, clonedSelf, i, len, pi, ref, ref1;
- clonedSelf = create(XMLElement.prototype, this);
- if (clonedSelf.isRoot) {
- clonedSelf.documentObject = null;
- }
- clonedSelf.attributes = {};
- ref = this.attributes;
- for (attName in ref) {
- if (!hasProp.call(ref, attName)) continue;
- att = ref[attName];
- clonedSelf.attributes[attName] = att.clone();
- }
- clonedSelf.instructions = [];
- ref1 = this.instructions;
- for (i = 0, len = ref1.length; i < len; i++) {
- pi = ref1[i];
- clonedSelf.instructions.push(pi.clone());
- }
- clonedSelf.children = [];
- this.children.forEach(function(child) {
- var clonedChild;
- clonedChild = child.clone();
- clonedChild.parent = clonedSelf;
- return clonedSelf.children.push(clonedChild);
- });
- return clonedSelf;
- };
-
- XMLElement.prototype.attribute = function(name, value) {
- var attName, attValue;
- if (name != null) {
- name = name.valueOf();
- }
- if (isObject(name)) {
- for (attName in name) {
- if (!hasProp.call(name, attName)) continue;
- attValue = name[attName];
- this.attribute(attName, attValue);
- }
- } else {
- if (isFunction(value)) {
- value = value.apply();
- }
- if (!this.options.skipNullAttributes || (value != null)) {
- this.attributes[name] = new XMLAttribute(this, name, value);
- }
- }
- return this;
- };
-
- XMLElement.prototype.removeAttribute = function(name) {
- var attName, i, len;
- if (name == null) {
- throw new Error("Missing attribute name");
- }
- name = name.valueOf();
- if (Array.isArray(name)) {
- for (i = 0, len = name.length; i < len; i++) {
- attName = name[i];
- delete this.attributes[attName];
- }
- } else {
- delete this.attributes[name];
- }
- return this;
- };
-
- XMLElement.prototype.instruction = function(target, value) {
- var i, insTarget, insValue, instruction, len;
- if (target != null) {
- target = target.valueOf();
- }
- if (value != null) {
- value = value.valueOf();
- }
- if (Array.isArray(target)) {
- for (i = 0, len = target.length; i < len; i++) {
- insTarget = target[i];
- this.instruction(insTarget);
- }
- } else if (isObject(target)) {
- for (insTarget in target) {
- if (!hasProp.call(target, insTarget)) continue;
- insValue = target[insTarget];
- this.instruction(insTarget, insValue);
- }
- } else {
- if (isFunction(value)) {
- value = value.apply();
- }
- instruction = new XMLProcessingInstruction(this, target, value);
- this.instructions.push(instruction);
- }
- return this;
- };
-
- XMLElement.prototype.toString = function(options, level) {
- var att, child, i, indent, instruction, j, len, len1, name, newline, offset, pretty, r, ref, ref1, ref2, ref3, ref4, ref5, space;
- pretty = (options != null ? options.pretty : void 0) || false;
- indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' ';
- offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0;
- newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n';
- level || (level = 0);
- space = new Array(level + offset + 1).join(indent);
- r = '';
- ref3 = this.instructions;
- for (i = 0, len = ref3.length; i < len; i++) {
- instruction = ref3[i];
- r += instruction.toString(options, level);
- }
- if (pretty) {
- r += space;
- }
- r += '<' + this.name;
- ref4 = this.attributes;
- for (name in ref4) {
- if (!hasProp.call(ref4, name)) continue;
- att = ref4[name];
- r += att.toString(options);
- }
- if (this.children.length === 0 || every(this.children, function(e) {
- return e.value === '';
- })) {
- r += '/>';
- if (pretty) {
- r += newline;
- }
- } else if (pretty && this.children.length === 1 && (this.children[0].value != null)) {
- r += '>';
- r += this.children[0].value;
- r += '' + this.name + '>';
- r += newline;
- } else {
- r += '>';
- if (pretty) {
- r += newline;
- }
- ref5 = this.children;
- for (j = 0, len1 = ref5.length; j < len1; j++) {
- child = ref5[j];
- r += child.toString(options, level + 1);
- }
- if (pretty) {
- r += space;
- }
- r += '' + this.name + '>';
- if (pretty) {
- r += newline;
- }
- }
- return r;
- };
-
- XMLElement.prototype.att = function(name, value) {
- return this.attribute(name, value);
- };
-
- XMLElement.prototype.ins = function(target, value) {
- return this.instruction(target, value);
- };
-
- XMLElement.prototype.a = function(name, value) {
- return this.attribute(name, value);
- };
-
- XMLElement.prototype.i = function(target, value) {
- return this.instruction(target, value);
- };
-
- return XMLElement;
-
- })(XMLNode);
-
-}).call(this);
-
-},{"./XMLAttribute":63,"./XMLNode":74,"./XMLProcessingInstruction":75,"lodash/collection/every":5,"lodash/lang/isFunction":51,"lodash/lang/isObject":53,"lodash/object/create":57}],74:[function(require,module,exports){
-// Generated by CoffeeScript 1.9.1
-(function() {
- var XMLCData, XMLComment, XMLDeclaration, XMLDocType, XMLElement, XMLNode, XMLRaw, XMLText, isEmpty, isFunction, isObject,
- hasProp = {}.hasOwnProperty;
-
- isObject = require('lodash/lang/isObject');
-
- isFunction = require('lodash/lang/isFunction');
-
- isEmpty = require('lodash/lang/isEmpty');
-
- XMLElement = null;
-
- XMLCData = null;
-
- XMLComment = null;
-
- XMLDeclaration = null;
-
- XMLDocType = null;
-
- XMLRaw = null;
-
- XMLText = null;
-
- module.exports = XMLNode = (function() {
- function XMLNode(parent) {
- this.parent = parent;
- this.options = this.parent.options;
- this.stringify = this.parent.stringify;
- if (XMLElement === null) {
- XMLElement = require('./XMLElement');
- XMLCData = require('./XMLCData');
- XMLComment = require('./XMLComment');
- XMLDeclaration = require('./XMLDeclaration');
- XMLDocType = require('./XMLDocType');
- XMLRaw = require('./XMLRaw');
- XMLText = require('./XMLText');
- }
- }
-
- XMLNode.prototype.element = function(name, attributes, text) {
- var childNode, item, j, k, key, lastChild, len, len1, ref, val;
- lastChild = null;
- if (attributes == null) {
- attributes = {};
- }
- attributes = attributes.valueOf();
- if (!isObject(attributes)) {
- ref = [attributes, text], text = ref[0], attributes = ref[1];
- }
- if (name != null) {
- name = name.valueOf();
- }
- if (Array.isArray(name)) {
- for (j = 0, len = name.length; j < len; j++) {
- item = name[j];
- lastChild = this.element(item);
- }
- } else if (isFunction(name)) {
- lastChild = this.element(name.apply());
- } else if (isObject(name)) {
- for (key in name) {
- if (!hasProp.call(name, key)) continue;
- val = name[key];
- if (isFunction(val)) {
- val = val.apply();
- }
- if ((isObject(val)) && (isEmpty(val))) {
- val = null;
- }
- if (!this.options.ignoreDecorators && this.stringify.convertAttKey && key.indexOf(this.stringify.convertAttKey) === 0) {
- lastChild = this.attribute(key.substr(this.stringify.convertAttKey.length), val);
- } else if (!this.options.ignoreDecorators && this.stringify.convertPIKey && key.indexOf(this.stringify.convertPIKey) === 0) {
- lastChild = this.instruction(key.substr(this.stringify.convertPIKey.length), val);
- } else if (Array.isArray(val)) {
- for (k = 0, len1 = val.length; k < len1; k++) {
- item = val[k];
- childNode = {};
- childNode[key] = item;
- lastChild = this.element(childNode);
- }
- } else if (isObject(val)) {
- lastChild = this.element(key);
- lastChild.element(val);
- } else {
- lastChild = this.element(key, val);
- }
- }
- } else {
- if (!this.options.ignoreDecorators && this.stringify.convertTextKey && name.indexOf(this.stringify.convertTextKey) === 0) {
- lastChild = this.text(text);
- } else if (!this.options.ignoreDecorators && this.stringify.convertCDataKey && name.indexOf(this.stringify.convertCDataKey) === 0) {
- lastChild = this.cdata(text);
- } else if (!this.options.ignoreDecorators && this.stringify.convertCommentKey && name.indexOf(this.stringify.convertCommentKey) === 0) {
- lastChild = this.comment(text);
- } else if (!this.options.ignoreDecorators && this.stringify.convertRawKey && name.indexOf(this.stringify.convertRawKey) === 0) {
- lastChild = this.raw(text);
- } else {
- lastChild = this.node(name, attributes, text);
- }
- }
- if (lastChild == null) {
- throw new Error("Could not create any elements with: " + name);
- }
- return lastChild;
- };
-
- XMLNode.prototype.insertBefore = function(name, attributes, text) {
- var child, i, removed;
- if (this.isRoot) {
- throw new Error("Cannot insert elements at root level");
- }
- i = this.parent.children.indexOf(this);
- removed = this.parent.children.splice(i);
- child = this.parent.element(name, attributes, text);
- Array.prototype.push.apply(this.parent.children, removed);
- return child;
- };
-
- XMLNode.prototype.insertAfter = function(name, attributes, text) {
- var child, i, removed;
- if (this.isRoot) {
- throw new Error("Cannot insert elements at root level");
- }
- i = this.parent.children.indexOf(this);
- removed = this.parent.children.splice(i + 1);
- child = this.parent.element(name, attributes, text);
- Array.prototype.push.apply(this.parent.children, removed);
- return child;
- };
-
- XMLNode.prototype.remove = function() {
- var i, ref;
- if (this.isRoot) {
- throw new Error("Cannot remove the root element");
- }
- i = this.parent.children.indexOf(this);
- [].splice.apply(this.parent.children, [i, i - i + 1].concat(ref = [])), ref;
- return this.parent;
- };
-
- XMLNode.prototype.node = function(name, attributes, text) {
- var child, ref;
- if (name != null) {
- name = name.valueOf();
- }
- if (attributes == null) {
- attributes = {};
- }
- attributes = attributes.valueOf();
- if (!isObject(attributes)) {
- ref = [attributes, text], text = ref[0], attributes = ref[1];
- }
- child = new XMLElement(this, name, attributes);
- if (text != null) {
- child.text(text);
- }
- this.children.push(child);
- return child;
- };
-
- XMLNode.prototype.text = function(value) {
- var child;
- child = new XMLText(this, value);
- this.children.push(child);
- return this;
- };
-
- XMLNode.prototype.cdata = function(value) {
- var child;
- child = new XMLCData(this, value);
- this.children.push(child);
- return this;
- };
-
- XMLNode.prototype.comment = function(value) {
- var child;
- child = new XMLComment(this, value);
- this.children.push(child);
- return this;
- };
-
- XMLNode.prototype.raw = function(value) {
- var child;
- child = new XMLRaw(this, value);
- this.children.push(child);
- return this;
- };
-
- XMLNode.prototype.declaration = function(version, encoding, standalone) {
- var doc, xmldec;
- doc = this.document();
- xmldec = new XMLDeclaration(doc, version, encoding, standalone);
- doc.xmldec = xmldec;
- return doc.root();
- };
-
- XMLNode.prototype.doctype = function(pubID, sysID) {
- var doc, doctype;
- doc = this.document();
- doctype = new XMLDocType(doc, pubID, sysID);
- doc.doctype = doctype;
- return doctype;
- };
-
- XMLNode.prototype.up = function() {
- if (this.isRoot) {
- throw new Error("The root node has no parent. Use doc() if you need to get the document object.");
- }
- return this.parent;
- };
-
- XMLNode.prototype.root = function() {
- var child;
- if (this.isRoot) {
- return this;
- }
- child = this.parent;
- while (!child.isRoot) {
- child = child.parent;
- }
- return child;
- };
-
- XMLNode.prototype.document = function() {
- return this.root().documentObject;
- };
-
- XMLNode.prototype.end = function(options) {
- return this.document().toString(options);
- };
-
- XMLNode.prototype.prev = function() {
- var i;
- if (this.isRoot) {
- throw new Error("Root node has no siblings");
- }
- i = this.parent.children.indexOf(this);
- if (i < 1) {
- throw new Error("Already at the first node");
- }
- return this.parent.children[i - 1];
- };
-
- XMLNode.prototype.next = function() {
- var i;
- if (this.isRoot) {
- throw new Error("Root node has no siblings");
- }
- i = this.parent.children.indexOf(this);
- if (i === -1 || i === this.parent.children.length - 1) {
- throw new Error("Already at the last node");
- }
- return this.parent.children[i + 1];
- };
-
- XMLNode.prototype.importXMLBuilder = function(xmlbuilder) {
- var clonedRoot;
- clonedRoot = xmlbuilder.root().clone();
- clonedRoot.parent = this;
- clonedRoot.isRoot = false;
- this.children.push(clonedRoot);
- return this;
- };
-
- XMLNode.prototype.ele = function(name, attributes, text) {
- return this.element(name, attributes, text);
- };
-
- XMLNode.prototype.nod = function(name, attributes, text) {
- return this.node(name, attributes, text);
- };
-
- XMLNode.prototype.txt = function(value) {
- return this.text(value);
- };
-
- XMLNode.prototype.dat = function(value) {
- return this.cdata(value);
- };
-
- XMLNode.prototype.com = function(value) {
- return this.comment(value);
- };
-
- XMLNode.prototype.doc = function() {
- return this.document();
- };
-
- XMLNode.prototype.dec = function(version, encoding, standalone) {
- return this.declaration(version, encoding, standalone);
- };
-
- XMLNode.prototype.dtd = function(pubID, sysID) {
- return this.doctype(pubID, sysID);
- };
-
- XMLNode.prototype.e = function(name, attributes, text) {
- return this.element(name, attributes, text);
- };
-
- XMLNode.prototype.n = function(name, attributes, text) {
- return this.node(name, attributes, text);
- };
-
- XMLNode.prototype.t = function(value) {
- return this.text(value);
- };
-
- XMLNode.prototype.d = function(value) {
- return this.cdata(value);
- };
-
- XMLNode.prototype.c = function(value) {
- return this.comment(value);
- };
-
- XMLNode.prototype.r = function(value) {
- return this.raw(value);
- };
-
- XMLNode.prototype.u = function() {
- return this.up();
- };
-
- return XMLNode;
-
- })();
-
-}).call(this);
-
-},{"./XMLCData":65,"./XMLComment":66,"./XMLDeclaration":71,"./XMLDocType":72,"./XMLElement":73,"./XMLRaw":76,"./XMLText":78,"lodash/lang/isEmpty":50,"lodash/lang/isFunction":51,"lodash/lang/isObject":53}],75:[function(require,module,exports){
-// Generated by CoffeeScript 1.9.1
-(function() {
- var XMLProcessingInstruction, create;
-
- create = require('lodash/object/create');
-
- module.exports = XMLProcessingInstruction = (function() {
- function XMLProcessingInstruction(parent, target, value) {
- this.stringify = parent.stringify;
- if (target == null) {
- throw new Error("Missing instruction target");
- }
- this.target = this.stringify.insTarget(target);
- if (value) {
- this.value = this.stringify.insValue(value);
- }
- }
-
- XMLProcessingInstruction.prototype.clone = function() {
- return create(XMLProcessingInstruction.prototype, this);
- };
-
- XMLProcessingInstruction.prototype.toString = function(options, level) {
- var indent, newline, offset, pretty, r, ref, ref1, ref2, space;
- pretty = (options != null ? options.pretty : void 0) || false;
- indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' ';
- offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0;
- newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n';
- level || (level = 0);
- space = new Array(level + offset + 1).join(indent);
- r = '';
- if (pretty) {
- r += space;
- }
- r += '';
- r += this.target;
- if (this.value) {
- r += ' ' + this.value;
- }
- r += '?>';
- if (pretty) {
- r += newline;
- }
- return r;
- };
-
- return XMLProcessingInstruction;
-
- })();
-
-}).call(this);
-
-},{"lodash/object/create":57}],76:[function(require,module,exports){
-// Generated by CoffeeScript 1.9.1
-(function() {
- var XMLNode, XMLRaw, create,
- extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
- hasProp = {}.hasOwnProperty;
-
- create = require('lodash/object/create');
-
- XMLNode = require('./XMLNode');
-
- module.exports = XMLRaw = (function(superClass) {
- extend(XMLRaw, superClass);
-
- function XMLRaw(parent, text) {
- XMLRaw.__super__.constructor.call(this, parent);
- if (text == null) {
- throw new Error("Missing raw text");
- }
- this.value = this.stringify.raw(text);
- }
-
- XMLRaw.prototype.clone = function() {
- return create(XMLRaw.prototype, this);
- };
-
- XMLRaw.prototype.toString = function(options, level) {
- var indent, newline, offset, pretty, r, ref, ref1, ref2, space;
- pretty = (options != null ? options.pretty : void 0) || false;
- indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' ';
- offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0;
- newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n';
- level || (level = 0);
- space = new Array(level + offset + 1).join(indent);
- r = '';
- if (pretty) {
- r += space;
- }
- r += this.value;
- if (pretty) {
- r += newline;
- }
- return r;
- };
-
- return XMLRaw;
-
- })(XMLNode);
-
-}).call(this);
-
-},{"./XMLNode":74,"lodash/object/create":57}],77:[function(require,module,exports){
-// Generated by CoffeeScript 1.9.1
-(function() {
- var XMLStringifier,
- bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
- hasProp = {}.hasOwnProperty;
-
- module.exports = XMLStringifier = (function() {
- function XMLStringifier(options) {
- this.assertLegalChar = bind(this.assertLegalChar, this);
- var key, ref, value;
- this.allowSurrogateChars = options != null ? options.allowSurrogateChars : void 0;
- ref = (options != null ? options.stringify : void 0) || {};
- for (key in ref) {
- if (!hasProp.call(ref, key)) continue;
- value = ref[key];
- this[key] = value;
- }
- }
-
- XMLStringifier.prototype.eleName = function(val) {
- val = '' + val || '';
- return this.assertLegalChar(val);
- };
-
- XMLStringifier.prototype.eleText = function(val) {
- val = '' + val || '';
- return this.assertLegalChar(this.elEscape(val));
- };
-
- XMLStringifier.prototype.cdata = function(val) {
- val = '' + val || '';
- if (val.match(/]]>/)) {
- throw new Error("Invalid CDATA text: " + val);
- }
- return this.assertLegalChar(val);
- };
-
- XMLStringifier.prototype.comment = function(val) {
- val = '' + val || '';
- if (val.match(/--/)) {
- throw new Error("Comment text cannot contain double-hypen: " + val);
- }
- return this.assertLegalChar(val);
- };
-
- XMLStringifier.prototype.raw = function(val) {
- return '' + val || '';
- };
-
- XMLStringifier.prototype.attName = function(val) {
- return '' + val || '';
- };
-
- XMLStringifier.prototype.attValue = function(val) {
- val = '' + val || '';
- return this.attEscape(val);
- };
-
- XMLStringifier.prototype.insTarget = function(val) {
- return '' + val || '';
- };
-
- XMLStringifier.prototype.insValue = function(val) {
- val = '' + val || '';
- if (val.match(/\?>/)) {
- throw new Error("Invalid processing instruction value: " + val);
- }
- return val;
- };
-
- XMLStringifier.prototype.xmlVersion = function(val) {
- val = '' + val || '';
- if (!val.match(/1\.[0-9]+/)) {
- throw new Error("Invalid version number: " + val);
- }
- return val;
- };
-
- XMLStringifier.prototype.xmlEncoding = function(val) {
- val = '' + val || '';
- if (!val.match(/^[A-Za-z](?:[A-Za-z0-9._-]|-)*$/)) {
- throw new Error("Invalid encoding: " + val);
- }
- return val;
- };
-
- XMLStringifier.prototype.xmlStandalone = function(val) {
- if (val) {
- return "yes";
- } else {
- return "no";
- }
- };
-
- XMLStringifier.prototype.dtdPubID = function(val) {
- return '' + val || '';
- };
-
- XMLStringifier.prototype.dtdSysID = function(val) {
- return '' + val || '';
- };
-
- XMLStringifier.prototype.dtdElementValue = function(val) {
- return '' + val || '';
- };
-
- XMLStringifier.prototype.dtdAttType = function(val) {
- return '' + val || '';
- };
-
- XMLStringifier.prototype.dtdAttDefault = function(val) {
- if (val != null) {
- return '' + val || '';
- } else {
- return val;
- }
- };
-
- XMLStringifier.prototype.dtdEntityValue = function(val) {
- return '' + val || '';
- };
-
- XMLStringifier.prototype.dtdNData = function(val) {
- return '' + val || '';
- };
-
- XMLStringifier.prototype.convertAttKey = '@';
-
- XMLStringifier.prototype.convertPIKey = '?';
-
- XMLStringifier.prototype.convertTextKey = '#text';
-
- XMLStringifier.prototype.convertCDataKey = '#cdata';
-
- XMLStringifier.prototype.convertCommentKey = '#comment';
-
- XMLStringifier.prototype.convertRawKey = '#raw';
-
- XMLStringifier.prototype.assertLegalChar = function(str) {
- var chars, chr;
- if (this.allowSurrogateChars) {
- chars = /[\u0000-\u0008\u000B-\u000C\u000E-\u001F\uFFFE-\uFFFF]/;
- } else {
- chars = /[\u0000-\u0008\u000B-\u000C\u000E-\u001F\uD800-\uDFFF\uFFFE-\uFFFF]/;
- }
- chr = str.match(chars);
- if (chr) {
- throw new Error("Invalid character (" + chr + ") in string: " + str + " at index " + chr.index);
- }
- return str;
- };
-
- XMLStringifier.prototype.elEscape = function(str) {
- return str.replace(/&/g, '&').replace(//g, '>').replace(/\r/g, '
');
- };
-
- XMLStringifier.prototype.attEscape = function(str) {
- return str.replace(/&/g, '&').replace(/,
- * and raw CDATA nodes.
- *
- * @param {Element} node
- * @returns {Boolean}
- * @api private
- */
-
-function shouldIgnoreNode (node) {
- return node.nodeType === 3 // text
- || node.nodeType === 8 // comment
- || node.nodeType === 4; // cdata
-}
-
-
-/**
- * Parses a Plist XML string. Returns an Object.
- *
- * @param {String} xml - the XML String to decode
- * @returns {Mixed} the decoded value from the Plist XML
- * @api public
- */
-
-function parse (xml) {
- var doc = new DOMParser().parseFromString(xml);
- if (doc.documentElement.nodeName !== 'plist') {
- throw new Error('malformed document. First element should be ');
- }
- var plist = parsePlistXML(doc.documentElement);
-
- // the root node gets interpreted as an Array,
- // so pull out the inner data first
- if (plist.length == 1) plist = plist[0];
-
- return plist;
-}
-
-/**
- * Parses a Plist XML string. Returns an Object. Takes a `callback` function.
- *
- * @param {String} xml - the XML String to decode
- * @param {Function} callback - callback function
- * @returns {Mixed} the decoded value from the Plist XML
- * @api public
- * @deprecated not actually async. use parse() instead
- */
-
-function parseString (xml, callback) {
- var doc, error, plist;
- try {
- doc = new DOMParser().parseFromString(xml);
- plist = parsePlistXML(doc.documentElement);
- } catch(e) {
- error = e;
- }
- callback(error, plist);
-}
-
-/**
- * Parses a Plist XML string. Returns an Object.
- *
- * @param {String} xml - the XML String to decode
- * @param {Function} callback - callback function
- * @returns {Mixed} the decoded value from the Plist XML
- * @api public
- * @deprecated use parse() instead
- */
-
-function parseStringSync (xml) {
- var doc = new DOMParser().parseFromString(xml);
- var plist;
- if (doc.documentElement.nodeName !== 'plist') {
- throw new Error('malformed document. First element should be ');
- }
- plist = parsePlistXML(doc.documentElement);
-
- // if the plist is an array with 1 element, pull it out of the array
- if (plist.length == 1) {
- plist = plist[0];
- }
- return plist;
-}
-
-/**
- * Convert an XML based plist document into a JSON representation.
- *
- * @param {Object} xml_node - current XML node in the plist
- * @returns {Mixed} built up JSON object
- * @api private
- */
-
-function parsePlistXML (node) {
- var i, new_obj, key, val, new_arr, res, d;
-
- if (!node)
- return null;
-
- if (node.nodeName === 'plist') {
- new_arr = [];
- for (i=0; i < node.childNodes.length; i++) {
- // ignore comment nodes (text)
- if (!shouldIgnoreNode(node.childNodes[i])) {
- new_arr.push( parsePlistXML(node.childNodes[i]));
- }
- }
- return new_arr;
-
- } else if (node.nodeName === 'dict') {
- new_obj = {};
- key = null;
- for (i=0; i < node.childNodes.length; i++) {
- // ignore comment nodes (text)
- if (!shouldIgnoreNode(node.childNodes[i])) {
- if (key === null) {
- key = parsePlistXML(node.childNodes[i]);
- } else {
- new_obj[key] = parsePlistXML(node.childNodes[i]);
- key = null;
- }
- }
- }
- return new_obj;
-
- } else if (node.nodeName === 'array') {
- new_arr = [];
- for (i=0; i < node.childNodes.length; i++) {
- // ignore comment nodes (text)
- if (!shouldIgnoreNode(node.childNodes[i])) {
- res = parsePlistXML(node.childNodes[i]);
- if (null != res) new_arr.push(res);
- }
- }
- return new_arr;
-
- } else if (node.nodeName === '#text') {
- // TODO: what should we do with text types? (CDATA sections)
-
- } else if (node.nodeName === 'key') {
- return node.childNodes[0].nodeValue;
-
- } else if (node.nodeName === 'string') {
- res = '';
- for (d=0; d < node.childNodes.length; d++) {
- res += node.childNodes[d].nodeValue;
- }
- return res;
-
- } else if (node.nodeName === 'integer') {
- // parse as base 10 integer
- return parseInt(node.childNodes[0].nodeValue, 10);
-
- } else if (node.nodeName === 'real') {
- res = '';
- for (d=0; d < node.childNodes.length; d++) {
- if (node.childNodes[d].nodeType === 3) {
- res += node.childNodes[d].nodeValue;
- }
- }
- return parseFloat(res);
-
- } else if (node.nodeName === 'data') {
- res = '';
- for (d=0; d < node.childNodes.length; d++) {
- if (node.childNodes[d].nodeType === 3) {
- res += node.childNodes[d].nodeValue.replace(/\s+/g, '');
- }
- }
-
- // decode base64 data to a Buffer instance
- return new Buffer(res, 'base64');
-
- } else if (node.nodeName === 'date') {
- return new Date(node.childNodes[0].nodeValue);
-
- } else if (node.nodeName === 'true') {
- return true;
-
- } else if (node.nodeName === 'false') {
- return false;
- }
-}
-
-}).call(this,require("buffer").Buffer)
-},{"buffer":3,"util-deprecate":6,"xmldom":7}],2:[function(require,module,exports){
-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))
-
-},{}],3:[function(require,module,exports){
-(function (global){
-/*!
- * The buffer module from node.js, for the browser.
- *
- * @author Feross Aboukhadijeh
- * @license MIT
- */
-/* eslint-disable no-proto */
-
-var base64 = require('base64-js')
-var ieee754 = require('ieee754')
-var isArray = require('is-array')
-
-exports.Buffer = Buffer
-exports.SlowBuffer = SlowBuffer
-exports.INSPECT_MAX_BYTES = 50
-Buffer.poolSize = 8192 // not used by this implementation
-
-var rootParent = {}
-
-/**
- * If `Buffer.TYPED_ARRAY_SUPPORT`:
- * === true Use Uint8Array implementation (fastest)
- * === false Use Object implementation (most compatible, even IE6)
- *
- * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
- * Opera 11.6+, iOS 4.2+.
- *
- * Due to various browser bugs, sometimes the Object implementation will be used even
- * when the browser supports typed arrays.
- *
- * Note:
- *
- * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,
- * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
- *
- * - Safari 5-7 lacks support for changing the `Object.prototype.constructor` property
- * on objects.
- *
- * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.
- *
- * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of
- * incorrect length in some situations.
-
- * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they
- * get the Object implementation, which is slower but behaves correctly.
- */
-Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined
- ? global.TYPED_ARRAY_SUPPORT
- : typedArraySupport()
-
-function typedArraySupport () {
- function Bar () {}
- try {
- var arr = new Uint8Array(1)
- arr.foo = function () { return 42 }
- arr.constructor = Bar
- return arr.foo() === 42 && // typed array instances can be augmented
- arr.constructor === Bar && // constructor can be set
- typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`
- arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`
- } catch (e) {
- return false
- }
-}
-
-function kMaxLength () {
- return Buffer.TYPED_ARRAY_SUPPORT
- ? 0x7fffffff
- : 0x3fffffff
-}
-
-/**
- * Class: Buffer
- * =============
- *
- * The Buffer constructor returns instances of `Uint8Array` that are augmented
- * with function properties for all the node `Buffer` API functions. We use
- * `Uint8Array` so that square bracket notation works as expected -- it returns
- * a single octet.
- *
- * By augmenting the instances, we can avoid modifying the `Uint8Array`
- * prototype.
- */
-function Buffer (arg) {
- if (!(this instanceof Buffer)) {
- // Avoid going through an ArgumentsAdaptorTrampoline in the common case.
- if (arguments.length > 1) return new Buffer(arg, arguments[1])
- return new Buffer(arg)
- }
-
- this.length = 0
- this.parent = undefined
-
- // Common case.
- if (typeof arg === 'number') {
- return fromNumber(this, arg)
- }
-
- // Slightly less common case.
- if (typeof arg === 'string') {
- return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')
- }
-
- // Unusual.
- return fromObject(this, arg)
-}
-
-function fromNumber (that, length) {
- that = allocate(that, length < 0 ? 0 : checked(length) | 0)
- if (!Buffer.TYPED_ARRAY_SUPPORT) {
- for (var i = 0; i < length; i++) {
- that[i] = 0
- }
- }
- return that
-}
-
-function fromString (that, string, encoding) {
- if (typeof encoding !== 'string' || encoding === '') encoding = 'utf8'
-
- // Assumption: byteLength() return value is always < kMaxLength.
- var length = byteLength(string, encoding) | 0
- that = allocate(that, length)
-
- that.write(string, encoding)
- return that
-}
-
-function fromObject (that, object) {
- if (Buffer.isBuffer(object)) return fromBuffer(that, object)
-
- if (isArray(object)) return fromArray(that, object)
-
- if (object == null) {
- throw new TypeError('must start with number, buffer, array or string')
- }
-
- if (typeof ArrayBuffer !== 'undefined') {
- if (object.buffer instanceof ArrayBuffer) {
- return fromTypedArray(that, object)
- }
- if (object instanceof ArrayBuffer) {
- return fromArrayBuffer(that, object)
- }
- }
-
- if (object.length) return fromArrayLike(that, object)
-
- return fromJsonObject(that, object)
-}
-
-function fromBuffer (that, buffer) {
- var length = checked(buffer.length) | 0
- that = allocate(that, length)
- buffer.copy(that, 0, 0, length)
- return that
-}
-
-function fromArray (that, array) {
- var length = checked(array.length) | 0
- that = allocate(that, length)
- for (var i = 0; i < length; i += 1) {
- that[i] = array[i] & 255
- }
- return that
-}
-
-// Duplicate of fromArray() to keep fromArray() monomorphic.
-function fromTypedArray (that, array) {
- var length = checked(array.length) | 0
- that = allocate(that, length)
- // Truncating the elements is probably not what people expect from typed
- // arrays with BYTES_PER_ELEMENT > 1 but it's compatible with the behavior
- // of the old Buffer constructor.
- for (var i = 0; i < length; i += 1) {
- that[i] = array[i] & 255
- }
- return that
-}
-
-function fromArrayBuffer (that, array) {
- if (Buffer.TYPED_ARRAY_SUPPORT) {
- // Return an augmented `Uint8Array` instance, for best performance
- array.byteLength
- that = Buffer._augment(new Uint8Array(array))
- } else {
- // Fallback: Return an object instance of the Buffer class
- that = fromTypedArray(that, new Uint8Array(array))
- }
- return that
-}
-
-function fromArrayLike (that, array) {
- var length = checked(array.length) | 0
- that = allocate(that, length)
- for (var i = 0; i < length; i += 1) {
- that[i] = array[i] & 255
- }
- return that
-}
-
-// Deserialize { type: 'Buffer', data: [1,2,3,...] } into a Buffer object.
-// Returns a zero-length buffer for inputs that don't conform to the spec.
-function fromJsonObject (that, object) {
- var array
- var length = 0
-
- if (object.type === 'Buffer' && isArray(object.data)) {
- array = object.data
- length = checked(array.length) | 0
- }
- that = allocate(that, length)
-
- for (var i = 0; i < length; i += 1) {
- that[i] = array[i] & 255
- }
- return that
-}
-
-if (Buffer.TYPED_ARRAY_SUPPORT) {
- Buffer.prototype.__proto__ = Uint8Array.prototype
- Buffer.__proto__ = Uint8Array
-}
-
-function allocate (that, length) {
- if (Buffer.TYPED_ARRAY_SUPPORT) {
- // Return an augmented `Uint8Array` instance, for best performance
- that = Buffer._augment(new Uint8Array(length))
- that.__proto__ = Buffer.prototype
- } else {
- // Fallback: Return an object instance of the Buffer class
- that.length = length
- that._isBuffer = true
- }
-
- var fromPool = length !== 0 && length <= Buffer.poolSize >>> 1
- if (fromPool) that.parent = rootParent
-
- return that
-}
-
-function checked (length) {
- // Note: cannot use `length < kMaxLength` here because that fails when
- // length is NaN (which is otherwise coerced to zero.)
- if (length >= kMaxLength()) {
- throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
- 'size: 0x' + kMaxLength().toString(16) + ' bytes')
- }
- return length | 0
-}
-
-function SlowBuffer (subject, encoding) {
- if (!(this instanceof SlowBuffer)) return new SlowBuffer(subject, encoding)
-
- var buf = new Buffer(subject, encoding)
- delete buf.parent
- return buf
-}
-
-Buffer.isBuffer = function isBuffer (b) {
- return !!(b != null && b._isBuffer)
-}
-
-Buffer.compare = function compare (a, b) {
- if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
- throw new TypeError('Arguments must be Buffers')
- }
-
- if (a === b) return 0
-
- var x = a.length
- var y = b.length
-
- var i = 0
- var len = Math.min(x, y)
- while (i < len) {
- if (a[i] !== b[i]) break
-
- ++i
- }
-
- if (i !== len) {
- x = a[i]
- y = b[i]
- }
-
- if (x < y) return -1
- if (y < x) return 1
- return 0
-}
-
-Buffer.isEncoding = function isEncoding (encoding) {
- switch (String(encoding).toLowerCase()) {
- case 'hex':
- case 'utf8':
- case 'utf-8':
- case 'ascii':
- case 'binary':
- case 'base64':
- case 'raw':
- case 'ucs2':
- case 'ucs-2':
- case 'utf16le':
- case 'utf-16le':
- return true
- default:
- return false
- }
-}
-
-Buffer.concat = function concat (list, length) {
- if (!isArray(list)) throw new TypeError('list argument must be an Array of Buffers.')
-
- if (list.length === 0) {
- return new Buffer(0)
- }
-
- var i
- if (length === undefined) {
- length = 0
- for (i = 0; i < list.length; i++) {
- length += list[i].length
- }
- }
-
- var buf = new Buffer(length)
- var pos = 0
- for (i = 0; i < list.length; i++) {
- var item = list[i]
- item.copy(buf, pos)
- pos += item.length
- }
- return buf
-}
-
-function byteLength (string, encoding) {
- if (typeof string !== 'string') string = '' + string
-
- var len = string.length
- if (len === 0) return 0
-
- // Use a for loop to avoid recursion
- var loweredCase = false
- for (;;) {
- switch (encoding) {
- case 'ascii':
- case 'binary':
- // Deprecated
- case 'raw':
- case 'raws':
- return len
- case 'utf8':
- case 'utf-8':
- return utf8ToBytes(string).length
- case 'ucs2':
- case 'ucs-2':
- case 'utf16le':
- case 'utf-16le':
- return len * 2
- case 'hex':
- return len >>> 1
- case 'base64':
- return base64ToBytes(string).length
- default:
- if (loweredCase) return utf8ToBytes(string).length // assume utf8
- encoding = ('' + encoding).toLowerCase()
- loweredCase = true
- }
- }
-}
-Buffer.byteLength = byteLength
-
-// pre-set for values that may exist in the future
-Buffer.prototype.length = undefined
-Buffer.prototype.parent = undefined
-
-function slowToString (encoding, start, end) {
- var loweredCase = false
-
- start = start | 0
- end = end === undefined || end === Infinity ? this.length : end | 0
-
- if (!encoding) encoding = 'utf8'
- if (start < 0) start = 0
- if (end > this.length) end = this.length
- if (end <= start) return ''
-
- while (true) {
- switch (encoding) {
- case 'hex':
- return hexSlice(this, start, end)
-
- case 'utf8':
- case 'utf-8':
- return utf8Slice(this, start, end)
-
- case 'ascii':
- return asciiSlice(this, start, end)
-
- case 'binary':
- return binarySlice(this, start, end)
-
- case 'base64':
- return base64Slice(this, start, end)
-
- case 'ucs2':
- case 'ucs-2':
- case 'utf16le':
- case 'utf-16le':
- return utf16leSlice(this, start, end)
-
- default:
- if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
- encoding = (encoding + '').toLowerCase()
- loweredCase = true
- }
- }
-}
-
-Buffer.prototype.toString = function toString () {
- var length = this.length | 0
- if (length === 0) return ''
- if (arguments.length === 0) return utf8Slice(this, 0, length)
- return slowToString.apply(this, arguments)
-}
-
-Buffer.prototype.equals = function equals (b) {
- if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
- if (this === b) return true
- return Buffer.compare(this, b) === 0
-}
-
-Buffer.prototype.inspect = function inspect () {
- var str = ''
- var max = exports.INSPECT_MAX_BYTES
- if (this.length > 0) {
- str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')
- if (this.length > max) str += ' ... '
- }
- return ''
-}
-
-Buffer.prototype.compare = function compare (b) {
- if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
- if (this === b) return 0
- return Buffer.compare(this, b)
-}
-
-Buffer.prototype.indexOf = function indexOf (val, byteOffset) {
- if (byteOffset > 0x7fffffff) byteOffset = 0x7fffffff
- else if (byteOffset < -0x80000000) byteOffset = -0x80000000
- byteOffset >>= 0
-
- if (this.length === 0) return -1
- if (byteOffset >= this.length) return -1
-
- // Negative offsets start from the end of the buffer
- if (byteOffset < 0) byteOffset = Math.max(this.length + byteOffset, 0)
-
- if (typeof val === 'string') {
- if (val.length === 0) return -1 // special case: looking for empty string always fails
- return String.prototype.indexOf.call(this, val, byteOffset)
- }
- if (Buffer.isBuffer(val)) {
- return arrayIndexOf(this, val, byteOffset)
- }
- if (typeof val === 'number') {
- if (Buffer.TYPED_ARRAY_SUPPORT && Uint8Array.prototype.indexOf === 'function') {
- return Uint8Array.prototype.indexOf.call(this, val, byteOffset)
- }
- return arrayIndexOf(this, [ val ], byteOffset)
- }
-
- function arrayIndexOf (arr, val, byteOffset) {
- var foundIndex = -1
- for (var i = 0; byteOffset + i < arr.length; i++) {
- if (arr[byteOffset + i] === val[foundIndex === -1 ? 0 : i - foundIndex]) {
- if (foundIndex === -1) foundIndex = i
- if (i - foundIndex + 1 === val.length) return byteOffset + foundIndex
- } else {
- foundIndex = -1
- }
- }
- return -1
- }
-
- throw new TypeError('val must be string, number or Buffer')
-}
-
-// `get` is deprecated
-Buffer.prototype.get = function get (offset) {
- console.log('.get() is deprecated. Access using array indexes instead.')
- return this.readUInt8(offset)
-}
-
-// `set` is deprecated
-Buffer.prototype.set = function set (v, offset) {
- console.log('.set() is deprecated. Access using array indexes instead.')
- return this.writeUInt8(v, offset)
-}
-
-function hexWrite (buf, string, offset, length) {
- offset = Number(offset) || 0
- var remaining = buf.length - offset
- if (!length) {
- length = remaining
- } else {
- length = Number(length)
- if (length > remaining) {
- length = remaining
- }
- }
-
- // must be an even number of digits
- var strLen = string.length
- if (strLen % 2 !== 0) throw new Error('Invalid hex string')
-
- if (length > strLen / 2) {
- length = strLen / 2
- }
- for (var i = 0; i < length; i++) {
- var parsed = parseInt(string.substr(i * 2, 2), 16)
- if (isNaN(parsed)) throw new Error('Invalid hex string')
- buf[offset + i] = parsed
- }
- return i
-}
-
-function utf8Write (buf, string, offset, length) {
- return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
-}
-
-function asciiWrite (buf, string, offset, length) {
- return blitBuffer(asciiToBytes(string), buf, offset, length)
-}
-
-function binaryWrite (buf, string, offset, length) {
- return asciiWrite(buf, string, offset, length)
-}
-
-function base64Write (buf, string, offset, length) {
- return blitBuffer(base64ToBytes(string), buf, offset, length)
-}
-
-function ucs2Write (buf, string, offset, length) {
- return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
-}
-
-Buffer.prototype.write = function write (string, offset, length, encoding) {
- // Buffer#write(string)
- if (offset === undefined) {
- encoding = 'utf8'
- length = this.length
- offset = 0
- // Buffer#write(string, encoding)
- } else if (length === undefined && typeof offset === 'string') {
- encoding = offset
- length = this.length
- offset = 0
- // Buffer#write(string, offset[, length][, encoding])
- } else if (isFinite(offset)) {
- offset = offset | 0
- if (isFinite(length)) {
- length = length | 0
- if (encoding === undefined) encoding = 'utf8'
- } else {
- encoding = length
- length = undefined
- }
- // legacy write(string, encoding, offset, length) - remove in v0.13
- } else {
- var swap = encoding
- encoding = offset
- offset = length | 0
- length = swap
- }
-
- var remaining = this.length - offset
- if (length === undefined || length > remaining) length = remaining
-
- if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
- throw new RangeError('attempt to write outside buffer bounds')
- }
-
- if (!encoding) encoding = 'utf8'
-
- var loweredCase = false
- for (;;) {
- switch (encoding) {
- case 'hex':
- return hexWrite(this, string, offset, length)
-
- case 'utf8':
- case 'utf-8':
- return utf8Write(this, string, offset, length)
-
- case 'ascii':
- return asciiWrite(this, string, offset, length)
-
- case 'binary':
- return binaryWrite(this, string, offset, length)
-
- case 'base64':
- // Warning: maxLength not taken into account in base64Write
- return base64Write(this, string, offset, length)
-
- case 'ucs2':
- case 'ucs-2':
- case 'utf16le':
- case 'utf-16le':
- return ucs2Write(this, string, offset, length)
-
- default:
- if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
- encoding = ('' + encoding).toLowerCase()
- loweredCase = true
- }
- }
-}
-
-Buffer.prototype.toJSON = function toJSON () {
- return {
- type: 'Buffer',
- data: Array.prototype.slice.call(this._arr || this, 0)
- }
-}
-
-function base64Slice (buf, start, end) {
- if (start === 0 && end === buf.length) {
- return base64.fromByteArray(buf)
- } else {
- return base64.fromByteArray(buf.slice(start, end))
- }
-}
-
-function utf8Slice (buf, start, end) {
- end = Math.min(buf.length, end)
- var res = []
-
- var i = start
- while (i < end) {
- var firstByte = buf[i]
- var codePoint = null
- var bytesPerSequence = (firstByte > 0xEF) ? 4
- : (firstByte > 0xDF) ? 3
- : (firstByte > 0xBF) ? 2
- : 1
-
- if (i + bytesPerSequence <= end) {
- var secondByte, thirdByte, fourthByte, tempCodePoint
-
- switch (bytesPerSequence) {
- case 1:
- if (firstByte < 0x80) {
- codePoint = firstByte
- }
- break
- case 2:
- secondByte = buf[i + 1]
- if ((secondByte & 0xC0) === 0x80) {
- tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
- if (tempCodePoint > 0x7F) {
- codePoint = tempCodePoint
- }
- }
- break
- case 3:
- secondByte = buf[i + 1]
- thirdByte = buf[i + 2]
- if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
- tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
- if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
- codePoint = tempCodePoint
- }
- }
- break
- case 4:
- secondByte = buf[i + 1]
- thirdByte = buf[i + 2]
- fourthByte = buf[i + 3]
- if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
- tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
- if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
- codePoint = tempCodePoint
- }
- }
- }
- }
-
- if (codePoint === null) {
- // we did not generate a valid codePoint so insert a
- // replacement char (U+FFFD) and advance only 1 byte
- codePoint = 0xFFFD
- bytesPerSequence = 1
- } else if (codePoint > 0xFFFF) {
- // encode to utf16 (surrogate pair dance)
- codePoint -= 0x10000
- res.push(codePoint >>> 10 & 0x3FF | 0xD800)
- codePoint = 0xDC00 | codePoint & 0x3FF
- }
-
- res.push(codePoint)
- i += bytesPerSequence
- }
-
- return decodeCodePointsArray(res)
-}
-
-// Based on http://stackoverflow.com/a/22747272/680742, the browser with
-// the lowest limit is Chrome, with 0x10000 args.
-// We go 1 magnitude less, for safety
-var MAX_ARGUMENTS_LENGTH = 0x1000
-
-function decodeCodePointsArray (codePoints) {
- var len = codePoints.length
- if (len <= MAX_ARGUMENTS_LENGTH) {
- return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
- }
-
- // Decode in chunks to avoid "call stack size exceeded".
- var res = ''
- var i = 0
- while (i < len) {
- res += String.fromCharCode.apply(
- String,
- codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
- )
- }
- return res
-}
-
-function asciiSlice (buf, start, end) {
- var ret = ''
- end = Math.min(buf.length, end)
-
- for (var i = start; i < end; i++) {
- ret += String.fromCharCode(buf[i] & 0x7F)
- }
- return ret
-}
-
-function binarySlice (buf, start, end) {
- var ret = ''
- end = Math.min(buf.length, end)
-
- for (var i = start; i < end; i++) {
- ret += String.fromCharCode(buf[i])
- }
- return ret
-}
-
-function hexSlice (buf, start, end) {
- var len = buf.length
-
- if (!start || start < 0) start = 0
- if (!end || end < 0 || end > len) end = len
-
- var out = ''
- for (var i = start; i < end; i++) {
- out += toHex(buf[i])
- }
- return out
-}
-
-function utf16leSlice (buf, start, end) {
- var bytes = buf.slice(start, end)
- var res = ''
- for (var i = 0; i < bytes.length; i += 2) {
- res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)
- }
- return res
-}
-
-Buffer.prototype.slice = function slice (start, end) {
- var len = this.length
- start = ~~start
- end = end === undefined ? len : ~~end
-
- if (start < 0) {
- start += len
- if (start < 0) start = 0
- } else if (start > len) {
- start = len
- }
-
- if (end < 0) {
- end += len
- if (end < 0) end = 0
- } else if (end > len) {
- end = len
- }
-
- if (end < start) end = start
-
- var newBuf
- if (Buffer.TYPED_ARRAY_SUPPORT) {
- newBuf = Buffer._augment(this.subarray(start, end))
- } else {
- var sliceLen = end - start
- newBuf = new Buffer(sliceLen, undefined)
- for (var i = 0; i < sliceLen; i++) {
- newBuf[i] = this[i + start]
- }
- }
-
- if (newBuf.length) newBuf.parent = this.parent || this
-
- return newBuf
-}
-
-/*
- * Need to make sure that buffer isn't trying to write out of bounds.
- */
-function checkOffset (offset, ext, length) {
- if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
- if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
-}
-
-Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
- offset = offset | 0
- byteLength = byteLength | 0
- if (!noAssert) checkOffset(offset, byteLength, this.length)
-
- var val = this[offset]
- var mul = 1
- var i = 0
- while (++i < byteLength && (mul *= 0x100)) {
- val += this[offset + i] * mul
- }
-
- return val
-}
-
-Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
- offset = offset | 0
- byteLength = byteLength | 0
- if (!noAssert) {
- checkOffset(offset, byteLength, this.length)
- }
-
- var val = this[offset + --byteLength]
- var mul = 1
- while (byteLength > 0 && (mul *= 0x100)) {
- val += this[offset + --byteLength] * mul
- }
-
- return val
-}
-
-Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 1, this.length)
- return this[offset]
-}
-
-Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 2, this.length)
- return this[offset] | (this[offset + 1] << 8)
-}
-
-Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 2, this.length)
- return (this[offset] << 8) | this[offset + 1]
-}
-
-Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 4, this.length)
-
- return ((this[offset]) |
- (this[offset + 1] << 8) |
- (this[offset + 2] << 16)) +
- (this[offset + 3] * 0x1000000)
-}
-
-Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 4, this.length)
-
- return (this[offset] * 0x1000000) +
- ((this[offset + 1] << 16) |
- (this[offset + 2] << 8) |
- this[offset + 3])
-}
-
-Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
- offset = offset | 0
- byteLength = byteLength | 0
- if (!noAssert) checkOffset(offset, byteLength, this.length)
-
- var val = this[offset]
- var mul = 1
- var i = 0
- while (++i < byteLength && (mul *= 0x100)) {
- val += this[offset + i] * mul
- }
- mul *= 0x80
-
- if (val >= mul) val -= Math.pow(2, 8 * byteLength)
-
- return val
-}
-
-Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
- offset = offset | 0
- byteLength = byteLength | 0
- if (!noAssert) checkOffset(offset, byteLength, this.length)
-
- var i = byteLength
- var mul = 1
- var val = this[offset + --i]
- while (i > 0 && (mul *= 0x100)) {
- val += this[offset + --i] * mul
- }
- mul *= 0x80
-
- if (val >= mul) val -= Math.pow(2, 8 * byteLength)
-
- return val
-}
-
-Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 1, this.length)
- if (!(this[offset] & 0x80)) return (this[offset])
- return ((0xff - this[offset] + 1) * -1)
-}
-
-Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 2, this.length)
- var val = this[offset] | (this[offset + 1] << 8)
- return (val & 0x8000) ? val | 0xFFFF0000 : val
-}
-
-Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 2, this.length)
- var val = this[offset + 1] | (this[offset] << 8)
- return (val & 0x8000) ? val | 0xFFFF0000 : val
-}
-
-Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 4, this.length)
-
- return (this[offset]) |
- (this[offset + 1] << 8) |
- (this[offset + 2] << 16) |
- (this[offset + 3] << 24)
-}
-
-Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 4, this.length)
-
- return (this[offset] << 24) |
- (this[offset + 1] << 16) |
- (this[offset + 2] << 8) |
- (this[offset + 3])
-}
-
-Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 4, this.length)
- return ieee754.read(this, offset, true, 23, 4)
-}
-
-Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 4, this.length)
- return ieee754.read(this, offset, false, 23, 4)
-}
-
-Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 8, this.length)
- return ieee754.read(this, offset, true, 52, 8)
-}
-
-Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 8, this.length)
- return ieee754.read(this, offset, false, 52, 8)
-}
-
-function checkInt (buf, value, offset, ext, max, min) {
- if (!Buffer.isBuffer(buf)) throw new TypeError('buffer must be a Buffer instance')
- if (value > max || value < min) throw new RangeError('value is out of bounds')
- if (offset + ext > buf.length) throw new RangeError('index out of range')
-}
-
-Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
- value = +value
- offset = offset | 0
- byteLength = byteLength | 0
- if (!noAssert) checkInt(this, value, offset, byteLength, Math.pow(2, 8 * byteLength), 0)
-
- var mul = 1
- var i = 0
- this[offset] = value & 0xFF
- while (++i < byteLength && (mul *= 0x100)) {
- this[offset + i] = (value / mul) & 0xFF
- }
-
- return offset + byteLength
-}
-
-Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
- value = +value
- offset = offset | 0
- byteLength = byteLength | 0
- if (!noAssert) checkInt(this, value, offset, byteLength, Math.pow(2, 8 * byteLength), 0)
-
- var i = byteLength - 1
- var mul = 1
- this[offset + i] = value & 0xFF
- while (--i >= 0 && (mul *= 0x100)) {
- this[offset + i] = (value / mul) & 0xFF
- }
-
- return offset + byteLength
-}
-
-Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
- value = +value
- offset = offset | 0
- if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
- if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
- this[offset] = (value & 0xff)
- return offset + 1
-}
-
-function objectWriteUInt16 (buf, value, offset, littleEndian) {
- if (value < 0) value = 0xffff + value + 1
- for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; i++) {
- buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>
- (littleEndian ? i : 1 - i) * 8
- }
-}
-
-Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
- value = +value
- offset = offset | 0
- if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
- if (Buffer.TYPED_ARRAY_SUPPORT) {
- this[offset] = (value & 0xff)
- this[offset + 1] = (value >>> 8)
- } else {
- objectWriteUInt16(this, value, offset, true)
- }
- return offset + 2
-}
-
-Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
- value = +value
- offset = offset | 0
- if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
- if (Buffer.TYPED_ARRAY_SUPPORT) {
- this[offset] = (value >>> 8)
- this[offset + 1] = (value & 0xff)
- } else {
- objectWriteUInt16(this, value, offset, false)
- }
- return offset + 2
-}
-
-function objectWriteUInt32 (buf, value, offset, littleEndian) {
- if (value < 0) value = 0xffffffff + value + 1
- for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; i++) {
- buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff
- }
-}
-
-Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
- value = +value
- offset = offset | 0
- if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
- if (Buffer.TYPED_ARRAY_SUPPORT) {
- this[offset + 3] = (value >>> 24)
- this[offset + 2] = (value >>> 16)
- this[offset + 1] = (value >>> 8)
- this[offset] = (value & 0xff)
- } else {
- objectWriteUInt32(this, value, offset, true)
- }
- return offset + 4
-}
-
-Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
- value = +value
- offset = offset | 0
- if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
- if (Buffer.TYPED_ARRAY_SUPPORT) {
- this[offset] = (value >>> 24)
- this[offset + 1] = (value >>> 16)
- this[offset + 2] = (value >>> 8)
- this[offset + 3] = (value & 0xff)
- } else {
- objectWriteUInt32(this, value, offset, false)
- }
- return offset + 4
-}
-
-Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
- value = +value
- offset = offset | 0
- if (!noAssert) {
- var limit = Math.pow(2, 8 * byteLength - 1)
-
- checkInt(this, value, offset, byteLength, limit - 1, -limit)
- }
-
- var i = 0
- var mul = 1
- var sub = value < 0 ? 1 : 0
- this[offset] = value & 0xFF
- while (++i < byteLength && (mul *= 0x100)) {
- this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
- }
-
- return offset + byteLength
-}
-
-Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
- value = +value
- offset = offset | 0
- if (!noAssert) {
- var limit = Math.pow(2, 8 * byteLength - 1)
-
- checkInt(this, value, offset, byteLength, limit - 1, -limit)
- }
-
- var i = byteLength - 1
- var mul = 1
- var sub = value < 0 ? 1 : 0
- this[offset + i] = value & 0xFF
- while (--i >= 0 && (mul *= 0x100)) {
- this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
- }
-
- return offset + byteLength
-}
-
-Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
- value = +value
- offset = offset | 0
- if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
- if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
- if (value < 0) value = 0xff + value + 1
- this[offset] = (value & 0xff)
- return offset + 1
-}
-
-Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
- value = +value
- offset = offset | 0
- if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
- if (Buffer.TYPED_ARRAY_SUPPORT) {
- this[offset] = (value & 0xff)
- this[offset + 1] = (value >>> 8)
- } else {
- objectWriteUInt16(this, value, offset, true)
- }
- return offset + 2
-}
-
-Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
- value = +value
- offset = offset | 0
- if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
- if (Buffer.TYPED_ARRAY_SUPPORT) {
- this[offset] = (value >>> 8)
- this[offset + 1] = (value & 0xff)
- } else {
- objectWriteUInt16(this, value, offset, false)
- }
- return offset + 2
-}
-
-Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
- value = +value
- offset = offset | 0
- if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
- if (Buffer.TYPED_ARRAY_SUPPORT) {
- this[offset] = (value & 0xff)
- this[offset + 1] = (value >>> 8)
- this[offset + 2] = (value >>> 16)
- this[offset + 3] = (value >>> 24)
- } else {
- objectWriteUInt32(this, value, offset, true)
- }
- return offset + 4
-}
-
-Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
- value = +value
- offset = offset | 0
- if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
- if (value < 0) value = 0xffffffff + value + 1
- if (Buffer.TYPED_ARRAY_SUPPORT) {
- this[offset] = (value >>> 24)
- this[offset + 1] = (value >>> 16)
- this[offset + 2] = (value >>> 8)
- this[offset + 3] = (value & 0xff)
- } else {
- objectWriteUInt32(this, value, offset, false)
- }
- return offset + 4
-}
-
-function checkIEEE754 (buf, value, offset, ext, max, min) {
- if (value > max || value < min) throw new RangeError('value is out of bounds')
- if (offset + ext > buf.length) throw new RangeError('index out of range')
- if (offset < 0) throw new RangeError('index out of range')
-}
-
-function writeFloat (buf, value, offset, littleEndian, noAssert) {
- if (!noAssert) {
- checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
- }
- ieee754.write(buf, value, offset, littleEndian, 23, 4)
- return offset + 4
-}
-
-Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
- return writeFloat(this, value, offset, true, noAssert)
-}
-
-Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
- return writeFloat(this, value, offset, false, noAssert)
-}
-
-function writeDouble (buf, value, offset, littleEndian, noAssert) {
- if (!noAssert) {
- checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
- }
- ieee754.write(buf, value, offset, littleEndian, 52, 8)
- return offset + 8
-}
-
-Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
- return writeDouble(this, value, offset, true, noAssert)
-}
-
-Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
- return writeDouble(this, value, offset, false, noAssert)
-}
-
-// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
-Buffer.prototype.copy = function copy (target, targetStart, start, end) {
- if (!start) start = 0
- if (!end && end !== 0) end = this.length
- if (targetStart >= target.length) targetStart = target.length
- if (!targetStart) targetStart = 0
- if (end > 0 && end < start) end = start
-
- // Copy 0 bytes; we're done
- if (end === start) return 0
- if (target.length === 0 || this.length === 0) return 0
-
- // Fatal error conditions
- if (targetStart < 0) {
- throw new RangeError('targetStart out of bounds')
- }
- if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')
- if (end < 0) throw new RangeError('sourceEnd out of bounds')
-
- // Are we oob?
- if (end > this.length) end = this.length
- if (target.length - targetStart < end - start) {
- end = target.length - targetStart + start
- }
-
- var len = end - start
- var i
-
- if (this === target && start < targetStart && targetStart < end) {
- // descending copy from end
- for (i = len - 1; i >= 0; i--) {
- target[i + targetStart] = this[i + start]
- }
- } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
- // ascending copy from start
- for (i = 0; i < len; i++) {
- target[i + targetStart] = this[i + start]
- }
- } else {
- target._set(this.subarray(start, start + len), targetStart)
- }
-
- return len
-}
-
-// fill(value, start=0, end=buffer.length)
-Buffer.prototype.fill = function fill (value, start, end) {
- if (!value) value = 0
- if (!start) start = 0
- if (!end) end = this.length
-
- if (end < start) throw new RangeError('end < start')
-
- // Fill 0 bytes; we're done
- if (end === start) return
- if (this.length === 0) return
-
- if (start < 0 || start >= this.length) throw new RangeError('start out of bounds')
- if (end < 0 || end > this.length) throw new RangeError('end out of bounds')
-
- var i
- if (typeof value === 'number') {
- for (i = start; i < end; i++) {
- this[i] = value
- }
- } else {
- var bytes = utf8ToBytes(value.toString())
- var len = bytes.length
- for (i = start; i < end; i++) {
- this[i] = bytes[i % len]
- }
- }
-
- return this
-}
-
-/**
- * Creates a new `ArrayBuffer` with the *copied* memory of the buffer instance.
- * Added in Node 0.12. Only available in browsers that support ArrayBuffer.
- */
-Buffer.prototype.toArrayBuffer = function toArrayBuffer () {
- if (typeof Uint8Array !== 'undefined') {
- if (Buffer.TYPED_ARRAY_SUPPORT) {
- return (new Buffer(this)).buffer
- } else {
- var buf = new Uint8Array(this.length)
- for (var i = 0, len = buf.length; i < len; i += 1) {
- buf[i] = this[i]
- }
- return buf.buffer
- }
- } else {
- throw new TypeError('Buffer.toArrayBuffer not supported in this browser')
- }
-}
-
-// HELPER FUNCTIONS
-// ================
-
-var BP = Buffer.prototype
-
-/**
- * Augment a Uint8Array *instance* (not the Uint8Array class!) with Buffer methods
- */
-Buffer._augment = function _augment (arr) {
- arr.constructor = Buffer
- arr._isBuffer = true
-
- // save reference to original Uint8Array set method before overwriting
- arr._set = arr.set
-
- // deprecated
- arr.get = BP.get
- arr.set = BP.set
-
- arr.write = BP.write
- arr.toString = BP.toString
- arr.toLocaleString = BP.toString
- arr.toJSON = BP.toJSON
- arr.equals = BP.equals
- arr.compare = BP.compare
- arr.indexOf = BP.indexOf
- arr.copy = BP.copy
- arr.slice = BP.slice
- arr.readUIntLE = BP.readUIntLE
- arr.readUIntBE = BP.readUIntBE
- arr.readUInt8 = BP.readUInt8
- arr.readUInt16LE = BP.readUInt16LE
- arr.readUInt16BE = BP.readUInt16BE
- arr.readUInt32LE = BP.readUInt32LE
- arr.readUInt32BE = BP.readUInt32BE
- arr.readIntLE = BP.readIntLE
- arr.readIntBE = BP.readIntBE
- arr.readInt8 = BP.readInt8
- arr.readInt16LE = BP.readInt16LE
- arr.readInt16BE = BP.readInt16BE
- arr.readInt32LE = BP.readInt32LE
- arr.readInt32BE = BP.readInt32BE
- arr.readFloatLE = BP.readFloatLE
- arr.readFloatBE = BP.readFloatBE
- arr.readDoubleLE = BP.readDoubleLE
- arr.readDoubleBE = BP.readDoubleBE
- arr.writeUInt8 = BP.writeUInt8
- arr.writeUIntLE = BP.writeUIntLE
- arr.writeUIntBE = BP.writeUIntBE
- arr.writeUInt16LE = BP.writeUInt16LE
- arr.writeUInt16BE = BP.writeUInt16BE
- arr.writeUInt32LE = BP.writeUInt32LE
- arr.writeUInt32BE = BP.writeUInt32BE
- arr.writeIntLE = BP.writeIntLE
- arr.writeIntBE = BP.writeIntBE
- arr.writeInt8 = BP.writeInt8
- arr.writeInt16LE = BP.writeInt16LE
- arr.writeInt16BE = BP.writeInt16BE
- arr.writeInt32LE = BP.writeInt32LE
- arr.writeInt32BE = BP.writeInt32BE
- arr.writeFloatLE = BP.writeFloatLE
- arr.writeFloatBE = BP.writeFloatBE
- arr.writeDoubleLE = BP.writeDoubleLE
- arr.writeDoubleBE = BP.writeDoubleBE
- arr.fill = BP.fill
- arr.inspect = BP.inspect
- arr.toArrayBuffer = BP.toArrayBuffer
-
- return arr
-}
-
-var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g
-
-function base64clean (str) {
- // Node strips out invalid characters like \n and \t from the string, base64-js does not
- str = stringtrim(str).replace(INVALID_BASE64_RE, '')
- // Node converts strings with length < 2 to ''
- if (str.length < 2) return ''
- // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
- while (str.length % 4 !== 0) {
- str = str + '='
- }
- return str
-}
-
-function stringtrim (str) {
- if (str.trim) return str.trim()
- return str.replace(/^\s+|\s+$/g, '')
-}
-
-function toHex (n) {
- if (n < 16) return '0' + n.toString(16)
- return n.toString(16)
-}
-
-function utf8ToBytes (string, units) {
- units = units || Infinity
- var codePoint
- var length = string.length
- var leadSurrogate = null
- var bytes = []
-
- for (var i = 0; i < length; i++) {
- codePoint = string.charCodeAt(i)
-
- // is surrogate component
- if (codePoint > 0xD7FF && codePoint < 0xE000) {
- // last char was a lead
- if (!leadSurrogate) {
- // no lead yet
- if (codePoint > 0xDBFF) {
- // unexpected trail
- if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
- continue
- } else if (i + 1 === length) {
- // unpaired lead
- if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
- continue
- }
-
- // valid lead
- leadSurrogate = codePoint
-
- continue
- }
-
- // 2 leads in a row
- if (codePoint < 0xDC00) {
- if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
- leadSurrogate = codePoint
- continue
- }
-
- // valid surrogate pair
- codePoint = leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00 | 0x10000
- } else if (leadSurrogate) {
- // valid bmp char, but last char was a lead
- if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
- }
-
- leadSurrogate = null
-
- // encode utf8
- if (codePoint < 0x80) {
- if ((units -= 1) < 0) break
- bytes.push(codePoint)
- } else if (codePoint < 0x800) {
- if ((units -= 2) < 0) break
- bytes.push(
- codePoint >> 0x6 | 0xC0,
- codePoint & 0x3F | 0x80
- )
- } else if (codePoint < 0x10000) {
- if ((units -= 3) < 0) break
- bytes.push(
- codePoint >> 0xC | 0xE0,
- codePoint >> 0x6 & 0x3F | 0x80,
- codePoint & 0x3F | 0x80
- )
- } else if (codePoint < 0x110000) {
- if ((units -= 4) < 0) break
- bytes.push(
- codePoint >> 0x12 | 0xF0,
- codePoint >> 0xC & 0x3F | 0x80,
- codePoint >> 0x6 & 0x3F | 0x80,
- codePoint & 0x3F | 0x80
- )
- } else {
- throw new Error('Invalid code point')
- }
- }
-
- return bytes
-}
-
-function asciiToBytes (str) {
- var byteArray = []
- for (var i = 0; i < str.length; i++) {
- // Node's code seems to be doing this and not & 0x7F..
- byteArray.push(str.charCodeAt(i) & 0xFF)
- }
- return byteArray
-}
-
-function utf16leToBytes (str, units) {
- var c, hi, lo
- var byteArray = []
- for (var i = 0; i < str.length; i++) {
- if ((units -= 2) < 0) break
-
- c = str.charCodeAt(i)
- hi = c >> 8
- lo = c % 256
- byteArray.push(lo)
- byteArray.push(hi)
- }
-
- return byteArray
-}
-
-function base64ToBytes (str) {
- return base64.toByteArray(base64clean(str))
-}
-
-function blitBuffer (src, dst, offset, length) {
- for (var i = 0; i < length; i++) {
- if ((i + offset >= dst.length) || (i >= src.length)) break
- dst[i + offset] = src[i]
- }
- return i
-}
-
-}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
-},{"base64-js":2,"ieee754":4,"is-array":5}],4:[function(require,module,exports){
-exports.read = function (buffer, offset, isLE, mLen, nBytes) {
- var e, m
- var eLen = nBytes * 8 - mLen - 1
- var eMax = (1 << eLen) - 1
- var eBias = eMax >> 1
- var nBits = -7
- var i = isLE ? (nBytes - 1) : 0
- var d = isLE ? -1 : 1
- var s = buffer[offset + i]
-
- i += d
-
- e = s & ((1 << (-nBits)) - 1)
- s >>= (-nBits)
- nBits += eLen
- for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}
-
- m = e & ((1 << (-nBits)) - 1)
- e >>= (-nBits)
- nBits += mLen
- for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}
-
- if (e === 0) {
- e = 1 - eBias
- } else if (e === eMax) {
- return m ? NaN : ((s ? -1 : 1) * Infinity)
- } else {
- m = m + Math.pow(2, mLen)
- e = e - eBias
- }
- return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
-}
-
-exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
- var e, m, c
- var eLen = nBytes * 8 - mLen - 1
- var eMax = (1 << eLen) - 1
- var eBias = eMax >> 1
- var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
- var i = isLE ? 0 : (nBytes - 1)
- var d = isLE ? 1 : -1
- var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
-
- value = Math.abs(value)
-
- if (isNaN(value) || value === Infinity) {
- m = isNaN(value) ? 1 : 0
- e = eMax
- } else {
- e = Math.floor(Math.log(value) / Math.LN2)
- if (value * (c = Math.pow(2, -e)) < 1) {
- e--
- c *= 2
- }
- if (e + eBias >= 1) {
- value += rt / c
- } else {
- value += rt * Math.pow(2, 1 - eBias)
- }
- if (value * c >= 2) {
- e++
- c /= 2
- }
-
- if (e + eBias >= eMax) {
- m = 0
- e = eMax
- } else if (e + eBias >= 1) {
- m = (value * c - 1) * Math.pow(2, mLen)
- e = e + eBias
- } else {
- m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
- e = 0
- }
- }
-
- for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
-
- e = (e << mLen) | m
- eLen += mLen
- for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
-
- buffer[offset + i - d] |= s * 128
-}
-
-},{}],5:[function(require,module,exports){
-
-/**
- * isArray
- */
-
-var isArray = Array.isArray;
-
-/**
- * toString
- */
-
-var str = Object.prototype.toString;
-
-/**
- * Whether or not the given `val`
- * is an array.
- *
- * example:
- *
- * isArray([]);
- * // > true
- * isArray(arguments);
- * // > false
- * isArray('');
- * // > false
- *
- * @param {mixed} val
- * @return {bool}
- */
-
-module.exports = isArray || function (val) {
- return !! val && '[object Array]' == str.call(val);
-};
-
-},{}],6:[function(require,module,exports){
-(function (global){
-
-/**
- * Module exports.
- */
-
-module.exports = deprecate;
-
-/**
- * Mark that a method should not be used.
- * Returns a modified function which warns once by default.
- *
- * If `localStorage.noDeprecation = true` is set, then it is a no-op.
- *
- * If `localStorage.throwDeprecation = true` is set, then deprecated functions
- * will throw an Error when invoked.
- *
- * If `localStorage.traceDeprecation = true` is set, then deprecated functions
- * will invoke `console.trace()` instead of `console.error()`.
- *
- * @param {Function} fn - the function to deprecate
- * @param {String} msg - the string to print to the console when `fn` is invoked
- * @returns {Function} a new "deprecated" version of `fn`
- * @api public
- */
-
-function deprecate (fn, msg) {
- if (config('noDeprecation')) {
- return fn;
- }
-
- var warned = false;
- function deprecated() {
- if (!warned) {
- if (config('throwDeprecation')) {
- throw new Error(msg);
- } else if (config('traceDeprecation')) {
- console.trace(msg);
- } else {
- console.warn(msg);
- }
- warned = true;
- }
- return fn.apply(this, arguments);
- }
-
- return deprecated;
-}
-
-/**
- * Checks `localStorage` for boolean values for the given `name`.
- *
- * @param {String} name
- * @returns {Boolean}
- * @api private
- */
-
-function config (name) {
- // accessing global.localStorage can trigger a DOMException in sandboxed iframes
- try {
- if (!global.localStorage) return false;
- } catch (_) {
- return false;
- }
- var val = global.localStorage[name];
- if (null == val) return false;
- return String(val).toLowerCase() === 'true';
-}
-
-}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
-},{}],7:[function(require,module,exports){
-function DOMParser(options){
- this.options = options ||{locator:{}};
-
-}
-DOMParser.prototype.parseFromString = function(source,mimeType){
- var options = this.options;
- var sax = new XMLReader();
- var domBuilder = options.domBuilder || new DOMHandler();//contentHandler and LexicalHandler
- var errorHandler = options.errorHandler;
- var locator = options.locator;
- var defaultNSMap = options.xmlns||{};
- var entityMap = {'lt':'<','gt':'>','amp':'&','quot':'"','apos':"'"}
- if(locator){
- domBuilder.setDocumentLocator(locator)
- }
-
- sax.errorHandler = buildErrorHandler(errorHandler,domBuilder,locator);
- sax.domBuilder = options.domBuilder || domBuilder;
- if(/\/x?html?$/.test(mimeType)){
- entityMap.nbsp = '\xa0';
- entityMap.copy = '\xa9';
- defaultNSMap['']= 'http://www.w3.org/1999/xhtml';
- }
- if(source){
- sax.parse(source,defaultNSMap,entityMap);
- }else{
- sax.errorHandler.error("invalid document source");
- }
- return domBuilder.document;
-}
-function buildErrorHandler(errorImpl,domBuilder,locator){
- if(!errorImpl){
- if(domBuilder instanceof DOMHandler){
- return domBuilder;
- }
- errorImpl = domBuilder ;
- }
- var errorHandler = {}
- var isCallback = errorImpl instanceof Function;
- locator = locator||{}
- function build(key){
- var fn = errorImpl[key];
- if(!fn){
- if(isCallback){
- fn = errorImpl.length == 2?function(msg){errorImpl(key,msg)}:errorImpl;
- }else{
- var i=arguments.length;
- while(--i){
- if(fn = errorImpl[arguments[i]]){
- break;
- }
- }
- }
- }
- errorHandler[key] = fn && function(msg){
- fn(msg+_locator(locator));
- }||function(){};
- }
- build('warning','warn');
- build('error','warn','warning');
- build('fatalError','warn','warning','error');
- return errorHandler;
-}
-/**
- * +ContentHandler+ErrorHandler
- * +LexicalHandler+EntityResolver2
- * -DeclHandler-DTDHandler
- *
- * DefaultHandler:EntityResolver, DTDHandler, ContentHandler, ErrorHandler
- * DefaultHandler2:DefaultHandler,LexicalHandler, DeclHandler, EntityResolver2
- * @link http://www.saxproject.org/apidoc/org/xml/sax/helpers/DefaultHandler.html
- */
-function DOMHandler() {
- this.cdata = false;
-}
-function position(locator,node){
- node.lineNumber = locator.lineNumber;
- node.columnNumber = locator.columnNumber;
-}
-/**
- * @see org.xml.sax.ContentHandler#startDocument
- * @link http://www.saxproject.org/apidoc/org/xml/sax/ContentHandler.html
- */
-DOMHandler.prototype = {
- startDocument : function() {
- this.document = new DOMImplementation().createDocument(null, null, null);
- if (this.locator) {
- this.document.documentURI = this.locator.systemId;
- }
- },
- startElement:function(namespaceURI, localName, qName, attrs) {
- var doc = this.document;
- var el = doc.createElementNS(namespaceURI, qName||localName);
- var len = attrs.length;
- appendElement(this, el);
- this.currentElement = el;
-
- this.locator && position(this.locator,el)
- for (var i = 0 ; i < len; i++) {
- var namespaceURI = attrs.getURI(i);
- var value = attrs.getValue(i);
- var qName = attrs.getQName(i);
- var attr = doc.createAttributeNS(namespaceURI, qName);
- if( attr.getOffset){
- position(attr.getOffset(1),attr)
- }
- attr.value = attr.nodeValue = value;
- el.setAttributeNode(attr)
- }
- },
- endElement:function(namespaceURI, localName, qName) {
- var current = this.currentElement
- var tagName = current.tagName;
- this.currentElement = current.parentNode;
- },
- startPrefixMapping:function(prefix, uri) {
- },
- endPrefixMapping:function(prefix) {
- },
- processingInstruction:function(target, data) {
- var ins = this.document.createProcessingInstruction(target, data);
- this.locator && position(this.locator,ins)
- appendElement(this, ins);
- },
- ignorableWhitespace:function(ch, start, length) {
- },
- characters:function(chars, start, length) {
- chars = _toString.apply(this,arguments)
- //console.log(chars)
- if(this.currentElement && chars){
- if (this.cdata) {
- var charNode = this.document.createCDATASection(chars);
- this.currentElement.appendChild(charNode);
- } else {
- var charNode = this.document.createTextNode(chars);
- this.currentElement.appendChild(charNode);
- }
- this.locator && position(this.locator,charNode)
- }
- },
- skippedEntity:function(name) {
- },
- endDocument:function() {
- this.document.normalize();
- },
- setDocumentLocator:function (locator) {
- if(this.locator = locator){// && !('lineNumber' in locator)){
- locator.lineNumber = 0;
- }
- },
- //LexicalHandler
- comment:function(chars, start, length) {
- chars = _toString.apply(this,arguments)
- var comm = this.document.createComment(chars);
- this.locator && position(this.locator,comm)
- appendElement(this, comm);
- },
-
- startCDATA:function() {
- //used in characters() methods
- this.cdata = true;
- },
- endCDATA:function() {
- this.cdata = false;
- },
-
- startDTD:function(name, publicId, systemId) {
- var impl = this.document.implementation;
- if (impl && impl.createDocumentType) {
- var dt = impl.createDocumentType(name, publicId, systemId);
- this.locator && position(this.locator,dt)
- appendElement(this, dt);
- }
- },
- /**
- * @see org.xml.sax.ErrorHandler
- * @link http://www.saxproject.org/apidoc/org/xml/sax/ErrorHandler.html
- */
- warning:function(error) {
- console.warn(error,_locator(this.locator));
- },
- error:function(error) {
- console.error(error,_locator(this.locator));
- },
- fatalError:function(error) {
- console.error(error,_locator(this.locator));
- throw error;
- }
-}
-function _locator(l){
- if(l){
- return '\n@'+(l.systemId ||'')+'#[line:'+l.lineNumber+',col:'+l.columnNumber+']'
- }
-}
-function _toString(chars,start,length){
- if(typeof chars == 'string'){
- return chars.substr(start,length)
- }else{//java sax connect width xmldom on rhino(what about: "? && !(chars instanceof String)")
- if(chars.length >= start+length || start){
- return new java.lang.String(chars,start,length)+'';
- }
- return chars;
- }
-}
-
-/*
- * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/LexicalHandler.html
- * used method of org.xml.sax.ext.LexicalHandler:
- * #comment(chars, start, length)
- * #startCDATA()
- * #endCDATA()
- * #startDTD(name, publicId, systemId)
- *
- *
- * IGNORED method of org.xml.sax.ext.LexicalHandler:
- * #endDTD()
- * #startEntity(name)
- * #endEntity(name)
- *
- *
- * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/DeclHandler.html
- * IGNORED method of org.xml.sax.ext.DeclHandler
- * #attributeDecl(eName, aName, type, mode, value)
- * #elementDecl(name, model)
- * #externalEntityDecl(name, publicId, systemId)
- * #internalEntityDecl(name, value)
- * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/EntityResolver2.html
- * IGNORED method of org.xml.sax.EntityResolver2
- * #resolveEntity(String name,String publicId,String baseURI,String systemId)
- * #resolveEntity(publicId, systemId)
- * #getExternalSubset(name, baseURI)
- * @link http://www.saxproject.org/apidoc/org/xml/sax/DTDHandler.html
- * IGNORED method of org.xml.sax.DTDHandler
- * #notationDecl(name, publicId, systemId) {};
- * #unparsedEntityDecl(name, publicId, systemId, notationName) {};
- */
-"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(key){
- DOMHandler.prototype[key] = function(){return null}
-})
-
-/* Private static helpers treated below as private instance methods, so don't need to add these to the public API; we might use a Relator to also get rid of non-standard public properties */
-function appendElement (hander,node) {
- if (!hander.currentElement) {
- hander.document.appendChild(node);
- } else {
- hander.currentElement.appendChild(node);
- }
-}//appendChild and setAttributeNS are preformance key
-
-if(typeof require == 'function'){
- var XMLReader = require('./sax').XMLReader;
- var DOMImplementation = exports.DOMImplementation = require('./dom').DOMImplementation;
- exports.XMLSerializer = require('./dom').XMLSerializer ;
- exports.DOMParser = DOMParser;
-}
-
-},{"./dom":8,"./sax":9}],8:[function(require,module,exports){
-/*
- * DOM Level 2
- * Object DOMException
- * @see http://www.w3.org/TR/REC-DOM-Level-1/ecma-script-language-binding.html
- * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html
- */
-
-function copy(src,dest){
- for(var p in src){
- dest[p] = src[p];
- }
-}
-/**
-^\w+\.prototype\.([_\w]+)\s*=\s*((?:.*\{\s*?[\r\n][\s\S]*?^})|\S.*?(?=[;\r\n]));?
-^\w+\.prototype\.([_\w]+)\s*=\s*(\S.*?(?=[;\r\n]));?
- */
-function _extends(Class,Super){
- var pt = Class.prototype;
- if(Object.create){
- var ppt = Object.create(Super.prototype)
- pt.__proto__ = ppt;
- }
- if(!(pt instanceof Super)){
- function t(){};
- t.prototype = Super.prototype;
- t = new t();
- copy(pt,t);
- Class.prototype = pt = t;
- }
- if(pt.constructor != Class){
- if(typeof Class != 'function'){
- console.error("unknow Class:"+Class)
- }
- pt.constructor = Class
- }
-}
-var htmlns = 'http://www.w3.org/1999/xhtml' ;
-// Node Types
-var NodeType = {}
-var ELEMENT_NODE = NodeType.ELEMENT_NODE = 1;
-var ATTRIBUTE_NODE = NodeType.ATTRIBUTE_NODE = 2;
-var TEXT_NODE = NodeType.TEXT_NODE = 3;
-var CDATA_SECTION_NODE = NodeType.CDATA_SECTION_NODE = 4;
-var ENTITY_REFERENCE_NODE = NodeType.ENTITY_REFERENCE_NODE = 5;
-var ENTITY_NODE = NodeType.ENTITY_NODE = 6;
-var PROCESSING_INSTRUCTION_NODE = NodeType.PROCESSING_INSTRUCTION_NODE = 7;
-var COMMENT_NODE = NodeType.COMMENT_NODE = 8;
-var DOCUMENT_NODE = NodeType.DOCUMENT_NODE = 9;
-var DOCUMENT_TYPE_NODE = NodeType.DOCUMENT_TYPE_NODE = 10;
-var DOCUMENT_FRAGMENT_NODE = NodeType.DOCUMENT_FRAGMENT_NODE = 11;
-var NOTATION_NODE = NodeType.NOTATION_NODE = 12;
-
-// ExceptionCode
-var ExceptionCode = {}
-var ExceptionMessage = {};
-var INDEX_SIZE_ERR = ExceptionCode.INDEX_SIZE_ERR = ((ExceptionMessage[1]="Index size error"),1);
-var DOMSTRING_SIZE_ERR = ExceptionCode.DOMSTRING_SIZE_ERR = ((ExceptionMessage[2]="DOMString size error"),2);
-var HIERARCHY_REQUEST_ERR = ExceptionCode.HIERARCHY_REQUEST_ERR = ((ExceptionMessage[3]="Hierarchy request error"),3);
-var WRONG_DOCUMENT_ERR = ExceptionCode.WRONG_DOCUMENT_ERR = ((ExceptionMessage[4]="Wrong document"),4);
-var INVALID_CHARACTER_ERR = ExceptionCode.INVALID_CHARACTER_ERR = ((ExceptionMessage[5]="Invalid character"),5);
-var NO_DATA_ALLOWED_ERR = ExceptionCode.NO_DATA_ALLOWED_ERR = ((ExceptionMessage[6]="No data allowed"),6);
-var NO_MODIFICATION_ALLOWED_ERR = ExceptionCode.NO_MODIFICATION_ALLOWED_ERR = ((ExceptionMessage[7]="No modification allowed"),7);
-var NOT_FOUND_ERR = ExceptionCode.NOT_FOUND_ERR = ((ExceptionMessage[8]="Not found"),8);
-var NOT_SUPPORTED_ERR = ExceptionCode.NOT_SUPPORTED_ERR = ((ExceptionMessage[9]="Not supported"),9);
-var INUSE_ATTRIBUTE_ERR = ExceptionCode.INUSE_ATTRIBUTE_ERR = ((ExceptionMessage[10]="Attribute in use"),10);
-//level2
-var INVALID_STATE_ERR = ExceptionCode.INVALID_STATE_ERR = ((ExceptionMessage[11]="Invalid state"),11);
-var SYNTAX_ERR = ExceptionCode.SYNTAX_ERR = ((ExceptionMessage[12]="Syntax error"),12);
-var INVALID_MODIFICATION_ERR = ExceptionCode.INVALID_MODIFICATION_ERR = ((ExceptionMessage[13]="Invalid modification"),13);
-var NAMESPACE_ERR = ExceptionCode.NAMESPACE_ERR = ((ExceptionMessage[14]="Invalid namespace"),14);
-var INVALID_ACCESS_ERR = ExceptionCode.INVALID_ACCESS_ERR = ((ExceptionMessage[15]="Invalid access"),15);
-
-
-function DOMException(code, message) {
- if(message instanceof Error){
- var error = message;
- }else{
- error = this;
- Error.call(this, ExceptionMessage[code]);
- this.message = ExceptionMessage[code];
- if(Error.captureStackTrace) Error.captureStackTrace(this, DOMException);
- }
- error.code = code;
- if(message) this.message = this.message + ": " + message;
- return error;
-};
-DOMException.prototype = Error.prototype;
-copy(ExceptionCode,DOMException)
-/**
- * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-536297177
- * The NodeList interface provides the abstraction of an ordered collection of nodes, without defining or constraining how this collection is implemented. NodeList objects in the DOM are live.
- * The items in the NodeList are accessible via an integral index, starting from 0.
- */
-function NodeList() {
-};
-NodeList.prototype = {
- /**
- * The number of nodes in the list. The range of valid child node indices is 0 to length-1 inclusive.
- * @standard level1
- */
- length:0,
- /**
- * Returns the indexth item in the collection. If index is greater than or equal to the number of nodes in the list, this returns null.
- * @standard level1
- * @param index unsigned long
- * Index into the collection.
- * @return Node
- * The node at the indexth position in the NodeList, or null if that is not a valid index.
- */
- item: function(index) {
- return this[index] || null;
- }
-};
-function LiveNodeList(node,refresh){
- this._node = node;
- this._refresh = refresh
- _updateLiveList(this);
-}
-function _updateLiveList(list){
- var inc = list._node._inc || list._node.ownerDocument._inc;
- if(list._inc != inc){
- var ls = list._refresh(list._node);
- //console.log(ls.length)
- __set__(list,'length',ls.length);
- copy(ls,list);
- list._inc = inc;
- }
-}
-LiveNodeList.prototype.item = function(i){
- _updateLiveList(this);
- return this[i];
-}
-
-_extends(LiveNodeList,NodeList);
-/**
- *
- * Objects implementing the NamedNodeMap interface are used to represent collections of nodes that can be accessed by name. Note that NamedNodeMap does not inherit from NodeList; NamedNodeMaps are not maintained in any particular order. Objects contained in an object implementing NamedNodeMap may also be accessed by an ordinal index, but this is simply to allow convenient enumeration of the contents of a NamedNodeMap, and does not imply that the DOM specifies an order to these Nodes.
- * NamedNodeMap objects in the DOM are live.
- * used for attributes or DocumentType entities
- */
-function NamedNodeMap() {
-};
-
-function _findNodeIndex(list,node){
- var i = list.length;
- while(i--){
- if(list[i] === node){return i}
- }
-}
-
-function _addNamedNode(el,list,newAttr,oldAttr){
- if(oldAttr){
- list[_findNodeIndex(list,oldAttr)] = newAttr;
- }else{
- list[list.length++] = newAttr;
- }
- if(el){
- newAttr.ownerElement = el;
- var doc = el.ownerDocument;
- if(doc){
- oldAttr && _onRemoveAttribute(doc,el,oldAttr);
- _onAddAttribute(doc,el,newAttr);
- }
- }
-}
-function _removeNamedNode(el,list,attr){
- var i = _findNodeIndex(list,attr);
- if(i>=0){
- var lastIndex = list.length-1
- while(i0 || key == 'xmlns'){
-// return null;
-// }
- var i = this.length;
- while(i--){
- var attr = this[i];
- if(attr.nodeName == key){
- return attr;
- }
- }
- },
- setNamedItem: function(attr) {
- var el = attr.ownerElement;
- if(el && el!=this._ownerElement){
- throw new DOMException(INUSE_ATTRIBUTE_ERR);
- }
- var oldAttr = this.getNamedItem(attr.nodeName);
- _addNamedNode(this._ownerElement,this,attr,oldAttr);
- return oldAttr;
- },
- /* returns Node */
- setNamedItemNS: function(attr) {// raises: WRONG_DOCUMENT_ERR,NO_MODIFICATION_ALLOWED_ERR,INUSE_ATTRIBUTE_ERR
- var el = attr.ownerElement, oldAttr;
- if(el && el!=this._ownerElement){
- throw new DOMException(INUSE_ATTRIBUTE_ERR);
- }
- oldAttr = this.getNamedItemNS(attr.namespaceURI,attr.localName);
- _addNamedNode(this._ownerElement,this,attr,oldAttr);
- return oldAttr;
- },
-
- /* returns Node */
- removeNamedItem: function(key) {
- var attr = this.getNamedItem(key);
- _removeNamedNode(this._ownerElement,this,attr);
- return attr;
-
-
- },// raises: NOT_FOUND_ERR,NO_MODIFICATION_ALLOWED_ERR
-
- //for level2
- removeNamedItemNS:function(namespaceURI,localName){
- var attr = this.getNamedItemNS(namespaceURI,localName);
- _removeNamedNode(this._ownerElement,this,attr);
- return attr;
- },
- getNamedItemNS: function(namespaceURI, localName) {
- var i = this.length;
- while(i--){
- var node = this[i];
- if(node.localName == localName && node.namespaceURI == namespaceURI){
- return node;
- }
- }
- return null;
- }
-};
-/**
- * @see http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-102161490
- */
-function DOMImplementation(/* Object */ features) {
- this._features = {};
- if (features) {
- for (var feature in features) {
- this._features = features[feature];
- }
- }
-};
-
-DOMImplementation.prototype = {
- hasFeature: function(/* string */ feature, /* string */ version) {
- var versions = this._features[feature.toLowerCase()];
- if (versions && (!version || version in versions)) {
- return true;
- } else {
- return false;
- }
- },
- // Introduced in DOM Level 2:
- createDocument:function(namespaceURI, qualifiedName, doctype){// raises:INVALID_CHARACTER_ERR,NAMESPACE_ERR,WRONG_DOCUMENT_ERR
- var doc = new Document();
- doc.doctype = doctype;
- if(doctype){
- doc.appendChild(doctype);
- }
- doc.implementation = this;
- doc.childNodes = new NodeList();
- if(qualifiedName){
- var root = doc.createElementNS(namespaceURI,qualifiedName);
- doc.appendChild(root);
- }
- return doc;
- },
- // Introduced in DOM Level 2:
- createDocumentType:function(qualifiedName, publicId, systemId){// raises:INVALID_CHARACTER_ERR,NAMESPACE_ERR
- var node = new DocumentType();
- node.name = qualifiedName;
- node.nodeName = qualifiedName;
- node.publicId = publicId;
- node.systemId = systemId;
- // Introduced in DOM Level 2:
- //readonly attribute DOMString internalSubset;
-
- //TODO:..
- // readonly attribute NamedNodeMap entities;
- // readonly attribute NamedNodeMap notations;
- return node;
- }
-};
-
-
-/**
- * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-1950641247
- */
-
-function Node() {
-};
-
-Node.prototype = {
- firstChild : null,
- lastChild : null,
- previousSibling : null,
- nextSibling : null,
- attributes : null,
- parentNode : null,
- childNodes : null,
- ownerDocument : null,
- nodeValue : null,
- namespaceURI : null,
- prefix : null,
- localName : null,
- // Modified in DOM Level 2:
- insertBefore:function(newChild, refChild){//raises
- return _insertBefore(this,newChild,refChild);
- },
- replaceChild:function(newChild, oldChild){//raises
- this.insertBefore(newChild,oldChild);
- if(oldChild){
- this.removeChild(oldChild);
- }
- },
- removeChild:function(oldChild){
- return _removeChild(this,oldChild);
- },
- appendChild:function(newChild){
- return this.insertBefore(newChild,null);
- },
- hasChildNodes:function(){
- return this.firstChild != null;
- },
- cloneNode:function(deep){
- return cloneNode(this.ownerDocument||this,this,deep);
- },
- // Modified in DOM Level 2:
- normalize:function(){
- var child = this.firstChild;
- while(child){
- var next = child.nextSibling;
- if(next && next.nodeType == TEXT_NODE && child.nodeType == TEXT_NODE){
- this.removeChild(next);
- child.appendData(next.data);
- }else{
- child.normalize();
- child = next;
- }
- }
- },
- // Introduced in DOM Level 2:
- isSupported:function(feature, version){
- return this.ownerDocument.implementation.hasFeature(feature,version);
- },
- // Introduced in DOM Level 2:
- hasAttributes:function(){
- return this.attributes.length>0;
- },
- lookupPrefix:function(namespaceURI){
- var el = this;
- while(el){
- var map = el._nsMap;
- //console.dir(map)
- if(map){
- for(var n in map){
- if(map[n] == namespaceURI){
- return n;
- }
- }
- }
- el = el.nodeType == 2?el.ownerDocument : el.parentNode;
- }
- return null;
- },
- // Introduced in DOM Level 3:
- lookupNamespaceURI:function(prefix){
- var el = this;
- while(el){
- var map = el._nsMap;
- //console.dir(map)
- if(map){
- if(prefix in map){
- return map[prefix] ;
- }
- }
- el = el.nodeType == 2?el.ownerDocument : el.parentNode;
- }
- return null;
- },
- // Introduced in DOM Level 3:
- isDefaultNamespace:function(namespaceURI){
- var prefix = this.lookupPrefix(namespaceURI);
- return prefix == null;
- }
-};
-
-
-function _xmlEncoder(c){
- return c == '<' && '<' ||
- c == '>' && '>' ||
- c == '&' && '&' ||
- c == '"' && '"' ||
- ''+c.charCodeAt()+';'
-}
-
-
-copy(NodeType,Node);
-copy(NodeType,Node.prototype);
-
-/**
- * @param callback return true for continue,false for break
- * @return boolean true: break visit;
- */
-function _visitNode(node,callback){
- if(callback(node)){
- return true;
- }
- if(node = node.firstChild){
- do{
- if(_visitNode(node,callback)){return true}
- }while(node=node.nextSibling)
- }
-}
-
-
-
-function Document(){
-}
-function _onAddAttribute(doc,el,newAttr){
- doc && doc._inc++;
- var ns = newAttr.namespaceURI ;
- if(ns == 'http://www.w3.org/2000/xmlns/'){
- //update namespace
- el._nsMap[newAttr.prefix?newAttr.localName:''] = newAttr.value
- }
-}
-function _onRemoveAttribute(doc,el,newAttr,remove){
- doc && doc._inc++;
- var ns = newAttr.namespaceURI ;
- if(ns == 'http://www.w3.org/2000/xmlns/'){
- //update namespace
- delete el._nsMap[newAttr.prefix?newAttr.localName:'']
- }
-}
-function _onUpdateChild(doc,el,newChild){
- if(doc && doc._inc){
- doc._inc++;
- //update childNodes
- var cs = el.childNodes;
- if(newChild){
- cs[cs.length++] = newChild;
- }else{
- //console.log(1)
- var child = el.firstChild;
- var i = 0;
- while(child){
- cs[i++] = child;
- child =child.nextSibling;
- }
- cs.length = i;
- }
- }
-}
-
-/**
- * attributes;
- * children;
- *
- * writeable properties:
- * nodeValue,Attr:value,CharacterData:data
- * prefix
- */
-function _removeChild(parentNode,child){
- var previous = child.previousSibling;
- var next = child.nextSibling;
- if(previous){
- previous.nextSibling = next;
- }else{
- parentNode.firstChild = next
- }
- if(next){
- next.previousSibling = previous;
- }else{
- parentNode.lastChild = previous;
- }
- _onUpdateChild(parentNode.ownerDocument,parentNode);
- return child;
-}
-/**
- * preformance key(refChild == null)
- */
-function _insertBefore(parentNode,newChild,nextChild){
- var cp = newChild.parentNode;
- if(cp){
- cp.removeChild(newChild);//remove and update
- }
- if(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){
- var newFirst = newChild.firstChild;
- if (newFirst == null) {
- return newChild;
- }
- var newLast = newChild.lastChild;
- }else{
- newFirst = newLast = newChild;
- }
- var pre = nextChild ? nextChild.previousSibling : parentNode.lastChild;
-
- newFirst.previousSibling = pre;
- newLast.nextSibling = nextChild;
-
-
- if(pre){
- pre.nextSibling = newFirst;
- }else{
- parentNode.firstChild = newFirst;
- }
- if(nextChild == null){
- parentNode.lastChild = newLast;
- }else{
- nextChild.previousSibling = newLast;
- }
- do{
- newFirst.parentNode = parentNode;
- }while(newFirst !== newLast && (newFirst= newFirst.nextSibling))
- _onUpdateChild(parentNode.ownerDocument||parentNode,parentNode);
- //console.log(parentNode.lastChild.nextSibling == null)
- if (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {
- newChild.firstChild = newChild.lastChild = null;
- }
- return newChild;
-}
-function _appendSingleChild(parentNode,newChild){
- var cp = newChild.parentNode;
- if(cp){
- var pre = parentNode.lastChild;
- cp.removeChild(newChild);//remove and update
- var pre = parentNode.lastChild;
- }
- var pre = parentNode.lastChild;
- newChild.parentNode = parentNode;
- newChild.previousSibling = pre;
- newChild.nextSibling = null;
- if(pre){
- pre.nextSibling = newChild;
- }else{
- parentNode.firstChild = newChild;
- }
- parentNode.lastChild = newChild;
- _onUpdateChild(parentNode.ownerDocument,parentNode,newChild);
- return newChild;
- //console.log("__aa",parentNode.lastChild.nextSibling == null)
-}
-Document.prototype = {
- //implementation : null,
- nodeName : '#document',
- nodeType : DOCUMENT_NODE,
- doctype : null,
- documentElement : null,
- _inc : 1,
-
- insertBefore : function(newChild, refChild){//raises
- if(newChild.nodeType == DOCUMENT_FRAGMENT_NODE){
- var child = newChild.firstChild;
- while(child){
- var next = child.nextSibling;
- this.insertBefore(child,refChild);
- child = next;
- }
- return newChild;
- }
- if(this.documentElement == null && newChild.nodeType == 1){
- this.documentElement = newChild;
- }
-
- return _insertBefore(this,newChild,refChild),(newChild.ownerDocument = this),newChild;
- },
- removeChild : function(oldChild){
- if(this.documentElement == oldChild){
- this.documentElement = null;
- }
- return _removeChild(this,oldChild);
- },
- // Introduced in DOM Level 2:
- importNode : function(importedNode,deep){
- return importNode(this,importedNode,deep);
- },
- // Introduced in DOM Level 2:
- getElementById : function(id){
- var rtv = null;
- _visitNode(this.documentElement,function(node){
- if(node.nodeType == 1){
- if(node.getAttribute('id') == id){
- rtv = node;
- return true;
- }
- }
- })
- return rtv;
- },
-
- //document factory method:
- createElement : function(tagName){
- var node = new Element();
- node.ownerDocument = this;
- node.nodeName = tagName;
- node.tagName = tagName;
- node.childNodes = new NodeList();
- var attrs = node.attributes = new NamedNodeMap();
- attrs._ownerElement = node;
- return node;
- },
- createDocumentFragment : function(){
- var node = new DocumentFragment();
- node.ownerDocument = this;
- node.childNodes = new NodeList();
- return node;
- },
- createTextNode : function(data){
- var node = new Text();
- node.ownerDocument = this;
- node.appendData(data)
- return node;
- },
- createComment : function(data){
- var node = new Comment();
- node.ownerDocument = this;
- node.appendData(data)
- return node;
- },
- createCDATASection : function(data){
- var node = new CDATASection();
- node.ownerDocument = this;
- node.appendData(data)
- return node;
- },
- createProcessingInstruction : function(target,data){
- var node = new ProcessingInstruction();
- node.ownerDocument = this;
- node.tagName = node.target = target;
- node.nodeValue= node.data = data;
- return node;
- },
- createAttribute : function(name){
- var node = new Attr();
- node.ownerDocument = this;
- node.name = name;
- node.nodeName = name;
- node.localName = name;
- node.specified = true;
- return node;
- },
- createEntityReference : function(name){
- var node = new EntityReference();
- node.ownerDocument = this;
- node.nodeName = name;
- return node;
- },
- // Introduced in DOM Level 2:
- createElementNS : function(namespaceURI,qualifiedName){
- var node = new Element();
- var pl = qualifiedName.split(':');
- var attrs = node.attributes = new NamedNodeMap();
- node.childNodes = new NodeList();
- node.ownerDocument = this;
- node.nodeName = qualifiedName;
- node.tagName = qualifiedName;
- node.namespaceURI = namespaceURI;
- if(pl.length == 2){
- node.prefix = pl[0];
- node.localName = pl[1];
- }else{
- //el.prefix = null;
- node.localName = qualifiedName;
- }
- attrs._ownerElement = node;
- return node;
- },
- // Introduced in DOM Level 2:
- createAttributeNS : function(namespaceURI,qualifiedName){
- var node = new Attr();
- var pl = qualifiedName.split(':');
- node.ownerDocument = this;
- node.nodeName = qualifiedName;
- node.name = qualifiedName;
- node.namespaceURI = namespaceURI;
- node.specified = true;
- if(pl.length == 2){
- node.prefix = pl[0];
- node.localName = pl[1];
- }else{
- //el.prefix = null;
- node.localName = qualifiedName;
- }
- return node;
- }
-};
-_extends(Document,Node);
-
-
-function Element() {
- this._nsMap = {};
-};
-Element.prototype = {
- nodeType : ELEMENT_NODE,
- hasAttribute : function(name){
- return this.getAttributeNode(name)!=null;
- },
- getAttribute : function(name){
- var attr = this.getAttributeNode(name);
- return attr && attr.value || '';
- },
- getAttributeNode : function(name){
- return this.attributes.getNamedItem(name);
- },
- setAttribute : function(name, value){
- var attr = this.ownerDocument.createAttribute(name);
- attr.value = attr.nodeValue = "" + value;
- this.setAttributeNode(attr)
- },
- removeAttribute : function(name){
- var attr = this.getAttributeNode(name)
- attr && this.removeAttributeNode(attr);
- },
-
- //four real opeartion method
- appendChild:function(newChild){
- if(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){
- return this.insertBefore(newChild,null);
- }else{
- return _appendSingleChild(this,newChild);
- }
- },
- setAttributeNode : function(newAttr){
- return this.attributes.setNamedItem(newAttr);
- },
- setAttributeNodeNS : function(newAttr){
- return this.attributes.setNamedItemNS(newAttr);
- },
- removeAttributeNode : function(oldAttr){
- return this.attributes.removeNamedItem(oldAttr.nodeName);
- },
- //get real attribute name,and remove it by removeAttributeNode
- removeAttributeNS : function(namespaceURI, localName){
- var old = this.getAttributeNodeNS(namespaceURI, localName);
- old && this.removeAttributeNode(old);
- },
-
- hasAttributeNS : function(namespaceURI, localName){
- return this.getAttributeNodeNS(namespaceURI, localName)!=null;
- },
- getAttributeNS : function(namespaceURI, localName){
- var attr = this.getAttributeNodeNS(namespaceURI, localName);
- return attr && attr.value || '';
- },
- setAttributeNS : function(namespaceURI, qualifiedName, value){
- var attr = this.ownerDocument.createAttributeNS(namespaceURI, qualifiedName);
- attr.value = attr.nodeValue = value;
- this.setAttributeNode(attr)
- },
- getAttributeNodeNS : function(namespaceURI, localName){
- return this.attributes.getNamedItemNS(namespaceURI, localName);
- },
-
- getElementsByTagName : function(tagName){
- return new LiveNodeList(this,function(base){
- var ls = [];
- _visitNode(base,function(node){
- if(node !== base && node.nodeType == ELEMENT_NODE && (tagName === '*' || node.tagName == tagName)){
- ls.push(node);
- }
- });
- return ls;
- });
- },
- getElementsByTagNameNS : function(namespaceURI, localName){
- return new LiveNodeList(this,function(base){
- var ls = [];
- _visitNode(base,function(node){
- if(node !== base && node.nodeType === ELEMENT_NODE && node.namespaceURI === namespaceURI && (localName === '*' || node.localName == localName)){
- ls.push(node);
- }
- });
- return ls;
- });
- }
-};
-Document.prototype.getElementsByTagName = Element.prototype.getElementsByTagName;
-Document.prototype.getElementsByTagNameNS = Element.prototype.getElementsByTagNameNS;
-
-
-_extends(Element,Node);
-function Attr() {
-};
-Attr.prototype.nodeType = ATTRIBUTE_NODE;
-_extends(Attr,Node);
-
-
-function CharacterData() {
-};
-CharacterData.prototype = {
- data : '',
- substringData : function(offset, count) {
- return this.data.substring(offset, offset+count);
- },
- appendData: function(text) {
- text = this.data+text;
- this.nodeValue = this.data = text;
- this.length = text.length;
- },
- insertData: function(offset,text) {
- this.replaceData(offset,0,text);
-
- },
- appendChild:function(newChild){
- //if(!(newChild instanceof CharacterData)){
- throw new Error(ExceptionMessage[3])
- //}
- return Node.prototype.appendChild.apply(this,arguments)
- },
- deleteData: function(offset, count) {
- this.replaceData(offset,count,"");
- },
- replaceData: function(offset, count, text) {
- var start = this.data.substring(0,offset);
- var end = this.data.substring(offset+count);
- text = start + text + end;
- this.nodeValue = this.data = text;
- this.length = text.length;
- }
-}
-_extends(CharacterData,Node);
-function Text() {
-};
-Text.prototype = {
- nodeName : "#text",
- nodeType : TEXT_NODE,
- splitText : function(offset) {
- var text = this.data;
- var newText = text.substring(offset);
- text = text.substring(0, offset);
- this.data = this.nodeValue = text;
- this.length = text.length;
- var newNode = this.ownerDocument.createTextNode(newText);
- if(this.parentNode){
- this.parentNode.insertBefore(newNode, this.nextSibling);
- }
- return newNode;
- }
-}
-_extends(Text,CharacterData);
-function Comment() {
-};
-Comment.prototype = {
- nodeName : "#comment",
- nodeType : COMMENT_NODE
-}
-_extends(Comment,CharacterData);
-
-function CDATASection() {
-};
-CDATASection.prototype = {
- nodeName : "#cdata-section",
- nodeType : CDATA_SECTION_NODE
-}
-_extends(CDATASection,CharacterData);
-
-
-function DocumentType() {
-};
-DocumentType.prototype.nodeType = DOCUMENT_TYPE_NODE;
-_extends(DocumentType,Node);
-
-function Notation() {
-};
-Notation.prototype.nodeType = NOTATION_NODE;
-_extends(Notation,Node);
-
-function Entity() {
-};
-Entity.prototype.nodeType = ENTITY_NODE;
-_extends(Entity,Node);
-
-function EntityReference() {
-};
-EntityReference.prototype.nodeType = ENTITY_REFERENCE_NODE;
-_extends(EntityReference,Node);
-
-function DocumentFragment() {
-};
-DocumentFragment.prototype.nodeName = "#document-fragment";
-DocumentFragment.prototype.nodeType = DOCUMENT_FRAGMENT_NODE;
-_extends(DocumentFragment,Node);
-
-
-function ProcessingInstruction() {
-}
-ProcessingInstruction.prototype.nodeType = PROCESSING_INSTRUCTION_NODE;
-_extends(ProcessingInstruction,Node);
-function XMLSerializer(){}
-XMLSerializer.prototype.serializeToString = function(node){
- var buf = [];
- serializeToString(node,buf);
- return buf.join('');
-}
-Node.prototype.toString =function(){
- return XMLSerializer.prototype.serializeToString(this);
-}
-function serializeToString(node,buf){
- switch(node.nodeType){
- case ELEMENT_NODE:
- var attrs = node.attributes;
- var len = attrs.length;
- var child = node.firstChild;
- var nodeName = node.tagName;
- var isHTML = htmlns === node.namespaceURI
- buf.push('<',nodeName);
- for(var i=0;i');
- //if is cdata child node
- if(isHTML && /^script$/i.test(nodeName)){
- if(child){
- buf.push(child.data);
- }
- }else{
- while(child){
- serializeToString(child,buf);
- child = child.nextSibling;
- }
- }
- buf.push('',nodeName,'>');
- }else{
- buf.push('/>');
- }
- return;
- case DOCUMENT_NODE:
- case DOCUMENT_FRAGMENT_NODE:
- var child = node.firstChild;
- while(child){
- serializeToString(child,buf);
- child = child.nextSibling;
- }
- return;
- case ATTRIBUTE_NODE:
- return buf.push(' ',node.name,'="',node.value.replace(/[<&"]/g,_xmlEncoder),'"');
- case TEXT_NODE:
- return buf.push(node.data.replace(/[<&]/g,_xmlEncoder));
- case CDATA_SECTION_NODE:
- return buf.push( '');
- case COMMENT_NODE:
- return buf.push( "");
- case DOCUMENT_TYPE_NODE:
- var pubid = node.publicId;
- var sysid = node.systemId;
- buf.push('');
- }else if(sysid && sysid!='.'){
- buf.push(' SYSTEM "',sysid,'">');
- }else{
- var sub = node.internalSubset;
- if(sub){
- buf.push(" [",sub,"]");
- }
- buf.push(">");
- }
- return;
- case PROCESSING_INSTRUCTION_NODE:
- return buf.push( "",node.target," ",node.data,"?>");
- case ENTITY_REFERENCE_NODE:
- return buf.push( '&',node.nodeName,';');
- //case ENTITY_NODE:
- //case NOTATION_NODE:
- default:
- buf.push('??',node.nodeName);
- }
-}
-function importNode(doc,node,deep){
- var node2;
- switch (node.nodeType) {
- case ELEMENT_NODE:
- node2 = node.cloneNode(false);
- node2.ownerDocument = doc;
- //var attrs = node2.attributes;
- //var len = attrs.length;
- //for(var i=0;i
-
-function XMLReader(){
-
-}
-
-XMLReader.prototype = {
- parse:function(source,defaultNSMap,entityMap){
- var domBuilder = this.domBuilder;
- domBuilder.startDocument();
- _copy(defaultNSMap ,defaultNSMap = {})
- parse(source,defaultNSMap,entityMap,
- domBuilder,this.errorHandler);
- domBuilder.endDocument();
- }
-}
-function parse(source,defaultNSMapCopy,entityMap,domBuilder,errorHandler){
- function fixedFromCharCode(code) {
- // String.prototype.fromCharCode does not supports
- // > 2 bytes unicode chars directly
- if (code > 0xffff) {
- code -= 0x10000;
- var surrogate1 = 0xd800 + (code >> 10)
- , surrogate2 = 0xdc00 + (code & 0x3ff);
-
- return String.fromCharCode(surrogate1, surrogate2);
- } else {
- return String.fromCharCode(code);
- }
- }
- function entityReplacer(a){
- var k = a.slice(1,-1);
- if(k in entityMap){
- return entityMap[k];
- }else if(k.charAt(0) === '#'){
- return fixedFromCharCode(parseInt(k.substr(1).replace('x','0x')))
- }else{
- errorHandler.error('entity not found:'+a);
- return a;
- }
- }
- function appendText(end){//has some bugs
- var xt = source.substring(start,end).replace(/?\w+;/g,entityReplacer);
- locator&&position(start);
- domBuilder.characters(xt,0,end-start);
- start = end
- }
- function position(start,m){
- while(start>=endPos && (m = linePattern.exec(source))){
- startPos = m.index;
- endPos = startPos + m[0].length;
- locator.lineNumber++;
- //console.log('line++:',locator,startPos,endPos)
- }
- locator.columnNumber = start-startPos+1;
- }
- var startPos = 0;
- var endPos = 0;
- var linePattern = /.+(?:\r\n?|\n)|.*$/g
- var locator = domBuilder.locator;
-
- var parseStack = [{currentNSMap:defaultNSMapCopy}]
- var closeMap = {};
- var start = 0;
- while(true){
- var i = source.indexOf('<',start);
- if(i<0){
- if(!source.substr(start).match(/^\s*$/)){
- var doc = domBuilder.document;
- var text = doc.createTextNode(source.substr(start));
- doc.appendChild(text);
- domBuilder.currentElement = text;
- }
- return;
- }
- if(i>start){
- appendText(i);
- }
- switch(source.charAt(i+1)){
- case '/':
- var end = source.indexOf('>',i+3);
- var tagName = source.substring(i+2,end);
- var config = parseStack.pop();
- var localNSMap = config.localNSMap;
-
- if(config.tagName != tagName){
- errorHandler.fatalError("end tag name: "+tagName+' is not match the current start tagName:'+config.tagName );
- }
- domBuilder.endElement(config.uri,config.localName,tagName);
- if(localNSMap){
- for(var prefix in localNSMap){
- domBuilder.endPrefixMapping(prefix) ;
- }
- }
- end++;
- break;
- // end elment
- case '?':// ...?>
- locator&&position(i);
- end = parseInstruction(source,i,domBuilder);
- break;
- case '!':// 0){
- value = source.slice(start,p).replace(/?\w+;/g,entityReplacer);
- el.add(attrName,value,start-1);
- s = S_E;
- }else{
- //fatalError: no end quot match
- throw new Error('attribute value no end \''+c+'\' match');
- }
- }else if(s == S_V){
- value = source.slice(start,p).replace(/?\w+;/g,entityReplacer);
- //console.log(attrName,value,start,p)
- el.add(attrName,value,start);
- //console.dir(el)
- errorHandler.warning('attribute "'+attrName+'" missed start quot('+c+')!!');
- start = p+1;
- s = S_E
- }else{
- //fatalError: no equal before
- throw new Error('attribute value must after "="');
- }
- break;
- case '/':
- switch(s){
- case S_TAG:
- el.setTagName(source.slice(start,p));
- case S_E:
- case S_S:
- case S_C:
- s = S_C;
- el.closed = true;
- case S_V:
- case S_ATTR:
- case S_ATTR_S:
- break;
- //case S_EQ:
- default:
- throw new Error("attribute invalid close char('/')")
- }
- break;
- case ''://end document
- //throw new Error('unexpected end of input')
- errorHandler.error('unexpected end of input');
- case '>':
- switch(s){
- case S_TAG:
- el.setTagName(source.slice(start,p));
- case S_E:
- case S_S:
- case S_C:
- break;//normal
- case S_V://Compatible state
- case S_ATTR:
- value = source.slice(start,p);
- if(value.slice(-1) === '/'){
- el.closed = true;
- value = value.slice(0,-1)
- }
- case S_ATTR_S:
- if(s === S_ATTR_S){
- value = attrName;
- }
- if(s == S_V){
- errorHandler.warning('attribute "'+value+'" missed quot(")!!');
- el.add(attrName,value.replace(/?\w+;/g,entityReplacer),start)
- }else{
- errorHandler.warning('attribute "'+value+'" missed value!! "'+value+'" instead!!')
- el.add(value,value,start)
- }
- break;
- case S_EQ:
- throw new Error('attribute value missed!!');
- }
-// console.log(tagName,tagNamePattern,tagNamePattern.test(tagName))
- return p;
- /*xml space '\x20' | #x9 | #xD | #xA; */
- case '\u0080':
- c = ' ';
- default:
- if(c<= ' '){//space
- switch(s){
- case S_TAG:
- el.setTagName(source.slice(start,p));//tagName
- s = S_S;
- break;
- case S_ATTR:
- attrName = source.slice(start,p)
- s = S_ATTR_S;
- break;
- case S_V:
- var value = source.slice(start,p).replace(/?\w+;/g,entityReplacer);
- errorHandler.warning('attribute "'+value+'" missed quot(")!!');
- el.add(attrName,value,start)
- case S_E:
- s = S_S;
- break;
- //case S_S:
- //case S_EQ:
- //case S_ATTR_S:
- // void();break;
- //case S_C:
- //ignore warning
- }
- }else{//not space
-//S_TAG, S_ATTR, S_EQ, S_V
-//S_ATTR_S, S_E, S_S, S_C
- switch(s){
- //case S_TAG:void();break;
- //case S_ATTR:void();break;
- //case S_V:void();break;
- case S_ATTR_S:
- errorHandler.warning('attribute "'+attrName+'" missed value!! "'+attrName+'" instead!!')
- el.add(attrName,attrName,start);
- start = p;
- s = S_ATTR;
- break;
- case S_E:
- errorHandler.warning('attribute space is required"'+attrName+'"!!')
- case S_S:
- s = S_ATTR;
- start = p;
- break;
- case S_EQ:
- s = S_V;
- start = p;
- break;
- case S_C:
- throw new Error("elements closed character '/' and '>' must be connected to");
- }
- }
- }
- p++;
- }
-}
-/**
- * @return end of the elementStartPart(end of elementEndPart for selfClosed el)
- */
-function appendElement(el,domBuilder,parseStack){
- var tagName = el.tagName;
- var localNSMap = null;
- var currentNSMap = parseStack[parseStack.length-1].currentNSMap;
- var i = el.length;
- while(i--){
- var a = el[i];
- var qName = a.qName;
- var value = a.value;
- var nsp = qName.indexOf(':');
- if(nsp>0){
- var prefix = a.prefix = qName.slice(0,nsp);
- var localName = qName.slice(nsp+1);
- var nsPrefix = prefix === 'xmlns' && localName
- }else{
- localName = qName;
- prefix = null
- nsPrefix = qName === 'xmlns' && ''
- }
- //can not set prefix,because prefix !== ''
- a.localName = localName ;
- //prefix == null for no ns prefix attribute
- if(nsPrefix !== false){//hack!!
- if(localNSMap == null){
- localNSMap = {}
- //console.log(currentNSMap,0)
- _copy(currentNSMap,currentNSMap={})
- //console.log(currentNSMap,1)
- }
- currentNSMap[nsPrefix] = localNSMap[nsPrefix] = value;
- a.uri = 'http://www.w3.org/2000/xmlns/'
- domBuilder.startPrefixMapping(nsPrefix, value)
- }
- }
- var i = el.length;
- while(i--){
- a = el[i];
- var prefix = a.prefix;
- if(prefix){//no prefix attribute has no namespace
- if(prefix === 'xml'){
- a.uri = 'http://www.w3.org/XML/1998/namespace';
- }if(prefix !== 'xmlns'){
- a.uri = currentNSMap[prefix]
-
- //{console.log('###'+a.qName,domBuilder.locator.systemId+'',currentNSMap,a.uri)}
- }
- }
- }
- var nsp = tagName.indexOf(':');
- if(nsp>0){
- prefix = el.prefix = tagName.slice(0,nsp);
- localName = el.localName = tagName.slice(nsp+1);
- }else{
- prefix = null;//important!!
- localName = el.localName = tagName;
- }
- //no prefix element has default namespace
- var ns = el.uri = currentNSMap[prefix || ''];
- domBuilder.startElement(ns,localName,tagName,el);
- //endPrefixMapping and startPrefixMapping have not any help for dom builder
- //localNSMap = null
- if(el.closed){
- domBuilder.endElement(ns,localName,tagName);
- if(localNSMap){
- for(prefix in localNSMap){
- domBuilder.endPrefixMapping(prefix)
- }
- }
- }else{
- el.currentNSMap = currentNSMap;
- el.localNSMap = localNSMap;
- parseStack.push(el);
- }
-}
-function parseHtmlSpecialContent(source,elStartEnd,tagName,entityReplacer,domBuilder){
- if(/^(?:script|textarea)$/i.test(tagName)){
- var elEndStart = source.indexOf(''+tagName+'>',elStartEnd);
- var text = source.substring(elStartEnd+1,elEndStart);
- if(/[&<]/.test(text)){
- if(/^script$/i.test(tagName)){
- //if(!/\]\]>/.test(text)){
- //lexHandler.startCDATA();
- domBuilder.characters(text,0,text.length);
- //lexHandler.endCDATA();
- return elEndStart;
- //}
- }//}else{//text area
- text = text.replace(/?\w+;/g,entityReplacer);
- domBuilder.characters(text,0,text.length);
- return elEndStart;
- //}
-
- }
- }
- return elStartEnd+1;
-}
-function fixSelfClosed(source,elStartEnd,tagName,closeMap){
- //if(tagName in closeMap){
- var pos = closeMap[tagName];
- if(pos == null){
- //console.log(tagName)
- pos = closeMap[tagName] = source.lastIndexOf(''+tagName+'>')
- }
- return pos',start+4);
- //append comment source.substring(4,end)//,
- * and raw CDATA nodes.
- *
- * @param {Element} node
- * @returns {Boolean}
- * @api private
- */
-
-function shouldIgnoreNode (node) {
- return node.nodeType === 3 // text
- || node.nodeType === 8 // comment
- || node.nodeType === 4; // cdata
-}
-
-
-/**
- * Parses a Plist XML string. Returns an Object.
- *
- * @param {String} xml - the XML String to decode
- * @returns {Mixed} the decoded value from the Plist XML
- * @api public
- */
-
-function parse (xml) {
- var doc = new DOMParser().parseFromString(xml);
- if (doc.documentElement.nodeName !== 'plist') {
- throw new Error('malformed document. First element should be ');
- }
- var plist = parsePlistXML(doc.documentElement);
-
- // the root node gets interpreted as an Array,
- // so pull out the inner data first
- if (plist.length == 1) plist = plist[0];
-
- return plist;
-}
-
-/**
- * Parses a Plist XML string. Returns an Object. Takes a `callback` function.
- *
- * @param {String} xml - the XML String to decode
- * @param {Function} callback - callback function
- * @returns {Mixed} the decoded value from the Plist XML
- * @api public
- * @deprecated not actually async. use parse() instead
- */
-
-function parseString (xml, callback) {
- var doc, error, plist;
- try {
- doc = new DOMParser().parseFromString(xml);
- plist = parsePlistXML(doc.documentElement);
- } catch(e) {
- error = e;
- }
- callback(error, plist);
-}
-
-/**
- * Parses a Plist XML string. Returns an Object.
- *
- * @param {String} xml - the XML String to decode
- * @param {Function} callback - callback function
- * @returns {Mixed} the decoded value from the Plist XML
- * @api public
- * @deprecated use parse() instead
- */
-
-function parseStringSync (xml) {
- var doc = new DOMParser().parseFromString(xml);
- var plist;
- if (doc.documentElement.nodeName !== 'plist') {
- throw new Error('malformed document. First element should be ');
- }
- plist = parsePlistXML(doc.documentElement);
-
- // if the plist is an array with 1 element, pull it out of the array
- if (plist.length == 1) {
- plist = plist[0];
- }
- return plist;
-}
-
-/**
- * Convert an XML based plist document into a JSON representation.
- *
- * @param {Object} xml_node - current XML node in the plist
- * @returns {Mixed} built up JSON object
- * @api private
- */
-
-function parsePlistXML (node) {
- var i, new_obj, key, val, new_arr, res, d;
-
- if (!node)
- return null;
-
- if (node.nodeName === 'plist') {
- new_arr = [];
- for (i=0; i < node.childNodes.length; i++) {
- // ignore comment nodes (text)
- if (!shouldIgnoreNode(node.childNodes[i])) {
- new_arr.push( parsePlistXML(node.childNodes[i]));
- }
- }
- return new_arr;
-
- } else if (node.nodeName === 'dict') {
- new_obj = {};
- key = null;
- for (i=0; i < node.childNodes.length; i++) {
- // ignore comment nodes (text)
- if (!shouldIgnoreNode(node.childNodes[i])) {
- if (key === null) {
- key = parsePlistXML(node.childNodes[i]);
- } else {
- new_obj[key] = parsePlistXML(node.childNodes[i]);
- key = null;
- }
- }
- }
- return new_obj;
-
- } else if (node.nodeName === 'array') {
- new_arr = [];
- for (i=0; i < node.childNodes.length; i++) {
- // ignore comment nodes (text)
- if (!shouldIgnoreNode(node.childNodes[i])) {
- res = parsePlistXML(node.childNodes[i]);
- if (null != res) new_arr.push(res);
- }
- }
- return new_arr;
-
- } else if (node.nodeName === '#text') {
- // TODO: what should we do with text types? (CDATA sections)
-
- } else if (node.nodeName === 'key') {
- return node.childNodes[0].nodeValue;
-
- } else if (node.nodeName === 'string') {
- res = '';
- for (d=0; d < node.childNodes.length; d++) {
- res += node.childNodes[d].nodeValue;
- }
- return res;
-
- } else if (node.nodeName === 'integer') {
- // parse as base 10 integer
- return parseInt(node.childNodes[0].nodeValue, 10);
-
- } else if (node.nodeName === 'real') {
- res = '';
- for (d=0; d < node.childNodes.length; d++) {
- if (node.childNodes[d].nodeType === 3) {
- res += node.childNodes[d].nodeValue;
- }
- }
- return parseFloat(res);
-
- } else if (node.nodeName === 'data') {
- res = '';
- for (d=0; d < node.childNodes.length; d++) {
- if (node.childNodes[d].nodeType === 3) {
- res += node.childNodes[d].nodeValue.replace(/\s+/g, '');
- }
- }
-
- // decode base64 data to a Buffer instance
- return new Buffer(res, 'base64');
-
- } else if (node.nodeName === 'date') {
- return new Date(node.childNodes[0].nodeValue);
-
- } else if (node.nodeName === 'true') {
- return true;
-
- } else if (node.nodeName === 'false') {
- return false;
- }
-}
-
-}).call(this,require("buffer").Buffer)
-},{"buffer":7,"util-deprecate":70,"xmldom":88}],4:[function(require,module,exports){
-
-var i;
-
-/**
- * Parser functions.
- */
-
-var parserFunctions = require('./parse');
-for (i in parserFunctions) exports[i] = parserFunctions[i];
-
-/**
- * Builder functions.
- */
-
-var builderFunctions = require('./build');
-for (i in builderFunctions) exports[i] = builderFunctions[i];
-
-/**
- * Add Node.js-specific functions (they're deprecated…).
- */
-
-var nodeFunctions = require('./node');
-for (i in nodeFunctions) exports[i] = nodeFunctions[i];
-
-},{"./build":1,"./node":2,"./parse":3}],5:[function(require,module,exports){
-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))
-
-},{}],6:[function(require,module,exports){
-
-},{}],7:[function(require,module,exports){
-(function (global){
-/*!
- * The buffer module from node.js, for the browser.
- *
- * @author Feross Aboukhadijeh
- * @license MIT
- */
-/* eslint-disable no-proto */
-
-var base64 = require('base64-js')
-var ieee754 = require('ieee754')
-var isArray = require('is-array')
-
-exports.Buffer = Buffer
-exports.SlowBuffer = SlowBuffer
-exports.INSPECT_MAX_BYTES = 50
-Buffer.poolSize = 8192 // not used by this implementation
-
-var rootParent = {}
-
-/**
- * If `Buffer.TYPED_ARRAY_SUPPORT`:
- * === true Use Uint8Array implementation (fastest)
- * === false Use Object implementation (most compatible, even IE6)
- *
- * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
- * Opera 11.6+, iOS 4.2+.
- *
- * Due to various browser bugs, sometimes the Object implementation will be used even
- * when the browser supports typed arrays.
- *
- * Note:
- *
- * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,
- * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
- *
- * - Safari 5-7 lacks support for changing the `Object.prototype.constructor` property
- * on objects.
- *
- * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.
- *
- * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of
- * incorrect length in some situations.
-
- * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they
- * get the Object implementation, which is slower but behaves correctly.
- */
-Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined
- ? global.TYPED_ARRAY_SUPPORT
- : typedArraySupport()
-
-function typedArraySupport () {
- function Bar () {}
- try {
- var arr = new Uint8Array(1)
- arr.foo = function () { return 42 }
- arr.constructor = Bar
- return arr.foo() === 42 && // typed array instances can be augmented
- arr.constructor === Bar && // constructor can be set
- typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`
- arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`
- } catch (e) {
- return false
- }
-}
-
-function kMaxLength () {
- return Buffer.TYPED_ARRAY_SUPPORT
- ? 0x7fffffff
- : 0x3fffffff
-}
-
-/**
- * Class: Buffer
- * =============
- *
- * The Buffer constructor returns instances of `Uint8Array` that are augmented
- * with function properties for all the node `Buffer` API functions. We use
- * `Uint8Array` so that square bracket notation works as expected -- it returns
- * a single octet.
- *
- * By augmenting the instances, we can avoid modifying the `Uint8Array`
- * prototype.
- */
-function Buffer (arg) {
- if (!(this instanceof Buffer)) {
- // Avoid going through an ArgumentsAdaptorTrampoline in the common case.
- if (arguments.length > 1) return new Buffer(arg, arguments[1])
- return new Buffer(arg)
- }
-
- this.length = 0
- this.parent = undefined
-
- // Common case.
- if (typeof arg === 'number') {
- return fromNumber(this, arg)
- }
-
- // Slightly less common case.
- if (typeof arg === 'string') {
- return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')
- }
-
- // Unusual.
- return fromObject(this, arg)
-}
-
-function fromNumber (that, length) {
- that = allocate(that, length < 0 ? 0 : checked(length) | 0)
- if (!Buffer.TYPED_ARRAY_SUPPORT) {
- for (var i = 0; i < length; i++) {
- that[i] = 0
- }
- }
- return that
-}
-
-function fromString (that, string, encoding) {
- if (typeof encoding !== 'string' || encoding === '') encoding = 'utf8'
-
- // Assumption: byteLength() return value is always < kMaxLength.
- var length = byteLength(string, encoding) | 0
- that = allocate(that, length)
-
- that.write(string, encoding)
- return that
-}
-
-function fromObject (that, object) {
- if (Buffer.isBuffer(object)) return fromBuffer(that, object)
-
- if (isArray(object)) return fromArray(that, object)
-
- if (object == null) {
- throw new TypeError('must start with number, buffer, array or string')
- }
-
- if (typeof ArrayBuffer !== 'undefined') {
- if (object.buffer instanceof ArrayBuffer) {
- return fromTypedArray(that, object)
- }
- if (object instanceof ArrayBuffer) {
- return fromArrayBuffer(that, object)
- }
- }
-
- if (object.length) return fromArrayLike(that, object)
-
- return fromJsonObject(that, object)
-}
-
-function fromBuffer (that, buffer) {
- var length = checked(buffer.length) | 0
- that = allocate(that, length)
- buffer.copy(that, 0, 0, length)
- return that
-}
-
-function fromArray (that, array) {
- var length = checked(array.length) | 0
- that = allocate(that, length)
- for (var i = 0; i < length; i += 1) {
- that[i] = array[i] & 255
- }
- return that
-}
-
-// Duplicate of fromArray() to keep fromArray() monomorphic.
-function fromTypedArray (that, array) {
- var length = checked(array.length) | 0
- that = allocate(that, length)
- // Truncating the elements is probably not what people expect from typed
- // arrays with BYTES_PER_ELEMENT > 1 but it's compatible with the behavior
- // of the old Buffer constructor.
- for (var i = 0; i < length; i += 1) {
- that[i] = array[i] & 255
- }
- return that
-}
-
-function fromArrayBuffer (that, array) {
- if (Buffer.TYPED_ARRAY_SUPPORT) {
- // Return an augmented `Uint8Array` instance, for best performance
- array.byteLength
- that = Buffer._augment(new Uint8Array(array))
- } else {
- // Fallback: Return an object instance of the Buffer class
- that = fromTypedArray(that, new Uint8Array(array))
- }
- return that
-}
-
-function fromArrayLike (that, array) {
- var length = checked(array.length) | 0
- that = allocate(that, length)
- for (var i = 0; i < length; i += 1) {
- that[i] = array[i] & 255
- }
- return that
-}
-
-// Deserialize { type: 'Buffer', data: [1,2,3,...] } into a Buffer object.
-// Returns a zero-length buffer for inputs that don't conform to the spec.
-function fromJsonObject (that, object) {
- var array
- var length = 0
-
- if (object.type === 'Buffer' && isArray(object.data)) {
- array = object.data
- length = checked(array.length) | 0
- }
- that = allocate(that, length)
-
- for (var i = 0; i < length; i += 1) {
- that[i] = array[i] & 255
- }
- return that
-}
-
-if (Buffer.TYPED_ARRAY_SUPPORT) {
- Buffer.prototype.__proto__ = Uint8Array.prototype
- Buffer.__proto__ = Uint8Array
-}
-
-function allocate (that, length) {
- if (Buffer.TYPED_ARRAY_SUPPORT) {
- // Return an augmented `Uint8Array` instance, for best performance
- that = Buffer._augment(new Uint8Array(length))
- that.__proto__ = Buffer.prototype
- } else {
- // Fallback: Return an object instance of the Buffer class
- that.length = length
- that._isBuffer = true
- }
-
- var fromPool = length !== 0 && length <= Buffer.poolSize >>> 1
- if (fromPool) that.parent = rootParent
-
- return that
-}
-
-function checked (length) {
- // Note: cannot use `length < kMaxLength` here because that fails when
- // length is NaN (which is otherwise coerced to zero.)
- if (length >= kMaxLength()) {
- throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
- 'size: 0x' + kMaxLength().toString(16) + ' bytes')
- }
- return length | 0
-}
-
-function SlowBuffer (subject, encoding) {
- if (!(this instanceof SlowBuffer)) return new SlowBuffer(subject, encoding)
-
- var buf = new Buffer(subject, encoding)
- delete buf.parent
- return buf
-}
-
-Buffer.isBuffer = function isBuffer (b) {
- return !!(b != null && b._isBuffer)
-}
-
-Buffer.compare = function compare (a, b) {
- if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
- throw new TypeError('Arguments must be Buffers')
- }
-
- if (a === b) return 0
-
- var x = a.length
- var y = b.length
-
- var i = 0
- var len = Math.min(x, y)
- while (i < len) {
- if (a[i] !== b[i]) break
-
- ++i
- }
-
- if (i !== len) {
- x = a[i]
- y = b[i]
- }
-
- if (x < y) return -1
- if (y < x) return 1
- return 0
-}
-
-Buffer.isEncoding = function isEncoding (encoding) {
- switch (String(encoding).toLowerCase()) {
- case 'hex':
- case 'utf8':
- case 'utf-8':
- case 'ascii':
- case 'binary':
- case 'base64':
- case 'raw':
- case 'ucs2':
- case 'ucs-2':
- case 'utf16le':
- case 'utf-16le':
- return true
- default:
- return false
- }
-}
-
-Buffer.concat = function concat (list, length) {
- if (!isArray(list)) throw new TypeError('list argument must be an Array of Buffers.')
-
- if (list.length === 0) {
- return new Buffer(0)
- }
-
- var i
- if (length === undefined) {
- length = 0
- for (i = 0; i < list.length; i++) {
- length += list[i].length
- }
- }
-
- var buf = new Buffer(length)
- var pos = 0
- for (i = 0; i < list.length; i++) {
- var item = list[i]
- item.copy(buf, pos)
- pos += item.length
- }
- return buf
-}
-
-function byteLength (string, encoding) {
- if (typeof string !== 'string') string = '' + string
-
- var len = string.length
- if (len === 0) return 0
-
- // Use a for loop to avoid recursion
- var loweredCase = false
- for (;;) {
- switch (encoding) {
- case 'ascii':
- case 'binary':
- // Deprecated
- case 'raw':
- case 'raws':
- return len
- case 'utf8':
- case 'utf-8':
- return utf8ToBytes(string).length
- case 'ucs2':
- case 'ucs-2':
- case 'utf16le':
- case 'utf-16le':
- return len * 2
- case 'hex':
- return len >>> 1
- case 'base64':
- return base64ToBytes(string).length
- default:
- if (loweredCase) return utf8ToBytes(string).length // assume utf8
- encoding = ('' + encoding).toLowerCase()
- loweredCase = true
- }
- }
-}
-Buffer.byteLength = byteLength
-
-// pre-set for values that may exist in the future
-Buffer.prototype.length = undefined
-Buffer.prototype.parent = undefined
-
-function slowToString (encoding, start, end) {
- var loweredCase = false
-
- start = start | 0
- end = end === undefined || end === Infinity ? this.length : end | 0
-
- if (!encoding) encoding = 'utf8'
- if (start < 0) start = 0
- if (end > this.length) end = this.length
- if (end <= start) return ''
-
- while (true) {
- switch (encoding) {
- case 'hex':
- return hexSlice(this, start, end)
-
- case 'utf8':
- case 'utf-8':
- return utf8Slice(this, start, end)
-
- case 'ascii':
- return asciiSlice(this, start, end)
-
- case 'binary':
- return binarySlice(this, start, end)
-
- case 'base64':
- return base64Slice(this, start, end)
-
- case 'ucs2':
- case 'ucs-2':
- case 'utf16le':
- case 'utf-16le':
- return utf16leSlice(this, start, end)
-
- default:
- if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
- encoding = (encoding + '').toLowerCase()
- loweredCase = true
- }
- }
-}
-
-Buffer.prototype.toString = function toString () {
- var length = this.length | 0
- if (length === 0) return ''
- if (arguments.length === 0) return utf8Slice(this, 0, length)
- return slowToString.apply(this, arguments)
-}
-
-Buffer.prototype.equals = function equals (b) {
- if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
- if (this === b) return true
- return Buffer.compare(this, b) === 0
-}
-
-Buffer.prototype.inspect = function inspect () {
- var str = ''
- var max = exports.INSPECT_MAX_BYTES
- if (this.length > 0) {
- str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')
- if (this.length > max) str += ' ... '
- }
- return ''
-}
-
-Buffer.prototype.compare = function compare (b) {
- if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
- if (this === b) return 0
- return Buffer.compare(this, b)
-}
-
-Buffer.prototype.indexOf = function indexOf (val, byteOffset) {
- if (byteOffset > 0x7fffffff) byteOffset = 0x7fffffff
- else if (byteOffset < -0x80000000) byteOffset = -0x80000000
- byteOffset >>= 0
-
- if (this.length === 0) return -1
- if (byteOffset >= this.length) return -1
-
- // Negative offsets start from the end of the buffer
- if (byteOffset < 0) byteOffset = Math.max(this.length + byteOffset, 0)
-
- if (typeof val === 'string') {
- if (val.length === 0) return -1 // special case: looking for empty string always fails
- return String.prototype.indexOf.call(this, val, byteOffset)
- }
- if (Buffer.isBuffer(val)) {
- return arrayIndexOf(this, val, byteOffset)
- }
- if (typeof val === 'number') {
- if (Buffer.TYPED_ARRAY_SUPPORT && Uint8Array.prototype.indexOf === 'function') {
- return Uint8Array.prototype.indexOf.call(this, val, byteOffset)
- }
- return arrayIndexOf(this, [ val ], byteOffset)
- }
-
- function arrayIndexOf (arr, val, byteOffset) {
- var foundIndex = -1
- for (var i = 0; byteOffset + i < arr.length; i++) {
- if (arr[byteOffset + i] === val[foundIndex === -1 ? 0 : i - foundIndex]) {
- if (foundIndex === -1) foundIndex = i
- if (i - foundIndex + 1 === val.length) return byteOffset + foundIndex
- } else {
- foundIndex = -1
- }
- }
- return -1
- }
-
- throw new TypeError('val must be string, number or Buffer')
-}
-
-// `get` is deprecated
-Buffer.prototype.get = function get (offset) {
- console.log('.get() is deprecated. Access using array indexes instead.')
- return this.readUInt8(offset)
-}
-
-// `set` is deprecated
-Buffer.prototype.set = function set (v, offset) {
- console.log('.set() is deprecated. Access using array indexes instead.')
- return this.writeUInt8(v, offset)
-}
-
-function hexWrite (buf, string, offset, length) {
- offset = Number(offset) || 0
- var remaining = buf.length - offset
- if (!length) {
- length = remaining
- } else {
- length = Number(length)
- if (length > remaining) {
- length = remaining
- }
- }
-
- // must be an even number of digits
- var strLen = string.length
- if (strLen % 2 !== 0) throw new Error('Invalid hex string')
-
- if (length > strLen / 2) {
- length = strLen / 2
- }
- for (var i = 0; i < length; i++) {
- var parsed = parseInt(string.substr(i * 2, 2), 16)
- if (isNaN(parsed)) throw new Error('Invalid hex string')
- buf[offset + i] = parsed
- }
- return i
-}
-
-function utf8Write (buf, string, offset, length) {
- return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
-}
-
-function asciiWrite (buf, string, offset, length) {
- return blitBuffer(asciiToBytes(string), buf, offset, length)
-}
-
-function binaryWrite (buf, string, offset, length) {
- return asciiWrite(buf, string, offset, length)
-}
-
-function base64Write (buf, string, offset, length) {
- return blitBuffer(base64ToBytes(string), buf, offset, length)
-}
-
-function ucs2Write (buf, string, offset, length) {
- return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
-}
-
-Buffer.prototype.write = function write (string, offset, length, encoding) {
- // Buffer#write(string)
- if (offset === undefined) {
- encoding = 'utf8'
- length = this.length
- offset = 0
- // Buffer#write(string, encoding)
- } else if (length === undefined && typeof offset === 'string') {
- encoding = offset
- length = this.length
- offset = 0
- // Buffer#write(string, offset[, length][, encoding])
- } else if (isFinite(offset)) {
- offset = offset | 0
- if (isFinite(length)) {
- length = length | 0
- if (encoding === undefined) encoding = 'utf8'
- } else {
- encoding = length
- length = undefined
- }
- // legacy write(string, encoding, offset, length) - remove in v0.13
- } else {
- var swap = encoding
- encoding = offset
- offset = length | 0
- length = swap
- }
-
- var remaining = this.length - offset
- if (length === undefined || length > remaining) length = remaining
-
- if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
- throw new RangeError('attempt to write outside buffer bounds')
- }
-
- if (!encoding) encoding = 'utf8'
-
- var loweredCase = false
- for (;;) {
- switch (encoding) {
- case 'hex':
- return hexWrite(this, string, offset, length)
-
- case 'utf8':
- case 'utf-8':
- return utf8Write(this, string, offset, length)
-
- case 'ascii':
- return asciiWrite(this, string, offset, length)
-
- case 'binary':
- return binaryWrite(this, string, offset, length)
-
- case 'base64':
- // Warning: maxLength not taken into account in base64Write
- return base64Write(this, string, offset, length)
-
- case 'ucs2':
- case 'ucs-2':
- case 'utf16le':
- case 'utf-16le':
- return ucs2Write(this, string, offset, length)
-
- default:
- if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
- encoding = ('' + encoding).toLowerCase()
- loweredCase = true
- }
- }
-}
-
-Buffer.prototype.toJSON = function toJSON () {
- return {
- type: 'Buffer',
- data: Array.prototype.slice.call(this._arr || this, 0)
- }
-}
-
-function base64Slice (buf, start, end) {
- if (start === 0 && end === buf.length) {
- return base64.fromByteArray(buf)
- } else {
- return base64.fromByteArray(buf.slice(start, end))
- }
-}
-
-function utf8Slice (buf, start, end) {
- end = Math.min(buf.length, end)
- var res = []
-
- var i = start
- while (i < end) {
- var firstByte = buf[i]
- var codePoint = null
- var bytesPerSequence = (firstByte > 0xEF) ? 4
- : (firstByte > 0xDF) ? 3
- : (firstByte > 0xBF) ? 2
- : 1
-
- if (i + bytesPerSequence <= end) {
- var secondByte, thirdByte, fourthByte, tempCodePoint
-
- switch (bytesPerSequence) {
- case 1:
- if (firstByte < 0x80) {
- codePoint = firstByte
- }
- break
- case 2:
- secondByte = buf[i + 1]
- if ((secondByte & 0xC0) === 0x80) {
- tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
- if (tempCodePoint > 0x7F) {
- codePoint = tempCodePoint
- }
- }
- break
- case 3:
- secondByte = buf[i + 1]
- thirdByte = buf[i + 2]
- if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
- tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
- if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
- codePoint = tempCodePoint
- }
- }
- break
- case 4:
- secondByte = buf[i + 1]
- thirdByte = buf[i + 2]
- fourthByte = buf[i + 3]
- if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
- tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
- if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
- codePoint = tempCodePoint
- }
- }
- }
- }
-
- if (codePoint === null) {
- // we did not generate a valid codePoint so insert a
- // replacement char (U+FFFD) and advance only 1 byte
- codePoint = 0xFFFD
- bytesPerSequence = 1
- } else if (codePoint > 0xFFFF) {
- // encode to utf16 (surrogate pair dance)
- codePoint -= 0x10000
- res.push(codePoint >>> 10 & 0x3FF | 0xD800)
- codePoint = 0xDC00 | codePoint & 0x3FF
- }
-
- res.push(codePoint)
- i += bytesPerSequence
- }
-
- return decodeCodePointsArray(res)
-}
-
-// Based on http://stackoverflow.com/a/22747272/680742, the browser with
-// the lowest limit is Chrome, with 0x10000 args.
-// We go 1 magnitude less, for safety
-var MAX_ARGUMENTS_LENGTH = 0x1000
-
-function decodeCodePointsArray (codePoints) {
- var len = codePoints.length
- if (len <= MAX_ARGUMENTS_LENGTH) {
- return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
- }
-
- // Decode in chunks to avoid "call stack size exceeded".
- var res = ''
- var i = 0
- while (i < len) {
- res += String.fromCharCode.apply(
- String,
- codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
- )
- }
- return res
-}
-
-function asciiSlice (buf, start, end) {
- var ret = ''
- end = Math.min(buf.length, end)
-
- for (var i = start; i < end; i++) {
- ret += String.fromCharCode(buf[i] & 0x7F)
- }
- return ret
-}
-
-function binarySlice (buf, start, end) {
- var ret = ''
- end = Math.min(buf.length, end)
-
- for (var i = start; i < end; i++) {
- ret += String.fromCharCode(buf[i])
- }
- return ret
-}
-
-function hexSlice (buf, start, end) {
- var len = buf.length
-
- if (!start || start < 0) start = 0
- if (!end || end < 0 || end > len) end = len
-
- var out = ''
- for (var i = start; i < end; i++) {
- out += toHex(buf[i])
- }
- return out
-}
-
-function utf16leSlice (buf, start, end) {
- var bytes = buf.slice(start, end)
- var res = ''
- for (var i = 0; i < bytes.length; i += 2) {
- res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)
- }
- return res
-}
-
-Buffer.prototype.slice = function slice (start, end) {
- var len = this.length
- start = ~~start
- end = end === undefined ? len : ~~end
-
- if (start < 0) {
- start += len
- if (start < 0) start = 0
- } else if (start > len) {
- start = len
- }
-
- if (end < 0) {
- end += len
- if (end < 0) end = 0
- } else if (end > len) {
- end = len
- }
-
- if (end < start) end = start
-
- var newBuf
- if (Buffer.TYPED_ARRAY_SUPPORT) {
- newBuf = Buffer._augment(this.subarray(start, end))
- } else {
- var sliceLen = end - start
- newBuf = new Buffer(sliceLen, undefined)
- for (var i = 0; i < sliceLen; i++) {
- newBuf[i] = this[i + start]
- }
- }
-
- if (newBuf.length) newBuf.parent = this.parent || this
-
- return newBuf
-}
-
-/*
- * Need to make sure that buffer isn't trying to write out of bounds.
- */
-function checkOffset (offset, ext, length) {
- if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
- if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
-}
-
-Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
- offset = offset | 0
- byteLength = byteLength | 0
- if (!noAssert) checkOffset(offset, byteLength, this.length)
-
- var val = this[offset]
- var mul = 1
- var i = 0
- while (++i < byteLength && (mul *= 0x100)) {
- val += this[offset + i] * mul
- }
-
- return val
-}
-
-Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
- offset = offset | 0
- byteLength = byteLength | 0
- if (!noAssert) {
- checkOffset(offset, byteLength, this.length)
- }
-
- var val = this[offset + --byteLength]
- var mul = 1
- while (byteLength > 0 && (mul *= 0x100)) {
- val += this[offset + --byteLength] * mul
- }
-
- return val
-}
-
-Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 1, this.length)
- return this[offset]
-}
-
-Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 2, this.length)
- return this[offset] | (this[offset + 1] << 8)
-}
-
-Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 2, this.length)
- return (this[offset] << 8) | this[offset + 1]
-}
-
-Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 4, this.length)
-
- return ((this[offset]) |
- (this[offset + 1] << 8) |
- (this[offset + 2] << 16)) +
- (this[offset + 3] * 0x1000000)
-}
-
-Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 4, this.length)
-
- return (this[offset] * 0x1000000) +
- ((this[offset + 1] << 16) |
- (this[offset + 2] << 8) |
- this[offset + 3])
-}
-
-Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
- offset = offset | 0
- byteLength = byteLength | 0
- if (!noAssert) checkOffset(offset, byteLength, this.length)
-
- var val = this[offset]
- var mul = 1
- var i = 0
- while (++i < byteLength && (mul *= 0x100)) {
- val += this[offset + i] * mul
- }
- mul *= 0x80
-
- if (val >= mul) val -= Math.pow(2, 8 * byteLength)
-
- return val
-}
-
-Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
- offset = offset | 0
- byteLength = byteLength | 0
- if (!noAssert) checkOffset(offset, byteLength, this.length)
-
- var i = byteLength
- var mul = 1
- var val = this[offset + --i]
- while (i > 0 && (mul *= 0x100)) {
- val += this[offset + --i] * mul
- }
- mul *= 0x80
-
- if (val >= mul) val -= Math.pow(2, 8 * byteLength)
-
- return val
-}
-
-Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 1, this.length)
- if (!(this[offset] & 0x80)) return (this[offset])
- return ((0xff - this[offset] + 1) * -1)
-}
-
-Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 2, this.length)
- var val = this[offset] | (this[offset + 1] << 8)
- return (val & 0x8000) ? val | 0xFFFF0000 : val
-}
-
-Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 2, this.length)
- var val = this[offset + 1] | (this[offset] << 8)
- return (val & 0x8000) ? val | 0xFFFF0000 : val
-}
-
-Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 4, this.length)
-
- return (this[offset]) |
- (this[offset + 1] << 8) |
- (this[offset + 2] << 16) |
- (this[offset + 3] << 24)
-}
-
-Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 4, this.length)
-
- return (this[offset] << 24) |
- (this[offset + 1] << 16) |
- (this[offset + 2] << 8) |
- (this[offset + 3])
-}
-
-Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 4, this.length)
- return ieee754.read(this, offset, true, 23, 4)
-}
-
-Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 4, this.length)
- return ieee754.read(this, offset, false, 23, 4)
-}
-
-Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 8, this.length)
- return ieee754.read(this, offset, true, 52, 8)
-}
-
-Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 8, this.length)
- return ieee754.read(this, offset, false, 52, 8)
-}
-
-function checkInt (buf, value, offset, ext, max, min) {
- if (!Buffer.isBuffer(buf)) throw new TypeError('buffer must be a Buffer instance')
- if (value > max || value < min) throw new RangeError('value is out of bounds')
- if (offset + ext > buf.length) throw new RangeError('index out of range')
-}
-
-Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
- value = +value
- offset = offset | 0
- byteLength = byteLength | 0
- if (!noAssert) checkInt(this, value, offset, byteLength, Math.pow(2, 8 * byteLength), 0)
-
- var mul = 1
- var i = 0
- this[offset] = value & 0xFF
- while (++i < byteLength && (mul *= 0x100)) {
- this[offset + i] = (value / mul) & 0xFF
- }
-
- return offset + byteLength
-}
-
-Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
- value = +value
- offset = offset | 0
- byteLength = byteLength | 0
- if (!noAssert) checkInt(this, value, offset, byteLength, Math.pow(2, 8 * byteLength), 0)
-
- var i = byteLength - 1
- var mul = 1
- this[offset + i] = value & 0xFF
- while (--i >= 0 && (mul *= 0x100)) {
- this[offset + i] = (value / mul) & 0xFF
- }
-
- return offset + byteLength
-}
-
-Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
- value = +value
- offset = offset | 0
- if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
- if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
- this[offset] = (value & 0xff)
- return offset + 1
-}
-
-function objectWriteUInt16 (buf, value, offset, littleEndian) {
- if (value < 0) value = 0xffff + value + 1
- for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; i++) {
- buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>
- (littleEndian ? i : 1 - i) * 8
- }
-}
-
-Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
- value = +value
- offset = offset | 0
- if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
- if (Buffer.TYPED_ARRAY_SUPPORT) {
- this[offset] = (value & 0xff)
- this[offset + 1] = (value >>> 8)
- } else {
- objectWriteUInt16(this, value, offset, true)
- }
- return offset + 2
-}
-
-Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
- value = +value
- offset = offset | 0
- if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
- if (Buffer.TYPED_ARRAY_SUPPORT) {
- this[offset] = (value >>> 8)
- this[offset + 1] = (value & 0xff)
- } else {
- objectWriteUInt16(this, value, offset, false)
- }
- return offset + 2
-}
-
-function objectWriteUInt32 (buf, value, offset, littleEndian) {
- if (value < 0) value = 0xffffffff + value + 1
- for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; i++) {
- buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff
- }
-}
-
-Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
- value = +value
- offset = offset | 0
- if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
- if (Buffer.TYPED_ARRAY_SUPPORT) {
- this[offset + 3] = (value >>> 24)
- this[offset + 2] = (value >>> 16)
- this[offset + 1] = (value >>> 8)
- this[offset] = (value & 0xff)
- } else {
- objectWriteUInt32(this, value, offset, true)
- }
- return offset + 4
-}
-
-Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
- value = +value
- offset = offset | 0
- if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
- if (Buffer.TYPED_ARRAY_SUPPORT) {
- this[offset] = (value >>> 24)
- this[offset + 1] = (value >>> 16)
- this[offset + 2] = (value >>> 8)
- this[offset + 3] = (value & 0xff)
- } else {
- objectWriteUInt32(this, value, offset, false)
- }
- return offset + 4
-}
-
-Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
- value = +value
- offset = offset | 0
- if (!noAssert) {
- var limit = Math.pow(2, 8 * byteLength - 1)
-
- checkInt(this, value, offset, byteLength, limit - 1, -limit)
- }
-
- var i = 0
- var mul = 1
- var sub = value < 0 ? 1 : 0
- this[offset] = value & 0xFF
- while (++i < byteLength && (mul *= 0x100)) {
- this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
- }
-
- return offset + byteLength
-}
-
-Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
- value = +value
- offset = offset | 0
- if (!noAssert) {
- var limit = Math.pow(2, 8 * byteLength - 1)
-
- checkInt(this, value, offset, byteLength, limit - 1, -limit)
- }
-
- var i = byteLength - 1
- var mul = 1
- var sub = value < 0 ? 1 : 0
- this[offset + i] = value & 0xFF
- while (--i >= 0 && (mul *= 0x100)) {
- this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
- }
-
- return offset + byteLength
-}
-
-Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
- value = +value
- offset = offset | 0
- if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
- if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
- if (value < 0) value = 0xff + value + 1
- this[offset] = (value & 0xff)
- return offset + 1
-}
-
-Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
- value = +value
- offset = offset | 0
- if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
- if (Buffer.TYPED_ARRAY_SUPPORT) {
- this[offset] = (value & 0xff)
- this[offset + 1] = (value >>> 8)
- } else {
- objectWriteUInt16(this, value, offset, true)
- }
- return offset + 2
-}
-
-Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
- value = +value
- offset = offset | 0
- if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
- if (Buffer.TYPED_ARRAY_SUPPORT) {
- this[offset] = (value >>> 8)
- this[offset + 1] = (value & 0xff)
- } else {
- objectWriteUInt16(this, value, offset, false)
- }
- return offset + 2
-}
-
-Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
- value = +value
- offset = offset | 0
- if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
- if (Buffer.TYPED_ARRAY_SUPPORT) {
- this[offset] = (value & 0xff)
- this[offset + 1] = (value >>> 8)
- this[offset + 2] = (value >>> 16)
- this[offset + 3] = (value >>> 24)
- } else {
- objectWriteUInt32(this, value, offset, true)
- }
- return offset + 4
-}
-
-Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
- value = +value
- offset = offset | 0
- if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
- if (value < 0) value = 0xffffffff + value + 1
- if (Buffer.TYPED_ARRAY_SUPPORT) {
- this[offset] = (value >>> 24)
- this[offset + 1] = (value >>> 16)
- this[offset + 2] = (value >>> 8)
- this[offset + 3] = (value & 0xff)
- } else {
- objectWriteUInt32(this, value, offset, false)
- }
- return offset + 4
-}
-
-function checkIEEE754 (buf, value, offset, ext, max, min) {
- if (value > max || value < min) throw new RangeError('value is out of bounds')
- if (offset + ext > buf.length) throw new RangeError('index out of range')
- if (offset < 0) throw new RangeError('index out of range')
-}
-
-function writeFloat (buf, value, offset, littleEndian, noAssert) {
- if (!noAssert) {
- checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
- }
- ieee754.write(buf, value, offset, littleEndian, 23, 4)
- return offset + 4
-}
-
-Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
- return writeFloat(this, value, offset, true, noAssert)
-}
-
-Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
- return writeFloat(this, value, offset, false, noAssert)
-}
-
-function writeDouble (buf, value, offset, littleEndian, noAssert) {
- if (!noAssert) {
- checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
- }
- ieee754.write(buf, value, offset, littleEndian, 52, 8)
- return offset + 8
-}
-
-Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
- return writeDouble(this, value, offset, true, noAssert)
-}
-
-Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
- return writeDouble(this, value, offset, false, noAssert)
-}
-
-// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
-Buffer.prototype.copy = function copy (target, targetStart, start, end) {
- if (!start) start = 0
- if (!end && end !== 0) end = this.length
- if (targetStart >= target.length) targetStart = target.length
- if (!targetStart) targetStart = 0
- if (end > 0 && end < start) end = start
-
- // Copy 0 bytes; we're done
- if (end === start) return 0
- if (target.length === 0 || this.length === 0) return 0
-
- // Fatal error conditions
- if (targetStart < 0) {
- throw new RangeError('targetStart out of bounds')
- }
- if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')
- if (end < 0) throw new RangeError('sourceEnd out of bounds')
-
- // Are we oob?
- if (end > this.length) end = this.length
- if (target.length - targetStart < end - start) {
- end = target.length - targetStart + start
- }
-
- var len = end - start
- var i
-
- if (this === target && start < targetStart && targetStart < end) {
- // descending copy from end
- for (i = len - 1; i >= 0; i--) {
- target[i + targetStart] = this[i + start]
- }
- } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
- // ascending copy from start
- for (i = 0; i < len; i++) {
- target[i + targetStart] = this[i + start]
- }
- } else {
- target._set(this.subarray(start, start + len), targetStart)
- }
-
- return len
-}
-
-// fill(value, start=0, end=buffer.length)
-Buffer.prototype.fill = function fill (value, start, end) {
- if (!value) value = 0
- if (!start) start = 0
- if (!end) end = this.length
-
- if (end < start) throw new RangeError('end < start')
-
- // Fill 0 bytes; we're done
- if (end === start) return
- if (this.length === 0) return
-
- if (start < 0 || start >= this.length) throw new RangeError('start out of bounds')
- if (end < 0 || end > this.length) throw new RangeError('end out of bounds')
-
- var i
- if (typeof value === 'number') {
- for (i = start; i < end; i++) {
- this[i] = value
- }
- } else {
- var bytes = utf8ToBytes(value.toString())
- var len = bytes.length
- for (i = start; i < end; i++) {
- this[i] = bytes[i % len]
- }
- }
-
- return this
-}
-
-/**
- * Creates a new `ArrayBuffer` with the *copied* memory of the buffer instance.
- * Added in Node 0.12. Only available in browsers that support ArrayBuffer.
- */
-Buffer.prototype.toArrayBuffer = function toArrayBuffer () {
- if (typeof Uint8Array !== 'undefined') {
- if (Buffer.TYPED_ARRAY_SUPPORT) {
- return (new Buffer(this)).buffer
- } else {
- var buf = new Uint8Array(this.length)
- for (var i = 0, len = buf.length; i < len; i += 1) {
- buf[i] = this[i]
- }
- return buf.buffer
- }
- } else {
- throw new TypeError('Buffer.toArrayBuffer not supported in this browser')
- }
-}
-
-// HELPER FUNCTIONS
-// ================
-
-var BP = Buffer.prototype
-
-/**
- * Augment a Uint8Array *instance* (not the Uint8Array class!) with Buffer methods
- */
-Buffer._augment = function _augment (arr) {
- arr.constructor = Buffer
- arr._isBuffer = true
-
- // save reference to original Uint8Array set method before overwriting
- arr._set = arr.set
-
- // deprecated
- arr.get = BP.get
- arr.set = BP.set
-
- arr.write = BP.write
- arr.toString = BP.toString
- arr.toLocaleString = BP.toString
- arr.toJSON = BP.toJSON
- arr.equals = BP.equals
- arr.compare = BP.compare
- arr.indexOf = BP.indexOf
- arr.copy = BP.copy
- arr.slice = BP.slice
- arr.readUIntLE = BP.readUIntLE
- arr.readUIntBE = BP.readUIntBE
- arr.readUInt8 = BP.readUInt8
- arr.readUInt16LE = BP.readUInt16LE
- arr.readUInt16BE = BP.readUInt16BE
- arr.readUInt32LE = BP.readUInt32LE
- arr.readUInt32BE = BP.readUInt32BE
- arr.readIntLE = BP.readIntLE
- arr.readIntBE = BP.readIntBE
- arr.readInt8 = BP.readInt8
- arr.readInt16LE = BP.readInt16LE
- arr.readInt16BE = BP.readInt16BE
- arr.readInt32LE = BP.readInt32LE
- arr.readInt32BE = BP.readInt32BE
- arr.readFloatLE = BP.readFloatLE
- arr.readFloatBE = BP.readFloatBE
- arr.readDoubleLE = BP.readDoubleLE
- arr.readDoubleBE = BP.readDoubleBE
- arr.writeUInt8 = BP.writeUInt8
- arr.writeUIntLE = BP.writeUIntLE
- arr.writeUIntBE = BP.writeUIntBE
- arr.writeUInt16LE = BP.writeUInt16LE
- arr.writeUInt16BE = BP.writeUInt16BE
- arr.writeUInt32LE = BP.writeUInt32LE
- arr.writeUInt32BE = BP.writeUInt32BE
- arr.writeIntLE = BP.writeIntLE
- arr.writeIntBE = BP.writeIntBE
- arr.writeInt8 = BP.writeInt8
- arr.writeInt16LE = BP.writeInt16LE
- arr.writeInt16BE = BP.writeInt16BE
- arr.writeInt32LE = BP.writeInt32LE
- arr.writeInt32BE = BP.writeInt32BE
- arr.writeFloatLE = BP.writeFloatLE
- arr.writeFloatBE = BP.writeFloatBE
- arr.writeDoubleLE = BP.writeDoubleLE
- arr.writeDoubleBE = BP.writeDoubleBE
- arr.fill = BP.fill
- arr.inspect = BP.inspect
- arr.toArrayBuffer = BP.toArrayBuffer
-
- return arr
-}
-
-var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g
-
-function base64clean (str) {
- // Node strips out invalid characters like \n and \t from the string, base64-js does not
- str = stringtrim(str).replace(INVALID_BASE64_RE, '')
- // Node converts strings with length < 2 to ''
- if (str.length < 2) return ''
- // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
- while (str.length % 4 !== 0) {
- str = str + '='
- }
- return str
-}
-
-function stringtrim (str) {
- if (str.trim) return str.trim()
- return str.replace(/^\s+|\s+$/g, '')
-}
-
-function toHex (n) {
- if (n < 16) return '0' + n.toString(16)
- return n.toString(16)
-}
-
-function utf8ToBytes (string, units) {
- units = units || Infinity
- var codePoint
- var length = string.length
- var leadSurrogate = null
- var bytes = []
-
- for (var i = 0; i < length; i++) {
- codePoint = string.charCodeAt(i)
-
- // is surrogate component
- if (codePoint > 0xD7FF && codePoint < 0xE000) {
- // last char was a lead
- if (!leadSurrogate) {
- // no lead yet
- if (codePoint > 0xDBFF) {
- // unexpected trail
- if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
- continue
- } else if (i + 1 === length) {
- // unpaired lead
- if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
- continue
- }
-
- // valid lead
- leadSurrogate = codePoint
-
- continue
- }
-
- // 2 leads in a row
- if (codePoint < 0xDC00) {
- if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
- leadSurrogate = codePoint
- continue
- }
-
- // valid surrogate pair
- codePoint = leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00 | 0x10000
- } else if (leadSurrogate) {
- // valid bmp char, but last char was a lead
- if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
- }
-
- leadSurrogate = null
-
- // encode utf8
- if (codePoint < 0x80) {
- if ((units -= 1) < 0) break
- bytes.push(codePoint)
- } else if (codePoint < 0x800) {
- if ((units -= 2) < 0) break
- bytes.push(
- codePoint >> 0x6 | 0xC0,
- codePoint & 0x3F | 0x80
- )
- } else if (codePoint < 0x10000) {
- if ((units -= 3) < 0) break
- bytes.push(
- codePoint >> 0xC | 0xE0,
- codePoint >> 0x6 & 0x3F | 0x80,
- codePoint & 0x3F | 0x80
- )
- } else if (codePoint < 0x110000) {
- if ((units -= 4) < 0) break
- bytes.push(
- codePoint >> 0x12 | 0xF0,
- codePoint >> 0xC & 0x3F | 0x80,
- codePoint >> 0x6 & 0x3F | 0x80,
- codePoint & 0x3F | 0x80
- )
- } else {
- throw new Error('Invalid code point')
- }
- }
-
- return bytes
-}
-
-function asciiToBytes (str) {
- var byteArray = []
- for (var i = 0; i < str.length; i++) {
- // Node's code seems to be doing this and not & 0x7F..
- byteArray.push(str.charCodeAt(i) & 0xFF)
- }
- return byteArray
-}
-
-function utf16leToBytes (str, units) {
- var c, hi, lo
- var byteArray = []
- for (var i = 0; i < str.length; i++) {
- if ((units -= 2) < 0) break
-
- c = str.charCodeAt(i)
- hi = c >> 8
- lo = c % 256
- byteArray.push(lo)
- byteArray.push(hi)
- }
-
- return byteArray
-}
-
-function base64ToBytes (str) {
- return base64.toByteArray(base64clean(str))
-}
-
-function blitBuffer (src, dst, offset, length) {
- for (var i = 0; i < length; i++) {
- if ((i + offset >= dst.length) || (i >= src.length)) break
- dst[i + offset] = src[i]
- }
- return i
-}
-
-}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
-},{"base64-js":5,"ieee754":8,"is-array":9}],8:[function(require,module,exports){
-exports.read = function (buffer, offset, isLE, mLen, nBytes) {
- var e, m
- var eLen = nBytes * 8 - mLen - 1
- var eMax = (1 << eLen) - 1
- var eBias = eMax >> 1
- var nBits = -7
- var i = isLE ? (nBytes - 1) : 0
- var d = isLE ? -1 : 1
- var s = buffer[offset + i]
-
- i += d
-
- e = s & ((1 << (-nBits)) - 1)
- s >>= (-nBits)
- nBits += eLen
- for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}
-
- m = e & ((1 << (-nBits)) - 1)
- e >>= (-nBits)
- nBits += mLen
- for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}
-
- if (e === 0) {
- e = 1 - eBias
- } else if (e === eMax) {
- return m ? NaN : ((s ? -1 : 1) * Infinity)
- } else {
- m = m + Math.pow(2, mLen)
- e = e - eBias
- }
- return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
-}
-
-exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
- var e, m, c
- var eLen = nBytes * 8 - mLen - 1
- var eMax = (1 << eLen) - 1
- var eBias = eMax >> 1
- var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
- var i = isLE ? 0 : (nBytes - 1)
- var d = isLE ? 1 : -1
- var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
-
- value = Math.abs(value)
-
- if (isNaN(value) || value === Infinity) {
- m = isNaN(value) ? 1 : 0
- e = eMax
- } else {
- e = Math.floor(Math.log(value) / Math.LN2)
- if (value * (c = Math.pow(2, -e)) < 1) {
- e--
- c *= 2
- }
- if (e + eBias >= 1) {
- value += rt / c
- } else {
- value += rt * Math.pow(2, 1 - eBias)
- }
- if (value * c >= 2) {
- e++
- c /= 2
- }
-
- if (e + eBias >= eMax) {
- m = 0
- e = eMax
- } else if (e + eBias >= 1) {
- m = (value * c - 1) * Math.pow(2, mLen)
- e = e + eBias
- } else {
- m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
- e = 0
- }
- }
-
- for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
-
- e = (e << mLen) | m
- eLen += mLen
- for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
-
- buffer[offset + i - d] |= s * 128
-}
-
-},{}],9:[function(require,module,exports){
-
-/**
- * isArray
- */
-
-var isArray = Array.isArray;
-
-/**
- * toString
- */
-
-var str = Object.prototype.toString;
-
-/**
- * Whether or not the given `val`
- * is an array.
- *
- * example:
- *
- * isArray([]);
- * // > true
- * isArray(arguments);
- * // > false
- * isArray('');
- * // > false
- *
- * @param {mixed} val
- * @return {bool}
- */
-
-module.exports = isArray || function (val) {
- return !! val && '[object Array]' == str.call(val);
-};
-
-},{}],10:[function(require,module,exports){
-/**
- * Determine if an object is Buffer
- *
- * Author: Feross Aboukhadijeh
- * License: MIT
- *
- * `npm install is-buffer`
- */
-
-module.exports = function (obj) {
- return !!(obj != null &&
- (obj._isBuffer || // For Safari 5-7 (missing Object.prototype.constructor)
- (obj.constructor &&
- typeof obj.constructor.isBuffer === 'function' &&
- obj.constructor.isBuffer(obj))
- ))
-}
-
-},{}],11:[function(require,module,exports){
-/**
- * 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;
-
-},{}],12:[function(require,module,exports){
-var arrayEvery = require('../internal/arrayEvery'),
- baseCallback = require('../internal/baseCallback'),
- baseEvery = require('../internal/baseEvery'),
- isArray = require('../lang/isArray'),
- isIterateeCall = require('../internal/isIterateeCall');
-
-/**
- * Checks if `predicate` returns truthy for **all** elements of `collection`.
- * The predicate is bound to `thisArg` and invoked with three arguments:
- * (value, index|key, collection).
- *
- * 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 _
- * @alias all
- * @category Collection
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function|Object|string} [predicate=_.identity] The function invoked
- * per iteration.
- * @param {*} [thisArg] The `this` binding of `predicate`.
- * @returns {boolean} Returns `true` if all elements pass the predicate check,
- * else `false`.
- * @example
- *
- * _.every([true, 1, null, 'yes'], Boolean);
- * // => false
- *
- * var users = [
- * { 'user': 'barney', 'active': false },
- * { 'user': 'fred', 'active': false }
- * ];
- *
- * // using the `_.matches` callback shorthand
- * _.every(users, { 'user': 'barney', 'active': false });
- * // => false
- *
- * // using the `_.matchesProperty` callback shorthand
- * _.every(users, 'active', false);
- * // => true
- *
- * // using the `_.property` callback shorthand
- * _.every(users, 'active');
- * // => false
- */
-function every(collection, predicate, thisArg) {
- var func = isArray(collection) ? arrayEvery : baseEvery;
- if (thisArg && isIterateeCall(collection, predicate, thisArg)) {
- predicate = undefined;
- }
- if (typeof predicate != 'function' || thisArg !== undefined) {
- predicate = baseCallback(predicate, thisArg, 3);
- }
- return func(collection, predicate);
-}
-
-module.exports = every;
-
-},{"../internal/arrayEvery":14,"../internal/baseCallback":18,"../internal/baseEvery":22,"../internal/isIterateeCall":47,"../lang/isArray":56}],13:[function(require,module,exports){
-/** Used as the `TypeError` message for "Functions" methods. */
-var FUNC_ERROR_TEXT = 'Expected a function';
-
-/* Native method references for those with the same name as other `lodash` methods. */
-var nativeMax = Math.max;
-
-/**
- * Creates a function that invokes `func` with the `this` binding of the
- * created function and arguments from `start` and beyond provided as an array.
- *
- * **Note:** This method is based on the [rest parameter](https://developer.mozilla.org/Web/JavaScript/Reference/Functions/rest_parameters).
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {Function} func The function to apply a rest parameter to.
- * @param {number} [start=func.length-1] The start position of the rest parameter.
- * @returns {Function} Returns the new function.
- * @example
- *
- * var say = _.restParam(function(what, names) {
- * return what + ' ' + _.initial(names).join(', ') +
- * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
- * });
- *
- * say('hello', 'fred', 'barney', 'pebbles');
- * // => 'hello fred, barney, & pebbles'
- */
-function restParam(func, start) {
- if (typeof func != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0);
- return function() {
- var args = arguments,
- index = -1,
- length = nativeMax(args.length - start, 0),
- rest = Array(length);
-
- while (++index < length) {
- rest[index] = args[start + index];
- }
- switch (start) {
- case 0: return func.call(this, rest);
- case 1: return func.call(this, args[0], rest);
- case 2: return func.call(this, args[0], args[1], rest);
- }
- var otherArgs = Array(start + 1);
- index = -1;
- while (++index < start) {
- otherArgs[index] = args[index];
- }
- otherArgs[start] = rest;
- return func.apply(this, otherArgs);
- };
-}
-
-module.exports = restParam;
-
-},{}],14:[function(require,module,exports){
-/**
- * A specialized version of `_.every` for arrays without support for callback
- * shorthands and `this` binding.
- *
- * @private
- * @param {Array} array The array to iterate over.
- * @param {Function} predicate The function invoked per iteration.
- * @returns {boolean} Returns `true` if all elements pass the predicate check,
- * else `false`.
- */
-function arrayEvery(array, predicate) {
- var index = -1,
- length = array.length;
-
- while (++index < length) {
- if (!predicate(array[index], index, array)) {
- return false;
- }
- }
- return true;
-}
-
-module.exports = arrayEvery;
-
-},{}],15:[function(require,module,exports){
-/**
- * A specialized version of `_.some` for arrays without support for callback
- * shorthands and `this` binding.
- *
- * @private
- * @param {Array} array The array to iterate over.
- * @param {Function} predicate The function invoked per iteration.
- * @returns {boolean} Returns `true` if any element passes the predicate check,
- * else `false`.
- */
-function arraySome(array, predicate) {
- var index = -1,
- length = array.length;
-
- while (++index < length) {
- if (predicate(array[index], index, array)) {
- return true;
- }
- }
- return false;
-}
-
-module.exports = arraySome;
-
-},{}],16:[function(require,module,exports){
-var keys = require('../object/keys');
-
-/**
- * A specialized version of `_.assign` for customizing assigned values without
- * support for argument juggling, multiple sources, and `this` binding `customizer`
- * functions.
- *
- * @private
- * @param {Object} object The destination object.
- * @param {Object} source The source object.
- * @param {Function} customizer The function to customize assigned values.
- * @returns {Object} Returns `object`.
- */
-function assignWith(object, source, customizer) {
- var index = -1,
- props = keys(source),
- length = props.length;
-
- while (++index < length) {
- var key = props[index],
- value = object[key],
- result = customizer(value, source[key], key, object, source);
-
- if ((result === result ? (result !== value) : (value === value)) ||
- (value === undefined && !(key in object))) {
- object[key] = result;
- }
- }
- return object;
-}
-
-module.exports = assignWith;
-
-},{"../object/keys":65}],17:[function(require,module,exports){
-var baseCopy = require('./baseCopy'),
- keys = require('../object/keys');
-
-/**
- * The base implementation of `_.assign` without support for argument juggling,
- * multiple sources, and `customizer` functions.
- *
- * @private
- * @param {Object} object The destination object.
- * @param {Object} source The source object.
- * @returns {Object} Returns `object`.
- */
-function baseAssign(object, source) {
- return source == null
- ? object
- : baseCopy(source, keys(source), object);
-}
-
-module.exports = baseAssign;
-
-},{"../object/keys":65,"./baseCopy":19}],18:[function(require,module,exports){
-var baseMatches = require('./baseMatches'),
- baseMatchesProperty = require('./baseMatchesProperty'),
- bindCallback = require('./bindCallback'),
- identity = require('../utility/identity'),
- property = require('../utility/property');
-
-/**
- * The base implementation of `_.callback` which supports specifying the
- * number of arguments to provide to `func`.
- *
- * @private
- * @param {*} [func=_.identity] The value to convert to a callback.
- * @param {*} [thisArg] The `this` binding of `func`.
- * @param {number} [argCount] The number of arguments to provide to `func`.
- * @returns {Function} Returns the callback.
- */
-function baseCallback(func, thisArg, argCount) {
- var type = typeof func;
- if (type == 'function') {
- return thisArg === undefined
- ? func
- : bindCallback(func, thisArg, argCount);
- }
- if (func == null) {
- return identity;
- }
- if (type == 'object') {
- return baseMatches(func);
- }
- return thisArg === undefined
- ? property(func)
- : baseMatchesProperty(func, thisArg);
-}
-
-module.exports = baseCallback;
-
-},{"../utility/identity":68,"../utility/property":69,"./baseMatches":29,"./baseMatchesProperty":30,"./bindCallback":35}],19:[function(require,module,exports){
-/**
- * Copies properties of `source` to `object`.
- *
- * @private
- * @param {Object} source The object to copy properties from.
- * @param {Array} props The property names to copy.
- * @param {Object} [object={}] The object to copy properties to.
- * @returns {Object} Returns `object`.
- */
-function baseCopy(source, props, object) {
- object || (object = {});
-
- var index = -1,
- length = props.length;
-
- while (++index < length) {
- var key = props[index];
- object[key] = source[key];
- }
- return object;
-}
-
-module.exports = baseCopy;
-
-},{}],20:[function(require,module,exports){
-var isObject = require('../lang/isObject');
-
-/**
- * The base implementation of `_.create` without support for assigning
- * properties to the created object.
- *
- * @private
- * @param {Object} prototype The object to inherit from.
- * @returns {Object} Returns the new object.
- */
-var baseCreate = (function() {
- function object() {}
- return function(prototype) {
- if (isObject(prototype)) {
- object.prototype = prototype;
- var result = new object;
- object.prototype = undefined;
- }
- return result || {};
- };
-}());
-
-module.exports = baseCreate;
-
-},{"../lang/isObject":60}],21:[function(require,module,exports){
-var baseForOwn = require('./baseForOwn'),
- createBaseEach = require('./createBaseEach');
-
-/**
- * The base implementation of `_.forEach` without support for callback
- * shorthands and `this` binding.
- *
- * @private
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Array|Object|string} Returns `collection`.
- */
-var baseEach = createBaseEach(baseForOwn);
-
-module.exports = baseEach;
-
-},{"./baseForOwn":24,"./createBaseEach":37}],22:[function(require,module,exports){
-var baseEach = require('./baseEach');
-
-/**
- * The base implementation of `_.every` without support for callback
- * shorthands and `this` binding.
- *
- * @private
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function} predicate The function invoked per iteration.
- * @returns {boolean} Returns `true` if all elements pass the predicate check,
- * else `false`
- */
-function baseEvery(collection, predicate) {
- var result = true;
- baseEach(collection, function(value, index, collection) {
- result = !!predicate(value, index, collection);
- return result;
- });
- return result;
-}
-
-module.exports = baseEvery;
-
-},{"./baseEach":21}],23:[function(require,module,exports){
-var createBaseFor = require('./createBaseFor');
-
-/**
- * The base implementation of `baseForIn` and `baseForOwn` which iterates
- * over `object` properties returned by `keysFunc` invoking `iteratee` for
- * each property. Iteratee functions may exit iteration early by explicitly
- * returning `false`.
- *
- * @private
- * @param {Object} object The object to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @param {Function} keysFunc The function to get the keys of `object`.
- * @returns {Object} Returns `object`.
- */
-var baseFor = createBaseFor();
-
-module.exports = baseFor;
-
-},{"./createBaseFor":38}],24:[function(require,module,exports){
-var baseFor = require('./baseFor'),
- keys = require('../object/keys');
-
-/**
- * The base implementation of `_.forOwn` without support for callback
- * shorthands and `this` binding.
- *
- * @private
- * @param {Object} object The object to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Object} Returns `object`.
- */
-function baseForOwn(object, iteratee) {
- return baseFor(object, iteratee, keys);
-}
-
-module.exports = baseForOwn;
-
-},{"../object/keys":65,"./baseFor":23}],25:[function(require,module,exports){
-var toObject = require('./toObject');
-
-/**
- * The base implementation of `get` without support for string paths
- * and default values.
- *
- * @private
- * @param {Object} object The object to query.
- * @param {Array} path The path of the property to get.
- * @param {string} [pathKey] The key representation of path.
- * @returns {*} Returns the resolved value.
- */
-function baseGet(object, path, pathKey) {
- if (object == null) {
- return;
- }
- if (pathKey !== undefined && pathKey in toObject(object)) {
- path = [pathKey];
- }
- var index = 0,
- length = path.length;
-
- while (object != null && index < length) {
- object = object[path[index++]];
- }
- return (index && index == length) ? object : undefined;
-}
-
-module.exports = baseGet;
-
-},{"./toObject":53}],26:[function(require,module,exports){
-var baseIsEqualDeep = require('./baseIsEqualDeep'),
- isObject = require('../lang/isObject'),
- isObjectLike = require('./isObjectLike');
-
-/**
- * The base implementation of `_.isEqual` without support for `this` binding
- * `customizer` functions.
- *
- * @private
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @param {Function} [customizer] The function to customize comparing values.
- * @param {boolean} [isLoose] Specify performing partial comparisons.
- * @param {Array} [stackA] Tracks traversed `value` objects.
- * @param {Array} [stackB] Tracks traversed `other` objects.
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
- */
-function baseIsEqual(value, other, customizer, isLoose, stackA, stackB) {
- if (value === other) {
- return true;
- }
- if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) {
- return value !== value && other !== other;
- }
- return baseIsEqualDeep(value, other, baseIsEqual, customizer, isLoose, stackA, stackB);
-}
-
-module.exports = baseIsEqual;
-
-},{"../lang/isObject":60,"./baseIsEqualDeep":27,"./isObjectLike":50}],27:[function(require,module,exports){
-var equalArrays = require('./equalArrays'),
- equalByTag = require('./equalByTag'),
- equalObjects = require('./equalObjects'),
- isArray = require('../lang/isArray'),
- isTypedArray = require('../lang/isTypedArray');
-
-/** `Object#toString` result references. */
-var argsTag = '[object Arguments]',
- arrayTag = '[object Array]',
- objectTag = '[object Object]';
-
-/** Used for native method references. */
-var objectProto = Object.prototype;
-
-/** Used to check objects for own properties. */
-var hasOwnProperty = objectProto.hasOwnProperty;
-
-/**
- * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
- * of values.
- */
-var objToString = objectProto.toString;
-
-/**
- * A specialized version of `baseIsEqual` for arrays and objects which performs
- * deep comparisons and tracks traversed objects enabling objects with circular
- * references to be compared.
- *
- * @private
- * @param {Object} object The object to compare.
- * @param {Object} other The other object to compare.
- * @param {Function} equalFunc The function to determine equivalents of values.
- * @param {Function} [customizer] The function to customize comparing objects.
- * @param {boolean} [isLoose] Specify performing partial comparisons.
- * @param {Array} [stackA=[]] Tracks traversed `value` objects.
- * @param {Array} [stackB=[]] Tracks traversed `other` objects.
- * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
- */
-function baseIsEqualDeep(object, other, equalFunc, customizer, isLoose, stackA, stackB) {
- var objIsArr = isArray(object),
- othIsArr = isArray(other),
- objTag = arrayTag,
- othTag = arrayTag;
-
- if (!objIsArr) {
- objTag = objToString.call(object);
- if (objTag == argsTag) {
- objTag = objectTag;
- } else if (objTag != objectTag) {
- objIsArr = isTypedArray(object);
- }
- }
- if (!othIsArr) {
- othTag = objToString.call(other);
- if (othTag == argsTag) {
- othTag = objectTag;
- } else if (othTag != objectTag) {
- othIsArr = isTypedArray(other);
- }
- }
- var objIsObj = objTag == objectTag,
- othIsObj = othTag == objectTag,
- isSameTag = objTag == othTag;
-
- if (isSameTag && !(objIsArr || objIsObj)) {
- return equalByTag(object, other, objTag);
- }
- if (!isLoose) {
- var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
- othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
-
- if (objIsWrapped || othIsWrapped) {
- return equalFunc(objIsWrapped ? object.value() : object, othIsWrapped ? other.value() : other, customizer, isLoose, stackA, stackB);
- }
- }
- if (!isSameTag) {
- return false;
- }
- // Assume cyclic values are equal.
- // For more information on detecting circular references see https://es5.github.io/#JO.
- stackA || (stackA = []);
- stackB || (stackB = []);
-
- var length = stackA.length;
- while (length--) {
- if (stackA[length] == object) {
- return stackB[length] == other;
- }
- }
- // Add `object` and `other` to the stack of traversed objects.
- stackA.push(object);
- stackB.push(other);
-
- var result = (objIsArr ? equalArrays : equalObjects)(object, other, equalFunc, customizer, isLoose, stackA, stackB);
-
- stackA.pop();
- stackB.pop();
-
- return result;
-}
-
-module.exports = baseIsEqualDeep;
-
-},{"../lang/isArray":56,"../lang/isTypedArray":62,"./equalArrays":39,"./equalByTag":40,"./equalObjects":41}],28:[function(require,module,exports){
-var baseIsEqual = require('./baseIsEqual'),
- toObject = require('./toObject');
-
-/**
- * The base implementation of `_.isMatch` without support for callback
- * shorthands and `this` binding.
- *
- * @private
- * @param {Object} object The object to inspect.
- * @param {Array} matchData The propery names, values, and compare flags to match.
- * @param {Function} [customizer] The function to customize comparing objects.
- * @returns {boolean} Returns `true` if `object` is a match, else `false`.
- */
-function baseIsMatch(object, matchData, customizer) {
- var index = matchData.length,
- length = index,
- noCustomizer = !customizer;
-
- if (object == null) {
- return !length;
- }
- object = toObject(object);
- while (index--) {
- var data = matchData[index];
- if ((noCustomizer && data[2])
- ? data[1] !== object[data[0]]
- : !(data[0] in object)
- ) {
- return false;
- }
- }
- while (++index < length) {
- data = matchData[index];
- var key = data[0],
- objValue = object[key],
- srcValue = data[1];
-
- if (noCustomizer && data[2]) {
- if (objValue === undefined && !(key in object)) {
- return false;
- }
- } else {
- var result = customizer ? customizer(objValue, srcValue, key) : undefined;
- if (!(result === undefined ? baseIsEqual(srcValue, objValue, customizer, true) : result)) {
- return false;
- }
- }
- }
- return true;
-}
-
-module.exports = baseIsMatch;
-
-},{"./baseIsEqual":26,"./toObject":53}],29:[function(require,module,exports){
-var baseIsMatch = require('./baseIsMatch'),
- getMatchData = require('./getMatchData'),
- toObject = require('./toObject');
-
-/**
- * The base implementation of `_.matches` which does not clone `source`.
- *
- * @private
- * @param {Object} source The object of property values to match.
- * @returns {Function} Returns the new function.
- */
-function baseMatches(source) {
- var matchData = getMatchData(source);
- if (matchData.length == 1 && matchData[0][2]) {
- var key = matchData[0][0],
- value = matchData[0][1];
-
- return function(object) {
- if (object == null) {
- return false;
- }
- return object[key] === value && (value !== undefined || (key in toObject(object)));
- };
- }
- return function(object) {
- return baseIsMatch(object, matchData);
- };
-}
-
-module.exports = baseMatches;
-
-},{"./baseIsMatch":28,"./getMatchData":43,"./toObject":53}],30:[function(require,module,exports){
-var baseGet = require('./baseGet'),
- baseIsEqual = require('./baseIsEqual'),
- baseSlice = require('./baseSlice'),
- isArray = require('../lang/isArray'),
- isKey = require('./isKey'),
- isStrictComparable = require('./isStrictComparable'),
- last = require('../array/last'),
- toObject = require('./toObject'),
- toPath = require('./toPath');
-
-/**
- * The base implementation of `_.matchesProperty` which does not clone `srcValue`.
- *
- * @private
- * @param {string} path The path of the property to get.
- * @param {*} srcValue The value to compare.
- * @returns {Function} Returns the new function.
- */
-function baseMatchesProperty(path, srcValue) {
- var isArr = isArray(path),
- isCommon = isKey(path) && isStrictComparable(srcValue),
- pathKey = (path + '');
-
- path = toPath(path);
- return function(object) {
- if (object == null) {
- return false;
- }
- var key = pathKey;
- object = toObject(object);
- if ((isArr || !isCommon) && !(key in object)) {
- object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
- if (object == null) {
- return false;
- }
- key = last(path);
- object = toObject(object);
- }
- return object[key] === srcValue
- ? (srcValue !== undefined || (key in object))
- : baseIsEqual(srcValue, object[key], undefined, true);
- };
-}
-
-module.exports = baseMatchesProperty;
-
-},{"../array/last":11,"../lang/isArray":56,"./baseGet":25,"./baseIsEqual":26,"./baseSlice":33,"./isKey":48,"./isStrictComparable":51,"./toObject":53,"./toPath":54}],31:[function(require,module,exports){
-/**
- * The base implementation of `_.property` without support for deep paths.
- *
- * @private
- * @param {string} key The key of the property to get.
- * @returns {Function} Returns the new function.
- */
-function baseProperty(key) {
- return function(object) {
- return object == null ? undefined : object[key];
- };
-}
-
-module.exports = baseProperty;
-
-},{}],32:[function(require,module,exports){
-var baseGet = require('./baseGet'),
- toPath = require('./toPath');
-
-/**
- * A specialized version of `baseProperty` which supports deep paths.
- *
- * @private
- * @param {Array|string} path The path of the property to get.
- * @returns {Function} Returns the new function.
- */
-function basePropertyDeep(path) {
- var pathKey = (path + '');
- path = toPath(path);
- return function(object) {
- return baseGet(object, path, pathKey);
- };
-}
-
-module.exports = basePropertyDeep;
-
-},{"./baseGet":25,"./toPath":54}],33:[function(require,module,exports){
-/**
- * The base implementation of `_.slice` without an iteratee call guard.
- *
- * @private
- * @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 baseSlice(array, start, end) {
- var index = -1,
- length = array.length;
-
- start = start == null ? 0 : (+start || 0);
- if (start < 0) {
- start = -start > length ? 0 : (length + start);
- }
- end = (end === undefined || end > length) ? length : (+end || 0);
- if (end < 0) {
- end += length;
- }
- length = start > end ? 0 : ((end - start) >>> 0);
- start >>>= 0;
-
- var result = Array(length);
- while (++index < length) {
- result[index] = array[index + start];
- }
- return result;
-}
-
-module.exports = baseSlice;
-
-},{}],34:[function(require,module,exports){
-/**
- * Converts `value` to a string if it's not one. An empty string is returned
- * for `null` or `undefined` values.
- *
- * @private
- * @param {*} value The value to process.
- * @returns {string} Returns the string.
- */
-function baseToString(value) {
- return value == null ? '' : (value + '');
-}
-
-module.exports = baseToString;
-
-},{}],35:[function(require,module,exports){
-var identity = require('../utility/identity');
-
-/**
- * A specialized version of `baseCallback` which only supports `this` binding
- * and specifying the number of arguments to provide to `func`.
- *
- * @private
- * @param {Function} func The function to bind.
- * @param {*} thisArg The `this` binding of `func`.
- * @param {number} [argCount] The number of arguments to provide to `func`.
- * @returns {Function} Returns the callback.
- */
-function bindCallback(func, thisArg, argCount) {
- if (typeof func != 'function') {
- return identity;
- }
- if (thisArg === undefined) {
- return func;
- }
- switch (argCount) {
- case 1: return function(value) {
- return func.call(thisArg, value);
- };
- case 3: return function(value, index, collection) {
- return func.call(thisArg, value, index, collection);
- };
- case 4: return function(accumulator, value, index, collection) {
- return func.call(thisArg, accumulator, value, index, collection);
- };
- case 5: return function(value, other, key, object, source) {
- return func.call(thisArg, value, other, key, object, source);
- };
- }
- return function() {
- return func.apply(thisArg, arguments);
- };
-}
-
-module.exports = bindCallback;
-
-},{"../utility/identity":68}],36:[function(require,module,exports){
-var bindCallback = require('./bindCallback'),
- isIterateeCall = require('./isIterateeCall'),
- restParam = require('../function/restParam');
-
-/**
- * Creates a `_.assign`, `_.defaults`, or `_.merge` function.
- *
- * @private
- * @param {Function} assigner The function to assign values.
- * @returns {Function} Returns the new assigner function.
- */
-function createAssigner(assigner) {
- return restParam(function(object, sources) {
- var index = -1,
- length = object == null ? 0 : sources.length,
- customizer = length > 2 ? sources[length - 2] : undefined,
- guard = length > 2 ? sources[2] : undefined,
- thisArg = length > 1 ? sources[length - 1] : undefined;
-
- if (typeof customizer == 'function') {
- customizer = bindCallback(customizer, thisArg, 5);
- length -= 2;
- } else {
- customizer = typeof thisArg == 'function' ? thisArg : undefined;
- length -= (customizer ? 1 : 0);
- }
- if (guard && isIterateeCall(sources[0], sources[1], guard)) {
- customizer = length < 3 ? undefined : customizer;
- length = 1;
- }
- while (++index < length) {
- var source = sources[index];
- if (source) {
- assigner(object, source, customizer);
- }
- }
- return object;
- });
-}
-
-module.exports = createAssigner;
-
-},{"../function/restParam":13,"./bindCallback":35,"./isIterateeCall":47}],37:[function(require,module,exports){
-var getLength = require('./getLength'),
- isLength = require('./isLength'),
- toObject = require('./toObject');
-
-/**
- * Creates a `baseEach` or `baseEachRight` function.
- *
- * @private
- * @param {Function} eachFunc The function to iterate over a collection.
- * @param {boolean} [fromRight] Specify iterating from right to left.
- * @returns {Function} Returns the new base function.
- */
-function createBaseEach(eachFunc, fromRight) {
- return function(collection, iteratee) {
- var length = collection ? getLength(collection) : 0;
- if (!isLength(length)) {
- return eachFunc(collection, iteratee);
- }
- var index = fromRight ? length : -1,
- iterable = toObject(collection);
-
- while ((fromRight ? index-- : ++index < length)) {
- if (iteratee(iterable[index], index, iterable) === false) {
- break;
- }
- }
- return collection;
- };
-}
-
-module.exports = createBaseEach;
-
-},{"./getLength":42,"./isLength":49,"./toObject":53}],38:[function(require,module,exports){
-var toObject = require('./toObject');
-
-/**
- * Creates a base function for `_.forIn` or `_.forInRight`.
- *
- * @private
- * @param {boolean} [fromRight] Specify iterating from right to left.
- * @returns {Function} Returns the new base function.
- */
-function createBaseFor(fromRight) {
- return function(object, iteratee, keysFunc) {
- var iterable = toObject(object),
- props = keysFunc(object),
- length = props.length,
- index = fromRight ? length : -1;
-
- while ((fromRight ? index-- : ++index < length)) {
- var key = props[index];
- if (iteratee(iterable[key], key, iterable) === false) {
- break;
- }
- }
- return object;
- };
-}
-
-module.exports = createBaseFor;
-
-},{"./toObject":53}],39:[function(require,module,exports){
-var arraySome = require('./arraySome');
-
-/**
- * A specialized version of `baseIsEqualDeep` for arrays with support for
- * partial deep comparisons.
- *
- * @private
- * @param {Array} array The array to compare.
- * @param {Array} other The other array to compare.
- * @param {Function} equalFunc The function to determine equivalents of values.
- * @param {Function} [customizer] The function to customize comparing arrays.
- * @param {boolean} [isLoose] Specify performing partial comparisons.
- * @param {Array} [stackA] Tracks traversed `value` objects.
- * @param {Array} [stackB] Tracks traversed `other` objects.
- * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
- */
-function equalArrays(array, other, equalFunc, customizer, isLoose, stackA, stackB) {
- var index = -1,
- arrLength = array.length,
- othLength = other.length;
-
- if (arrLength != othLength && !(isLoose && othLength > arrLength)) {
- return false;
- }
- // Ignore non-index properties.
- while (++index < arrLength) {
- var arrValue = array[index],
- othValue = other[index],
- result = customizer ? customizer(isLoose ? othValue : arrValue, isLoose ? arrValue : othValue, index) : undefined;
-
- if (result !== undefined) {
- if (result) {
- continue;
- }
- return false;
- }
- // Recursively compare arrays (susceptible to call stack limits).
- if (isLoose) {
- if (!arraySome(other, function(othValue) {
- return arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB);
- })) {
- return false;
- }
- } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB))) {
- return false;
- }
- }
- return true;
-}
-
-module.exports = equalArrays;
-
-},{"./arraySome":15}],40:[function(require,module,exports){
-/** `Object#toString` result references. */
-var boolTag = '[object Boolean]',
- dateTag = '[object Date]',
- errorTag = '[object Error]',
- numberTag = '[object Number]',
- regexpTag = '[object RegExp]',
- stringTag = '[object String]';
-
-/**
- * A specialized version of `baseIsEqualDeep` for comparing objects of
- * the same `toStringTag`.
- *
- * **Note:** This function only supports comparing values with tags of
- * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
- *
- * @private
- * @param {Object} object The object to compare.
- * @param {Object} other The other object to compare.
- * @param {string} tag The `toStringTag` of the objects to compare.
- * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
- */
-function equalByTag(object, other, tag) {
- switch (tag) {
- case boolTag:
- case dateTag:
- // Coerce dates and booleans to numbers, dates to milliseconds and booleans
- // to `1` or `0` treating invalid dates coerced to `NaN` as not equal.
- return +object == +other;
-
- case errorTag:
- return object.name == other.name && object.message == other.message;
-
- case numberTag:
- // Treat `NaN` vs. `NaN` as equal.
- return (object != +object)
- ? other != +other
- : object == +other;
-
- case regexpTag:
- case stringTag:
- // Coerce regexes to strings and treat strings primitives and string
- // objects as equal. See https://es5.github.io/#x15.10.6.4 for more details.
- return object == (other + '');
- }
- return false;
-}
-
-module.exports = equalByTag;
-
-},{}],41:[function(require,module,exports){
-var keys = require('../object/keys');
-
-/** Used for native method references. */
-var objectProto = Object.prototype;
-
-/** Used to check objects for own properties. */
-var hasOwnProperty = objectProto.hasOwnProperty;
-
-/**
- * A specialized version of `baseIsEqualDeep` for objects with support for
- * partial deep comparisons.
- *
- * @private
- * @param {Object} object The object to compare.
- * @param {Object} other The other object to compare.
- * @param {Function} equalFunc The function to determine equivalents of values.
- * @param {Function} [customizer] The function to customize comparing values.
- * @param {boolean} [isLoose] Specify performing partial comparisons.
- * @param {Array} [stackA] Tracks traversed `value` objects.
- * @param {Array} [stackB] Tracks traversed `other` objects.
- * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
- */
-function equalObjects(object, other, equalFunc, customizer, isLoose, stackA, stackB) {
- var objProps = keys(object),
- objLength = objProps.length,
- othProps = keys(other),
- othLength = othProps.length;
-
- if (objLength != othLength && !isLoose) {
- return false;
- }
- var index = objLength;
- while (index--) {
- var key = objProps[index];
- if (!(isLoose ? key in other : hasOwnProperty.call(other, key))) {
- return false;
- }
- }
- var skipCtor = isLoose;
- while (++index < objLength) {
- key = objProps[index];
- var objValue = object[key],
- othValue = other[key],
- result = customizer ? customizer(isLoose ? othValue : objValue, isLoose? objValue : othValue, key) : undefined;
-
- // Recursively compare objects (susceptible to call stack limits).
- if (!(result === undefined ? equalFunc(objValue, othValue, customizer, isLoose, stackA, stackB) : result)) {
- return false;
- }
- skipCtor || (skipCtor = key == 'constructor');
- }
- if (!skipCtor) {
- var objCtor = object.constructor,
- othCtor = other.constructor;
-
- // Non `Object` object instances with different constructors are not equal.
- if (objCtor != othCtor &&
- ('constructor' in object && 'constructor' in other) &&
- !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
- typeof othCtor == 'function' && othCtor instanceof othCtor)) {
- return false;
- }
- }
- return true;
-}
-
-module.exports = equalObjects;
-
-},{"../object/keys":65}],42:[function(require,module,exports){
-var baseProperty = require('./baseProperty');
-
-/**
- * Gets the "length" property value of `object`.
- *
- * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)
- * that affects Safari on at least iOS 8.1-8.3 ARM64.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {*} Returns the "length" value.
- */
-var getLength = baseProperty('length');
-
-module.exports = getLength;
-
-},{"./baseProperty":31}],43:[function(require,module,exports){
-var isStrictComparable = require('./isStrictComparable'),
- pairs = require('../object/pairs');
-
-/**
- * Gets the propery names, values, and compare flags of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {Array} Returns the match data of `object`.
- */
-function getMatchData(object) {
- var result = pairs(object),
- length = result.length;
-
- while (length--) {
- result[length][2] = isStrictComparable(result[length][1]);
- }
- return result;
-}
-
-module.exports = getMatchData;
-
-},{"../object/pairs":67,"./isStrictComparable":51}],44:[function(require,module,exports){
-var isNative = require('../lang/isNative');
-
-/**
- * Gets the native function at `key` of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @param {string} key The key of the method to get.
- * @returns {*} Returns the function if it's native, else `undefined`.
- */
-function getNative(object, key) {
- var value = object == null ? undefined : object[key];
- return isNative(value) ? value : undefined;
-}
-
-module.exports = getNative;
-
-},{"../lang/isNative":59}],45:[function(require,module,exports){
-var getLength = require('./getLength'),
- isLength = require('./isLength');
-
-/**
- * Checks if `value` is array-like.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
- */
-function isArrayLike(value) {
- return value != null && isLength(getLength(value));
-}
-
-module.exports = isArrayLike;
-
-},{"./getLength":42,"./isLength":49}],46:[function(require,module,exports){
-/** Used to detect unsigned integer values. */
-var reIsUint = /^\d+$/;
-
-/**
- * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)
- * of an array-like value.
- */
-var MAX_SAFE_INTEGER = 9007199254740991;
-
-/**
- * Checks if `value` is a valid array-like index.
- *
- * @private
- * @param {*} value The value to check.
- * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
- * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
- */
-function isIndex(value, length) {
- value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;
- length = length == null ? MAX_SAFE_INTEGER : length;
- return value > -1 && value % 1 == 0 && value < length;
-}
-
-module.exports = isIndex;
-
-},{}],47:[function(require,module,exports){
-var isArrayLike = require('./isArrayLike'),
- isIndex = require('./isIndex'),
- isObject = require('../lang/isObject');
-
-/**
- * Checks if the provided arguments are from an iteratee call.
- *
- * @private
- * @param {*} value The potential iteratee value argument.
- * @param {*} index The potential iteratee index or key argument.
- * @param {*} object The potential iteratee object argument.
- * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`.
- */
-function isIterateeCall(value, index, object) {
- if (!isObject(object)) {
- return false;
- }
- var type = typeof index;
- if (type == 'number'
- ? (isArrayLike(object) && isIndex(index, object.length))
- : (type == 'string' && index in object)) {
- var other = object[index];
- return value === value ? (value === other) : (other !== other);
- }
- return false;
-}
-
-module.exports = isIterateeCall;
-
-},{"../lang/isObject":60,"./isArrayLike":45,"./isIndex":46}],48:[function(require,module,exports){
-var isArray = require('../lang/isArray'),
- toObject = require('./toObject');
-
-/** Used to match property names within property paths. */
-var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,
- reIsPlainProp = /^\w*$/;
-
-/**
- * Checks if `value` is a property name and not a property path.
- *
- * @private
- * @param {*} value The value to check.
- * @param {Object} [object] The object to query keys on.
- * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
- */
-function isKey(value, object) {
- var type = typeof value;
- if ((type == 'string' && reIsPlainProp.test(value)) || type == 'number') {
- return true;
- }
- if (isArray(value)) {
- return false;
- }
- var result = !reIsDeepProp.test(value);
- return result || (object != null && value in toObject(object));
-}
-
-module.exports = isKey;
-
-},{"../lang/isArray":56,"./toObject":53}],49:[function(require,module,exports){
-/**
- * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)
- * of an array-like value.
- */
-var MAX_SAFE_INTEGER = 9007199254740991;
-
-/**
- * Checks if `value` is a valid array-like length.
- *
- * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
- */
-function isLength(value) {
- return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
-}
-
-module.exports = isLength;
-
-},{}],50:[function(require,module,exports){
-/**
- * Checks if `value` is object-like.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
- */
-function isObjectLike(value) {
- return !!value && typeof value == 'object';
-}
-
-module.exports = isObjectLike;
-
-},{}],51:[function(require,module,exports){
-var isObject = require('../lang/isObject');
-
-/**
- * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` if suitable for strict
- * equality comparisons, else `false`.
- */
-function isStrictComparable(value) {
- return value === value && !isObject(value);
-}
-
-module.exports = isStrictComparable;
-
-},{"../lang/isObject":60}],52:[function(require,module,exports){
-var isArguments = require('../lang/isArguments'),
- isArray = require('../lang/isArray'),
- isIndex = require('./isIndex'),
- isLength = require('./isLength'),
- keysIn = require('../object/keysIn');
-
-/** Used for native method references. */
-var objectProto = Object.prototype;
-
-/** Used to check objects for own properties. */
-var hasOwnProperty = objectProto.hasOwnProperty;
-
-/**
- * A fallback implementation of `Object.keys` which creates an array of the
- * own enumerable property names of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property names.
- */
-function shimKeys(object) {
- var props = keysIn(object),
- propsLength = props.length,
- length = propsLength && object.length;
-
- var allowIndexes = !!length && isLength(length) &&
- (isArray(object) || isArguments(object));
-
- var index = -1,
- result = [];
-
- while (++index < propsLength) {
- var key = props[index];
- if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) {
- result.push(key);
- }
- }
- return result;
-}
-
-module.exports = shimKeys;
-
-},{"../lang/isArguments":55,"../lang/isArray":56,"../object/keysIn":66,"./isIndex":46,"./isLength":49}],53:[function(require,module,exports){
-var isObject = require('../lang/isObject');
-
-/**
- * Converts `value` to an object if it's not one.
- *
- * @private
- * @param {*} value The value to process.
- * @returns {Object} Returns the object.
- */
-function toObject(value) {
- return isObject(value) ? value : Object(value);
-}
-
-module.exports = toObject;
-
-},{"../lang/isObject":60}],54:[function(require,module,exports){
-var baseToString = require('./baseToString'),
- isArray = require('../lang/isArray');
-
-/** Used to match property names within property paths. */
-var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g;
-
-/** Used to match backslashes in property paths. */
-var reEscapeChar = /\\(\\)?/g;
-
-/**
- * Converts `value` to property path array if it's not one.
- *
- * @private
- * @param {*} value The value to process.
- * @returns {Array} Returns the property path array.
- */
-function toPath(value) {
- if (isArray(value)) {
- return value;
- }
- var result = [];
- baseToString(value).replace(rePropName, function(match, number, quote, string) {
- result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
- });
- return result;
-}
-
-module.exports = toPath;
-
-},{"../lang/isArray":56,"./baseToString":34}],55:[function(require,module,exports){
-var isArrayLike = require('../internal/isArrayLike'),
- isObjectLike = require('../internal/isObjectLike');
-
-/** Used for native method references. */
-var objectProto = Object.prototype;
-
-/** Used to check objects for own properties. */
-var hasOwnProperty = objectProto.hasOwnProperty;
-
-/** Native method references. */
-var propertyIsEnumerable = objectProto.propertyIsEnumerable;
-
-/**
- * Checks if `value` is classified as an `arguments` object.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
- * @example
- *
- * _.isArguments(function() { return arguments; }());
- * // => true
- *
- * _.isArguments([1, 2, 3]);
- * // => false
- */
-function isArguments(value) {
- return isObjectLike(value) && isArrayLike(value) &&
- hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee');
-}
-
-module.exports = isArguments;
-
-},{"../internal/isArrayLike":45,"../internal/isObjectLike":50}],56:[function(require,module,exports){
-var getNative = require('../internal/getNative'),
- isLength = require('../internal/isLength'),
- isObjectLike = require('../internal/isObjectLike');
-
-/** `Object#toString` result references. */
-var arrayTag = '[object Array]';
-
-/** Used for native method references. */
-var objectProto = Object.prototype;
-
-/**
- * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
- * of values.
- */
-var objToString = objectProto.toString;
-
-/* Native method references for those with the same name as other `lodash` methods. */
-var nativeIsArray = getNative(Array, 'isArray');
-
-/**
- * Checks if `value` is classified as an `Array` object.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
- * @example
- *
- * _.isArray([1, 2, 3]);
- * // => true
- *
- * _.isArray(function() { return arguments; }());
- * // => false
- */
-var isArray = nativeIsArray || function(value) {
- return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag;
-};
-
-module.exports = isArray;
-
-},{"../internal/getNative":44,"../internal/isLength":49,"../internal/isObjectLike":50}],57:[function(require,module,exports){
-var isArguments = require('./isArguments'),
- isArray = require('./isArray'),
- isArrayLike = require('../internal/isArrayLike'),
- isFunction = require('./isFunction'),
- isObjectLike = require('../internal/isObjectLike'),
- isString = require('./isString'),
- keys = require('../object/keys');
-
-/**
- * Checks if `value` is empty. A value is considered empty unless it's an
- * `arguments` object, array, string, or jQuery-like collection with a length
- * greater than `0` or an object with own enumerable properties.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {Array|Object|string} value The value to inspect.
- * @returns {boolean} Returns `true` if `value` is empty, else `false`.
- * @example
- *
- * _.isEmpty(null);
- * // => true
- *
- * _.isEmpty(true);
- * // => true
- *
- * _.isEmpty(1);
- * // => true
- *
- * _.isEmpty([1, 2, 3]);
- * // => false
- *
- * _.isEmpty({ 'a': 1 });
- * // => false
- */
-function isEmpty(value) {
- if (value == null) {
- return true;
- }
- if (isArrayLike(value) && (isArray(value) || isString(value) || isArguments(value) ||
- (isObjectLike(value) && isFunction(value.splice)))) {
- return !value.length;
- }
- return !keys(value).length;
-}
-
-module.exports = isEmpty;
-
-},{"../internal/isArrayLike":45,"../internal/isObjectLike":50,"../object/keys":65,"./isArguments":55,"./isArray":56,"./isFunction":58,"./isString":61}],58:[function(require,module,exports){
-var isObject = require('./isObject');
-
-/** `Object#toString` result references. */
-var funcTag = '[object Function]';
-
-/** Used for native method references. */
-var objectProto = Object.prototype;
-
-/**
- * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
- * of values.
- */
-var objToString = objectProto.toString;
-
-/**
- * Checks if `value` is classified as a `Function` object.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
- * @example
- *
- * _.isFunction(_);
- * // => true
- *
- * _.isFunction(/abc/);
- * // => false
- */
-function isFunction(value) {
- // The use of `Object#toString` avoids issues with the `typeof` operator
- // in older versions of Chrome and Safari which return 'function' for regexes
- // and Safari 8 which returns 'object' for typed array constructors.
- return isObject(value) && objToString.call(value) == funcTag;
-}
-
-module.exports = isFunction;
-
-},{"./isObject":60}],59:[function(require,module,exports){
-var isFunction = require('./isFunction'),
- isObjectLike = require('../internal/isObjectLike');
-
-/** Used to detect host constructors (Safari > 5). */
-var reIsHostCtor = /^\[object .+?Constructor\]$/;
-
-/** Used for native method references. */
-var objectProto = Object.prototype;
-
-/** Used to resolve the decompiled source of functions. */
-var fnToString = Function.prototype.toString;
-
-/** Used to check objects for own properties. */
-var hasOwnProperty = objectProto.hasOwnProperty;
-
-/** Used to detect if a method is native. */
-var reIsNative = RegExp('^' +
- fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&')
- .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
-);
-
-/**
- * Checks if `value` is a native function.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a native function, else `false`.
- * @example
- *
- * _.isNative(Array.prototype.push);
- * // => true
- *
- * _.isNative(_);
- * // => false
- */
-function isNative(value) {
- if (value == null) {
- return false;
- }
- if (isFunction(value)) {
- return reIsNative.test(fnToString.call(value));
- }
- return isObjectLike(value) && reIsHostCtor.test(value);
-}
-
-module.exports = isNative;
-
-},{"../internal/isObjectLike":50,"./isFunction":58}],60:[function(require,module,exports){
-/**
- * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
- * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
- * @example
- *
- * _.isObject({});
- * // => true
- *
- * _.isObject([1, 2, 3]);
- * // => true
- *
- * _.isObject(1);
- * // => false
- */
-function isObject(value) {
- // Avoid a V8 JIT bug in Chrome 19-20.
- // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
- var type = typeof value;
- return !!value && (type == 'object' || type == 'function');
-}
-
-module.exports = isObject;
-
-},{}],61:[function(require,module,exports){
-var isObjectLike = require('../internal/isObjectLike');
-
-/** `Object#toString` result references. */
-var stringTag = '[object String]';
-
-/** Used for native method references. */
-var objectProto = Object.prototype;
-
-/**
- * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
- * of values.
- */
-var objToString = objectProto.toString;
-
-/**
- * Checks if `value` is classified as a `String` primitive or object.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
- * @example
- *
- * _.isString('abc');
- * // => true
- *
- * _.isString(1);
- * // => false
- */
-function isString(value) {
- return typeof value == 'string' || (isObjectLike(value) && objToString.call(value) == stringTag);
-}
-
-module.exports = isString;
-
-},{"../internal/isObjectLike":50}],62:[function(require,module,exports){
-var isLength = require('../internal/isLength'),
- isObjectLike = require('../internal/isObjectLike');
-
-/** `Object#toString` result references. */
-var argsTag = '[object Arguments]',
- arrayTag = '[object Array]',
- boolTag = '[object Boolean]',
- dateTag = '[object Date]',
- errorTag = '[object Error]',
- funcTag = '[object Function]',
- mapTag = '[object Map]',
- numberTag = '[object Number]',
- objectTag = '[object Object]',
- regexpTag = '[object RegExp]',
- setTag = '[object Set]',
- stringTag = '[object String]',
- weakMapTag = '[object WeakMap]';
-
-var arrayBufferTag = '[object ArrayBuffer]',
- float32Tag = '[object Float32Array]',
- float64Tag = '[object Float64Array]',
- int8Tag = '[object Int8Array]',
- int16Tag = '[object Int16Array]',
- int32Tag = '[object Int32Array]',
- uint8Tag = '[object Uint8Array]',
- uint8ClampedTag = '[object Uint8ClampedArray]',
- uint16Tag = '[object Uint16Array]',
- uint32Tag = '[object Uint32Array]';
-
-/** Used to identify `toStringTag` values of typed arrays. */
-var typedArrayTags = {};
-typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
-typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
-typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
-typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
-typedArrayTags[uint32Tag] = true;
-typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
-typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
-typedArrayTags[dateTag] = typedArrayTags[errorTag] =
-typedArrayTags[funcTag] = typedArrayTags[mapTag] =
-typedArrayTags[numberTag] = typedArrayTags[objectTag] =
-typedArrayTags[regexpTag] = typedArrayTags[setTag] =
-typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
-
-/** Used for native method references. */
-var objectProto = Object.prototype;
-
-/**
- * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
- * of values.
- */
-var objToString = objectProto.toString;
-
-/**
- * Checks if `value` is classified as a typed array.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
- * @example
- *
- * _.isTypedArray(new Uint8Array);
- * // => true
- *
- * _.isTypedArray([]);
- * // => false
- */
-function isTypedArray(value) {
- return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objToString.call(value)];
-}
-
-module.exports = isTypedArray;
-
-},{"../internal/isLength":49,"../internal/isObjectLike":50}],63:[function(require,module,exports){
-var assignWith = require('../internal/assignWith'),
- baseAssign = require('../internal/baseAssign'),
- createAssigner = require('../internal/createAssigner');
-
-/**
- * Assigns own enumerable properties of source object(s) to the destination
- * object. Subsequent sources overwrite property assignments of previous sources.
- * If `customizer` is provided it's invoked to produce the assigned values.
- * The `customizer` is bound to `thisArg` and invoked with five arguments:
- * (objectValue, sourceValue, key, object, source).
- *
- * **Note:** This method mutates `object` and is based on
- * [`Object.assign`](http://ecma-international.org/ecma-262/6.0/#sec-object.assign).
- *
- * @static
- * @memberOf _
- * @alias extend
- * @category Object
- * @param {Object} object The destination object.
- * @param {...Object} [sources] The source objects.
- * @param {Function} [customizer] The function to customize assigned values.
- * @param {*} [thisArg] The `this` binding of `customizer`.
- * @returns {Object} Returns `object`.
- * @example
- *
- * _.assign({ 'user': 'barney' }, { 'age': 40 }, { 'user': 'fred' });
- * // => { 'user': 'fred', 'age': 40 }
- *
- * // using a customizer callback
- * var defaults = _.partialRight(_.assign, function(value, other) {
- * return _.isUndefined(value) ? other : value;
- * });
- *
- * defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' });
- * // => { 'user': 'barney', 'age': 36 }
- */
-var assign = createAssigner(function(object, source, customizer) {
- return customizer
- ? assignWith(object, source, customizer)
- : baseAssign(object, source);
-});
-
-module.exports = assign;
-
-},{"../internal/assignWith":16,"../internal/baseAssign":17,"../internal/createAssigner":36}],64:[function(require,module,exports){
-var baseAssign = require('../internal/baseAssign'),
- baseCreate = require('../internal/baseCreate'),
- isIterateeCall = require('../internal/isIterateeCall');
-
-/**
- * Creates an object that inherits from the given `prototype` object. If a
- * `properties` object is provided its own enumerable properties are assigned
- * to the created object.
- *
- * @static
- * @memberOf _
- * @category Object
- * @param {Object} prototype The object to inherit from.
- * @param {Object} [properties] The properties to assign to the object.
- * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
- * @returns {Object} Returns the new object.
- * @example
- *
- * function Shape() {
- * this.x = 0;
- * this.y = 0;
- * }
- *
- * function Circle() {
- * Shape.call(this);
- * }
- *
- * Circle.prototype = _.create(Shape.prototype, {
- * 'constructor': Circle
- * });
- *
- * var circle = new Circle;
- * circle instanceof Circle;
- * // => true
- *
- * circle instanceof Shape;
- * // => true
- */
-function create(prototype, properties, guard) {
- var result = baseCreate(prototype);
- if (guard && isIterateeCall(prototype, properties, guard)) {
- properties = undefined;
- }
- return properties ? baseAssign(result, properties) : result;
-}
-
-module.exports = create;
-
-},{"../internal/baseAssign":17,"../internal/baseCreate":20,"../internal/isIterateeCall":47}],65:[function(require,module,exports){
-var getNative = require('../internal/getNative'),
- isArrayLike = require('../internal/isArrayLike'),
- isObject = require('../lang/isObject'),
- shimKeys = require('../internal/shimKeys');
-
-/* Native method references for those with the same name as other `lodash` methods. */
-var nativeKeys = getNative(Object, 'keys');
-
-/**
- * Creates an array of the own enumerable property names of `object`.
- *
- * **Note:** Non-object values are coerced to objects. See the
- * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys)
- * for more details.
- *
- * @static
- * @memberOf _
- * @category Object
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property names.
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.keys(new Foo);
- * // => ['a', 'b'] (iteration order is not guaranteed)
- *
- * _.keys('hi');
- * // => ['0', '1']
- */
-var keys = !nativeKeys ? shimKeys : function(object) {
- var Ctor = object == null ? undefined : object.constructor;
- if ((typeof Ctor == 'function' && Ctor.prototype === object) ||
- (typeof object != 'function' && isArrayLike(object))) {
- return shimKeys(object);
- }
- return isObject(object) ? nativeKeys(object) : [];
-};
-
-module.exports = keys;
-
-},{"../internal/getNative":44,"../internal/isArrayLike":45,"../internal/shimKeys":52,"../lang/isObject":60}],66:[function(require,module,exports){
-var isArguments = require('../lang/isArguments'),
- isArray = require('../lang/isArray'),
- isIndex = require('../internal/isIndex'),
- isLength = require('../internal/isLength'),
- isObject = require('../lang/isObject');
-
-/** Used for native method references. */
-var objectProto = Object.prototype;
-
-/** Used to check objects for own properties. */
-var hasOwnProperty = objectProto.hasOwnProperty;
-
-/**
- * Creates an array of the own and inherited enumerable property names of `object`.
- *
- * **Note:** Non-object values are coerced to objects.
- *
- * @static
- * @memberOf _
- * @category Object
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property names.
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.keysIn(new Foo);
- * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
- */
-function keysIn(object) {
- if (object == null) {
- return [];
- }
- if (!isObject(object)) {
- object = Object(object);
- }
- var length = object.length;
- length = (length && isLength(length) &&
- (isArray(object) || isArguments(object)) && length) || 0;
-
- var Ctor = object.constructor,
- index = -1,
- isProto = typeof Ctor == 'function' && Ctor.prototype === object,
- result = Array(length),
- skipIndexes = length > 0;
-
- while (++index < length) {
- result[index] = (index + '');
- }
- for (var key in object) {
- if (!(skipIndexes && isIndex(key, length)) &&
- !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
- result.push(key);
- }
- }
- return result;
-}
-
-module.exports = keysIn;
-
-},{"../internal/isIndex":46,"../internal/isLength":49,"../lang/isArguments":55,"../lang/isArray":56,"../lang/isObject":60}],67:[function(require,module,exports){
-var keys = require('./keys'),
- toObject = require('../internal/toObject');
-
-/**
- * Creates a two dimensional array of the key-value pairs for `object`,
- * e.g. `[[key1, value1], [key2, value2]]`.
- *
- * @static
- * @memberOf _
- * @category Object
- * @param {Object} object The object to query.
- * @returns {Array} Returns the new array of key-value pairs.
- * @example
- *
- * _.pairs({ 'barney': 36, 'fred': 40 });
- * // => [['barney', 36], ['fred', 40]] (iteration order is not guaranteed)
- */
-function pairs(object) {
- object = toObject(object);
-
- var index = -1,
- props = keys(object),
- length = props.length,
- result = Array(length);
-
- while (++index < length) {
- var key = props[index];
- result[index] = [key, object[key]];
- }
- return result;
-}
-
-module.exports = pairs;
-
-},{"../internal/toObject":53,"./keys":65}],68:[function(require,module,exports){
-/**
- * This method returns the first argument provided to it.
- *
- * @static
- * @memberOf _
- * @category Utility
- * @param {*} value Any value.
- * @returns {*} Returns `value`.
- * @example
- *
- * var object = { 'user': 'fred' };
- *
- * _.identity(object) === object;
- * // => true
- */
-function identity(value) {
- return value;
-}
-
-module.exports = identity;
-
-},{}],69:[function(require,module,exports){
-var baseProperty = require('../internal/baseProperty'),
- basePropertyDeep = require('../internal/basePropertyDeep'),
- isKey = require('../internal/isKey');
-
-/**
- * Creates a function that returns the property value at `path` on a
- * given object.
- *
- * @static
- * @memberOf _
- * @category Utility
- * @param {Array|string} path The path of the property to get.
- * @returns {Function} Returns the new function.
- * @example
- *
- * var objects = [
- * { 'a': { 'b': { 'c': 2 } } },
- * { 'a': { 'b': { 'c': 1 } } }
- * ];
- *
- * _.map(objects, _.property('a.b.c'));
- * // => [2, 1]
- *
- * _.pluck(_.sortBy(objects, _.property(['a', 'b', 'c'])), 'a.b.c');
- * // => [1, 2]
- */
-function property(path) {
- return isKey(path) ? baseProperty(path) : basePropertyDeep(path);
-}
-
-module.exports = property;
-
-},{"../internal/baseProperty":31,"../internal/basePropertyDeep":32,"../internal/isKey":48}],70:[function(require,module,exports){
-(function (global){
-
-/**
- * Module exports.
- */
-
-module.exports = deprecate;
-
-/**
- * Mark that a method should not be used.
- * Returns a modified function which warns once by default.
- *
- * If `localStorage.noDeprecation = true` is set, then it is a no-op.
- *
- * If `localStorage.throwDeprecation = true` is set, then deprecated functions
- * will throw an Error when invoked.
- *
- * If `localStorage.traceDeprecation = true` is set, then deprecated functions
- * will invoke `console.trace()` instead of `console.error()`.
- *
- * @param {Function} fn - the function to deprecate
- * @param {String} msg - the string to print to the console when `fn` is invoked
- * @returns {Function} a new "deprecated" version of `fn`
- * @api public
- */
-
-function deprecate (fn, msg) {
- if (config('noDeprecation')) {
- return fn;
- }
-
- var warned = false;
- function deprecated() {
- if (!warned) {
- if (config('throwDeprecation')) {
- throw new Error(msg);
- } else if (config('traceDeprecation')) {
- console.trace(msg);
- } else {
- console.warn(msg);
- }
- warned = true;
- }
- return fn.apply(this, arguments);
- }
-
- return deprecated;
-}
-
-/**
- * Checks `localStorage` for boolean values for the given `name`.
- *
- * @param {String} name
- * @returns {Boolean}
- * @api private
- */
-
-function config (name) {
- // accessing global.localStorage can trigger a DOMException in sandboxed iframes
- try {
- if (!global.localStorage) return false;
- } catch (_) {
- return false;
- }
- var val = global.localStorage[name];
- if (null == val) return false;
- return String(val).toLowerCase() === 'true';
-}
-
-}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
-},{}],71:[function(require,module,exports){
-// Generated by CoffeeScript 1.9.1
-(function() {
- var XMLAttribute, create;
-
- create = require('lodash/object/create');
-
- module.exports = XMLAttribute = (function() {
- function XMLAttribute(parent, name, value) {
- this.stringify = parent.stringify;
- if (name == null) {
- throw new Error("Missing attribute name of element " + parent.name);
- }
- if (value == null) {
- throw new Error("Missing attribute value for attribute " + name + " of element " + parent.name);
- }
- this.name = this.stringify.attName(name);
- this.value = this.stringify.attValue(value);
- }
-
- XMLAttribute.prototype.clone = function() {
- return create(XMLAttribute.prototype, this);
- };
-
- XMLAttribute.prototype.toString = function(options, level) {
- return ' ' + this.name + '="' + this.value + '"';
- };
-
- return XMLAttribute;
-
- })();
-
-}).call(this);
-
-},{"lodash/object/create":64}],72:[function(require,module,exports){
-// Generated by CoffeeScript 1.9.1
-(function() {
- var XMLBuilder, XMLDeclaration, XMLDocType, XMLElement, XMLStringifier;
-
- XMLStringifier = require('./XMLStringifier');
-
- XMLDeclaration = require('./XMLDeclaration');
-
- XMLDocType = require('./XMLDocType');
-
- XMLElement = require('./XMLElement');
-
- module.exports = XMLBuilder = (function() {
- function XMLBuilder(name, options) {
- var root, temp;
- if (name == null) {
- throw new Error("Root element needs a name");
- }
- if (options == null) {
- options = {};
- }
- this.options = options;
- this.stringify = new XMLStringifier(options);
- temp = new XMLElement(this, 'doc');
- root = temp.element(name);
- root.isRoot = true;
- root.documentObject = this;
- this.rootObject = root;
- if (!options.headless) {
- root.declaration(options);
- if ((options.pubID != null) || (options.sysID != null)) {
- root.doctype(options);
- }
- }
- }
-
- XMLBuilder.prototype.root = function() {
- return this.rootObject;
- };
-
- XMLBuilder.prototype.end = function(options) {
- return this.toString(options);
- };
-
- XMLBuilder.prototype.toString = function(options) {
- var indent, newline, offset, pretty, r, ref, ref1, ref2;
- pretty = (options != null ? options.pretty : void 0) || false;
- indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' ';
- offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0;
- newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n';
- r = '';
- if (this.xmldec != null) {
- r += this.xmldec.toString(options);
- }
- if (this.doctype != null) {
- r += this.doctype.toString(options);
- }
- r += this.rootObject.toString(options);
- if (pretty && r.slice(-newline.length) === newline) {
- r = r.slice(0, -newline.length);
- }
- return r;
- };
-
- return XMLBuilder;
-
- })();
-
-}).call(this);
-
-},{"./XMLDeclaration":79,"./XMLDocType":80,"./XMLElement":81,"./XMLStringifier":85}],73:[function(require,module,exports){
-// Generated by CoffeeScript 1.9.1
-(function() {
- var XMLCData, XMLNode, create,
- extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
- hasProp = {}.hasOwnProperty;
-
- create = require('lodash/object/create');
-
- XMLNode = require('./XMLNode');
-
- module.exports = XMLCData = (function(superClass) {
- extend(XMLCData, superClass);
-
- function XMLCData(parent, text) {
- XMLCData.__super__.constructor.call(this, parent);
- if (text == null) {
- throw new Error("Missing CDATA text");
- }
- this.text = this.stringify.cdata(text);
- }
-
- XMLCData.prototype.clone = function() {
- return create(XMLCData.prototype, this);
- };
-
- XMLCData.prototype.toString = function(options, level) {
- var indent, newline, offset, pretty, r, ref, ref1, ref2, space;
- pretty = (options != null ? options.pretty : void 0) || false;
- indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' ';
- offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0;
- newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n';
- level || (level = 0);
- space = new Array(level + offset + 1).join(indent);
- r = '';
- if (pretty) {
- r += space;
- }
- r += '';
- if (pretty) {
- r += newline;
- }
- return r;
- };
-
- return XMLCData;
-
- })(XMLNode);
-
-}).call(this);
-
-},{"./XMLNode":82,"lodash/object/create":64}],74:[function(require,module,exports){
-// Generated by CoffeeScript 1.9.1
-(function() {
- var XMLComment, XMLNode, create,
- extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
- hasProp = {}.hasOwnProperty;
-
- create = require('lodash/object/create');
-
- XMLNode = require('./XMLNode');
-
- module.exports = XMLComment = (function(superClass) {
- extend(XMLComment, superClass);
-
- function XMLComment(parent, text) {
- XMLComment.__super__.constructor.call(this, parent);
- if (text == null) {
- throw new Error("Missing comment text");
- }
- this.text = this.stringify.comment(text);
- }
-
- XMLComment.prototype.clone = function() {
- return create(XMLComment.prototype, this);
- };
-
- XMLComment.prototype.toString = function(options, level) {
- var indent, newline, offset, pretty, r, ref, ref1, ref2, space;
- pretty = (options != null ? options.pretty : void 0) || false;
- indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' ';
- offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0;
- newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n';
- level || (level = 0);
- space = new Array(level + offset + 1).join(indent);
- r = '';
- if (pretty) {
- r += space;
- }
- r += '';
- if (pretty) {
- r += newline;
- }
- return r;
- };
-
- return XMLComment;
-
- })(XMLNode);
-
-}).call(this);
-
-},{"./XMLNode":82,"lodash/object/create":64}],75:[function(require,module,exports){
-// Generated by CoffeeScript 1.9.1
-(function() {
- var XMLDTDAttList, create;
-
- create = require('lodash/object/create');
-
- module.exports = XMLDTDAttList = (function() {
- function XMLDTDAttList(parent, elementName, attributeName, attributeType, defaultValueType, defaultValue) {
- this.stringify = parent.stringify;
- if (elementName == null) {
- throw new Error("Missing DTD element name");
- }
- if (attributeName == null) {
- throw new Error("Missing DTD attribute name");
- }
- if (!attributeType) {
- throw new Error("Missing DTD attribute type");
- }
- if (!defaultValueType) {
- throw new Error("Missing DTD attribute default");
- }
- if (defaultValueType.indexOf('#') !== 0) {
- defaultValueType = '#' + defaultValueType;
- }
- if (!defaultValueType.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/)) {
- throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT");
- }
- if (defaultValue && !defaultValueType.match(/^(#FIXED|#DEFAULT)$/)) {
- throw new Error("Default value only applies to #FIXED or #DEFAULT");
- }
- this.elementName = this.stringify.eleName(elementName);
- this.attributeName = this.stringify.attName(attributeName);
- this.attributeType = this.stringify.dtdAttType(attributeType);
- this.defaultValue = this.stringify.dtdAttDefault(defaultValue);
- this.defaultValueType = defaultValueType;
- }
-
- XMLDTDAttList.prototype.toString = function(options, level) {
- var indent, newline, offset, pretty, r, ref, ref1, ref2, space;
- pretty = (options != null ? options.pretty : void 0) || false;
- indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' ';
- offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0;
- newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n';
- level || (level = 0);
- space = new Array(level + offset + 1).join(indent);
- r = '';
- if (pretty) {
- r += space;
- }
- r += '';
- if (pretty) {
- r += newline;
- }
- return r;
- };
-
- return XMLDTDAttList;
-
- })();
-
-}).call(this);
-
-},{"lodash/object/create":64}],76:[function(require,module,exports){
-// Generated by CoffeeScript 1.9.1
-(function() {
- var XMLDTDElement, create;
-
- create = require('lodash/object/create');
-
- module.exports = XMLDTDElement = (function() {
- function XMLDTDElement(parent, name, value) {
- this.stringify = parent.stringify;
- if (name == null) {
- throw new Error("Missing DTD element name");
- }
- if (!value) {
- value = '(#PCDATA)';
- }
- if (Array.isArray(value)) {
- value = '(' + value.join(',') + ')';
- }
- this.name = this.stringify.eleName(name);
- this.value = this.stringify.dtdElementValue(value);
- }
-
- XMLDTDElement.prototype.toString = function(options, level) {
- var indent, newline, offset, pretty, r, ref, ref1, ref2, space;
- pretty = (options != null ? options.pretty : void 0) || false;
- indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' ';
- offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0;
- newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n';
- level || (level = 0);
- space = new Array(level + offset + 1).join(indent);
- r = '';
- if (pretty) {
- r += space;
- }
- r += '';
- if (pretty) {
- r += newline;
- }
- return r;
- };
-
- return XMLDTDElement;
-
- })();
-
-}).call(this);
-
-},{"lodash/object/create":64}],77:[function(require,module,exports){
-// Generated by CoffeeScript 1.9.1
-(function() {
- var XMLDTDEntity, create, isObject;
-
- create = require('lodash/object/create');
-
- isObject = require('lodash/lang/isObject');
-
- module.exports = XMLDTDEntity = (function() {
- function XMLDTDEntity(parent, pe, name, value) {
- this.stringify = parent.stringify;
- if (name == null) {
- throw new Error("Missing entity name");
- }
- if (value == null) {
- throw new Error("Missing entity value");
- }
- this.pe = !!pe;
- this.name = this.stringify.eleName(name);
- if (!isObject(value)) {
- this.value = this.stringify.dtdEntityValue(value);
- } else {
- if (!value.pubID && !value.sysID) {
- throw new Error("Public and/or system identifiers are required for an external entity");
- }
- if (value.pubID && !value.sysID) {
- throw new Error("System identifier is required for a public external entity");
- }
- if (value.pubID != null) {
- this.pubID = this.stringify.dtdPubID(value.pubID);
- }
- if (value.sysID != null) {
- this.sysID = this.stringify.dtdSysID(value.sysID);
- }
- if (value.nData != null) {
- this.nData = this.stringify.dtdNData(value.nData);
- }
- if (this.pe && this.nData) {
- throw new Error("Notation declaration is not allowed in a parameter entity");
- }
- }
- }
-
- XMLDTDEntity.prototype.toString = function(options, level) {
- var indent, newline, offset, pretty, r, ref, ref1, ref2, space;
- pretty = (options != null ? options.pretty : void 0) || false;
- indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' ';
- offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0;
- newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n';
- level || (level = 0);
- space = new Array(level + offset + 1).join(indent);
- r = '';
- if (pretty) {
- r += space;
- }
- r += '';
- if (pretty) {
- r += newline;
- }
- return r;
- };
-
- return XMLDTDEntity;
-
- })();
-
-}).call(this);
-
-},{"lodash/lang/isObject":60,"lodash/object/create":64}],78:[function(require,module,exports){
-// Generated by CoffeeScript 1.9.1
-(function() {
- var XMLDTDNotation, create;
-
- create = require('lodash/object/create');
-
- module.exports = XMLDTDNotation = (function() {
- function XMLDTDNotation(parent, name, value) {
- this.stringify = parent.stringify;
- if (name == null) {
- throw new Error("Missing notation name");
- }
- if (!value.pubID && !value.sysID) {
- throw new Error("Public or system identifiers are required for an external entity");
- }
- this.name = this.stringify.eleName(name);
- if (value.pubID != null) {
- this.pubID = this.stringify.dtdPubID(value.pubID);
- }
- if (value.sysID != null) {
- this.sysID = this.stringify.dtdSysID(value.sysID);
- }
- }
-
- XMLDTDNotation.prototype.toString = function(options, level) {
- var indent, newline, offset, pretty, r, ref, ref1, ref2, space;
- pretty = (options != null ? options.pretty : void 0) || false;
- indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' ';
- offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0;
- newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n';
- level || (level = 0);
- space = new Array(level + offset + 1).join(indent);
- r = '';
- if (pretty) {
- r += space;
- }
- r += '';
- if (pretty) {
- r += newline;
- }
- return r;
- };
-
- return XMLDTDNotation;
-
- })();
-
-}).call(this);
-
-},{"lodash/object/create":64}],79:[function(require,module,exports){
-// Generated by CoffeeScript 1.9.1
-(function() {
- var XMLDeclaration, XMLNode, create, isObject,
- extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
- hasProp = {}.hasOwnProperty;
-
- create = require('lodash/object/create');
-
- isObject = require('lodash/lang/isObject');
-
- XMLNode = require('./XMLNode');
-
- module.exports = XMLDeclaration = (function(superClass) {
- extend(XMLDeclaration, superClass);
-
- function XMLDeclaration(parent, version, encoding, standalone) {
- var ref;
- XMLDeclaration.__super__.constructor.call(this, parent);
- if (isObject(version)) {
- ref = version, version = ref.version, encoding = ref.encoding, standalone = ref.standalone;
- }
- if (!version) {
- version = '1.0';
- }
- this.version = this.stringify.xmlVersion(version);
- if (encoding != null) {
- this.encoding = this.stringify.xmlEncoding(encoding);
- }
- if (standalone != null) {
- this.standalone = this.stringify.xmlStandalone(standalone);
- }
- }
-
- XMLDeclaration.prototype.toString = function(options, level) {
- var indent, newline, offset, pretty, r, ref, ref1, ref2, space;
- pretty = (options != null ? options.pretty : void 0) || false;
- indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' ';
- offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0;
- newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n';
- level || (level = 0);
- space = new Array(level + offset + 1).join(indent);
- r = '';
- if (pretty) {
- r += space;
- }
- r += '';
- if (pretty) {
- r += newline;
- }
- return r;
- };
-
- return XMLDeclaration;
-
- })(XMLNode);
-
-}).call(this);
-
-},{"./XMLNode":82,"lodash/lang/isObject":60,"lodash/object/create":64}],80:[function(require,module,exports){
-// Generated by CoffeeScript 1.9.1
-(function() {
- var XMLCData, XMLComment, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDocType, XMLProcessingInstruction, create, isObject;
-
- create = require('lodash/object/create');
-
- isObject = require('lodash/lang/isObject');
-
- XMLCData = require('./XMLCData');
-
- XMLComment = require('./XMLComment');
-
- XMLDTDAttList = require('./XMLDTDAttList');
-
- XMLDTDEntity = require('./XMLDTDEntity');
-
- XMLDTDElement = require('./XMLDTDElement');
-
- XMLDTDNotation = require('./XMLDTDNotation');
-
- XMLProcessingInstruction = require('./XMLProcessingInstruction');
-
- module.exports = XMLDocType = (function() {
- function XMLDocType(parent, pubID, sysID) {
- var ref, ref1;
- this.documentObject = parent;
- this.stringify = this.documentObject.stringify;
- this.children = [];
- if (isObject(pubID)) {
- ref = pubID, pubID = ref.pubID, sysID = ref.sysID;
- }
- if (sysID == null) {
- ref1 = [pubID, sysID], sysID = ref1[0], pubID = ref1[1];
- }
- if (pubID != null) {
- this.pubID = this.stringify.dtdPubID(pubID);
- }
- if (sysID != null) {
- this.sysID = this.stringify.dtdSysID(sysID);
- }
- }
-
- XMLDocType.prototype.element = function(name, value) {
- var child;
- child = new XMLDTDElement(this, name, value);
- this.children.push(child);
- return this;
- };
-
- XMLDocType.prototype.attList = function(elementName, attributeName, attributeType, defaultValueType, defaultValue) {
- var child;
- child = new XMLDTDAttList(this, elementName, attributeName, attributeType, defaultValueType, defaultValue);
- this.children.push(child);
- return this;
- };
-
- XMLDocType.prototype.entity = function(name, value) {
- var child;
- child = new XMLDTDEntity(this, false, name, value);
- this.children.push(child);
- return this;
- };
-
- XMLDocType.prototype.pEntity = function(name, value) {
- var child;
- child = new XMLDTDEntity(this, true, name, value);
- this.children.push(child);
- return this;
- };
-
- XMLDocType.prototype.notation = function(name, value) {
- var child;
- child = new XMLDTDNotation(this, name, value);
- this.children.push(child);
- return this;
- };
-
- XMLDocType.prototype.cdata = function(value) {
- var child;
- child = new XMLCData(this, value);
- this.children.push(child);
- return this;
- };
-
- XMLDocType.prototype.comment = function(value) {
- var child;
- child = new XMLComment(this, value);
- this.children.push(child);
- return this;
- };
-
- XMLDocType.prototype.instruction = function(target, value) {
- var child;
- child = new XMLProcessingInstruction(this, target, value);
- this.children.push(child);
- return this;
- };
-
- XMLDocType.prototype.root = function() {
- return this.documentObject.root();
- };
-
- XMLDocType.prototype.document = function() {
- return this.documentObject;
- };
-
- XMLDocType.prototype.toString = function(options, level) {
- var child, i, indent, len, newline, offset, pretty, r, ref, ref1, ref2, ref3, space;
- pretty = (options != null ? options.pretty : void 0) || false;
- indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' ';
- offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0;
- newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n';
- level || (level = 0);
- space = new Array(level + offset + 1).join(indent);
- r = '';
- if (pretty) {
- r += space;
- }
- r += ' 0) {
- r += ' [';
- if (pretty) {
- r += newline;
- }
- ref3 = this.children;
- for (i = 0, len = ref3.length; i < len; i++) {
- child = ref3[i];
- r += child.toString(options, level + 1);
- }
- r += ']';
- }
- r += '>';
- if (pretty) {
- r += newline;
- }
- return r;
- };
-
- XMLDocType.prototype.ele = function(name, value) {
- return this.element(name, value);
- };
-
- XMLDocType.prototype.att = function(elementName, attributeName, attributeType, defaultValueType, defaultValue) {
- return this.attList(elementName, attributeName, attributeType, defaultValueType, defaultValue);
- };
-
- XMLDocType.prototype.ent = function(name, value) {
- return this.entity(name, value);
- };
-
- XMLDocType.prototype.pent = function(name, value) {
- return this.pEntity(name, value);
- };
-
- XMLDocType.prototype.not = function(name, value) {
- return this.notation(name, value);
- };
-
- XMLDocType.prototype.dat = function(value) {
- return this.cdata(value);
- };
-
- XMLDocType.prototype.com = function(value) {
- return this.comment(value);
- };
-
- XMLDocType.prototype.ins = function(target, value) {
- return this.instruction(target, value);
- };
-
- XMLDocType.prototype.up = function() {
- return this.root();
- };
-
- XMLDocType.prototype.doc = function() {
- return this.document();
- };
-
- return XMLDocType;
-
- })();
-
-}).call(this);
-
-},{"./XMLCData":73,"./XMLComment":74,"./XMLDTDAttList":75,"./XMLDTDElement":76,"./XMLDTDEntity":77,"./XMLDTDNotation":78,"./XMLProcessingInstruction":83,"lodash/lang/isObject":60,"lodash/object/create":64}],81:[function(require,module,exports){
-// Generated by CoffeeScript 1.9.1
-(function() {
- var XMLAttribute, XMLElement, XMLNode, XMLProcessingInstruction, create, every, isFunction, isObject,
- extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
- hasProp = {}.hasOwnProperty;
-
- create = require('lodash/object/create');
-
- isObject = require('lodash/lang/isObject');
-
- isFunction = require('lodash/lang/isFunction');
-
- every = require('lodash/collection/every');
-
- XMLNode = require('./XMLNode');
-
- XMLAttribute = require('./XMLAttribute');
-
- XMLProcessingInstruction = require('./XMLProcessingInstruction');
-
- module.exports = XMLElement = (function(superClass) {
- extend(XMLElement, superClass);
-
- function XMLElement(parent, name, attributes) {
- XMLElement.__super__.constructor.call(this, parent);
- if (name == null) {
- throw new Error("Missing element name");
- }
- this.name = this.stringify.eleName(name);
- this.children = [];
- this.instructions = [];
- this.attributes = {};
- if (attributes != null) {
- this.attribute(attributes);
- }
- }
-
- XMLElement.prototype.clone = function() {
- var att, attName, clonedSelf, i, len, pi, ref, ref1;
- clonedSelf = create(XMLElement.prototype, this);
- if (clonedSelf.isRoot) {
- clonedSelf.documentObject = null;
- }
- clonedSelf.attributes = {};
- ref = this.attributes;
- for (attName in ref) {
- if (!hasProp.call(ref, attName)) continue;
- att = ref[attName];
- clonedSelf.attributes[attName] = att.clone();
- }
- clonedSelf.instructions = [];
- ref1 = this.instructions;
- for (i = 0, len = ref1.length; i < len; i++) {
- pi = ref1[i];
- clonedSelf.instructions.push(pi.clone());
- }
- clonedSelf.children = [];
- this.children.forEach(function(child) {
- var clonedChild;
- clonedChild = child.clone();
- clonedChild.parent = clonedSelf;
- return clonedSelf.children.push(clonedChild);
- });
- return clonedSelf;
- };
-
- XMLElement.prototype.attribute = function(name, value) {
- var attName, attValue;
- if (name != null) {
- name = name.valueOf();
- }
- if (isObject(name)) {
- for (attName in name) {
- if (!hasProp.call(name, attName)) continue;
- attValue = name[attName];
- this.attribute(attName, attValue);
- }
- } else {
- if (isFunction(value)) {
- value = value.apply();
- }
- if (!this.options.skipNullAttributes || (value != null)) {
- this.attributes[name] = new XMLAttribute(this, name, value);
- }
- }
- return this;
- };
-
- XMLElement.prototype.removeAttribute = function(name) {
- var attName, i, len;
- if (name == null) {
- throw new Error("Missing attribute name");
- }
- name = name.valueOf();
- if (Array.isArray(name)) {
- for (i = 0, len = name.length; i < len; i++) {
- attName = name[i];
- delete this.attributes[attName];
- }
- } else {
- delete this.attributes[name];
- }
- return this;
- };
-
- XMLElement.prototype.instruction = function(target, value) {
- var i, insTarget, insValue, instruction, len;
- if (target != null) {
- target = target.valueOf();
- }
- if (value != null) {
- value = value.valueOf();
- }
- if (Array.isArray(target)) {
- for (i = 0, len = target.length; i < len; i++) {
- insTarget = target[i];
- this.instruction(insTarget);
- }
- } else if (isObject(target)) {
- for (insTarget in target) {
- if (!hasProp.call(target, insTarget)) continue;
- insValue = target[insTarget];
- this.instruction(insTarget, insValue);
- }
- } else {
- if (isFunction(value)) {
- value = value.apply();
- }
- instruction = new XMLProcessingInstruction(this, target, value);
- this.instructions.push(instruction);
- }
- return this;
- };
-
- XMLElement.prototype.toString = function(options, level) {
- var att, child, i, indent, instruction, j, len, len1, name, newline, offset, pretty, r, ref, ref1, ref2, ref3, ref4, ref5, space;
- pretty = (options != null ? options.pretty : void 0) || false;
- indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' ';
- offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0;
- newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n';
- level || (level = 0);
- space = new Array(level + offset + 1).join(indent);
- r = '';
- ref3 = this.instructions;
- for (i = 0, len = ref3.length; i < len; i++) {
- instruction = ref3[i];
- r += instruction.toString(options, level);
- }
- if (pretty) {
- r += space;
- }
- r += '<' + this.name;
- ref4 = this.attributes;
- for (name in ref4) {
- if (!hasProp.call(ref4, name)) continue;
- att = ref4[name];
- r += att.toString(options);
- }
- if (this.children.length === 0 || every(this.children, function(e) {
- return e.value === '';
- })) {
- r += '/>';
- if (pretty) {
- r += newline;
- }
- } else if (pretty && this.children.length === 1 && (this.children[0].value != null)) {
- r += '>';
- r += this.children[0].value;
- r += '' + this.name + '>';
- r += newline;
- } else {
- r += '>';
- if (pretty) {
- r += newline;
- }
- ref5 = this.children;
- for (j = 0, len1 = ref5.length; j < len1; j++) {
- child = ref5[j];
- r += child.toString(options, level + 1);
- }
- if (pretty) {
- r += space;
- }
- r += '' + this.name + '>';
- if (pretty) {
- r += newline;
- }
- }
- return r;
- };
-
- XMLElement.prototype.att = function(name, value) {
- return this.attribute(name, value);
- };
-
- XMLElement.prototype.ins = function(target, value) {
- return this.instruction(target, value);
- };
-
- XMLElement.prototype.a = function(name, value) {
- return this.attribute(name, value);
- };
-
- XMLElement.prototype.i = function(target, value) {
- return this.instruction(target, value);
- };
-
- return XMLElement;
-
- })(XMLNode);
-
-}).call(this);
-
-},{"./XMLAttribute":71,"./XMLNode":82,"./XMLProcessingInstruction":83,"lodash/collection/every":12,"lodash/lang/isFunction":58,"lodash/lang/isObject":60,"lodash/object/create":64}],82:[function(require,module,exports){
-// Generated by CoffeeScript 1.9.1
-(function() {
- var XMLCData, XMLComment, XMLDeclaration, XMLDocType, XMLElement, XMLNode, XMLRaw, XMLText, isEmpty, isFunction, isObject,
- hasProp = {}.hasOwnProperty;
-
- isObject = require('lodash/lang/isObject');
-
- isFunction = require('lodash/lang/isFunction');
-
- isEmpty = require('lodash/lang/isEmpty');
-
- XMLElement = null;
-
- XMLCData = null;
-
- XMLComment = null;
-
- XMLDeclaration = null;
-
- XMLDocType = null;
-
- XMLRaw = null;
-
- XMLText = null;
-
- module.exports = XMLNode = (function() {
- function XMLNode(parent) {
- this.parent = parent;
- this.options = this.parent.options;
- this.stringify = this.parent.stringify;
- if (XMLElement === null) {
- XMLElement = require('./XMLElement');
- XMLCData = require('./XMLCData');
- XMLComment = require('./XMLComment');
- XMLDeclaration = require('./XMLDeclaration');
- XMLDocType = require('./XMLDocType');
- XMLRaw = require('./XMLRaw');
- XMLText = require('./XMLText');
- }
- }
-
- XMLNode.prototype.element = function(name, attributes, text) {
- var childNode, item, j, k, key, lastChild, len, len1, ref, val;
- lastChild = null;
- if (attributes == null) {
- attributes = {};
- }
- attributes = attributes.valueOf();
- if (!isObject(attributes)) {
- ref = [attributes, text], text = ref[0], attributes = ref[1];
- }
- if (name != null) {
- name = name.valueOf();
- }
- if (Array.isArray(name)) {
- for (j = 0, len = name.length; j < len; j++) {
- item = name[j];
- lastChild = this.element(item);
- }
- } else if (isFunction(name)) {
- lastChild = this.element(name.apply());
- } else if (isObject(name)) {
- for (key in name) {
- if (!hasProp.call(name, key)) continue;
- val = name[key];
- if (isFunction(val)) {
- val = val.apply();
- }
- if ((isObject(val)) && (isEmpty(val))) {
- val = null;
- }
- if (!this.options.ignoreDecorators && this.stringify.convertAttKey && key.indexOf(this.stringify.convertAttKey) === 0) {
- lastChild = this.attribute(key.substr(this.stringify.convertAttKey.length), val);
- } else if (!this.options.ignoreDecorators && this.stringify.convertPIKey && key.indexOf(this.stringify.convertPIKey) === 0) {
- lastChild = this.instruction(key.substr(this.stringify.convertPIKey.length), val);
- } else if (Array.isArray(val)) {
- for (k = 0, len1 = val.length; k < len1; k++) {
- item = val[k];
- childNode = {};
- childNode[key] = item;
- lastChild = this.element(childNode);
- }
- } else if (isObject(val)) {
- lastChild = this.element(key);
- lastChild.element(val);
- } else {
- lastChild = this.element(key, val);
- }
- }
- } else {
- if (!this.options.ignoreDecorators && this.stringify.convertTextKey && name.indexOf(this.stringify.convertTextKey) === 0) {
- lastChild = this.text(text);
- } else if (!this.options.ignoreDecorators && this.stringify.convertCDataKey && name.indexOf(this.stringify.convertCDataKey) === 0) {
- lastChild = this.cdata(text);
- } else if (!this.options.ignoreDecorators && this.stringify.convertCommentKey && name.indexOf(this.stringify.convertCommentKey) === 0) {
- lastChild = this.comment(text);
- } else if (!this.options.ignoreDecorators && this.stringify.convertRawKey && name.indexOf(this.stringify.convertRawKey) === 0) {
- lastChild = this.raw(text);
- } else {
- lastChild = this.node(name, attributes, text);
- }
- }
- if (lastChild == null) {
- throw new Error("Could not create any elements with: " + name);
- }
- return lastChild;
- };
-
- XMLNode.prototype.insertBefore = function(name, attributes, text) {
- var child, i, removed;
- if (this.isRoot) {
- throw new Error("Cannot insert elements at root level");
- }
- i = this.parent.children.indexOf(this);
- removed = this.parent.children.splice(i);
- child = this.parent.element(name, attributes, text);
- Array.prototype.push.apply(this.parent.children, removed);
- return child;
- };
-
- XMLNode.prototype.insertAfter = function(name, attributes, text) {
- var child, i, removed;
- if (this.isRoot) {
- throw new Error("Cannot insert elements at root level");
- }
- i = this.parent.children.indexOf(this);
- removed = this.parent.children.splice(i + 1);
- child = this.parent.element(name, attributes, text);
- Array.prototype.push.apply(this.parent.children, removed);
- return child;
- };
-
- XMLNode.prototype.remove = function() {
- var i, ref;
- if (this.isRoot) {
- throw new Error("Cannot remove the root element");
- }
- i = this.parent.children.indexOf(this);
- [].splice.apply(this.parent.children, [i, i - i + 1].concat(ref = [])), ref;
- return this.parent;
- };
-
- XMLNode.prototype.node = function(name, attributes, text) {
- var child, ref;
- if (name != null) {
- name = name.valueOf();
- }
- if (attributes == null) {
- attributes = {};
- }
- attributes = attributes.valueOf();
- if (!isObject(attributes)) {
- ref = [attributes, text], text = ref[0], attributes = ref[1];
- }
- child = new XMLElement(this, name, attributes);
- if (text != null) {
- child.text(text);
- }
- this.children.push(child);
- return child;
- };
-
- XMLNode.prototype.text = function(value) {
- var child;
- child = new XMLText(this, value);
- this.children.push(child);
- return this;
- };
-
- XMLNode.prototype.cdata = function(value) {
- var child;
- child = new XMLCData(this, value);
- this.children.push(child);
- return this;
- };
-
- XMLNode.prototype.comment = function(value) {
- var child;
- child = new XMLComment(this, value);
- this.children.push(child);
- return this;
- };
-
- XMLNode.prototype.raw = function(value) {
- var child;
- child = new XMLRaw(this, value);
- this.children.push(child);
- return this;
- };
-
- XMLNode.prototype.declaration = function(version, encoding, standalone) {
- var doc, xmldec;
- doc = this.document();
- xmldec = new XMLDeclaration(doc, version, encoding, standalone);
- doc.xmldec = xmldec;
- return doc.root();
- };
-
- XMLNode.prototype.doctype = function(pubID, sysID) {
- var doc, doctype;
- doc = this.document();
- doctype = new XMLDocType(doc, pubID, sysID);
- doc.doctype = doctype;
- return doctype;
- };
-
- XMLNode.prototype.up = function() {
- if (this.isRoot) {
- throw new Error("The root node has no parent. Use doc() if you need to get the document object.");
- }
- return this.parent;
- };
-
- XMLNode.prototype.root = function() {
- var child;
- if (this.isRoot) {
- return this;
- }
- child = this.parent;
- while (!child.isRoot) {
- child = child.parent;
- }
- return child;
- };
-
- XMLNode.prototype.document = function() {
- return this.root().documentObject;
- };
-
- XMLNode.prototype.end = function(options) {
- return this.document().toString(options);
- };
-
- XMLNode.prototype.prev = function() {
- var i;
- if (this.isRoot) {
- throw new Error("Root node has no siblings");
- }
- i = this.parent.children.indexOf(this);
- if (i < 1) {
- throw new Error("Already at the first node");
- }
- return this.parent.children[i - 1];
- };
-
- XMLNode.prototype.next = function() {
- var i;
- if (this.isRoot) {
- throw new Error("Root node has no siblings");
- }
- i = this.parent.children.indexOf(this);
- if (i === -1 || i === this.parent.children.length - 1) {
- throw new Error("Already at the last node");
- }
- return this.parent.children[i + 1];
- };
-
- XMLNode.prototype.importXMLBuilder = function(xmlbuilder) {
- var clonedRoot;
- clonedRoot = xmlbuilder.root().clone();
- clonedRoot.parent = this;
- clonedRoot.isRoot = false;
- this.children.push(clonedRoot);
- return this;
- };
-
- XMLNode.prototype.ele = function(name, attributes, text) {
- return this.element(name, attributes, text);
- };
-
- XMLNode.prototype.nod = function(name, attributes, text) {
- return this.node(name, attributes, text);
- };
-
- XMLNode.prototype.txt = function(value) {
- return this.text(value);
- };
-
- XMLNode.prototype.dat = function(value) {
- return this.cdata(value);
- };
-
- XMLNode.prototype.com = function(value) {
- return this.comment(value);
- };
-
- XMLNode.prototype.doc = function() {
- return this.document();
- };
-
- XMLNode.prototype.dec = function(version, encoding, standalone) {
- return this.declaration(version, encoding, standalone);
- };
-
- XMLNode.prototype.dtd = function(pubID, sysID) {
- return this.doctype(pubID, sysID);
- };
-
- XMLNode.prototype.e = function(name, attributes, text) {
- return this.element(name, attributes, text);
- };
-
- XMLNode.prototype.n = function(name, attributes, text) {
- return this.node(name, attributes, text);
- };
-
- XMLNode.prototype.t = function(value) {
- return this.text(value);
- };
-
- XMLNode.prototype.d = function(value) {
- return this.cdata(value);
- };
-
- XMLNode.prototype.c = function(value) {
- return this.comment(value);
- };
-
- XMLNode.prototype.r = function(value) {
- return this.raw(value);
- };
-
- XMLNode.prototype.u = function() {
- return this.up();
- };
-
- return XMLNode;
-
- })();
-
-}).call(this);
-
-},{"./XMLCData":73,"./XMLComment":74,"./XMLDeclaration":79,"./XMLDocType":80,"./XMLElement":81,"./XMLRaw":84,"./XMLText":86,"lodash/lang/isEmpty":57,"lodash/lang/isFunction":58,"lodash/lang/isObject":60}],83:[function(require,module,exports){
-// Generated by CoffeeScript 1.9.1
-(function() {
- var XMLProcessingInstruction, create;
-
- create = require('lodash/object/create');
-
- module.exports = XMLProcessingInstruction = (function() {
- function XMLProcessingInstruction(parent, target, value) {
- this.stringify = parent.stringify;
- if (target == null) {
- throw new Error("Missing instruction target");
- }
- this.target = this.stringify.insTarget(target);
- if (value) {
- this.value = this.stringify.insValue(value);
- }
- }
-
- XMLProcessingInstruction.prototype.clone = function() {
- return create(XMLProcessingInstruction.prototype, this);
- };
-
- XMLProcessingInstruction.prototype.toString = function(options, level) {
- var indent, newline, offset, pretty, r, ref, ref1, ref2, space;
- pretty = (options != null ? options.pretty : void 0) || false;
- indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' ';
- offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0;
- newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n';
- level || (level = 0);
- space = new Array(level + offset + 1).join(indent);
- r = '';
- if (pretty) {
- r += space;
- }
- r += '';
- r += this.target;
- if (this.value) {
- r += ' ' + this.value;
- }
- r += '?>';
- if (pretty) {
- r += newline;
- }
- return r;
- };
-
- return XMLProcessingInstruction;
-
- })();
-
-}).call(this);
-
-},{"lodash/object/create":64}],84:[function(require,module,exports){
-// Generated by CoffeeScript 1.9.1
-(function() {
- var XMLNode, XMLRaw, create,
- extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
- hasProp = {}.hasOwnProperty;
-
- create = require('lodash/object/create');
-
- XMLNode = require('./XMLNode');
-
- module.exports = XMLRaw = (function(superClass) {
- extend(XMLRaw, superClass);
-
- function XMLRaw(parent, text) {
- XMLRaw.__super__.constructor.call(this, parent);
- if (text == null) {
- throw new Error("Missing raw text");
- }
- this.value = this.stringify.raw(text);
- }
-
- XMLRaw.prototype.clone = function() {
- return create(XMLRaw.prototype, this);
- };
-
- XMLRaw.prototype.toString = function(options, level) {
- var indent, newline, offset, pretty, r, ref, ref1, ref2, space;
- pretty = (options != null ? options.pretty : void 0) || false;
- indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' ';
- offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0;
- newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n';
- level || (level = 0);
- space = new Array(level + offset + 1).join(indent);
- r = '';
- if (pretty) {
- r += space;
- }
- r += this.value;
- if (pretty) {
- r += newline;
- }
- return r;
- };
-
- return XMLRaw;
-
- })(XMLNode);
-
-}).call(this);
-
-},{"./XMLNode":82,"lodash/object/create":64}],85:[function(require,module,exports){
-// Generated by CoffeeScript 1.9.1
-(function() {
- var XMLStringifier,
- bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
- hasProp = {}.hasOwnProperty;
-
- module.exports = XMLStringifier = (function() {
- function XMLStringifier(options) {
- this.assertLegalChar = bind(this.assertLegalChar, this);
- var key, ref, value;
- this.allowSurrogateChars = options != null ? options.allowSurrogateChars : void 0;
- ref = (options != null ? options.stringify : void 0) || {};
- for (key in ref) {
- if (!hasProp.call(ref, key)) continue;
- value = ref[key];
- this[key] = value;
- }
- }
-
- XMLStringifier.prototype.eleName = function(val) {
- val = '' + val || '';
- return this.assertLegalChar(val);
- };
-
- XMLStringifier.prototype.eleText = function(val) {
- val = '' + val || '';
- return this.assertLegalChar(this.elEscape(val));
- };
-
- XMLStringifier.prototype.cdata = function(val) {
- val = '' + val || '';
- if (val.match(/]]>/)) {
- throw new Error("Invalid CDATA text: " + val);
- }
- return this.assertLegalChar(val);
- };
-
- XMLStringifier.prototype.comment = function(val) {
- val = '' + val || '';
- if (val.match(/--/)) {
- throw new Error("Comment text cannot contain double-hypen: " + val);
- }
- return this.assertLegalChar(val);
- };
-
- XMLStringifier.prototype.raw = function(val) {
- return '' + val || '';
- };
-
- XMLStringifier.prototype.attName = function(val) {
- return '' + val || '';
- };
-
- XMLStringifier.prototype.attValue = function(val) {
- val = '' + val || '';
- return this.attEscape(val);
- };
-
- XMLStringifier.prototype.insTarget = function(val) {
- return '' + val || '';
- };
-
- XMLStringifier.prototype.insValue = function(val) {
- val = '' + val || '';
- if (val.match(/\?>/)) {
- throw new Error("Invalid processing instruction value: " + val);
- }
- return val;
- };
-
- XMLStringifier.prototype.xmlVersion = function(val) {
- val = '' + val || '';
- if (!val.match(/1\.[0-9]+/)) {
- throw new Error("Invalid version number: " + val);
- }
- return val;
- };
-
- XMLStringifier.prototype.xmlEncoding = function(val) {
- val = '' + val || '';
- if (!val.match(/^[A-Za-z](?:[A-Za-z0-9._-]|-)*$/)) {
- throw new Error("Invalid encoding: " + val);
- }
- return val;
- };
-
- XMLStringifier.prototype.xmlStandalone = function(val) {
- if (val) {
- return "yes";
- } else {
- return "no";
- }
- };
-
- XMLStringifier.prototype.dtdPubID = function(val) {
- return '' + val || '';
- };
-
- XMLStringifier.prototype.dtdSysID = function(val) {
- return '' + val || '';
- };
-
- XMLStringifier.prototype.dtdElementValue = function(val) {
- return '' + val || '';
- };
-
- XMLStringifier.prototype.dtdAttType = function(val) {
- return '' + val || '';
- };
-
- XMLStringifier.prototype.dtdAttDefault = function(val) {
- if (val != null) {
- return '' + val || '';
- } else {
- return val;
- }
- };
-
- XMLStringifier.prototype.dtdEntityValue = function(val) {
- return '' + val || '';
- };
-
- XMLStringifier.prototype.dtdNData = function(val) {
- return '' + val || '';
- };
-
- XMLStringifier.prototype.convertAttKey = '@';
-
- XMLStringifier.prototype.convertPIKey = '?';
-
- XMLStringifier.prototype.convertTextKey = '#text';
-
- XMLStringifier.prototype.convertCDataKey = '#cdata';
-
- XMLStringifier.prototype.convertCommentKey = '#comment';
-
- XMLStringifier.prototype.convertRawKey = '#raw';
-
- XMLStringifier.prototype.assertLegalChar = function(str) {
- var chars, chr;
- if (this.allowSurrogateChars) {
- chars = /[\u0000-\u0008\u000B-\u000C\u000E-\u001F\uFFFE-\uFFFF]/;
- } else {
- chars = /[\u0000-\u0008\u000B-\u000C\u000E-\u001F\uD800-\uDFFF\uFFFE-\uFFFF]/;
- }
- chr = str.match(chars);
- if (chr) {
- throw new Error("Invalid character (" + chr + ") in string: " + str + " at index " + chr.index);
- }
- return str;
- };
-
- XMLStringifier.prototype.elEscape = function(str) {
- return str.replace(/&/g, '&').replace(//g, '>').replace(/\r/g, '
');
- };
-
- XMLStringifier.prototype.attEscape = function(str) {
- return str.replace(/&/g, '&').replace(/','amp':'&','quot':'"','apos':"'"}
- if(locator){
- domBuilder.setDocumentLocator(locator)
- }
-
- sax.errorHandler = buildErrorHandler(errorHandler,domBuilder,locator);
- sax.domBuilder = options.domBuilder || domBuilder;
- if(/\/x?html?$/.test(mimeType)){
- entityMap.nbsp = '\xa0';
- entityMap.copy = '\xa9';
- defaultNSMap['']= 'http://www.w3.org/1999/xhtml';
- }
- if(source){
- sax.parse(source,defaultNSMap,entityMap);
- }else{
- sax.errorHandler.error("invalid document source");
- }
- return domBuilder.document;
-}
-function buildErrorHandler(errorImpl,domBuilder,locator){
- if(!errorImpl){
- if(domBuilder instanceof DOMHandler){
- return domBuilder;
- }
- errorImpl = domBuilder ;
- }
- var errorHandler = {}
- var isCallback = errorImpl instanceof Function;
- locator = locator||{}
- function build(key){
- var fn = errorImpl[key];
- if(!fn){
- if(isCallback){
- fn = errorImpl.length == 2?function(msg){errorImpl(key,msg)}:errorImpl;
- }else{
- var i=arguments.length;
- while(--i){
- if(fn = errorImpl[arguments[i]]){
- break;
- }
- }
- }
- }
- errorHandler[key] = fn && function(msg){
- fn(msg+_locator(locator));
- }||function(){};
- }
- build('warning','warn');
- build('error','warn','warning');
- build('fatalError','warn','warning','error');
- return errorHandler;
-}
-/**
- * +ContentHandler+ErrorHandler
- * +LexicalHandler+EntityResolver2
- * -DeclHandler-DTDHandler
- *
- * DefaultHandler:EntityResolver, DTDHandler, ContentHandler, ErrorHandler
- * DefaultHandler2:DefaultHandler,LexicalHandler, DeclHandler, EntityResolver2
- * @link http://www.saxproject.org/apidoc/org/xml/sax/helpers/DefaultHandler.html
- */
-function DOMHandler() {
- this.cdata = false;
-}
-function position(locator,node){
- node.lineNumber = locator.lineNumber;
- node.columnNumber = locator.columnNumber;
-}
-/**
- * @see org.xml.sax.ContentHandler#startDocument
- * @link http://www.saxproject.org/apidoc/org/xml/sax/ContentHandler.html
- */
-DOMHandler.prototype = {
- startDocument : function() {
- this.document = new DOMImplementation().createDocument(null, null, null);
- if (this.locator) {
- this.document.documentURI = this.locator.systemId;
- }
- },
- startElement:function(namespaceURI, localName, qName, attrs) {
- var doc = this.document;
- var el = doc.createElementNS(namespaceURI, qName||localName);
- var len = attrs.length;
- appendElement(this, el);
- this.currentElement = el;
-
- this.locator && position(this.locator,el)
- for (var i = 0 ; i < len; i++) {
- var namespaceURI = attrs.getURI(i);
- var value = attrs.getValue(i);
- var qName = attrs.getQName(i);
- var attr = doc.createAttributeNS(namespaceURI, qName);
- if( attr.getOffset){
- position(attr.getOffset(1),attr)
- }
- attr.value = attr.nodeValue = value;
- el.setAttributeNode(attr)
- }
- },
- endElement:function(namespaceURI, localName, qName) {
- var current = this.currentElement
- var tagName = current.tagName;
- this.currentElement = current.parentNode;
- },
- startPrefixMapping:function(prefix, uri) {
- },
- endPrefixMapping:function(prefix) {
- },
- processingInstruction:function(target, data) {
- var ins = this.document.createProcessingInstruction(target, data);
- this.locator && position(this.locator,ins)
- appendElement(this, ins);
- },
- ignorableWhitespace:function(ch, start, length) {
- },
- characters:function(chars, start, length) {
- chars = _toString.apply(this,arguments)
- //console.log(chars)
- if(this.currentElement && chars){
- if (this.cdata) {
- var charNode = this.document.createCDATASection(chars);
- this.currentElement.appendChild(charNode);
- } else {
- var charNode = this.document.createTextNode(chars);
- this.currentElement.appendChild(charNode);
- }
- this.locator && position(this.locator,charNode)
- }
- },
- skippedEntity:function(name) {
- },
- endDocument:function() {
- this.document.normalize();
- },
- setDocumentLocator:function (locator) {
- if(this.locator = locator){// && !('lineNumber' in locator)){
- locator.lineNumber = 0;
- }
- },
- //LexicalHandler
- comment:function(chars, start, length) {
- chars = _toString.apply(this,arguments)
- var comm = this.document.createComment(chars);
- this.locator && position(this.locator,comm)
- appendElement(this, comm);
- },
-
- startCDATA:function() {
- //used in characters() methods
- this.cdata = true;
- },
- endCDATA:function() {
- this.cdata = false;
- },
-
- startDTD:function(name, publicId, systemId) {
- var impl = this.document.implementation;
- if (impl && impl.createDocumentType) {
- var dt = impl.createDocumentType(name, publicId, systemId);
- this.locator && position(this.locator,dt)
- appendElement(this, dt);
- }
- },
- /**
- * @see org.xml.sax.ErrorHandler
- * @link http://www.saxproject.org/apidoc/org/xml/sax/ErrorHandler.html
- */
- warning:function(error) {
- console.warn(error,_locator(this.locator));
- },
- error:function(error) {
- console.error(error,_locator(this.locator));
- },
- fatalError:function(error) {
- console.error(error,_locator(this.locator));
- throw error;
- }
-}
-function _locator(l){
- if(l){
- return '\n@'+(l.systemId ||'')+'#[line:'+l.lineNumber+',col:'+l.columnNumber+']'
- }
-}
-function _toString(chars,start,length){
- if(typeof chars == 'string'){
- return chars.substr(start,length)
- }else{//java sax connect width xmldom on rhino(what about: "? && !(chars instanceof String)")
- if(chars.length >= start+length || start){
- return new java.lang.String(chars,start,length)+'';
- }
- return chars;
- }
-}
-
-/*
- * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/LexicalHandler.html
- * used method of org.xml.sax.ext.LexicalHandler:
- * #comment(chars, start, length)
- * #startCDATA()
- * #endCDATA()
- * #startDTD(name, publicId, systemId)
- *
- *
- * IGNORED method of org.xml.sax.ext.LexicalHandler:
- * #endDTD()
- * #startEntity(name)
- * #endEntity(name)
- *
- *
- * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/DeclHandler.html
- * IGNORED method of org.xml.sax.ext.DeclHandler
- * #attributeDecl(eName, aName, type, mode, value)
- * #elementDecl(name, model)
- * #externalEntityDecl(name, publicId, systemId)
- * #internalEntityDecl(name, value)
- * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/EntityResolver2.html
- * IGNORED method of org.xml.sax.EntityResolver2
- * #resolveEntity(String name,String publicId,String baseURI,String systemId)
- * #resolveEntity(publicId, systemId)
- * #getExternalSubset(name, baseURI)
- * @link http://www.saxproject.org/apidoc/org/xml/sax/DTDHandler.html
- * IGNORED method of org.xml.sax.DTDHandler
- * #notationDecl(name, publicId, systemId) {};
- * #unparsedEntityDecl(name, publicId, systemId, notationName) {};
- */
-"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(key){
- DOMHandler.prototype[key] = function(){return null}
-})
-
-/* Private static helpers treated below as private instance methods, so don't need to add these to the public API; we might use a Relator to also get rid of non-standard public properties */
-function appendElement (hander,node) {
- if (!hander.currentElement) {
- hander.document.appendChild(node);
- } else {
- hander.currentElement.appendChild(node);
- }
-}//appendChild and setAttributeNS are preformance key
-
-if(typeof require == 'function'){
- var XMLReader = require('./sax').XMLReader;
- var DOMImplementation = exports.DOMImplementation = require('./dom').DOMImplementation;
- exports.XMLSerializer = require('./dom').XMLSerializer ;
- exports.DOMParser = DOMParser;
-}
-
-},{"./dom":89,"./sax":90}],89:[function(require,module,exports){
-/*
- * DOM Level 2
- * Object DOMException
- * @see http://www.w3.org/TR/REC-DOM-Level-1/ecma-script-language-binding.html
- * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html
- */
-
-function copy(src,dest){
- for(var p in src){
- dest[p] = src[p];
- }
-}
-/**
-^\w+\.prototype\.([_\w]+)\s*=\s*((?:.*\{\s*?[\r\n][\s\S]*?^})|\S.*?(?=[;\r\n]));?
-^\w+\.prototype\.([_\w]+)\s*=\s*(\S.*?(?=[;\r\n]));?
- */
-function _extends(Class,Super){
- var pt = Class.prototype;
- if(Object.create){
- var ppt = Object.create(Super.prototype)
- pt.__proto__ = ppt;
- }
- if(!(pt instanceof Super)){
- function t(){};
- t.prototype = Super.prototype;
- t = new t();
- copy(pt,t);
- Class.prototype = pt = t;
- }
- if(pt.constructor != Class){
- if(typeof Class != 'function'){
- console.error("unknow Class:"+Class)
- }
- pt.constructor = Class
- }
-}
-var htmlns = 'http://www.w3.org/1999/xhtml' ;
-// Node Types
-var NodeType = {}
-var ELEMENT_NODE = NodeType.ELEMENT_NODE = 1;
-var ATTRIBUTE_NODE = NodeType.ATTRIBUTE_NODE = 2;
-var TEXT_NODE = NodeType.TEXT_NODE = 3;
-var CDATA_SECTION_NODE = NodeType.CDATA_SECTION_NODE = 4;
-var ENTITY_REFERENCE_NODE = NodeType.ENTITY_REFERENCE_NODE = 5;
-var ENTITY_NODE = NodeType.ENTITY_NODE = 6;
-var PROCESSING_INSTRUCTION_NODE = NodeType.PROCESSING_INSTRUCTION_NODE = 7;
-var COMMENT_NODE = NodeType.COMMENT_NODE = 8;
-var DOCUMENT_NODE = NodeType.DOCUMENT_NODE = 9;
-var DOCUMENT_TYPE_NODE = NodeType.DOCUMENT_TYPE_NODE = 10;
-var DOCUMENT_FRAGMENT_NODE = NodeType.DOCUMENT_FRAGMENT_NODE = 11;
-var NOTATION_NODE = NodeType.NOTATION_NODE = 12;
-
-// ExceptionCode
-var ExceptionCode = {}
-var ExceptionMessage = {};
-var INDEX_SIZE_ERR = ExceptionCode.INDEX_SIZE_ERR = ((ExceptionMessage[1]="Index size error"),1);
-var DOMSTRING_SIZE_ERR = ExceptionCode.DOMSTRING_SIZE_ERR = ((ExceptionMessage[2]="DOMString size error"),2);
-var HIERARCHY_REQUEST_ERR = ExceptionCode.HIERARCHY_REQUEST_ERR = ((ExceptionMessage[3]="Hierarchy request error"),3);
-var WRONG_DOCUMENT_ERR = ExceptionCode.WRONG_DOCUMENT_ERR = ((ExceptionMessage[4]="Wrong document"),4);
-var INVALID_CHARACTER_ERR = ExceptionCode.INVALID_CHARACTER_ERR = ((ExceptionMessage[5]="Invalid character"),5);
-var NO_DATA_ALLOWED_ERR = ExceptionCode.NO_DATA_ALLOWED_ERR = ((ExceptionMessage[6]="No data allowed"),6);
-var NO_MODIFICATION_ALLOWED_ERR = ExceptionCode.NO_MODIFICATION_ALLOWED_ERR = ((ExceptionMessage[7]="No modification allowed"),7);
-var NOT_FOUND_ERR = ExceptionCode.NOT_FOUND_ERR = ((ExceptionMessage[8]="Not found"),8);
-var NOT_SUPPORTED_ERR = ExceptionCode.NOT_SUPPORTED_ERR = ((ExceptionMessage[9]="Not supported"),9);
-var INUSE_ATTRIBUTE_ERR = ExceptionCode.INUSE_ATTRIBUTE_ERR = ((ExceptionMessage[10]="Attribute in use"),10);
-//level2
-var INVALID_STATE_ERR = ExceptionCode.INVALID_STATE_ERR = ((ExceptionMessage[11]="Invalid state"),11);
-var SYNTAX_ERR = ExceptionCode.SYNTAX_ERR = ((ExceptionMessage[12]="Syntax error"),12);
-var INVALID_MODIFICATION_ERR = ExceptionCode.INVALID_MODIFICATION_ERR = ((ExceptionMessage[13]="Invalid modification"),13);
-var NAMESPACE_ERR = ExceptionCode.NAMESPACE_ERR = ((ExceptionMessage[14]="Invalid namespace"),14);
-var INVALID_ACCESS_ERR = ExceptionCode.INVALID_ACCESS_ERR = ((ExceptionMessage[15]="Invalid access"),15);
-
-
-function DOMException(code, message) {
- if(message instanceof Error){
- var error = message;
- }else{
- error = this;
- Error.call(this, ExceptionMessage[code]);
- this.message = ExceptionMessage[code];
- if(Error.captureStackTrace) Error.captureStackTrace(this, DOMException);
- }
- error.code = code;
- if(message) this.message = this.message + ": " + message;
- return error;
-};
-DOMException.prototype = Error.prototype;
-copy(ExceptionCode,DOMException)
-/**
- * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-536297177
- * The NodeList interface provides the abstraction of an ordered collection of nodes, without defining or constraining how this collection is implemented. NodeList objects in the DOM are live.
- * The items in the NodeList are accessible via an integral index, starting from 0.
- */
-function NodeList() {
-};
-NodeList.prototype = {
- /**
- * The number of nodes in the list. The range of valid child node indices is 0 to length-1 inclusive.
- * @standard level1
- */
- length:0,
- /**
- * Returns the indexth item in the collection. If index is greater than or equal to the number of nodes in the list, this returns null.
- * @standard level1
- * @param index unsigned long
- * Index into the collection.
- * @return Node
- * The node at the indexth position in the NodeList, or null if that is not a valid index.
- */
- item: function(index) {
- return this[index] || null;
- }
-};
-function LiveNodeList(node,refresh){
- this._node = node;
- this._refresh = refresh
- _updateLiveList(this);
-}
-function _updateLiveList(list){
- var inc = list._node._inc || list._node.ownerDocument._inc;
- if(list._inc != inc){
- var ls = list._refresh(list._node);
- //console.log(ls.length)
- __set__(list,'length',ls.length);
- copy(ls,list);
- list._inc = inc;
- }
-}
-LiveNodeList.prototype.item = function(i){
- _updateLiveList(this);
- return this[i];
-}
-
-_extends(LiveNodeList,NodeList);
-/**
- *
- * Objects implementing the NamedNodeMap interface are used to represent collections of nodes that can be accessed by name. Note that NamedNodeMap does not inherit from NodeList; NamedNodeMaps are not maintained in any particular order. Objects contained in an object implementing NamedNodeMap may also be accessed by an ordinal index, but this is simply to allow convenient enumeration of the contents of a NamedNodeMap, and does not imply that the DOM specifies an order to these Nodes.
- * NamedNodeMap objects in the DOM are live.
- * used for attributes or DocumentType entities
- */
-function NamedNodeMap() {
-};
-
-function _findNodeIndex(list,node){
- var i = list.length;
- while(i--){
- if(list[i] === node){return i}
- }
-}
-
-function _addNamedNode(el,list,newAttr,oldAttr){
- if(oldAttr){
- list[_findNodeIndex(list,oldAttr)] = newAttr;
- }else{
- list[list.length++] = newAttr;
- }
- if(el){
- newAttr.ownerElement = el;
- var doc = el.ownerDocument;
- if(doc){
- oldAttr && _onRemoveAttribute(doc,el,oldAttr);
- _onAddAttribute(doc,el,newAttr);
- }
- }
-}
-function _removeNamedNode(el,list,attr){
- var i = _findNodeIndex(list,attr);
- if(i>=0){
- var lastIndex = list.length-1
- while(i0 || key == 'xmlns'){
-// return null;
-// }
- var i = this.length;
- while(i--){
- var attr = this[i];
- if(attr.nodeName == key){
- return attr;
- }
- }
- },
- setNamedItem: function(attr) {
- var el = attr.ownerElement;
- if(el && el!=this._ownerElement){
- throw new DOMException(INUSE_ATTRIBUTE_ERR);
- }
- var oldAttr = this.getNamedItem(attr.nodeName);
- _addNamedNode(this._ownerElement,this,attr,oldAttr);
- return oldAttr;
- },
- /* returns Node */
- setNamedItemNS: function(attr) {// raises: WRONG_DOCUMENT_ERR,NO_MODIFICATION_ALLOWED_ERR,INUSE_ATTRIBUTE_ERR
- var el = attr.ownerElement, oldAttr;
- if(el && el!=this._ownerElement){
- throw new DOMException(INUSE_ATTRIBUTE_ERR);
- }
- oldAttr = this.getNamedItemNS(attr.namespaceURI,attr.localName);
- _addNamedNode(this._ownerElement,this,attr,oldAttr);
- return oldAttr;
- },
-
- /* returns Node */
- removeNamedItem: function(key) {
- var attr = this.getNamedItem(key);
- _removeNamedNode(this._ownerElement,this,attr);
- return attr;
-
-
- },// raises: NOT_FOUND_ERR,NO_MODIFICATION_ALLOWED_ERR
-
- //for level2
- removeNamedItemNS:function(namespaceURI,localName){
- var attr = this.getNamedItemNS(namespaceURI,localName);
- _removeNamedNode(this._ownerElement,this,attr);
- return attr;
- },
- getNamedItemNS: function(namespaceURI, localName) {
- var i = this.length;
- while(i--){
- var node = this[i];
- if(node.localName == localName && node.namespaceURI == namespaceURI){
- return node;
- }
- }
- return null;
- }
-};
-/**
- * @see http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-102161490
- */
-function DOMImplementation(/* Object */ features) {
- this._features = {};
- if (features) {
- for (var feature in features) {
- this._features = features[feature];
- }
- }
-};
-
-DOMImplementation.prototype = {
- hasFeature: function(/* string */ feature, /* string */ version) {
- var versions = this._features[feature.toLowerCase()];
- if (versions && (!version || version in versions)) {
- return true;
- } else {
- return false;
- }
- },
- // Introduced in DOM Level 2:
- createDocument:function(namespaceURI, qualifiedName, doctype){// raises:INVALID_CHARACTER_ERR,NAMESPACE_ERR,WRONG_DOCUMENT_ERR
- var doc = new Document();
- doc.doctype = doctype;
- if(doctype){
- doc.appendChild(doctype);
- }
- doc.implementation = this;
- doc.childNodes = new NodeList();
- if(qualifiedName){
- var root = doc.createElementNS(namespaceURI,qualifiedName);
- doc.appendChild(root);
- }
- return doc;
- },
- // Introduced in DOM Level 2:
- createDocumentType:function(qualifiedName, publicId, systemId){// raises:INVALID_CHARACTER_ERR,NAMESPACE_ERR
- var node = new DocumentType();
- node.name = qualifiedName;
- node.nodeName = qualifiedName;
- node.publicId = publicId;
- node.systemId = systemId;
- // Introduced in DOM Level 2:
- //readonly attribute DOMString internalSubset;
-
- //TODO:..
- // readonly attribute NamedNodeMap entities;
- // readonly attribute NamedNodeMap notations;
- return node;
- }
-};
-
-
-/**
- * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-1950641247
- */
-
-function Node() {
-};
-
-Node.prototype = {
- firstChild : null,
- lastChild : null,
- previousSibling : null,
- nextSibling : null,
- attributes : null,
- parentNode : null,
- childNodes : null,
- ownerDocument : null,
- nodeValue : null,
- namespaceURI : null,
- prefix : null,
- localName : null,
- // Modified in DOM Level 2:
- insertBefore:function(newChild, refChild){//raises
- return _insertBefore(this,newChild,refChild);
- },
- replaceChild:function(newChild, oldChild){//raises
- this.insertBefore(newChild,oldChild);
- if(oldChild){
- this.removeChild(oldChild);
- }
- },
- removeChild:function(oldChild){
- return _removeChild(this,oldChild);
- },
- appendChild:function(newChild){
- return this.insertBefore(newChild,null);
- },
- hasChildNodes:function(){
- return this.firstChild != null;
- },
- cloneNode:function(deep){
- return cloneNode(this.ownerDocument||this,this,deep);
- },
- // Modified in DOM Level 2:
- normalize:function(){
- var child = this.firstChild;
- while(child){
- var next = child.nextSibling;
- if(next && next.nodeType == TEXT_NODE && child.nodeType == TEXT_NODE){
- this.removeChild(next);
- child.appendData(next.data);
- }else{
- child.normalize();
- child = next;
- }
- }
- },
- // Introduced in DOM Level 2:
- isSupported:function(feature, version){
- return this.ownerDocument.implementation.hasFeature(feature,version);
- },
- // Introduced in DOM Level 2:
- hasAttributes:function(){
- return this.attributes.length>0;
- },
- lookupPrefix:function(namespaceURI){
- var el = this;
- while(el){
- var map = el._nsMap;
- //console.dir(map)
- if(map){
- for(var n in map){
- if(map[n] == namespaceURI){
- return n;
- }
- }
- }
- el = el.nodeType == 2?el.ownerDocument : el.parentNode;
- }
- return null;
- },
- // Introduced in DOM Level 3:
- lookupNamespaceURI:function(prefix){
- var el = this;
- while(el){
- var map = el._nsMap;
- //console.dir(map)
- if(map){
- if(prefix in map){
- return map[prefix] ;
- }
- }
- el = el.nodeType == 2?el.ownerDocument : el.parentNode;
- }
- return null;
- },
- // Introduced in DOM Level 3:
- isDefaultNamespace:function(namespaceURI){
- var prefix = this.lookupPrefix(namespaceURI);
- return prefix == null;
- }
-};
-
-
-function _xmlEncoder(c){
- return c == '<' && '<' ||
- c == '>' && '>' ||
- c == '&' && '&' ||
- c == '"' && '"' ||
- ''+c.charCodeAt()+';'
-}
-
-
-copy(NodeType,Node);
-copy(NodeType,Node.prototype);
-
-/**
- * @param callback return true for continue,false for break
- * @return boolean true: break visit;
- */
-function _visitNode(node,callback){
- if(callback(node)){
- return true;
- }
- if(node = node.firstChild){
- do{
- if(_visitNode(node,callback)){return true}
- }while(node=node.nextSibling)
- }
-}
-
-
-
-function Document(){
-}
-function _onAddAttribute(doc,el,newAttr){
- doc && doc._inc++;
- var ns = newAttr.namespaceURI ;
- if(ns == 'http://www.w3.org/2000/xmlns/'){
- //update namespace
- el._nsMap[newAttr.prefix?newAttr.localName:''] = newAttr.value
- }
-}
-function _onRemoveAttribute(doc,el,newAttr,remove){
- doc && doc._inc++;
- var ns = newAttr.namespaceURI ;
- if(ns == 'http://www.w3.org/2000/xmlns/'){
- //update namespace
- delete el._nsMap[newAttr.prefix?newAttr.localName:'']
- }
-}
-function _onUpdateChild(doc,el,newChild){
- if(doc && doc._inc){
- doc._inc++;
- //update childNodes
- var cs = el.childNodes;
- if(newChild){
- cs[cs.length++] = newChild;
- }else{
- //console.log(1)
- var child = el.firstChild;
- var i = 0;
- while(child){
- cs[i++] = child;
- child =child.nextSibling;
- }
- cs.length = i;
- }
- }
-}
-
-/**
- * attributes;
- * children;
- *
- * writeable properties:
- * nodeValue,Attr:value,CharacterData:data
- * prefix
- */
-function _removeChild(parentNode,child){
- var previous = child.previousSibling;
- var next = child.nextSibling;
- if(previous){
- previous.nextSibling = next;
- }else{
- parentNode.firstChild = next
- }
- if(next){
- next.previousSibling = previous;
- }else{
- parentNode.lastChild = previous;
- }
- _onUpdateChild(parentNode.ownerDocument,parentNode);
- return child;
-}
-/**
- * preformance key(refChild == null)
- */
-function _insertBefore(parentNode,newChild,nextChild){
- var cp = newChild.parentNode;
- if(cp){
- cp.removeChild(newChild);//remove and update
- }
- if(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){
- var newFirst = newChild.firstChild;
- if (newFirst == null) {
- return newChild;
- }
- var newLast = newChild.lastChild;
- }else{
- newFirst = newLast = newChild;
- }
- var pre = nextChild ? nextChild.previousSibling : parentNode.lastChild;
-
- newFirst.previousSibling = pre;
- newLast.nextSibling = nextChild;
-
-
- if(pre){
- pre.nextSibling = newFirst;
- }else{
- parentNode.firstChild = newFirst;
- }
- if(nextChild == null){
- parentNode.lastChild = newLast;
- }else{
- nextChild.previousSibling = newLast;
- }
- do{
- newFirst.parentNode = parentNode;
- }while(newFirst !== newLast && (newFirst= newFirst.nextSibling))
- _onUpdateChild(parentNode.ownerDocument||parentNode,parentNode);
- //console.log(parentNode.lastChild.nextSibling == null)
- if (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {
- newChild.firstChild = newChild.lastChild = null;
- }
- return newChild;
-}
-function _appendSingleChild(parentNode,newChild){
- var cp = newChild.parentNode;
- if(cp){
- var pre = parentNode.lastChild;
- cp.removeChild(newChild);//remove and update
- var pre = parentNode.lastChild;
- }
- var pre = parentNode.lastChild;
- newChild.parentNode = parentNode;
- newChild.previousSibling = pre;
- newChild.nextSibling = null;
- if(pre){
- pre.nextSibling = newChild;
- }else{
- parentNode.firstChild = newChild;
- }
- parentNode.lastChild = newChild;
- _onUpdateChild(parentNode.ownerDocument,parentNode,newChild);
- return newChild;
- //console.log("__aa",parentNode.lastChild.nextSibling == null)
-}
-Document.prototype = {
- //implementation : null,
- nodeName : '#document',
- nodeType : DOCUMENT_NODE,
- doctype : null,
- documentElement : null,
- _inc : 1,
-
- insertBefore : function(newChild, refChild){//raises
- if(newChild.nodeType == DOCUMENT_FRAGMENT_NODE){
- var child = newChild.firstChild;
- while(child){
- var next = child.nextSibling;
- this.insertBefore(child,refChild);
- child = next;
- }
- return newChild;
- }
- if(this.documentElement == null && newChild.nodeType == 1){
- this.documentElement = newChild;
- }
-
- return _insertBefore(this,newChild,refChild),(newChild.ownerDocument = this),newChild;
- },
- removeChild : function(oldChild){
- if(this.documentElement == oldChild){
- this.documentElement = null;
- }
- return _removeChild(this,oldChild);
- },
- // Introduced in DOM Level 2:
- importNode : function(importedNode,deep){
- return importNode(this,importedNode,deep);
- },
- // Introduced in DOM Level 2:
- getElementById : function(id){
- var rtv = null;
- _visitNode(this.documentElement,function(node){
- if(node.nodeType == 1){
- if(node.getAttribute('id') == id){
- rtv = node;
- return true;
- }
- }
- })
- return rtv;
- },
-
- //document factory method:
- createElement : function(tagName){
- var node = new Element();
- node.ownerDocument = this;
- node.nodeName = tagName;
- node.tagName = tagName;
- node.childNodes = new NodeList();
- var attrs = node.attributes = new NamedNodeMap();
- attrs._ownerElement = node;
- return node;
- },
- createDocumentFragment : function(){
- var node = new DocumentFragment();
- node.ownerDocument = this;
- node.childNodes = new NodeList();
- return node;
- },
- createTextNode : function(data){
- var node = new Text();
- node.ownerDocument = this;
- node.appendData(data)
- return node;
- },
- createComment : function(data){
- var node = new Comment();
- node.ownerDocument = this;
- node.appendData(data)
- return node;
- },
- createCDATASection : function(data){
- var node = new CDATASection();
- node.ownerDocument = this;
- node.appendData(data)
- return node;
- },
- createProcessingInstruction : function(target,data){
- var node = new ProcessingInstruction();
- node.ownerDocument = this;
- node.tagName = node.target = target;
- node.nodeValue= node.data = data;
- return node;
- },
- createAttribute : function(name){
- var node = new Attr();
- node.ownerDocument = this;
- node.name = name;
- node.nodeName = name;
- node.localName = name;
- node.specified = true;
- return node;
- },
- createEntityReference : function(name){
- var node = new EntityReference();
- node.ownerDocument = this;
- node.nodeName = name;
- return node;
- },
- // Introduced in DOM Level 2:
- createElementNS : function(namespaceURI,qualifiedName){
- var node = new Element();
- var pl = qualifiedName.split(':');
- var attrs = node.attributes = new NamedNodeMap();
- node.childNodes = new NodeList();
- node.ownerDocument = this;
- node.nodeName = qualifiedName;
- node.tagName = qualifiedName;
- node.namespaceURI = namespaceURI;
- if(pl.length == 2){
- node.prefix = pl[0];
- node.localName = pl[1];
- }else{
- //el.prefix = null;
- node.localName = qualifiedName;
- }
- attrs._ownerElement = node;
- return node;
- },
- // Introduced in DOM Level 2:
- createAttributeNS : function(namespaceURI,qualifiedName){
- var node = new Attr();
- var pl = qualifiedName.split(':');
- node.ownerDocument = this;
- node.nodeName = qualifiedName;
- node.name = qualifiedName;
- node.namespaceURI = namespaceURI;
- node.specified = true;
- if(pl.length == 2){
- node.prefix = pl[0];
- node.localName = pl[1];
- }else{
- //el.prefix = null;
- node.localName = qualifiedName;
- }
- return node;
- }
-};
-_extends(Document,Node);
-
-
-function Element() {
- this._nsMap = {};
-};
-Element.prototype = {
- nodeType : ELEMENT_NODE,
- hasAttribute : function(name){
- return this.getAttributeNode(name)!=null;
- },
- getAttribute : function(name){
- var attr = this.getAttributeNode(name);
- return attr && attr.value || '';
- },
- getAttributeNode : function(name){
- return this.attributes.getNamedItem(name);
- },
- setAttribute : function(name, value){
- var attr = this.ownerDocument.createAttribute(name);
- attr.value = attr.nodeValue = "" + value;
- this.setAttributeNode(attr)
- },
- removeAttribute : function(name){
- var attr = this.getAttributeNode(name)
- attr && this.removeAttributeNode(attr);
- },
-
- //four real opeartion method
- appendChild:function(newChild){
- if(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){
- return this.insertBefore(newChild,null);
- }else{
- return _appendSingleChild(this,newChild);
- }
- },
- setAttributeNode : function(newAttr){
- return this.attributes.setNamedItem(newAttr);
- },
- setAttributeNodeNS : function(newAttr){
- return this.attributes.setNamedItemNS(newAttr);
- },
- removeAttributeNode : function(oldAttr){
- return this.attributes.removeNamedItem(oldAttr.nodeName);
- },
- //get real attribute name,and remove it by removeAttributeNode
- removeAttributeNS : function(namespaceURI, localName){
- var old = this.getAttributeNodeNS(namespaceURI, localName);
- old && this.removeAttributeNode(old);
- },
-
- hasAttributeNS : function(namespaceURI, localName){
- return this.getAttributeNodeNS(namespaceURI, localName)!=null;
- },
- getAttributeNS : function(namespaceURI, localName){
- var attr = this.getAttributeNodeNS(namespaceURI, localName);
- return attr && attr.value || '';
- },
- setAttributeNS : function(namespaceURI, qualifiedName, value){
- var attr = this.ownerDocument.createAttributeNS(namespaceURI, qualifiedName);
- attr.value = attr.nodeValue = value;
- this.setAttributeNode(attr)
- },
- getAttributeNodeNS : function(namespaceURI, localName){
- return this.attributes.getNamedItemNS(namespaceURI, localName);
- },
-
- getElementsByTagName : function(tagName){
- return new LiveNodeList(this,function(base){
- var ls = [];
- _visitNode(base,function(node){
- if(node !== base && node.nodeType == ELEMENT_NODE && (tagName === '*' || node.tagName == tagName)){
- ls.push(node);
- }
- });
- return ls;
- });
- },
- getElementsByTagNameNS : function(namespaceURI, localName){
- return new LiveNodeList(this,function(base){
- var ls = [];
- _visitNode(base,function(node){
- if(node !== base && node.nodeType === ELEMENT_NODE && node.namespaceURI === namespaceURI && (localName === '*' || node.localName == localName)){
- ls.push(node);
- }
- });
- return ls;
- });
- }
-};
-Document.prototype.getElementsByTagName = Element.prototype.getElementsByTagName;
-Document.prototype.getElementsByTagNameNS = Element.prototype.getElementsByTagNameNS;
-
-
-_extends(Element,Node);
-function Attr() {
-};
-Attr.prototype.nodeType = ATTRIBUTE_NODE;
-_extends(Attr,Node);
-
-
-function CharacterData() {
-};
-CharacterData.prototype = {
- data : '',
- substringData : function(offset, count) {
- return this.data.substring(offset, offset+count);
- },
- appendData: function(text) {
- text = this.data+text;
- this.nodeValue = this.data = text;
- this.length = text.length;
- },
- insertData: function(offset,text) {
- this.replaceData(offset,0,text);
-
- },
- appendChild:function(newChild){
- //if(!(newChild instanceof CharacterData)){
- throw new Error(ExceptionMessage[3])
- //}
- return Node.prototype.appendChild.apply(this,arguments)
- },
- deleteData: function(offset, count) {
- this.replaceData(offset,count,"");
- },
- replaceData: function(offset, count, text) {
- var start = this.data.substring(0,offset);
- var end = this.data.substring(offset+count);
- text = start + text + end;
- this.nodeValue = this.data = text;
- this.length = text.length;
- }
-}
-_extends(CharacterData,Node);
-function Text() {
-};
-Text.prototype = {
- nodeName : "#text",
- nodeType : TEXT_NODE,
- splitText : function(offset) {
- var text = this.data;
- var newText = text.substring(offset);
- text = text.substring(0, offset);
- this.data = this.nodeValue = text;
- this.length = text.length;
- var newNode = this.ownerDocument.createTextNode(newText);
- if(this.parentNode){
- this.parentNode.insertBefore(newNode, this.nextSibling);
- }
- return newNode;
- }
-}
-_extends(Text,CharacterData);
-function Comment() {
-};
-Comment.prototype = {
- nodeName : "#comment",
- nodeType : COMMENT_NODE
-}
-_extends(Comment,CharacterData);
-
-function CDATASection() {
-};
-CDATASection.prototype = {
- nodeName : "#cdata-section",
- nodeType : CDATA_SECTION_NODE
-}
-_extends(CDATASection,CharacterData);
-
-
-function DocumentType() {
-};
-DocumentType.prototype.nodeType = DOCUMENT_TYPE_NODE;
-_extends(DocumentType,Node);
-
-function Notation() {
-};
-Notation.prototype.nodeType = NOTATION_NODE;
-_extends(Notation,Node);
-
-function Entity() {
-};
-Entity.prototype.nodeType = ENTITY_NODE;
-_extends(Entity,Node);
-
-function EntityReference() {
-};
-EntityReference.prototype.nodeType = ENTITY_REFERENCE_NODE;
-_extends(EntityReference,Node);
-
-function DocumentFragment() {
-};
-DocumentFragment.prototype.nodeName = "#document-fragment";
-DocumentFragment.prototype.nodeType = DOCUMENT_FRAGMENT_NODE;
-_extends(DocumentFragment,Node);
-
-
-function ProcessingInstruction() {
-}
-ProcessingInstruction.prototype.nodeType = PROCESSING_INSTRUCTION_NODE;
-_extends(ProcessingInstruction,Node);
-function XMLSerializer(){}
-XMLSerializer.prototype.serializeToString = function(node){
- var buf = [];
- serializeToString(node,buf);
- return buf.join('');
-}
-Node.prototype.toString =function(){
- return XMLSerializer.prototype.serializeToString(this);
-}
-function serializeToString(node,buf){
- switch(node.nodeType){
- case ELEMENT_NODE:
- var attrs = node.attributes;
- var len = attrs.length;
- var child = node.firstChild;
- var nodeName = node.tagName;
- var isHTML = htmlns === node.namespaceURI
- buf.push('<',nodeName);
- for(var i=0;i');
- //if is cdata child node
- if(isHTML && /^script$/i.test(nodeName)){
- if(child){
- buf.push(child.data);
- }
- }else{
- while(child){
- serializeToString(child,buf);
- child = child.nextSibling;
- }
- }
- buf.push('',nodeName,'>');
- }else{
- buf.push('/>');
- }
- return;
- case DOCUMENT_NODE:
- case DOCUMENT_FRAGMENT_NODE:
- var child = node.firstChild;
- while(child){
- serializeToString(child,buf);
- child = child.nextSibling;
- }
- return;
- case ATTRIBUTE_NODE:
- return buf.push(' ',node.name,'="',node.value.replace(/[<&"]/g,_xmlEncoder),'"');
- case TEXT_NODE:
- return buf.push(node.data.replace(/[<&]/g,_xmlEncoder));
- case CDATA_SECTION_NODE:
- return buf.push( '');
- case COMMENT_NODE:
- return buf.push( "");
- case DOCUMENT_TYPE_NODE:
- var pubid = node.publicId;
- var sysid = node.systemId;
- buf.push('');
- }else if(sysid && sysid!='.'){
- buf.push(' SYSTEM "',sysid,'">');
- }else{
- var sub = node.internalSubset;
- if(sub){
- buf.push(" [",sub,"]");
- }
- buf.push(">");
- }
- return;
- case PROCESSING_INSTRUCTION_NODE:
- return buf.push( "",node.target," ",node.data,"?>");
- case ENTITY_REFERENCE_NODE:
- return buf.push( '&',node.nodeName,';');
- //case ENTITY_NODE:
- //case NOTATION_NODE:
- default:
- buf.push('??',node.nodeName);
- }
-}
-function importNode(doc,node,deep){
- var node2;
- switch (node.nodeType) {
- case ELEMENT_NODE:
- node2 = node.cloneNode(false);
- node2.ownerDocument = doc;
- //var attrs = node2.attributes;
- //var len = attrs.length;
- //for(var i=0;i
-
-function XMLReader(){
-
-}
-
-XMLReader.prototype = {
- parse:function(source,defaultNSMap,entityMap){
- var domBuilder = this.domBuilder;
- domBuilder.startDocument();
- _copy(defaultNSMap ,defaultNSMap = {})
- parse(source,defaultNSMap,entityMap,
- domBuilder,this.errorHandler);
- domBuilder.endDocument();
- }
-}
-function parse(source,defaultNSMapCopy,entityMap,domBuilder,errorHandler){
- function fixedFromCharCode(code) {
- // String.prototype.fromCharCode does not supports
- // > 2 bytes unicode chars directly
- if (code > 0xffff) {
- code -= 0x10000;
- var surrogate1 = 0xd800 + (code >> 10)
- , surrogate2 = 0xdc00 + (code & 0x3ff);
-
- return String.fromCharCode(surrogate1, surrogate2);
- } else {
- return String.fromCharCode(code);
- }
- }
- function entityReplacer(a){
- var k = a.slice(1,-1);
- if(k in entityMap){
- return entityMap[k];
- }else if(k.charAt(0) === '#'){
- return fixedFromCharCode(parseInt(k.substr(1).replace('x','0x')))
- }else{
- errorHandler.error('entity not found:'+a);
- return a;
- }
- }
- function appendText(end){//has some bugs
- var xt = source.substring(start,end).replace(/?\w+;/g,entityReplacer);
- locator&&position(start);
- domBuilder.characters(xt,0,end-start);
- start = end
- }
- function position(start,m){
- while(start>=endPos && (m = linePattern.exec(source))){
- startPos = m.index;
- endPos = startPos + m[0].length;
- locator.lineNumber++;
- //console.log('line++:',locator,startPos,endPos)
- }
- locator.columnNumber = start-startPos+1;
- }
- var startPos = 0;
- var endPos = 0;
- var linePattern = /.+(?:\r\n?|\n)|.*$/g
- var locator = domBuilder.locator;
-
- var parseStack = [{currentNSMap:defaultNSMapCopy}]
- var closeMap = {};
- var start = 0;
- while(true){
- var i = source.indexOf('<',start);
- if(i<0){
- if(!source.substr(start).match(/^\s*$/)){
- var doc = domBuilder.document;
- var text = doc.createTextNode(source.substr(start));
- doc.appendChild(text);
- domBuilder.currentElement = text;
- }
- return;
- }
- if(i>start){
- appendText(i);
- }
- switch(source.charAt(i+1)){
- case '/':
- var end = source.indexOf('>',i+3);
- var tagName = source.substring(i+2,end);
- var config = parseStack.pop();
- var localNSMap = config.localNSMap;
-
- if(config.tagName != tagName){
- errorHandler.fatalError("end tag name: "+tagName+' is not match the current start tagName:'+config.tagName );
- }
- domBuilder.endElement(config.uri,config.localName,tagName);
- if(localNSMap){
- for(var prefix in localNSMap){
- domBuilder.endPrefixMapping(prefix) ;
- }
- }
- end++;
- break;
- // end elment
- case '?':// ...?>
- locator&&position(i);
- end = parseInstruction(source,i,domBuilder);
- break;
- case '!':// 0){
- value = source.slice(start,p).replace(/?\w+;/g,entityReplacer);
- el.add(attrName,value,start-1);
- s = S_E;
- }else{
- //fatalError: no end quot match
- throw new Error('attribute value no end \''+c+'\' match');
- }
- }else if(s == S_V){
- value = source.slice(start,p).replace(/?\w+;/g,entityReplacer);
- //console.log(attrName,value,start,p)
- el.add(attrName,value,start);
- //console.dir(el)
- errorHandler.warning('attribute "'+attrName+'" missed start quot('+c+')!!');
- start = p+1;
- s = S_E
- }else{
- //fatalError: no equal before
- throw new Error('attribute value must after "="');
- }
- break;
- case '/':
- switch(s){
- case S_TAG:
- el.setTagName(source.slice(start,p));
- case S_E:
- case S_S:
- case S_C:
- s = S_C;
- el.closed = true;
- case S_V:
- case S_ATTR:
- case S_ATTR_S:
- break;
- //case S_EQ:
- default:
- throw new Error("attribute invalid close char('/')")
- }
- break;
- case ''://end document
- //throw new Error('unexpected end of input')
- errorHandler.error('unexpected end of input');
- case '>':
- switch(s){
- case S_TAG:
- el.setTagName(source.slice(start,p));
- case S_E:
- case S_S:
- case S_C:
- break;//normal
- case S_V://Compatible state
- case S_ATTR:
- value = source.slice(start,p);
- if(value.slice(-1) === '/'){
- el.closed = true;
- value = value.slice(0,-1)
- }
- case S_ATTR_S:
- if(s === S_ATTR_S){
- value = attrName;
- }
- if(s == S_V){
- errorHandler.warning('attribute "'+value+'" missed quot(")!!');
- el.add(attrName,value.replace(/?\w+;/g,entityReplacer),start)
- }else{
- errorHandler.warning('attribute "'+value+'" missed value!! "'+value+'" instead!!')
- el.add(value,value,start)
- }
- break;
- case S_EQ:
- throw new Error('attribute value missed!!');
- }
-// console.log(tagName,tagNamePattern,tagNamePattern.test(tagName))
- return p;
- /*xml space '\x20' | #x9 | #xD | #xA; */
- case '\u0080':
- c = ' ';
- default:
- if(c<= ' '){//space
- switch(s){
- case S_TAG:
- el.setTagName(source.slice(start,p));//tagName
- s = S_S;
- break;
- case S_ATTR:
- attrName = source.slice(start,p)
- s = S_ATTR_S;
- break;
- case S_V:
- var value = source.slice(start,p).replace(/?\w+;/g,entityReplacer);
- errorHandler.warning('attribute "'+value+'" missed quot(")!!');
- el.add(attrName,value,start)
- case S_E:
- s = S_S;
- break;
- //case S_S:
- //case S_EQ:
- //case S_ATTR_S:
- // void();break;
- //case S_C:
- //ignore warning
- }
- }else{//not space
-//S_TAG, S_ATTR, S_EQ, S_V
-//S_ATTR_S, S_E, S_S, S_C
- switch(s){
- //case S_TAG:void();break;
- //case S_ATTR:void();break;
- //case S_V:void();break;
- case S_ATTR_S:
- errorHandler.warning('attribute "'+attrName+'" missed value!! "'+attrName+'" instead!!')
- el.add(attrName,attrName,start);
- start = p;
- s = S_ATTR;
- break;
- case S_E:
- errorHandler.warning('attribute space is required"'+attrName+'"!!')
- case S_S:
- s = S_ATTR;
- start = p;
- break;
- case S_EQ:
- s = S_V;
- start = p;
- break;
- case S_C:
- throw new Error("elements closed character '/' and '>' must be connected to");
- }
- }
- }
- p++;
- }
-}
-/**
- * @return end of the elementStartPart(end of elementEndPart for selfClosed el)
- */
-function appendElement(el,domBuilder,parseStack){
- var tagName = el.tagName;
- var localNSMap = null;
- var currentNSMap = parseStack[parseStack.length-1].currentNSMap;
- var i = el.length;
- while(i--){
- var a = el[i];
- var qName = a.qName;
- var value = a.value;
- var nsp = qName.indexOf(':');
- if(nsp>0){
- var prefix = a.prefix = qName.slice(0,nsp);
- var localName = qName.slice(nsp+1);
- var nsPrefix = prefix === 'xmlns' && localName
- }else{
- localName = qName;
- prefix = null
- nsPrefix = qName === 'xmlns' && ''
- }
- //can not set prefix,because prefix !== ''
- a.localName = localName ;
- //prefix == null for no ns prefix attribute
- if(nsPrefix !== false){//hack!!
- if(localNSMap == null){
- localNSMap = {}
- //console.log(currentNSMap,0)
- _copy(currentNSMap,currentNSMap={})
- //console.log(currentNSMap,1)
- }
- currentNSMap[nsPrefix] = localNSMap[nsPrefix] = value;
- a.uri = 'http://www.w3.org/2000/xmlns/'
- domBuilder.startPrefixMapping(nsPrefix, value)
- }
- }
- var i = el.length;
- while(i--){
- a = el[i];
- var prefix = a.prefix;
- if(prefix){//no prefix attribute has no namespace
- if(prefix === 'xml'){
- a.uri = 'http://www.w3.org/XML/1998/namespace';
- }if(prefix !== 'xmlns'){
- a.uri = currentNSMap[prefix]
-
- //{console.log('###'+a.qName,domBuilder.locator.systemId+'',currentNSMap,a.uri)}
- }
- }
- }
- var nsp = tagName.indexOf(':');
- if(nsp>0){
- prefix = el.prefix = tagName.slice(0,nsp);
- localName = el.localName = tagName.slice(nsp+1);
- }else{
- prefix = null;//important!!
- localName = el.localName = tagName;
- }
- //no prefix element has default namespace
- var ns = el.uri = currentNSMap[prefix || ''];
- domBuilder.startElement(ns,localName,tagName,el);
- //endPrefixMapping and startPrefixMapping have not any help for dom builder
- //localNSMap = null
- if(el.closed){
- domBuilder.endElement(ns,localName,tagName);
- if(localNSMap){
- for(prefix in localNSMap){
- domBuilder.endPrefixMapping(prefix)
- }
- }
- }else{
- el.currentNSMap = currentNSMap;
- el.localNSMap = localNSMap;
- parseStack.push(el);
- }
-}
-function parseHtmlSpecialContent(source,elStartEnd,tagName,entityReplacer,domBuilder){
- if(/^(?:script|textarea)$/i.test(tagName)){
- var elEndStart = source.indexOf(''+tagName+'>',elStartEnd);
- var text = source.substring(elStartEnd+1,elEndStart);
- if(/[&<]/.test(text)){
- if(/^script$/i.test(tagName)){
- //if(!/\]\]>/.test(text)){
- //lexHandler.startCDATA();
- domBuilder.characters(text,0,text.length);
- //lexHandler.endCDATA();
- return elEndStart;
- //}
- }//}else{//text area
- text = text.replace(/?\w+;/g,entityReplacer);
- domBuilder.characters(text,0,text.length);
- return elEndStart;
- //}
-
- }
- }
- return elStartEnd+1;
-}
-function fixSelfClosed(source,elStartEnd,tagName,closeMap){
- //if(tagName in closeMap){
- var pos = closeMap[tagName];
- if(pos == null){
- //console.log(tagName)
- pos = closeMap[tagName] = source.lastIndexOf(''+tagName+'>')
- }
- return pos',start+4);
- //append comment source.substring(4,end)//,
- * and raw CDATA nodes.
- *
- * @param {Element} node
- * @returns {Boolean}
- * @api private
- */
-
-function shouldIgnoreNode (node) {
- return node.nodeType === 3 // text
- || node.nodeType === 8 // comment
- || node.nodeType === 4; // cdata
-}
-
-
-/**
- * Parses a Plist XML string. Returns an Object.
- *
- * @param {String} xml - the XML String to decode
- * @returns {Mixed} the decoded value from the Plist XML
- * @api public
- */
-
-function parse (xml) {
- var doc = new DOMParser().parseFromString(xml);
- if (doc.documentElement.nodeName !== 'plist') {
- throw new Error('malformed document. First element should be ');
- }
- var plist = parsePlistXML(doc.documentElement);
-
- // the root node gets interpreted as an Array,
- // so pull out the inner data first
- if (plist.length == 1) plist = plist[0];
-
- return plist;
-}
-
-/**
- * Parses a Plist XML string. Returns an Object. Takes a `callback` function.
- *
- * @param {String} xml - the XML String to decode
- * @param {Function} callback - callback function
- * @returns {Mixed} the decoded value from the Plist XML
- * @api public
- * @deprecated not actually async. use parse() instead
- */
-
-function parseString (xml, callback) {
- var doc, error, plist;
- try {
- doc = new DOMParser().parseFromString(xml);
- plist = parsePlistXML(doc.documentElement);
- } catch(e) {
- error = e;
- }
- callback(error, plist);
-}
-
-/**
- * Parses a Plist XML string. Returns an Object.
- *
- * @param {String} xml - the XML String to decode
- * @param {Function} callback - callback function
- * @returns {Mixed} the decoded value from the Plist XML
- * @api public
- * @deprecated use parse() instead
- */
-
-function parseStringSync (xml) {
- var doc = new DOMParser().parseFromString(xml);
- var plist;
- if (doc.documentElement.nodeName !== 'plist') {
- throw new Error('malformed document. First element should be ');
- }
- plist = parsePlistXML(doc.documentElement);
-
- // if the plist is an array with 1 element, pull it out of the array
- if (plist.length == 1) {
- plist = plist[0];
- }
- return plist;
-}
-
-/**
- * Convert an XML based plist document into a JSON representation.
- *
- * @param {Object} xml_node - current XML node in the plist
- * @returns {Mixed} built up JSON object
- * @api private
- */
-
-function parsePlistXML (node) {
- var i, new_obj, key, val, new_arr, res, d;
-
- if (!node)
- return null;
-
- if (node.nodeName === 'plist') {
- new_arr = [];
- for (i=0; i < node.childNodes.length; i++) {
- // ignore comment nodes (text)
- if (!shouldIgnoreNode(node.childNodes[i])) {
- new_arr.push( parsePlistXML(node.childNodes[i]));
- }
- }
- return new_arr;
-
- } else if (node.nodeName === 'dict') {
- new_obj = {};
- key = null;
- for (i=0; i < node.childNodes.length; i++) {
- // ignore comment nodes (text)
- if (!shouldIgnoreNode(node.childNodes[i])) {
- if (key === null) {
- key = parsePlistXML(node.childNodes[i]);
- } else {
- new_obj[key] = parsePlistXML(node.childNodes[i]);
- key = null;
- }
- }
- }
- return new_obj;
-
- } else if (node.nodeName === 'array') {
- new_arr = [];
- for (i=0; i < node.childNodes.length; i++) {
- // ignore comment nodes (text)
- if (!shouldIgnoreNode(node.childNodes[i])) {
- res = parsePlistXML(node.childNodes[i]);
- if (null != res) new_arr.push(res);
- }
- }
- return new_arr;
-
- } else if (node.nodeName === '#text') {
- // TODO: what should we do with text types? (CDATA sections)
-
- } else if (node.nodeName === 'key') {
- return node.childNodes[0].nodeValue;
-
- } else if (node.nodeName === 'string') {
- res = '';
- for (d=0; d < node.childNodes.length; d++) {
- res += node.childNodes[d].nodeValue;
- }
- return res;
-
- } else if (node.nodeName === 'integer') {
- // parse as base 10 integer
- return parseInt(node.childNodes[0].nodeValue, 10);
-
- } else if (node.nodeName === 'real') {
- res = '';
- for (d=0; d < node.childNodes.length; d++) {
- if (node.childNodes[d].nodeType === 3) {
- res += node.childNodes[d].nodeValue;
- }
- }
- return parseFloat(res);
-
- } else if (node.nodeName === 'data') {
- res = '';
- for (d=0; d < node.childNodes.length; d++) {
- if (node.childNodes[d].nodeType === 3) {
- res += node.childNodes[d].nodeValue.replace(/\s+/g, '');
- }
- }
-
- // decode base64 data to a Buffer instance
- return new Buffer(res, 'base64');
-
- } else if (node.nodeName === 'date') {
- return new Date(node.childNodes[0].nodeValue);
-
- } else if (node.nodeName === 'true') {
- return true;
-
- } else if (node.nodeName === 'false') {
- return false;
- }
-}
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/plist/lib/plist.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/plist/lib/plist.js
deleted file mode 100644
index 00a4167..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/plist/lib/plist.js
+++ /dev/null
@@ -1,23 +0,0 @@
-
-var i;
-
-/**
- * Parser functions.
- */
-
-var parserFunctions = require('./parse');
-for (i in parserFunctions) exports[i] = parserFunctions[i];
-
-/**
- * Builder functions.
- */
-
-var builderFunctions = require('./build');
-for (i in builderFunctions) exports[i] = builderFunctions[i];
-
-/**
- * Add Node.js-specific functions (they're deprecated…).
- */
-
-var nodeFunctions = require('./node');
-for (i in nodeFunctions) exports[i] = nodeFunctions[i];
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/plist/package.json b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/plist/package.json
deleted file mode 100644
index 9dd0f04..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/plist/package.json
+++ /dev/null
@@ -1,126 +0,0 @@
-{
- "_args": [
- [
- {
- "raw": "plist@^1.2.0",
- "scope": null,
- "escapedName": "plist",
- "name": "plist",
- "rawSpec": "^1.2.0",
- "spec": ">=1.2.0 <2.0.0",
- "type": "range"
- },
- "/Users/steveng/repo/cordova/cordova-android/node_modules/cordova-common"
- ]
- ],
- "_from": "plist@>=1.2.0 <2.0.0",
- "_id": "plist@1.2.0",
- "_inCache": true,
- "_installable": true,
- "_location": "/plist",
- "_nodeVersion": "5.0.0",
- "_npmUser": {
- "name": "mreinstein",
- "email": "reinstein.mike@gmail.com"
- },
- "_npmVersion": "3.3.11",
- "_phantomChildren": {},
- "_requested": {
- "raw": "plist@^1.2.0",
- "scope": null,
- "escapedName": "plist",
- "name": "plist",
- "rawSpec": "^1.2.0",
- "spec": ">=1.2.0 <2.0.0",
- "type": "range"
- },
- "_requiredBy": [
- "/cordova-common"
- ],
- "_resolved": "http://registry.npmjs.org/plist/-/plist-1.2.0.tgz",
- "_shasum": "084b5093ddc92506e259f874b8d9b1afb8c79593",
- "_shrinkwrap": null,
- "_spec": "plist@^1.2.0",
- "_where": "/Users/steveng/repo/cordova/cordova-android/node_modules/cordova-common",
- "author": {
- "name": "Nathan Rajlich",
- "email": "nathan@tootallnate.net"
- },
- "bugs": {
- "url": "https://github.com/TooTallNate/node-plist/issues"
- },
- "contributors": [
- {
- "name": "Hans Huebner",
- "email": "hans.huebner@gmail.com"
- },
- {
- "name": "Pierre Metrailler"
- },
- {
- "name": "Mike Reinstein",
- "email": "reinstein.mike@gmail.com"
- },
- {
- "name": "Vladimir Tsvang"
- },
- {
- "name": "Mathieu D'Amours"
- }
- ],
- "dependencies": {
- "base64-js": "0.0.8",
- "util-deprecate": "1.0.2",
- "xmlbuilder": "4.0.0",
- "xmldom": "0.1.x"
- },
- "description": "Mac OS X Plist parser/builder for Node.js and browsers",
- "devDependencies": {
- "browserify": "12.0.1",
- "mocha": "2.3.3",
- "multiline": "1.0.2",
- "zuul": "3.7.2"
- },
- "directories": {},
- "dist": {
- "shasum": "084b5093ddc92506e259f874b8d9b1afb8c79593",
- "tarball": "https://registry.npmjs.org/plist/-/plist-1.2.0.tgz"
- },
- "gitHead": "69520574f27864145192338b72e608fbe1bda6f7",
- "homepage": "https://github.com/TooTallNate/node-plist#readme",
- "keywords": [
- "apple",
- "browser",
- "mac",
- "plist",
- "parser",
- "xml"
- ],
- "license": "MIT",
- "main": "lib/plist.js",
- "maintainers": [
- {
- "name": "TooTallNate",
- "email": "nathan@tootallnate.net"
- },
- {
- "name": "tootallnate",
- "email": "nathan@tootallnate.net"
- },
- {
- "name": "mreinstein",
- "email": "reinstein.mike@gmail.com"
- }
- ],
- "name": "plist",
- "optionalDependencies": {},
- "readme": "ERROR: No README data found!",
- "repository": {
- "type": "git",
- "url": "git://github.com/TooTallNate/node-plist.git"
- },
- "scripts": {
- "test": "make test"
- },
- "version": "1.2.0"
-}
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/properties-parser/README.markdown b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/properties-parser/README.markdown
deleted file mode 100644
index 3a808ba..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/properties-parser/README.markdown
+++ /dev/null
@@ -1,48 +0,0 @@
-# node-properties-parser
-
-A parser for [.properties](http://en.wikipedia.org/wiki/.properties) files written in javascript. Properties files store key-value pairs. They are typically used for configuration and internationalization in Java applications as well as in Actionscript projects. Here's an example of the format:
-
- # You are reading the ".properties" entry.
- ! The exclamation mark can also mark text as comments.
- website = http://en.wikipedia.org/
- language = English
- # The backslash below tells the application to continue reading
- # the value onto the next line.
- message = Welcome to \
- Wikipedia!
- # Add spaces to the key
- key\ with\ spaces = This is the value that could be looked up with the key "key with spaces".
- # Unicode
- tab : \u0009
-*(taken from [Wikipedia](http://en.wikipedia.org/wiki/.properties#Format))*
-
-Currently works with any version of node.js.
-
-## The API
-
-- `parse(text)`: Parses `text` into key-value pairs. Returns an object containing the key-value pairs.
-- `read(path[, callback])`: Opens the file specified by `path` and calls `parse` on its content. If the optional `callback` parameter is provided, the result is then passed to it as the second parameter. If an error occurs, the error object is passed to `callback` as the first parameter. If `callback` is not provided, the file specified by `path` is synchronously read and calls `parse` on its contents. The resulting object is immediately returned.
-- `createEditor([path[, callback]])`: If neither `path` or `callback` are provided an empty editor object is returned synchronously. If only `path` is provided, the file specified by `path` is synchronously read and parsed. An editor object with the results in then immediately returned. If both `path` and `callback` are provided, the file specified by `path` is read and parsed asynchronously. An editor object with the results are then passed to `callback` as the second parameters. If an error occurs, the error object is passed to `callback` as the first parameter.
-- `Editor`: The editor object is returned by `createEditor`. Has the following API:
- - `get(key)`: Returns the value currently associated with `key`.
- - `set(key, [value[, comment]])`: Associates `key` with `value`. An optional comment can be provided. If `value` is not specified or is `null`, then `key` is unset.
- - `unset(key)`: Unsets the specified `key`.
- - `save([path][, callback]])`: Writes the current contents of this editor object to a file specified by `path`. If `path` is not provided, then it'll be defaulted to the `path` value passed to `createEditor`. The `callback` parameter is called when the file has been written to disk.
- - `addHeadComment`: Added a comment to the head of the file.
- - `toString`: Returns the string representation of this properties editor object. This string will be written to a file if `save` is called.
-
-## Getting node-properties-parser
-
-The easiest way to get node-properties-parser is with [npm](http://npmjs.org/):
-
- npm install properties-parser
-
-Alternatively you can clone this git repository:
-
- git://github.com/xavi-/node-properties-parser.git
-
-## Developed by
-* Xavi Ramirez
-
-## License
-This project is released under [The MIT License](http://www.opensource.org/licenses/mit-license.php).
\ No newline at end of file
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/properties-parser/index.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/properties-parser/index.js
deleted file mode 100644
index b103ad0..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/properties-parser/index.js
+++ /dev/null
@@ -1,354 +0,0 @@
-var fs = require("fs");
-
-function Iterator(text) {
- var pos = 0, length = text.length;
-
- this.peek = function(num) {
- num = num || 0;
- if(pos + num >= length) { return null; }
-
- return text.charAt(pos + num);
- };
- this.next = function(inc) {
- inc = inc || 1;
-
- if(pos >= length) { return null; }
-
- return text.charAt((pos += inc) - inc);
- };
- this.pos = function() {
- return pos;
- };
-}
-
-var rWhitespace = /\s/;
-function isWhitespace(chr) {
- return rWhitespace.test(chr);
-}
-function consumeWhiteSpace(iter) {
- var start = iter.pos();
-
- while(isWhitespace(iter.peek())) { iter.next(); }
-
- return { type: "whitespace", start: start, end: iter.pos() };
-}
-
-function startsComment(chr) {
- return chr === "!" || chr === "#";
-}
-function isEOL(chr) {
- return chr == null || chr === "\n" || chr === "\r";
-}
-function consumeComment(iter) {
- var start = iter.pos();
-
- while(!isEOL(iter.peek())) { iter.next(); }
-
- return { type: "comment", start: start, end: iter.pos() };
-}
-
-function startsKeyVal(chr) {
- return !isWhitespace(chr) && !startsComment(chr);
-}
-function startsSeparator(chr) {
- return chr === "=" || chr === ":" || isWhitespace(chr);
-}
-function startsEscapedVal(chr) {
- return chr === "\\";
-}
-function consumeEscapedVal(iter) {
- var start = iter.pos();
-
- iter.next(); // move past "\"
- var curChar = iter.next();
- if(curChar === "u") { // encoded unicode char
- iter.next(4); // Read in the 4 hex values
- }
-
- return { type: "escaped-value", start: start, end: iter.pos() };
-}
-function consumeKey(iter) {
- var start = iter.pos(), children = [];
-
- var curChar;
- while((curChar = iter.peek()) !== null) {
- if(startsSeparator(curChar)) { break; }
- if(startsEscapedVal(curChar)) { children.push(consumeEscapedVal(iter)); continue; }
-
- iter.next();
- }
-
- return { type: "key", start: start, end: iter.pos(), children: children };
-}
-function consumeKeyValSeparator(iter) {
- var start = iter.pos();
-
- var seenHardSep = false, curChar;
- while((curChar = iter.peek()) !== null) {
- if(isEOL(curChar)) { break; }
-
- if(isWhitespace(curChar)) { iter.next(); continue; }
-
- if(seenHardSep) { break; }
-
- seenHardSep = (curChar === ":" || curChar === "=");
- if(seenHardSep) { iter.next(); continue; }
-
- break; // curChar is a non-separtor char
- }
-
- return { type: "key-value-separator", start: start, end: iter.pos() };
-}
-function startsLineBreak(iter) {
- return iter.peek() === "\\" && isEOL(iter.peek(1));
-}
-function consumeLineBreak(iter) {
- var start = iter.pos();
-
- iter.next(); // consume \
- if(iter.peek() === "\r") { iter.next(); }
- iter.next(); // consume \n
-
- var curChar;
- while((curChar = iter.peek()) !== null) {
- if(isEOL(curChar)) { break; }
- if(!isWhitespace(curChar)) { break; }
-
- iter.next();
- }
-
- return { type: "line-break", start: start, end: iter.pos() };
-}
-function consumeVal(iter) {
- var start = iter.pos(), children = [];
-
- var curChar;
- while((curChar = iter.peek()) !== null) {
- if(startsLineBreak(iter)) { children.push(consumeLineBreak(iter)); continue; }
- if(startsEscapedVal(curChar)) { children.push(consumeEscapedVal(iter)); continue; }
- if(isEOL(curChar)) { break; }
-
- iter.next();
- }
-
- return { type: "value", start: start, end: iter.pos(), children: children };
-}
-function consumeKeyVal(iter) {
- return {
- type: "key-value",
- start: iter.pos(),
- children: [
- consumeKey(iter),
- consumeKeyValSeparator(iter),
- consumeVal(iter)
- ],
- end: iter.pos()
- };
-}
-
-var renderChild = {
- "escaped-value": function(child, text) {
- var type = text.charAt(child.start + 1);
-
- if(type === "t") { return "\t"; }
- if(type === "r") { return "\r"; }
- if(type === "n") { return "\n"; }
- if(type === "f") { return "\f"; }
- if(type !== "u") { return type; }
-
- return String.fromCharCode(parseInt(text.substr(child.start + 2, 4), 16));
- },
- "line-break": function (child, text) {
- return "";
- }
-};
-function rangeToBuffer(range, text) {
- var start = range.start, buffer = [];
-
- for(var i = 0; i < range.children.length; i++) {
- var child = range.children[i];
-
- buffer.push(text.substring(start, child.start));
- buffer.push(renderChild[child.type](child, text));
- start = child.end;
- }
- buffer.push(text.substring(start, range.end));
-
- return buffer;
-}
-function rangesToObject(ranges, text) {
- var obj = Object.create(null); // Creates to a true hash map
-
- for(var i = 0; i < ranges.length; i++) {
- var range = ranges[i];
-
- if(range.type !== "key-value") { continue; }
-
- var key = rangeToBuffer(range.children[0], text).join("");
- var val = rangeToBuffer(range.children[2], text).join("");
- obj[key] = val;
- }
-
- return obj;
-}
-
-function stringToRanges(text) {
- var iter = new Iterator(text), ranges = [];
-
- var curChar;
- while((curChar = iter.peek()) !== null) {
- if(isWhitespace(curChar)) { ranges.push(consumeWhiteSpace(iter)); continue; }
- if(startsComment(curChar)) { ranges.push(consumeComment(iter)); continue; }
- if(startsKeyVal(curChar)) { ranges.push(consumeKeyVal(iter)); continue; }
-
- throw Error("Something crazy happened. text: '" + text + "'; curChar: '" + curChar + "'");
- }
-
- return ranges;
-}
-
-function isNewLineRange(range) {
- if(!range) { return false; }
-
- if(range.type === "whitespace") { return true; }
-
- if(range.type === "literal") {
- return isWhitespace(range.text) && range.text.indexOf("\n") > -1;
- }
-
- return false;
-}
-
-function Editor(text, path) {
- text = text || "";
-
- var ranges = stringToRanges(text);
- var obj = rangesToObject(ranges, text);
- var keyRange = Object.create(null); // Creates to a true hash map
-
- for(var i = 0; i < ranges.length; i++) {
- var range = ranges[i];
-
- if(range.type !== "key-value") { continue; }
-
- var key = rangeToBuffer(range.children[0], text).join("");
- keyRange[key] = range;
- }
-
- this.addHeadComment = function(comment) {
- if(comment == null) { return; }
-
- ranges.unshift({ type: "literal", text: "# " + comment.replace(/\n/g, "\n# ") + "\n" });
- };
-
- this.get = function(key) { return obj[key]; };
- this.set = function(key, val, comment) {
- if(val == null) { this.unset(key); return; }
-
- obj[key] = val;
-
- var range = keyRange[key];
- if(!range) {
- keyRange[key] = range = { type: "literal", text: key + "=" + val };
-
- var prevRange = ranges[ranges.length - 1];
- if(prevRange != null && !isNewLineRange(prevRange)) {
- ranges.push({ type: "literal", text: "\n" });
- }
- ranges.push(range);
- }
-
- // comment === null deletes comment. if comment === undefined, it's left alone
- if(comment !== undefined) {
- range.comment = comment && "# " + comment.replace(/\n/g, "\n# ") + "\n";
- }
-
- if(range.type === "literal") {
- range.text = key + "=" + val;
- if(range.comment != null) { range.text = range.comment + range.text; }
- } else if(range.type === "key-value") {
- range.children[2] = { type: "literal", text: val };
- } else {
- throw "Unknown node type: " + range.type;
- }
- };
- this.unset = function(key) {
- if(!(key in obj)) { return; }
-
- var range = keyRange[key];
- var idx = ranges.indexOf(range);
-
- ranges.splice(idx, (isNewLineRange(ranges[idx + 1]) ? 2 : 1));
-
- delete keyRange[key];
- delete obj[key];
- };
- this.valueOf = this.toString = function() {
- var buffer = [], stack = [].concat(ranges);
-
- var node;
- while((node = stack.shift()) != null) {
- switch(node.type) {
- case "literal":
- buffer.push(node.text);
- break;
- case "key":
- case "value":
- case "comment":
- case "whitespace":
- case "key-value-separator":
- case "escaped-value":
- case "line-break":
- buffer.push(text.substring(node.start, node.end));
- break;
- case "key-value":
- Array.prototype.unshift.apply(stack, node.children);
- if(node.comment) { stack.unshift({ type: "literal", text: node.comment }); }
- break;
- }
- }
-
- return buffer.join("");
- };
- this.save = function(newPath, callback) {
- if(typeof newPath === 'function') {
- callback = newPath;
- newPath = path;
- }
- newPath = newPath || path;
-
- if(!newPath) { callback("Unknown path"); }
-
- fs.writeFile(newPath, this.toString(), callback || function() {});
- };
-}
-function createEditor(path, callback) {
- if(!path) { return new Editor(); }
-
- if(!callback) { return new Editor(fs.readFileSync(path).toString(), path); }
-
- return fs.readFile(path, function(err, text) {
- if(err) { return callback(err, null); }
-
- text = text.toString();
- return callback(null, new Editor(text, path));
- });
-}
-
-function parse(text) {
- text = text.toString();
- var ranges = stringToRanges(text);
- return rangesToObject(ranges, text);
-}
-
-function read(path, callback) {
- if(!callback) { return parse(fs.readFileSync(path)); }
-
- return fs.readFile(path, function(err, data) {
- if(err) { return callback(err, null); }
-
- return callback(null, parse(data));
- });
-}
-
-module.exports = { parse: parse, read: read, createEditor: createEditor };
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/properties-parser/package.json b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/properties-parser/package.json
deleted file mode 100644
index 9c3acab..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/properties-parser/package.json
+++ /dev/null
@@ -1,82 +0,0 @@
-{
- "_args": [
- [
- {
- "raw": "properties-parser@^0.2.3",
- "scope": null,
- "escapedName": "properties-parser",
- "name": "properties-parser",
- "rawSpec": "^0.2.3",
- "spec": ">=0.2.3 <0.3.0",
- "type": "range"
- },
- "/Users/steveng/repo/cordova/cordova-android"
- ]
- ],
- "_from": "properties-parser@>=0.2.3 <0.3.0",
- "_id": "properties-parser@0.2.3",
- "_inCache": true,
- "_installable": true,
- "_location": "/properties-parser",
- "_npmUser": {
- "name": "xavi",
- "email": "xavi.rmz@gmail.com"
- },
- "_npmVersion": "1.3.23",
- "_phantomChildren": {},
- "_requested": {
- "raw": "properties-parser@^0.2.3",
- "scope": null,
- "escapedName": "properties-parser",
- "name": "properties-parser",
- "rawSpec": "^0.2.3",
- "spec": ">=0.2.3 <0.3.0",
- "type": "range"
- },
- "_requiredBy": [
- "/"
- ],
- "_resolved": "http://registry.npmjs.org/properties-parser/-/properties-parser-0.2.3.tgz",
- "_shasum": "f7591255f707abbff227c7b56b637dbb0373a10f",
- "_shrinkwrap": null,
- "_spec": "properties-parser@^0.2.3",
- "_where": "/Users/steveng/repo/cordova/cordova-android",
- "bugs": {
- "url": "https://github.com/xavi-/node-properties-parser/issues"
- },
- "dependencies": {},
- "description": "A parser for .properties files written in javascript",
- "devDependencies": {},
- "directories": {},
- "dist": {
- "shasum": "f7591255f707abbff227c7b56b637dbb0373a10f",
- "tarball": "https://registry.npmjs.org/properties-parser/-/properties-parser-0.2.3.tgz"
- },
- "engines": {
- "node": ">= 0.3.1"
- },
- "homepage": "https://github.com/xavi-/node-properties-parser",
- "keywords": [
- "parser",
- ".properties",
- "properties",
- "java",
- "file parser",
- "actionscript"
- ],
- "main": "./index.js",
- "maintainers": [
- {
- "name": "xavi",
- "email": "xavi.rmz@gmail.com"
- }
- ],
- "name": "properties-parser",
- "optionalDependencies": {},
- "readme": "ERROR: No README data found!",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/xavi-/node-properties-parser.git"
- },
- "version": "0.2.3"
-}
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/properties-parser/play-ground.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/properties-parser/play-ground.js
deleted file mode 100644
index ffbcf62..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/properties-parser/play-ground.js
+++ /dev/null
@@ -1,17 +0,0 @@
-var parser = require("./");
-var editor = parser.createEditor();
-
-editor.set("ok", "hi");
-editor.set("hi", "ok");
-
-console.log(editor.toString());
-
-editor.unset("hi");
-
-console.log("===================");
-console.log(editor.toString());
-
-editor.unset("ok");
-
-console.log("===================");
-console.log(editor.toString());
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/properties-parser/test/ReadProperties.java b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/properties-parser/test/ReadProperties.java
deleted file mode 100644
index 12e4472..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/properties-parser/test/ReadProperties.java
+++ /dev/null
@@ -1,61 +0,0 @@
-import java.io.*;
-import java.util.*;
-
-public class ReadProperties {
- public static void main(String[] args) throws IOException {
- if(args.length <= 0) { System.out.println("No file provided."); return; }
-
- File f = new File(args[0]);
-
- if(!f.exists()) { System.out.println("File not found: " + args[0]); return; }
-
- Properties prop = new Properties();
- prop.load(new FileInputStream(f));
-
- boolean isFirst = true; // I fucking hate java, why don't they have a native string join function?
- System.out.print("{");
- for (Map.Entry item : prop.entrySet()) {
- String key = (String) item.getKey();
- String value = (String) item.getValue();
-
- if(isFirst) { isFirst = false; }
- else { System.out.print(","); }
-
- System.out.print("\"" + escape(key) + "\":\"" + escape(value) + "\"");
- }
- System.out.print("}");
- }
-
- static String escape(String s) { // Taken from http://code.google.com/p/json-simple/
- StringBuffer sb = new StringBuffer();
- for(int i = 0; i < s.length(); i++) {
- char ch = s.charAt(i);
- switch(ch) {
- case '"': sb.append("\\\""); break;
- case '\\': sb.append("\\\\"); break;
- case '\b': sb.append("\\b"); break;
- case '\f': sb.append("\\f"); break;
- case '\n': sb.append("\\n"); break;
- case '\r': sb.append("\\r"); break;
- case '\t': sb.append("\\t"); break;
- case '/': sb.append("\\/"); break;
- default:
- //Reference: http://www.unicode.org/versions/Unicode5.1.0/
- if (('\u0000' <= ch && ch <= '\u001F')
- || ('\u007F' <= ch && ch <= '\u009F')
- || ('\u2000' <= ch && ch <= '\u20FF')) {
- String ss = Integer.toHexString(ch);
- sb.append("\\u");
- for(int k = ss.length(); k < 4; k++) {
- sb.append('0');
- }
- sb.append(ss.toUpperCase());
- } else {
- sb.append(ch);
- }
- }
- }
-
- return sb.toString();
- }
-}
\ No newline at end of file
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/properties-parser/test/test-cases-copy.properties b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/properties-parser/test/test-cases-copy.properties
deleted file mode 100644
index 04b8ecd..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/properties-parser/test/test-cases-copy.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-# You are reading the ".properties" entry.
-! The exclamation mark can also mark text as comments.
-lala=whatever
-website = whatever
-language = whatever
-# The backslash below tells the application to continue reading
-# the value onto the next line.
-message = whatever
-# Add spaces to the key
-key\ with\ spaces = whatever
-# Unicode
-tab : whatever
-long-unicode : whatever
-space\ separator key val \n three
-another-test :whatever
- null-prop
\ No newline at end of file
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/properties-parser/test/test-cases.properties b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/properties-parser/test/test-cases.properties
deleted file mode 100644
index 5fc5bb7..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/properties-parser/test/test-cases.properties
+++ /dev/null
@@ -1,18 +0,0 @@
-# You are reading the ".properties" entry.
-! The exclamation mark can also mark text as comments.
-lala=\u210A the foo foo \
- lalala;
-website = http://en.wikipedia.org/
-language = English
-# The backslash below tells the application to continue reading
-# the value onto the next line.
-message = Welcome to \
- Wikipedia!
-# Add spaces to the key
-key\ with\ spaces = This is the value that could be looked up with the key "key with spaces".
-# Unicode
-tab : \u0009
-long-unicode : \u00000009
-space\ separator key val \n three
-another-test ::: hihi
- null-prop
\ No newline at end of file
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/properties-parser/test/test.js b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/properties-parser/test/test.js
deleted file mode 100644
index 4b7b531..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/properties-parser/test/test.js
+++ /dev/null
@@ -1,123 +0,0 @@
-var fs = require("fs");
-var assert = require("assert");
-var prop = require("../index.js");
-
-var syncData = prop.read("./test-cases.properties");
-prop.read("./test-cases.properties", function(err, data) {
- assert.deepEqual(data, syncData);
- assert.equal(data["lala"], 'ℊ the foo foo lalala;');
- assert.equal(data["website"], 'http://en.wikipedia.org/');
- assert.equal(data["language"], 'English');
- assert.equal(data["message"], 'Welcome to Wikipedia!');
- assert.equal(data["key with spaces"], 'This is the value that could be looked up with the key "key with spaces".');
- assert.equal(data["tab"], '\t');
- assert.equal(data["long-unicode"], '\u00000009');
- assert.equal(data["space separator"], 'key val \n three');
- assert.equal(data["another-test"], ':: hihi');
- assert.equal(data["null-prop"], '');
- assert.ok(data["valueOf"] == null, "Properties are set that shouldn't be (valueOf)");
- assert.ok(data["toString"] == null, "Properties are set that shouldn't be (toString)");
-
- console.log("Tests all passed...");
-
- if(process.argv[2] === "repl") {
- var repl = require("repl").start("test-repl> ");
- repl.context.data = data;
- repl.context.prop = prop;
- }
-});
-
-var editor1 = prop.createEditor();
-editor1.set("basic", "prop1");
-assert.equal(editor1.toString(), "basic=prop1");
-editor1.set("basic", "prop2", "A comment\nmulti-line1");
-assert.equal(editor1.toString(), "# A comment\n# multi-line1\nbasic=prop2");
-editor1.set("basic", "prop3", "A comment\nmulti-line2");
-assert.equal(editor1.toString(), "# A comment\n# multi-line2\nbasic=prop3");
-editor1.set("basic", "prop4");
-assert.equal(editor1.toString(), "# A comment\n# multi-line2\nbasic=prop4");
-editor1.set("basic", "prop5", null); // Delete's comment
-assert.equal(editor1.toString(), "basic=prop5");
-editor1.set("basic1", "prop6");
-assert.equal(editor1.toString(), "basic=prop5\nbasic1=prop6");
-editor1.addHeadComment("Head Comment");
-assert.equal(editor1.toString(), "# Head Comment\nbasic=prop5\nbasic1=prop6");
-assert.ok(editor1.get("valueOf") == null);
-assert.ok(editor1.get("toString") == null);
-
-var editor2 = prop.createEditor("./test-cases.properties");
-assert.equal(fs.readFileSync("./test-cases.properties").toString(), editor2.toString());
-editor2.set("lala", "prop1");
-assert.ok(editor2.toString().indexOf("lala=prop1") > -1);
-editor2.set("lala", "prop2", "A comment\nmulti-line1");
-assert.ok(editor2.toString().indexOf("# A comment\n# multi-line1\nlala=prop2") > -1);
-editor2.set("lala", "prop3", "A comment\nmulti-line2");
-assert.ok(editor2.toString().indexOf("# A comment\n# multi-line2\nlala=prop3") > -1);
-editor2.set("lala", "prop4");
-assert.ok(editor2.toString().indexOf("# A comment\n# multi-line2\nlala=prop4") > -1);
-editor2.set("lala", "prop5", null); // Delete's comment
-assert.ok(editor2.toString().indexOf("! The exclamation mark can also mark text as comments.\nlala=prop5") > -1);
-editor2.set("basic-non-existing", "prop6");
-assert.ok(editor2.toString().indexOf("\nbasic-non-existing=prop6") > -1);
-editor2.addHeadComment("Head Comment");
-assert.equal(editor2.toString().indexOf("# Head Comment\n"), 0);
-assert.ok(editor2.get("valueOf") == null);
-assert.ok(editor2.get("toString") == null);
-
-var editor3 = prop.createEditor();
-editor3.set("stay", "ok");
-
-editor3.unset("key");
-editor3.unset("key", null);
-editor3.unset("key", undefined);
-assert.equal(editor3.toString().trim(), "stay=ok");
-
-editor3.set("key", "val");
-editor3.unset("key");
-assert.equal(editor3.toString().trim(), "stay=ok");
-
-editor3.set("key", "val");
-editor3.set("key", null);
-assert.equal(editor3.toString().trim(), "stay=ok");
-
-editor3.set("key", "val");
-editor3.set("key", undefined);
-assert.equal(editor3.toString().trim(), "stay=ok");
-
-prop.createEditor("./test-cases.properties", function(err, editor) {
- var properties = {};
- properties.lala = 'whatever';
- properties.website = 'whatever';
- properties.language = 'whatever';
- properties.message = 'whatever';
- properties['key with spaces'] = 'whatever';
- properties.tab = 'whatever';
- properties['long-unicode'] = 'whatever';
- properties['another-test'] = 'whatever';
- for (var item in properties) {
- editor.set(item, properties[item]);
- }
-
- assert.equal(
- editor.toString(),
- '# You are reading the ".properties" entry.\n' +
- '! The exclamation mark can also mark text as comments.\n' +
- 'lala=whatever\n' +
- 'website = whatever\n' +
- 'language = whatever\n' +
- '# The backslash below tells the application to continue reading\n' +
- '# the value onto the next line.\n' +
- 'message = whatever\n' +
- '# Add spaces to the key\n' +
- 'key\\ with\\ spaces = whatever\n' +
- '# Unicode\n' +
- 'tab : whatever\n' +
- 'long-unicode : whatever\n' +
- 'space\\ separator key val \\n three\n' +
- 'another-test :whatever\n' +
- ' null-prop'
- );
-});
-
-// java ReadProperties test-cases.properties
-// javac ReadProperties.java
\ No newline at end of file
diff --git a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/q/CHANGES.md b/Zombie/ZombieDetector/platforms/android/cordova/node_modules/q/CHANGES.md
deleted file mode 100644
index cd351fd..0000000
--- a/Zombie/ZombieDetector/platforms/android/cordova/node_modules/q/CHANGES.md
+++ /dev/null
@@ -1,786 +0,0 @@
-
-## 1.4.1
-
- - Address an issue that prevented Q from being used as a `
-
-