From de77513e6b78249257b431eebb97b353e840c7c5 Mon Sep 17 00:00:00 2001 From: "walf (Localization Automation)" Date: Thu, 2 Feb 2017 02:03:20 -0800 Subject: [PATCH 001/121] Updated by ALF automation. --- src/nls/fr/strings.js | 4 +++- src/nls/ja/strings.js | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/nls/fr/strings.js b/src/nls/fr/strings.js index f412003fab7..4e610ccfc23 100644 --- a/src/nls/fr/strings.js +++ b/src/nls/fr/strings.js @@ -153,7 +153,8 @@ define({ "FIND_NO_RESULTS": "Aucun résultat", "FIND_QUERY_PLACEHOLDER": "Rechercher\u2026", "REPLACE_PLACEHOLDER": "Remplacer par\u2026", - "BUTTON_REPLACE_ALL": "Traiter par lots\u2026", + "BUTTON_REPLACE_ALL": "Remplacer tout", + "BUTTON_REPLACE_BATCH": "Traiter par lots\u2026", "BUTTON_REPLACE_ALL_IN_FILES": "Remplacer\u2026", "BUTTON_REPLACE": "Remplacer", "BUTTON_NEXT": "\u25B6", @@ -418,6 +419,7 @@ define({ "CMD_SHOW_IN_EXPLORER": "Afficher dans l’Explorateur", "CMD_SHOW_IN_FINDER": "Afficher dans le Finder", "CMD_SHOW_IN_OS": "Afficher dans le SE", + "CMD_SWITCH_PANE_FOCUS": "Switch Pane Focus", // Help menu commands "HELP_MENU": "Aide", diff --git a/src/nls/ja/strings.js b/src/nls/ja/strings.js index 9ecab6c2303..4bad9ebbb2e 100644 --- a/src/nls/ja/strings.js +++ b/src/nls/ja/strings.js @@ -153,7 +153,8 @@ define({ "FIND_NO_RESULTS": "該当なし", "FIND_QUERY_PLACEHOLDER": "検索\u2026", "REPLACE_PLACEHOLDER": "\u2026 に置換", - "BUTTON_REPLACE_ALL": "バッチ\u2026", + "BUTTON_REPLACE_ALL": "すべて置換", + "BUTTON_REPLACE_BATCH": "バッチ\u2026", "BUTTON_REPLACE_ALL_IN_FILES": "置換\u2026", "BUTTON_REPLACE": "置換", "BUTTON_NEXT": "\u25B6", @@ -418,6 +419,7 @@ define({ "CMD_SHOW_IN_EXPLORER": "エクスプローラーで表示", "CMD_SHOW_IN_FINDER": "Finder で表示", "CMD_SHOW_IN_OS": "OS で表示", + "CMD_SWITCH_PANE_FOCUS": "Switch Pane Focus", // Help menu commands "HELP_MENU": "ヘルプ", From 46ad28c871cc24487b7bbc399e0dbded03119a97 Mon Sep 17 00:00:00 2001 From: Swagatam Mitra Date: Thu, 9 Feb 2017 11:20:51 +0530 Subject: [PATCH 002/121] Sync code hint font size with code view font size --- src/view/ViewCommandHandlers.js | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/src/view/ViewCommandHandlers.js b/src/view/ViewCommandHandlers.js index 15bb311a491..af88bb7b3e3 100644 --- a/src/view/ViewCommandHandlers.js +++ b/src/view/ViewCommandHandlers.js @@ -66,6 +66,12 @@ define(function (require, exports, module) { * @type {string} */ var DYNAMIC_FONT_STYLE_ID = "codemirror-dynamic-fonts"; + + /** + * @const + * @type {string} + */ + var DYNAMIC_CODEHINT_FONT_STYLE_ID = "codehint-dynamic-fonts"; /** * @const @@ -122,10 +128,10 @@ define(function (require, exports, module) { * @param {string} value Is the value of the style * @param {boolean} important Is a flag to make the style property !important */ - function _addDynamicProperty(propertyID, name, value, important, cssRule) { + function _addDynamicProperty(propertyID, name, value, important, cssRule, cssText) { cssRule = cssRule || ".CodeMirror"; var $style = $("").attr("id", propertyID); - var styleStr = StringUtils.format("{0}: {1}{2}", name, value, important ? " !important" : ""); + var styleStr = cssText || StringUtils.format("{0}: {1} {2}", name, value, important ? " !important" : ""); $style.html(cssRule + "{ " + styleStr + " }"); // Let's make sure we remove the already existing item from the DOM. @@ -139,6 +145,18 @@ define(function (require, exports, module) { */ function _removeDynamicFontSize() { _removeDynamicProperty(DYNAMIC_FONT_STYLE_ID); + _removeDynamicProperty(DYNAMIC_CODEHINT_FONT_STYLE_ID); + } + + /** + * @private + * Adds a new embeded style top sync code-hint font size with codeview font size + */ + function _addDynamicFontSizeForCodeHints(fontSize) { + var styleStr = ""; + styleStr = styleStr + StringUtils.format("{0}: {1} {2};", "font-size", fontSize, " !important"); + styleStr = styleStr + StringUtils.format("{0}: {1} {2};", "line-height", (parseInt(fontSize, 10) + 2) + fontSize.replace(parseInt(fontSize, 10), ""), " !important"); + _addDynamicProperty(DYNAMIC_CODEHINT_FONT_STYLE_ID, "font-size", fontSize, true, ".codehint-menu .dropdown-menu li a", styleStr); } /** @@ -148,6 +166,9 @@ define(function (require, exports, module) { */ function _addDynamicFontSize(fontSize) { _addDynamicProperty(DYNAMIC_FONT_STYLE_ID, "font-size", fontSize, true); + + // Sync code-hint font size + _addDynamicFontSizeForCodeHints(fontSize); } /** From a0463f90bc5cd597fa4e462f8c4b212f26b6dcf7 Mon Sep 17 00:00:00 2001 From: "walf (Localization Automation)" Date: Tue, 14 Feb 2017 09:41:11 -0800 Subject: [PATCH 003/121] Updated by ALF automation. --- src/nls/fr/strings.js | 3 ++- src/nls/ja/strings.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/nls/fr/strings.js b/src/nls/fr/strings.js index 4e610ccfc23..b8808d2a0fe 100644 --- a/src/nls/fr/strings.js +++ b/src/nls/fr/strings.js @@ -789,5 +789,6 @@ define({ "DEFAULT_PREFERENCES_JSON_DEFAULT": "Par défaut", "DESCRIPTION_PURE_CODING_SURFACE": "vrai pour activer le mode code seul et masquer tous les autres éléments de l’interface utilisateur dans {APP_NAME}", "DESCRIPTION_INDENT_LINE_COMMENT": "vrai pour activer la mise en retrait des commentaires sur une ligne", - "DESCRIPTION_RECENT_FILES_NAV": "Activer/désactiver la navigation dans les fichiers récents" + "DESCRIPTION_RECENT_FILES_NAV": "Activer/désactiver la navigation dans les fichiers récents", + "DESCRIPTION_LIVEDEV_WEBSOCKET_PORT": "Port on which WebSocket Server runs for Live Preview" }); diff --git a/src/nls/ja/strings.js b/src/nls/ja/strings.js index 4bad9ebbb2e..c81a38f8a2f 100644 --- a/src/nls/ja/strings.js +++ b/src/nls/ja/strings.js @@ -789,5 +789,6 @@ define({ "DEFAULT_PREFERENCES_JSON_DEFAULT": "デフォルト", "DESCRIPTION_PURE_CODING_SURFACE": "{APP_NAME} でコードのみモードを有効にし、その他すべての UI エレメントを非表示にするには true", "DESCRIPTION_INDENT_LINE_COMMENT": "行コメントのインデントを有効にするには true", - "DESCRIPTION_RECENT_FILES_NAV": "最近使用したファイルのナビゲーションを有効化/無効化" + "DESCRIPTION_RECENT_FILES_NAV": "最近使用したファイルのナビゲーションを有効化/無効化", + "DESCRIPTION_LIVEDEV_WEBSOCKET_PORT": "Port on which WebSocket Server runs for Live Preview" }); From 3ed088d88334dba951992057cdfd8f631a97ee4a Mon Sep 17 00:00:00 2001 From: "walf (Localization Automation)" Date: Tue, 14 Feb 2017 21:46:06 -0800 Subject: [PATCH 004/121] Updated by ALF automation. --- src/nls/fr/strings.js | 1 + src/nls/ja/strings.js | 1 + 2 files changed, 2 insertions(+) diff --git a/src/nls/fr/strings.js b/src/nls/fr/strings.js index b8808d2a0fe..f1cb1c02cce 100644 --- a/src/nls/fr/strings.js +++ b/src/nls/fr/strings.js @@ -513,6 +513,7 @@ define({ "INVALID_VERSION_NUMBER": "Le numéro de version du pack ({0}) n’est pas valide.", "INVALID_BRACKETS_VERSION": "La chaîne de compatibilité {APP_NAME} ({0}) n’est pas valide.", "DISALLOWED_WORDS": "Le champ {0} ne peut pas contenir les mots ({1}).", + "NPM_INSTALL_FAILED": "npm install command failed: {0}", "API_NOT_COMPATIBLE": "L’extension n’est pas compatible avec cette version de l’application {APP_NAME}. Elle a été installée dans le dossier contenant les extensions désactivées.", "MISSING_MAIN": "Le pack ne contient pas de fichier main.js.", "EXTENSION_ALREADY_INSTALLED": "L’installation de ce pack remplacera une extension installée précédemment. Voulez-vous remplacer l’extension installée ?", diff --git a/src/nls/ja/strings.js b/src/nls/ja/strings.js index c81a38f8a2f..34ef893e197 100644 --- a/src/nls/ja/strings.js +++ b/src/nls/ja/strings.js @@ -513,6 +513,7 @@ define({ "INVALID_VERSION_NUMBER": "パッケージバージョン番号 ({0}) は無効です。", "INVALID_BRACKETS_VERSION": "{APP_NAME} 互換文字列 {0} は無効です。", "DISALLOWED_WORDS": "{1} は {0} フィールドでは使用できません。", + "NPM_INSTALL_FAILED": "npm install command failed: {0}", "API_NOT_COMPATIBLE": "拡張機能はこのバージョンの {APP_NAME} と互換性がありません。無効な拡張機能フォルダーにインストールされます。", "MISSING_MAIN": "パッケージに main.js ファイルが含まれていません。", "EXTENSION_ALREADY_INSTALLED": "このパッケージをインストールすると以前にインストールした拡張機能が上書きされます。古い拡張機能を上書きしますか?", From 2954858128883a7bbd2a0488be4ee88fc8a07981 Mon Sep 17 00:00:00 2001 From: Saurabh Kathpalia Date: Mon, 20 Feb 2017 11:42:52 +0530 Subject: [PATCH 005/121] Added Extension Sorting capability according to downloads and last published date (#13080) * Added Extension Sorting capability according to downloads and last published date * Passed sort criteria to sortRegistry function in registy_utils * Added some tests * Added check for existence of downloadCount in extension-manager * Added test for checking downloadCount in ExtensionManager view * Added svg image for download icon in Extension Manager --- src/extensibility/ExtensionManager.js | 3 ++ src/extensibility/ExtensionManagerDialog.js | 25 ++++++++++- src/extensibility/ExtensionManagerView.js | 5 ++- .../ExtensionManagerViewModel.js | 41 ++++++++++--------- src/extensibility/registry_utils.js | 14 +++++-- src/htmlContent/extension-manager-dialog.html | 5 +++ .../extension-manager-view-item.html | 5 ++- src/nls/root/strings.js | 4 ++ src/styles/brackets_patterns_override.less | 11 +++++ src/styles/images/download-icon.svg | 19 +++++++++ .../mockRegistry.json | 30 +++++++++----- .../mockRegistryForSearch.json | 18 +++++--- .../mockRegistryThemes.json | 6 ++- test/spec/ExtensionManager-test.js | 18 +++++++- 14 files changed, 160 insertions(+), 44 deletions(-) create mode 100644 src/styles/images/download-icon.svg diff --git a/src/extensibility/ExtensionManager.js b/src/extensibility/ExtensionManager.js index b6cc2d8ef01..5997d482abc 100644 --- a/src/extensibility/ExtensionManager.js +++ b/src/extensibility/ExtensionManager.js @@ -108,6 +108,9 @@ define(function (require, exports, module) { _idsToDisable = {}; PreferencesManager.stateManager.definePreference(FOLDER_AUTOINSTALL, "object", undefined); + PreferencesManager.definePreference("extensions.sort", "string", "publishedDate", { + description: Strings.SORT_EXTENSION_METHOD + }); /** * @private diff --git a/src/extensibility/ExtensionManagerDialog.js b/src/extensibility/ExtensionManagerDialog.js index acfd61873fb..855b91211d4 100644 --- a/src/extensibility/ExtensionManagerDialog.js +++ b/src/extensibility/ExtensionManagerDialog.js @@ -41,7 +41,8 @@ define(function (require, exports, module) { KeyEvent = require("utils/KeyEvent"), ExtensionManager = require("extensibility/ExtensionManager"), ExtensionManagerView = require("extensibility/ExtensionManagerView").ExtensionManagerView, - ExtensionManagerViewModel = require("extensibility/ExtensionManagerViewModel"); + ExtensionManagerViewModel = require("extensibility/ExtensionManagerViewModel"), + PreferencesManager = require("preferences/PreferencesManager"); var dialogTemplate = require("text!htmlContent/extension-manager-dialog.html"); @@ -372,6 +373,11 @@ define(function (require, exports, module) { if (models[_activeTabIndex]) { $modalDlg.scrollTop(models[_activeTabIndex].scrollPos || 0); clearSearch(); + if (_activeTabIndex === 2) { + $(".ext-sort-group").hide(); + } else { + $(".ext-sort-group").show(); + } } } @@ -460,6 +466,18 @@ define(function (require, exports, module) { $modalDlg.scrollTop(0); }); }).on("click", ".search-clear", clearSearch); + + // Sort the extension list based on the current selected sorting criteria + $dlg.on("change", ".sort-extensions", function (e) { + var sortBy = $(this).val(); + PreferencesManager.set("extensions.sort", sortBy); + models.forEach(function (model, index) { + if (index <= 1) { + model._setSortedExtensionList(ExtensionManager.extensions, index === 1); + views[index].filter($(".search").val()); + } + }); + }); // Disable the search field when there are no items in the model models.forEach(function (model, index) { @@ -480,6 +498,11 @@ define(function (require, exports, module) { } else { // Otherwise show the first tab $dlg.find(".nav-tabs a:first").tab("show"); } + if ($activeTab.hasClass("installed")) { + $(".ext-sort-group").hide(); + } else { + $(".ext-sort-group").show(); + } }); // Handle the 'Install from URL' button. diff --git a/src/extensibility/ExtensionManagerView.js b/src/extensibility/ExtensionManagerView.js index 0bac5cdde1a..2a981ff6c68 100644 --- a/src/extensibility/ExtensionManagerView.js +++ b/src/extensibility/ExtensionManagerView.js @@ -36,7 +36,8 @@ define(function (require, exports, module) { LanguageManager = require("language/LanguageManager"), Mustache = require("thirdparty/mustache/mustache"), PathUtils = require("thirdparty/path-utils/path-utils"), - itemTemplate = require("text!htmlContent/extension-manager-view-item.html"); + itemTemplate = require("text!htmlContent/extension-manager-view-item.html"), + PreferencesManager = require("preferences/PreferencesManager"); /** @@ -71,6 +72,7 @@ define(function (require, exports, module) { this._$infoMessage = $("
") .appendTo(this.$el).html(this.model.infoMessage); this._$table = $("").appendTo(this.$el); + $(".sort-extensions").val(PreferencesManager.get("extensions.sort")); this.model.initialize().done(function () { self._setupEventHandlers(); @@ -248,6 +250,7 @@ define(function (require, exports, module) { var installWarningBase = context.requiresNewer ? Strings.EXTENSION_LATEST_INCOMPATIBLE_NEWER : Strings.EXTENSION_LATEST_INCOMPATIBLE_OLDER; context.installWarning = StringUtils.format(installWarningBase, entry.registryInfo.versions[entry.registryInfo.versions.length - 1].version, latestVerCompatInfo.compatibleVersion); } + context.downloadCount = entry.registryInfo.totalDownloads; } else { // We should only get here when viewing the Installed tab and some extensions don't exist in the registry // (or registry is offline). These flags *should* always be ignored in that scenario, but just in case... diff --git a/src/extensibility/ExtensionManagerViewModel.js b/src/extensibility/ExtensionManagerViewModel.js index 90d30fe512e..cb86d1327ee 100644 --- a/src/extensibility/ExtensionManagerViewModel.js +++ b/src/extensibility/ExtensionManagerViewModel.js @@ -28,10 +28,11 @@ define(function (require, exports, module) { var _ = require("thirdparty/lodash"); - var ExtensionManager = require("extensibility/ExtensionManager"), - registry_utils = require("extensibility/registry_utils"), - EventDispatcher = require("utils/EventDispatcher"), - Strings = require("strings"); + var ExtensionManager = require("extensibility/ExtensionManager"), + registry_utils = require("extensibility/registry_utils"), + EventDispatcher = require("utils/EventDispatcher"), + Strings = require("strings"), + PreferencesManager = require("preferences/PreferencesManager"); /** * @private @@ -292,6 +293,20 @@ define(function (require, exports, module) { }); }; + ExtensionManagerViewModel.prototype._setSortedExtensionList = function (extensions, isTheme) { + this.filterSet = this.sortedFullSet = registry_utils.sortRegistry(extensions, "registryInfo", PreferencesManager.get("extensions.sort")) + .filter(function (entry) { + if (!isTheme) { + return entry.registryInfo && !entry.registryInfo.metadata.theme; + } else { + return entry.registryInfo && entry.registryInfo.metadata.theme; + } + }) + .map(function (entry) { + return entry.registryInfo.metadata.name; + }); + }; + /** * The model for the ExtensionManagerView that is responsible for handling registry-based extensions. * This extends ExtensionManagerViewModel. @@ -329,13 +344,7 @@ define(function (require, exports, module) { self.extensions = ExtensionManager.extensions; // Sort the registry by last published date and store the sorted list of IDs. - self.sortedFullSet = registry_utils.sortRegistry(self.extensions, "registryInfo") - .filter(function (entry) { - return entry.registryInfo !== undefined && entry.registryInfo.metadata.theme === undefined; - }) - .map(function (entry) { - return entry.registryInfo.metadata.name; - }); + self._setSortedExtensionList(ExtensionManager.extensions, false); self._setInitialFilter(); }) .fail(function () { @@ -536,13 +545,7 @@ define(function (require, exports, module) { self.extensions = ExtensionManager.extensions; // Sort the registry by last published date and store the sorted list of IDs. - self.sortedFullSet = registry_utils.sortRegistry(self.extensions, "registryInfo") - .filter(function (entry) { - return entry.registryInfo !== undefined && entry.registryInfo.metadata.theme; - }) - .map(function (entry) { - return entry.registryInfo.metadata.name; - }); + self._setSortedExtensionList(ExtensionManager.extensions, true); self._setInitialFilter(); }) .fail(function () { @@ -570,4 +573,4 @@ define(function (require, exports, module) { exports.RegistryViewModel = RegistryViewModel; exports.ThemesViewModel = ThemesViewModel; exports.InstalledViewModel = InstalledViewModel; -}); +}); \ No newline at end of file diff --git a/src/extensibility/registry_utils.js b/src/extensibility/registry_utils.js index 57be44c6e29..3ee9b76b6df 100644 --- a/src/extensibility/registry_utils.js +++ b/src/extensibility/registry_utils.js @@ -120,7 +120,7 @@ define(function (require, exports, module) { * we should look at the top level of the object. * @return {Array} Sorted array of registry entries. */ - exports.sortRegistry = function (registry, subkey) { + exports.sortRegistry = function (registry, subkey, sortBy) { function getPublishTime(entry) { if (entry.versions) { return new Date(entry.versions[entry.versions.length - 1].published).getTime(); @@ -136,8 +136,16 @@ define(function (require, exports, module) { sortedEntries.push(registry[key]); }); sortedEntries.sort(function (entry1, entry2) { - return getPublishTime((subkey && entry2[subkey]) || entry2) - - getPublishTime((subkey && entry1[subkey]) || entry1); + if (sortBy !== "publishedDate") { + if (entry1.registryInfo && entry2.registryInfo) { + return entry2.registryInfo.totalDownloads - entry1.registryInfo.totalDownloads; + } else { + return Number.NEGATIVE_INFINITY; + } + } else { + return getPublishTime((subkey && entry2[subkey]) || entry2) - + getPublishTime((subkey && entry1[subkey]) || entry1); + } }); return sortedEntries; diff --git a/src/htmlContent/extension-manager-dialog.html b/src/htmlContent/extension-manager-dialog.html index ebc3162bb60..53ab9562bff 100644 --- a/src/htmlContent/extension-manager-dialog.html +++ b/src/htmlContent/extension-manager-dialog.html @@ -9,6 +9,11 @@

  • {{Strings.EXTENSIONS_INSTALLED_TITLE}}
  • + {{Strings.EXTENSIONS_SORT_BY}} +
    diff --git a/src/htmlContent/extension-manager-view-item.html b/src/htmlContent/extension-manager-view-item.html index bb3782e5ed1..6b15d72bce4 100644 --- a/src/htmlContent/extension-manager-view-item.html +++ b/src/htmlContent/extension-manager-view-item.html @@ -8,6 +8,9 @@ {{#hasVersionInfo}} — {{lastVersionDate}} {{/hasVersionInfo}} + {{#downloadCount}} +

    {{downloadCount}}

    + {{/downloadCount}} - + \ No newline at end of file diff --git a/src/nls/root/strings.js b/src/nls/root/strings.js index 21adacbbcab..6e15cfaf9f8 100644 --- a/src/nls/root/strings.js +++ b/src/nls/root/strings.js @@ -503,6 +503,7 @@ define({ "INSTALL_CANCELED" : "Installation canceled.", "VIEW_COMPLETE_DESCRIPTION" : "View complete description", "VIEW_TRUNCATED_DESCRIPTION" : "View truncated description", + "SORT_EXTENSION_METHOD" : "Sort Extensions using downloadCount or publishedDate", // These must match the error codes in ExtensionsDomain.Errors.* : "INVALID_ZIP_FILE" : "The downloaded content is not a valid zip file.", "MISSING_PACKAGE_JSON" : "The package has no package.json file.", @@ -580,6 +581,9 @@ define({ "EXTENSIONS_AVAILABLE_TITLE" : "Available", "EXTENSIONS_THEMES_TITLE" : "Themes", "EXTENSIONS_UPDATES_TITLE" : "Updates", + "EXTENSIONS_SORT_BY" : "Sort By", + "EXTENSIONS_LAST_UPDATED" : "Last Updated", + "EXTENSIONS_DOWNLOADS" : "Downloads", "INLINE_EDITOR_NO_MATCHES" : "No matches available.", "INLINE_EDITOR_HIDDEN_MATCHES" : "All matches are collapsed. Expand the files listed at right to view matches.", diff --git a/src/styles/brackets_patterns_override.less b/src/styles/brackets_patterns_override.less index 7bed48f66ae..0fd283bc034 100644 --- a/src/styles/brackets_patterns_override.less +++ b/src/styles/brackets_patterns_override.less @@ -1183,6 +1183,17 @@ a[href^="http"] { opacity: 0.3; } } + .sort-extensions-title { + float: left; + margin-right: 5px; + margin-top: 5px; + } + .sort-extensions { + float: left; + margin-right: 10px; + width: auto; + padding-right: 18px; + } } .modal-body { height: 400px; diff --git a/src/styles/images/download-icon.svg b/src/styles/images/download-icon.svg new file mode 100644 index 00000000000..74927919666 --- /dev/null +++ b/src/styles/images/download-icon.svg @@ -0,0 +1,19 @@ + + + + + S_Download_18_N + + + + \ No newline at end of file diff --git a/test/spec/ExtensionManager-test-files/mockRegistry.json b/test/spec/ExtensionManager-test-files/mockRegistry.json index 259639f7071..b61ec791c10 100644 --- a/test/spec/ExtensionManager-test-files/mockRegistry.json +++ b/test/spec/ExtensionManager-test-files/mockRegistry.json @@ -20,7 +20,8 @@ "published": "2013-04-10T18:21:27.058Z", "brackets": ">0.20.0" } - ] + ], + "totalDownloads": 10 }, "long-desc-extension": { "metadata": { @@ -42,7 +43,8 @@ "version": "1.0.0", "published": "2013-04-10T18:26:20.553Z" } - ] + ], + "totalDownloads": 184 }, "mock-extension-1": { "metadata": { @@ -65,7 +67,8 @@ "version": "1.0.0", "published": "2013-04-11T18:26:20.553Z" } - ] + ], + "totalDownloads": 190 }, "mock-extension-2": { "metadata": { @@ -79,7 +82,8 @@ "version": "1.0.0", "published": "2013-04-11T18:26:20.553Z" } - ] + ], + "totalDownloads": 88 }, "mock-extension-3": { "metadata": { @@ -93,7 +97,8 @@ "version": "1.0.0", "published": "2013-04-11T18:26:20.553Z" } - ] + ], + "totalDownloads": 34 }, "mock-extension-4": { "metadata": { @@ -107,7 +112,8 @@ "version": "1.0.0", "published": "2013-04-11T18:26:20.553Z" } - ] + ], + "totalDownloads": 20 }, "malicious-script-extension": { "metadata": { @@ -122,7 +128,8 @@ "version": "1.0.0", "published": "2013-04-10T18:26:24.956Z" } - ] + ], + "totalDownloads": 781 }, "select-parent": { "metadata": { @@ -147,7 +154,8 @@ "published": "2013-04-10T18:26:47.580Z", "brackets": ">0.22.0" } - ] + ], + "totalDownloads": 101 }, "basic-valid-extension": { "metadata": { @@ -165,7 +173,8 @@ "version": "3.0.0", "published": "2013-04-10T18:29:11.907Z" } - ] + ], + "totalDownloads": 130 }, "everyscrub": { "metadata": { @@ -179,6 +188,7 @@ "version": "0.23.0", "published": "2013-04-11T17:22:38.033Z" } - ] + ], + "totalDownloads": 101 } } \ No newline at end of file diff --git a/test/spec/ExtensionManager-test-files/mockRegistryForSearch.json b/test/spec/ExtensionManager-test-files/mockRegistryForSearch.json index a58761d98e8..2e64ad07643 100644 --- a/test/spec/ExtensionManager-test-files/mockRegistryForSearch.json +++ b/test/spec/ExtensionManager-test-files/mockRegistryForSearch.json @@ -19,7 +19,8 @@ "published": "2013-04-10T18:21:27.058Z", "brackets": ">0.20.0" } - ] + ], + "totalDownloads": 10 }, "item-2": { "metadata": { @@ -36,7 +37,8 @@ "version": "1.0.0", "published": "2013-04-10T18:26:20.553Z" } - ] + ], + "totalDownloads": 5 }, "item-3": { "metadata": { @@ -53,7 +55,8 @@ "version": "1.0.0", "published": "2013-04-10T13:26:20.553Z" } - ] + ], + "totalDownloads": 11 }, "item-4": { "metadata": { @@ -71,7 +74,8 @@ "version": "1.0.0", "published": "2013-04-10T15:26:20.553Z" } - ] + ], + "totalDownloads": 12 }, "item-5": { "metadata": { @@ -89,7 +93,8 @@ "version": "1.0.0", "published": "2013-04-16T18:26:20.553Z" } - ] + ], + "totalDownloads": 2 }, "item-6": { "metadata": { @@ -111,6 +116,7 @@ "version": "1.0.0", "published": "2013-04-15T18:26:20.553Z" } - ] + ], + "totalDownloads": 100 } } \ No newline at end of file diff --git a/test/spec/ExtensionManager-test-files/mockRegistryThemes.json b/test/spec/ExtensionManager-test-files/mockRegistryThemes.json index 6a62a6636af..35386535b2a 100644 --- a/test/spec/ExtensionManager-test-files/mockRegistryThemes.json +++ b/test/spec/ExtensionManager-test-files/mockRegistryThemes.json @@ -188,7 +188,8 @@ "version": "0.0.1", "published": "2014-08-31T04:05:47.778Z" } - ] + ], + "totalDownloads": 80 }, "theme-2": { "metadata": { @@ -205,6 +206,7 @@ "version": "1.0.1", "published": "2014-07-31T04:05:47.778Z" } - ] + ], + "totalDownloads": 99 } } diff --git a/test/spec/ExtensionManager-test.js b/test/spec/ExtensionManager-test.js index 52bc8df2e8b..13682a7cee3 100644 --- a/test/spec/ExtensionManager-test.js +++ b/test/spec/ExtensionManager-test.js @@ -48,6 +48,7 @@ define(function (require, exports, module) { Strings = require("strings"), StringUtils = require("utils/StringUtils"), LocalizationUtils = require("utils/LocalizationUtils"), + PreferencesManager = require("preferences/PreferencesManager"), mockRegistryText = require("text!spec/ExtensionManager-test-files/mockRegistry.json"), mockRegistryThemesText = require("text!spec/ExtensionManager-test-files/mockRegistryThemes.json"), mockRegistryForSearch = require("text!spec/ExtensionManager-test-files/mockRegistryForSearch.json"), @@ -734,7 +735,15 @@ define(function (require, exports, module) { expect(model.extensions).toEqual(ExtensionManager.extensions); }); + it("should start with the full set sorted in reverse download count order", function () { + PreferencesManager.set("extensions.sort", "downloadCount"); + model._setSortedExtensionList(ExtensionManager.extensions, false); + expect(model.filterSet).toEqual(["item-6", "item-4", "item-3", "find-uniq1-in-name", "item-2", "item-5"]); + }); + it("should start with the full set sorted in reverse publish date order", function () { + PreferencesManager.set("extensions.sort", "publishedDate"); + model._setSortedExtensionList(ExtensionManager.extensions, false); expect(model.filterSet).toEqual(["item-5", "item-6", "item-2", "find-uniq1-in-name", "item-4", "item-3"]); }); @@ -829,6 +838,12 @@ define(function (require, exports, module) { it("should start with the full set sorted in reverse publish date order", function () { expect(model.filterSet).toEqual(["theme-1", "theme-2"]); }); + + it("should start with the full set sorted in reverse download count order", function () { + PreferencesManager.set("extensions.sort", "downloadCount"); + model._setSortedExtensionList(ExtensionManager.extensions, true); + expect(model.filterSet).toEqual(["theme-2", "theme-1"]); + }); }); @@ -1282,7 +1297,8 @@ define(function (require, exports, module) { // Simple fields [item.metadata.version, - item.metadata.author && item.metadata.author.name] + item.metadata.author && item.metadata.author.name, + item.totalDownloads] .forEach(function (value) { if (value) { expect(view).toHaveText(value); From c28a6697c8bb6bbfc9449e20284228ab755cac59 Mon Sep 17 00:00:00 2001 From: "walf (Localization Automation)" Date: Mon, 20 Feb 2017 09:41:12 -0800 Subject: [PATCH 006/121] Updated by ALF automation. --- src/nls/fr/strings.js | 4 ++++ src/nls/ja/strings.js | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/nls/fr/strings.js b/src/nls/fr/strings.js index f1cb1c02cce..6f20e3943c7 100644 --- a/src/nls/fr/strings.js +++ b/src/nls/fr/strings.js @@ -503,6 +503,7 @@ define({ "INSTALL_CANCELED": "Installation annulée.", "VIEW_COMPLETE_DESCRIPTION": "Voir la description complète", "VIEW_TRUNCATED_DESCRIPTION": "Voir la description tronquée", + "SORT_EXTENSION_METHOD": "Sort Extensions using downloadCount or publishedDate", // These must match the error codes in ExtensionsDomain.Errors.* : "INVALID_ZIP_FILE": "Le contenu téléchargé n’est pas un fichier zip valide.", "MISSING_PACKAGE_JSON": "Le pack ne contient pas de fichier package.json.", @@ -580,6 +581,9 @@ define({ "EXTENSIONS_AVAILABLE_TITLE": "Disponibles", "EXTENSIONS_THEMES_TITLE": "Thèmes", "EXTENSIONS_UPDATES_TITLE": "Mises à jour", + "EXTENSIONS_SORT_BY": "Trier par", + "EXTENSIONS_LAST_UPDATED": "Last Updated", + "EXTENSIONS_DOWNLOADS": "Téléchargements", "INLINE_EDITOR_NO_MATCHES": "Aucun résultat.", "INLINE_EDITOR_HIDDEN_MATCHES": "Tous les résultats sont réduits. Développez les fichiers dans la liste de droite pour voir le détail.", diff --git a/src/nls/ja/strings.js b/src/nls/ja/strings.js index 34ef893e197..99bee7014b8 100644 --- a/src/nls/ja/strings.js +++ b/src/nls/ja/strings.js @@ -503,6 +503,7 @@ define({ "INSTALL_CANCELED": "インストールはキャンセルされました。", "VIEW_COMPLETE_DESCRIPTION": "詳細な説明を表示", "VIEW_TRUNCATED_DESCRIPTION": "省略された説明を表示", + "SORT_EXTENSION_METHOD": "Sort Extensions using downloadCount or publishedDate", // These must match the error codes in ExtensionsDomain.Errors.* : "INVALID_ZIP_FILE": "ダウンロードされたコンテンツは有効な zip ファイルではありません。", "MISSING_PACKAGE_JSON": "パッケージに package.json ファイルがありません。", @@ -580,6 +581,9 @@ define({ "EXTENSIONS_AVAILABLE_TITLE": "入手可能", "EXTENSIONS_THEMES_TITLE": "テーマ", "EXTENSIONS_UPDATES_TITLE": "アップデート", + "EXTENSIONS_SORT_BY": "並べ替え", + "EXTENSIONS_LAST_UPDATED": "最終更新日", + "EXTENSIONS_DOWNLOADS": "ダウンロード", "INLINE_EDITOR_NO_MATCHES": "一致するものがありません。", "INLINE_EDITOR_HIDDEN_MATCHES": "一致項目はすべて縮小されています。一致項目を表示するには、右側にリストされているファイルを展開してください。", From cbad08ec26384e010add775cc1d23b0ec5e6e92b Mon Sep 17 00:00:00 2001 From: Martin Zagora Date: Tue, 21 Feb 2017 10:52:55 +1100 Subject: [PATCH 007/121] update codemirror to 5.24.0 --- src/npm-shrinkwrap.json | 42 ++++++++++++++++++++--------------------- src/package.json | 2 +- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/npm-shrinkwrap.json b/src/npm-shrinkwrap.json index 9283712df0a..74d6a49bfbb 100644 --- a/src/npm-shrinkwrap.json +++ b/src/npm-shrinkwrap.json @@ -2,9 +2,9 @@ "name": "brackets-src", "dependencies": { "ansi-regex": { - "version": "2.0.0", + "version": "2.1.1", "from": "ansi-regex@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.0.0.tgz" + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz" }, "ansi-styles": { "version": "2.2.1", @@ -43,15 +43,15 @@ "optional": true }, "aws4": { - "version": "1.5.0", + "version": "1.6.0", "from": "aws4@>=1.2.1 <2.0.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.5.0.tgz", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz", "optional": true }, "bcrypt-pbkdf": { - "version": "1.0.0", + "version": "1.0.1", "from": "bcrypt-pbkdf@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", "optional": true }, "boom": { @@ -72,9 +72,9 @@ "optional": true }, "codemirror": { - "version": "5.21.0", - "from": "codemirror@5.21.0", - "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-5.21.0.tgz" + "version": "5.24.0", + "from": "codemirror@5.24.0", + "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-5.24.0.tgz" }, "combined-stream": { "version": "1.0.5", @@ -257,9 +257,9 @@ "optional": true }, "jsbn": { - "version": "0.1.0", + "version": "0.1.1", "from": "jsbn@>=0.1.0 <0.2.0", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.0.tgz", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", "optional": true }, "json-schema": { @@ -288,7 +288,7 @@ }, "less": { "version": "2.7.2", - "from": "less@latest", + "from": "less@2.7.2", "resolved": "https://registry.npmjs.org/less/-/less-2.7.2.tgz" }, "mime": { @@ -298,14 +298,14 @@ "optional": true }, "mime-db": { - "version": "1.25.0", - "from": "mime-db@>=1.25.0 <1.26.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.25.0.tgz" + "version": "1.26.0", + "from": "mime-db@>=1.26.0 <1.27.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.26.0.tgz" }, "mime-types": { - "version": "2.1.13", + "version": "2.1.14", "from": "mime-types@>=2.1.7 <2.2.0", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.13.tgz" + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.14.tgz" }, "minimist": { "version": "0.0.8", @@ -356,9 +356,9 @@ "optional": true }, "qs": { - "version": "6.3.0", + "version": "6.3.1", "from": "qs@>=6.3.0 <6.4.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.3.0.tgz", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.3.1.tgz", "optional": true }, "request": { @@ -380,9 +380,9 @@ "optional": true }, "sshpk": { - "version": "1.10.1", + "version": "1.10.2", "from": "sshpk@>=1.7.0 <2.0.0", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.10.1.tgz", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.10.2.tgz", "optional": true, "dependencies": { "assert-plus": { diff --git a/src/package.json b/src/package.json index d6efd58485a..66b6c119997 100644 --- a/src/package.json +++ b/src/package.json @@ -1,7 +1,7 @@ { "name": "brackets-src", "dependencies": { - "codemirror": "5.21.0", + "codemirror": "5.24.0", "less": "2.7.2" } } From c590f02485d8dce55256a62df27c949474518427 Mon Sep 17 00:00:00 2001 From: Martin Zagora Date: Wed, 22 Feb 2017 12:22:27 +1100 Subject: [PATCH 008/121] fix unit tests because of new sticky flag --- test/spec/CodeInspection-test.js | 13 +- test/spec/Document-test.js | 72 ++-- test/spec/DocumentCommandHandlers-test.js | 23 +- test/spec/Editor-test.js | 425 ++++++++++++++-------- test/spec/EditorCommandHandlers-test.js | 111 ++++-- test/spec/EditorOptionHandlers-test.js | 19 +- test/spec/FindReplace-test.js | 185 +++++++--- test/spec/InlineEditorProviders-test.js | 24 +- 8 files changed, 583 insertions(+), 289 deletions(-) diff --git a/test/spec/CodeInspection-test.js b/test/spec/CodeInspection-test.js index eae58c10729..d4f6b1aafde 100644 --- a/test/spec/CodeInspection-test.js +++ b/test/spec/CodeInspection-test.js @@ -104,6 +104,13 @@ define(function (require, exports, module) { }; } + // Helper functions for testing cursor position / selection range + function fixPos(pos) { + if (!("sticky" in pos)) { + pos.sticky = null; + } + } + beforeFirst(function () { runs(function () { SpecRunnerUtils.createTestWindowAndRun(this, function (w) { @@ -925,8 +932,7 @@ define(function (require, exports, module) { runs(function () { CommandManager.execute(Commands.NAVIGATE_GOTO_FIRST_PROBLEM); - - expect(EditorManager.getActiveEditor().getCursorPos()).toEqual({line: 1, ch: 3}); + expect(fixPos(EditorManager.getActiveEditor().getCursorPos())).toEqual(fixPos({line: 1, ch: 3})); }); }); @@ -956,9 +962,8 @@ define(function (require, exports, module) { runs(function () { CommandManager.execute(Commands.NAVIGATE_GOTO_FIRST_PROBLEM); - // 'first' error is in order of linter registration, not in line number order - expect(EditorManager.getActiveEditor().getCursorPos()).toEqual({line: 1, ch: 3}); + expect(fixPos(EditorManager.getActiveEditor().getCursorPos())).toEqual(fixPos({line: 1, ch: 3})); }); }); diff --git a/test/spec/Document-test.js b/test/spec/Document-test.js index 17514ec4db3..289fcabbf37 100644 --- a/test/spec/Document-test.js +++ b/test/spec/Document-test.js @@ -72,8 +72,10 @@ define(function (require, exports, module) { initialContentLines[2] = "new content"; expect(myDocument.getText()).toEqual(initialContentLines.join("\n")); expect(result.length).toBe(1); - expect(result[0].start).toEqual({line: 2, ch: 11}); // end of "new content" - expect(result[0].end).toEqual({line: 2, ch: 11}); + expect(result[0].start.line).toEqual(2); + expect(result[0].start.ch).toEqual(11); // end of "new content" + expect(result[0].end.line).toEqual(2); + expect(result[0].end.ch).toEqual(11); expect(result[0].reversed).toBe(true); }); @@ -83,8 +85,10 @@ define(function (require, exports, module) { initialContentLines[2] = "new content"; expect(myDocument.getText()).toEqual(initialContentLines.join("\n")); expect(result.length).toBe(1); - expect(result[0].start).toEqual({line: 2, ch: 4}); - expect(result[0].end).toEqual({line: 2, ch: 4}); + expect(result[0].start.line).toEqual(2); + expect(result[0].start.ch).toEqual(4); + expect(result[0].end.line).toEqual(2); + expect(result[0].end.ch).toEqual(4); expect(result[0].reversed).toBe(true); }); @@ -101,11 +105,15 @@ define(function (require, exports, module) { initialContentLines.splice(3, 0, ""); expect(myDocument.getText()).toEqual(initialContentLines.join("\n")); expect(result.length).toBe(2); - expect(result[0].start).toEqual({line: 3, ch: 0}); // pushed to end of modified text - expect(result[0].end).toEqual({line: 3, ch: 0}); + expect(result[0].start.line).toEqual(3); + expect(result[0].start.ch).toEqual(0); // pushed to end of modified text + expect(result[0].end.line).toEqual(3); + expect(result[0].end.ch).toEqual(0); expect(result[0].primary).toBe(true); - expect(result[1].start).toEqual({line: 6, ch: 0}); // pushed to end of modified text and updated for both edits - expect(result[1].end).toEqual({line: 6, ch: 0}); + expect(result[1].start.line).toEqual(6); + expect(result[1].start.ch).toEqual(0); // pushed to end of modified text and updated for both edits + expect(result[1].end.line).toEqual(6); + expect(result[1].end.ch).toEqual(0); expect(result[1].reversed).toBe(true); }); @@ -122,11 +130,15 @@ define(function (require, exports, module) { initialContentLines.splice(3, 0, ""); expect(myDocument.getText()).toEqual(initialContentLines.join("\n")); expect(result.length).toBe(2); - expect(result[0].start).toEqual({line: 2, ch: 4}); // not modified since it's above the other edit - expect(result[0].end).toEqual({line: 2, ch: 4}); + expect(result[0].start.line).toEqual(2); + expect(result[0].start.ch).toEqual(4); // not modified since it's above the other edit + expect(result[0].end.line).toEqual(2); + expect(result[0].end.ch).toEqual(4); expect(result[0].primary).toBe(true); - expect(result[1].start).toEqual({line: 5, ch: 4}); // not pushed to end of modified text, but updated for previous edit - expect(result[1].end).toEqual({line: 5, ch: 4}); + expect(result[1].start.line).toEqual(5); + expect(result[1].start.ch).toEqual(4); // not pushed to end of modified text, but updated for previous edit + expect(result[1].end.line).toEqual(5); + expect(result[1].end.ch).toEqual(4); expect(result[1].reversed).toBe(true); }); @@ -146,14 +158,20 @@ define(function (require, exports, module) { initialContentLines.splice(3, 0, ""); expect(myDocument.getText()).toEqual(initialContentLines.join("\n")); expect(result.length).toBe(3); - expect(result[0].start).toEqual({line: 1, ch: 15}); // pushed to end of first modified text - expect(result[0].end).toEqual({line: 1, ch: 15}); + expect(result[0].start.line).toEqual(1); + expect(result[0].start.ch).toEqual(15); // pushed to end of first modified text + expect(result[0].end.line).toEqual(1); + expect(result[0].end.ch).toEqual(15); expect(result[0].primary).toBeFalsy(); - expect(result[1].start).toEqual({line: 3, ch: 0}); // pushed to end of second modified text - expect(result[1].end).toEqual({line: 3, ch: 0}); + expect(result[1].start.line).toEqual(3); + expect(result[1].start.ch).toEqual(0); // pushed to end of second modified text + expect(result[1].end.line).toEqual(3); + expect(result[1].end.ch).toEqual(0); expect(result[1].primary).toBe(true); - expect(result[2].start).toEqual({line: 6, ch: 0}); // pushed to end of third modified text and updated for both edits - expect(result[2].end).toEqual({line: 6, ch: 0}); + expect(result[2].start.line).toEqual(6); + expect(result[2].start.ch).toEqual(0); // pushed to end of third modified text and updated for both edits + expect(result[2].end.line).toEqual(6); + expect(result[2].end.ch).toEqual(0); expect(result[2].reversed).toBe(true); }); @@ -173,14 +191,20 @@ define(function (require, exports, module) { initialContentLines.splice(3, 0, ""); expect(myDocument.getText()).toEqual(initialContentLines.join("\n")); expect(result.length).toBe(3); - expect(result[0].start).toEqual({line: 1, ch: 4}); // not fixed up - expect(result[0].end).toEqual({line: 1, ch: 4}); + expect(result[0].start.line).toEqual(1); + expect(result[0].start.ch).toEqual(4); // not fixed up + expect(result[0].end.line).toEqual(1); + expect(result[0].end.ch).toEqual(4); expect(result[0].primary).toBeFalsy(); - expect(result[1].start).toEqual({line: 2, ch: 4}); // not fixed up, no need to adjust for first edit - expect(result[1].end).toEqual({line: 2, ch: 4}); + expect(result[1].start.line).toEqual(2); + expect(result[1].start.ch).toEqual(4); // not fixed up, no need to adjust for first edit + expect(result[1].end.line).toEqual(2); + expect(result[1].end.ch).toEqual(4); expect(result[1].primary).toBe(true); - expect(result[2].start).toEqual({line: 5, ch: 4}); // not pushed to end of modified text, but updated for previous edit - expect(result[2].end).toEqual({line: 5, ch: 4}); + expect(result[2].start.line).toEqual(5); + expect(result[2].start.ch).toEqual(4); // not pushed to end of modified text, but updated for previous edit + expect(result[2].end.line).toEqual(5); + expect(result[2].end.ch).toEqual(4); expect(result[2].reversed).toBe(true); }); diff --git a/test/spec/DocumentCommandHandlers-test.js b/test/spec/DocumentCommandHandlers-test.js index 8cbc3734720..0b7e9de714c 100644 --- a/test/spec/DocumentCommandHandlers-test.js +++ b/test/spec/DocumentCommandHandlers-test.js @@ -102,6 +102,27 @@ define(function (require, exports, module) { }); }); + // Helper functions for testing cursor position / selection range + function fixPos(pos) { + if (!("sticky" in pos)) { + pos.sticky = null; + } + return pos; + } + function fixSel(sel) { + fixPos(sel.start); + fixPos(sel.end); + if (!("reversed" in sel)) { + sel.reversed = false; + } + return sel; + } + function fixSels(sels) { + sels.forEach(function (sel) { + fixSel(sel); + }); + return sels; + } /** Expect a file to exist (failing test if not) and then delete it */ function expectAndDelete(fullPath) { @@ -974,7 +995,7 @@ define(function (require, exports, module) { var currentDocument = DocumentManager.getCurrentDocument(), currentEditor = EditorManager.getActiveEditor(); expect(currentDocument.file.fullPath).toEqual(newFilePath); - expect(currentEditor.getSelections()).toEqual(selections); + expect(fixSels(currentEditor.getSelections())).toEqual(fixSels(selections)); }); runs(function () { diff --git a/test/spec/Editor-test.js b/test/spec/Editor-test.js index d68418e1162..034f6a0a226 100644 --- a/test/spec/Editor-test.js +++ b/test/spec/Editor-test.js @@ -80,6 +80,39 @@ define(function (require, exports, module) { } }); + // Helper functions for testing cursor position / selection range + function fixPos(pos) { + if (!("sticky" in pos)) { + pos.sticky = null; + } + return pos; + } + function fixSel(sel) { + fixPos(sel.start); + fixPos(sel.end); + if (!("reversed" in sel)) { + sel.reversed = false; + } + return sel; + } + function fixSels(sels) { + sels.forEach(function (sel) { + fixSel(sel); + }); + return sels; + } + function expectCursorAt(pos) { + var selection = myEditor.getSelection(); + expect(selection.start).toEqual(selection.end); + expect(fixPos(selection.start)).toEqual(fixPos(pos)); + } + function expectSelection(sel) { + expect(fixSel(myEditor.getSelection())).toEqual(fixSel(sel)); + } + function expectSelections(sels) { + expect(fixSels(myEditor.getSelections())).toEqual(fixSels(sels)); + } + describe("Editor wrapper", function () { beforeEach(function () { createTestEditor(defaultContent, ""); @@ -100,8 +133,10 @@ define(function (require, exports, module) { changeFired = true; expect(doc).toBe(myDocument); expect(changeList.length).toBe(1); - expect(changeList[0].from).toEqual({line: 0, ch: 0}); - expect(changeList[0].to).toEqual({line: 1, ch: 0}); + expect(changeList[0].from.line).toEqual(0); + expect(changeList[0].from.ch).toEqual(0); + expect(changeList[0].to.line).toEqual(1); + expect(changeList[0].to.ch).toEqual(0); expect(changeList[0].text).toEqual(["new content"]); } myDocument.on("change", changeHandler); @@ -123,11 +158,15 @@ define(function (require, exports, module) { var args = changeHandler.mostRecentCall.args; expect(args[1]).toBe(myDocument); expect(args[2][0].text).toEqual(["inserted"]); - expect(args[2][0].from).toEqual({line: 1, ch: 0}); - expect(args[2][0].to).toEqual({line: 1, ch: 0}); + expect(args[2][0].from.line).toEqual(1); + expect(args[2][0].from.ch).toEqual(0); + expect(args[2][0].to.line).toEqual(1); + expect(args[2][0].to.ch).toEqual(0); expect(args[2][1].text).toEqual([""]); - expect(args[2][1].from).toEqual({line: 0, ch: 0}); - expect(args[2][1].to).toEqual({line: 0, ch: 4}); + expect(args[2][1].from.line).toEqual(0); + expect(args[2][1].from.ch).toEqual(0); + expect(args[2][1].to.line).toEqual(0); + expect(args[2][1].to.ch).toEqual(4); }); it("should set mode based on Document language", function () { @@ -382,20 +421,30 @@ define(function (require, exports, module) { describe("getCursorPos", function () { it("should return a single cursor", function () { myEditor._codeMirror.setCursor(0, 2); - expect(myEditor.getCursorPos()).toEqual({line: 0, ch: 2}); - expect(myEditor.getCursorPos(false, "start")).toEqual({line: 0, ch: 2}); - expect(myEditor.getCursorPos(false, "anchor")).toEqual({line: 0, ch: 2}); - expect(myEditor.getCursorPos(false, "end")).toEqual({line: 0, ch: 2}); - expect(myEditor.getCursorPos(false, "head")).toEqual({line: 0, ch: 2}); + expect(myEditor.getCursorPos().line).toEqual(0); + expect(myEditor.getCursorPos().ch).toEqual(2); + expect(myEditor.getCursorPos(false, "start").line).toEqual(0); + expect(myEditor.getCursorPos(false, "start").ch).toEqual(2); + expect(myEditor.getCursorPos(false, "anchor").line).toEqual(0); + expect(myEditor.getCursorPos(false, "anchor").ch).toEqual(2); + expect(myEditor.getCursorPos(false, "end").line).toEqual(0); + expect(myEditor.getCursorPos(false, "end").ch).toEqual(2); + expect(myEditor.getCursorPos(false, "head").line).toEqual(0); + expect(myEditor.getCursorPos(false, "head").ch).toEqual(2); }); it("should return the correct ends of a single selection", function () { myEditor._codeMirror.setSelection({line: 0, ch: 1}, {line: 0, ch: 5}); - expect(myEditor.getCursorPos()).toEqual({line: 0, ch: 5}); - expect(myEditor.getCursorPos(false, "start")).toEqual({line: 0, ch: 1}); - expect(myEditor.getCursorPos(false, "anchor")).toEqual({line: 0, ch: 1}); - expect(myEditor.getCursorPos(false, "end")).toEqual({line: 0, ch: 5}); - expect(myEditor.getCursorPos(false, "head")).toEqual({line: 0, ch: 5}); + expect(myEditor.getCursorPos().line).toEqual(0); + expect(myEditor.getCursorPos().ch).toEqual(5); + expect(myEditor.getCursorPos(false, "start").line).toEqual(0); + expect(myEditor.getCursorPos(false, "start").ch).toEqual(1); + expect(myEditor.getCursorPos(false, "anchor").line).toEqual(0); + expect(myEditor.getCursorPos(false, "anchor").ch).toEqual(1); + expect(myEditor.getCursorPos(false, "end").line).toEqual(0); + expect(myEditor.getCursorPos(false, "end").ch).toEqual(5); + expect(myEditor.getCursorPos(false, "head").line).toEqual(0); + expect(myEditor.getCursorPos(false, "head").ch).toEqual(5); }); it("should return the default primary cursor in a multiple cursor selection", function () { @@ -403,11 +452,16 @@ define(function (require, exports, module) { {anchor: {line: 1, ch: 1}, head: {line: 1, ch: 1}}, {anchor: {line: 2, ch: 1}, head: {line: 2, ch: 1}} ], 2); - expect(myEditor.getCursorPos()).toEqual({line: 2, ch: 1}); - expect(myEditor.getCursorPos(false, "start")).toEqual({line: 2, ch: 1}); - expect(myEditor.getCursorPos(false, "anchor")).toEqual({line: 2, ch: 1}); - expect(myEditor.getCursorPos(false, "end")).toEqual({line: 2, ch: 1}); - expect(myEditor.getCursorPos(false, "head")).toEqual({line: 2, ch: 1}); + expect(myEditor.getCursorPos().line).toEqual(2); + expect(myEditor.getCursorPos().ch).toEqual(1); + expect(myEditor.getCursorPos(false, "start").line).toEqual(2); + expect(myEditor.getCursorPos(false, "start").ch).toEqual(1); + expect(myEditor.getCursorPos(false, "anchor").line).toEqual(2); + expect(myEditor.getCursorPos(false, "anchor").ch).toEqual(1); + expect(myEditor.getCursorPos(false, "end").line).toEqual(2); + expect(myEditor.getCursorPos(false, "end").ch).toEqual(1); + expect(myEditor.getCursorPos(false, "head").line).toEqual(2); + expect(myEditor.getCursorPos(false, "head").ch).toEqual(1); }); it("should return the specific primary cursor in a multiple cursor selection", function () { @@ -415,11 +469,16 @@ define(function (require, exports, module) { {anchor: {line: 1, ch: 1}, head: {line: 1, ch: 1}}, {anchor: {line: 2, ch: 1}, head: {line: 2, ch: 1}} ], 1); - expect(myEditor.getCursorPos()).toEqual({line: 1, ch: 1}); - expect(myEditor.getCursorPos(false, "start")).toEqual({line: 1, ch: 1}); - expect(myEditor.getCursorPos(false, "anchor")).toEqual({line: 1, ch: 1}); - expect(myEditor.getCursorPos(false, "end")).toEqual({line: 1, ch: 1}); - expect(myEditor.getCursorPos(false, "head")).toEqual({line: 1, ch: 1}); + expect(myEditor.getCursorPos().line).toEqual(1); + expect(myEditor.getCursorPos().ch).toEqual(1); + expect(myEditor.getCursorPos(false, "start").line).toEqual(1); + expect(myEditor.getCursorPos(false, "start").ch).toEqual(1); + expect(myEditor.getCursorPos(false, "anchor").line).toEqual(1); + expect(myEditor.getCursorPos(false, "anchor").ch).toEqual(1); + expect(myEditor.getCursorPos(false, "end").line).toEqual(1); + expect(myEditor.getCursorPos(false, "end").ch).toEqual(1); + expect(myEditor.getCursorPos(false, "head").line).toEqual(1); + expect(myEditor.getCursorPos(false, "head").ch).toEqual(1); }); it("should return the correct ends of the default primary selection in a multiple selection", function () { @@ -427,11 +486,16 @@ define(function (require, exports, module) { {anchor: {line: 1, ch: 1}, head: {line: 1, ch: 4}}, {anchor: {line: 2, ch: 1}, head: {line: 2, ch: 4}} ], 2); - expect(myEditor.getCursorPos()).toEqual({line: 2, ch: 4}); - expect(myEditor.getCursorPos(false, "start")).toEqual({line: 2, ch: 1}); - expect(myEditor.getCursorPos(false, "anchor")).toEqual({line: 2, ch: 1}); - expect(myEditor.getCursorPos(false, "end")).toEqual({line: 2, ch: 4}); - expect(myEditor.getCursorPos(false, "head")).toEqual({line: 2, ch: 4}); + expect(myEditor.getCursorPos().line).toEqual(2); + expect(myEditor.getCursorPos().ch).toEqual(4); + expect(myEditor.getCursorPos(false, "start").line).toEqual(2); + expect(myEditor.getCursorPos(false, "start").ch).toEqual(1); + expect(myEditor.getCursorPos(false, "anchor").line).toEqual(2); + expect(myEditor.getCursorPos(false, "anchor").ch).toEqual(1); + expect(myEditor.getCursorPos(false, "end").line).toEqual(2); + expect(myEditor.getCursorPos(false, "end").ch).toEqual(4); + expect(myEditor.getCursorPos(false, "head").line).toEqual(2); + expect(myEditor.getCursorPos(false, "head").ch).toEqual(4); }); it("should return the correct ends of a specific primary selection in a multiple selection", function () { @@ -439,11 +503,16 @@ define(function (require, exports, module) { {anchor: {line: 1, ch: 1}, head: {line: 1, ch: 4}}, {anchor: {line: 2, ch: 1}, head: {line: 2, ch: 4}} ], 1); - expect(myEditor.getCursorPos()).toEqual({line: 1, ch: 4}); - expect(myEditor.getCursorPos(false, "start")).toEqual({line: 1, ch: 1}); - expect(myEditor.getCursorPos(false, "anchor")).toEqual({line: 1, ch: 1}); - expect(myEditor.getCursorPos(false, "end")).toEqual({line: 1, ch: 4}); - expect(myEditor.getCursorPos(false, "head")).toEqual({line: 1, ch: 4}); + expect(myEditor.getCursorPos().line).toEqual(1); + expect(myEditor.getCursorPos().ch).toEqual(4); + expect(myEditor.getCursorPos(false, "start").line).toEqual(1); + expect(myEditor.getCursorPos(false, "start").ch).toEqual(1); + expect(myEditor.getCursorPos(false, "anchor").line).toEqual(1); + expect(myEditor.getCursorPos(false, "anchor").ch).toEqual(1); + expect(myEditor.getCursorPos(false, "end").line).toEqual(1); + expect(myEditor.getCursorPos(false, "end").ch).toEqual(4); + expect(myEditor.getCursorPos(false, "head").line).toEqual(1); + expect(myEditor.getCursorPos(false, "head").ch).toEqual(4); }); }); @@ -451,13 +520,15 @@ define(function (require, exports, module) { it("should replace an existing single cursor", function () { myEditor._codeMirror.setCursor(0, 2); myEditor.setCursorPos(1, 3); - expect(myEditor.getCursorPos()).toEqual({line: 1, ch: 3}); + expect(myEditor.getCursorPos().line).toEqual(1); + expect(myEditor.getCursorPos().ch).toEqual(3); }); it("should replace an existing single selection", function () { myEditor._codeMirror.setSelection({line: 0, ch: 1}, {line: 0, ch: 5}); myEditor.setCursorPos(1, 3); - expect(myEditor.getCursorPos()).toEqual({line: 1, ch: 3}); + expect(myEditor.getCursorPos().line).toEqual(1); + expect(myEditor.getCursorPos().ch).toEqual(3); }); it("should replace existing multiple cursors", function () { @@ -466,7 +537,8 @@ define(function (require, exports, module) { {anchor: {line: 2, ch: 1}, head: {line: 2, ch: 1}} ], 2); myEditor.setCursorPos(1, 3); - expect(myEditor.getCursorPos()).toEqual({line: 1, ch: 3}); + expect(myEditor.getCursorPos().line).toEqual(1); + expect(myEditor.getCursorPos().ch).toEqual(3); }); it("should replace existing multiple selections", function () { @@ -475,34 +547,35 @@ define(function (require, exports, module) { {anchor: {line: 2, ch: 1}, head: {line: 2, ch: 4}} ], 2); myEditor.setCursorPos(1, 3); - expect(myEditor.getCursorPos()).toEqual({line: 1, ch: 3}); + expect(myEditor.getCursorPos().line).toEqual(1); + expect(myEditor.getCursorPos().ch).toEqual(3); }); }); describe("getSelection", function () { it("should return a single cursor", function () { myEditor._codeMirror.setCursor(0, 2); - expect(myEditor.getSelection()).toEqual({start: {line: 0, ch: 2}, end: {line: 0, ch: 2}, reversed: false}); + expectSelection({start: {line: 0, ch: 2}, end: {line: 0, ch: 2}, reversed: false}); }); it("should return a single selection", function () { myEditor._codeMirror.setSelection({line: 0, ch: 1}, {line: 0, ch: 5}); - expect(myEditor.getSelection()).toEqual({start: {line: 0, ch: 1}, end: {line: 0, ch: 5}, reversed: false}); + expectSelection({start: {line: 0, ch: 1}, end: {line: 0, ch: 5}, reversed: false}); }); it("should return a multiline selection", function () { myEditor._codeMirror.setSelection({line: 0, ch: 5}, {line: 1, ch: 3}); - expect(myEditor.getSelection()).toEqual({start: {line: 0, ch: 5}, end: {line: 1, ch: 3}, reversed: false}); + expectSelection({start: {line: 0, ch: 5}, end: {line: 1, ch: 3}, reversed: false}); }); it("should return a single selection in the proper order when reversed", function () { myEditor._codeMirror.setSelection({line: 0, ch: 5}, {line: 0, ch: 1}); - expect(myEditor.getSelection()).toEqual({start: {line: 0, ch: 1}, end: {line: 0, ch: 5}, reversed: true}); + expectSelection({start: {line: 0, ch: 1}, end: {line: 0, ch: 5}, reversed: true}); }); it("should return a multiline selection in the proper order when reversed", function () { myEditor._codeMirror.setSelection({line: 1, ch: 3}, {line: 0, ch: 5}); - expect(myEditor.getSelection()).toEqual({start: {line: 0, ch: 5}, end: {line: 1, ch: 3}, reversed: true}); + expectSelection({start: {line: 0, ch: 5}, end: {line: 1, ch: 3}, reversed: true}); }); it("should return the default primary cursor in a multiple cursor selection", function () { @@ -510,7 +583,7 @@ define(function (require, exports, module) { {anchor: {line: 1, ch: 1}, head: {line: 1, ch: 1}}, {anchor: {line: 2, ch: 1}, head: {line: 2, ch: 1}} ], 2); - expect(myEditor.getSelection()).toEqual({start: {line: 2, ch: 1}, end: {line: 2, ch: 1}, reversed: false}); + expectSelection({start: {line: 2, ch: 1}, end: {line: 2, ch: 1}, reversed: false}); }); it("should return the specific primary cursor in a multiple cursor selection", function () { @@ -518,7 +591,7 @@ define(function (require, exports, module) { {anchor: {line: 1, ch: 1}, head: {line: 1, ch: 1}}, {anchor: {line: 2, ch: 1}, head: {line: 2, ch: 1}} ], 1); - expect(myEditor.getSelection()).toEqual({start: {line: 1, ch: 1}, end: {line: 1, ch: 1}, reversed: false}); + expectSelection({start: {line: 1, ch: 1}, end: {line: 1, ch: 1}, reversed: false}); }); it("should return the default primary selection in a multiple selection", function () { @@ -526,7 +599,7 @@ define(function (require, exports, module) { {anchor: {line: 1, ch: 1}, head: {line: 1, ch: 4}}, {anchor: {line: 2, ch: 1}, head: {line: 2, ch: 4}} ], 2); - expect(myEditor.getSelection()).toEqual({start: {line: 2, ch: 1}, end: {line: 2, ch: 4}, reversed: false}); + expectSelection({start: {line: 2, ch: 1}, end: {line: 2, ch: 4}, reversed: false}); }); it("should return the default primary selection in the proper order when reversed", function () { @@ -534,7 +607,7 @@ define(function (require, exports, module) { {anchor: {line: 1, ch: 1}, head: {line: 1, ch: 4}}, {anchor: {line: 2, ch: 4}, head: {line: 2, ch: 1}} ], 2); - expect(myEditor.getSelection()).toEqual({start: {line: 2, ch: 1}, end: {line: 2, ch: 4}, reversed: true}); + expectSelection({start: {line: 2, ch: 1}, end: {line: 2, ch: 4}, reversed: true}); }); it("should return the specific primary selection in a multiple selection", function () { @@ -542,7 +615,7 @@ define(function (require, exports, module) { {anchor: {line: 1, ch: 1}, head: {line: 1, ch: 4}}, {anchor: {line: 2, ch: 1}, head: {line: 2, ch: 4}} ], 1); - expect(myEditor.getSelection()).toEqual({start: {line: 1, ch: 1}, end: {line: 1, ch: 4}, reversed: false}); + expectSelection({start: {line: 1, ch: 1}, end: {line: 1, ch: 4}, reversed: false}); }); it("should return the specific primary selection in the proper order when reversed", function () { @@ -550,7 +623,7 @@ define(function (require, exports, module) { {anchor: {line: 1, ch: 4}, head: {line: 1, ch: 1}}, {anchor: {line: 2, ch: 1}, head: {line: 2, ch: 4}} ], 1); - expect(myEditor.getSelection()).toEqual({start: {line: 1, ch: 1}, end: {line: 1, ch: 4}, reversed: true}); + expectSelection({start: {line: 1, ch: 1}, end: {line: 1, ch: 4}, reversed: true}); }); }); @@ -558,17 +631,17 @@ define(function (require, exports, module) { describe("getSelections", function () { it("should return a single cursor", function () { myEditor._codeMirror.setCursor(0, 2); - expect(myEditor.getSelections()).toEqual([{start: {line: 0, ch: 2}, end: {line: 0, ch: 2}, reversed: false, primary: true}]); + expectSelections([{start: {line: 0, ch: 2}, end: {line: 0, ch: 2}, reversed: false, primary: true}]); }); it("should return a single selection", function () { myEditor._codeMirror.setSelection({line: 0, ch: 1}, {line: 0, ch: 5}); - expect(myEditor.getSelections()).toEqual([{start: {line: 0, ch: 1}, end: {line: 0, ch: 5}, reversed: false, primary: true}]); + expectSelections([{start: {line: 0, ch: 1}, end: {line: 0, ch: 5}, reversed: false, primary: true}]); }); it("should properly reverse a single selection whose head is before its anchor", function () { myEditor._codeMirror.setSelection({line: 0, ch: 5}, {line: 0, ch: 1}); - expect(myEditor.getSelections()).toEqual([{start: {line: 0, ch: 1}, end: {line: 0, ch: 5}, reversed: true, primary: true}]); + expectSelections([{start: {line: 0, ch: 1}, end: {line: 0, ch: 5}, reversed: true, primary: true}]); }); it("should return multiple cursors", function () { @@ -576,7 +649,7 @@ define(function (require, exports, module) { {anchor: {line: 1, ch: 1}, head: {line: 1, ch: 1}}, {anchor: {line: 2, ch: 1}, head: {line: 2, ch: 1}} ], 2); - expect(myEditor.getSelections()).toEqual([{start: {line: 0, ch: 1}, end: {line: 0, ch: 1}, reversed: false, primary: false}, + expectSelections([{start: {line: 0, ch: 1}, end: {line: 0, ch: 1}, reversed: false, primary: false}, {start: {line: 1, ch: 1}, end: {line: 1, ch: 1}, reversed: false, primary: false}, {start: {line: 2, ch: 1}, end: {line: 2, ch: 1}, reversed: false, primary: true} ]); @@ -587,7 +660,7 @@ define(function (require, exports, module) { {anchor: {line: 1, ch: 1}, head: {line: 1, ch: 4}}, {anchor: {line: 2, ch: 1}, head: {line: 2, ch: 4}} ], 2); - expect(myEditor.getSelections()).toEqual([{start: {line: 0, ch: 1}, end: {line: 0, ch: 4}, reversed: false, primary: false}, + expectSelections([{start: {line: 0, ch: 1}, end: {line: 0, ch: 4}, reversed: false, primary: false}, {start: {line: 1, ch: 1}, end: {line: 1, ch: 4}, reversed: false, primary: false}, {start: {line: 2, ch: 1}, end: {line: 2, ch: 4}, reversed: false, primary: true} ]); @@ -598,7 +671,7 @@ define(function (require, exports, module) { {anchor: {line: 1, ch: 1}, head: {line: 1, ch: 4}}, {anchor: {line: 2, ch: 4}, head: {line: 2, ch: 1}} ], 2); - expect(myEditor.getSelections()).toEqual([{start: {line: 0, ch: 1}, end: {line: 0, ch: 4}, reversed: true, primary: false}, + expectSelections([{start: {line: 0, ch: 1}, end: {line: 0, ch: 4}, reversed: true, primary: false}, {start: {line: 1, ch: 1}, end: {line: 1, ch: 4}, reversed: false, primary: false}, {start: {line: 2, ch: 1}, end: {line: 2, ch: 4}, reversed: true, primary: true} ]); @@ -608,7 +681,7 @@ define(function (require, exports, module) { myEditor._codeMirror.setSelections([{anchor: {line: 1, ch: 3}, head: {line: 0, ch: 5}}, {anchor: {line: 4, ch: 4}, head: {line: 3, ch: 1}} ], 1); - expect(myEditor.getSelections()).toEqual([{start: {line: 0, ch: 5}, end: {line: 1, ch: 3}, reversed: true, primary: false}, + expectSelections([{start: {line: 0, ch: 5}, end: {line: 1, ch: 3}, reversed: true, primary: false}, {start: {line: 3, ch: 1}, end: {line: 4, ch: 4}, reversed: true, primary: true} ]); }); @@ -659,18 +732,18 @@ define(function (require, exports, module) { it("should replace an existing single cursor", function () { myEditor._codeMirror.setCursor(0, 2); myEditor.setSelection({line: 1, ch: 3}, {line: 2, ch: 5}); - expect(myEditor.getSelection()).toEqual({start: {line: 1, ch: 3}, end: {line: 2, ch: 5}, reversed: false}); + expectSelection({start: {line: 1, ch: 3}, end: {line: 2, ch: 5}, reversed: false}); }); it("should replace an existing single selection", function () { myEditor._codeMirror.setSelection({line: 0, ch: 1}, {line: 0, ch: 5}); myEditor.setSelection({line: 1, ch: 3}, {line: 2, ch: 5}); - expect(myEditor.getSelection()).toEqual({start: {line: 1, ch: 3}, end: {line: 2, ch: 5}, reversed: false}); + expectSelection({start: {line: 1, ch: 3}, end: {line: 2, ch: 5}, reversed: false}); }); it("should allow implicit end", function () { myEditor.setSelection({line: 1, ch: 3}); - expect(myEditor.getSelection()).toEqual({start: {line: 1, ch: 3}, end: {line: 1, ch: 3}, reversed: false}); + expectSelection({start: {line: 1, ch: 3}, end: {line: 1, ch: 3}, reversed: false}); }); it("should replace existing multiple cursors", function () { @@ -679,7 +752,7 @@ define(function (require, exports, module) { {anchor: {line: 2, ch: 1}, head: {line: 2, ch: 1}} ], 2); myEditor.setSelection({line: 1, ch: 3}, {line: 2, ch: 5}); - expect(myEditor.getSelection()).toEqual({start: {line: 1, ch: 3}, end: {line: 2, ch: 5}, reversed: false}); + expectSelection({start: {line: 1, ch: 3}, end: {line: 2, ch: 5}, reversed: false}); }); it("should replace existing multiple selections", function () { @@ -688,7 +761,7 @@ define(function (require, exports, module) { {anchor: {line: 2, ch: 1}, head: {line: 2, ch: 4}} ], 2); myEditor.setSelection({line: 1, ch: 3}, {line: 2, ch: 5}); - expect(myEditor.getSelection()).toEqual({start: {line: 1, ch: 3}, end: {line: 2, ch: 5}, reversed: false}); + expectSelection({start: {line: 1, ch: 3}, end: {line: 2, ch: 5}, reversed: false}); }); }); @@ -697,18 +770,18 @@ define(function (require, exports, module) { myEditor._codeMirror.setCursor(0, 2); myEditor.setSelections([{start: {line: 0, ch: 1}, end: {line: 1, ch: 3}}, {start: {line: 1, ch: 8}, end: {line: 2, ch: 5}}]); - expect(myEditor.getSelections()).toEqual([{start: {line: 0, ch: 1}, end: {line: 1, ch: 3}, reversed: false, primary: false}, + expectSelections([{start: {line: 0, ch: 1}, end: {line: 1, ch: 3}, reversed: false, primary: false}, {start: {line: 1, ch: 8}, end: {line: 2, ch: 5}, reversed: false, primary: true}]); - expect(myEditor.getSelection()).toEqual({start: {line: 1, ch: 8}, end: {line: 2, ch: 5}, reversed: false}); + expectSelection({start: {line: 1, ch: 8}, end: {line: 2, ch: 5}, reversed: false}); }); it("should replace an existing single selection", function () { myEditor._codeMirror.setSelection({line: 0, ch: 1}, {line: 0, ch: 5}); myEditor.setSelections([{start: {line: 0, ch: 1}, end: {line: 1, ch: 3}}, {start: {line: 1, ch: 8}, end: {line: 2, ch: 5}}]); - expect(myEditor.getSelections()).toEqual([{start: {line: 0, ch: 1}, end: {line: 1, ch: 3}, reversed: false, primary: false}, + expectSelections([{start: {line: 0, ch: 1}, end: {line: 1, ch: 3}, reversed: false, primary: false}, {start: {line: 1, ch: 8}, end: {line: 2, ch: 5}, reversed: false, primary: true}]); - expect(myEditor.getSelection()).toEqual({start: {line: 1, ch: 8}, end: {line: 2, ch: 5}, reversed: false}); + expectSelection({start: {line: 1, ch: 8}, end: {line: 2, ch: 5}, reversed: false}); }); it("should replace existing multiple cursors", function () { @@ -718,9 +791,9 @@ define(function (require, exports, module) { ], 2); myEditor.setSelections([{start: {line: 0, ch: 1}, end: {line: 1, ch: 3}}, {start: {line: 1, ch: 8}, end: {line: 2, ch: 5}}]); - expect(myEditor.getSelections()).toEqual([{start: {line: 0, ch: 1}, end: {line: 1, ch: 3}, reversed: false, primary: false}, + expectSelections([{start: {line: 0, ch: 1}, end: {line: 1, ch: 3}, reversed: false, primary: false}, {start: {line: 1, ch: 8}, end: {line: 2, ch: 5}, reversed: false, primary: true}]); - expect(myEditor.getSelection()).toEqual({start: {line: 1, ch: 8}, end: {line: 2, ch: 5}, reversed: false}); + expectSelection({start: {line: 1, ch: 8}, end: {line: 2, ch: 5}, reversed: false}); }); it("should replace existing multiple selections", function () { @@ -730,32 +803,32 @@ define(function (require, exports, module) { ], 2); myEditor.setSelections([{start: {line: 0, ch: 1}, end: {line: 1, ch: 3}}, {start: {line: 1, ch: 8}, end: {line: 2, ch: 5}}]); - expect(myEditor.getSelections()).toEqual([{start: {line: 0, ch: 1}, end: {line: 1, ch: 3}, reversed: false, primary: false}, + expectSelections([{start: {line: 0, ch: 1}, end: {line: 1, ch: 3}, reversed: false, primary: false}, {start: {line: 1, ch: 8}, end: {line: 2, ch: 5}, reversed: false, primary: true}]); - expect(myEditor.getSelection()).toEqual({start: {line: 1, ch: 8}, end: {line: 2, ch: 5}, reversed: false}); + expectSelection({start: {line: 1, ch: 8}, end: {line: 2, ch: 5}, reversed: false}); }); it("should specify non-default primary selection", function () { myEditor.setSelections([{start: {line: 0, ch: 1}, end: {line: 1, ch: 3}, primary: true}, {start: {line: 1, ch: 8}, end: {line: 2, ch: 5}}]); - expect(myEditor.getSelections()).toEqual([{start: {line: 0, ch: 1}, end: {line: 1, ch: 3}, reversed: false, primary: true}, + expectSelections([{start: {line: 0, ch: 1}, end: {line: 1, ch: 3}, reversed: false, primary: true}, {start: {line: 1, ch: 8}, end: {line: 2, ch: 5}, reversed: false, primary: false}]); - expect(myEditor.getSelection()).toEqual({start: {line: 0, ch: 1}, end: {line: 1, ch: 3}, reversed: false}); + expectSelection({start: {line: 0, ch: 1}, end: {line: 1, ch: 3}, reversed: false}); }); it("should sort and merge overlapping selections", function () { myEditor.setSelections([{start: {line: 2, ch: 4}, end: {line: 3, ch: 0}}, {start: {line: 2, ch: 3}, end: {line: 2, ch: 6}}, {start: {line: 1, ch: 1}, end: {line: 1, ch: 4}}]); - expect(myEditor.getSelections()).toEqual([{start: {line: 1, ch: 1}, end: {line: 1, ch: 4}, reversed: false, primary: true}, + expectSelections([{start: {line: 1, ch: 1}, end: {line: 1, ch: 4}, reversed: false, primary: true}, {start: {line: 2, ch: 3}, end: {line: 3, ch: 0}, reversed: false, primary: false}]); - expect(myEditor.getSelection()).toEqual({start: {line: 1, ch: 1}, end: {line: 1, ch: 4}, reversed: false}); + expectSelection({start: {line: 1, ch: 1}, end: {line: 1, ch: 4}, reversed: false}); }); it("should properly set reversed selections", function () { myEditor.setSelections([{start: {line: 0, ch: 1}, end: {line: 1, ch: 3}, reversed: true}, {start: {line: 1, ch: 8}, end: {line: 2, ch: 5}}]); - expect(myEditor.getSelections()).toEqual([{start: {line: 0, ch: 1}, end: {line: 1, ch: 3}, reversed: true, primary: false}, + expectSelections([{start: {line: 0, ch: 1}, end: {line: 1, ch: 3}, reversed: true, primary: false}, {start: {line: 1, ch: 8}, end: {line: 2, ch: 5}, reversed: false, primary: true}]); }); @@ -766,8 +839,10 @@ define(function (require, exports, module) { var origSelections = [{start: {line: 0, ch: 4}, end: {line: 0, ch: 4}}], result = myEditor.convertToLineSelections(origSelections); expect(result.length).toBe(1); - expect(result[0].selectionForEdit.start).toEqual({line: 0, ch: 0}); - expect(result[0].selectionForEdit.end).toEqual({line: 1, ch: 0}); + expect(result[0].selectionForEdit.start.line).toEqual(0); + expect(result[0].selectionForEdit.start.ch).toEqual(0); + expect(result[0].selectionForEdit.end.line).toEqual(1); + expect(result[0].selectionForEdit.end.ch).toEqual(0); expect(result[0].selectionsToTrack.length).toBe(1); expect(result[0].selectionsToTrack[0]).toEqual(origSelections[0]); }); @@ -776,8 +851,10 @@ define(function (require, exports, module) { var origSelections = [{start: {line: 0, ch: 4}, end: {line: 0, ch: 8}}], result = myEditor.convertToLineSelections(origSelections); expect(result.length).toBe(1); - expect(result[0].selectionForEdit.start).toEqual({line: 0, ch: 0}); - expect(result[0].selectionForEdit.end).toEqual({line: 1, ch: 0}); + expect(result[0].selectionForEdit.start.line).toEqual(0); + expect(result[0].selectionForEdit.start.ch).toEqual(0); + expect(result[0].selectionForEdit.end.line).toEqual(1); + expect(result[0].selectionForEdit.end.ch).toEqual(0); expect(result[0].selectionsToTrack.length).toBe(1); expect(result[0].selectionsToTrack[0]).toEqual(origSelections[0]); }); @@ -786,8 +863,10 @@ define(function (require, exports, module) { var origSelections = [{start: {line: 0, ch: 4}, end: {line: 1, ch: 8}}], result = myEditor.convertToLineSelections(origSelections); expect(result.length).toBe(1); - expect(result[0].selectionForEdit.start).toEqual({line: 0, ch: 0}); - expect(result[0].selectionForEdit.end).toEqual({line: 2, ch: 0}); + expect(result[0].selectionForEdit.start.line).toEqual(0); + expect(result[0].selectionForEdit.start.ch).toEqual(0); + expect(result[0].selectionForEdit.end.line).toEqual(2); + expect(result[0].selectionForEdit.end.ch).toEqual(0); expect(result[0].selectionsToTrack.length).toBe(1); expect(result[0].selectionsToTrack[0]).toEqual(origSelections[0]); }); @@ -796,8 +875,10 @@ define(function (require, exports, module) { var origSelections = [{start: {line: 0, ch: 4}, end: {line: 0, ch: 8}, reversed: true}], result = myEditor.convertToLineSelections(origSelections); expect(result.length).toBe(1); - expect(result[0].selectionForEdit.start).toEqual({line: 0, ch: 0}); - expect(result[0].selectionForEdit.end).toEqual({line: 1, ch: 0}); + expect(result[0].selectionForEdit.start.line).toEqual(0); + expect(result[0].selectionForEdit.start.ch).toEqual(0); + expect(result[0].selectionForEdit.end.line).toEqual(1); + expect(result[0].selectionForEdit.end.ch).toEqual(0); expect(result[0].selectionsToTrack.length).toBe(1); expect(result[0].selectionsToTrack[0]).toEqual(origSelections[0]); }); @@ -806,8 +887,10 @@ define(function (require, exports, module) { var origSelections = [{start: {line: 0, ch: 0}, end: {line: 1, ch: 0}}], result = myEditor.convertToLineSelections(origSelections); expect(result.length).toBe(1); - expect(result[0].selectionForEdit.start).toEqual({line: 0, ch: 0}); - expect(result[0].selectionForEdit.end).toEqual({line: 1, ch: 0}); + expect(result[0].selectionForEdit.start.line).toEqual(0); + expect(result[0].selectionForEdit.start.ch).toEqual(0); + expect(result[0].selectionForEdit.end.line).toEqual(1); + expect(result[0].selectionForEdit.end.ch).toEqual(0); expect(result[0].selectionsToTrack.length).toBe(1); expect(result[0].selectionsToTrack[0]).toEqual(origSelections[0]); }); @@ -816,8 +899,10 @@ define(function (require, exports, module) { var origSelections = [{start: {line: 0, ch: 0}, end: {line: 1, ch: 0}}], result = myEditor.convertToLineSelections(origSelections, {expandEndAtStartOfLine: true}); expect(result.length).toBe(1); - expect(result[0].selectionForEdit.start).toEqual({line: 0, ch: 0}); - expect(result[0].selectionForEdit.end).toEqual({line: 2, ch: 0}); + expect(result[0].selectionForEdit.start.line).toEqual(0); + expect(result[0].selectionForEdit.start.ch).toEqual(0); + expect(result[0].selectionForEdit.end.line).toEqual(2); + expect(result[0].selectionForEdit.end.ch).toEqual(0); expect(result[0].selectionsToTrack.length).toBe(1); expect(result[0].selectionsToTrack[0]).toEqual(origSelections[0]); }); @@ -829,20 +914,28 @@ define(function (require, exports, module) { {start: {line: 7, ch: 0}, end: {line: 8, ch: 0}}], result = myEditor.convertToLineSelections(origSelections); expect(result.length).toBe(4); - expect(result[0].selectionForEdit.start).toEqual({line: 0, ch: 0}); - expect(result[0].selectionForEdit.end).toEqual({line: 1, ch: 0}); + expect(result[0].selectionForEdit.start.line).toEqual(0); + expect(result[0].selectionForEdit.start.ch).toEqual(0); + expect(result[0].selectionForEdit.end.line).toEqual(1); + expect(result[0].selectionForEdit.end.ch).toEqual(0); expect(result[0].selectionsToTrack.length).toBe(1); expect(result[0].selectionsToTrack[0]).toEqual(origSelections[0]); - expect(result[1].selectionForEdit.start).toEqual({line: 2, ch: 0}); - expect(result[1].selectionForEdit.end).toEqual({line: 3, ch: 0}); + expect(result[1].selectionForEdit.start.line).toEqual(2); + expect(result[1].selectionForEdit.start.ch).toEqual(0); + expect(result[1].selectionForEdit.end.line).toEqual(3); + expect(result[1].selectionForEdit.end.ch).toEqual(0); expect(result[1].selectionsToTrack.length).toBe(1); expect(result[1].selectionsToTrack[0]).toEqual(origSelections[1]); - expect(result[2].selectionForEdit.start).toEqual({line: 4, ch: 0}); - expect(result[2].selectionForEdit.end).toEqual({line: 6, ch: 0}); + expect(result[2].selectionForEdit.start.line).toEqual(4); + expect(result[2].selectionForEdit.start.ch).toEqual(0); + expect(result[2].selectionForEdit.end.line).toEqual(6); + expect(result[2].selectionForEdit.end.ch).toEqual(0); expect(result[2].selectionsToTrack.length).toBe(1); expect(result[2].selectionsToTrack[0]).toEqual(origSelections[2]); - expect(result[3].selectionForEdit.start).toEqual({line: 7, ch: 0}); - expect(result[3].selectionForEdit.end).toEqual({line: 8, ch: 0}); // not expanded since expandEndAtStartOfLine is false + expect(result[3].selectionForEdit.start.line).toEqual(7); + expect(result[3].selectionForEdit.start.ch).toEqual(0); + expect(result[3].selectionForEdit.end.line).toEqual(8); + expect(result[3].selectionForEdit.end.ch).toEqual(0); // not expanded since expandEndAtStartOfLine is false expect(result[3].selectionsToTrack.length).toBe(1); expect(result[3].selectionsToTrack[0]).toEqual(origSelections[3]); }); @@ -853,13 +946,17 @@ define(function (require, exports, module) { {start: {line: 4, ch: 0}, end: {line: 5, ch: 0}}], result = myEditor.convertToLineSelections(origSelections); expect(result.length).toBe(2); - expect(result[0].selectionForEdit.start).toEqual({line: 0, ch: 0}); - expect(result[0].selectionForEdit.end).toEqual({line: 2, ch: 0}); + expect(result[0].selectionForEdit.start.line).toEqual(0); + expect(result[0].selectionForEdit.start.ch).toEqual(0); + expect(result[0].selectionForEdit.end.line).toEqual(2); + expect(result[0].selectionForEdit.end.ch).toEqual(0); expect(result[0].selectionsToTrack.length).toBe(2); expect(result[0].selectionsToTrack[0]).toEqual(origSelections[0]); expect(result[0].selectionsToTrack[1]).toEqual(origSelections[1]); - expect(result[1].selectionForEdit.start).toEqual({line: 4, ch: 0}); - expect(result[1].selectionForEdit.end).toEqual({line: 5, ch: 0}); + expect(result[1].selectionForEdit.start.line).toEqual(4); + expect(result[1].selectionForEdit.start.ch).toEqual(0); + expect(result[1].selectionForEdit.end.line).toEqual(5); + expect(result[1].selectionForEdit.end.ch).toEqual(0); expect(result[1].selectionsToTrack.length).toBe(1); expect(result[1].selectionsToTrack[0]).toEqual(origSelections[2]); }); @@ -870,13 +967,17 @@ define(function (require, exports, module) { {start: {line: 4, ch: 0}, end: {line: 5, ch: 0}}], result = myEditor.convertToLineSelections(origSelections); expect(result.length).toBe(2); - expect(result[0].selectionForEdit.start).toEqual({line: 0, ch: 0}); - expect(result[0].selectionForEdit.end).toEqual({line: 2, ch: 0}); + expect(result[0].selectionForEdit.start.line).toEqual(0); + expect(result[0].selectionForEdit.start.ch).toEqual(0); + expect(result[0].selectionForEdit.end.line).toEqual(2); + expect(result[0].selectionForEdit.end.ch).toEqual(0); expect(result[0].selectionsToTrack.length).toBe(2); expect(result[0].selectionsToTrack[0]).toEqual(origSelections[0]); expect(result[0].selectionsToTrack[1]).toEqual(origSelections[1]); - expect(result[1].selectionForEdit.start).toEqual({line: 4, ch: 0}); - expect(result[1].selectionForEdit.end).toEqual({line: 5, ch: 0}); + expect(result[1].selectionForEdit.start.line).toEqual(4); + expect(result[1].selectionForEdit.start.ch).toEqual(0); + expect(result[1].selectionForEdit.end.line).toEqual(5); + expect(result[1].selectionForEdit.end.ch).toEqual(0); expect(result[1].selectionsToTrack.length).toBe(1); expect(result[1].selectionsToTrack[0]).toEqual(origSelections[2]); }); @@ -886,8 +987,10 @@ define(function (require, exports, module) { {start: {line: 1, ch: 8}, end: {line: 2, ch: 8}}], result = myEditor.convertToLineSelections(origSelections); expect(result.length).toBe(1); - expect(result[0].selectionForEdit.start).toEqual({line: 0, ch: 0}); - expect(result[0].selectionForEdit.end).toEqual({line: 3, ch: 0}); + expect(result[0].selectionForEdit.start.line).toEqual(0); + expect(result[0].selectionForEdit.start.ch).toEqual(0); + expect(result[0].selectionForEdit.end.line).toEqual(3); + expect(result[0].selectionForEdit.end.ch).toEqual(0); expect(result[0].selectionsToTrack.length).toBe(2); expect(result[0].selectionsToTrack[0]).toEqual(origSelections[0]); expect(result[0].selectionsToTrack[1]).toEqual(origSelections[1]); @@ -899,16 +1002,22 @@ define(function (require, exports, module) { {start: {line: 4, ch: 0}, end: {line: 5, ch: 0}}], result = myEditor.convertToLineSelections(origSelections, {mergeAdjacent: false}); expect(result.length).toBe(3); - expect(result[0].selectionForEdit.start).toEqual({line: 0, ch: 0}); - expect(result[0].selectionForEdit.end).toEqual({line: 1, ch: 0}); + expect(result[0].selectionForEdit.start.line).toEqual(0); + expect(result[0].selectionForEdit.start.ch).toEqual(0); + expect(result[0].selectionForEdit.end.line).toEqual(1); + expect(result[0].selectionForEdit.end.ch).toEqual(0); expect(result[0].selectionsToTrack.length).toBe(1); expect(result[0].selectionsToTrack[0]).toEqual(origSelections[0]); - expect(result[1].selectionForEdit.start).toEqual({line: 1, ch: 0}); - expect(result[1].selectionForEdit.end).toEqual({line: 2, ch: 0}); + expect(result[1].selectionForEdit.start.line).toEqual(1); + expect(result[1].selectionForEdit.start.ch).toEqual(0); + expect(result[1].selectionForEdit.end.line).toEqual(2); + expect(result[1].selectionForEdit.end.ch).toEqual(0); expect(result[1].selectionsToTrack.length).toBe(1); expect(result[1].selectionsToTrack[0]).toEqual(origSelections[1]); - expect(result[2].selectionForEdit.start).toEqual({line: 4, ch: 0}); - expect(result[2].selectionForEdit.end).toEqual({line: 5, ch: 0}); // not expanded since expandEndAtStartOfLine not set + expect(result[2].selectionForEdit.start.line).toEqual(4); + expect(result[2].selectionForEdit.start.ch).toEqual(0); + expect(result[2].selectionForEdit.end.line).toEqual(5); + expect(result[2].selectionForEdit.end.ch).toEqual(0); // not expanded since expandEndAtStartOfLine not set expect(result[2].selectionsToTrack.length).toBe(1); expect(result[2].selectionsToTrack[0]).toEqual(origSelections[2]); }); @@ -918,8 +1027,10 @@ define(function (require, exports, module) { {start: {line: 2, ch: 0}, end: {line: 3, ch: 0}}], result = myEditor.convertToLineSelections(origSelections, {expandEndAtStartOfLine: true}); expect(result.length).toBe(1); - expect(result[0].selectionForEdit.start).toEqual({line: 0, ch: 0}); - expect(result[0].selectionForEdit.end).toEqual({line: 4, ch: 0}); + expect(result[0].selectionForEdit.start.line).toEqual(0); + expect(result[0].selectionForEdit.start.ch).toEqual(0); + expect(result[0].selectionForEdit.end.line).toEqual(4); + expect(result[0].selectionForEdit.end.ch).toEqual(0); expect(result[0].selectionsToTrack.length).toBe(2); expect(result[0].selectionsToTrack[0]).toEqual(origSelections[0]); expect(result[0].selectionsToTrack[1]).toEqual(origSelections[1]); @@ -932,12 +1043,16 @@ define(function (require, exports, module) { {start: {line: 2, ch: 0}, end: {line: 3, ch: 0}}], result = myEditor.convertToLineSelections(origSelections, {expandEndAtStartOfLine: true, mergeAdjacent: false}); expect(result.length).toBe(2); - expect(result[0].selectionForEdit.start).toEqual({line: 0, ch: 0}); - expect(result[0].selectionForEdit.end).toEqual({line: 2, ch: 0}); + expect(result[0].selectionForEdit.start.line).toEqual(0); + expect(result[0].selectionForEdit.start.ch).toEqual(0); + expect(result[0].selectionForEdit.end.line).toEqual(2); + expect(result[0].selectionForEdit.end.ch).toEqual(0); expect(result[0].selectionsToTrack.length).toBe(1); expect(result[0].selectionsToTrack[0]).toEqual(origSelections[0]); - expect(result[1].selectionForEdit.start).toEqual({line: 2, ch: 0}); - expect(result[1].selectionForEdit.end).toEqual({line: 4, ch: 0}); + expect(result[1].selectionForEdit.start.line).toEqual(2); + expect(result[1].selectionForEdit.start.ch).toEqual(0); + expect(result[1].selectionForEdit.end.line).toEqual(4); + expect(result[1].selectionForEdit.end.ch).toEqual(0); expect(result[1].selectionsToTrack.length).toBe(1); expect(result[1].selectionsToTrack[0]).toEqual(origSelections[1]); }); @@ -948,8 +1063,10 @@ define(function (require, exports, module) { {start: {line: 2, ch: 8}, end: {line: 5, ch: 0}}], result = myEditor.convertToLineSelections(origSelections); expect(result.length).toBe(1); - expect(result[0].selectionForEdit.start).toEqual({line: 0, ch: 0}); - expect(result[0].selectionForEdit.end).toEqual({line: 5, ch: 0}); + expect(result[0].selectionForEdit.start.line).toEqual(0); + expect(result[0].selectionForEdit.start.ch).toEqual(0); + expect(result[0].selectionForEdit.end.line).toEqual(5); + expect(result[0].selectionForEdit.end.ch).toEqual(0); expect(result[0].selectionsToTrack.length).toBe(3); expect(result[0].selectionsToTrack[0]).toEqual(origSelections[0]); expect(result[0].selectionsToTrack[1]).toEqual(origSelections[1]); @@ -979,9 +1096,9 @@ define(function (require, exports, module) { myEditor._handleSoftTabNavigation(dir, command); if (Array.isArray(expectedSel)) { - expect(myEditor.getSelections()).toEqual(expectedSel); + expectSelections(expectedSel); } else { - expect(myEditor.getCursorPos()).toEqual(expectedSel); + expectCursorAt(expectedSel); } expect(myEditor.document.getText()).toEqual(expectedText); } @@ -1373,7 +1490,7 @@ define(function (require, exports, module) { makeEditor(content); myEditor.setCursorPos({line: 2, ch: 0}); myEditor._handleTabKey(); - expect(myEditor.getSelection()).toEqual({start: {line: 2, ch: 8}, end: {line: 2, ch: 8}, reversed: false}); + expectSelection({start: {line: 2, ch: 8}, end: {line: 2, ch: 8}, reversed: false}); var lines = content.split("\n"); lines[2] = " "; @@ -1389,7 +1506,7 @@ define(function (require, exports, module) { makeEditor(content, true); myEditor.setCursorPos({line: 2, ch: 0}); myEditor._handleTabKey(); - expect(myEditor.getSelection()).toEqual({start: {line: 2, ch: 2}, end: {line: 2, ch: 2}, reversed: false}); + expectSelection({start: {line: 2, ch: 2}, end: {line: 2, ch: 2}, reversed: false}); var lines = content.split("\n"); lines[2] = "\t\t"; @@ -1405,7 +1522,7 @@ define(function (require, exports, module) { makeEditor(content); myEditor.setCursorPos({line: 2, ch: 0}); myEditor._handleTabKey(); - expect(myEditor.getSelection()).toEqual({start: {line: 2, ch: 8}, end: {line: 2, ch: 8}, reversed: false}); + expectSelection({start: {line: 2, ch: 8}, end: {line: 2, ch: 8}, reversed: false}); expect(myEditor.document.getText()).toEqual(content); }); @@ -1419,7 +1536,7 @@ define(function (require, exports, module) { makeEditor(content, true); myEditor.setCursorPos({line: 2, ch: 0}); myEditor._handleTabKey(); - expect(myEditor.getSelection()).toEqual({start: {line: 2, ch: 2}, end: {line: 2, ch: 2}, reversed: false}); + expectSelection({start: {line: 2, ch: 2}, end: {line: 2, ch: 2}, reversed: false}); expect(myEditor.document.getText()).toEqual(content); }); @@ -1432,7 +1549,7 @@ define(function (require, exports, module) { makeEditor(content); myEditor.setCursorPos({line: 2, ch: 12}); myEditor._handleTabKey(); - expect(myEditor.getSelection()).toEqual({start: {line: 2, ch: 16}, end: {line: 2, ch: 16}, reversed: false}); + expectSelection({start: {line: 2, ch: 16}, end: {line: 2, ch: 16}, reversed: false}); var lines = content.split("\n"); lines[2] = " " + lines[2]; @@ -1449,7 +1566,7 @@ define(function (require, exports, module) { makeEditor(content, true); myEditor.setCursorPos({line: 2, ch: 3}); myEditor._handleTabKey(); - expect(myEditor.getSelection()).toEqual({start: {line: 2, ch: 4}, end: {line: 2, ch: 4}, reversed: false}); + expectSelection({start: {line: 2, ch: 4}, end: {line: 2, ch: 4}, reversed: false}); var lines = content.split("\n"); lines[2] = "\t" + lines[2]; @@ -1466,7 +1583,7 @@ define(function (require, exports, module) { makeEditor(content); myEditor.setCursorPos({line: 2, ch: 2}); myEditor._handleTabKey(); - expect(myEditor.getSelection()).toEqual({start: {line: 2, ch: 8}, end: {line: 2, ch: 8}, reversed: false}); + expectSelection({start: {line: 2, ch: 8}, end: {line: 2, ch: 8}, reversed: false}); var lines = content.split("\n"); lines[2] = " indentme();"; @@ -1482,7 +1599,7 @@ define(function (require, exports, module) { makeEditor(content, true); myEditor.setCursorPos({line: 2, ch: 0}); myEditor._handleTabKey(); - expect(myEditor.getSelection()).toEqual({start: {line: 2, ch: 2}, end: {line: 2, ch: 2}, reversed: false}); + expectSelection({start: {line: 2, ch: 2}, end: {line: 2, ch: 2}, reversed: false}); var lines = content.split("\n"); lines[2] = "\t\tindentme();"; @@ -1498,7 +1615,7 @@ define(function (require, exports, module) { makeEditor(content); myEditor.setCursorPos({line: 1, ch: 8}); myEditor._handleTabKey(); - expect(myEditor.getSelection()).toEqual({start: {line: 1, ch: 12}, end: {line: 1, ch: 12}, reversed: false}); + expectSelection({start: {line: 1, ch: 12}, end: {line: 1, ch: 12}, reversed: false}); var lines = content.split("\n"); lines[1] = " if (bar) {"; @@ -1514,7 +1631,7 @@ define(function (require, exports, module) { makeEditor(content, true); myEditor.setCursorPos({line: 1, ch: 2}); myEditor._handleTabKey(); - expect(myEditor.getSelection()).toEqual({start: {line: 1, ch: 3}, end: {line: 1, ch: 3}, reversed: false}); + expectSelection({start: {line: 1, ch: 3}, end: {line: 1, ch: 3}, reversed: false}); var lines = content.split("\n"); lines[1] = "\t\t\tif (bar) {"; @@ -1530,7 +1647,7 @@ define(function (require, exports, module) { makeEditor(content); myEditor.setCursorPos({line: 2, ch: 4}); myEditor._handleTabKey(); - expect(myEditor.getSelection()).toEqual({start: {line: 2, ch: 8}, end: {line: 2, ch: 8}, reversed: false}); + expectSelection({start: {line: 2, ch: 8}, end: {line: 2, ch: 8}, reversed: false}); expect(myEditor.document.getText()).toEqual(content); }); @@ -1543,7 +1660,7 @@ define(function (require, exports, module) { makeEditor(content, true); myEditor.setCursorPos({line: 2, ch: 1}); myEditor._handleTabKey(); - expect(myEditor.getSelection()).toEqual({start: {line: 2, ch: 2}, end: {line: 2, ch: 2}, reversed: false}); + expectSelection({start: {line: 2, ch: 2}, end: {line: 2, ch: 2}, reversed: false}); expect(myEditor.document.getText()).toEqual(content); }); @@ -1556,7 +1673,7 @@ define(function (require, exports, module) { makeEditor(content); myEditor.setCursorPos({line: 2, ch: 8}); myEditor._handleTabKey(); - expect(myEditor.getSelection()).toEqual({start: {line: 2, ch: 12}, end: {line: 2, ch: 12}, reversed: false}); + expectSelection({start: {line: 2, ch: 12}, end: {line: 2, ch: 12}, reversed: false}); var lines = content.split("\n"); lines[2] = " indentme();"; @@ -1572,7 +1689,7 @@ define(function (require, exports, module) { makeEditor(content, true); myEditor.setCursorPos({line: 2, ch: 2}); myEditor._handleTabKey(); - expect(myEditor.getSelection()).toEqual({start: {line: 2, ch: 3}, end: {line: 2, ch: 3}, reversed: false}); + expectSelection({start: {line: 2, ch: 3}, end: {line: 2, ch: 3}, reversed: false}); var lines = content.split("\n"); lines[2] = "\t\t\tindentme();"; @@ -1589,7 +1706,7 @@ define(function (require, exports, module) { makeEditor(content); myEditor.setSelection({line: 1, ch: 6}, {line: 3, ch: 3}); myEditor._handleTabKey(); - expect(myEditor.getSelection()).toEqual({start: {line: 1, ch: 10}, end: {line: 3, ch: 8}, reversed: false}); + expectSelection({start: {line: 1, ch: 10}, end: {line: 3, ch: 8}, reversed: false}); var lines = content.split("\n"); for (i = 1; i <= 3; i++) { @@ -1608,7 +1725,7 @@ define(function (require, exports, module) { makeEditor(content, true); myEditor.setSelection({line: 1, ch: 0}, {line: 3, ch: 1}); myEditor._handleTabKey(); - expect(myEditor.getSelection()).toEqual({start: {line: 1, ch: 0}, end: {line: 3, ch: 2}, reversed: false}); + expectSelection({start: {line: 1, ch: 0}, end: {line: 3, ch: 2}, reversed: false}); var lines = content.split("\n"); for (i = 1; i <= 3; i++) { @@ -1626,7 +1743,7 @@ define(function (require, exports, module) { makeEditor(content); myEditor.setSelection({line: 2, ch: 9}, {line: 2, ch: 9}); // should add three spaces to get to column 12 myEditor._handleTabKey(); - expect(myEditor.getSelection()).toEqual({start: {line: 2, ch: 12}, end: {line: 2, ch: 12}, reversed: false}); + expectSelection({start: {line: 2, ch: 12}, end: {line: 2, ch: 12}, reversed: false}); var lines = content.split("\n"); lines[2] = " inden tme();"; @@ -1642,7 +1759,7 @@ define(function (require, exports, module) { makeEditor(content, true); myEditor.setSelection({line: 2, ch: 5}, {line: 2, ch: 5}); myEditor._handleTabKey(); - expect(myEditor.getSelection()).toEqual({start: {line: 2, ch: 6}, end: {line: 2, ch: 6}, reversed: false}); + expectSelection({start: {line: 2, ch: 6}, end: {line: 2, ch: 6}, reversed: false}); var lines = content.split("\n"); lines[2] = "\tinde\tntme();"; @@ -1658,7 +1775,7 @@ define(function (require, exports, module) { makeEditor(content); myEditor.setSelection({line: 2, ch: 9}, {line: 2, ch: 14}); // should add three spaces to get to column 12 myEditor._handleTabKey(); - expect(myEditor.getSelection()).toEqual({start: {line: 2, ch: 12}, end: {line: 2, ch: 17}, reversed: false}); + expectSelection({start: {line: 2, ch: 12}, end: {line: 2, ch: 17}, reversed: false}); var lines = content.split("\n"); lines[2] = " inden tme();"; @@ -1674,7 +1791,7 @@ define(function (require, exports, module) { makeEditor(content, true); myEditor.setSelection({line: 2, ch: 5}, {line: 2, ch: 8}); myEditor._handleTabKey(); - expect(myEditor.getSelection()).toEqual({start: {line: 2, ch: 6}, end: {line: 2, ch: 9}, reversed: false}); + expectSelection({start: {line: 2, ch: 6}, end: {line: 2, ch: 9}, reversed: false}); var lines = content.split("\n"); lines[2] = "\tinde\tntme();"; @@ -1700,7 +1817,7 @@ define(function (require, exports, module) { myEditor.setSelections([{start: {line: 0, ch: 9}, end: {line: 0, ch: 9}, primary: true}, {start: {line: 2, ch: 6}, end: {line: 3, ch: 3}}]); myEditor._handleTabKey(); - expect(myEditor.getSelections()).toEqual([{start: {line: 0, ch: 13}, end: {line: 0, ch: 13}, primary: true, reversed: false}, + expectSelections([{start: {line: 0, ch: 13}, end: {line: 0, ch: 13}, primary: true, reversed: false}, {start: {line: 2, ch: 10}, end: {line: 3, ch: 8}, primary: false, reversed: false}]); var lines = content.split("\n"); @@ -1720,7 +1837,7 @@ define(function (require, exports, module) { myEditor.setSelections([{start: {line: 0, ch: 6}, end: {line: 0, ch: 6}, primary: true}, {start: {line: 2, ch: 3}, end: {line: 3, ch: 1}}]); myEditor._handleTabKey(); - expect(myEditor.getSelections()).toEqual([{start: {line: 0, ch: 7}, end: {line: 0, ch: 7}, primary: true, reversed: false}, + expectSelections([{start: {line: 0, ch: 7}, end: {line: 0, ch: 7}, primary: true, reversed: false}, {start: {line: 2, ch: 4}, end: {line: 3, ch: 2}, primary: false, reversed: false}]); var lines = content.split("\n"); @@ -1741,7 +1858,7 @@ define(function (require, exports, module) { {start: {line: 2, ch: 6}, end: {line: 2, ch: 6}}, {start: {line: 3, ch: 2}, end: {line: 3, ch: 2}}]); myEditor._handleTabKey(); - expect(myEditor.getSelections()).toEqual([{start: {line: 0, ch: 4}, end: {line: 0, ch: 4}, primary: false, reversed: false}, + expectSelections([{start: {line: 0, ch: 4}, end: {line: 0, ch: 4}, primary: false, reversed: false}, {start: {line: 2, ch: 8}, end: {line: 2, ch: 8}, primary: false, reversed: false}, {start: {line: 3, ch: 4}, end: {line: 3, ch: 4}, primary: true, reversed: false}]); @@ -1763,7 +1880,7 @@ define(function (require, exports, module) { {start: {line: 2, ch: 6}, end: {line: 2, ch: 6}}, {start: {line: 3, ch: 1}, end: {line: 3, ch: 1}}]); myEditor._handleTabKey(); - expect(myEditor.getSelections()).toEqual([{start: {line: 0, ch: 4}, end: {line: 0, ch: 4}, primary: false, reversed: false}, + expectSelections([{start: {line: 0, ch: 4}, end: {line: 0, ch: 4}, primary: false, reversed: false}, {start: {line: 2, ch: 7}, end: {line: 2, ch: 7}, primary: false, reversed: false}, {start: {line: 3, ch: 2}, end: {line: 3, ch: 2}, primary: true, reversed: false}]); @@ -1785,7 +1902,7 @@ define(function (require, exports, module) { {start: {line: 2, ch: 6}, end: {line: 2, ch: 9}}, {start: {line: 3, ch: 2}, end: {line: 3, ch: 4}}]); myEditor._handleTabKey(); - expect(myEditor.getSelections()).toEqual([{start: {line: 0, ch: 4}, end: {line: 0, ch: 7}, primary: false, reversed: false}, + expectSelections([{start: {line: 0, ch: 4}, end: {line: 0, ch: 7}, primary: false, reversed: false}, {start: {line: 2, ch: 8}, end: {line: 2, ch: 11}, primary: false, reversed: false}, {start: {line: 3, ch: 4}, end: {line: 3, ch: 6}, primary: true, reversed: false}]); @@ -1807,7 +1924,7 @@ define(function (require, exports, module) { {start: {line: 2, ch: 6}, end: {line: 2, ch: 9}}, {start: {line: 3, ch: 1}, end: {line: 3, ch: 2}}]); myEditor._handleTabKey(); - expect(myEditor.getSelections()).toEqual([{start: {line: 0, ch: 4}, end: {line: 0, ch: 7}, primary: false, reversed: false}, + expectSelections([{start: {line: 0, ch: 4}, end: {line: 0, ch: 7}, primary: false, reversed: false}, {start: {line: 2, ch: 7}, end: {line: 2, ch: 10}, primary: false, reversed: false}, {start: {line: 3, ch: 2}, end: {line: 3, ch: 3}, primary: true, reversed: false}]); @@ -1828,7 +1945,7 @@ define(function (require, exports, module) { myEditor.setSelections([{start: {line: 1, ch: 4}, end: {line: 1, ch: 4}, primary: true}, // should not move {start: {line: 2, ch: 4}, end: {line: 2, ch: 4}}]); // should get indented and move myEditor._handleTabKey(); - expect(myEditor.getSelections()).toEqual([{start: {line: 1, ch: 8}, end: {line: 1, ch: 8}, primary: true, reversed: false}, + expectSelections([{start: {line: 1, ch: 8}, end: {line: 1, ch: 8}, primary: true, reversed: false}, {start: {line: 2, ch: 8}, end: {line: 2, ch: 8}, primary: false, reversed: false}]); var lines = content.split("\n"); @@ -1847,7 +1964,7 @@ define(function (require, exports, module) { myEditor.setSelections([{start: {line: 1, ch: 1}, end: {line: 1, ch: 1}, primary: true}, // should not move {start: {line: 2, ch: 1}, end: {line: 2, ch: 1}}]); // should get indented and move myEditor._handleTabKey(); - expect(myEditor.getSelections()).toEqual([{start: {line: 1, ch: 2}, end: {line: 1, ch: 2}, primary: true, reversed: false}, + expectSelections([{start: {line: 1, ch: 2}, end: {line: 1, ch: 2}, primary: true, reversed: false}, {start: {line: 2, ch: 2}, end: {line: 2, ch: 2}, primary: false, reversed: false}]); var lines = content.split("\n"); @@ -1866,7 +1983,7 @@ define(function (require, exports, module) { myEditor.setSelections([{start: {line: 1, ch: 2}, end: {line: 1, ch: 2}, primary: true}, // should not move {start: {line: 2, ch: 2}, end: {line: 2, ch: 2}}]); // should get indented and move myEditor._handleTabKey(); - expect(myEditor.getSelections()).toEqual([{start: {line: 1, ch: 4}, end: {line: 1, ch: 4}, primary: true, reversed: false}, + expectSelections([{start: {line: 1, ch: 4}, end: {line: 1, ch: 4}, primary: true, reversed: false}, {start: {line: 2, ch: 8}, end: {line: 2, ch: 8}, primary: false, reversed: false}]); var lines = content.split("\n"); @@ -1884,7 +2001,7 @@ define(function (require, exports, module) { myEditor.setSelections([{start: {line: 1, ch: 0}, end: {line: 1, ch: 0}, primary: true}, // should not move {start: {line: 2, ch: 0}, end: {line: 2, ch: 0}}]); // should get indented and move myEditor._handleTabKey(); - expect(myEditor.getSelections()).toEqual([{start: {line: 1, ch: 1}, end: {line: 1, ch: 1}, primary: true, reversed: false}, + expectSelections([{start: {line: 1, ch: 1}, end: {line: 1, ch: 1}, primary: true, reversed: false}, {start: {line: 2, ch: 2}, end: {line: 2, ch: 2}, primary: false, reversed: false}]); var lines = content.split("\n"); @@ -1902,7 +2019,7 @@ define(function (require, exports, module) { myEditor.setSelections([{start: {line: 1, ch: 4}, end: {line: 1, ch: 4}}, {start: {line: 2, ch: 8}, end: {line: 2, ch: 8}}]); myEditor._handleTabKey(); - expect(myEditor.getSelections()).toEqual([{start: {line: 1, ch: 8}, end: {line: 1, ch: 8}, primary: false, reversed: false}, + expectSelections([{start: {line: 1, ch: 8}, end: {line: 1, ch: 8}, primary: false, reversed: false}, {start: {line: 2, ch: 12}, end: {line: 2, ch: 12}, primary: true, reversed: false}]); var lines = content.split("\n"); @@ -1921,7 +2038,7 @@ define(function (require, exports, module) { myEditor.setSelections([{start: {line: 1, ch: 1}, end: {line: 1, ch: 1}}, {start: {line: 2, ch: 2}, end: {line: 2, ch: 2}}]); myEditor._handleTabKey(); - expect(myEditor.getSelections()).toEqual([{start: {line: 1, ch: 2}, end: {line: 1, ch: 2}, primary: false, reversed: false}, + expectSelections([{start: {line: 1, ch: 2}, end: {line: 1, ch: 2}, primary: false, reversed: false}, {start: {line: 2, ch: 3}, end: {line: 2, ch: 3}, primary: true, reversed: false}]); var lines = content.split("\n"); diff --git a/test/spec/EditorCommandHandlers-test.js b/test/spec/EditorCommandHandlers-test.js index 562c0f53509..52737ced36b 100644 --- a/test/spec/EditorCommandHandlers-test.js +++ b/test/spec/EditorCommandHandlers-test.js @@ -91,21 +91,37 @@ define(function (require, exports, module) { } }); - // Helper functions for testing cursor position / selection range + function fixPos(pos) { + if (!("sticky" in pos)) { + pos.sticky = null; + } + return pos; + } + function fixSel(sel) { + fixPos(sel.start); + fixPos(sel.end); + if (!("reversed" in sel)) { + sel.reversed = false; + } + return sel; + } + function fixSels(sels) { + sels.forEach(function (sel) { + fixSel(sel); + }); + return sels; + } function expectCursorAt(pos) { var selection = myEditor.getSelection(); expect(selection.start).toEqual(selection.end); - expect(selection.start).toEqual(pos); + expect(fixPos(selection.start)).toEqual(fixPos(pos)); } function expectSelection(sel) { - if (!sel.reversed) { - sel.reversed = false; - } - expect(myEditor.getSelection()).toEqual(sel); + expect(fixSel(myEditor.getSelection())).toEqual(fixSel(sel)); } function expectSelections(sels) { - expect(myEditor.getSelections()).toEqual(sels); + expect(fixSels(myEditor.getSelections())).toEqual(fixSels(sels)); } function contentWithDeletedLines(lineNums) { var lines = defaultContent.split("\n"); @@ -1022,8 +1038,10 @@ define(function (require, exports, module) { CommandManager.execute(Commands.EDIT_LINE_COMMENT, myEditor); expect(myDocument.getText()).toEqual(defaultContent); - expect(myEditor.getSelections()).toEqual([{start: {line: 1, ch: 4}, end: {line: 1, ch: 4}, reversed: false, primary: false}, - {start: {line: 3, ch: 4}, end: {line: 3, ch: 4}, reversed: false, primary: true}]); + expectSelections([ + {start: {line: 1, ch: 4}, end: {line: 1, ch: 4}, reversed: false, primary: false}, + {start: {line: 3, ch: 4}, end: {line: 3, ch: 4}, reversed: false, primary: true} + ]); }); it("should properly restore the range selections", function () { @@ -1033,8 +1051,10 @@ define(function (require, exports, module) { CommandManager.execute(Commands.EDIT_LINE_COMMENT, myEditor); expect(myDocument.getText()).toEqual(defaultContent); - expect(myEditor.getSelections()).toEqual([{start: {line: 1, ch: 4}, end: {line: 1, ch: 6}, reversed: false, primary: false}, - {start: {line: 3, ch: 4}, end: {line: 3, ch: 6}, reversed: false, primary: true}]); + expectSelections([ + {start: {line: 1, ch: 4}, end: {line: 1, ch: 6}, reversed: false, primary: false}, + {start: {line: 3, ch: 4}, end: {line: 3, ch: 6}, reversed: false, primary: true} + ]); }); it("should properly restore primary/reversed range selections", function () { @@ -1044,8 +1064,10 @@ define(function (require, exports, module) { CommandManager.execute(Commands.EDIT_LINE_COMMENT, myEditor); expect(myDocument.getText()).toEqual(defaultContent); - expect(myEditor.getSelections()).toEqual([{start: {line: 1, ch: 4}, end: {line: 1, ch: 4}, reversed: false, primary: true}, - {start: {line: 3, ch: 4}, end: {line: 3, ch: 12}, reversed: true, primary: false}]); + expectSelections([ + {start: {line: 1, ch: 4}, end: {line: 1, ch: 4}, reversed: false, primary: true}, + {start: {line: 3, ch: 4}, end: {line: 3, ch: 12}, reversed: true, primary: false} + ]); }); }); @@ -1460,8 +1482,10 @@ define(function (require, exports, module) { lines.splice(1, 0, "*/"); lines.splice(0, 0, "/*"); expect(myDocument.getText()).toEqual(lines.join("\n")); - expect(myEditor.getSelections()).toEqual([{start: {line: 1, ch: 0}, end: {line: 2, ch: 0}, primary: false, reversed: false}, - {start: {line: 6, ch: 0}, end: {line: 6, ch: 18}, primary: true, reversed: true}]); + expectSelections([ + {start: {line: 1, ch: 0}, end: {line: 2, ch: 0}, primary: false, reversed: false}, + {start: {line: 6, ch: 0}, end: {line: 6, ch: 18}, primary: true, reversed: true} + ]); }); }); }); @@ -3381,9 +3405,11 @@ define(function (require, exports, module) { CommandManager.execute(Commands.EDIT_DELETE_LINES, myEditor); expect(myDocument.getText()).toEqual(contentWithDeletedLines([0, 2, 6])); - expect(myEditor.getSelections()).toEqual([{start: {line: 0, ch: 0}, end: {line: 0, ch: 0}, primary: false, reversed: false}, - {start: {line: 1, ch: 0}, end: {line: 1, ch: 0}, primary: false, reversed: false}, - {start: {line: 4, ch: 0}, end: {line: 4, ch: 0}, primary: true, reversed: false}]); + expectSelections([ + {start: {line: 0, ch: 0}, end: {line: 0, ch: 0}, primary: false, reversed: false}, + {start: {line: 1, ch: 0}, end: {line: 1, ch: 0}, primary: false, reversed: false}, + {start: {line: 4, ch: 0}, end: {line: 4, ch: 0}, primary: true, reversed: false} + ]); }); it("should delete lines containing any range in a multiple selection", function () { @@ -3393,9 +3419,11 @@ define(function (require, exports, module) { CommandManager.execute(Commands.EDIT_DELETE_LINES, myEditor); expect(myDocument.getText()).toEqual(contentWithDeletedLines([0, 2, 6])); - expect(myEditor.getSelections()).toEqual([{start: {line: 0, ch: 0}, end: {line: 0, ch: 0}, primary: false, reversed: false}, - {start: {line: 1, ch: 0}, end: {line: 1, ch: 0}, primary: false, reversed: false}, - {start: {line: 4, ch: 0}, end: {line: 4, ch: 0}, primary: true, reversed: false}]); + expectSelections([ + {start: {line: 0, ch: 0}, end: {line: 0, ch: 0}, primary: false, reversed: false}, + {start: {line: 1, ch: 0}, end: {line: 1, ch: 0}, primary: false, reversed: false}, + {start: {line: 4, ch: 0}, end: {line: 4, ch: 0}, primary: true, reversed: false} + ]); }); it("should handle multiple cursors/selections on the same line (only deleting the line once)", function () { @@ -3406,9 +3434,11 @@ define(function (require, exports, module) { CommandManager.execute(Commands.EDIT_DELETE_LINES, myEditor); expect(myDocument.getText()).toEqual(contentWithDeletedLines([0, 2, 6])); - expect(myEditor.getSelections()).toEqual([{start: {line: 0, ch: 0}, end: {line: 0, ch: 0}, primary: false, reversed: false}, - {start: {line: 1, ch: 0}, end: {line: 1, ch: 0}, primary: false, reversed: false}, - {start: {line: 4, ch: 0}, end: {line: 4, ch: 0}, primary: true, reversed: false}]); + expectSelections([ + {start: {line: 0, ch: 0}, end: {line: 0, ch: 0}, primary: false, reversed: false}, + {start: {line: 1, ch: 0}, end: {line: 1, ch: 0}, primary: false, reversed: false}, + {start: {line: 4, ch: 0}, end: {line: 4, ch: 0}, primary: true, reversed: false} + ]); }); it("should handle multiple selections that span multiple lines", function () { @@ -3417,8 +3447,10 @@ define(function (require, exports, module) { CommandManager.execute(Commands.EDIT_DELETE_LINES, myEditor); expect(myDocument.getText()).toEqual(contentWithDeletedLines([0, 1, 3, 4])); - expect(myEditor.getSelections()).toEqual([{start: {line: 0, ch: 0}, end: {line: 0, ch: 0}, primary: false, reversed: false}, - {start: {line: 1, ch: 0}, end: {line: 1, ch: 0}, primary: true, reversed: false}]); + expectSelections([ + {start: {line: 0, ch: 0}, end: {line: 0, ch: 0}, primary: false, reversed: false}, + {start: {line: 1, ch: 0}, end: {line: 1, ch: 0}, primary: true, reversed: false} + ]); }); it("should delete the rest of a selection that starts on a line previously deleted", function () { @@ -3427,7 +3459,9 @@ define(function (require, exports, module) { CommandManager.execute(Commands.EDIT_DELETE_LINES, myEditor); expect(myDocument.getText()).toEqual(contentWithDeletedLines([0, 1, 2, 3])); - expect(myEditor.getSelections()).toEqual([{start: {line: 0, ch: 0}, end: {line: 0, ch: 0}, primary: true, reversed: false}]); + expectSelections([ + {start: {line: 0, ch: 0}, end: {line: 0, ch: 0}, primary: true, reversed: false} + ]); }); it("should merge the primary selection into another selection on the same line", function () { @@ -3438,9 +3472,11 @@ define(function (require, exports, module) { CommandManager.execute(Commands.EDIT_DELETE_LINES, myEditor); expect(myDocument.getText()).toEqual(contentWithDeletedLines([0, 2, 6])); - expect(myEditor.getSelections()).toEqual([{start: {line: 0, ch: 0}, end: {line: 0, ch: 0}, primary: false, reversed: false}, - {start: {line: 1, ch: 0}, end: {line: 1, ch: 0}, primary: true, reversed: false}, - {start: {line: 4, ch: 0}, end: {line: 4, ch: 0}, primary: false, reversed: false}]); + expectSelections([ + {start: {line: 0, ch: 0}, end: {line: 0, ch: 0}, primary: false, reversed: false}, + {start: {line: 1, ch: 0}, end: {line: 1, ch: 0}, primary: true, reversed: false}, + {start: {line: 4, ch: 0}, end: {line: 4, ch: 0}, primary: false, reversed: false} + ]); }); }); }); @@ -3503,9 +3539,11 @@ define(function (require, exports, module) { CommandManager.execute(Commands.EDIT_DELETE_LINES, myEditor); expect(myDocument.getText()).toEqual(contentWithDeletedLines([1, 3, 6])); - expect(myEditor.getSelections()).toEqual([{start: {line: 1, ch: 0}, end: {line: 1, ch: 0}, primary: false, reversed: false}, - {start: {line: 2, ch: 0}, end: {line: 2, ch: 0}, primary: false, reversed: false}, - {start: {line: 3, ch: 5}, end: {line: 3, ch: 5}, primary: true, reversed: false}]); + expectSelections([ + {start: {line: 1, ch: 0}, end: {line: 1, ch: 0}, primary: false, reversed: false}, + {start: {line: 2, ch: 0}, end: {line: 2, ch: 0}, primary: false, reversed: false}, + {start: {line: 3, ch: 5}, end: {line: 3, ch: 5}, primary: true, reversed: false} + ]); }); }); @@ -4212,9 +4250,10 @@ define(function (require, exports, module) { }); runs(function () { selection = myEditor.getSelection(); - expect(selection).toEqual({start: {line: 0, ch: 9}, - end: {line: 0, ch: 15}, - reversed: false}); + expect(fixSel(selection)).toEqual(fixSel({ + start: {line: 0, ch: 9}, + end: {line: 0, ch: 15} + })); }); }); }); diff --git a/test/spec/EditorOptionHandlers-test.js b/test/spec/EditorOptionHandlers-test.js index db44a7cbd8f..a3bd93a5c05 100644 --- a/test/spec/EditorOptionHandlers-test.js +++ b/test/spec/EditorOptionHandlers-test.js @@ -82,6 +82,21 @@ define(function (require, exports, module) { testWindow.closeAllFiles(); }); + // Helper functions for testing cursor position / selection range + function fixPos(pos) { + if (!("sticky" in pos)) { + pos.sticky = null; + } + return pos; + } + function fixSel(sel) { + fixPos(sel.start); + fixPos(sel.end); + if (!("reversed" in sel)) { + sel.reversed = false; + } + return sel; + } function checkLineWrapping(editor, firstPos, secondPos, shouldWrap) { runs(function () { @@ -419,7 +434,7 @@ define(function (require, exports, module) { checkCloseBraces(editor, {line: 0, ch: 16}, null, CLOSE_BRACKET, "var myContent =[] \"This is awesome!\";"); runs(function () { - expect(editor.getCursorPos()).toEqual({line: 0, ch: 17}); + expect(fixPos(editor.getCursorPos())).toEqual(fixPos({line: 0, ch: 17})); }); }); }); @@ -432,7 +447,7 @@ define(function (require, exports, module) { checkCloseBraces(editor, {line: 0, ch: 16}, {line: 0, ch: 34}, OPEN_BRACKET, "var myContent = [\"This is awesome!\"];"); runs(function () { - expect(editor.getSelection()).toEqual({start: {line: 0, ch: 17}, end: {line: 0, ch: 35}, reversed: false}); + expect(fixSel(editor.getSelection())).toEqual(fixSel({start: {line: 0, ch: 17}, end: {line: 0, ch: 35}})); }); }); }); diff --git a/test/spec/FindReplace-test.js b/test/spec/FindReplace-test.js index c0602fcd19e..cdd73d2e2dc 100644 --- a/test/spec/FindReplace-test.js +++ b/test/spec/FindReplace-test.js @@ -48,6 +48,28 @@ define(function (require, exports, module) { "\n" + "}"; + // Helper functions for testing cursor position / selection range + function fixPos(pos) { + if (!("sticky" in pos)) { + pos.sticky = null; + } + return pos; + } + function fixSel(sel) { + fixPos(sel.start); + fixPos(sel.end); + if (!("reversed" in sel)) { + sel.reversed = false; + } + return sel; + } + function fixSels(sels) { + sels.forEach(function (sel) { + fixSel(sel); + }); + return sels; + } + describe("FindReplace - Unit", function () { var editor, doc; @@ -104,59 +126,74 @@ define(function (require, exports, module) { it("should do nothing if the cursor is in non-word/whitespace", function () { editor.setSelection({line: 8, ch: 4}); FindReplace._expandWordAndAddNextToSelection(editor); - expect(editor.getSelections()).toEqual([{start: {line: 8, ch: 4}, end: {line: 8, ch: 4}, primary: true, reversed: false}]); + expect(editor.getSelections()).toEqual(fixSels([ + {start: {line: 8, ch: 4}, end: {line: 8, ch: 4}, primary: true, reversed: false} + ])); }); it("should expand a single cursor to the containing word without adding a new selection", function () { editor.setSelection({line: 2, ch: 26}); FindReplace._expandWordAndAddNextToSelection(editor); - expect(editor.getSelections()).toEqual([{start: {line: 2, ch: 23}, end: {line: 2, ch: 30}, primary: true, reversed: false}]); + expect(editor.getSelections()).toEqual(fixSels([ + {start: {line: 2, ch: 23}, end: {line: 2, ch: 30}, primary: true, reversed: false} + ])); }); it("should add the next match for a single word selection as a new primary selection", function () { editor.setSelection({line: 2, ch: 23}, {line: 2, ch: 30}); FindReplace._expandWordAndAddNextToSelection(editor); - expect(editor.getSelections()).toEqual([{start: {line: 2, ch: 23}, end: {line: 2, ch: 30}, primary: false, reversed: false}, - {start: {line: 3, ch: 23}, end: {line: 3, ch: 30}, primary: true, reversed: false}]); + expect(editor.getSelections()).toEqual(fixSels([ + {start: {line: 2, ch: 23}, end: {line: 2, ch: 30}, primary: false, reversed: false}, + {start: {line: 3, ch: 23}, end: {line: 3, ch: 30}, primary: true, reversed: false} + ])); }); it("should add the next match for an existing range that isn't actually a word", function () { editor.setSelection({line: 2, ch: 14}, {line: 2, ch: 22}); // "require(" FindReplace._expandWordAndAddNextToSelection(editor); - expect(editor.getSelections()).toEqual([{start: {line: 2, ch: 14}, end: {line: 2, ch: 22}, primary: false, reversed: false}, - {start: {line: 3, ch: 14}, end: {line: 3, ch: 22}, primary: true, reversed: false}]); + expect(editor.getSelections()).toEqual(fixSels([ + {start: {line: 2, ch: 14}, end: {line: 2, ch: 22}, primary: false, reversed: false}, + {start: {line: 3, ch: 14}, end: {line: 3, ch: 22}, primary: true, reversed: false} + ])); }); it("should find the next match case-insensitively", function () { editor.setSelection({line: 6, ch: 17}, {line: 6, ch: 20}); // "Foo" in "callFoo" - should next find "foo" in "foo()" FindReplace._expandWordAndAddNextToSelection(editor); - expect(editor.getSelections()).toEqual([{start: {line: 6, ch: 17}, end: {line: 6, ch: 20}, primary: false, reversed: false}, - {start: {line: 8, ch: 8}, end: {line: 8, ch: 11}, primary: true, reversed: false}]); - + expect(editor.getSelections()).toEqual(fixSels([ + {start: {line: 6, ch: 17}, end: {line: 6, ch: 20}, primary: false, reversed: false}, + {start: {line: 8, ch: 8}, end: {line: 8, ch: 11}, primary: true, reversed: false} + ])); }); it("should expand two cursors without adding a new selection", function () { editor.setSelections([{start: {line: 2, ch: 26}, end: {line: 2, ch: 26}}, {start: {line: 3, ch: 16}, end: {line: 3, ch: 16}}]); FindReplace._expandWordAndAddNextToSelection(editor); - expect(editor.getSelections()).toEqual([{start: {line: 2, ch: 23}, end: {line: 2, ch: 30}, primary: false, reversed: false}, - {start: {line: 3, ch: 14}, end: {line: 3, ch: 21}, primary: true, reversed: false}]); + expect(editor.getSelections()).toEqual(fixSels([ + {start: {line: 2, ch: 23}, end: {line: 2, ch: 30}, primary: false, reversed: false}, + {start: {line: 3, ch: 14}, end: {line: 3, ch: 21}, primary: true, reversed: false} + ])); }); it("should, when one cursor and one range are selected, expand the cursor and add the next match for the range to the selection", function () { editor.setSelections([{start: {line: 2, ch: 26}, end: {line: 2, ch: 26}}, {start: {line: 3, ch: 14}, end: {line: 3, ch: 21}}]); // "require" FindReplace._expandWordAndAddNextToSelection(editor); - expect(editor.getSelections()).toEqual([{start: {line: 2, ch: 23}, end: {line: 2, ch: 30}, primary: false, reversed: false}, - {start: {line: 3, ch: 14}, end: {line: 3, ch: 21}, primary: false, reversed: false}, - {start: {line: 4, ch: 14}, end: {line: 4, ch: 21}, primary: true, reversed: false}]); + expect(editor.getSelections()).toEqual(fixSels([ + {start: {line: 2, ch: 23}, end: {line: 2, ch: 30}, primary: false, reversed: false}, + {start: {line: 3, ch: 14}, end: {line: 3, ch: 21}, primary: false, reversed: false}, + {start: {line: 4, ch: 14}, end: {line: 4, ch: 21}, primary: true, reversed: false} + ])); }); it("should wrap around the end of the document and add the next instance at the beginning of the document", function () { editor.setSelection({line: 4, ch: 14}, {line: 4, ch: 21}); // "require" FindReplace._expandWordAndAddNextToSelection(editor); - expect(editor.getSelections()).toEqual([{start: {line: 1, ch: 17}, end: {line: 1, ch: 24}, primary: true, reversed: false}, - {start: {line: 4, ch: 14}, end: {line: 4, ch: 21}, primary: false, reversed: false}]); + expect(editor.getSelections()).toEqual(fixSels([ + {start: {line: 1, ch: 17}, end: {line: 1, ch: 24}, primary: true, reversed: false}, + {start: {line: 4, ch: 14}, end: {line: 4, ch: 21}, primary: false, reversed: false} + ])); }); it("should skip over matches that are already in the selection", function () { @@ -165,10 +202,12 @@ define(function (require, exports, module) { {start: {line: 3, ch: 14}, end: {line: 3, ch: 21}}, {start: {line: 4, ch: 14}, end: {line: 4, ch: 21}}]); FindReplace._expandWordAndAddNextToSelection(editor); - expect(editor.getSelections()).toEqual([{start: {line: 1, ch: 17}, end: {line: 1, ch: 24}, primary: false, reversed: false}, - {start: {line: 2, ch: 14}, end: {line: 2, ch: 21}, primary: true, reversed: false}, - {start: {line: 3, ch: 14}, end: {line: 3, ch: 21}, primary: false, reversed: false}, - {start: {line: 4, ch: 14}, end: {line: 4, ch: 21}, primary: false, reversed: false}]); + expect(editor.getSelections()).toEqual(fixSels([ + {start: {line: 1, ch: 17}, end: {line: 1, ch: 24}, primary: false, reversed: false}, + {start: {line: 2, ch: 14}, end: {line: 2, ch: 21}, primary: true, reversed: false}, + {start: {line: 3, ch: 14}, end: {line: 3, ch: 21}, primary: false, reversed: false}, + {start: {line: 4, ch: 14}, end: {line: 4, ch: 21}, primary: false, reversed: false} + ])); }); it("should do nothing if all instances are already selected", function () { @@ -177,10 +216,12 @@ define(function (require, exports, module) { {start: {line: 3, ch: 14}, end: {line: 3, ch: 21}}, {start: {line: 4, ch: 14}, end: {line: 4, ch: 21}}]); FindReplace._expandWordAndAddNextToSelection(editor); - expect(editor.getSelections()).toEqual([{start: {line: 1, ch: 17}, end: {line: 1, ch: 24}, primary: false, reversed: false}, - {start: {line: 2, ch: 14}, end: {line: 2, ch: 21}, primary: false, reversed: false}, - {start: {line: 3, ch: 14}, end: {line: 3, ch: 21}, primary: false, reversed: false}, - {start: {line: 4, ch: 14}, end: {line: 4, ch: 21}, primary: true, reversed: false}]); + expect(editor.getSelections()).toEqual(fixSels([ + {start: {line: 1, ch: 17}, end: {line: 1, ch: 24}, primary: false, reversed: false}, + {start: {line: 2, ch: 14}, end: {line: 2, ch: 21}, primary: false, reversed: false}, + {start: {line: 3, ch: 14}, end: {line: 3, ch: 21}, primary: false, reversed: false}, + {start: {line: 4, ch: 14}, end: {line: 4, ch: 21}, primary: true, reversed: false} + ])); }); }); @@ -188,27 +229,35 @@ define(function (require, exports, module) { it("should remove a single range selection and select the next instance", function () { editor.setSelection({line: 2, ch: 23}, {line: 2, ch: 30}); FindReplace._expandWordAndAddNextToSelection(editor, true); - expect(editor.getSelections()).toEqual([{start: {line: 3, ch: 23}, end: {line: 3, ch: 30}, primary: true, reversed: false}]); + expect(editor.getSelections()).toEqual(fixSels([ + {start: {line: 3, ch: 23}, end: {line: 3, ch: 30}, primary: true, reversed: false} + ])); }); it("should expand a single cursor to a range, then change the selection to the next instance of that range", function () { editor.setSelection({line: 2, ch: 26}, {line: 2, ch: 26}); FindReplace._expandWordAndAddNextToSelection(editor, true); - expect(editor.getSelections()).toEqual([{start: {line: 3, ch: 23}, end: {line: 3, ch: 30}, primary: true, reversed: false}]); + expect(editor.getSelections()).toEqual(fixSels([ + {start: {line: 3, ch: 23}, end: {line: 3, ch: 30}, primary: true, reversed: false} + ])); }); it("should, when one cursor and one range are selected, expand the cursor and change the range selection to its next match", function () { editor.setSelections([{start: {line: 2, ch: 26}, end: {line: 2, ch: 26}}, {start: {line: 3, ch: 14}, end: {line: 3, ch: 21}}]); // "require" FindReplace._expandWordAndAddNextToSelection(editor, true); - expect(editor.getSelections()).toEqual([{start: {line: 2, ch: 23}, end: {line: 2, ch: 30}, primary: false, reversed: false}, - {start: {line: 4, ch: 14}, end: {line: 4, ch: 21}, primary: true, reversed: false}]); + expect(editor.getSelections()).toEqual(fixSels([ + {start: {line: 2, ch: 23}, end: {line: 2, ch: 30}, primary: false, reversed: false}, + {start: {line: 4, ch: 14}, end: {line: 4, ch: 21}, primary: true, reversed: false} + ])); }); it("should wrap around the end of the document and switch to the next instance at the beginning of the document", function () { editor.setSelection({line: 4, ch: 14}, {line: 4, ch: 21}); // "require" FindReplace._expandWordAndAddNextToSelection(editor, true); - expect(editor.getSelections()).toEqual([{start: {line: 1, ch: 17}, end: {line: 1, ch: 24}, primary: true, reversed: false}]); + expect(editor.getSelections()).toEqual(fixSels([ + {start: {line: 1, ch: 17}, end: {line: 1, ch: 24}, primary: true, reversed: false} + ])); }); it("should skip over matches that are already in the selection (but still remove the current one)", function () { @@ -217,9 +266,11 @@ define(function (require, exports, module) { {start: {line: 3, ch: 14}, end: {line: 3, ch: 21}}, {start: {line: 4, ch: 14}, end: {line: 4, ch: 21}}]); FindReplace._expandWordAndAddNextToSelection(editor, true); - expect(editor.getSelections()).toEqual([{start: {line: 1, ch: 17}, end: {line: 1, ch: 24}, primary: false, reversed: false}, - {start: {line: 2, ch: 14}, end: {line: 2, ch: 21}, primary: true, reversed: false}, - {start: {line: 3, ch: 14}, end: {line: 3, ch: 21}, primary: false, reversed: false}]); + expect(editor.getSelections()).toEqual(fixSels([ + {start: {line: 1, ch: 17}, end: {line: 1, ch: 24}, primary: false, reversed: false}, + {start: {line: 2, ch: 14}, end: {line: 2, ch: 21}, primary: true, reversed: false}, + {start: {line: 3, ch: 14}, end: {line: 3, ch: 21}, primary: false, reversed: false} + ])); }); it("should just remove the primary selection if all instances are already selected", function () { @@ -228,9 +279,11 @@ define(function (require, exports, module) { {start: {line: 3, ch: 14}, end: {line: 3, ch: 21}}, {start: {line: 4, ch: 14}, end: {line: 4, ch: 21}}]); FindReplace._expandWordAndAddNextToSelection(editor, true); - expect(editor.getSelections()).toEqual([{start: {line: 1, ch: 17}, end: {line: 1, ch: 24}, primary: false, reversed: false}, - {start: {line: 2, ch: 14}, end: {line: 2, ch: 21}, primary: false, reversed: false}, - {start: {line: 3, ch: 14}, end: {line: 3, ch: 21}, primary: true, reversed: false}]); + expect(editor.getSelections()).toEqual(fixSels([ + {start: {line: 1, ch: 17}, end: {line: 1, ch: 24}, primary: false, reversed: false}, + {start: {line: 2, ch: 14}, end: {line: 2, ch: 21}, primary: false, reversed: false}, + {start: {line: 3, ch: 14}, end: {line: 3, ch: 21}, primary: true, reversed: false} + ])); }); }); @@ -238,55 +291,67 @@ define(function (require, exports, module) { it("should find all instances of a selected range when first instance is selected, keeping it primary", function () { editor.setSelection({line: 1, ch: 17}, {line: 1, ch: 24}); FindReplace._findAllAndSelect(editor); - expect(editor.getSelections()).toEqual([{start: {line: 1, ch: 17}, end: {line: 1, ch: 24}, primary: true, reversed: false}, - {start: {line: 2, ch: 14}, end: {line: 2, ch: 21}, primary: false, reversed: false}, - {start: {line: 3, ch: 14}, end: {line: 3, ch: 21}, primary: false, reversed: false}, - {start: {line: 4, ch: 14}, end: {line: 4, ch: 21}, primary: false, reversed: false}]); + expect(editor.getSelections()).toEqual(fixSels([ + {start: {line: 1, ch: 17}, end: {line: 1, ch: 24}, primary: true, reversed: false}, + {start: {line: 2, ch: 14}, end: {line: 2, ch: 21}, primary: false, reversed: false}, + {start: {line: 3, ch: 14}, end: {line: 3, ch: 21}, primary: false, reversed: false}, + {start: {line: 4, ch: 14}, end: {line: 4, ch: 21}, primary: false, reversed: false} + ])); }); it("should find all instances of a selected range when instance other than first is selected, keeping it primary", function () { editor.setSelection({line: 3, ch: 14}, {line: 3, ch: 21}); FindReplace._findAllAndSelect(editor); - expect(editor.getSelections()).toEqual([{start: {line: 1, ch: 17}, end: {line: 1, ch: 24}, primary: false, reversed: false}, - {start: {line: 2, ch: 14}, end: {line: 2, ch: 21}, primary: false, reversed: false}, - {start: {line: 3, ch: 14}, end: {line: 3, ch: 21}, primary: true, reversed: false}, - {start: {line: 4, ch: 14}, end: {line: 4, ch: 21}, primary: false, reversed: false}]); + expect(editor.getSelections()).toEqual(fixSels([ + {start: {line: 1, ch: 17}, end: {line: 1, ch: 24}, primary: false, reversed: false}, + {start: {line: 2, ch: 14}, end: {line: 2, ch: 21}, primary: false, reversed: false}, + {start: {line: 3, ch: 14}, end: {line: 3, ch: 21}, primary: true, reversed: false}, + {start: {line: 4, ch: 14}, end: {line: 4, ch: 21}, primary: false, reversed: false} + ])); }); it("should throw away selections other than the primary selection", function () { editor.setSelections([{start: {line: 3, ch: 14}, end: {line: 3, ch: 21}, primary: true}, {start: {line: 6, ch: 4}, end: {line: 6, ch: 6}}]); FindReplace._findAllAndSelect(editor); - expect(editor.getSelections()).toEqual([{start: {line: 1, ch: 17}, end: {line: 1, ch: 24}, primary: false, reversed: false}, - {start: {line: 2, ch: 14}, end: {line: 2, ch: 21}, primary: false, reversed: false}, - {start: {line: 3, ch: 14}, end: {line: 3, ch: 21}, primary: true, reversed: false}, - {start: {line: 4, ch: 14}, end: {line: 4, ch: 21}, primary: false, reversed: false}]); + expect(editor.getSelections()).toEqual(fixSels([ + {start: {line: 1, ch: 17}, end: {line: 1, ch: 24}, primary: false, reversed: false}, + {start: {line: 2, ch: 14}, end: {line: 2, ch: 21}, primary: false, reversed: false}, + {start: {line: 3, ch: 14}, end: {line: 3, ch: 21}, primary: true, reversed: false}, + {start: {line: 4, ch: 14}, end: {line: 4, ch: 21}, primary: false, reversed: false} + ])); }); it("should expand cursor to range, then find other instances", function () { editor.setSelection({line: 3, ch: 18}, {line: 3, ch: 18}); FindReplace._findAllAndSelect(editor); - expect(editor.getSelections()).toEqual([{start: {line: 1, ch: 17}, end: {line: 1, ch: 24}, primary: false, reversed: false}, - {start: {line: 2, ch: 14}, end: {line: 2, ch: 21}, primary: false, reversed: false}, - {start: {line: 3, ch: 14}, end: {line: 3, ch: 21}, primary: true, reversed: false}, - {start: {line: 4, ch: 14}, end: {line: 4, ch: 21}, primary: false, reversed: false}]); + expect(editor.getSelections()).toEqual(fixSels([ + {start: {line: 1, ch: 17}, end: {line: 1, ch: 24}, primary: false, reversed: false}, + {start: {line: 2, ch: 14}, end: {line: 2, ch: 21}, primary: false, reversed: false}, + {start: {line: 3, ch: 14}, end: {line: 3, ch: 21}, primary: true, reversed: false}, + {start: {line: 4, ch: 14}, end: {line: 4, ch: 21}, primary: false, reversed: false} + ])); }); it("should find all case insensitively", function () { editor.setSelection({line: 8, ch: 10}, {line: 8, ch: 10}); // inside "foo", should also find "Foo"s FindReplace._findAllAndSelect(editor); - expect(editor.getSelections()).toEqual([{start: {line: 2, ch: 8}, end: {line: 2, ch: 11}, primary: false, reversed: false}, - {start: {line: 2, ch: 31}, end: {line: 2, ch: 34}, primary: false, reversed: false}, - {start: {line: 6, ch: 17}, end: {line: 6, ch: 20}, primary: false, reversed: false}, - {start: {line: 8, ch: 8}, end: {line: 8, ch: 11}, primary: true, reversed: false}]); + expect(editor.getSelections()).toEqual(fixSels([ + {start: {line: 2, ch: 8}, end: {line: 2, ch: 11}, primary: false, reversed: false}, + {start: {line: 2, ch: 31}, end: {line: 2, ch: 34}, primary: false, reversed: false}, + {start: {line: 6, ch: 17}, end: {line: 6, ch: 20}, primary: false, reversed: false}, + {start: {line: 8, ch: 8}, end: {line: 8, ch: 11}, primary: true, reversed: false} + ])); }); it("should not change the selection if the primary selection is a cursor inside a non-word", function () { editor.setSelections([{start: {line: 1, ch: 4}, end: {line: 1, ch: 10}}, {start: {line: 8, ch: 0}, end: {line: 8, ch: 0}}]); FindReplace._findAllAndSelect(editor); - expect(editor.getSelections()).toEqual([{start: {line: 1, ch: 4}, end: {line: 1, ch: 10}, primary: false, reversed: false}, - {start: {line: 8, ch: 0}, end: {line: 8, ch: 0}, primary: true, reversed: false}]); + expect(editor.getSelections()).toEqual(fixSels([ + {start: {line: 1, ch: 4}, end: {line: 1, ch: 10}, primary: false, reversed: false}, + {start: {line: 8, ch: 0}, end: {line: 8, ch: 0}, primary: true, reversed: false} + ])); }); }); }); @@ -325,7 +390,7 @@ define(function (require, exports, module) { if (!sel.reversed) { sel.reversed = false; } - expect(myEditor.getSelection()).toEqual(sel); + expect(fixSel(myEditor.getSelection())).toEqual(fixSel(sel)); } function expectMatchIndex(index, count) { var matchInfo = StringUtils.format(Strings.FIND_MATCH_INDEX, index + 1, count); @@ -346,8 +411,8 @@ define(function (require, exports, module) { selections.forEach(function (location, index) { var textMarker = searchState.marked[index]; var markerLocation = textMarker.find(); - expect(markerLocation.from).toEqual(location.start); - expect(markerLocation.to).toEqual(location.end); + expect(fixPos(markerLocation.from)).toEqual(fixPos(location.start)); + expect(fixPos(markerLocation.to)).toEqual(fixPos(location.end)); }); } diff --git a/test/spec/InlineEditorProviders-test.js b/test/spec/InlineEditorProviders-test.js index ffe23d56b37..0890d0b5197 100644 --- a/test/spec/InlineEditorProviders-test.js +++ b/test/spec/InlineEditorProviders-test.js @@ -40,6 +40,14 @@ define(function (require, exports, module) { SpecRunnerUtils = require("spec/SpecRunnerUtils"), Strings = require("strings"); + // Helper functions for testing cursor position / selection range + function fixPos(pos) { + if (!("sticky" in pos)) { + pos.sticky = null; + } + return pos; + } + describe("InlineEditorProviders", function () { this.category = "integration"; @@ -314,7 +322,7 @@ define(function (require, exports, module) { var inlinePos = inlineWidget.editor.getCursorPos(); // verify cursor position and displayed range in inline editor - expect(inlinePos).toEqual(infos["test1.php"].offsets[0]); + expect(fixPos(inlinePos)).toEqual(fixPos(infos["test1.php"].offsets[0])); expect(inlineWidget.editor).toHaveInlineEditorRange(toRange(4, 8)); inlineWidget = null; @@ -329,7 +337,7 @@ define(function (require, exports, module) { var inlinePos = inlineWidget.editor.getCursorPos(); // verify cursor position in inline editor - expect(inlinePos).toEqual(infos["test1.css"].offsets[0]); + expect(fixPos(inlinePos)).toEqual(fixPos(infos["test1.css"].offsets[0])); inlineWidget = null; }); @@ -343,7 +351,7 @@ define(function (require, exports, module) { var inlinePos = inlineWidget.editor.getCursorPos(); // verify cursor position in inline editor - expect(inlinePos).toEqual(infos["test1.css"].offsets[0]); + expect(fixPos(inlinePos)).toEqual(fixPos(infos["test1.css"].offsets[0])); inlineWidget = null; }); @@ -357,7 +365,7 @@ define(function (require, exports, module) { var inlinePos = inlineWidget.editor.getCursorPos(); // verify cursor position in inline editor - expect(inlinePos).toEqual(infos["test1.css"].offsets[1]); + expect(fixPos(inlinePos)).toEqual(fixPos(infos["test1.css"].offsets[1])); inlineWidget = null; }); @@ -371,7 +379,7 @@ define(function (require, exports, module) { var inlinePos = inlineWidget.editor.getCursorPos(); // verify cursor position in inline editor - expect(inlinePos).toEqual(infos["test1.css"].offsets[1]); + expect(fixPos(inlinePos)).toEqual(fixPos(infos["test1.css"].offsets[1])); inlineWidget = null; }); @@ -385,7 +393,7 @@ define(function (require, exports, module) { var inlinePos = inlineWidget.editor.getCursorPos(); // verify cursor position in inline editor - expect(inlinePos).toEqual(infos["test1.html"].offsets[11]); + expect(fixPos(inlinePos)).toEqual(fixPos(infos["test1.html"].offsets[11])); inlineWidget = null; }); @@ -399,7 +407,7 @@ define(function (require, exports, module) { var inlinePos = inlineWidget.editor.getCursorPos(); // verify cursor position in inline editor - expect(inlinePos).toEqual(infos["test1.css"].offsets[2]); + expect(fixPos(inlinePos)).toEqual(fixPos(infos["test1.css"].offsets[2])); inlineWidget = null; }); @@ -444,7 +452,7 @@ define(function (require, exports, module) { var inlinePos = inlineWidget.editor.getCursorPos(); // verify cursor position in inline editor - expect(inlinePos).toEqual(infos["test1.css"].offsets[8]); + expect(fixPos(inlinePos)).toEqual(fixPos(infos["test1.css"].offsets[8])); inlineWidget = null; }); From f0fecdc514f492030ce908345976aeac4ef8ee67 Mon Sep 17 00:00:00 2001 From: Saurabh Kathpalia Date: Wed, 22 Feb 2017 11:28:09 +0530 Subject: [PATCH 009/121] Added Reverse Inspect feature in MultiBrowserLive Preview using the existing Websocket transport architecture (#13103) --- src/LiveDevelopment/Agents/RemoteFunctions.js | 4 ++-- .../MultiBrowserImpl/protocol/LiveDevProtocol.js | 12 ++++++++++-- .../protocol/remote/LiveDevProtocolRemote.js | 13 +++++++++++++ 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/src/LiveDevelopment/Agents/RemoteFunctions.js b/src/LiveDevelopment/Agents/RemoteFunctions.js index 7060ce5a3fd..e5119c1981e 100644 --- a/src/LiveDevelopment/Agents/RemoteFunctions.js +++ b/src/LiveDevelopment/Agents/RemoteFunctions.js @@ -22,7 +22,7 @@ */ /*jslint forin: true */ -/*global Node */ +/*global Node, MessageEvent */ /*theseus instrument: false */ /** @@ -337,7 +337,7 @@ function RemoteFunctions(experimental, remoteWSPort) { _trigger(element, "highlight", 1); } - if (!window.event && !isInViewport(element)) { + if ((!window.event || window.event instanceof MessageEvent) && !isInViewport(element)) { var top = getDocumentOffsetTop(element); if (top) { top -= (window.innerHeight / 2); diff --git a/src/LiveDevelopment/MultiBrowserImpl/protocol/LiveDevProtocol.js b/src/LiveDevelopment/MultiBrowserImpl/protocol/LiveDevProtocol.js index 56d0874294e..159d16ec5d6 100644 --- a/src/LiveDevelopment/MultiBrowserImpl/protocol/LiveDevProtocol.js +++ b/src/LiveDevelopment/MultiBrowserImpl/protocol/LiveDevProtocol.js @@ -45,8 +45,10 @@ define(function (require, exports, module) { // Text of the script we'll inject into the browser that handles protocol requests. var LiveDevProtocolRemote = require("text!LiveDevelopment/MultiBrowserImpl/protocol/remote/LiveDevProtocolRemote.js"), - DocumentObserver = require("text!LiveDevelopment/MultiBrowserImpl/protocol/remote/DocumentObserver.js"), - RemoteFunctions = require("text!LiveDevelopment/Agents/RemoteFunctions.js"); + DocumentObserver = require("text!LiveDevelopment/MultiBrowserImpl/protocol/remote/DocumentObserver.js"), + RemoteFunctions = require("text!LiveDevelopment/Agents/RemoteFunctions.js"), + EditorManager = require("editor/EditorManager"), + HTMLInstrumentation = require("language/HTMLInstrumentation"); /** * @private @@ -109,6 +111,12 @@ define(function (require, exports, module) { deferred.resolve(msg); } } + } else if (msg.tagId) { + var editor = EditorManager.getActiveEditor(), + position = HTMLInstrumentation.getPositionFromTagId(editor, parseInt(msg.tagId, 10)); + if (position) { + editor.setCursorPos(position.line, position.ch, true); + } } else { // enrich received message with clientId msg.clientId = clientId; diff --git a/src/LiveDevelopment/MultiBrowserImpl/protocol/remote/LiveDevProtocolRemote.js b/src/LiveDevelopment/MultiBrowserImpl/protocol/remote/LiveDevProtocolRemote.js index da2d0ad324e..943dbe165bc 100644 --- a/src/LiveDevelopment/MultiBrowserImpl/protocol/remote/LiveDevProtocolRemote.js +++ b/src/LiveDevelopment/MultiBrowserImpl/protocol/remote/LiveDevProtocolRemote.js @@ -376,5 +376,18 @@ window.addEventListener('load', function () { ProtocolManager.enable(); }); + + /** + * Sends the message containing tagID which is being clicked + * to the editor in order to change the cursor position to + * the HTML tag corresponding to the clicked element. + */ + function onDocumentClick(event) { + var element = event.target; + if (element && element.hasAttribute('data-brackets-id')) { + MessageBroker.send({"tagId": element.getAttribute('data-brackets-id')}); + } + } + window.document.addEventListener("click", onDocumentClick); }(this)); From eb0198a4badb3492e185b58292c3c5c2beba6679 Mon Sep 17 00:00:00 2001 From: ficristo Date: Wed, 22 Feb 2017 21:12:52 +0100 Subject: [PATCH 010/121] Remove node dependencies --- .../node/node_modules/object-assign/index.js | 83 - .../node/node_modules/object-assign/license | 21 - .../node_modules/object-assign/package.json | 106 - .../node/node_modules/object-assign/readme.md | 56 - .../launchers/node/node_modules/opn/index.js | 95 - .../launchers/node/node_modules/opn/license | 21 - .../node/node_modules/opn/package.json | 116 - .../launchers/node/node_modules/opn/readme.md | 89 - .../launchers/node/node_modules/opn/xdg-open | 861 -- .../node/node_modules/pinkie-promise/index.js | 3 - .../node/node_modules/pinkie-promise/license | 21 - .../node_modules/pinkie-promise/package.json | 94 - .../node_modules/pinkie-promise/readme.md | 28 - .../node/node_modules/pinkie/index.js | 292 - .../node/node_modules/pinkie/license | 21 - .../node/node_modules/pinkie/package.json | 92 - .../node/node_modules/pinkie/readme.md | 83 - .../launchers/node/package.json | 6 - .../transports/node/node_modules/.bin/wscat | 15 - .../node/node_modules/.bin/wscat.cmd | 5 - .../node/node_modules/lodash/LICENSE.txt | 22 - .../node/node_modules/lodash/README.md | 163 - .../node_modules/lodash/dist/lodash.compat.js | 7157 ---------------- .../lodash/dist/lodash.compat.min.js | 61 - .../node/node_modules/lodash/dist/lodash.js | 6785 ---------------- .../node_modules/lodash/dist/lodash.min.js | 56 - .../lodash/dist/lodash.underscore.js | 4979 ------------ .../lodash/dist/lodash.underscore.min.js | 39 - .../node/node_modules/lodash/lodash.js | 7179 ----------------- .../node/node_modules/lodash/package.json | 102 - .../node/node_modules/ws/.npmignore | 11 - .../node/node_modules/ws/.travis.yml | 5 - .../node/node_modules/ws/History.md | 312 - .../transports/node/node_modules/ws/Makefile | 40 - .../transports/node/node_modules/ws/README.md | 171 - .../transports/node/node_modules/ws/bin/wscat | 222 - .../node/node_modules/ws/binding.gyp | 16 - .../node/node_modules/ws/builderror.log | 11 - .../transports/node/node_modules/ws/index.js | 26 - .../node/node_modules/ws/lib/BufferPool.js | 59 - .../ws/lib/BufferUtil.fallback.js | 47 - .../node/node_modules/ws/lib/BufferUtil.js | 16 - .../node/node_modules/ws/lib/ErrorCodes.js | 24 - .../node_modules/ws/lib/Receiver.hixie.js | 180 - .../node/node_modules/ws/lib/Receiver.js | 585 -- .../node/node_modules/ws/lib/Sender.hixie.js | 118 - .../node/node_modules/ws/lib/Sender.js | 227 - .../ws/lib/Validation.fallback.js | 12 - .../node/node_modules/ws/lib/Validation.js | 16 - .../node/node_modules/ws/lib/WebSocket.js | 794 -- .../node_modules/ws/lib/WebSocketServer.js | 465 -- .../node/node_modules/ws/lib/browser.js | 43 - .../ws/node_modules/commander/Readme.md | 195 - .../ws/node_modules/commander/index.js | 851 -- .../ws/node_modules/commander/package.json | 41 - .../node_modules/ws/node_modules/nan/.dntrc | 36 - .../node_modules/ws/node_modules/nan/LICENSE | 46 - .../ws/node_modules/nan/README.md | 947 --- .../ws/node_modules/nan/build/config.gypi | 38 - .../ws/node_modules/nan/include_dirs.js | 1 - .../node_modules/ws/node_modules/nan/nan.h | 1910 ----- .../ws/node_modules/nan/package.json | 51 - .../ws/node_modules/options/.npmignore | 7 - .../ws/node_modules/options/Makefile | 12 - .../ws/node_modules/options/README.md | 69 - .../ws/node_modules/options/lib/options.js | 86 - .../ws/node_modules/options/package.json | 33 - .../ws/node_modules/tinycolor/.npmignore | 5 - .../ws/node_modules/tinycolor/README.md | 3 - .../ws/node_modules/tinycolor/example.js | 3 - .../ws/node_modules/tinycolor/package.json | 28 - .../ws/node_modules/tinycolor/tinycolor.js | 31 - .../node/node_modules/ws/package.json | 61 - .../node/node_modules/ws/src/bufferutil.cc | 117 - .../node/node_modules/ws/src/validation.cc | 145 - .../transports/node/package.json | 7 - test/node/node_modules/fs-extra/.npmignore | 1 - test/node/node_modules/fs-extra/.travis.yml | 5 - test/node/node_modules/fs-extra/CHANGELOG.md | 67 - test/node/node_modules/fs-extra/LICENSE | 16 - test/node/node_modules/fs-extra/README.md | 281 - test/node/node_modules/fs-extra/lib/copy.js | 42 - test/node/node_modules/fs-extra/lib/create.js | 53 - test/node/node_modules/fs-extra/lib/index.js | 102 - test/node/node_modules/fs-extra/lib/mkdir.js | 6 - test/node/node_modules/fs-extra/lib/output.js | 35 - test/node/node_modules/fs-extra/lib/remove.js | 17 - .../fs-extra/node_modules/.bin/ncp | 1 - .../fs-extra/node_modules/jsonfile/.npmignore | 1 - .../node_modules/jsonfile/.travis.yml | 4 - .../node_modules/jsonfile/CHANGELOG.md | 3 - .../fs-extra/node_modules/jsonfile/LICENSE | 15 - .../fs-extra/node_modules/jsonfile/README.md | 116 - .../node_modules/jsonfile/lib/jsonfile.js | 44 - .../node_modules/jsonfile/package.json | 37 - .../jsonfile/test/jsonfile.test.js | 66 - .../node_modules/jsonfile/test/mocha.opts | 3 - .../jsonfile/test/resources/.gitkeep | 0 .../fs-extra/node_modules/mkdirp/.npmignore | 2 - .../fs-extra/node_modules/mkdirp/.travis.yml | 5 - .../fs-extra/node_modules/mkdirp/LICENSE | 21 - .../node_modules/mkdirp/examples/pow.js | 6 - .../fs-extra/node_modules/mkdirp/index.js | 82 - .../fs-extra/node_modules/mkdirp/package.json | 30 - .../node_modules/mkdirp/readme.markdown | 63 - .../node_modules/mkdirp/test/chmod.js | 38 - .../node_modules/mkdirp/test/clobber.js | 37 - .../node_modules/mkdirp/test/mkdirp.js | 28 - .../fs-extra/node_modules/mkdirp/test/perm.js | 32 - .../node_modules/mkdirp/test/perm_sync.js | 39 - .../fs-extra/node_modules/mkdirp/test/race.js | 41 - .../fs-extra/node_modules/mkdirp/test/rel.js | 32 - .../node_modules/mkdirp/test/return.js | 25 - .../node_modules/mkdirp/test/return_sync.js | 24 - .../fs-extra/node_modules/mkdirp/test/root.js | 18 - .../fs-extra/node_modules/mkdirp/test/sync.js | 32 - .../node_modules/mkdirp/test/umask.js | 28 - .../node_modules/mkdirp/test/umask_sync.js | 32 - .../fs-extra/node_modules/ncp/.npmignore | 4 - .../fs-extra/node_modules/ncp/.travis.yml | 6 - .../fs-extra/node_modules/ncp/LICENSE.md | 21 - .../fs-extra/node_modules/ncp/README.md | 46 - .../fs-extra/node_modules/ncp/bin/ncp | 48 - .../fs-extra/node_modules/ncp/lib/ncp.js | 216 - .../fs-extra/node_modules/ncp/package.json | 37 - .../node_modules/ncp/test/fixtures/src/a | 1 - .../node_modules/ncp/test/fixtures/src/b | 1 - .../node_modules/ncp/test/fixtures/src/c | 0 .../node_modules/ncp/test/fixtures/src/d | 0 .../node_modules/ncp/test/fixtures/src/e | 0 .../node_modules/ncp/test/fixtures/src/f | 0 .../node_modules/ncp/test/fixtures/src/sub/a | 1 - .../node_modules/ncp/test/fixtures/src/sub/b | 0 .../node_modules/ncp/test/ncp-test.js | 74 - .../fs-extra/node_modules/rimraf/AUTHORS | 6 - .../fs-extra/node_modules/rimraf/LICENSE | 23 - .../fs-extra/node_modules/rimraf/README.md | 21 - .../node_modules/graceful-fs/.npmignore | 1 - .../rimraf/node_modules/graceful-fs/LICENSE | 23 - .../rimraf/node_modules/graceful-fs/README.md | 5 - .../node_modules/graceful-fs/graceful-fs.js | 316 - .../node_modules/graceful-fs/package.json | 36 - .../node_modules/graceful-fs/test/open.js | 46 - .../fs-extra/node_modules/rimraf/package.json | 55 - .../fs-extra/node_modules/rimraf/rimraf.js | 132 - .../fs-extra/node_modules/rimraf/test/run.sh | 10 - .../node_modules/rimraf/test/setup.sh | 47 - .../node_modules/rimraf/test/test-async.js | 5 - .../node_modules/rimraf/test/test-sync.js | 3 - test/node/node_modules/fs-extra/package.json | 63 - .../node_modules/fs-extra/test/copy.test.js | 85 - .../node_modules/fs-extra/test/create.test.js | 60 - .../node_modules/fs-extra/test/mkdir.test.js | 66 - .../node_modules/fs-extra/test/mocha.opts | 4 - .../node_modules/fs-extra/test/output.test.js | 62 - .../node_modules/fs-extra/test/read.test.js | 68 - .../node_modules/fs-extra/test/remove.test.js | 127 - test/node/package.json | 7 - 158 files changed, 40030 deletions(-) delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/object-assign/index.js delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/object-assign/license delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/object-assign/package.json delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/object-assign/readme.md delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/opn/index.js delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/opn/license delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/opn/package.json delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/opn/readme.md delete mode 100755 src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/opn/xdg-open delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/pinkie-promise/index.js delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/pinkie-promise/license delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/pinkie-promise/package.json delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/pinkie-promise/readme.md delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/pinkie/index.js delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/pinkie/license delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/pinkie/package.json delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/pinkie/readme.md delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/launchers/node/package.json delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/.bin/wscat delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/.bin/wscat.cmd delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/lodash/LICENSE.txt delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/lodash/README.md delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/lodash/dist/lodash.compat.js delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/lodash/dist/lodash.compat.min.js delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/lodash/dist/lodash.js delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/lodash/dist/lodash.min.js delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/lodash/dist/lodash.underscore.js delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/lodash/dist/lodash.underscore.min.js delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/lodash/lodash.js delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/lodash/package.json delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/.npmignore delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/.travis.yml delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/History.md delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/Makefile delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/README.md delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/bin/wscat delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/binding.gyp delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/builderror.log delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/index.js delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/lib/BufferPool.js delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/lib/BufferUtil.fallback.js delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/lib/BufferUtil.js delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/lib/ErrorCodes.js delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/lib/Receiver.hixie.js delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/lib/Receiver.js delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/lib/Sender.hixie.js delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/lib/Sender.js delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/lib/Validation.fallback.js delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/lib/Validation.js delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/lib/WebSocket.js delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/lib/WebSocketServer.js delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/lib/browser.js delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/commander/Readme.md delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/commander/index.js delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/commander/package.json delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/nan/.dntrc delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/nan/LICENSE delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/nan/README.md delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/nan/build/config.gypi delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/nan/include_dirs.js delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/nan/nan.h delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/nan/package.json delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/options/.npmignore delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/options/Makefile delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/options/README.md delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/options/lib/options.js delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/options/package.json delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/tinycolor/.npmignore delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/tinycolor/README.md delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/tinycolor/example.js delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/tinycolor/package.json delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/tinycolor/tinycolor.js delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/package.json delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/src/bufferutil.cc delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/src/validation.cc delete mode 100644 src/LiveDevelopment/MultiBrowserImpl/transports/node/package.json delete mode 100644 test/node/node_modules/fs-extra/.npmignore delete mode 100644 test/node/node_modules/fs-extra/.travis.yml delete mode 100644 test/node/node_modules/fs-extra/CHANGELOG.md delete mode 100644 test/node/node_modules/fs-extra/LICENSE delete mode 100644 test/node/node_modules/fs-extra/README.md delete mode 100644 test/node/node_modules/fs-extra/lib/copy.js delete mode 100644 test/node/node_modules/fs-extra/lib/create.js delete mode 100644 test/node/node_modules/fs-extra/lib/index.js delete mode 100644 test/node/node_modules/fs-extra/lib/mkdir.js delete mode 100644 test/node/node_modules/fs-extra/lib/output.js delete mode 100644 test/node/node_modules/fs-extra/lib/remove.js delete mode 120000 test/node/node_modules/fs-extra/node_modules/.bin/ncp delete mode 100644 test/node/node_modules/fs-extra/node_modules/jsonfile/.npmignore delete mode 100644 test/node/node_modules/fs-extra/node_modules/jsonfile/.travis.yml delete mode 100644 test/node/node_modules/fs-extra/node_modules/jsonfile/CHANGELOG.md delete mode 100644 test/node/node_modules/fs-extra/node_modules/jsonfile/LICENSE delete mode 100644 test/node/node_modules/fs-extra/node_modules/jsonfile/README.md delete mode 100644 test/node/node_modules/fs-extra/node_modules/jsonfile/lib/jsonfile.js delete mode 100644 test/node/node_modules/fs-extra/node_modules/jsonfile/package.json delete mode 100644 test/node/node_modules/fs-extra/node_modules/jsonfile/test/jsonfile.test.js delete mode 100644 test/node/node_modules/fs-extra/node_modules/jsonfile/test/mocha.opts delete mode 100644 test/node/node_modules/fs-extra/node_modules/jsonfile/test/resources/.gitkeep delete mode 100644 test/node/node_modules/fs-extra/node_modules/mkdirp/.npmignore delete mode 100644 test/node/node_modules/fs-extra/node_modules/mkdirp/.travis.yml delete mode 100644 test/node/node_modules/fs-extra/node_modules/mkdirp/LICENSE delete mode 100644 test/node/node_modules/fs-extra/node_modules/mkdirp/examples/pow.js delete mode 100644 test/node/node_modules/fs-extra/node_modules/mkdirp/index.js delete mode 100644 test/node/node_modules/fs-extra/node_modules/mkdirp/package.json delete mode 100644 test/node/node_modules/fs-extra/node_modules/mkdirp/readme.markdown delete mode 100644 test/node/node_modules/fs-extra/node_modules/mkdirp/test/chmod.js delete mode 100644 test/node/node_modules/fs-extra/node_modules/mkdirp/test/clobber.js delete mode 100644 test/node/node_modules/fs-extra/node_modules/mkdirp/test/mkdirp.js delete mode 100644 test/node/node_modules/fs-extra/node_modules/mkdirp/test/perm.js delete mode 100644 test/node/node_modules/fs-extra/node_modules/mkdirp/test/perm_sync.js delete mode 100644 test/node/node_modules/fs-extra/node_modules/mkdirp/test/race.js delete mode 100644 test/node/node_modules/fs-extra/node_modules/mkdirp/test/rel.js delete mode 100644 test/node/node_modules/fs-extra/node_modules/mkdirp/test/return.js delete mode 100644 test/node/node_modules/fs-extra/node_modules/mkdirp/test/return_sync.js delete mode 100644 test/node/node_modules/fs-extra/node_modules/mkdirp/test/root.js delete mode 100644 test/node/node_modules/fs-extra/node_modules/mkdirp/test/sync.js delete mode 100644 test/node/node_modules/fs-extra/node_modules/mkdirp/test/umask.js delete mode 100644 test/node/node_modules/fs-extra/node_modules/mkdirp/test/umask_sync.js delete mode 100644 test/node/node_modules/fs-extra/node_modules/ncp/.npmignore delete mode 100644 test/node/node_modules/fs-extra/node_modules/ncp/.travis.yml delete mode 100644 test/node/node_modules/fs-extra/node_modules/ncp/LICENSE.md delete mode 100644 test/node/node_modules/fs-extra/node_modules/ncp/README.md delete mode 100755 test/node/node_modules/fs-extra/node_modules/ncp/bin/ncp delete mode 100644 test/node/node_modules/fs-extra/node_modules/ncp/lib/ncp.js delete mode 100644 test/node/node_modules/fs-extra/node_modules/ncp/package.json delete mode 100644 test/node/node_modules/fs-extra/node_modules/ncp/test/fixtures/src/a delete mode 100644 test/node/node_modules/fs-extra/node_modules/ncp/test/fixtures/src/b delete mode 100644 test/node/node_modules/fs-extra/node_modules/ncp/test/fixtures/src/c delete mode 100644 test/node/node_modules/fs-extra/node_modules/ncp/test/fixtures/src/d delete mode 100644 test/node/node_modules/fs-extra/node_modules/ncp/test/fixtures/src/e delete mode 100644 test/node/node_modules/fs-extra/node_modules/ncp/test/fixtures/src/f delete mode 100644 test/node/node_modules/fs-extra/node_modules/ncp/test/fixtures/src/sub/a delete mode 100644 test/node/node_modules/fs-extra/node_modules/ncp/test/fixtures/src/sub/b delete mode 100644 test/node/node_modules/fs-extra/node_modules/ncp/test/ncp-test.js delete mode 100644 test/node/node_modules/fs-extra/node_modules/rimraf/AUTHORS delete mode 100644 test/node/node_modules/fs-extra/node_modules/rimraf/LICENSE delete mode 100644 test/node/node_modules/fs-extra/node_modules/rimraf/README.md delete mode 100644 test/node/node_modules/fs-extra/node_modules/rimraf/node_modules/graceful-fs/.npmignore delete mode 100644 test/node/node_modules/fs-extra/node_modules/rimraf/node_modules/graceful-fs/LICENSE delete mode 100644 test/node/node_modules/fs-extra/node_modules/rimraf/node_modules/graceful-fs/README.md delete mode 100644 test/node/node_modules/fs-extra/node_modules/rimraf/node_modules/graceful-fs/graceful-fs.js delete mode 100644 test/node/node_modules/fs-extra/node_modules/rimraf/node_modules/graceful-fs/package.json delete mode 100644 test/node/node_modules/fs-extra/node_modules/rimraf/node_modules/graceful-fs/test/open.js delete mode 100644 test/node/node_modules/fs-extra/node_modules/rimraf/package.json delete mode 100644 test/node/node_modules/fs-extra/node_modules/rimraf/rimraf.js delete mode 100644 test/node/node_modules/fs-extra/node_modules/rimraf/test/run.sh delete mode 100644 test/node/node_modules/fs-extra/node_modules/rimraf/test/setup.sh delete mode 100644 test/node/node_modules/fs-extra/node_modules/rimraf/test/test-async.js delete mode 100644 test/node/node_modules/fs-extra/node_modules/rimraf/test/test-sync.js delete mode 100755 test/node/node_modules/fs-extra/package.json delete mode 100644 test/node/node_modules/fs-extra/test/copy.test.js delete mode 100644 test/node/node_modules/fs-extra/test/create.test.js delete mode 100644 test/node/node_modules/fs-extra/test/mkdir.test.js delete mode 100644 test/node/node_modules/fs-extra/test/mocha.opts delete mode 100644 test/node/node_modules/fs-extra/test/output.test.js delete mode 100644 test/node/node_modules/fs-extra/test/read.test.js delete mode 100644 test/node/node_modules/fs-extra/test/remove.test.js delete mode 100644 test/node/package.json diff --git a/src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/object-assign/index.js b/src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/object-assign/index.js deleted file mode 100644 index 508504840dc..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/object-assign/index.js +++ /dev/null @@ -1,83 +0,0 @@ -'use strict'; -/* eslint-disable no-unused-vars */ -var hasOwnProperty = Object.prototype.hasOwnProperty; -var propIsEnumerable = Object.prototype.propertyIsEnumerable; - -function toObject(val) { - if (val === null || val === undefined) { - throw new TypeError('Object.assign cannot be called with null or undefined'); - } - - return Object(val); -} - -function shouldUseNative() { - try { - if (!Object.assign) { - return false; - } - - // Detect buggy property enumeration order in older V8 versions. - - // https://bugs.chromium.org/p/v8/issues/detail?id=4118 - var test1 = new String('abc'); // eslint-disable-line - test1[5] = 'de'; - if (Object.getOwnPropertyNames(test1)[0] === '5') { - return false; - } - - // https://bugs.chromium.org/p/v8/issues/detail?id=3056 - var test2 = {}; - for (var i = 0; i < 10; i++) { - test2['_' + String.fromCharCode(i)] = i; - } - var order2 = Object.getOwnPropertyNames(test2).map(function (n) { - return test2[n]; - }); - if (order2.join('') !== '0123456789') { - return false; - } - - // https://bugs.chromium.org/p/v8/issues/detail?id=3056 - var test3 = {}; - 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { - test3[letter] = letter; - }); - if (Object.keys(Object.assign({}, test3)).join('') !== - 'abcdefghijklmnopqrst') { - return false; - } - - return true; - } catch (e) { - // We don't expect any of the above to throw, but better to be safe. - return false; - } -} - -module.exports = shouldUseNative() ? Object.assign : function (target, source) { - var from; - var to = toObject(target); - var symbols; - - for (var s = 1; s < arguments.length; s++) { - from = Object(arguments[s]); - - for (var key in from) { - if (hasOwnProperty.call(from, key)) { - to[key] = from[key]; - } - } - - if (Object.getOwnPropertySymbols) { - symbols = Object.getOwnPropertySymbols(from); - for (var i = 0; i < symbols.length; i++) { - if (propIsEnumerable.call(from, symbols[i])) { - to[symbols[i]] = from[symbols[i]]; - } - } - } - } - - return to; -}; diff --git a/src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/object-assign/license b/src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/object-assign/license deleted file mode 100644 index 654d0bfe943..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/object-assign/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (sindresorhus.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/src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/object-assign/package.json b/src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/object-assign/package.json deleted file mode 100644 index 068b9088c79..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/object-assign/package.json +++ /dev/null @@ -1,106 +0,0 @@ -{ - "_args": [ - [ - "object-assign@^4.0.1", - "/Users/Filippo/Documents/git/brackets/src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/opn" - ] - ], - "_from": "object-assign@>=4.0.1 <5.0.0", - "_id": "object-assign@4.1.0", - "_inCache": true, - "_installable": true, - "_location": "/object-assign", - "_nodeVersion": "4.1.0", - "_npmOperationalInternal": { - "host": "packages-16-east.internal.npmjs.com", - "tmp": "tmp/object-assign-4.1.0.tgz_1462212593641_0.3332549517508596" - }, - "_npmUser": { - "email": "ben@benalpert.com", - "name": "spicyj" - }, - "_npmVersion": "2.14.19", - "_phantomChildren": {}, - "_requested": { - "name": "object-assign", - "raw": "object-assign@^4.0.1", - "rawSpec": "^4.0.1", - "scope": null, - "spec": ">=4.0.1 <5.0.0", - "type": "range" - }, - "_requiredBy": [ - "/opn" - ], - "_resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.0.tgz", - "_shasum": "7a3b3d0e98063d43f4c03f2e8ae6cd51a86883a0", - "_shrinkwrap": null, - "_spec": "object-assign@^4.0.1", - "_where": "/Users/Filippo/Documents/git/brackets/src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/opn", - "author": { - "email": "sindresorhus@gmail.com", - "name": "Sindre Sorhus", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/object-assign/issues" - }, - "dependencies": {}, - "description": "ES2015 Object.assign() ponyfill", - "devDependencies": { - "lodash": "^4.8.2", - "matcha": "^0.7.0", - "mocha": "*", - "xo": "*" - }, - "directories": {}, - "dist": { - "shasum": "7a3b3d0e98063d43f4c03f2e8ae6cd51a86883a0", - "tarball": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.0.tgz" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "gitHead": "72fe21c86911758f3342fdf41c2a57860d5829bc", - "homepage": "https://github.com/sindresorhus/object-assign#readme", - "keywords": [ - "object", - "assign", - "extend", - "properties", - "es2015", - "ecmascript", - "harmony", - "ponyfill", - "prollyfill", - "polyfill", - "shim", - "browser" - ], - "license": "MIT", - "maintainers": [ - { - "email": "sindresorhus@gmail.com", - "name": "sindresorhus" - }, - { - "email": "ben@benalpert.com", - "name": "spicyj" - } - ], - "name": "object-assign", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/object-assign.git" - }, - "scripts": { - "bench": "matcha bench.js", - "test": "xo && mocha" - }, - "version": "4.1.0" -} diff --git a/src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/object-assign/readme.md b/src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/object-assign/readme.md deleted file mode 100644 index 13c097734cf..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/object-assign/readme.md +++ /dev/null @@ -1,56 +0,0 @@ -# object-assign [![Build Status](https://travis-ci.org/sindresorhus/object-assign.svg?branch=master)](https://travis-ci.org/sindresorhus/object-assign) - -> ES2015 [`Object.assign()`](http://www.2ality.com/2014/01/object-assign.html) ponyfill - -> Ponyfill: A polyfill that doesn't overwrite the native method - - -## Install - -``` -$ npm install --save object-assign -``` - - -## Usage - -```js -const objectAssign = require('object-assign'); - -objectAssign({foo: 0}, {bar: 1}); -//=> {foo: 0, bar: 1} - -// multiple sources -objectAssign({foo: 0}, {bar: 1}, {baz: 2}); -//=> {foo: 0, bar: 1, baz: 2} - -// overwrites equal keys -objectAssign({foo: 0}, {foo: 1}, {foo: 2}); -//=> {foo: 2} - -// ignores null and undefined sources -objectAssign({foo: 0}, null, {bar: 1}, undefined); -//=> {foo: 0, bar: 1} -``` - - -## API - -### objectAssign(target, source, [source, ...]) - -Assigns enumerable own properties of `source` objects to the `target` object and returns the `target` object. Additional `source` objects will overwrite previous ones. - - -## Resources - -- [ES2015 spec - Object.assign](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign) - - -## Related - -- [deep-assign](https://github.com/sindresorhus/deep-assign) - Recursive `Object.assign()` - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/opn/index.js b/src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/opn/index.js deleted file mode 100644 index 13dcb66fb12..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/opn/index.js +++ /dev/null @@ -1,95 +0,0 @@ -'use strict'; -var path = require('path'); -var childProcess = require('child_process'); -var objectAssign = require('object-assign'); -var Promise = require('pinkie-promise'); - -module.exports = function (target, opts) { - if (typeof target !== 'string') { - return Promise.reject(new Error('Expected a `target`')); - } - - opts = objectAssign({wait: true}, opts); - - var cmd; - var appArgs = []; - var args = []; - var cpOpts = {}; - - if (Array.isArray(opts.app)) { - appArgs = opts.app.slice(1); - opts.app = opts.app[0]; - } - - if (process.platform === 'darwin') { - cmd = 'open'; - - if (opts.wait) { - args.push('-W'); - } - - if (opts.app) { - args.push('-a', opts.app); - } - } else if (process.platform === 'win32') { - cmd = 'cmd'; - args.push('/c', 'start', '""'); - target = target.replace(/&/g, '^&'); - - if (opts.wait) { - args.push('/wait'); - } - - if (opts.app) { - args.push(opts.app); - } - - if (appArgs.length > 0) { - args = args.concat(appArgs); - } - } else { - if (opts.app) { - cmd = opts.app; - } else { - cmd = path.join(__dirname, 'xdg-open'); - } - - if (appArgs.length > 0) { - args = args.concat(appArgs); - } - - if (!opts.wait) { - // xdg-open will block the process unless - // stdio is ignored even if it's unref'd - cpOpts.stdio = 'ignore'; - } - } - - args.push(target); - - if (process.platform === 'darwin' && appArgs.length > 0) { - args.push('--args'); - args = args.concat(appArgs); - } - - var cp = childProcess.spawn(cmd, args, cpOpts); - - if (opts.wait) { - return new Promise(function (resolve, reject) { - cp.once('error', reject); - - cp.once('close', function (code) { - if (code > 0) { - reject(new Error('Exited with code ' + code)); - return; - } - - resolve(cp); - }); - }); - } - - cp.unref(); - - return Promise.resolve(cp); -}; diff --git a/src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/opn/license b/src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/opn/license deleted file mode 100644 index ced6f6b30dd..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/opn/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus - -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/src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/opn/package.json b/src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/opn/package.json deleted file mode 100644 index 1f9d62546b4..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/opn/package.json +++ /dev/null @@ -1,116 +0,0 @@ -{ - "_args": [ - [ - "opn@4.0.2", - "/Users/Filippo/Documents/git/brackets/src/LiveDevelopment/MultiBrowserImpl/launchers/node" - ] - ], - "_from": "opn@4.0.2", - "_id": "opn@4.0.2", - "_inCache": true, - "_installable": true, - "_location": "/opn", - "_nodeVersion": "4.4.2", - "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/opn-4.0.2.tgz_1463477356148_0.1645404922310263" - }, - "_npmUser": { - "email": "sindresorhus@gmail.com", - "name": "sindresorhus" - }, - "_npmVersion": "3.9.0", - "_phantomChildren": {}, - "_requested": { - "name": "opn", - "raw": "opn@4.0.2", - "rawSpec": "4.0.2", - "scope": null, - "spec": "4.0.2", - "type": "version" - }, - "_requiredBy": [ - "/" - ], - "_resolved": "https://registry.npmjs.org/opn/-/opn-4.0.2.tgz", - "_shasum": "7abc22e644dff63b0a96d5ab7f2790c0f01abc95", - "_shrinkwrap": null, - "_spec": "opn@4.0.2", - "_where": "/Users/Filippo/Documents/git/brackets/src/LiveDevelopment/MultiBrowserImpl/launchers/node", - "author": { - "email": "sindresorhus@gmail.com", - "name": "Sindre Sorhus", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/opn/issues" - }, - "dependencies": { - "object-assign": "^4.0.1", - "pinkie-promise": "^2.0.0" - }, - "description": "A better node-open. Opens stuff like websites, files, executables. Cross-platform.", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "directories": {}, - "dist": { - "shasum": "7abc22e644dff63b0a96d5ab7f2790c0f01abc95", - "tarball": "https://registry.npmjs.org/opn/-/opn-4.0.2.tgz" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js", - "xdg-open" - ], - "gitHead": "b56b0e981ee377d3b04c57a4e6748ad2793ada17", - "homepage": "https://github.com/sindresorhus/opn#readme", - "keywords": [ - "app", - "open", - "opn", - "opener", - "opens", - "launch", - "start", - "xdg-open", - "xdg", - "default", - "cmd", - "browser", - "editor", - "executable", - "exe", - "url", - "urls", - "arguments", - "args", - "spawn", - "exec", - "child", - "process", - "website", - "file" - ], - "license": "MIT", - "maintainers": [ - { - "email": "sindresorhus@gmail.com", - "name": "sindresorhus" - } - ], - "name": "opn", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/opn.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "4.0.2" -} diff --git a/src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/opn/readme.md b/src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/opn/readme.md deleted file mode 100644 index 76d543933cd..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/opn/readme.md +++ /dev/null @@ -1,89 +0,0 @@ -# opn - -> A better [node-open](https://github.com/pwnall/node-open). Opens stuff like websites, files, executables. Cross-platform. - - -#### Why? - -- Actively maintained -- Supports app arguments -- Safer as it uses `spawn` instead of `exec` -- Fixes most of the open `node-open` issues -- Includes the latest [`xdg-open` script](http://cgit.freedesktop.org/xdg/xdg-utils/commit/?id=c55122295c2a480fa721a9614f0e2d42b2949c18) for Linux - - -## Install - -``` -$ npm install --save opn -``` - - -## Usage - -```js -const opn = require('opn'); - -// opens the image in the default image viewer -opn('unicorn.png').then(() => { - // image viewer closed -}); - -// opens the url in the default browser -opn('http://sindresorhus.com'); - -// specify the app to open in -opn('http://sindresorhus.com', {app: 'firefox'}); - -// specify app arguments -opn('http://sindresorhus.com', {app: ['google chrome', '--incognito']}); -``` - - -## API - -Uses the command `open` on OS X, `start` on Windows and `xdg-open` on other platforms. - -### opn(target, [options]) - -Returns a promise for the [spawned child process](https://nodejs.org/api/child_process.html#child_process_class_childprocess). You'd normally not need to use this for anything, but it can be useful if you'd like to attach custom event listeners or perform other operations directly on the spawned process. - -#### target - -*Required* -Type: `string` - -The thing you want to open. Can be a URL, file, or executable. - -Opens in the default app for the file type. Eg. URLs opens in your default browser. - -#### options - -Type: `object` - -##### wait - -Type: `boolean` -Default: `true` - -Wait for the opened app to exit before calling the `callback`. If `false` it's called immediately when opening the app. - -On Windows you have to explicitly specify an app for it to be able to wait. - -##### app - -Type: `string`, `array` - -Specify the app to open the `target` with, or an array with the app and app arguments. - -The app name is platform dependent. Don't hard code it in reusable modules. Eg. Chrome is `google chrome` on OS X, `google-chrome` on Linux and `chrome` on Windows. - - -## Related - -- [opn-cli](https://github.com/sindresorhus/opn-cli) - CLI for this module - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/opn/xdg-open b/src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/opn/xdg-open deleted file mode 100755 index 9be7f32f63e..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/opn/xdg-open +++ /dev/null @@ -1,861 +0,0 @@ -#!/bin/sh -#--------------------------------------------- -# xdg-open -# -# Utility script to open a URL in the registered default application. -# -# Refer to the usage() function below for usage. -# -# Copyright 2009-2010, Fathi Boudra -# Copyright 2009-2010, Rex Dieter -# Copyright 2006, Kevin Krammer -# Copyright 2006, Jeremy White -# -# 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. -# -#--------------------------------------------- - -manualpage() -{ -cat << _MANUALPAGE -Name - - xdg-open - opens a file or URL in the user's preferred - application - -Synopsis - - xdg-open { file | URL } - - xdg-open { --help | --manual | --version } - -Description - - xdg-open opens a file or URL in the user's preferred - application. If a URL is provided the URL will be opened in the - user's preferred web browser. If a file is provided the file - will be opened in the preferred application for files of that - type. xdg-open supports file, ftp, http and https URLs. - - xdg-open is for use inside a desktop session only. It is not - recommended to use xdg-open as root. - -Options - - --help - Show command synopsis. - - --manual - Show this manual page. - - --version - Show the xdg-utils version information. - -Exit Codes - - An exit code of 0 indicates success while a non-zero exit code - indicates failure. The following failure codes can be returned: - - 1 - Error in command line syntax. - - 2 - One of the files passed on the command line did not - exist. - - 3 - A required tool could not be found. - - 4 - The action failed. - -Examples - -xdg-open 'http://www.freedesktop.org/' - - Opens the freedesktop.org website in the user's default - browser. - -xdg-open /tmp/foobar.png - - Opens the PNG image file /tmp/foobar.png in the user's default - image viewing application. -_MANUALPAGE -} - -usage() -{ -cat << _USAGE - xdg-open - opens a file or URL in the user's preferred - application - -Synopsis - - xdg-open { file | URL } - - xdg-open { --help | --manual | --version } - -_USAGE -} - -#@xdg-utils-common@ - -#---------------------------------------------------------------------------- -# Common utility functions included in all XDG wrapper scripts -#---------------------------------------------------------------------------- - -DEBUG() -{ - [ -z "${XDG_UTILS_DEBUG_LEVEL}" ] && return 0; - [ ${XDG_UTILS_DEBUG_LEVEL} -lt $1 ] && return 0; - shift - echo "$@" >&2 -} - -# This handles backslashes but not quote marks. -first_word() -{ - read first rest - echo "$first" -} - -#------------------------------------------------------------- -# map a binary to a .desktop file -binary_to_desktop_file() -{ - search="${XDG_DATA_HOME:-$HOME/.local/share}:${XDG_DATA_DIRS:-/usr/local/share:/usr/share}" - binary="`which "$1"`" - binary="`readlink -f "$binary"`" - base="`basename "$binary"`" - IFS=: - for dir in $search; do - unset IFS - [ "$dir" ] || continue - [ -d "$dir/applications" ] || [ -d "$dir/applnk" ] || continue - for file in "$dir"/applications/*.desktop "$dir"/applications/*/*.desktop "$dir"/applnk/*.desktop "$dir"/applnk/*/*.desktop; do - [ -r "$file" ] || continue - # Check to make sure it's worth the processing. - grep -q "^Exec.*$base" "$file" || continue - # Make sure it's a visible desktop file (e.g. not "preferred-web-browser.desktop"). - grep -Eq "^(NoDisplay|Hidden)=true" "$file" && continue - command="`grep -E "^Exec(\[[^]=]*])?=" "$file" | cut -d= -f 2- | first_word`" - command="`which "$command"`" - if [ x"`readlink -f "$command"`" = x"$binary" ]; then - # Fix any double slashes that got added path composition - echo "$file" | sed -e 's,//*,/,g' - return - fi - done - done -} - -#------------------------------------------------------------- -# map a .desktop file to a binary -## FIXME: handle vendor dir case -desktop_file_to_binary() -{ - search="${XDG_DATA_HOME:-$HOME/.local/share}:${XDG_DATA_DIRS:-/usr/local/share:/usr/share}" - desktop="`basename "$1"`" - IFS=: - for dir in $search; do - unset IFS - [ "$dir" ] && [ -d "$dir/applications" ] || continue - file="$dir/applications/$desktop" - [ -r "$file" ] || continue - # Remove any arguments (%F, %f, %U, %u, etc.). - command="`grep -E "^Exec(\[[^]=]*])?=" "$file" | cut -d= -f 2- | first_word`" - command="`which "$command"`" - readlink -f "$command" - return - done -} - -#------------------------------------------------------------- -# Exit script on successfully completing the desired operation - -exit_success() -{ - if [ $# -gt 0 ]; then - echo "$@" - echo - fi - - exit 0 -} - - -#----------------------------------------- -# Exit script on malformed arguments, not enough arguments -# or missing required option. -# prints usage information - -exit_failure_syntax() -{ - if [ $# -gt 0 ]; then - echo "xdg-open: $@" >&2 - echo "Try 'xdg-open --help' for more information." >&2 - else - usage - echo "Use 'man xdg-open' or 'xdg-open --manual' for additional info." - fi - - exit 1 -} - -#------------------------------------------------------------- -# Exit script on missing file specified on command line - -exit_failure_file_missing() -{ - if [ $# -gt 0 ]; then - echo "xdg-open: $@" >&2 - fi - - exit 2 -} - -#------------------------------------------------------------- -# Exit script on failure to locate necessary tool applications - -exit_failure_operation_impossible() -{ - if [ $# -gt 0 ]; then - echo "xdg-open: $@" >&2 - fi - - exit 3 -} - -#------------------------------------------------------------- -# Exit script on failure returned by a tool application - -exit_failure_operation_failed() -{ - if [ $# -gt 0 ]; then - echo "xdg-open: $@" >&2 - fi - - exit 4 -} - -#------------------------------------------------------------ -# Exit script on insufficient permission to read a specified file - -exit_failure_file_permission_read() -{ - if [ $# -gt 0 ]; then - echo "xdg-open: $@" >&2 - fi - - exit 5 -} - -#------------------------------------------------------------ -# Exit script on insufficient permission to write a specified file - -exit_failure_file_permission_write() -{ - if [ $# -gt 0 ]; then - echo "xdg-open: $@" >&2 - fi - - exit 6 -} - -check_input_file() -{ - if [ ! -e "$1" ]; then - exit_failure_file_missing "file '$1' does not exist" - fi - if [ ! -r "$1" ]; then - exit_failure_file_permission_read "no permission to read file '$1'" - fi -} - -check_vendor_prefix() -{ - file_label="$2" - [ -n "$file_label" ] || file_label="filename" - file=`basename "$1"` - case "$file" in - [[:alpha:]]*-*) - return - ;; - esac - - echo "xdg-open: $file_label '$file' does not have a proper vendor prefix" >&2 - echo 'A vendor prefix consists of alpha characters ([a-zA-Z]) and is terminated' >&2 - echo 'with a dash ("-"). An example '"$file_label"' is '"'example-$file'" >&2 - echo "Use --novendor to override or 'xdg-open --manual' for additional info." >&2 - exit 1 -} - -check_output_file() -{ - # if the file exists, check if it is writeable - # if it does not exists, check if we are allowed to write on the directory - if [ -e "$1" ]; then - if [ ! -w "$1" ]; then - exit_failure_file_permission_write "no permission to write to file '$1'" - fi - else - DIR=`dirname "$1"` - if [ ! -w "$DIR" ] || [ ! -x "$DIR" ]; then - exit_failure_file_permission_write "no permission to create file '$1'" - fi - fi -} - -#---------------------------------------- -# Checks for shared commands, e.g. --help - -check_common_commands() -{ - while [ $# -gt 0 ] ; do - parm="$1" - shift - - case "$parm" in - --help) - usage - echo "Use 'man xdg-open' or 'xdg-open --manual' for additional info." - exit_success - ;; - - --manual) - manualpage - exit_success - ;; - - --version) - echo "xdg-open 1.1.0 rc3" - exit_success - ;; - esac - done -} - -check_common_commands "$@" - -[ -z "${XDG_UTILS_DEBUG_LEVEL}" ] && unset XDG_UTILS_DEBUG_LEVEL; -if [ ${XDG_UTILS_DEBUG_LEVEL-0} -lt 1 ]; then - # Be silent - xdg_redirect_output=" > /dev/null 2> /dev/null" -else - # All output to stderr - xdg_redirect_output=" >&2" -fi - -#-------------------------------------- -# Checks for known desktop environments -# set variable DE to the desktop environments name, lowercase - -detectDE() -{ - # see https://bugs.freedesktop.org/show_bug.cgi?id=34164 - unset GREP_OPTIONS - - if [ -n "${XDG_CURRENT_DESKTOP}" ]; then - case "${XDG_CURRENT_DESKTOP}" in - ENLIGHTENMENT) - DE=enlightenment; - ;; - GNOME) - DE=gnome; - ;; - KDE) - DE=kde; - ;; - LXDE) - DE=lxde; - ;; - MATE) - DE=mate; - ;; - XFCE) - DE=xfce - ;; - esac - fi - - if [ x"$DE" = x"" ]; then - # classic fallbacks - if [ x"$KDE_FULL_SESSION" != x"" ]; then DE=kde; - elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome; - elif [ x"$MATE_DESKTOP_SESSION_ID" != x"" ]; then DE=mate; - elif `dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.GetNameOwner string:org.gnome.SessionManager > /dev/null 2>&1` ; then DE=gnome; - elif xprop -root _DT_SAVE_MODE 2> /dev/null | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce; - elif xprop -root 2> /dev/null | grep -i '^xfce_desktop_window' >/dev/null 2>&1; then DE=xfce - elif echo $DESKTOP | grep -q '^Enlightenment'; then DE=enlightenment; - fi - fi - - if [ x"$DE" = x"" ]; then - # fallback to checking $DESKTOP_SESSION - case "$DESKTOP_SESSION" in - gnome) - DE=gnome; - ;; - LXDE|Lubuntu) - DE=lxde; - ;; - MATE) - DE=mate; - ;; - xfce|xfce4|'Xfce Session') - DE=xfce; - ;; - esac - fi - - if [ x"$DE" = x"" ]; then - # fallback to uname output for other platforms - case "$(uname 2>/dev/null)" in - Darwin) - DE=darwin; - ;; - esac - fi - - if [ x"$DE" = x"gnome" ]; then - # gnome-default-applications-properties is only available in GNOME 2.x - # but not in GNOME 3.x - which gnome-default-applications-properties > /dev/null 2>&1 || DE="gnome3" - fi -} - -#---------------------------------------------------------------------------- -# kfmclient exec/openURL can give bogus exit value in KDE <= 3.5.4 -# It also always returns 1 in KDE 3.4 and earlier -# Simply return 0 in such case - -kfmclient_fix_exit_code() -{ - version=`LC_ALL=C.UTF-8 kde-config --version 2>/dev/null | grep '^KDE'` - major=`echo $version | sed 's/KDE.*: \([0-9]\).*/\1/'` - minor=`echo $version | sed 's/KDE.*: [0-9]*\.\([0-9]\).*/\1/'` - release=`echo $version | sed 's/KDE.*: [0-9]*\.[0-9]*\.\([0-9]\).*/\1/'` - test "$major" -gt 3 && return $1 - test "$minor" -gt 5 && return $1 - test "$release" -gt 4 && return $1 - return 0 -} - -# This handles backslashes but not quote marks. -last_word() -{ - read first rest - echo "$rest" -} - -# Get the value of a key in a desktop file's Desktop Entry group. -# Example: Use get_key foo.desktop Exec -# to get the values of the Exec= key for the Desktop Entry group. -get_key() -{ - local file="${1}" - local key="${2}" - local desktop_entry="" - - IFS_="${IFS}" - IFS="" - while read line - do - case "$line" in - "[Desktop Entry]") - desktop_entry="y" - ;; - # Reset match flag for other groups - "["*) - desktop_entry="" - ;; - "${key}="*) - # Only match Desktop Entry group - if [ -n "${desktop_entry}" ] - then - echo "${line}" | cut -d= -f 2- - fi - esac - done < "${file}" - IFS="${IFS_}" -} - -open_darwin() -{ - open "$1" - - if [ $? -eq 0 ]; then - exit_success - else - exit_failure_operation_failed - fi -} - -open_kde() -{ - if [ -n "${KDE_SESSION_VERSION}" ]; then - case "${KDE_SESSION_VERSION}" in - 4) - kde-open "$1" - ;; - 5) - kde-open${KDE_SESSION_VERSION} "$1" - ;; - esac - else - kfmclient exec "$1" - kfmclient_fix_exit_code $? - fi - - if [ $? -eq 0 ]; then - exit_success - else - exit_failure_operation_failed - fi -} - -open_gnome() -{ - if gvfs-open --help 2>/dev/null 1>&2; then - gvfs-open "$1" - else - gnome-open "$1" - fi - - if [ $? -eq 0 ]; then - exit_success - else - exit_failure_operation_failed - fi -} - -open_mate() -{ - if gvfs-open --help 2>/dev/null 1>&2; then - gvfs-open "$1" - else - mate-open "$1" - fi - - if [ $? -eq 0 ]; then - exit_success - else - exit_failure_operation_failed - fi -} - -open_xfce() -{ - exo-open "$1" - - if [ $? -eq 0 ]; then - exit_success - else - exit_failure_operation_failed - fi -} - -open_enlightenment() -{ - enlightenment_open "$1" - - if [ $? -eq 0 ]; then - exit_success - else - exit_failure_operation_failed - fi -} - -#----------------------------------------- -# Recursively search .desktop file - -search_desktop_file() -{ - local default="$1" - local dir="$2" - local target="$3" - - local file="" - # look for both vendor-app.desktop, vendor/app.desktop - if [ -r "$dir/$default" ]; then - file="$dir/$default" - elif [ -r "$dir/`echo $default | sed -e 's|-|/|'`" ]; then - file="$dir/`echo $default | sed -e 's|-|/|'`" - fi - - if [ -r "$file" ] ; then - command="$(get_key "${file}" "Exec" | first_word)" - command_exec=`which $command 2>/dev/null` - icon="$(get_key "${file}" "Icon")" - # FIXME: Actually LC_MESSAGES should be used as described in - # http://standards.freedesktop.org/desktop-entry-spec/latest/ar01s04.html - localised_name="$(get_key "${file}" "Name")" - set -- $(get_key "${file}" "Exec" | last_word) - # We need to replace any occurrence of "%f", "%F" and - # the like by the target file. We examine each - # argument and append the modified argument to the - # end then shift. - local args=$# - local replaced=0 - while [ $args -gt 0 ]; do - case $1 in - %[c]) - replaced=1 - arg="${localised_name}" - shift - set -- "$@" "$arg" - ;; - %[fFuU]) - replaced=1 - arg="$target" - shift - set -- "$@" "$arg" - ;; - %[i]) - replaced=1 - shift - set -- "$@" "--icon" "$icon" - ;; - *) - arg="$1" - shift - set -- "$@" "$arg" - ;; - esac - args=$(( $args - 1 )) - done - [ $replaced -eq 1 ] || set -- "$@" "$target" - "$command_exec" "$@" - - if [ $? -eq 0 ]; then - exit_success - fi - fi - - for d in $dir/*/; do - [ -d "$d" ] && search_desktop_file "$default" "$d" "$target" - done -} - - -open_generic_xdg_mime() -{ - filetype="$2" - default=`xdg-mime query default "$filetype"` - if [ -n "$default" ] ; then - xdg_user_dir="$XDG_DATA_HOME" - [ -n "$xdg_user_dir" ] || xdg_user_dir="$HOME/.local/share" - - xdg_system_dirs="$XDG_DATA_DIRS" - [ -n "$xdg_system_dirs" ] || xdg_system_dirs=/usr/local/share/:/usr/share/ - -DEBUG 3 "$xdg_user_dir:$xdg_system_dirs" - for x in `echo "$xdg_user_dir:$xdg_system_dirs" | sed 's/:/ /g'`; do - search_desktop_file "$default" "$x/applications/" "$1" - done - fi -} - -open_generic_xdg_file_mime() -{ - filetype=`xdg-mime query filetype "$1" | sed "s/;.*//"` - open_generic_xdg_mime "$1" "$filetype" -} - -open_generic_xdg_x_scheme_handler() -{ - scheme="`echo $1 | sed -n 's/\(^[[:alnum:]+\.-]*\):.*$/\1/p'`" - if [ -n $scheme ]; then - filetype="x-scheme-handler/$scheme" - open_generic_xdg_mime "$1" "$filetype" - fi -} - -open_generic() -{ - # Paths or file:// URLs - if (echo "$1" | grep -q '^file://' || - ! echo "$1" | egrep -q '^[[:alpha:]+\.\-]+:'); then - - local file="$1" - - # Decode URLs - if echo "$file" | grep -q '^file:///'; then - file=${file#file://} - file="$(printf "$(echo "$file" | sed -e 's@%\([a-f0-9A-F]\{2\}\)@\\x\1@g')")" - fi - file_check=${file%%#*} - file_check=${file_check%%\?*} - check_input_file "$file_check" - - filetype=`xdg-mime query filetype "$file_check" | sed "s/;.*//"` - open_generic_xdg_mime "$file" "$filetype" - - if which run-mailcap 2>/dev/null 1>&2; then - run-mailcap --action=view "$file" - if [ $? -eq 0 ]; then - exit_success - fi - fi - - if mimeopen -v 2>/dev/null 1>&2; then - mimeopen -L -n "$file" - if [ $? -eq 0 ]; then - exit_success - fi - fi - fi - - open_generic_xdg_x_scheme_handler "$1" - - IFS=":" - for browser in $BROWSER; do - if [ x"$browser" != x"" ]; then - - browser_with_arg=`printf "$browser" "$1" 2>/dev/null` - if [ $? -ne 0 ]; then - browser_with_arg=$browser; - fi - - if [ x"$browser_with_arg" = x"$browser" ]; then - eval '$browser "$1"'$xdg_redirect_output; - else eval '$browser_with_arg'$xdg_redirect_output; - fi - - if [ $? -eq 0 ]; then - exit_success; - fi - fi - done - - exit_failure_operation_impossible "no method available for opening '$1'" -} - -open_lxde() -{ - # pcmanfm only knows how to handle file:// urls and filepaths, it seems. - if (echo "$1" | grep -q '^file://' || - ! echo "$1" | egrep -q '^[[:alpha:]+\.\-]+:') - then - local file="$1" - - # handle relative paths - if ! echo "$file" | egrep -q '^(file://)?/'; then - file="$(pwd)/$file" - fi - - pcmanfm "$file" - - else - open_generic "$1" - fi - - if [ $? -eq 0 ]; then - exit_success - else - exit_failure_operation_failed - fi -} - -[ x"$1" != x"" ] || exit_failure_syntax - -url= -while [ $# -gt 0 ] ; do - parm="$1" - shift - - case "$parm" in - -*) - exit_failure_syntax "unexpected option '$parm'" - ;; - - *) - if [ -n "$url" ] ; then - exit_failure_syntax "unexpected argument '$parm'" - fi - url="$parm" - ;; - esac -done - -if [ -z "${url}" ] ; then - exit_failure_syntax "file or URL argument missing" -fi - -detectDE - -if [ x"$DE" = x"" ]; then - DE=generic -fi - -DEBUG 2 "Selected DE $DE" - -# sanitize BROWSER (avoid caling ourselves in particular) -case "${BROWSER}" in - *:"xdg-open"|"xdg-open":*) - BROWSER=$(echo $BROWSER | sed -e 's|:xdg-open||g' -e 's|xdg-open:||g') - ;; - "xdg-open") - BROWSER= - ;; -esac - -# if BROWSER variable is not set, check some well known browsers instead -if [ x"$BROWSER" = x"" ]; then - BROWSER=links2:elinks:links:lynx:w3m - if [ -n "$DISPLAY" ]; then - BROWSER=x-www-browser:firefox:seamonkey:mozilla:epiphany:konqueror:chromium-browser:google-chrome:$BROWSER - fi -fi - -case "$DE" in - kde) - open_kde "$url" - ;; - - gnome*) - open_gnome "$url" - ;; - - mate) - open_mate "$url" - ;; - - xfce) - open_xfce "$url" - ;; - - lxde) - open_lxde "$url" - ;; - - enlightenment) - open_enlightenment "$url" - ;; - - generic) - open_generic "$url" - ;; - - *) - exit_failure_operation_impossible "no method available for opening '$url'" - ;; -esac diff --git a/src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/pinkie-promise/index.js b/src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/pinkie-promise/index.js deleted file mode 100644 index 777377a1f77..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/pinkie-promise/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = typeof Promise === 'function' ? Promise : require('pinkie'); diff --git a/src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/pinkie-promise/license b/src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/pinkie-promise/license deleted file mode 100644 index 1aeb74fd25e..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/pinkie-promise/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Vsevolod Strukchinsky (github.com/floatdrop) - -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/src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/pinkie-promise/package.json b/src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/pinkie-promise/package.json deleted file mode 100644 index a02e8f465e0..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/pinkie-promise/package.json +++ /dev/null @@ -1,94 +0,0 @@ -{ - "_args": [ - [ - "pinkie-promise@^2.0.0", - "/Users/Filippo/Documents/git/brackets/src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/opn" - ] - ], - "_from": "pinkie-promise@>=2.0.0 <3.0.0", - "_id": "pinkie-promise@2.0.1", - "_inCache": true, - "_installable": true, - "_location": "/pinkie-promise", - "_nodeVersion": "4.4.1", - "_npmOperationalInternal": { - "host": "packages-16-east.internal.npmjs.com", - "tmp": "tmp/pinkie-promise-2.0.1.tgz_1460309839126_0.3422858319245279" - }, - "_npmUser": { - "email": "floatdrop@gmail.com", - "name": "floatdrop" - }, - "_npmVersion": "2.14.20", - "_phantomChildren": {}, - "_requested": { - "name": "pinkie-promise", - "raw": "pinkie-promise@^2.0.0", - "rawSpec": "^2.0.0", - "scope": null, - "spec": ">=2.0.0 <3.0.0", - "type": "range" - }, - "_requiredBy": [ - "/opn" - ], - "_resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", - "_shasum": "2135d6dfa7a358c069ac9b178776288228450ffa", - "_shrinkwrap": null, - "_spec": "pinkie-promise@^2.0.0", - "_where": "/Users/Filippo/Documents/git/brackets/src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/opn", - "author": { - "email": "floatdrop@gmail.com", - "name": "Vsevolod Strukchinsky", - "url": "github.com/floatdrop" - }, - "bugs": { - "url": "https://github.com/floatdrop/pinkie-promise/issues" - }, - "dependencies": { - "pinkie": "^2.0.0" - }, - "description": "ES2015 Promise ponyfill", - "devDependencies": { - "mocha": "*" - }, - "directories": {}, - "dist": { - "shasum": "2135d6dfa7a358c069ac9b178776288228450ffa", - "tarball": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "gitHead": "4a936c09c34ad591a25db93f1216d242de0d6184", - "homepage": "https://github.com/floatdrop/pinkie-promise", - "keywords": [ - "promise", - "promises", - "es2015", - "es6", - "polyfill", - "ponyfill" - ], - "license": "MIT", - "maintainers": [ - { - "email": "floatdrop@gmail.com", - "name": "floatdrop" - } - ], - "name": "pinkie-promise", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/floatdrop/pinkie-promise.git" - }, - "scripts": { - "test": "mocha" - }, - "version": "2.0.1" -} diff --git a/src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/pinkie-promise/readme.md b/src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/pinkie-promise/readme.md deleted file mode 100644 index 78477f4297d..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/pinkie-promise/readme.md +++ /dev/null @@ -1,28 +0,0 @@ -# pinkie-promise [![Build Status](https://travis-ci.org/floatdrop/pinkie-promise.svg?branch=master)](https://travis-ci.org/floatdrop/pinkie-promise) - -> [ES2015 Promise](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-promise-objects) ponyfill - -Module exports global Promise object (if available) or [`pinkie`](http://github.com/floatdrop/pinkie) Promise polyfill. - -## Install - -``` -$ npm install --save pinkie-promise -``` - -## Usage - -```js -var Promise = require('pinkie-promise'); - -new Promise(function (resolve) { resolve('unicorns'); }); -//=> Promise { 'unicorns' } -``` - -## Related - -- [pify](https://github.com/sindresorhus/pify) - Promisify a callback-style function - -## License - -MIT © [Vsevolod Strukchinsky](http://github.com/floatdrop) diff --git a/src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/pinkie/index.js b/src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/pinkie/index.js deleted file mode 100644 index 14ce1bfe3d4..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/pinkie/index.js +++ /dev/null @@ -1,292 +0,0 @@ -'use strict'; - -var PENDING = 'pending'; -var SETTLED = 'settled'; -var FULFILLED = 'fulfilled'; -var REJECTED = 'rejected'; -var NOOP = function () {}; -var isNode = typeof global !== 'undefined' && typeof global.process !== 'undefined' && typeof global.process.emit === 'function'; - -var asyncSetTimer = typeof setImmediate === 'undefined' ? setTimeout : setImmediate; -var asyncQueue = []; -var asyncTimer; - -function asyncFlush() { - // run promise callbacks - for (var i = 0; i < asyncQueue.length; i++) { - asyncQueue[i][0](asyncQueue[i][1]); - } - - // reset async asyncQueue - asyncQueue = []; - asyncTimer = false; -} - -function asyncCall(callback, arg) { - asyncQueue.push([callback, arg]); - - if (!asyncTimer) { - asyncTimer = true; - asyncSetTimer(asyncFlush, 0); - } -} - -function invokeResolver(resolver, promise) { - function resolvePromise(value) { - resolve(promise, value); - } - - function rejectPromise(reason) { - reject(promise, reason); - } - - try { - resolver(resolvePromise, rejectPromise); - } catch (e) { - rejectPromise(e); - } -} - -function invokeCallback(subscriber) { - var owner = subscriber.owner; - var settled = owner._state; - var value = owner._data; - var callback = subscriber[settled]; - var promise = subscriber.then; - - if (typeof callback === 'function') { - settled = FULFILLED; - try { - value = callback(value); - } catch (e) { - reject(promise, e); - } - } - - if (!handleThenable(promise, value)) { - if (settled === FULFILLED) { - resolve(promise, value); - } - - if (settled === REJECTED) { - reject(promise, value); - } - } -} - -function handleThenable(promise, value) { - var resolved; - - try { - if (promise === value) { - throw new TypeError('A promises callback cannot return that same promise.'); - } - - if (value && (typeof value === 'function' || typeof value === 'object')) { - // then should be retrieved only once - var then = value.then; - - if (typeof then === 'function') { - then.call(value, function (val) { - if (!resolved) { - resolved = true; - - if (value === val) { - fulfill(promise, val); - } else { - resolve(promise, val); - } - } - }, function (reason) { - if (!resolved) { - resolved = true; - - reject(promise, reason); - } - }); - - return true; - } - } - } catch (e) { - if (!resolved) { - reject(promise, e); - } - - return true; - } - - return false; -} - -function resolve(promise, value) { - if (promise === value || !handleThenable(promise, value)) { - fulfill(promise, value); - } -} - -function fulfill(promise, value) { - if (promise._state === PENDING) { - promise._state = SETTLED; - promise._data = value; - - asyncCall(publishFulfillment, promise); - } -} - -function reject(promise, reason) { - if (promise._state === PENDING) { - promise._state = SETTLED; - promise._data = reason; - - asyncCall(publishRejection, promise); - } -} - -function publish(promise) { - promise._then = promise._then.forEach(invokeCallback); -} - -function publishFulfillment(promise) { - promise._state = FULFILLED; - publish(promise); -} - -function publishRejection(promise) { - promise._state = REJECTED; - publish(promise); - if (!promise._handled && isNode) { - global.process.emit('unhandledRejection', promise._data, promise); - } -} - -function notifyRejectionHandled(promise) { - global.process.emit('rejectionHandled', promise); -} - -/** - * @class - */ -function Promise(resolver) { - if (typeof resolver !== 'function') { - throw new TypeError('Promise resolver ' + resolver + ' is not a function'); - } - - if (this instanceof Promise === false) { - throw new TypeError('Failed to construct \'Promise\': Please use the \'new\' operator, this object constructor cannot be called as a function.'); - } - - this._then = []; - - invokeResolver(resolver, this); -} - -Promise.prototype = { - constructor: Promise, - - _state: PENDING, - _then: null, - _data: undefined, - _handled: false, - - then: function (onFulfillment, onRejection) { - var subscriber = { - owner: this, - then: new this.constructor(NOOP), - fulfilled: onFulfillment, - rejected: onRejection - }; - - if ((onRejection || onFulfillment) && !this._handled) { - this._handled = true; - if (this._state === REJECTED && isNode) { - asyncCall(notifyRejectionHandled, this); - } - } - - if (this._state === FULFILLED || this._state === REJECTED) { - // already resolved, call callback async - asyncCall(invokeCallback, subscriber); - } else { - // subscribe - this._then.push(subscriber); - } - - return subscriber.then; - }, - - catch: function (onRejection) { - return this.then(null, onRejection); - } -}; - -Promise.all = function (promises) { - if (!Array.isArray(promises)) { - throw new TypeError('You must pass an array to Promise.all().'); - } - - return new Promise(function (resolve, reject) { - var results = []; - var remaining = 0; - - function resolver(index) { - remaining++; - return function (value) { - results[index] = value; - if (!--remaining) { - resolve(results); - } - }; - } - - for (var i = 0, promise; i < promises.length; i++) { - promise = promises[i]; - - if (promise && typeof promise.then === 'function') { - promise.then(resolver(i), reject); - } else { - results[i] = promise; - } - } - - if (!remaining) { - resolve(results); - } - }); -}; - -Promise.race = function (promises) { - if (!Array.isArray(promises)) { - throw new TypeError('You must pass an array to Promise.race().'); - } - - return new Promise(function (resolve, reject) { - for (var i = 0, promise; i < promises.length; i++) { - promise = promises[i]; - - if (promise && typeof promise.then === 'function') { - promise.then(resolve, reject); - } else { - resolve(promise); - } - } - }); -}; - -Promise.resolve = function (value) { - if (value && typeof value === 'object' && value.constructor === Promise) { - return value; - } - - return new Promise(function (resolve) { - resolve(value); - }); -}; - -Promise.reject = function (reason) { - return new Promise(function (resolve, reject) { - reject(reason); - }); -}; - -module.exports = Promise; diff --git a/src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/pinkie/license b/src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/pinkie/license deleted file mode 100644 index 1aeb74fd25e..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/pinkie/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Vsevolod Strukchinsky (github.com/floatdrop) - -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/src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/pinkie/package.json b/src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/pinkie/package.json deleted file mode 100644 index 096b2057a3a..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/pinkie/package.json +++ /dev/null @@ -1,92 +0,0 @@ -{ - "_args": [ - [ - "pinkie@^2.0.0", - "/Users/Filippo/Documents/git/brackets/src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/pinkie-promise" - ] - ], - "_from": "pinkie@>=2.0.0 <3.0.0", - "_id": "pinkie@2.0.4", - "_inCache": true, - "_installable": true, - "_location": "/pinkie", - "_nodeVersion": "4.2.4", - "_npmUser": { - "email": "floatdrop@gmail.com", - "name": "floatdrop" - }, - "_npmVersion": "2.14.12", - "_phantomChildren": {}, - "_requested": { - "name": "pinkie", - "raw": "pinkie@^2.0.0", - "rawSpec": "^2.0.0", - "scope": null, - "spec": ">=2.0.0 <3.0.0", - "type": "range" - }, - "_requiredBy": [ - "/pinkie-promise" - ], - "_resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "_shasum": "72556b80cfa0d48a974e80e77248e80ed4f7f870", - "_shrinkwrap": null, - "_spec": "pinkie@^2.0.0", - "_where": "/Users/Filippo/Documents/git/brackets/src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/pinkie-promise", - "author": { - "email": "floatdrop@gmail.com", - "name": "Vsevolod Strukchinsky", - "url": "github.com/floatdrop" - }, - "bugs": { - "url": "https://github.com/floatdrop/pinkie/issues" - }, - "dependencies": {}, - "description": "Itty bitty little widdle twinkie pinkie ES2015 Promise implementation", - "devDependencies": { - "core-assert": "^0.1.1", - "coveralls": "^2.11.4", - "mocha": "*", - "nyc": "^3.2.2", - "promises-aplus-tests": "*", - "xo": "^0.10.1" - }, - "directories": {}, - "dist": { - "shasum": "72556b80cfa0d48a974e80e77248e80ed4f7f870", - "tarball": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "gitHead": "8d4a92447a5c62bff9f89756caeb4c9c8770579b", - "homepage": "https://github.com/floatdrop/pinkie", - "keywords": [ - "promise", - "promises", - "es2015", - "es6" - ], - "license": "MIT", - "maintainers": [ - { - "email": "floatdrop@gmail.com", - "name": "floatdrop" - } - ], - "name": "pinkie", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/floatdrop/pinkie.git" - }, - "scripts": { - "coverage": "nyc report --reporter=text-lcov | coveralls", - "test": "xo && nyc mocha" - }, - "version": "2.0.4" -} diff --git a/src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/pinkie/readme.md b/src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/pinkie/readme.md deleted file mode 100644 index 1565f958896..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/launchers/node/node_modules/pinkie/readme.md +++ /dev/null @@ -1,83 +0,0 @@ -

    -
    - pinkie -
    -
    -

    - -> Itty bitty little widdle twinkie pinkie [ES2015 Promise](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-promise-objects) implementation - -[![Build Status](https://travis-ci.org/floatdrop/pinkie.svg?branch=master)](https://travis-ci.org/floatdrop/pinkie) [![Coverage Status](https://coveralls.io/repos/floatdrop/pinkie/badge.svg?branch=master&service=github)](https://coveralls.io/github/floatdrop/pinkie?branch=master) - -There are [tons of Promise implementations](https://github.com/promises-aplus/promises-spec/blob/master/implementations.md#standalone) out there, but all of them focus on browser compatibility and are often bloated with functionality. - -This module is an exact Promise specification polyfill (like [native-promise-only](https://github.com/getify/native-promise-only)), but in Node.js land (it should be browserify-able though). - - -## Install - -``` -$ npm install --save pinkie -``` - - -## Usage - -```js -var fs = require('fs'); -var Promise = require('pinkie'); - -new Promise(function (resolve, reject) { - fs.readFile('foo.json', 'utf8', function (err, data) { - if (err) { - reject(err); - return; - } - - resolve(data); - }); -}); -//=> Promise -``` - - -### API - -`pinkie` exports bare [ES2015 Promise](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-promise-objects) implementation and polyfills [Node.js rejection events](https://nodejs.org/api/process.html#process_event_unhandledrejection). In case you forgot: - -#### new Promise(executor) - -Returns new instance of `Promise`. - -##### executor - -*Required* -Type: `function` - -Function with two arguments `resolve` and `reject`. The first argument fulfills the promise, the second argument rejects it. - -#### pinkie.all(promises) - -Returns a promise that resolves when all of the promises in the `promises` Array argument have resolved. - -#### pinkie.race(promises) - -Returns a promise that resolves or rejects as soon as one of the promises in the `promises` Array resolves or rejects, with the value or reason from that promise. - -#### pinkie.reject(reason) - -Returns a Promise object that is rejected with the given `reason`. - -#### pinkie.resolve(value) - -Returns a Promise object that is resolved with the given `value`. If the `value` is a thenable (i.e. has a then method), the returned promise will "follow" that thenable, adopting its eventual state; otherwise the returned promise will be fulfilled with the `value`. - - -## Related - -- [pinkie-promise](https://github.com/floatdrop/pinkie-promise) - Returns the native Promise or this module - - -## License - -MIT © [Vsevolod Strukchinsky](http://github.com/floatdrop) diff --git a/src/LiveDevelopment/MultiBrowserImpl/launchers/node/package.json b/src/LiveDevelopment/MultiBrowserImpl/launchers/node/package.json deleted file mode 100644 index 994a54144c5..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/launchers/node/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "livedev-multibrowser-launchers", - "dependencies": { - "opn": "4.0.2" - } -} diff --git a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/.bin/wscat b/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/.bin/wscat deleted file mode 100644 index 1a710cfd651..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/.bin/wscat +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -basedir=`dirname "$0"` - -case `uname` in - *CYGWIN*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - "$basedir/node" "$basedir/../ws/bin/wscat" "$@" - ret=$? -else - node "$basedir/../ws/bin/wscat" "$@" - ret=$? -fi -exit $ret diff --git a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/.bin/wscat.cmd b/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/.bin/wscat.cmd deleted file mode 100644 index a681b37aade..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/.bin/wscat.cmd +++ /dev/null @@ -1,5 +0,0 @@ -@IF EXIST "%~dp0\node.exe" ( - "%~dp0\node.exe" "%~dp0\..\ws\bin\wscat" %* -) ELSE ( - node "%~dp0\..\ws\bin\wscat" %* -) \ No newline at end of file diff --git a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/lodash/LICENSE.txt b/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/lodash/LICENSE.txt deleted file mode 100644 index 49869bbab37..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/lodash/LICENSE.txt +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2013 The Dojo Foundation -Based on Underscore.js 1.5.2, copyright 2009-2013 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. \ No newline at end of file diff --git a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/lodash/README.md b/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/lodash/README.md deleted file mode 100644 index 6f9598e8a9d..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/lodash/README.md +++ /dev/null @@ -1,163 +0,0 @@ -# Lo-Dash v2.4.1 -A utility library delivering consistency, [customization](http://lodash.com/custom-builds), [performance](http://lodash.com/benchmarks), & [extras](http://lodash.com/#features). - -## Download - -Check out our [wiki]([https://github.com/lodash/lodash/wiki/build-differences]) for details over the differences between builds. - -* Modern builds perfect for newer browsers/environments:
    -[Development](https://raw.github.com/lodash/lodash/2.4.1/dist/lodash.js) & -[Production](https://raw.github.com/lodash/lodash/2.4.1/dist/lodash.min.js) - -* Compatibility builds for older environment support too:
    -[Development](https://raw.github.com/lodash/lodash/2.4.1/dist/lodash.compat.js) & -[Production](https://raw.github.com/lodash/lodash/2.4.1/dist/lodash.compat.min.js) - -* Underscore builds to use as a drop-in replacement:
    -[Development](https://raw.github.com/lodash/lodash/2.4.1/dist/lodash.underscore.js) & -[Production](https://raw.github.com/lodash/lodash/2.4.1/dist/lodash.underscore.min.js) - -CDN copies are available on [cdnjs](http://cdnjs.com/libraries/lodash.js/) & [jsDelivr](http://www.jsdelivr.com/#!lodash). For smaller file sizes, create [custom builds](http://lodash.com/custom-builds) with only the features needed. - -Love modules? We’ve got you covered with [lodash-amd](https://npmjs.org/package/lodash-amd), [lodash-es6](https://github.com/lodash/lodash-es6), [lodash-node](https://npmjs.org/package/lodash-node), & [npm packages](https://npmjs.org/browse/keyword/lodash-modularized) per method. - -## Dive in - -There’s plenty of **[documentation](http://lodash.com/docs)**, [unit tests](http://lodash.com/tests), & [benchmarks](http://lodash.com/benchmarks).
    -Check out DevDocs as a fast, organized, & searchable interface for our documentation. - -The full changelog for this release is available on our [wiki](https://github.com/lodash/lodash/wiki/Changelog).
    -A list of upcoming features is available on our [roadmap](https://github.com/lodash/lodash/wiki/Roadmap). - -## Features *not* in Underscore - - * AMD loader support ([curl](https://github.com/cujojs/curl), [dojo](http://dojotoolkit.org/), [requirejs](http://requirejs.org/), etc.) - * [_(…)](http://lodash.com/docs#_) supports intuitive chaining - * [_.at](http://lodash.com/docs#at) for cherry-picking collection values - * [_.bindKey](http://lodash.com/docs#bindKey) for binding [*“lazy”*](http://michaux.ca/articles/lazy-function-definition-pattern) defined methods - * [_.clone](http://lodash.com/docs#clone) supports shallow cloning of `Date` & `RegExp` objects - * [_.cloneDeep](http://lodash.com/docs#cloneDeep) for deep cloning arrays & objects - * [_.constant](http://lodash.com/docs#constant) & [_.property](http://lodash.com/docs#property) function generators for composing functions - * [_.contains](http://lodash.com/docs#contains) accepts a `fromIndex` - * [_.create](http://lodash.com/docs#create) for easier object inheritance - * [_.createCallback](http://lodash.com/docs#createCallback) for extending callbacks in methods & mixins - * [_.curry](http://lodash.com/docs#curry) for creating [curried](http://hughfdjackson.com/javascript/2013/07/06/why-curry-helps/) functions - * [_.debounce](http://lodash.com/docs#debounce) & [_.throttle](http://lodash.com/docs#throttle) accept additional `options` for more control - * [_.findIndex](http://lodash.com/docs#findIndex) & [_.findKey](http://lodash.com/docs#findKey) for finding indexes & keys - * [_.forEach](http://lodash.com/docs#forEach) is chainable & supports exiting early - * [_.forIn](http://lodash.com/docs#forIn) for iterating own & inherited properties - * [_.forOwn](http://lodash.com/docs#forOwn) for iterating own properties - * [_.isPlainObject](http://lodash.com/docs#isPlainObject) for checking if values are created by `Object` - * [_.mapValues](http://lodash.com/docs#mapValues) for [mapping](http://lodash.com/docs#map) values to an object - * [_.memoize](http://lodash.com/docs#memoize) exposes the `cache` of memoized functions - * [_.merge](http://lodash.com/docs#merge) for a deep [_.extend](http://lodash.com/docs#extend) - * [_.noop](http://lodash.com/docs#noop) for function placeholders - * [_.now](http://lodash.com/docs#now) as a cross-browser `Date.now` alternative - * [_.parseInt](http://lodash.com/docs#parseInt) for consistent behavior - * [_.pull](http://lodash.com/docs#pull) & [_.remove](http://lodash.com/docs#remove) for mutating arrays - * [_.random](http://lodash.com/docs#random) supports returning floating-point numbers - * [_.runInContext](http://lodash.com/docs#runInContext) for easier mocking - * [_.sortBy](http://lodash.com/docs#sortBy) supports sorting by multiple properties - * [_.support](http://lodash.com/docs#support) for flagging environment features - * [_.template](http://lodash.com/docs#template) supports [*“imports”*](http://lodash.com/docs#templateSettings_imports) options & [ES6 template delimiters](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-literals-string-literals) - * [_.transform](http://lodash.com/docs#transform) as a powerful alternative to [_.reduce](http://lodash.com/docs#reduce) for transforming objects - * [_.where](http://lodash.com/docs#where) supports deep object comparisons - * [_.xor](http://lodash.com/docs#xor) as a companion to [_.difference](http://lodash.com/docs#difference), [_.intersection](http://lodash.com/docs#intersection), & [_.union](http://lodash.com/docs#union) - * [_.zip](http://lodash.com/docs#zip) is capable of unzipping values - * [_.omit](http://lodash.com/docs#omit), [_.pick](http://lodash.com/docs#pick), & - [more](http://lodash.com/docs "_.assign, _.clone, _.cloneDeep, _.first, _.initial, _.isEqual, _.last, _.merge, _.rest") accept callbacks - * [_.contains](http://lodash.com/docs#contains), [_.toArray](http://lodash.com/docs#toArray), & - [more](http://lodash.com/docs "_.at, _.countBy, _.every, _.filter, _.find, _.forEach, _.forEachRight, _.groupBy, _.invoke, _.map, _.max, _.min, _.pluck, _.reduce, _.reduceRight, _.reject, _.shuffle, _.size, _.some, _.sortBy, _.where") accept strings - * [_.filter](http://lodash.com/docs#filter), [_.map](http://lodash.com/docs#map), & - [more](http://lodash.com/docs "_.countBy, _.every, _.find, _.findKey, _.findLast, _.findLastIndex, _.findLastKey, _.first, _.groupBy, _.initial, _.last, _.max, _.min, _.reject, _.rest, _.some, _.sortBy, _.sortedIndex, _.uniq") support *“_.pluck”* & *“_.where”* shorthands - * [_.findLast](http://lodash.com/docs#findLast), [_.findLastIndex](http://lodash.com/docs#findLastIndex), & - [more](http://lodash.com/docs "_.findLastKey, _.forEachRight, _.forInRight, _.forOwnRight, _.partialRight") right-associative methods - -## Resources - - * Podcasts - - [JavaScript Jabber](http://javascriptjabber.com/079-jsj-lo-dash-with-john-david-dalton/) - - * Posts - - [Say “Hello” to Lo-Dash](http://kitcambridge.be/blog/say-hello-to-lo-dash/) - - [Custom builds in Lo-Dash 2.0](http://kitcambridge.be/blog/custom-builds-in-lo-dash-2-dot-0/) - - * Videos - - [Introduction](https://vimeo.com/44154599) - - [Origins](https://vimeo.com/44154600) - - [Optimizations & builds](https://vimeo.com/44154601) - - [Native method use](https://vimeo.com/48576012) - - [Testing](https://vimeo.com/45865290) - - [CascadiaJS ’12](http://www.youtube.com/watch?v=dpPy4f_SeEk) - - A list of other community created podcasts, posts, & videos is available on our [wiki](https://github.com/lodash/lodash/wiki/Resources). - -## Support - -Tested in Chrome 5~31, Firefox 2~25, IE 6-11, Opera 9.25~17, Safari 3-7, Node.js 0.6.21~0.10.22, Narwhal 0.3.2, PhantomJS 1.9.2, RingoJS 0.9, & Rhino 1.7RC5.
    -Automated browser test results [are available](https://saucelabs.com/u/lodash) as well as [Travis CI](https://travis-ci.org/) builds for [lodash](https://travis-ci.org/lodash/lodash/), [lodash-cli](https://travis-ci.org/lodash/lodash-cli/), [lodash-amd](https://travis-ci.org/lodash/lodash-amd/), [lodash-node](https://travis-ci.org/lodash/lodash-node/), & [grunt-lodash](https://travis-ci.org/lodash/grunt-lodash). - -Special thanks to [Sauce Labs](https://saucelabs.com/) for providing automated browser testing.
    -[![Sauce Labs](http://lodash.com/_img/sauce.png)](https://saucelabs.com/ "Sauce Labs: Selenium Testing & More") - -## Installation & usage - -In browsers: - -```html - -``` - -Using [`npm`](http://npmjs.org/): - -```bash -npm i --save lodash - -{sudo} npm i -g lodash -npm ln lodash -``` - -In [Node.js](http://nodejs.org/) & [Ringo](http://ringojs.org/): - -```js -var _ = require('lodash'); -// or as Underscore -var _ = require('lodash/dist/lodash.underscore'); -``` - -**Notes:** - * Don’t assign values to [special variable](http://nodejs.org/api/repl.html#repl_repl_features) `_` when in the REPL - * If Lo-Dash is installed globally, run [`npm ln lodash`](http://blog.nodejs.org/2011/03/23/npm-1-0-global-vs-local-installation/) in your project’s root directory *before* requiring it - -In [Rhino](http://www.mozilla.org/rhino/): - -```js -load('lodash.js'); -``` - -In an AMD loader: - -```js -require({ - 'packages': [ - { 'name': 'lodash', 'location': 'path/to/lodash', 'main': 'lodash' } - ] -}, -['lodash'], function(_) { - console.log(_.VERSION); -}); -``` - -## Author - -| [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton "Follow @jdalton on Twitter") | -|---| -| [John-David Dalton](http://allyoucanleet.com/) | - -## Contributors - -| [![twitter/blainebublitz](http://gravatar.com/avatar/ac1c67fd906c9fecd823ce302283b4c1?s=70)](https://twitter.com/blainebublitz "Follow @BlaineBublitz on Twitter") | [![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter") | [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") | -|---|---|---| -| [Blaine Bublitz](http://www.iceddev.com/) | [Kit Cambridge](http://kitcambridge.be/) | [Mathias Bynens](http://mathiasbynens.be/) | - -[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/lodash/lodash/trend.png)](https://bitdeli.com/free "Bitdeli Badge") diff --git a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/lodash/dist/lodash.compat.js b/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/lodash/dist/lodash.compat.js deleted file mode 100644 index 23798ba8538..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/lodash/dist/lodash.compat.js +++ /dev/null @@ -1,7157 +0,0 @@ -/** - * @license - * Lo-Dash 2.4.1 (Custom Build) - * Build: `lodash -o ./dist/lodash.compat.js` - * Copyright 2012-2013 The Dojo Foundation - * Based on Underscore.js 1.5.2 - * Copyright 2009-2013 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 to pool arrays and objects used internally */ - var arrayPool = [], - objectPool = []; - - /** Used to generate unique IDs */ - var idCounter = 0; - - /** Used internally to indicate various things */ - var indicatorObject = {}; - - /** Used to prefix keys to avoid issues with `__proto__` and properties on `Object.prototype` */ - var keyPrefix = +new Date + ''; - - /** Used as the size when optimizations are enabled for large arrays */ - var largeArraySize = 75; - - /** Used as the max size of the `arrayPool` and `objectPool` */ - var maxPoolSize = 40; - - /** Used to detect and test whitespace */ - var whitespace = ( - // whitespace - ' \t\x0B\f\xA0\ufeff' + - - // line terminators - '\n\r\u2028\u2029' + - - // unicode category "Zs" space separators - '\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000' - ); - - /** 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 ES6 template delimiters - * http://people.mozilla.org/~jorendorff/es6-draft.html#sec-literals-string-literals - */ - var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; - - /** Used to match regexp flags from their coerced string values */ - var reFlags = /\w*$/; - - /** Used to detected named functions */ - var reFuncName = /^\s*function[ \n\r\t]+\w/; - - /** Used to match "interpolate" template delimiters */ - var reInterpolate = /<%=([\s\S]+?)%>/g; - - /** Used to match leading whitespace and zeros to be removed */ - var reLeadingSpacesAndZeros = RegExp('^[' + whitespace + ']*0+(?=.$)'); - - /** Used to ensure capturing order of template delimiters */ - var reNoMatch = /($^)/; - - /** Used to detect functions containing a `this` reference */ - var reThis = /\bthis\b/; - - /** Used to match unescaped characters in compiled string literals */ - var reUnescapedString = /['\n\r\t\u2028\u2029\\]/g; - - /** Used to assign default `context` object properties */ - var contextProps = [ - 'Array', 'Boolean', 'Date', 'Error', 'Function', 'Math', 'Number', 'Object', - 'RegExp', 'String', '_', 'attachEvent', 'clearTimeout', 'isFinite', 'isNaN', - 'parseInt', 'setTimeout' - ]; - - /** Used to fix the JScript [[DontEnum]] bug */ - var shadowedProps = [ - 'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', - 'toLocaleString', 'toString', 'valueOf' - ]; - - /** Used to make template sourceURLs easier to identify */ - var templateCounter = 0; - - /** `Object#toString` result shortcuts */ - var argsClass = '[object Arguments]', - arrayClass = '[object Array]', - boolClass = '[object Boolean]', - dateClass = '[object Date]', - errorClass = '[object Error]', - funcClass = '[object Function]', - numberClass = '[object Number]', - objectClass = '[object Object]', - regexpClass = '[object RegExp]', - stringClass = '[object String]'; - - /** Used to identify object classifications that `_.clone` supports */ - var cloneableClasses = {}; - cloneableClasses[funcClass] = false; - cloneableClasses[argsClass] = cloneableClasses[arrayClass] = - cloneableClasses[boolClass] = cloneableClasses[dateClass] = - cloneableClasses[numberClass] = cloneableClasses[objectClass] = - cloneableClasses[regexpClass] = cloneableClasses[stringClass] = true; - - /** Used as an internal `_.debounce` options object */ - var debounceOptions = { - 'leading': false, - 'maxWait': 0, - 'trailing': false - }; - - /** Used as the property descriptor for `__bindData__` */ - var descriptor = { - 'configurable': false, - 'enumerable': false, - 'value': null, - 'writable': false - }; - - /** Used as the data object for `iteratorTemplate` */ - var iteratorData = { - 'args': '', - 'array': null, - 'bottom': '', - 'firstArg': '', - 'init': '', - 'keys': null, - 'loop': '', - 'shadowedProps': null, - 'support': null, - 'top': '', - 'useHas': false - }; - - /** Used to determine if values are of the language type Object */ - var objectTypes = { - 'boolean': false, - 'function': true, - 'object': true, - 'number': false, - 'string': false, - 'undefined': false - }; - - /** Used to escape characters for inclusion in compiled string literals */ - var stringEscapes = { - '\\': '\\', - "'": "'", - '\n': 'n', - '\r': 'r', - '\t': 't', - '\u2028': 'u2028', - '\u2029': 'u2029' - }; - - /** Used as a reference to the global object */ - var root = (objectTypes[typeof window] && window) || this; - - /** 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 the popular CommonJS extension `module.exports` */ - var moduleExports = freeModule && freeModule.exports === freeExports && freeExports; - - /** Detect free variable `global` from Node.js or Browserified code and use it as `root` */ - var freeGlobal = objectTypes[typeof global] && global; - if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal)) { - root = freeGlobal; - } - - /*--------------------------------------------------------------------------*/ - - /** - * The base implementation of `_.indexOf` without support for binary searches - * or `fromIndex` constraints. - * - * @private - * @param {Array} array The array to search. - * @param {*} value The value to search for. - * @param {number} [fromIndex=0] The index to search from. - * @returns {number} Returns the index of the matched value or `-1`. - */ - function baseIndexOf(array, value, fromIndex) { - var index = (fromIndex || 0) - 1, - length = array ? array.length : 0; - - while (++index < length) { - if (array[index] === value) { - return index; - } - } - return -1; - } - - /** - * An implementation of `_.contains` for cache objects that mimics the return - * signature of `_.indexOf` by returning `0` if the value is found, else `-1`. - * - * @private - * @param {Object} cache The cache object to inspect. - * @param {*} value The value to search for. - * @returns {number} Returns `0` if `value` is found, else `-1`. - */ - function cacheIndexOf(cache, value) { - var type = typeof value; - cache = cache.cache; - - if (type == 'boolean' || value == null) { - return cache[value] ? 0 : -1; - } - if (type != 'number' && type != 'string') { - type = 'object'; - } - var key = type == 'number' ? value : keyPrefix + value; - cache = (cache = cache[type]) && cache[key]; - - return type == 'object' - ? (cache && baseIndexOf(cache, value) > -1 ? 0 : -1) - : (cache ? 0 : -1); - } - - /** - * Adds a given value to the corresponding cache object. - * - * @private - * @param {*} value The value to add to the cache. - */ - function cachePush(value) { - var cache = this.cache, - type = typeof value; - - if (type == 'boolean' || value == null) { - cache[value] = true; - } else { - if (type != 'number' && type != 'string') { - type = 'object'; - } - var key = type == 'number' ? value : keyPrefix + value, - typeCache = cache[type] || (cache[type] = {}); - - if (type == 'object') { - (typeCache[key] || (typeCache[key] = [])).push(value); - } else { - typeCache[key] = true; - } - } - } - - /** - * Used by `_.max` and `_.min` as the default callback when a given - * collection is a string value. - * - * @private - * @param {string} value The character to inspect. - * @returns {number} Returns the code unit of given character. - */ - function charAtCallback(value) { - return value.charCodeAt(0); - } - - /** - * Used by `sortBy` to compare transformed `collection` elements, stable sorting - * them in ascending order. - * - * @private - * @param {Object} a The object to compare to `b`. - * @param {Object} b The object to compare to `a`. - * @returns {number} Returns the sort order indicator of `1` or `-1`. - */ - function compareAscending(a, b) { - var ac = a.criteria, - bc = b.criteria, - index = -1, - length = ac.length; - - while (++index < length) { - var value = ac[index], - other = bc[index]; - - if (value !== other) { - if (value > other || typeof value == 'undefined') { - return 1; - } - if (value < other || typeof other == 'undefined') { - return -1; - } - } - } - // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications - // that causes it, under certain circumstances, to return the same value for - // `a` and `b`. See https://github.com/jashkenas/underscore/pull/1247 - // - // This also ensures a stable sort in V8 and other engines. - // See http://code.google.com/p/v8/issues/detail?id=90 - return a.index - b.index; - } - - /** - * Creates a cache object to optimize linear searches of large arrays. - * - * @private - * @param {Array} [array=[]] The array to search. - * @returns {null|Object} Returns the cache object or `null` if caching should not be used. - */ - function createCache(array) { - var index = -1, - length = array.length, - first = array[0], - mid = array[(length / 2) | 0], - last = array[length - 1]; - - if (first && typeof first == 'object' && - mid && typeof mid == 'object' && last && typeof last == 'object') { - return false; - } - var cache = getObject(); - cache['false'] = cache['null'] = cache['true'] = cache['undefined'] = false; - - var result = getObject(); - result.array = array; - result.cache = cache; - result.push = cachePush; - - while (++index < length) { - result.push(array[index]); - } - return result; - } - - /** - * Used by `template` to escape characters for inclusion in compiled - * string literals. - * - * @private - * @param {string} match The matched character to escape. - * @returns {string} Returns the escaped character. - */ - function escapeStringChar(match) { - return '\\' + stringEscapes[match]; - } - - /** - * Gets an array from the array pool or creates a new one if the pool is empty. - * - * @private - * @returns {Array} The array from the pool. - */ - function getArray() { - return arrayPool.pop() || []; - } - - /** - * Gets an object from the object pool or creates a new one if the pool is empty. - * - * @private - * @returns {Object} The object from the pool. - */ - function getObject() { - return objectPool.pop() || { - 'array': null, - 'cache': null, - 'criteria': null, - 'false': false, - 'index': 0, - 'null': false, - 'number': null, - 'object': null, - 'push': null, - 'string': null, - 'true': false, - 'undefined': false, - 'value': null - }; - } - - /** - * Checks if `value` is a DOM node in IE < 9. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if the `value` is a DOM node, else `false`. - */ - function isNode(value) { - // IE < 9 presents DOM nodes as `Object` objects except they have `toString` - // methods that are `typeof` "string" and still can coerce nodes to strings - return typeof value.toString != 'function' && typeof (value + '') == 'string'; - } - - /** - * Releases the given array back to the array pool. - * - * @private - * @param {Array} [array] The array to release. - */ - function releaseArray(array) { - array.length = 0; - if (arrayPool.length < maxPoolSize) { - arrayPool.push(array); - } - } - - /** - * Releases the given object back to the object pool. - * - * @private - * @param {Object} [object] The object to release. - */ - function releaseObject(object) { - var cache = object.cache; - if (cache) { - releaseObject(cache); - } - object.array = object.cache = object.criteria = object.object = object.number = object.string = object.value = null; - if (objectPool.length < maxPoolSize) { - objectPool.push(object); - } - } - - /** - * Slices the `collection` from the `start` index up to, but not including, - * the `end` index. - * - * Note: This function is used instead of `Array#slice` to support node lists - * in IE < 9 and to ensure dense arrays are returned. - * - * @private - * @param {Array|Object|string} collection The collection to slice. - * @param {number} start The start index. - * @param {number} end The end index. - * @returns {Array} Returns the new array. - */ - function slice(array, start, end) { - start || (start = 0); - if (typeof end == 'undefined') { - end = array ? array.length : 0; - } - var index = -1, - length = end - start || 0, - result = Array(length < 0 ? 0 : length); - - while (++index < length) { - result[index] = array[start + index]; - } - return result; - } - - /*--------------------------------------------------------------------------*/ - - /** - * Create a new `lodash` function using the given context object. - * - * @static - * @memberOf _ - * @category Utilities - * @param {Object} [context=root] The context object. - * @returns {Function} Returns the `lodash` function. - */ - 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 http://es5.github.io/#x11.1.5. - context = context ? _.defaults(root.Object(), context, _.pick(root, contextProps)) : root; - - /** Native constructor references */ - var Array = context.Array, - Boolean = context.Boolean, - 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 `Array` method references. - * - * Normally `Array.prototype` would suffice, however, using an array literal - * avoids issues in Narwhal. - */ - var arrayRef = []; - - /** Used for native method references */ - var errorProto = Error.prototype, - objectProto = Object.prototype, - stringProto = String.prototype; - - /** Used to restore the original `_` reference in `noConflict` */ - var oldDash = context._; - - /** Used to resolve the internal [[Class]] of values */ - var toString = objectProto.toString; - - /** Used to detect if a method is native */ - var reNative = RegExp('^' + - String(toString) - .replace(/[.*+?^${}()|[\]\\]/g, '\\$&') - .replace(/toString| for [^\]]+/g, '.*?') + '$' - ); - - /** Native method shortcuts */ - var ceil = Math.ceil, - clearTimeout = context.clearTimeout, - floor = Math.floor, - fnToString = Function.prototype.toString, - getPrototypeOf = isNative(getPrototypeOf = Object.getPrototypeOf) && getPrototypeOf, - hasOwnProperty = objectProto.hasOwnProperty, - push = arrayRef.push, - propertyIsEnumerable = objectProto.propertyIsEnumerable, - setTimeout = context.setTimeout, - splice = arrayRef.splice, - unshift = arrayRef.unshift; - - /** Used to set meta data on functions */ - var defineProperty = (function() { - // IE 8 only accepts DOM elements - try { - var o = {}, - func = isNative(func = Object.defineProperty) && func, - result = func(o, o, o) && func; - } catch(e) { } - return result; - }()); - - /* Native method shortcuts for methods with the same name as other `lodash` methods */ - var nativeCreate = isNative(nativeCreate = Object.create) && nativeCreate, - nativeIsArray = isNative(nativeIsArray = Array.isArray) && nativeIsArray, - nativeIsFinite = context.isFinite, - nativeIsNaN = context.isNaN, - nativeKeys = isNative(nativeKeys = Object.keys) && nativeKeys, - nativeMax = Math.max, - nativeMin = Math.min, - nativeParseInt = context.parseInt, - nativeRandom = Math.random; - - /** Used to lookup a built-in constructor by [[Class]] */ - var ctorByClass = {}; - ctorByClass[arrayClass] = Array; - ctorByClass[boolClass] = Boolean; - ctorByClass[dateClass] = Date; - ctorByClass[funcClass] = Function; - ctorByClass[objectClass] = Object; - ctorByClass[numberClass] = Number; - ctorByClass[regexpClass] = RegExp; - ctorByClass[stringClass] = String; - - /** Used to avoid iterating non-enumerable properties in IE < 9 */ - var nonEnumProps = {}; - nonEnumProps[arrayClass] = nonEnumProps[dateClass] = nonEnumProps[numberClass] = { 'constructor': true, 'toLocaleString': true, 'toString': true, 'valueOf': true }; - nonEnumProps[boolClass] = nonEnumProps[stringClass] = { 'constructor': true, 'toString': true, 'valueOf': true }; - nonEnumProps[errorClass] = nonEnumProps[funcClass] = nonEnumProps[regexpClass] = { 'constructor': true, 'toString': true }; - nonEnumProps[objectClass] = { 'constructor': true }; - - (function() { - var length = shadowedProps.length; - while (length--) { - var key = shadowedProps[length]; - for (var className in nonEnumProps) { - if (hasOwnProperty.call(nonEnumProps, className) && !hasOwnProperty.call(nonEnumProps[className], key)) { - nonEnumProps[className][key] = false; - } - } - } - }()); - - /*--------------------------------------------------------------------------*/ - - /** - * Creates a `lodash` object which wraps the given value to enable intuitive - * method chaining. - * - * In addition to Lo-Dash methods, wrappers also have the following `Array` methods: - * `concat`, `join`, `pop`, `push`, `reverse`, `shift`, `slice`, `sort`, `splice`, - * and `unshift` - * - * Chaining is supported in custom builds as long as the `value` method is - * implicitly or explicitly included in the build. - * - * The chainable wrapper functions are: - * `after`, `assign`, `bind`, `bindAll`, `bindKey`, `chain`, `compact`, - * `compose`, `concat`, `countBy`, `create`, `createCallback`, `curry`, - * `debounce`, `defaults`, `defer`, `delay`, `difference`, `filter`, `flatten`, - * `forEach`, `forEachRight`, `forIn`, `forInRight`, `forOwn`, `forOwnRight`, - * `functions`, `groupBy`, `indexBy`, `initial`, `intersection`, `invert`, - * `invoke`, `keys`, `map`, `max`, `memoize`, `merge`, `min`, `object`, `omit`, - * `once`, `pairs`, `partial`, `partialRight`, `pick`, `pluck`, `pull`, `push`, - * `range`, `reject`, `remove`, `rest`, `reverse`, `shuffle`, `slice`, `sort`, - * `sortBy`, `splice`, `tap`, `throttle`, `times`, `toArray`, `transform`, - * `union`, `uniq`, `unshift`, `unzip`, `values`, `where`, `without`, `wrap`, - * and `zip` - * - * The non-chainable wrapper functions are: - * `clone`, `cloneDeep`, `contains`, `escape`, `every`, `find`, `findIndex`, - * `findKey`, `findLast`, `findLastIndex`, `findLastKey`, `has`, `identity`, - * `indexOf`, `isArguments`, `isArray`, `isBoolean`, `isDate`, `isElement`, - * `isEmpty`, `isEqual`, `isFinite`, `isFunction`, `isNaN`, `isNull`, `isNumber`, - * `isObject`, `isPlainObject`, `isRegExp`, `isString`, `isUndefined`, `join`, - * `lastIndexOf`, `mixin`, `noConflict`, `parseInt`, `pop`, `random`, `reduce`, - * `reduceRight`, `result`, `shift`, `size`, `some`, `sortedIndex`, `runInContext`, - * `template`, `unescape`, `uniqueId`, and `value` - * - * The wrapper functions `first` and `last` return wrapped values when `n` is - * provided, otherwise they return unwrapped values. - * - * Explicit chaining can be enabled by using the `_.chain` method. - * - * @name _ - * @constructor - * @category Chaining - * @param {*} value The value to wrap in a `lodash` instance. - * @returns {Object} Returns a `lodash` instance. - * @example - * - * var wrapped = _([1, 2, 3]); - * - * // returns an unwrapped value - * wrapped.reduce(function(sum, num) { - * return sum + num; - * }); - * // => 6 - * - * // returns a wrapped value - * var squares = wrapped.map(function(num) { - * return num * num; - * }); - * - * _.isArray(squares); - * // => false - * - * _.isArray(squares.value()); - * // => true - */ - function lodash(value) { - // don't wrap if already wrapped, even if wrapped by a different `lodash` constructor - return (value && typeof value == 'object' && !isArray(value) && hasOwnProperty.call(value, '__wrapped__')) - ? value - : new lodashWrapper(value); - } - - /** - * A fast path for creating `lodash` wrapper objects. - * - * @private - * @param {*} value The value to wrap in a `lodash` instance. - * @param {boolean} chainAll A flag to enable chaining for all methods - * @returns {Object} Returns a `lodash` instance. - */ - function lodashWrapper(value, chainAll) { - this.__chain__ = !!chainAll; - this.__wrapped__ = value; - } - // ensure `new lodashWrapper` is an instance of `lodash` - lodashWrapper.prototype = lodash.prototype; - - /** - * An object used to flag environments features. - * - * @static - * @memberOf _ - * @type Object - */ - var support = lodash.support = {}; - - (function() { - var ctor = function() { this.x = 1; }, - object = { '0': 1, 'length': 1 }, - props = []; - - ctor.prototype = { 'valueOf': 1, 'y': 1 }; - for (var key in new ctor) { props.push(key); } - for (key in arguments) { } - - /** - * Detect if an `arguments` object's [[Class]] is resolvable (all but Firefox < 4, IE < 9). - * - * @memberOf _.support - * @type boolean - */ - support.argsClass = toString.call(arguments) == argsClass; - - /** - * Detect if `arguments` objects are `Object` objects (all but Narwhal and Opera < 10.5). - * - * @memberOf _.support - * @type boolean - */ - support.argsObject = arguments.constructor == Object && !(arguments instanceof Array); - - /** - * Detect if `name` or `message` properties of `Error.prototype` are - * enumerable by default. (IE < 9, Safari < 5.1) - * - * @memberOf _.support - * @type boolean - */ - support.enumErrorProps = propertyIsEnumerable.call(errorProto, 'message') || propertyIsEnumerable.call(errorProto, 'name'); - - /** - * Detect if `prototype` properties are enumerable by default. - * - * Firefox < 3.6, Opera > 9.50 - Opera < 11.60, and Safari < 5.1 - * (if the prototype or a property on the prototype has been set) - * incorrectly sets a function's `prototype` property [[Enumerable]] - * value to `true`. - * - * @memberOf _.support - * @type boolean - */ - support.enumPrototypes = propertyIsEnumerable.call(ctor, 'prototype'); - - /** - * Detect if functions can be decompiled by `Function#toString` - * (all but PS3 and older Opera mobile browsers & avoided in Windows 8 apps). - * - * @memberOf _.support - * @type boolean - */ - support.funcDecomp = !isNative(context.WinRTError) && reThis.test(runInContext); - - /** - * Detect if `Function#name` is supported (all but IE). - * - * @memberOf _.support - * @type boolean - */ - support.funcNames = typeof Function.name == 'string'; - - /** - * Detect if `arguments` object indexes are non-enumerable - * (Firefox < 4, IE < 9, PhantomJS, Safari < 5.1). - * - * @memberOf _.support - * @type boolean - */ - support.nonEnumArgs = key != 0; - - /** - * Detect if properties shadowing those on `Object.prototype` are non-enumerable. - * - * In IE < 9 an objects own properties, shadowing non-enumerable ones, are - * made non-enumerable as well (a.k.a the JScript [[DontEnum]] bug). - * - * @memberOf _.support - * @type boolean - */ - support.nonEnumShadows = !/valueOf/.test(props); - - /** - * Detect if own properties are iterated after inherited properties (all but IE < 9). - * - * @memberOf _.support - * @type boolean - */ - support.ownLast = props[0] != 'x'; - - /** - * Detect if `Array#shift` and `Array#splice` augment array-like objects correctly. - * - * Firefox < 10, IE compatibility mode, and IE < 9 have buggy Array `shift()` - * and `splice()` functions that fail to remove the last element, `value[0]`, - * of array-like objects even though the `length` property is set to `0`. - * The `shift()` method is buggy in IE 8 compatibility mode, while `splice()` - * is buggy regardless of mode in IE < 9 and buggy in compatibility mode in IE 9. - * - * @memberOf _.support - * @type boolean - */ - support.spliceObjects = (arrayRef.splice.call(object, 0, 1), !object[0]); - - /** - * Detect lack of support for accessing string characters by index. - * - * IE < 8 can't access characters by index and IE 8 can only access - * characters by index on string literals. - * - * @memberOf _.support - * @type boolean - */ - support.unindexedChars = ('x'[0] + Object('x')[0]) != 'xx'; - - /** - * Detect if a DOM node's [[Class]] is resolvable (all but IE < 9) - * and that the JS engine errors when attempting to coerce an object to - * a string without a `toString` function. - * - * @memberOf _.support - * @type boolean - */ - try { - support.nodeClass = !(toString.call(document) == objectClass && !({ 'toString': 0 } + '')); - } catch(e) { - support.nodeClass = true; - } - }(1)); - - /** - * By default, the template delimiters used by Lo-Dash are similar to 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': /<%-([\s\S]+?)%>/g, - - /** - * Used to detect code to be evaluated. - * - * @memberOf _.templateSettings - * @type RegExp - */ - 'evaluate': /<%([\s\S]+?)%>/g, - - /** - * 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 - } - }; - - /*--------------------------------------------------------------------------*/ - - /** - * The template used to create iterator functions. - * - * @private - * @param {Object} data The data object used to populate the text. - * @returns {string} Returns the interpolated text. - */ - var iteratorTemplate = function(obj) { - - var __p = 'var index, iterable = ' + - (obj.firstArg) + - ', result = ' + - (obj.init) + - ';\nif (!iterable) return result;\n' + - (obj.top) + - ';'; - if (obj.array) { - __p += '\nvar length = iterable.length; index = -1;\nif (' + - (obj.array) + - ') { '; - if (support.unindexedChars) { - __p += '\n if (isString(iterable)) {\n iterable = iterable.split(\'\')\n } '; - } - __p += '\n while (++index < length) {\n ' + - (obj.loop) + - ';\n }\n}\nelse { '; - } else if (support.nonEnumArgs) { - __p += '\n var length = iterable.length; index = -1;\n if (length && isArguments(iterable)) {\n while (++index < length) {\n index += \'\';\n ' + - (obj.loop) + - ';\n }\n } else { '; - } - - if (support.enumPrototypes) { - __p += '\n var skipProto = typeof iterable == \'function\';\n '; - } - - if (support.enumErrorProps) { - __p += '\n var skipErrorProps = iterable === errorProto || iterable instanceof Error;\n '; - } - - var conditions = []; if (support.enumPrototypes) { conditions.push('!(skipProto && index == "prototype")'); } if (support.enumErrorProps) { conditions.push('!(skipErrorProps && (index == "message" || index == "name"))'); } - - if (obj.useHas && obj.keys) { - __p += '\n var ownIndex = -1,\n ownProps = objectTypes[typeof iterable] && keys(iterable),\n length = ownProps ? ownProps.length : 0;\n\n while (++ownIndex < length) {\n index = ownProps[ownIndex];\n'; - if (conditions.length) { - __p += ' if (' + - (conditions.join(' && ')) + - ') {\n '; - } - __p += - (obj.loop) + - '; '; - if (conditions.length) { - __p += '\n }'; - } - __p += '\n } '; - } else { - __p += '\n for (index in iterable) {\n'; - if (obj.useHas) { conditions.push("hasOwnProperty.call(iterable, index)"); } if (conditions.length) { - __p += ' if (' + - (conditions.join(' && ')) + - ') {\n '; - } - __p += - (obj.loop) + - '; '; - if (conditions.length) { - __p += '\n }'; - } - __p += '\n } '; - if (support.nonEnumShadows) { - __p += '\n\n if (iterable !== objectProto) {\n var ctor = iterable.constructor,\n isProto = iterable === (ctor && ctor.prototype),\n className = iterable === stringProto ? stringClass : iterable === errorProto ? errorClass : toString.call(iterable),\n nonEnum = nonEnumProps[className];\n '; - for (k = 0; k < 7; k++) { - __p += '\n index = \'' + - (obj.shadowedProps[k]) + - '\';\n if ((!(isProto && nonEnum[index]) && hasOwnProperty.call(iterable, index))'; - if (!obj.useHas) { - __p += ' || (!nonEnum[index] && iterable[index] !== objectProto[index])'; - } - __p += ') {\n ' + - (obj.loop) + - ';\n } '; - } - __p += '\n } '; - } - - } - - if (obj.array || support.nonEnumArgs) { - __p += '\n}'; - } - __p += - (obj.bottom) + - ';\nreturn result'; - - return __p - }; - - /*--------------------------------------------------------------------------*/ - - /** - * The base implementation of `_.bind` that creates the bound function and - * sets its meta data. - * - * @private - * @param {Array} bindData The bind data array. - * @returns {Function} Returns the new bound function. - */ - function baseBind(bindData) { - var func = bindData[0], - partialArgs = bindData[2], - thisArg = bindData[4]; - - function bound() { - // `Function#bind` spec - // http://es5.github.io/#x15.3.4.5 - if (partialArgs) { - // avoid `arguments` object deoptimizations by using `slice` instead - // of `Array.prototype.slice.call` and not assigning `arguments` to a - // variable as a ternary expression - var args = slice(partialArgs); - push.apply(args, arguments); - } - // mimic the constructor's `return` behavior - // http://es5.github.io/#x13.2.2 - if (this instanceof bound) { - // ensure `new bound` is an instance of `func` - var thisBinding = baseCreate(func.prototype), - result = func.apply(thisBinding, args || arguments); - return isObject(result) ? result : thisBinding; - } - return func.apply(thisArg, args || arguments); - } - setBindData(bound, bindData); - return bound; - } - - /** - * The base implementation of `_.clone` without argument juggling or support - * for `thisArg` binding. - * - * @private - * @param {*} value The value to clone. - * @param {boolean} [isDeep=false] Specify a deep clone. - * @param {Function} [callback] The function to customize cloning values. - * @param {Array} [stackA=[]] Tracks traversed source objects. - * @param {Array} [stackB=[]] Associates clones with source counterparts. - * @returns {*} Returns the cloned value. - */ - function baseClone(value, isDeep, callback, stackA, stackB) { - if (callback) { - var result = callback(value); - if (typeof result != 'undefined') { - return result; - } - } - // inspect [[Class]] - var isObj = isObject(value); - if (isObj) { - var className = toString.call(value); - if (!cloneableClasses[className] || (!support.nodeClass && isNode(value))) { - return value; - } - var ctor = ctorByClass[className]; - switch (className) { - case boolClass: - case dateClass: - return new ctor(+value); - - case numberClass: - case stringClass: - return new ctor(value); - - case regexpClass: - result = ctor(value.source, reFlags.exec(value)); - result.lastIndex = value.lastIndex; - return result; - } - } else { - return value; - } - var isArr = isArray(value); - if (isDeep) { - // check for circular references and return corresponding clone - var initedStack = !stackA; - stackA || (stackA = getArray()); - stackB || (stackB = getArray()); - - var length = stackA.length; - while (length--) { - if (stackA[length] == value) { - return stackB[length]; - } - } - result = isArr ? ctor(value.length) : {}; - } - else { - result = isArr ? slice(value) : assign({}, value); - } - // add array properties assigned by `RegExp#exec` - if (isArr) { - if (hasOwnProperty.call(value, 'index')) { - result.index = value.index; - } - if (hasOwnProperty.call(value, 'input')) { - result.input = value.input; - } - } - // exit for shallow clone - if (!isDeep) { - return result; - } - // 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 ? baseEach : forOwn)(value, function(objValue, key) { - result[key] = baseClone(objValue, isDeep, callback, stackA, stackB); - }); - - if (initedStack) { - releaseArray(stackA); - releaseArray(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. - */ - function baseCreate(prototype, properties) { - return isObject(prototype) ? nativeCreate(prototype) : {}; - } - // fallback for browsers without `Object.create` - if (!nativeCreate) { - baseCreate = (function() { - function Object() {} - return function(prototype) { - if (isObject(prototype)) { - Object.prototype = prototype; - var result = new Object; - Object.prototype = null; - } - return result || context.Object(); - }; - }()); - } - - /** - * The base implementation of `_.createCallback` without support for creating - * "_.pluck" or "_.where" style callbacks. - * - * @private - * @param {*} [func=identity] The value to convert to a callback. - * @param {*} [thisArg] The `this` binding of the created callback. - * @param {number} [argCount] The number of arguments the callback accepts. - * @returns {Function} Returns a callback function. - */ - function baseCreateCallback(func, thisArg, argCount) { - if (typeof func != 'function') { - return identity; - } - // exit early for no `thisArg` or already bound by `Function#bind` - if (typeof thisArg == 'undefined' || !('prototype' in func)) { - return func; - } - var bindData = func.__bindData__; - if (typeof bindData == 'undefined') { - if (support.funcNames) { - bindData = !func.name; - } - bindData = bindData || !support.funcDecomp; - if (!bindData) { - var source = fnToString.call(func); - if (!support.funcNames) { - bindData = !reFuncName.test(source); - } - if (!bindData) { - // checks if `func` references the `this` keyword and stores the result - bindData = reThis.test(source); - setBindData(func, bindData); - } - } - } - // exit early if there are no `this` references or `func` is bound - if (bindData === false || (bindData !== true && bindData[1] & 1)) { - return func; - } - switch (argCount) { - case 1: return function(value) { - return func.call(thisArg, value); - }; - case 2: return function(a, b) { - return func.call(thisArg, a, b); - }; - 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); - }; - } - return bind(func, thisArg); - } - - /** - * The base implementation of `createWrapper` that creates the wrapper and - * sets its meta data. - * - * @private - * @param {Array} bindData The bind data array. - * @returns {Function} Returns the new function. - */ - function baseCreateWrapper(bindData) { - var func = bindData[0], - bitmask = bindData[1], - partialArgs = bindData[2], - partialRightArgs = bindData[3], - thisArg = bindData[4], - arity = bindData[5]; - - var isBind = bitmask & 1, - isBindKey = bitmask & 2, - isCurry = bitmask & 4, - isCurryBound = bitmask & 8, - key = func; - - function bound() { - var thisBinding = isBind ? thisArg : this; - if (partialArgs) { - var args = slice(partialArgs); - push.apply(args, arguments); - } - if (partialRightArgs || isCurry) { - args || (args = slice(arguments)); - if (partialRightArgs) { - push.apply(args, partialRightArgs); - } - if (isCurry && args.length < arity) { - bitmask |= 16 & ~32; - return baseCreateWrapper([func, (isCurryBound ? bitmask : bitmask & ~3), args, null, thisArg, arity]); - } - } - args || (args = arguments); - if (isBindKey) { - func = thisBinding[key]; - } - if (this instanceof bound) { - thisBinding = baseCreate(func.prototype); - var result = func.apply(thisBinding, args); - return isObject(result) ? result : thisBinding; - } - return func.apply(thisBinding, args); - } - setBindData(bound, bindData); - return bound; - } - - /** - * The base implementation of `_.difference` that accepts a single array - * of values to exclude. - * - * @private - * @param {Array} array The array to process. - * @param {Array} [values] The array of values to exclude. - * @returns {Array} Returns a new array of filtered values. - */ - function baseDifference(array, values) { - var index = -1, - indexOf = getIndexOf(), - length = array ? array.length : 0, - isLarge = length >= largeArraySize && indexOf === baseIndexOf, - result = []; - - if (isLarge) { - var cache = createCache(values); - if (cache) { - indexOf = cacheIndexOf; - values = cache; - } else { - isLarge = false; - } - } - while (++index < length) { - var value = array[index]; - if (indexOf(values, value) < 0) { - result.push(value); - } - } - if (isLarge) { - releaseObject(values); - } - return result; - } - - /** - * The base implementation of `_.flatten` without support for callback - * shorthands or `thisArg` binding. - * - * @private - * @param {Array} array The array to flatten. - * @param {boolean} [isShallow=false] A flag to restrict flattening to a single level. - * @param {boolean} [isStrict=false] A flag to restrict flattening to arrays and `arguments` objects. - * @param {number} [fromIndex=0] The index to start from. - * @returns {Array} Returns a new flattened array. - */ - function baseFlatten(array, isShallow, isStrict, fromIndex) { - var index = (fromIndex || 0) - 1, - length = array ? array.length : 0, - result = []; - - while (++index < length) { - var value = array[index]; - - if (value && typeof value == 'object' && typeof value.length == 'number' - && (isArray(value) || isArguments(value))) { - // recursively flatten arrays (susceptible to call stack limits) - if (!isShallow) { - value = baseFlatten(value, isShallow, isStrict); - } - var valIndex = -1, - valLength = value.length, - resIndex = result.length; - - result.length += valLength; - while (++valIndex < valLength) { - result[resIndex++] = value[valIndex]; - } - } else if (!isStrict) { - result.push(value); - } - } - return result; - } - - /** - * The base implementation of `_.isEqual`, without support for `thisArg` binding, - * that allows partial "_.where" style comparisons. - * - * @private - * @param {*} a The value to compare. - * @param {*} b The other value to compare. - * @param {Function} [callback] The function to customize comparing values. - * @param {Function} [isWhere=false] A flag to indicate performing partial comparisons. - * @param {Array} [stackA=[]] Tracks traversed `a` objects. - * @param {Array} [stackB=[]] Tracks traversed `b` objects. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - */ - function baseIsEqual(a, b, callback, isWhere, stackA, stackB) { - // used to indicate that when comparing objects, `a` has at least the properties of `b` - if (callback) { - var result = callback(a, b); - if (typeof result != 'undefined') { - return !!result; - } - } - // exit early for identical values - if (a === b) { - // treat `+0` vs. `-0` as not equal - return a !== 0 || (1 / a == 1 / b); - } - var type = typeof a, - otherType = typeof b; - - // exit early for unlike primitive values - if (a === a && - !(a && objectTypes[type]) && - !(b && objectTypes[otherType])) { - return false; - } - // exit early for `null` and `undefined` avoiding ES3's Function#call behavior - // http://es5.github.io/#x15.3.4.4 - if (a == null || b == null) { - return a === b; - } - // compare [[Class]] names - var className = toString.call(a), - otherClass = toString.call(b); - - if (className == argsClass) { - className = objectClass; - } - if (otherClass == argsClass) { - otherClass = objectClass; - } - if (className != otherClass) { - return false; - } - switch (className) { - case boolClass: - case dateClass: - // 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 +a == +b; - - case numberClass: - // treat `NaN` vs. `NaN` as equal - return (a != +a) - ? b != +b - // but treat `+0` vs. `-0` as not equal - : (a == 0 ? (1 / a == 1 / b) : a == +b); - - case regexpClass: - case stringClass: - // coerce regexes to strings (http://es5.github.io/#x15.10.6.4) - // treat string primitives and their corresponding object instances as equal - return a == String(b); - } - var isArr = className == arrayClass; - if (!isArr) { - // unwrap any `lodash` wrapped values - var aWrapped = hasOwnProperty.call(a, '__wrapped__'), - bWrapped = hasOwnProperty.call(b, '__wrapped__'); - - if (aWrapped || bWrapped) { - return baseIsEqual(aWrapped ? a.__wrapped__ : a, bWrapped ? b.__wrapped__ : b, callback, isWhere, stackA, stackB); - } - // exit for functions and DOM nodes - if (className != objectClass || (!support.nodeClass && (isNode(a) || isNode(b)))) { - return false; - } - // in older versions of Opera, `arguments` objects have `Array` constructors - var ctorA = !support.argsObject && isArguments(a) ? Object : a.constructor, - ctorB = !support.argsObject && isArguments(b) ? Object : b.constructor; - - // non `Object` object instances with different constructors are not equal - if (ctorA != ctorB && - !(isFunction(ctorA) && ctorA instanceof ctorA && isFunction(ctorB) && ctorB instanceof ctorB) && - ('constructor' in a && 'constructor' in b) - ) { - return false; - } - } - // assume cyclic structures are equal - // the algorithm for detecting cyclic structures is adapted from ES 5.1 - // section 15.12.3, abstract operation `JO` (http://es5.github.io/#x15.12.3) - var initedStack = !stackA; - stackA || (stackA = getArray()); - stackB || (stackB = getArray()); - - var length = stackA.length; - while (length--) { - if (stackA[length] == a) { - return stackB[length] == b; - } - } - var size = 0; - result = true; - - // add `a` and `b` to the stack of traversed objects - stackA.push(a); - stackB.push(b); - - // recursively compare objects and arrays (susceptible to call stack limits) - if (isArr) { - // compare lengths to determine if a deep comparison is necessary - length = a.length; - size = b.length; - result = size == length; - - if (result || isWhere) { - // deep compare the contents, ignoring non-numeric properties - while (size--) { - var index = length, - value = b[size]; - - if (isWhere) { - while (index--) { - if ((result = baseIsEqual(a[index], value, callback, isWhere, stackA, stackB))) { - break; - } - } - } else if (!(result = baseIsEqual(a[size], value, callback, isWhere, stackA, stackB))) { - break; - } - } - } - } - else { - // deep compare objects using `forIn`, instead of `forOwn`, to avoid `Object.keys` - // which, in this case, is more costly - forIn(b, function(value, key, b) { - if (hasOwnProperty.call(b, key)) { - // count the number of properties. - size++; - // deep compare each property value. - return (result = hasOwnProperty.call(a, key) && baseIsEqual(a[key], value, callback, isWhere, stackA, stackB)); - } - }); - - if (result && !isWhere) { - // ensure both objects have the same number of properties - forIn(a, function(value, key, a) { - if (hasOwnProperty.call(a, key)) { - // `size` will be `-1` if `a` has more properties than `b` - return (result = --size > -1); - } - }); - } - } - stackA.pop(); - stackB.pop(); - - if (initedStack) { - releaseArray(stackA); - releaseArray(stackB); - } - return result; - } - - /** - * The base implementation of `_.merge` without argument juggling or support - * for `thisArg` binding. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @param {Function} [callback] The function to customize merging properties. - * @param {Array} [stackA=[]] Tracks traversed source objects. - * @param {Array} [stackB=[]] Associates values with source counterparts. - */ - function baseMerge(object, source, callback, stackA, stackB) { - (isArray(source) ? forEach : forOwn)(source, function(source, key) { - var found, - isArr, - result = source, - value = object[key]; - - if (source && ((isArr = isArray(source)) || isPlainObject(source))) { - // avoid merging previously merged cyclic sources - var stackLength = stackA.length; - while (stackLength--) { - if ((found = stackA[stackLength] == source)) { - value = stackB[stackLength]; - break; - } - } - if (!found) { - var isShallow; - if (callback) { - result = callback(value, source); - if ((isShallow = typeof result != 'undefined')) { - value = result; - } - } - if (!isShallow) { - value = isArr - ? (isArray(value) ? value : []) - : (isPlainObject(value) ? value : {}); - } - // add `source` and associated `value` to the stack of traversed objects - stackA.push(source); - stackB.push(value); - - // recursively merge objects and arrays (susceptible to call stack limits) - if (!isShallow) { - baseMerge(value, source, callback, stackA, stackB); - } - } - } - else { - if (callback) { - result = callback(value, source); - if (typeof result == 'undefined') { - result = source; - } - } - if (typeof result != 'undefined') { - value = result; - } - } - object[key] = value; - }); - } - - /** - * The base implementation of `_.random` without argument juggling or support - * for returning floating-point numbers. - * - * @private - * @param {number} min The minimum possible value. - * @param {number} max The maximum possible value. - * @returns {number} Returns a random number. - */ - function baseRandom(min, max) { - return min + floor(nativeRandom() * (max - min + 1)); - } - - /** - * The base implementation of `_.uniq` without support for callback shorthands - * or `thisArg` binding. - * - * @private - * @param {Array} array The array to process. - * @param {boolean} [isSorted=false] A flag to indicate that `array` is sorted. - * @param {Function} [callback] The function called per iteration. - * @returns {Array} Returns a duplicate-value-free array. - */ - function baseUniq(array, isSorted, callback) { - var index = -1, - indexOf = getIndexOf(), - length = array ? array.length : 0, - result = []; - - var isLarge = !isSorted && length >= largeArraySize && indexOf === baseIndexOf, - seen = (callback || isLarge) ? getArray() : result; - - if (isLarge) { - var cache = createCache(seen); - indexOf = cacheIndexOf; - seen = cache; - } - while (++index < length) { - var value = array[index], - computed = callback ? callback(value, index, array) : value; - - if (isSorted - ? !index || seen[seen.length - 1] !== computed - : indexOf(seen, computed) < 0 - ) { - if (callback || isLarge) { - seen.push(computed); - } - result.push(value); - } - } - if (isLarge) { - releaseArray(seen.array); - releaseObject(seen); - } else if (callback) { - releaseArray(seen); - } - return result; - } - - /** - * Creates a function that aggregates a collection, creating an object composed - * of keys generated from the results of running each element of the collection - * through a callback. The given `setter` function sets the keys and values - * of the composed object. - * - * @private - * @param {Function} setter The setter function. - * @returns {Function} Returns the new aggregator function. - */ - function createAggregator(setter) { - return function(collection, callback, thisArg) { - var result = {}; - callback = lodash.createCallback(callback, thisArg, 3); - - if (isArray(collection)) { - var index = -1, - length = collection.length; - - while (++index < length) { - var value = collection[index]; - setter(result, value, callback(value, index, collection), collection); - } - } else { - baseEach(collection, function(value, key, collection) { - setter(result, value, callback(value, key, collection), collection); - }); - } - return result; - }; - } - - /** - * Creates a function that, when called, either curries or invokes `func` - * with an 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 method flags to compose. - * The bitmask may be composed of the following flags: - * 1 - `_.bind` - * 2 - `_.bindKey` - * 4 - `_.curry` - * 8 - `_.curry` (bound) - * 16 - `_.partial` - * 32 - `_.partialRight` - * @param {Array} [partialArgs] An array of arguments to prepend to those - * provided to the new function. - * @param {Array} [partialRightArgs] An array of arguments to append to those - * provided to the new function. - * @param {*} [thisArg] The `this` binding of `func`. - * @param {number} [arity] The arity of `func`. - * @returns {Function} Returns the new function. - */ - function createWrapper(func, bitmask, partialArgs, partialRightArgs, thisArg, arity) { - var isBind = bitmask & 1, - isBindKey = bitmask & 2, - isCurry = bitmask & 4, - isCurryBound = bitmask & 8, - isPartial = bitmask & 16, - isPartialRight = bitmask & 32; - - if (!isBindKey && !isFunction(func)) { - throw new TypeError; - } - if (isPartial && !partialArgs.length) { - bitmask &= ~16; - isPartial = partialArgs = false; - } - if (isPartialRight && !partialRightArgs.length) { - bitmask &= ~32; - isPartialRight = partialRightArgs = false; - } - var bindData = func && func.__bindData__; - if (bindData && bindData !== true) { - // clone `bindData` - bindData = slice(bindData); - if (bindData[2]) { - bindData[2] = slice(bindData[2]); - } - if (bindData[3]) { - bindData[3] = slice(bindData[3]); - } - // set `thisBinding` is not previously bound - if (isBind && !(bindData[1] & 1)) { - bindData[4] = thisArg; - } - // set if previously bound but not currently (subsequent curried functions) - if (!isBind && bindData[1] & 1) { - bitmask |= 8; - } - // set curried arity if not yet set - if (isCurry && !(bindData[1] & 4)) { - bindData[5] = arity; - } - // append partial left arguments - if (isPartial) { - push.apply(bindData[2] || (bindData[2] = []), partialArgs); - } - // append partial right arguments - if (isPartialRight) { - unshift.apply(bindData[3] || (bindData[3] = []), partialRightArgs); - } - // merge flags - bindData[1] |= bitmask; - return createWrapper.apply(null, bindData); - } - // fast path for `_.bind` - var creater = (bitmask == 1 || bitmask === 17) ? baseBind : baseCreateWrapper; - return creater([func, bitmask, partialArgs, partialRightArgs, thisArg, arity]); - } - - /** - * Creates compiled iteration functions. - * - * @private - * @param {...Object} [options] The compile options object(s). - * @param {string} [options.array] Code to determine if the iterable is an array or array-like. - * @param {boolean} [options.useHas] Specify using `hasOwnProperty` checks in the object loop. - * @param {Function} [options.keys] A reference to `_.keys` for use in own property iteration. - * @param {string} [options.args] A comma separated string of iteration function arguments. - * @param {string} [options.top] Code to execute before the iteration branches. - * @param {string} [options.loop] Code to execute in the object loop. - * @param {string} [options.bottom] Code to execute after the iteration branches. - * @returns {Function} Returns the compiled function. - */ - function createIterator() { - // data properties - iteratorData.shadowedProps = shadowedProps; - - // iterator options - iteratorData.array = iteratorData.bottom = iteratorData.loop = iteratorData.top = ''; - iteratorData.init = 'iterable'; - iteratorData.useHas = true; - - // merge options into a template data object - for (var object, index = 0; object = arguments[index]; index++) { - for (var key in object) { - iteratorData[key] = object[key]; - } - } - var args = iteratorData.args; - iteratorData.firstArg = /^[^,]+/.exec(args)[0]; - - // create the function factory - var factory = Function( - 'baseCreateCallback, errorClass, errorProto, hasOwnProperty, ' + - 'indicatorObject, isArguments, isArray, isString, keys, objectProto, ' + - 'objectTypes, nonEnumProps, stringClass, stringProto, toString', - 'return function(' + args + ') {\n' + iteratorTemplate(iteratorData) + '\n}' - ); - - // return the compiled function - return factory( - baseCreateCallback, errorClass, errorProto, hasOwnProperty, - indicatorObject, isArguments, isArray, isString, iteratorData.keys, objectProto, - objectTypes, nonEnumProps, stringClass, stringProto, toString - ); - } - - /** - * Used by `escape` to convert characters to HTML entities. - * - * @private - * @param {string} match The matched character to escape. - * @returns {string} Returns the escaped character. - */ - function escapeHtmlChar(match) { - return htmlEscapes[match]; - } - - /** - * Gets the appropriate "indexOf" function. If the `_.indexOf` method is - * customized, this method returns the custom method, otherwise it returns - * the `baseIndexOf` function. - * - * @private - * @returns {Function} Returns the "indexOf" function. - */ - function getIndexOf() { - var result = (result = lodash.indexOf) === indexOf ? baseIndexOf : result; - return result; - } - - /** - * Checks if `value` is a native function. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if the `value` is a native function, else `false`. - */ - function isNative(value) { - return typeof value == 'function' && reNative.test(value); - } - - /** - * Sets `this` binding data on a given function. - * - * @private - * @param {Function} func The function to set data on. - * @param {Array} value The data array to set. - */ - var setBindData = !defineProperty ? noop : function(func, value) { - descriptor.value = value; - defineProperty(func, '__bindData__', descriptor); - }; - - /** - * A fallback implementation of `isPlainObject` which checks if a given value - * is an object created by the `Object` constructor, assuming objects created - * by the `Object` constructor have no inherited enumerable properties and that - * there are no `Object.prototype` extensions. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. - */ - function shimIsPlainObject(value) { - var ctor, - result; - - // avoid non Object objects, `arguments` objects, and DOM elements - if (!(value && toString.call(value) == objectClass) || - (ctor = value.constructor, isFunction(ctor) && !(ctor instanceof ctor)) || - (!support.argsClass && isArguments(value)) || - (!support.nodeClass && isNode(value))) { - 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. - if (support.ownLast) { - forIn(value, function(value, key, object) { - result = hasOwnProperty.call(object, key); - return false; - }); - return result !== false; - } - // 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. - forIn(value, function(value, key) { - result = key; - }); - return typeof result == 'undefined' || hasOwnProperty.call(value, result); - } - - /** - * Used by `unescape` to convert HTML entities to characters. - * - * @private - * @param {string} match The matched character to unescape. - * @returns {string} Returns the unescaped character. - */ - function unescapeHtmlChar(match) { - return htmlUnescapes[match]; - } - - /*--------------------------------------------------------------------------*/ - - /** - * Checks if `value` is an `arguments` object. - * - * @static - * @memberOf _ - * @category Objects - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if the `value` is an `arguments` object, else `false`. - * @example - * - * (function() { return _.isArguments(arguments); })(1, 2, 3); - * // => true - * - * _.isArguments([1, 2, 3]); - * // => false - */ - function isArguments(value) { - return value && typeof value == 'object' && typeof value.length == 'number' && - toString.call(value) == argsClass || false; - } - // fallback for browsers that can't detect `arguments` objects by [[Class]] - if (!support.argsClass) { - isArguments = function(value) { - return value && typeof value == 'object' && typeof value.length == 'number' && - hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee') || false; - }; - } - - /** - * Checks if `value` is an array. - * - * @static - * @memberOf _ - * @type Function - * @category Objects - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if the `value` is an array, else `false`. - * @example - * - * (function() { return _.isArray(arguments); })(); - * // => false - * - * _.isArray([1, 2, 3]); - * // => true - */ - var isArray = nativeIsArray || function(value) { - return value && typeof value == 'object' && typeof value.length == 'number' && - toString.call(value) == arrayClass || false; - }; - - /** - * A fallback implementation of `Object.keys` which produces an array of the - * given object's own enumerable property names. - * - * @private - * @type Function - * @param {Object} object The object to inspect. - * @returns {Array} Returns an array of property names. - */ - var shimKeys = createIterator({ - 'args': 'object', - 'init': '[]', - 'top': 'if (!(objectTypes[typeof object])) return result', - 'loop': 'result.push(index)' - }); - - /** - * Creates an array composed of the own enumerable property names of an object. - * - * @static - * @memberOf _ - * @category Objects - * @param {Object} object The object to inspect. - * @returns {Array} Returns an array of property names. - * @example - * - * _.keys({ 'one': 1, 'two': 2, 'three': 3 }); - * // => ['one', 'two', 'three'] (property order is not guaranteed across environments) - */ - var keys = !nativeKeys ? shimKeys : function(object) { - if (!isObject(object)) { - return []; - } - if ((support.enumPrototypes && typeof object == 'function') || - (support.nonEnumArgs && object.length && isArguments(object))) { - return shimKeys(object); - } - return nativeKeys(object); - }; - - /** Reusable iterator options shared by `each`, `forIn`, and `forOwn` */ - var eachIteratorOptions = { - 'args': 'collection, callback, thisArg', - 'top': "callback = callback && typeof thisArg == 'undefined' ? callback : baseCreateCallback(callback, thisArg, 3)", - 'array': "typeof length == 'number'", - 'keys': keys, - 'loop': 'if (callback(iterable[index], index, collection) === false) return result' - }; - - /** Reusable iterator options for `assign` and `defaults` */ - var defaultsIteratorOptions = { - 'args': 'object, source, guard', - 'top': - 'var args = arguments,\n' + - ' argsIndex = 0,\n' + - " argsLength = typeof guard == 'number' ? 2 : args.length;\n" + - 'while (++argsIndex < argsLength) {\n' + - ' iterable = args[argsIndex];\n' + - ' if (iterable && objectTypes[typeof iterable]) {', - 'keys': keys, - 'loop': "if (typeof result[index] == 'undefined') result[index] = iterable[index]", - 'bottom': ' }\n}' - }; - - /** Reusable iterator options for `forIn` and `forOwn` */ - var forOwnIteratorOptions = { - 'top': 'if (!objectTypes[typeof iterable]) return result;\n' + eachIteratorOptions.top, - 'array': false - }; - - /** - * Used to convert characters to HTML entities: - * - * Though the `>` character is escaped for symmetry, characters like `>` and `/` - * don't require escaping in HTML and have no special meaning unless they're part - * of a tag or an unquoted attribute value. - * http://mathiasbynens.be/notes/ambiguous-ampersands (under "semi-related fun fact") - */ - var htmlEscapes = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''' - }; - - /** Used to convert HTML entities to characters */ - var htmlUnescapes = invert(htmlEscapes); - - /** Used to match HTML entities and HTML characters */ - var reEscapedHtml = RegExp('(' + keys(htmlUnescapes).join('|') + ')', 'g'), - reUnescapedHtml = RegExp('[' + keys(htmlEscapes).join('') + ']', 'g'); - - /** - * A function compiled to iterate `arguments` objects, arrays, objects, and - * strings consistenly across environments, executing the callback for each - * element in the collection. The callback is bound to `thisArg` and invoked - * with three arguments; (value, index|key, collection). Callbacks may exit - * iteration early by explicitly returning `false`. - * - * @private - * @type Function - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} [callback=identity] The function called per iteration. - * @param {*} [thisArg] The `this` binding of `callback`. - * @returns {Array|Object|string} Returns `collection`. - */ - var baseEach = createIterator(eachIteratorOptions); - - /*--------------------------------------------------------------------------*/ - - /** - * Assigns own enumerable properties of source object(s) to the destination - * object. Subsequent sources will overwrite property assignments of previous - * sources. If a callback is provided it will be executed to produce the - * assigned values. The callback is bound to `thisArg` and invoked with two - * arguments; (objectValue, sourceValue). - * - * @static - * @memberOf _ - * @type Function - * @alias extend - * @category Objects - * @param {Object} object The destination object. - * @param {...Object} [source] The source objects. - * @param {Function} [callback] The function to customize assigning values. - * @param {*} [thisArg] The `this` binding of `callback`. - * @returns {Object} Returns the destination object. - * @example - * - * _.assign({ 'name': 'fred' }, { 'employer': 'slate' }); - * // => { 'name': 'fred', 'employer': 'slate' } - * - * var defaults = _.partialRight(_.assign, function(a, b) { - * return typeof a == 'undefined' ? b : a; - * }); - * - * var object = { 'name': 'barney' }; - * defaults(object, { 'name': 'fred', 'employer': 'slate' }); - * // => { 'name': 'barney', 'employer': 'slate' } - */ - var assign = createIterator(defaultsIteratorOptions, { - 'top': - defaultsIteratorOptions.top.replace(';', - ';\n' + - "if (argsLength > 3 && typeof args[argsLength - 2] == 'function') {\n" + - ' var callback = baseCreateCallback(args[--argsLength - 1], args[argsLength--], 2);\n' + - "} else if (argsLength > 2 && typeof args[argsLength - 1] == 'function') {\n" + - ' callback = args[--argsLength];\n' + - '}' - ), - 'loop': 'result[index] = callback ? callback(result[index], iterable[index]) : iterable[index]' - }); - - /** - * Creates a clone of `value`. If `isDeep` is `true` nested objects will also - * be cloned, otherwise they will be assigned by reference. If a callback - * is provided it will be executed to produce the cloned values. If the - * callback returns `undefined` cloning will be handled by the method instead. - * The callback is bound to `thisArg` and invoked with one argument; (value). - * - * @static - * @memberOf _ - * @category Objects - * @param {*} value The value to clone. - * @param {boolean} [isDeep=false] Specify a deep clone. - * @param {Function} [callback] The function to customize cloning values. - * @param {*} [thisArg] The `this` binding of `callback`. - * @returns {*} Returns the cloned value. - * @example - * - * var characters = [ - * { 'name': 'barney', 'age': 36 }, - * { 'name': 'fred', 'age': 40 } - * ]; - * - * var shallow = _.clone(characters); - * shallow[0] === characters[0]; - * // => true - * - * var deep = _.clone(characters, true); - * deep[0] === characters[0]; - * // => false - * - * _.mixin({ - * 'clone': _.partialRight(_.clone, function(value) { - * return _.isElement(value) ? value.cloneNode(false) : undefined; - * }) - * }); - * - * var clone = _.clone(document.body); - * clone.childNodes.length; - * // => 0 - */ - function clone(value, isDeep, callback, thisArg) { - // allows working with "Collections" methods without using their `index` - // and `collection` arguments for `isDeep` and `callback` - if (typeof isDeep != 'boolean' && isDeep != null) { - thisArg = callback; - callback = isDeep; - isDeep = false; - } - return baseClone(value, isDeep, typeof callback == 'function' && baseCreateCallback(callback, thisArg, 1)); - } - - /** - * Creates a deep clone of `value`. If a callback is provided it will be - * executed to produce the cloned values. If the callback returns `undefined` - * cloning will be handled by the method instead. The callback is bound to - * `thisArg` and invoked with one argument; (value). - * - * Note: This method is loosely based on the structured clone algorithm. Functions - * and DOM nodes are **not** cloned. The enumerable properties of `arguments` objects and - * objects created by constructors other than `Object` are cloned to plain `Object` objects. - * See http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm. - * - * @static - * @memberOf _ - * @category Objects - * @param {*} value The value to deep clone. - * @param {Function} [callback] The function to customize cloning values. - * @param {*} [thisArg] The `this` binding of `callback`. - * @returns {*} Returns the deep cloned value. - * @example - * - * var characters = [ - * { 'name': 'barney', 'age': 36 }, - * { 'name': 'fred', 'age': 40 } - * ]; - * - * var deep = _.cloneDeep(characters); - * deep[0] === characters[0]; - * // => false - * - * var view = { - * 'label': 'docs', - * 'node': element - * }; - * - * var clone = _.cloneDeep(view, function(value) { - * return _.isElement(value) ? value.cloneNode(true) : undefined; - * }); - * - * clone.node == view.node; - * // => false - */ - function cloneDeep(value, callback, thisArg) { - return baseClone(value, true, typeof callback == 'function' && baseCreateCallback(callback, thisArg, 1)); - } - - /** - * 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 Objects - * @param {Object} prototype The object to inherit from. - * @param {Object} [properties] The properties to assign to the object. - * @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) { - var result = baseCreate(prototype); - return properties ? assign(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 defaults of the same property will be ignored. - * - * @static - * @memberOf _ - * @type Function - * @category Objects - * @param {Object} object The destination object. - * @param {...Object} [source] The source objects. - * @param- {Object} [guard] Allows working with `_.reduce` without using its - * `key` and `object` arguments as sources. - * @returns {Object} Returns the destination object. - * @example - * - * var object = { 'name': 'barney' }; - * _.defaults(object, { 'name': 'fred', 'employer': 'slate' }); - * // => { 'name': 'barney', 'employer': 'slate' } - */ - var defaults = createIterator(defaultsIteratorOptions); - - /** - * This method is like `_.findIndex` except that it returns the key of the - * first element that passes the callback check, instead of the element itself. - * - * If a property name is provided for `callback` the created "_.pluck" style - * callback will return the property value of the given element. - * - * If an object is provided for `callback` the created "_.where" style callback - * will return `true` for elements that have the properties of the given object, - * else `false`. - * - * @static - * @memberOf _ - * @category Objects - * @param {Object} object The object to search. - * @param {Function|Object|string} [callback=identity] The function called per - * iteration. If a property name or object is provided it will be used to - * create a "_.pluck" or "_.where" style callback, respectively. - * @param {*} [thisArg] The `this` binding of `callback`. - * @returns {string|undefined} Returns the key of the found element, else `undefined`. - * @example - * - * var characters = { - * 'barney': { 'age': 36, 'blocked': false }, - * 'fred': { 'age': 40, 'blocked': true }, - * 'pebbles': { 'age': 1, 'blocked': false } - * }; - * - * _.findKey(characters, function(chr) { - * return chr.age < 40; - * }); - * // => 'barney' (property order is not guaranteed across environments) - * - * // using "_.where" callback shorthand - * _.findKey(characters, { 'age': 1 }); - * // => 'pebbles' - * - * // using "_.pluck" callback shorthand - * _.findKey(characters, 'blocked'); - * // => 'fred' - */ - function findKey(object, callback, thisArg) { - var result; - callback = lodash.createCallback(callback, thisArg, 3); - forOwn(object, function(value, key, object) { - if (callback(value, key, object)) { - result = key; - return false; - } - }); - return result; - } - - /** - * 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 `callback` the created "_.pluck" style - * callback will return the property value of the given element. - * - * If an object is provided for `callback` the created "_.where" style callback - * will return `true` for elements that have the properties of the given object, - * else `false`. - * - * @static - * @memberOf _ - * @category Objects - * @param {Object} object The object to search. - * @param {Function|Object|string} [callback=identity] The function called per - * iteration. If a property name or object is provided it will be used to - * create a "_.pluck" or "_.where" style callback, respectively. - * @param {*} [thisArg] The `this` binding of `callback`. - * @returns {string|undefined} Returns the key of the found element, else `undefined`. - * @example - * - * var characters = { - * 'barney': { 'age': 36, 'blocked': true }, - * 'fred': { 'age': 40, 'blocked': false }, - * 'pebbles': { 'age': 1, 'blocked': true } - * }; - * - * _.findLastKey(characters, function(chr) { - * return chr.age < 40; - * }); - * // => returns `pebbles`, assuming `_.findKey` returns `barney` - * - * // using "_.where" callback shorthand - * _.findLastKey(characters, { 'age': 40 }); - * // => 'fred' - * - * // using "_.pluck" callback shorthand - * _.findLastKey(characters, 'blocked'); - * // => 'pebbles' - */ - function findLastKey(object, callback, thisArg) { - var result; - callback = lodash.createCallback(callback, thisArg, 3); - forOwnRight(object, function(value, key, object) { - if (callback(value, key, object)) { - result = key; - return false; - } - }); - return result; - } - - /** - * Iterates over own and inherited enumerable properties of an object, - * executing the callback for each property. The callback is bound to `thisArg` - * and invoked with three arguments; (value, key, object). Callbacks may exit - * iteration early by explicitly returning `false`. - * - * @static - * @memberOf _ - * @type Function - * @category Objects - * @param {Object} object The object to iterate over. - * @param {Function} [callback=identity] The function called per iteration. - * @param {*} [thisArg] The `this` binding of `callback`. - * @returns {Object} Returns `object`. - * @example - * - * function Shape() { - * this.x = 0; - * this.y = 0; - * } - * - * Shape.prototype.move = function(x, y) { - * this.x += x; - * this.y += y; - * }; - * - * _.forIn(new Shape, function(value, key) { - * console.log(key); - * }); - * // => logs 'x', 'y', and 'move' (property order is not guaranteed across environments) - */ - var forIn = createIterator(eachIteratorOptions, forOwnIteratorOptions, { - 'useHas': false - }); - - /** - * This method is like `_.forIn` except that it iterates over elements - * of a `collection` in the opposite order. - * - * @static - * @memberOf _ - * @category Objects - * @param {Object} object The object to iterate over. - * @param {Function} [callback=identity] The function called per iteration. - * @param {*} [thisArg] The `this` binding of `callback`. - * @returns {Object} Returns `object`. - * @example - * - * function Shape() { - * this.x = 0; - * this.y = 0; - * } - * - * Shape.prototype.move = function(x, y) { - * this.x += x; - * this.y += y; - * }; - * - * _.forInRight(new Shape, function(value, key) { - * console.log(key); - * }); - * // => logs 'move', 'y', and 'x' assuming `_.forIn ` logs 'x', 'y', and 'move' - */ - function forInRight(object, callback, thisArg) { - var pairs = []; - - forIn(object, function(value, key) { - pairs.push(key, value); - }); - - var length = pairs.length; - callback = baseCreateCallback(callback, thisArg, 3); - while (length--) { - if (callback(pairs[length--], pairs[length], object) === false) { - break; - } - } - return object; - } - - /** - * Iterates over own enumerable properties of an object, executing the callback - * for each property. The callback is bound to `thisArg` and invoked with three - * arguments; (value, key, object). Callbacks may exit iteration early by - * explicitly returning `false`. - * - * @static - * @memberOf _ - * @type Function - * @category Objects - * @param {Object} object The object to iterate over. - * @param {Function} [callback=identity] The function called per iteration. - * @param {*} [thisArg] The `this` binding of `callback`. - * @returns {Object} Returns `object`. - * @example - * - * _.forOwn({ '0': 'zero', '1': 'one', 'length': 2 }, function(num, key) { - * console.log(key); - * }); - * // => logs '0', '1', and 'length' (property order is not guaranteed across environments) - */ - var forOwn = createIterator(eachIteratorOptions, forOwnIteratorOptions); - - /** - * This method is like `_.forOwn` except that it iterates over elements - * of a `collection` in the opposite order. - * - * @static - * @memberOf _ - * @category Objects - * @param {Object} object The object to iterate over. - * @param {Function} [callback=identity] The function called per iteration. - * @param {*} [thisArg] The `this` binding of `callback`. - * @returns {Object} Returns `object`. - * @example - * - * _.forOwnRight({ '0': 'zero', '1': 'one', 'length': 2 }, function(num, key) { - * console.log(key); - * }); - * // => logs 'length', '1', and '0' assuming `_.forOwn` logs '0', '1', and 'length' - */ - function forOwnRight(object, callback, thisArg) { - var props = keys(object), - length = props.length; - - callback = baseCreateCallback(callback, thisArg, 3); - while (length--) { - var key = props[length]; - if (callback(object[key], key, object) === false) { - break; - } - } - return object; - } - - /** - * Creates a sorted array of property names of all enumerable properties, - * own and inherited, of `object` that have function values. - * - * @static - * @memberOf _ - * @alias methods - * @category Objects - * @param {Object} object The object to inspect. - * @returns {Array} Returns an array of property names that have function values. - * @example - * - * _.functions(_); - * // => ['all', 'any', 'bind', 'bindAll', 'clone', 'compact', 'compose', ...] - */ - function functions(object) { - var result = []; - forIn(object, function(value, key) { - if (isFunction(value)) { - result.push(key); - } - }); - return result.sort(); - } - - /** - * Checks if the specified property name exists as a direct property of `object`, - * instead of an inherited property. - * - * @static - * @memberOf _ - * @category Objects - * @param {Object} object The object to inspect. - * @param {string} key The name of the property to check. - * @returns {boolean} Returns `true` if key is a direct property, else `false`. - * @example - * - * _.has({ 'a': 1, 'b': 2, 'c': 3 }, 'b'); - * // => true - */ - function has(object, key) { - return object ? hasOwnProperty.call(object, key) : false; - } - - /** - * Creates an object composed of the inverted keys and values of the given object. - * - * @static - * @memberOf _ - * @category Objects - * @param {Object} object The object to invert. - * @returns {Object} Returns the created inverted object. - * @example - * - * _.invert({ 'first': 'fred', 'second': 'barney' }); - * // => { 'fred': 'first', 'barney': 'second' } - */ - function invert(object) { - var index = -1, - props = keys(object), - length = props.length, - result = {}; - - while (++index < length) { - var key = props[index]; - result[object[key]] = key; - } - return result; - } - - /** - * Checks if `value` is a boolean value. - * - * @static - * @memberOf _ - * @category Objects - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if the `value` is a boolean value, else `false`. - * @example - * - * _.isBoolean(null); - * // => false - */ - function isBoolean(value) { - return value === true || value === false || - value && typeof value == 'object' && toString.call(value) == boolClass || false; - } - - /** - * Checks if `value` is a date. - * - * @static - * @memberOf _ - * @category Objects - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if the `value` is a date, else `false`. - * @example - * - * _.isDate(new Date); - * // => true - */ - function isDate(value) { - return value && typeof value == 'object' && toString.call(value) == dateClass || false; - } - - /** - * Checks if `value` is a DOM element. - * - * @static - * @memberOf _ - * @category Objects - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if the `value` is a DOM element, else `false`. - * @example - * - * _.isElement(document.body); - * // => true - */ - function isElement(value) { - return value && value.nodeType === 1 || false; - } - - /** - * Checks if `value` is empty. Arrays, strings, or `arguments` objects with a - * length of `0` and objects with no own enumerable properties are considered - * "empty". - * - * @static - * @memberOf _ - * @category Objects - * @param {Array|Object|string} value The value to inspect. - * @returns {boolean} Returns `true` if the `value` is empty, else `false`. - * @example - * - * _.isEmpty([1, 2, 3]); - * // => false - * - * _.isEmpty({}); - * // => true - * - * _.isEmpty(''); - * // => true - */ - function isEmpty(value) { - var result = true; - if (!value) { - return result; - } - var className = toString.call(value), - length = value.length; - - if ((className == arrayClass || className == stringClass || - (support.argsClass ? className == argsClass : isArguments(value))) || - (className == objectClass && typeof length == 'number' && isFunction(value.splice))) { - return !length; - } - forOwn(value, function() { - return (result = false); - }); - return result; - } - - /** - * Performs a deep comparison between two values to determine if they are - * equivalent to each other. If a callback is provided it will be executed - * to compare values. If the callback returns `undefined` comparisons will - * be handled by the method instead. The callback is bound to `thisArg` and - * invoked with two arguments; (a, b). - * - * @static - * @memberOf _ - * @category Objects - * @param {*} a The value to compare. - * @param {*} b The other value to compare. - * @param {Function} [callback] The function to customize comparing values. - * @param {*} [thisArg] The `this` binding of `callback`. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'name': 'fred' }; - * var copy = { 'name': 'fred' }; - * - * object == copy; - * // => false - * - * _.isEqual(object, copy); - * // => true - * - * var words = ['hello', 'goodbye']; - * var otherWords = ['hi', 'goodbye']; - * - * _.isEqual(words, otherWords, function(a, b) { - * var reGreet = /^(?:hello|hi)$/i, - * aGreet = _.isString(a) && reGreet.test(a), - * bGreet = _.isString(b) && reGreet.test(b); - * - * return (aGreet || bGreet) ? (aGreet == bGreet) : undefined; - * }); - * // => true - */ - function isEqual(a, b, callback, thisArg) { - return baseIsEqual(a, b, typeof callback == 'function' && baseCreateCallback(callback, thisArg, 2)); - } - - /** - * Checks if `value` is, or can be coerced to, a finite number. - * - * Note: This is not the same as native `isFinite` which will return true for - * booleans and empty strings. See http://es5.github.io/#x15.1.2.5. - * - * @static - * @memberOf _ - * @category Objects - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if the `value` is finite, else `false`. - * @example - * - * _.isFinite(-101); - * // => true - * - * _.isFinite('10'); - * // => true - * - * _.isFinite(true); - * // => false - * - * _.isFinite(''); - * // => false - * - * _.isFinite(Infinity); - * // => false - */ - function isFinite(value) { - return nativeIsFinite(value) && !nativeIsNaN(parseFloat(value)); - } - - /** - * Checks if `value` is a function. - * - * @static - * @memberOf _ - * @category Objects - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if the `value` is a function, else `false`. - * @example - * - * _.isFunction(_); - * // => true - */ - function isFunction(value) { - return typeof value == 'function'; - } - // fallback for older versions of Chrome and Safari - if (isFunction(/x/)) { - isFunction = function(value) { - return typeof value == 'function' && toString.call(value) == funcClass; - }; - } - - /** - * Checks if `value` is the language type of Object. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @category Objects - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if the `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(1); - * // => false - */ - function isObject(value) { - // check if the value is the ECMAScript language type of Object - // http://es5.github.io/#x8 - // and avoid a V8 bug - // http://code.google.com/p/v8/issues/detail?id=2291 - return !!(value && objectTypes[typeof value]); - } - - /** - * Checks if `value` is `NaN`. - * - * Note: This is not the same as native `isNaN` which will return `true` for - * `undefined` and other non-numeric values. See http://es5.github.io/#x15.1.2.4. - * - * @static - * @memberOf _ - * @category Objects - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if the `value` is `NaN`, else `false`. - * @example - * - * _.isNaN(NaN); - * // => true - * - * _.isNaN(new Number(NaN)); - * // => true - * - * isNaN(undefined); - * // => true - * - * _.isNaN(undefined); - * // => false - */ - function isNaN(value) { - // `NaN` as a primitive is the only value that is not equal to itself - // (perform the [[Class]] check first to avoid errors with some host objects in IE) - return isNumber(value) && value != +value; - } - - /** - * Checks if `value` is `null`. - * - * @static - * @memberOf _ - * @category Objects - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if the `value` is `null`, else `false`. - * @example - * - * _.isNull(null); - * // => true - * - * _.isNull(undefined); - * // => false - */ - function isNull(value) { - return value === null; - } - - /** - * Checks if `value` is a number. - * - * Note: `NaN` is considered a number. See http://es5.github.io/#x8.5. - * - * @static - * @memberOf _ - * @category Objects - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if the `value` is a number, else `false`. - * @example - * - * _.isNumber(8.4 * 5); - * // => true - */ - function isNumber(value) { - return typeof value == 'number' || - value && typeof value == 'object' && toString.call(value) == numberClass || false; - } - - /** - * Checks if `value` is an object created by the `Object` constructor. - * - * @static - * @memberOf _ - * @category Objects - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. - * @example - * - * function Shape() { - * this.x = 0; - * this.y = 0; - * } - * - * _.isPlainObject(new Shape); - * // => false - * - * _.isPlainObject([1, 2, 3]); - * // => false - * - * _.isPlainObject({ 'x': 0, 'y': 0 }); - * // => true - */ - var isPlainObject = !getPrototypeOf ? shimIsPlainObject : function(value) { - if (!(value && toString.call(value) == objectClass) || (!support.argsClass && isArguments(value))) { - return false; - } - var valueOf = value.valueOf, - objProto = isNative(valueOf) && (objProto = getPrototypeOf(valueOf)) && getPrototypeOf(objProto); - - return objProto - ? (value == objProto || getPrototypeOf(value) == objProto) - : shimIsPlainObject(value); - }; - - /** - * Checks if `value` is a regular expression. - * - * @static - * @memberOf _ - * @category Objects - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if the `value` is a regular expression, else `false`. - * @example - * - * _.isRegExp(/fred/); - * // => true - */ - function isRegExp(value) { - return value && objectTypes[typeof value] && toString.call(value) == regexpClass || false; - } - - /** - * Checks if `value` is a string. - * - * @static - * @memberOf _ - * @category Objects - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if the `value` is a string, else `false`. - * @example - * - * _.isString('fred'); - * // => true - */ - function isString(value) { - return typeof value == 'string' || - value && typeof value == 'object' && toString.call(value) == stringClass || false; - } - - /** - * Checks if `value` is `undefined`. - * - * @static - * @memberOf _ - * @category Objects - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if the `value` is `undefined`, else `false`. - * @example - * - * _.isUndefined(void 0); - * // => true - */ - function isUndefined(value) { - return typeof value == 'undefined'; - } - - /** - * Creates an object with the same keys as `object` and values generated by - * running each own enumerable property of `object` through the callback. - * The callback is bound to `thisArg` and invoked with three arguments; - * (value, key, object). - * - * If a property name is provided for `callback` the created "_.pluck" style - * callback will return the property value of the given element. - * - * If an object is provided for `callback` the created "_.where" style callback - * will return `true` for elements that have the properties of the given object, - * else `false`. - * - * @static - * @memberOf _ - * @category Objects - * @param {Object} object The object to iterate over. - * @param {Function|Object|string} [callback=identity] The function called - * per iteration. If a property name or object is provided it will be used - * to create a "_.pluck" or "_.where" style callback, respectively. - * @param {*} [thisArg] The `this` binding of `callback`. - * @returns {Array} Returns a new object with values of the results of each `callback` execution. - * @example - * - * _.mapValues({ 'a': 1, 'b': 2, 'c': 3} , function(num) { return num * 3; }); - * // => { 'a': 3, 'b': 6, 'c': 9 } - * - * var characters = { - * 'fred': { 'name': 'fred', 'age': 40 }, - * 'pebbles': { 'name': 'pebbles', 'age': 1 } - * }; - * - * // using "_.pluck" callback shorthand - * _.mapValues(characters, 'age'); - * // => { 'fred': 40, 'pebbles': 1 } - */ - function mapValues(object, callback, thisArg) { - var result = {}; - callback = lodash.createCallback(callback, thisArg, 3); - - forOwn(object, function(value, key, object) { - result[key] = callback(value, key, object); - }); - return result; - } - - /** - * Recursively merges own enumerable properties of the source object(s), that - * don't resolve to `undefined` into the destination object. Subsequent sources - * will overwrite property assignments of previous sources. If a callback is - * provided it will be executed to produce the merged values of the destination - * and source properties. If the callback returns `undefined` merging will - * be handled by the method instead. The callback is bound to `thisArg` and - * invoked with two arguments; (objectValue, sourceValue). - * - * @static - * @memberOf _ - * @category Objects - * @param {Object} object The destination object. - * @param {...Object} [source] The source objects. - * @param {Function} [callback] The function to customize merging properties. - * @param {*} [thisArg] The `this` binding of `callback`. - * @returns {Object} Returns the destination object. - * @example - * - * var names = { - * 'characters': [ - * { 'name': 'barney' }, - * { 'name': 'fred' } - * ] - * }; - * - * var ages = { - * 'characters': [ - * { 'age': 36 }, - * { 'age': 40 } - * ] - * }; - * - * _.merge(names, ages); - * // => { 'characters': [{ 'name': 'barney', 'age': 36 }, { 'name': 'fred', 'age': 40 }] } - * - * var food = { - * 'fruits': ['apple'], - * 'vegetables': ['beet'] - * }; - * - * var otherFood = { - * 'fruits': ['banana'], - * 'vegetables': ['carrot'] - * }; - * - * _.merge(food, otherFood, function(a, b) { - * return _.isArray(a) ? a.concat(b) : undefined; - * }); - * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot] } - */ - function merge(object) { - var args = arguments, - length = 2; - - if (!isObject(object)) { - return object; - } - // allows working with `_.reduce` and `_.reduceRight` without using - // their `index` and `collection` arguments - if (typeof args[2] != 'number') { - length = args.length; - } - if (length > 3 && typeof args[length - 2] == 'function') { - var callback = baseCreateCallback(args[--length - 1], args[length--], 2); - } else if (length > 2 && typeof args[length - 1] == 'function') { - callback = args[--length]; - } - var sources = slice(arguments, 1, length), - index = -1, - stackA = getArray(), - stackB = getArray(); - - while (++index < length) { - baseMerge(object, sources[index], callback, stackA, stackB); - } - releaseArray(stackA); - releaseArray(stackB); - return object; - } - - /** - * Creates a shallow clone of `object` excluding the specified properties. - * Property names may be specified as individual arguments or as arrays of - * property names. If a callback is provided it will be executed for each - * property of `object` omitting the properties the callback returns truey - * for. The callback is bound to `thisArg` and invoked with three arguments; - * (value, key, object). - * - * @static - * @memberOf _ - * @category Objects - * @param {Object} object The source object. - * @param {Function|...string|string[]} [callback] The properties to omit or the - * function called per iteration. - * @param {*} [thisArg] The `this` binding of `callback`. - * @returns {Object} Returns an object without the omitted properties. - * @example - * - * _.omit({ 'name': 'fred', 'age': 40 }, 'age'); - * // => { 'name': 'fred' } - * - * _.omit({ 'name': 'fred', 'age': 40 }, function(value) { - * return typeof value == 'number'; - * }); - * // => { 'name': 'fred' } - */ - function omit(object, callback, thisArg) { - var result = {}; - if (typeof callback != 'function') { - var props = []; - forIn(object, function(value, key) { - props.push(key); - }); - props = baseDifference(props, baseFlatten(arguments, true, false, 1)); - - var index = -1, - length = props.length; - - while (++index < length) { - var key = props[index]; - result[key] = object[key]; - } - } else { - callback = lodash.createCallback(callback, thisArg, 3); - forIn(object, function(value, key, object) { - if (!callback(value, key, object)) { - result[key] = value; - } - }); - } - return result; - } - - /** - * Creates a two dimensional array of an object's key-value pairs, - * i.e. `[[key1, value1], [key2, value2]]`. - * - * @static - * @memberOf _ - * @category Objects - * @param {Object} object The object to inspect. - * @returns {Array} Returns new array of key-value pairs. - * @example - * - * _.pairs({ 'barney': 36, 'fred': 40 }); - * // => [['barney', 36], ['fred', 40]] (property order is not guaranteed across environments) - */ - function pairs(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 a shallow clone of `object` composed of the specified properties. - * Property names may be specified as individual arguments or as arrays of - * property names. If a callback is provided it will be executed for each - * property of `object` picking the properties the callback returns truey - * for. The callback is bound to `thisArg` and invoked with three arguments; - * (value, key, object). - * - * @static - * @memberOf _ - * @category Objects - * @param {Object} object The source object. - * @param {Function|...string|string[]} [callback] The function called per - * iteration or property names to pick, specified as individual property - * names or arrays of property names. - * @param {*} [thisArg] The `this` binding of `callback`. - * @returns {Object} Returns an object composed of the picked properties. - * @example - * - * _.pick({ 'name': 'fred', '_userid': 'fred1' }, 'name'); - * // => { 'name': 'fred' } - * - * _.pick({ 'name': 'fred', '_userid': 'fred1' }, function(value, key) { - * return key.charAt(0) != '_'; - * }); - * // => { 'name': 'fred' } - */ - function pick(object, callback, thisArg) { - var result = {}; - if (typeof callback != 'function') { - var index = -1, - props = baseFlatten(arguments, true, false, 1), - length = isObject(object) ? props.length : 0; - - while (++index < length) { - var key = props[index]; - if (key in object) { - result[key] = object[key]; - } - } - } else { - callback = lodash.createCallback(callback, thisArg, 3); - forIn(object, function(value, key, object) { - if (callback(value, key, object)) { - result[key] = value; - } - }); - } - return result; - } - - /** - * 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 a callback, with each callback execution - * potentially mutating the `accumulator` object. The callback is bound to - * `thisArg` and invoked with four arguments; (accumulator, value, key, object). - * Callbacks may exit iteration early by explicitly returning `false`. - * - * @static - * @memberOf _ - * @category Objects - * @param {Array|Object} object The object to iterate over. - * @param {Function} [callback=identity] The function called per iteration. - * @param {*} [accumulator] The custom accumulator value. - * @param {*} [thisArg] The `this` binding of `callback`. - * @returns {*} Returns the accumulated value. - * @example - * - * var squares = _.transform([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], function(result, num) { - * num *= num; - * if (num % 2) { - * return result.push(num) < 3; - * } - * }); - * // => [1, 9, 25] - * - * var mapped = _.transform({ 'a': 1, 'b': 2, 'c': 3 }, function(result, num, key) { - * result[key] = num * 3; - * }); - * // => { 'a': 3, 'b': 6, 'c': 9 } - */ - function transform(object, callback, accumulator, thisArg) { - var isArr = isArray(object); - if (accumulator == null) { - if (isArr) { - accumulator = []; - } else { - var ctor = object && object.constructor, - proto = ctor && ctor.prototype; - - accumulator = baseCreate(proto); - } - } - if (callback) { - callback = lodash.createCallback(callback, thisArg, 4); - (isArr ? baseEach : forOwn)(object, function(value, index, object) { - return callback(accumulator, value, index, object); - }); - } - return accumulator; - } - - /** - * Creates an array composed of the own enumerable property values of `object`. - * - * @static - * @memberOf _ - * @category Objects - * @param {Object} object The object to inspect. - * @returns {Array} Returns an array of property values. - * @example - * - * _.values({ 'one': 1, 'two': 2, 'three': 3 }); - * // => [1, 2, 3] (property order is not guaranteed across environments) - */ - function values(object) { - var index = -1, - props = keys(object), - length = props.length, - result = Array(length); - - while (++index < length) { - result[index] = object[props[index]]; - } - return result; - } - - /*--------------------------------------------------------------------------*/ - - /** - * Creates an array of elements from the specified indexes, or keys, of the - * `collection`. Indexes may be specified as individual arguments or as arrays - * of indexes. - * - * @static - * @memberOf _ - * @category Collections - * @param {Array|Object|string} collection The collection to iterate over. - * @param {...(number|number[]|string|string[])} [index] The indexes of `collection` - * to retrieve, specified as individual indexes or arrays of indexes. - * @returns {Array} Returns a new array of elements corresponding to the - * provided indexes. - * @example - * - * _.at(['a', 'b', 'c', 'd', 'e'], [0, 2, 4]); - * // => ['a', 'c', 'e'] - * - * _.at(['fred', 'barney', 'pebbles'], 0, 2); - * // => ['fred', 'pebbles'] - */ - function at(collection) { - var args = arguments, - index = -1, - props = baseFlatten(args, true, false, 1), - length = (args[2] && args[2][args[1]] === collection) ? 1 : props.length, - result = Array(length); - - if (support.unindexedChars && isString(collection)) { - collection = collection.split(''); - } - while(++index < length) { - result[index] = collection[props[index]]; - } - return result; - } - - /** - * Checks if a given value is present in a collection using strict equality - * for comparisons, i.e. `===`. If `fromIndex` is negative, it is used as the - * offset from the end of the collection. - * - * @static - * @memberOf _ - * @alias include - * @category Collections - * @param {Array|Object|string} collection The collection to iterate over. - * @param {*} target The value to check for. - * @param {number} [fromIndex=0] The index to search from. - * @returns {boolean} Returns `true` if the `target` element is found, else `false`. - * @example - * - * _.contains([1, 2, 3], 1); - * // => true - * - * _.contains([1, 2, 3], 1, 2); - * // => false - * - * _.contains({ 'name': 'fred', 'age': 40 }, 'fred'); - * // => true - * - * _.contains('pebbles', 'eb'); - * // => true - */ - function contains(collection, target, fromIndex) { - var index = -1, - indexOf = getIndexOf(), - length = collection ? collection.length : 0, - result = false; - - fromIndex = (fromIndex < 0 ? nativeMax(0, length + fromIndex) : fromIndex) || 0; - if (isArray(collection)) { - result = indexOf(collection, target, fromIndex) > -1; - } else if (typeof length == 'number') { - result = (isString(collection) ? collection.indexOf(target, fromIndex) : indexOf(collection, target, fromIndex)) > -1; - } else { - baseEach(collection, function(value) { - if (++index >= fromIndex) { - return !(result = value === target); - } - }); - } - return result; - } - - /** - * Creates an object composed of keys generated from the results of running - * each element of `collection` through the callback. The corresponding value - * of each key is the number of times the key was returned by the callback. - * The callback is bound to `thisArg` and invoked with three arguments; - * (value, index|key, collection). - * - * If a property name is provided for `callback` the created "_.pluck" style - * callback will return the property value of the given element. - * - * If an object is provided for `callback` the created "_.where" style callback - * will return `true` for elements that have the properties of the given object, - * else `false`. - * - * @static - * @memberOf _ - * @category Collections - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [callback=identity] The function called - * per iteration. If a property name or object is provided it will be used - * to create a "_.pluck" or "_.where" style callback, respectively. - * @param {*} [thisArg] The `this` binding of `callback`. - * @returns {Object} Returns the composed aggregate object. - * @example - * - * _.countBy([4.3, 6.1, 6.4], function(num) { return Math.floor(num); }); - * // => { '4': 1, '6': 2 } - * - * _.countBy([4.3, 6.1, 6.4], function(num) { return this.floor(num); }, 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 the given callback returns truey value for **all** elements of - * a collection. The callback is bound to `thisArg` and invoked with three - * arguments; (value, index|key, collection). - * - * If a property name is provided for `callback` the created "_.pluck" style - * callback will return the property value of the given element. - * - * If an object is provided for `callback` the created "_.where" style callback - * will return `true` for elements that have the properties of the given object, - * else `false`. - * - * @static - * @memberOf _ - * @alias all - * @category Collections - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [callback=identity] The function called - * per iteration. If a property name or object is provided it will be used - * to create a "_.pluck" or "_.where" style callback, respectively. - * @param {*} [thisArg] The `this` binding of `callback`. - * @returns {boolean} Returns `true` if all elements passed the callback check, - * else `false`. - * @example - * - * _.every([true, 1, null, 'yes']); - * // => false - * - * var characters = [ - * { 'name': 'barney', 'age': 36 }, - * { 'name': 'fred', 'age': 40 } - * ]; - * - * // using "_.pluck" callback shorthand - * _.every(characters, 'age'); - * // => true - * - * // using "_.where" callback shorthand - * _.every(characters, { 'age': 36 }); - * // => false - */ - function every(collection, callback, thisArg) { - var result = true; - callback = lodash.createCallback(callback, thisArg, 3); - - if (isArray(collection)) { - var index = -1, - length = collection.length; - - while (++index < length) { - if (!(result = !!callback(collection[index], index, collection))) { - break; - } - } - } else { - baseEach(collection, function(value, index, collection) { - return (result = !!callback(value, index, collection)); - }); - } - return result; - } - - /** - * Iterates over elements of a collection, returning an array of all elements - * the callback returns truey for. The callback is bound to `thisArg` and - * invoked with three arguments; (value, index|key, collection). - * - * If a property name is provided for `callback` the created "_.pluck" style - * callback will return the property value of the given element. - * - * If an object is provided for `callback` the created "_.where" style callback - * will return `true` for elements that have the properties of the given object, - * else `false`. - * - * @static - * @memberOf _ - * @alias select - * @category Collections - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [callback=identity] The function called - * per iteration. If a property name or object is provided it will be used - * to create a "_.pluck" or "_.where" style callback, respectively. - * @param {*} [thisArg] The `this` binding of `callback`. - * @returns {Array} Returns a new array of elements that passed the callback check. - * @example - * - * var evens = _.filter([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; }); - * // => [2, 4, 6] - * - * var characters = [ - * { 'name': 'barney', 'age': 36, 'blocked': false }, - * { 'name': 'fred', 'age': 40, 'blocked': true } - * ]; - * - * // using "_.pluck" callback shorthand - * _.filter(characters, 'blocked'); - * // => [{ 'name': 'fred', 'age': 40, 'blocked': true }] - * - * // using "_.where" callback shorthand - * _.filter(characters, { 'age': 36 }); - * // => [{ 'name': 'barney', 'age': 36, 'blocked': false }] - */ - function filter(collection, callback, thisArg) { - var result = []; - callback = lodash.createCallback(callback, thisArg, 3); - - if (isArray(collection)) { - var index = -1, - length = collection.length; - - while (++index < length) { - var value = collection[index]; - if (callback(value, index, collection)) { - result.push(value); - } - } - } else { - baseEach(collection, function(value, index, collection) { - if (callback(value, index, collection)) { - result.push(value); - } - }); - } - return result; - } - - /** - * Iterates over elements of a collection, returning the first element that - * the callback returns truey for. The callback is bound to `thisArg` and - * invoked with three arguments; (value, index|key, collection). - * - * If a property name is provided for `callback` the created "_.pluck" style - * callback will return the property value of the given element. - * - * If an object is provided for `callback` the created "_.where" style callback - * will return `true` for elements that have the properties of the given object, - * else `false`. - * - * @static - * @memberOf _ - * @alias detect, findWhere - * @category Collections - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [callback=identity] The function called - * per iteration. If a property name or object is provided it will be used - * to create a "_.pluck" or "_.where" style callback, respectively. - * @param {*} [thisArg] The `this` binding of `callback`. - * @returns {*} Returns the found element, else `undefined`. - * @example - * - * var characters = [ - * { 'name': 'barney', 'age': 36, 'blocked': false }, - * { 'name': 'fred', 'age': 40, 'blocked': true }, - * { 'name': 'pebbles', 'age': 1, 'blocked': false } - * ]; - * - * _.find(characters, function(chr) { - * return chr.age < 40; - * }); - * // => { 'name': 'barney', 'age': 36, 'blocked': false } - * - * // using "_.where" callback shorthand - * _.find(characters, { 'age': 1 }); - * // => { 'name': 'pebbles', 'age': 1, 'blocked': false } - * - * // using "_.pluck" callback shorthand - * _.find(characters, 'blocked'); - * // => { 'name': 'fred', 'age': 40, 'blocked': true } - */ - function find(collection, callback, thisArg) { - callback = lodash.createCallback(callback, thisArg, 3); - - if (isArray(collection)) { - var index = -1, - length = collection.length; - - while (++index < length) { - var value = collection[index]; - if (callback(value, index, collection)) { - return value; - } - } - } else { - var result; - baseEach(collection, function(value, index, collection) { - if (callback(value, index, collection)) { - result = value; - return false; - } - }); - return result; - } - } - - /** - * This method is like `_.find` except that it iterates over elements - * of a `collection` from right to left. - * - * @static - * @memberOf _ - * @category Collections - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [callback=identity] The function called - * per iteration. If a property name or object is provided it will be used - * to create a "_.pluck" or "_.where" style callback, respectively. - * @param {*} [thisArg] The `this` binding of `callback`. - * @returns {*} Returns the found element, else `undefined`. - * @example - * - * _.findLast([1, 2, 3, 4], function(num) { - * return num % 2 == 1; - * }); - * // => 3 - */ - function findLast(collection, callback, thisArg) { - var result; - callback = lodash.createCallback(callback, thisArg, 3); - forEachRight(collection, function(value, index, collection) { - if (callback(value, index, collection)) { - result = value; - return false; - } - }); - return result; - } - - /** - * Iterates over elements of a collection, executing the callback for each - * element. The callback is bound to `thisArg` and invoked with three arguments; - * (value, index|key, collection). Callbacks 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 Collections - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} [callback=identity] The function called per iteration. - * @param {*} [thisArg] The `this` binding of `callback`. - * @returns {Array|Object|string} Returns `collection`. - * @example - * - * _([1, 2, 3]).forEach(function(num) { console.log(num); }).join(','); - * // => logs each number and returns '1,2,3' - * - * _.forEach({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { console.log(num); }); - * // => logs each number and returns the object (property order is not guaranteed across environments) - */ - function forEach(collection, callback, thisArg) { - if (callback && typeof thisArg == 'undefined' && isArray(collection)) { - var index = -1, - length = collection.length; - - while (++index < length) { - if (callback(collection[index], index, collection) === false) { - break; - } - } - } else { - baseEach(collection, callback, thisArg); - } - return collection; - } - - /** - * This method is like `_.forEach` except that it iterates over elements - * of a `collection` from right to left. - * - * @static - * @memberOf _ - * @alias eachRight - * @category Collections - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} [callback=identity] The function called per iteration. - * @param {*} [thisArg] The `this` binding of `callback`. - * @returns {Array|Object|string} Returns `collection`. - * @example - * - * _([1, 2, 3]).forEachRight(function(num) { console.log(num); }).join(','); - * // => logs each number from right to left and returns '3,2,1' - */ - function forEachRight(collection, callback, thisArg) { - var iterable = collection, - length = collection ? collection.length : 0; - - callback = callback && typeof thisArg == 'undefined' ? callback : baseCreateCallback(callback, thisArg, 3); - if (isArray(collection)) { - while (length--) { - if (callback(collection[length], length, collection) === false) { - break; - } - } - } else { - if (typeof length != 'number') { - var props = keys(collection); - length = props.length; - } else if (support.unindexedChars && isString(collection)) { - iterable = collection.split(''); - } - baseEach(collection, function(value, key, collection) { - key = props ? props[--length] : --length; - return callback(iterable[key], key, collection); - }); - } - return collection; - } - - /** - * Creates an object composed of keys generated from the results of running - * each element of a collection through the callback. The corresponding value - * of each key is an array of the elements responsible for generating the key. - * The callback is bound to `thisArg` and invoked with three arguments; - * (value, index|key, collection). - * - * If a property name is provided for `callback` the created "_.pluck" style - * callback will return the property value of the given element. - * - * If an object is provided for `callback` the created "_.where" style callback - * will return `true` for elements that have the properties of the given object, - * else `false` - * - * @static - * @memberOf _ - * @category Collections - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [callback=identity] The function called - * per iteration. If a property name or object is provided it will be used - * to create a "_.pluck" or "_.where" style callback, respectively. - * @param {*} [thisArg] The `this` binding of `callback`. - * @returns {Object} Returns the composed aggregate object. - * @example - * - * _.groupBy([4.2, 6.1, 6.4], function(num) { return Math.floor(num); }); - * // => { '4': [4.2], '6': [6.1, 6.4] } - * - * _.groupBy([4.2, 6.1, 6.4], function(num) { return this.floor(num); }, Math); - * // => { '4': [4.2], '6': [6.1, 6.4] } - * - * // using "_.pluck" callback shorthand - * _.groupBy(['one', 'two', 'three'], 'length'); - * // => { '3': ['one', 'two'], '5': ['three'] } - */ - var groupBy = createAggregator(function(result, value, key) { - (hasOwnProperty.call(result, key) ? result[key] : result[key] = []).push(value); - }); - - /** - * Creates an object composed of keys generated from the results of running - * each element of the collection through the given callback. The corresponding - * value of each key is the last element responsible for generating the key. - * The callback is bound to `thisArg` and invoked with three arguments; - * (value, index|key, collection). - * - * If a property name is provided for `callback` the created "_.pluck" style - * callback will return the property value of the given element. - * - * If an object is provided for `callback` the created "_.where" style callback - * will return `true` for elements that have the properties of the given object, - * else `false`. - * - * @static - * @memberOf _ - * @category Collections - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [callback=identity] The function called - * per iteration. If a property name or object is provided it will be used - * to create a "_.pluck" or "_.where" style callback, respectively. - * @param {*} [thisArg] The `this` binding of `callback`. - * @returns {Object} Returns the composed aggregate object. - * @example - * - * var keys = [ - * { 'dir': 'left', 'code': 97 }, - * { 'dir': 'right', 'code': 100 } - * ]; - * - * _.indexBy(keys, 'dir'); - * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } - * - * _.indexBy(keys, function(key) { return String.fromCharCode(key.code); }); - * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } - * - * _.indexBy(characters, function(key) { this.fromCharCode(key.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 named by `methodName` on each element in the `collection` - * returning an array of the results of each invoked method. Additional arguments - * will be provided to each invoked method. If `methodName` is a function it - * will be invoked for, and `this` bound to, each element in the `collection`. - * - * @static - * @memberOf _ - * @category Collections - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|string} methodName The name of the method to invoke or - * the function invoked per iteration. - * @param {...*} [arg] Arguments to invoke the method with. - * @returns {Array} Returns a new array of the results of each invoked method. - * @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']] - */ - function invoke(collection, methodName) { - var args = slice(arguments, 2), - index = -1, - isFunc = typeof methodName == 'function', - length = collection ? collection.length : 0, - result = Array(typeof length == 'number' ? length : 0); - - forEach(collection, function(value) { - result[++index] = (isFunc ? methodName : value[methodName]).apply(value, args); - }); - return result; - } - - /** - * Creates an array of values by running each element in the collection - * through the callback. The callback is bound to `thisArg` and invoked with - * three arguments; (value, index|key, collection). - * - * If a property name is provided for `callback` the created "_.pluck" style - * callback will return the property value of the given element. - * - * If an object is provided for `callback` the created "_.where" style callback - * will return `true` for elements that have the properties of the given object, - * else `false`. - * - * @static - * @memberOf _ - * @alias collect - * @category Collections - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [callback=identity] The function called - * per iteration. If a property name or object is provided it will be used - * to create a "_.pluck" or "_.where" style callback, respectively. - * @param {*} [thisArg] The `this` binding of `callback`. - * @returns {Array} Returns a new array of the results of each `callback` execution. - * @example - * - * _.map([1, 2, 3], function(num) { return num * 3; }); - * // => [3, 6, 9] - * - * _.map({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { return num * 3; }); - * // => [3, 6, 9] (property order is not guaranteed across environments) - * - * var characters = [ - * { 'name': 'barney', 'age': 36 }, - * { 'name': 'fred', 'age': 40 } - * ]; - * - * // using "_.pluck" callback shorthand - * _.map(characters, 'name'); - * // => ['barney', 'fred'] - */ - function map(collection, callback, thisArg) { - var index = -1, - length = collection ? collection.length : 0, - result = Array(typeof length == 'number' ? length : 0); - - callback = lodash.createCallback(callback, thisArg, 3); - if (isArray(collection)) { - while (++index < length) { - result[index] = callback(collection[index], index, collection); - } - } else { - baseEach(collection, function(value, key, collection) { - result[++index] = callback(value, key, collection); - }); - } - return result; - } - - /** - * Retrieves the maximum value of a collection. If the collection is empty or - * falsey `-Infinity` is returned. If a callback is provided it will be executed - * for each value in the collection to generate the criterion by which the value - * is ranked. The callback is bound to `thisArg` and invoked with three - * arguments; (value, index, collection). - * - * If a property name is provided for `callback` the created "_.pluck" style - * callback will return the property value of the given element. - * - * If an object is provided for `callback` the created "_.where" style callback - * will return `true` for elements that have the properties of the given object, - * else `false`. - * - * @static - * @memberOf _ - * @category Collections - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [callback=identity] The function called - * per iteration. If a property name or object is provided it will be used - * to create a "_.pluck" or "_.where" style callback, respectively. - * @param {*} [thisArg] The `this` binding of `callback`. - * @returns {*} Returns the maximum value. - * @example - * - * _.max([4, 2, 8, 6]); - * // => 8 - * - * var characters = [ - * { 'name': 'barney', 'age': 36 }, - * { 'name': 'fred', 'age': 40 } - * ]; - * - * _.max(characters, function(chr) { return chr.age; }); - * // => { 'name': 'fred', 'age': 40 }; - * - * // using "_.pluck" callback shorthand - * _.max(characters, 'age'); - * // => { 'name': 'fred', 'age': 40 }; - */ - function max(collection, callback, thisArg) { - var computed = -Infinity, - result = computed; - - // allows working with functions like `_.map` without using - // their `index` argument as a callback - if (typeof callback != 'function' && thisArg && thisArg[callback] === collection) { - callback = null; - } - if (callback == null && isArray(collection)) { - var index = -1, - length = collection.length; - - while (++index < length) { - var value = collection[index]; - if (value > result) { - result = value; - } - } - } else { - callback = (callback == null && isString(collection)) - ? charAtCallback - : lodash.createCallback(callback, thisArg, 3); - - baseEach(collection, function(value, index, collection) { - var current = callback(value, index, collection); - if (current > computed) { - computed = current; - result = value; - } - }); - } - return result; - } - - /** - * Retrieves the minimum value of a collection. If the collection is empty or - * falsey `Infinity` is returned. If a callback is provided it will be executed - * for each value in the collection to generate the criterion by which the value - * is ranked. The callback is bound to `thisArg` and invoked with three - * arguments; (value, index, collection). - * - * If a property name is provided for `callback` the created "_.pluck" style - * callback will return the property value of the given element. - * - * If an object is provided for `callback` the created "_.where" style callback - * will return `true` for elements that have the properties of the given object, - * else `false`. - * - * @static - * @memberOf _ - * @category Collections - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [callback=identity] The function called - * per iteration. If a property name or object is provided it will be used - * to create a "_.pluck" or "_.where" style callback, respectively. - * @param {*} [thisArg] The `this` binding of `callback`. - * @returns {*} Returns the minimum value. - * @example - * - * _.min([4, 2, 8, 6]); - * // => 2 - * - * var characters = [ - * { 'name': 'barney', 'age': 36 }, - * { 'name': 'fred', 'age': 40 } - * ]; - * - * _.min(characters, function(chr) { return chr.age; }); - * // => { 'name': 'barney', 'age': 36 }; - * - * // using "_.pluck" callback shorthand - * _.min(characters, 'age'); - * // => { 'name': 'barney', 'age': 36 }; - */ - function min(collection, callback, thisArg) { - var computed = Infinity, - result = computed; - - // allows working with functions like `_.map` without using - // their `index` argument as a callback - if (typeof callback != 'function' && thisArg && thisArg[callback] === collection) { - callback = null; - } - if (callback == null && isArray(collection)) { - var index = -1, - length = collection.length; - - while (++index < length) { - var value = collection[index]; - if (value < result) { - result = value; - } - } - } else { - callback = (callback == null && isString(collection)) - ? charAtCallback - : lodash.createCallback(callback, thisArg, 3); - - baseEach(collection, function(value, index, collection) { - var current = callback(value, index, collection); - if (current < computed) { - computed = current; - result = value; - } - }); - } - return result; - } - - /** - * Retrieves the value of a specified property from all elements in the collection. - * - * @static - * @memberOf _ - * @type Function - * @category Collections - * @param {Array|Object|string} collection The collection to iterate over. - * @param {string} property The name of the property to pluck. - * @returns {Array} Returns a new array of property values. - * @example - * - * var characters = [ - * { 'name': 'barney', 'age': 36 }, - * { 'name': 'fred', 'age': 40 } - * ]; - * - * _.pluck(characters, 'name'); - * // => ['barney', 'fred'] - */ - var pluck = map; - - /** - * Reduces a collection to a value which is the accumulated result of running - * each element in the collection through the callback, where each successive - * callback execution consumes the return value of the previous execution. If - * `accumulator` is not provided the first element of the collection will be - * used as the initial `accumulator` value. The callback is bound to `thisArg` - * and invoked with four arguments; (accumulator, value, index|key, collection). - * - * @static - * @memberOf _ - * @alias foldl, inject - * @category Collections - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} [callback=identity] The function called per iteration. - * @param {*} [accumulator] Initial value of the accumulator. - * @param {*} [thisArg] The `this` binding of `callback`. - * @returns {*} Returns the accumulated value. - * @example - * - * var sum = _.reduce([1, 2, 3], function(sum, num) { - * return sum + num; - * }); - * // => 6 - * - * var mapped = _.reduce({ 'a': 1, 'b': 2, 'c': 3 }, function(result, num, key) { - * result[key] = num * 3; - * return result; - * }, {}); - * // => { 'a': 3, 'b': 6, 'c': 9 } - */ - function reduce(collection, callback, accumulator, thisArg) { - var noaccum = arguments.length < 3; - callback = lodash.createCallback(callback, thisArg, 4); - - if (isArray(collection)) { - var index = -1, - length = collection.length; - - if (noaccum) { - accumulator = collection[++index]; - } - while (++index < length) { - accumulator = callback(accumulator, collection[index], index, collection); - } - } else { - baseEach(collection, function(value, index, collection) { - accumulator = noaccum - ? (noaccum = false, value) - : callback(accumulator, value, index, collection) - }); - } - return accumulator; - } - - /** - * This method is like `_.reduce` except that it iterates over elements - * of a `collection` from right to left. - * - * @static - * @memberOf _ - * @alias foldr - * @category Collections - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} [callback=identity] The function called per iteration. - * @param {*} [accumulator] Initial value of the accumulator. - * @param {*} [thisArg] The `this` binding of `callback`. - * @returns {*} Returns the accumulated value. - * @example - * - * var list = [[0, 1], [2, 3], [4, 5]]; - * var flat = _.reduceRight(list, function(a, b) { return a.concat(b); }, []); - * // => [4, 5, 2, 3, 0, 1] - */ - function reduceRight(collection, callback, accumulator, thisArg) { - var noaccum = arguments.length < 3; - callback = lodash.createCallback(callback, thisArg, 4); - forEachRight(collection, function(value, index, collection) { - accumulator = noaccum - ? (noaccum = false, value) - : callback(accumulator, value, index, collection); - }); - return accumulator; - } - - /** - * The opposite of `_.filter` this method returns the elements of a - * collection that the callback does **not** return truey for. - * - * If a property name is provided for `callback` the created "_.pluck" style - * callback will return the property value of the given element. - * - * If an object is provided for `callback` the created "_.where" style callback - * will return `true` for elements that have the properties of the given object, - * else `false`. - * - * @static - * @memberOf _ - * @category Collections - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [callback=identity] The function called - * per iteration. If a property name or object is provided it will be used - * to create a "_.pluck" or "_.where" style callback, respectively. - * @param {*} [thisArg] The `this` binding of `callback`. - * @returns {Array} Returns a new array of elements that failed the callback check. - * @example - * - * var odds = _.reject([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; }); - * // => [1, 3, 5] - * - * var characters = [ - * { 'name': 'barney', 'age': 36, 'blocked': false }, - * { 'name': 'fred', 'age': 40, 'blocked': true } - * ]; - * - * // using "_.pluck" callback shorthand - * _.reject(characters, 'blocked'); - * // => [{ 'name': 'barney', 'age': 36, 'blocked': false }] - * - * // using "_.where" callback shorthand - * _.reject(characters, { 'age': 36 }); - * // => [{ 'name': 'fred', 'age': 40, 'blocked': true }] - */ - function reject(collection, callback, thisArg) { - callback = lodash.createCallback(callback, thisArg, 3); - return filter(collection, function(value, index, collection) { - return !callback(value, index, collection); - }); - } - - /** - * Retrieves a random element or `n` random elements from a collection. - * - * @static - * @memberOf _ - * @category Collections - * @param {Array|Object|string} collection The collection to sample. - * @param {number} [n] The number of elements to sample. - * @param- {Object} [guard] Allows working with functions like `_.map` - * without using their `index` arguments as `n`. - * @returns {Array} Returns the random sample(s) of `collection`. - * @example - * - * _.sample([1, 2, 3, 4]); - * // => 2 - * - * _.sample([1, 2, 3, 4], 2); - * // => [3, 1] - */ - function sample(collection, n, guard) { - if (collection && typeof collection.length != 'number') { - collection = values(collection); - } else if (support.unindexedChars && isString(collection)) { - collection = collection.split(''); - } - if (n == null || guard) { - return collection ? collection[baseRandom(0, collection.length - 1)] : undefined; - } - var result = shuffle(collection); - result.length = nativeMin(nativeMax(0, n), result.length); - return result; - } - - /** - * Creates an array of shuffled values, using a version of the Fisher-Yates - * shuffle. See http://en.wikipedia.org/wiki/Fisher-Yates_shuffle. - * - * @static - * @memberOf _ - * @category Collections - * @param {Array|Object|string} collection The collection to shuffle. - * @returns {Array} Returns a new shuffled collection. - * @example - * - * _.shuffle([1, 2, 3, 4, 5, 6]); - * // => [4, 1, 6, 3, 5, 2] - */ - function shuffle(collection) { - var index = -1, - length = collection ? collection.length : 0, - result = Array(typeof length == 'number' ? length : 0); - - forEach(collection, function(value) { - var rand = baseRandom(0, ++index); - result[index] = result[rand]; - result[rand] = value; - }); - return result; - } - - /** - * Gets the size of the `collection` by returning `collection.length` for arrays - * and array-like objects or the number of own enumerable properties for objects. - * - * @static - * @memberOf _ - * @category Collections - * @param {Array|Object|string} collection The collection to inspect. - * @returns {number} Returns `collection.length` or number of own enumerable properties. - * @example - * - * _.size([1, 2]); - * // => 2 - * - * _.size({ 'one': 1, 'two': 2, 'three': 3 }); - * // => 3 - * - * _.size('pebbles'); - * // => 7 - */ - function size(collection) { - var length = collection ? collection.length : 0; - return typeof length == 'number' ? length : keys(collection).length; - } - - /** - * Checks if the callback returns a truey value for **any** element of a - * collection. The function returns as soon as it finds a passing value and - * does not iterate over the entire collection. The callback is bound to - * `thisArg` and invoked with three arguments; (value, index|key, collection). - * - * If a property name is provided for `callback` the created "_.pluck" style - * callback will return the property value of the given element. - * - * If an object is provided for `callback` the created "_.where" style callback - * will return `true` for elements that have the properties of the given object, - * else `false`. - * - * @static - * @memberOf _ - * @alias any - * @category Collections - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [callback=identity] The function called - * per iteration. If a property name or object is provided it will be used - * to create a "_.pluck" or "_.where" style callback, respectively. - * @param {*} [thisArg] The `this` binding of `callback`. - * @returns {boolean} Returns `true` if any element passed the callback check, - * else `false`. - * @example - * - * _.some([null, 0, 'yes', false], Boolean); - * // => true - * - * var characters = [ - * { 'name': 'barney', 'age': 36, 'blocked': false }, - * { 'name': 'fred', 'age': 40, 'blocked': true } - * ]; - * - * // using "_.pluck" callback shorthand - * _.some(characters, 'blocked'); - * // => true - * - * // using "_.where" callback shorthand - * _.some(characters, { 'age': 1 }); - * // => false - */ - function some(collection, callback, thisArg) { - var result; - callback = lodash.createCallback(callback, thisArg, 3); - - if (isArray(collection)) { - var index = -1, - length = collection.length; - - while (++index < length) { - if ((result = callback(collection[index], index, collection))) { - break; - } - } - } else { - baseEach(collection, function(value, index, collection) { - return !(result = callback(value, index, collection)); - }); - } - return !!result; - } - - /** - * Creates an array of elements, sorted in ascending order by the results of - * running each element in a collection through the callback. This method - * performs a stable sort, that is, it will preserve the original sort order - * of equal elements. The callback is bound to `thisArg` and invoked with - * three arguments; (value, index|key, collection). - * - * If a property name is provided for `callback` the created "_.pluck" style - * callback will return the property value of the given element. - * - * If an array of property names is provided for `callback` the collection - * will be sorted by each property value. - * - * If an object is provided for `callback` the created "_.where" style callback - * will return `true` for elements that have the properties of the given object, - * else `false`. - * - * @static - * @memberOf _ - * @category Collections - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Array|Function|Object|string} [callback=identity] The function called - * per iteration. If a property name or object is provided it will be used - * to create a "_.pluck" or "_.where" style callback, respectively. - * @param {*} [thisArg] The `this` binding of `callback`. - * @returns {Array} Returns a new array of sorted elements. - * @example - * - * _.sortBy([1, 2, 3], function(num) { return Math.sin(num); }); - * // => [3, 1, 2] - * - * _.sortBy([1, 2, 3], function(num) { return this.sin(num); }, Math); - * // => [3, 1, 2] - * - * var characters = [ - * { 'name': 'barney', 'age': 36 }, - * { 'name': 'fred', 'age': 40 }, - * { 'name': 'barney', 'age': 26 }, - * { 'name': 'fred', 'age': 30 } - * ]; - * - * // using "_.pluck" callback shorthand - * _.map(_.sortBy(characters, 'age'), _.values); - * // => [['barney', 26], ['fred', 30], ['barney', 36], ['fred', 40]] - * - * // sorting by multiple properties - * _.map(_.sortBy(characters, ['name', 'age']), _.values); - * // = > [['barney', 26], ['barney', 36], ['fred', 30], ['fred', 40]] - */ - function sortBy(collection, callback, thisArg) { - var index = -1, - isArr = isArray(callback), - length = collection ? collection.length : 0, - result = Array(typeof length == 'number' ? length : 0); - - if (!isArr) { - callback = lodash.createCallback(callback, thisArg, 3); - } - forEach(collection, function(value, key, collection) { - var object = result[++index] = getObject(); - if (isArr) { - object.criteria = map(callback, function(key) { return value[key]; }); - } else { - (object.criteria = getArray())[0] = callback(value, key, collection); - } - object.index = index; - object.value = value; - }); - - length = result.length; - result.sort(compareAscending); - while (length--) { - var object = result[length]; - result[length] = object.value; - if (!isArr) { - releaseArray(object.criteria); - } - releaseObject(object); - } - return result; - } - - /** - * Converts the `collection` to an array. - * - * @static - * @memberOf _ - * @category Collections - * @param {Array|Object|string} collection The collection to convert. - * @returns {Array} Returns the new converted array. - * @example - * - * (function() { return _.toArray(arguments).slice(1); })(1, 2, 3, 4); - * // => [2, 3, 4] - */ - function toArray(collection) { - if (collection && typeof collection.length == 'number') { - return (support.unindexedChars && isString(collection)) - ? collection.split('') - : slice(collection); - } - return values(collection); - } - - /** - * Performs a deep comparison of each element in a `collection` to the given - * `properties` object, returning an array of all elements that have equivalent - * property values. - * - * @static - * @memberOf _ - * @type Function - * @category Collections - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Object} props The object of property values to filter by. - * @returns {Array} Returns a new array of elements that have the given properties. - * @example - * - * var characters = [ - * { 'name': 'barney', 'age': 36, 'pets': ['hoppy'] }, - * { 'name': 'fred', 'age': 40, 'pets': ['baby puss', 'dino'] } - * ]; - * - * _.where(characters, { 'age': 36 }); - * // => [{ 'name': 'barney', 'age': 36, 'pets': ['hoppy'] }] - * - * _.where(characters, { 'pets': ['dino'] }); - * // => [{ 'name': 'fred', 'age': 40, 'pets': ['baby puss', 'dino'] }] - */ - var where = filter; - - /*--------------------------------------------------------------------------*/ - - /** - * Creates an array with all falsey values removed. The values `false`, `null`, - * `0`, `""`, `undefined`, and `NaN` are all falsey. - * - * @static - * @memberOf _ - * @category Arrays - * @param {Array} array The array to compact. - * @returns {Array} Returns a 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, - result = []; - - while (++index < length) { - var value = array[index]; - if (value) { - result.push(value); - } - } - return result; - } - - /** - * Creates an array excluding all values of the provided arrays using strict - * equality for comparisons, i.e. `===`. - * - * @static - * @memberOf _ - * @category Arrays - * @param {Array} array The array to process. - * @param {...Array} [values] The arrays of values to exclude. - * @returns {Array} Returns a new array of filtered values. - * @example - * - * _.difference([1, 2, 3, 4, 5], [5, 2, 10]); - * // => [1, 3, 4] - */ - function difference(array) { - return baseDifference(array, baseFlatten(arguments, true, true, 1)); - } - - /** - * This method is like `_.find` except that it returns the index of the first - * element that passes the callback check, instead of the element itself. - * - * If a property name is provided for `callback` the created "_.pluck" style - * callback will return the property value of the given element. - * - * If an object is provided for `callback` the created "_.where" style callback - * will return `true` for elements that have the properties of the given object, - * else `false`. - * - * @static - * @memberOf _ - * @category Arrays - * @param {Array} array The array to search. - * @param {Function|Object|string} [callback=identity] The function called - * per iteration. If a property name or object is provided it will be used - * to create a "_.pluck" or "_.where" style callback, respectively. - * @param {*} [thisArg] The `this` binding of `callback`. - * @returns {number} Returns the index of the found element, else `-1`. - * @example - * - * var characters = [ - * { 'name': 'barney', 'age': 36, 'blocked': false }, - * { 'name': 'fred', 'age': 40, 'blocked': true }, - * { 'name': 'pebbles', 'age': 1, 'blocked': false } - * ]; - * - * _.findIndex(characters, function(chr) { - * return chr.age < 20; - * }); - * // => 2 - * - * // using "_.where" callback shorthand - * _.findIndex(characters, { 'age': 36 }); - * // => 0 - * - * // using "_.pluck" callback shorthand - * _.findIndex(characters, 'blocked'); - * // => 1 - */ - function findIndex(array, callback, thisArg) { - var index = -1, - length = array ? array.length : 0; - - callback = lodash.createCallback(callback, thisArg, 3); - while (++index < length) { - if (callback(array[index], index, array)) { - return index; - } - } - return -1; - } - - /** - * This method is like `_.findIndex` except that it iterates over elements - * of a `collection` from right to left. - * - * If a property name is provided for `callback` the created "_.pluck" style - * callback will return the property value of the given element. - * - * If an object is provided for `callback` the created "_.where" style callback - * will return `true` for elements that have the properties of the given object, - * else `false`. - * - * @static - * @memberOf _ - * @category Arrays - * @param {Array} array The array to search. - * @param {Function|Object|string} [callback=identity] The function called - * per iteration. If a property name or object is provided it will be used - * to create a "_.pluck" or "_.where" style callback, respectively. - * @param {*} [thisArg] The `this` binding of `callback`. - * @returns {number} Returns the index of the found element, else `-1`. - * @example - * - * var characters = [ - * { 'name': 'barney', 'age': 36, 'blocked': true }, - * { 'name': 'fred', 'age': 40, 'blocked': false }, - * { 'name': 'pebbles', 'age': 1, 'blocked': true } - * ]; - * - * _.findLastIndex(characters, function(chr) { - * return chr.age > 30; - * }); - * // => 1 - * - * // using "_.where" callback shorthand - * _.findLastIndex(characters, { 'age': 36 }); - * // => 0 - * - * // using "_.pluck" callback shorthand - * _.findLastIndex(characters, 'blocked'); - * // => 2 - */ - function findLastIndex(array, callback, thisArg) { - var length = array ? array.length : 0; - callback = lodash.createCallback(callback, thisArg, 3); - while (length--) { - if (callback(array[length], length, array)) { - return length; - } - } - return -1; - } - - /** - * Gets the first element or first `n` elements of an array. If a callback - * is provided elements at the beginning of the array are returned as long - * as the callback returns truey. The callback is bound to `thisArg` and - * invoked with three arguments; (value, index, array). - * - * If a property name is provided for `callback` the created "_.pluck" style - * callback will return the property value of the given element. - * - * If an object is provided for `callback` the created "_.where" style callback - * will return `true` for elements that have the properties of the given object, - * else `false`. - * - * @static - * @memberOf _ - * @alias head, take - * @category Arrays - * @param {Array} array The array to query. - * @param {Function|Object|number|string} [callback] The function called - * per element or the number of elements to return. If a property name or - * object is provided it will be used to create a "_.pluck" or "_.where" - * style callback, respectively. - * @param {*} [thisArg] The `this` binding of `callback`. - * @returns {*} Returns the first element(s) of `array`. - * @example - * - * _.first([1, 2, 3]); - * // => 1 - * - * _.first([1, 2, 3], 2); - * // => [1, 2] - * - * _.first([1, 2, 3], function(num) { - * return num < 3; - * }); - * // => [1, 2] - * - * var characters = [ - * { 'name': 'barney', 'blocked': true, 'employer': 'slate' }, - * { 'name': 'fred', 'blocked': false, 'employer': 'slate' }, - * { 'name': 'pebbles', 'blocked': true, 'employer': 'na' } - * ]; - * - * // using "_.pluck" callback shorthand - * _.first(characters, 'blocked'); - * // => [{ 'name': 'barney', 'blocked': true, 'employer': 'slate' }] - * - * // using "_.where" callback shorthand - * _.pluck(_.first(characters, { 'employer': 'slate' }), 'name'); - * // => ['barney', 'fred'] - */ - function first(array, callback, thisArg) { - var n = 0, - length = array ? array.length : 0; - - if (typeof callback != 'number' && callback != null) { - var index = -1; - callback = lodash.createCallback(callback, thisArg, 3); - while (++index < length && callback(array[index], index, array)) { - n++; - } - } else { - n = callback; - if (n == null || thisArg) { - return array ? array[0] : undefined; - } - } - return slice(array, 0, nativeMin(nativeMax(0, n), length)); - } - - /** - * Flattens a nested array (the nesting can be to any depth). If `isShallow` - * is truey, the array will only be flattened a single level. If a callback - * is provided each element of the array is passed through the callback before - * flattening. The callback is bound to `thisArg` and invoked with three - * arguments; (value, index, array). - * - * If a property name is provided for `callback` the created "_.pluck" style - * callback will return the property value of the given element. - * - * If an object is provided for `callback` the created "_.where" style callback - * will return `true` for elements that have the properties of the given object, - * else `false`. - * - * @static - * @memberOf _ - * @category Arrays - * @param {Array} array The array to flatten. - * @param {boolean} [isShallow=false] A flag to restrict flattening to a single level. - * @param {Function|Object|string} [callback=identity] The function called - * per iteration. If a property name or object is provided it will be used - * to create a "_.pluck" or "_.where" style callback, respectively. - * @param {*} [thisArg] The `this` binding of `callback`. - * @returns {Array} Returns a new flattened array. - * @example - * - * _.flatten([1, [2], [3, [[4]]]]); - * // => [1, 2, 3, 4]; - * - * _.flatten([1, [2], [3, [[4]]]], true); - * // => [1, 2, 3, [[4]]]; - * - * var characters = [ - * { 'name': 'barney', 'age': 30, 'pets': ['hoppy'] }, - * { 'name': 'fred', 'age': 40, 'pets': ['baby puss', 'dino'] } - * ]; - * - * // using "_.pluck" callback shorthand - * _.flatten(characters, 'pets'); - * // => ['hoppy', 'baby puss', 'dino'] - */ - function flatten(array, isShallow, callback, thisArg) { - // juggle arguments - if (typeof isShallow != 'boolean' && isShallow != null) { - thisArg = callback; - callback = (typeof isShallow != 'function' && thisArg && thisArg[isShallow] === array) ? null : isShallow; - isShallow = false; - } - if (callback != null) { - array = map(array, callback, thisArg); - } - return baseFlatten(array, isShallow); - } - - /** - * Gets the index at which the first occurrence of `value` is found using - * strict equality for comparisons, i.e. `===`. If the array is already sorted - * providing `true` for `fromIndex` will run a faster binary search. - * - * @static - * @memberOf _ - * @category Arrays - * @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 or `-1`. - * @example - * - * _.indexOf([1, 2, 3, 1, 2, 3], 2); - * // => 1 - * - * _.indexOf([1, 2, 3, 1, 2, 3], 2, 3); - * // => 4 - * - * _.indexOf([1, 1, 2, 2, 3, 3], 2, true); - * // => 2 - */ - function indexOf(array, value, fromIndex) { - if (typeof fromIndex == 'number') { - var length = array ? array.length : 0; - fromIndex = (fromIndex < 0 ? nativeMax(0, length + fromIndex) : fromIndex || 0); - } else if (fromIndex) { - var index = sortedIndex(array, value); - return array[index] === value ? index : -1; - } - return baseIndexOf(array, value, fromIndex); - } - - /** - * Gets all but the last element or last `n` elements of an array. If a - * callback is provided elements at the end of the array are excluded from - * the result as long as the callback returns truey. The callback is bound - * to `thisArg` and invoked with three arguments; (value, index, array). - * - * If a property name is provided for `callback` the created "_.pluck" style - * callback will return the property value of the given element. - * - * If an object is provided for `callback` the created "_.where" style callback - * will return `true` for elements that have the properties of the given object, - * else `false`. - * - * @static - * @memberOf _ - * @category Arrays - * @param {Array} array The array to query. - * @param {Function|Object|number|string} [callback=1] The function called - * per element or the number of elements to exclude. If a property name or - * object is provided it will be used to create a "_.pluck" or "_.where" - * style callback, respectively. - * @param {*} [thisArg] The `this` binding of `callback`. - * @returns {Array} Returns a slice of `array`. - * @example - * - * _.initial([1, 2, 3]); - * // => [1, 2] - * - * _.initial([1, 2, 3], 2); - * // => [1] - * - * _.initial([1, 2, 3], function(num) { - * return num > 1; - * }); - * // => [1] - * - * var characters = [ - * { 'name': 'barney', 'blocked': false, 'employer': 'slate' }, - * { 'name': 'fred', 'blocked': true, 'employer': 'slate' }, - * { 'name': 'pebbles', 'blocked': true, 'employer': 'na' } - * ]; - * - * // using "_.pluck" callback shorthand - * _.initial(characters, 'blocked'); - * // => [{ 'name': 'barney', 'blocked': false, 'employer': 'slate' }] - * - * // using "_.where" callback shorthand - * _.pluck(_.initial(characters, { 'employer': 'na' }), 'name'); - * // => ['barney', 'fred'] - */ - function initial(array, callback, thisArg) { - var n = 0, - length = array ? array.length : 0; - - if (typeof callback != 'number' && callback != null) { - var index = length; - callback = lodash.createCallback(callback, thisArg, 3); - while (index-- && callback(array[index], index, array)) { - n++; - } - } else { - n = (callback == null || thisArg) ? 1 : callback || n; - } - return slice(array, 0, nativeMin(nativeMax(0, length - n), length)); - } - - /** - * Creates an array of unique values present in all provided arrays using - * strict equality for comparisons, i.e. `===`. - * - * @static - * @memberOf _ - * @category Arrays - * @param {...Array} [array] The arrays to inspect. - * @returns {Array} Returns an array of shared values. - * @example - * - * _.intersection([1, 2, 3], [5, 2, 1, 4], [2, 1]); - * // => [1, 2] - */ - function intersection() { - var args = [], - argsIndex = -1, - argsLength = arguments.length, - caches = getArray(), - indexOf = getIndexOf(), - trustIndexOf = indexOf === baseIndexOf, - seen = getArray(); - - while (++argsIndex < argsLength) { - var value = arguments[argsIndex]; - if (isArray(value) || isArguments(value)) { - args.push(value); - caches.push(trustIndexOf && value.length >= largeArraySize && - createCache(argsIndex ? args[argsIndex] : seen)); - } - } - var array = args[0], - index = -1, - length = array ? array.length : 0, - result = []; - - outer: - while (++index < length) { - var cache = caches[0]; - value = array[index]; - - if ((cache ? cacheIndexOf(cache, value) : indexOf(seen, value)) < 0) { - argsIndex = argsLength; - (cache || seen).push(value); - while (--argsIndex) { - cache = caches[argsIndex]; - if ((cache ? cacheIndexOf(cache, value) : indexOf(args[argsIndex], value)) < 0) { - continue outer; - } - } - result.push(value); - } - } - while (argsLength--) { - cache = caches[argsLength]; - if (cache) { - releaseObject(cache); - } - } - releaseArray(caches); - releaseArray(seen); - return result; - } - - /** - * Gets the last element or last `n` elements of an array. If a callback is - * provided elements at the end of the array are returned as long as the - * callback returns truey. The callback is bound to `thisArg` and invoked - * with three arguments; (value, index, array). - * - * If a property name is provided for `callback` the created "_.pluck" style - * callback will return the property value of the given element. - * - * If an object is provided for `callback` the created "_.where" style callback - * will return `true` for elements that have the properties of the given object, - * else `false`. - * - * @static - * @memberOf _ - * @category Arrays - * @param {Array} array The array to query. - * @param {Function|Object|number|string} [callback] The function called - * per element or the number of elements to return. If a property name or - * object is provided it will be used to create a "_.pluck" or "_.where" - * style callback, respectively. - * @param {*} [thisArg] The `this` binding of `callback`. - * @returns {*} Returns the last element(s) of `array`. - * @example - * - * _.last([1, 2, 3]); - * // => 3 - * - * _.last([1, 2, 3], 2); - * // => [2, 3] - * - * _.last([1, 2, 3], function(num) { - * return num > 1; - * }); - * // => [2, 3] - * - * var characters = [ - * { 'name': 'barney', 'blocked': false, 'employer': 'slate' }, - * { 'name': 'fred', 'blocked': true, 'employer': 'slate' }, - * { 'name': 'pebbles', 'blocked': true, 'employer': 'na' } - * ]; - * - * // using "_.pluck" callback shorthand - * _.pluck(_.last(characters, 'blocked'), 'name'); - * // => ['fred', 'pebbles'] - * - * // using "_.where" callback shorthand - * _.last(characters, { 'employer': 'na' }); - * // => [{ 'name': 'pebbles', 'blocked': true, 'employer': 'na' }] - */ - function last(array, callback, thisArg) { - var n = 0, - length = array ? array.length : 0; - - if (typeof callback != 'number' && callback != null) { - var index = length; - callback = lodash.createCallback(callback, thisArg, 3); - while (index-- && callback(array[index], index, array)) { - n++; - } - } else { - n = callback; - if (n == null || thisArg) { - return array ? array[length - 1] : undefined; - } - } - return slice(array, nativeMax(0, length - n)); - } - - /** - * Gets the index at which the last occurrence of `value` is found using strict - * equality for comparisons, i.e. `===`. If `fromIndex` is negative, it is used - * as the offset from the end of the collection. - * - * If a property name is provided for `callback` the created "_.pluck" style - * callback will return the property value of the given element. - * - * If an object is provided for `callback` the created "_.where" style callback - * will return `true` for elements that have the properties of the given object, - * else `false`. - * - * @static - * @memberOf _ - * @category Arrays - * @param {Array} array The array to search. - * @param {*} value The value to search for. - * @param {number} [fromIndex=array.length-1] The index to search from. - * @returns {number} Returns the index of the matched value or `-1`. - * @example - * - * _.lastIndexOf([1, 2, 3, 1, 2, 3], 2); - * // => 4 - * - * _.lastIndexOf([1, 2, 3, 1, 2, 3], 2, 3); - * // => 1 - */ - function lastIndexOf(array, value, fromIndex) { - var index = array ? array.length : 0; - if (typeof fromIndex == 'number') { - index = (fromIndex < 0 ? nativeMax(0, index + fromIndex) : nativeMin(fromIndex, index - 1)) + 1; - } - while (index--) { - if (array[index] === value) { - return index; - } - } - return -1; - } - - /** - * Removes all provided values from the given array using strict equality for - * comparisons, i.e. `===`. - * - * @static - * @memberOf _ - * @category Arrays - * @param {Array} array The array to modify. - * @param {...*} [value] 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(array) { - var args = arguments, - argsIndex = 0, - argsLength = args.length, - length = array ? array.length : 0; - - while (++argsIndex < argsLength) { - var index = -1, - value = args[argsIndex]; - while (++index < length) { - if (array[index] === value) { - splice.call(array, index--, 1); - length--; - } - } - } - return array; - } - - /** - * Creates an array of numbers (positive and/or negative) progressing from - * `start` up to but not including `end`. If `start` is less than `stop` a - * zero-length range is created unless a negative `step` is specified. - * - * @static - * @memberOf _ - * @category Arrays - * @param {number} [start=0] The start of the range. - * @param {number} end The end of the range. - * @param {number} [step=1] The value to increment or decrement by. - * @returns {Array} Returns a new range array. - * @example - * - * _.range(4); - * // => [0, 1, 2, 3] - * - * _.range(1, 5); - * // => [1, 2, 3, 4] - * - * _.range(0, 20, 5); - * // => [0, 5, 10, 15] - * - * _.range(0, -4, -1); - * // => [0, -1, -2, -3] - * - * _.range(1, 4, 0); - * // => [1, 1, 1] - * - * _.range(0); - * // => [] - */ - function range(start, end, step) { - start = +start || 0; - step = typeof step == 'number' ? step : (+step || 1); - - if (end == null) { - end = start; - start = 0; - } - // use `Array(length)` so engines like Chakra and V8 avoid slower modes - // http://youtu.be/XAqIpGU8ZZk#t=17m25s - var index = -1, - length = nativeMax(0, ceil((end - start) / (step || 1))), - result = Array(length); - - while (++index < length) { - result[index] = start; - start += step; - } - return result; - } - - /** - * Removes all elements from an array that the callback returns truey for - * and returns an array of removed elements. The callback is bound to `thisArg` - * and invoked with three arguments; (value, index, array). - * - * If a property name is provided for `callback` the created "_.pluck" style - * callback will return the property value of the given element. - * - * If an object is provided for `callback` the created "_.where" style callback - * will return `true` for elements that have the properties of the given object, - * else `false`. - * - * @static - * @memberOf _ - * @category Arrays - * @param {Array} array The array to modify. - * @param {Function|Object|string} [callback=identity] The function called - * per iteration. If a property name or object is provided it will be used - * to create a "_.pluck" or "_.where" style callback, respectively. - * @param {*} [thisArg] The `this` binding of `callback`. - * @returns {Array} Returns a new array of removed elements. - * @example - * - * var array = [1, 2, 3, 4, 5, 6]; - * var evens = _.remove(array, function(num) { return num % 2 == 0; }); - * - * console.log(array); - * // => [1, 3, 5] - * - * console.log(evens); - * // => [2, 4, 6] - */ - function remove(array, callback, thisArg) { - var index = -1, - length = array ? array.length : 0, - result = []; - - callback = lodash.createCallback(callback, thisArg, 3); - while (++index < length) { - var value = array[index]; - if (callback(value, index, array)) { - result.push(value); - splice.call(array, index--, 1); - length--; - } - } - return result; - } - - /** - * The opposite of `_.initial` this method gets all but the first element or - * first `n` elements of an array. If a callback function is provided elements - * at the beginning of the array are excluded from the result as long as the - * callback returns truey. The callback is bound to `thisArg` and invoked - * with three arguments; (value, index, array). - * - * If a property name is provided for `callback` the created "_.pluck" style - * callback will return the property value of the given element. - * - * If an object is provided for `callback` the created "_.where" style callback - * will return `true` for elements that have the properties of the given object, - * else `false`. - * - * @static - * @memberOf _ - * @alias drop, tail - * @category Arrays - * @param {Array} array The array to query. - * @param {Function|Object|number|string} [callback=1] The function called - * per element or the number of elements to exclude. If a property name or - * object is provided it will be used to create a "_.pluck" or "_.where" - * style callback, respectively. - * @param {*} [thisArg] The `this` binding of `callback`. - * @returns {Array} Returns a slice of `array`. - * @example - * - * _.rest([1, 2, 3]); - * // => [2, 3] - * - * _.rest([1, 2, 3], 2); - * // => [3] - * - * _.rest([1, 2, 3], function(num) { - * return num < 3; - * }); - * // => [3] - * - * var characters = [ - * { 'name': 'barney', 'blocked': true, 'employer': 'slate' }, - * { 'name': 'fred', 'blocked': false, 'employer': 'slate' }, - * { 'name': 'pebbles', 'blocked': true, 'employer': 'na' } - * ]; - * - * // using "_.pluck" callback shorthand - * _.pluck(_.rest(characters, 'blocked'), 'name'); - * // => ['fred', 'pebbles'] - * - * // using "_.where" callback shorthand - * _.rest(characters, { 'employer': 'slate' }); - * // => [{ 'name': 'pebbles', 'blocked': true, 'employer': 'na' }] - */ - function rest(array, callback, thisArg) { - if (typeof callback != 'number' && callback != null) { - var n = 0, - index = -1, - length = array ? array.length : 0; - - callback = lodash.createCallback(callback, thisArg, 3); - while (++index < length && callback(array[index], index, array)) { - n++; - } - } else { - n = (callback == null || thisArg) ? 1 : nativeMax(0, callback); - } - return slice(array, n); - } - - /** - * Uses a binary search to determine the smallest index at which a value - * should be inserted into a given sorted array in order to maintain the sort - * order of the array. If a callback is provided it will be executed for - * `value` and each element of `array` to compute their sort ranking. The - * callback is bound to `thisArg` and invoked with one argument; (value). - * - * If a property name is provided for `callback` the created "_.pluck" style - * callback will return the property value of the given element. - * - * If an object is provided for `callback` the created "_.where" style callback - * will return `true` for elements that have the properties of the given object, - * else `false`. - * - * @static - * @memberOf _ - * @category Arrays - * @param {Array} array The array to inspect. - * @param {*} value The value to evaluate. - * @param {Function|Object|string} [callback=identity] The function called - * per iteration. If a property name or object is provided it will be used - * to create a "_.pluck" or "_.where" style callback, respectively. - * @param {*} [thisArg] The `this` binding of `callback`. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. - * @example - * - * _.sortedIndex([20, 30, 50], 40); - * // => 2 - * - * // using "_.pluck" callback shorthand - * _.sortedIndex([{ 'x': 20 }, { 'x': 30 }, { 'x': 50 }], { 'x': 40 }, 'x'); - * // => 2 - * - * var dict = { - * 'wordToNumber': { 'twenty': 20, 'thirty': 30, 'fourty': 40, 'fifty': 50 } - * }; - * - * _.sortedIndex(['twenty', 'thirty', 'fifty'], 'fourty', function(word) { - * return dict.wordToNumber[word]; - * }); - * // => 2 - * - * _.sortedIndex(['twenty', 'thirty', 'fifty'], 'fourty', function(word) { - * return this.wordToNumber[word]; - * }, dict); - * // => 2 - */ - function sortedIndex(array, value, callback, thisArg) { - var low = 0, - high = array ? array.length : low; - - // explicitly reference `identity` for better inlining in Firefox - callback = callback ? lodash.createCallback(callback, thisArg, 1) : identity; - value = callback(value); - - while (low < high) { - var mid = (low + high) >>> 1; - (callback(array[mid]) < value) - ? low = mid + 1 - : high = mid; - } - return low; - } - - /** - * Creates an array of unique values, in order, of the provided arrays using - * strict equality for comparisons, i.e. `===`. - * - * @static - * @memberOf _ - * @category Arrays - * @param {...Array} [array] The arrays to inspect. - * @returns {Array} Returns an array of combined values. - * @example - * - * _.union([1, 2, 3], [5, 2, 1, 4], [2, 1]); - * // => [1, 2, 3, 5, 4] - */ - function union() { - return baseUniq(baseFlatten(arguments, true, true)); - } - - /** - * Creates a duplicate-value-free version of an array using strict equality - * for comparisons, i.e. `===`. If the array is sorted, providing - * `true` for `isSorted` will use a faster algorithm. If a callback is provided - * each element of `array` is passed through the callback before uniqueness - * is computed. The callback is bound to `thisArg` and invoked with three - * arguments; (value, index, array). - * - * If a property name is provided for `callback` the created "_.pluck" style - * callback will return the property value of the given element. - * - * If an object is provided for `callback` the created "_.where" style callback - * will return `true` for elements that have the properties of the given object, - * else `false`. - * - * @static - * @memberOf _ - * @alias unique - * @category Arrays - * @param {Array} array The array to process. - * @param {boolean} [isSorted=false] A flag to indicate that `array` is sorted. - * @param {Function|Object|string} [callback=identity] The function called - * per iteration. If a property name or object is provided it will be used - * to create a "_.pluck" or "_.where" style callback, respectively. - * @param {*} [thisArg] The `this` binding of `callback`. - * @returns {Array} Returns a duplicate-value-free array. - * @example - * - * _.uniq([1, 2, 1, 3, 1]); - * // => [1, 2, 3] - * - * _.uniq([1, 1, 2, 2, 3], true); - * // => [1, 2, 3] - * - * _.uniq(['A', 'b', 'C', 'a', 'B', 'c'], function(letter) { return letter.toLowerCase(); }); - * // => ['A', 'b', 'C'] - * - * _.uniq([1, 2.5, 3, 1.5, 2, 3.5], function(num) { return this.floor(num); }, Math); - * // => [1, 2.5, 3] - * - * // using "_.pluck" callback shorthand - * _.uniq([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }, { 'x': 2 }] - */ - function uniq(array, isSorted, callback, thisArg) { - // juggle arguments - if (typeof isSorted != 'boolean' && isSorted != null) { - thisArg = callback; - callback = (typeof isSorted != 'function' && thisArg && thisArg[isSorted] === array) ? null : isSorted; - isSorted = false; - } - if (callback != null) { - callback = lodash.createCallback(callback, thisArg, 3); - } - return baseUniq(array, isSorted, callback); - } - - /** - * Creates an array excluding all provided values using strict equality for - * comparisons, i.e. `===`. - * - * @static - * @memberOf _ - * @category Arrays - * @param {Array} array The array to filter. - * @param {...*} [value] The values to exclude. - * @returns {Array} Returns a new array of filtered values. - * @example - * - * _.without([1, 2, 1, 0, 3, 1, 4], 0, 1); - * // => [2, 3, 4] - */ - function without(array) { - return baseDifference(array, slice(arguments, 1)); - } - - /** - * Creates an array that is the symmetric difference of the provided arrays. - * See http://en.wikipedia.org/wiki/Symmetric_difference. - * - * @static - * @memberOf _ - * @category Arrays - * @param {...Array} [array] The arrays to inspect. - * @returns {Array} Returns an array of values. - * @example - * - * _.xor([1, 2, 3], [5, 2, 1, 4]); - * // => [3, 5, 4] - * - * _.xor([1, 2, 5], [2, 3, 5], [3, 4, 5]); - * // => [1, 4, 5] - */ - function xor() { - var index = -1, - length = arguments.length; - - while (++index < length) { - var array = arguments[index]; - if (isArray(array) || isArguments(array)) { - var result = result - ? baseUniq(baseDifference(result, array).concat(baseDifference(array, result))) - : array; - } - } - return 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 _ - * @alias unzip - * @category Arrays - * @param {...Array} [array] Arrays to process. - * @returns {Array} Returns a new array of grouped elements. - * @example - * - * _.zip(['fred', 'barney'], [30, 40], [true, false]); - * // => [['fred', 30, true], ['barney', 40, false]] - */ - function zip() { - var array = arguments.length > 1 ? arguments : arguments[0], - index = -1, - length = array ? max(pluck(array, 'length')) : 0, - result = Array(length < 0 ? 0 : length); - - while (++index < length) { - result[index] = pluck(array, index); - } - return result; - } - - /** - * Creates an object composed from arrays of `keys` and `values`. Provide - * either a single two dimensional array, i.e. `[[key1, value1], [key2, value2]]` - * or two arrays, one of `keys` and one of corresponding `values`. - * - * @static - * @memberOf _ - * @alias object - * @category Arrays - * @param {Array} keys The array of keys. - * @param {Array} [values=[]] The array of values. - * @returns {Object} Returns an object composed of the given keys and - * corresponding values. - * @example - * - * _.zipObject(['fred', 'barney'], [30, 40]); - * // => { 'fred': 30, 'barney': 40 } - */ - function zipObject(keys, values) { - var index = -1, - length = keys ? keys.length : 0, - result = {}; - - if (!values && length && !isArray(keys[0])) { - values = []; - } - while (++index < length) { - var key = keys[index]; - if (values) { - result[key] = values[index]; - } else if (key) { - result[key[0]] = key[1]; - } - } - return result; - } - - /*--------------------------------------------------------------------------*/ - - /** - * Creates a function that executes `func`, with the `this` binding and - * arguments of the created function, only after being called `n` times. - * - * @static - * @memberOf _ - * @category Functions - * @param {number} n The number of times the function must be called before - * `func` is executed. - * @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 all saves have completed - */ - function after(n, func) { - if (!isFunction(func)) { - throw new TypeError; - } - return function() { - if (--n < 1) { - return func.apply(this, arguments); - } - }; - } - - /** - * Creates a function that, when called, invokes `func` with the `this` - * binding of `thisArg` and prepends any additional `bind` arguments to those - * provided to the bound function. - * - * @static - * @memberOf _ - * @category Functions - * @param {Function} func The function to bind. - * @param {*} [thisArg] The `this` binding of `func`. - * @param {...*} [arg] Arguments to be partially applied. - * @returns {Function} Returns the new bound function. - * @example - * - * var func = function(greeting) { - * return greeting + ' ' + this.name; - * }; - * - * func = _.bind(func, { 'name': 'fred' }, 'hi'); - * func(); - * // => 'hi fred' - */ - function bind(func, thisArg) { - return arguments.length > 2 - ? createWrapper(func, 17, slice(arguments, 2), null, thisArg) - : createWrapper(func, 1, null, null, thisArg); - } - - /** - * 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 the function properties - * of `object` will be bound. - * - * @static - * @memberOf _ - * @category Functions - * @param {Object} object The object to bind and assign the bound methods to. - * @param {...string} [methodName] 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 button is clicked - */ - function bindAll(object) { - var funcs = arguments.length > 1 ? baseFlatten(arguments, true, false, 1) : functions(object), - index = -1, - length = funcs.length; - - while (++index < length) { - var key = funcs[index]; - object[key] = createWrapper(object[key], 1, null, null, object); - } - return object; - } - - /** - * Creates a function that, when called, 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 will be redefined or don't yet exist. - * See http://michaux.ca/articles/lazy-function-definition-pattern. - * - * @static - * @memberOf _ - * @category Functions - * @param {Object} object The object the method belongs to. - * @param {string} key The key of the method. - * @param {...*} [arg] Arguments to be partially applied. - * @returns {Function} Returns the new bound function. - * @example - * - * var object = { - * 'name': 'fred', - * 'greet': function(greeting) { - * return greeting + ' ' + this.name; - * } - * }; - * - * var func = _.bindKey(object, 'greet', 'hi'); - * func(); - * // => 'hi fred' - * - * object.greet = function(greeting) { - * return greeting + 'ya ' + this.name + '!'; - * }; - * - * func(); - * // => 'hiya fred!' - */ - function bindKey(object, key) { - return arguments.length > 2 - ? createWrapper(key, 19, slice(arguments, 2), null, object) - : createWrapper(key, 3, null, null, object); - } - - /** - * Creates a function that is the composition of the provided functions, - * where each function consumes the return value of the function that follows. - * For example, composing the functions `f()`, `g()`, and `h()` produces `f(g(h()))`. - * Each function is executed with the `this` binding of the composed function. - * - * @static - * @memberOf _ - * @category Functions - * @param {...Function} [func] Functions to compose. - * @returns {Function} Returns the new composed function. - * @example - * - * var realNameMap = { - * 'pebbles': 'penelope' - * }; - * - * var format = function(name) { - * name = realNameMap[name.toLowerCase()] || name; - * return name.charAt(0).toUpperCase() + name.slice(1).toLowerCase(); - * }; - * - * var greet = function(formatted) { - * return 'Hiya ' + formatted + '!'; - * }; - * - * var welcome = _.compose(greet, format); - * welcome('pebbles'); - * // => 'Hiya Penelope!' - */ - function compose() { - var funcs = arguments, - length = funcs.length; - - while (length--) { - if (!isFunction(funcs[length])) { - throw new TypeError; - } - } - return function() { - var args = arguments, - length = funcs.length; - - while (length--) { - args = [funcs[length].apply(this, args)]; - } - return args[0]; - }; - } - - /** - * Creates a function which accepts one or more arguments of `func` that when - * invoked either executes `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` can be specified - * if `func.length` is not sufficient. - * - * @static - * @memberOf _ - * @category Functions - * @param {Function} func The function to curry. - * @param {number} [arity=func.length] The arity of `func`. - * @returns {Function} Returns the new curried function. - * @example - * - * var curried = _.curry(function(a, b, c) { - * console.log(a + b + c); - * }); - * - * curried(1)(2)(3); - * // => 6 - * - * curried(1, 2)(3); - * // => 6 - * - * curried(1, 2, 3); - * // => 6 - */ - function curry(func, arity) { - arity = typeof arity == 'number' ? arity : (+arity || func.length); - return createWrapper(func, 4, null, null, null, arity); - } - - /** - * Creates a function that will delay the execution of `func` until after - * `wait` milliseconds have elapsed since the last time it was invoked. - * 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 will return the result of the last `func` call. - * - * Note: If `leading` and `trailing` options are `true` `func` will be called - * on the trailing edge of the timeout only if the the debounced function is - * invoked more than once during the `wait` timeout. - * - * @static - * @memberOf _ - * @category Functions - * @param {Function} func The function to debounce. - * @param {number} wait The number of milliseconds to delay. - * @param {Object} [options] The options object. - * @param {boolean} [options.leading=false] Specify execution on the leading edge of the timeout. - * @param {number} [options.maxWait] The maximum time `func` is allowed to be delayed before it's called. - * @param {boolean} [options.trailing=true] Specify execution 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 - * var lazyLayout = _.debounce(calculateLayout, 150); - * jQuery(window).on('resize', lazyLayout); - * - * // execute `sendMail` when the click event is fired, debouncing subsequent calls - * jQuery('#postbox').on('click', _.debounce(sendMail, 300, { - * 'leading': true, - * 'trailing': false - * }); - * - * // ensure `batchLog` is executed once after 1 second of debounced calls - * var source = new EventSource('/stream'); - * source.addEventListener('message', _.debounce(batchLog, 250, { - * 'maxWait': 1000 - * }, false); - */ - function debounce(func, wait, options) { - var args, - maxTimeoutId, - result, - stamp, - thisArg, - timeoutId, - trailingCall, - lastCalled = 0, - maxWait = false, - trailing = true; - - if (!isFunction(func)) { - throw new TypeError; - } - wait = nativeMax(0, wait) || 0; - if (options === true) { - var leading = true; - trailing = false; - } else if (isObject(options)) { - leading = options.leading; - maxWait = 'maxWait' in options && (nativeMax(wait, options.maxWait) || 0); - trailing = 'trailing' in options ? options.trailing : trailing; - } - var delayed = function() { - var remaining = wait - (now() - stamp); - if (remaining <= 0) { - if (maxTimeoutId) { - clearTimeout(maxTimeoutId); - } - var isCalled = trailingCall; - maxTimeoutId = timeoutId = trailingCall = undefined; - if (isCalled) { - lastCalled = now(); - result = func.apply(thisArg, args); - if (!timeoutId && !maxTimeoutId) { - args = thisArg = null; - } - } - } else { - timeoutId = setTimeout(delayed, remaining); - } - }; - - var maxDelayed = function() { - if (timeoutId) { - clearTimeout(timeoutId); - } - maxTimeoutId = timeoutId = trailingCall = undefined; - if (trailing || (maxWait !== wait)) { - lastCalled = now(); - result = func.apply(thisArg, args); - if (!timeoutId && !maxTimeoutId) { - args = thisArg = null; - } - } - }; - - return function() { - 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; - - 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 = null; - } - return result; - }; - } - - /** - * Defers executing the `func` function until the current call stack has cleared. - * Additional arguments will be provided to `func` when it is invoked. - * - * @static - * @memberOf _ - * @category Functions - * @param {Function} func The function to defer. - * @param {...*} [arg] 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 - */ - function defer(func) { - if (!isFunction(func)) { - throw new TypeError; - } - var args = slice(arguments, 1); - return setTimeout(function() { func.apply(undefined, args); }, 1); - } - - /** - * Executes the `func` function after `wait` milliseconds. Additional arguments - * will be provided to `func` when it is invoked. - * - * @static - * @memberOf _ - * @category Functions - * @param {Function} func The function to delay. - * @param {number} wait The number of milliseconds to delay execution. - * @param {...*} [arg] 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 - */ - function delay(func, wait) { - if (!isFunction(func)) { - throw new TypeError; - } - var args = slice(arguments, 2); - return setTimeout(function() { func.apply(undefined, args); }, wait); - } - - /** - * Creates a function that memoizes the result of `func`. If `resolver` is - * provided it will be used to determine 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 used as the cache key. - * The `func` is executed with the `this` binding of the memoized function. - * The result cache is exposed as the `cache` property on the memoized function. - * - * @static - * @memberOf _ - * @category Functions - * @param {Function} func The function to have its output memoized. - * @param {Function} [resolver] A function used to resolve the cache key. - * @returns {Function} Returns the new memoizing function. - * @example - * - * var fibonacci = _.memoize(function(n) { - * return n < 2 ? n : fibonacci(n - 1) + fibonacci(n - 2); - * }); - * - * fibonacci(9) - * // => 34 - * - * var data = { - * 'fred': { 'name': 'fred', 'age': 40 }, - * 'pebbles': { 'name': 'pebbles', 'age': 1 } - * }; - * - * // modifying the result cache - * var get = _.memoize(function(name) { return data[name]; }, _.identity); - * get('pebbles'); - * // => { 'name': 'pebbles', 'age': 1 } - * - * get.cache.pebbles.name = 'penelope'; - * get('pebbles'); - * // => { 'name': 'penelope', 'age': 1 } - */ - function memoize(func, resolver) { - if (!isFunction(func)) { - throw new TypeError; - } - var memoized = function() { - var cache = memoized.cache, - key = resolver ? resolver.apply(this, arguments) : keyPrefix + arguments[0]; - - return hasOwnProperty.call(cache, key) - ? cache[key] - : (cache[key] = func.apply(this, arguments)); - } - memoized.cache = {}; - return memoized; - } - - /** - * Creates a function that is restricted to execute `func` once. Repeat calls to - * the function will return the value of the first call. The `func` is executed - * with the `this` binding of the created function. - * - * @static - * @memberOf _ - * @category Functions - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new restricted function. - * @example - * - * var initialize = _.once(createApplication); - * initialize(); - * initialize(); - * // `initialize` executes `createApplication` once - */ - function once(func) { - var ran, - result; - - if (!isFunction(func)) { - throw new TypeError; - } - return function() { - if (ran) { - return result; - } - ran = true; - result = func.apply(this, arguments); - - // clear the `func` variable so the function may be garbage collected - func = null; - return result; - }; - } - - /** - * Creates a function that, when called, invokes `func` with any additional - * `partial` arguments prepended to those provided to the new function. This - * method is similar to `_.bind` except it does **not** alter the `this` binding. - * - * @static - * @memberOf _ - * @category Functions - * @param {Function} func The function to partially apply arguments to. - * @param {...*} [arg] Arguments to be partially applied. - * @returns {Function} Returns the new partially applied function. - * @example - * - * var greet = function(greeting, name) { return greeting + ' ' + name; }; - * var hi = _.partial(greet, 'hi'); - * hi('fred'); - * // => 'hi fred' - */ - function partial(func) { - return createWrapper(func, 16, slice(arguments, 1)); - } - - /** - * This method is like `_.partial` except that `partial` arguments are - * appended to those provided to the new function. - * - * @static - * @memberOf _ - * @category Functions - * @param {Function} func The function to partially apply arguments to. - * @param {...*} [arg] Arguments to be partially applied. - * @returns {Function} Returns the new partially applied function. - * @example - * - * var defaultsDeep = _.partialRight(_.merge, _.defaults); - * - * var options = { - * 'variable': 'data', - * 'imports': { 'jq': $ } - * }; - * - * defaultsDeep(options, _.templateSettings); - * - * options.variable - * // => 'data' - * - * options.imports - * // => { '_': _, 'jq': $ } - */ - function partialRight(func) { - return createWrapper(func, 32, null, slice(arguments, 1)); - } - - /** - * Creates a function that, when executed, will only call the `func` function - * at most once per every `wait` milliseconds. 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 will - * return the result of the last `func` call. - * - * Note: If `leading` and `trailing` options are `true` `func` will be called - * on the trailing edge of the timeout only if the the throttled function is - * invoked more than once during the `wait` timeout. - * - * @static - * @memberOf _ - * @category Functions - * @param {Function} func The function to throttle. - * @param {number} wait The number of milliseconds to throttle executions to. - * @param {Object} [options] The options object. - * @param {boolean} [options.leading=true] Specify execution on the leading edge of the timeout. - * @param {boolean} [options.trailing=true] Specify execution on the trailing edge of the timeout. - * @returns {Function} Returns the new throttled function. - * @example - * - * // avoid excessively updating the position while scrolling - * var throttled = _.throttle(updatePosition, 100); - * jQuery(window).on('scroll', throttled); - * - * // execute `renewToken` when the click event is fired, but not more than once every 5 minutes - * jQuery('.interactive').on('click', _.throttle(renewToken, 300000, { - * 'trailing': false - * })); - */ - function throttle(func, wait, options) { - var leading = true, - trailing = true; - - if (!isFunction(func)) { - throw new TypeError; - } - if (options === false) { - leading = false; - } else if (isObject(options)) { - leading = 'leading' in options ? options.leading : leading; - trailing = 'trailing' in options ? options.trailing : trailing; - } - debounceOptions.leading = leading; - debounceOptions.maxWait = wait; - debounceOptions.trailing = trailing; - - return debounce(func, wait, debounceOptions); - } - - /** - * Creates a function that provides `value` to the wrapper function as its - * first argument. Additional arguments provided to the function are appended - * to those provided to the wrapper function. The wrapper is executed with - * the `this` binding of the created function. - * - * @static - * @memberOf _ - * @category Functions - * @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, Wilma, & Pebbles'); - * // => '

    Fred, Wilma, & Pebbles

    ' - */ - function wrap(value, wrapper) { - return createWrapper(wrapper, 16, [value]); - } - - /*--------------------------------------------------------------------------*/ - - /** - * Creates a function that returns `value`. - * - * @static - * @memberOf _ - * @category Utilities - * @param {*} value The value to return from the new function. - * @returns {Function} Returns the new function. - * @example - * - * var object = { 'name': 'fred' }; - * var getter = _.constant(object); - * getter() === object; - * // => true - */ - function constant(value) { - return function() { - return value; - }; - } - - /** - * Produces a callback bound to an optional `thisArg`. If `func` is a property - * name the created callback will return the property value for a given element. - * If `func` is an object the created callback will return `true` for elements - * that contain the equivalent object properties, otherwise it will return `false`. - * - * @static - * @memberOf _ - * @category Utilities - * @param {*} [func=identity] The value to convert to a callback. - * @param {*} [thisArg] The `this` binding of the created callback. - * @param {number} [argCount] The number of arguments the callback accepts. - * @returns {Function} Returns a callback function. - * @example - * - * var characters = [ - * { 'name': 'barney', 'age': 36 }, - * { 'name': 'fred', 'age': 40 } - * ]; - * - * // wrap to create custom callback shorthands - * _.createCallback = _.wrap(_.createCallback, function(func, callback, thisArg) { - * var match = /^(.+?)__([gl]t)(.+)$/.exec(callback); - * return !match ? func(callback, thisArg) : function(object) { - * return match[2] == 'gt' ? object[match[1]] > match[3] : object[match[1]] < match[3]; - * }; - * }); - * - * _.filter(characters, 'age__gt38'); - * // => [{ 'name': 'fred', 'age': 40 }] - */ - function createCallback(func, thisArg, argCount) { - var type = typeof func; - if (func == null || type == 'function') { - return baseCreateCallback(func, thisArg, argCount); - } - // handle "_.pluck" style callback shorthands - if (type != 'object') { - return property(func); - } - var props = keys(func), - key = props[0], - a = func[key]; - - // handle "_.where" style callback shorthands - if (props.length == 1 && a === a && !isObject(a)) { - // fast path the common case of providing an object with a single - // property containing a primitive value - return function(object) { - var b = object[key]; - return a === b && (a !== 0 || (1 / a == 1 / b)); - }; - } - return function(object) { - var length = props.length, - result = false; - - while (length--) { - if (!(result = baseIsEqual(object[props[length]], func[props[length]], null, true))) { - break; - } - } - return result; - }; - } - - /** - * Converts the characters `&`, `<`, `>`, `"`, and `'` in `string` to their - * corresponding HTML entities. - * - * @static - * @memberOf _ - * @category Utilities - * @param {string} string The string to escape. - * @returns {string} Returns the escaped string. - * @example - * - * _.escape('Fred, Wilma, & Pebbles'); - * // => 'Fred, Wilma, & Pebbles' - */ - function escape(string) { - return string == null ? '' : String(string).replace(reUnescapedHtml, escapeHtmlChar); - } - - /** - * This method returns the first argument provided to it. - * - * @static - * @memberOf _ - * @category Utilities - * @param {*} value Any value. - * @returns {*} Returns `value`. - * @example - * - * var object = { 'name': 'fred' }; - * _.identity(object) === object; - * // => true - */ - function identity(value) { - return value; - } - - /** - * Adds function properties of a source object to the destination object. - * If `object` is a function methods will be added to its prototype as well. - * - * @static - * @memberOf _ - * @category Utilities - * @param {Function|Object} [object=lodash] object The destination object. - * @param {Object} source The object of functions to add. - * @param {Object} [options] The options object. - * @param {boolean} [options.chain=true] Specify whether the functions added are chainable. - * @example - * - * function capitalize(string) { - * return string.charAt(0).toUpperCase() + string.slice(1).toLowerCase(); - * } - * - * _.mixin({ 'capitalize': capitalize }); - * _.capitalize('fred'); - * // => 'Fred' - * - * _('fred').capitalize().value(); - * // => 'Fred' - * - * _.mixin({ 'capitalize': capitalize }, { 'chain': false }); - * _('fred').capitalize(); - * // => 'Fred' - */ - function mixin(object, source, options) { - var chain = true, - methodNames = source && functions(source); - - if (!source || (!options && !methodNames.length)) { - if (options == null) { - options = source; - } - ctor = lodashWrapper; - source = object; - object = lodash; - methodNames = functions(source); - } - if (options === false) { - chain = false; - } else if (isObject(options) && 'chain' in options) { - chain = options.chain; - } - var ctor = object, - isFunc = isFunction(ctor); - - forEach(methodNames, function(methodName) { - var func = object[methodName] = source[methodName]; - if (isFunc) { - ctor.prototype[methodName] = function() { - var chainAll = this.__chain__, - value = this.__wrapped__, - args = [value]; - - push.apply(args, arguments); - var result = func.apply(object, args); - if (chain || chainAll) { - if (value === result && isObject(result)) { - return this; - } - result = new ctor(result); - result.__chain__ = chainAll; - } - return result; - }; - } - }); - } - - /** - * Reverts the '_' variable to its previous value and returns a reference to - * the `lodash` function. - * - * @static - * @memberOf _ - * @category Utilities - * @returns {Function} Returns the `lodash` function. - * @example - * - * var lodash = _.noConflict(); - */ - function noConflict() { - context._ = oldDash; - return this; - } - - /** - * A no-operation function. - * - * @static - * @memberOf _ - * @category Utilities - * @example - * - * var object = { 'name': 'fred' }; - * _.noop(object) === undefined; - * // => true - */ - function noop() { - // no operation performed - } - - /** - * Gets the number of milliseconds that have elapsed since the Unix epoch - * (1 January 1970 00:00:00 UTC). - * - * @static - * @memberOf _ - * @category Utilities - * @example - * - * var stamp = _.now(); - * _.defer(function() { console.log(_.now() - stamp); }); - * // => logs the number of milliseconds it took for the deferred function to be called - */ - var now = isNative(now = Date.now) && now || function() { - return new Date().getTime(); - }; - - /** - * Converts the given value into an integer of the specified radix. - * If `radix` is `undefined` or `0` a `radix` of `10` is used unless the - * `value` is a hexadecimal, in which case a `radix` of `16` is used. - * - * Note: This method avoids differences in native ES3 and ES5 `parseInt` - * implementations. See http://es5.github.io/#E. - * - * @static - * @memberOf _ - * @category Utilities - * @param {string} value The value to parse. - * @param {number} [radix] The radix used to interpret the value to parse. - * @returns {number} Returns the new integer value. - * @example - * - * _.parseInt('08'); - * // => 8 - */ - var parseInt = nativeParseInt(whitespace + '08') == 8 ? nativeParseInt : function(value, radix) { - // Firefox < 21 and Opera < 15 follow the ES3 specified implementation of `parseInt` - return nativeParseInt(isString(value) ? value.replace(reLeadingSpacesAndZeros, '') : value, radix || 0); - }; - - /** - * Creates a "_.pluck" style function, which returns the `key` value of a - * given object. - * - * @static - * @memberOf _ - * @category Utilities - * @param {string} key The name of the property to retrieve. - * @returns {Function} Returns the new function. - * @example - * - * var characters = [ - * { 'name': 'fred', 'age': 40 }, - * { 'name': 'barney', 'age': 36 } - * ]; - * - * var getName = _.property('name'); - * - * _.map(characters, getName); - * // => ['barney', 'fred'] - * - * _.sortBy(characters, getName); - * // => [{ 'name': 'barney', 'age': 36 }, { 'name': 'fred', 'age': 40 }] - */ - function property(key) { - return function(object) { - return object[key]; - }; - } - - /** - * Produces a random number between `min` and `max` (inclusive). If only one - * argument is provided a number between `0` and the given number will be - * returned. If `floating` is truey or either `min` or `max` are floats a - * floating-point number will be returned instead of an integer. - * - * @static - * @memberOf _ - * @category Utilities - * @param {number} [min=0] The minimum possible value. - * @param {number} [max=1] The maximum possible value. - * @param {boolean} [floating=false] Specify returning a floating-point number. - * @returns {number} Returns a 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) { - var noMin = min == null, - noMax = max == null; - - if (floating == null) { - if (typeof min == 'boolean' && noMax) { - floating = min; - min = 1; - } - else if (!noMax && typeof max == 'boolean') { - floating = max; - noMax = true; - } - } - if (noMin && noMax) { - max = 1; - } - 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); - } - - /** - * Resolves the value of property `key` on `object`. If `key` is a function - * it will be invoked with the `this` binding of `object` and its result returned, - * else the property value is returned. If `object` is falsey then `undefined` - * is returned. - * - * @static - * @memberOf _ - * @category Utilities - * @param {Object} object The object to inspect. - * @param {string} key The name of the property to resolve. - * @returns {*} Returns the resolved value. - * @example - * - * var object = { - * 'cheese': 'crumpets', - * 'stuff': function() { - * return 'nonsense'; - * } - * }; - * - * _.result(object, 'cheese'); - * // => 'crumpets' - * - * _.result(object, 'stuff'); - * // => 'nonsense' - */ - function result(object, key) { - if (object) { - var value = object[key]; - return isFunction(value) ? object[key]() : value; - } - } - - /** - * A micro-templating method that handles arbitrary delimiters, preserves - * whitespace, and correctly escapes quotes within interpolated code. - * - * Note: In the development build, `_.template` utilizes sourceURLs for easier - * debugging. See http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl - * - * For more information on precompiling templates see: - * http://lodash.com/custom-builds - * - * For more information on Chrome extension sandboxes see: - * http://developer.chrome.com/stable/extensions/sandboxingEval.html - * - * @static - * @memberOf _ - * @category Utilities - * @param {string} text The template text. - * @param {Object} data The data object used to populate the text. - * @param {Object} [options] The options object. - * @param {RegExp} [options.escape] The "escape" delimiter. - * @param {RegExp} [options.evaluate] The "evaluate" delimiter. - * @param {Object} [options.imports] An object to import into the template as local variables. - * @param {RegExp} [options.interpolate] The "interpolate" delimiter. - * @param {string} [sourceURL] The sourceURL of the template's compiled source. - * @param {string} [variable] The data object variable name. - * @returns {Function|string} Returns a compiled function when no `data` object - * is given, else it returns the interpolated text. - * @example - * - * // using the "interpolate" delimiter to create a compiled template - * var compiled = _.template('hello <%= name %>'); - * compiled({ 'name': 'fred' }); - * // => 'hello fred' - * - * // using the "escape" delimiter to escape HTML in data property values - * _.template('<%- value %>', { 'value': '\n```\n\nUsing [`npm`](http://npmjs.org/):\n\n```bash\nnpm i --save lodash\n\n{sudo} npm i -g lodash\nnpm ln lodash\n```\n\nIn [Node.js](http://nodejs.org/) & [Ringo](http://ringojs.org/):\n\n```js\nvar _ = require('lodash');\n// or as Underscore\nvar _ = require('lodash/dist/lodash.underscore');\n```\n\n**Notes:**\n * Don’t assign values to [special variable](http://nodejs.org/api/repl.html#repl_repl_features) `_` when in the REPL\n * If Lo-Dash is installed globally, run [`npm ln lodash`](http://blog.nodejs.org/2011/03/23/npm-1-0-global-vs-local-installation/) in your project’s root directory *before* requiring it\n\nIn [Rhino](http://www.mozilla.org/rhino/):\n\n```js\nload('lodash.js');\n```\n\nIn an AMD loader:\n\n```js\nrequire({\n 'packages': [\n { 'name': 'lodash', 'location': 'path/to/lodash', 'main': 'lodash' }\n ]\n},\n['lodash'], function(_) {\n console.log(_.VERSION);\n});\n```\n\n## Author\n\n| [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton \"Follow @jdalton on Twitter\") |\n|---|\n| [John-David Dalton](http://allyoucanleet.com/) |\n\n## Contributors\n\n| [![twitter/blainebublitz](http://gravatar.com/avatar/ac1c67fd906c9fecd823ce302283b4c1?s=70)](https://twitter.com/blainebublitz \"Follow @BlaineBublitz on Twitter\") | [![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge \"Follow @kitcambridge on Twitter\") | [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias \"Follow @mathias on Twitter\") |\n|---|---|---|\n| [Blaine Bublitz](http://www.iceddev.com/) | [Kit Cambridge](http://kitcambridge.be/) | [Mathias Bynens](http://mathiasbynens.be/) |\n\n[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/lodash/lodash/trend.png)](https://bitdeli.com/free \"Bitdeli Badge\")\n", - "readmeFilename": "README.md", - "_id": "lodash@2.4.1", - "_from": "lodash@~2.4.1" -} diff --git a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/.npmignore b/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/.npmignore deleted file mode 100644 index 1eba800f80f..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/.npmignore +++ /dev/null @@ -1,11 +0,0 @@ -npm-debug.log -node_modules -.*.swp -.lock-* -build - -bench -doc -examples -test - diff --git a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/.travis.yml b/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/.travis.yml deleted file mode 100644 index 973586683f5..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js -npm_args: --ws:native -node_js: - - "0.8" - - "0.10" diff --git a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/History.md b/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/History.md deleted file mode 100644 index 63cf0ea6a95..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/History.md +++ /dev/null @@ -1,312 +0,0 @@ -v0.4.31 - September 23th, 2013 -===================== - -* Component support - -v0.4.30 - August 30th, 2013 -===================== - -* BufferedAmount could be undefined, default to 0 [TooTallNate] -* Support protocols as second argument and options as third [TooTallNate] -* Proper browserify shim [mcollina] -* Broadcasting example in README [stefanocudini] - -v0.4.29 - August 23th, 2013 -===================== -* Small clean up of the Node 0.11 support by using NAN from the NPM registry [kkoopa] -* Support for custom `Agent`'s through the options. [gramakri] & [TooTallNate] -* Support for custom headers through the options [3rd-Eden] -* Added a `gypfile` flag to the package.json for compiled module discovery [wolfeidau] - -v0.4.28 - August 16th, 2013 -===================== -* Node 0.11 support. [kkoopa] -* Authorization headers are sent when basic auth is used in the url [jcrugzz] -* Origin header will now include the port number [Jason Plum] -* Race condition fixed where data was received before the readyState was updated. [saschagehlich] - -v0.4.27 - June 27th, 2013 -===================== -* Frames are no longer masked in `wscat`. [slaskis] -* Don't retrain reference to large slab buffers. [jmatthewsr-msi] -* Don't use Buffer.byteLength for ArrayBuffer's. [Anthony Pesch] -* Fix browser field in package.json. [shtylman] -* Client-side certificate support & documentation improvements. [Lukas Berns] -* WebSocket readyState's is added to the prototype for spec compatiblity. [BallBearing] -* Use Object.defineProperty. [arlolra] -* Autodetect ArrayBuffers as binary when sending. [BallBearing] -* Check instanceof Buffer for binary data. [arlolra] -* Emit the close event before destroying the internal socket. [3rd-Eden] -* Don't setup multiply timeouts for one connection. [AndreasMadsen] -* Allow support for binding to ethereal port. [wpreul] -* Fix broken terminate reference. [3rd-Eden] -* Misc node 0.10 test fixes and documentation improvements. [3rd-Eden] -* Ensure ssl options are propagated to request. [einaros] -* Add 'Host' and 'Origin' to request header. [Lars-Magnus Skog] -* Subprotocol support. [kanaka] -* Honor ArrayBufferView's byteOffset when sending. [Anthony Pesch] -* Added target attribute for events. [arlolra] - -v0.4.26 - Skipped -===================== - -v0.4.25 - December 17th, 2012 -===================== -* Removed install.js. [shtylman] -* Added browser field to package.json. [shtylman] -* Support overwriting host header. [Raynos] -* Emit 'listening' also with custom http server. [sebiq] - -v0.4.24 - December 6th, 2012 -===================== -* Yet another intermediate release, to not delay minor features any longer. -* Native support installation issues further circumvented. [einaros] - -v0.4.23 - November 19th, 2012 -===================== -* Service release - last before major upgrade. -* Changes default host from 127.0.0.1 to 0.0.0.0. [einaros] - -v0.4.22 - October 3rd, 2012 -===================== -* clear failsafe cleanup timeout once cleanup is called [AndreasMadsen] -* added w3c compatible CloseEvent for onclose / addEventListener("close", ...). [einaros] -* fix the sub protocol header handler [sonnyp] -* fix unhandled exception if socket closes and 'error' is emitted [jmatthewsr-ms] - -v0.4.21 - July 14th, 2012 -===================== -* Emit error if server reponds with anything other than status code 101. [einaros] -* Added 'headers' event to server. [rauchg] -* path.exists moved to fs.exists. [blakmatrix] - -v0.4.20 - June 26th, 2012 -===================== -* node v0.8.0 compatibility release. - -v0.4.19 - June 19th, 2012 -===================== -* Change sender to merge buffers for relatively small payloads, may improve perf in some cases [einaros] -* Avoid EventEmitter for Receiver classes. As above this may improve perf. [einaros] -* Renamed fallback files from the somewhat misleading '*Windows'. [einaros] - -v0.4.18 - June 14th 2012 -===================== -* Fixed incorrect md5 digest encoding in Hixie handshake [nicokaiser] -* Added example of use with Express 3 [einaros] -* Change installation procedure to not require --ws:native to build native extensions. They will now build if a compiler is available. [einaros] - -v0.4.17 - June 13th 2012 -===================== -* Improve error handling during connection handshaking [einaros] -* Ensure that errors are caught also after connection teardown [nicokaiser] -* Update 'mocha' version to 1.1.0. [einaros] -* Stop showing 'undefined' for some error logs. [tricknotes] -* Update 'should' version to 0.6.3 [tricknotes] - -v0.4.16 - June 1st 2012 -===================== -* Build fix for Windows. [einaros] - -v0.4.15 - May 20th 2012 -===================== -* Enable fauxe streaming for hixie tansport. [einaros] -* Allow hixie sender to deal with buffers. [einaros/pigne] -* Allow error code 1011. [einaros] -* Fix framing for empty packets (empty pings and pongs might break). [einaros] -* Improve error and close handling, to avoid connections lingering in CLOSING state. [einaros] - -v0.4.14 - Apr 30th 2012 -===================== -* use node-gyp instead of node-waf [TooTallNate] -* remove old windows compatibility makefile, and silently fall back to native modules [einaros] -* ensure connection status [nicokaiser] -* websocket client updated to use port 443 by default for wss:// connections [einaros] -* support unix sockets [kschzt] - -v0.4.13 - Apr 12th 2012 -===================== - -* circumvent node 0.6+ related memory leak caused by Object.defineProperty [nicokaiser] -* improved error handling, improving stability in massive load use cases [nicokaiser] - -v0.4.12 - Mar 30th 2012 -===================== - -* various memory leak / possible memory leak cleanups [einaros] -* api documentation [nicokaiser] -* add option to disable client tracking [nicokaiser] - -v0.4.11 - Mar 24th 2012 -===================== - -* node v0.7 compatibillity release -* gyp support [TooTallNate] -* commander dependency update [jwueller] -* loadbalancer support [nicokaiser] - -v0.4.10 - Mar 22th 2012 -===================== - -* Final hixie close frame fixes. [nicokaiser] - -v0.4.9 - Mar 21st 2012 -===================== - -* Various hixie bugfixes (such as proper close frame handling). [einaros] - -v0.4.8 - Feb 29th 2012 -===================== - -* Allow verifyClient to run asynchronously [karlsequin] -* Various bugfixes and cleanups. [einaros] - -v0.4.7 - Feb 21st 2012 -===================== - -* Exposed bytesReceived from websocket client object, which makes it possible to implement bandwidth sampling. [einaros] -* Updated browser based file upload example to include and output per websocket channel bandwidth sampling. [einaros] -* Changed build scripts to check which architecture is currently in use. Required after the node.js changes to have prebuilt packages target ia32 by default. [einaros] - -v0.4.6 - Feb 9th 2012 -===================== - -* Added browser based file upload example. [einaros] -* Added server-to-browser status push example. [einaros] -* Exposed pause() and resume() on WebSocket object, to enable client stream shaping. [einaros] - -v0.4.5 - Feb 7th 2012 -===================== - -* Corrected regression bug in handling of connections with the initial frame delivered across both http upgrade head and a standalone packet. This would lead to a race condition, which in some cases could cause message corruption. [einaros] - -v0.4.4 - Feb 6th 2012 -===================== - -* Pass original request object to verifyClient, for cookie or authentication verifications. [einaros] -* Implemented addEventListener and slightly improved the emulation API by adding a MessageEvent with a readonly data attribute. [aslakhellesoy] -* Rewrite parts of hybi receiver to avoid stack overflows for large amounts of packets bundled in the same buffer / packet. [einaros] - -v0.4.3 - Feb 4th 2012 -===================== - -* Prioritized update: Corrected issue which would cause sockets to stay open longer than necessary, and resource leakage because of this. [einaros] - -v0.4.2 - Feb 4th 2012 -===================== - -* Breaking change: WebSocketServer's verifyOrigin option has been renamed to verifyClient. [einaros] -* verifyClient now receives { origin: 'origin header', secure: true/false }, where 'secure' will be true for ssl connections. [einaros] -* Split benchmark, in preparation for more thorough case. [einaros] -* Introduced hixie-76 draft support for server, since Safari (iPhone / iPad / OS X) and Opera still aren't updated to use Hybi. [einaros] -* Expose 'supports' object from WebSocket, to indicate e.g. the underlying transport's support for binary data. [einaros] -* Test and code cleanups. [einaros] - -v0.4.1 - Jan 25th 2012 -===================== - -* Use readline in wscat [tricknotes] -* Refactor _state away, in favor of the new _readyState [tricknotes] -* travis-ci integration [einaros] -* Fixed race condition in testsuite, causing a few tests to fail (without actually indicating errors) on travis [einaros] -* Expose pong event [paddybyers] -* Enabled running of WebSocketServer in noServer-mode, meaning that upgrades are passed in manually. [einaros] -* Reworked connection procedure for WebSocketServer, and cleaned up tests. [einaros] - -v0.4.0 - Jan 2nd 2012 -===================== - -* Windows compatibility [einaros] -* Windows compatible test script [einaros] - -v0.3.9 - Jan 1st 2012 -====================== - -* Improved protocol framing performance [einaros] -* WSS support [kazuyukitanimura] -* WSS tests [einaros] -* readyState exposed [justinlatimer, tricknotes] -* url property exposed [justinlatimer] -* Removed old 'state' property [einaros] -* Test cleanups [einaros] - -v0.3.8 - Dec 27th 2011 -====================== - -* Made it possible to listen on specific paths, which is especially good to have for precreated http servers [einaros] -* Extensive WebSocket / WebSocketServer cleanup, including changing all internal properties to unconfigurable, unenumerable properties [einaros] -* Receiver modifications to ensure even better performance with fragmented sends [einaros] -* Fixed issue in sender.js, which would cause SlowBuffer instances (such as returned from the crypto library's randomBytes) to be copied (and thus be dead slow) [einaros] -* Removed redundant buffer copy in sender.js, which should improve server performance [einaros] - -v0.3.7 - Dec 25nd 2011 -====================== - -* Added a browser based API which uses EventEmitters internally [3rd-Eden] -* Expose request information from upgrade event for websocket server clients [mmalecki] - -v0.3.6 - Dec 19th 2011 -====================== - -* Added option to let WebSocket.Server use an already existing http server [mmalecki] -* Migrating various option structures to use options.js module [einaros] -* Added a few more tests, options and handshake verifications to ensure that faulty connections are dealt with [einaros] -* Code cleanups in Sender and Receiver, to ensure even faster parsing [einaros] - -v0.3.5 - Dec 13th 2011 -====================== - -* Optimized Sender.js, Receiver.js and bufferutil.cc: - * Apply loop-unrolling-like small block copies rather than use node.js Buffer#copy() (which is slow). - * Mask blocks of data using combination of 32bit xor and loop-unrolling, instead of single bytes. - * Keep pre-made send buffer for small transfers. -* Leak fixes and code cleanups. - -v0.3.3 - Dec 12th 2011 -====================== - -* Compile fix for Linux. -* Rewrote parts of WebSocket.js, to avoid try/catch and thus avoid optimizer bailouts. - -v0.3.2 - Dec 11th 2011 -====================== - -* Further performance updates, including the additions of a native BufferUtil module, which deals with several of the cpu intensive WebSocket operations. - -v0.3.1 - Dec 8th 2011 -====================== - -* Service release, fixing broken tests. - -v0.3.0 - Dec 8th 2011 -====================== - -* Node.js v0.4.x compatibility. -* Code cleanups and efficiency improvements. -* WebSocket server added, although this will still mainly be a client library. -* WebSocket server certified to pass the Autobahn test suite. -* Protocol improvements and corrections - such as handling (redundant) masks for empty fragments. -* 'wscat' command line utility added, which can act as either client or server. - -v0.2.6 - Dec 3rd 2011 -====================== - -* Renamed to 'ws'. Big woop, right -- but easy-websocket really just doesn't cut it anymore! - -v0.2.5 - Dec 3rd 2011 -====================== - - * Rewrote much of the WebSocket parser, to ensure high speed for highly fragmented messages. - * Added a BufferPool, as a start to more efficiently deal with allocations for WebSocket connections. More work to come, in that area. - * Updated the Autobahn report, at http://einaros.github.com/easy-websocket, with comparisons against WebSocket-Node 1.0.2 and Chrome 16. - -v0.2.0 - Nov 25th 2011 -====================== - - * Major rework to make sure all the Autobahn test cases pass. Also updated the internal tests to cover more corner cases. - -v0.1.2 - Nov 14th 2011 -====================== - - * Back and forth, back and forth: now settled on keeping the api (event names, methods) closer to the websocket browser api. This will stick now. - * Started keeping this history record. Better late than never, right? diff --git a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/Makefile b/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/Makefile deleted file mode 100644 index 151aa2ba535..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/Makefile +++ /dev/null @@ -1,40 +0,0 @@ -ALL_TESTS = $(shell find test/ -name '*.test.js') -ALL_INTEGRATION = $(shell find test/ -name '*.integration.js') - -all: - node-gyp configure build - -clean: - node-gyp clean - -run-tests: - @./node_modules/.bin/mocha \ - -t 2000 \ - -s 2400 \ - $(TESTFLAGS) \ - $(TESTS) - -run-integrationtests: - @./node_modules/.bin/mocha \ - -t 5000 \ - -s 6000 \ - $(TESTFLAGS) \ - $(TESTS) - -test: - @$(MAKE) NODE_TLS_REJECT_UNAUTHORIZED=0 NODE_PATH=lib TESTS="$(ALL_TESTS)" run-tests - -integrationtest: - @$(MAKE) NODE_TLS_REJECT_UNAUTHORIZED=0 NODE_PATH=lib TESTS="$(ALL_INTEGRATION)" run-integrationtests - -benchmark: - @node bench/sender.benchmark.js - @node bench/parser.benchmark.js - -autobahn: - @NODE_PATH=lib node test/autobahn.js - -autobahn-server: - @NODE_PATH=lib node test/autobahn-server.js - -.PHONY: test diff --git a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/README.md b/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/README.md deleted file mode 100644 index cf1f1fb885a..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/README.md +++ /dev/null @@ -1,171 +0,0 @@ -[![Build Status](https://secure.travis-ci.org/einaros/ws.png)](http://travis-ci.org/einaros/ws) - -# ws: a node.js websocket library # - -`ws` is a simple to use websocket implementation, up-to-date against RFC-6455, and [probably the fastest WebSocket library for node.js](http://web.archive.org/web/20130314230536/http://hobbycoding.posterous.com/the-fastest-websocket-module-for-nodejs). - -Passes the quite extensive Autobahn test suite. See http://einaros.github.com/ws for the full reports. - -Comes with a command line utility, `wscat`, which can either act as a server (--listen), or client (--connect); Use it to debug simple websocket services. - -## Protocol support ## - -* **Hixie draft 76** (Old and deprecated, but still in use by Safari and Opera. Added to ws version 0.4.2, but server only. Can be disabled by setting the `disableHixie` option to true.) -* **HyBi drafts 07-12** (Use the option `protocolVersion: 8`, or argument `-p 8` for wscat) -* **HyBi drafts 13-17** (Current default, alternatively option `protocolVersion: 13`, or argument `-p 13` for wscat) - -_See the echo.websocket.org example below for how to use the `protocolVersion` option._ - -## Usage ## - -### Installing ### - -`npm install ws` - -### Sending and receiving text data ### - -```js -var WebSocket = require('ws'); -var ws = new WebSocket('ws://www.host.com/path'); -ws.on('open', function() { - ws.send('something'); -}); -ws.on('message', function(data, flags) { - // flags.binary will be set if a binary data is received - // flags.masked will be set if the data was masked -}); -``` - -### Sending binary data ### - -```js -var WebSocket = require('ws'); -var ws = new WebSocket('ws://www.host.com/path'); -ws.on('open', function() { - var array = new Float32Array(5); - for (var i = 0; i < array.length; ++i) array[i] = i / 2; - ws.send(array, {binary: true, mask: true}); -}); -``` - -Setting `mask`, as done for the send options above, will cause the data to be masked according to the websocket protocol. The same option applies for text data. - -### Server example ### - -```js -var WebSocketServer = require('ws').Server - , wss = new WebSocketServer({port: 8080}); -wss.on('connection', function(ws) { - ws.on('message', function(message) { - console.log('received: %s', message); - }); - ws.send('something'); -}); -``` - -### Server sending broadcast data ### - -```js -var WebSocketServer = require('ws').Server - , wss = new WebSocketServer({port: 8080}); - -wss.broadcast = function(data) { - for(var i in this.clients) - this.clients[i].send(data); -}; -``` - -### Error handling best practices ### - -```js -// If the WebSocket is closed before the following send is attempted -ws.send('something'); - -// Errors (both immediate and async write errors) can be detected in an optional callback. -// The callback is also the only way of being notified that data has actually been sent. -ws.send('something', function(error) { - // if error is null, the send has been completed, - // otherwise the error object will indicate what failed. -}); - -// Immediate errors can also be handled with try/catch-blocks, but **note** -// that since sends are inherently asynchronous, socket write failures will *not* -// be captured when this technique is used. -try { - ws.send('something'); -} -catch (e) { - // handle error -} -``` - -### echo.websocket.org demo ### - -```js -var WebSocket = require('ws'); -var ws = new WebSocket('ws://echo.websocket.org/', {protocolVersion: 8, origin: 'http://websocket.org'}); -ws.on('open', function() { - console.log('connected'); - ws.send(Date.now().toString(), {mask: true}); -}); -ws.on('close', function() { - console.log('disconnected'); -}); -ws.on('message', function(data, flags) { - console.log('Roundtrip time: ' + (Date.now() - parseInt(data)) + 'ms', flags); - setTimeout(function() { - ws.send(Date.now().toString(), {mask: true}); - }, 500); -}); -``` - -### wscat against echo.websocket.org ### - - $ npm install -g ws - $ wscat -c ws://echo.websocket.org - connected (press CTRL+C to quit) - > hi there - < hi there - > are you a happy parrot? - < are you a happy parrot? - -### Other examples ### - -For a full example with a browser client communicating with a ws server, see the examples folder. - -Note that the usage together with Express 3.0 is quite different from Express 2.x. The difference is expressed in the two different serverstats-examples. - -Otherwise, see the test cases. - -### Running the tests ### - -`make test` - -## API Docs ## - -See the doc/ directory for Node.js-like docs for the ws classes. - -## License ## - -(The MIT License) - -Copyright (c) 2011 Einar Otto Stangvik <einaros@gmail.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/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/bin/wscat b/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/bin/wscat deleted file mode 100644 index 7c66600de29..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/bin/wscat +++ /dev/null @@ -1,222 +0,0 @@ -#!/usr/bin/env node - -/*! - * ws: a node.js websocket client - * Copyright(c) 2011 Einar Otto Stangvik - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var WebSocket = require('../') - , fs = require('fs') - , program = require('commander') - , util = require('util') - , events = require('events') - , readline = require('readline'); - -/** - * InputReader - processes console input - */ - -function Console() { - this.stdin = process.stdin; - this.stdout = process.stdout; - - this.readlineInterface = readline.createInterface(this.stdin, this.stdout); - - var self = this; - this.readlineInterface.on('line', function(data) { - self.emit('line', data); - }); - this.readlineInterface.on('close', function() { - self.emit('close'); - }); - - this._resetInput = function() { - self.clear(); - } -} -util.inherits(Console, events.EventEmitter); - -Console.Colors = { - Red: '\033[31m', - Green: '\033[32m', - Yellow: '\033[33m', - Blue: '\033[34m', - Default: '\033[39m' -}; - -Console.prototype.prompt = function() { - this.readlineInterface.prompt(); -} - -Console.prototype.print = function(msg, color) { - this.clear(); - color = color || Console.Colors.Default; - this.stdout.write(color + msg + Console.Colors.Default + '\n'); - this.prompt(); -} - -Console.prototype.clear = function() { - this.stdout.write('\033[2K\033[E'); -} - -Console.prototype.pause = function() { - this.stdin.on('keypress', this._resetInput); -} - -Console.prototype.resume = function() { - this.stdin.removeListener('keypress', this._resetInput); -} - -function appender(xs) { - xs = xs || []; - return function (x) { - xs.push(x); - return xs; - } -} - -function into(obj, kvals) { - kvals.forEach(function (kv) { - obj[kv[0]] = kv[1]; - }); - return obj; -} - -function splitOnce(sep, str) { // sep can be either String or RegExp - var tokens = str.split(sep); - return [tokens[0], str.replace(sep, '').substr(tokens[0].length)]; -} - -/** - * The actual application - */ - -var version = JSON.parse(fs.readFileSync(__dirname + '/../package.json', 'utf8')).version; -program - .version(version) - .usage('[options] ') - .option('-l, --listen ', 'listen on port') - .option('-c, --connect ', 'connect to a websocket server') - .option('-p, --protocol ', 'optional protocol version') - .option('-o, --origin ', 'optional origin') - .option('--host ', 'optional host') - .option('-s, --subprotocol ', 'optional subprotocol') - .option('-n, --no-check', 'Do not check for unauthorized certificates') - .option('-H, --header ', 'Set an HTTP header. Repeat to set multiple. (--connect only)', appender(), []) - .option('--auth ', 'Add basic HTTP authentication header. (--connect only)') - .parse(process.argv); - -if (program.listen && program.connect) { - console.error('\033[33merror: use either --listen or --connect\033[39m'); - process.exit(-1); -} -else if (program.listen) { - var wsConsole = new Console(); - wsConsole.pause(); - var options = {}; - if (program.protocol) options.protocolVersion = program.protocol; - if (program.origin) options.origin = program.origin; - if (program.subprotocol) options.protocol = program.subprotocol; - if (!program.check) options.rejectUnauthorized = program.check; - var ws = null; - var wss = new WebSocket.Server({port: program.listen}, function() { - wsConsole.print('listening on port ' + program.listen + ' (press CTRL+C to quit)', Console.Colors.Green); - wsConsole.clear(); - }); - wsConsole.on('close', function() { - if (ws) { - try { - ws.close(); - } - catch (e) {} - } - process.exit(0); - }); - wsConsole.on('line', function(data) { - if (ws) { - ws.send(data, {mask: false}); - wsConsole.prompt(); - } - }); - wss.on('connection', function(newClient) { - if (ws) { - // limit to one client - newClient.terminate(); - return; - }; - ws = newClient; - wsConsole.resume(); - wsConsole.prompt(); - wsConsole.print('client connected', Console.Colors.Green); - ws.on('close', function() { - wsConsole.print('disconnected', Console.Colors.Green); - wsConsole.clear(); - wsConsole.pause(); - ws = null; - }); - ws.on('error', function(code, description) { - wsConsole.print('error: ' + code + (description ? ' ' + description : ''), Console.Colors.Yellow); - }); - ws.on('message', function(data, flags) { - wsConsole.print('< ' + data, Console.Colors.Blue); - }); - }); - wss.on('error', function(error) { - wsConsole.print('error: ' + error.toString(), Console.Colors.Yellow); - process.exit(-1); - }); -} -else if (program.connect) { - var wsConsole = new Console(); - var options = {}; - if (program.protocol) options.protocolVersion = program.protocol; - if (program.origin) options.origin = program.origin; - if (program.subprotocol) options.protocol = program.subprotocol; - if (program.host) options.host = program.host; - if (!program.check) options.rejectUnauthorized = program.check; - var headers = into({}, (program.header || []).map(function (s) { - return splitOnce(':', s) - })); - if (program.auth) { - headers['Authorization'] = 'Basic ' + new Buffer(program.auth).toString('base64'); - } - options.headers = headers; - var ws = new WebSocket(program.connect, options); - ws.on('open', function() { - wsConsole.print('connected (press CTRL+C to quit)', Console.Colors.Green); - wsConsole.on('line', function(data) { - ws.send(data, {mask: true}); - wsConsole.prompt(); - }); - }); - ws.on('close', function() { - wsConsole.print('disconnected', Console.Colors.Green); - wsConsole.clear(); - process.exit(); - }); - ws.on('error', function(code, description) { - wsConsole.print('error: ' + code + (description ? ' ' + description : ''), Console.Colors.Yellow); - process.exit(-1); - }); - ws.on('message', function(data, flags) { - wsConsole.print('< ' + data, Console.Colors.Blue); - }); - wsConsole.on('close', function() { - if (ws) { - try { - ws.close(); - } - catch(e) {} - process.exit(); - } - }); -} -else { - console.error('\033[33merror: use either --listen or --connect\033[39m'); - process.exit(-1); -} diff --git a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/binding.gyp b/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/binding.gyp deleted file mode 100644 index 600f9d10f14..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/binding.gyp +++ /dev/null @@ -1,16 +0,0 @@ -{ - 'targets': [ - { - 'target_name': 'validation', - 'include_dirs': [" - * MIT Licensed - */ - -module.exports = require('./lib/WebSocket'); -module.exports.Server = require('./lib/WebSocketServer'); -module.exports.Sender = require('./lib/Sender'); -module.exports.Receiver = require('./lib/Receiver'); - -module.exports.createServer = function (options, connectionListener) { - var server = new module.exports.Server(options); - if (typeof connectionListener === 'function') { - server.on('connection', connectionListener); - } - return server; -}; - -module.exports.connect = module.exports.createConnection = function (address, openListener) { - var client = new module.exports(address); - if (typeof openListener === 'function') { - client.on('open', openListener); - } - return client; -}; diff --git a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/lib/BufferPool.js b/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/lib/BufferPool.js deleted file mode 100644 index faf8637c04e..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/lib/BufferPool.js +++ /dev/null @@ -1,59 +0,0 @@ -/*! - * ws: a node.js websocket client - * Copyright(c) 2011 Einar Otto Stangvik - * MIT Licensed - */ - -var util = require('util'); - -function BufferPool(initialSize, growStrategy, shrinkStrategy) { - if (typeof initialSize === 'function') { - shrinkStrategy = growStrategy; - growStrategy = initialSize; - initialSize = 0; - } - else if (typeof initialSize === 'undefined') { - initialSize = 0; - } - this._growStrategy = (growStrategy || function(db, size) { - return db.used + size; - }).bind(null, this); - this._shrinkStrategy = (shrinkStrategy || function(db) { - return initialSize; - }).bind(null, this); - this._buffer = initialSize ? new Buffer(initialSize) : null; - this._offset = 0; - this._used = 0; - this._changeFactor = 0; - this.__defineGetter__('size', function(){ - return this._buffer == null ? 0 : this._buffer.length; - }); - this.__defineGetter__('used', function(){ - return this._used; - }); -} - -BufferPool.prototype.get = function(length) { - if (this._buffer == null || this._offset + length > this._buffer.length) { - var newBuf = new Buffer(this._growStrategy(length)); - this._buffer = newBuf; - this._offset = 0; - } - this._used += length; - var buf = this._buffer.slice(this._offset, this._offset + length); - this._offset += length; - return buf; -} - -BufferPool.prototype.reset = function(forceNewBuffer) { - var len = this._shrinkStrategy(); - if (len < this.size) this._changeFactor -= 1; - if (forceNewBuffer || this._changeFactor < -2) { - this._changeFactor = 0; - this._buffer = len ? new Buffer(len) : null; - } - this._offset = 0; - this._used = 0; -} - -module.exports = BufferPool; diff --git a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/lib/BufferUtil.fallback.js b/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/lib/BufferUtil.fallback.js deleted file mode 100644 index 508542c9e50..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/lib/BufferUtil.fallback.js +++ /dev/null @@ -1,47 +0,0 @@ -/*! - * ws: a node.js websocket client - * Copyright(c) 2011 Einar Otto Stangvik - * MIT Licensed - */ - -module.exports.BufferUtil = { - merge: function(mergedBuffer, buffers) { - var offset = 0; - for (var i = 0, l = buffers.length; i < l; ++i) { - var buf = buffers[i]; - buf.copy(mergedBuffer, offset); - offset += buf.length; - } - }, - mask: function(source, mask, output, offset, length) { - var maskNum = mask.readUInt32LE(0, true); - var i = 0; - for (; i < length - 3; i += 4) { - var num = maskNum ^ source.readUInt32LE(i, true); - if (num < 0) num = 4294967296 + num; - output.writeUInt32LE(num, offset + i, true); - } - switch (length % 4) { - case 3: output[offset + i + 2] = source[i + 2] ^ mask[2]; - case 2: output[offset + i + 1] = source[i + 1] ^ mask[1]; - case 1: output[offset + i] = source[i] ^ mask[0]; - case 0:; - } - }, - unmask: function(data, mask) { - var maskNum = mask.readUInt32LE(0, true); - var length = data.length; - var i = 0; - for (; i < length - 3; i += 4) { - var num = maskNum ^ data.readUInt32LE(i, true); - if (num < 0) num = 4294967296 + num; - data.writeUInt32LE(num, i, true); - } - switch (length % 4) { - case 3: data[i + 2] = data[i + 2] ^ mask[2]; - case 2: data[i + 1] = data[i + 1] ^ mask[1]; - case 1: data[i] = data[i] ^ mask[0]; - case 0:; - } - } -} diff --git a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/lib/BufferUtil.js b/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/lib/BufferUtil.js deleted file mode 100644 index 15d35b98f5c..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/lib/BufferUtil.js +++ /dev/null @@ -1,16 +0,0 @@ -/*! - * ws: a node.js websocket client - * Copyright(c) 2011 Einar Otto Stangvik - * MIT Licensed - */ - -try { - module.exports = require('../build/Release/bufferutil'); -} catch (e) { try { - module.exports = require('../build/default/bufferutil'); -} catch (e) { try { - module.exports = require('./BufferUtil.fallback'); -} catch (e) { - console.error('bufferutil.node seems to not have been built. Run npm install.'); - throw e; -}}} diff --git a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/lib/ErrorCodes.js b/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/lib/ErrorCodes.js deleted file mode 100644 index 55ebd529b7c..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/lib/ErrorCodes.js +++ /dev/null @@ -1,24 +0,0 @@ -/*! - * ws: a node.js websocket client - * Copyright(c) 2011 Einar Otto Stangvik - * MIT Licensed - */ - -module.exports = { - isValidErrorCode: function(code) { - return (code >= 1000 && code <= 1011 && code != 1004 && code != 1005 && code != 1006) || - (code >= 3000 && code <= 4999); - }, - 1000: 'normal', - 1001: 'going away', - 1002: 'protocol error', - 1003: 'unsupported data', - 1004: 'reserved', - 1005: 'reserved for extensions', - 1006: 'reserved for extensions', - 1007: 'inconsistent or invalid data', - 1008: 'policy violation', - 1009: 'message too big', - 1010: 'extension handshake missing', - 1011: 'an unexpected condition prevented the request from being fulfilled', -}; \ No newline at end of file diff --git a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/lib/Receiver.hixie.js b/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/lib/Receiver.hixie.js deleted file mode 100644 index a8e41c47b51..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/lib/Receiver.hixie.js +++ /dev/null @@ -1,180 +0,0 @@ -/*! - * ws: a node.js websocket client - * Copyright(c) 2011 Einar Otto Stangvik - * MIT Licensed - */ - -var util = require('util'); - -/** - * State constants - */ - -var EMPTY = 0 - , BODY = 1; -var BINARYLENGTH = 2 - , BINARYBODY = 3; - -/** - * Hixie Receiver implementation - */ - -function Receiver () { - this.state = EMPTY; - this.buffers = []; - this.messageEnd = -1; - this.spanLength = 0; - this.dead = false; - - this.onerror = function() {}; - this.ontext = function() {}; - this.onbinary = function() {}; - this.onclose = function() {}; - this.onping = function() {}; - this.onpong = function() {}; -} - -module.exports = Receiver; - -/** - * Add new data to the parser. - * - * @api public - */ - -Receiver.prototype.add = function(data) { - var self = this; - function doAdd() { - if (self.state === EMPTY) { - if (data.length == 2 && data[0] == 0xFF && data[1] == 0x00) { - self.reset(); - self.onclose(); - return; - } - if (data[0] === 0x80) { - self.messageEnd = 0; - self.state = BINARYLENGTH; - data = data.slice(1); - } else { - - if (data[0] !== 0x00) { - self.error('payload must start with 0x00 byte', true); - return; - } - data = data.slice(1); - self.state = BODY; - - } - } - if (self.state === BINARYLENGTH) { - var i = 0; - while ((i < data.length) && (data[i] & 0x80)) { - self.messageEnd = 128 * self.messageEnd + (data[i] & 0x7f); - ++i; - } - if (i < data.length) { - self.messageEnd = 128 * self.messageEnd + (data[i] & 0x7f); - self.state = BINARYBODY; - ++i; - } - if (i > 0) - data = data.slice(i); - } - if (self.state === BINARYBODY) { - var dataleft = self.messageEnd - self.spanLength; - if (data.length >= dataleft) { - // consume the whole buffer to finish the frame - self.buffers.push(data); - self.spanLength += dataleft; - self.messageEnd = dataleft; - return self.parse(); - } - // frame's not done even if we consume it all - self.buffers.push(data); - self.spanLength += data.length; - return; - } - self.buffers.push(data); - if ((self.messageEnd = bufferIndex(data, 0xFF)) != -1) { - self.spanLength += self.messageEnd; - return self.parse(); - } - else self.spanLength += data.length; - } - while(data) data = doAdd(); -}; - -/** - * Releases all resources used by the receiver. - * - * @api public - */ - -Receiver.prototype.cleanup = function() { - this.dead = true; - this.state = EMPTY; - this.buffers = []; -}; - -/** - * Process buffered data. - * - * @api public - */ - -Receiver.prototype.parse = function() { - var output = new Buffer(this.spanLength); - var outputIndex = 0; - for (var bi = 0, bl = this.buffers.length; bi < bl - 1; ++bi) { - var buffer = this.buffers[bi]; - buffer.copy(output, outputIndex); - outputIndex += buffer.length; - } - var lastBuffer = this.buffers[this.buffers.length - 1]; - if (this.messageEnd > 0) lastBuffer.copy(output, outputIndex, 0, this.messageEnd); - if (this.state !== BODY) --this.messageEnd; - var tail = null; - if (this.messageEnd < lastBuffer.length - 1) { - tail = lastBuffer.slice(this.messageEnd + 1); - } - this.reset(); - this.ontext(output.toString('utf8')); - return tail; -}; - -/** - * Handles an error - * - * @api private - */ - -Receiver.prototype.error = function (reason, terminate) { - this.reset(); - this.onerror(reason, terminate); - return this; -}; - -/** - * Reset parser state - * - * @api private - */ - -Receiver.prototype.reset = function (reason) { - if (this.dead) return; - this.state = EMPTY; - this.buffers = []; - this.messageEnd = -1; - this.spanLength = 0; -}; - -/** - * Internal api - */ - -function bufferIndex(buffer, byte) { - for (var i = 0, l = buffer.length; i < l; ++i) { - if (buffer[i] === byte) return i; - } - return -1; -} diff --git a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/lib/Receiver.js b/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/lib/Receiver.js deleted file mode 100644 index 004cd32c168..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/lib/Receiver.js +++ /dev/null @@ -1,585 +0,0 @@ -/*! - * ws: a node.js websocket client - * Copyright(c) 2011 Einar Otto Stangvik - * MIT Licensed - */ - -var util = require('util') - , Validation = require('./Validation').Validation - , ErrorCodes = require('./ErrorCodes') - , BufferPool = require('./BufferPool') - , bufferUtil = require('./BufferUtil').BufferUtil; - -/** - * HyBi Receiver implementation - */ - -function Receiver () { - // memory pool for fragmented messages - var fragmentedPoolPrevUsed = -1; - this.fragmentedBufferPool = new BufferPool(1024, function(db, length) { - return db.used + length; - }, function(db) { - return fragmentedPoolPrevUsed = fragmentedPoolPrevUsed >= 0 ? - (fragmentedPoolPrevUsed + db.used) / 2 : - db.used; - }); - - // memory pool for unfragmented messages - var unfragmentedPoolPrevUsed = -1; - this.unfragmentedBufferPool = new BufferPool(1024, function(db, length) { - return db.used + length; - }, function(db) { - return unfragmentedPoolPrevUsed = unfragmentedPoolPrevUsed >= 0 ? - (unfragmentedPoolPrevUsed + db.used) / 2 : - db.used; - }); - - this.state = { - activeFragmentedOperation: null, - lastFragment: false, - masked: false, - opcode: 0, - fragmentedOperation: false - }; - this.overflow = []; - this.headerBuffer = new Buffer(10); - this.expectOffset = 0; - this.expectBuffer = null; - this.expectHandler = null; - this.currentMessage = []; - this.expectHeader(2, this.processPacket); - this.dead = false; - - this.onerror = function() {}; - this.ontext = function() {}; - this.onbinary = function() {}; - this.onclose = function() {}; - this.onping = function() {}; - this.onpong = function() {}; -} - -module.exports = Receiver; - -/** - * Add new data to the parser. - * - * @api public - */ - -Receiver.prototype.add = function(data) { - var dataLength = data.length; - if (dataLength == 0) return; - if (this.expectBuffer == null) { - this.overflow.push(data); - return; - } - var toRead = Math.min(dataLength, this.expectBuffer.length - this.expectOffset); - fastCopy(toRead, data, this.expectBuffer, this.expectOffset); - this.expectOffset += toRead; - if (toRead < dataLength) { - this.overflow.push(data.slice(toRead)); - } - while (this.expectBuffer && this.expectOffset == this.expectBuffer.length) { - var bufferForHandler = this.expectBuffer; - this.expectBuffer = null; - this.expectOffset = 0; - this.expectHandler.call(this, bufferForHandler); - } -}; - -/** - * Releases all resources used by the receiver. - * - * @api public - */ - -Receiver.prototype.cleanup = function() { - this.dead = true; - this.overflow = null; - this.headerBuffer = null; - this.expectBuffer = null; - this.expectHandler = null; - this.unfragmentedBufferPool = null; - this.fragmentedBufferPool = null; - this.state = null; - this.currentMessage = null; - this.onerror = null; - this.ontext = null; - this.onbinary = null; - this.onclose = null; - this.onping = null; - this.onpong = null; -}; - -/** - * Waits for a certain amount of header bytes to be available, then fires a callback. - * - * @api private - */ - -Receiver.prototype.expectHeader = function(length, handler) { - if (length == 0) { - handler(null); - return; - } - this.expectBuffer = this.headerBuffer.slice(this.expectOffset, this.expectOffset + length); - this.expectHandler = handler; - var toRead = length; - while (toRead > 0 && this.overflow.length > 0) { - var fromOverflow = this.overflow.pop(); - if (toRead < fromOverflow.length) this.overflow.push(fromOverflow.slice(toRead)); - var read = Math.min(fromOverflow.length, toRead); - fastCopy(read, fromOverflow, this.expectBuffer, this.expectOffset); - this.expectOffset += read; - toRead -= read; - } -}; - -/** - * Waits for a certain amount of data bytes to be available, then fires a callback. - * - * @api private - */ - -Receiver.prototype.expectData = function(length, handler) { - if (length == 0) { - handler(null); - return; - } - this.expectBuffer = this.allocateFromPool(length, this.state.fragmentedOperation); - this.expectHandler = handler; - var toRead = length; - while (toRead > 0 && this.overflow.length > 0) { - var fromOverflow = this.overflow.pop(); - if (toRead < fromOverflow.length) this.overflow.push(fromOverflow.slice(toRead)); - var read = Math.min(fromOverflow.length, toRead); - fastCopy(read, fromOverflow, this.expectBuffer, this.expectOffset); - this.expectOffset += read; - toRead -= read; - } -}; - -/** - * Allocates memory from the buffer pool. - * - * @api private - */ - -Receiver.prototype.allocateFromPool = function(length, isFragmented) { - return (isFragmented ? this.fragmentedBufferPool : this.unfragmentedBufferPool).get(length); -}; - -/** - * Start processing a new packet. - * - * @api private - */ - -Receiver.prototype.processPacket = function (data) { - if ((data[0] & 0x70) != 0) { - this.error('reserved fields must be empty', 1002); - return; - } - this.state.lastFragment = (data[0] & 0x80) == 0x80; - this.state.masked = (data[1] & 0x80) == 0x80; - var opcode = data[0] & 0xf; - if (opcode === 0) { - // continuation frame - this.state.fragmentedOperation = true; - this.state.opcode = this.state.activeFragmentedOperation; - if (!(this.state.opcode == 1 || this.state.opcode == 2)) { - this.error('continuation frame cannot follow current opcode', 1002); - return; - } - } - else { - if (opcode < 3 && this.state.activeFragmentedOperation != null) { - this.error('data frames after the initial data frame must have opcode 0', 1002); - return; - } - this.state.opcode = opcode; - if (this.state.lastFragment === false) { - this.state.fragmentedOperation = true; - this.state.activeFragmentedOperation = opcode; - } - else this.state.fragmentedOperation = false; - } - var handler = opcodes[this.state.opcode]; - if (typeof handler == 'undefined') this.error('no handler for opcode ' + this.state.opcode, 1002); - else { - handler.start.call(this, data); - } -}; - -/** - * Endprocessing a packet. - * - * @api private - */ - -Receiver.prototype.endPacket = function() { - if (!this.state.fragmentedOperation) this.unfragmentedBufferPool.reset(true); - else if (this.state.lastFragment) this.fragmentedBufferPool.reset(false); - this.expectOffset = 0; - this.expectBuffer = null; - this.expectHandler = null; - if (this.state.lastFragment && this.state.opcode === this.state.activeFragmentedOperation) { - // end current fragmented operation - this.state.activeFragmentedOperation = null; - } - this.state.lastFragment = false; - this.state.opcode = this.state.activeFragmentedOperation != null ? this.state.activeFragmentedOperation : 0; - this.state.masked = false; - this.expectHeader(2, this.processPacket); -}; - -/** - * Reset the parser state. - * - * @api private - */ - -Receiver.prototype.reset = function() { - if (this.dead) return; - this.state = { - activeFragmentedOperation: null, - lastFragment: false, - masked: false, - opcode: 0, - fragmentedOperation: false - }; - this.fragmentedBufferPool.reset(true); - this.unfragmentedBufferPool.reset(true); - this.expectOffset = 0; - this.expectBuffer = null; - this.expectHandler = null; - this.overflow = []; - this.currentMessage = []; -}; - -/** - * Unmask received data. - * - * @api private - */ - -Receiver.prototype.unmask = function (mask, buf, binary) { - if (mask != null && buf != null) bufferUtil.unmask(buf, mask); - if (binary) return buf; - return buf != null ? buf.toString('utf8') : ''; -}; - -/** - * Concatenates a list of buffers. - * - * @api private - */ - -Receiver.prototype.concatBuffers = function(buffers) { - var length = 0; - for (var i = 0, l = buffers.length; i < l; ++i) length += buffers[i].length; - var mergedBuffer = new Buffer(length); - bufferUtil.merge(mergedBuffer, buffers); - return mergedBuffer; -}; - -/** - * Handles an error - * - * @api private - */ - -Receiver.prototype.error = function (reason, protocolErrorCode) { - this.reset(); - this.onerror(reason, protocolErrorCode); - return this; -}; - -/** - * Buffer utilities - */ - -function readUInt16BE(start) { - return (this[start]<<8) + - this[start+1]; -} - -function readUInt32BE(start) { - return (this[start]<<24) + - (this[start+1]<<16) + - (this[start+2]<<8) + - this[start+3]; -} - -function fastCopy(length, srcBuffer, dstBuffer, dstOffset) { - switch (length) { - default: srcBuffer.copy(dstBuffer, dstOffset, 0, length); break; - case 16: dstBuffer[dstOffset+15] = srcBuffer[15]; - case 15: dstBuffer[dstOffset+14] = srcBuffer[14]; - case 14: dstBuffer[dstOffset+13] = srcBuffer[13]; - case 13: dstBuffer[dstOffset+12] = srcBuffer[12]; - case 12: dstBuffer[dstOffset+11] = srcBuffer[11]; - case 11: dstBuffer[dstOffset+10] = srcBuffer[10]; - case 10: dstBuffer[dstOffset+9] = srcBuffer[9]; - case 9: dstBuffer[dstOffset+8] = srcBuffer[8]; - case 8: dstBuffer[dstOffset+7] = srcBuffer[7]; - case 7: dstBuffer[dstOffset+6] = srcBuffer[6]; - case 6: dstBuffer[dstOffset+5] = srcBuffer[5]; - case 5: dstBuffer[dstOffset+4] = srcBuffer[4]; - case 4: dstBuffer[dstOffset+3] = srcBuffer[3]; - case 3: dstBuffer[dstOffset+2] = srcBuffer[2]; - case 2: dstBuffer[dstOffset+1] = srcBuffer[1]; - case 1: dstBuffer[dstOffset] = srcBuffer[0]; - } -} - -/** - * Opcode handlers - */ - -var opcodes = { - // text - '1': { - start: function(data) { - var self = this; - // decode length - var firstLength = data[1] & 0x7f; - if (firstLength < 126) { - opcodes['1'].getData.call(self, firstLength); - } - else if (firstLength == 126) { - self.expectHeader(2, function(data) { - opcodes['1'].getData.call(self, readUInt16BE.call(data, 0)); - }); - } - else if (firstLength == 127) { - self.expectHeader(8, function(data) { - if (readUInt32BE.call(data, 0) != 0) { - self.error('packets with length spanning more than 32 bit is currently not supported', 1008); - return; - } - opcodes['1'].getData.call(self, readUInt32BE.call(data, 4)); - }); - } - }, - getData: function(length) { - var self = this; - if (self.state.masked) { - self.expectHeader(4, function(data) { - var mask = data; - self.expectData(length, function(data) { - opcodes['1'].finish.call(self, mask, data); - }); - }); - } - else { - self.expectData(length, function(data) { - opcodes['1'].finish.call(self, null, data); - }); - } - }, - finish: function(mask, data) { - var packet = this.unmask(mask, data, true); - if (packet != null) this.currentMessage.push(packet); - if (this.state.lastFragment) { - var messageBuffer = this.concatBuffers(this.currentMessage); - if (!Validation.isValidUTF8(messageBuffer)) { - this.error('invalid utf8 sequence', 1007); - return; - } - this.ontext(messageBuffer.toString('utf8'), {masked: this.state.masked, buffer: messageBuffer}); - this.currentMessage = []; - } - this.endPacket(); - } - }, - // binary - '2': { - start: function(data) { - var self = this; - // decode length - var firstLength = data[1] & 0x7f; - if (firstLength < 126) { - opcodes['2'].getData.call(self, firstLength); - } - else if (firstLength == 126) { - self.expectHeader(2, function(data) { - opcodes['2'].getData.call(self, readUInt16BE.call(data, 0)); - }); - } - else if (firstLength == 127) { - self.expectHeader(8, function(data) { - if (readUInt32BE.call(data, 0) != 0) { - self.error('packets with length spanning more than 32 bit is currently not supported', 1008); - return; - } - opcodes['2'].getData.call(self, readUInt32BE.call(data, 4, true)); - }); - } - }, - getData: function(length) { - var self = this; - if (self.state.masked) { - self.expectHeader(4, function(data) { - var mask = data; - self.expectData(length, function(data) { - opcodes['2'].finish.call(self, mask, data); - }); - }); - } - else { - self.expectData(length, function(data) { - opcodes['2'].finish.call(self, null, data); - }); - } - }, - finish: function(mask, data) { - var packet = this.unmask(mask, data, true); - if (packet != null) this.currentMessage.push(packet); - if (this.state.lastFragment) { - var messageBuffer = this.concatBuffers(this.currentMessage); - this.onbinary(messageBuffer, {masked: this.state.masked, buffer: messageBuffer}); - this.currentMessage = []; - } - this.endPacket(); - } - }, - // close - '8': { - start: function(data) { - var self = this; - if (self.state.lastFragment == false) { - self.error('fragmented close is not supported', 1002); - return; - } - - // decode length - var firstLength = data[1] & 0x7f; - if (firstLength < 126) { - opcodes['8'].getData.call(self, firstLength); - } - else { - self.error('control frames cannot have more than 125 bytes of data', 1002); - } - }, - getData: function(length) { - var self = this; - if (self.state.masked) { - self.expectHeader(4, function(data) { - var mask = data; - self.expectData(length, function(data) { - opcodes['8'].finish.call(self, mask, data); - }); - }); - } - else { - self.expectData(length, function(data) { - opcodes['8'].finish.call(self, null, data); - }); - } - }, - finish: function(mask, data) { - var self = this; - data = self.unmask(mask, data, true); - if (data && data.length == 1) { - self.error('close packets with data must be at least two bytes long', 1002); - return; - } - var code = data && data.length > 1 ? readUInt16BE.call(data, 0) : 1000; - if (!ErrorCodes.isValidErrorCode(code)) { - self.error('invalid error code', 1002); - return; - } - var message = ''; - if (data && data.length > 2) { - var messageBuffer = data.slice(2); - if (!Validation.isValidUTF8(messageBuffer)) { - self.error('invalid utf8 sequence', 1007); - return; - } - message = messageBuffer.toString('utf8'); - } - this.onclose(code, message, {masked: self.state.masked}); - this.reset(); - }, - }, - // ping - '9': { - start: function(data) { - var self = this; - if (self.state.lastFragment == false) { - self.error('fragmented ping is not supported', 1002); - return; - } - - // decode length - var firstLength = data[1] & 0x7f; - if (firstLength < 126) { - opcodes['9'].getData.call(self, firstLength); - } - else { - self.error('control frames cannot have more than 125 bytes of data', 1002); - } - }, - getData: function(length) { - var self = this; - if (self.state.masked) { - self.expectHeader(4, function(data) { - var mask = data; - self.expectData(length, function(data) { - opcodes['9'].finish.call(self, mask, data); - }); - }); - } - else { - self.expectData(length, function(data) { - opcodes['9'].finish.call(self, null, data); - }); - } - }, - finish: function(mask, data) { - this.onping(this.unmask(mask, data, true), {masked: this.state.masked, binary: true}); - this.endPacket(); - } - }, - // pong - '10': { - start: function(data) { - var self = this; - if (self.state.lastFragment == false) { - self.error('fragmented pong is not supported', 1002); - return; - } - - // decode length - var firstLength = data[1] & 0x7f; - if (firstLength < 126) { - opcodes['10'].getData.call(self, firstLength); - } - else { - self.error('control frames cannot have more than 125 bytes of data', 1002); - } - }, - getData: function(length) { - var self = this; - if (this.state.masked) { - this.expectHeader(4, function(data) { - var mask = data; - self.expectData(length, function(data) { - opcodes['10'].finish.call(self, mask, data); - }); - }); - } - else { - this.expectData(length, function(data) { - opcodes['10'].finish.call(self, null, data); - }); - } - }, - finish: function(mask, data) { - this.onpong(this.unmask(mask, data, true), {masked: this.state.masked, binary: true}); - this.endPacket(); - } - } -} diff --git a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/lib/Sender.hixie.js b/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/lib/Sender.hixie.js deleted file mode 100644 index c715dbdc7ec..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/lib/Sender.hixie.js +++ /dev/null @@ -1,118 +0,0 @@ -/*! - * ws: a node.js websocket client - * Copyright(c) 2011 Einar Otto Stangvik - * MIT Licensed - */ - -var events = require('events') - , util = require('util') - , EventEmitter = events.EventEmitter; - -/** - * Hixie Sender implementation - */ - -function Sender(socket) { - this.socket = socket; - this.continuationFrame = false; - this.isClosed = false; -} - -module.exports = Sender; - -/** - * Inherits from EventEmitter. - */ - -util.inherits(Sender, events.EventEmitter); - -/** - * Frames and writes data. - * - * @api public - */ - -Sender.prototype.send = function(data, options, cb) { - if (this.isClosed) return; - - var isString = typeof data == 'string' - , length = isString ? Buffer.byteLength(data) : data.length - , lengthbytes = (length > 127) ? 2 : 1 // assume less than 2**14 bytes - , writeStartMarker = this.continuationFrame == false - , writeEndMarker = !options || !(typeof options.fin != 'undefined' && !options.fin) - , buffer = new Buffer((writeStartMarker ? ((options && options.binary) ? (1 + lengthbytes) : 1) : 0) + length + ((writeEndMarker && !(options && options.binary)) ? 1 : 0)) - , offset = writeStartMarker ? 1 : 0; - - if (writeStartMarker) { - if (options && options.binary) { - buffer.write('\x80', 'binary'); - // assume length less than 2**14 bytes - if (lengthbytes > 1) - buffer.write(String.fromCharCode(128+length/128), offset++, 'binary'); - buffer.write(String.fromCharCode(length&0x7f), offset++, 'binary'); - } else - buffer.write('\x00', 'binary'); - } - - if (isString) buffer.write(data, offset, 'utf8'); - else data.copy(buffer, offset, 0); - - if (writeEndMarker) { - if (options && options.binary) { - // sending binary, not writing end marker - } else - buffer.write('\xff', offset + length, 'binary'); - this.continuationFrame = false; - } - else this.continuationFrame = true; - - try { - this.socket.write(buffer, 'binary', cb); - } catch (e) { - this.error(e.toString()); - } -}; - -/** - * Sends a close instruction to the remote party. - * - * @api public - */ - -Sender.prototype.close = function(code, data, mask, cb) { - if (this.isClosed) return; - this.isClosed = true; - try { - if (this.continuationFrame) this.socket.write(new Buffer([0xff], 'binary')); - this.socket.write(new Buffer([0xff, 0x00]), 'binary', cb); - } catch (e) { - this.error(e.toString()); - } -}; - -/** - * Sends a ping message to the remote party. Not available for hixie. - * - * @api public - */ - -Sender.prototype.ping = function(data, options) {}; - -/** - * Sends a pong message to the remote party. Not available for hixie. - * - * @api public - */ - -Sender.prototype.pong = function(data, options) {}; - -/** - * Handles an error - * - * @api private - */ - -Sender.prototype.error = function (reason) { - this.emit('error', reason); - return this; -}; diff --git a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/lib/Sender.js b/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/lib/Sender.js deleted file mode 100644 index bc6ea7308f1..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/lib/Sender.js +++ /dev/null @@ -1,227 +0,0 @@ -/*! - * ws: a node.js websocket client - * Copyright(c) 2011 Einar Otto Stangvik - * MIT Licensed - */ - -var events = require('events') - , util = require('util') - , EventEmitter = events.EventEmitter - , ErrorCodes = require('./ErrorCodes') - , bufferUtil = require('./BufferUtil').BufferUtil; - -/** - * HyBi Sender implementation - */ - -function Sender(socket) { - this._socket = socket; - this.firstFragment = true; -} - -/** - * Inherits from EventEmitter. - */ - -util.inherits(Sender, events.EventEmitter); - -/** - * Sends a close instruction to the remote party. - * - * @api public - */ - -Sender.prototype.close = function(code, data, mask) { - if (typeof code !== 'undefined') { - if (typeof code !== 'number' || - !ErrorCodes.isValidErrorCode(code)) throw new Error('first argument must be a valid error code number'); - } - code = code || 1000; - var dataBuffer = new Buffer(2 + (data ? Buffer.byteLength(data) : 0)); - writeUInt16BE.call(dataBuffer, code, 0); - if (dataBuffer.length > 2) dataBuffer.write(data, 2); - this.frameAndSend(0x8, dataBuffer, true, mask); -}; - -/** - * Sends a ping message to the remote party. - * - * @api public - */ - -Sender.prototype.ping = function(data, options) { - var mask = options && options.mask; - this.frameAndSend(0x9, data || '', true, mask); -}; - -/** - * Sends a pong message to the remote party. - * - * @api public - */ - -Sender.prototype.pong = function(data, options) { - var mask = options && options.mask; - this.frameAndSend(0xa, data || '', true, mask); -}; - -/** - * Sends text or binary data to the remote party. - * - * @api public - */ - -Sender.prototype.send = function(data, options, cb) { - var finalFragment = options && options.fin === false ? false : true; - var mask = options && options.mask; - var opcode = options && options.binary ? 2 : 1; - if (this.firstFragment === false) opcode = 0; - else this.firstFragment = false; - if (finalFragment) this.firstFragment = true - this.frameAndSend(opcode, data, finalFragment, mask, cb); -}; - -/** - * Frames and sends a piece of data according to the HyBi WebSocket protocol. - * - * @api private - */ - -Sender.prototype.frameAndSend = function(opcode, data, finalFragment, maskData, cb) { - var canModifyData = false; - - if (!data) { - try { - this._socket.write(new Buffer([opcode | (finalFragment ? 0x80 : 0), 0 | (maskData ? 0x80 : 0)].concat(maskData ? [0, 0, 0, 0] : [])), 'binary', cb); - } - catch (e) { - if (typeof cb == 'function') cb(e); - else this.emit('error', e); - } - return; - } - - if (!Buffer.isBuffer(data)) { - canModifyData = true; - if (data && (typeof data.byteLength !== 'undefined' || typeof data.buffer !== 'undefined')) { - data = getArrayBuffer(data); - } else { - data = new Buffer(data); - } - } - - var dataLength = data.length - , dataOffset = maskData ? 6 : 2 - , secondByte = dataLength; - - if (dataLength >= 65536) { - dataOffset += 8; - secondByte = 127; - } - else if (dataLength > 125) { - dataOffset += 2; - secondByte = 126; - } - - var mergeBuffers = dataLength < 32768 || (maskData && !canModifyData); - var totalLength = mergeBuffers ? dataLength + dataOffset : dataOffset; - var outputBuffer = new Buffer(totalLength); - outputBuffer[0] = finalFragment ? opcode | 0x80 : opcode; - - switch (secondByte) { - case 126: - writeUInt16BE.call(outputBuffer, dataLength, 2); - break; - case 127: - writeUInt32BE.call(outputBuffer, 0, 2); - writeUInt32BE.call(outputBuffer, dataLength, 6); - } - - if (maskData) { - outputBuffer[1] = secondByte | 0x80; - var mask = this._randomMask || (this._randomMask = getRandomMask()); - outputBuffer[dataOffset - 4] = mask[0]; - outputBuffer[dataOffset - 3] = mask[1]; - outputBuffer[dataOffset - 2] = mask[2]; - outputBuffer[dataOffset - 1] = mask[3]; - if (mergeBuffers) { - bufferUtil.mask(data, mask, outputBuffer, dataOffset, dataLength); - try { - this._socket.write(outputBuffer, 'binary', cb); - } - catch (e) { - if (typeof cb == 'function') cb(e); - else this.emit('error', e); - } - } - else { - bufferUtil.mask(data, mask, data, 0, dataLength); - try { - this._socket.write(outputBuffer, 'binary'); - this._socket.write(data, 'binary', cb); - } - catch (e) { - if (typeof cb == 'function') cb(e); - else this.emit('error', e); - } - } - } - else { - outputBuffer[1] = secondByte; - if (mergeBuffers) { - data.copy(outputBuffer, dataOffset); - try { - this._socket.write(outputBuffer, 'binary', cb); - } - catch (e) { - if (typeof cb == 'function') cb(e); - else this.emit('error', e); - } - } - else { - try { - this._socket.write(outputBuffer, 'binary'); - this._socket.write(data, 'binary', cb); - } - catch (e) { - if (typeof cb == 'function') cb(e); - else this.emit('error', e); - } - } - } -}; - -module.exports = Sender; - -function writeUInt16BE(value, offset) { - this[offset] = (value & 0xff00)>>8; - this[offset+1] = value & 0xff; -} - -function writeUInt32BE(value, offset) { - this[offset] = (value & 0xff000000)>>24; - this[offset+1] = (value & 0xff0000)>>16; - this[offset+2] = (value & 0xff00)>>8; - this[offset+3] = value & 0xff; -} - -function getArrayBuffer(data) { - // data is either an ArrayBuffer or ArrayBufferView. - var array = new Uint8Array(data.buffer || data) - , l = data.byteLength || data.length - , o = data.byteOffset || 0 - , buffer = new Buffer(l); - for (var i = 0; i < l; ++i) { - buffer[i] = array[o+i]; - } - return buffer; -} - -function getRandomMask() { - return new Buffer([ - ~~(Math.random() * 255), - ~~(Math.random() * 255), - ~~(Math.random() * 255), - ~~(Math.random() * 255) - ]); -} diff --git a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/lib/Validation.fallback.js b/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/lib/Validation.fallback.js deleted file mode 100644 index 2c7c4fd48b2..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/lib/Validation.fallback.js +++ /dev/null @@ -1,12 +0,0 @@ -/*! - * ws: a node.js websocket client - * Copyright(c) 2011 Einar Otto Stangvik - * MIT Licensed - */ - -module.exports.Validation = { - isValidUTF8: function(buffer) { - return true; - } -}; - diff --git a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/lib/Validation.js b/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/lib/Validation.js deleted file mode 100644 index 0f3109a05a5..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/lib/Validation.js +++ /dev/null @@ -1,16 +0,0 @@ -/*! - * ws: a node.js websocket client - * Copyright(c) 2011 Einar Otto Stangvik - * MIT Licensed - */ - -try { - module.exports = require('../build/Release/validation'); -} catch (e) { try { - module.exports = require('../build/default/validation'); -} catch (e) { try { - module.exports = require('./Validation.fallback'); -} catch (e) { - console.error('validation.node seems to not have been built. Run npm install.'); - throw e; -}}} diff --git a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/lib/WebSocket.js b/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/lib/WebSocket.js deleted file mode 100644 index 8c304ebbd05..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/lib/WebSocket.js +++ /dev/null @@ -1,794 +0,0 @@ -/*! - * ws: a node.js websocket client - * Copyright(c) 2011 Einar Otto Stangvik - * MIT Licensed - */ - -var util = require('util') - , events = require('events') - , http = require('http') - , https = require('https') - , crypto = require('crypto') - , url = require('url') - , stream = require('stream') - , Options = require('options') - , Sender = require('./Sender') - , Receiver = require('./Receiver') - , SenderHixie = require('./Sender.hixie') - , ReceiverHixie = require('./Receiver.hixie'); - -/** - * Constants - */ - -// Default protocol version - -var protocolVersion = 13; - -// Close timeout - -var closeTimeout = 30000; // Allow 5 seconds to terminate the connection cleanly - -/** - * WebSocket implementation - */ - -function WebSocket(address, protocols, options) { - - if (protocols && !Array.isArray(protocols) && 'object' == typeof protocols) { - // accept the "options" Object as the 2nd argument - options = protocols; - protocols = null; - } - if ('string' == typeof protocols) { - protocols = [ protocols ]; - } - if (!Array.isArray(protocols)) { - protocols = []; - } - // TODO: actually handle the `Sub-Protocols` part of the WebSocket client - - this._socket = null; - this.bytesReceived = 0; - this.readyState = null; - this.supports = {}; - - if (Array.isArray(address)) { - initAsServerClient.apply(this, address.concat(options)); - } else { - initAsClient.apply(this, [address, protocols, options]); - } -} - -/** - * Inherits from EventEmitter. - */ - -util.inherits(WebSocket, events.EventEmitter); - -/** - * Ready States - */ - -["CONNECTING", "OPEN", "CLOSING", "CLOSED"].forEach(function (state, index) { - WebSocket.prototype[state] = WebSocket[state] = index; -}); - -/** - * Gracefully closes the connection, after sending a description message to the server - * - * @param {Object} data to be sent to the server - * @api public - */ - -WebSocket.prototype.close = function(code, data) { - if (this.readyState == WebSocket.CLOSING || this.readyState == WebSocket.CLOSED) return; - if (this.readyState == WebSocket.CONNECTING) { - this.readyState = WebSocket.CLOSED; - return; - } - try { - this.readyState = WebSocket.CLOSING; - this._closeCode = code; - this._closeMessage = data; - var mask = !this._isServer; - this._sender.close(code, data, mask); - } - catch (e) { - this.emit('error', e); - } - finally { - this.terminate(); - } -} - -/** - * Pause the client stream - * - * @api public - */ - -WebSocket.prototype.pause = function() { - if (this.readyState != WebSocket.OPEN) throw new Error('not opened'); - return this._socket.pause(); -} - -/** - * Sends a ping - * - * @param {Object} data to be sent to the server - * @param {Object} Members - mask: boolean, binary: boolean - * @param {boolean} dontFailWhenClosed indicates whether or not to throw if the connection isnt open - * @api public - */ - -WebSocket.prototype.ping = function(data, options, dontFailWhenClosed) { - if (this.readyState != WebSocket.OPEN) { - if (dontFailWhenClosed === true) return; - throw new Error('not opened'); - } - options = options || {}; - if (typeof options.mask == 'undefined') options.mask = !this._isServer; - this._sender.ping(data, options); -} - -/** - * Sends a pong - * - * @param {Object} data to be sent to the server - * @param {Object} Members - mask: boolean, binary: boolean - * @param {boolean} dontFailWhenClosed indicates whether or not to throw if the connection isnt open - * @api public - */ - -WebSocket.prototype.pong = function(data, options, dontFailWhenClosed) { - if (this.readyState != WebSocket.OPEN) { - if (dontFailWhenClosed === true) return; - throw new Error('not opened'); - } - options = options || {}; - if (typeof options.mask == 'undefined') options.mask = !this._isServer; - this._sender.pong(data, options); -} - -/** - * Resume the client stream - * - * @api public - */ - -WebSocket.prototype.resume = function() { - if (this.readyState != WebSocket.OPEN) throw new Error('not opened'); - return this._socket.resume(); -} - -/** - * Sends a piece of data - * - * @param {Object} data to be sent to the server - * @param {Object} Members - mask: boolean, binary: boolean - * @param {function} Optional callback which is executed after the send completes - * @api public - */ - -WebSocket.prototype.send = function(data, options, cb) { - if (typeof options == 'function') { - cb = options; - options = {}; - } - if (this.readyState != WebSocket.OPEN) { - if (typeof cb == 'function') cb(new Error('not opened')); - else throw new Error('not opened'); - return; - } - if (!data) data = ''; - if (this._queue) { - var self = this; - this._queue.push(function() { self.send(data, options, cb); }); - return; - } - options = options || {}; - options.fin = true; - if (typeof options.binary == 'undefined') { - options.binary = (data instanceof ArrayBuffer || data instanceof Buffer || - data instanceof Uint8Array || - data instanceof Uint16Array || - data instanceof Uint32Array || - data instanceof Int8Array || - data instanceof Int16Array || - data instanceof Int32Array || - data instanceof Float32Array || - data instanceof Float64Array); - } - if (typeof options.mask == 'undefined') options.mask = !this._isServer; - var readable = typeof stream.Readable == 'function' ? stream.Readable : stream.Stream; - if (data instanceof readable) { - startQueue(this); - var self = this; - sendStream(this, data, options, function(error) { - process.nextTick(function() { executeQueueSends(self); }); - if (typeof cb == 'function') cb(error); - }); - } - else this._sender.send(data, options, cb); -} - -/** - * Streams data through calls to a user supplied function - * - * @param {Object} Members - mask: boolean, binary: boolean - * @param {function} 'function (error, send)' which is executed on successive ticks of which send is 'function (data, final)'. - * @api public - */ - -WebSocket.prototype.stream = function(options, cb) { - if (typeof options == 'function') { - cb = options; - options = {}; - } - var self = this; - if (typeof cb != 'function') throw new Error('callback must be provided'); - if (this.readyState != WebSocket.OPEN) { - if (typeof cb == 'function') cb(new Error('not opened')); - else throw new Error('not opened'); - return; - } - if (this._queue) { - this._queue.push(function() { self.stream(options, cb); }); - return; - } - options = options || {}; - if (typeof options.mask == 'undefined') options.mask = !this._isServer; - startQueue(this); - var send = function(data, final) { - try { - if (self.readyState != WebSocket.OPEN) throw new Error('not opened'); - options.fin = final === true; - self._sender.send(data, options); - if (!final) process.nextTick(cb.bind(null, null, send)); - else executeQueueSends(self); - } - catch (e) { - if (typeof cb == 'function') cb(e); - else { - delete self._queue; - self.emit('error', e); - } - } - } - process.nextTick(cb.bind(null, null, send)); -} - -/** - * Immediately shuts down the connection - * - * @api public - */ - -WebSocket.prototype.terminate = function() { - if (this.readyState == WebSocket.CLOSED) return; - if (this._socket) { - try { - // End the connection - this._socket.end(); - } - catch (e) { - // Socket error during end() call, so just destroy it right now - cleanupWebsocketResources.call(this, true); - return; - } - - // Add a timeout to ensure that the connection is completely - // cleaned up within 30 seconds, even if the clean close procedure - // fails for whatever reason - this._closeTimer = setTimeout(cleanupWebsocketResources.bind(this, true), closeTimeout); - } - else if (this.readyState == WebSocket.CONNECTING) { - cleanupWebsocketResources.call(this, true); - } -}; - -/** - * Expose bufferedAmount - * - * @api public - */ - -Object.defineProperty(WebSocket.prototype, 'bufferedAmount', { - get: function get() { - var amount = 0; - if (this._socket) { - amount = this._socket.bufferSize || 0; - } - return amount; - } -}); - -/** - * Emulates the W3C Browser based WebSocket interface using function members. - * - * @see http://dev.w3.org/html5/websockets/#the-websocket-interface - * @api public - */ - -['open', 'error', 'close', 'message'].forEach(function(method) { - Object.defineProperty(WebSocket.prototype, 'on' + method, { - /** - * Returns the current listener - * - * @returns {Mixed} the set function or undefined - * @api public - */ - - get: function get() { - var listener = this.listeners(method)[0]; - return listener ? (listener._listener ? listener._listener : listener) : undefined; - }, - - /** - * Start listening for events - * - * @param {Function} listener the listener - * @returns {Mixed} the set function or undefined - * @api public - */ - - set: function set(listener) { - this.removeAllListeners(method); - this.addEventListener(method, listener); - } - }); -}); - -/** - * Emulates the W3C Browser based WebSocket interface using addEventListener. - * - * @see https://developer.mozilla.org/en/DOM/element.addEventListener - * @see http://dev.w3.org/html5/websockets/#the-websocket-interface - * @api public - */ -WebSocket.prototype.addEventListener = function(method, listener) { - var target = this; - if (typeof listener === 'function') { - if (method === 'message') { - function onMessage (data, flags) { - listener.call(this, new MessageEvent(data, flags.binary ? 'Binary' : 'Text', target)); - } - // store a reference so we can return the original function from the addEventListener hook - onMessage._listener = listener; - this.on(method, onMessage); - } else if (method === 'close') { - function onClose (code, message) { - listener.call(this, new CloseEvent(code, message, target)); - } - // store a reference so we can return the original function from the addEventListener hook - onClose._listener = listener; - this.on(method, onClose); - } else if (method === 'error') { - function onError (event) { - event.target = target; - listener.call(this, event); - } - // store a reference so we can return the original function from the addEventListener hook - onError._listener = listener; - this.on(method, onError); - } else if (method === 'open') { - function onOpen () { - listener.call(this, new OpenEvent(target)); - } - // store a reference so we can return the original function from the addEventListener hook - onOpen._listener = listener; - this.on(method, onOpen); - } else { - this.on(method, listener); - } - } -} - -module.exports = WebSocket; - -/** - * W3C MessageEvent - * - * @see http://www.w3.org/TR/html5/comms.html - * @api private - */ - -function MessageEvent(dataArg, typeArg, target) { - this.data = dataArg; - this.type = typeArg; - this.target = target; -} - -/** - * W3C CloseEvent - * - * @see http://www.w3.org/TR/html5/comms.html - * @api private - */ - -function CloseEvent(code, reason, target) { - this.wasClean = (typeof code == 'undefined' || code == 1000); - this.code = code; - this.reason = reason; - this.target = target; -} - -/** - * W3C OpenEvent - * - * @see http://www.w3.org/TR/html5/comms.html - * @api private - */ - -function OpenEvent(target) { - this.target = target; -} - -/** - * Entirely private apis, - * which may or may not be bound to a sepcific WebSocket instance. - */ - -function initAsServerClient(req, socket, upgradeHead, options) { - options = new Options({ - protocolVersion: protocolVersion, - protocol: null - }).merge(options); - - // expose state properties - this.protocol = options.value.protocol; - this.protocolVersion = options.value.protocolVersion; - this.supports.binary = (this.protocolVersion != 'hixie-76'); - this.upgradeReq = req; - this.readyState = WebSocket.CONNECTING; - this._isServer = true; - - // establish connection - if (options.value.protocolVersion == 'hixie-76') establishConnection.call(this, ReceiverHixie, SenderHixie, socket, upgradeHead); - else establishConnection.call(this, Receiver, Sender, socket, upgradeHead); -} - -function initAsClient(address, protocols, options) { - options = new Options({ - origin: null, - protocolVersion: protocolVersion, - host: null, - headers: null, - protocol: null, - agent: null, - - // ssl-related options - pfx: null, - key: null, - passphrase: null, - cert: null, - ca: null, - ciphers: null, - rejectUnauthorized: null - }).merge(options); - if (options.value.protocolVersion != 8 && options.value.protocolVersion != 13) { - throw new Error('unsupported protocol version'); - } - - // verify url and establish http class - var serverUrl = url.parse(address); - var isUnixSocket = serverUrl.protocol === 'ws+unix:'; - if (!serverUrl.host && !isUnixSocket) throw new Error('invalid url'); - var isSecure = serverUrl.protocol === 'wss:' || serverUrl.protocol === 'https:'; - var httpObj = isSecure ? https : http; - var port = serverUrl.port || (isSecure ? 443 : 80); - var auth = serverUrl.auth; - - // expose state properties - this._isServer = false; - this.url = address; - this.protocolVersion = options.value.protocolVersion; - this.supports.binary = (this.protocolVersion != 'hixie-76'); - - // begin handshake - var key = new Buffer(options.value.protocolVersion + '-' + Date.now()).toString('base64'); - var shasum = crypto.createHash('sha1'); - shasum.update(key + '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'); - var expectedServerKey = shasum.digest('base64'); - - var agent = options.value.agent; - - var headerHost = serverUrl.hostname; - // Append port number to Host and Origin header, only if specified in the url and non-default - if(serverUrl.port) { - if((isSecure && (port != 443)) || (!isSecure && (port != 80))){ - headerHost = headerHost + ':' + port; - } - } - - var requestOptions = { - port: port, - host: serverUrl.hostname, - headers: { - 'Connection': 'Upgrade', - 'Upgrade': 'websocket', - 'Host': headerHost, - 'Origin': headerHost, - 'Sec-WebSocket-Version': options.value.protocolVersion, - 'Sec-WebSocket-Key': key - } - }; - - // If we have basic auth. - if (auth) { - requestOptions.headers['Authorization'] = 'Basic ' + new Buffer(auth).toString('base64'); - } - - if (options.value.protocol) { - requestOptions.headers['Sec-WebSocket-Protocol'] = options.value.protocol; - } - - if (options.value.host) { - requestOptions.headers['Host'] = options.value.host; - } - - if (options.value.headers) { - for (var header in options.value.headers) { - if (options.value.headers.hasOwnProperty(header)) { - requestOptions.headers[header] = options.value.headers[header]; - } - } - } - - if (options.isDefinedAndNonNull('pfx') - || options.isDefinedAndNonNull('key') - || options.isDefinedAndNonNull('passphrase') - || options.isDefinedAndNonNull('cert') - || options.isDefinedAndNonNull('ca') - || options.isDefinedAndNonNull('ciphers') - || options.isDefinedAndNonNull('rejectUnauthorized')) { - - if (options.isDefinedAndNonNull('pfx')) requestOptions.pfx = options.value.pfx; - if (options.isDefinedAndNonNull('key')) requestOptions.key = options.value.key; - if (options.isDefinedAndNonNull('passphrase')) requestOptions.passphrase = options.value.passphrase; - if (options.isDefinedAndNonNull('cert')) requestOptions.cert = options.value.cert; - if (options.isDefinedAndNonNull('ca')) requestOptions.ca = options.value.ca; - if (options.isDefinedAndNonNull('ciphers')) requestOptions.ciphers = options.value.ciphers; - if (options.isDefinedAndNonNull('rejectUnauthorized')) requestOptions.rejectUnauthorized = options.value.rejectUnauthorized; - - if (!agent) { - // global agent ignores client side certificates - agent = new httpObj.Agent(requestOptions); - } - } - - requestOptions.path = serverUrl.path || '/'; - - if (agent) { - requestOptions.agent = agent; - } - - if (isUnixSocket) { - requestOptions.socketPath = serverUrl.pathname; - } - if (options.value.origin) { - if (options.value.protocolVersion < 13) requestOptions.headers['Sec-WebSocket-Origin'] = options.value.origin; - else requestOptions.headers['Origin'] = options.value.origin; - } - - var self = this; - var req = httpObj.request(requestOptions); - - req.on('error', function(error) { - self.emit('error', error); - cleanupWebsocketResources.call(this, error); - }); - - req.once('response', function(res) { - if (!self.emit('unexpected-response', req, res)) { - var error = new Error('unexpected server response (' + res.statusCode + ')'); - req.abort(); - self.emit('error', error); - } - cleanupWebsocketResources.call(this, error); - }); - - req.once('upgrade', function(res, socket, upgradeHead) { - if (self.readyState == WebSocket.CLOSED) { - // client closed before server accepted connection - self.emit('close'); - self.removeAllListeners(); - socket.end(); - return; - } - var serverKey = res.headers['sec-websocket-accept']; - if (typeof serverKey == 'undefined' || serverKey !== expectedServerKey) { - self.emit('error', 'invalid server key'); - self.removeAllListeners(); - socket.end(); - return; - } - - var serverProt = res.headers['sec-websocket-protocol']; - var protList = (options.value.protocol || "").split(/, */); - var protError = null; - if (!options.value.protocol && serverProt) { - protError = 'server sent a subprotocol even though none requested'; - } else if (options.value.protocol && !serverProt) { - protError = 'server sent no subprotocol even though requested'; - } else if (serverProt && protList.indexOf(serverProt) === -1) { - protError = 'server responded with an invalid protocol'; - } - if (protError) { - self.emit('error', protError); - self.removeAllListeners(); - socket.end(); - return; - } else if (serverProt) { - self.protocol = serverProt; - } - - establishConnection.call(self, Receiver, Sender, socket, upgradeHead); - - // perform cleanup on http resources - req.removeAllListeners(); - req = null; - agent = null; - }); - - req.end(); - this.readyState = WebSocket.CONNECTING; -} - -function establishConnection(ReceiverClass, SenderClass, socket, upgradeHead) { - this._socket = socket; - socket.setTimeout(0); - socket.setNoDelay(true); - var self = this; - this._receiver = new ReceiverClass(); - - // socket cleanup handlers - socket.on('end', cleanupWebsocketResources.bind(this)); - socket.on('close', cleanupWebsocketResources.bind(this)); - socket.on('error', cleanupWebsocketResources.bind(this)); - - // ensure that the upgradeHead is added to the receiver - function firstHandler(data) { - if (self.readyState != WebSocket.OPEN) return; - if (upgradeHead && upgradeHead.length > 0) { - self.bytesReceived += upgradeHead.length; - var head = upgradeHead; - upgradeHead = null; - self._receiver.add(head); - } - dataHandler = realHandler; - if (data) { - self.bytesReceived += data.length; - self._receiver.add(data); - } - } - // subsequent packets are pushed straight to the receiver - function realHandler(data) { - if (data) self.bytesReceived += data.length; - self._receiver.add(data); - } - var dataHandler = firstHandler; - // if data was passed along with the http upgrade, - // this will schedule a push of that on to the receiver. - // this has to be done on next tick, since the caller - // hasn't had a chance to set event handlers on this client - // object yet. - process.nextTick(firstHandler); - - // receiver event handlers - self._receiver.ontext = function (data, flags) { - flags = flags || {}; - self.emit('message', data, flags); - }; - self._receiver.onbinary = function (data, flags) { - flags = flags || {}; - flags.binary = true; - self.emit('message', data, flags); - }; - self._receiver.onping = function(data, flags) { - flags = flags || {}; - self.pong(data, {mask: !self._isServer, binary: flags.binary === true}, true); - self.emit('ping', data, flags); - }; - self._receiver.onpong = function(data, flags) { - self.emit('pong', data, flags); - }; - self._receiver.onclose = function(code, data, flags) { - flags = flags || {}; - self.close(code, data); - }; - self._receiver.onerror = function(reason, errorCode) { - // close the connection when the receiver reports a HyBi error code - self.close(typeof errorCode != 'undefined' ? errorCode : 1002, ''); - self.emit('error', reason, errorCode); - }; - - // finalize the client - this._sender = new SenderClass(socket); - this._sender.on('error', function(error) { - self.close(1002, ''); - self.emit('error', error); - }); - this.readyState = WebSocket.OPEN; - this.emit('open'); - - socket.on('data', dataHandler); -} - -function startQueue(instance) { - instance._queue = instance._queue || []; -} - -function executeQueueSends(instance) { - var queue = instance._queue; - if (typeof queue == 'undefined') return; - delete instance._queue; - for (var i = 0, l = queue.length; i < l; ++i) { - queue[i](); - } -} - -function sendStream(instance, stream, options, cb) { - stream.on('data', function(data) { - if (instance.readyState != WebSocket.OPEN) { - if (typeof cb == 'function') cb(new Error('not opened')); - else { - delete instance._queue; - instance.emit('error', new Error('not opened')); - } - return; - } - options.fin = false; - instance._sender.send(data, options); - }); - stream.on('end', function() { - if (instance.readyState != WebSocket.OPEN) { - if (typeof cb == 'function') cb(new Error('not opened')); - else { - delete instance._queue; - instance.emit('error', new Error('not opened')); - } - return; - } - options.fin = true; - instance._sender.send(null, options); - if (typeof cb == 'function') cb(null); - }); -} - -function cleanupWebsocketResources(error) { - if (this.readyState == WebSocket.CLOSED) return; - var emitClose = this.readyState != WebSocket.CONNECTING; - this.readyState = WebSocket.CLOSED; - - clearTimeout(this._closeTimer); - this._closeTimer = null; - if (emitClose) this.emit('close', this._closeCode || 1000, this._closeMessage || ''); - - if (this._socket) { - this._socket.removeAllListeners(); - // catch all socket error after removing all standard handlers - var socket = this._socket; - this._socket.on('error', function() { - try { socket.destroy(); } catch (e) {} - }); - try { - if (!error) this._socket.end(); - else this._socket.destroy(); - } - catch (e) { /* Ignore termination errors */ } - this._socket = null; - } - if (this._sender) { - this._sender.removeAllListeners(); - this._sender = null; - } - if (this._receiver) { - this._receiver.cleanup(); - this._receiver = null; - } - this.removeAllListeners(); - this.on('error', function() {}); // catch all errors after this - delete this._queue; -} diff --git a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/lib/WebSocketServer.js b/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/lib/WebSocketServer.js deleted file mode 100644 index 5cbd195b42e..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/lib/WebSocketServer.js +++ /dev/null @@ -1,465 +0,0 @@ -/*! - * ws: a node.js websocket client - * Copyright(c) 2011 Einar Otto Stangvik - * MIT Licensed - */ - -var util = require('util') - , events = require('events') - , http = require('http') - , crypto = require('crypto') - , Options = require('options') - , WebSocket = require('./WebSocket') - , tls = require('tls') - , url = require('url'); - -/** - * WebSocket Server implementation - */ - -function WebSocketServer(options, callback) { - options = new Options({ - host: '0.0.0.0', - port: null, - server: null, - verifyClient: null, - handleProtocols: null, - path: null, - noServer: false, - disableHixie: false, - clientTracking: true - }).merge(options); - - if (!options.isDefinedAndNonNull('port') && !options.isDefinedAndNonNull('server') && !options.value.noServer) { - throw new TypeError('`port` or a `server` must be provided'); - } - - var self = this; - - if (options.isDefinedAndNonNull('port')) { - this._server = http.createServer(function (req, res) { - res.writeHead(200, {'Content-Type': 'text/plain'}); - res.end('Not implemented'); - }); - this._server.listen(options.value.port, options.value.host, callback); - this._closeServer = function() { if (self._server) self._server.close(); }; - } - else if (options.value.server) { - this._server = options.value.server; - if (options.value.path) { - // take note of the path, to avoid collisions when multiple websocket servers are - // listening on the same http server - if (this._server._webSocketPaths && options.value.server._webSocketPaths[options.value.path]) { - throw new Error('two instances of WebSocketServer cannot listen on the same http server path'); - } - if (typeof this._server._webSocketPaths !== 'object') { - this._server._webSocketPaths = {}; - } - this._server._webSocketPaths[options.value.path] = 1; - } - } - if (this._server) this._server.once('listening', function() { self.emit('listening'); }); - - if (typeof this._server != 'undefined') { - this._server.on('error', function(error) { - self.emit('error', error) - }); - this._server.on('upgrade', function(req, socket, upgradeHead) { - //copy upgradeHead to avoid retention of large slab buffers used in node core - var head = new Buffer(upgradeHead.length); - upgradeHead.copy(head); - - self.handleUpgrade(req, socket, head, function(client) { - self.emit('connection'+req.url, client); - self.emit('connection', client); - }); - }); - } - - this.options = options.value; - this.path = options.value.path; - this.clients = []; -} - -/** - * Inherits from EventEmitter. - */ - -util.inherits(WebSocketServer, events.EventEmitter); - -/** - * Immediately shuts down the connection. - * - * @api public - */ - -WebSocketServer.prototype.close = function() { - // terminate all associated clients - var error = null; - try { - for (var i = 0, l = this.clients.length; i < l; ++i) { - this.clients[i].terminate(); - } - } - catch (e) { - error = e; - } - - // remove path descriptor, if any - if (this.path && this._server._webSocketPaths) { - delete this._server._webSocketPaths[this.path]; - if (Object.keys(this._server._webSocketPaths).length == 0) { - delete this._server._webSocketPaths; - } - } - - // close the http server if it was internally created - try { - if (typeof this._closeServer !== 'undefined') { - this._closeServer(); - } - } - finally { - delete this._server; - } - if (error) throw error; -} - -/** - * Handle a HTTP Upgrade request. - * - * @api public - */ - -WebSocketServer.prototype.handleUpgrade = function(req, socket, upgradeHead, cb) { - // check for wrong path - if (this.options.path) { - var u = url.parse(req.url); - if (u && u.pathname !== this.options.path) return; - } - - if (typeof req.headers.upgrade === 'undefined' || req.headers.upgrade.toLowerCase() !== 'websocket') { - abortConnection(socket, 400, 'Bad Request'); - return; - } - - if (req.headers['sec-websocket-key1']) handleHixieUpgrade.apply(this, arguments); - else handleHybiUpgrade.apply(this, arguments); -} - -module.exports = WebSocketServer; - -/** - * Entirely private apis, - * which may or may not be bound to a sepcific WebSocket instance. - */ - -function handleHybiUpgrade(req, socket, upgradeHead, cb) { - // handle premature socket errors - var errorHandler = function() { - try { socket.destroy(); } catch (e) {} - } - socket.on('error', errorHandler); - - // verify key presence - if (!req.headers['sec-websocket-key']) { - abortConnection(socket, 400, 'Bad Request'); - return; - } - - // verify version - var version = parseInt(req.headers['sec-websocket-version']); - if ([8, 13].indexOf(version) === -1) { - abortConnection(socket, 400, 'Bad Request'); - return; - } - - // verify protocol - var protocols = req.headers['sec-websocket-protocol']; - - // verify client - var origin = version < 13 ? - req.headers['sec-websocket-origin'] : - req.headers['origin']; - - // handler to call when the connection sequence completes - var self = this; - var completeHybiUpgrade2 = function(protocol) { - - // calc key - var key = req.headers['sec-websocket-key']; - var shasum = crypto.createHash('sha1'); - shasum.update(key + "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"); - key = shasum.digest('base64'); - - var headers = [ - 'HTTP/1.1 101 Switching Protocols' - , 'Upgrade: websocket' - , 'Connection: Upgrade' - , 'Sec-WebSocket-Accept: ' + key - ]; - - if (typeof protocol != 'undefined') { - headers.push('Sec-WebSocket-Protocol: ' + protocol); - } - - // allows external modification/inspection of handshake headers - self.emit('headers', headers); - - socket.setTimeout(0); - socket.setNoDelay(true); - try { - socket.write(headers.concat('', '').join('\r\n')); - } - catch (e) { - // if the upgrade write fails, shut the connection down hard - try { socket.destroy(); } catch (e) {} - return; - } - - var client = new WebSocket([req, socket, upgradeHead], { - protocolVersion: version, - protocol: protocol - }); - - if (self.options.clientTracking) { - self.clients.push(client); - client.on('close', function() { - var index = self.clients.indexOf(client); - if (index != -1) { - self.clients.splice(index, 1); - } - }); - } - - // signal upgrade complete - socket.removeListener('error', errorHandler); - cb(client); - } - - // optionally call external protocol selection handler before - // calling completeHybiUpgrade2 - var completeHybiUpgrade1 = function() { - // choose from the sub-protocols - if (typeof self.options.handleProtocols == 'function') { - var protList = (protocols || "").split(/, */); - var callbackCalled = false; - var res = self.options.handleProtocols(protList, function(result, protocol) { - callbackCalled = true; - if (!result) abortConnection(socket, 404, 'Unauthorized') - else completeHybiUpgrade2(protocol); - }); - if (!callbackCalled) { - // the handleProtocols handler never called our callback - abortConnection(socket, 501, 'Could not process protocols'); - } - return; - } else { - if (typeof protocols !== 'undefined') { - completeHybiUpgrade2(protocols.split(/, */)[0]); - } - else { - completeHybiUpgrade2(); - } - } - } - - // optionally call external client verification handler - if (typeof this.options.verifyClient == 'function') { - var info = { - origin: origin, - secure: typeof req.connection.authorized !== 'undefined' || typeof req.connection.encrypted !== 'undefined', - req: req - }; - if (this.options.verifyClient.length == 2) { - this.options.verifyClient(info, function(result, code, name) { - if (typeof code === 'undefined') code = 401; - if (typeof name === 'undefined') name = http.STATUS_CODES[code]; - - if (!result) abortConnection(socket, code, name); - else completeHybiUpgrade1(); - }); - return; - } - else if (!this.options.verifyClient(info)) { - abortConnection(socket, 401, 'Unauthorized'); - return; - } - } - - completeHybiUpgrade1(); -} - -function handleHixieUpgrade(req, socket, upgradeHead, cb) { - // handle premature socket errors - var errorHandler = function() { - try { socket.destroy(); } catch (e) {} - } - socket.on('error', errorHandler); - - // bail if options prevent hixie - if (this.options.disableHixie) { - abortConnection(socket, 401, 'Hixie support disabled'); - return; - } - - // verify key presence - if (!req.headers['sec-websocket-key2']) { - abortConnection(socket, 400, 'Bad Request'); - return; - } - - var origin = req.headers['origin'] - , self = this; - - // setup handshake completion to run after client has been verified - var onClientVerified = function() { - var wshost; - if (!req.headers['x-forwarded-host']) - wshost = req.headers.host; - else - wshost = req.headers['x-forwarded-host']; - var location = ((req.headers['x-forwarded-proto'] === 'https' || socket.encrypted) ? 'wss' : 'ws') + '://' + wshost + req.url - , protocol = req.headers['sec-websocket-protocol']; - - // handshake completion code to run once nonce has been successfully retrieved - var completeHandshake = function(nonce, rest) { - // calculate key - var k1 = req.headers['sec-websocket-key1'] - , k2 = req.headers['sec-websocket-key2'] - , md5 = crypto.createHash('md5'); - - [k1, k2].forEach(function (k) { - var n = parseInt(k.replace(/[^\d]/g, '')) - , spaces = k.replace(/[^ ]/g, '').length; - if (spaces === 0 || n % spaces !== 0){ - abortConnection(socket, 400, 'Bad Request'); - return; - } - n /= spaces; - md5.update(String.fromCharCode( - n >> 24 & 0xFF, - n >> 16 & 0xFF, - n >> 8 & 0xFF, - n & 0xFF)); - }); - md5.update(nonce.toString('binary')); - - var headers = [ - 'HTTP/1.1 101 Switching Protocols' - , 'Upgrade: WebSocket' - , 'Connection: Upgrade' - , 'Sec-WebSocket-Location: ' + location - ]; - if (typeof protocol != 'undefined') headers.push('Sec-WebSocket-Protocol: ' + protocol); - if (typeof origin != 'undefined') headers.push('Sec-WebSocket-Origin: ' + origin); - - socket.setTimeout(0); - socket.setNoDelay(true); - try { - // merge header and hash buffer - var headerBuffer = new Buffer(headers.concat('', '').join('\r\n')); - var hashBuffer = new Buffer(md5.digest('binary'), 'binary'); - var handshakeBuffer = new Buffer(headerBuffer.length + hashBuffer.length); - headerBuffer.copy(handshakeBuffer, 0); - hashBuffer.copy(handshakeBuffer, headerBuffer.length); - - // do a single write, which - upon success - causes a new client websocket to be setup - socket.write(handshakeBuffer, 'binary', function(err) { - if (err) return; // do not create client if an error happens - var client = new WebSocket([req, socket, rest], { - protocolVersion: 'hixie-76', - protocol: protocol - }); - if (self.options.clientTracking) { - self.clients.push(client); - client.on('close', function() { - var index = self.clients.indexOf(client); - if (index != -1) { - self.clients.splice(index, 1); - } - }); - } - - // signal upgrade complete - socket.removeListener('error', errorHandler); - cb(client); - }); - } - catch (e) { - try { socket.destroy(); } catch (e) {} - return; - } - } - - // retrieve nonce - var nonceLength = 8; - if (upgradeHead && upgradeHead.length >= nonceLength) { - var nonce = upgradeHead.slice(0, nonceLength); - var rest = upgradeHead.length > nonceLength ? upgradeHead.slice(nonceLength) : null; - completeHandshake.call(self, nonce, rest); - } - else { - // nonce not present in upgradeHead, so we must wait for enough data - // data to arrive before continuing - var nonce = new Buffer(nonceLength); - upgradeHead.copy(nonce, 0); - var received = upgradeHead.length; - var rest = null; - var handler = function (data) { - var toRead = Math.min(data.length, nonceLength - received); - if (toRead === 0) return; - data.copy(nonce, received, 0, toRead); - received += toRead; - if (received == nonceLength) { - socket.removeListener('data', handler); - if (toRead < data.length) rest = data.slice(toRead); - completeHandshake.call(self, nonce, rest); - } - } - socket.on('data', handler); - } - } - - // verify client - if (typeof this.options.verifyClient == 'function') { - var info = { - origin: origin, - secure: typeof req.connection.authorized !== 'undefined' || typeof req.connection.encrypted !== 'undefined', - req: req - }; - if (this.options.verifyClient.length == 2) { - var self = this; - this.options.verifyClient(info, function(result, code, name) { - if (typeof code === 'undefined') code = 401; - if (typeof name === 'undefined') name = http.STATUS_CODES[code]; - - if (!result) abortConnection(socket, code, name); - else onClientVerified.apply(self); - }); - return; - } - else if (!this.options.verifyClient(info)) { - abortConnection(socket, 401, 'Unauthorized'); - return; - } - } - - // no client verification required - onClientVerified(); -} - -function abortConnection(socket, code, name) { - try { - var response = [ - 'HTTP/1.1 ' + code + ' ' + name, - 'Content-type: text/html' - ]; - socket.write(response.concat('', '').join('\r\n')); - } - catch (e) { /* ignore errors - we've aborted this connection */ } - finally { - // ensure that an early aborted connection is shut down completely - try { socket.destroy(); } catch (e) {} - } -} diff --git a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/lib/browser.js b/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/lib/browser.js deleted file mode 100644 index 8d3a755cd57..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/lib/browser.js +++ /dev/null @@ -1,43 +0,0 @@ - -/** - * Module dependencies. - */ - -var global = (function() { return this; })(); - -/** - * WebSocket constructor. - */ - -var WebSocket = global.WebSocket || global.MozWebSocket; - -/** - * Module exports. - */ - -module.exports = WebSocket ? ws : null; - -/** - * WebSocket constructor. - * - * The third `opts` options object gets ignored in web browsers, since it's - * non-standard, and throws a TypeError if passed to the constructor. - * See: https://github.com/einaros/ws/issues/227 - * - * @param {String} uri - * @param {Array} protocols (optional) - * @param {Object) opts (optional) - * @api public - */ - -function ws(uri, protocols, opts) { - var instance; - if (protocols) { - instance = new WebSocket(uri, protocols); - } else { - instance = new WebSocket(uri); - } - return instance; -} - -if (WebSocket) ws.prototype = WebSocket.prototype; diff --git a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/commander/Readme.md b/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/commander/Readme.md deleted file mode 100644 index d1644012c51..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/commander/Readme.md +++ /dev/null @@ -1,195 +0,0 @@ -# Commander.js - - The complete solution for [node.js](http://nodejs.org) command-line interfaces, inspired by Ruby's [commander](https://github.com/visionmedia/commander). - - [![Build Status](https://secure.travis-ci.org/visionmedia/commander.js.png)](http://travis-ci.org/visionmedia/commander.js) - -## Installation - - $ npm install commander - -## Option parsing - - Options with commander are defined with the `.option()` method, also serving as documentation for the options. The example below parses args and options from `process.argv`, leaving remaining args as the `program.args` array which were not consumed by options. - -```js -#!/usr/bin/env node - -/** - * Module dependencies. - */ - -var program = require('commander'); - -program - .version('0.0.1') - .option('-p, --peppers', 'Add peppers') - .option('-P, --pineapple', 'Add pineapple') - .option('-b, --bbq', 'Add bbq sauce') - .option('-c, --cheese [type]', 'Add the specified type of cheese [marble]', 'marble') - .parse(process.argv); - -console.log('you ordered a pizza with:'); -if (program.peppers) console.log(' - peppers'); -if (program.pineapple) console.log(' - pineapple'); -if (program.bbq) console.log(' - bbq'); -console.log(' - %s cheese', program.cheese); -``` - - Short flags may be passed as a single arg, for example `-abc` is equivalent to `-a -b -c`. Multi-word options such as "--template-engine" are camel-cased, becoming `program.templateEngine` etc. - -## Automated --help - - The help information is auto-generated based on the information commander already knows about your program, so the following `--help` info is for free: - -``` - $ ./examples/pizza --help - - Usage: pizza [options] - - Options: - - -V, --version output the version number - -p, --peppers Add peppers - -P, --pineapple Add pineapple - -b, --bbq Add bbq sauce - -c, --cheese Add the specified type of cheese [marble] - -h, --help output usage information - -``` - -## Coercion - -```js -function range(val) { - return val.split('..').map(Number); -} - -function list(val) { - return val.split(','); -} - -program - .version('0.0.1') - .usage('[options] ') - .option('-i, --integer ', 'An integer argument', parseInt) - .option('-f, --float ', 'A float argument', parseFloat) - .option('-r, --range ..', 'A range', range) - .option('-l, --list ', 'A list', list) - .option('-o, --optional [value]', 'An optional value') - .parse(process.argv); - -console.log(' int: %j', program.integer); -console.log(' float: %j', program.float); -console.log(' optional: %j', program.optional); -program.range = program.range || []; -console.log(' range: %j..%j', program.range[0], program.range[1]); -console.log(' list: %j', program.list); -console.log(' args: %j', program.args); -``` - -## Custom help - - You can display arbitrary `-h, --help` information - by listening for "--help". Commander will automatically - exit once you are done so that the remainder of your program - does not execute causing undesired behaviours, for example - in the following executable "stuff" will not output when - `--help` is used. - -```js -#!/usr/bin/env node - -/** - * Module dependencies. - */ - -var program = require('../'); - -function list(val) { - return val.split(',').map(Number); -} - -program - .version('0.0.1') - .option('-f, --foo', 'enable some foo') - .option('-b, --bar', 'enable some bar') - .option('-B, --baz', 'enable some baz'); - -// must be before .parse() since -// node's emit() is immediate - -program.on('--help', function(){ - console.log(' Examples:'); - console.log(''); - console.log(' $ custom-help --help'); - console.log(' $ custom-help -h'); - console.log(''); -}); - -program.parse(process.argv); - -console.log('stuff'); -``` - -yielding the following help output: - -``` - -Usage: custom-help [options] - -Options: - - -h, --help output usage information - -V, --version output the version number - -f, --foo enable some foo - -b, --bar enable some bar - -B, --baz enable some baz - -Examples: - - $ custom-help --help - $ custom-help -h - -``` - -## .outputHelp() - - Output help information without exiting. - -## .help() - - Output help information and exit immediately. - -## Links - - - [API documentation](http://visionmedia.github.com/commander.js/) - - [ascii tables](https://github.com/LearnBoost/cli-table) - - [progress bars](https://github.com/visionmedia/node-progress) - - [more progress bars](https://github.com/substack/node-multimeter) - - [examples](https://github.com/visionmedia/commander.js/tree/master/examples) - -## License - -(The MIT License) - -Copyright (c) 2011 TJ Holowaychuk <tj@vision-media.ca> - -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/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/commander/index.js b/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/commander/index.js deleted file mode 100644 index 790a7519bdc..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/commander/index.js +++ /dev/null @@ -1,851 +0,0 @@ - -/** - * Module dependencies. - */ - -var EventEmitter = require('events').EventEmitter; -var spawn = require('child_process').spawn; -var fs = require('fs'); -var exists = fs.existsSync; -var path = require('path'); -var dirname = path.dirname; -var basename = path.basename; - -/** - * Expose the root command. - */ - -exports = module.exports = new Command; - -/** - * Expose `Command`. - */ - -exports.Command = Command; - -/** - * Expose `Option`. - */ - -exports.Option = Option; - -/** - * Initialize a new `Option` with the given `flags` and `description`. - * - * @param {String} flags - * @param {String} description - * @api public - */ - -function Option(flags, description) { - this.flags = flags; - this.required = ~flags.indexOf('<'); - this.optional = ~flags.indexOf('['); - this.bool = !~flags.indexOf('-no-'); - flags = flags.split(/[ ,|]+/); - if (flags.length > 1 && !/^[[<]/.test(flags[1])) this.short = flags.shift(); - this.long = flags.shift(); - this.description = description || ''; -} - -/** - * Return option name. - * - * @return {String} - * @api private - */ - -Option.prototype.name = function(){ - return this.long - .replace('--', '') - .replace('no-', ''); -}; - -/** - * Check if `arg` matches the short or long flag. - * - * @param {String} arg - * @return {Boolean} - * @api private - */ - -Option.prototype.is = function(arg){ - return arg == this.short - || arg == this.long; -}; - -/** - * Initialize a new `Command`. - * - * @param {String} name - * @api public - */ - -function Command(name) { - this.commands = []; - this.options = []; - this._execs = []; - this._args = []; - this._name = name; -} - -/** - * Inherit from `EventEmitter.prototype`. - */ - -Command.prototype.__proto__ = EventEmitter.prototype; - -/** - * Add command `name`. - * - * The `.action()` callback is invoked when the - * command `name` is specified via __ARGV__, - * and the remaining arguments are applied to the - * function for access. - * - * When the `name` is "*" an un-matched command - * will be passed as the first arg, followed by - * the rest of __ARGV__ remaining. - * - * Examples: - * - * program - * .version('0.0.1') - * .option('-C, --chdir ', 'change the working directory') - * .option('-c, --config ', 'set config path. defaults to ./deploy.conf') - * .option('-T, --no-tests', 'ignore test hook') - * - * program - * .command('setup') - * .description('run remote setup commands') - * .action(function(){ - * console.log('setup'); - * }); - * - * program - * .command('exec ') - * .description('run the given remote command') - * .action(function(cmd){ - * console.log('exec "%s"', cmd); - * }); - * - * program - * .command('*') - * .description('deploy the given env') - * .action(function(env){ - * console.log('deploying "%s"', env); - * }); - * - * program.parse(process.argv); - * - * @param {String} name - * @param {String} [desc] - * @return {Command} the new command - * @api public - */ - -Command.prototype.command = function(name, desc){ - var args = name.split(/ +/); - var cmd = new Command(args.shift()); - if (desc) cmd.description(desc); - if (desc) this.executables = true; - if (desc) this._execs[cmd._name] = true; - this.commands.push(cmd); - cmd.parseExpectedArgs(args); - cmd.parent = this; - if (desc) return this; - return cmd; -}; - -/** - * Add an implicit `help [cmd]` subcommand - * which invokes `--help` for the given command. - * - * @api private - */ - -Command.prototype.addImplicitHelpCommand = function() { - this.command('help [cmd]', 'display help for [cmd]'); -}; - -/** - * Parse expected `args`. - * - * For example `["[type]"]` becomes `[{ required: false, name: 'type' }]`. - * - * @param {Array} args - * @return {Command} for chaining - * @api public - */ - -Command.prototype.parseExpectedArgs = function(args){ - if (!args.length) return; - var self = this; - args.forEach(function(arg){ - switch (arg[0]) { - case '<': - self._args.push({ required: true, name: arg.slice(1, -1) }); - break; - case '[': - self._args.push({ required: false, name: arg.slice(1, -1) }); - break; - } - }); - return this; -}; - -/** - * Register callback `fn` for the command. - * - * Examples: - * - * program - * .command('help') - * .description('display verbose help') - * .action(function(){ - * // output help here - * }); - * - * @param {Function} fn - * @return {Command} for chaining - * @api public - */ - -Command.prototype.action = function(fn){ - var self = this; - this.parent.on(this._name, function(args, unknown){ - // Parse any so-far unknown options - unknown = unknown || []; - var parsed = self.parseOptions(unknown); - - // Output help if necessary - outputHelpIfNecessary(self, parsed.unknown); - - // If there are still any unknown options, then we simply - // die, unless someone asked for help, in which case we give it - // to them, and then we die. - if (parsed.unknown.length > 0) { - self.unknownOption(parsed.unknown[0]); - } - - // Leftover arguments need to be pushed back. Fixes issue #56 - if (parsed.args.length) args = parsed.args.concat(args); - - self._args.forEach(function(arg, i){ - if (arg.required && null == args[i]) { - self.missingArgument(arg.name); - } - }); - - // Always append ourselves to the end of the arguments, - // to make sure we match the number of arguments the user - // expects - if (self._args.length) { - args[self._args.length] = self; - } else { - args.push(self); - } - - fn.apply(this, args); - }); - return this; -}; - -/** - * Define option with `flags`, `description` and optional - * coercion `fn`. - * - * The `flags` string should contain both the short and long flags, - * separated by comma, a pipe or space. The following are all valid - * all will output this way when `--help` is used. - * - * "-p, --pepper" - * "-p|--pepper" - * "-p --pepper" - * - * Examples: - * - * // simple boolean defaulting to false - * program.option('-p, --pepper', 'add pepper'); - * - * --pepper - * program.pepper - * // => Boolean - * - * // simple boolean defaulting to false - * program.option('-C, --no-cheese', 'remove cheese'); - * - * program.cheese - * // => true - * - * --no-cheese - * program.cheese - * // => true - * - * // required argument - * program.option('-C, --chdir ', 'change the working directory'); - * - * --chdir /tmp - * program.chdir - * // => "/tmp" - * - * // optional argument - * program.option('-c, --cheese [type]', 'add cheese [marble]'); - * - * @param {String} flags - * @param {String} description - * @param {Function|Mixed} fn or default - * @param {Mixed} defaultValue - * @return {Command} for chaining - * @api public - */ - -Command.prototype.option = function(flags, description, fn, defaultValue){ - var self = this - , option = new Option(flags, description) - , oname = option.name() - , name = camelcase(oname); - - // default as 3rd arg - if ('function' != typeof fn) defaultValue = fn, fn = null; - - // preassign default value only for --no-*, [optional], or - if (false == option.bool || option.optional || option.required) { - // when --no-* we make sure default is true - if (false == option.bool) defaultValue = true; - // preassign only if we have a default - if (undefined !== defaultValue) self[name] = defaultValue; - } - - // register the option - this.options.push(option); - - // when it's passed assign the value - // and conditionally invoke the callback - this.on(oname, function(val){ - // coercion - if (null != val && fn) val = fn(val); - - // unassigned or bool - if ('boolean' == typeof self[name] || 'undefined' == typeof self[name]) { - // if no value, bool true, and we have a default, then use it! - if (null == val) { - self[name] = option.bool - ? defaultValue || true - : false; - } else { - self[name] = val; - } - } else if (null !== val) { - // reassign - self[name] = val; - } - }); - - return this; -}; - -/** - * Parse `argv`, settings options and invoking commands when defined. - * - * @param {Array} argv - * @return {Command} for chaining - * @api public - */ - -Command.prototype.parse = function(argv){ - // implicit help - if (this.executables) this.addImplicitHelpCommand(); - - // store raw args - this.rawArgs = argv; - - // guess name - this._name = this._name || basename(argv[1]); - - // process argv - var parsed = this.parseOptions(this.normalize(argv.slice(2))); - var args = this.args = parsed.args; - - var result = this.parseArgs(this.args, parsed.unknown); - - // executable sub-commands - var name = result.args[0]; - if (this._execs[name]) return this.executeSubCommand(argv, args, parsed.unknown); - - return result; -}; - -/** - * Execute a sub-command executable. - * - * @param {Array} argv - * @param {Array} args - * @param {Array} unknown - * @api private - */ - -Command.prototype.executeSubCommand = function(argv, args, unknown) { - args = args.concat(unknown); - - if (!args.length) this.help(); - if ('help' == args[0] && 1 == args.length) this.help(); - - // --help - if ('help' == args[0]) { - args[0] = args[1]; - args[1] = '--help'; - } - - // executable - var dir = dirname(argv[1]); - var bin = basename(argv[1]) + '-' + args[0]; - - // check for ./ first - var local = path.join(dir, bin); - - // run it - args = args.slice(1); - var proc = spawn(local, args, { stdio: 'inherit', customFds: [0, 1, 2] }); - proc.on('error', function(err){ - if (err.code == "ENOENT") { - console.error('\n %s(1) does not exist, try --help\n', bin); - } else if (err.code == "EACCES") { - console.error('\n %s(1) not executable. try chmod or run with root\n', bin); - } - }); - - this.runningCommand = proc; -}; - -/** - * Normalize `args`, splitting joined short flags. For example - * the arg "-abc" is equivalent to "-a -b -c". - * This also normalizes equal sign and splits "--abc=def" into "--abc def". - * - * @param {Array} args - * @return {Array} - * @api private - */ - -Command.prototype.normalize = function(args){ - var ret = [] - , arg - , lastOpt - , index; - - for (var i = 0, len = args.length; i < len; ++i) { - arg = args[i]; - i > 0 && (lastOpt = this.optionFor(args[i-1])); - - if (lastOpt && lastOpt.required) { - ret.push(arg); - } else if (arg.length > 1 && '-' == arg[0] && '-' != arg[1]) { - arg.slice(1).split('').forEach(function(c){ - ret.push('-' + c); - }); - } else if (/^--/.test(arg) && ~(index = arg.indexOf('='))) { - ret.push(arg.slice(0, index), arg.slice(index + 1)); - } else { - ret.push(arg); - } - } - - return ret; -}; - -/** - * Parse command `args`. - * - * When listener(s) are available those - * callbacks are invoked, otherwise the "*" - * event is emitted and those actions are invoked. - * - * @param {Array} args - * @return {Command} for chaining - * @api private - */ - -Command.prototype.parseArgs = function(args, unknown){ - var cmds = this.commands - , len = cmds.length - , name; - - if (args.length) { - name = args[0]; - if (this.listeners(name).length) { - this.emit(args.shift(), args, unknown); - } else { - this.emit('*', args); - } - } else { - outputHelpIfNecessary(this, unknown); - - // If there were no args and we have unknown options, - // then they are extraneous and we need to error. - if (unknown.length > 0) { - this.unknownOption(unknown[0]); - } - } - - return this; -}; - -/** - * Return an option matching `arg` if any. - * - * @param {String} arg - * @return {Option} - * @api private - */ - -Command.prototype.optionFor = function(arg){ - for (var i = 0, len = this.options.length; i < len; ++i) { - if (this.options[i].is(arg)) { - return this.options[i]; - } - } -}; - -/** - * Parse options from `argv` returning `argv` - * void of these options. - * - * @param {Array} argv - * @return {Array} - * @api public - */ - -Command.prototype.parseOptions = function(argv){ - var args = [] - , len = argv.length - , literal - , option - , arg; - - var unknownOptions = []; - - // parse options - for (var i = 0; i < len; ++i) { - arg = argv[i]; - - // literal args after -- - if ('--' == arg) { - literal = true; - continue; - } - - if (literal) { - args.push(arg); - continue; - } - - // find matching Option - option = this.optionFor(arg); - - // option is defined - if (option) { - // requires arg - if (option.required) { - arg = argv[++i]; - if (null == arg) return this.optionMissingArgument(option); - this.emit(option.name(), arg); - // optional arg - } else if (option.optional) { - arg = argv[i+1]; - if (null == arg || ('-' == arg[0] && '-' != arg)) { - arg = null; - } else { - ++i; - } - this.emit(option.name(), arg); - // bool - } else { - this.emit(option.name()); - } - continue; - } - - // looks like an option - if (arg.length > 1 && '-' == arg[0]) { - unknownOptions.push(arg); - - // If the next argument looks like it might be - // an argument for this option, we pass it on. - // If it isn't, then it'll simply be ignored - if (argv[i+1] && '-' != argv[i+1][0]) { - unknownOptions.push(argv[++i]); - } - continue; - } - - // arg - args.push(arg); - } - - return { args: args, unknown: unknownOptions }; -}; - -/** - * Argument `name` is missing. - * - * @param {String} name - * @api private - */ - -Command.prototype.missingArgument = function(name){ - console.error(); - console.error(" error: missing required argument `%s'", name); - console.error(); - process.exit(1); -}; - -/** - * `Option` is missing an argument, but received `flag` or nothing. - * - * @param {String} option - * @param {String} flag - * @api private - */ - -Command.prototype.optionMissingArgument = function(option, flag){ - console.error(); - if (flag) { - console.error(" error: option `%s' argument missing, got `%s'", option.flags, flag); - } else { - console.error(" error: option `%s' argument missing", option.flags); - } - console.error(); - process.exit(1); -}; - -/** - * Unknown option `flag`. - * - * @param {String} flag - * @api private - */ - -Command.prototype.unknownOption = function(flag){ - console.error(); - console.error(" error: unknown option `%s'", flag); - console.error(); - process.exit(1); -}; - - -/** - * Set the program version to `str`. - * - * This method auto-registers the "-V, --version" flag - * which will print the version number when passed. - * - * @param {String} str - * @param {String} flags - * @return {Command} for chaining - * @api public - */ - -Command.prototype.version = function(str, flags){ - if (0 == arguments.length) return this._version; - this._version = str; - flags = flags || '-V, --version'; - this.option(flags, 'output the version number'); - this.on('version', function(){ - console.log(str); - process.exit(0); - }); - return this; -}; - -/** - * Set the description `str`. - * - * @param {String} str - * @return {String|Command} - * @api public - */ - -Command.prototype.description = function(str){ - if (0 == arguments.length) return this._description; - this._description = str; - return this; -}; - -/** - * Set / get the command usage `str`. - * - * @param {String} str - * @return {String|Command} - * @api public - */ - -Command.prototype.usage = function(str){ - var args = this._args.map(function(arg){ - return arg.required - ? '<' + arg.name + '>' - : '[' + arg.name + ']'; - }); - - var usage = '[options' - + (this.commands.length ? '] [command' : '') - + ']' - + (this._args.length ? ' ' + args : ''); - - if (0 == arguments.length) return this._usage || usage; - this._usage = str; - - return this; -}; - -/** - * Return the largest option length. - * - * @return {Number} - * @api private - */ - -Command.prototype.largestOptionLength = function(){ - return this.options.reduce(function(max, option){ - return Math.max(max, option.flags.length); - }, 0); -}; - -/** - * Return help for options. - * - * @return {String} - * @api private - */ - -Command.prototype.optionHelp = function(){ - var width = this.largestOptionLength(); - - // Prepend the help information - return [pad('-h, --help', width) + ' ' + 'output usage information'] - .concat(this.options.map(function(option){ - return pad(option.flags, width) - + ' ' + option.description; - })) - .join('\n'); -}; - -/** - * Return command help documentation. - * - * @return {String} - * @api private - */ - -Command.prototype.commandHelp = function(){ - if (!this.commands.length) return ''; - return [ - '' - , ' Commands:' - , '' - , this.commands.map(function(cmd){ - var args = cmd._args.map(function(arg){ - return arg.required - ? '<' + arg.name + '>' - : '[' + arg.name + ']'; - }).join(' '); - - return pad(cmd._name - + (cmd.options.length - ? ' [options]' - : '') + ' ' + args, 22) - + (cmd.description() - ? ' ' + cmd.description() - : ''); - }).join('\n').replace(/^/gm, ' ') - , '' - ].join('\n'); -}; - -/** - * Return program help documentation. - * - * @return {String} - * @api private - */ - -Command.prototype.helpInformation = function(){ - return [ - '' - , ' Usage: ' + this._name + ' ' + this.usage() - , '' + this.commandHelp() - , ' Options:' - , '' - , '' + this.optionHelp().replace(/^/gm, ' ') - , '' - , '' - ].join('\n'); -}; - -/** - * Output help information for this command - * - * @api public - */ - -Command.prototype.outputHelp = function(){ - process.stdout.write(this.helpInformation()); - this.emit('--help'); -}; - -/** - * Output help information and exit. - * - * @api public - */ - -Command.prototype.help = function(){ - this.outputHelp(); - process.exit(); -}; - -/** - * Camel-case the given `flag` - * - * @param {String} flag - * @return {String} - * @api private - */ - -function camelcase(flag) { - return flag.split('-').reduce(function(str, word){ - return str + word[0].toUpperCase() + word.slice(1); - }); -} - -/** - * Pad `str` to `width`. - * - * @param {String} str - * @param {Number} width - * @return {String} - * @api private - */ - -function pad(str, width) { - var len = Math.max(0, width - str.length); - return str + Array(len + 1).join(' '); -} - -/** - * Output help information if necessary - * - * @param {Command} command to output help for - * @param {Array} array of options to search for -h or --help - * @api private - */ - -function outputHelpIfNecessary(cmd, options) { - options = options || []; - for (var i = 0; i < options.length; i++) { - if (options[i] == '--help' || options[i] == '-h') { - cmd.outputHelp(); - process.exit(0); - } - } -} diff --git a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/commander/package.json b/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/commander/package.json deleted file mode 100644 index bdafc5ca911..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/commander/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "commander", - "version": "2.1.0", - "description": "the complete solution for node.js command-line programs", - "keywords": [ - "command", - "option", - "parser", - "prompt", - "stdin" - ], - "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca" - }, - "repository": { - "type": "git", - "url": "https://github.com/visionmedia/commander.js.git" - }, - "devDependencies": { - "should": ">= 0.0.1" - }, - "scripts": { - "test": "make test" - }, - "main": "index", - "engines": { - "node": ">= 0.6.x" - }, - "files": [ - "index.js" - ], - "readme": "# Commander.js\n\n The complete solution for [node.js](http://nodejs.org) command-line interfaces, inspired by Ruby's [commander](https://github.com/visionmedia/commander).\n\n [![Build Status](https://secure.travis-ci.org/visionmedia/commander.js.png)](http://travis-ci.org/visionmedia/commander.js)\n\n## Installation\n\n $ npm install commander\n\n## Option parsing\n\n Options with commander are defined with the `.option()` method, also serving as documentation for the options. The example below parses args and options from `process.argv`, leaving remaining args as the `program.args` array which were not consumed by options.\n\n```js\n#!/usr/bin/env node\n\n/**\n * Module dependencies.\n */\n\nvar program = require('commander');\n\nprogram\n .version('0.0.1')\n .option('-p, --peppers', 'Add peppers')\n .option('-P, --pineapple', 'Add pineapple')\n .option('-b, --bbq', 'Add bbq sauce')\n .option('-c, --cheese [type]', 'Add the specified type of cheese [marble]', 'marble')\n .parse(process.argv);\n\nconsole.log('you ordered a pizza with:');\nif (program.peppers) console.log(' - peppers');\nif (program.pineapple) console.log(' - pineapple');\nif (program.bbq) console.log(' - bbq');\nconsole.log(' - %s cheese', program.cheese);\n```\n\n Short flags may be passed as a single arg, for example `-abc` is equivalent to `-a -b -c`. Multi-word options such as \"--template-engine\" are camel-cased, becoming `program.templateEngine` etc.\n\n## Automated --help\n\n The help information is auto-generated based on the information commander already knows about your program, so the following `--help` info is for free:\n\n``` \n $ ./examples/pizza --help\n\n Usage: pizza [options]\n\n Options:\n\n -V, --version output the version number\n -p, --peppers Add peppers\n -P, --pineapple Add pineapple\n -b, --bbq Add bbq sauce\n -c, --cheese Add the specified type of cheese [marble]\n -h, --help output usage information\n\n```\n\n## Coercion\n\n```js\nfunction range(val) {\n return val.split('..').map(Number);\n}\n\nfunction list(val) {\n return val.split(',');\n}\n\nprogram\n .version('0.0.1')\n .usage('[options] ')\n .option('-i, --integer ', 'An integer argument', parseInt)\n .option('-f, --float ', 'A float argument', parseFloat)\n .option('-r, --range ..', 'A range', range)\n .option('-l, --list ', 'A list', list)\n .option('-o, --optional [value]', 'An optional value')\n .parse(process.argv);\n\nconsole.log(' int: %j', program.integer);\nconsole.log(' float: %j', program.float);\nconsole.log(' optional: %j', program.optional);\nprogram.range = program.range || [];\nconsole.log(' range: %j..%j', program.range[0], program.range[1]);\nconsole.log(' list: %j', program.list);\nconsole.log(' args: %j', program.args);\n```\n\n## Custom help\n\n You can display arbitrary `-h, --help` information\n by listening for \"--help\". Commander will automatically\n exit once you are done so that the remainder of your program\n does not execute causing undesired behaviours, for example\n in the following executable \"stuff\" will not output when\n `--help` is used.\n\n```js\n#!/usr/bin/env node\n\n/**\n * Module dependencies.\n */\n\nvar program = require('../');\n\nfunction list(val) {\n return val.split(',').map(Number);\n}\n\nprogram\n .version('0.0.1')\n .option('-f, --foo', 'enable some foo')\n .option('-b, --bar', 'enable some bar')\n .option('-B, --baz', 'enable some baz');\n\n// must be before .parse() since\n// node's emit() is immediate\n\nprogram.on('--help', function(){\n console.log(' Examples:');\n console.log('');\n console.log(' $ custom-help --help');\n console.log(' $ custom-help -h');\n console.log('');\n});\n\nprogram.parse(process.argv);\n\nconsole.log('stuff');\n```\n\nyielding the following help output:\n\n```\n\nUsage: custom-help [options]\n\nOptions:\n\n -h, --help output usage information\n -V, --version output the version number\n -f, --foo enable some foo\n -b, --bar enable some bar\n -B, --baz enable some baz\n\nExamples:\n\n $ custom-help --help\n $ custom-help -h\n\n```\n\n## .outputHelp()\n\n Output help information without exiting.\n\n## .help()\n\n Output help information and exit immediately.\n\n## Links\n\n - [API documentation](http://visionmedia.github.com/commander.js/)\n - [ascii tables](https://github.com/LearnBoost/cli-table)\n - [progress bars](https://github.com/visionmedia/node-progress)\n - [more progress bars](https://github.com/substack/node-multimeter)\n - [examples](https://github.com/visionmedia/commander.js/tree/master/examples)\n\n## License \n\n(The MIT License)\n\nCopyright (c) 2011 TJ Holowaychuk <tj@vision-media.ca>\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n", - "readmeFilename": "Readme.md", - "bugs": { - "url": "https://github.com/visionmedia/commander.js/issues" - }, - "homepage": "https://github.com/visionmedia/commander.js", - "_id": "commander@2.1.0", - "_from": "commander@~2.1.0" -} diff --git a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/nan/.dntrc b/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/nan/.dntrc deleted file mode 100644 index 1c3e6243a30..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/nan/.dntrc +++ /dev/null @@ -1,36 +0,0 @@ -## DNT config file -## see https://github.com/rvagg/dnt - -NODE_VERSIONS="\ - master \ - v0.11.13 \ - v0.11.10 \ - v0.11.9 \ - v0.11.8 \ - v0.11.7 \ - v0.11.6 \ - v0.11.5 \ - v0.11.4 \ - v0.10.26 \ - v0.10.25 \ - v0.10.24 \ - v0.10.23 \ - v0.10.22 \ - v0.10.21 \ - v0.10.20 \ - v0.10.19 \ - v0.10.18 \ - v0.8.26 \ - v0.8.25 \ - v0.8.24 \ - v0.8.23 \ - v0.8.22 \ -" -OUTPUT_PREFIX="nan-" -TEST_CMD="\ - cd /dnt/test/ && \ - npm install && \ - node_modules/.bin/node-gyp --nodedir /usr/src/node/ rebuild && \ - node_modules/.bin/tap --gc js/*-test.js; \ -" - diff --git a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/nan/LICENSE b/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/nan/LICENSE deleted file mode 100644 index d502e18a193..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/nan/LICENSE +++ /dev/null @@ -1,46 +0,0 @@ -Copyright 2013, NAN contributors: - - Rod Vagg - - Benjamin Byholm - - Trevor Norris - - Nathan Rajlich - - Brett Lawson - - Ben Noordhuis -(the "Original Author") -All rights reserved. - -MIT +no-false-attribs 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. - -Distributions of all or part of the Software intended to be used -by the recipients as they would use the unmodified Software, -containing modifications that substantially alter, remove, or -disable functionality of the Software, outside of the documented -configuration mechanisms provided by the Software, shall be -modified such that the Original Author's bug reporting email -addresses and urls are either replaced with the contact information -of the parties responsible for the changes, or removed entirely. - -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. - - -Except where noted, this license applies to any and all software -programs and associated documentation files created by the -Original Author, when distributed with the Software. diff --git a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/nan/README.md b/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/nan/README.md deleted file mode 100644 index 7c8d6883f72..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/nan/README.md +++ /dev/null @@ -1,947 +0,0 @@ -Native Abstractions for Node.js -=============================== - -**A header file filled with macro and utility goodness for making add-on development for Node.js easier across versions 0.8, 0.10 and 0.11, and eventually 0.12.** - -***Current version: 1.0.0*** *(See [nan.h](https://github.com/rvagg/nan/blob/master/nan.h) for complete ChangeLog)* - -[![NPM](https://nodei.co/npm/nan.png?downloads=true)](https://nodei.co/npm/nan/) [![NPM](https://nodei.co/npm-dl/nan.png?months=6)](https://nodei.co/npm/nan/) - -Thanks to the crazy changes in V8 (and some in Node core), keeping native addons compiling happily across versions, particularly 0.10 to 0.11/0.12, is a minor nightmare. The goal of this project is to store all logic necessary to develop native Node.js addons without having to inspect `NODE_MODULE_VERSION` and get yourself into a macro-tangle. - -This project also contains some helper utilities that make addon development a bit more pleasant. - - * **[News & Updates](#news)** - * **[Usage](#usage)** - * **[Example](#example)** - * **[API](#api)** - - -## News & Updates - -### May-2013: Major changes for V8 3.25 / Node 0.11.13 - -Node 0.11.11 and 0.11.12 were both broken releases for native add-ons, you simply can't properly compile against either of them for different reasons. But we now have a 0.11.13 release that jumps a couple of versions of V8 ahead and includes some more, major (traumatic) API changes. - -Because we are now nearing Node 0.12 and estimate that the version of V8 we are using in Node 0.11.13 will be close to the API we get for 0.12, we have taken the opportunity to not only *fix* NAN for 0.11.13 but make some major changes to improve the NAN API. - -We have **removed support for Node 0.11 versions prior to 0.11.13**, (although our tests are still passing for 0.11.10). As usual, our tests are run against (and pass) the last 5 versions of Node 0.8 and Node 0.10. We also include Node 0.11.13 obviously. - -The major change is something that [Benjamin Byholm](kkoopa) has put many hours in to. We now have a fantastic new `NanNew(args)` interface for creating new `Local`s, this replaces `NanNewLocal()` and much more. If you look in [./nan.h](nan.h) you'll see a large number of overloaded versions of this method. In general you should be able to `NanNew(arguments)` for any type you want to make a `Local` from. This includes `Persistent` types, so we now have a `Local NanNew(const Persistent arg)` to replace `NanPersistentToLocal()`. - -We also now have `NanUndefined()`, `NanNull()`, `NanTrue()` and `NanFalse()`. Mainly because of the new requirement for an `Isolate` argument for each of the native V8 versions of this. - -V8 has now introduced an `EscapableHandleScope` from which you `scope.Escape(Local value)` to *return* a value from a one scope to another. This replaces the standard `HandleScope` and `scope.Close(Local value)`, although `HandleScope` still exists for when you don't need to return a handle to the caller. For NAN we are exposing it as `NanEscapableScope()` and `NanEscapeScope()`, while `NanScope()` is still how you create a new scope that doesn't need to return handles. For older versions of Node/V8, it'll still map to the older `HandleScope` functionality. - -`NanFromV8String()` was deprecated and has now been removed. You should use `NanCString()` or `NanRawString()` instead. - -Because `node::MakeCallback()` now takes an `Isolate`, and because it doesn't exist in older versions of Node, we've introduced `NanMakeCallabck()`. You should *always* use this when calling a JavaScript function from C++. - -There's lots more, check out the Changelog in nan.h or look through [#86](https://github.com/rvagg/nan/pull/86) for all the gory details. - -### Dec-2013: NanCString and NanRawString - -Two new functions have been introduced to replace the functionality that's been provided by `NanFromV8String` until now. NanCString has sensible defaults so it's super easy to fetch a null-terminated c-style string out of a `v8::String`. `NanFromV8String` is still around and has defaults that allow you to pass a single handle to fetch a `char*` while `NanRawString` requires a little more attention to arguments. - -### Nov-2013: Node 0.11.9+ breaking V8 change - -The version of V8 that's shipping with Node 0.11.9+ has changed the signature for new `Local`s to: `v8::Local::New(isolate, value)`, i.e. introducing the `isolate` argument and therefore breaking all new `Local` declarations for previous versions. NAN 0.6+ now includes a `NanNewLocal(value)` that can be used in place to work around this incompatibility and maintain compatibility with 0.8->0.11.9+ (minus a few early 0.11 releases). - -For example, if you wanted to return a `null` on a callback you will have to change the argument from `v8::Local::New(v8::Null())` to `NanNewLocal(v8::Null())`. - -### Nov-2013: Change to binding.gyp `"include_dirs"` for NAN - -Inclusion of NAN in a project's binding.gyp is now greatly simplified. You can now just use `" -## Usage - -Simply add **NAN** as a dependency in the *package.json* of your Node addon: - -``` bash -$ npm install --save nan -``` - -Pull in the path to **NAN** in your *binding.gyp* so that you can use `#include ` in your *.cpp* files: - -``` python -"include_dirs" : [ - "` when compiling your addon. - - -## Example - -See **[LevelDOWN](https://github.com/rvagg/node-leveldown/pull/48)** for a full example of **NAN** in use. - -For a simpler example, see the **[async pi estimation example](https://github.com/rvagg/nan/tree/master/examples/async_pi_estimate)** in the examples directory for full code and an explanation of what this Monte Carlo Pi estimation example does. Below are just some parts of the full example that illustrate the use of **NAN**. - -Compare to the current 0.10 version of this example, found in the [node-addon-examples](https://github.com/rvagg/node-addon-examples/tree/master/9_async_work) repository and also a 0.11 version of the same found [here](https://github.com/kkoopa/node-addon-examples/tree/5c01f58fc993377a567812597e54a83af69686d7/9_async_work). - -Note that there is no embedded version sniffing going on here and also the async work is made much simpler, see below for details on the `NanAsyncWorker` class. - -```c++ -// addon.cc -#include -#include -// ... - -using v8::FunctionTemplate; -using v8::Handle; -using v8::Object; - -void InitAll(Handle exports) { - exports->Set(NanSymbol("calculateSync"), - NanNew(CalculateSync)->GetFunction()); - - exports->Set(NanSymbol("calculateAsync"), - NanNew(CalculateAsync)->GetFunction()); -} - -NODE_MODULE(addon, InitAll) -``` - -```c++ -// sync.h -#include -#include - -NAN_METHOD(CalculateSync); -``` - -```c++ -// sync.cc -#include -#include -#include "./sync.h" -// ... - -using v8::Number; - -// Simple synchronous access to the `Estimate()` function -NAN_METHOD(CalculateSync) { - NanScope(); - - // expect a number as the first argument - int points = args[0]->Uint32Value(); - double est = Estimate(points); - - NanReturnValue(NanNew(est)); -} -``` - -```c++ -// async.cc -#include -#include -#include "./async.h" - -// ... - -using v8::Function; -using v8::Local; -using v8::Null; -using v8::Number; -using v8::Value; - -class PiWorker : public NanAsyncWorker { - public: - PiWorker(NanCallback *callback, int points) - : NanAsyncWorker(callback), points(points) {} - ~PiWorker() {} - - // Executed inside the worker-thread. - // It is not safe to access V8, or V8 data structures - // here, so everything we need for input and output - // should go on `this`. - void Execute () { - estimate = Estimate(points); - } - - // Executed when the async work is complete - // this function will be run inside the main event loop - // so it is safe to use V8 again - void HandleOKCallback () { - NanScope(); - - Local argv[] = { - NanNew(NanNull()) - , NanNew(estimate) - }; - - callback->Call(2, argv); - }; - - private: - int points; - double estimate; -}; - -// Asynchronous access to the `Estimate()` function -NAN_METHOD(CalculateAsync) { - NanScope(); - - int points = args[0]->Uint32Value(); - NanCallback *callback = new NanCallback(args[1].As()); - - NanAsyncQueueWorker(new PiWorker(callback, points)); - NanReturnUndefined(); -} -``` - - -## API - - * NAN_METHOD - * NAN_GETTER - * NAN_SETTER - * NAN_PROPERTY_GETTER - * NAN_PROPERTY_SETTER - * NAN_PROPERTY_ENUMERATOR - * NAN_PROPERTY_DELETER - * NAN_PROPERTY_QUERY - * NAN_INDEX_GETTER - * NAN_INDEX_SETTER - * NAN_INDEX_ENUMERATOR - * NAN_INDEX_DELETER - * NAN_INDEX_QUERY - * NAN_WEAK_CALLBACK - * NAN_DEPRECATED - * NAN_INLINE - * NanNew - * NanUndefined - * NanNull - * NanTrue - * NanFalse - * NanReturnValue - * NanReturnUndefined - * NanReturnNull - * NanReturnEmptyString - * NanScope - * NanEscapableScope - * NanEscapeScope - * NanLocker - * NanUnlocker - * NanGetInternalFieldPointer - * NanSetInternalFieldPointer - * NanObjectWrapHandle - * NanSymbol - * NanGetPointerSafe - * NanSetPointerSafe - * NanRawString - * NanCString - * NanBooleanOptionValue - * NanUInt32OptionValue - * NanError, NanTypeError, NanRangeError - * NanThrowError, NanThrowTypeError, NanThrowRangeError, NanThrowError(Handle), NanThrowError(Handle, int) - * NanNewBufferHandle(char *, size_t, FreeCallback, void *), NanNewBufferHandle(char *, uint32_t), NanNewBufferHandle(uint32_t) - * NanBufferUse(char *, uint32_t) - * NanNewContextHandle - * NanGetCurrentContext - * NanHasInstance - * NanDisposePersistent - * NanAssignPersistent - * NanMakeWeakPersistent - * NanSetTemplate - * NanMakeCallback - * NanCompileScript - * NanRunScript - * NanAdjustExternalMemory - * NanAddGCEpilogueCallback - * NanAddGCPrologueCallback - * NanRemoveGCEpilogueCallback - * NanRemoveGCPrologueCallback - * NanGetHeapStatistics - * NanCallback - * NanAsyncWorker - * NanAsyncQueueWorker - - -### NAN_METHOD(methodname) - -Use `NAN_METHOD` to define your V8 accessible methods: - -```c++ -// .h: -class Foo : public node::ObjectWrap { - ... - - static NAN_METHOD(Bar); - static NAN_METHOD(Baz); -} - - -// .cc: -NAN_METHOD(Foo::Bar) { - ... -} - -NAN_METHOD(Foo::Baz) { - ... -} -``` - -The reason for this macro is because of the method signature change in 0.11: - -```c++ -// 0.10 and below: -Handle name(const Arguments& args) - -// 0.11 and above -void name(const FunctionCallbackInfo& args) -``` - -The introduction of `FunctionCallbackInfo` brings additional complications: - - -### NAN_GETTER(methodname) - -Use `NAN_GETTER` to declare your V8 accessible getters. You get a `Local` `property` and an appropriately typed `args` object that can act like the `args` argument to a `NAN_METHOD` call. - -You can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_GETTER`. - - -### NAN_SETTER(methodname) - -Use `NAN_SETTER` to declare your V8 accessible setters. Same as `NAN_GETTER` but you also get a `Local` `value` object to work with. - - -### NAN_PROPERTY_GETTER(cbname) -Use `NAN_PROPERTY_GETTER` to declare your V8 accessible property getters. You get a `Local` `property` and an appropriately typed `args` object that can act similar to the `args` argument to a `NAN_METHOD` call. - -You can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_PROPERTY_GETTER`. - - -### NAN_PROPERTY_SETTER(cbname) -Use `NAN_PROPERTY_SETTER` to declare your V8 accessible property setters. Same as `NAN_PROPERTY_GETTER` but you also get a `Local` `value` object to work with. - - -### NAN_PROPERTY_ENUMERATOR(cbname) -Use `NAN_PROPERTY_ENUMERATOR` to declare your V8 accessible property enumerators. You get an appropriately typed `args` object like the `args` argument to a `NAN_PROPERTY_GETTER` call. - -You can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_PROPERTY_ENUMERATOR`. - - -### NAN_PROPERTY_DELETER(cbname) -Use `NAN_PROPERTY_DELETER` to declare your V8 accessible property deleters. Same as `NAN_PROPERTY_GETTER`. - -You can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_PROPERTY_DELETER`. - - -### NAN_PROPERTY_QUERY(cbname) -Use `NAN_PROPERTY_QUERY` to declare your V8 accessible property queries. Same as `NAN_PROPERTY_GETTER`. - -You can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_PROPERTY_QUERY`. - - -### NAN_INDEX_GETTER(cbname) -Use `NAN_INDEX_GETTER` to declare your V8 accessible index getters. You get a `uint32_t` `index` and an appropriately typed `args` object that can act similar to the `args` argument to a `NAN_METHOD` call. - -You can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_INDEX_GETTER`. - - -### NAN_INDEX_SETTER(cbname) -Use `NAN_INDEX_SETTER` to declare your V8 accessible index setters. Same as `NAN_INDEX_GETTER` but you also get a `Local` `value` object to work with. - - -### NAN_INDEX_ENUMERATOR(cbname) -Use `NAN_INDEX_ENUMERATOR` to declare your V8 accessible index enumerators. You get an appropriately typed `args` object like the `args` argument to a `NAN_INDEX_GETTER` call. - -You can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_INDEX_ENUMERATOR`. - - -### NAN_INDEX_DELETER(cbname) -Use `NAN_INDEX_DELETER` to declare your V8 accessible index deleters. Same as `NAN_INDEX_GETTER`. - -You can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_INDEX_DELETER`. - - -### NAN_INDEX_QUERY(cbname) -Use `NAN_INDEX_QUERY` to declare your V8 accessible index queries. Same as `NAN_INDEX_GETTER`. - -You can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_INDEX_QUERY`. - - -### NAN_WEAK_CALLBACK(cbname) - -Use `NAN_WEAK_CALLBACK` to define your V8 WeakReference callbacks. Do not use for declaration. There is an argument object `const _NanWeakCallbackData &data` allowing access to the weak object and the supplied parameter through its `GetValue` and `GetParameter` methods. - -```c++ -NAN_WEAK_CALLBACK(weakCallback) { - int *parameter = data.GetParameter(); - NanMakeCallback(NanGetCurrentContext()->Global(), data.GetValue(), 0, NULL); - if ((*parameter)++ == 0) { - data.Revive(); - } else { - delete parameter; - data.Dispose(); - } -} -``` - - -### NAN_DEPRECATED -Declares a function as deprecated. - -```c++ -static NAN_DEPRECATED NAN_METHOD(foo) { - ... -} -``` - - -### NAN_INLINE -Inlines a function. - -```c++ -NAN_INLINE int foo(int bar) { - ... -} -``` - - -### Local<T> NanNew<T>( ... ) - -Use `NanNew` to construct almost all v8 objects and make new local handles. - -```c++ -Local s = NanNew("value"); - -... - -Persistent o; - -... - -Local lo = NanNew(o); - -``` - - -### Handle<Primitive> NanUndefined() - -Use instead of `Undefined()` - - -### Handle<Primitive> NanNull() - -Use instead of `Null()` - - -### Handle<Primitive> NanTrue() - -Use instead of `True()` - - -### Handle<Primitive> NanFalse() - -Use instead of `False()` - - -### NanReturnValue(Handle<Value>) - -Use `NanReturnValue` when you want to return a value from your V8 accessible method: - -```c++ -NAN_METHOD(Foo::Bar) { - ... - - NanReturnValue(NanNew("FooBar!")); -} -``` - -No `return` statement required. - - -### NanReturnUndefined() - -Use `NanReturnUndefined` when you don't want to return anything from your V8 accessible method: - -```c++ -NAN_METHOD(Foo::Baz) { - ... - - NanReturnUndefined(); -} -``` - - -### NanReturnNull() - -Use `NanReturnNull` when you want to return `Null` from your V8 accessible method: - -```c++ -NAN_METHOD(Foo::Baz) { - ... - - NanReturnNull(); -} -``` - - -### NanReturnEmptyString() - -Use `NanReturnEmptyString` when you want to return an empty `String` from your V8 accessible method: - -```c++ -NAN_METHOD(Foo::Baz) { - ... - - NanReturnEmptyString(); -} -``` - - -### NanScope() - -The introduction of `isolate` references for many V8 calls in Node 0.11 makes `NanScope()` necessary, use it in place of `HandleScope scope`: - -```c++ -NAN_METHOD(Foo::Bar) { - NanScope(); - - NanReturnValue(NanNew("FooBar!")); -} -``` - - -### NanEscapableScope() - -The separation of handle scopes into escapable and inescapable scopes makes `NanEscapableScope()` necessary, use it in place of `HandleScope scope` when you later wish to `Close()` the scope: - -```c++ -Handle Foo::Bar() { - NanEscapableScope(); - - return NanEscapeScope(NanNew("FooBar!")); -} -``` - - -### Local<T> NanEscapeScope(Handle<T> value); -Use together with `NanEscapableScope` to escape the scope. Corresponds to `HandleScope::Close` or `EscapableHandleScope::Escape`. - - -### NanLocker() - -The introduction of `isolate` references for many V8 calls in Node 0.11 makes `NanLocker()` necessary, use it in place of `Locker locker`: - -```c++ -NAN_METHOD(Foo::Bar) { - NanLocker(); - ... - NanUnlocker(); -} -``` - - -### NanUnlocker() - -The introduction of `isolate` references for many V8 calls in Node 0.11 makes `NanUnlocker()` necessary, use it in place of `Unlocker unlocker`: - -```c++ -NAN_METHOD(Foo::Bar) { - NanLocker(); - ... - NanUnlocker(); -} -``` - - -### void * NanGetInternalFieldPointer(Handle<Object>, int) - -Gets a pointer to the internal field with at `index` from a V8 `Object` handle. - -```c++ -Local obj; -... -NanGetInternalFieldPointer(obj, 0); -``` - -### void NanSetInternalFieldPointer(Handle<Object>, int, void *) - -Sets the value of the internal field at `index` on a V8 `Object` handle. - -```c++ -static Persistent dataWrapperCtor; -... -Local wrapper = NanPersistentToLocal(dataWrapperCtor)->NewInstance(); -NanSetInternalFieldPointer(wrapper, 0, this); -``` - - -### Local<Object> NanObjectWrapHandle(Object) - -When you want to fetch the V8 object handle from a native object you've wrapped with Node's `ObjectWrap`, you should use `NanObjectWrapHandle`: - -```c++ -NanObjectWrapHandle(iterator)->Get(NanSymbol("end")) -``` - - -### String NanSymbol(char *) - -Use to create string symbol objects (i.e. `v8::String::NewSymbol(x)`), for getting and setting object properties, or names of objects. - -```c++ -bool foo = false; -if (obj->Has(NanSymbol("foo"))) - foo = optionsObj->Get(NanSymbol("foo"))->BooleanValue() -``` - - -### Type NanGetPointerSafe(Type *[, Type]) - -A helper for getting values from optional pointers. If the pointer is `NULL`, the function returns the optional default value, which defaults to `0`. Otherwise, the function returns the value the pointer points to. - -```c++ -char *plugh(uint32_t *optional) { - char res[] = "xyzzy"; - uint32_t param = NanGetPointerSafe(optional, 0x1337); - switch (param) { - ... - } - NanSetPointerSafe(optional, 0xDEADBEEF); -} -``` - - -### bool NanSetPointerSafe(Type *, Type) - -A helper for setting optional argument pointers. If the pointer is `NULL`, the function simply returns `false`. Otherwise, the value is assigned to the variable the pointer points to. - -```c++ -const char *plugh(size_t *outputsize) { - char res[] = "xyzzy"; - if !(NanSetPointerSafe(outputsize, strlen(res) + 1)) { - ... - } - - ... -} -``` - - -### void* NanRawString(Handle<Value>, enum Nan::Encoding, size_t *, void *, size_t, int) - -When you want to convert a V8 `String` to a `char*` buffer, use `NanRawString`. You have to supply an encoding as well as a pointer to a variable that will be assigned the number of bytes in the returned string. It is also possible to supply a buffer and its length to the function in order not to have a new buffer allocated. The final argument allows setting `String::WriteOptions`. -Just remember that you'll end up with an object that you'll need to `delete[]` at some point unless you supply your own buffer: - -```c++ -size_t count; -void* decoded = NanRawString(args[1], Nan::BASE64, &count, NULL, 0, String::HINT_MANY_WRITES_EXPECTED); -char param_copy[count]; -memcpy(param_copy, decoded, count); -delete[] decoded; -``` - - -### char* NanCString(Handle<Value>, size_t *[, char *, size_t, int]) - -When you want to convert a V8 `String` to a null-terminated C `char*` use `NanCString`. The resulting `char*` will be UTF-8-encoded, and you need to supply a pointer to a variable that will be assigned the number of bytes in the returned string. It is also possible to supply a buffer and its length to the function in order not to have a new buffer allocated. The final argument allows optionally setting `String::WriteOptions`, which default to `v8::String::NO_OPTIONS`. -Just remember that you'll end up with an object that you'll need to `delete[]` at some point unless you supply your own buffer: - -```c++ -size_t count; -char* name = NanCString(args[0], &count); -``` - - -### bool NanBooleanOptionValue(Handle<Value>, Handle<String>[, bool]) - -When you have an "options" object that you need to fetch properties from, boolean options can be fetched with this pair. They check first if the object exists (`IsEmpty`), then if the object has the given property (`Has`) then they get and convert/coerce the property to a `bool`. - -The optional last parameter is the *default* value, which is `false` if left off: - -```c++ -// `foo` is false unless the user supplies a truthy value for it -bool foo = NanBooleanOptionValue(optionsObj, NanSymbol("foo")); -// `bar` is true unless the user supplies a falsy value for it -bool bar = NanBooleanOptionValueDefTrue(optionsObj, NanSymbol("bar"), true); -``` - - -### uint32_t NanUInt32OptionValue(Handle<Value>, Handle<String>, uint32_t) - -Similar to `NanBooleanOptionValue`, use `NanUInt32OptionValue` to fetch an integer option from your options object. Can be any kind of JavaScript `Number` and it will be coerced to an unsigned 32-bit integer. - -Requires all 3 arguments as a default is not optional: - -```c++ -uint32_t count = NanUInt32OptionValue(optionsObj, NanSymbol("count"), 1024); -``` - - -### NanError(message), NanTypeError(message), NanRangeError(message) - -For making `Error`, `TypeError` and `RangeError` objects. - -```c++ -Local res = NanError("you must supply a callback argument"); -``` - - -### NanThrowError(message), NanThrowTypeError(message), NanThrowRangeError(message), NanThrowError(Local<Value>), NanThrowError(Local<Value>, int) - -For throwing `Error`, `TypeError` and `RangeError` objects. You should `return` this call: - -```c++ -return NanThrowError("you must supply a callback argument"); -``` - -Can also handle any custom object you may want to throw. If used with the error code argument, it will add the supplied error code to the error object as a property called `code`. - - -### Local<Object> NanNewBufferHandle(char *, uint32_t), Local<Object> NanNewBufferHandle(uint32_t) - -The `Buffer` API has changed a little in Node 0.11, this helper provides consistent access to `Buffer` creation: - -```c++ -NanNewBufferHandle((char*)value.data(), value.size()); -``` - -Can also be used to initialize a `Buffer` with just a `size` argument. - -Can also be supplied with a `NanFreeCallback` and a hint for the garbage collector. - - -### Local<Object> NanBufferUse(char*, uint32_t) - -`Buffer::New(char*, uint32_t)` prior to 0.11 would make a copy of the data. -While it was possible to get around this, it required a shim by passing a -callback. So the new API `Buffer::Use(char*, uint32_t)` was introduced to remove -needing to use this shim. - -`NanBufferUse` uses the `char*` passed as the backing data, and will free the -memory automatically when the weak callback is called. Keep this in mind, as -careless use can lead to "double free or corruption" and other cryptic failures. - - -### bool NanHasInstance(Persistent<FunctionTemplate>&, Handle<Value>) - -Can be used to check the type of an object to determine it is of a particular class you have already defined and have a `Persistent` handle for. - - -### Local<Context> NanNewContextHandle([ExtensionConfiguration*, Handle<ObjectTemplate>, Handle<Value>]) -Creates a new `Local` handle. - -```c++ -Local ftmpl = NanNew(); -Local otmpl = ftmpl->InstanceTemplate(); -Local ctx = NanNewContextHandle(NULL, otmpl); -``` - - -### Local NanGetCurrentContext() - -Gets the current context. - -```c++ -Local ctx = NanGetCurrentContext(); -``` - - -### void NanDisposePersistent(Persistent<T> &) - -Use `NanDisposePersistent` to dispose a `Persistent` handle. - -```c++ -NanDisposePersistent(persistentHandle); -``` - - -### NanAssignPersistent(type, handle, object) - -Use `NanAssignPersistent` to assign a non-`Persistent` handle to a `Persistent` one. You can no longer just declare a `Persistent` handle and assign directly to it later, you have to `Reset` it in Node 0.11, so this makes it easier. - -In general it is now better to place anything you want to protect from V8's garbage collector as properties of a generic `Object` and then assign that to a `Persistent`. This works in older versions of Node also if you use `NanAssignPersistent`: - -```c++ -Persistent persistentHandle; - -... - -Local obj = NanNew(); -obj->Set(NanSymbol("key"), keyHandle); // where keyHandle might be a Local -NanAssignPersistent(Object, persistentHandle, obj) -``` - - -### NanMakeWeakPersistent(Handle<T> handle, P* parameter, _NanWeakCallbackInfo<T, P>::Callback callback) - -Creates a weak persistent handle with the supplied parameter and `NAN_WEAK_CALLBACK`. The callback has to be fully specialized to work on all versions of Node. - -```c++ -NAN_WEAK_CALLBACK(weakCallback) { - -... - -} - -Local func; - -... - -int *parameter = new int(0); -NanMakeWeakPersistent(func, parameter, &weakCallback); -``` - - -### NanSetTemplate(templ, name, value) - -Use to add properties on object and function templates. - - -### NanMakeCallback(target, func, argc, argv) - -Use instead of `node::MakeCallback` to call javascript functions. This is the only proper way of calling functions. - - -### NanCompileScript(Handle s [, const ScriptOrigin& origin]) - -Use to create new scripts bound to the current context. - - -### NanRunScript(script) - -Use to run both bound and unbound scripts. - - -### NanAdjustExternalMemory(int change_in_bytes) - -Simply does `AdjustAmountOfExternalAllocatedMemory` - - -### NanAddGCEpilogueCallback(GCEpilogueCallback callback, GCType gc_type_filter=kGCTypeAll) - -Simply does `AddGCEpilogueCallback` - - -### NanAddGCPrologueCallback(GCPrologueCallback callback, GCType gc_type_filter=kGCTypeAll) - -Simply does `AddGCPrologueCallback` - - -### NanRemoveGCEpilogueCallback(GCEpilogueCallback callback) - -Simply does `RemoveGCEpilogueCallback` - - -### NanRemoveGCPrologueCallback(GCPrologueCallback callback) - -Simply does `RemoveGCPrologueCallback` - - -### NanGetHeapStatistics(HeapStatistics *heap_statistics) - -Simply does `GetHeapStatistics` - - -### NanCallback - -Because of the difficulties imposed by the changes to `Persistent` handles in V8 in Node 0.11, creating `Persistent` versions of your `Handle` is annoyingly tricky. `NanCallback` makes it easier by taking your handle, making it persistent until the `NanCallback` is deleted and even providing a handy `Call()` method to fetch and execute the callback `Function`. - -```c++ -Local callbackHandle = args[0].As(); -NanCallback *callback = new NanCallback(callbackHandle); -// pass `callback` around and it's safe from GC until you: -delete callback; -``` - -You can execute the callback like so: - -```c++ -// no arguments: -callback->Call(0, NULL); - -// an error argument: -Handle argv[] = { - NanError(NanNew("fail!")) -}; -callback->Call(1, argv); - -// a success argument: -Handle argv[] = { - NanNull(), - NanNew("w00t!") -}; -callback->Call(2, argv); -``` - -`NanCallback` also has a `Local GetCallback()` method that you can use -to fetch a local handle to the underlying callback function, as well as a -`void SetFunction(Handle)` for setting the callback on the -`NanCallback`. Additionally a generic constructor is available for using -`NanCallback` without performing heap allocations. - - -### NanAsyncWorker - -`NanAsyncWorker` is an abstract class that you can subclass to have much of the annoying async queuing and handling taken care of for you. It can even store arbitrary V8 objects for you and have them persist while the async work is in progress. - -See a rough outline of the implementation: - -```c++ -class NanAsyncWorker { -public: - NanAsyncWorker (NanCallback *callback); - - // Clean up persistent handles and delete the *callback - virtual ~NanAsyncWorker (); - - // Check the `char *errmsg` property and call HandleOKCallback() - // or HandleErrorCallback depending on whether it has been set or not - virtual void WorkComplete (); - - // You must implement this to do some async work. If there is an - // error then allocate `errmsg` to a message and the callback will - // be passed that string in an Error object - virtual void Execute (); - - // Save a V8 object in a Persistent handle to protect it from GC - void SavePersistent(const char *key, Local &obj); - - // Fetch a stored V8 object (don't call from within `Execute()`) - Local GetFromPersistent(const char *key); - -protected: - // Set this if there is an error, otherwise it's NULL - const char *errmsg; - - // Default implementation calls the callback function with no arguments. - // Override this to return meaningful data - virtual void HandleOKCallback (); - - // Default implementation calls the callback function with an Error object - // wrapping the `errmsg` string - virtual void HandleErrorCallback (); -}; -``` - - -### NanAsyncQueueWorker(NanAsyncWorker *) - -`NanAsyncQueueWorker` will run a `NanAsyncWorker` asynchronously via libuv. Both the *execute* and *after_work* steps are taken care of for you—most of the logic for this is embedded in `NanAsyncWorker`. - -### Contributors - -NAN is only possible due to the excellent work of the following contributors: - -
    {{#showInstallButton}} @@ -99,4 +102,4 @@ {{/isInstalled}}
    - - - - - - -
    Rod VaggGitHub/rvaggTwitter/@rvagg
    Benjamin ByholmGitHub/kkoopa
    Trevor NorrisGitHub/trevnorrisTwitter/@trevnorris
    Nathan RajlichGitHub/TooTallNateTwitter/@TooTallNate
    Brett LawsonGitHub/brett19Twitter/@brett19x
    Ben NoordhuisGitHub/bnoordhuisTwitter/@bnoordhuis
    - -Licence & copyright ------------------------ - -Copyright (c) 2014 NAN contributors (listed above). - -Native Abstractions for Node.js is licensed under an MIT +no-false-attribs license. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details. diff --git a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/nan/build/config.gypi b/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/nan/build/config.gypi deleted file mode 100644 index e085a5008e3..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/nan/build/config.gypi +++ /dev/null @@ -1,38 +0,0 @@ -# Do not edit. File was generated by node-gyp's "configure" step -{ - "target_defaults": { - "cflags": [], - "default_configuration": "Release", - "defines": [], - "include_dirs": [], - "libraries": [] - }, - "variables": { - "clang": 0, - "gcc_version": 47, - "host_arch": "x64", - "node_install_npm": "true", - "node_prefix": "", - "node_shared_cares": "false", - "node_shared_http_parser": "false", - "node_shared_libuv": "false", - "node_shared_openssl": "false", - "node_shared_v8": "false", - "node_shared_zlib": "false", - "node_tag": "", - "node_unsafe_optimizations": 0, - "node_use_dtrace": "false", - "node_use_etw": "false", - "node_use_openssl": "true", - "node_use_perfctr": "false", - "node_use_systemtap": "false", - "python": "/usr/bin/python", - "target_arch": "x64", - "v8_enable_gdbjit": 0, - "v8_no_strict_aliasing": 1, - "v8_use_snapshot": "true", - "nodedir": "/home/rvagg/.node-gyp/0.10.21", - "copy_dev_lib": "true", - "standalone_static_library": 1 - } -} diff --git a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/nan/include_dirs.js b/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/nan/include_dirs.js deleted file mode 100644 index 4f1dfb41667..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/nan/include_dirs.js +++ /dev/null @@ -1 +0,0 @@ -console.log(require('path').relative('.', __dirname)); diff --git a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/nan/nan.h b/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/nan/nan.h deleted file mode 100644 index bc544f53c54..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/nan/nan.h +++ /dev/null @@ -1,1910 +0,0 @@ -/********************************************************************************** - * NAN - Native Abstractions for Node.js - * - * Copyright (c) 2014 NAN contributors: - * - Rod Vagg - * - Benjamin Byholm - * - Trevor Norris - * - Nathan Rajlich - * - Brett Lawson - * - Ben Noordhuis - * - * MIT +no-false-attribs License - * - * Version 1.0.0 (current Node unstable: 0.11.13, Node stable: 0.10.28) - * - * ChangeLog: - * * 1.0.0 May 4 2014 - * - Heavy API changes for V8 3.25 / Node 0.11.13 - * - Use cpplint.py - * - Removed NanInitPersistent - * - Removed NanPersistentToLocal - * - Removed NanFromV8String - * - Removed NanMakeWeak - * - Removed NanNewLocal - * - Removed NAN_WEAK_CALLBACK_OBJECT - * - Removed NAN_WEAK_CALLBACK_DATA - * - Introduce NanNew, replaces NanNewLocal, NanPersistentToLocal, adds many overloaded typed versions - * - Introduce NanUndefined, NanNull, NanTrue and NanFalse - * - Introduce NanEscapableScope and NanEscapeScope - * - Introduce NanMakeWeakPersistent (requires a special callback to work on both old and new node) - * - Introduce NanMakeCallback for node::MakeCallback - * - Introduce NanSetTemplate - * - Introduce NanGetCurrentContext - * - Introduce NanCompileScript and NanRunScript - * - Introduce NanAdjustExternalMemory - * - Introduce NanAddGCEpilogueCallback, NanAddGCPrologueCallback, NanRemoveGCEpilogueCallback, NanRemoveGCPrologueCallback - * - Introduce NanGetHeapStatistics - * - Rename NanAsyncWorker#SavePersistent() to SaveToPersistent() - * - * * 0.8.0 Jan 9 2014 - * - NanDispose -> NanDisposePersistent, deprecate NanDispose - * - Extract _NAN_*_RETURN_TYPE, pull up NAN_*() - * - * * 0.7.1 Jan 9 2014 - * - Fixes to work against debug builds of Node - * - Safer NanPersistentToLocal (avoid reinterpret_cast) - * - Speed up common NanRawString case by only extracting flattened string when necessary - * - * * 0.7.0 Dec 17 2013 - * - New no-arg form of NanCallback() constructor. - * - NanCallback#Call takes Handle rather than Local - * - Removed deprecated NanCallback#Run method, use NanCallback#Call instead - * - Split off _NAN_*_ARGS_TYPE from _NAN_*_ARGS - * - Restore (unofficial) Node 0.6 compatibility at NanCallback#Call() - * - Introduce NanRawString() for char* (or appropriate void*) from v8::String - * (replacement for NanFromV8String) - * - Introduce NanCString() for null-terminated char* from v8::String - * - * * 0.6.0 Nov 21 2013 - * - Introduce NanNewLocal(v8::Handle value) for use in place of - * v8::Local::New(...) since v8 started requiring isolate in Node 0.11.9 - * - * * 0.5.2 Nov 16 2013 - * - Convert SavePersistent and GetFromPersistent in NanAsyncWorker from protected and public - * - * * 0.5.1 Nov 12 2013 - * - Use node::MakeCallback() instead of direct v8::Function::Call() - * - * * 0.5.0 Nov 11 2013 - * - Added @TooTallNate as collaborator - * - New, much simpler, "include_dirs" for binding.gyp - * - Added full range of NAN_INDEX_* macros to match NAN_PROPERTY_* macros - * - * * 0.4.4 Nov 2 2013 - * - Isolate argument from v8::Persistent::MakeWeak removed for 0.11.8+ - * - * * 0.4.3 Nov 2 2013 - * - Include node_object_wrap.h, removed from node.h for Node 0.11.8. - * - * * 0.4.2 Nov 2 2013 - * - Handle deprecation of v8::Persistent::Dispose(v8::Isolate* isolate)) for - * Node 0.11.8 release. - * - * * 0.4.1 Sep 16 2013 - * - Added explicit `#include ` as it was removed from node.h for v0.11.8 - * - * * 0.4.0 Sep 2 2013 - * - Added NAN_INLINE and NAN_DEPRECATED and made use of them - * - Added NanError, NanTypeError and NanRangeError - * - Cleaned up code - * - * * 0.3.2 Aug 30 2013 - * - Fix missing scope declaration in GetFromPersistent() and SaveToPersistent - * in NanAsyncWorker - * - * * 0.3.1 Aug 20 2013 - * - fix "not all control paths return a value" compile warning on some platforms - * - * * 0.3.0 Aug 19 2013 - * - Made NAN work with NPM - * - Lots of fixes to NanFromV8String, pulling in features from new Node core - * - Changed node::encoding to Nan::Encoding in NanFromV8String to unify the API - * - Added optional error number argument for NanThrowError() - * - Added NanInitPersistent() - * - Added NanReturnNull() and NanReturnEmptyString() - * - Added NanLocker and NanUnlocker - * - Added missing scopes - * - Made sure to clear disposed Persistent handles - * - Changed NanAsyncWorker to allocate error messages on the heap - * - Changed NanThrowError(Local) to NanThrowError(Handle) - * - Fixed leak in NanAsyncWorker when errmsg is used - * - * * 0.2.2 Aug 5 2013 - * - Fixed usage of undefined variable with node::BASE64 in NanFromV8String() - * - * * 0.2.1 Aug 5 2013 - * - Fixed 0.8 breakage, node::BUFFER encoding type not available in 0.8 for - * NanFromV8String() - * - * * 0.2.0 Aug 5 2013 - * - Added NAN_PROPERTY_GETTER, NAN_PROPERTY_SETTER, NAN_PROPERTY_ENUMERATOR, - * NAN_PROPERTY_DELETER, NAN_PROPERTY_QUERY - * - Extracted _NAN_METHOD_ARGS, _NAN_GETTER_ARGS, _NAN_SETTER_ARGS, - * _NAN_PROPERTY_GETTER_ARGS, _NAN_PROPERTY_SETTER_ARGS, - * _NAN_PROPERTY_ENUMERATOR_ARGS, _NAN_PROPERTY_DELETER_ARGS, - * _NAN_PROPERTY_QUERY_ARGS - * - Added NanGetInternalFieldPointer, NanSetInternalFieldPointer - * - Added NAN_WEAK_CALLBACK, NAN_WEAK_CALLBACK_OBJECT, - * NAN_WEAK_CALLBACK_DATA, NanMakeWeak - * - Renamed THROW_ERROR to _NAN_THROW_ERROR - * - Added NanNewBufferHandle(char*, size_t, node::smalloc::FreeCallback, void*) - * - Added NanBufferUse(char*, uint32_t) - * - Added NanNewContextHandle(v8::ExtensionConfiguration*, - * v8::Handle, v8::Handle) - * - Fixed broken NanCallback#GetFunction() - * - Added optional encoding and size arguments to NanFromV8String() - * - Added NanGetPointerSafe() and NanSetPointerSafe() - * - Added initial test suite (to be expanded) - * - Allow NanUInt32OptionValue to convert any Number object - * - * * 0.1.0 Jul 21 2013 - * - Added `NAN_GETTER`, `NAN_SETTER` - * - Added `NanThrowError` with single Local argument - * - Added `NanNewBufferHandle` with single uint32_t argument - * - Added `NanHasInstance(Persistent&, Handle)` - * - Added `Local NanCallback#GetFunction()` - * - Added `NanCallback#Call(int, Local[])` - * - Deprecated `NanCallback#Run(int, Local[])` in favour of Call - * - * See https://github.com/rvagg/nan for the latest update to this file - **********************************************************************************/ - -#ifndef NAN_H_ -#define NAN_H_ - -#include -#include -#include -#include -#include -#include - -#if defined(__GNUC__) && !defined(DEBUG) -# define NAN_INLINE inline __attribute__((always_inline)) -#elif defined(_MSC_VER) && !defined(DEBUG) -# define NAN_INLINE __forceinline -#else -# define NAN_INLINE inline -#endif - -#if defined(__GNUC__) && !V8_DISABLE_DEPRECATIONS -# define NAN_DEPRECATED __attribute__((deprecated)) -#elif defined(_MSC_VER) && !V8_DISABLE_DEPRECATIONS -# define NAN_DEPRECATED __declspec(deprecated) -#else -# define NAN_DEPRECATED -#endif - -// some generic helpers - -template NAN_INLINE bool NanSetPointerSafe( - T *var - , T val -) { - if (var) { - *var = val; - return true; - } else { - return false; - } -} - -template NAN_INLINE T NanGetPointerSafe( - T *var - , T fallback = reinterpret_cast(0) -) { - if (var) { - return *var; - } else { - return fallback; - } -} - -NAN_INLINE bool NanBooleanOptionValue( - v8::Local optionsObj - , v8::Handle opt, bool def -) { - if (def) { - return optionsObj.IsEmpty() - || !optionsObj->Has(opt) - || optionsObj->Get(opt)->BooleanValue(); - } else { - return !optionsObj.IsEmpty() - && optionsObj->Has(opt) - && optionsObj->Get(opt)->BooleanValue(); - } -} - -NAN_INLINE bool NanBooleanOptionValue( - v8::Local optionsObj - , v8::Handle opt -) { - return NanBooleanOptionValue(optionsObj, opt, false); -} - -NAN_INLINE uint32_t NanUInt32OptionValue( - v8::Local optionsObj - , v8::Handle opt - , uint32_t def -) { - return !optionsObj.IsEmpty() - && optionsObj->Has(opt) - && optionsObj->Get(opt)->IsNumber() - ? optionsObj->Get(opt)->Uint32Value() - : def; -} - -#if (NODE_MODULE_VERSION > 0x000B) -// Node 0.11+ (0.11.3 and below won't compile with these) - -# define _NAN_METHOD_ARGS_TYPE const v8::FunctionCallbackInfo& -# define _NAN_METHOD_ARGS _NAN_METHOD_ARGS_TYPE args -# define _NAN_METHOD_RETURN_TYPE void - -# define _NAN_GETTER_ARGS_TYPE const v8::PropertyCallbackInfo& -# define _NAN_GETTER_ARGS _NAN_GETTER_ARGS_TYPE args -# define _NAN_GETTER_RETURN_TYPE void - -# define _NAN_SETTER_ARGS_TYPE const v8::PropertyCallbackInfo& -# define _NAN_SETTER_ARGS _NAN_SETTER_ARGS_TYPE args -# define _NAN_SETTER_RETURN_TYPE void - -# define _NAN_PROPERTY_GETTER_ARGS_TYPE \ - const v8::PropertyCallbackInfo& -# define _NAN_PROPERTY_GETTER_ARGS _NAN_PROPERTY_GETTER_ARGS_TYPE args -# define _NAN_PROPERTY_GETTER_RETURN_TYPE void - -# define _NAN_PROPERTY_SETTER_ARGS_TYPE \ - const v8::PropertyCallbackInfo& -# define _NAN_PROPERTY_SETTER_ARGS _NAN_PROPERTY_SETTER_ARGS_TYPE args -# define _NAN_PROPERTY_SETTER_RETURN_TYPE void - -# define _NAN_PROPERTY_ENUMERATOR_ARGS_TYPE \ - const v8::PropertyCallbackInfo& -# define _NAN_PROPERTY_ENUMERATOR_ARGS _NAN_PROPERTY_ENUMERATOR_ARGS_TYPE args -# define _NAN_PROPERTY_ENUMERATOR_RETURN_TYPE void - -# define _NAN_PROPERTY_DELETER_ARGS_TYPE \ - const v8::PropertyCallbackInfo& -# define _NAN_PROPERTY_DELETER_ARGS \ - _NAN_PROPERTY_DELETER_ARGS_TYPE args -# define _NAN_PROPERTY_DELETER_RETURN_TYPE void - -# define _NAN_PROPERTY_QUERY_ARGS_TYPE \ - const v8::PropertyCallbackInfo& -# define _NAN_PROPERTY_QUERY_ARGS _NAN_PROPERTY_QUERY_ARGS_TYPE args -# define _NAN_PROPERTY_QUERY_RETURN_TYPE void - -# define _NAN_INDEX_GETTER_ARGS_TYPE \ - const v8::PropertyCallbackInfo& -# define _NAN_INDEX_GETTER_ARGS _NAN_INDEX_GETTER_ARGS_TYPE args -# define _NAN_INDEX_GETTER_RETURN_TYPE void - -# define _NAN_INDEX_SETTER_ARGS_TYPE \ - const v8::PropertyCallbackInfo& -# define _NAN_INDEX_SETTER_ARGS _NAN_INDEX_SETTER_ARGS_TYPE args -# define _NAN_INDEX_SETTER_RETURN_TYPE void - -# define _NAN_INDEX_ENUMERATOR_ARGS_TYPE \ - const v8::PropertyCallbackInfo& -# define _NAN_INDEX_ENUMERATOR_ARGS _NAN_INDEX_ENUMERATOR_ARGS_TYPE args -# define _NAN_INDEX_ENUMERATOR_RETURN_TYPE void - -# define _NAN_INDEX_DELETER_ARGS_TYPE \ - const v8::PropertyCallbackInfo& -# define _NAN_INDEX_DELETER_ARGS _NAN_INDEX_DELETER_ARGS_TYPE args -# define _NAN_INDEX_DELETER_RETURN_TYPE void - -# define _NAN_INDEX_QUERY_ARGS_TYPE \ - const v8::PropertyCallbackInfo& -# define _NAN_INDEX_QUERY_ARGS _NAN_INDEX_QUERY_ARGS_TYPE args -# define _NAN_INDEX_QUERY_RETURN_TYPE void - -typedef v8::FunctionCallback NanFunctionCallback; -static v8::Isolate* nan_isolate = v8::Isolate::GetCurrent(); - -# define NanUndefined() v8::Undefined(nan_isolate) -# define NanNull() v8::Null(nan_isolate) -# define NanTrue() v8::True(nan_isolate) -# define NanFalse() v8::False(nan_isolate) -# define NanAdjustExternalMemory(amount) \ - nan_isolate->AdjustAmountOfExternalAllocatedMemory(amount) -# define NanSetTemplate(templ, name, value) templ->Set(nan_isolate, name, value) -# define NanGetCurrentContext() nan_isolate->GetCurrentContext() -# define NanMakeCallback(target, func, argc, argv) \ - node::MakeCallback(nan_isolate, target, func, argc, argv) -# define NanGetInternalFieldPointer(object, index) \ - object->GetAlignedPointerFromInternalField(index) -# define NanSetInternalFieldPointer(object, index, value) \ - object->SetAlignedPointerInInternalField(index, value) - - template - NAN_INLINE v8::Local NanNew() { - return T::New(nan_isolate); - } - - template - NAN_INLINE v8::Local NanNew(P arg1) { - return T::New(nan_isolate, arg1); - } - - template - NAN_INLINE v8::Local NanNew( - v8::Handle receiver - , int argc - , v8::Handle argv[] = 0) { - return v8::Signature::New(nan_isolate, receiver, argc, argv); - } - - template - NAN_INLINE v8::Local NanNew( - NanFunctionCallback callback - , v8::Handle data = v8::Handle() - , v8::Handle signature = v8::Handle()) { - return T::New(nan_isolate, callback, data, signature); - } - - template - NAN_INLINE v8::Local NanNew(v8::Handle arg1) { - return v8::Local::New(nan_isolate, arg1); - } - - template - NAN_INLINE v8::Local NanNew(const v8::Persistent &arg1) { - return v8::Local::New(nan_isolate, arg1); - } - - template - NAN_INLINE v8::Local NanNew(P arg1, int arg2) { - return T::New(nan_isolate, arg1, arg2); - } - - template<> - NAN_INLINE v8::Local NanNew() { - return v8::Array::New(nan_isolate); - } - - template<> - NAN_INLINE v8::Local NanNew(int length) { - return v8::Array::New(nan_isolate, length); - } - - template<> - NAN_INLINE v8::Local NanNew(double time) { - return v8::Date::New(nan_isolate, time).As(); - } - - template<> - NAN_INLINE v8::Local NanNew(int time) { - return v8::Date::New(nan_isolate, time).As(); - } - - typedef v8::UnboundScript NanUnboundScript; - typedef v8::Script NanBoundScript; - - template - NAN_INLINE v8::Local NanNew( - P s - , const v8::ScriptOrigin& origin - ) { - v8::ScriptCompiler::Source source(s, origin); - return v8::ScriptCompiler::CompileUnbound(nan_isolate, &source); - } - - template<> - NAN_INLINE v8::Local NanNew( - v8::Local s - ) { - v8::ScriptCompiler::Source source(s); - return v8::ScriptCompiler::CompileUnbound(nan_isolate, &source); - } - - NAN_INLINE v8::Local NanNew( - v8::String::ExternalStringResource *resource) { - return v8::String::NewExternal(nan_isolate, resource); - } - - NAN_INLINE v8::Local NanNew( - v8::String::ExternalAsciiStringResource *resource) { - return v8::String::NewExternal(nan_isolate, resource); - } - - template<> - NAN_INLINE v8::Local NanNew(bool value) { - return v8::BooleanObject::New(value).As(); - } - - template<> - NAN_INLINE v8::Local - NanNew >( - v8::Local value) { - return v8::StringObject::New(value).As(); - } - - template<> - NAN_INLINE v8::Local - NanNew >( - v8::Handle value) { - return v8::StringObject::New(value).As(); - } - - template<> - NAN_INLINE v8::Local NanNew(double val) { - return v8::NumberObject::New(nan_isolate, val).As(); - } - - template - NAN_INLINE v8::Local NanNew( - v8::Handle pattern, v8::RegExp::Flags flags) { - return v8::RegExp::New(pattern, flags); - } - - template - NAN_INLINE v8::Local NanNew( - v8::Local pattern, v8::RegExp::Flags flags) { - return v8::RegExp::New(pattern, flags); - } - - template - NAN_INLINE v8::Local NanNew( - v8::Handle pattern, v8::RegExp::Flags flags) { - return v8::RegExp::New(pattern, flags); - } - - template - NAN_INLINE v8::Local NanNew( - v8::Local pattern, v8::RegExp::Flags flags) { - return v8::RegExp::New(pattern, flags); - } - - template<> - NAN_INLINE v8::Local NanNew(int32_t val) { - return v8::Uint32::NewFromUnsigned(nan_isolate, val)->ToUint32(); - } - - template<> - NAN_INLINE v8::Local NanNew(uint32_t val) { - return v8::Uint32::NewFromUnsigned(nan_isolate, val)->ToUint32(); - } - - template<> - NAN_INLINE v8::Local NanNew(int32_t val) { - return v8::Int32::New(nan_isolate, val)->ToInt32(); - } - - template<> - NAN_INLINE v8::Local NanNew(uint32_t val) { - return v8::Int32::New(nan_isolate, val)->ToInt32(); - } - - template<> - NAN_INLINE v8::Local NanNew( - char *arg - , int length) { - return v8::String::NewFromUtf8( - nan_isolate - , arg - , v8::String::kNormalString - , length); - } - - template<> - NAN_INLINE v8::Local NanNew( - const char *arg - , int length) { - return v8::String::NewFromUtf8( - nan_isolate - , arg - , v8::String::kNormalString - , length); - } - - template<> - NAN_INLINE v8::Local NanNew(char *arg) { - return v8::String::NewFromUtf8(nan_isolate, arg); - } - - template<> - NAN_INLINE v8::Local NanNew( - const char *arg) { - return v8::String::NewFromUtf8(nan_isolate, arg); - } - - template<> - NAN_INLINE v8::Local NanNew( - uint8_t *arg - , int length) { - return v8::String::NewFromOneByte( - nan_isolate - , arg - , v8::String::kNormalString - , length); - } - - template<> - NAN_INLINE v8::Local NanNew( - const uint8_t *arg - , int length) { - return v8::String::NewFromOneByte( - nan_isolate - , arg - , v8::String::kNormalString - , length); - } - - template<> - NAN_INLINE v8::Local NanNew(uint8_t *arg) { - return v8::String::NewFromOneByte(nan_isolate, arg); - } - - template<> - NAN_INLINE v8::Local NanNew( - const uint8_t *arg) { - return v8::String::NewFromOneByte(nan_isolate, arg); - } - - template<> - NAN_INLINE v8::Local NanNew( - uint16_t *arg - , int length) { - return v8::String::NewFromTwoByte( - nan_isolate - , arg - , v8::String::kNormalString - , length); - } - - template<> - NAN_INLINE v8::Local NanNew( - const uint16_t *arg - , int length) { - return v8::String::NewFromTwoByte( - nan_isolate - , arg - , v8::String::kNormalString - , length); - } - template<> - NAN_INLINE v8::Local NanNew( - uint16_t *arg) { - return v8::String::NewFromTwoByte(nan_isolate, arg); - } - - template<> - NAN_INLINE v8::Local NanNew( - const uint16_t *arg) { - return v8::String::NewFromTwoByte(nan_isolate, arg); - } - - template<> - NAN_INLINE v8::Local NanNew() { - return v8::String::Empty(nan_isolate); - } - - NAN_INLINE void NanAddGCEpilogueCallback( - v8::Isolate::GCEpilogueCallback callback - , v8::GCType gc_type_filter = v8::kGCTypeAll) { - nan_isolate->AddGCEpilogueCallback(callback, gc_type_filter); - } - - NAN_INLINE void NanRemoveGCEpilogueCallback( - v8::Isolate::GCEpilogueCallback callback) { - nan_isolate->RemoveGCEpilogueCallback(callback); - } - - NAN_INLINE void NanAddGCPrologueCallback( - v8::Isolate::GCPrologueCallback callback - , v8::GCType gc_type_filter = v8::kGCTypeAll) { - nan_isolate->AddGCPrologueCallback(callback, gc_type_filter); - } - - NAN_INLINE void NanRemoveGCPrologueCallback( - v8::Isolate::GCPrologueCallback callback) { - nan_isolate->RemoveGCPrologueCallback(callback); - } - - NAN_INLINE void NanGetHeapStatistics( - v8::HeapStatistics *heap_statistics) { - nan_isolate->GetHeapStatistics(heap_statistics); - } - -# define NanSymbol(value) NanNew(value) - - template - NAN_INLINE void NanAssignPersistent( - v8::Persistent& handle - , v8::Handle obj) { - handle.Reset(nan_isolate, obj); - } - - template - NAN_INLINE void NanAssignPersistent( - v8::Persistent& handle - , const v8::Persistent& obj) { - handle.Reset(nan_isolate, obj); - } - - template - struct _NanWeakCallbackInfo { - typedef void (*Callback)( - const v8::WeakCallbackData >& data); - _NanWeakCallbackInfo(v8::Handle handle, P* param, Callback cb) - : parameter(param), callback(cb) { - NanAssignPersistent(persistent, handle); - } - - ~_NanWeakCallbackInfo() { - persistent.Reset(); - } - - P* const parameter; - Callback const callback; - v8::Persistent persistent; - }; - - template - class _NanWeakCallbackData { - public: - _NanWeakCallbackData(_NanWeakCallbackInfo *info) - : info_(info) { } - - NAN_INLINE v8::Local GetValue() const { - return NanNew(info_->persistent); - } - NAN_INLINE P* GetParameter() const { return info_->parameter; } - NAN_INLINE void Revive() const { - info_->persistent.SetWeak(info_, info_->callback); - } - - NAN_INLINE void Dispose() const { - delete info_; - } - - private: - _NanWeakCallbackInfo* info_; - }; - -// do not use for declaration -# define NAN_WEAK_CALLBACK(name) \ - template \ - static void name( \ - const v8::WeakCallbackData > &data) { \ - _NanWeakCallbackData wcbd( \ - data.GetParameter()); \ - _Nan_Weak_Callback_ ## name(wcbd); \ - } \ - \ - template \ - NAN_INLINE void _Nan_Weak_Callback_ ## name( \ - const _NanWeakCallbackData &data) - -# define NanScope() v8::HandleScope scope(nan_isolate) -# define NanEscapableScope() v8::EscapableHandleScope scope(nan_isolate) -# define NanEscapeScope(val) scope.Escape(val) -# define NanLocker() v8::Locker locker(nan_isolate) -# define NanUnlocker() v8::Unlocker unlocker(nan_isolate) -# define NanReturnValue(value) return args.GetReturnValue().Set(value) -# define NanReturnUndefined() return -# define NanReturnNull() return args.GetReturnValue().SetNull() -# define NanReturnEmptyString() return args.GetReturnValue().SetEmptyString() - -# define NanObjectWrapHandle(obj) obj->handle() - -template -void NAN_INLINE NanMakeWeakPersistent( - v8::Handle handle - , P* parameter - , typename _NanWeakCallbackInfo::Callback callback) { - _NanWeakCallbackInfo *cbinfo = - new _NanWeakCallbackInfo(handle, parameter, callback); - cbinfo->persistent.SetWeak(cbinfo, callback); -} - -# define _NAN_ERROR(fun, errmsg) fun(NanNew(errmsg)) - -# define _NAN_THROW_ERROR(fun, errmsg) \ - do { \ - NanScope(); \ - nan_isolate->ThrowException(_NAN_ERROR(fun, errmsg)); \ - } while (0); - - NAN_INLINE v8::Local NanError(const char* errmsg) { - return _NAN_ERROR(v8::Exception::Error, errmsg); - } - - NAN_INLINE void NanThrowError(const char* errmsg) { - _NAN_THROW_ERROR(v8::Exception::Error, errmsg); - } - - NAN_INLINE void NanThrowError(v8::Handle error) { - NanScope(); - nan_isolate->ThrowException(error); - } - - NAN_INLINE v8::Local NanError( - const char *msg - , const int errorNumber - ) { - v8::Local err = v8::Exception::Error(NanNew(msg)); - v8::Local obj = err.As(); - obj->Set(NanSymbol("code"), NanNew(errorNumber)); - return err; - } - - NAN_INLINE void NanThrowError( - const char *msg - , const int errorNumber - ) { - NanThrowError(NanError(msg, errorNumber)); - } - - NAN_INLINE v8::Local NanTypeError(const char* errmsg) { - return _NAN_ERROR(v8::Exception::TypeError, errmsg); - } - - NAN_INLINE void NanThrowTypeError(const char* errmsg) { - _NAN_THROW_ERROR(v8::Exception::TypeError, errmsg); - } - - NAN_INLINE v8::Local NanRangeError(const char* errmsg) { - return _NAN_ERROR(v8::Exception::RangeError, errmsg); - } - - NAN_INLINE void NanThrowRangeError(const char* errmsg) { - _NAN_THROW_ERROR(v8::Exception::RangeError, errmsg); - } - - template NAN_INLINE void NanDisposePersistent( - v8::Persistent &handle - ) { - handle.Reset(); - } - - NAN_INLINE v8::Local NanNewBufferHandle ( - char *data - , size_t length - , node::smalloc::FreeCallback callback - , void *hint - ) { - return node::Buffer::New(nan_isolate, data, length, callback, hint); - } - - NAN_INLINE v8::Local NanNewBufferHandle ( - const char *data - , uint32_t size - ) { - return node::Buffer::New(nan_isolate, data, size); - } - - NAN_INLINE v8::Local NanNewBufferHandle (uint32_t size) { - return node::Buffer::New(nan_isolate, size); - } - - NAN_INLINE v8::Local NanBufferUse( - char* data - , uint32_t size - ) { - return node::Buffer::Use(nan_isolate, data, size); - } - - NAN_INLINE bool NanHasInstance( - v8::Persistent& function_template - , v8::Handle value - ) { - return NanNew(function_template)->HasInstance(value); - } - - NAN_INLINE v8::Local NanNewContextHandle( - v8::ExtensionConfiguration* extensions = NULL - , v8::Handle tmpl = v8::Handle() - , v8::Handle obj = v8::Handle() - ) { - return v8::Local::New( - nan_isolate - , v8::Context::New(nan_isolate, extensions, tmpl, obj) - ); - } - - NAN_INLINE v8::Local NanCompileScript( - v8::Local s - , const v8::ScriptOrigin& origin - ) { - v8::ScriptCompiler::Source source(s, origin); - return v8::ScriptCompiler::Compile(nan_isolate, &source); - } - - NAN_INLINE v8::Local NanCompileScript( - v8::Local s - ) { - v8::ScriptCompiler::Source source(s); - return v8::ScriptCompiler::Compile(nan_isolate, &source); - } - - NAN_INLINE v8::Local NanRunScript( - v8::Local script - ) { - return script->BindToCurrentContext()->Run(); - } - - NAN_INLINE v8::Local NanRunScript( - v8::Local script - ) { - return script->Run(); - } - -#else -// Node 0.8 and 0.10 - -# define _NAN_METHOD_ARGS_TYPE const v8::Arguments& -# define _NAN_METHOD_ARGS _NAN_METHOD_ARGS_TYPE args -# define _NAN_METHOD_RETURN_TYPE v8::Handle - -# define _NAN_GETTER_ARGS_TYPE const v8::AccessorInfo & -# define _NAN_GETTER_ARGS _NAN_GETTER_ARGS_TYPE args -# define _NAN_GETTER_RETURN_TYPE v8::Handle - -# define _NAN_SETTER_ARGS_TYPE const v8::AccessorInfo & -# define _NAN_SETTER_ARGS _NAN_SETTER_ARGS_TYPE args -# define _NAN_SETTER_RETURN_TYPE void - -# define _NAN_PROPERTY_GETTER_ARGS_TYPE const v8::AccessorInfo& -# define _NAN_PROPERTY_GETTER_ARGS _NAN_PROPERTY_GETTER_ARGS_TYPE args -# define _NAN_PROPERTY_GETTER_RETURN_TYPE v8::Handle - -# define _NAN_PROPERTY_SETTER_ARGS_TYPE const v8::AccessorInfo& -# define _NAN_PROPERTY_SETTER_ARGS _NAN_PROPERTY_SETTER_ARGS_TYPE args -# define _NAN_PROPERTY_SETTER_RETURN_TYPE v8::Handle - -# define _NAN_PROPERTY_ENUMERATOR_ARGS_TYPE const v8::AccessorInfo& -# define _NAN_PROPERTY_ENUMERATOR_ARGS _NAN_PROPERTY_ENUMERATOR_ARGS_TYPE args -# define _NAN_PROPERTY_ENUMERATOR_RETURN_TYPE v8::Handle - -# define _NAN_PROPERTY_DELETER_ARGS_TYPE const v8::AccessorInfo& -# define _NAN_PROPERTY_DELETER_ARGS _NAN_PROPERTY_DELETER_ARGS_TYPE args -# define _NAN_PROPERTY_DELETER_RETURN_TYPE v8::Handle - -# define _NAN_PROPERTY_QUERY_ARGS_TYPE const v8::AccessorInfo& -# define _NAN_PROPERTY_QUERY_ARGS _NAN_PROPERTY_QUERY_ARGS_TYPE args -# define _NAN_PROPERTY_QUERY_RETURN_TYPE v8::Handle - -# define _NAN_INDEX_GETTER_ARGS_TYPE const v8::AccessorInfo& -# define _NAN_INDEX_GETTER_ARGS _NAN_INDEX_GETTER_ARGS_TYPE args -# define _NAN_INDEX_GETTER_RETURN_TYPE v8::Handle - -# define _NAN_INDEX_SETTER_ARGS_TYPE const v8::AccessorInfo& -# define _NAN_INDEX_SETTER_ARGS _NAN_INDEX_SETTER_ARGS_TYPE args -# define _NAN_INDEX_SETTER_RETURN_TYPE v8::Handle - -# define _NAN_INDEX_ENUMERATOR_ARGS_TYPE const v8::AccessorInfo& -# define _NAN_INDEX_ENUMERATOR_ARGS _NAN_INDEX_ENUMERATOR_ARGS_TYPE args -# define _NAN_INDEX_ENUMERATOR_RETURN_TYPE v8::Handle - -# define _NAN_INDEX_DELETER_ARGS_TYPE const v8::AccessorInfo& -# define _NAN_INDEX_DELETER_ARGS _NAN_INDEX_DELETER_ARGS_TYPE args -# define _NAN_INDEX_DELETER_RETURN_TYPE v8::Handle - -# define _NAN_INDEX_QUERY_ARGS_TYPE const v8::AccessorInfo& -# define _NAN_INDEX_QUERY_ARGS _NAN_INDEX_QUERY_ARGS_TYPE args -# define _NAN_INDEX_QUERY_RETURN_TYPE v8::Handle - -typedef v8::InvocationCallback NanFunctionCallback; - -# define NanUndefined() v8::Undefined() -# define NanNull() v8::Null() -# define NanTrue() v8::True() -# define NanFalse() v8::False() -# define NanAdjustExternalMemory(amount) \ - v8::V8::AdjustAmountOfExternalAllocatedMemory(amount) -# define NanSetTemplate(templ, name, value) templ->Set(name, value) -# define NanGetCurrentContext() v8::Context::GetCurrent() -# if NODE_VERSION_AT_LEAST(0, 8, 0) -# define NanMakeCallback(target, func, argc, argv) \ - node::MakeCallback(target, func, argc, argv) -# else -# define NanMakeCallback(target, func, argc, argv) \ - do { \ - v8::TryCatch try_catch; \ - func->Call(target, argc, argv); \ - if (try_catch.HasCaught()) { \ - v8::FatalException(try_catch); \ - } \ - } while (0) -# endif - -# define NanSymbol(value) v8::String::NewSymbol(value) - - template - NAN_INLINE v8::Local NanNew() { - return v8::Local::New(T::New()); - } - - template - NAN_INLINE v8::Local NanNew(v8::Handle arg) { - return v8::Local::New(arg); - } - - template - NAN_INLINE v8::Local NanNew( - v8::Handle receiver - , int argc - , v8::Handle argv[] = 0) { - return v8::Signature::New(receiver, argc, argv); - } - - template - NAN_INLINE v8::Local NanNew( - NanFunctionCallback callback - , v8::Handle data = v8::Handle() - , v8::Handle signature = v8::Handle()) { - return T::New(callback, data, signature); - } - - template - NAN_INLINE v8::Local NanNew(const v8::Persistent &arg) { - return v8::Local::New(arg); - } - - template - NAN_INLINE v8::Local NanNew(P arg) { - return v8::Local::New(T::New(arg)); - } - - template - NAN_INLINE v8::Local NanNew(P arg, int length) { - return v8::Local::New(T::New(arg, length)); - } - - template - NAN_INLINE v8::Local NanNew( - v8::Handle pattern, v8::RegExp::Flags flags) { - return v8::RegExp::New(pattern, flags); - } - - template - NAN_INLINE v8::Local NanNew( - v8::Local pattern, v8::RegExp::Flags flags) { - return v8::RegExp::New(pattern, flags); - } - - template - NAN_INLINE v8::Local NanNew( - v8::Handle pattern, v8::RegExp::Flags flags) { - return v8::RegExp::New(pattern, flags); - } - - template - NAN_INLINE v8::Local NanNew( - v8::Local pattern, v8::RegExp::Flags flags) { - return v8::RegExp::New(pattern, flags); - } - - template<> - NAN_INLINE v8::Local NanNew() { - return v8::Array::New(); - } - - template<> - NAN_INLINE v8::Local NanNew(int length) { - return v8::Array::New(length); - } - - - template<> - NAN_INLINE v8::Local NanNew(double time) { - return v8::Date::New(time).As(); - } - - template<> - NAN_INLINE v8::Local NanNew(int time) { - return v8::Date::New(time).As(); - } - - typedef v8::Script NanUnboundScript; - typedef v8::Script NanBoundScript; - - template - NAN_INLINE v8::Local NanNew( - P s - , const v8::ScriptOrigin& origin - ) { - return v8::Script::New(s, const_cast(&origin)); - } - - template<> - NAN_INLINE v8::Local NanNew( - v8::Local s - ) { - return v8::Script::New(s); - } - - NAN_INLINE v8::Local NanNew( - v8::String::ExternalStringResource *resource) { - return v8::String::NewExternal(resource); - } - - NAN_INLINE v8::Local NanNew( - v8::String::ExternalAsciiStringResource *resource) { - return v8::String::NewExternal(resource); - } - - template<> - NAN_INLINE v8::Local NanNew(bool value) { - return v8::BooleanObject::New(value).As(); - } - - template<> - NAN_INLINE v8::Local - NanNew >( - v8::Local value) { - return v8::StringObject::New(value).As(); - } - - template<> - NAN_INLINE v8::Local - NanNew >( - v8::Handle value) { - return v8::StringObject::New(value).As(); - } - - template<> - NAN_INLINE v8::Local NanNew(double val) { - return v8::NumberObject::New(val).As(); - } - - template<> - NAN_INLINE v8::Local NanNew(int32_t val) { - return v8::Uint32::NewFromUnsigned(val)->ToUint32(); - } - - template<> - NAN_INLINE v8::Local NanNew(uint32_t val) { - return v8::Uint32::NewFromUnsigned(val)->ToUint32(); - } - - template<> - NAN_INLINE v8::Local NanNew(int32_t val) { - return v8::Int32::New(val)->ToInt32(); - } - - template<> - NAN_INLINE v8::Local NanNew(uint32_t val) { - return v8::Int32::New(val)->ToInt32(); - } - - template<> - NAN_INLINE v8::Local NanNew( - uint8_t *arg - , int length) { - uint16_t *warg = new uint16_t[length]; - for (int i = 0; i < length; i++) { - warg[i] = arg[i]; - } - v8::Local retval = v8::String::New(warg, length); - delete[] warg; - return retval; - } - - template<> - NAN_INLINE v8::Local NanNew( - const uint8_t *arg - , int length) { - uint16_t *warg = new uint16_t[length]; - for (int i = 0; i < length; i++) { - warg[i] = arg[i]; - } - v8::Local retval = v8::String::New(warg, length); - delete[] warg; - return retval; - } - - template<> - NAN_INLINE v8::Local NanNew(uint8_t *arg) { - int length = strlen(reinterpret_cast(arg)); - uint16_t *warg = new uint16_t[length]; - for (int i = 0; i < length; i++) { - warg[i] = arg[i]; - } - - v8::Local retval = v8::String::New(warg, length); - delete[] warg; - return retval; - } - - template<> - NAN_INLINE v8::Local NanNew( - const uint8_t *arg) { - int length = strlen(reinterpret_cast(arg)); - uint16_t *warg = new uint16_t[length]; - for (int i = 0; i < length; i++) { - warg[i] = arg[i]; - } - v8::Local retval = v8::String::New(warg, length); - delete[] warg; - return retval; - } - - template<> - NAN_INLINE v8::Local NanNew() { - return v8::String::Empty(); - } - - NAN_INLINE void NanAddGCEpilogueCallback( - v8::GCEpilogueCallback callback - , v8::GCType gc_type_filter = v8::kGCTypeAll) { - v8::V8::AddGCEpilogueCallback(callback, gc_type_filter); - } - NAN_INLINE void NanRemoveGCEpilogueCallback( - v8::GCEpilogueCallback callback) { - v8::V8::RemoveGCEpilogueCallback(callback); - } - NAN_INLINE void NanAddGCPrologueCallback( - v8::GCPrologueCallback callback - , v8::GCType gc_type_filter = v8::kGCTypeAll) { - v8::V8::AddGCPrologueCallback(callback, gc_type_filter); - } - NAN_INLINE void NanRemoveGCPrologueCallback( - v8::GCPrologueCallback callback) { - v8::V8::RemoveGCPrologueCallback(callback); - } - NAN_INLINE void NanGetHeapStatistics( - v8::HeapStatistics *heap_statistics) { - v8::V8::GetHeapStatistics(heap_statistics); - } - - template - NAN_INLINE void NanAssignPersistent( - v8::Persistent& handle - , v8::Handle obj) { - handle.Dispose(); - handle = v8::Persistent::New(obj); - } - - template - struct _NanWeakCallbackInfo { - typedef void (*Callback)(v8::Persistent object, void* parameter); - _NanWeakCallbackInfo(v8::Handle handle, P* param, Callback cb) : - parameter(param) - , callback(cb) - , persistent(v8::Persistent::New(handle)) { } - - ~_NanWeakCallbackInfo() { - persistent.Dispose(); - persistent.Clear(); - } - - P* const parameter; - Callback const callback; - v8::Persistent persistent; - }; - - template - class _NanWeakCallbackData { - public: - _NanWeakCallbackData(_NanWeakCallbackInfo *info) - : info_(info) { } - - NAN_INLINE v8::Local GetValue() const { - return NanNew(info_->persistent); - } - NAN_INLINE P* GetParameter() const { return info_->parameter; } - NAN_INLINE void Revive() const { - info_->persistent.MakeWeak(info_, info_->callback); - } - NAN_INLINE void Dispose() const { - delete info_; - } - - private: - _NanWeakCallbackInfo* info_; - }; - -# define NanGetInternalFieldPointer(object, index) \ - object->GetPointerFromInternalField(index) -# define NanSetInternalFieldPointer(object, index, value) \ - object->SetPointerInInternalField(index, value) - -// do not use for declaration -# define NAN_WEAK_CALLBACK(name) \ - template \ - static void name( \ - v8::Persistent object, void *data) { \ - _NanWeakCallbackData wcbd( \ - static_cast<_NanWeakCallbackInfo*>(data)); \ - _Nan_Weak_Callback_ ## name(wcbd); \ - } \ - \ - template \ - NAN_INLINE void _Nan_Weak_Callback_ ## name( \ - const _NanWeakCallbackData &data) - - template - NAN_INLINE void NanMakeWeakPersistent( - v8::Handle handle - , P* parameter - , typename _NanWeakCallbackInfo::Callback callback) { - _NanWeakCallbackInfo *cbinfo = - new _NanWeakCallbackInfo(handle, parameter, callback); - cbinfo->persistent.MakeWeak(cbinfo, callback); - } - -# define NanScope() v8::HandleScope scope -# define NanEscapableScope() v8::HandleScope scope -# define NanEscapeScope(val) scope.Close(val) -# define NanLocker() v8::Locker locker -# define NanUnlocker() v8::Unlocker unlocker -# define NanReturnValue(value) return scope.Close(value) -# define NanReturnUndefined() return v8::Undefined() -# define NanReturnNull() return v8::Null() -# define NanReturnEmptyString() return v8::String::Empty() -# define NanObjectWrapHandle(obj) v8::Local::New(obj->handle_) - -# define _NAN_ERROR(fun, errmsg) \ - fun(v8::String::New(errmsg)) - -# define _NAN_THROW_ERROR(fun, errmsg) \ - do { \ - NanScope(); \ - return v8::Local::New( \ - v8::ThrowException(_NAN_ERROR(fun, errmsg))); \ - } while (0); - - NAN_INLINE v8::Local NanError(const char* errmsg) { - return _NAN_ERROR(v8::Exception::Error, errmsg); - } - - NAN_INLINE v8::Local NanThrowError(const char* errmsg) { - _NAN_THROW_ERROR(v8::Exception::Error, errmsg); - } - - NAN_INLINE v8::Local NanThrowError( - v8::Handle error - ) { - NanScope(); - return v8::Local::New(v8::ThrowException(error)); - } - - NAN_INLINE v8::Local NanError( - const char *msg - , const int errorNumber - ) { - v8::Local err = v8::Exception::Error(v8::String::New(msg)); - v8::Local obj = err.As(); - obj->Set(v8::String::New("code"), v8::Int32::New(errorNumber)); - return err; - } - - NAN_INLINE v8::Local NanThrowError( - const char *msg - , const int errorNumber - ) { - return NanThrowError(NanError(msg, errorNumber)); - } - - NAN_INLINE v8::Local NanTypeError(const char* errmsg) { - return _NAN_ERROR(v8::Exception::TypeError, errmsg); - } - - NAN_INLINE v8::Local NanThrowTypeError( - const char* errmsg - ) { - _NAN_THROW_ERROR(v8::Exception::TypeError, errmsg); - } - - NAN_INLINE v8::Local NanRangeError( - const char* errmsg - ) { - return _NAN_ERROR(v8::Exception::RangeError, errmsg); - } - - NAN_INLINE v8::Local NanThrowRangeError( - const char* errmsg - ) { - _NAN_THROW_ERROR(v8::Exception::RangeError, errmsg); - } - - template - NAN_INLINE void NanDisposePersistent( - v8::Persistent &handle) { // NOLINT(runtime/references) - handle.Dispose(); - handle.Clear(); - } - - NAN_INLINE v8::Local NanNewBufferHandle ( - char *data - , size_t length - , node::Buffer::free_callback callback - , void *hint - ) { - return NanNew( - node::Buffer::New(data, length, callback, hint)->handle_); - } - - NAN_INLINE v8::Local NanNewBufferHandle ( - const char *data - , uint32_t size - ) { -#if NODE_MODULE_VERSION >= 0x000B - return NanNew(node::Buffer::New(data, size)->handle_); -#else - return NanNew( - node::Buffer::New(const_cast(data), size)->handle_); -#endif - } - - NAN_INLINE v8::Local NanNewBufferHandle (uint32_t size) { - return NanNew(node::Buffer::New(size)->handle_); - } - - NAN_INLINE void FreeData(char *data, void *hint) { - delete[] data; - } - - NAN_INLINE v8::Local NanBufferUse( - char* data - , uint32_t size - ) { - return NanNew( - node::Buffer::New(data, size, FreeData, NULL)->handle_); - } - - NAN_INLINE bool NanHasInstance( - v8::Persistent& function_template - , v8::Handle value - ) { - return function_template->HasInstance(value); - } - - NAN_INLINE v8::Local NanNewContextHandle( - v8::ExtensionConfiguration* extensions = NULL - , v8::Handle tmpl = v8::Handle() - , v8::Handle obj = v8::Handle() - ) { - v8::Persistent ctx = v8::Context::New(extensions, tmpl, obj); - v8::Local lctx = NanNew(ctx); - ctx.Dispose(); - return lctx; - } - - NAN_INLINE v8::Local NanCompileScript( - v8::Local s - , const v8::ScriptOrigin& origin - ) { - return v8::Script::Compile(s, const_cast(&origin)); - } - - NAN_INLINE v8::Local NanCompileScript( - v8::Local s - ) { - return v8::Script::Compile(s); - } - - NAN_INLINE v8::Local NanRunScript(v8::Local script) { - return script->Run(); - } - -#endif // NODE_MODULE_VERSION - -typedef void (*NanFreeCallback)(char *data, void *hint); - -#define NAN_METHOD(name) _NAN_METHOD_RETURN_TYPE name(_NAN_METHOD_ARGS) -#define NAN_GETTER(name) \ - _NAN_GETTER_RETURN_TYPE name( \ - v8::Local property \ - , _NAN_GETTER_ARGS) -#define NAN_SETTER(name) \ - _NAN_SETTER_RETURN_TYPE name( \ - v8::Local property \ - , v8::Local value \ - , _NAN_SETTER_ARGS) -#define NAN_PROPERTY_GETTER(name) \ - _NAN_PROPERTY_GETTER_RETURN_TYPE name( \ - v8::Local property \ - , _NAN_PROPERTY_GETTER_ARGS) -#define NAN_PROPERTY_SETTER(name) \ - _NAN_PROPERTY_SETTER_RETURN_TYPE name( \ - v8::Local property \ - , v8::Local value \ - , _NAN_PROPERTY_SETTER_ARGS) -#define NAN_PROPERTY_ENUMERATOR(name) \ - _NAN_PROPERTY_ENUMERATOR_RETURN_TYPE name(_NAN_PROPERTY_ENUMERATOR_ARGS) -#define NAN_PROPERTY_DELETER(name) \ - _NAN_PROPERTY_DELETER_RETURN_TYPE name( \ - v8::Local property \ - , _NAN_PROPERTY_DELETER_ARGS) -#define NAN_PROPERTY_QUERY(name) \ - _NAN_PROPERTY_QUERY_RETURN_TYPE name( \ - v8::Local property \ - , _NAN_PROPERTY_QUERY_ARGS) -# define NAN_INDEX_GETTER(name) \ - _NAN_INDEX_GETTER_RETURN_TYPE name(uint32_t index, _NAN_INDEX_GETTER_ARGS) -#define NAN_INDEX_SETTER(name) \ - _NAN_INDEX_SETTER_RETURN_TYPE name( \ - uint32_t index \ - , v8::Local value \ - , _NAN_INDEX_SETTER_ARGS) -#define NAN_INDEX_ENUMERATOR(name) \ - _NAN_INDEX_ENUMERATOR_RETURN_TYPE name(_NAN_INDEX_ENUMERATOR_ARGS) -#define NAN_INDEX_DELETER(name) \ - _NAN_INDEX_DELETER_RETURN_TYPE name( \ - uint32_t index \ - , _NAN_INDEX_DELETER_ARGS) -#define NAN_INDEX_QUERY(name) \ - _NAN_INDEX_QUERY_RETURN_TYPE name(uint32_t index, _NAN_INDEX_QUERY_ARGS) - -class NanCallback { - public: - NanCallback() { - NanScope(); - v8::Local obj = NanNew(); - NanAssignPersistent(handle, obj); - } - - explicit NanCallback(const v8::Handle &fn) { - NanScope(); - v8::Local obj = NanNew(); - NanAssignPersistent(handle, obj); - SetFunction(fn); - } - - ~NanCallback() { - if (handle.IsEmpty()) return; - NanDisposePersistent(handle); - } - - NAN_INLINE void SetFunction(const v8::Handle &fn) { - NanScope(); - NanNew(handle)->Set(NanSymbol("callback"), fn); - } - - NAN_INLINE v8::Local GetFunction () { - return NanNew(handle)->Get(NanSymbol("callback")) - .As(); - } - - void Call(int argc, v8::Handle argv[]) { - NanScope(); -#if (NODE_MODULE_VERSION > 0x000B) // 0.11.12+ - v8::Local callback = NanNew(handle)-> - Get(NanSymbol("callback")).As(); - node::MakeCallback( - nan_isolate - , nan_isolate->GetCurrentContext()->Global() - , callback - , argc - , argv - ); -#else -#if NODE_VERSION_AT_LEAST(0, 8, 0) - v8::Local callback = NanNew(handle)-> - Get(NanSymbol("callback")).As(); - node::MakeCallback( - v8::Context::GetCurrent()->Global() - , callback - , argc - , argv - ); -#else - node::MakeCallback(handle, "callback", argc, argv); -#endif -#endif - } - - private: - v8::Persistent handle; -}; - -/* abstract */ class NanAsyncWorker { - public: - explicit NanAsyncWorker(NanCallback *callback) : callback(callback) { - request.data = this; - errmsg = NULL; - - NanScope(); - v8::Local obj = NanNew(); - NanAssignPersistent(persistentHandle, obj); - } - - virtual ~NanAsyncWorker() { - NanScope(); - - if (!persistentHandle.IsEmpty()) - NanDisposePersistent(persistentHandle); - if (callback) - delete callback; - if (errmsg) - delete errmsg; - } - - virtual void WorkComplete() { - NanScope(); - - if (errmsg == NULL) - HandleOKCallback(); - else - HandleErrorCallback(); - delete callback; - callback = NULL; - } - - NAN_INLINE void SaveToPersistent(const char *key, v8::Local &obj) { - v8::Local handle = NanNew(persistentHandle); - handle->Set(NanSymbol(key), obj); - } - - v8::Local GetFromPersistent(const char *key) { - NanEscapableScope(); - v8::Local handle = NanNew(persistentHandle); - return NanEscapeScope(handle->Get(NanSymbol(key)).As()); - } - - virtual void Execute() = 0; - - uv_work_t request; - - protected: - v8::Persistent persistentHandle; - NanCallback *callback; - const char *errmsg; - - virtual void HandleOKCallback() { - NanScope(); - - callback->Call(0, NULL); - } - - virtual void HandleErrorCallback() { - NanScope(); - - v8::Local argv[] = { - v8::Exception::Error(NanNew(errmsg)) - }; - callback->Call(1, argv); - } -}; - -NAN_INLINE void NanAsyncExecute (uv_work_t* req) { - NanAsyncWorker *worker = static_cast(req->data); - worker->Execute(); -} - -NAN_INLINE void NanAsyncExecuteComplete (uv_work_t* req) { - NanAsyncWorker* worker = static_cast(req->data); - worker->WorkComplete(); - delete worker; -} - -NAN_INLINE void NanAsyncQueueWorker (NanAsyncWorker* worker) { - uv_queue_work( - uv_default_loop() - , &worker->request - , NanAsyncExecute - , (uv_after_work_cb)NanAsyncExecuteComplete - ); -} - -//// Base 64 //// - -#define _nan_base64_encoded_size(size) ((size + 2 - ((size + 2) % 3)) / 3 * 4) - -// Doesn't check for padding at the end. Can be 1-2 bytes over. -NAN_INLINE size_t _nan_base64_decoded_size_fast(size_t size) { - size_t remainder = size % 4; - - size = (size / 4) * 3; - if (remainder) { - if (size == 0 && remainder == 1) { - // special case: 1-byte input cannot be decoded - size = 0; - } else { - // non-padded input, add 1 or 2 extra bytes - size += 1 + (remainder == 3); - } - } - - return size; -} - -template -NAN_INLINE size_t _nan_base64_decoded_size( - const T* src - , size_t size -) { - if (size == 0) - return 0; - - if (src[size - 1] == '=') - size--; - if (size > 0 && src[size - 1] == '=') - size--; - - return _nan_base64_decoded_size_fast(size); -} - -// supports regular and URL-safe base64 -static const int _nan_unbase64_table[] = { - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -2, -1, -1, -2, -1, -1 - , -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 - , -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, 62, -1, 63 - , 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1 - , -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 - , 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, 63 - , -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40 - , 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1 - , -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 - , -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 - , -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 - , -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 - , -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 - , -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 - , -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 - , -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 -}; - -#define _nan_unbase64(x) _nan_unbase64_table[(uint8_t)(x)] - -template static size_t _nan_base64_decode( - char* buf - , size_t len - , const T* src - , const size_t srcLen -) { - char* dst = buf; - char* dstEnd = buf + len; - const T* srcEnd = src + srcLen; - - while (src < srcEnd && dst < dstEnd) { - ptrdiff_t remaining = srcEnd - src; - char a, b, c, d; - - while (_nan_unbase64(*src) < 0 && src < srcEnd) src++, remaining--; - if (remaining == 0 || *src == '=') break; - a = _nan_unbase64(*src++); - - while (_nan_unbase64(*src) < 0 && src < srcEnd) src++, remaining--; - if (remaining <= 1 || *src == '=') break; - b = _nan_unbase64(*src++); - - *dst++ = (a << 2) | ((b & 0x30) >> 4); - if (dst == dstEnd) break; - - while (_nan_unbase64(*src) < 0 && src < srcEnd) src++, remaining--; - if (remaining <= 2 || *src == '=') break; - c = _nan_unbase64(*src++); - - *dst++ = ((b & 0x0F) << 4) | ((c & 0x3C) >> 2); - if (dst == dstEnd) break; - - while (_nan_unbase64(*src) < 0 && src < srcEnd) src++, remaining--; - if (remaining <= 3 || *src == '=') break; - d = _nan_unbase64(*src++); - - *dst++ = ((c & 0x03) << 6) | (d & 0x3F); - } - - return dst - buf; -} - -//// HEX //// - -template unsigned _nan_hex2bin(T c) { - if (c >= '0' && c <= '9') return c - '0'; - if (c >= 'A' && c <= 'F') return 10 + (c - 'A'); - if (c >= 'a' && c <= 'f') return 10 + (c - 'a'); - return static_cast(-1); -} - -template static size_t _nan_hex_decode( - char* buf - , size_t len - , const T* src - , const size_t srcLen -) { - size_t i; - for (i = 0; i < len && i * 2 + 1 < srcLen; ++i) { - unsigned a = _nan_hex2bin(src[i * 2 + 0]); - unsigned b = _nan_hex2bin(src[i * 2 + 1]); - if (!~a || !~b) return i; - buf[i] = a * 16 + b; - } - - return i; -} - -static bool _NanGetExternalParts( - v8::Handle val - , const char** data - , size_t* len -) { - if (node::Buffer::HasInstance(val)) { - *data = node::Buffer::Data(val.As()); - *len = node::Buffer::Length(val.As()); - return true; - } - - assert(val->IsString()); - v8::Local str = NanNew(val.As()); - - if (str->IsExternalAscii()) { - const v8::String::ExternalAsciiStringResource* ext; - ext = str->GetExternalAsciiStringResource(); - *data = ext->data(); - *len = ext->length(); - return true; - - } else if (str->IsExternal()) { - const v8::String::ExternalStringResource* ext; - ext = str->GetExternalStringResource(); - *data = reinterpret_cast(ext->data()); - *len = ext->length(); - return true; - } - - return false; -} - -namespace Nan { - enum Encoding {ASCII, UTF8, BASE64, UCS2, BINARY, HEX, BUFFER}; -} - -NAN_INLINE void* NanRawString( - v8::Handle from - , enum Nan::Encoding encoding - , size_t *datalen - , void *buf - , size_t buflen - , int flags -) { - NanScope(); - - size_t sz_; - size_t term_len = !(flags & v8::String::NO_NULL_TERMINATION); - char *data = NULL; - size_t len; - bool is_extern = _NanGetExternalParts( - from - , const_cast(&data) - , &len); - - if (is_extern && !term_len) { - NanSetPointerSafe(datalen, len); - return data; - } - - v8::Local toStr = from->ToString(); - - char *to = static_cast(buf); - - switch (encoding) { - case Nan::ASCII: -#if NODE_MODULE_VERSION < 0x000C - sz_ = toStr->Length(); - if (to == NULL) { - to = new char[sz_ + term_len]; - } else { - assert(buflen >= sz_ + term_len && "too small buffer"); - } - NanSetPointerSafe( - datalen - , toStr->WriteAscii(to, 0, static_cast(sz_ + term_len), flags)); - return to; -#endif - case Nan::BINARY: - case Nan::BUFFER: - sz_ = toStr->Length(); - if (to == NULL) { - to = new char[sz_ + term_len]; - } else { - assert(buflen >= sz_ + term_len && "too small buffer"); - } -#if NODE_MODULE_VERSION < 0x000C - { - uint16_t* twobytebuf = new uint16_t[sz_ + term_len]; - - size_t len = toStr->Write(twobytebuf, 0, - static_cast(sz_ + term_len), flags); - - for (size_t i = 0; i < sz_ + term_len && i < len + term_len; i++) { - unsigned char *b = reinterpret_cast(&twobytebuf[i]); - to[i] = *b; - } - - NanSetPointerSafe(datalen, len); - - delete[] twobytebuf; - return to; - } -#else - NanSetPointerSafe( - datalen, - toStr->WriteOneByte( - reinterpret_cast(to) - , 0 - , static_cast(sz_ + term_len) - , flags)); - return to; -#endif - case Nan::UTF8: - sz_ = toStr->Utf8Length(); - if (to == NULL) { - to = new char[sz_ + term_len]; - } else { - assert(buflen >= sz_ + term_len && "too small buffer"); - } - NanSetPointerSafe( - datalen - , toStr->WriteUtf8(to, static_cast(sz_ + term_len) - , NULL, flags) - - term_len); - return to; - case Nan::BASE64: - { - v8::String::Value value(toStr); - sz_ = _nan_base64_decoded_size(*value, value.length()); - if (to == NULL) { - to = new char[sz_ + term_len]; - } else { - assert(buflen >= sz_ + term_len); - } - NanSetPointerSafe( - datalen - , _nan_base64_decode(to, sz_, *value, value.length())); - if (term_len) { - to[sz_] = '\0'; - } - return to; - } - case Nan::UCS2: - { - sz_ = toStr->Length(); - if (to == NULL) { - to = new char[(sz_ + term_len) * 2]; - } else { - assert(buflen >= (sz_ + term_len) * 2 && "too small buffer"); - } - - int bc = 2 * toStr->Write( - reinterpret_cast(to) - , 0 - , static_cast(sz_ + term_len) - , flags); - NanSetPointerSafe(datalen, bc); - return to; - } - case Nan::HEX: - { - v8::String::Value value(toStr); - sz_ = value.length(); - assert(!(sz_ & 1) && "bad hex data"); - if (to == NULL) { - to = new char[sz_ / 2 + term_len]; - } else { - assert(buflen >= sz_ / 2 + term_len && "too small buffer"); - } - NanSetPointerSafe( - datalen - , _nan_hex_decode(to, sz_ / 2, *value, value.length())); - } - if (term_len) { - to[sz_ / 2] = '\0'; - } - return to; - default: - assert(0 && "unknown encoding"); - } - return to; -} - -NAN_INLINE char* NanCString( - v8::Handle from - , size_t *datalen - , char *buf = NULL - , size_t buflen = 0 - , int flags = v8::String::NO_OPTIONS -) { - return static_cast( - NanRawString(from, Nan::UTF8, datalen, buf, buflen, flags) - ); -} - -#endif // NAN_H_ diff --git a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/nan/package.json b/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/nan/package.json deleted file mode 100644 index 2ca80f17f86..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/nan/package.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "name": "nan", - "version": "1.0.0", - "description": "Native Abstractions for Node.js: C++ header for Node 0.8->0.12 compatibility", - "main": "include_dirs.js", - "repository": { - "type": "git", - "url": "git://github.com/rvagg/nan.git" - }, - "contributors": [ - { - "name": "Rod Vagg", - "email": "r@va.gg", - "url": "https://github.com/rvagg" - }, - { - "name": "Benjamin Byholm", - "email": "bbyholm@abo.fi", - "url": "https://github.com/kkoopa/" - }, - { - "name": "Trevor Norris", - "email": "trev.norris@gmail.com", - "url": "https://github.com/trevnorris" - }, - { - "name": "Nathan Rajlich", - "email": "nathan@tootallnate.net", - "url": "https://github.com/TooTallNate" - }, - { - "name": "Brett Lawson", - "email": "brett19@gmail.com", - "url": "https://github.com/brett19" - }, - { - "name": "Ben Noordhuis", - "email": "info@bnoordhuis.nl", - "url": "https://github.com/bnoordhuis" - } - ], - "license": "MIT", - "readme": "Native Abstractions for Node.js\n===============================\n\n**A header file filled with macro and utility goodness for making add-on development for Node.js easier across versions 0.8, 0.10 and 0.11, and eventually 0.12.**\n\n***Current version: 1.0.0*** *(See [nan.h](https://github.com/rvagg/nan/blob/master/nan.h) for complete ChangeLog)*\n\n[![NPM](https://nodei.co/npm/nan.png?downloads=true)](https://nodei.co/npm/nan/) [![NPM](https://nodei.co/npm-dl/nan.png?months=6)](https://nodei.co/npm/nan/)\n\nThanks to the crazy changes in V8 (and some in Node core), keeping native addons compiling happily across versions, particularly 0.10 to 0.11/0.12, is a minor nightmare. The goal of this project is to store all logic necessary to develop native Node.js addons without having to inspect `NODE_MODULE_VERSION` and get yourself into a macro-tangle.\n\nThis project also contains some helper utilities that make addon development a bit more pleasant.\n\n * **[News & Updates](#news)**\n * **[Usage](#usage)**\n * **[Example](#example)**\n * **[API](#api)**\n\n\n## News & Updates\n\n### May-2013: Major changes for V8 3.25 / Node 0.11.13\n\nNode 0.11.11 and 0.11.12 were both broken releases for native add-ons, you simply can't properly compile against either of them for different reasons. But we now have a 0.11.13 release that jumps a couple of versions of V8 ahead and includes some more, major (traumatic) API changes.\n\nBecause we are now nearing Node 0.12 and estimate that the version of V8 we are using in Node 0.11.13 will be close to the API we get for 0.12, we have taken the opportunity to not only *fix* NAN for 0.11.13 but make some major changes to improve the NAN API.\n\nWe have **removed support for Node 0.11 versions prior to 0.11.13**, (although our tests are still passing for 0.11.10). As usual, our tests are run against (and pass) the last 5 versions of Node 0.8 and Node 0.10. We also include Node 0.11.13 obviously.\n\nThe major change is something that [Benjamin Byholm](kkoopa) has put many hours in to. We now have a fantastic new `NanNew(args)` interface for creating new `Local`s, this replaces `NanNewLocal()` and much more. If you look in [./nan.h](nan.h) you'll see a large number of overloaded versions of this method. In general you should be able to `NanNew(arguments)` for any type you want to make a `Local` from. This includes `Persistent` types, so we now have a `Local NanNew(const Persistent arg)` to replace `NanPersistentToLocal()`.\n\nWe also now have `NanUndefined()`, `NanNull()`, `NanTrue()` and `NanFalse()`. Mainly because of the new requirement for an `Isolate` argument for each of the native V8 versions of this.\n\nV8 has now introduced an `EscapableHandleScope` from which you `scope.Escape(Local value)` to *return* a value from a one scope to another. This replaces the standard `HandleScope` and `scope.Close(Local value)`, although `HandleScope` still exists for when you don't need to return a handle to the caller. For NAN we are exposing it as `NanEscapableScope()` and `NanEscapeScope()`, while `NanScope()` is still how you create a new scope that doesn't need to return handles. For older versions of Node/V8, it'll still map to the older `HandleScope` functionality.\n\n`NanFromV8String()` was deprecated and has now been removed. You should use `NanCString()` or `NanRawString()` instead.\n\nBecause `node::MakeCallback()` now takes an `Isolate`, and because it doesn't exist in older versions of Node, we've introduced `NanMakeCallabck()`. You should *always* use this when calling a JavaScript function from C++.\n\nThere's lots more, check out the Changelog in nan.h or look through [#86](https://github.com/rvagg/nan/pull/86) for all the gory details.\n\n### Dec-2013: NanCString and NanRawString\n\nTwo new functions have been introduced to replace the functionality that's been provided by `NanFromV8String` until now. NanCString has sensible defaults so it's super easy to fetch a null-terminated c-style string out of a `v8::String`. `NanFromV8String` is still around and has defaults that allow you to pass a single handle to fetch a `char*` while `NanRawString` requires a little more attention to arguments.\n\n### Nov-2013: Node 0.11.9+ breaking V8 change\n\nThe version of V8 that's shipping with Node 0.11.9+ has changed the signature for new `Local`s to: `v8::Local::New(isolate, value)`, i.e. introducing the `isolate` argument and therefore breaking all new `Local` declarations for previous versions. NAN 0.6+ now includes a `NanNewLocal(value)` that can be used in place to work around this incompatibility and maintain compatibility with 0.8->0.11.9+ (minus a few early 0.11 releases).\n\nFor example, if you wanted to return a `null` on a callback you will have to change the argument from `v8::Local::New(v8::Null())` to `NanNewLocal(v8::Null())`.\n\n### Nov-2013: Change to binding.gyp `\"include_dirs\"` for NAN\n\nInclusion of NAN in a project's binding.gyp is now greatly simplified. You can now just use `\"\n## Usage\n\nSimply add **NAN** as a dependency in the *package.json* of your Node addon:\n\n``` bash\n$ npm install --save nan\n```\n\nPull in the path to **NAN** in your *binding.gyp* so that you can use `#include ` in your *.cpp* files:\n\n``` python\n\"include_dirs\" : [\n \"` when compiling your addon.\n\n\n## Example\n\nSee **[LevelDOWN](https://github.com/rvagg/node-leveldown/pull/48)** for a full example of **NAN** in use.\n\nFor a simpler example, see the **[async pi estimation example](https://github.com/rvagg/nan/tree/master/examples/async_pi_estimate)** in the examples directory for full code and an explanation of what this Monte Carlo Pi estimation example does. Below are just some parts of the full example that illustrate the use of **NAN**.\n\nCompare to the current 0.10 version of this example, found in the [node-addon-examples](https://github.com/rvagg/node-addon-examples/tree/master/9_async_work) repository and also a 0.11 version of the same found [here](https://github.com/kkoopa/node-addon-examples/tree/5c01f58fc993377a567812597e54a83af69686d7/9_async_work).\n\nNote that there is no embedded version sniffing going on here and also the async work is made much simpler, see below for details on the `NanAsyncWorker` class.\n\n```c++\n// addon.cc\n#include \n#include \n// ...\n\nusing v8::FunctionTemplate;\nusing v8::Handle;\nusing v8::Object;\n\nvoid InitAll(Handle exports) {\n exports->Set(NanSymbol(\"calculateSync\"),\n NanNew(CalculateSync)->GetFunction());\n\n exports->Set(NanSymbol(\"calculateAsync\"),\n NanNew(CalculateAsync)->GetFunction());\n}\n\nNODE_MODULE(addon, InitAll)\n```\n\n```c++\n// sync.h\n#include \n#include \n\nNAN_METHOD(CalculateSync);\n```\n\n```c++\n// sync.cc\n#include \n#include \n#include \"./sync.h\"\n// ...\n\nusing v8::Number;\n\n// Simple synchronous access to the `Estimate()` function\nNAN_METHOD(CalculateSync) {\n NanScope();\n\n // expect a number as the first argument\n int points = args[0]->Uint32Value();\n double est = Estimate(points);\n\n NanReturnValue(NanNew(est));\n}\n```\n\n```c++\n// async.cc\n#include \n#include \n#include \"./async.h\"\n\n// ...\n\nusing v8::Function;\nusing v8::Local;\nusing v8::Null;\nusing v8::Number;\nusing v8::Value;\n\nclass PiWorker : public NanAsyncWorker {\n public:\n PiWorker(NanCallback *callback, int points)\n : NanAsyncWorker(callback), points(points) {}\n ~PiWorker() {}\n\n // Executed inside the worker-thread.\n // It is not safe to access V8, or V8 data structures\n // here, so everything we need for input and output\n // should go on `this`.\n void Execute () {\n estimate = Estimate(points);\n }\n\n // Executed when the async work is complete\n // this function will be run inside the main event loop\n // so it is safe to use V8 again\n void HandleOKCallback () {\n NanScope();\n\n Local argv[] = {\n NanNew(NanNull())\n , NanNew(estimate)\n };\n\n callback->Call(2, argv);\n };\n\n private:\n int points;\n double estimate;\n};\n\n// Asynchronous access to the `Estimate()` function\nNAN_METHOD(CalculateAsync) {\n NanScope();\n\n int points = args[0]->Uint32Value();\n NanCallback *callback = new NanCallback(args[1].As());\n\n NanAsyncQueueWorker(new PiWorker(callback, points));\n NanReturnUndefined();\n}\n```\n\n\n## API\n\n * NAN_METHOD\n * NAN_GETTER\n * NAN_SETTER\n * NAN_PROPERTY_GETTER\n * NAN_PROPERTY_SETTER\n * NAN_PROPERTY_ENUMERATOR\n * NAN_PROPERTY_DELETER\n * NAN_PROPERTY_QUERY\n * NAN_INDEX_GETTER\n * NAN_INDEX_SETTER\n * NAN_INDEX_ENUMERATOR\n * NAN_INDEX_DELETER\n * NAN_INDEX_QUERY\n * NAN_WEAK_CALLBACK\n * NAN_DEPRECATED\n * NAN_INLINE\n * NanNew\n * NanUndefined\n * NanNull\n * NanTrue\n * NanFalse\n * NanReturnValue\n * NanReturnUndefined\n * NanReturnNull\n * NanReturnEmptyString\n * NanScope\n * NanEscapableScope\n * NanEscapeScope\n * NanLocker\n * NanUnlocker\n * NanGetInternalFieldPointer\n * NanSetInternalFieldPointer\n * NanObjectWrapHandle\n * NanSymbol\n * NanGetPointerSafe\n * NanSetPointerSafe\n * NanRawString\n * NanCString\n * NanBooleanOptionValue\n * NanUInt32OptionValue\n * NanError, NanTypeError, NanRangeError\n * NanThrowError, NanThrowTypeError, NanThrowRangeError, NanThrowError(Handle), NanThrowError(Handle, int)\n * NanNewBufferHandle(char *, size_t, FreeCallback, void *), NanNewBufferHandle(char *, uint32_t), NanNewBufferHandle(uint32_t)\n * NanBufferUse(char *, uint32_t)\n * NanNewContextHandle\n * NanGetCurrentContext\n * NanHasInstance\n * NanDisposePersistent\n * NanAssignPersistent\n * NanMakeWeakPersistent\n * NanSetTemplate\n * NanMakeCallback\n * NanCompileScript\n * NanRunScript\n * NanAdjustExternalMemory\n * NanAddGCEpilogueCallback\n * NanAddGCPrologueCallback\n * NanRemoveGCEpilogueCallback\n * NanRemoveGCPrologueCallback\n * NanGetHeapStatistics\n * NanCallback\n * NanAsyncWorker\n * NanAsyncQueueWorker\n\n\n### NAN_METHOD(methodname)\n\nUse `NAN_METHOD` to define your V8 accessible methods:\n\n```c++\n// .h:\nclass Foo : public node::ObjectWrap {\n ...\n\n static NAN_METHOD(Bar);\n static NAN_METHOD(Baz);\n}\n\n\n// .cc:\nNAN_METHOD(Foo::Bar) {\n ...\n}\n\nNAN_METHOD(Foo::Baz) {\n ...\n}\n```\n\nThe reason for this macro is because of the method signature change in 0.11:\n\n```c++\n// 0.10 and below:\nHandle name(const Arguments& args)\n\n// 0.11 and above\nvoid name(const FunctionCallbackInfo& args)\n```\n\nThe introduction of `FunctionCallbackInfo` brings additional complications:\n\n\n### NAN_GETTER(methodname)\n\nUse `NAN_GETTER` to declare your V8 accessible getters. You get a `Local` `property` and an appropriately typed `args` object that can act like the `args` argument to a `NAN_METHOD` call.\n\nYou can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_GETTER`.\n\n\n### NAN_SETTER(methodname)\n\nUse `NAN_SETTER` to declare your V8 accessible setters. Same as `NAN_GETTER` but you also get a `Local` `value` object to work with.\n\n\n### NAN_PROPERTY_GETTER(cbname)\nUse `NAN_PROPERTY_GETTER` to declare your V8 accessible property getters. You get a `Local` `property` and an appropriately typed `args` object that can act similar to the `args` argument to a `NAN_METHOD` call.\n\nYou can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_PROPERTY_GETTER`.\n\n\n### NAN_PROPERTY_SETTER(cbname)\nUse `NAN_PROPERTY_SETTER` to declare your V8 accessible property setters. Same as `NAN_PROPERTY_GETTER` but you also get a `Local` `value` object to work with.\n\n\n### NAN_PROPERTY_ENUMERATOR(cbname)\nUse `NAN_PROPERTY_ENUMERATOR` to declare your V8 accessible property enumerators. You get an appropriately typed `args` object like the `args` argument to a `NAN_PROPERTY_GETTER` call.\n\nYou can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_PROPERTY_ENUMERATOR`.\n\n\n### NAN_PROPERTY_DELETER(cbname)\nUse `NAN_PROPERTY_DELETER` to declare your V8 accessible property deleters. Same as `NAN_PROPERTY_GETTER`.\n\nYou can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_PROPERTY_DELETER`.\n\n\n### NAN_PROPERTY_QUERY(cbname)\nUse `NAN_PROPERTY_QUERY` to declare your V8 accessible property queries. Same as `NAN_PROPERTY_GETTER`.\n\nYou can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_PROPERTY_QUERY`.\n\n\n### NAN_INDEX_GETTER(cbname)\nUse `NAN_INDEX_GETTER` to declare your V8 accessible index getters. You get a `uint32_t` `index` and an appropriately typed `args` object that can act similar to the `args` argument to a `NAN_METHOD` call.\n\nYou can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_INDEX_GETTER`.\n\n\n### NAN_INDEX_SETTER(cbname)\nUse `NAN_INDEX_SETTER` to declare your V8 accessible index setters. Same as `NAN_INDEX_GETTER` but you also get a `Local` `value` object to work with.\n\n\n### NAN_INDEX_ENUMERATOR(cbname)\nUse `NAN_INDEX_ENUMERATOR` to declare your V8 accessible index enumerators. You get an appropriately typed `args` object like the `args` argument to a `NAN_INDEX_GETTER` call.\n\nYou can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_INDEX_ENUMERATOR`.\n\n\n### NAN_INDEX_DELETER(cbname)\nUse `NAN_INDEX_DELETER` to declare your V8 accessible index deleters. Same as `NAN_INDEX_GETTER`.\n\nYou can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_INDEX_DELETER`.\n\n\n### NAN_INDEX_QUERY(cbname)\nUse `NAN_INDEX_QUERY` to declare your V8 accessible index queries. Same as `NAN_INDEX_GETTER`.\n\nYou can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_INDEX_QUERY`.\n\n\n### NAN_WEAK_CALLBACK(cbname)\n\nUse `NAN_WEAK_CALLBACK` to define your V8 WeakReference callbacks. Do not use for declaration. There is an argument object `const _NanWeakCallbackData &data` allowing access to the weak object and the supplied parameter through its `GetValue` and `GetParameter` methods.\n\n```c++\nNAN_WEAK_CALLBACK(weakCallback) {\n int *parameter = data.GetParameter();\n NanMakeCallback(NanGetCurrentContext()->Global(), data.GetValue(), 0, NULL);\n if ((*parameter)++ == 0) {\n data.Revive();\n } else {\n delete parameter;\n data.Dispose();\n }\n}\n```\n\n\n### NAN_DEPRECATED\nDeclares a function as deprecated.\n\n```c++\nstatic NAN_DEPRECATED NAN_METHOD(foo) {\n ...\n}\n```\n\n\n### NAN_INLINE\nInlines a function.\n\n```c++\nNAN_INLINE int foo(int bar) {\n ...\n}\n```\n\n\n### Local<T> NanNew<T>( ... )\n\nUse `NanNew` to construct almost all v8 objects and make new local handles.\n\n```c++\nLocal s = NanNew(\"value\");\n\n...\n\nPersistent o;\n\n...\n\nLocal lo = NanNew(o);\n\n```\n\n\n### Handle<Primitive> NanUndefined()\n\nUse instead of `Undefined()`\n\n\n### Handle<Primitive> NanNull()\n\nUse instead of `Null()`\n\n\n### Handle<Primitive> NanTrue()\n\nUse instead of `True()`\n\n\n### Handle<Primitive> NanFalse()\n\nUse instead of `False()`\n\n\n### NanReturnValue(Handle<Value>)\n\nUse `NanReturnValue` when you want to return a value from your V8 accessible method:\n\n```c++\nNAN_METHOD(Foo::Bar) {\n ...\n\n NanReturnValue(NanNew(\"FooBar!\"));\n}\n```\n\nNo `return` statement required.\n\n\n### NanReturnUndefined()\n\nUse `NanReturnUndefined` when you don't want to return anything from your V8 accessible method:\n\n```c++\nNAN_METHOD(Foo::Baz) {\n ...\n\n NanReturnUndefined();\n}\n```\n\n\n### NanReturnNull()\n\nUse `NanReturnNull` when you want to return `Null` from your V8 accessible method:\n\n```c++\nNAN_METHOD(Foo::Baz) {\n ...\n\n NanReturnNull();\n}\n```\n\n\n### NanReturnEmptyString()\n\nUse `NanReturnEmptyString` when you want to return an empty `String` from your V8 accessible method:\n\n```c++\nNAN_METHOD(Foo::Baz) {\n ...\n\n NanReturnEmptyString();\n}\n```\n\n\n### NanScope()\n\nThe introduction of `isolate` references for many V8 calls in Node 0.11 makes `NanScope()` necessary, use it in place of `HandleScope scope`:\n\n```c++\nNAN_METHOD(Foo::Bar) {\n NanScope();\n\n NanReturnValue(NanNew(\"FooBar!\"));\n}\n```\n\n\n### NanEscapableScope()\n\nThe separation of handle scopes into escapable and inescapable scopes makes `NanEscapableScope()` necessary, use it in place of `HandleScope scope` when you later wish to `Close()` the scope:\n\n```c++\nHandle Foo::Bar() {\n NanEscapableScope();\n\n return NanEscapeScope(NanNew(\"FooBar!\"));\n}\n```\n\n\n### Local<T> NanEscapeScope(Handle<T> value);\nUse together with `NanEscapableScope` to escape the scope. Corresponds to `HandleScope::Close` or `EscapableHandleScope::Escape`.\n\n\n### NanLocker()\n\nThe introduction of `isolate` references for many V8 calls in Node 0.11 makes `NanLocker()` necessary, use it in place of `Locker locker`:\n\n```c++\nNAN_METHOD(Foo::Bar) {\n NanLocker();\n ...\n NanUnlocker();\n}\n```\n\n\n### NanUnlocker()\n\nThe introduction of `isolate` references for many V8 calls in Node 0.11 makes `NanUnlocker()` necessary, use it in place of `Unlocker unlocker`:\n\n```c++\nNAN_METHOD(Foo::Bar) {\n NanLocker();\n ...\n NanUnlocker();\n}\n```\n\n\n### void * NanGetInternalFieldPointer(Handle<Object>, int)\n\nGets a pointer to the internal field with at `index` from a V8 `Object` handle.\n\n```c++\nLocal obj;\n...\nNanGetInternalFieldPointer(obj, 0);\n```\n\n### void NanSetInternalFieldPointer(Handle<Object>, int, void *)\n\nSets the value of the internal field at `index` on a V8 `Object` handle.\n\n```c++\nstatic Persistent dataWrapperCtor;\n...\nLocal wrapper = NanPersistentToLocal(dataWrapperCtor)->NewInstance();\nNanSetInternalFieldPointer(wrapper, 0, this);\n```\n\n\n### Local<Object> NanObjectWrapHandle(Object)\n\nWhen you want to fetch the V8 object handle from a native object you've wrapped with Node's `ObjectWrap`, you should use `NanObjectWrapHandle`:\n\n```c++\nNanObjectWrapHandle(iterator)->Get(NanSymbol(\"end\"))\n```\n\n\n### String NanSymbol(char *)\n\nUse to create string symbol objects (i.e. `v8::String::NewSymbol(x)`), for getting and setting object properties, or names of objects.\n\n```c++\nbool foo = false;\nif (obj->Has(NanSymbol(\"foo\")))\n foo = optionsObj->Get(NanSymbol(\"foo\"))->BooleanValue()\n```\n\n\n### Type NanGetPointerSafe(Type *[, Type])\n\nA helper for getting values from optional pointers. If the pointer is `NULL`, the function returns the optional default value, which defaults to `0`. Otherwise, the function returns the value the pointer points to.\n\n```c++\nchar *plugh(uint32_t *optional) {\n char res[] = \"xyzzy\";\n uint32_t param = NanGetPointerSafe(optional, 0x1337);\n switch (param) {\n ...\n }\n NanSetPointerSafe(optional, 0xDEADBEEF);\n} \n```\n\n\n### bool NanSetPointerSafe(Type *, Type)\n\nA helper for setting optional argument pointers. If the pointer is `NULL`, the function simply returns `false`. Otherwise, the value is assigned to the variable the pointer points to.\n\n```c++\nconst char *plugh(size_t *outputsize) {\n char res[] = \"xyzzy\";\n if !(NanSetPointerSafe(outputsize, strlen(res) + 1)) {\n ...\n }\n\n ...\n}\n```\n\n\n### void* NanRawString(Handle<Value>, enum Nan::Encoding, size_t *, void *, size_t, int)\n\nWhen you want to convert a V8 `String` to a `char*` buffer, use `NanRawString`. You have to supply an encoding as well as a pointer to a variable that will be assigned the number of bytes in the returned string. It is also possible to supply a buffer and its length to the function in order not to have a new buffer allocated. The final argument allows setting `String::WriteOptions`.\nJust remember that you'll end up with an object that you'll need to `delete[]` at some point unless you supply your own buffer:\n\n```c++\nsize_t count;\nvoid* decoded = NanRawString(args[1], Nan::BASE64, &count, NULL, 0, String::HINT_MANY_WRITES_EXPECTED);\nchar param_copy[count];\nmemcpy(param_copy, decoded, count);\ndelete[] decoded;\n```\n\n\n### char* NanCString(Handle<Value>, size_t *[, char *, size_t, int])\n\nWhen you want to convert a V8 `String` to a null-terminated C `char*` use `NanCString`. The resulting `char*` will be UTF-8-encoded, and you need to supply a pointer to a variable that will be assigned the number of bytes in the returned string. It is also possible to supply a buffer and its length to the function in order not to have a new buffer allocated. The final argument allows optionally setting `String::WriteOptions`, which default to `v8::String::NO_OPTIONS`.\nJust remember that you'll end up with an object that you'll need to `delete[]` at some point unless you supply your own buffer:\n\n```c++\nsize_t count;\nchar* name = NanCString(args[0], &count);\n```\n\n\n### bool NanBooleanOptionValue(Handle<Value>, Handle<String>[, bool])\n\nWhen you have an \"options\" object that you need to fetch properties from, boolean options can be fetched with this pair. They check first if the object exists (`IsEmpty`), then if the object has the given property (`Has`) then they get and convert/coerce the property to a `bool`.\n\nThe optional last parameter is the *default* value, which is `false` if left off:\n\n```c++\n// `foo` is false unless the user supplies a truthy value for it\nbool foo = NanBooleanOptionValue(optionsObj, NanSymbol(\"foo\"));\n// `bar` is true unless the user supplies a falsy value for it\nbool bar = NanBooleanOptionValueDefTrue(optionsObj, NanSymbol(\"bar\"), true);\n```\n\n\n### uint32_t NanUInt32OptionValue(Handle<Value>, Handle<String>, uint32_t)\n\nSimilar to `NanBooleanOptionValue`, use `NanUInt32OptionValue` to fetch an integer option from your options object. Can be any kind of JavaScript `Number` and it will be coerced to an unsigned 32-bit integer.\n\nRequires all 3 arguments as a default is not optional:\n\n```c++\nuint32_t count = NanUInt32OptionValue(optionsObj, NanSymbol(\"count\"), 1024);\n```\n\n\n### NanError(message), NanTypeError(message), NanRangeError(message)\n\nFor making `Error`, `TypeError` and `RangeError` objects.\n\n```c++\nLocal res = NanError(\"you must supply a callback argument\");\n```\n\n\n### NanThrowError(message), NanThrowTypeError(message), NanThrowRangeError(message), NanThrowError(Local<Value>), NanThrowError(Local<Value>, int)\n\nFor throwing `Error`, `TypeError` and `RangeError` objects. You should `return` this call:\n\n```c++\nreturn NanThrowError(\"you must supply a callback argument\");\n```\n\nCan also handle any custom object you may want to throw. If used with the error code argument, it will add the supplied error code to the error object as a property called `code`.\n\n\n### Local<Object> NanNewBufferHandle(char *, uint32_t), Local<Object> NanNewBufferHandle(uint32_t)\n\nThe `Buffer` API has changed a little in Node 0.11, this helper provides consistent access to `Buffer` creation:\n\n```c++\nNanNewBufferHandle((char*)value.data(), value.size());\n```\n\nCan also be used to initialize a `Buffer` with just a `size` argument.\n\nCan also be supplied with a `NanFreeCallback` and a hint for the garbage collector.\n\n\n### Local<Object> NanBufferUse(char*, uint32_t)\n\n`Buffer::New(char*, uint32_t)` prior to 0.11 would make a copy of the data.\nWhile it was possible to get around this, it required a shim by passing a\ncallback. So the new API `Buffer::Use(char*, uint32_t)` was introduced to remove\nneeding to use this shim.\n\n`NanBufferUse` uses the `char*` passed as the backing data, and will free the\nmemory automatically when the weak callback is called. Keep this in mind, as\ncareless use can lead to \"double free or corruption\" and other cryptic failures.\n\n\n### bool NanHasInstance(Persistent<FunctionTemplate>&, Handle<Value>)\n\nCan be used to check the type of an object to determine it is of a particular class you have already defined and have a `Persistent` handle for.\n\n\n### Local<Context> NanNewContextHandle([ExtensionConfiguration*, Handle<ObjectTemplate>, Handle<Value>])\nCreates a new `Local` handle.\n\n```c++\nLocal ftmpl = NanNew();\nLocal otmpl = ftmpl->InstanceTemplate();\nLocal ctx = NanNewContextHandle(NULL, otmpl);\n```\n\n\n### Local NanGetCurrentContext()\n\nGets the current context.\n\n```c++\nLocal ctx = NanGetCurrentContext();\n```\n\n\n### void NanDisposePersistent(Persistent<T> &)\n\nUse `NanDisposePersistent` to dispose a `Persistent` handle.\n\n```c++\nNanDisposePersistent(persistentHandle);\n```\n\n\n### NanAssignPersistent(type, handle, object)\n\nUse `NanAssignPersistent` to assign a non-`Persistent` handle to a `Persistent` one. You can no longer just declare a `Persistent` handle and assign directly to it later, you have to `Reset` it in Node 0.11, so this makes it easier.\n\nIn general it is now better to place anything you want to protect from V8's garbage collector as properties of a generic `Object` and then assign that to a `Persistent`. This works in older versions of Node also if you use `NanAssignPersistent`:\n\n```c++\nPersistent persistentHandle;\n\n...\n\nLocal obj = NanNew();\nobj->Set(NanSymbol(\"key\"), keyHandle); // where keyHandle might be a Local\nNanAssignPersistent(Object, persistentHandle, obj)\n```\n\n\n### NanMakeWeakPersistent(Handle<T> handle, P* parameter, _NanWeakCallbackInfo<T, P>::Callback callback)\n\nCreates a weak persistent handle with the supplied parameter and `NAN_WEAK_CALLBACK`. The callback has to be fully specialized to work on all versions of Node.\n\n```c++\nNAN_WEAK_CALLBACK(weakCallback) {\n\n...\n\n}\n\nLocal func;\n\n...\n\nint *parameter = new int(0);\nNanMakeWeakPersistent(func, parameter, &weakCallback);\n```\n\n\n### NanSetTemplate(templ, name, value)\n\nUse to add properties on object and function templates.\n\n\n### NanMakeCallback(target, func, argc, argv)\n\nUse instead of `node::MakeCallback` to call javascript functions. This is the only proper way of calling functions.\n\n\n### NanCompileScript(Handle s [, const ScriptOrigin& origin])\n\nUse to create new scripts bound to the current context.\n\n\n### NanRunScript(script)\n\nUse to run both bound and unbound scripts.\n\n\n### NanAdjustExternalMemory(int change_in_bytes)\n\nSimply does `AdjustAmountOfExternalAllocatedMemory`\n\n\n### NanAddGCEpilogueCallback(GCEpilogueCallback callback, GCType gc_type_filter=kGCTypeAll)\n\nSimply does `AddGCEpilogueCallback`\n\n\n### NanAddGCPrologueCallback(GCPrologueCallback callback, GCType gc_type_filter=kGCTypeAll)\n\nSimply does `AddGCPrologueCallback`\n\n\n### NanRemoveGCEpilogueCallback(GCEpilogueCallback callback)\n\nSimply does `RemoveGCEpilogueCallback`\n\n\n### NanRemoveGCPrologueCallback(GCPrologueCallback callback)\n\nSimply does `RemoveGCPrologueCallback`\n\n\n### NanGetHeapStatistics(HeapStatistics *heap_statistics)\n\nSimply does `GetHeapStatistics`\n\n\n### NanCallback\n\nBecause of the difficulties imposed by the changes to `Persistent` handles in V8 in Node 0.11, creating `Persistent` versions of your `Handle` is annoyingly tricky. `NanCallback` makes it easier by taking your handle, making it persistent until the `NanCallback` is deleted and even providing a handy `Call()` method to fetch and execute the callback `Function`.\n\n```c++\nLocal callbackHandle = args[0].As();\nNanCallback *callback = new NanCallback(callbackHandle);\n// pass `callback` around and it's safe from GC until you:\ndelete callback;\n```\n\nYou can execute the callback like so:\n\n```c++\n// no arguments:\ncallback->Call(0, NULL);\n\n// an error argument:\nHandle argv[] = {\n NanError(NanNew(\"fail!\"))\n};\ncallback->Call(1, argv);\n\n// a success argument:\nHandle argv[] = {\n NanNull(),\n NanNew(\"w00t!\")\n};\ncallback->Call(2, argv);\n```\n\n`NanCallback` also has a `Local GetCallback()` method that you can use\nto fetch a local handle to the underlying callback function, as well as a\n`void SetFunction(Handle)` for setting the callback on the\n`NanCallback`. Additionally a generic constructor is available for using\n`NanCallback` without performing heap allocations.\n\n\n### NanAsyncWorker\n\n`NanAsyncWorker` is an abstract class that you can subclass to have much of the annoying async queuing and handling taken care of for you. It can even store arbitrary V8 objects for you and have them persist while the async work is in progress.\n\nSee a rough outline of the implementation:\n\n```c++\nclass NanAsyncWorker {\npublic:\n NanAsyncWorker (NanCallback *callback);\n\n // Clean up persistent handles and delete the *callback\n virtual ~NanAsyncWorker ();\n\n // Check the `char *errmsg` property and call HandleOKCallback()\n // or HandleErrorCallback depending on whether it has been set or not\n virtual void WorkComplete ();\n\n // You must implement this to do some async work. If there is an\n // error then allocate `errmsg` to a message and the callback will\n // be passed that string in an Error object\n virtual void Execute ();\n\n // Save a V8 object in a Persistent handle to protect it from GC\n void SavePersistent(const char *key, Local &obj);\n\n // Fetch a stored V8 object (don't call from within `Execute()`)\n Local GetFromPersistent(const char *key);\n\nprotected:\n // Set this if there is an error, otherwise it's NULL\n const char *errmsg;\n\n // Default implementation calls the callback function with no arguments.\n // Override this to return meaningful data\n virtual void HandleOKCallback ();\n\n // Default implementation calls the callback function with an Error object\n // wrapping the `errmsg` string\n virtual void HandleErrorCallback ();\n};\n```\n\n\n### NanAsyncQueueWorker(NanAsyncWorker *)\n\n`NanAsyncQueueWorker` will run a `NanAsyncWorker` asynchronously via libuv. Both the *execute* and *after_work* steps are taken care of for you—most of the logic for this is embedded in `NanAsyncWorker`.\n\n### Contributors\n\nNAN is only possible due to the excellent work of the following contributors:\n\n\n\n\n\n\n\n\n
    Rod VaggGitHub/rvaggTwitter/@rvagg
    Benjamin ByholmGitHub/kkoopa
    Trevor NorrisGitHub/trevnorrisTwitter/@trevnorris
    Nathan RajlichGitHub/TooTallNateTwitter/@TooTallNate
    Brett LawsonGitHub/brett19Twitter/@brett19x
    Ben NoordhuisGitHub/bnoordhuisTwitter/@bnoordhuis
    \n\nLicence & copyright\n-----------------------\n\nCopyright (c) 2014 NAN contributors (listed above).\n\nNative Abstractions for Node.js is licensed under an MIT +no-false-attribs license. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/rvagg/nan/issues" - }, - "homepage": "https://github.com/rvagg/nan", - "_id": "nan@1.0.0", - "_from": "nan@~1.0.0" -} diff --git a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/options/.npmignore b/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/options/.npmignore deleted file mode 100644 index 1b18fb395ab..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/options/.npmignore +++ /dev/null @@ -1,7 +0,0 @@ -npm-debug.log -node_modules -.*.swp -.lock-* -build/ - -test diff --git a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/options/Makefile b/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/options/Makefile deleted file mode 100644 index 7496b6fcc50..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/options/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -ALL_TESTS = $(shell find test/ -name '*.test.js') - -run-tests: - @./node_modules/.bin/mocha \ - -t 2000 \ - $(TESTFLAGS) \ - $(TESTS) - -test: - @$(MAKE) NODE_PATH=lib TESTS="$(ALL_TESTS)" run-tests - -.PHONY: test diff --git a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/options/README.md b/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/options/README.md deleted file mode 100644 index 0dabc7551c4..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/options/README.md +++ /dev/null @@ -1,69 +0,0 @@ -# options.js # - -A very light-weight in-code option parsers for node.js. - -## Usage ## - -``` js -var Options = require("options"); - -// Create an Options object -function foo(options) { - var default_options = { - foo : "bar" - }; - - // Create an option object with default value - var opts = new Options(default_options); - - // Merge options - opts = opts.merge(options); - - // Reset to default value - opts.reset(); - - // Copy selected attributes out - var seled_att = opts.copy("foo"); - - // Read json options from a file. - opts.read("options.file"); // Sync - opts.read("options.file", function(err){ // Async - if(err){ // If error occurs - console.log("File error."); - }else{ - // No error - } - }); - - // Attributes defined or not - opts.isDefinedAndNonNull("foobar"); - opts.isDefined("foobar"); -} - -``` - - -## License ## - -(The MIT License) - -Copyright (c) 2012 Einar Otto Stangvik <einaros@gmail.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/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/options/lib/options.js b/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/options/lib/options.js deleted file mode 100644 index 4fc45e90a8c..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/options/lib/options.js +++ /dev/null @@ -1,86 +0,0 @@ -/*! - * Copyright(c) 2011 Einar Otto Stangvik - * MIT Licensed - */ - -var fs = require('fs'); - -function Options(defaults) { - var internalValues = {}; - var values = this.value = {}; - Object.keys(defaults).forEach(function(key) { - internalValues[key] = defaults[key]; - Object.defineProperty(values, key, { - get: function() { return internalValues[key]; }, - configurable: false, - enumerable: true - }); - }); - this.reset = function() { - Object.keys(defaults).forEach(function(key) { - internalValues[key] = defaults[key]; - }); - return this; - }; - this.merge = function(options, required) { - options = options || {}; - if (Object.prototype.toString.call(required) === '[object Array]') { - var missing = []; - for (var i = 0, l = required.length; i < l; ++i) { - var key = required[i]; - if (!(key in options)) { - missing.push(key); - } - } - if (missing.length > 0) { - if (missing.length > 1) { - throw new Error('options ' + - missing.slice(0, missing.length - 1).join(', ') + ' and ' + - missing[missing.length - 1] + ' must be defined'); - } - else throw new Error('option ' + missing[0] + ' must be defined'); - } - } - Object.keys(options).forEach(function(key) { - if (key in internalValues) { - internalValues[key] = options[key]; - } - }); - return this; - }; - this.copy = function(keys) { - var obj = {}; - Object.keys(defaults).forEach(function(key) { - if (keys.indexOf(key) !== -1) { - obj[key] = values[key]; - } - }); - return obj; - }; - this.read = function(filename, cb) { - if (typeof cb == 'function') { - var self = this; - fs.readFile(filename, function(error, data) { - if (error) return cb(error); - var conf = JSON.parse(data); - self.merge(conf); - cb(); - }); - } - else { - var conf = JSON.parse(fs.readFileSync(filename)); - this.merge(conf); - } - return this; - }; - this.isDefined = function(key) { - return typeof values[key] != 'undefined'; - }; - this.isDefinedAndNonNull = function(key) { - return typeof values[key] != 'undefined' && values[key] !== null; - }; - Object.freeze(values); - Object.freeze(this); -} - -module.exports = Options; diff --git a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/options/package.json b/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/options/package.json deleted file mode 100644 index bb26c80c217..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/options/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "author": { - "name": "Einar Otto Stangvik", - "email": "einaros@gmail.com", - "url": "http://2x.io" - }, - "name": "options", - "description": "A very light-weight in-code option parsers for node.js.", - "version": "0.0.6", - "repository": { - "type": "git", - "url": "git://github.com/einaros/options.js.git" - }, - "main": "lib/options", - "scripts": { - "test": "make test" - }, - "engines": { - "node": ">=0.4.0" - }, - "dependencies": {}, - "devDependencies": { - "mocha": "latest" - }, - "readme": "# options.js #\n\nA very light-weight in-code option parsers for node.js.\n\n## Usage ##\n\n``` js\nvar Options = require(\"options\");\n\n// Create an Options object\nfunction foo(options) {\n var default_options = {\n foo : \"bar\"\n };\n \n // Create an option object with default value\n var opts = new Options(default_options);\n \n // Merge options\n opts = opts.merge(options);\n \n // Reset to default value\n opts.reset();\n \n // Copy selected attributes out\n var seled_att = opts.copy(\"foo\");\n \n // Read json options from a file. \n opts.read(\"options.file\"); // Sync\n opts.read(\"options.file\", function(err){ // Async\n if(err){ // If error occurs\n console.log(\"File error.\");\n }else{\n // No error\n }\n });\n \n // Attributes defined or not\n opts.isDefinedAndNonNull(\"foobar\");\n opts.isDefined(\"foobar\");\n}\n\n```\n\n\n## License ##\n\n(The MIT License)\n\nCopyright (c) 2012 Einar Otto Stangvik <einaros@gmail.com>\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/einaros/options.js/issues" - }, - "homepage": "https://github.com/einaros/options.js", - "_id": "options@0.0.6", - "_from": "options@>=0.0.5" -} diff --git a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/tinycolor/.npmignore b/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/tinycolor/.npmignore deleted file mode 100644 index 6bfffbb79b5..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/tinycolor/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -npm-debug.log -node_modules -.*.swp -.lock-* -build/ diff --git a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/tinycolor/README.md b/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/tinycolor/README.md deleted file mode 100644 index 55eb3c110a5..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/tinycolor/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# tinycolor # - -This is a no-fuzz, barebone, zero muppetry color module for node.js. \ No newline at end of file diff --git a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/tinycolor/example.js b/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/tinycolor/example.js deleted file mode 100644 index f754046854b..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/tinycolor/example.js +++ /dev/null @@ -1,3 +0,0 @@ -require('./tinycolor'); -console.log('this should be red and have an underline!'.grey.underline); -console.log('this should have a blue background!'.bgBlue); \ No newline at end of file diff --git a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/tinycolor/package.json b/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/tinycolor/package.json deleted file mode 100644 index c9a34e93b7b..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/tinycolor/package.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "author": { - "name": "Einar Otto Stangvik", - "email": "einaros@gmail.com", - "url": "http://2x.io" - }, - "name": "tinycolor", - "description": "a to-the-point color module for node", - "version": "0.0.1", - "repository": { - "type": "git", - "url": "git://github.com/einaros/tinycolor.git" - }, - "engines": { - "node": ">=0.4.0" - }, - "dependencies": {}, - "devDependencies": {}, - "main": "tinycolor", - "readme": "# tinycolor #\n\nThis is a no-fuzz, barebone, zero muppetry color module for node.js.", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/einaros/tinycolor/issues" - }, - "homepage": "https://github.com/einaros/tinycolor", - "_id": "tinycolor@0.0.1", - "_from": "tinycolor@0.x" -} diff --git a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/tinycolor/tinycolor.js b/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/tinycolor/tinycolor.js deleted file mode 100644 index 36e552c4ccb..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/node_modules/tinycolor/tinycolor.js +++ /dev/null @@ -1,31 +0,0 @@ -var styles = { - 'bold': ['\033[1m', '\033[22m'], - 'italic': ['\033[3m', '\033[23m'], - 'underline': ['\033[4m', '\033[24m'], - 'inverse': ['\033[7m', '\033[27m'], - 'black': ['\033[30m', '\033[39m'], - 'red': ['\033[31m', '\033[39m'], - 'green': ['\033[32m', '\033[39m'], - 'yellow': ['\033[33m', '\033[39m'], - 'blue': ['\033[34m', '\033[39m'], - 'magenta': ['\033[35m', '\033[39m'], - 'cyan': ['\033[36m', '\033[39m'], - 'white': ['\033[37m', '\033[39m'], - 'default': ['\033[39m', '\033[39m'], - 'grey': ['\033[90m', '\033[39m'], - 'bgBlack': ['\033[40m', '\033[49m'], - 'bgRed': ['\033[41m', '\033[49m'], - 'bgGreen': ['\033[42m', '\033[49m'], - 'bgYellow': ['\033[43m', '\033[49m'], - 'bgBlue': ['\033[44m', '\033[49m'], - 'bgMagenta': ['\033[45m', '\033[49m'], - 'bgCyan': ['\033[46m', '\033[49m'], - 'bgWhite': ['\033[47m', '\033[49m'], - 'bgDefault': ['\033[49m', '\033[49m'] -} -Object.keys(styles).forEach(function(style) { - Object.defineProperty(String.prototype, style, { - get: function() { return styles[style][0] + this + styles[style][1]; }, - enumerable: false - }); -}); diff --git a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/package.json b/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/package.json deleted file mode 100644 index fbfd001e825..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/package.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "author": { - "name": "Einar Otto Stangvik", - "email": "einaros@gmail.com", - "url": "http://2x.io" - }, - "name": "ws", - "description": "simple to use, blazing fast and thoroughly tested websocket client, server and console for node.js, up-to-date against RFC-6455", - "version": "0.4.32", - "keywords": [ - "Hixie", - "HyBi", - "Push", - "RFC-6455", - "WebSocket", - "WebSockets", - "real-time" - ], - "repository": { - "type": "git", - "url": "git://github.com/einaros/ws.git" - }, - "bin": { - "wscat": "./bin/wscat" - }, - "scripts": { - "test": "make test", - "install": "(node-gyp rebuild 2> builderror.log) || (exit 0)" - }, - "engines": { - "node": ">=0.4.0" - }, - "dependencies": { - "commander": "~2.1.0", - "nan": "~1.0.0", - "tinycolor": "0.x", - "options": ">=0.0.5" - }, - "devDependencies": { - "mocha": "1.12.0", - "should": "1.2.x", - "expect.js": "0.2.x", - "benchmark": "0.3.x", - "ansi": "latest" - }, - "browser": "./lib/browser.js", - "component": { - "scripts": { - "ws/index.js": "./lib/browser.js" - } - }, - "gypfile": true, - "readme": "[![Build Status](https://secure.travis-ci.org/einaros/ws.png)](http://travis-ci.org/einaros/ws)\n\n# ws: a node.js websocket library #\n\n`ws` is a simple to use websocket implementation, up-to-date against RFC-6455, and [probably the fastest WebSocket library for node.js](http://web.archive.org/web/20130314230536/http://hobbycoding.posterous.com/the-fastest-websocket-module-for-nodejs).\n\nPasses the quite extensive Autobahn test suite. See http://einaros.github.com/ws for the full reports.\n\nComes with a command line utility, `wscat`, which can either act as a server (--listen), or client (--connect); Use it to debug simple websocket services.\n\n## Protocol support ##\n\n* **Hixie draft 76** (Old and deprecated, but still in use by Safari and Opera. Added to ws version 0.4.2, but server only. Can be disabled by setting the `disableHixie` option to true.)\n* **HyBi drafts 07-12** (Use the option `protocolVersion: 8`, or argument `-p 8` for wscat)\n* **HyBi drafts 13-17** (Current default, alternatively option `protocolVersion: 13`, or argument `-p 13` for wscat)\n\n_See the echo.websocket.org example below for how to use the `protocolVersion` option._\n\n## Usage ##\n\n### Installing ###\n\n`npm install ws`\n\n### Sending and receiving text data ###\n\n```js\nvar WebSocket = require('ws');\nvar ws = new WebSocket('ws://www.host.com/path');\nws.on('open', function() {\n ws.send('something');\n});\nws.on('message', function(data, flags) {\n // flags.binary will be set if a binary data is received\n // flags.masked will be set if the data was masked\n});\n```\n\n### Sending binary data ###\n\n```js\nvar WebSocket = require('ws');\nvar ws = new WebSocket('ws://www.host.com/path');\nws.on('open', function() {\n var array = new Float32Array(5);\n for (var i = 0; i < array.length; ++i) array[i] = i / 2;\n ws.send(array, {binary: true, mask: true});\n});\n```\n\nSetting `mask`, as done for the send options above, will cause the data to be masked according to the websocket protocol. The same option applies for text data.\n\n### Server example ###\n\n```js\nvar WebSocketServer = require('ws').Server\n , wss = new WebSocketServer({port: 8080});\nwss.on('connection', function(ws) {\n ws.on('message', function(message) {\n console.log('received: %s', message);\n });\n ws.send('something');\n});\n```\n\n### Server sending broadcast data ###\n\n```js\nvar WebSocketServer = require('ws').Server\n , wss = new WebSocketServer({port: 8080});\n \nwss.broadcast = function(data) {\n\tfor(var i in this.clients)\n\t\tthis.clients[i].send(data);\n};\n```\n\n### Error handling best practices ###\n\n```js\n// If the WebSocket is closed before the following send is attempted\nws.send('something');\n\n// Errors (both immediate and async write errors) can be detected in an optional callback.\n// The callback is also the only way of being notified that data has actually been sent.\nws.send('something', function(error) {\n // if error is null, the send has been completed,\n // otherwise the error object will indicate what failed.\n});\n\n// Immediate errors can also be handled with try/catch-blocks, but **note**\n// that since sends are inherently asynchronous, socket write failures will *not*\n// be captured when this technique is used.\ntry {\n ws.send('something');\n}\ncatch (e) {\n // handle error\n}\n```\n\n### echo.websocket.org demo ###\n\n```js\nvar WebSocket = require('ws');\nvar ws = new WebSocket('ws://echo.websocket.org/', {protocolVersion: 8, origin: 'http://websocket.org'});\nws.on('open', function() {\n console.log('connected');\n ws.send(Date.now().toString(), {mask: true});\n});\nws.on('close', function() {\n console.log('disconnected');\n});\nws.on('message', function(data, flags) {\n console.log('Roundtrip time: ' + (Date.now() - parseInt(data)) + 'ms', flags);\n setTimeout(function() {\n ws.send(Date.now().toString(), {mask: true});\n }, 500);\n});\n```\n\n### wscat against echo.websocket.org ###\n\n $ npm install -g ws\n $ wscat -c ws://echo.websocket.org \n connected (press CTRL+C to quit)\n > hi there\n < hi there\n > are you a happy parrot?\n < are you a happy parrot?\n\n### Other examples ###\n\nFor a full example with a browser client communicating with a ws server, see the examples folder.\n\nNote that the usage together with Express 3.0 is quite different from Express 2.x. The difference is expressed in the two different serverstats-examples.\n\nOtherwise, see the test cases.\n\n### Running the tests ###\n\n`make test`\n\n## API Docs ##\n\nSee the doc/ directory for Node.js-like docs for the ws classes.\n\n## License ##\n\n(The MIT License)\n\nCopyright (c) 2011 Einar Otto Stangvik <einaros@gmail.com>\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/einaros/ws/issues" - }, - "homepage": "https://github.com/einaros/ws", - "_id": "ws@0.4.32", - "_from": "ws@~0.4.31" -} diff --git a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/src/bufferutil.cc b/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/src/bufferutil.cc deleted file mode 100644 index 7f99bd6b269..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/src/bufferutil.cc +++ /dev/null @@ -1,117 +0,0 @@ -/*! - * ws: a node.js websocket client - * Copyright(c) 2011 Einar Otto Stangvik - * MIT Licensed - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include "nan.h" - -using namespace v8; -using namespace node; - -class BufferUtil : public ObjectWrap -{ -public: - - static void Initialize(v8::Handle target) - { - NanScope(); - Local t = NanNew(New); - t->InstanceTemplate()->SetInternalFieldCount(1); - NODE_SET_METHOD(t, "unmask", BufferUtil::Unmask); - NODE_SET_METHOD(t, "mask", BufferUtil::Mask); - NODE_SET_METHOD(t, "merge", BufferUtil::Merge); - target->Set(NanSymbol("BufferUtil"), t->GetFunction()); - } - -protected: - - static NAN_METHOD(New) - { - NanScope(); - BufferUtil* bufferUtil = new BufferUtil(); - bufferUtil->Wrap(args.This()); - NanReturnValue(args.This()); - } - - static NAN_METHOD(Merge) - { - NanScope(); - Local bufferObj = args[0]->ToObject(); - char* buffer = Buffer::Data(bufferObj); - Local array = Local::Cast(args[1]); - unsigned int arrayLength = array->Length(); - size_t offset = 0; - unsigned int i; - for (i = 0; i < arrayLength; ++i) { - Local src = array->Get(i)->ToObject(); - size_t length = Buffer::Length(src); - memcpy(buffer + offset, Buffer::Data(src), length); - offset += length; - } - NanReturnValue(NanTrue()); - } - - static NAN_METHOD(Unmask) - { - NanScope(); - Local buffer_obj = args[0]->ToObject(); - size_t length = Buffer::Length(buffer_obj); - Local mask_obj = args[1]->ToObject(); - unsigned int *mask = (unsigned int*)Buffer::Data(mask_obj); - unsigned int* from = (unsigned int*)Buffer::Data(buffer_obj); - size_t len32 = length / 4; - unsigned int i; - for (i = 0; i < len32; ++i) *(from + i) ^= *mask; - from += i; - switch (length % 4) { - case 3: *((unsigned char*)from+2) = *((unsigned char*)from+2) ^ ((unsigned char*)mask)[2]; - case 2: *((unsigned char*)from+1) = *((unsigned char*)from+1) ^ ((unsigned char*)mask)[1]; - case 1: *((unsigned char*)from ) = *((unsigned char*)from ) ^ ((unsigned char*)mask)[0]; - case 0:; - } - NanReturnValue(NanTrue()); - } - - static NAN_METHOD(Mask) - { - NanScope(); - Local buffer_obj = args[0]->ToObject(); - Local mask_obj = args[1]->ToObject(); - unsigned int *mask = (unsigned int*)Buffer::Data(mask_obj); - Local output_obj = args[2]->ToObject(); - unsigned int dataOffset = args[3]->Int32Value(); - unsigned int length = args[4]->Int32Value(); - unsigned int* to = (unsigned int*)(Buffer::Data(output_obj) + dataOffset); - unsigned int* from = (unsigned int*)Buffer::Data(buffer_obj); - unsigned int len32 = length / 4; - unsigned int i; - for (i = 0; i < len32; ++i) *(to + i) = *(from + i) ^ *mask; - to += i; - from += i; - switch (length % 4) { - case 3: *((unsigned char*)to+2) = *((unsigned char*)from+2) ^ *((unsigned char*)mask+2); - case 2: *((unsigned char*)to+1) = *((unsigned char*)from+1) ^ *((unsigned char*)mask+1); - case 1: *((unsigned char*)to ) = *((unsigned char*)from ) ^ *((unsigned char*)mask); - case 0:; - } - NanReturnValue(NanTrue()); - } -}; - -extern "C" void init (Handle target) -{ - NanScope(); - BufferUtil::Initialize(target); -} - -NODE_MODULE(bufferutil, init) - diff --git a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/src/validation.cc b/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/src/validation.cc deleted file mode 100644 index 0d9e242ad68..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/transports/node/node_modules/ws/src/validation.cc +++ /dev/null @@ -1,145 +0,0 @@ -/*! - * ws: a node.js websocket client - * Copyright(c) 2011 Einar Otto Stangvik - * MIT Licensed - */ - -#include -#include -#include -#include -#include -#include -#include -#include "nan.h" - -using namespace v8; -using namespace node; - -#define UNI_SUR_HIGH_START (uint32_t) 0xD800 -#define UNI_SUR_LOW_END (uint32_t) 0xDFFF -#define UNI_REPLACEMENT_CHAR (uint32_t) 0x0000FFFD -#define UNI_MAX_LEGAL_UTF32 (uint32_t) 0x0010FFFF - -static const uint8_t trailingBytesForUTF8[256] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, - 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 3,3,3,3,3,3,3,3,4,4,4,4,5,5,5,5 -}; - -static const uint32_t offsetsFromUTF8[6] = { - 0x00000000, 0x00003080, 0x000E2080, - 0x03C82080, 0xFA082080, 0x82082080 -}; - -static int isLegalUTF8(const uint8_t *source, const int length) -{ - uint8_t a; - const uint8_t *srcptr = source+length; - switch (length) { - default: return 0; - /* Everything else falls through when "true"... */ - /* RFC3629 makes 5 & 6 bytes UTF-8 illegal - case 6: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return 0; - case 5: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return 0; */ - case 4: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return 0; - case 3: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return 0; - case 2: if ((a = (*--srcptr)) > 0xBF) return 0; - switch (*source) { - /* no fall-through in this inner switch */ - case 0xE0: if (a < 0xA0) return 0; break; - case 0xED: if (a > 0x9F) return 0; break; - case 0xF0: if (a < 0x90) return 0; break; - case 0xF4: if (a > 0x8F) return 0; break; - default: if (a < 0x80) return 0; - } - - case 1: if (*source >= 0x80 && *source < 0xC2) return 0; - } - if (*source > 0xF4) return 0; - return 1; -} - -int is_valid_utf8 (size_t len, char *value) -{ - /* is the string valid UTF-8? */ - for (unsigned int i = 0; i < len; i++) { - uint32_t ch = 0; - uint8_t extrabytes = trailingBytesForUTF8[(uint8_t) value[i]]; - - if (extrabytes + i >= len) - return 0; - - if (isLegalUTF8 ((uint8_t *) (value + i), extrabytes + 1) == 0) return 0; - - switch (extrabytes) { - case 5 : ch += (uint8_t) value[i++]; ch <<= 6; - case 4 : ch += (uint8_t) value[i++]; ch <<= 6; - case 3 : ch += (uint8_t) value[i++]; ch <<= 6; - case 2 : ch += (uint8_t) value[i++]; ch <<= 6; - case 1 : ch += (uint8_t) value[i++]; ch <<= 6; - case 0 : ch += (uint8_t) value[i]; - } - - ch -= offsetsFromUTF8[extrabytes]; - - if (ch <= UNI_MAX_LEGAL_UTF32) { - if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) - return 0; - } else { - return 0; - } - } - - return 1; -} - -class Validation : public ObjectWrap -{ -public: - - static void Initialize(v8::Handle target) - { - NanScope(); - Local t = NanNew(New); - t->InstanceTemplate()->SetInternalFieldCount(1); - NODE_SET_METHOD(t, "isValidUTF8", Validation::IsValidUTF8); - target->Set(NanSymbol("Validation"), t->GetFunction()); - } - -protected: - - static NAN_METHOD(New) - { - NanScope(); - Validation* validation = new Validation(); - validation->Wrap(args.This()); - NanReturnValue(args.This()); - } - - static NAN_METHOD(IsValidUTF8) - { - NanScope(); - if (!Buffer::HasInstance(args[0])) { - return NanThrowTypeError("First argument needs to be a buffer"); - } - Local buffer_obj = args[0]->ToObject(); - char *buffer_data = Buffer::Data(buffer_obj); - size_t buffer_length = Buffer::Length(buffer_obj); - NanReturnValue(is_valid_utf8(buffer_length, buffer_data) == 1 ? NanTrue() : NanFalse()); - } -}; - -extern "C" void init (Handle target) -{ - NanScope(); - Validation::Initialize(target); -} - -NODE_MODULE(validation, init) - diff --git a/src/LiveDevelopment/MultiBrowserImpl/transports/node/package.json b/src/LiveDevelopment/MultiBrowserImpl/transports/node/package.json deleted file mode 100644 index 1b7dea6a9aa..00000000000 --- a/src/LiveDevelopment/MultiBrowserImpl/transports/node/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "brackets-livedev-multibrowser-server", - "dependencies": { - "ws": "~0.4.31", - "lodash": "~2.4.1" - } -} diff --git a/test/node/node_modules/fs-extra/.npmignore b/test/node/node_modules/fs-extra/.npmignore deleted file mode 100644 index 40b878db5b1..00000000000 --- a/test/node/node_modules/fs-extra/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules/ \ No newline at end of file diff --git a/test/node/node_modules/fs-extra/.travis.yml b/test/node/node_modules/fs-extra/.travis.yml deleted file mode 100644 index 84fd7ca248a..00000000000 --- a/test/node/node_modules/fs-extra/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js -node_js: - - 0.6 - - 0.8 - - 0.9 diff --git a/test/node/node_modules/fs-extra/CHANGELOG.md b/test/node/node_modules/fs-extra/CHANGELOG.md deleted file mode 100644 index 2e55cc05a02..00000000000 --- a/test/node/node_modules/fs-extra/CHANGELOG.md +++ /dev/null @@ -1,67 +0,0 @@ -0.5.0 / 2013-02-03 ------------------- -* Removed `readTextFile`. -* Renamed `readJSONFile` to `readJSON` and `readJson`, same with write. -* Restructured documentation a bit. Added roadmap. - -0.4.0 / 2013-01-28 ------------------- -* Set default spaces in `jsonfile` from 4 to 2. -* Updated `testutil` deps for tests. -* Renamed `touch()` to `createFile()` -* Added `outputFile()` and `outputFileSync()` -* Changed creation of testing diretories so the /tmp dir is not littered. -* Added `readTextFile()` and `readTextFileSync()`. - -0.3.2 / 2012-11-01 ------------------- -* Added `touch()` and `touchSync()` methods. - -0.3.1 / 2012-10-11 ------------------- -* Fixed some stray globals. - -0.3.0 / 2012-10-09 ------------------- -* Removed all CoffeeScript from tests. -* Renamed `mkdir` to `mkdirs`/`mkdirp`. - -0.2.1 / 2012-09-11 ------------------- -* Updated `rimraf` dep. - -0.2.0 / 2012-09-10 ------------------- -* Rewrote module into JavaScript. (Must still rewrite tests into JavaScript) -* Added all methods of [jsonfile][https://github.com/jprichardson/node-jsonfile] -* Added Travis-CI. - -0.1.3 / 2012-08-13 ------------------- -* Added method `readJSONFile`. - -0.1.2 / 2012-06-15 ------------------- -* Bug fix: `deleteSync()` didn't exist. -* Verified Node v0.8 compatibility. - -0.1.1 / 2012-06-15 ------------------- -* Fixed bug in `remove()`/`delete()` that wouldn't execute the function if a callback wasn't passed. - -0.1.0 / 2012-05-31 ------------------- -* Renamed `copyFile()` to `copy()`. `copy()` can now copy directories (recursively) too. -* Renamed `rmrf()` to `remove()`. -* `remove()` aliased with `delete()`. -* Added `mkdirp` capabilities. Named: `mkdir()`. Hides Node.js native `mkdir()`. -* Instead of exporting the native `fs` module with new functions, I now copy over the native methods to a new object and export that instead. - -0.0.4 / 2012-03-14 ------------------- -* Removed CoffeeScript dependency - -0.0.3 / 2012-01-11 ------------------- -* Added methods rmrf and rmrfSync -* Moved tests from Jasmine to Mocha diff --git a/test/node/node_modules/fs-extra/LICENSE b/test/node/node_modules/fs-extra/LICENSE deleted file mode 100644 index fab2a8c6ac9..00000000000 --- a/test/node/node_modules/fs-extra/LICENSE +++ /dev/null @@ -1,16 +0,0 @@ - -(The MIT License) - -Copyright (c) 2011 JP Richardson - -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. \ No newline at end of file diff --git a/test/node/node_modules/fs-extra/README.md b/test/node/node_modules/fs-extra/README.md deleted file mode 100644 index 6adf282804c..00000000000 --- a/test/node/node_modules/fs-extra/README.md +++ /dev/null @@ -1,281 +0,0 @@ -[![build status](https://secure.travis-ci.org/jprichardson/node-fs-extra.png)](http://travis-ci.org/jprichardson/node-fs-extra) - -Node.js: fs-extra -================= - -This module adds a few extra file system methods that aren't included in the native `fs` module. It is a drop in replacement for `fs`. - - - -Why? ----- - -I got tired of including `mkdirp`, `rimraf`, and `cp -r` in most of my projects. - - - - -Installation ------------- - - npm install fs-extra - - - -Usage ------ - -```javascript -var fs = require('fs-extra'); -``` - - - -Methods -------- - -**NOTE:** You can still use the native Node.js methods. They are copied over to `fs-extra`. - - -### copy(src, dest, callback) - -Copy a file or directory. The directory can have contents. Like `cp -r`. There isn't a synchronous version implemented yet. - -Sync: (none) - - -Examples: - -```javascript -var fs = require('fs-extra'); - -fs.copy('/tmp/myfile', '/tmp/mynewfile', function(err){ - if (err) { - console.error(err); - } - else { - console.log("success!") - } -}); //copies file - -fs.copy('/tmp/mydir', '/tmp/mynewdir', function(err){ - if (err) { - console.error(err); - } - else { - console.log("success!") - } -}); //copies directory, even if it has subdirectories or files -``` - - -### createFile(file, callback) - -Creates a file. If the file that is requested to be created is in directories that do not exist, these directories are created. If the file already exists, it is **NOT MODIFIED**. - -Sync: `createFileSync()` - - -Example: - -```javascript -var fs = require('fs-extra') - , file = '/tmp/this/path/does/not/exist/file.txt' - -fs.createFile(file, function(err) { - console.log(err); //null - - //file has now been created, including the directory it is to be placed in -}) -``` - - -### exists() / existsSync() - -These methods are actually from `path` in v0.6. But in Node v0.8 they are moved from `path` to `fs`. So you can use this module to help make your modules v0.6 and v0.8 compatible. - - - -### mkdirs(dir, callback) - -Creates a directory. If the parent hierarchy doesn't exist, it's created. Like `mkdir -p`. - -Alias: `mkdirp()` - -Sync: `mkdirsSync()` / `mkdirpSync()` - - -Examples: - -```javascript -var fs = require('fs-extra'); - -fs.mkdirs('/tmp/some/long/path/that/prob/doesnt/exist', function(err){ - if (err) { - console.error(err); - } - else { - console.log("success!") - } -}); - -fs.mkdirsSync('/tmp/another/path'); -``` - - -### outputFile(file, data, callback) - -Almost the same as `writeFile`, except that if the directory does not exist, it's created. - -Sync: `outputFileSync()` - - -Example: - -```javascript -var fs = require('fs-extra') - , file = '/tmp/this/path/does/not/exist/file.txt' - -fs.outputFile(file, 'hello!' function(err) { - console.log(err); //null - - fs.readFile(file, 'utf8', function(err, data) { - console.log(data); //hello! - }) -}) -``` - - -### readJson(file, callback) - -Reads a JSON file and then parses it into an object. - -Alias: `readJSON()` - -Sync: `readJsonSync()`, `readJSONSync()` - - -Example: - -```javascript -var fs = require('fs-extra'); - -fs.readJson('./package.json', function(err, packageObj) { - console.log(packageObj.version); //0.1.3 -}); -``` - - -### remove(dir, callback) - -Removes a file or directory. The directory can have contents. Like `rm -rf`. - -Alias: `delete()` - -Sync: `removeSync()` / `deleteSync()` - - -Examples: - -```javascript -var fs = require('fs-extra'); - -fs.remove('/tmp/myfile', function(err){ - if (err) { - console.error(err); - } - else { - console.log("success!") - } -}); - -fs.removeSync('/home/jprichardson'); //I just deleted my entire HOME directory. -``` - - - -### writeJson(file, object, callback) - -Writes an object to a JSON file. - -Alias: `writeJSON()` - -Sync: `writeJsonSync()`, `writeJSONSync()` - -Example: - -```javascript -var fs = require('fs-extra'); -fs.writeJson('./package.json', {name: 'fs-extra'}, function(err){ - console.log(err); -}); -``` - - - -Roadmap -------- - -This contains items that I'm considering doing. I'd love community feedback. - -* File system walker. I really like this one: https://github.com/daaku/nodejs-walker -* File/directory tree watcher. There are quite a few. -* Method to move files. -* Copy sync. -* Thinking about moving `rimraf`, `ncp`, and `mkdirps` code into this library. I'd like fs-extra to be a stable library that module authors -can depend upon. A bunch of other dependencies kinda sucks for modules/libraries. -* Change documentation to use the `fse` prefix instead of `fs`. This may encourage people to start using `fse` as a prefix and hence make their code clearer that they're not using the native `fs`. I'm very undecided on this one since `fs-extra` is a drop in replacement for the native `fs`. - - - -Naming ------- - -I put a lot of thought into the naming of these function. Inspired by @coolaj86's request. So he deserves much of the credit for raising the issue. See discussion(s) here: - -* https://github.com/jprichardson/node-fs-extra/issues/2 -* https://github.com/flatiron/utile/issues/11 -* https://github.com/ryanmcgrath/wrench-js/issues/29 -* https://github.com/substack/node-mkdirp/issues/17 - -First, I believe that in as many cases as possible, the [Node.js naming schemes](http://nodejs.org/api/fs.html) should be chosen. However, there are problems with the Node.js own naming schemes. - -For example, `fs.readFile()` and `fs.readdir()`: the **F** is capitalized in *File* and the **d** is not capitalized in *dir*. Perhaps a bit pedantic, but they should still be consistent. Also, Node.js has chosen a lot of POSIX naming schemes, which I believe is great. See: `fs.mkdir()`, `fs.rmdir()`, `fs.chown()`, etc. - -We have a dilemma though. How do you consistently name methods that perform the following POSIX commands: `cp`, `cp -r`, `mkdir -p`, and `rm -rf`? - -My perspective: when in doubt, err on the side of simplicity. Consider that for a moment. A directory is just a hierarchical grouping of directories and files. So when you want to copy it or remove it, in most cases you'll want to copy or remove all of its contents. When you want to create a directory, if the directory that it's suppose to be contained in does not exist, then in most cases you'll want to create that too. - -So, if you want to remove a file or a directory regardless of whether it has contents, just call `fs.remove(path)` or its alias `fs.delete(path)`. If you want to copy a file or a directory whether it has contents, just call `fs.copy(source, destination)`. If you want to create a directory regardless of whether its parent directories exist, just call `fs.mkdirs(path)` or `fs.mkdirp(path)`. - - - -Author ------- - -`node-fs-extra` was written by [JP Richardson][aboutjp]. You should follow him on Twitter [@jprichardson][twitter]. Also read his coding blog [Procbits][procbits]. If you write software with others, you should checkout [Gitpilot][gitpilot] to make collaboration with Git simple. - - - - -License -------- - - -Licensed under MIT - -Copyright (c) 2011-2013 JP Richardson - -[1]: http://nodejs.org/docs/latest/api/fs.html - - -[jsonfile]: https://github.com/jprichardson/node-jsonfile - - -[aboutjp]: http://about.me/jprichardson -[twitter]: http://twitter.com/jprichardson -[procbits]: http://procbits.com -[gitpilot]: http://gitpilot.com - - - diff --git a/test/node/node_modules/fs-extra/lib/copy.js b/test/node/node_modules/fs-extra/lib/copy.js deleted file mode 100644 index f23539b1bf6..00000000000 --- a/test/node/node_modules/fs-extra/lib/copy.js +++ /dev/null @@ -1,42 +0,0 @@ -var fs = require('fs') - , ncp = require('ncp').ncp; - -var BUF_LENGTH = 64 * 1024; -var _buff = new Buffer(BUF_LENGTH); - -var copyFileSync = function(srcFile, destFile) { - var bytesRead, fdr, fdw, pos; - fdr = fs.openSync(srcFile, 'r'); - fdw = fs.openSync(destFile, 'w'); - bytesRead = 1; - pos = 0; - while (bytesRead > 0) { - bytesRead = fs.readSync(fdr, _buff, 0, BUF_LENGTH, pos); - fs.writeSync(fdw, _buff, 0, bytesRead); - pos += bytesRead; - } - fs.closeSync(fdr); - return fs.closeSync(fdw); -}; - -var copyFile = function(srcFile, destFile, cb) { - var fdr, fdw; - fdr = fs.createReadStream(srcFile); - fdw = fs.createWriteStream(destFile); - fdr.on('end', function() { - return cb(null); - }); - return fdr.pipe(fdw); -}; - -function copy(source, dest, callback) { - if (callback) - ncp(source, dest, callback); - else - ncp(source, dest, function(){}); -}; - - -module.exports.copyFileSync = copyFileSync; -module.exports.copyFile = copyFile; -module.exports.copy = copy; \ No newline at end of file diff --git a/test/node/node_modules/fs-extra/lib/create.js b/test/node/node_modules/fs-extra/lib/create.js deleted file mode 100644 index 8752388a573..00000000000 --- a/test/node/node_modules/fs-extra/lib/create.js +++ /dev/null @@ -1,53 +0,0 @@ -var mkdir = require('./mkdir') - , path = require('path') - , fs = require('fs') - , exists = fs.exists || path.exists - , existsSync = fs.existsSync || path.existsSync - -function createFile (file, callback) { - exists(file, function(fileExists) { - if (fileExists) - return callback(null); - else { - var dir = path.dirname(file); - - function makeFile() { - fs.writeFile(file, '', function(err) { - if (err) - callback(err) - else - callback(null); - }) - } - - exists(dir, function(dirExists) { - if (!dirExists) { - mkdir.mkdirs(dir, function(err) { - if (err) - callback(err) - else - makeFile(); - }) - } else { - makeFile(); - } - }) - } - }) -} - - -function createFileSync (file) { - if (existsSync(file)) - return; - - var dir = path.dirname(file); - if (!existsSync(dir)) - mkdir.mkdirsSync(dir); - - fs.writeFileSync(file, ''); -} - - -module.exports.createFile = createFile; -module.exports.createFileSync = createFileSync; \ No newline at end of file diff --git a/test/node/node_modules/fs-extra/lib/index.js b/test/node/node_modules/fs-extra/lib/index.js deleted file mode 100644 index d5dbea2c6fb..00000000000 --- a/test/node/node_modules/fs-extra/lib/index.js +++ /dev/null @@ -1,102 +0,0 @@ -var fs = require('fs') - , path = require('path') - , jsonFile = require('jsonfile') - , fse = {}; - -for (var funcName in fs) { - var func = fs[funcName]; - if (fs.hasOwnProperty(funcName)) { - if (typeof func == 'function') - fse[funcName] = func; - } -} - -fs = fse; - -// copy - -fs.copy = require('./copy').copy; - -// remove - -var remove = require('./remove'); -fs.remove = remove.remove; -fs.removeSync = remove.removeSync; -fs['delete'] = fs.remove -fs.deleteSync = fs.removeSync - -// mkdir - -var mkdir = require('./mkdir') -fs.mkdirs = mkdir.mkdirs -fs.mkdirsSync = mkdir.mkdirsSync -fs.mkdirp = mkdir.mkdirs -fs.mkdirpSync = mkdir.mkdirsSync - -// create - -var create = require('./create') -fs.createFile = create.createFile; -fs.createFileSync = create.createFileSync; - -//deprecated -fs.touch = function touch() { - console.log('fs.touch() is deprecated. Please use fs.createFile().') - fs.createFile.apply(null, arguments) -} - -fs.touchSync = function touchSync() { - console.log('fs.touchSync() is deprecated. Please use fs.createFileSync().') - fs.createFileSync.apply(null, arguments) -} - -// output - -var output = require('./output'); -fs.outputFile = output.outputFile; -fs.outputFileSync = output.outputFileSync; - -// read - -/*fs.readTextFile = function(file, callback) { - return fs.readFile(file, 'utf8', callback) -} - -fs.readTextFileSync = function(file, callback) { - return fs.readFileSync(file, 'utf8') -}*/ - -// json files - -fs.readJsonFile = jsonFile.readFile; -fs.readJSONFile = jsonFile.readFile; -fs.readJsonFileSync = jsonFile.readFileSync; -fs.readJSONFileSync = jsonFile.readFileSync; - -fs.readJson = jsonFile.readFile; -fs.readJSON = jsonFile.readFile; -fs.readJsonSync = jsonFile.readFileSync; -fs.readJSONSync = jsonFile.readFileSync; - -fs.writeJsonFile = jsonFile.writeFile; -fs.writeJSONFile = jsonFile.writeFile; -fs.writeJsonFileSync = jsonFile.writeFileSync; -fs.writeJSONFileSync = jsonFile.writeFileSync; - -fs.writeJson = jsonFile.writeFile; -fs.writeJSON = jsonFile.writeFile; -fs.writeJsonSync = jsonFile.writeFileSync; -fs.writeJSONSync = jsonFile.writeFileSync; - - -//make compatible for Node v0.8 -if (typeof fs.exists == 'undefined') - fs.exists = path.exists -if (typeof fs.existsSync == 'undefined') - fs.existsSync = path.existsSync - -module.exports = fs - -jsonFile.spaces = 2; //set to 2 -module.exports.jsonfile = jsonFile; //so users of fs-extra can modify jsonFile.spaces; - diff --git a/test/node/node_modules/fs-extra/lib/mkdir.js b/test/node/node_modules/fs-extra/lib/mkdir.js deleted file mode 100644 index fb8ac3ad050..00000000000 --- a/test/node/node_modules/fs-extra/lib/mkdir.js +++ /dev/null @@ -1,6 +0,0 @@ -var mkdirp = require('mkdirp'); - -module.exports.mkdirs = mkdirp; -module.exports.mkdirsSync = mkdirp.sync; - - diff --git a/test/node/node_modules/fs-extra/lib/output.js b/test/node/node_modules/fs-extra/lib/output.js deleted file mode 100644 index 290241d1dac..00000000000 --- a/test/node/node_modules/fs-extra/lib/output.js +++ /dev/null @@ -1,35 +0,0 @@ -var mkdir = require('./mkdir') - , path = require('path') - , fs = require('fs') - , exists = fs.exists || path.exists - , existsSync = fs.existsSync || path.existsSync - -function outputFile (file, data, encoding, callback) { - if (typeof encoding === 'function') { - callback = encoding - encoding = 'utf8' - } - - var dir = path.dirname(file) - exists(dir, function(itDoes) { - if (itDoes) return fs.writeFile(file, data, encoding, callback) - - mkdir.mkdirs(dir, function(err) { - if (err) return callback(err) - - fs.writeFile(file, data, encoding, callback) - }) - }) -} - - -function outputFileSync (file, data, encoding) { - var dir = path.dirname(file) - if (existsSync(dir)) return fs.writeFileSync.apply(fs, arguments) - mkdir.mkdirsSync(dir) - fs.writeFileSync.apply(fs, arguments) -} - - -module.exports.outputFile = outputFile; -module.exports.outputFileSync = outputFileSync; \ No newline at end of file diff --git a/test/node/node_modules/fs-extra/lib/remove.js b/test/node/node_modules/fs-extra/lib/remove.js deleted file mode 100644 index 754264be8c7..00000000000 --- a/test/node/node_modules/fs-extra/lib/remove.js +++ /dev/null @@ -1,17 +0,0 @@ -var rimraf = require('rimraf') - , fs = require('fs'); - -function rmrfSync(dir) { - return rimraf.sync(dir); -} - -function rmrf(dir, cb) { - if (cb != null) { - return rimraf(dir, cb); - } else { - return rimraf(dir, (function() {})); - } -} - -module.exports.remove = rmrf; -module.exports.removeSync = rmrfSync; diff --git a/test/node/node_modules/fs-extra/node_modules/.bin/ncp b/test/node/node_modules/fs-extra/node_modules/.bin/ncp deleted file mode 120000 index 1c026480ab4..00000000000 --- a/test/node/node_modules/fs-extra/node_modules/.bin/ncp +++ /dev/null @@ -1 +0,0 @@ -../ncp/bin/ncp \ No newline at end of file diff --git a/test/node/node_modules/fs-extra/node_modules/jsonfile/.npmignore b/test/node/node_modules/fs-extra/node_modules/jsonfile/.npmignore deleted file mode 100644 index 40b878db5b1..00000000000 --- a/test/node/node_modules/fs-extra/node_modules/jsonfile/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules/ \ No newline at end of file diff --git a/test/node/node_modules/fs-extra/node_modules/jsonfile/.travis.yml b/test/node/node_modules/fs-extra/node_modules/jsonfile/.travis.yml deleted file mode 100644 index 811124587af..00000000000 --- a/test/node/node_modules/fs-extra/node_modules/jsonfile/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.6 - - 0.8 \ No newline at end of file diff --git a/test/node/node_modules/fs-extra/node_modules/jsonfile/CHANGELOG.md b/test/node/node_modules/fs-extra/node_modules/jsonfile/CHANGELOG.md deleted file mode 100644 index 88ddd16057e..00000000000 --- a/test/node/node_modules/fs-extra/node_modules/jsonfile/CHANGELOG.md +++ /dev/null @@ -1,3 +0,0 @@ -0.0.1 / 2012-09-10 ------------------- -* Initial release. diff --git a/test/node/node_modules/fs-extra/node_modules/jsonfile/LICENSE b/test/node/node_modules/fs-extra/node_modules/jsonfile/LICENSE deleted file mode 100644 index 83642bff279..00000000000 --- a/test/node/node_modules/fs-extra/node_modules/jsonfile/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -(The MIT License) - -Copyright (c) 2012, JP Richardson - -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/test/node/node_modules/fs-extra/node_modules/jsonfile/README.md b/test/node/node_modules/fs-extra/node_modules/jsonfile/README.md deleted file mode 100644 index 9b75723108e..00000000000 --- a/test/node/node_modules/fs-extra/node_modules/jsonfile/README.md +++ /dev/null @@ -1,116 +0,0 @@ -[![build status](https://secure.travis-ci.org/jprichardson/node-jsonfile.png)](http://travis-ci.org/jprichardson/node-jsonfile) - -Node.js - jsonfile -================ - -Easily read/write JSON files. - - -Why? ----- - -Writing `JSON.stringify()` and then `fs.writeFile()` and `JSON.parse()` with `fs.readFile()` enclosed in `try/catch` blocks became annoying. - - - -Installation ------------- - - npm install jsonfile - - - -API ---- - -### readFile() - -```javascript -var jf = require('jsonfile') - , util = require('util'); - -var file = '/tmp/data.json'; -js.readFile(file, function(err, obj) { - console.log(util.inspect(obj)); -}); -``` - - -### readFileSync() - -```javascript -var jf = require('jsonfile') - , util = require('util'); - -var file = '/tmp/data.json'; - -console.log(util.inspect(jf.readFileSync(file))); -``` - - -### writeFile() - -```javascript -var jf = require('jsonfile') - -var file = '/tmp/data.json'; -var obj = {name: 'JP'}; - -jf.writeFile(file, obj, function(err) { - console.log(err); -}) -``` - -### writeFileSync() - -```javascript -var jf = require('jsonfile') - -var file = '/tmp/data.json'; -var obj = {name: 'JP'}; - -jf.writeFileSync(file, obj); -``` - - -### spaces - -Number of spaces to indent JSON files. - -**default:** 4 - -``` -var jf = require('jsonfile'); - -jf.spaces = 2; - -var file = '/tmp/data.json'; -var obj = {name: 'JP'}; - -jf.writeFile(file, obj, function(err) { //json file has two space indenting now - console.log(err); -}); -``` - - -Author ------- - -`node-jsonfile` was written by [JP Richardson][aboutjp]. You should follow him on Twitter [@jprichardson][twitter]. Also read his coding blog [Procbits][procbits]. If you write software with others, you should checkout [Gitpilot][gitpilot] to make collaboration with Git simple. - - - -License -------- - -(MIT License) - -Copyright 2012, JP Richardson - - -[aboutjp]: http://about.me/jprichardson -[twitter]: http://twitter.com/jprichardson -[procbits]: http://procbits.com -[gitpilot]: http://gitpilot.com - - diff --git a/test/node/node_modules/fs-extra/node_modules/jsonfile/lib/jsonfile.js b/test/node/node_modules/fs-extra/node_modules/jsonfile/lib/jsonfile.js deleted file mode 100644 index 4bdb60144a0..00000000000 --- a/test/node/node_modules/fs-extra/node_modules/jsonfile/lib/jsonfile.js +++ /dev/null @@ -1,44 +0,0 @@ -var fs = require('fs'); - -module.exports.spaces = 4; - -function readFile(file, callback) { - fs.readFile(file, 'utf8', function(err, data) { - if (err) { - callback(err, null); - } else { - try { - var obj = JSON.parse(data); - callback(null, obj); - } catch (err2) { - callback(err2, null); - } - } - }) -} - -function readFileSync(file) { - var data = fs.readFileSync(file, 'utf8'); - return JSON.parse(data); -} - -function writeFile(file, obj, callback) { - var str = ''; - try { - str = JSON.stringify(obj, null, module.exports.spaces); - } catch (err) { - callback(err, null); - } - fs.writeFile(file, str, callback); -} - -function writeFileSync(file, obj) { - var str = JSON.stringify(obj, null, module.exports.spaces); - return fs.writeFileSync(file, str); //not sure if fs.writeFileSync returns anything, but just in case -} - - -module.exports.readFile = readFile; -module.exports.readFileSync = readFileSync; -module.exports.writeFile = writeFile; -module.exports.writeFileSync = writeFileSync; \ No newline at end of file diff --git a/test/node/node_modules/fs-extra/node_modules/jsonfile/package.json b/test/node/node_modules/fs-extra/node_modules/jsonfile/package.json deleted file mode 100644 index 826c8517b23..00000000000 --- a/test/node/node_modules/fs-extra/node_modules/jsonfile/package.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "jsonfile", - "version": "0.0.1", - "description": "Easily read/write JSON files.", - "homepage": [ - "" - ], - "repository": { - "type": "git", - "url": "git@github.com:jprichardson/node-jsonfile.git" - }, - "keywords": [], - "author": { - "name": "JP Richardson", - "email": "jprichardson@gmail.com" - }, - "licenses": [ - { - "type": "MIT", - "url": "" - } - ], - "dependencies": {}, - "devDependencies": { - "mkdirp": "~0.3.4", - "testutil": "~0.2.2", - "mocha": "~1.4.2" - }, - "main": "./lib/jsonfile.js", - "scripts": { - "test": "mocha test" - }, - "readme": "[![build status](https://secure.travis-ci.org/jprichardson/node-jsonfile.png)](http://travis-ci.org/jprichardson/node-jsonfile)\n\nNode.js - jsonfile\n================\n\nEasily read/write JSON files. \n\n\nWhy?\n----\n\nWriting `JSON.stringify()` and then `fs.writeFile()` and `JSON.parse()` with `fs.readFile()` enclosed in `try/catch` blocks became annoying.\n\n\n\nInstallation\n------------\n\n npm install jsonfile\n\n\n\nAPI\n---\n\n### readFile()\n\n```javascript\nvar jf = require('jsonfile')\n , util = require('util');\n\nvar file = '/tmp/data.json';\njs.readFile(file, function(err, obj) {\n console.log(util.inspect(obj)); \n});\n```\n\n\n### readFileSync()\n\n```javascript\nvar jf = require('jsonfile')\n , util = require('util');\n\nvar file = '/tmp/data.json';\n\nconsole.log(util.inspect(jf.readFileSync(file)));\n```\n\n\n### writeFile()\n\n```javascript\nvar jf = require('jsonfile')\n\nvar file = '/tmp/data.json';\nvar obj = {name: 'JP'};\n\njf.writeFile(file, obj, function(err) {\n console.log(err);\n})\n```\n\n### writeFileSync()\n\n```javascript\nvar jf = require('jsonfile')\n\nvar file = '/tmp/data.json';\nvar obj = {name: 'JP'};\n\njf.writeFileSync(file, obj);\n```\n\n\n### spaces\n\nNumber of spaces to indent JSON files. \n\n**default:** 4\n\n```\nvar jf = require('jsonfile');\n\njf.spaces = 2;\n\nvar file = '/tmp/data.json';\nvar obj = {name: 'JP'};\n\njf.writeFile(file, obj, function(err) { //json file has two space indenting now\n console.log(err);\n});\n```\n\n\nAuthor\n------\n\n`node-jsonfile` was written by [JP Richardson][aboutjp]. You should follow him on Twitter [@jprichardson][twitter]. Also read his coding blog [Procbits][procbits]. If you write software with others, you should checkout [Gitpilot][gitpilot] to make collaboration with Git simple.\n\n\n\nLicense\n-------\n\n(MIT License)\n\nCopyright 2012, JP Richardson \n\n\n[aboutjp]: http://about.me/jprichardson\n[twitter]: http://twitter.com/jprichardson\n[procbits]: http://procbits.com\n[gitpilot]: http://gitpilot.com\n\n\n", - "readmeFilename": "README.md", - "_id": "jsonfile@0.0.1", - "_from": "jsonfile@0.0.x" -} diff --git a/test/node/node_modules/fs-extra/node_modules/jsonfile/test/jsonfile.test.js b/test/node/node_modules/fs-extra/node_modules/jsonfile/test/jsonfile.test.js deleted file mode 100644 index 6bd4888b0fc..00000000000 --- a/test/node/node_modules/fs-extra/node_modules/jsonfile/test/jsonfile.test.js +++ /dev/null @@ -1,66 +0,0 @@ -var testutil = require('testutil') - , mkdirp = require('mkdirp') - , jf = require('../lib/jsonfile') - , fs = require('fs') - , path = require('path'); - -TEST_DIR = '' - -beforeEach(function(done) { - TEST_DIR = testutil.generateTestPath('test-jsonfile'); - mkdirp(TEST_DIR, done); -}) - -suite('jsonfile'); - -test('- readFile()', function(done) { - var file = path.join(TEST_DIR, 'somefile.json'); - var obj = {name: 'JP'} - fs.writeFileSync(file, JSON.stringify(obj)); - - jf.readFile(file, function(err, obj2) { - F (err) - T (obj2.name === obj.name) - done(); - }); -}) - -test('- writeFile()', function(done) { - var file = path.join(TEST_DIR, 'somefile2.json'); - var obj = {name: 'JP'}; - - jf.writeFile(file, obj, function(err) { - F (err) - fs.readFile(file, 'utf8', function(err,data) { - var obj2 = JSON.parse(data); - T (obj2.name === obj.name) - done(); - }); - }) -}) - -test('- readFileSync()', function(done) { - var file = path.join(TEST_DIR, 'somefile3.json'); - var obj = {name: 'JP'} - fs.writeFileSync(file, JSON.stringify(obj)); - - try { - var obj2 = jf.readFileSync(file); - T (obj2.name === obj.name); - done(); - } catch (err) { - done(err); - } -}) - -test('- writeFileSync()', function(done) { - var file = path.join(TEST_DIR, 'somefile4.json'); - var obj = {name: 'JP'}; - - jf.writeFileSync(file, obj); - - var obj2 = JSON.parse(fs.readFileSync(file, 'utf8')); - T (obj2.name === obj.name); - done(); -}) - diff --git a/test/node/node_modules/fs-extra/node_modules/jsonfile/test/mocha.opts b/test/node/node_modules/fs-extra/node_modules/jsonfile/test/mocha.opts deleted file mode 100644 index d7795420605..00000000000 --- a/test/node/node_modules/fs-extra/node_modules/jsonfile/test/mocha.opts +++ /dev/null @@ -1,3 +0,0 @@ ---reporter spec ---ui qunit ---timeout 2000 \ No newline at end of file diff --git a/test/node/node_modules/fs-extra/node_modules/jsonfile/test/resources/.gitkeep b/test/node/node_modules/fs-extra/node_modules/jsonfile/test/resources/.gitkeep deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/test/node/node_modules/fs-extra/node_modules/mkdirp/.npmignore b/test/node/node_modules/fs-extra/node_modules/mkdirp/.npmignore deleted file mode 100644 index 9303c347ee6..00000000000 --- a/test/node/node_modules/fs-extra/node_modules/mkdirp/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules/ -npm-debug.log \ No newline at end of file diff --git a/test/node/node_modules/fs-extra/node_modules/mkdirp/.travis.yml b/test/node/node_modules/fs-extra/node_modules/mkdirp/.travis.yml deleted file mode 100644 index 84fd7ca248a..00000000000 --- a/test/node/node_modules/fs-extra/node_modules/mkdirp/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js -node_js: - - 0.6 - - 0.8 - - 0.9 diff --git a/test/node/node_modules/fs-extra/node_modules/mkdirp/LICENSE b/test/node/node_modules/fs-extra/node_modules/mkdirp/LICENSE deleted file mode 100644 index 432d1aeb01d..00000000000 --- a/test/node/node_modules/fs-extra/node_modules/mkdirp/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -Copyright 2010 James Halliday (mail@substack.net) - -This project is free software released under the MIT/X11 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/test/node/node_modules/fs-extra/node_modules/mkdirp/examples/pow.js b/test/node/node_modules/fs-extra/node_modules/mkdirp/examples/pow.js deleted file mode 100644 index e6924212e6a..00000000000 --- a/test/node/node_modules/fs-extra/node_modules/mkdirp/examples/pow.js +++ /dev/null @@ -1,6 +0,0 @@ -var mkdirp = require('mkdirp'); - -mkdirp('/tmp/foo/bar/baz', function (err) { - if (err) console.error(err) - else console.log('pow!') -}); diff --git a/test/node/node_modules/fs-extra/node_modules/mkdirp/index.js b/test/node/node_modules/fs-extra/node_modules/mkdirp/index.js deleted file mode 100644 index fda6de8a2c2..00000000000 --- a/test/node/node_modules/fs-extra/node_modules/mkdirp/index.js +++ /dev/null @@ -1,82 +0,0 @@ -var path = require('path'); -var fs = require('fs'); - -module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP; - -function mkdirP (p, mode, f, made) { - if (typeof mode === 'function' || mode === undefined) { - f = mode; - mode = 0777 & (~process.umask()); - } - if (!made) made = null; - - var cb = f || function () {}; - if (typeof mode === 'string') mode = parseInt(mode, 8); - p = path.resolve(p); - - fs.mkdir(p, mode, function (er) { - if (!er) { - made = made || p; - return cb(null, made); - } - switch (er.code) { - case 'ENOENT': - mkdirP(path.dirname(p), mode, function (er, made) { - if (er) cb(er, made); - else mkdirP(p, mode, cb, made); - }); - break; - - // In the case of any other error, just see if there's a dir - // there already. If so, then hooray! If not, then something - // is borked. - default: - fs.stat(p, function (er2, stat) { - // if the stat fails, then that's super weird. - // let the original error be the failure reason. - if (er2 || !stat.isDirectory()) cb(er, made) - else cb(null, made); - }); - break; - } - }); -} - -mkdirP.sync = function sync (p, mode, made) { - if (mode === undefined) { - mode = 0777 & (~process.umask()); - } - if (!made) made = null; - - if (typeof mode === 'string') mode = parseInt(mode, 8); - p = path.resolve(p); - - try { - fs.mkdirSync(p, mode); - made = made || p; - } - catch (err0) { - switch (err0.code) { - case 'ENOENT' : - made = sync(path.dirname(p), mode, made); - sync(p, mode, made); - break; - - // In the case of any other error, just see if there's a dir - // there already. If so, then hooray! If not, then something - // is borked. - default: - var stat; - try { - stat = fs.statSync(p); - } - catch (err1) { - throw err0; - } - if (!stat.isDirectory()) throw err0; - break; - } - } - - return made; -}; diff --git a/test/node/node_modules/fs-extra/node_modules/mkdirp/package.json b/test/node/node_modules/fs-extra/node_modules/mkdirp/package.json deleted file mode 100644 index 047842c899a..00000000000 --- a/test/node/node_modules/fs-extra/node_modules/mkdirp/package.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "mkdirp", - "description": "Recursively mkdir, like `mkdir -p`", - "version": "0.3.5", - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "main": "./index", - "keywords": [ - "mkdir", - "directory" - ], - "repository": { - "type": "git", - "url": "http://github.com/substack/node-mkdirp.git" - }, - "scripts": { - "test": "tap test/*.js" - }, - "devDependencies": { - "tap": "~0.4.0" - }, - "license": "MIT", - "readme": "# mkdirp\n\nLike `mkdir -p`, but in node.js!\n\n[![build status](https://secure.travis-ci.org/substack/node-mkdirp.png)](http://travis-ci.org/substack/node-mkdirp)\n\n# example\n\n## pow.js\n\n```js\nvar mkdirp = require('mkdirp');\n \nmkdirp('/tmp/foo/bar/baz', function (err) {\n if (err) console.error(err)\n else console.log('pow!')\n});\n```\n\nOutput\n\n```\npow!\n```\n\nAnd now /tmp/foo/bar/baz exists, huzzah!\n\n# methods\n\n```js\nvar mkdirp = require('mkdirp');\n```\n\n## mkdirp(dir, mode, cb)\n\nCreate a new directory and any necessary subdirectories at `dir` with octal\npermission string `mode`.\n\nIf `mode` isn't specified, it defaults to `0777 & (~process.umask())`.\n\n`cb(err, made)` fires with the error or the first directory `made`\nthat had to be created, if any.\n\n## mkdirp.sync(dir, mode)\n\nSynchronously create a new directory and any necessary subdirectories at `dir`\nwith octal permission string `mode`.\n\nIf `mode` isn't specified, it defaults to `0777 & (~process.umask())`.\n\nReturns the first directory that had to be created, if any.\n\n# install\n\nWith [npm](http://npmjs.org) do:\n\n```\nnpm install mkdirp\n```\n\n# license\n\nMIT\n", - "readmeFilename": "readme.markdown", - "_id": "mkdirp@0.3.5", - "_from": "mkdirp@0.3.x" -} diff --git a/test/node/node_modules/fs-extra/node_modules/mkdirp/readme.markdown b/test/node/node_modules/fs-extra/node_modules/mkdirp/readme.markdown deleted file mode 100644 index 83b0216ab59..00000000000 --- a/test/node/node_modules/fs-extra/node_modules/mkdirp/readme.markdown +++ /dev/null @@ -1,63 +0,0 @@ -# mkdirp - -Like `mkdir -p`, but in node.js! - -[![build status](https://secure.travis-ci.org/substack/node-mkdirp.png)](http://travis-ci.org/substack/node-mkdirp) - -# example - -## pow.js - -```js -var mkdirp = require('mkdirp'); - -mkdirp('/tmp/foo/bar/baz', function (err) { - if (err) console.error(err) - else console.log('pow!') -}); -``` - -Output - -``` -pow! -``` - -And now /tmp/foo/bar/baz exists, huzzah! - -# methods - -```js -var mkdirp = require('mkdirp'); -``` - -## mkdirp(dir, mode, cb) - -Create a new directory and any necessary subdirectories at `dir` with octal -permission string `mode`. - -If `mode` isn't specified, it defaults to `0777 & (~process.umask())`. - -`cb(err, made)` fires with the error or the first directory `made` -that had to be created, if any. - -## mkdirp.sync(dir, mode) - -Synchronously create a new directory and any necessary subdirectories at `dir` -with octal permission string `mode`. - -If `mode` isn't specified, it defaults to `0777 & (~process.umask())`. - -Returns the first directory that had to be created, if any. - -# install - -With [npm](http://npmjs.org) do: - -``` -npm install mkdirp -``` - -# license - -MIT diff --git a/test/node/node_modules/fs-extra/node_modules/mkdirp/test/chmod.js b/test/node/node_modules/fs-extra/node_modules/mkdirp/test/chmod.js deleted file mode 100644 index 520dcb8e9b5..00000000000 --- a/test/node/node_modules/fs-extra/node_modules/mkdirp/test/chmod.js +++ /dev/null @@ -1,38 +0,0 @@ -var mkdirp = require('../').mkdirp; -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -var ps = [ '', 'tmp' ]; - -for (var i = 0; i < 25; i++) { - var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - ps.push(dir); -} - -var file = ps.join('/'); - -test('chmod-pre', function (t) { - var mode = 0744 - mkdirp(file, mode, function (er) { - t.ifError(er, 'should not error'); - fs.stat(file, function (er, stat) { - t.ifError(er, 'should exist'); - t.ok(stat && stat.isDirectory(), 'should be directory'); - t.equal(stat && stat.mode & 0777, mode, 'should be 0744'); - t.end(); - }); - }); -}); - -test('chmod', function (t) { - var mode = 0755 - mkdirp(file, mode, function (er) { - t.ifError(er, 'should not error'); - fs.stat(file, function (er, stat) { - t.ifError(er, 'should exist'); - t.ok(stat && stat.isDirectory(), 'should be directory'); - t.end(); - }); - }); -}); diff --git a/test/node/node_modules/fs-extra/node_modules/mkdirp/test/clobber.js b/test/node/node_modules/fs-extra/node_modules/mkdirp/test/clobber.js deleted file mode 100644 index 0eb70998700..00000000000 --- a/test/node/node_modules/fs-extra/node_modules/mkdirp/test/clobber.js +++ /dev/null @@ -1,37 +0,0 @@ -var mkdirp = require('../').mkdirp; -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -var ps = [ '', 'tmp' ]; - -for (var i = 0; i < 25; i++) { - var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - ps.push(dir); -} - -var file = ps.join('/'); - -// a file in the way -var itw = ps.slice(0, 3).join('/'); - - -test('clobber-pre', function (t) { - console.error("about to write to "+itw) - fs.writeFileSync(itw, 'I AM IN THE WAY, THE TRUTH, AND THE LIGHT.'); - - fs.stat(itw, function (er, stat) { - t.ifError(er) - t.ok(stat && stat.isFile(), 'should be file') - t.end() - }) -}) - -test('clobber', function (t) { - t.plan(2); - mkdirp(file, 0755, function (err) { - t.ok(err); - t.equal(err.code, 'ENOTDIR'); - t.end(); - }); -}); diff --git a/test/node/node_modules/fs-extra/node_modules/mkdirp/test/mkdirp.js b/test/node/node_modules/fs-extra/node_modules/mkdirp/test/mkdirp.js deleted file mode 100644 index b07cd70c109..00000000000 --- a/test/node/node_modules/fs-extra/node_modules/mkdirp/test/mkdirp.js +++ /dev/null @@ -1,28 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('woo', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - mkdirp(file, 0755, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) - }); -}); diff --git a/test/node/node_modules/fs-extra/node_modules/mkdirp/test/perm.js b/test/node/node_modules/fs-extra/node_modules/mkdirp/test/perm.js deleted file mode 100644 index 23a7abbd232..00000000000 --- a/test/node/node_modules/fs-extra/node_modules/mkdirp/test/perm.js +++ /dev/null @@ -1,32 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('async perm', function (t) { - t.plan(2); - var file = '/tmp/' + (Math.random() * (1<<30)).toString(16); - - mkdirp(file, 0755, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) - }); -}); - -test('async root perm', function (t) { - mkdirp('/tmp', 0755, function (err) { - if (err) t.fail(err); - t.end(); - }); - t.end(); -}); diff --git a/test/node/node_modules/fs-extra/node_modules/mkdirp/test/perm_sync.js b/test/node/node_modules/fs-extra/node_modules/mkdirp/test/perm_sync.js deleted file mode 100644 index f685f609069..00000000000 --- a/test/node/node_modules/fs-extra/node_modules/mkdirp/test/perm_sync.js +++ /dev/null @@ -1,39 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('sync perm', function (t) { - t.plan(2); - var file = '/tmp/' + (Math.random() * (1<<30)).toString(16) + '.json'; - - mkdirp.sync(file, 0755); - path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }); -}); - -test('sync root perm', function (t) { - t.plan(1); - - var file = '/tmp'; - mkdirp.sync(file, 0755); - path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }); -}); diff --git a/test/node/node_modules/fs-extra/node_modules/mkdirp/test/race.js b/test/node/node_modules/fs-extra/node_modules/mkdirp/test/race.js deleted file mode 100644 index 96a04476365..00000000000 --- a/test/node/node_modules/fs-extra/node_modules/mkdirp/test/race.js +++ /dev/null @@ -1,41 +0,0 @@ -var mkdirp = require('../').mkdirp; -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('race', function (t) { - t.plan(4); - var ps = [ '', 'tmp' ]; - - for (var i = 0; i < 25; i++) { - var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - ps.push(dir); - } - var file = ps.join('/'); - - var res = 2; - mk(file, function () { - if (--res === 0) t.end(); - }); - - mk(file, function () { - if (--res === 0) t.end(); - }); - - function mk (file, cb) { - mkdirp(file, 0755, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - if (cb) cb(); - } - }) - }) - }); - } -}); diff --git a/test/node/node_modules/fs-extra/node_modules/mkdirp/test/rel.js b/test/node/node_modules/fs-extra/node_modules/mkdirp/test/rel.js deleted file mode 100644 index 79858243ab9..00000000000 --- a/test/node/node_modules/fs-extra/node_modules/mkdirp/test/rel.js +++ /dev/null @@ -1,32 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('rel', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var cwd = process.cwd(); - process.chdir('/tmp'); - - var file = [x,y,z].join('/'); - - mkdirp(file, 0755, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - process.chdir(cwd); - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) - }); -}); diff --git a/test/node/node_modules/fs-extra/node_modules/mkdirp/test/return.js b/test/node/node_modules/fs-extra/node_modules/mkdirp/test/return.js deleted file mode 100644 index bce68e5613e..00000000000 --- a/test/node/node_modules/fs-extra/node_modules/mkdirp/test/return.js +++ /dev/null @@ -1,25 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('return value', function (t) { - t.plan(4); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - // should return the first dir created. - // By this point, it would be profoundly surprising if /tmp didn't - // already exist, since every other test makes things in there. - mkdirp(file, function (err, made) { - t.ifError(err); - t.equal(made, '/tmp/' + x); - mkdirp(file, function (err, made) { - t.ifError(err); - t.equal(made, null); - }); - }); -}); diff --git a/test/node/node_modules/fs-extra/node_modules/mkdirp/test/return_sync.js b/test/node/node_modules/fs-extra/node_modules/mkdirp/test/return_sync.js deleted file mode 100644 index 7c222d3558d..00000000000 --- a/test/node/node_modules/fs-extra/node_modules/mkdirp/test/return_sync.js +++ /dev/null @@ -1,24 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('return value', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - // should return the first dir created. - // By this point, it would be profoundly surprising if /tmp didn't - // already exist, since every other test makes things in there. - // Note that this will throw on failure, which will fail the test. - var made = mkdirp.sync(file); - t.equal(made, '/tmp/' + x); - - // making the same file again should have no effect. - made = mkdirp.sync(file); - t.equal(made, null); -}); diff --git a/test/node/node_modules/fs-extra/node_modules/mkdirp/test/root.js b/test/node/node_modules/fs-extra/node_modules/mkdirp/test/root.js deleted file mode 100644 index 97ad7a2f358..00000000000 --- a/test/node/node_modules/fs-extra/node_modules/mkdirp/test/root.js +++ /dev/null @@ -1,18 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('root', function (t) { - // '/' on unix, 'c:/' on windows. - var file = path.resolve('/'); - - mkdirp(file, 0755, function (err) { - if (err) throw err - fs.stat(file, function (er, stat) { - if (er) throw er - t.ok(stat.isDirectory(), 'target is a directory'); - t.end(); - }) - }); -}); diff --git a/test/node/node_modules/fs-extra/node_modules/mkdirp/test/sync.js b/test/node/node_modules/fs-extra/node_modules/mkdirp/test/sync.js deleted file mode 100644 index 7530cada84c..00000000000 --- a/test/node/node_modules/fs-extra/node_modules/mkdirp/test/sync.js +++ /dev/null @@ -1,32 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('sync', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - try { - mkdirp.sync(file, 0755); - } catch (err) { - t.fail(err); - return t.end(); - } - - path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }); - }); -}); diff --git a/test/node/node_modules/fs-extra/node_modules/mkdirp/test/umask.js b/test/node/node_modules/fs-extra/node_modules/mkdirp/test/umask.js deleted file mode 100644 index 64ccafe22bc..00000000000 --- a/test/node/node_modules/fs-extra/node_modules/mkdirp/test/umask.js +++ /dev/null @@ -1,28 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('implicit mode from umask', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - mkdirp(file, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0777 & (~process.umask())); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) - }); -}); diff --git a/test/node/node_modules/fs-extra/node_modules/mkdirp/test/umask_sync.js b/test/node/node_modules/fs-extra/node_modules/mkdirp/test/umask_sync.js deleted file mode 100644 index 35bd5cbbf41..00000000000 --- a/test/node/node_modules/fs-extra/node_modules/mkdirp/test/umask_sync.js +++ /dev/null @@ -1,32 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('umask sync modes', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - try { - mkdirp.sync(file); - } catch (err) { - t.fail(err); - return t.end(); - } - - path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, (0777 & (~process.umask()))); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }); - }); -}); diff --git a/test/node/node_modules/fs-extra/node_modules/ncp/.npmignore b/test/node/node_modules/fs-extra/node_modules/ncp/.npmignore deleted file mode 100644 index 9ecd205c676..00000000000 --- a/test/node/node_modules/fs-extra/node_modules/ncp/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -node_modules -.*.sw[op] -.DS_Store -test/fixtures/out diff --git a/test/node/node_modules/fs-extra/node_modules/ncp/.travis.yml b/test/node/node_modules/fs-extra/node_modules/ncp/.travis.yml deleted file mode 100644 index 3a05aef8ad3..00000000000 --- a/test/node/node_modules/fs-extra/node_modules/ncp/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: node_js - -node_js: - - 0.4 - - 0.6 - - 0.7 diff --git a/test/node/node_modules/fs-extra/node_modules/ncp/LICENSE.md b/test/node/node_modules/fs-extra/node_modules/ncp/LICENSE.md deleted file mode 100644 index e2b9b4135ef..00000000000 --- a/test/node/node_modules/fs-extra/node_modules/ncp/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -# MIT License - -###Copyright (C) 2011 by Charlie McConnell - -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/test/node/node_modules/fs-extra/node_modules/ncp/README.md b/test/node/node_modules/fs-extra/node_modules/ncp/README.md deleted file mode 100644 index 745fe99c00f..00000000000 --- a/test/node/node_modules/fs-extra/node_modules/ncp/README.md +++ /dev/null @@ -1,46 +0,0 @@ -# ncp - Asynchronous recursive file & directory copying - -[![Build Status](https://secure.travis-ci.org/AvianFlu/ncp.png)](http://travis-ci.org/AvianFlu/ncp) - -Think `cp -r`, but pure node, and asynchronous. `ncp` can be used both as a CLI tool and programmatically. - -## Command Line usage - -Usage is simple: `ncp [source] [dest] [--limit=concurrency limit] -[--filter=filter] --stopOnErr` - -The 'filter' is a Regular Expression - matched files will be copied. - -The 'concurrency limit' is an integer that represents how many pending file system requests `ncp` has at a time. - -'stopOnErr' is a boolean flag that will tell `ncp` to stop immediately if any -errors arise, rather than attempting to continue while logging errors. - -If there are no errors, `ncp` will output `done.` when complete. If there are errors, the error messages will be logged to `stdout` and to `./ncp-debug.log`, and the copy operation will attempt to continue. - -## Programmatic usage - -Programmatic usage of `ncp` is just as simple. The only argument to the completion callback is a possible error. - -```javascript -var ncp = require('ncp').ncp; - -ncp.limit = 16; - -ncp(source, destination, function (err) { - if (err) { - return console.error(err); - } - console.log('done!'); -}); -``` - -You can also call ncp like `ncp(source, destination, options, callback)`. -`options` should be a dictionary. Currently, such options are available: - - * `options.filter` - a `RegExp` instance, against which each file name is - tested to determine whether to copy it or not, or a function taking single - parameter: copied file name, returning `true` or `false`, determining - whether to copy file or not. - -Please open an issue if any bugs arise. As always, I accept (working) pull requests, and refunds are available at `/dev/null`. diff --git a/test/node/node_modules/fs-extra/node_modules/ncp/bin/ncp b/test/node/node_modules/fs-extra/node_modules/ncp/bin/ncp deleted file mode 100755 index 388eaba6d3d..00000000000 --- a/test/node/node_modules/fs-extra/node_modules/ncp/bin/ncp +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env node - - - - -var ncp = require('../lib/ncp'), - args = process.argv.slice(2), - source, dest; - -if (args.length < 2) { - console.error('Usage: ncp [source] [destination] [--filter=filter] [--limit=concurrency limit]'); - process.exit(1); -} - -// parse arguments the hard way -function startsWith(str, prefix) { - return str.substr(0, prefix.length) == prefix; -} - -var options = {}; -args.forEach(function (arg) { - if (startsWith(arg, "--limit=")) { - options.limit = parseInt(arg.split('=', 2)[1], 10); - } - if (startsWith(arg, "--filter=")) { - options.filter = new RegExp(arg.split('=', 2)[1]); - } - if (startsWith(arg, "--stoponerr")) { - options.stopOnErr = true; - } -}); - -ncp.ncp(args[0], args[1], options, function (err) { - if (Array.isArray(err)) { - console.error('There were errors during the copy.'); - err.forEach(function (err) { - console.error(err.stack || err.message); - }); - process.exit(1); - } - else if (err) { - console.error('An error has occurred.'); - console.error(err.stack || err.message); - process.exit(1); - } -}); - - diff --git a/test/node/node_modules/fs-extra/node_modules/ncp/lib/ncp.js b/test/node/node_modules/fs-extra/node_modules/ncp/lib/ncp.js deleted file mode 100644 index 82d64c3947f..00000000000 --- a/test/node/node_modules/fs-extra/node_modules/ncp/lib/ncp.js +++ /dev/null @@ -1,216 +0,0 @@ -var fs = require('fs'), - path = require('path'); - -var ncp = exports; - -ncp.ncp = function (source, dest, options, callback) { - if (!callback) { - callback = options; - options = {}; - } - - var basePath = process.cwd(), - currentPath = path.resolve(basePath, source), - targetPath = path.resolve(basePath, dest), - filter = options.filter, - errs = null, - started = 0, - finished = 0, - running = 0, - limit = options.limit || ncp.limit || 16; - - limit = (limit < 1) ? 1 : (limit > 512) ? 512 : limit; - - startCopy(currentPath); - - function startCopy(source) { - started++; - if (filter) { - if (filter instanceof RegExp) { - if (!filter.test(source)) { - return cb(true); - } - } - else if (typeof filter === 'function') { - if (!filter(source)) { - return cb(true); - } - } - } - return getStats(source); - } - - function defer(fn) { - if (typeof(setImmediate) === 'function') - return setImmediate(fn); - return process.nextTick(fn); - } - - function getStats(source) { - if (running >= limit) { - return defer(function () { - getStats(source); - }); - } - running++; - fs.lstat(source, function (err, stats) { - var item = {}; - if (err) { - return onError(err); - } - - // We need to get the mode from the stats object and preserve it. - item.name = source; - item.mode = stats.mode; - - if (stats.isDirectory()) { - return onDir(item); - } - else if (stats.isFile()) { - return onFile(item); - } - else if (stats.isSymbolicLink()) { - // Symlinks don't really need to know about the mode. - return onLink(source); - } - }); - } - - function onFile(file) { - var target = file.name.replace(currentPath, targetPath); - isWritable(target, function (writable) { - if (writable) { - return copyFile(file, target); - } - rmFile(target, function () { - copyFile(file, target); - }); - }); - } - - function copyFile(file, target) { - var readStream = fs.createReadStream(file.name), - writeStream = fs.createWriteStream(target, { mode: file.mode }); - readStream.pipe(writeStream); - readStream.once('end', cb); - } - - function rmFile(file, done) { - fs.unlink(file, function (err) { - if (err) { - return onError(err); - } - return done(); - }); - } - - function onDir(dir) { - var target = dir.name.replace(currentPath, targetPath); - isWritable(target, function (writable) { - if (writable) { - return mkDir(dir, target); - } - copyDir(dir.name); - }); - } - - function mkDir(dir, target) { - fs.mkdir(target, dir.mode, function (err) { - if (err) { - return onError(err); - } - copyDir(dir.name); - }); - } - - function copyDir(dir) { - fs.readdir(dir, function (err, items) { - if (err) { - return onError(err); - } - items.forEach(function (item) { - startCopy(dir + '/' + item); - }); - return cb(); - }); - } - - function onLink(link) { - var target = link.replace(currentPath, targetPath); - fs.readlink(link, function (err, resolvedPath) { - if (err) { - return onError(err); - } - checkLink(resolvedPath, target); - }); - } - - function checkLink(resolvedPath, target) { - isWritable(target, function (writable) { - if (writable) { - return makeLink(resolvedPath, target); - } - fs.readlink(target, function (err, targetDest) { - if (err) { - return onError(err); - } - if (targetDest === resolvedPath) { - return cb(); - } - return rmFile(target, function () { - makeLink(resolvedPath, target); - }); - }); - }); - } - - function makeLink(linkPath, target) { - fs.symlink(linkPath, target, function (err) { - if (err) { - return onError(err); - } - return cb(); - }); - } - - function isWritable(path, done) { - fs.lstat(path, function (err, stats) { - if (err) { - if (err.code === 'ENOENT') return done(true); - return done(false); - } - return done(false); - }); - } - - function onError(err) { - if (options.stopOnError) { - return callback(err); - } - else if (!errs && options.errs) { - errs = fs.createWriteStream(options.errs); - } - else if (!errs) { - errs = []; - } - else if (options.errs) { - if (typeof errs.write === 'undefined') { - errs.push(err); - } - else { - errs.write(err.stack + '\n\n'); - } - } - return cb(); - } - - function cb(skipped) { - if (!skipped) running--; - finished++; - if ((started === finished) && (running === 0)) { - return errs ? callback(errs) : callback(null); - } - } -}; - - diff --git a/test/node/node_modules/fs-extra/node_modules/ncp/package.json b/test/node/node_modules/fs-extra/node_modules/ncp/package.json deleted file mode 100644 index 850a41ffa01..00000000000 --- a/test/node/node_modules/fs-extra/node_modules/ncp/package.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "ncp", - "version": "0.2.7", - "author": { - "name": "AvianFlu", - "email": "charlie@charlieistheman.com" - }, - "description": "Asynchronous recursive file copy utility.", - "bin": { - "ncp": "./bin/ncp" - }, - "devDependencies": { - "vows": "0.6.x", - "rimraf": "1.0.x", - "read-dir-files": "0.0.x" - }, - "main": "./lib/ncp.js", - "repository": { - "type": "git", - "url": "https://github.com/AvianFlu/ncp.git" - }, - "keywords": [ - "cli", - "copy" - ], - "license": "MIT", - "engine": { - "node": ">=0.4" - }, - "scripts": { - "test": "vows --isolate --spec" - }, - "readme": "# ncp - Asynchronous recursive file & directory copying\n\n[![Build Status](https://secure.travis-ci.org/AvianFlu/ncp.png)](http://travis-ci.org/AvianFlu/ncp)\n\nThink `cp -r`, but pure node, and asynchronous. `ncp` can be used both as a CLI tool and programmatically.\n\n## Command Line usage\n\nUsage is simple: `ncp [source] [dest] [--limit=concurrency limit]\n[--filter=filter] --stopOnErr`\n\nThe 'filter' is a Regular Expression - matched files will be copied.\n\nThe 'concurrency limit' is an integer that represents how many pending file system requests `ncp` has at a time.\n\n'stopOnErr' is a boolean flag that will tell `ncp` to stop immediately if any\nerrors arise, rather than attempting to continue while logging errors.\n\nIf there are no errors, `ncp` will output `done.` when complete. If there are errors, the error messages will be logged to `stdout` and to `./ncp-debug.log`, and the copy operation will attempt to continue.\n\n## Programmatic usage\n\nProgrammatic usage of `ncp` is just as simple. The only argument to the completion callback is a possible error. \n\n```javascript\nvar ncp = require('ncp').ncp;\n\nncp.limit = 16;\n\nncp(source, destination, function (err) {\n if (err) {\n return console.error(err);\n }\n console.log('done!');\n});\n```\n\nYou can also call ncp like `ncp(source, destination, options, callback)`. \n`options` should be a dictionary. Currently, such options are available:\n\n * `options.filter` - a `RegExp` instance, against which each file name is\n tested to determine whether to copy it or not, or a function taking single\n parameter: copied file name, returning `true` or `false`, determining\n whether to copy file or not.\n\nPlease open an issue if any bugs arise. As always, I accept (working) pull requests, and refunds are available at `/dev/null`.\n", - "readmeFilename": "README.md", - "_id": "ncp@0.2.7", - "_from": "ncp@0.2.x" -} diff --git a/test/node/node_modules/fs-extra/node_modules/ncp/test/fixtures/src/a b/test/node/node_modules/fs-extra/node_modules/ncp/test/fixtures/src/a deleted file mode 100644 index 802992c4220..00000000000 --- a/test/node/node_modules/fs-extra/node_modules/ncp/test/fixtures/src/a +++ /dev/null @@ -1 +0,0 @@ -Hello world diff --git a/test/node/node_modules/fs-extra/node_modules/ncp/test/fixtures/src/b b/test/node/node_modules/fs-extra/node_modules/ncp/test/fixtures/src/b deleted file mode 100644 index 9f6bb1859d1..00000000000 --- a/test/node/node_modules/fs-extra/node_modules/ncp/test/fixtures/src/b +++ /dev/null @@ -1 +0,0 @@ -Hello ncp diff --git a/test/node/node_modules/fs-extra/node_modules/ncp/test/fixtures/src/c b/test/node/node_modules/fs-extra/node_modules/ncp/test/fixtures/src/c deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/test/node/node_modules/fs-extra/node_modules/ncp/test/fixtures/src/d b/test/node/node_modules/fs-extra/node_modules/ncp/test/fixtures/src/d deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/test/node/node_modules/fs-extra/node_modules/ncp/test/fixtures/src/e b/test/node/node_modules/fs-extra/node_modules/ncp/test/fixtures/src/e deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/test/node/node_modules/fs-extra/node_modules/ncp/test/fixtures/src/f b/test/node/node_modules/fs-extra/node_modules/ncp/test/fixtures/src/f deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/test/node/node_modules/fs-extra/node_modules/ncp/test/fixtures/src/sub/a b/test/node/node_modules/fs-extra/node_modules/ncp/test/fixtures/src/sub/a deleted file mode 100644 index cf291b5e2b7..00000000000 --- a/test/node/node_modules/fs-extra/node_modules/ncp/test/fixtures/src/sub/a +++ /dev/null @@ -1 +0,0 @@ -Hello nodejitsu diff --git a/test/node/node_modules/fs-extra/node_modules/ncp/test/fixtures/src/sub/b b/test/node/node_modules/fs-extra/node_modules/ncp/test/fixtures/src/sub/b deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/test/node/node_modules/fs-extra/node_modules/ncp/test/ncp-test.js b/test/node/node_modules/fs-extra/node_modules/ncp/test/ncp-test.js deleted file mode 100644 index 3783f603eef..00000000000 --- a/test/node/node_modules/fs-extra/node_modules/ncp/test/ncp-test.js +++ /dev/null @@ -1,74 +0,0 @@ -var assert = require('assert'), - path = require('path'), - rimraf = require('rimraf'), - vows = require('vows'), - readDirFiles = require('read-dir-files'), - ncp = require('../').ncp; - -var fixtures = path.join(__dirname, 'fixtures'), - src = path.join(fixtures, 'src'), - out = path.join(fixtures, 'out'); - -vows.describe('ncp').addBatch({ - 'When copying a directory of files': { - topic: function () { - var cb = this.callback; - rimraf(out, function () { - ncp(src, out, cb); - }); - }, - 'files should be copied': { - topic: function () { - var cb = this.callback; - - readDirFiles(src, 'utf8', function (srcErr, srcFiles) { - readDirFiles(out, 'utf8', function (outErr, outFiles) { - cb(outErr, srcFiles, outFiles); - }); - }); - }, - 'and the destination should match the source': function (err, srcFiles, outFiles) { - assert.isNull(err); - assert.deepEqual(srcFiles, outFiles); - } - } - } -}).addBatch({ - 'When copying files using filter': { - topic: function() { - var cb = this.callback; - var filter = function(name) { - return name.substr(name.length - 1) != 'a' - } - rimraf(out, function () { - ncp(src, out, {filter: filter}, cb); - }); - }, - 'it should copy files': { - topic: function () { - var cb = this.callback; - - readDirFiles(src, 'utf8', function (srcErr, srcFiles) { - function filter(files) { - for (var fileName in files) { - var curFile = files[fileName]; - if (curFile instanceof Object) - return filter(curFile); - if (fileName.substr(fileName.length - 1) == 'a') - delete files[fileName]; - } - } - filter(srcFiles); - readDirFiles(out, 'utf8', function (outErr, outFiles) { - cb(outErr, srcFiles, outFiles); - }); - }); - }, - 'and destination files should match source files that pass filter': function (err, srcFiles, outFiles) { - assert.isNull(err); - assert.deepEqual(srcFiles, outFiles); - } - } - } -}).export(module); - diff --git a/test/node/node_modules/fs-extra/node_modules/rimraf/AUTHORS b/test/node/node_modules/fs-extra/node_modules/rimraf/AUTHORS deleted file mode 100644 index 247b7543737..00000000000 --- a/test/node/node_modules/fs-extra/node_modules/rimraf/AUTHORS +++ /dev/null @@ -1,6 +0,0 @@ -# Authors sorted by whether or not they're me. -Isaac Z. Schlueter (http://blog.izs.me) -Wayne Larsen (http://github.com/wvl) -ritch -Marcel Laverdet -Yosef Dinerstein diff --git a/test/node/node_modules/fs-extra/node_modules/rimraf/LICENSE b/test/node/node_modules/fs-extra/node_modules/rimraf/LICENSE deleted file mode 100644 index 05a4010949c..00000000000 --- a/test/node/node_modules/fs-extra/node_modules/rimraf/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright 2009, 2010, 2011 Isaac Z. Schlueter. -All rights reserved. - -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/test/node/node_modules/fs-extra/node_modules/rimraf/README.md b/test/node/node_modules/fs-extra/node_modules/rimraf/README.md deleted file mode 100644 index 96ce9b2a0bd..00000000000 --- a/test/node/node_modules/fs-extra/node_modules/rimraf/README.md +++ /dev/null @@ -1,21 +0,0 @@ -A `rm -rf` for node. - -Install with `npm install rimraf`, or just drop rimraf.js somewhere. - -## API - -`rimraf(f, callback)` - -The callback will be called with an error if there is one. Certain -errors are handled for you: - -* `EBUSY` - rimraf will back off a maximum of opts.maxBusyTries times - before giving up. -* `EMFILE` - If too many file descriptors get opened, rimraf will - patiently wait until more become available. - - -## rimraf.sync - -It can remove stuff synchronously, too. But that's not so good. Use -the async API. It's better. diff --git a/test/node/node_modules/fs-extra/node_modules/rimraf/node_modules/graceful-fs/.npmignore b/test/node/node_modules/fs-extra/node_modules/rimraf/node_modules/graceful-fs/.npmignore deleted file mode 100644 index c2658d7d1b3..00000000000 --- a/test/node/node_modules/fs-extra/node_modules/rimraf/node_modules/graceful-fs/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules/ diff --git a/test/node/node_modules/fs-extra/node_modules/rimraf/node_modules/graceful-fs/LICENSE b/test/node/node_modules/fs-extra/node_modules/rimraf/node_modules/graceful-fs/LICENSE deleted file mode 100644 index 05a4010949c..00000000000 --- a/test/node/node_modules/fs-extra/node_modules/rimraf/node_modules/graceful-fs/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright 2009, 2010, 2011 Isaac Z. Schlueter. -All rights reserved. - -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/test/node/node_modules/fs-extra/node_modules/rimraf/node_modules/graceful-fs/README.md b/test/node/node_modules/fs-extra/node_modules/rimraf/node_modules/graceful-fs/README.md deleted file mode 100644 index 7d2e681e32f..00000000000 --- a/test/node/node_modules/fs-extra/node_modules/rimraf/node_modules/graceful-fs/README.md +++ /dev/null @@ -1,5 +0,0 @@ -Just like node's `fs` module, but it does an incremental back-off when -EMFILE is encountered. - -Useful in asynchronous situations where one needs to try to open lots -and lots of files. diff --git a/test/node/node_modules/fs-extra/node_modules/rimraf/node_modules/graceful-fs/graceful-fs.js b/test/node/node_modules/fs-extra/node_modules/rimraf/node_modules/graceful-fs/graceful-fs.js deleted file mode 100644 index fe9c3f4cad9..00000000000 --- a/test/node/node_modules/fs-extra/node_modules/rimraf/node_modules/graceful-fs/graceful-fs.js +++ /dev/null @@ -1,316 +0,0 @@ -// this keeps a queue of opened file descriptors, and will make -// fs operations wait until some have closed before trying to open more. - -var fs_ = require("fs") - -var fs = module.exports = {} - -Object.getOwnPropertyNames(fs_).forEach(function(prop) { - var desc = Object.getOwnPropertyDescriptor(fs_, prop) - Object.defineProperty(fs, prop, desc) -}) - -var queue = [] - , constants = require("constants") - -exports = module.exports = fs -fs._curOpen = 0 - -fs.MIN_MAX_OPEN = 64 -fs.MAX_OPEN = 1024 - -var originalOpen = fs.open - , originalOpenSync = fs.openSync - , originalClose = fs.close - , originalCloseSync = fs.closeSync - - -// prevent EMFILE errors -function OpenReq (path, flags, mode, cb) { - this.path = path - this.flags = flags - this.mode = mode - this.cb = cb -} - -function noop () {} - -fs.open = gracefulOpen - -function gracefulOpen (path, flags, mode, cb) { - if (typeof mode === "function") cb = mode, mode = null - if (typeof cb !== "function") cb = noop - - if (fs._curOpen >= fs.MAX_OPEN) { - queue.push(new OpenReq(path, flags, mode, cb)) - setTimeout(flush) - return - } - open(path, flags, mode, function (er, fd) { - if (er && er.code === "EMFILE" && fs._curOpen > fs.MIN_MAX_OPEN) { - // that was too many. reduce max, get back in queue. - // this should only happen once in a great while, and only - // if the ulimit -n is set lower than 1024. - fs.MAX_OPEN = fs._curOpen - 1 - return fs.open(path, flags, mode, cb) - } - cb(er, fd) - }) -} - -function open (path, flags, mode, cb) { - cb = cb || noop - fs._curOpen ++ - originalOpen.call(fs, path, flags, mode, function (er, fd) { - if (er) onclose() - cb(er, fd) - }) -} - -fs.openSync = function (path, flags, mode) { - var ret - ret = originalOpenSync.call(fs, path, flags, mode) - fs._curOpen ++ - return ret -} - -function onclose () { - fs._curOpen -- - flush() -} - -function flush () { - while (fs._curOpen < fs.MAX_OPEN) { - var req = queue.shift() - if (!req) return - open(req.path, req.flags || "r", req.mode || 0777, req.cb) - } -} - -fs.close = function (fd, cb) { - cb = cb || noop - originalClose.call(fs, fd, function (er) { - onclose() - cb(er) - }) -} - -fs.closeSync = function (fd) { - onclose() - return originalCloseSync.call(fs, fd) -} - - -// (re-)implement some things that are known busted or missing. - -var constants = require("constants") - -// lchmod, broken prior to 0.6.2 -// back-port the fix here. -if (constants.hasOwnProperty('O_SYMLINK') && - process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { - fs.lchmod = function (path, mode, callback) { - callback = callback || noop - fs.open( path - , constants.O_WRONLY | constants.O_SYMLINK - , mode - , function (err, fd) { - if (err) { - callback(err) - return - } - // prefer to return the chmod error, if one occurs, - // but still try to close, and report closing errors if they occur. - fs.fchmod(fd, mode, function (err) { - fs.close(fd, function(err2) { - callback(err || err2) - }) - }) - }) - } - - fs.lchmodSync = function (path, mode) { - var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode) - - // prefer to return the chmod error, if one occurs, - // but still try to close, and report closing errors if they occur. - var err, err2 - try { - var ret = fs.fchmodSync(fd, mode) - } catch (er) { - err = er - } - try { - fs.closeSync(fd) - } catch (er) { - err2 = er - } - if (err || err2) throw (err || err2) - return ret - } -} - - -// lutimes implementation, or no-op -if (!fs.lutimes) { - if (constants.hasOwnProperty("O_SYMLINK")) { - fs.lutimes = function (path, at, mt, cb) { - fs.open(path, constants.O_SYMLINK, function (er, fd) { - cb = cb || noop - if (er) return cb(er) - fs.futimes(fd, at, mt, function (er) { - fs.close(fd, function (er2) { - return cb(er || er2) - }) - }) - }) - } - - fs.lutimesSync = function (path, at, mt) { - var fd = fs.openSync(path, constants.O_SYMLINK) - , err - , err2 - , ret - - try { - var ret = fs.futimesSync(fd, at, mt) - } catch (er) { - err = er - } - try { - fs.closeSync(fd) - } catch (er) { - err2 = er - } - if (err || err2) throw (err || err2) - return ret - } - - } else if (fs.utimensat && constants.hasOwnProperty("AT_SYMLINK_NOFOLLOW")) { - // maybe utimensat will be bound soonish? - fs.lutimes = function (path, at, mt, cb) { - fs.utimensat(path, at, mt, constants.AT_SYMLINK_NOFOLLOW, cb) - } - - fs.lutimesSync = function (path, at, mt) { - return fs.utimensatSync(path, at, mt, constants.AT_SYMLINK_NOFOLLOW) - } - - } else { - fs.lutimes = function (_a, _b, _c, cb) { process.nextTick(cb) } - fs.lutimesSync = function () {} - } -} - - -// https://github.com/isaacs/node-graceful-fs/issues/4 -// Chown should not fail on einval or eperm if non-root. - -fs.chown = chownFix(fs.chown) -fs.fchown = chownFix(fs.fchown) -fs.lchown = chownFix(fs.lchown) - -fs.chownSync = chownFixSync(fs.chownSync) -fs.fchownSync = chownFixSync(fs.fchownSync) -fs.lchownSync = chownFixSync(fs.lchownSync) - -function chownFix (orig) { - if (!orig) return orig - return function (target, uid, gid, cb) { - return orig.call(fs, target, uid, gid, function (er, res) { - if (chownErOk(er)) er = null - cb(er, res) - }) - } -} - -function chownFixSync (orig) { - if (!orig) return orig - return function (target, uid, gid) { - try { - return orig.call(fs, target, uid, gid) - } catch (er) { - if (!chownErOk(er)) throw er - } - } -} - -function chownErOk (er) { - // if there's no getuid, or if getuid() is something other than 0, - // and the error is EINVAL or EPERM, then just ignore it. - // This specific case is a silent failure in cp, install, tar, - // and most other unix tools that manage permissions. - // When running as root, or if other types of errors are encountered, - // then it's strict. - if (!er || (!process.getuid || process.getuid() !== 0) - && (er.code === "EINVAL" || er.code === "EPERM")) return true -} - - -// if lchmod/lchown do not exist, then make them no-ops -if (!fs.lchmod) { - fs.lchmod = function (path, mode, cb) { - process.nextTick(cb) - } - fs.lchmodSync = function () {} -} -if (!fs.lchown) { - fs.lchown = function (path, uid, gid, cb) { - process.nextTick(cb) - } - fs.lchownSync = function () {} -} - - - -// on Windows, A/V software can lock the directory, causing this -// to fail with an EACCES or EPERM if the directory contains newly -// created files. Try again on failure, for up to 1 second. -if (process.platform === "win32") { - var rename_ = fs.rename - fs.rename = function rename (from, to, cb) { - var start = Date.now() - rename_(from, to, function CB (er) { - if (er - && (er.code === "EACCES" || er.code === "EPERM") - && Date.now() - start < 1000) { - return rename_(from, to, CB) - } - cb(er) - }) - } -} - - -// if read() returns EAGAIN, then just try it again. -var read = fs.read -fs.read = function (fd, buffer, offset, length, position, callback_) { - var callback - if (callback_ && typeof callback_ === 'function') { - var eagCounter = 0 - callback = function (er, _, __) { - if (er && er.code === 'EAGAIN' && eagCounter < 10) { - eagCounter ++ - return read.call(fs, fd, buffer, offset, length, position, callback) - } - callback_.apply(this, arguments) - } - } - return read.call(fs, fd, buffer, offset, length, position, callback) -} - -var readSync = fs.readSync -fs.readSync = function (fd, buffer, offset, length, position) { - var eagCounter = 0 - while (true) { - try { - return readSync.call(fs, fd, buffer, offset, length, position) - } catch (er) { - if (er.code === 'EAGAIN' && eagCounter < 10) { - eagCounter ++ - continue - } - throw er - } - } -} diff --git a/test/node/node_modules/fs-extra/node_modules/rimraf/node_modules/graceful-fs/package.json b/test/node/node_modules/fs-extra/node_modules/rimraf/node_modules/graceful-fs/package.json deleted file mode 100644 index 9623d0b2858..00000000000 --- a/test/node/node_modules/fs-extra/node_modules/rimraf/node_modules/graceful-fs/package.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me" - }, - "name": "graceful-fs", - "description": "fs monkey-patching to avoid EMFILE and other problems", - "version": "1.2.0", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/node-graceful-fs.git" - }, - "main": "graceful-fs.js", - "engines": { - "node": ">=0.4.0" - }, - "directories": { - "test": "test" - }, - "scripts": { - "test": "tap test/*.js" - }, - "keywords": [ - "fs", - "EMFILE", - "error", - "handling", - "monkeypatch" - ], - "license": "BSD", - "readme": "Just like node's `fs` module, but it does an incremental back-off when\nEMFILE is encountered.\n\nUseful in asynchronous situations where one needs to try to open lots\nand lots of files.\n", - "readmeFilename": "README.md", - "_id": "graceful-fs@1.2.0", - "_from": "graceful-fs@~1" -} diff --git a/test/node/node_modules/fs-extra/node_modules/rimraf/node_modules/graceful-fs/test/open.js b/test/node/node_modules/fs-extra/node_modules/rimraf/node_modules/graceful-fs/test/open.js deleted file mode 100644 index 930d53257c2..00000000000 --- a/test/node/node_modules/fs-extra/node_modules/rimraf/node_modules/graceful-fs/test/open.js +++ /dev/null @@ -1,46 +0,0 @@ -var test = require('tap').test -var fs = require('../graceful-fs.js') - -test('graceful fs is not fs', function (t) { - t.notEqual(fs, require('fs')) - t.end() -}) - -test('open an existing file works', function (t) { - var start = fs._curOpen - var fd = fs.openSync(__filename, 'r') - t.equal(fs._curOpen, start + 1) - fs.closeSync(fd) - t.equal(fs._curOpen, start) - fs.open(__filename, 'r', function (er, fd) { - if (er) throw er - t.equal(fs._curOpen, start + 1) - fs.close(fd, function (er) { - if (er) throw er - t.equal(fs._curOpen, start) - t.end() - }) - }) -}) - -test('open a non-existing file throws', function (t) { - var start = fs._curOpen - var er - try { - var fd = fs.openSync('this file does not exist', 'r') - } catch (x) { - er = x - } - t.ok(er, 'should throw') - t.notOk(fd, 'should not get an fd') - t.equal(er.code, 'ENOENT') - t.equal(fs._curOpen, start) - - fs.open('neither does this file', 'r', function (er, fd) { - t.ok(er, 'should throw') - t.notOk(fd, 'should not get an fd') - t.equal(er.code, 'ENOENT') - t.equal(fs._curOpen, start) - t.end() - }) -}) diff --git a/test/node/node_modules/fs-extra/node_modules/rimraf/package.json b/test/node/node_modules/fs-extra/node_modules/rimraf/package.json deleted file mode 100644 index 51d4512c66e..00000000000 --- a/test/node/node_modules/fs-extra/node_modules/rimraf/package.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "name": "rimraf", - "version": "2.1.4", - "main": "rimraf.js", - "description": "A deep deletion module for node (like `rm -rf`)", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "license": { - "type": "MIT", - "url": "https://github.com/isaacs/rimraf/raw/master/LICENSE" - }, - "optionalDependencies": { - "graceful-fs": "~1" - }, - "repository": { - "type": "git", - "url": "git://github.com/isaacs/rimraf.git" - }, - "scripts": { - "test": "cd test && bash run.sh" - }, - "contributors": [ - { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me" - }, - { - "name": "Wayne Larsen", - "email": "wayne@larsen.st", - "url": "http://github.com/wvl" - }, - { - "name": "ritch", - "email": "skawful@gmail.com" - }, - { - "name": "Marcel Laverdet" - }, - { - "name": "Yosef Dinerstein", - "email": "yosefd@microsoft.com" - } - ], - "readme": "A `rm -rf` for node.\n\nInstall with `npm install rimraf`, or just drop rimraf.js somewhere.\n\n## API\n\n`rimraf(f, callback)`\n\nThe callback will be called with an error if there is one. Certain\nerrors are handled for you:\n\n* `EBUSY` - rimraf will back off a maximum of opts.maxBusyTries times\n before giving up.\n* `EMFILE` - If too many file descriptors get opened, rimraf will\n patiently wait until more become available.\n\n\n## rimraf.sync\n\nIt can remove stuff synchronously, too. But that's not so good. Use\nthe async API. It's better.\n", - "readmeFilename": "README.md", - "_id": "rimraf@2.1.4", - "dependencies": { - "graceful-fs": "~1" - }, - "_from": "rimraf@~2.1.2" -} diff --git a/test/node/node_modules/fs-extra/node_modules/rimraf/rimraf.js b/test/node/node_modules/fs-extra/node_modules/rimraf/rimraf.js deleted file mode 100644 index ed915f982e8..00000000000 --- a/test/node/node_modules/fs-extra/node_modules/rimraf/rimraf.js +++ /dev/null @@ -1,132 +0,0 @@ -module.exports = rimraf -rimraf.sync = rimrafSync - -var path = require("path") - , fs - -try { - // optional dependency - fs = require("graceful-fs") -} catch (er) { - fs = require("fs") -} - -// for EMFILE handling -var timeout = 0 -exports.EMFILE_MAX = 1000 -exports.BUSYTRIES_MAX = 3 - -function rimraf (p, cb) { - if (!cb) throw new Error("No callback passed to rimraf()") - - var busyTries = 0 - rimraf_(p, function CB (er) { - if (er) { - if (er.code === "EBUSY" && busyTries < exports.BUSYTRIES_MAX) { - busyTries ++ - var time = busyTries * 100 - // try again, with the same exact callback as this one. - return setTimeout(function () { - rimraf_(p, CB) - }, time) - } - - // this one won't happen if graceful-fs is used. - if (er.code === "EMFILE" && timeout < exports.EMFILE_MAX) { - return setTimeout(function () { - rimraf_(p, CB) - }, timeout ++) - } - - // already gone - if (er.code === "ENOENT") er = null - } - - timeout = 0 - cb(er) - }) -} - -// Two possible strategies. -// 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR -// 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR -// -// Both result in an extra syscall when you guess wrong. However, there -// are likely far more normal files in the world than directories. This -// is based on the assumption that a the average number of files per -// directory is >= 1. -// -// If anyone ever complains about this, then I guess the strategy could -// be made configurable somehow. But until then, YAGNI. -function rimraf_ (p, cb) { - fs.unlink(p, function (er) { - if (er && er.code === "ENOENT") - return cb() - if (er && (er.code === "EPERM" || er.code === "EISDIR")) - return rmdir(p, er, cb) - return cb(er) - }) -} - -function rmdir (p, originalEr, cb) { - // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS) - // if we guessed wrong, and it's not a directory, then - // raise the original error. - fs.rmdir(p, function (er) { - if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST")) - rmkids(p, cb) - else if (er && er.code === "ENOTDIR") - cb(originalEr) - else - cb(er) - }) -} - -function rmkids(p, cb) { - fs.readdir(p, function (er, files) { - if (er) - return cb(er) - var n = files.length - if (n === 0) - return fs.rmdir(p, cb) - var errState - files.forEach(function (f) { - rimraf(path.join(p, f), function (er) { - if (errState) - return - if (er) - return cb(errState = er) - if (--n === 0) - fs.rmdir(p, cb) - }) - }) - }) -} - -// this looks simpler, and is strictly *faster*, but will -// tie up the JavaScript thread and fail on excessively -// deep directory trees. -function rimrafSync (p) { - try { - fs.unlinkSync(p) - } catch (er) { - if (er.code === "ENOENT") - return - if (er.code !== "EPERM" && er.code !== "EISDIR") - throw er - try { - fs.rmdirSync(p) - } catch (er2) { - if (er2.code === "ENOENT") - return - if (er2.code === "ENOTDIR") - throw er - if (er2.code === "ENOTEMPTY") { - fs.readdirSync(p).forEach(function (f) { - rimrafSync(path.join(p, f)) - }) - fs.rmdirSync(p) - } - } - } -} diff --git a/test/node/node_modules/fs-extra/node_modules/rimraf/test/run.sh b/test/node/node_modules/fs-extra/node_modules/rimraf/test/run.sh deleted file mode 100644 index 598f0163b23..00000000000 --- a/test/node/node_modules/fs-extra/node_modules/rimraf/test/run.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -set -e -for i in test-*.js; do - echo -n $i ... - bash setup.sh - node $i - ! [ -d target ] - echo "pass" -done -rm -rf target diff --git a/test/node/node_modules/fs-extra/node_modules/rimraf/test/setup.sh b/test/node/node_modules/fs-extra/node_modules/rimraf/test/setup.sh deleted file mode 100644 index 2602e631602..00000000000 --- a/test/node/node_modules/fs-extra/node_modules/rimraf/test/setup.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash - -set -e - -files=10 -folders=2 -depth=4 -target="$PWD/target" - -rm -rf target - -fill () { - local depth=$1 - local files=$2 - local folders=$3 - local target=$4 - - if ! [ -d $target ]; then - mkdir -p $target - fi - - local f - - f=$files - while [ $f -gt 0 ]; do - touch "$target/f-$depth-$f" - let f-- - done - - let depth-- - - if [ $depth -le 0 ]; then - return 0 - fi - - f=$folders - while [ $f -gt 0 ]; do - mkdir "$target/folder-$depth-$f" - fill $depth $files $folders "$target/d-$depth-$f" - let f-- - done -} - -fill $depth $files $folders $target - -# sanity assert -[ -d $target ] diff --git a/test/node/node_modules/fs-extra/node_modules/rimraf/test/test-async.js b/test/node/node_modules/fs-extra/node_modules/rimraf/test/test-async.js deleted file mode 100644 index 9c2e0b7be0e..00000000000 --- a/test/node/node_modules/fs-extra/node_modules/rimraf/test/test-async.js +++ /dev/null @@ -1,5 +0,0 @@ -var rimraf = require("../rimraf") - , path = require("path") -rimraf(path.join(__dirname, "target"), function (er) { - if (er) throw er -}) diff --git a/test/node/node_modules/fs-extra/node_modules/rimraf/test/test-sync.js b/test/node/node_modules/fs-extra/node_modules/rimraf/test/test-sync.js deleted file mode 100644 index eb71f10476e..00000000000 --- a/test/node/node_modules/fs-extra/node_modules/rimraf/test/test-sync.js +++ /dev/null @@ -1,3 +0,0 @@ -var rimraf = require("../rimraf") - , path = require("path") -rimraf.sync(path.join(__dirname, "target")) diff --git a/test/node/node_modules/fs-extra/package.json b/test/node/node_modules/fs-extra/package.json deleted file mode 100755 index f9a3e10f026..00000000000 --- a/test/node/node_modules/fs-extra/package.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "name": "fs-extra", - "version": "0.5.0", - "description": "fs-extra contains methods that aren't included in the vanilla Node.js fs package. Such as mkdir -p, cp -r, and rm -rf.", - "homepage": [ - "https://github.com/jprichardson/node-fs-extra" - ], - "repository": { - "type": "git", - "url": "https://github.com/jprichardson/node-fs-extra" - }, - "keywords": [ - "fs", - "file", - "file system", - "copy", - "directory", - "extra", - "mkdirp", - "mkdir", - "mkdirs", - "recursive", - "json", - "read", - "write", - "extra", - "delete", - "remove", - "touch", - "create", - "text", - "output" - ], - "author": { - "name": "JP Richardson", - "email": "jprichardson@gmail.com" - }, - "licenses": [ - { - "type": "MIT", - "url": "http://github.com/jprichardson/node-fs-extra/raw/master/LICENSE" - } - ], - "dependencies": { - "ncp": "0.2.x", - "mkdirp": "0.3.x", - "jsonfile": "0.0.x", - "rimraf": "~2.1.2" - }, - "devDependencies": { - "mocha": "*", - "path-extra": "0.0.x", - "testutil": "~0.4.0" - }, - "main": "./lib/index", - "scripts": { - "test": "mocha test" - }, - "readme": "[![build status](https://secure.travis-ci.org/jprichardson/node-fs-extra.png)](http://travis-ci.org/jprichardson/node-fs-extra)\n\nNode.js: fs-extra\n=================\n\nThis module adds a few extra file system methods that aren't included in the native `fs` module. It is a drop in replacement for `fs`.\n\n\n\nWhy?\n----\n\nI got tired of including `mkdirp`, `rimraf`, and `cp -r` in most of my projects. \n\n\n\n\nInstallation\n------------\n\n npm install fs-extra\n\n\n\nUsage\n-----\n\n```javascript\nvar fs = require('fs-extra');\n```\n\n\n\nMethods\n-------\n\n**NOTE:** You can still use the native Node.js methods. They are copied over to `fs-extra`.\n\n\n### copy(src, dest, callback)\n\nCopy a file or directory. The directory can have contents. Like `cp -r`. There isn't a synchronous version implemented yet.\n\nSync: (none)\n\n\nExamples:\n\n```javascript\nvar fs = require('fs-extra');\n\nfs.copy('/tmp/myfile', '/tmp/mynewfile', function(err){\n if (err) {\n console.error(err);\n }\n else {\n console.log(\"success!\")\n }\n}); //copies file\n\nfs.copy('/tmp/mydir', '/tmp/mynewdir', function(err){\n if (err) {\n console.error(err);\n }\n else {\n console.log(\"success!\")\n }\n}); //copies directory, even if it has subdirectories or files\n```\n\n\n### createFile(file, callback) \n\nCreates a file. If the file that is requested to be created is in directories that do not exist, these directories are created. If the file already exists, it is **NOT MODIFIED**.\n\nSync: `createFileSync()`\n\n\nExample:\n\n```javascript\nvar fs = require('fs-extra')\n , file = '/tmp/this/path/does/not/exist/file.txt'\n\nfs.createFile(file, function(err) {\n console.log(err); //null\n\n //file has now been created, including the directory it is to be placed in\n})\n```\n\n\n### exists() / existsSync()\n\nThese methods are actually from `path` in v0.6. But in Node v0.8 they are moved from `path` to `fs`. So you can use this module to help make your modules v0.6 and v0.8 compatible.\n\n\n\n### mkdirs(dir, callback) \n\nCreates a directory. If the parent hierarchy doesn't exist, it's created. Like `mkdir -p`.\n\nAlias: `mkdirp()`\n\nSync: `mkdirsSync()` / `mkdirpSync()`\n\n\nExamples:\n\n```javascript\nvar fs = require('fs-extra');\n\nfs.mkdirs('/tmp/some/long/path/that/prob/doesnt/exist', function(err){\n if (err) {\n console.error(err);\n }\n else {\n console.log(\"success!\")\n }\n});\n\nfs.mkdirsSync('/tmp/another/path');\n```\n\n\n### outputFile(file, data, callback)\n\nAlmost the same as `writeFile`, except that if the directory does not exist, it's created.\n\nSync: `outputFileSync()`\n\n\nExample:\n\n```javascript\nvar fs = require('fs-extra')\n , file = '/tmp/this/path/does/not/exist/file.txt'\n\nfs.outputFile(file, 'hello!' function(err) {\n console.log(err); //null\n\n fs.readFile(file, 'utf8', function(err, data) {\n console.log(data); //hello!\n })\n})\n```\n\n\n### readJson(file, callback) \n\nReads a JSON file and then parses it into an object.\n\nAlias: `readJSON()`\n\nSync: `readJsonSync()`, `readJSONSync()`\n\n\nExample:\n\n```javascript\nvar fs = require('fs-extra');\n\nfs.readJson('./package.json', function(err, packageObj) {\n console.log(packageObj.version); //0.1.3\n});\n```\n\n\n### remove(dir, callback)\n\nRemoves a file or directory. The directory can have contents. Like `rm -rf`.\n\nAlias: `delete()`\n\nSync: `removeSync()` / `deleteSync()`\n\n\nExamples:\n\n```javascript\nvar fs = require('fs-extra');\n\nfs.remove('/tmp/myfile', function(err){\n if (err) {\n console.error(err);\n }\n else {\n console.log(\"success!\")\n }\n});\n\nfs.removeSync('/home/jprichardson'); //I just deleted my entire HOME directory. \n```\n\n\n\n### writeJson(file, object, callback) \n\nWrites an object to a JSON file.\n\nAlias: `writeJSON()`\n\nSync: `writeJsonSync()`, `writeJSONSync()`\n\nExample:\n\n```javascript\nvar fs = require('fs-extra');\nfs.writeJson('./package.json', {name: 'fs-extra'}, function(err){\n console.log(err);\n});\n```\n\n\n\nRoadmap \n-------\n\nThis contains items that I'm considering doing. I'd love community feedback.\n\n* File system walker. I really like this one: https://github.com/daaku/nodejs-walker\n* File/directory tree watcher. There are quite a few.\n* Method to move files.\n* Copy sync.\n* Thinking about moving `rimraf`, `ncp`, and `mkdirps` code into this library. I'd like fs-extra to be a stable library that module authors\ncan depend upon. A bunch of other dependencies kinda sucks for modules/libraries.\n* Change documentation to use the `fse` prefix instead of `fs`. This may encourage people to start using `fse` as a prefix and hence make their code clearer that they're not using the native `fs`. I'm very undecided on this one since `fs-extra` is a drop in replacement for the native `fs`.\n\n\n\nNaming\n------\n\nI put a lot of thought into the naming of these function. Inspired by @coolaj86's request. So he deserves much of the credit for raising the issue. See discussion(s) here:\n\n* https://github.com/jprichardson/node-fs-extra/issues/2\n* https://github.com/flatiron/utile/issues/11\n* https://github.com/ryanmcgrath/wrench-js/issues/29\n* https://github.com/substack/node-mkdirp/issues/17\n\nFirst, I believe that in as many cases as possible, the [Node.js naming schemes](http://nodejs.org/api/fs.html) should be chosen. However, there are problems with the Node.js own naming schemes.\n\nFor example, `fs.readFile()` and `fs.readdir()`: the **F** is capitalized in *File* and the **d** is not capitalized in *dir*. Perhaps a bit pedantic, but they should still be consistent. Also, Node.js has chosen a lot of POSIX naming schemes, which I believe is great. See: `fs.mkdir()`, `fs.rmdir()`, `fs.chown()`, etc.\n\nWe have a dilemma though. How do you consistently name methods that perform the following POSIX commands: `cp`, `cp -r`, `mkdir -p`, and `rm -rf`?\n\nMy perspective: when in doubt, err on the side of simplicity. Consider that for a moment. A directory is just a hierarchical grouping of directories and files. So when you want to copy it or remove it, in most cases you'll want to copy or remove all of its contents. When you want to create a directory, if the directory that it's suppose to be contained in does not exist, then in most cases you'll want to create that too. \n\nSo, if you want to remove a file or a directory regardless of whether it has contents, just call `fs.remove(path)` or its alias `fs.delete(path)`. If you want to copy a file or a directory whether it has contents, just call `fs.copy(source, destination)`. If you want to create a directory regardless of whether its parent directories exist, just call `fs.mkdirs(path)` or `fs.mkdirp(path)`. \n\n\n\nAuthor\n------\n\n`node-fs-extra` was written by [JP Richardson][aboutjp]. You should follow him on Twitter [@jprichardson][twitter]. Also read his coding blog [Procbits][procbits]. If you write software with others, you should checkout [Gitpilot][gitpilot] to make collaboration with Git simple.\n\n\n\n\nLicense\n-------\n\n\nLicensed under MIT\n\nCopyright (c) 2011-2013 JP Richardson\n\n[1]: http://nodejs.org/docs/latest/api/fs.html \n\n\n[jsonfile]: https://github.com/jprichardson/node-jsonfile\n\n\n[aboutjp]: http://about.me/jprichardson\n[twitter]: http://twitter.com/jprichardson\n[procbits]: http://procbits.com\n[gitpilot]: http://gitpilot.com\n\n\n\n", - "readmeFilename": "README.md", - "_id": "fs-extra@0.5.0", - "_from": "fs-extra@0.5.x" -} diff --git a/test/node/node_modules/fs-extra/test/copy.test.js b/test/node/node_modules/fs-extra/test/copy.test.js deleted file mode 100644 index c847e47b3ab..00000000000 --- a/test/node/node_modules/fs-extra/test/copy.test.js +++ /dev/null @@ -1,85 +0,0 @@ -var crypto = require('crypto') - , fs = require('../lib') - , path = require('path-extra') - , testutil = require('testutil') - , mkdir = require('mkdirp'); - -var SIZE = 16 * 64 * 1024 + 7; -var DIR = ''; - -describe('fs-extra', function() { - beforeEach(function(done) { - DIR = testutil.createTestDir('fs-extra'); - done(); - }) - - afterEach(function(done) { - fs.remove(DIR, done); - }) - - /* - describe '+ copyFileSync()', -> - it 'should copy synchronously', -> - fileSrc = path.join(DIR, "TEST_fs-extra_src") - fileDest = path.join(DIR, "TEST_fs-extra_copy") - - fileSrc = testutil.createFileWithData(fileSrc, SIZE) - srcMd5 = crypto.createHash('md5').update(fs.readFileSync(fileSrc)).digest('hex') - fs.copyFileSync(fileSrc, fileDest) - destMd5 = crypto.createHash('md5').update(fs.readFileSync(fileDest)).digest("hex") - - T srcMd5 is destMd5 - */ - - describe('+ copy()', function() { - - it('should copy the file asynchronously', function(done) { - var fileSrc = path.join(DIR, "TEST_fs-extra_src") - , fileDest = path.join(DIR, "TEST_fs-extra_copy") - , fileSrc = testutil.createFileWithData(fileSrc, SIZE) - , srcMd5 = crypto.createHash('md5').update(fs.readFileSync(fileSrc)).digest("hex") - , destMd5 = ''; - - fs.copy(fileSrc, fileDest, function(err) { - destMd5 = crypto.createHash('md5').update(fs.readFileSync(fileDest)).digest("hex"); - T (srcMd5 === destMd5); - done() - }) - }) - - it('should copy the directory asynchronously', function(done) { - var FILES = 2 - , src = path.join(DIR, 'src') - , dest = path.join(DIR, 'dest'); - - mkdir(src, function(err) { - for (var i = 0; i < FILES; ++i) - testutil.createFileWithData(path.join(src, i.toString()), SIZE); - - var subdir = path.join(src, 'subdir'); - mkdir(subdir, function(err) { - for (var i = 0; i < FILES; ++i) - testutil.createFileWithData(path.join(subdir, i.toString()), SIZE); - - fs.copy(src, dest, function(err) { - F (err); - T (fs.existsSync(dest)); - - for (var i = 0; i < FILES; ++i) - T (fs.existsSync(path.join(dest, i.toString()))); - - - var destSub = path.join(dest, 'subdir'); - for (var j = 0; j < FILES; ++j) - T (fs.existsSync(path.join(destSub, j.toString()))); - - done(); - }) - }) - }) - }) - - }) -}) - - diff --git a/test/node/node_modules/fs-extra/test/create.test.js b/test/node/node_modules/fs-extra/test/create.test.js deleted file mode 100644 index 4b02479f506..00000000000 --- a/test/node/node_modules/fs-extra/test/create.test.js +++ /dev/null @@ -1,60 +0,0 @@ -var testutil = require('testutil') - , fs = require('../') - , path = require('path') - -var TEST_DIR = ''; - -describe('fs-extra', function () { - beforeEach(function() { - TEST_DIR = testutil.createTestDir('fs-extra'); - }) - - describe('+ createFile', function() { - describe('> when the file and directory does not exist', function() { - it('should create the file', function(done) { - var file = path.join(TEST_DIR, Math.random() + 't-ne', Math.random() + '.txt'); - F (fs.existsSync(file)); - fs.createFile(file, function(err) { - F (err); - T (fs.existsSync(file)); - done(); - }) - }) - }) - - describe('> when the file does exist', function() { - it('should not modify the file', function(done) { - var file = path.join(TEST_DIR, Math.random() + 't-e', Math.random() + '.txt'); - fs.mkdirsSync(path.dirname(file)) - fs.writeFileSync(file, 'hello world'); - fs.createFile(file, function(err) { - F (err); - T (fs.readFileSync(file, 'utf8') === 'hello world'); - done(); - }) - }) - }) - }) - - describe('+ createFileSync', function() { - describe('> when the file and directory does not exist', function() { - it('should create the file', function() { - var file = path.join(TEST_DIR, Math.random() + 'ts-ne', Math.random() + '.txt'); - F (fs.existsSync(file)); - fs.createFileSync(file); - T (fs.existsSync(file)); - }) - }) - - describe('> when the file does exist', function() { - it('should not modify the file', function() { - var file = path.join(TEST_DIR, Math.random() + 'ts-e', Math.random() + '.txt'); - fs.mkdirsSync(path.dirname(file)) - fs.writeFileSync(file, 'hello world'); - fs.createFileSync(file); - T (fs.readFileSync(file, 'utf8') === 'hello world'); - }) - }) - }) - -}) \ No newline at end of file diff --git a/test/node/node_modules/fs-extra/test/mkdir.test.js b/test/node/node_modules/fs-extra/test/mkdir.test.js deleted file mode 100644 index b6111a8a621..00000000000 --- a/test/node/node_modules/fs-extra/test/mkdir.test.js +++ /dev/null @@ -1,66 +0,0 @@ -var fs = require('../lib') - , path = require('path-extra') - , testutil = require('testutil'); - -var TEST_DIR = '' - -describe('fs-extra', function() { - beforeEach(function() { - TEST_DIR = testutil.createTestDir('fs-extra') - }) - - describe('+ mkdirs()', function() { - it('should make the directory', function(done) { - var dir = path.join(TEST_DIR, 'tmp-' + Date.now() + Math.random()); - - F (fs.existsSync(dir)); - - fs.mkdirs(dir, function(err) { - T (err === null); - T (fs.existsSync(dir)); - - done(); - }) - }) - - it('should make the entire directory path', function(done) { - var dir = path.join(path.tempdir(), 'tmp-' + Date.now() + Math.random()) - , newDir = path.join(TEST_DIR, 'dfdf', 'ffff', 'aaa'); - - F (fs.existsSync(dir)); - - fs.mkdirs(newDir, function(err) { - T (err === null); - T (fs.existsSync(newDir)); - - done(); - }); - }) - }) - - describe('+ mkdirsSync()', function() { - it('should make the directory', function(done) { - var dir = path.join(TEST_DIR, 'tmp-' + Date.now() + Math.random()); - - F (fs.existsSync(dir)); - fs.mkdirsSync(dir); - T (fs.existsSync(dir)); - - done(); - }) - - it('should make the entire directory path', function(done) { - var dir = path.join(TEST_DIR, 'tmp-' + Date.now() + Math.random()) - , newDir = path.join(dir, 'dfdf', 'ffff', 'aaa'); - - F (fs.existsSync(dir)); - fs.mkdirsSync(dir); - T (fs.existsSync(dir)); - - done(); - }) - }) - -}) - - diff --git a/test/node/node_modules/fs-extra/test/mocha.opts b/test/node/node_modules/fs-extra/test/mocha.opts deleted file mode 100644 index 764abfbc2dc..00000000000 --- a/test/node/node_modules/fs-extra/test/mocha.opts +++ /dev/null @@ -1,4 +0,0 @@ ---reporter spec ---ui bdd ---growl ---timeout 7000 \ No newline at end of file diff --git a/test/node/node_modules/fs-extra/test/output.test.js b/test/node/node_modules/fs-extra/test/output.test.js deleted file mode 100644 index e82f80eadc4..00000000000 --- a/test/node/node_modules/fs-extra/test/output.test.js +++ /dev/null @@ -1,62 +0,0 @@ -var testutil = require('testutil') - , fs = require('../') - , path = require('path') - -var TEST_DIR = ''; - -describe('fs-extra', function () { - beforeEach(function() { - TEST_DIR = testutil.createTestDir('fs-extra') - }) - - describe('+ outputFile', function() { - describe('> when the file and directory does not exist', function() { - it('should create the file', function(done) { - var file = path.join(TEST_DIR, Math.random() + 't-ne', Math.random() + '.txt'); - F (fs.existsSync(file)); - fs.outputFile(file, 'hi jp', function(err) { - F (err); - T (fs.existsSync(file)); - EQ (fs.readFileSync(file, 'utf8'), 'hi jp') - done(); - }) - }) - }) - - describe('> when the file does exist', function() { - it('should still modify the file', function(done) { - var file = path.join(TEST_DIR, Math.random() + 't-e', Math.random() + '.txt'); - fs.mkdirsSync(path.dirname(file)) - fs.writeFileSync(file, 'hello world'); - fs.outputFile(file, 'hello jp', function(err) { - if (err) return done(err) - EQ (fs.readFileSync(file, 'utf8'), 'hello jp') - done(); - }) - }) - }) - }) - - describe('+ outputFileSync', function() { - describe('> when the file and directory does not exist', function() { - it('should create the file', function() { - var file = path.join(TEST_DIR, Math.random() + 'ts-ne', Math.random() + '.txt'); - F (fs.existsSync(file)); - fs.outputFileSync(file, 'hello man'); - T (fs.existsSync(file)); - EQ (fs.readFileSync(file, 'utf8'), 'hello man') - }) - }) - - describe('> when the file does exist', function() { - it('should still modify the file', function() { - var file = path.join(TEST_DIR, Math.random() + 'ts-e', Math.random() + '.txt'); - fs.mkdirsSync(path.dirname(file)) - fs.writeFileSync(file, 'hello world'); - fs.outputFileSync(file, 'hello man'); - EQ (fs.readFileSync(file, 'utf8'), 'hello man') - }) - }) - }) - -}) \ No newline at end of file diff --git a/test/node/node_modules/fs-extra/test/read.test.js b/test/node/node_modules/fs-extra/test/read.test.js deleted file mode 100644 index da55ee23531..00000000000 --- a/test/node/node_modules/fs-extra/test/read.test.js +++ /dev/null @@ -1,68 +0,0 @@ -var fs = require('../lib') - , testutil = require('testutil') - , path = require('path'); - -var DIR = ''; - -describe('fs-extra', function() { - beforeEach(function() { - DIR = testutil.createTestDir('fs-extra') - }) - - afterEach(function(done) { - fs.remove(DIR, done); - }) - - describe('+ readJSON', function() { - it('should read a file and parse the json', function(done) { - var obj1 = { - firstName: 'JP', - lastName: 'Richardson' - }; - var file = path.join(DIR, 'file.json'); - - fs.writeFileSync(file, JSON.stringify(obj1)); - - fs.readJSON(file, function(err, obj2) { - F (err != null); - T (obj1.firstName === obj2.firstName); - T (obj1.lastName === obj2.lastName); - - done(); - }) - }) - - it('should error if it cant parse the json', function(done) { - var file = path.join(DIR, 'file2.json'); - fs.writeFileSync(file, '%asdfasdff444'); - fs.readJSON(file, function(err, obj) { - T (err != null); - F (obj); - done(); - }) - }) - }) - - /*(describe('+ readTextFile', function() { - it('should read the text file', function(done) { - var file = path.join(DIR, 'readtext.txt') - fs.writeFileSync(file, "hello") - fs.readTextFile(file, function(err, data) { - if (err) return done(err) - EQ (data, 'hello') - done() - }) - }) - }) - - describe('+ readTextFileSync', function() { - it('should read the text file', function() { - var file = path.join(DIR, 'readtext.txt') - fs.writeFileSync(file, "hello") - var data = fs.readTextFileSync(file) - EQ (data, 'hello') - }) - })*/ -}) - - diff --git a/test/node/node_modules/fs-extra/test/remove.test.js b/test/node/node_modules/fs-extra/test/remove.test.js deleted file mode 100644 index 981a0bb197a..00000000000 --- a/test/node/node_modules/fs-extra/test/remove.test.js +++ /dev/null @@ -1,127 +0,0 @@ -var crypto = require('crypto') - , fs = require('../lib') - , path = require('path') - , testutil = require('testutil') - , mkdir = require('mkdirp'); - -var DIR = ''; - - buildDir = function() { //shit function that should be deleted - var baseDir, buf, bytesWritten, ex, subDir; - buf = new Buffer(5); - bytesWritten = 0; - while (bytesWritten < buf.length) { - buf[bytesWritten] = Math.floor(Math.random() * 256); - bytesWritten += 1; - } - ex = Date.now(); - baseDir = path.join(DIR, "TEST_fs-extra_rmrf-" + ex); - fs.mkdirSync(baseDir); - fs.writeFileSync(path.join(baseDir, Math.random() + ''), buf); - fs.writeFileSync(path.join(baseDir, Math.random() + ''), buf); - subDir = path.join(DIR, Math.random() + ''); - fs.mkdirSync(subDir); - fs.writeFileSync(path.join(subDir, Math.random() + '')); - return baseDir; - }; - -describe('fs-extra', function() { - beforeEach(function() { - DIR = testutil.createTestDir('fs-extra'); - }) - - afterEach(function(done) { - if (fs.existsSync(DIR)) { - fs.remove(DIR, done); - } else { - done(); - } - }) - - describe('+ removeSync()', function() { - it('should delete directories and files synchronously', function() { - T (fs.existsSync(DIR)); - fs.removeSync(DIR); - F (fs.existsSync(DIR)); - }) - - it('should delete an empty directory synchronously', function() { - T (fs.existsSync(DIR)); - fs.removeSync(DIR); - F (fs.existsSync(DIR)); - }) - - it('should delete a file synchronously', function() { - var file = testutil.createFileWithData(path.join(DIR, 'file'), 4); - T (fs.existsSync(file)); - fs.removeSync(file); - }) - }) - - describe('+ remove()', function() { - it('should delete an empty directory', function(done) { - T (fs.existsSync(DIR)); - fs.remove(DIR, function(err) { - T (err === null); - F (fs.existsSync(DIR)); - done(); - }) - }) - - it('should delete a directory full of directories and files', function(done) { - var dir = buildDir(); - T(fs.existsSync(DIR)); - return fs.remove(DIR, function(err) { - T(err === null); - F(fs.existsSync(DIR)); - return done(); - }); - }); - it('should delete a file', function(done) { - var file = testutil.createFileWithData(path.join(DIR, 'file'), 4); - - T (fs.existsSync(file)); - fs.remove(file, function(err) { - T (err === null); - F (fs.existsSync(file)); - done(); - }); - }) - - it('should delete without a callback', function(done) { - var file = testutil.createFileWithData(path.join(DIR, 'file'), 4); - T (fs.existsSync(file)); - var existsChecker = setInterval(function() { - fs.exists(file, function(itDoes) { - if (!itDoes) { - clearInterval(existsChecker); - done(); - } - }); - }, 25); - fs.remove(file); - }) - }) - - describe('+ delete()', function() { - it('should delete an empty directory', function(done) { - T (fs.existsSync(DIR)); - fs["delete"](DIR, function(err) { - T (err === null); - F (fs.existsSync(DIR)); - done(); - }) - }) - }) - - describe('+ deleteSync()', function() { - it('should delete directories and files synchronously', function() { - T (fs.existsSync(DIR)); - fs.deleteSync(DIR); - F (fs.existsSync(DIR)); - }) - }) - -}) - - diff --git a/test/node/package.json b/test/node/package.json deleted file mode 100644 index ebee2ac0af6..00000000000 --- a/test/node/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "brackets-testing", - "version": "0.22.0", - "dependencies": { - "fs-extra": "0.5.x" - } -} \ No newline at end of file From d447a65d2286eb61d4769abc76604ac29b5414d9 Mon Sep 17 00:00:00 2001 From: Martin Zagora Date: Thu, 23 Feb 2017 17:27:53 +1100 Subject: [PATCH 011/121] update cm to 5.24.2 --- src/npm-shrinkwrap.json | 6 +++--- src/package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/npm-shrinkwrap.json b/src/npm-shrinkwrap.json index 74d6a49bfbb..649c2bfbcef 100644 --- a/src/npm-shrinkwrap.json +++ b/src/npm-shrinkwrap.json @@ -72,9 +72,9 @@ "optional": true }, "codemirror": { - "version": "5.24.0", - "from": "codemirror@5.24.0", - "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-5.24.0.tgz" + "version": "5.24.2", + "from": "codemirror@5.24.2", + "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-5.24.2.tgz" }, "combined-stream": { "version": "1.0.5", diff --git a/src/package.json b/src/package.json index 66b6c119997..e6f0e135539 100644 --- a/src/package.json +++ b/src/package.json @@ -1,7 +1,7 @@ { "name": "brackets-src", "dependencies": { - "codemirror": "5.24.0", + "codemirror": "5.24.2", "less": "2.7.2" } } From e42dcdda2f6ac27efbbce238493213d354db207d Mon Sep 17 00:00:00 2001 From: Martin Zagora Date: Fri, 24 Feb 2017 09:42:34 +1100 Subject: [PATCH 012/121] fix css code hints tests --- src/extensions/default/CSSCodeHints/unittests.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/extensions/default/CSSCodeHints/unittests.js b/src/extensions/default/CSSCodeHints/unittests.js index e3d5febfeb9..24dc3a945e4 100644 --- a/src/extensions/default/CSSCodeHints/unittests.js +++ b/src/extensions/default/CSSCodeHints/unittests.js @@ -114,10 +114,16 @@ define(function (require, exports, module) { } // Helper function for testing cursor position + function fixPos(pos) { + if (!("sticky" in pos)) { + pos.sticky = null; + } + return pos; + } function expectCursorAt(pos) { var selection = testEditor.getSelection(); - expect(selection.start).toEqual(selection.end); - expect(selection.start).toEqual(pos); + expect(fixPos(selection.start)).toEqual(fixPos(selection.end)); + expect(fixPos(selection.start)).toEqual(fixPos(pos)); } // Helper function to From 42e535f42fb9350113a18fa28d2afed6b9cedecb Mon Sep 17 00:00:00 2001 From: Martin Zagora Date: Fri, 24 Feb 2017 09:44:00 +1100 Subject: [PATCH 013/121] fix html code hints tests --- src/extensions/default/HTMLCodeHints/unittests.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/extensions/default/HTMLCodeHints/unittests.js b/src/extensions/default/HTMLCodeHints/unittests.js index 48a0cf66af3..44bc69ce157 100644 --- a/src/extensions/default/HTMLCodeHints/unittests.js +++ b/src/extensions/default/HTMLCodeHints/unittests.js @@ -494,10 +494,16 @@ define(function (require, exports, module) { } // Helper function for testing cursor position + function fixPos(pos) { + if (!("sticky" in pos)) { + pos.sticky = null; + } + return pos; + } function expectCursorAt(pos) { var selection = testEditor.getSelection(); - expect(selection.start).toEqual(selection.end); - expect(selection.start).toEqual(pos); + expect(fixPos(selection.start)).toEqual(fixPos(selection.end)); + expect(fixPos(selection.start)).toEqual(fixPos(pos)); } it("should insert =\"\" after attribute", function () { From fdc7e17d6eb579a039c6e04b96f1dee772437578 Mon Sep 17 00:00:00 2001 From: Martin Zagora Date: Fri, 24 Feb 2017 09:45:23 +1100 Subject: [PATCH 014/121] fix html entity hinting tests --- .../default/HtmlEntityCodeHints/unittests.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/extensions/default/HtmlEntityCodeHints/unittests.js b/src/extensions/default/HtmlEntityCodeHints/unittests.js index 42d45a061e1..5193f36c11c 100644 --- a/src/extensions/default/HtmlEntityCodeHints/unittests.js +++ b/src/extensions/default/HtmlEntityCodeHints/unittests.js @@ -31,6 +31,14 @@ define(function (require, exports, module) { HTMLEntityHints = require("main").SpecialCharHints, defaultContent = require("text!unittest-files/default.html"); + // Helper function for testing cursor position + function fixPos(pos) { + if (!("sticky" in pos)) { + pos.sticky = null; + } + return pos; + } + describe("HTML Entity Hinting", function () { var testEditorAndDoc, @@ -150,7 +158,7 @@ define(function (require, exports, module) { var hints = expectHints(hintProvider); hintProvider.insertHint(hints[0]); - expect(testEditorAndDoc.editor.getCursorPos()).toEqual({line: 17, ch: 23}); + expect(fixPos(testEditorAndDoc.editor.getCursorPos())).toEqual(fixPos({line: 17, ch: 23})); }); }); }); From df77e15708a213a89348ce627a2a90c5422172e3 Mon Sep 17 00:00:00 2001 From: nyteksf Date: Fri, 24 Feb 2017 13:35:15 -0800 Subject: [PATCH 015/121] Restricted font size input to valid entries. --- src/config.json | 2 +- src/htmlContent/themes-settings.bak.html | 49 +++++++ src/htmlContent/themes-settings.html | 6 +- src/view/ThemeSettings.bak.js | 167 +++++++++++++++++++++++ src/view/ThemeSettings.js | 21 ++- 5 files changed, 239 insertions(+), 6 deletions(-) create mode 100644 src/htmlContent/themes-settings.bak.html create mode 100644 src/view/ThemeSettings.bak.js diff --git a/src/config.json b/src/config.json index 0ee111b5b63..431267c449e 100644 --- a/src/config.json +++ b/src/config.json @@ -20,7 +20,7 @@ "extension_url": "https://s3.amazonaws.com/extend.brackets/{0}/{0}-{1}.zip", "linting.enabled_by_default": true, "build_timestamp": "", - "healthDataServerURL": "https://healthdev.brackets.io/healthDataLog" + "healthDataServerURL": "https://health.brackets.io/healthDataLog" }, "name": "Brackets", "version": "1.9.0-0", diff --git a/src/htmlContent/themes-settings.bak.html b/src/htmlContent/themes-settings.bak.html new file mode 100644 index 00000000000..299763fff98 --- /dev/null +++ b/src/htmlContent/themes-settings.bak.html @@ -0,0 +1,49 @@ + diff --git a/src/htmlContent/themes-settings.html b/src/htmlContent/themes-settings.html index 299763fff98..426e234dd88 100644 --- a/src/htmlContent/themes-settings.html +++ b/src/htmlContent/themes-settings.html @@ -30,20 +30,20 @@

    {{Strings.THEMES_SETTINGS}}

    - +
    - +
    diff --git a/src/view/ThemeSettings.bak.js b/src/view/ThemeSettings.bak.js new file mode 100644 index 00000000000..a946eb6513b --- /dev/null +++ b/src/view/ThemeSettings.bak.js @@ -0,0 +1,167 @@ +/** + * Brackets Themes Copyright (c) 2014 Miguel Castillo. + * + * 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. + * + */ + +define(function (require, exports, module) { + "use strict"; + + var _ = require("thirdparty/lodash"), + Mustache = require("thirdparty/mustache/mustache"), + Dialogs = require("widgets/Dialogs"), + Strings = require("strings"), + ViewCommandHandlers = require("view/ViewCommandHandlers"), + settingsTemplate = require("text!htmlContent/themes-settings.html"), + PreferencesManager = require("preferences/PreferencesManager"), + prefs = PreferencesManager.getExtensionPrefs("themes"); + + /** + * @type {Object} + * Currently loaded themes that are available to choose from. + */ + var loadedThemes = {}; + + /** + * Object with all default values that can be configure via the settings UI + */ + var defaults = { + "themeScrollbars": true, + "theme": "light-theme" + }; + + + /** + * Cached html settings jQuery object for easier processing when opening the settings dialog + */ + var $settings = $(settingsTemplate).addClass("themeSettings"); + + /** + * @private + * Gets all the configurable settings that need to be loaded in the settings dialog + * + * @return {Object} a collection with all the settings + */ + function getValues() { + var result = {}; + + Object.keys(defaults).forEach(function (key) { + result[key] = prefs.get(key); + }); + + result.fontFamily = ViewCommandHandlers.getFontFamily(); + result.fontSize = ViewCommandHandlers.getFontSize(); + return result; + } + + /** + * Opens the settings dialog + */ + function showDialog() { + var currentSettings = getValues(); + var newSettings = {}; + var themes = _.map(loadedThemes, function (theme) { return theme; }); + var template = $("
    ").append($settings).html(); + var $template = $(Mustache.render(template, {"settings": currentSettings, "themes": themes, "Strings": Strings})); + + // Select the correct theme. + var $currentThemeOption = $template + .find("[value='" + currentSettings.theme + "']"); + + if ($currentThemeOption.length === 0) { + $currentThemeOption = $template.find("[value='" + defaults.theme + "']"); + } + $currentThemeOption.attr("selected", "selected"); + + $template + .find("[data-toggle=tab].default") + .tab("show"); + + $template + .on("change", "[data-target]:checkbox", function () { + var $target = $(this); + var attr = $target.attr("data-target"); + newSettings[attr] = $target.is(":checked"); + }) + .on("input", "[data-target]:text", function () { + var $target = $(this); + var attr = $target.attr("data-target"); + newSettings[attr] = $target.val(); + }) + .on("change", "select", function () { + var $target = $(":selected", this); + var attr = $target.attr("data-target"); + + if (attr) { + prefs.set(attr, $target.val()); + } + }); + + Dialogs.showModalDialogUsingTemplate($template).done(function (id) { + var setterFn; + + if (id === "save") { + // Go through each new setting and apply it + Object.keys(newSettings).forEach(function (setting) { + if (defaults.hasOwnProperty(setting)) { + prefs.set(setting, newSettings[setting]); + } else { + // Figure out if the setting is in the ViewCommandHandlers, which means it is + // a font setting + setterFn = "set" + setting[0].toLocaleUpperCase() + setting.substr(1); + if (typeof ViewCommandHandlers[setterFn] === 'function') { + ViewCommandHandlers[setterFn](newSettings[setting]); + } + } + }); + } else if (id === "cancel") { + // Make sure we revert any changes to theme selection + prefs.set("theme", currentSettings.theme); + } + }); + } + + /** + * Interface to set the themes that are available to chose from in the setting dialog + * @param {ThemeManager.Theme} themes is a collection of themes created by the ThemeManager + */ + function setThemes(themes) { + loadedThemes = themes; + } + + /** + * Restores themes to factory settings. + */ + function restore() { + prefs.set("theme", defaults.theme); + prefs.set("themeScrollbars", defaults.themeScrollbars); + } + + prefs.definePreference("theme", "string", defaults.theme, { + description: Strings.DESCRIPTION_THEME + }); + prefs.definePreference("themeScrollbars", "boolean", defaults.themeScrollbars, { + description: Strings.DESCRIPTION_USE_THEME_SCROLLBARS + }); + + exports._setThemes = setThemes; + exports.restore = restore; + exports.showDialog = showDialog; +}); diff --git a/src/view/ThemeSettings.js b/src/view/ThemeSettings.js index a946eb6513b..e6af037552f 100644 --- a/src/view/ThemeSettings.js +++ b/src/view/ThemeSettings.js @@ -100,7 +100,24 @@ define(function (require, exports, module) { var attr = $target.attr("data-target"); newSettings[attr] = $target.is(":checked"); }) - .on("input", "[data-target]:text", function () { + .on("input", "#font-size-input", function () { + var $target = $(this); + var $input = $target.val(); + var validInput = /^[\d\.]+(p|px|e|em){0,1}$/g; + var btn = document.getElementById("done"); + + // Make sure that the font size is expressed in terms we can handle (px or em). If not, 'done' button disabled until input corrected. + + if ($input.search(validInput) === -1) { + ($input.length === 0) ? btn.disabled=false : btn.disabled=true; + return false; + }else{ + if(btn.disabled) btn.disabled = false; + var attr = $target.attr("data-target"); + newSettings[attr] = $input; + } + }) + .on("input", "#font-family-input", function () { var $target = $(this); var attr = $target.attr("data-target"); newSettings[attr] = $target.val(); @@ -126,7 +143,7 @@ define(function (require, exports, module) { // Figure out if the setting is in the ViewCommandHandlers, which means it is // a font setting setterFn = "set" + setting[0].toLocaleUpperCase() + setting.substr(1); - if (typeof ViewCommandHandlers[setterFn] === 'function') { + if (typeof ViewCommandHandlers[setterFn] === "function") { ViewCommandHandlers[setterFn](newSettings[setting]); } } From 76890171ae039e2a1120e07fd84c6ed8d598a007 Mon Sep 17 00:00:00 2001 From: nyteksf Date: Fri, 24 Feb 2017 14:08:59 -0800 Subject: [PATCH 016/121] #11801 - Restricted font size input to valid entries. --- src/htmlContent/themes-settings.bak.html | 49 ------- src/view/ThemeSettings.bak.js | 167 ----------------------- 2 files changed, 216 deletions(-) delete mode 100644 src/htmlContent/themes-settings.bak.html delete mode 100644 src/view/ThemeSettings.bak.js diff --git a/src/htmlContent/themes-settings.bak.html b/src/htmlContent/themes-settings.bak.html deleted file mode 100644 index 299763fff98..00000000000 --- a/src/htmlContent/themes-settings.bak.html +++ /dev/null @@ -1,49 +0,0 @@ - diff --git a/src/view/ThemeSettings.bak.js b/src/view/ThemeSettings.bak.js deleted file mode 100644 index a946eb6513b..00000000000 --- a/src/view/ThemeSettings.bak.js +++ /dev/null @@ -1,167 +0,0 @@ -/** - * Brackets Themes Copyright (c) 2014 Miguel Castillo. - * - * 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. - * - */ - -define(function (require, exports, module) { - "use strict"; - - var _ = require("thirdparty/lodash"), - Mustache = require("thirdparty/mustache/mustache"), - Dialogs = require("widgets/Dialogs"), - Strings = require("strings"), - ViewCommandHandlers = require("view/ViewCommandHandlers"), - settingsTemplate = require("text!htmlContent/themes-settings.html"), - PreferencesManager = require("preferences/PreferencesManager"), - prefs = PreferencesManager.getExtensionPrefs("themes"); - - /** - * @type {Object} - * Currently loaded themes that are available to choose from. - */ - var loadedThemes = {}; - - /** - * Object with all default values that can be configure via the settings UI - */ - var defaults = { - "themeScrollbars": true, - "theme": "light-theme" - }; - - - /** - * Cached html settings jQuery object for easier processing when opening the settings dialog - */ - var $settings = $(settingsTemplate).addClass("themeSettings"); - - /** - * @private - * Gets all the configurable settings that need to be loaded in the settings dialog - * - * @return {Object} a collection with all the settings - */ - function getValues() { - var result = {}; - - Object.keys(defaults).forEach(function (key) { - result[key] = prefs.get(key); - }); - - result.fontFamily = ViewCommandHandlers.getFontFamily(); - result.fontSize = ViewCommandHandlers.getFontSize(); - return result; - } - - /** - * Opens the settings dialog - */ - function showDialog() { - var currentSettings = getValues(); - var newSettings = {}; - var themes = _.map(loadedThemes, function (theme) { return theme; }); - var template = $("
    ").append($settings).html(); - var $template = $(Mustache.render(template, {"settings": currentSettings, "themes": themes, "Strings": Strings})); - - // Select the correct theme. - var $currentThemeOption = $template - .find("[value='" + currentSettings.theme + "']"); - - if ($currentThemeOption.length === 0) { - $currentThemeOption = $template.find("[value='" + defaults.theme + "']"); - } - $currentThemeOption.attr("selected", "selected"); - - $template - .find("[data-toggle=tab].default") - .tab("show"); - - $template - .on("change", "[data-target]:checkbox", function () { - var $target = $(this); - var attr = $target.attr("data-target"); - newSettings[attr] = $target.is(":checked"); - }) - .on("input", "[data-target]:text", function () { - var $target = $(this); - var attr = $target.attr("data-target"); - newSettings[attr] = $target.val(); - }) - .on("change", "select", function () { - var $target = $(":selected", this); - var attr = $target.attr("data-target"); - - if (attr) { - prefs.set(attr, $target.val()); - } - }); - - Dialogs.showModalDialogUsingTemplate($template).done(function (id) { - var setterFn; - - if (id === "save") { - // Go through each new setting and apply it - Object.keys(newSettings).forEach(function (setting) { - if (defaults.hasOwnProperty(setting)) { - prefs.set(setting, newSettings[setting]); - } else { - // Figure out if the setting is in the ViewCommandHandlers, which means it is - // a font setting - setterFn = "set" + setting[0].toLocaleUpperCase() + setting.substr(1); - if (typeof ViewCommandHandlers[setterFn] === 'function') { - ViewCommandHandlers[setterFn](newSettings[setting]); - } - } - }); - } else if (id === "cancel") { - // Make sure we revert any changes to theme selection - prefs.set("theme", currentSettings.theme); - } - }); - } - - /** - * Interface to set the themes that are available to chose from in the setting dialog - * @param {ThemeManager.Theme} themes is a collection of themes created by the ThemeManager - */ - function setThemes(themes) { - loadedThemes = themes; - } - - /** - * Restores themes to factory settings. - */ - function restore() { - prefs.set("theme", defaults.theme); - prefs.set("themeScrollbars", defaults.themeScrollbars); - } - - prefs.definePreference("theme", "string", defaults.theme, { - description: Strings.DESCRIPTION_THEME - }); - prefs.definePreference("themeScrollbars", "boolean", defaults.themeScrollbars, { - description: Strings.DESCRIPTION_USE_THEME_SCROLLBARS - }); - - exports._setThemes = setThemes; - exports.restore = restore; - exports.showDialog = showDialog; -}); From 15b635b07257172a12f6c41bb28863292a1e91a2 Mon Sep 17 00:00:00 2001 From: Martin Zagora Date: Sat, 25 Feb 2017 11:03:13 +1100 Subject: [PATCH 017/121] fix inline color editor tests --- .../default/InlineColorEditor/unittests.js | 32 ++++++++++++++++--- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/src/extensions/default/InlineColorEditor/unittests.js b/src/extensions/default/InlineColorEditor/unittests.js index 1257c07c052..fc27573851b 100644 --- a/src/extensions/default/InlineColorEditor/unittests.js +++ b/src/extensions/default/InlineColorEditor/unittests.js @@ -37,6 +37,28 @@ define(function (require, exports, module) { ColorEditor = require("ColorEditor").ColorEditor, tinycolor = require("thirdparty/tinycolor-min"); + // Helper functions for testing cursor position / selection range + function fixPos(pos) { + if (!("sticky" in pos)) { + pos.sticky = null; + } + return pos; + } + function fixSel(sel) { + fixPos(sel.start); + fixPos(sel.end); + if (!("reversed" in sel)) { + sel.reversed = false; + } + return sel; + } + function fixSels(sels) { + sels.forEach(function (sel) { + fixSel(sel); + }); + return sels; + } + describe("Inline Color Editor - unit", function () { var testDocument, testEditor, inline; @@ -217,7 +239,7 @@ define(function (require, exports, module) { runs(function () { testDocument.replaceRange("", {line: 1, ch: 22}, {line: 1, ch: 24}); inline.colorEditor.setColorFromString("#c0c0c0"); - expect(inline.getCurrentRange()).toEqual({start: {line: 1, ch: 16}, end: {line: 1, ch: 23}}); + expect(fixSel(inline.getCurrentRange())).toEqual(fixSel({start: {line: 1, ch: 16}, end: {line: 1, ch: 23}})); expect(testDocument.getRange({line: 1, ch: 16}, {line: 1, ch: 23})).toBe("#c0c0c0"); }); }); @@ -236,7 +258,7 @@ define(function (require, exports, module) { // TODO (#2201): this assumes getColor() is a tinycolor, but sometimes it's a string expect(inline.colorEditor.getColor().toHexString().toLowerCase()).toBe("#a0cdef"); expect(inline.close).not.toHaveBeenCalled(); - expect(inline.getCurrentRange()).toEqual({start: {line: 1, ch: 16}, end: {line: 1, ch: 23}}); + expect(fixSel(inline.getCurrentRange())).toEqual(fixSel({start: {line: 1, ch: 16}, end: {line: 1, ch: 23}})); }); }); @@ -260,7 +282,7 @@ define(function (require, exports, module) { testDocument.replaceRange("0", {line: 1, ch: 22}, {line: 1, ch: 22}); expect(inline._color).toBe("#abcde0"); expect(inline.close).not.toHaveBeenCalled(); - expect(inline.getCurrentRange()).toEqual({start: {line: 1, ch: 16}, end: {line: 1, ch: 23}}); + expect(fixSel(inline.getCurrentRange())).toEqual(fixSel({start: {line: 1, ch: 16}, end: {line: 1, ch: 23}})); }); }); @@ -269,7 +291,7 @@ define(function (require, exports, module) { runs(function () { testDocument.replaceRange("", {line: 1, ch: 22}, {line: 1, ch: 23}); expect(inline._color).toBe("#abcdef"); - expect(inline.getCurrentRange()).toEqual({start: {line: 1, ch: 16}, end: {line: 1, ch: 22}}); + expect(fixSel(inline.getCurrentRange())).toEqual(fixSel({start: {line: 1, ch: 16}, end: {line: 1, ch: 22}})); }); }); @@ -278,7 +300,7 @@ define(function (require, exports, module) { runs(function () { testDocument.replaceRange("", {line: 1, ch: 22}, {line: 1, ch: 24}); expect(inline._color).toBe("#abcdef"); - expect(inline.getCurrentRange()).toEqual({start: {line: 1, ch: 16}, end: {line: 1, ch: 22}}); + expect(fixSel(inline.getCurrentRange())).toEqual(fixSel({start: {line: 1, ch: 16}, end: {line: 1, ch: 22}})); }); }); From 447bc5c70f9eabdfec0a38907ae077a46343d632 Mon Sep 17 00:00:00 2001 From: Martin Zagora Date: Sat, 25 Feb 2017 11:06:41 +1100 Subject: [PATCH 018/121] fix preferences code hints tests --- .../default/PrefsCodeHints/unittests.js | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/src/extensions/default/PrefsCodeHints/unittests.js b/src/extensions/default/PrefsCodeHints/unittests.js index 80e72729613..cc0ad74f396 100644 --- a/src/extensions/default/PrefsCodeHints/unittests.js +++ b/src/extensions/default/PrefsCodeHints/unittests.js @@ -138,11 +138,33 @@ define(function (require, exports, module) { expect(token.type).toBe(type); } + // Helper functions for testing cursor position / selection range + function fixPos(pos) { + if (!("sticky" in pos)) { + pos.sticky = null; + } + return pos; + } + function fixSel(sel) { + fixPos(sel.start); + fixPos(sel.end); + if (!("reversed" in sel)) { + sel.reversed = false; + } + return sel; + } + function fixSels(sels) { + sels.forEach(function (sel) { + fixSel(sel); + }); + return sels; + } + // Determines the position of the cursor. function expectCursorAt(pos) { var selection = testEditor.getSelection(); - expect(selection.start).toEqual(selection.end); - expect(selection.start).toEqual(pos); + expect(fixPos(selection.start)).toEqual(fixPos(selection.end)); + expect(fixPos(selection.start)).toEqual(fixPos(pos)); } describe("File name based hinting", function () { From bd4b03374bffc0ef23a1bbd7fb2f3de246f3e739 Mon Sep 17 00:00:00 2001 From: Martin Zagora Date: Sat, 25 Feb 2017 11:08:27 +1100 Subject: [PATCH 019/121] fix svg code hints tests --- src/extensions/default/PrefsCodeHints/unittests.js | 14 -------------- src/extensions/default/SVGCodeHints/unittests.js | 12 ++++++++++-- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/src/extensions/default/PrefsCodeHints/unittests.js b/src/extensions/default/PrefsCodeHints/unittests.js index cc0ad74f396..24e7c6b7c0f 100644 --- a/src/extensions/default/PrefsCodeHints/unittests.js +++ b/src/extensions/default/PrefsCodeHints/unittests.js @@ -145,20 +145,6 @@ define(function (require, exports, module) { } return pos; } - function fixSel(sel) { - fixPos(sel.start); - fixPos(sel.end); - if (!("reversed" in sel)) { - sel.reversed = false; - } - return sel; - } - function fixSels(sels) { - sels.forEach(function (sel) { - fixSel(sel); - }); - return sels; - } // Determines the position of the cursor. function expectCursorAt(pos) { diff --git a/src/extensions/default/SVGCodeHints/unittests.js b/src/extensions/default/SVGCodeHints/unittests.js index d95e21faca9..beab0ad536c 100644 --- a/src/extensions/default/SVGCodeHints/unittests.js +++ b/src/extensions/default/SVGCodeHints/unittests.js @@ -107,11 +107,19 @@ define(function (require, exports, module) { expect(token.type).toBe(type); } + // Helper functions for testing cursor position / selection range + function fixPos(pos) { + if (!("sticky" in pos)) { + pos.sticky = null; + } + return pos; + } + // Used to test cursor position. function expectCursorAt(pos) { var selection = testEditor.getSelection(); - expect(selection.start).toEqual(selection.end); - expect(selection.start).toEqual(pos); + expect(fixPos(selection.start)).toEqual(fixPos(selection.end)); + expect(fixPos(selection.start)).toEqual(fixPos(pos)); } describe("Tag Hinting", function () { From e212ea4d5a25695da11d3cb4c6e5672a36306413 Mon Sep 17 00:00:00 2001 From: Martin Zagora Date: Sat, 25 Feb 2017 11:12:20 +1100 Subject: [PATCH 020/121] fix url code hinting tests --- .../default/UrlCodeHints/unittests.js | 26 ++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/src/extensions/default/UrlCodeHints/unittests.js b/src/extensions/default/UrlCodeHints/unittests.js index f7569657e54..9471c005635 100644 --- a/src/extensions/default/UrlCodeHints/unittests.js +++ b/src/extensions/default/UrlCodeHints/unittests.js @@ -129,6 +129,14 @@ define(function (require, exports, module) { expect(hintList).toEqual(expectedHints); } + // Helper functions for testing cursor position / selection range + function fixPos(pos) { + if (!("sticky" in pos)) { + pos.sticky = null; + } + return pos; + } + describe("HTML Url Code Hints", function () { beforeFirst(function () { @@ -428,7 +436,7 @@ define(function (require, exports, module) { expect(testDocument.getRange(pos1, pos3)).toEqual("url(test.html)"); // Cursor was moved past closing paren - expect(testEditor.getCursorPos()).toEqual(pos3); + expect(fixPos(testEditor.getCursorPos())).toEqual(fixPos(pos3)); }); }); @@ -458,7 +466,7 @@ define(function (require, exports, module) { expect(testDocument.getRange(pos1, pos3)).toEqual("url('test.html')"); // Cursor was moved past closing single-quote and closing paren - expect(testEditor.getCursorPos()).toEqual(pos3); + expect(fixPos(testEditor.getCursorPos())).toEqual(fixPos(pos3)); }); }); @@ -488,7 +496,7 @@ define(function (require, exports, module) { expect(testDocument.getRange(pos1, pos2)).toEqual("subfolder/"); // Cursor remains inside quote - expect(testEditor.getCursorPos()).toEqual(pos2); + expect(fixPos(testEditor.getCursorPos())).toEqual(fixPos(pos2)); // Get hints of inserted folder hintsObj = null; @@ -510,7 +518,7 @@ define(function (require, exports, module) { expect(testDocument.getRange(pos1, pos3)).toEqual("subfolder/chevron.png"); // Cursor was moved past closing double-quote and closing paren - expect(testEditor.getCursorPos()).toEqual(pos4); + expect(fixPos(testEditor.getCursorPos())).toEqual(fixPos(pos4)); }); }); @@ -543,7 +551,7 @@ define(function (require, exports, module) { expect(testDocument.getRange(pos1, pos4)).toEqual('url("subfolder/")'); // Cursor remains inside double-quote and closing paren - expect(testEditor.getCursorPos()).toEqual(pos3); + expect(fixPos(testEditor.getCursorPos())).toEqual(fixPos(pos3)); // Get hints of inserted folder hintsObj = null; @@ -565,7 +573,7 @@ define(function (require, exports, module) { expect(testDocument.getRange(pos1, pos5)).toEqual('url("subfolder/chevron.png")'); // Cursor was moved past closing double-quote and closing paren - expect(testEditor.getCursorPos()).toEqual(pos5); + expect(fixPos(testEditor.getCursorPos())).toEqual(fixPos(pos5)); }); }); @@ -595,7 +603,7 @@ define(function (require, exports, module) { expect(testDocument.getRange(pos1, pos3)).toEqual("subfolder/test2.html"); // Cursor is at end of inserted folder - expect(testEditor.getCursorPos()).toEqual(pos2); + expect(fixPos(testEditor.getCursorPos())).toEqual(fixPos(pos2)); // Get hints of inserted folder hintsObj = null; @@ -642,7 +650,7 @@ define(function (require, exports, module) { expect(testDocument.getRange(pos1, pos3)).toEqual("'subfolder/chevron.png'"); // Cursor was moved past closing single-quote - expect(testEditor.getCursorPos()).toEqual(pos3); + expect(fixPos(testEditor.getCursorPos())).toEqual(fixPos(pos3)); }); }); @@ -720,7 +728,7 @@ define(function (require, exports, module) { expect(testDocument.getRange(pos1, pos3)).toEqual("subfolder/dummy.jpg"); // Cursor is at end of inserted folder - expect(testEditor.getCursorPos()).toEqual(pos2); + expect(fixPos(testEditor.getCursorPos())).toEqual(fixPos(pos2)); // Get hints of inserted folder hintsObj = null; From 2143187dc01d114c44fd86182d96383e54521557 Mon Sep 17 00:00:00 2001 From: nyteksf Date: Fri, 24 Feb 2017 17:33:17 -0800 Subject: [PATCH 021/121] #11801 - Added @zaggino's prescribed changes --- .eslintrc.json | 3 ++- src/config.json | 2 +- src/htmlContent/themes-settings.html | 6 +++--- src/view/ThemeSettings.js | 24 +++++++++++++++--------- 4 files changed, 21 insertions(+), 14 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 16b5f74189a..b7f1a39fa4b 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -55,8 +55,9 @@ "require": false, "define": false, "$": false, - + "window": false, + "document": false, "console": false, "setTimeout": false, "clearTimeout": false, diff --git a/src/config.json b/src/config.json index 431267c449e..0ee111b5b63 100644 --- a/src/config.json +++ b/src/config.json @@ -20,7 +20,7 @@ "extension_url": "https://s3.amazonaws.com/extend.brackets/{0}/{0}-{1}.zip", "linting.enabled_by_default": true, "build_timestamp": "", - "healthDataServerURL": "https://health.brackets.io/healthDataLog" + "healthDataServerURL": "https://healthdev.brackets.io/healthDataLog" }, "name": "Brackets", "version": "1.9.0-0", diff --git a/src/htmlContent/themes-settings.html b/src/htmlContent/themes-settings.html index 426e234dd88..49cdb46d7d8 100644 --- a/src/htmlContent/themes-settings.html +++ b/src/htmlContent/themes-settings.html @@ -30,20 +30,20 @@

    {{Strings.THEMES_SETTINGS}}

    - +
    - +
    diff --git a/src/view/ThemeSettings.js b/src/view/ThemeSettings.js index e6af037552f..5fdd23055d8 100644 --- a/src/view/ThemeSettings.js +++ b/src/view/ThemeSettings.js @@ -90,6 +90,11 @@ define(function (require, exports, module) { } $currentThemeOption.attr("selected", "selected"); + + + + + $template .find("[data-toggle=tab].default") .tab("show"); @@ -100,24 +105,25 @@ define(function (require, exports, module) { var attr = $target.attr("data-target"); newSettings[attr] = $target.is(":checked"); }) - .on("input", "#font-size-input", function () { + .on("input", "[data-target=fontSize]", function () { var $target = $(this); - var $input = $target.val(); + var targetValue = $target.val(); var validInput = /^[\d\.]+(p|px|e|em){0,1}$/g; - var btn = document.getElementById("done"); + var btn = document.getElementById("theme-settings-done-btn"); // Make sure that the font size is expressed in terms we can handle (px or em). If not, 'done' button disabled until input corrected. - if ($input.search(validInput) === -1) { - ($input.length === 0) ? btn.disabled=false : btn.disabled=true; - return false; + if (targetValue.search(validInput) === -1) { + btn.disabled = targetValue.length !== 0; }else{ - if(btn.disabled) btn.disabled = false; + if(btn.disabled) { + btn.disabled = false; + } var attr = $target.attr("data-target"); - newSettings[attr] = $input; + newSettings[attr] = targetValue; } }) - .on("input", "#font-family-input", function () { + .on("input", "[data-target=fontFamily]", function () { var $target = $(this); var attr = $target.attr("data-target"); newSettings[attr] = $target.val(); From f7a0cab5608d48d624dd694d7c8e6a021167cea4 Mon Sep 17 00:00:00 2001 From: nyteksf Date: Fri, 24 Feb 2017 18:02:53 -0800 Subject: [PATCH 022/121] Deleted trailing spaces, and added missed change --- .eslintrc.json | 2 +- src/htmlContent/themes-settings.html | 2 +- src/view/ThemeSettings.js | 5 ----- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index b7f1a39fa4b..920f47f75a0 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -55,7 +55,7 @@ "require": false, "define": false, "$": false, - + "window": false, "document": false, "console": false, diff --git a/src/htmlContent/themes-settings.html b/src/htmlContent/themes-settings.html index 49cdb46d7d8..8ea9627ea99 100644 --- a/src/htmlContent/themes-settings.html +++ b/src/htmlContent/themes-settings.html @@ -30,7 +30,7 @@

    {{Strings.THEMES_SETTINGS}}

    - +
    diff --git a/src/view/ThemeSettings.js b/src/view/ThemeSettings.js index 5fdd23055d8..e6b69534815 100644 --- a/src/view/ThemeSettings.js +++ b/src/view/ThemeSettings.js @@ -89,11 +89,6 @@ define(function (require, exports, module) { $currentThemeOption = $template.find("[value='" + defaults.theme + "']"); } $currentThemeOption.attr("selected", "selected"); - - - - - $template .find("[data-toggle=tab].default") From 01ae3a8464777c6c7a49f3471dd5d294e59dee3c Mon Sep 17 00:00:00 2001 From: nyteksf Date: Fri, 24 Feb 2017 21:07:18 -0800 Subject: [PATCH 023/121] #11801 - Removed line of whitespace --- src/view/ThemeSettings.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/view/ThemeSettings.js b/src/view/ThemeSettings.js index e6b69534815..d57b5a53a22 100644 --- a/src/view/ThemeSettings.js +++ b/src/view/ThemeSettings.js @@ -89,7 +89,7 @@ define(function (require, exports, module) { $currentThemeOption = $template.find("[value='" + defaults.theme + "']"); } $currentThemeOption.attr("selected", "selected"); - + $template .find("[data-toggle=tab].default") .tab("show"); From 8131ef4850f4bb17d196895a86ad335af0b06151 Mon Sep 17 00:00:00 2001 From: nyteksf Date: Fri, 24 Feb 2017 21:30:01 -0800 Subject: [PATCH 024/121] #11801 - Added inner quotes --- src/view/ThemeSettings.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/view/ThemeSettings.js b/src/view/ThemeSettings.js index d57b5a53a22..fd31b10a569 100644 --- a/src/view/ThemeSettings.js +++ b/src/view/ThemeSettings.js @@ -100,7 +100,7 @@ define(function (require, exports, module) { var attr = $target.attr("data-target"); newSettings[attr] = $target.is(":checked"); }) - .on("input", "[data-target=fontSize]", function () { + .on("input", "[data-target='fontSize']", function () { var $target = $(this); var targetValue = $target.val(); var validInput = /^[\d\.]+(p|px|e|em){0,1}$/g; @@ -118,7 +118,7 @@ define(function (require, exports, module) { newSettings[attr] = targetValue; } }) - .on("input", "[data-target=fontFamily]", function () { + .on("input", "[data-target='fontFamily']", function () { var $target = $(this); var attr = $target.attr("data-target"); newSettings[attr] = $target.val(); From e41986029d2e56635e813b8fca16058086cdaab6 Mon Sep 17 00:00:00 2001 From: ficristo Date: Wed, 22 Feb 2017 21:21:17 +0100 Subject: [PATCH 025/121] Move dependencies to toplevel package.json --- npm-shrinkwrap.json | 2062 +------------------------------------------ package.json | 2 + src/config.json | 2 + 3 files changed, 11 insertions(+), 2055 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 8afa80cd793..ee760bc6e09 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -2,93 +2,11 @@ "name": "Brackets", "version": "1.9.0-0", "dependencies": { - "abbrev": { - "version": "1.0.9", - "from": "abbrev@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz", - "dev": true - }, - "acorn": { - "version": "4.0.4", - "from": "acorn@4.0.4", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-4.0.4.tgz", - "dev": true - }, - "acorn-jsx": { - "version": "3.0.1", - "from": "acorn-jsx@>=3.0.0 <4.0.0", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz", - "dev": true, - "dependencies": { - "acorn": { - "version": "3.3.0", - "from": "acorn@>=3.0.4 <4.0.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", - "dev": true - } - } - }, - "adm-zip": { - "version": "0.4.4", - "from": "adm-zip@0.4.4", - "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.4.4.tgz", - "dev": true - }, - "ajv": { - "version": "4.11.3", - "from": "ajv@>=4.7.0 <5.0.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.3.tgz", - "dev": true - }, - "ajv-keywords": { - "version": "1.5.1", - "from": "ajv-keywords@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-1.5.1.tgz", - "dev": true - }, - "amdefine": { - "version": "1.0.1", - "from": "amdefine@>=0.0.4", - "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", - "dev": true - }, - "ansi-escapes": { - "version": "1.4.0", - "from": "ansi-escapes@>=1.1.0 <2.0.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-1.4.0.tgz", - "dev": true - }, - "ansi-regex": { - "version": "2.1.1", - "from": "ansi-regex@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "dev": true - }, - "ansi-styles": { - "version": "2.2.1", - "from": "ansi-styles@>=2.2.1 <3.0.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "dev": true - }, "anymatch": { "version": "1.3.0", "from": "anymatch@>=1.3.0 <2.0.0", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.0.tgz" }, - "argparse": { - "version": "0.1.16", - "from": "argparse@>=0.1.11 <0.2.0", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-0.1.16.tgz", - "dev": true, - "dependencies": { - "underscore.string": { - "version": "2.4.0", - "from": "underscore.string@>=2.4.0 <2.5.0", - "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-2.4.0.tgz", - "dev": true - } - } - }, "arr-diff": { "version": "2.0.0", "from": "arr-diff@>=2.0.0 <3.0.0", @@ -99,24 +17,6 @@ "from": "arr-flatten@>=1.0.1 <2.0.0", "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.0.1.tgz" }, - "array-differ": { - "version": "1.0.0", - "from": "array-differ@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-1.0.0.tgz", - "dev": true - }, - "array-union": { - "version": "1.0.2", - "from": "array-union@>=1.0.1 <2.0.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", - "dev": true - }, - "array-uniq": { - "version": "1.0.3", - "from": "array-uniq@>=1.0.1 <2.0.0", - "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", - "dev": true - }, "array-unique": { "version": "0.2.1", "from": "array-unique@>=0.2.1 <0.3.0", @@ -127,82 +27,21 @@ "from": "arrify@>=1.0.0 <2.0.0", "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz" }, - "asap": { - "version": "2.0.5", - "from": "asap@>=2.0.3 <2.1.0", - "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.5.tgz", - "dev": true, - "optional": true - }, - "asn1": { - "version": "0.1.11", - "from": "asn1@0.1.11", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.1.11.tgz", - "dev": true, - "optional": true - }, - "async": { - "version": "0.1.22", - "from": "async@>=0.1.22 <0.2.0", - "resolved": "https://registry.npmjs.org/async/-/async-0.1.22.tgz", - "dev": true - }, "async-each": { "version": "1.0.1", "from": "async-each@>=1.0.0 <2.0.0", "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz" }, - "asynckit": { - "version": "0.4.0", - "from": "asynckit@>=0.4.0 <0.5.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "dev": true, - "optional": true - }, - "aws4": { - "version": "1.6.0", - "from": "aws4@>=1.2.1 <2.0.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz", - "dev": true, - "optional": true - }, "balanced-match": { "version": "0.4.2", "from": "balanced-match@>=0.4.1 <0.5.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz" }, - "bcrypt-pbkdf": { - "version": "1.0.1", - "from": "bcrypt-pbkdf@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", - "dev": true, - "optional": true - }, "binary-extensions": { "version": "1.8.0", "from": "binary-extensions@>=1.0.0 <2.0.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.8.0.tgz" }, - "bl": { - "version": "0.9.5", - "from": "bl@>=0.9.0 <0.10.0", - "resolved": "https://registry.npmjs.org/bl/-/bl-0.9.5.tgz", - "dev": true, - "dependencies": { - "isarray": { - "version": "0.0.1", - "from": "isarray@0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "dev": true - }, - "readable-stream": { - "version": "1.0.34", - "from": "readable-stream@>=1.0.26 <1.1.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "dev": true - } - } - }, "brace-expansion": { "version": "1.1.6", "from": "brace-expansion@>=1.0.0 <2.0.0", @@ -218,320 +57,21 @@ "from": "buffer-shims@>=1.0.0 <2.0.0", "resolved": "https://registry.npmjs.org/buffer-shims/-/buffer-shims-1.0.0.tgz" }, - "caller-path": { - "version": "0.1.0", - "from": "caller-path@>=0.1.0 <0.2.0", - "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", - "dev": true - }, - "callsites": { - "version": "0.2.0", - "from": "callsites@>=0.2.0 <0.3.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "from": "chalk@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "dev": true - }, "chokidar": { "version": "1.6.0", "from": "chokidar@1.6.0", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.6.0.tgz" }, - "circular-json": { - "version": "0.3.1", - "from": "circular-json@>=0.3.0 <0.4.0", - "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.1.tgz", - "dev": true - }, - "clean-css": { - "version": "1.0.12", - "from": "clean-css@>=1.0.0 <1.1.0", - "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-1.0.12.tgz", - "dev": true - }, - "cli-cursor": { - "version": "1.0.2", - "from": "cli-cursor@>=1.0.1 <2.0.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-1.0.2.tgz", - "dev": true - }, - "cli-width": { - "version": "2.1.0", - "from": "cli-width@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.1.0.tgz", - "dev": true - }, - "co": { - "version": "4.6.0", - "from": "co@>=4.6.0 <5.0.0", - "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "dev": true - }, - "code-point-at": { - "version": "1.1.0", - "from": "code-point-at@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "dev": true - }, - "coffee-script": { - "version": "1.3.3", - "from": "coffee-script@>=1.3.3 <1.4.0", - "resolved": "https://registry.npmjs.org/coffee-script/-/coffee-script-1.3.3.tgz", - "dev": true - }, - "colors": { - "version": "0.6.2", - "from": "colors@>=0.6.2 <0.7.0", - "resolved": "https://registry.npmjs.org/colors/-/colors-0.6.2.tgz", - "dev": true - }, - "commander": { - "version": "1.3.2", - "from": "commander@>=1.3.0 <1.4.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-1.3.2.tgz", - "dev": true - }, "concat-map": { "version": "0.0.1", "from": "concat-map@0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" }, - "concat-stream": { - "version": "1.6.0", - "from": "concat-stream@>=1.4.6 <2.0.0", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.0.tgz", - "dev": true - }, - "config-chain": { - "version": "1.1.11", - "from": "config-chain@>=1.1.8 <1.2.0", - "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.11.tgz", - "dev": true - }, "core-util-is": { "version": "1.0.2", "from": "core-util-is@>=1.0.0 <1.1.0", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz" }, - "ctype": { - "version": "0.5.3", - "from": "ctype@0.5.3", - "resolved": "https://registry.npmjs.org/ctype/-/ctype-0.5.3.tgz", - "dev": true, - "optional": true - }, - "d": { - "version": "0.1.1", - "from": "d@>=0.1.1 <0.2.0", - "resolved": "https://registry.npmjs.org/d/-/d-0.1.1.tgz", - "dev": true - }, - "dashdash": { - "version": "1.14.1", - "from": "dashdash@>=1.12.0 <2.0.0", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "dev": true, - "optional": true, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "from": "assert-plus@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "dev": true, - "optional": true - } - } - }, - "dateformat": { - "version": "1.0.2-1.2.3", - "from": "dateformat@1.0.2-1.2.3", - "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-1.0.2-1.2.3.tgz", - "dev": true - }, - "debug": { - "version": "0.7.4", - "from": "debug@>=0.7.0 <0.8.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-0.7.4.tgz", - "dev": true - }, - "deep-is": { - "version": "0.1.3", - "from": "deep-is@>=0.1.3 <0.2.0", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", - "dev": true - }, - "del": { - "version": "2.2.2", - "from": "del@>=2.0.2 <3.0.0", - "resolved": "https://registry.npmjs.org/del/-/del-2.2.2.tgz", - "dev": true - }, - "doctrine": { - "version": "1.5.0", - "from": "doctrine@>=1.2.2 <2.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", - "dev": true - }, - "ecc-jsbn": { - "version": "0.1.1", - "from": "ecc-jsbn@>=0.1.1 <0.2.0", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", - "dev": true, - "optional": true - }, - "errno": { - "version": "0.1.4", - "from": "errno@>=0.1.1 <0.2.0", - "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.4.tgz", - "dev": true, - "optional": true - }, - "es5-ext": { - "version": "0.10.12", - "from": "es5-ext@>=0.10.11 <0.11.0", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.12.tgz", - "dev": true - }, - "es6-iterator": { - "version": "2.0.0", - "from": "es6-iterator@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.0.tgz", - "dev": true - }, - "es6-map": { - "version": "0.1.4", - "from": "es6-map@>=0.1.3 <0.2.0", - "resolved": "https://registry.npmjs.org/es6-map/-/es6-map-0.1.4.tgz", - "dev": true - }, - "es6-set": { - "version": "0.1.4", - "from": "es6-set@>=0.1.3 <0.2.0", - "resolved": "https://registry.npmjs.org/es6-set/-/es6-set-0.1.4.tgz", - "dev": true - }, - "es6-symbol": { - "version": "3.1.0", - "from": "es6-symbol@>=3.1.0 <3.2.0", - "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.0.tgz", - "dev": true - }, - "es6-weak-map": { - "version": "2.0.1", - "from": "es6-weak-map@>=2.0.1 <3.0.0", - "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.1.tgz", - "dev": true - }, - "escape-string-regexp": { - "version": "1.0.5", - "from": "escape-string-regexp@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "dev": true - }, - "escope": { - "version": "3.6.0", - "from": "escope@>=3.6.0 <4.0.0", - "resolved": "https://registry.npmjs.org/escope/-/escope-3.6.0.tgz", - "dev": true - }, - "eslint": { - "version": "2.13.1", - "from": "eslint@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-2.13.1.tgz", - "dev": true, - "dependencies": { - "argparse": { - "version": "1.0.9", - "from": "argparse@>=1.0.7 <2.0.0", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.9.tgz", - "dev": true - }, - "debug": { - "version": "2.6.1", - "from": "debug@>=2.1.1 <3.0.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.1.tgz", - "dev": true - }, - "esprima": { - "version": "3.1.3", - "from": "esprima@>=3.1.1 <4.0.0", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-3.1.3.tgz", - "dev": true - }, - "js-yaml": { - "version": "3.8.1", - "from": "js-yaml@>=3.5.1 <4.0.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.8.1.tgz", - "dev": true - } - } - }, - "espree": { - "version": "3.4.0", - "from": "espree@>=3.1.6 <4.0.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-3.4.0.tgz", - "dev": true - }, - "esprima": { - "version": "1.0.4", - "from": "esprima@>=1.0.2 <1.1.0", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-1.0.4.tgz", - "dev": true - }, - "esrecurse": { - "version": "4.1.0", - "from": "esrecurse@>=4.1.0 <5.0.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.1.0.tgz", - "dev": true, - "dependencies": { - "estraverse": { - "version": "4.1.1", - "from": "estraverse@>=4.1.0 <4.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.1.1.tgz", - "dev": true - } - } - }, - "estraverse": { - "version": "4.2.0", - "from": "estraverse@>=4.2.0 <5.0.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", - "dev": true - }, - "esutils": { - "version": "2.0.2", - "from": "esutils@>=2.0.2 <3.0.0", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", - "dev": true - }, - "event-emitter": { - "version": "0.3.4", - "from": "event-emitter@>=0.3.4 <0.4.0", - "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.4.tgz", - "dev": true - }, - "eventemitter2": { - "version": "0.4.14", - "from": "eventemitter2@>=0.4.13 <0.5.0", - "resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-0.4.14.tgz", - "dev": true - }, - "exit": { - "version": "0.1.2", - "from": "exit@>=0.1.1 <0.2.0", - "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", - "dev": true - }, - "exit-hook": { - "version": "1.1.1", - "from": "exit-hook@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/exit-hook/-/exit-hook-1.1.1.tgz", - "dev": true - }, "expand-brackets": { "version": "0.1.5", "from": "expand-brackets@>=0.1.4 <0.2.0", @@ -542,124 +82,21 @@ "from": "expand-range@>=1.8.1 <2.0.0", "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz" }, - "extend": { - "version": "3.0.0", - "from": "extend@>=3.0.0 <3.1.0", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.0.tgz", - "dev": true, - "optional": true - }, "extglob": { "version": "0.3.2", "from": "extglob@>=0.3.1 <0.4.0", "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz" }, - "extsprintf": { - "version": "1.0.2", - "from": "extsprintf@1.0.2", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.0.2.tgz", - "dev": true - }, - "fast-levenshtein": { - "version": "2.0.6", - "from": "fast-levenshtein@>=2.0.4 <2.1.0", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "dev": true - }, - "faye-websocket": { - "version": "0.4.4", - "from": "faye-websocket@>=0.4.3 <0.5.0", - "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.4.4.tgz", - "dev": true - }, - "figures": { - "version": "1.7.0", - "from": "figures@>=1.3.5 <2.0.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", - "dev": true - }, - "file-entry-cache": { - "version": "1.3.1", - "from": "file-entry-cache@>=1.1.1 <2.0.0", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-1.3.1.tgz", - "dev": true - }, "filename-regex": { "version": "2.0.0", "from": "filename-regex@>=2.0.0 <3.0.0", "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.0.tgz" }, - "fileset": { - "version": "0.1.8", - "from": "fileset@>=0.1.5 <0.2.0", - "resolved": "https://registry.npmjs.org/fileset/-/fileset-0.1.8.tgz", - "dev": true, - "dependencies": { - "glob": { - "version": "3.2.11", - "from": "glob@>=3.0.0 <4.0.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-3.2.11.tgz", - "dev": true, - "dependencies": { - "minimatch": { - "version": "0.3.0", - "from": "minimatch@>=0.3.0 <0.4.0", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.3.0.tgz", - "dev": true - } - } - }, - "minimatch": { - "version": "0.4.0", - "from": "minimatch@>=0.0.0 <1.0.0", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.4.0.tgz", - "dev": true - } - } - }, "fill-range": { "version": "2.2.3", "from": "fill-range@>=2.1.0 <3.0.0", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.3.tgz" }, - "find-up": { - "version": "1.1.2", - "from": "find-up@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", - "dev": true - }, - "findup-sync": { - "version": "0.1.3", - "from": "findup-sync@>=0.1.2 <0.2.0", - "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-0.1.3.tgz", - "dev": true, - "dependencies": { - "glob": { - "version": "3.2.11", - "from": "glob@>=3.2.9 <3.3.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-3.2.11.tgz", - "dev": true - }, - "lodash": { - "version": "2.4.2", - "from": "lodash@>=2.4.1 <2.5.0", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-2.4.2.tgz", - "dev": true - }, - "minimatch": { - "version": "0.3.0", - "from": "minimatch@>=0.3.0 <0.4.0", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.3.0.tgz", - "dev": true - } - } - }, - "flat-cache": { - "version": "1.2.2", - "from": "flat-cache@>=1.2.1 <2.0.0", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.2.2.tgz", - "dev": true - }, "for-in": { "version": "0.1.6", "from": "for-in@>=0.1.5 <0.2.0", @@ -670,72 +107,6 @@ "from": "for-own@>=0.1.4 <0.2.0", "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.4.tgz" }, - "fs-extra": { - "version": "0.23.1", - "from": "fs-extra@>=0.23.1 <0.24.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.23.1.tgz", - "dev": true - }, - "fs.realpath": { - "version": "1.0.0", - "from": "fs.realpath@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "dev": true - }, - "gaze": { - "version": "0.3.4", - "from": "gaze@>=0.3.4 <0.4.0", - "resolved": "https://registry.npmjs.org/gaze/-/gaze-0.3.4.tgz", - "dev": true, - "dependencies": { - "minimatch": { - "version": "0.2.14", - "from": "minimatch@>=0.2.9 <0.3.0", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz", - "dev": true - } - } - }, - "generate-function": { - "version": "2.0.0", - "from": "generate-function@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz", - "dev": true - }, - "generate-object-property": { - "version": "1.2.0", - "from": "generate-object-property@>=1.1.0 <2.0.0", - "resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz", - "dev": true - }, - "getobject": { - "version": "0.1.0", - "from": "getobject@>=0.1.0 <0.2.0", - "resolved": "https://registry.npmjs.org/getobject/-/getobject-0.1.0.tgz", - "dev": true - }, - "getpass": { - "version": "0.1.6", - "from": "getpass@>=0.1.1 <0.2.0", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.6.tgz", - "dev": true, - "optional": true, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "from": "assert-plus@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "dev": true, - "optional": true - } - } - }, - "glob": { - "version": "7.0.6", - "from": "glob@7.0.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.0.6.tgz", - "dev": true - }, "glob-base": { "version": "0.3.0", "from": "glob-base@>=0.3.0 <0.4.0", @@ -746,395 +117,16 @@ "from": "glob-parent@>=2.0.0 <3.0.0", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz" }, - "globals": { - "version": "9.14.0", - "from": "globals@>=9.2.0 <10.0.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-9.14.0.tgz", - "dev": true - }, - "globby": { - "version": "5.0.0", - "from": "globby@>=5.0.0 <6.0.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-5.0.0.tgz", - "dev": true - }, "graceful-fs": { "version": "4.1.11", "from": "graceful-fs@>=4.1.2 <5.0.0", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz" }, - "graceful-readlink": { - "version": "1.0.1", - "from": "graceful-readlink@>=1.0.0", - "resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz", - "dev": true, - "optional": true - }, - "growl": { - "version": "1.7.0", - "from": "growl@>=1.7.0 <1.8.0", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.7.0.tgz", - "dev": true - }, - "grunt": { - "version": "0.4.5", - "from": "grunt@0.4.5", - "resolved": "https://registry.npmjs.org/grunt/-/grunt-0.4.5.tgz", - "dev": true, - "dependencies": { - "glob": { - "version": "3.1.21", - "from": "glob@>=3.1.21 <3.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-3.1.21.tgz", - "dev": true, - "dependencies": { - "graceful-fs": { - "version": "1.2.3", - "from": "graceful-fs@>=1.2.0 <1.3.0", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.2.3.tgz", - "dev": true - } - } - }, - "inherits": { - "version": "1.0.2", - "from": "inherits@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-1.0.2.tgz", - "dev": true - }, - "lodash": { - "version": "0.9.2", - "from": "lodash@>=0.9.2 <0.10.0", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-0.9.2.tgz", - "dev": true - }, - "minimatch": { - "version": "0.2.14", - "from": "minimatch@>=0.2.12 <0.3.0", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz", - "dev": true - } - } - }, - "grunt-cleanempty": { - "version": "1.0.3", - "from": "grunt-cleanempty@1.0.3", - "resolved": "https://registry.npmjs.org/grunt-cleanempty/-/grunt-cleanempty-1.0.3.tgz", - "dev": true - }, - "grunt-cli": { - "version": "0.1.9", - "from": "grunt-cli@0.1.9", - "resolved": "https://registry.npmjs.org/grunt-cli/-/grunt-cli-0.1.9.tgz", - "dev": true - }, - "grunt-contrib-clean": { - "version": "0.4.1", - "from": "grunt-contrib-clean@0.4.1", - "resolved": "https://registry.npmjs.org/grunt-contrib-clean/-/grunt-contrib-clean-0.4.1.tgz", - "dev": true - }, - "grunt-contrib-concat": { - "version": "0.3.0", - "from": "grunt-contrib-concat@0.3.0", - "resolved": "https://registry.npmjs.org/grunt-contrib-concat/-/grunt-contrib-concat-0.3.0.tgz", - "dev": true - }, - "grunt-contrib-copy": { - "version": "0.4.1", - "from": "grunt-contrib-copy@0.4.1", - "resolved": "https://registry.npmjs.org/grunt-contrib-copy/-/grunt-contrib-copy-0.4.1.tgz", - "dev": true - }, - "grunt-contrib-cssmin": { - "version": "0.6.0", - "from": "grunt-contrib-cssmin@0.6.0", - "resolved": "https://registry.npmjs.org/grunt-contrib-cssmin/-/grunt-contrib-cssmin-0.6.0.tgz", - "dev": true - }, - "grunt-contrib-htmlmin": { - "version": "0.1.3", - "from": "grunt-contrib-htmlmin@0.1.3", - "resolved": "https://registry.npmjs.org/grunt-contrib-htmlmin/-/grunt-contrib-htmlmin-0.1.3.tgz", - "dev": true - }, - "grunt-contrib-jasmine": { - "version": "0.4.2", - "from": "grunt-contrib-jasmine@0.4.2", - "resolved": "https://registry.npmjs.org/grunt-contrib-jasmine/-/grunt-contrib-jasmine-0.4.2.tgz", - "dev": true, - "dependencies": { - "graceful-fs": { - "version": "1.1.14", - "from": "graceful-fs@>=1.1.0 <1.2.0", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.1.14.tgz", - "dev": true, - "optional": true - }, - "rimraf": { - "version": "2.0.3", - "from": "rimraf@>=2.0.3 <2.1.0", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.0.3.tgz", - "dev": true - } - } - }, - "grunt-contrib-less": { - "version": "1.4.0", - "from": "grunt-contrib-less@1.4.0", - "resolved": "https://registry.npmjs.org/grunt-contrib-less/-/grunt-contrib-less-1.4.0.tgz", - "dev": true, - "dependencies": { - "async": { - "version": "2.1.4", - "from": "async@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/async/-/async-2.1.4.tgz", - "dev": true - } - } - }, - "grunt-contrib-requirejs": { - "version": "0.4.1", - "from": "grunt-contrib-requirejs@0.4.1", - "resolved": "https://registry.npmjs.org/grunt-contrib-requirejs/-/grunt-contrib-requirejs-0.4.1.tgz", - "dev": true - }, - "grunt-contrib-uglify": { - "version": "0.2.0", - "from": "grunt-contrib-uglify@0.2.0", - "resolved": "https://registry.npmjs.org/grunt-contrib-uglify/-/grunt-contrib-uglify-0.2.0.tgz", - "dev": true - }, - "grunt-contrib-watch": { - "version": "0.4.3", - "from": "grunt-contrib-watch@0.4.3", - "resolved": "https://registry.npmjs.org/grunt-contrib-watch/-/grunt-contrib-watch-0.4.3.tgz", - "dev": true - }, - "grunt-eslint": { - "version": "18.1.0", - "from": "grunt-eslint@18.1.0", - "resolved": "https://registry.npmjs.org/grunt-eslint/-/grunt-eslint-18.1.0.tgz", - "dev": true, - "dependencies": { - "ansi-regex": { - "version": "2.0.0", - "from": "ansi-regex@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.0.0.tgz", - "dev": true - }, - "ansi-styles": { - "version": "2.2.1", - "from": "ansi-styles@>=2.2.1 <3.0.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "from": "chalk@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "dev": true - }, - "has-ansi": { - "version": "2.0.0", - "from": "has-ansi@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "dev": true - }, - "strip-ansi": { - "version": "3.0.1", - "from": "strip-ansi@>=3.0.0 <4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "dev": true - }, - "supports-color": { - "version": "2.0.0", - "from": "supports-color@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "dev": true - } - } - }, - "grunt-jasmine-node": { - "version": "0.1.0", - "from": "grunt-jasmine-node@0.1.0", - "resolved": "https://registry.npmjs.org/grunt-jasmine-node/-/grunt-jasmine-node-0.1.0.tgz", - "dev": true - }, - "grunt-legacy-log": { - "version": "0.1.3", - "from": "grunt-legacy-log@>=0.1.0 <0.2.0", - "resolved": "https://registry.npmjs.org/grunt-legacy-log/-/grunt-legacy-log-0.1.3.tgz", - "dev": true, - "dependencies": { - "lodash": { - "version": "2.4.2", - "from": "lodash@>=2.4.1 <2.5.0", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-2.4.2.tgz", - "dev": true - }, - "underscore.string": { - "version": "2.3.3", - "from": "underscore.string@>=2.3.3 <2.4.0", - "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-2.3.3.tgz", - "dev": true - } - } - }, - "grunt-legacy-log-utils": { - "version": "0.1.1", - "from": "grunt-legacy-log-utils@>=0.1.1 <0.2.0", - "resolved": "https://registry.npmjs.org/grunt-legacy-log-utils/-/grunt-legacy-log-utils-0.1.1.tgz", - "dev": true, - "dependencies": { - "lodash": { - "version": "2.4.2", - "from": "lodash@>=2.4.1 <2.5.0", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-2.4.2.tgz", - "dev": true - }, - "underscore.string": { - "version": "2.3.3", - "from": "underscore.string@>=2.3.3 <2.4.0", - "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-2.3.3.tgz", - "dev": true - } - } - }, - "grunt-legacy-util": { - "version": "0.2.0", - "from": "grunt-legacy-util@>=0.2.0 <0.3.0", - "resolved": "https://registry.npmjs.org/grunt-legacy-util/-/grunt-legacy-util-0.2.0.tgz", - "dev": true, - "dependencies": { - "lodash": { - "version": "0.9.2", - "from": "lodash@~0.9.2", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-0.9.2.tgz", - "dev": true - } - } - }, - "grunt-lib-contrib": { - "version": "0.6.1", - "from": "grunt-lib-contrib@>=0.6.0 <0.7.0", - "resolved": "https://registry.npmjs.org/grunt-lib-contrib/-/grunt-lib-contrib-0.6.1.tgz", - "dev": true - }, - "grunt-lib-phantomjs": { - "version": "0.3.0", - "from": "grunt-lib-phantomjs@0.3.0", - "resolved": "https://registry.npmjs.org/grunt-lib-phantomjs/-/grunt-lib-phantomjs-0.3.0.tgz", - "dev": true, - "dependencies": { - "semver": { - "version": "1.0.14", - "from": "semver@>=1.0.14 <1.1.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-1.0.14.tgz", - "dev": true - } - } - }, - "grunt-targethtml": { - "version": "0.2.6", - "from": "grunt-targethtml@0.2.6", - "resolved": "https://registry.npmjs.org/grunt-targethtml/-/grunt-targethtml-0.2.6.tgz", - "dev": true - }, - "grunt-template-jasmine-requirejs": { - "version": "0.1.0", - "from": "grunt-template-jasmine-requirejs@0.1.0", - "resolved": "https://registry.npmjs.org/grunt-template-jasmine-requirejs/-/grunt-template-jasmine-requirejs-0.1.0.tgz", - "dev": true - }, - "grunt-usemin": { - "version": "0.1.11", - "from": "grunt-usemin@0.1.11", - "resolved": "https://registry.npmjs.org/grunt-usemin/-/grunt-usemin-0.1.11.tgz", - "dev": true - }, - "har-validator": { - "version": "2.0.6", - "from": "har-validator@>=2.0.6 <2.1.0", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-2.0.6.tgz", - "dev": true, - "optional": true, - "dependencies": { - "commander": { - "version": "2.9.0", - "from": "commander@>=2.9.0 <3.0.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz", - "dev": true, - "optional": true - } - } - }, - "has-ansi": { - "version": "2.0.0", - "from": "has-ansi@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "dev": true - }, - "hooker": { - "version": "0.2.3", - "from": "hooker@>=0.2.3 <0.3.0", - "resolved": "https://registry.npmjs.org/hooker/-/hooker-0.2.3.tgz", - "dev": true - }, - "html-minifier": { - "version": "0.5.6", - "from": "html-minifier@>=0.5.0 <0.6.0", - "resolved": "https://registry.npmjs.org/html-minifier/-/html-minifier-0.5.6.tgz", - "dev": true - }, - "iconv-lite": { - "version": "0.2.11", - "from": "iconv-lite@>=0.2.11 <0.3.0", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.2.11.tgz", - "dev": true - }, - "ignore": { - "version": "3.2.2", - "from": "ignore@>=3.1.2 <4.0.0", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.2.2.tgz", - "dev": true - }, - "image-size": { - "version": "0.5.1", - "from": "image-size@>=0.5.0 <0.6.0", - "resolved": "https://registry.npmjs.org/image-size/-/image-size-0.5.1.tgz", - "dev": true, - "optional": true - }, - "imurmurhash": { - "version": "0.1.4", - "from": "imurmurhash@>=0.1.4 <0.2.0", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "dev": true - }, - "inflight": { - "version": "1.0.6", - "from": "inflight@>=1.0.4 <2.0.0", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "dev": true - }, "inherits": { "version": "2.0.3", "from": "inherits@>=2.0.0 <3.0.0", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz" }, - "ini": { - "version": "1.3.4", - "from": "ini@>=1.2.0 <2.0.0", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.4.tgz", - "dev": true - }, - "inquirer": { - "version": "0.12.0", - "from": "inquirer@>=0.12.0 <0.13.0", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-0.12.0.tgz", - "dev": true - }, "is-binary-path": { "version": "1.0.1", "from": "is-binary-path@>=1.0.0 <2.0.0", @@ -1165,46 +157,16 @@ "from": "is-extglob@>=1.0.0 <2.0.0", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz" }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "from": "is-fullwidth-code-point@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "dev": true - }, "is-glob": { "version": "2.0.1", "from": "is-glob@>=2.0.0 <3.0.0", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz" }, - "is-my-json-valid": { - "version": "2.15.0", - "from": "is-my-json-valid@>=2.12.4 <3.0.0", - "resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.15.0.tgz", - "dev": true - }, "is-number": { "version": "2.1.0", "from": "is-number@>=2.1.0 <3.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz" }, - "is-path-cwd": { - "version": "1.0.0", - "from": "is-path-cwd@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz", - "dev": true - }, - "is-path-in-cwd": { - "version": "1.0.0", - "from": "is-path-in-cwd@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.0.tgz", - "dev": true - }, - "is-path-inside": { - "version": "1.0.0", - "from": "is-path-inside@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.0.tgz", - "dev": true - }, "is-posix-bracket": { "version": "0.1.1", "from": "is-posix-bracket@>=0.1.0 <0.2.0", @@ -1215,25 +177,6 @@ "from": "is-primitive@>=2.0.0 <3.0.0", "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz" }, - "is-property": { - "version": "1.0.2", - "from": "is-property@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", - "dev": true - }, - "is-resolvable": { - "version": "1.0.0", - "from": "is-resolvable@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.0.0.tgz", - "dev": true - }, - "is-typedarray": { - "version": "1.0.0", - "from": "is-typedarray@>=1.0.0 <1.1.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "dev": true, - "optional": true - }, "isarray": { "version": "1.0.0", "from": "isarray@1.0.0", @@ -1244,368 +187,31 @@ "from": "isobject@>=2.0.0 <3.0.0", "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz" }, - "isstream": { - "version": "0.1.2", - "from": "isstream@>=0.1.2 <0.2.0", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "dev": true, - "optional": true - }, - "jasmine": { - "version": "2.5.3", - "from": "jasmine@>=2.4.1 <3.0.0", - "resolved": "https://registry.npmjs.org/jasmine/-/jasmine-2.5.3.tgz", - "dev": true - }, - "jasmine-core": { - "version": "2.5.2", - "from": "jasmine-core@>=2.5.2 <2.6.0", - "resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-2.5.2.tgz", - "dev": true - }, - "jasmine-growl-reporter": { - "version": "0.0.3", - "from": "jasmine-growl-reporter@>=0.0.2 <0.1.0", - "resolved": "https://registry.npmjs.org/jasmine-growl-reporter/-/jasmine-growl-reporter-0.0.3.tgz", - "dev": true - }, - "jasmine-node": { - "version": "1.11.0", - "from": "jasmine-node@1.11.0", - "resolved": "https://registry.npmjs.org/jasmine-node/-/jasmine-node-1.11.0.tgz", - "dev": true, - "dependencies": { - "mkdirp": { - "version": "0.3.5", - "from": "mkdirp@>=0.3.5 <0.4.0", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.5.tgz", - "dev": true - } - } - }, - "jasmine-reporters": { - "version": "2.2.0", - "from": "jasmine-reporters@>=0.2.0", - "resolved": "https://registry.npmjs.org/jasmine-reporters/-/jasmine-reporters-2.2.0.tgz", - "dev": true - }, - "jodid25519": { - "version": "1.0.2", - "from": "jodid25519@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/jodid25519/-/jodid25519-1.0.2.tgz", - "dev": true, - "optional": true - }, - "js-yaml": { - "version": "2.0.5", - "from": "js-yaml@>=2.0.5 <2.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-2.0.5.tgz", - "dev": true - }, - "jsbn": { - "version": "0.1.1", - "from": "jsbn@>=0.1.0 <0.2.0", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "dev": true, - "optional": true - }, - "json-schema": { - "version": "0.2.3", - "from": "json-schema@0.2.3", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "dev": true, - "optional": true - }, - "json-stable-stringify": { - "version": "1.0.1", - "from": "json-stable-stringify@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", - "dev": true - }, - "json-stringify-safe": { - "version": "5.0.1", - "from": "json-stringify-safe@>=5.0.0 <5.1.0", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "dev": true - }, - "jsonfile": { - "version": "2.4.0", - "from": "jsonfile@>=2.1.0 <3.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", - "dev": true - }, - "jsonify": { - "version": "0.0.0", - "from": "jsonify@>=0.0.0 <0.1.0", - "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", - "dev": true - }, - "jsonpointer": { - "version": "4.0.1", - "from": "jsonpointer@>=4.0.0 <5.0.0", - "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-4.0.1.tgz", - "dev": true - }, - "jsprim": { - "version": "1.3.1", - "from": "jsprim@>=1.2.2 <2.0.0", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.3.1.tgz", - "dev": true, - "optional": true - }, - "junk": { - "version": "1.0.3", - "from": "junk@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/junk/-/junk-1.0.3.tgz", - "dev": true - }, - "kew": { - "version": "0.4.0", - "from": "kew@0.4.0", - "resolved": "https://registry.npmjs.org/kew/-/kew-0.4.0.tgz", - "dev": true - }, - "keypress": { - "version": "0.1.0", - "from": "keypress@>=0.1.0 <0.2.0", - "resolved": "https://registry.npmjs.org/keypress/-/keypress-0.1.0.tgz", - "dev": true - }, "kind-of": { "version": "3.1.0", "from": "kind-of@>=3.0.2 <4.0.0", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.1.0.tgz" }, - "less": { - "version": "2.7.2", - "from": "less@>=2.7.1 <2.8.0", - "resolved": "https://registry.npmjs.org/less/-/less-2.7.2.tgz", - "dev": true, - "dependencies": { - "assert-plus": { - "version": "0.2.0", - "from": "assert-plus@>=0.2.0 <0.3.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz", - "dev": true, - "optional": true - }, - "aws-sign2": { - "version": "0.6.0", - "from": "aws-sign2@>=0.6.0 <0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", - "dev": true, - "optional": true - }, - "boom": { - "version": "2.10.1", - "from": "boom@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", - "dev": true - }, - "caseless": { - "version": "0.11.0", - "from": "caseless@>=0.11.0 <0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz", - "dev": true, - "optional": true - }, - "combined-stream": { - "version": "1.0.5", - "from": "combined-stream@>=1.0.5 <1.1.0", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz", - "dev": true - }, - "cryptiles": { - "version": "2.0.5", - "from": "cryptiles@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz", - "dev": true, - "optional": true - }, - "delayed-stream": { - "version": "1.0.0", - "from": "delayed-stream@>=1.0.0 <1.1.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "dev": true - }, - "forever-agent": { - "version": "0.6.1", - "from": "forever-agent@>=0.6.1 <0.7.0", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "dev": true, - "optional": true - }, - "form-data": { - "version": "2.1.2", - "from": "form-data@>=2.1.1 <2.2.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.1.2.tgz", - "dev": true, - "optional": true - }, - "hawk": { - "version": "3.1.3", - "from": "hawk@>=3.1.3 <3.2.0", - "resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz", - "dev": true, - "optional": true - }, - "hoek": { - "version": "2.16.3", - "from": "hoek@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", - "dev": true - }, - "http-signature": { - "version": "1.1.1", - "from": "http-signature@>=1.1.0 <1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz", - "dev": true, - "optional": true - }, - "mime-types": { - "version": "2.1.14", - "from": "mime-types@>=2.1.7 <2.2.0", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.14.tgz", - "dev": true - }, - "oauth-sign": { - "version": "0.8.2", - "from": "oauth-sign@>=0.8.1 <0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", - "dev": true, - "optional": true - }, - "qs": { - "version": "6.3.0", - "from": "qs@>=6.3.0 <6.4.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.3.0.tgz", - "dev": true, - "optional": true - }, - "request": { - "version": "2.79.0", - "from": "request@>=2.51.0 <3.0.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.79.0.tgz", - "dev": true, - "optional": true - }, - "sntp": { - "version": "1.0.9", - "from": "sntp@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz", - "dev": true, - "optional": true - }, - "uuid": { - "version": "3.0.1", - "from": "uuid@>=3.0.0 <4.0.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.0.1.tgz", - "dev": true, - "optional": true - } - } - }, - "levn": { - "version": "0.3.0", - "from": "levn@>=0.3.0 <0.4.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "dev": true - }, - "load-grunt-tasks": { - "version": "3.5.0", - "from": "load-grunt-tasks@3.5.0", - "resolved": "https://registry.npmjs.org/load-grunt-tasks/-/load-grunt-tasks-3.5.0.tgz", - "dev": true - }, "lodash": { "version": "4.15.0", "from": "lodash@4.15.0", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.15.0.tgz" }, - "lru-cache": { - "version": "2.7.3", - "from": "lru-cache@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz", - "dev": true - }, "micromatch": { "version": "2.3.11", "from": "micromatch@>=2.1.5 <3.0.0", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz" }, - "mime": { - "version": "1.2.11", - "from": "mime@>=1.2.11 <1.3.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.2.11.tgz", - "dev": true, - "optional": true - }, - "mime-db": { - "version": "1.26.0", - "from": "mime-db@>=1.26.0 <1.27.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.26.0.tgz", - "dev": true - }, "minimatch": { "version": "3.0.3", "from": "minimatch@>=3.0.2 <4.0.0", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz" }, - "minimist": { - "version": "0.0.8", - "from": "minimist@0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "dev": true - }, - "mkdirp": { - "version": "0.5.1", - "from": "mkdirp@>=0.5.0 <0.6.0", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "dev": true - }, - "ms": { - "version": "0.7.2", - "from": "ms@0.7.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.2.tgz", - "dev": true - }, - "multimatch": { - "version": "2.1.0", - "from": "multimatch@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-2.1.0.tgz", - "dev": true - }, - "mute-stream": { - "version": "0.0.5", - "from": "mute-stream@0.0.5", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.5.tgz", - "dev": true - }, "nan": { "version": "1.0.0", "from": "nan@>=1.0.0 <1.1.0", "resolved": "https://registry.npmjs.org/nan/-/nan-1.0.0.tgz" }, - "nopt": { - "version": "1.0.10", - "from": "nopt@>=1.0.10 <1.1.0", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", - "dev": true - }, - "noptify": { - "version": "0.0.3", - "from": "noptify@latest", - "resolved": "https://registry.npmjs.org/noptify/-/noptify-0.0.3.tgz", - "dev": true, - "dependencies": { - "nopt": { - "version": "2.0.0", - "from": "nopt@>=2.0.0 <2.1.0", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-2.0.0.tgz", - "dev": true - } - } - }, "normalize-path": { "version": "2.0.1", "from": "normalize-path@>=2.0.1 <3.0.0", @@ -3100,294 +1706,45 @@ } } }, - "npmconf": { - "version": "2.1.1", - "from": "npmconf@2.1.1", - "resolved": "https://registry.npmjs.org/npmconf/-/npmconf-2.1.1.tgz", - "dev": true, - "dependencies": { - "nopt": { - "version": "3.0.6", - "from": "nopt@>=3.0.1 <3.1.0", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", - "dev": true - }, - "once": { - "version": "1.3.3", - "from": "once@>=1.3.0 <1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.3.3.tgz", - "dev": true - } - } - }, - "number-is-nan": { - "version": "1.0.1", - "from": "number-is-nan@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "dev": true - }, "object-assign": { "version": "4.1.1", "from": "object-assign@>=4.0.1 <5.0.0", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "dev": true + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz" }, "object.omit": { "version": "2.0.1", "from": "object.omit@>=2.0.0 <3.0.0", "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz" }, - "once": { - "version": "1.4.0", - "from": "once@>=1.3.0 <2.0.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "dev": true - }, - "onetime": { - "version": "1.1.0", - "from": "onetime@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz", - "dev": true - }, - "optimist": { - "version": "0.3.7", - "from": "optimist@>=0.3.5 <0.4.0", - "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.3.7.tgz", - "dev": true - }, - "optionator": { - "version": "0.8.2", - "from": "optionator@>=0.8.1 <0.9.0", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", - "dev": true, - "dependencies": { - "wordwrap": { - "version": "1.0.0", - "from": "wordwrap@>=1.0.0 <1.1.0", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", - "dev": true - } - } + "opn": { + "version": "4.0.2", + "from": "opn@4.0.2", + "resolved": "https://registry.npmjs.org/opn/-/opn-4.0.2.tgz" }, "options": { "version": "0.0.6", "from": "options@>=0.0.5", "resolved": "https://registry.npmjs.org/options/-/options-0.0.6.tgz" }, - "os-homedir": { - "version": "1.0.2", - "from": "os-homedir@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "dev": true - }, - "os-tmpdir": { - "version": "1.0.2", - "from": "os-tmpdir@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "dev": true - }, - "osenv": { - "version": "0.1.4", - "from": "osenv@>=0.1.0 <0.2.0", - "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.4.tgz", - "dev": true - }, - "package": { - "version": "1.0.1", - "from": "package@>=1.0.0 <1.2.0", - "resolved": "https://registry.npmjs.org/package/-/package-1.0.1.tgz", - "dev": true - }, "parse-glob": { "version": "3.0.4", "from": "parse-glob@>=3.0.4 <4.0.0", "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz" }, - "path-exists": { - "version": "2.1.0", - "from": "path-exists@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", - "dev": true - }, "path-is-absolute": { "version": "1.0.1", "from": "path-is-absolute@>=1.0.0 <2.0.0", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" }, - "path-is-inside": { - "version": "1.0.2", - "from": "path-is-inside@>=1.0.1 <2.0.0", - "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", - "dev": true - }, - "phantomjs": { - "version": "1.9.18", - "from": "phantomjs@1.9.18", - "resolved": "https://registry.npmjs.org/phantomjs/-/phantomjs-1.9.18.tgz", - "dev": true, - "dependencies": { - "assert-plus": { - "version": "0.1.5", - "from": "assert-plus@>=0.1.5 <0.2.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.1.5.tgz", - "dev": true, - "optional": true - }, - "async": { - "version": "0.9.2", - "from": "async@>=0.9.0 <0.10.0", - "resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz", - "dev": true, - "optional": true - }, - "aws-sign2": { - "version": "0.5.0", - "from": "aws-sign2@>=0.5.0 <0.6.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.5.0.tgz", - "dev": true, - "optional": true - }, - "boom": { - "version": "0.4.2", - "from": "boom@>=0.4.0 <0.5.0", - "resolved": "https://registry.npmjs.org/boom/-/boom-0.4.2.tgz", - "dev": true - }, - "caseless": { - "version": "0.6.0", - "from": "caseless@>=0.6.0 <0.7.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.6.0.tgz", - "dev": true - }, - "combined-stream": { - "version": "0.0.7", - "from": "combined-stream@>=0.0.4 <0.1.0", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-0.0.7.tgz", - "dev": true, - "optional": true - }, - "cryptiles": { - "version": "0.2.2", - "from": "cryptiles@>=0.2.0 <0.3.0", - "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-0.2.2.tgz", - "dev": true, - "optional": true - }, - "delayed-stream": { - "version": "0.0.5", - "from": "delayed-stream@0.0.5", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-0.0.5.tgz", - "dev": true, - "optional": true - }, - "forever-agent": { - "version": "0.5.2", - "from": "forever-agent@>=0.5.0 <0.6.0", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.5.2.tgz", - "dev": true - }, - "form-data": { - "version": "0.1.4", - "from": "form-data@>=0.1.0 <0.2.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-0.1.4.tgz", - "dev": true, - "optional": true - }, - "hawk": { - "version": "1.1.1", - "from": "hawk@1.1.1", - "resolved": "https://registry.npmjs.org/hawk/-/hawk-1.1.1.tgz", - "dev": true, - "optional": true - }, - "hoek": { - "version": "0.9.1", - "from": "hoek@>=0.9.0 <0.10.0", - "resolved": "https://registry.npmjs.org/hoek/-/hoek-0.9.1.tgz", - "dev": true - }, - "http-signature": { - "version": "0.10.1", - "from": "http-signature@>=0.10.0 <0.11.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-0.10.1.tgz", - "dev": true, - "optional": true - }, - "mime-types": { - "version": "1.0.2", - "from": "mime-types@>=1.0.1 <1.1.0", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-1.0.2.tgz", - "dev": true - }, - "node-uuid": { - "version": "1.4.7", - "from": "node-uuid@>=1.4.0 <1.5.0", - "resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.7.tgz", - "dev": true - }, - "oauth-sign": { - "version": "0.4.0", - "from": "oauth-sign@>=0.4.0 <0.5.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.4.0.tgz", - "dev": true, - "optional": true - }, - "qs": { - "version": "1.2.2", - "from": "qs@>=1.2.0 <1.3.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-1.2.2.tgz", - "dev": true - }, - "request": { - "version": "2.42.0", - "from": "request@2.42.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.42.0.tgz", - "dev": true - }, - "sntp": { - "version": "0.2.4", - "from": "sntp@>=0.2.0 <0.3.0", - "resolved": "https://registry.npmjs.org/sntp/-/sntp-0.2.4.tgz", - "dev": true, - "optional": true - } - } - }, - "pify": { - "version": "2.3.0", - "from": "pify@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "dev": true - }, "pinkie": { "version": "2.0.4", "from": "pinkie@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "dev": true + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz" }, "pinkie-promise": { "version": "2.0.1", "from": "pinkie-promise@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", - "dev": true - }, - "pkg-up": { - "version": "1.0.0", - "from": "pkg-up@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/pkg-up/-/pkg-up-1.0.0.tgz", - "dev": true - }, - "pluralize": { - "version": "1.2.1", - "from": "pluralize@>=1.2.1 <2.0.0", - "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-1.2.1.tgz", - "dev": true - }, - "prelude-ls": { - "version": "1.1.2", - "from": "prelude-ls@>=1.1.2 <1.2.0", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "dev": true + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz" }, "preserve": { "version": "0.2.0", @@ -3399,45 +1756,6 @@ "from": "process-nextick-args@>=1.0.6 <1.1.0", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz" }, - "progress": { - "version": "1.1.8", - "from": "progress@1.1.8", - "resolved": "https://registry.npmjs.org/progress/-/progress-1.1.8.tgz", - "dev": true - }, - "promise": { - "version": "7.1.1", - "from": "promise@>=7.1.1 <8.0.0", - "resolved": "https://registry.npmjs.org/promise/-/promise-7.1.1.tgz", - "dev": true, - "optional": true - }, - "proto-list": { - "version": "1.2.4", - "from": "proto-list@>=1.2.1 <1.3.0", - "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", - "dev": true - }, - "prr": { - "version": "0.0.0", - "from": "prr@>=0.0.0 <0.1.0", - "resolved": "https://registry.npmjs.org/prr/-/prr-0.0.0.tgz", - "dev": true, - "optional": true - }, - "punycode": { - "version": "1.4.1", - "from": "punycode@>=1.4.1 <2.0.0", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "dev": true, - "optional": true - }, - "q": { - "version": "1.4.1", - "from": "q@1.4.1", - "resolved": "https://registry.npmjs.org/q/-/q-1.4.1.tgz", - "dev": true - }, "randomatic": { "version": "1.1.6", "from": "randomatic@>=1.1.3 <2.0.0", @@ -3453,12 +1771,6 @@ "from": "readdirp@>=2.0.0 <3.0.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.1.0.tgz" }, - "readline2": { - "version": "1.0.1", - "from": "readline2@>=1.0.1 <2.0.0", - "resolved": "https://registry.npmjs.org/readline2/-/readline2-1.0.1.tgz", - "dev": true - }, "regex-cache": { "version": "0.4.3", "from": "regex-cache@>=0.4.2 <0.5.0", @@ -3474,362 +1786,26 @@ "from": "repeat-string@>=1.5.2 <2.0.0", "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz" }, - "request-progress": { - "version": "0.3.1", - "from": "request-progress@0.3.1", - "resolved": "https://registry.npmjs.org/request-progress/-/request-progress-0.3.1.tgz", - "dev": true - }, - "require-uncached": { - "version": "1.0.3", - "from": "require-uncached@>=1.0.2 <2.0.0", - "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", - "dev": true - }, - "requirejs": { - "version": "2.1.22", - "from": "requirejs@>=2.1.0 <2.2.0", - "resolved": "https://registry.npmjs.org/requirejs/-/requirejs-2.1.22.tgz", - "dev": true - }, - "resolve": { - "version": "0.3.1", - "from": "resolve@>=0.3.1 <0.4.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-0.3.1.tgz", - "dev": true - }, - "resolve-from": { - "version": "1.0.1", - "from": "resolve-from@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", - "dev": true - }, - "resolve-pkg": { - "version": "0.1.0", - "from": "resolve-pkg@>=0.1.0 <0.2.0", - "resolved": "https://registry.npmjs.org/resolve-pkg/-/resolve-pkg-0.1.0.tgz", - "dev": true, - "dependencies": { - "resolve-from": { - "version": "2.0.0", - "from": "resolve-from@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-2.0.0.tgz", - "dev": true - } - } - }, - "restore-cursor": { - "version": "1.0.1", - "from": "restore-cursor@>=1.0.1 <2.0.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-1.0.1.tgz", - "dev": true - }, - "rimraf": { - "version": "2.2.8", - "from": "rimraf@>=2.2.8 <2.3.0", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.2.8.tgz", - "dev": true - }, - "run-async": { - "version": "0.1.0", - "from": "run-async@>=0.1.0 <0.2.0", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-0.1.0.tgz", - "dev": true - }, - "rx-lite": { - "version": "3.1.2", - "from": "rx-lite@>=3.1.2 <4.0.0", - "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-3.1.2.tgz", - "dev": true - }, - "sax": { - "version": "0.6.1", - "from": "sax@>=0.6.1 <0.7.0", - "resolved": "https://registry.npmjs.org/sax/-/sax-0.6.1.tgz", - "dev": true - }, - "semver": { - "version": "4.3.6", - "from": "semver@>=4.1.0 <5.0.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-4.3.6.tgz", - "dev": true - }, "set-immediate-shim": { "version": "1.0.1", "from": "set-immediate-shim@>=1.0.1 <2.0.0", "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz" }, - "shelljs": { - "version": "0.6.1", - "from": "shelljs@>=0.6.0 <0.7.0", - "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.6.1.tgz", - "dev": true - }, - "sigmund": { - "version": "1.0.1", - "from": "sigmund@>=1.0.0 <1.1.0", - "resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz", - "dev": true - }, - "slice-ansi": { - "version": "0.0.4", - "from": "slice-ansi@0.0.4", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-0.0.4.tgz", - "dev": true - }, - "source-map": { - "version": "0.5.6", - "from": "source-map@>=0.5.3 <0.6.0", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.6.tgz", - "dev": true, - "optional": true - }, - "sprintf-js": { - "version": "1.0.3", - "from": "sprintf-js@>=1.0.2 <1.1.0", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "dev": true - }, - "sshpk": { - "version": "1.10.2", - "from": "sshpk@>=1.7.0 <2.0.0", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.10.2.tgz", - "dev": true, - "optional": true, - "dependencies": { - "asn1": { - "version": "0.2.3", - "from": "asn1@>=0.2.3 <0.3.0", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", - "dev": true, - "optional": true - }, - "assert-plus": { - "version": "1.0.0", - "from": "assert-plus@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "dev": true, - "optional": true - } - } - }, "string_decoder": { "version": "0.10.31", "from": "string_decoder@>=0.10.0 <0.11.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" }, - "string-width": { - "version": "1.0.2", - "from": "string-width@>=1.0.1 <2.0.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "dev": true - }, - "stringstream": { - "version": "0.0.5", - "from": "stringstream@>=0.0.4 <0.1.0", - "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", - "dev": true, - "optional": true - }, - "strip-ansi": { - "version": "3.0.1", - "from": "strip-ansi@>=3.0.0 <4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "dev": true - }, - "strip-json-comments": { - "version": "1.0.4", - "from": "strip-json-comments@>=1.0.1 <1.1.0", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-1.0.4.tgz", - "dev": true - }, - "supports-color": { - "version": "2.0.0", - "from": "supports-color@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "dev": true - }, - "table": { - "version": "3.8.3", - "from": "table@>=3.7.8 <4.0.0", - "resolved": "https://registry.npmjs.org/table/-/table-3.8.3.tgz", - "dev": true, - "dependencies": { - "is-fullwidth-code-point": { - "version": "2.0.0", - "from": "is-fullwidth-code-point@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "dev": true - }, - "string-width": { - "version": "2.0.0", - "from": "string-width@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.0.0.tgz", - "dev": true - } - } - }, - "temporary": { - "version": "0.0.8", - "from": "temporary@>=0.0.4 <0.1.0", - "resolved": "https://registry.npmjs.org/temporary/-/temporary-0.0.8.tgz", - "dev": true - }, - "text-table": { - "version": "0.2.0", - "from": "text-table@>=0.2.0 <0.3.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "dev": true - }, - "throttleit": { - "version": "0.0.2", - "from": "throttleit@>=0.0.2 <0.1.0", - "resolved": "https://registry.npmjs.org/throttleit/-/throttleit-0.0.2.tgz", - "dev": true - }, - "through": { - "version": "2.3.8", - "from": "through@>=2.3.6 <3.0.0", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "dev": true - }, - "tiny-lr": { - "version": "0.0.4", - "from": "tiny-lr@0.0.4", - "resolved": "https://registry.npmjs.org/tiny-lr/-/tiny-lr-0.0.4.tgz", - "dev": true, - "dependencies": { - "qs": { - "version": "0.5.6", - "from": "qs@>=0.5.2 <0.6.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-0.5.6.tgz", - "dev": true - } - } - }, "tinycolor": { "version": "0.0.1", "from": "tinycolor@>=0.0.0 <1.0.0", "resolved": "https://registry.npmjs.org/tinycolor/-/tinycolor-0.0.1.tgz" }, - "tough-cookie": { - "version": "2.3.2", - "from": "tough-cookie@>=0.12.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.2.tgz", - "dev": true, - "optional": true - }, - "tryit": { - "version": "1.0.3", - "from": "tryit@>=1.0.1 <2.0.0", - "resolved": "https://registry.npmjs.org/tryit/-/tryit-1.0.3.tgz", - "dev": true - }, - "tunnel-agent": { - "version": "0.4.3", - "from": "tunnel-agent@>=0.4.0 <0.5.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.3.tgz", - "dev": true - }, - "tweetnacl": { - "version": "0.14.5", - "from": "tweetnacl@>=0.14.0 <0.15.0", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "dev": true, - "optional": true - }, - "type-check": { - "version": "0.3.2", - "from": "type-check@>=0.3.2 <0.4.0", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "dev": true - }, - "typedarray": { - "version": "0.0.6", - "from": "typedarray@>=0.0.5 <0.1.0", - "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "dev": true - }, - "uglify-js": { - "version": "2.2.5", - "from": "uglify-js@>=2.2.1 <2.3.0", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.2.5.tgz", - "dev": true, - "dependencies": { - "source-map": { - "version": "0.1.43", - "from": "source-map@>=0.1.7 <0.2.0", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz", - "dev": true - } - } - }, - "uid-number": { - "version": "0.0.5", - "from": "uid-number@0.0.5", - "resolved": "https://registry.npmjs.org/uid-number/-/uid-number-0.0.5.tgz", - "dev": true - }, - "underscore": { - "version": "1.7.0", - "from": "underscore@>=1.7.0 <1.8.0", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.7.0.tgz", - "dev": true - }, - "underscore.string": { - "version": "2.2.1", - "from": "underscore.string@>=2.2.1 <2.3.0", - "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-2.2.1.tgz", - "dev": true - }, - "user-home": { - "version": "2.0.0", - "from": "user-home@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/user-home/-/user-home-2.0.0.tgz", - "dev": true - }, "util-deprecate": { "version": "1.0.2", "from": "util-deprecate@>=1.0.1 <1.1.0", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz" }, - "verror": { - "version": "1.3.6", - "from": "verror@1.3.6", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.3.6.tgz", - "dev": true, - "optional": true - }, - "walkdir": { - "version": "0.0.11", - "from": "walkdir@>=0.0.1", - "resolved": "https://registry.npmjs.org/walkdir/-/walkdir-0.0.11.tgz", - "dev": true - }, - "which": { - "version": "1.0.9", - "from": "which@>=1.0.5 <1.1.0", - "resolved": "https://registry.npmjs.org/which/-/which-1.0.9.tgz", - "dev": true - }, - "wordwrap": { - "version": "0.0.3", - "from": "wordwrap@>=0.0.2 <0.1.0", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", - "dev": true - }, - "wrappy": { - "version": "1.0.2", - "from": "wrappy@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "dev": true - }, - "write": { - "version": "0.2.1", - "from": "write@>=0.2.1 <0.3.0", - "resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz", - "dev": true - }, "ws": { "version": "0.4.32", "from": "ws@>=0.4.31 <0.5.0", @@ -3841,30 +1817,6 @@ "resolved": "https://registry.npmjs.org/commander/-/commander-2.1.0.tgz" } } - }, - "xmldoc": { - "version": "0.1.4", - "from": "xmldoc@>=0.1.2 <0.2.0", - "resolved": "https://registry.npmjs.org/xmldoc/-/xmldoc-0.1.4.tgz", - "dev": true - }, - "xmldom": { - "version": "0.1.27", - "from": "xmldom@>=0.1.22 <0.2.0", - "resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.27.tgz", - "dev": true - }, - "xtend": { - "version": "4.0.1", - "from": "xtend@>=4.0.0 <5.0.0", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "dev": true - }, - "zlib-browserify": { - "version": "0.0.1", - "from": "zlib-browserify@0.0.1", - "resolved": "https://registry.npmjs.org/zlib-browserify/-/zlib-browserify-0.0.1.tgz", - "dev": true } } } diff --git a/package.json b/package.json index baa2696d2b3..13b7760f1f4 100644 --- a/package.json +++ b/package.json @@ -17,9 +17,11 @@ "chokidar": "1.6.0", "lodash": "4.15.0", "npm": "3.10.9", + "opn": "4.0.2", "ws": "~0.4.31" }, "devDependencies": { + "fs-extra": "0.5.0", "glob": "7.0.6", "grunt": "0.4.5", "jasmine-node": "1.11.0", diff --git a/src/config.json b/src/config.json index 0ee111b5b63..3775afad8db 100644 --- a/src/config.json +++ b/src/config.json @@ -40,9 +40,11 @@ "chokidar": "1.6.0", "lodash": "4.15.0", "npm": "3.10.9", + "opn": "4.0.2", "ws": "~0.4.31" }, "devDependencies": { + "fs-extra": "0.5.0", "glob": "7.0.6", "grunt": "0.4.5", "jasmine-node": "1.11.0", From 337946fbacf3190f74282505959a9dc4f080c7f6 Mon Sep 17 00:00:00 2001 From: nyteksf Date: Mon, 27 Feb 2017 00:08:36 -0800 Subject: [PATCH 026/121] #11801 - Implemented @ficristo's Requested Changes: HTML5 pattern attibute, jQuery for var $btn, etc. --- .eslintrc.json | 1 - src/htmlContent/themes-settings.html | 2 +- src/view/ThemeSettings.js | 26 +++++++++++--------------- 3 files changed, 12 insertions(+), 17 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 920f47f75a0..16b5f74189a 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -57,7 +57,6 @@ "$": false, "window": false, - "document": false, "console": false, "setTimeout": false, "clearTimeout": false, diff --git a/src/htmlContent/themes-settings.html b/src/htmlContent/themes-settings.html index 8ea9627ea99..c5eed6c57ec 100644 --- a/src/htmlContent/themes-settings.html +++ b/src/htmlContent/themes-settings.html @@ -30,7 +30,7 @@

    {{Strings.THEMES_SETTINGS}}

    - +
    diff --git a/src/view/ThemeSettings.js b/src/view/ThemeSettings.js index fd31b10a569..8dd6c25f6b1 100644 --- a/src/view/ThemeSettings.js +++ b/src/view/ThemeSettings.js @@ -101,21 +101,17 @@ define(function (require, exports, module) { newSettings[attr] = $target.is(":checked"); }) .on("input", "[data-target='fontSize']", function () { - var $target = $(this); - var targetValue = $target.val(); - var validInput = /^[\d\.]+(p|px|e|em){0,1}$/g; - var btn = document.getElementById("theme-settings-done-btn"); - - // Make sure that the font size is expressed in terms we can handle (px or em). If not, 'done' button disabled until input corrected. - - if (targetValue.search(validInput) === -1) { - btn.disabled = targetValue.length !== 0; - }else{ - if(btn.disabled) { - btn.disabled = false; - } - var attr = $target.attr("data-target"); - newSettings[attr] = targetValue; + var target = this; + var targetValue = $(this).val(); + var $btn = $("#theme-settings-done-btn")[0]; + + // Make sure that the font size is expressed in terms we can handle (px or em). If not, 'done' button is disabled until input has been corrected. + + if (target.checkValidity() === true) { + $btn.disabled = false; + newSettings["fontSize"] = targetValue; + } else { + $btn.disabled = true; } }) .on("input", "[data-target='fontFamily']", function () { From 9a6f12cf259276ebd163e70266030377df67eb2b Mon Sep 17 00:00:00 2001 From: nyteksf Date: Mon, 27 Feb 2017 00:14:56 -0800 Subject: [PATCH 027/121] #11801 - Edited tag value for clarity --- src/view/ThemeSettings.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/view/ThemeSettings.js b/src/view/ThemeSettings.js index 8dd6c25f6b1..4b21f67695f 100644 --- a/src/view/ThemeSettings.js +++ b/src/view/ThemeSettings.js @@ -115,9 +115,8 @@ define(function (require, exports, module) { } }) .on("input", "[data-target='fontFamily']", function () { - var $target = $(this); - var attr = $target.attr("data-target"); - newSettings[attr] = $target.val(); + var targetValue = $(this).val(); + newSettings["fontFamily"] = targetValue; }) .on("change", "select", function () { var $target = $(":selected", this); From 245fcc1e136269bc63932d1bcdc6ef6671eee828 Mon Sep 17 00:00:00 2001 From: Martin Zagora Date: Tue, 28 Feb 2017 14:36:57 +1100 Subject: [PATCH 028/121] fix javascript quick edit tests --- .../default/JavaScriptQuickEdit/unittests.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/extensions/default/JavaScriptQuickEdit/unittests.js b/src/extensions/default/JavaScriptQuickEdit/unittests.js index 77380ba2376..5302abca973 100644 --- a/src/extensions/default/JavaScriptQuickEdit/unittests.js +++ b/src/extensions/default/JavaScriptQuickEdit/unittests.js @@ -61,6 +61,14 @@ define(function (require, exports, module) { return result.promise(); } + // Helper function for testing cursor position + function fixPos(pos) { + if (!("sticky" in pos)) { + pos.sticky = null; + } + return pos; + } + /** * Performs setup for an inline editor test. Parses offsets (saved to Spec.offsets) for all files in * the test project (testPath) and saves files back to disk without offset markup. @@ -237,7 +245,7 @@ define(function (require, exports, module) { var inlinePos = inlineWidget.editor.getCursorPos(); // verify cursor position in inline editor - expect(inlinePos).toEqual(this.infos["test1inline.js"].offsets[0]); + expect(fixPos(inlinePos)).toEqual(fixPos(this.infos["test1inline.js"].offsets[0])); }); }); @@ -249,7 +257,7 @@ define(function (require, exports, module) { var inlinePos = inlineWidget.editor.getCursorPos(); // verify cursor position in inline editor - expect(inlinePos).toEqual(this.infos["test1inline.js"].offsets[1]); + expect(fixPos(inlinePos)).toEqual(fixPos(this.infos["test1inline.js"].offsets[1])); }); }); @@ -261,7 +269,7 @@ define(function (require, exports, module) { var inlinePos = inlineWidget.editor.getCursorPos(); // verify cursor position in inline editor - expect(inlinePos).toEqual(this.infos["test1inline.js"].offsets[2]); + expect(fixPos(inlinePos)).toEqual(fixPos(this.infos["test1inline.js"].offsets[2])); }); }); From e26dfad9c831b7de80cbb55cafe97b252ca1d048 Mon Sep 17 00:00:00 2001 From: Martin Zagora Date: Tue, 28 Feb 2017 14:47:12 +1100 Subject: [PATCH 029/121] fix javascript code hints tests --- .../default/JavaScriptCodeHints/unittests.js | 25 +++++++++++++------ 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/src/extensions/default/JavaScriptCodeHints/unittests.js b/src/extensions/default/JavaScriptCodeHints/unittests.js index 9c93ac879e9..22541344d96 100644 --- a/src/extensions/default/JavaScriptCodeHints/unittests.js +++ b/src/extensions/default/JavaScriptCodeHints/unittests.js @@ -58,6 +58,15 @@ define(function (require, exports, module) { }); describe("JavaScript Code Hinting", function () { + + // Helper function for testing cursor position + function fixPos(pos) { + if (!("sticky" in pos)) { + pos.sticky = null; + } + return pos; + } + /* * Ask provider for hints at current cursor position; expect it to * return some @@ -718,7 +727,7 @@ define(function (require, exports, module) { selectHint(JSCodeHints.jsHintProvider, hintObj, "propA"); runs(function () { - expect(testEditor.getCursorPos()).toEqual(end); + expect(fixPos(testEditor.getCursorPos())).toEqual(fixPos(end)); expect(testDoc.getRange(start, end)).toEqual("A1.propA"); expect(testDoc.getLine(end.line).length).toEqual(8); }); @@ -736,7 +745,7 @@ define(function (require, exports, module) { selectHint(JSCodeHints.jsHintProvider, hintObj, "propA"); runs(function () { - expect(testEditor.getCursorPos()).toEqual(end); + expect(fixPos(testEditor.getCursorPos())).toEqual(fixPos(end)); expect(testDoc.getRange(start, endplus)).toEqual("A1.propAprop"); expect(testDoc.getLine(end.line).length).toEqual(12); }); @@ -752,7 +761,7 @@ define(function (require, exports, module) { var hintObj = expectHints(JSCodeHints.jsHintProvider); selectHint(JSCodeHints.jsHintProvider, hintObj, "propA"); runs(function () { - expect(testEditor.getCursorPos()).toEqual(end); + expect(fixPos(testEditor.getCursorPos())).toEqual(fixPos(end)); expect(testDoc.getRange(start, end)).toEqual("A1.propA"); expect(testDoc.getLine(end.line).length).toEqual(8); }); @@ -769,7 +778,7 @@ define(function (require, exports, module) { var hintObj = expectHints(JSCodeHints.jsHintProvider); selectHint(JSCodeHints.jsHintProvider, hintObj, "propA"); runs(function () { - expect(testEditor.getCursorPos()).toEqual(end); + expect(fixPos(testEditor.getCursorPos())).toEqual(fixPos(end)); expect(testDoc.getRange(start, endplus)).toEqual("A1.propApB"); expect(testDoc.getLine(end.line).length).toEqual(10); }); @@ -787,7 +796,7 @@ define(function (require, exports, module) { selectHint(JSCodeHints.jsHintProvider, hintObj, "propA"); runs(function () { - expect(testEditor.getCursorPos()).toEqual(end); + expect(fixPos(testEditor.getCursorPos())).toEqual(fixPos(end)); expect(testDoc.getRange(start, endplus)).toEqual("(A1.propAprop)"); expect(testDoc.getLine(endplus.line).length).toEqual(14); }); @@ -1005,7 +1014,7 @@ define(function (require, exports, module) { var hintObj = expectHints(JSCodeHints.jsHintProvider); selectHint(JSCodeHints.jsHintProvider, hintObj, "my-key"); runs(function () { - expect(testEditor.getCursorPos()).toEqual(end); + expect(fixPos(testEditor.getCursorPos())).toEqual(fixPos(end)); expect(testDoc.getRange(start, end)).toEqual("arr[\"my-key\"]"); expect(testDoc.getLine(end.line).length).toEqual(13); }); @@ -1021,7 +1030,7 @@ define(function (require, exports, module) { var hintObj = expectHints(JSCodeHints.jsHintProvider); selectHint(JSCodeHints.jsHintProvider, hintObj, "my-key"); runs(function () { - expect(testEditor.getCursorPos()).toEqual(end); + expect(fixPos(testEditor.getCursorPos())).toEqual(fixPos(end)); expect(testDoc.getRange(start, end)).toEqual("arr[\"my-key\"]"); expect(testDoc.getLine(end.line).length).toEqual(13); }); @@ -1037,7 +1046,7 @@ define(function (require, exports, module) { var hintObj = expectHints(JSCodeHints.jsHintProvider); selectHint(JSCodeHints.jsHintProvider, hintObj, "for"); runs(function () { - expect(testEditor.getCursorPos()).toEqual(end); + expect(fixPos(testEditor.getCursorPos())).toEqual(fixPos(end)); expect(testDoc.getRange(start, end)).toEqual("arr.for"); expect(testDoc.getLine(end.line).length).toEqual(7); }); From 1de6b887c7fcf23dfe4e93e4d8408811ab55c098 Mon Sep 17 00:00:00 2001 From: Martin Zagora Date: Tue, 28 Feb 2017 15:20:11 +1100 Subject: [PATCH 030/121] fixes #13126 --- .../JavaScriptCodeHints/ScopeManager.js | 101 +++++++++--------- 1 file changed, 52 insertions(+), 49 deletions(-) diff --git a/src/extensions/default/JavaScriptCodeHints/ScopeManager.js b/src/extensions/default/JavaScriptCodeHints/ScopeManager.js index b7985bb26ca..00d97626464 100644 --- a/src/extensions/default/JavaScriptCodeHints/ScopeManager.js +++ b/src/extensions/default/JavaScriptCodeHints/ScopeManager.js @@ -1169,65 +1169,68 @@ define(function (require, exports, module) { ensurePreferences(); deferredPreferences.done(function () { - if (!file instanceof InMemoryFile) { - FileSystem.resolve(dir, function (err, directory) { + if (file instanceof InMemoryFile) { + initTernServer(pr, []); + var hintsPromise = primePump(path); + hintsPromise.done(function () { + addFilesDeferred.resolveWith(null, [_ternWorker]); + }); + return; + } + + FileSystem.resolve(dir, function (err, directory) { + if (err) { + console.error("Error resolving", dir); + addFilesDeferred.resolveWith(null); + return; + } + + directory.getContents(function (err, contents) { if (err) { - console.error("Error resolving", dir); + console.error("Error getting contents for", directory); addFilesDeferred.resolveWith(null); return; } - directory.getContents(function (err, contents) { - if (err) { - console.error("Error getting contents for", directory); - addFilesDeferred.resolveWith(null); - return; - } + var files = contents + .filter(function (entry) { + return entry.isFile && !isFileExcluded(entry); + }) + .map(function (entry) { + return entry.fullPath; + }); - var files = contents - .filter(function (entry) { - return entry.isFile && !isFileExcluded(entry); - }) - .map(function (entry) { - return entry.fullPath; - }); + initTernServer(dir, files); + + var hintsPromise = primePump(path); + hintsPromise.done(function () { + if (!usingModules()) { + // Read the subdirectories of the new file's directory. + // Read them first in case there are too many files to + // read in the project. + addAllFilesAndSubdirectories(dir, function () { + // If the file is in the project root, then read + // all the files under the project root. + var currentDir = (dir + "/"); + if (projectRoot && currentDir !== projectRoot && + currentDir.indexOf(projectRoot) === 0) { + addAllFilesAndSubdirectories(projectRoot, function () { + // prime the pump again but this time don't wait + // for completion. + primePump(path); - initTernServer(dir, files); - - var hintsPromise = primePump(path); - hintsPromise.done(function () { - if (!usingModules()) { - // Read the subdirectories of the new file's directory. - // Read them first in case there are too many files to - // read in the project. - addAllFilesAndSubdirectories(dir, function () { - // If the file is in the project root, then read - // all the files under the project root. - var currentDir = (dir + "/"); - if (projectRoot && currentDir !== projectRoot && - currentDir.indexOf(projectRoot) === 0) { - addAllFilesAndSubdirectories(projectRoot, function () { - // prime the pump again but this time don't wait - // for completion. - primePump(path); - - addFilesDeferred.resolveWith(null, [_ternWorker]); - }); - } else { addFilesDeferred.resolveWith(null, [_ternWorker]); - } - }); - } else { - addFilesDeferred.resolveWith(null, [_ternWorker]); - } - }); + }); + } else { + addFilesDeferred.resolveWith(null, [_ternWorker]); + } + }); + } else { + addFilesDeferred.resolveWith(null, [_ternWorker]); + } }); }); - } else { - initTernServer(pr, []); - primePump(path); - addFilesDeferred.resolveWith(null, [_ternWorker]); - } + }); }); } From bec7552b4cb42307738f3b1fa8521c15a7c097aa Mon Sep 17 00:00:00 2001 From: Martin Zagora Date: Wed, 1 Mar 2017 12:24:10 +1100 Subject: [PATCH 031/121] add syntax highlighting for pug (jade) templating language --- src/language/languages.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/language/languages.json b/src/language/languages.json index fc1b9137695..1de22f94d48 100644 --- a/src/language/languages.json +++ b/src/language/languages.json @@ -317,5 +317,13 @@ "fileExtensions": ["go"], "blockComment": ["/*", "*/"], "lineComment": ["//"] + }, + + "pug": { + "name": "Pug", + "mode": "pug", + "fileExtensions": ["pug", "jade"], + "lineComment": ["//"] } + } From 885b97acc49d8f66f495a35425969cbd913d5887 Mon Sep 17 00:00:00 2001 From: Saurabh Kathpalia Date: Wed, 1 Mar 2017 13:35:52 +0530 Subject: [PATCH 032/121] Fixed #13072: Now Preferences objects are extended from initial values defined in defaultPreferences.json (#13132) * Fixed #13072: Now Preferences objects are extended from initial values defined in defaultPreferences.json * Added test for PreferencesBase --- src/editor/Editor.js | 2 +- src/preferences/PreferencesBase.js | 3 +++ test/spec/PreferencesBase-test.js | 26 ++++++++++++++++++++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/src/editor/Editor.js b/src/editor/Editor.js index 2511615d0f7..f2a4ff9ab12 100644 --- a/src/editor/Editor.js +++ b/src/editor/Editor.js @@ -141,7 +141,7 @@ define(function (require, exports, module) { PreferencesManager.definePreference(CLOSE_BRACKETS, "boolean", true, { description: Strings.DESCRIPTION_CLOSE_BRACKETS }); - PreferencesManager.definePreference(CLOSE_TAGS, "object", { whenOpening: true, whenClosing: true, indentTags: [] }, { + PreferencesManager.definePreference(CLOSE_TAGS, "object", { whenOpening: true, whenClosing: true, indentTags: [], dontCloseTags: [] }, { description: Strings.DESCRIPTION_CLOSE_TAGS, keys: { dontCloseTags: { diff --git a/src/preferences/PreferencesBase.js b/src/preferences/PreferencesBase.js index 1b5c9337faa..dce4ba4c353 100644 --- a/src/preferences/PreferencesBase.js +++ b/src/preferences/PreferencesBase.js @@ -1666,6 +1666,9 @@ define(function (require, exports, module) { var pref = this.getPreference(id), validator = pref && pref.validator; if (!validator || validator(result)) { + if (pref && pref.type === "object") { + result = _.extend({}, pref.initial, result); + } return _.cloneDeep(result); } } diff --git a/test/spec/PreferencesBase-test.js b/test/spec/PreferencesBase-test.js index 65563c99a87..8995eb45e5a 100644 --- a/test/spec/PreferencesBase-test.js +++ b/test/spec/PreferencesBase-test.js @@ -878,6 +878,32 @@ define(function (require, exports, module) { expect(pm.get("useTabChar")).toBe(true); expect(pm.get("tabSize")).toBe(8); }); + + it("should extend Preference Objects from base", function () { + var pm = new PreferencesBase.PreferencesSystem(); + pm.definePreference("closeTags", "object", { + "dontCloseTags": [], + "indentTags": [], + "whenClosing": true, + "whenOpening": true + }); + var userScope = new PreferencesBase.Scope(new PreferencesBase.MemoryStorage()); + pm.addScope("user", userScope); + + var userLocation = { + location: { + scope: "user" + } + }; + pm.set("closeTags", { "whenOpening": false }, userLocation); + + expect(pm.get("closeTags")).toEqual({ + "dontCloseTags": [], + "indentTags": [], + "whenClosing": true, + "whenOpening": false, + }); + }); it("handles asynchronously loaded scopes", function () { var storage1 = new PreferencesBase.MemoryStorage({ From e83abde280dcbbfcb0be3697fdea6ff6e6dbddc8 Mon Sep 17 00:00:00 2001 From: Saurabh Kathpalia Date: Wed, 1 Mar 2017 20:13:22 +0530 Subject: [PATCH 033/121] Fixed #11291 - Added a delay of 200ms when searching for extensions and now we are updating the current view only instead of updating all 3 views --- src/extensibility/ExtensionManagerDialog.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/extensibility/ExtensionManagerDialog.js b/src/extensibility/ExtensionManagerDialog.js index 855b91211d4..2df8249bc29 100644 --- a/src/extensibility/ExtensionManagerDialog.js +++ b/src/extensibility/ExtensionManagerDialog.js @@ -459,12 +459,14 @@ define(function (require, exports, module) { }); // Filter the views when the user types in the search field. + var searchTimeOut = 0; $dlg.on("input", ".search", function (e) { + clearTimeout(searchTimeOut); var query = $(this).val(); - views.forEach(function (view) { - view.filter(query); + searchTimeOut = setTimeout(function () { + views[_activeTabIndex].filter(query); $modalDlg.scrollTop(0); - }); + }, 200); }).on("click", ".search-clear", clearSearch); // Sort the extension list based on the current selected sorting criteria From f4f40d8c7222e4050d8d62361b99a14d455aace6 Mon Sep 17 00:00:00 2001 From: Mansimar Kaur Date: Thu, 2 Mar 2017 00:35:12 +0530 Subject: [PATCH 034/121] Disabled context menu items for unsaved files (#12806) * disabled context menu items for unsaved files * Added JSDocs for the new functions added --- src/command/DefaultMenus.js | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/src/command/DefaultMenus.js b/src/command/DefaultMenus.js index 17f66609b2b..c449437b78a 100644 --- a/src/command/DefaultMenus.js +++ b/src/command/DefaultMenus.js @@ -30,7 +30,37 @@ define(function (require, exports, module) { var AppInit = require("utils/AppInit"), Commands = require("command/Commands"), Menus = require("command/Menus"), - Strings = require("strings"); + Strings = require("strings"), + MainViewManager = require("view/MainViewManager"), + CommandManager = require("command/CommandManager"); + + /** + * Disables menu items present in items if enabled is true. + * enabled is true if file is saved and present on user system. + * @param {boolean} enabled + * @param {array} items + */ + function _setContextMenuItemsVisible(enabled, items) { + items.forEach(function (item) { + CommandManager.get(item).setEnabled(enabled); + }); + } + + /** + * Checks if file saved and present on system and + * disables menu items accordingly + */ + function _setMenuItemsVisible() { + var file = MainViewManager.getCurrentlyViewedFile(MainViewManager.ACTIVE_PANE); + if (file) { + file.exists(function (err, isPresent) { + if (err) { + return err; + } + _setContextMenuItemsVisible(isPresent, [Commands.FILE_RENAME, Commands.NAVIGATE_SHOW_IN_FILE_TREE, Commands.NAVIGATE_SHOW_IN_OS]); + }); + } + } AppInit.htmlReady(function () { /* @@ -340,5 +370,9 @@ define(function (require, exports, module) { $(this).addClass("open"); } }); + // Check the visibility of context menu items before opening the context menu. + // 'Rename', 'Show in file tree' and 'Show in explorer' items will be disabled for files that have not yet been saved to disk. + Menus.getContextMenu(Menus.ContextMenuIds.WORKING_SET_CONTEXT_MENU).on("beforeContextMenuOpen", _setMenuItemsVisible); + Menus.getContextMenu(Menus.ContextMenuIds.PROJECT_MENU).on("beforeContextMenuOpen", _setMenuItemsVisible); }); }); From 8dc4e617534f64e51388824532828fe95e152d70 Mon Sep 17 00:00:00 2001 From: Martin Zagora Date: Thu, 2 Mar 2017 12:19:24 +1100 Subject: [PATCH 035/121] use .js instead of .json so we can use comments --- .eslintrc.json => .eslintrc.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename .eslintrc.json => .eslintrc.js (98%) diff --git a/.eslintrc.json b/.eslintrc.js similarity index 98% rename from .eslintrc.json rename to .eslintrc.js index 16b5f74189a..dc1e0035fdc 100644 --- a/.eslintrc.json +++ b/.eslintrc.js @@ -1,4 +1,4 @@ -{ +module.exports = { "rules": { "no-bitwise": 2, "curly": 2, @@ -66,4 +66,4 @@ "Uint32Array": false, "WebSocket": false } -} +}; From 69723722529da617fd40f40ac6ed0488d2ae279a Mon Sep 17 00:00:00 2001 From: Martin Zagora Date: Thu, 2 Mar 2017 12:19:58 +1100 Subject: [PATCH 036/121] add no-else-return warning --- .eslintrc.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.eslintrc.js b/.eslintrc.js index dc1e0035fdc..f05d0cd2ed4 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -47,7 +47,11 @@ module.exports = { "no-trailing-spaces": 0, "eol-last": 0, - "max-len": [1, 120] + "max-len": [1, 120], + + // the rules below should be sorted in a same way they are sorted on http://eslint.org/docs/rules page + // http://eslint.org/docs/rules/#best-practices + "no-else-return": 1 }, "globals": { "brackets": false, From a5cd2e7d8acda2d043b5f0b02a2e5c4c38547011 Mon Sep 17 00:00:00 2001 From: Martin Zagora Date: Thu, 2 Mar 2017 12:20:25 +1100 Subject: [PATCH 037/121] add grunt eslint script to package.json --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 13b7760f1f4..b6c3764db47 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,8 @@ }, "scripts": { "postinstall": "grunt install", - "test": "grunt cla-check-pull test" + "test": "grunt cla-check-pull test", + "eslint": "grunt eslint" }, "licenses": [ { From c5cf0d5d8ef1c452b6d5e091e0e7421205bce875 Mon Sep 17 00:00:00 2001 From: Martin Zagora Date: Thu, 2 Mar 2017 12:48:32 +1100 Subject: [PATCH 038/121] sort the rules in eslint config --- .eslintrc.js | 96 ++++++++++++++++++++++++++-------------------------- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index f05d0cd2ed4..67de082dafc 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,11 +1,44 @@ module.exports = { "rules": { - "no-bitwise": 2, + // the rules below should be sorted in a same way they are sorted on http://eslint.org/docs/rules page + // http://eslint.org/docs/rules/#possible-errors + "no-caller": 2, + "no-control-regex": 2, + "no-empty": 1, + "no-invalid-regexp": 2, + "no-regex-spaces": 2, + "valid-jsdoc": 0, + "valid-typeof": 2, + // http://eslint.org/docs/rules/#best-practices "curly": 2, - "eqeqeq": 2, + "eqeqeq": [2, "smart"], "guard-for-in": 0, + "no-else-return": 1, + "no-fallthrough": 2, + "no-invalid-this": 1, + "no-iterator": 2, + "no-loop-func": 2, + "no-multi-str": 2, + "no-new-func": 2, + "no-new-wrappers": 2, + "no-new": 2, + "no-proto": 2, + "no-script-url": 2, "wrap-iife": [2, "outside"], + // http://eslint.org/docs/rules/#strict-mode + "strict": 2, + // http://eslint.org/docs/rules/#variables + "no-shadow-restricted-names": 2, + "no-shadow": 1, + "no-undef": 2, + "no-unused-vars": [1, {"vars": "all", "args": "none"}], "no-use-before-define": 0, + // http://eslint.org/docs/rules/#nodejs-and-commonjs + "no-new-require": 2, + // http://eslint.org/docs/rules/#stylistic-issues + "eol-last": 1, + "indent": [1, 4], + "max-len": [1, 120], "new-cap": [0, { "capIsNewExceptions": [ "$.Deferred", @@ -14,60 +47,27 @@ module.exports = { "Immutable.Map", "Immutable.List", "JSLINT" - ]}], - "no-caller": 2, - "no-empty": 0, - "no-new": 2, - "no-invalid-regexp": 2, - "no-control-regex": 2, - "no-regex-spaces": 2, - "no-undef": 2, - "strict": 2, - "no-unused-vars": [0, {"vars": "all", "args": "none"}], - "semi": 2, - - "no-iterator": 2, - "no-loop-func": 2, - "no-multi-str": 2, - "no-fallthrough": 2, - "no-proto": 2, - "no-script-url": 2, - "no-shadow": 0, - "no-shadow-restricted-names": 2, - "no-new-func": 2, - "no-new-wrappers": 2, - "no-new-require": 2, + ] + }], "new-parens": 2, + "no-bitwise": 2, "no-new-object": 2, - "no-invalid-this": 0, - "indent": [0, 4], - - "valid-jsdoc": 0, - "valid-typeof": 2, - - "no-trailing-spaces": 0, - "eol-last": 0, - "max-len": [1, 120], - - // the rules below should be sorted in a same way they are sorted on http://eslint.org/docs/rules page - // http://eslint.org/docs/rules/#best-practices - "no-else-return": 1 + "no-trailing-spaces": 1, + "semi-spacing": 1, + "semi": 2 }, "globals": { - "brackets": false, - - "require": false, - "define": false, "$": false, - - "window": false, + "brackets": false, + "clearTimeout": false, "console": false, + "define": false, + "require": false, "setTimeout": false, - "clearTimeout": false, - + "window": false, "ArrayBuffer": false, - "XMLHttpRequest": false, "Uint32Array": false, - "WebSocket": false + "WebSocket": false, + "XMLHttpRequest": false } }; From 6ef33edb3ab79f79db67e04b4cb51ccbc0d0198e Mon Sep 17 00:00:00 2001 From: Saurabh Kathpalia Date: Thu, 2 Mar 2017 09:31:30 +0530 Subject: [PATCH 039/121] Changed name of variable searchTimeOut to searchTimeoutID --- src/extensibility/ExtensionManagerDialog.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/extensibility/ExtensionManagerDialog.js b/src/extensibility/ExtensionManagerDialog.js index 2df8249bc29..315e428799a 100644 --- a/src/extensibility/ExtensionManagerDialog.js +++ b/src/extensibility/ExtensionManagerDialog.js @@ -459,11 +459,11 @@ define(function (require, exports, module) { }); // Filter the views when the user types in the search field. - var searchTimeOut = 0; + var searchTimeoutID; $dlg.on("input", ".search", function (e) { - clearTimeout(searchTimeOut); + clearTimeout(searchTimeoutID); var query = $(this).val(); - searchTimeOut = setTimeout(function () { + searchTimeoutID = setTimeout(function () { views[_activeTabIndex].filter(query); $modalDlg.scrollTop(0); }, 200); From 526baa4360d5a17d6728aa88edc11b339daac6b4 Mon Sep 17 00:00:00 2001 From: Saurabh Kathpalia Date: Thu, 2 Mar 2017 11:46:20 +0530 Subject: [PATCH 040/121] Fixed #9642 - Added extension to the filename in SaveAs Dialog for Untitled files using the language specified in language Switcher (#13137) --- src/document/DocumentCommandHandlers.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/document/DocumentCommandHandlers.js b/src/document/DocumentCommandHandlers.js index ed718566d11..49f9d4bdb76 100644 --- a/src/document/DocumentCommandHandlers.js +++ b/src/document/DocumentCommandHandlers.js @@ -55,6 +55,7 @@ define(function (require, exports, module) { UrlParams = require("utils/UrlParams").UrlParams, StatusBar = require("widgets/StatusBar"), WorkspaceManager = require("view/WorkspaceManager"), + LanguageManager = require("language/LanguageManager"), _ = require("thirdparty/lodash"); /** @@ -952,6 +953,16 @@ define(function (require, exports, module) { saveAsDefaultPath = FileUtils.getDirectoryPath(origPath); } defaultName = FileUtils.getBaseName(origPath); + var file = FileSystem.getFileForPath(origPath); + if (file instanceof InMemoryFile) { + var language = LanguageManager.getLanguageForPath(origPath); + if (language) { + var fileExtensions = language.getFileExtensions(); + if (fileExtensions && fileExtensions.length > 0) { + defaultName += "." + fileExtensions[0]; + } + } + } FileSystem.showSaveDialog(Strings.SAVE_FILE_AS, saveAsDefaultPath, defaultName, function (err, selectedPath) { if (!err) { if (selectedPath) { From 9dded4aa7063150f151f37f65fbd4630a86810d3 Mon Sep 17 00:00:00 2001 From: 39bit Date: Thu, 2 Mar 2017 17:32:18 +0200 Subject: [PATCH 041/121] Update Finnish strings.js for (current) 1.9 --- src/nls/fi/strings.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/nls/fi/strings.js b/src/nls/fi/strings.js index 984392b3819..291d60aac75 100644 --- a/src/nls/fi/strings.js +++ b/src/nls/fi/strings.js @@ -31,7 +31,7 @@ define({ "GENERIC_ERROR" : "(virhe {0})", "NOT_FOUND_ERR" : "Tiedostoa tai hakemistoa ei löytynyt.", "NOT_READABLE_ERR" : "Tiedostoa tai hakemistoa ei voitu lukea.", - "EXCEEDS_MAX_FILE_SIZE" : "Yli {0} Mt:n tiedostoja ei voi voi avata {APP_NAME}issa.", + "EXCEEDS_MAX_FILE_SIZE" : "Yli {0} Mt:n tiedostoja ei voi avata {APP_NAME}issa.", "NO_MODIFICATION_ALLOWED_ERR" : "Kohdehakemistoa ei voi muuttaa.", "NO_MODIFICATION_ALLOWED_ERR_FILE" : "Sinulla ei ole oikeuksia tehdä muutoksia.", "CONTENTS_MODIFIED_ERR" : "Tiedostoa on muokattu {APP_NAME}in ulkopuolella.", @@ -154,6 +154,7 @@ define({ "FIND_QUERY_PLACEHOLDER" : "Etsi\u2026", "REPLACE_PLACEHOLDER" : "Korvaa merkkijonolla\u2026", "BUTTON_REPLACE_ALL" : "Kaikki\u2026", + "BUTTON_REPLACE_BATCH" : "Sarja\u2026", "BUTTON_REPLACE_ALL_IN_FILES" : "Korvaa\u2026", "BUTTON_REPLACE" : "Korvaa", "BUTTON_NEXT" : "\u25B6", @@ -418,6 +419,7 @@ define({ "CMD_SHOW_IN_EXPLORER" : "Näytä Resurssienhallinnassa", "CMD_SHOW_IN_FINDER" : "Näytä Finderissä", "CMD_SHOW_IN_OS" : "Näytä käyttöjärjestelmässä", + "CMD_SWITCH_PANE_FOCUS" : "Vaihda aktiivinen paneeli", // Help menu commands "HELP_MENU" : "Ohje", @@ -501,6 +503,7 @@ define({ "INSTALL_CANCELED" : "Asennus on peruutettu.", "VIEW_COMPLETE_DESCRIPTION" : "Näytä täysi kuvaus", "VIEW_TRUNCATED_DESCRIPTION" : "Näytä katkaistu kuvaus", + "SORT_EXTENSION_METHOD" : "Lajittele laajennukset käyttäen latausmäärää tai päivityspäivämäärää", // These must match the error codes in ExtensionsDomain.Errors.* : "INVALID_ZIP_FILE" : "Ladattu sisältö ei ole kelvollinen zip-tiedosto.", "MISSING_PACKAGE_JSON" : "Paketissa ei ole tiedostoa package.json.", @@ -511,6 +514,7 @@ define({ "INVALID_VERSION_NUMBER" : "Paketin versionumero ({0}) on virheellinen.", "INVALID_BRACKETS_VERSION" : "{APP_NAME}in yhteensopivuuden merkkijono ({0}) on virheellinen.", "DISALLOWED_WORDS" : "Sanat ({1}) eivät ole sallittuja kentässä {0}.", + "NPM_INSTALL_FAILED" : "npm install -komento epäonnistui: {0}", "API_NOT_COMPATIBLE" : "Laajennus ei ole yhteensopiva tämän {APP_NAME}-version kanssa. Se asennettiin käytöstä poistettujen laajennusten kansioon.", "MISSING_MAIN" : "Paketissa ei ole tiedostoa main.js.", "EXTENSION_ALREADY_INSTALLED" : "Tämän paketin asennus korvaa aiemmin asennetun laajennuksen. Korvataanko vanha laajennus?", @@ -577,6 +581,9 @@ define({ "EXTENSIONS_AVAILABLE_TITLE" : "Saatavilla", "EXTENSIONS_THEMES_TITLE" : "Teemat", "EXTENSIONS_UPDATES_TITLE" : "Päivitykset", + "EXTENSIONS_SORT_BY" : "Lajittele", + "EXTENSIONS_LAST_UPDATED" : "Päivitetty", + "EXTENSIONS_DOWNLOADS" : "Latausmäärä", "INLINE_EDITOR_NO_MATCHES" : "Vastineita ei saatavilla.", "INLINE_EDITOR_HIDDEN_MATCHES" : "Kaikki vastineet on pienennetty. Laajenna oikealla listatut tiedostot, niin näet vastineet.", @@ -788,6 +795,7 @@ define({ "DESCRIPTION_PURE_CODING_SURFACE" : "true: ota vain koodi -näkymä käyttöön ja piilota muut {APP_NAME}in käyttöliittymäelementit", "DESCRIPTION_INDENT_LINE_COMMENT" : "true: ota rivikommenttien sisennys käyttöön", "DESCRIPTION_RECENT_FILES_NAV" : "Ota viimeaikaisiin tiedostoihin siirtyminen käyttöön tai poista se käytöstä" + "DESCRIPTION_LIVEDEV_WEBSOCKET_PORT" : "WebSocket-palvelimen käyttämä portti esikatselua varten" }); -/* Last translated for 4be34b641c5f0209c596c7b03eb03b464d4a53c4 */ +/* Last translated for 2954858128883a7bbd2a0488be4ee88fc8a07981 */ From a5253e7d55f92e1572032227bd06a69f43b754f0 Mon Sep 17 00:00:00 2001 From: nyteksf Date: Thu, 2 Mar 2017 17:30:44 -0800 Subject: [PATCH 042/121] #11801 - Added @ficristo's Changes: Exposed RegExp To Be Used On HTML --- src/htmlContent/themes-settings.html | 2 +- src/view/ThemeSettings.js | 15 +++++++++------ src/view/ViewCommandHandlers.js | 21 ++++++++++++--------- 3 files changed, 22 insertions(+), 16 deletions(-) diff --git a/src/htmlContent/themes-settings.html b/src/htmlContent/themes-settings.html index c5eed6c57ec..13f65bc6e3f 100644 --- a/src/htmlContent/themes-settings.html +++ b/src/htmlContent/themes-settings.html @@ -30,7 +30,7 @@

    {{Strings.THEMES_SETTINGS}}

    - +
    diff --git a/src/view/ThemeSettings.js b/src/view/ThemeSettings.js index 4b21f67695f..045f2211e4e 100644 --- a/src/view/ThemeSettings.js +++ b/src/view/ThemeSettings.js @@ -68,9 +68,10 @@ define(function (require, exports, module) { result.fontFamily = ViewCommandHandlers.getFontFamily(); result.fontSize = ViewCommandHandlers.getFontSize(); + result.validFontSizeRegExp = ViewCommandHandlers.validFontSizeRegExp; return result; } - + var validFontSizeRegExp = ViewCommandHandlers.validFontSizeRegExp; /** * Opens the settings dialog */ @@ -81,7 +82,7 @@ define(function (require, exports, module) { var template = $("
    ").append($settings).html(); var $template = $(Mustache.render(template, {"settings": currentSettings, "themes": themes, "Strings": Strings})); - // Select the correct theme. +// Select the correct theme. var $currentThemeOption = $template .find("[value='" + currentSettings.theme + "']"); @@ -100,13 +101,15 @@ define(function (require, exports, module) { var attr = $target.attr("data-target"); newSettings[attr] = $target.is(":checked"); }) - .on("input", "[data-target='fontSize']", function () { + .on("input", "[data-target='fontSize']", function () { var target = this; var targetValue = $(this).val(); var $btn = $("#theme-settings-done-btn")[0]; - - // Make sure that the font size is expressed in terms we can handle (px or em). If not, 'done' button is disabled until input has been corrected. - + + // Make sure that the font size is expressed in terms + // we can handle (px or em). If not, 'done' button is + // disabled until input has been corrected. + if (target.checkValidity() === true) { $btn.disabled = false; newSettings["fontSize"] = targetValue; diff --git a/src/view/ViewCommandHandlers.js b/src/view/ViewCommandHandlers.js index 15bb311a491..8baa06d103e 100644 --- a/src/view/ViewCommandHandlers.js +++ b/src/view/ViewCommandHandlers.js @@ -295,16 +295,19 @@ define(function (require, exports, module) { * @param {number} adjustment Negative number to make the font smaller; positive number to make it bigger * @return {boolean} true if adjustment occurred, false if it did not occur */ - function _adjustFontSize(adjustment) { - var fsStyle = prefs.get("fontSize"), - validFont = /^[\d\.]+(px|em)$/; - - // Make sure that the font size is expressed in terms we can handle (px or em). If not, simply bail. - if (fsStyle.search(validFont) === -1) { + var validFontSizeRegExpStr = "^[0-9.]+(px|em)$"; // Need RegExp string to be exported for compatibility with HTML5 pattern attribute. + function _adjustFontSize(adjustment) { + var fsStyle = prefs.get("fontSize"); + var validFontSizeRegExp = new RegExp(validFontSizeRegExpStr); + + // Make sure that the font size is expressed in terms we can + // handle (px or em). If not, simply bail. + + if (fsStyle.search(validFontSizeRegExp) === -1) { return false; } - // Guaranteed to work by the validation above. + // Guaranteed to work by validation above. var fsUnits = fsStyle.substring(fsStyle.length - 2, fsStyle.length), delta = fsUnits === "px" ? 1 : 0.1, fsOld = parseFloat(fsStyle.substring(0, fsStyle.length - 2)), @@ -532,7 +535,6 @@ define(function (require, exports, module) { // Update UI when Brackets finishes loading AppInit.appReady(init); - EventDispatcher.makeEventDispatcher(exports); exports.restoreFontSize = restoreFontSize; @@ -541,4 +543,5 @@ define(function (require, exports, module) { exports.setFontSize = setFontSize; exports.getFontFamily = getFontFamily; exports.setFontFamily = setFontFamily; -}); + exports.validFontSizeRegExp = validFontSizeRegExpStr; +}); From 8839926d0ae41930521e92850bc20cae4704a480 Mon Sep 17 00:00:00 2001 From: nyteksf Date: Thu, 2 Mar 2017 18:20:07 -0800 Subject: [PATCH 043/121] #11801 - Added @zaggino's Stylistic Changes --- src/htmlContent/themes-settings.html | 2 +- src/view/ThemeSettings.js | 11 +++++++++-- src/view/ViewCommandHandlers.js | 9 +++++++-- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/htmlContent/themes-settings.html b/src/htmlContent/themes-settings.html index 13f65bc6e3f..9a6b084da07 100644 --- a/src/htmlContent/themes-settings.html +++ b/src/htmlContent/themes-settings.html @@ -30,7 +30,7 @@

    {{Strings.THEMES_SETTINGS}}

    - +
    diff --git a/src/view/ThemeSettings.js b/src/view/ThemeSettings.js index 045f2211e4e..8d1518800d7 100644 --- a/src/view/ThemeSettings.js +++ b/src/view/ThemeSettings.js @@ -32,6 +32,13 @@ define(function (require, exports, module) { settingsTemplate = require("text!htmlContent/themes-settings.html"), PreferencesManager = require("preferences/PreferencesManager"), prefs = PreferencesManager.getExtensionPrefs("themes"); + + + /** + * RegExp used to ensure Font Size is of valid format + */ + var validFontSizeRegExp = ViewCommandHandlers.validFontSizeRegExp; + /** * @type {Object} @@ -71,7 +78,7 @@ define(function (require, exports, module) { result.validFontSizeRegExp = ViewCommandHandlers.validFontSizeRegExp; return result; } - var validFontSizeRegExp = ViewCommandHandlers.validFontSizeRegExp; + /** * Opens the settings dialog */ @@ -82,7 +89,7 @@ define(function (require, exports, module) { var template = $("
    ").append($settings).html(); var $template = $(Mustache.render(template, {"settings": currentSettings, "themes": themes, "Strings": Strings})); -// Select the correct theme. + // Select the correct theme. var $currentThemeOption = $template .find("[value='" + currentSettings.theme + "']"); diff --git a/src/view/ViewCommandHandlers.js b/src/view/ViewCommandHandlers.js index 8baa06d103e..2a637299e53 100644 --- a/src/view/ViewCommandHandlers.js +++ b/src/view/ViewCommandHandlers.js @@ -45,7 +45,13 @@ define(function (require, exports, module) { _ = require("thirdparty/lodash"); var prefs = PreferencesManager.getExtensionPrefs("fonts"); - + + + /** + * Font sizes should be validated by this regexp + */ + var validFontSizeRegExpStr = "^[0-9.]+(px|em)$"; + // Need RegExp as a string to be exported for use with HTML5 pattern attribute /** * @private @@ -295,7 +301,6 @@ define(function (require, exports, module) { * @param {number} adjustment Negative number to make the font smaller; positive number to make it bigger * @return {boolean} true if adjustment occurred, false if it did not occur */ - var validFontSizeRegExpStr = "^[0-9.]+(px|em)$"; // Need RegExp string to be exported for compatibility with HTML5 pattern attribute. function _adjustFontSize(adjustment) { var fsStyle = prefs.get("fontSize"); var validFontSizeRegExp = new RegExp(validFontSizeRegExpStr); From fdfdcc569b22feefad97232690816dbfdeed0dc1 Mon Sep 17 00:00:00 2001 From: nyteksf Date: Thu, 2 Mar 2017 21:11:47 -0800 Subject: [PATCH 044/121] #11801 - Trimmed Edge Cases From Font Size Validating RegExp --- src/view/ViewCommandHandlers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/view/ViewCommandHandlers.js b/src/view/ViewCommandHandlers.js index 2a637299e53..b1c6d50a27c 100644 --- a/src/view/ViewCommandHandlers.js +++ b/src/view/ViewCommandHandlers.js @@ -50,7 +50,7 @@ define(function (require, exports, module) { /** * Font sizes should be validated by this regexp */ - var validFontSizeRegExpStr = "^[0-9.]+(px|em)$"; + var validFontSizeRegExpStr = "^([0-9]+)?(.[0-9]+)*(px|em)$"; // Need RegExp as a string to be exported for use with HTML5 pattern attribute /** From febb9cb44e9f8872e2ed98a2e7226f26b945c21c Mon Sep 17 00:00:00 2001 From: nyteksf Date: Thu, 2 Mar 2017 21:37:10 -0800 Subject: [PATCH 045/121] #11801 - Corrected Format Of RegExp --- src/view/ViewCommandHandlers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/view/ViewCommandHandlers.js b/src/view/ViewCommandHandlers.js index b1c6d50a27c..0b061f1547a 100644 --- a/src/view/ViewCommandHandlers.js +++ b/src/view/ViewCommandHandlers.js @@ -50,7 +50,7 @@ define(function (require, exports, module) { /** * Font sizes should be validated by this regexp */ - var validFontSizeRegExpStr = "^([0-9]+)?(.[0-9]+)*(px|em)$"; + var validFontSizeRegExpStr = "^([0-9]+)?(\.)?([0-9]+)(px|em)$"; // Need RegExp as a string to be exported for use with HTML5 pattern attribute /** From e337dc769f1fe1b8f045e826b83e7c9c15550073 Mon Sep 17 00:00:00 2001 From: Martin Zagora Date: Fri, 3 Mar 2017 17:24:16 +1100 Subject: [PATCH 046/121] slash should be escaped --- src/view/ViewCommandHandlers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/view/ViewCommandHandlers.js b/src/view/ViewCommandHandlers.js index 0b061f1547a..95fe3cfc491 100644 --- a/src/view/ViewCommandHandlers.js +++ b/src/view/ViewCommandHandlers.js @@ -50,7 +50,7 @@ define(function (require, exports, module) { /** * Font sizes should be validated by this regexp */ - var validFontSizeRegExpStr = "^([0-9]+)?(\.)?([0-9]+)(px|em)$"; + var validFontSizeRegExpStr = "^([0-9]+)?(\\.)?([0-9]+)(px|em)$"; // Need RegExp as a string to be exported for use with HTML5 pattern attribute /** From 737f086d88cd033f8c55644960ef5b80ea5df2c4 Mon Sep 17 00:00:00 2001 From: Martin Zagora Date: Fri, 3 Mar 2017 17:27:20 +1100 Subject: [PATCH 047/121] this variable was never used --- src/view/ThemeSettings.js | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/view/ThemeSettings.js b/src/view/ThemeSettings.js index 8d1518800d7..85a9f66ed6b 100644 --- a/src/view/ThemeSettings.js +++ b/src/view/ThemeSettings.js @@ -32,13 +32,6 @@ define(function (require, exports, module) { settingsTemplate = require("text!htmlContent/themes-settings.html"), PreferencesManager = require("preferences/PreferencesManager"), prefs = PreferencesManager.getExtensionPrefs("themes"); - - - /** - * RegExp used to ensure Font Size is of valid format - */ - var validFontSizeRegExp = ViewCommandHandlers.validFontSizeRegExp; - /** * @type {Object} From dbfc1114148c067a783deb4511d7c840b6a0b7ef Mon Sep 17 00:00:00 2001 From: 39bit Date: Fri, 3 Mar 2017 18:16:49 +0200 Subject: [PATCH 048/121] update translation as per comments by @petetnt @valtlai --- src/nls/fi/strings.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/nls/fi/strings.js b/src/nls/fi/strings.js index 291d60aac75..43276317081 100644 --- a/src/nls/fi/strings.js +++ b/src/nls/fi/strings.js @@ -154,7 +154,7 @@ define({ "FIND_QUERY_PLACEHOLDER" : "Etsi\u2026", "REPLACE_PLACEHOLDER" : "Korvaa merkkijonolla\u2026", "BUTTON_REPLACE_ALL" : "Kaikki\u2026", - "BUTTON_REPLACE_BATCH" : "Sarja\u2026", + "BUTTON_REPLACE_BATCH" : "Korvaa erissä\u2026", "BUTTON_REPLACE_ALL_IN_FILES" : "Korvaa\u2026", "BUTTON_REPLACE" : "Korvaa", "BUTTON_NEXT" : "\u25B6", @@ -419,7 +419,7 @@ define({ "CMD_SHOW_IN_EXPLORER" : "Näytä Resurssienhallinnassa", "CMD_SHOW_IN_FINDER" : "Näytä Finderissä", "CMD_SHOW_IN_OS" : "Näytä käyttöjärjestelmässä", - "CMD_SWITCH_PANE_FOCUS" : "Vaihda aktiivinen paneeli", + "CMD_SWITCH_PANE_FOCUS" : "Vaihda ruudun valinta", // Help menu commands "HELP_MENU" : "Ohje", @@ -503,7 +503,7 @@ define({ "INSTALL_CANCELED" : "Asennus on peruutettu.", "VIEW_COMPLETE_DESCRIPTION" : "Näytä täysi kuvaus", "VIEW_TRUNCATED_DESCRIPTION" : "Näytä katkaistu kuvaus", - "SORT_EXTENSION_METHOD" : "Lajittele laajennukset käyttäen latausmäärää tai päivityspäivämäärää", + "SORT_EXTENSION_METHOD" : "Lajittele laajennukset latausmäärän tai päivitysajankohdan mukaan", // These must match the error codes in ExtensionsDomain.Errors.* : "INVALID_ZIP_FILE" : "Ladattu sisältö ei ole kelvollinen zip-tiedosto.", "MISSING_PACKAGE_JSON" : "Paketissa ei ole tiedostoa package.json.", @@ -514,7 +514,7 @@ define({ "INVALID_VERSION_NUMBER" : "Paketin versionumero ({0}) on virheellinen.", "INVALID_BRACKETS_VERSION" : "{APP_NAME}in yhteensopivuuden merkkijono ({0}) on virheellinen.", "DISALLOWED_WORDS" : "Sanat ({1}) eivät ole sallittuja kentässä {0}.", - "NPM_INSTALL_FAILED" : "npm install -komento epäonnistui: {0}", + "NPM_INSTALL_FAILED" : "npm install \u2011komento epäonnistui: {0}", "API_NOT_COMPATIBLE" : "Laajennus ei ole yhteensopiva tämän {APP_NAME}-version kanssa. Se asennettiin käytöstä poistettujen laajennusten kansioon.", "MISSING_MAIN" : "Paketissa ei ole tiedostoa main.js.", "EXTENSION_ALREADY_INSTALLED" : "Tämän paketin asennus korvaa aiemmin asennetun laajennuksen. Korvataanko vanha laajennus?", @@ -583,7 +583,7 @@ define({ "EXTENSIONS_UPDATES_TITLE" : "Päivitykset", "EXTENSIONS_SORT_BY" : "Lajittele", "EXTENSIONS_LAST_UPDATED" : "Päivitetty", - "EXTENSIONS_DOWNLOADS" : "Latausmäärä", + "EXTENSIONS_DOWNLOADS" : "Lataukset", "INLINE_EDITOR_NO_MATCHES" : "Vastineita ei saatavilla.", "INLINE_EDITOR_HIDDEN_MATCHES" : "Kaikki vastineet on pienennetty. Laajenna oikealla listatut tiedostot, niin näet vastineet.", @@ -789,7 +789,7 @@ define({ "DESCRIPTION_OPEN_PREFS_IN_SPLIT_VIEW" : "false: poista asetustiedoston avaaminen käytöstä jaetussa näkymässä", "DESCRIPTION_OPEN_USER_PREFS_IN_SECOND_PANE" : "false: avaa käyttäjän asetustiedosto vasemmassa tai ylemmässä ruudussa", "DESCRIPTION_MERGE_PANES_WHEN_LAST_FILE_CLOSED" : "true: yhdistä ruudut sen jälkeen, kun ruudun viimeinen tiedosto on suljettu ruudun yläosassa olevalla sulkupaikkeella", - "DESCRIPTION_SHOW_PANE_HEADER_BUTTONS" : "Valitse, milloin sulku- ja flip view -painikkeet näkyvät paneelin yläosassa", + "DESCRIPTION_SHOW_PANE_HEADER_BUTTONS" : "Valitse, milloin sulku- ja flip view -painikkeet näkyvät ruudun yläosassa", "DEFAULT_PREFERENCES_JSON_HEADER_COMMENT" : "/*\n * Tämä on vain luku -tiedosto {APP_NAME}in tukemista\n * asetuksista.\n * Käytä tätä apuna, kun muutat asetustiedostoasi\n * ”brackets.json”, joka on avattu toiseen ruutuun.\n * Lisätietoa siitä, kuinka käyttää asetuksia {APP_NAME}issa,\n * löydät verkkosivulta osoitteessa https://github.com/adobe/brackets/wiki/How-to-Use-Brackets#preferences\n */", "DEFAULT_PREFERENCES_JSON_DEFAULT" : "Oletus", "DESCRIPTION_PURE_CODING_SURFACE" : "true: ota vain koodi -näkymä käyttöön ja piilota muut {APP_NAME}in käyttöliittymäelementit", From 8cfab6e613abac31a4fb5807e621d767cd84aa14 Mon Sep 17 00:00:00 2001 From: "walf (Localization Automation)" Date: Fri, 3 Mar 2017 09:41:10 -0800 Subject: [PATCH 049/121] Updated by ALF automation. --- src/nls/fr/strings.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nls/fr/strings.js b/src/nls/fr/strings.js index 6f20e3943c7..cdf5de35f53 100644 --- a/src/nls/fr/strings.js +++ b/src/nls/fr/strings.js @@ -582,7 +582,7 @@ define({ "EXTENSIONS_THEMES_TITLE": "Thèmes", "EXTENSIONS_UPDATES_TITLE": "Mises à jour", "EXTENSIONS_SORT_BY": "Trier par", - "EXTENSIONS_LAST_UPDATED": "Last Updated", + "EXTENSIONS_LAST_UPDATED": "Dernières mises à jour", "EXTENSIONS_DOWNLOADS": "Téléchargements", "INLINE_EDITOR_NO_MATCHES": "Aucun résultat.", From 26cea37ce5731c93a39b9898637afd8e874277cb Mon Sep 17 00:00:00 2001 From: Martin Zagora Date: Sat, 4 Mar 2017 06:33:28 +1100 Subject: [PATCH 050/121] missing comma --- src/nls/fi/strings.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nls/fi/strings.js b/src/nls/fi/strings.js index 43276317081..7176a83dcea 100644 --- a/src/nls/fi/strings.js +++ b/src/nls/fi/strings.js @@ -794,7 +794,7 @@ define({ "DEFAULT_PREFERENCES_JSON_DEFAULT" : "Oletus", "DESCRIPTION_PURE_CODING_SURFACE" : "true: ota vain koodi -näkymä käyttöön ja piilota muut {APP_NAME}in käyttöliittymäelementit", "DESCRIPTION_INDENT_LINE_COMMENT" : "true: ota rivikommenttien sisennys käyttöön", - "DESCRIPTION_RECENT_FILES_NAV" : "Ota viimeaikaisiin tiedostoihin siirtyminen käyttöön tai poista se käytöstä" + "DESCRIPTION_RECENT_FILES_NAV" : "Ota viimeaikaisiin tiedostoihin siirtyminen käyttöön tai poista se käytöstä", "DESCRIPTION_LIVEDEV_WEBSOCKET_PORT" : "WebSocket-palvelimen käyttämä portti esikatselua varten" }); From 01070268c7808949c33d1937c133a85913be52cc Mon Sep 17 00:00:00 2001 From: Martin Zagora Date: Sat, 4 Mar 2017 06:35:27 +1100 Subject: [PATCH 051/121] test (eslint) should be run before cla-check-pull --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 13b7760f1f4..914085c7559 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ }, "scripts": { "postinstall": "grunt install", - "test": "grunt cla-check-pull test" + "test": "grunt test cla-check-pull" }, "licenses": [ { From b7e10c35a03856eb6e249a3412bbf964f1e3b392 Mon Sep 17 00:00:00 2001 From: Bomani McClendon Date: Sat, 4 Mar 2017 02:35:43 -0500 Subject: [PATCH 052/121] Add jQuery event to catch when the name field is toolong --- src/search/FileFilters.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/search/FileFilters.js b/src/search/FileFilters.js index 9ff936068ef..4c29a73a1a1 100644 --- a/src/search/FileFilters.js +++ b/src/search/FileFilters.js @@ -337,6 +337,12 @@ define(function (require, exports, module) { }); } + $nameField.bind('input', function () { + if ($(this).val().length > 30) { + console.log("Too long!"); + } + }); + dialog.done(function (buttonId) { if (buttonId === Dialogs.DIALOG_BTN_OK) { // Update saved filter preference From 0cbade29fe1551b35b7ea55f6c13b403562d76f7 Mon Sep 17 00:00:00 2001 From: Bomani McClendon Date: Sat, 4 Mar 2017 11:00:02 -0500 Subject: [PATCH 053/121] Adds UI for displaying character limit on the exlusions editor --- src/htmlContent/edit-filter-dialog.html | 1 + src/search/FileFilters.js | 10 +- src/styles/brackets.less | 156 ++++++++++++------------ 3 files changed, 90 insertions(+), 77 deletions(-) diff --git a/src/htmlContent/edit-filter-dialog.html b/src/htmlContent/edit-filter-dialog.html index f96c3a6fa2c..95dda518082 100644 --- a/src/htmlContent/edit-filter-dialog.html +++ b/src/htmlContent/edit-filter-dialog.html @@ -7,6 +7,7 @@

    {{Strings.FILE_FILTER_DIALOG}}

    {{{instruction}}} +
    {{Strings.FILTER_COUNTING_FILES}}
    diff --git a/src/search/FileFilters.js b/src/search/FileFilters.js index 4c29a73a1a1..47691a2988c 100644 --- a/src/search/FileFilters.js +++ b/src/search/FileFilters.js @@ -323,7 +323,8 @@ define(function (require, exports, module) { }; var dialog = Dialogs.showModalDialogUsingTemplate(Mustache.render(EditFilterTemplate, templateVars)), $nameField = dialog.getElement().find(".exclusions-name"), - $editField = dialog.getElement().find(".exclusions-editor"); + $editField = dialog.getElement().find(".exclusions-editor"), + $remainingField = dialog.getElement().find(".exclusions-name-characters-remaining"); $nameField.val(filter.name); $editField.val(filter.patterns.join("\n")).focus(); @@ -338,6 +339,13 @@ define(function (require, exports, module) { } $nameField.bind('input', function () { + var textLength = $(this).val().length; + $remainingField.text(StringUtils.format( + "Characters Remaining: {0}", + 30-textLength + )); + + Mustache.render(EditFilterTemplate, {charactersRemaining: 30 - textLength}) if ($(this).val().length > 30) { console.log("Too long!"); } diff --git a/src/styles/brackets.less b/src/styles/brackets.less index 08e4ce3df69..947f2e22f31 100644 --- a/src/styles/brackets.less +++ b/src/styles/brackets.less @@ -120,7 +120,7 @@ a, img { left: @sidebar-width; // changed dynamically via Resizer right: @main-toolbar-width; } - + .force-right-zero { right: 0; } @@ -133,7 +133,7 @@ a, img { // Make sure the bottom box-shadow goes above the editor (position: relative needed to start a new stacking group) position: relative; z-index: @z-index-brackets-toolbar; - + .dark & { border-bottom: 1px solid @dark-bc-shadow; box-shadow: 0 1px 3px @dark-bc-shadow-small; @@ -183,7 +183,7 @@ a, img { #status-file { color: @bc-text-quiet; - + .dark & { color: @dark-bc-text-quiet; } @@ -205,7 +205,7 @@ a, img { > div { &:not(.spinner) { border-left: 1px solid @bc-panel-border; - + .dark & { border-left: 1px solid @dark-bc-panel-separator; } @@ -222,12 +222,12 @@ a, img { border-right: 1px solid @bc-panel-border; padding: 0; margin: 0; - + .dark & { border-right: 1px solid @dark-bc-panel-separator; } } - + /* dropdown button styling */ .btn-status-bar { border: 0; @@ -244,7 +244,7 @@ a, img { border-radius: 0; box-shadow: none; text-shadow: none; - + &:focus { outline: 0; } @@ -258,7 +258,7 @@ a, img { right: 8px; } } - + } #status-indent > * { @@ -292,7 +292,7 @@ a, img { top: -1px; width: 6px; transition: 0.1s linear all; - + .dark & { color: @dark-bc-text; } @@ -312,7 +312,7 @@ a, img { background-color: rgba(255, 255, 255, 0); color: @bc-text; cursor: pointer; - + .dark & { color: @dark-bc-text; } @@ -409,7 +409,7 @@ a, img { } .image-guide, - .image-tip, + .image-tip, .image-scale { pointer-events: none; } @@ -527,7 +527,7 @@ a, img { &.flipview-icon-top { background-position: center 1px; } - + &.flipview-icon-right { background-position: center -18px; } @@ -580,7 +580,7 @@ a, img { } .active-pane { - + .pane-header { opacity: 1; color: @bc-menu-text; @@ -643,10 +643,10 @@ a, img { display: none; height: 200px; border-top: 1px solid @bc-panel-border; - + .dark & { background-color: @dark-bc-panel-bg; - border-top: 1px solid @dark-bc-panel-border; + border-top: 1px solid @dark-bc-panel-border; } .check-all { @@ -661,18 +661,18 @@ a, img { padding-bottom: (@base-padding / 2); z-index: @z-index-brackets-results-panel; box-shadow: inset 0 1px 0 @bc-highlight-hard, 0 -1px 3px @bc-shadow-small; - + .dark & { background-color: @dark-bc-panel-bg-promoted; border-bottom: @dark-bc-panel-separator; - box-shadow: inset 0 1px 0 @dark-bc-highlight, 0 -1px 3px @dark-bc-shadow-small; + box-shadow: inset 0 1px 0 @dark-bc-highlight, 0 -1px 3px @dark-bc-shadow-small; } - + .title { color: @bc-text; font-size: @label-font-size; font-weight: @font-weight-semibold; - + .dark & { color: @dark-bc-text; } @@ -694,7 +694,7 @@ a, img { .highlight { background: @bc-panel-bg-text-highlight; border-radius: 2px; - + .dark & { background: @dark-bc-panel-bg-text-highlight; } @@ -703,7 +703,7 @@ a, img { tr.selected td { background-color: @bc-panel-bg-selected; color: @bc-text-thin; - + .dark & { background-color: @dark-bc-panel-bg-selected; color: @dark-bc-text-thin; @@ -732,7 +732,7 @@ a, img { text-align: right; white-space: nowrap; width: 5px; - + .dark & { color: @dark-bc-text-thin-quiet; } @@ -792,8 +792,8 @@ a, img { #working-set-list-container { background: @bc-sidebar-bg; - - > div:last-child ul { + + > div:last-child ul { padding-bottom: 21px; // Adds working set bottom padding to the last UL. } } @@ -806,13 +806,13 @@ a, img { color: @project-panel-text-2; text-shadow: none; overflow: hidden; - + > span { background: @bc-sidebar-bg; position: relative; z-index: 9; } - + > div { background-color: @dark-bc-sidebar-bg; opacity: 1; @@ -863,7 +863,7 @@ a, img { .sprite-icon(0, 0, 13px, 13px, "images/split-view-icons.svg"); margin: 0 5px 0 -1px; vertical-align: -2px; - + .dark & { .sprite-icon(0, 0, 13px, 13px, "images/split-view-icons-dark.svg"); } @@ -894,13 +894,13 @@ a, img { font-size: 13px; color: @project-panel-text-2; overflow: hidden; - + .btn-alt-quiet { background-color: #47484b; - + // relative positioning plus z-index make sure that the splitview button flows under the left aligned buttons in the project pane when there are no working set files position: relative; - z-index: 9; + z-index: 9; } } @@ -922,7 +922,7 @@ a, img { min-height: 18px; vertical-align: baseline; white-space: nowrap; - + &.selected a { color: @open-working-file-name-highlight; } @@ -1049,7 +1049,7 @@ a, img { vertical-align: middle; width: @jstree-sprite-size; height: @jstree-sprite-size; - + .dark & { background-image: @dark-jstree-sprite; } @@ -1065,7 +1065,7 @@ a, img { transition: transform 190ms cubic-bezier(.01, .91, 0, .99); -webkit-filter: drop-shadow(1px 0 1px @bc-shadow); filter: drop-shadow(1px 0 1px @bc-shadow); - + .dark & { -webkit-filter: drop-shadow(1px 0 1px @dark-bc-shadow); filter: drop-shadow(1px 0 1px @dark-bc-shadow); @@ -1080,7 +1080,7 @@ a, img { transition: transform 90ms cubic-bezier(.01, .91, 0, .99); -webkit-filter: drop-shadow(1px 0 1px @bc-shadow); filter: drop-shadow(1px 0 1px @bc-shadow); - + .dark & { -webkit-filter: drop-shadow(1px 0 1px @dark-bc-shadow); filter: drop-shadow(1px 0 1px @dark-bc-shadow); @@ -1109,17 +1109,17 @@ a, img { .unicode-icon-container; color: rgba(255, 255, 255, 0.5); } - + &.dirty:before { content: "\2022"; line-height: 1em; } - + &.can-close:before { content: "\00D7"; line-height: 1.1em; } - + &.can-close:hover:before { color: rgba(255, 255, 255, 0.7); } @@ -1145,7 +1145,7 @@ a, img { cursor: default; .dark & { - background-color: @dark-bc-bg-inline-widget; + background-color: @dark-bc-bg-inline-widget; } &.animating { @@ -1189,7 +1189,7 @@ a, img { overflow: hidden; position: relative; top: 1px; - + .dark & { color: @dark-bc-text-quiet; } @@ -1226,7 +1226,7 @@ a, img { .CodeMirror-linenumbers { background-color: @bc-bg-inline-widget; - + .dark & { background-color: @dark-bc-bg-inline-widget; } @@ -1297,7 +1297,7 @@ a, img { margin-top: -@inline-triangle-size; top: 50%; .scale-x(0.9, left, top); - + .dark & { border-left: @inline-triangle-size solid @dark-bc-bg-inline-widget; } @@ -1327,7 +1327,7 @@ a, img { .dark & { color: @dark-bc-text-emphasized; } - + &.section-header { padding-left: 0; padding-bottom: 0; @@ -1342,7 +1342,7 @@ a, img { .related-file { color: @bc-text-thin-quiet; padding-left: 3px; - + .dark & { color: @dark-bc-text-thin-quiet; } @@ -1352,7 +1352,7 @@ a, img { .selected { color: @bc-text-thin; transition: color 0.1s ease-out .15s; - + .dark & { color: @dark-bc-text-thin; } @@ -1367,7 +1367,7 @@ a, img { line-height: 17px; height: 20px; padding: 10px 0 40px 50px; - + .dark & { color: @dark-bc-text-thin-quiet; } @@ -1422,11 +1422,11 @@ a, img { } .pagination-col > span:active { background-color: @bc-shadow; - + .dark & { background-color: @dark-bc-shadow; } - } + } .replace-col { .flex-item(1, 0); min-width: 120px; @@ -1510,7 +1510,7 @@ a, img { body:not(.has-appshell-menus) & { // Separator line between us and the HTML menu/titlebar above border-top: 1px solid @bc-panel-border; - + .dark & { border-top: 1px solid @dark-bc-panel-border; } @@ -1540,7 +1540,7 @@ a, img { &.no-results { border: 1px solid @bc-btn-border-error; box-shadow: inset 0 1px 0 @bc-shadow-small, 0 0 0 1px @bc-btn-border-error-glow; - + .dark & { border: 1px solid @dark-bc-btn-border-error; box-shadow: inset 0 1px 0 @dark-bc-shadow-small, 0 0 0 1px @dark-bc-btn-border-error-glow; @@ -1569,7 +1569,7 @@ a, img { padding: 3px 8px; border-radius: 0 0 3px 3px; box-shadow: 0 1px 3px @bc-shadow-small; - + .dark & { background-color: @dark-bc-error; color: @dark-bc-text-alt; @@ -1587,7 +1587,7 @@ a, img { top: 1px; right: 2px; font-size: 12px; - + .dark & { color: @dark-bc-text-thin-quiet; } @@ -1605,7 +1605,7 @@ a, img { // If scope controls are showing, force the replace controls to a second line. display: block; } - + .scope-group { display: inline-block; margin-left: 10px; @@ -1651,7 +1651,7 @@ a, img { #find-case-sensitive.active, #find-case-sensitive:active { // Make the toggle buttons' down states the same color as 'on' state to prevent a flash of different color. background-color: @bc-bg-highlight; - + .dark & { background-color: @dark-bc-bg-highlight; } @@ -1750,7 +1750,7 @@ li:hover .filter-edit-icon { .recent-filter-patterns { color: @bc-text-thin-quiet; padding-right: 52px; - + .dark & { color: @dark-bc-text-thin-quiet; } @@ -1778,12 +1778,16 @@ textarea.exclusions-editor { margin-bottom: 0; .code-font(); } +.exclusions-name-characters-remaining { + text-align: right; + padding-top: 4px; +} .exclusions-filecount { margin: 12px 0 -14px 0; padding: 4px 8px; background-color: @bc-bg-highlight; border-radius: @bc-border-radius; - + .dark & { background-color: @dark-bc-bg-highlight; } @@ -1795,11 +1799,11 @@ textarea.exclusions-editor { background-color: @cm-match-highlight; box-shadow: 0 1px 3px @bc-shadow-small; color: @match-text !important; - + .dark & { box-shadow: 0 1px 3px @dark-bc-shadow-small; } - + &.searching-current-match { background-color: @cm-current-match-highlight; } @@ -1854,7 +1858,7 @@ textarea.exclusions-editor { text-align: right; top: 12px; z-index: 9999; - + .dark & { background: @dark-bc-input-bg; color: @dark-bc-text-quiet; @@ -1868,7 +1872,7 @@ textarea.exclusions-editor { border-radius: 0 0 4px 4px; box-shadow: 0 5px 10px @bc-shadow; opacity: 0; - + .animation (autocomplete, 90ms, cubic-bezier(.01, .91, 0, .99)); -webkit-animation-fill-mode: forwards; animation-fill-mode: forwards; @@ -1877,7 +1881,7 @@ textarea.exclusions-editor { padding: 0; margin: 9px 0 0; - + z-index: @z-index-brackets-context-menu-base; .dark & { @@ -1891,7 +1895,7 @@ textarea.exclusions-editor { font-size: 11px; letter-spacing: 0.04em; line-height: 11px; - + .dark & { color: @dark-bc-text-medium; } @@ -1910,7 +1914,7 @@ textarea.exclusions-editor { &:nth-child(odd) { background-color: @bc-panel-bg-alt; - + .dark & { background-color: @dark-bc-panel-bg-alt; } @@ -1921,7 +1925,7 @@ textarea.exclusions-editor { &:hover { background-color: @bc-panel-bg-hover; - + .dark & { background-color: @dark-bc-panel-bg-hover; } @@ -1930,7 +1934,7 @@ textarea.exclusions-editor { &.highlight { background-color: @bc-bg-highlight; color: @bc-menu-text; - + .dark & { background-color: @dark-bc-bg-highlight; color: @dark-bc-menu-text; @@ -1955,7 +1959,7 @@ textarea.exclusions-editor { .quicksearch-pathmatch { color: @bc-text-medium; - + .dark & { color: @dark-bc-text-medium; } @@ -2033,7 +2037,7 @@ textarea.exclusions-editor { } } } - + &.inline { margin-left: 8px; position: relative; @@ -2060,7 +2064,7 @@ textarea.exclusions-editor { border: none; cursor: default; width: 13px; - + &.inspection-errors { cursor: pointer; } @@ -2102,7 +2106,7 @@ textarea.exclusions-editor { width: 100%; padding-left: 10px; } - + .inspector-section > td { padding-left: 5px; } @@ -2140,12 +2144,12 @@ label input { color: @bc-text-alt; box-shadow: 0 3px 9px @bc-shadow; white-space: nowrap; - + .dark & { background-color: @dark-bc-error; border-radius: 3px; color: @dark-bc-text-alt; - box-shadow: 0 3px 9px @dark-bc-shadow; + box-shadow: 0 3px 9px @dark-bc-shadow; } } .arrowAbove { @@ -2154,7 +2158,7 @@ label input { border-width: 0 10px 10px 10px; border-color: transparent transparent @bc-error transparent; border-style: solid; - + .dark & { border-color: transparent transparent @dark-bc-error transparent; } @@ -2165,7 +2169,7 @@ label input { border-width: 10px 10px 0 10px; border-color: @bc-error transparent transparent transparent; border-style: solid; - + .dark & { border-color: @dark-bc-error transparent transparent transparent; } @@ -2216,12 +2220,12 @@ label input { position: absolute; top: -1px; left: -1px; - + padding: 1px; width: 100%; height: 100%; display: none; - + cursor: copy; } @@ -2236,11 +2240,11 @@ label input { border: 1px solid @bc-primary-btn-bg; color: @bc-text-alt; text-shadow: none; - + .dark & { background: @dark-bc-primary-btn-bg; border: 1px solid @dark-bc-primary-btn-bg; - color: @dark-bc-text-alt; + color: @dark-bc-text-alt; } } From 80e79839dc0b53bd03d8c298213d22322e0eafe2 Mon Sep 17 00:00:00 2001 From: ficristo Date: Fri, 3 Mar 2017 19:02:27 +0100 Subject: [PATCH 054/121] Do not overwrite normalizeFilename of Tern --- .../JavaScriptCodeHints/tern-worker.js | 46 ++++++++++++------- 1 file changed, 29 insertions(+), 17 deletions(-) diff --git a/src/extensions/default/JavaScriptCodeHints/tern-worker.js b/src/extensions/default/JavaScriptCodeHints/tern-worker.js index fbe8d9faaca..e4694c09d3e 100644 --- a/src/extensions/default/JavaScriptCodeHints/tern-worker.js +++ b/src/extensions/default/JavaScriptCodeHints/tern-worker.js @@ -106,6 +106,13 @@ var config = {}; delete fileCallBacks[file]; } + function _getNormalizedFilename(fileName) { + if (ternServer.projectDir && fileName.indexOf(ternServer.projectDir) === -1) { + fileName = ternServer.projectDir + fileName; + } + return fileName; + } + /** * Create a new tern server. * @@ -113,8 +120,9 @@ var config = {}; * the json files in node_modules/tern/defs * @param {Array.} files - a list of filenames tern should be aware of */ - function initTernServer(env, files) { + function initTernServer(dir, env, files) { var ternOptions = { + projectDir: dir, defs: env, async: true, getFile: getFile, @@ -122,14 +130,6 @@ var config = {}; }; ternServer = new Tern.Server(ternOptions); - // Since we don't specify projectDir, Tern will "normalize" file names by - // removing any leading "/" (the default projectDir, which cannot be changed to ""). - // This is not a problem on Windows, but on Mac and Linux, it will break - // absolute paths ("/home/" to "home/", for example) - ternServer.normalizeFilename = function (name) { - return name; - }; - files.forEach(function (file) { ternServer.addFile(file); }); @@ -207,8 +207,9 @@ var config = {}; self.postMessage({type: MessageIds.TERN_JUMPTODEF_MSG, file: fileInfo.name, offset: offset}); return; } + var response = {type: MessageIds.TERN_JUMPTODEF_MSG, - file: fileInfo.name, + file: _getNormalizedFilename(fileInfo.name), resultFile: data.file, offset: offset, start: data.start, @@ -264,7 +265,7 @@ var config = {}; // Post a message back to the main thread with the completions self.postMessage({type: type, - file: fileInfo.name, + file: _getNormalizedFilename(fileInfo.name), offset: offset, properties: properties }); @@ -310,7 +311,7 @@ var config = {}; if (completions.length > 0 || !isProperty) { // Post a message back to the main thread with the completions self.postMessage({type: MessageIds.TERN_COMPLETIONS_MSG, - file: fileInfo.name, + file: _getNormalizedFilename(fileInfo.name), offset: offset, completions: completions }); @@ -544,7 +545,7 @@ var config = {}; // Post a message back to the main thread with the completions self.postMessage({type: MessageIds.TERN_CALLED_FUNC_TYPE_MSG, - file: fileInfo.name, + file: _getNormalizedFilename(fileInfo.name), offset: offset, fnType: fnType, error: error @@ -587,14 +588,24 @@ var config = {}; * @param {string} path - the path of the file */ function handlePrimePump(path) { - var fileInfo = createEmptyUpdate(path), + var fileName = path; + if (ternServer.projectDir && fileName.indexOf(ternServer.projectDir) === 0) { + fileName = fileName.slice(ternServer.projectDir.length); + } + var fileInfo = createEmptyUpdate(fileName), request = buildRequest(fileInfo, "completions", {line: 0, ch: 0}); try { ternServer.request(request, function (error, data) { + if (error) { + _log("Error returned from Tern 'completions' request: " + error); + self.postMessage({type: MessageIds.TERN_PRIME_PUMP_MSG, file: fileInfo.name, path: path}); + return; + } + // Post a message back to the main thread self.postMessage({type: MessageIds.TERN_PRIME_PUMP_MSG, - path: path + path: _getNormalizedFilename(path) }); }); } catch (e) { @@ -622,11 +633,12 @@ var config = {}; if (type === MessageIds.TERN_INIT_MSG) { - var env = request.env, + var dir = request.dir, + env = request.env, files = request.files; inferenceTimeout = request.timeout; - initTernServer(env, files); + initTernServer(dir, env, files); } else if (type === MessageIds.TERN_COMPLETIONS_MSG) { offset = request.offset; getTernHints(request.fileInfo, offset, request.isProperty); From 91a0a8157d946c9e284bb9b582988b5e6da3b425 Mon Sep 17 00:00:00 2001 From: Bomani McClendon Date: Sat, 4 Mar 2017 15:09:59 -0500 Subject: [PATCH 055/121] Changes the character count color when text is over the limit --- src/search/FileFilters.js | 13 +++++++------ src/styles/brackets.less | 3 +++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/search/FileFilters.js b/src/search/FileFilters.js index 47691a2988c..2a16e51d91a 100644 --- a/src/search/FileFilters.js +++ b/src/search/FileFilters.js @@ -339,15 +339,16 @@ define(function (require, exports, module) { } $nameField.bind('input', function () { - var textLength = $(this).val().length; + var remainingCharacters = 10 - $(this).val().length; $remainingField.text(StringUtils.format( - "Characters Remaining: {0}", - 30-textLength + "{0} characters remaining", + remainingCharacters )); - Mustache.render(EditFilterTemplate, {charactersRemaining: 30 - textLength}) - if ($(this).val().length > 30) { - console.log("Too long!"); + if (remainingCharacters < 0) { + $remainingField.addClass("exclusions-name-characters-limit-reached"); + } else { + $remainingField.removeClass("exclusions-name-characters-limit-reached"); } }); diff --git a/src/styles/brackets.less b/src/styles/brackets.less index 947f2e22f31..3a59a24c356 100644 --- a/src/styles/brackets.less +++ b/src/styles/brackets.less @@ -1782,6 +1782,9 @@ textarea.exclusions-editor { text-align: right; padding-top: 4px; } +.exclusions-name-characters-limit-reached { + color: red; +} .exclusions-filecount { margin: 12px 0 -14px 0; padding: 4px 8px; From af71ac26a71d52af9dec4807549b1e33d5e67b01 Mon Sep 17 00:00:00 2001 From: Bomani McClendon Date: Sat, 4 Mar 2017 18:45:09 -0500 Subject: [PATCH 056/121] Adds NLS root string for copy --- src/nls/root/strings.js | 1 + src/search/FileFilters.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/nls/root/strings.js b/src/nls/root/strings.js index 6e15cfaf9f8..ec3ebd1a41c 100644 --- a/src/nls/root/strings.js +++ b/src/nls/root/strings.js @@ -210,6 +210,7 @@ define({ "FILE_FILTER_DIALOG" : "Edit Exclusion Set", "FILE_FILTER_INSTRUCTIONS" : "Exclude files and folders matching any of the following strings / substrings or wildcards. Enter each string on a new line.", "FILTER_NAME_PLACEHOLDER" : "Name this exclusion set (optional)", + "FILTER_NAME_REMAINING" : "{0} characters remaining", "FILE_FILTER_CLIPPED_SUFFIX" : "and {0} more", "FILTER_COUNTING_FILES" : "Counting files\u2026", "FILTER_FILE_COUNT" : "Allows {0} of {1} files {2}", diff --git a/src/search/FileFilters.js b/src/search/FileFilters.js index 2a16e51d91a..9e4c2a32d06 100644 --- a/src/search/FileFilters.js +++ b/src/search/FileFilters.js @@ -341,7 +341,7 @@ define(function (require, exports, module) { $nameField.bind('input', function () { var remainingCharacters = 10 - $(this).val().length; $remainingField.text(StringUtils.format( - "{0} characters remaining", + Strings.FILTER_NAME_REMAINING, remainingCharacters )); From a45ba7ca4a544c634f0a4ffbab7fff0586050e90 Mon Sep 17 00:00:00 2001 From: Bomani McClendon Date: Sat, 4 Mar 2017 19:05:38 -0500 Subject: [PATCH 057/121] Limits the length of the name to the specific number of characters --- src/search/FileFilters.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/search/FileFilters.js b/src/search/FileFilters.js index 9e4c2a32d06..2ed1a68cd4d 100644 --- a/src/search/FileFilters.js +++ b/src/search/FileFilters.js @@ -355,7 +355,7 @@ define(function (require, exports, module) { dialog.done(function (buttonId) { if (buttonId === Dialogs.DIALOG_BTN_OK) { // Update saved filter preference - setActiveFilter({ name: $nameField.val(), patterns: getValue() }, index); + setActiveFilter({ name: $nameField.val().substr(0, 10), patterns: getValue() }, index); _updatePicker(); _doPopulate(); } From b53481380658487da2f17df603b29a0bd3c1f5c6 Mon Sep 17 00:00:00 2001 From: Bomani McClendon Date: Sun, 5 Mar 2017 09:20:16 -0500 Subject: [PATCH 058/121] Added constant value for the character limit max --- src/search/FileFilters.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/search/FileFilters.js b/src/search/FileFilters.js index 2ed1a68cd4d..0de66a7b912 100644 --- a/src/search/FileFilters.js +++ b/src/search/FileFilters.js @@ -45,6 +45,12 @@ define(function (require, exports, module) { */ var FIRST_FILTER_INDEX = 3; + /** + * Constant: max number of characters for the filter name + * @type {number} + */ + var FILTER_NAME_CHARACTER_MAX = 20; + /** * Context Info on which files the filter will be applied to. * It will be initialized when createFilterPicker is called and if specified, editing UI will @@ -339,7 +345,7 @@ define(function (require, exports, module) { } $nameField.bind('input', function () { - var remainingCharacters = 10 - $(this).val().length; + var remainingCharacters = FILTER_NAME_CHARACTER_MAX - $(this).val().length; $remainingField.text(StringUtils.format( Strings.FILTER_NAME_REMAINING, remainingCharacters @@ -355,7 +361,7 @@ define(function (require, exports, module) { dialog.done(function (buttonId) { if (buttonId === Dialogs.DIALOG_BTN_OK) { // Update saved filter preference - setActiveFilter({ name: $nameField.val().substr(0, 10), patterns: getValue() }, index); + setActiveFilter({ name: $nameField.val().substr(0, FILTER_NAME_CHARACTER_MAX), patterns: getValue() }, index); _updatePicker(); _doPopulate(); } From 508e38f8d9c46de496065e334c009709420c501d Mon Sep 17 00:00:00 2001 From: nyteksf Date: Sun, 5 Mar 2017 15:15:01 -0800 Subject: [PATCH 059/121] #7723 - Beginning to put together patch --- .../Getting Started/coloreditortesting.css | 3 ++ .../default/InlineColorEditor/ColorEditor.js | 49 +++++++++++++++++-- .../ColorEditorTemplate.html | 1 + src/nls/root/strings.js | 1 + src/utils/ColorUtils.js | 4 +- 5 files changed, 52 insertions(+), 6 deletions(-) create mode 100644 samples/root/Getting Started/coloreditortesting.css diff --git a/samples/root/Getting Started/coloreditortesting.css b/samples/root/Getting Started/coloreditortesting.css new file mode 100644 index 00000000000..e818c75836b --- /dev/null +++ b/samples/root/Getting Started/coloreditortesting.css @@ -0,0 +1,3 @@ +#object { + border: 1px solid #FFAACC 0xFFAACC; +} \ No newline at end of file diff --git a/src/extensions/default/InlineColorEditor/ColorEditor.js b/src/extensions/default/InlineColorEditor/ColorEditor.js index 79d1dee616e..787c9646259 100644 --- a/src/extensions/default/InlineColorEditor/ColorEditor.js +++ b/src/extensions/default/InlineColorEditor/ColorEditor.js @@ -64,8 +64,31 @@ define(function (require, exports, module) { this._handleHueDrag = this._handleHueDrag.bind(this); this._handleSelectionFieldDrag = this._handleSelectionFieldDrag.bind(this); - this._color = tinycolor(color); + // + //STYLING IS MESSY AND OUT OF ORDER ONLY UNTIL I GET THE BELOW WORKING: + var that = this; + //MUST CONVERT 0X TO HEX6 NOTATION AND BACK IN ORDER TO BE ABLE TO USE COLOR W/ TINYCOLOR(COLOR). TINYCOLOR DOESN'T SUPPORT 0x NOTATION! + function checkIf0xNotation(color,that){ + if((/0x/).test(color)){ //Is input in 0x Notation? + //IF YES, THEN CHANGE/UPDATE SETTINGS: + var thatColor = color.replace("0x","#") //CONVERT 0x TO HEX6, ie 0xFFAACC => #FFAACC + var that_Color = tinycolor(thatColor); //SWAPPED COLOR OUT TO RETURN RGBA VALUES INSTEAD OF _r=0, _g=0, etc. + that_Color._originalInput = that._originalColor; //RESTORE HEX6 TO 0x NOTATION INPUT FOR O.G. COLOR INPUT + that_Color._format = "0x"; //CHANGE _FORMAT TO '0x' SO THAT RESULT WORKS WITH .getFormat() et al; + return that_Color; //EXIT + }else{ + return tinycolor(color); //SIMPLY RETURN AS USUAL IF NOT + } + + } + this._originalColor = color; + this._color = checkIf0xNotation(color,this); + //console.log(this._color); + //output => tinycolor {_originalInput: "#e282a8", _r: 255, _g: 170, _b: 204, _a: 1…} -- THIS WORKS NOW, EXCEPT STILL DOES NOT CHANGE COLOR SWATCH OR MOVE COLOR SELECTOR BECAUSE SWATCHES ARE 0x NOTATION + // + // + this._redoColor = null; this._isUpperCase = PreferencesManager.get("uppercaseColors"); PreferencesManager.on("change", "uppercaseColors", function () { @@ -77,6 +100,7 @@ define(function (require, exports, module) { this.$rgbaButton = this.$element.find(".rgba"); this.$hexButton = this.$element.find(".hex"); this.$hslButton = this.$element.find(".hsla"); + this.$0xButton = this.$element.find(".0x"); this.$currentColor = this.$element.find(".current-color"); this.$originalColor = this.$element.find(".original-color"); this.$selection = this.$element.find(".color-selection-field"); @@ -88,9 +112,15 @@ define(function (require, exports, module) { this.$opacitySlider = this.$element.find(".opacity-slider"); this.$opacitySelector = this.$element.find(".opacity-slider .selector-base"); this.$swatches = this.$element.find(".swatches"); + console.log(this.$swatches); + console.log("-------------") + //ERROR: INNERHTML OF SWATCH FOR '0xFFAACC" = "
    " + //SHOULD CONVERT TO HEX // Create quick-access color swatches this._addSwatches(swatches); + console.log(swatches) + console.log("------") // Attach event listeners to main UI elements this._addListeners(); @@ -137,6 +167,7 @@ define(function (require, exports, module) { this._bindColorFormatToRadioButton("rgba"); this._bindColorFormatToRadioButton("hex"); this._bindColorFormatToRadioButton("hsla"); + this._bindColorFormatToRadioButton("0x"); this._bindInputHandlers(); @@ -228,6 +259,9 @@ define(function (require, exports, module) { case "hsl": this.$buttonList.find(".hsla").parent().addClass("selected"); break; + case "0x": + this.$buttonList.find(".0x").parent().addClass("selected"); + break; } }; @@ -254,6 +288,9 @@ define(function (require, exports, module) { newColor = colorObject.toHexString(); self._hsv.a = 1; break; + case "0x": + newColor = colorObject.toHexString(); + newColor.replace("#","0x"); } // We need to run this again whenever RGB/HSL/Hex conversions @@ -407,8 +444,9 @@ define(function (require, exports, module) { */ ColorEditor.prototype.setColorAsHsv = function (hsv) { var colorVal, newColor, - oldFormat = tinycolor(this.getColor()).getFormat(); - + oldFormat = tinycolor(this.getColor()).getFormat() || "0x"; + //IF UNDETECTABLE VIA TINYCOLORS .getFormat(), THEN FORMAT IS OF '0x' NOTATION + // Set our state to the new color $.extend(this._hsv, hsv); newColor = tinycolor(this._hsv); @@ -427,6 +465,9 @@ define(function (require, exports, module) { case "name": colorVal = this._hsv.a < 1 ? newColor.toRgbString() : newColor.toHexString(); break; + case "0x": + colorVal = newColor.toHexString().to0xString(); + //NEED TO IMPLEMENT .to0xString() method } colorVal = this._isUpperCase ? colorVal.toUpperCase() : colorVal; this._commitColor(colorVal, false); @@ -709,4 +750,4 @@ define(function (require, exports, module) { }); exports.ColorEditor = ColorEditor; -}); +}); \ No newline at end of file diff --git a/src/extensions/default/InlineColorEditor/ColorEditorTemplate.html b/src/extensions/default/InlineColorEditor/ColorEditorTemplate.html index 60566a8631e..eda86a7aa6d 100644 --- a/src/extensions/default/InlineColorEditor/ColorEditorTemplate.html +++ b/src/extensions/default/InlineColorEditor/ColorEditorTemplate.html @@ -27,6 +27,7 @@
  • RGBa
  • Hex
  • HSLa
  • +
  • 0x
  • diff --git a/src/nls/root/strings.js b/src/nls/root/strings.js index 6e15cfaf9f8..381c8baf044 100644 --- a/src/nls/root/strings.js +++ b/src/nls/root/strings.js @@ -651,6 +651,7 @@ define({ "COLOR_EDITOR_RGBA_BUTTON_TIP" : "RGBa Format", "COLOR_EDITOR_HEX_BUTTON_TIP" : "Hex Format", "COLOR_EDITOR_HSLA_BUTTON_TIP" : "HSLa Format", + "COLOR_EDITOR_0X_BUTTON_TIP" : "Hex (0x) Format", "COLOR_EDITOR_USED_COLOR_TIP_SINGULAR" : "{0} (Used {1} time)", "COLOR_EDITOR_USED_COLOR_TIP_PLURAL" : "{0} (Used {1} times)", diff --git a/src/utils/ColorUtils.js b/src/utils/ColorUtils.js index cacca39948b..12de3f3ebce 100644 --- a/src/utils/ColorUtils.js +++ b/src/utils/ColorUtils.js @@ -37,13 +37,13 @@ define(function (require, exports, module) { /** * Regular expression that matches reasonably well-formed colors in hex format (3 or 6 digits), - * rgb()/rgba() function format, hsl()/hsla() function format, + * rgb()/rgba() function format, hsl()/hsla() function format, 0x notation format, * or color name format according to CSS Color Module Level 3 (http://www.w3.org/TR/css3-color/) * or "rebeccapurple" from CSS Color Module Level 4. * @const @type {RegExp} */ // use RegExp.source of the RegExp literal to avoid doubled backslashes - var COLOR_REGEX = new RegExp(/#[a-f0-9]{6}\b|#[a-f0-9]{3}\b|\brgb\(\s*(?:[0-9]{1,2}|1[0-9]{2}|2[0-4][0-9]|25[0-5])\b\s*,\s*(?:[0-9]{1,2}|1[0-9]{2}|2[0-4][0-9]|25[0-5])\b\s*,\s*(?:[0-9]{1,2}|1[0-9]{2}|2[0-4][0-9]|25[0-5])\b\s*\)|\brgb\(\s*(?:[0-9]{1,2}%|100%)\s*,\s*(?:[0-9]{1,2}%|100%)\s*,\s*(?:[0-9]{1,2}%|100%)\s*\)|\brgba\(\s*(?:[0-9]{1,2}|1[0-9]{2}|2[0-4][0-9]|25[0-5])\b\s*,\s*(?:[0-9]{1,2}|1[0-9]{2}|2[0-4][0-9]|25[0-5])\b\s*,\s*(?:[0-9]{1,2}|1[0-9]{2}|2[0-4][0-9]|25[0-5])\b\s*,\s*(?:1|1\.0|0|0?\.[0-9]{1,3})\s*\)|\brgba\(\s*(?:[0-9]{1,2}%|100%)\s*,\s*(?:[0-9]{1,2}%|100%)\s*,\s*(?:[0-9]{1,2}%|100%)\s*,\s*(?:1|1\.0|0|0?\.[0-9]{1,3})\s*\)|\bhsl\(\s*(?:[0-9]{1,3})\b\s*,\s*(?:[0-9]{1,2}|100)\b%\s*,\s*(?:[0-9]{1,2}|100)\b%\s*\)|\bhsla\(\s*(?:[0-9]{1,3})\b\s*,\s*(?:[0-9]{1,2}|100)\b%\s*,\s*(?:[0-9]{1,2}|100)\b%\s*,\s*(?:1|1\.0|0|0?\.[0-9]{1,3})\s*\)|\b/.source + COLOR_NAMES.join("\\b|\\b") + "\\b", "gi"); + var COLOR_REGEX = new RegExp(/0x([a-f0-9]{6})\b|#[a-f0-9]{6}\b|#[a-f0-9]{3}\b|\brgb\(\s*(?:[0-9]{1,2}|1[0-9]{2}|2[0-4][0-9]|25[0-5])\b\s*,\s*(?:[0-9]{1,2}|1[0-9]{2}|2[0-4][0-9]|25[0-5])\b\s*,\s*(?:[0-9]{1,2}|1[0-9]{2}|2[0-4][0-9]|25[0-5])\b\s*\)|\brgb\(\s*(?:[0-9]{1,2}%|100%)\s*,\s*(?:[0-9]{1,2}%|100%)\s*,\s*(?:[0-9]{1,2}%|100%)\s*\)|\brgba\(\s*(?:[0-9]{1,2}|1[0-9]{2}|2[0-4][0-9]|25[0-5])\b\s*,\s*(?:[0-9]{1,2}|1[0-9]{2}|2[0-4][0-9]|25[0-5])\b\s*,\s*(?:[0-9]{1,2}|1[0-9]{2}|2[0-4][0-9]|25[0-5])\b\s*,\s*(?:1|1\.0|0|0?\.[0-9]{1,3})\s*\)|\brgba\(\s*(?:[0-9]{1,2}%|100%)\s*,\s*(?:[0-9]{1,2}%|100%)\s*,\s*(?:[0-9]{1,2}%|100%)\s*,\s*(?:1|1\.0|0|0?\.[0-9]{1,3})\s*\)|\bhsl\(\s*(?:[0-9]{1,3})\b\s*,\s*(?:[0-9]{1,2}|100)\b%\s*,\s*(?:[0-9]{1,2}|100)\b%\s*\)|\bhsla\(\s*(?:[0-9]{1,3})\b\s*,\s*(?:[0-9]{1,2}|100)\b%\s*,\s*(?:[0-9]{1,2}|100)\b%\s*,\s*(?:1|1\.0|0|0?\.[0-9]{1,3})\s*\)|\b/.source + COLOR_NAMES.join("\\b|\\b") + "\\b", "gi"); /* * Adds a color swatch to code hints where this is supported. From d4757d0394bde605ec6723219b0bf787727a4d3a Mon Sep 17 00:00:00 2001 From: ficristo Date: Mon, 6 Mar 2017 20:42:20 +0100 Subject: [PATCH 060/121] Introduce _getDenormalizedFilename and use it --- .../default/JavaScriptCodeHints/tern-worker.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/extensions/default/JavaScriptCodeHints/tern-worker.js b/src/extensions/default/JavaScriptCodeHints/tern-worker.js index e4694c09d3e..52d6d876f54 100644 --- a/src/extensions/default/JavaScriptCodeHints/tern-worker.js +++ b/src/extensions/default/JavaScriptCodeHints/tern-worker.js @@ -113,6 +113,13 @@ var config = {}; return fileName; } + function _getDenormalizedFilename(fileName) { + if (ternServer.projectDir && fileName.indexOf(ternServer.projectDir) === 0) { + fileName = fileName.slice(ternServer.projectDir.length); + } + return fileName; + } + /** * Create a new tern server. * @@ -588,10 +595,7 @@ var config = {}; * @param {string} path - the path of the file */ function handlePrimePump(path) { - var fileName = path; - if (ternServer.projectDir && fileName.indexOf(ternServer.projectDir) === 0) { - fileName = fileName.slice(ternServer.projectDir.length); - } + var fileName = _getDenormalizedFilename(path); var fileInfo = createEmptyUpdate(fileName), request = buildRequest(fileInfo, "completions", {line: 0, ch: 0}); From 8adb530f43b677e8248b739798c7be5fa0d9f596 Mon Sep 17 00:00:00 2001 From: Martin Zagora Date: Tue, 7 Mar 2017 11:42:03 +1100 Subject: [PATCH 061/121] add support for universal (language independent) code inspector --- src/language/CodeInspection.js | 19 +++++++++++++++---- test/spec/CodeInspection-test.js | 24 ++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 4 deletions(-) diff --git a/src/language/CodeInspection.js b/src/language/CodeInspection.js index e00a5e4e153..261d86ab21e 100644 --- a/src/language/CodeInspection.js +++ b/src/language/CodeInspection.js @@ -157,7 +157,7 @@ define(function (require, exports, module) { function getProvidersForPath(filePath) { var language = LanguageManager.getLanguageForPath(filePath).getId(), context = PreferencesManager._buildContext(filePath, language), - installedProviders = _providers[language], + installedProviders = getProvidersForLanguageId(language), preferredProviders, prefPreferredProviderNames = prefs.get(PREF_PREFER_PROVIDERS, context), @@ -165,9 +165,6 @@ define(function (require, exports, module) { providers; - // ensure there is an instance and that a copy is returned, always - installedProviders = (installedProviders && installedProviders.slice(0)) || []; - if (prefPreferredProviderNames && prefPreferredProviderNames.length) { if (typeof prefPreferredProviderNames === "string") { prefPreferredProviderNames = [prefPreferredProviderNames]; @@ -509,6 +506,20 @@ define(function (require, exports, module) { run(); // in case a file of this type is open currently } + /** + * Returns a list of providers registered for given languageId through register function + */ + function getProvidersForLanguageId(languageId) { + var result = []; + if (_providers[languageId]) { + result = result.concat(_providers[languageId]); + } + if (_providers['*']) { + result = result.concat(_providers['*']); + } + return result; + } + /** * Update DocumentManager listeners. */ diff --git a/test/spec/CodeInspection-test.js b/test/spec/CodeInspection-test.js index d4f6b1aafde..d28a5a5ab41 100644 --- a/test/spec/CodeInspection-test.js +++ b/test/spec/CodeInspection-test.js @@ -490,6 +490,30 @@ define(function (require, exports, module) { }); }); + it("should support universal providers", function () { + var codeInspector1 = createCodeInspector("javascript linter", successfulLintResult()); + var codeInspector2 = createCodeInspector("css linter", successfulLintResult()); + var codeInspector3 = createCodeInspector("universal linter", successfulLintResult()); + + CodeInspection.register("javascript", codeInspector1); + CodeInspection.register("css", codeInspector2); + CodeInspection.register("*", codeInspector3); + + var providers = CodeInspection.getProvidersForPath("test.js"); + expect(providers.length).toBe(2); + expect(providers[0]).toBe(codeInspector1); + expect(providers[1]).toBe(codeInspector3); + + providers = CodeInspection.getProvidersForPath("test.css"); + expect(providers.length).toBe(2); + expect(providers[0]).toBe(codeInspector2); + expect(providers[1]).toBe(codeInspector3); + + providers = CodeInspection.getProvidersForPath("test.other"); + expect(providers.length).toBe(1); + expect(providers[0]).toBe(codeInspector3); + }); + }); describe("Code Inspection UI", function () { From 84f7863b933923f0ba734f03656a509daf77879f Mon Sep 17 00:00:00 2001 From: nyteksf Date: Mon, 6 Mar 2017 17:04:47 -0800 Subject: [PATCH 062/121] #7723 - Removed my test CSS document from build --- samples/root/Getting Started/coloreditortesting.css | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 samples/root/Getting Started/coloreditortesting.css diff --git a/samples/root/Getting Started/coloreditortesting.css b/samples/root/Getting Started/coloreditortesting.css deleted file mode 100644 index e818c75836b..00000000000 --- a/samples/root/Getting Started/coloreditortesting.css +++ /dev/null @@ -1,3 +0,0 @@ -#object { - border: 1px solid #FFAACC 0xFFAACC; -} \ No newline at end of file From bd18fc1a99b01ba10017e22cc152c7d0ed57279a Mon Sep 17 00:00:00 2001 From: nyteksf Date: Mon, 6 Mar 2017 17:27:13 -0800 Subject: [PATCH 063/121] #7723 - Added missing semicolons --- .../default/InlineColorEditor/ColorEditor.js | 12 ++++++------ src/utils/ColorUtils.js | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/extensions/default/InlineColorEditor/ColorEditor.js b/src/extensions/default/InlineColorEditor/ColorEditor.js index 787c9646259..734f6c6e274 100644 --- a/src/extensions/default/InlineColorEditor/ColorEditor.js +++ b/src/extensions/default/InlineColorEditor/ColorEditor.js @@ -71,7 +71,7 @@ define(function (require, exports, module) { function checkIf0xNotation(color,that){ if((/0x/).test(color)){ //Is input in 0x Notation? //IF YES, THEN CHANGE/UPDATE SETTINGS: - var thatColor = color.replace("0x","#") //CONVERT 0x TO HEX6, ie 0xFFAACC => #FFAACC + var thatColor = color.replace("0x","#"); //CONVERT 0x TO HEX6, ie 0xFFAACC => #FFAACC var that_Color = tinycolor(thatColor); //SWAPPED COLOR OUT TO RETURN RGBA VALUES INSTEAD OF _r=0, _g=0, etc. that_Color._originalInput = that._originalColor; //RESTORE HEX6 TO 0x NOTATION INPUT FOR O.G. COLOR INPUT that_Color._format = "0x"; //CHANGE _FORMAT TO '0x' SO THAT RESULT WORKS WITH .getFormat() et al; @@ -113,14 +113,14 @@ define(function (require, exports, module) { this.$opacitySelector = this.$element.find(".opacity-slider .selector-base"); this.$swatches = this.$element.find(".swatches"); console.log(this.$swatches); - console.log("-------------") + console.log("-------------"); //ERROR: INNERHTML OF SWATCH FOR '0xFFAACC" = "
    " //SHOULD CONVERT TO HEX // Create quick-access color swatches this._addSwatches(swatches); - console.log(swatches) - console.log("------") + console.log(swatches); + console.log("------"); // Attach event listeners to main UI elements this._addListeners(); @@ -444,8 +444,8 @@ define(function (require, exports, module) { */ ColorEditor.prototype.setColorAsHsv = function (hsv) { var colorVal, newColor, - oldFormat = tinycolor(this.getColor()).getFormat() || "0x"; - //IF UNDETECTABLE VIA TINYCOLORS .getFormat(), THEN FORMAT IS OF '0x' NOTATION + oldFormat = tinycolor(this.getColor()).getFormat(); //|| "0x"; + //IF STILL UNDETECTABLE VIA TINYCOLOR .getFormat(), METHOD, THEN FORMAT IS SET TO '0x' NOTATION // Set our state to the new color $.extend(this._hsv, hsv); diff --git a/src/utils/ColorUtils.js b/src/utils/ColorUtils.js index 12de3f3ebce..04000684567 100644 --- a/src/utils/ColorUtils.js +++ b/src/utils/ColorUtils.js @@ -37,7 +37,7 @@ define(function (require, exports, module) { /** * Regular expression that matches reasonably well-formed colors in hex format (3 or 6 digits), - * rgb()/rgba() function format, hsl()/hsla() function format, 0x notation format, + * rgb()/rgba() function format, hsl()/hsla() function format, 0x notation format * or color name format according to CSS Color Module Level 3 (http://www.w3.org/TR/css3-color/) * or "rebeccapurple" from CSS Color Module Level 4. * @const @type {RegExp} From 05ee335ea588616e7952f0219a8706106cbe89c3 Mon Sep 17 00:00:00 2001 From: nyteksf Date: Mon, 6 Mar 2017 17:31:32 -0800 Subject: [PATCH 064/121] #7723 - Corrected comment --- src/extensions/default/InlineColorEditor/ColorEditor.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/extensions/default/InlineColorEditor/ColorEditor.js b/src/extensions/default/InlineColorEditor/ColorEditor.js index 734f6c6e274..25ab5a1e164 100644 --- a/src/extensions/default/InlineColorEditor/ColorEditor.js +++ b/src/extensions/default/InlineColorEditor/ColorEditor.js @@ -73,7 +73,7 @@ define(function (require, exports, module) { //IF YES, THEN CHANGE/UPDATE SETTINGS: var thatColor = color.replace("0x","#"); //CONVERT 0x TO HEX6, ie 0xFFAACC => #FFAACC var that_Color = tinycolor(thatColor); //SWAPPED COLOR OUT TO RETURN RGBA VALUES INSTEAD OF _r=0, _g=0, etc. - that_Color._originalInput = that._originalColor; //RESTORE HEX6 TO 0x NOTATION INPUT FOR O.G. COLOR INPUT + that_Color._originalInput = that._originalColor; //RESTORE HEX6 FORMAT TO 0x NOTATION FORMAT INPUT FOR ORIGINAL INPUT that_Color._format = "0x"; //CHANGE _FORMAT TO '0x' SO THAT RESULT WORKS WITH .getFormat() et al; return that_Color; //EXIT }else{ @@ -85,7 +85,7 @@ define(function (require, exports, module) { this._originalColor = color; this._color = checkIf0xNotation(color,this); //console.log(this._color); - //output => tinycolor {_originalInput: "#e282a8", _r: 255, _g: 170, _b: 204, _a: 1…} -- THIS WORKS NOW, EXCEPT STILL DOES NOT CHANGE COLOR SWATCH OR MOVE COLOR SELECTOR BECAUSE SWATCHES ARE 0x NOTATION + //output => tinycolor {_originalInput: "0xE282A8", _r: 255, _g: 170, _b: 204, _a: 1…} -- THIS WORKS NOW, EXCEPT STILL DOES NOT CHANGE COLOR SWATCH OR MOVE COLOR SELECTOR BECAUSE SWATCHES ARE 0x NOTATION // // From cf3582a0887de4e642bfd981724df99fe145bcee Mon Sep 17 00:00:00 2001 From: nyteksf Date: Mon, 6 Mar 2017 17:34:39 -0800 Subject: [PATCH 065/121] #7723 - Corrected comment --- src/extensions/default/InlineColorEditor/ColorEditor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/extensions/default/InlineColorEditor/ColorEditor.js b/src/extensions/default/InlineColorEditor/ColorEditor.js index 25ab5a1e164..4b4c7a58021 100644 --- a/src/extensions/default/InlineColorEditor/ColorEditor.js +++ b/src/extensions/default/InlineColorEditor/ColorEditor.js @@ -115,7 +115,7 @@ define(function (require, exports, module) { console.log(this.$swatches); console.log("-------------"); //ERROR: INNERHTML OF SWATCH FOR '0xFFAACC" = "
    " - //SHOULD CONVERT TO HEX + //SHOULD CONVERT TO CSS COLOR SO SWATCH WORKS? // Create quick-access color swatches this._addSwatches(swatches); From 013c8c5624c1622d2ce0efc34fe23cae044ed86e Mon Sep 17 00:00:00 2001 From: Swagatam Mitra Date: Tue, 7 Mar 2017 16:12:09 +0530 Subject: [PATCH 066/121] Address Review comments and handle dyanamic width --- src/view/ViewCommandHandlers.js | 60 +++++++++++++++++++++++++++------ 1 file changed, 50 insertions(+), 10 deletions(-) diff --git a/src/view/ViewCommandHandlers.js b/src/view/ViewCommandHandlers.js index af88bb7b3e3..a24613a3b00 100644 --- a/src/view/ViewCommandHandlers.js +++ b/src/view/ViewCommandHandlers.js @@ -72,6 +72,12 @@ define(function (require, exports, module) { * @type {string} */ var DYNAMIC_CODEHINT_FONT_STYLE_ID = "codehint-dynamic-fonts"; + + /** + * @const + * @type {string} + */ + var DYNAMIC_CODEHINT_WITH_TYPE_STYLE_ID = "codehint-with-type-dynamic-width"; /** * @const @@ -110,6 +116,14 @@ define(function (require, exports, module) { * @type {string} */ var DEFAULT_FONT_FAMILY = "'SourceCodePro-Medium', MS ゴシック, 'MS Gothic', monospace"; + + /** + * @const + * @private + * The default hint span width for hints with annotated type details + * @type {number} + */ + var DEFAULT_TYPED_HINT_SPAN_WIDTH = 300; /** * @private @@ -119,19 +133,22 @@ define(function (require, exports, module) { function _removeDynamicProperty(propertyID) { $("#" + propertyID).remove(); } - + /** * @private * Add the style property to the DOM * @param {string} propertyID Is the property ID to be added - * @param {string} name Is the name of the style property - * @param {string} value Is the value of the style - * @param {boolean} important Is a flag to make the style property !important + * @param {object} ruleCfg Is the CSS Rule configuration object + * @param {string} ruleCfg.propName Is the name of the style property + * @param {string} ruleCfg.propValue Is the value of the style property + * @param {boolean} ruleCfg.priorityFlag Is a flag to make the style property !important + * @param {string} ruleCfg.ruleName Optional Selctor name to be used for the rule + * @param {string} ruleCfg.ruleText Optional selector definition text */ - function _addDynamicProperty(propertyID, name, value, important, cssRule, cssText) { - cssRule = cssRule || ".CodeMirror"; + function _addDynamicProperty(propertyID, ruleCfg) { + var cssRule = ruleCfg.ruleName || ".CodeMirror"; var $style = $("").attr("id", propertyID); - var styleStr = cssText || StringUtils.format("{0}: {1} {2}", name, value, important ? " !important" : ""); + var styleStr = ruleCfg.ruleText || StringUtils.format("{0}: {1} {2}", ruleCfg.propName, ruleCfg.propValue, ruleCfg.priorityFlag ? "!important" : ""); $style.html(cssRule + "{ " + styleStr + " }"); // Let's make sure we remove the already existing item from the DOM. @@ -146,6 +163,7 @@ define(function (require, exports, module) { function _removeDynamicFontSize() { _removeDynamicProperty(DYNAMIC_FONT_STYLE_ID); _removeDynamicProperty(DYNAMIC_CODEHINT_FONT_STYLE_ID); + _removeDynamicProperty(DYNAMIC_CODEHINT_WITH_TYPE_STYLE_ID); } /** @@ -156,7 +174,22 @@ define(function (require, exports, module) { var styleStr = ""; styleStr = styleStr + StringUtils.format("{0}: {1} {2};", "font-size", fontSize, " !important"); styleStr = styleStr + StringUtils.format("{0}: {1} {2};", "line-height", (parseInt(fontSize, 10) + 2) + fontSize.replace(parseInt(fontSize, 10), ""), " !important"); - _addDynamicProperty(DYNAMIC_CODEHINT_FONT_STYLE_ID, "font-size", fontSize, true, ".codehint-menu .dropdown-menu li a", styleStr); + + _addDynamicProperty(DYNAMIC_CODEHINT_FONT_STYLE_ID, { + propName: "font-size", + propValue: fontSize, + priorityFlag: true, + ruleName: ".codehint-menu .dropdown-menu li a", + ruleText: styleStr + }); + + _addDynamicProperty(DYNAMIC_CODEHINT_WITH_TYPE_STYLE_ID, { + propName: "width", + propValue: DEFAULT_TYPED_HINT_SPAN_WIDTH * (parseInt(fontSize, 10) / DEFAULT_FONT_SIZE) + "px", + priorityFlag: true, + ruleName: "span.brackets-js-hints-with-type-details", + ruleText: "" + }); } /** @@ -165,7 +198,11 @@ define(function (require, exports, module) { * @param {string} fontSize A string with the font size and the size unit */ function _addDynamicFontSize(fontSize) { - _addDynamicProperty(DYNAMIC_FONT_STYLE_ID, "font-size", fontSize, true); + _addDynamicProperty(DYNAMIC_FONT_STYLE_ID, { + propName: "font-size", + propValue: fontSize, + priorityFlag: true + }); // Sync code-hint font size _addDynamicFontSizeForCodeHints(fontSize); @@ -185,7 +222,10 @@ define(function (require, exports, module) { * @param {string} fontFamily A string with the font family */ function _addDynamicFontFamily(fontFamily) { - _addDynamicProperty(DYNAMIC_FONT_FAMILY_ID, "font-family", fontFamily); + _addDynamicProperty(DYNAMIC_FONT_STYLE_ID, { + propName: "font-family", + propValue: fontFamily + }); } /** From 4dc3df07ea6b446ce10f71ff139313cc10df161e Mon Sep 17 00:00:00 2001 From: Swagatam Mitra Date: Tue, 7 Mar 2017 18:17:47 +0530 Subject: [PATCH 067/121] Dynamic hint menu height implementations to show only 8 lines of info at any font size --- .../styles/brackets-js-hints.css | 10 +++-- src/view/ViewCommandHandlers.js | 44 ++++++++++++++++++- 2 files changed, 48 insertions(+), 6 deletions(-) diff --git a/src/extensions/default/JavaScriptCodeHints/styles/brackets-js-hints.css b/src/extensions/default/JavaScriptCodeHints/styles/brackets-js-hints.css index bdf5a3a3484..9deaf8b79fc 100644 --- a/src/extensions/default/JavaScriptCodeHints/styles/brackets-js-hints.css +++ b/src/extensions/default/JavaScriptCodeHints/styles/brackets-js-hints.css @@ -149,7 +149,6 @@ span.brackets-js-hints-with-type-details { color: #d4d4d4; word-wrap: break-word; white-space: normal; - width:300px; box-sizing: border-box; } @@ -163,12 +162,15 @@ span.brackets-js-hints-with-type-details { color: grey; word-wrap: break-word; white-space: normal; - width: 300px; box-sizing: border-box; float: left; clear: left; - max-height: 3em; + max-height: 2em; overflow: hidden; + text-overflow: ellipsis; + line-height: 1em; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; } .dark .jshint-jsdoc { @@ -219,7 +221,7 @@ span.brackets-js-hints-with-type-details { } .highlight .jshint-jsdoc { - display: block; + display: -webkit-box; } .dark .brackets-js-hints-type-details { diff --git a/src/view/ViewCommandHandlers.js b/src/view/ViewCommandHandlers.js index a24613a3b00..4d71e041dd4 100644 --- a/src/view/ViewCommandHandlers.js +++ b/src/view/ViewCommandHandlers.js @@ -78,6 +78,12 @@ define(function (require, exports, module) { * @type {string} */ var DYNAMIC_CODEHINT_WITH_TYPE_STYLE_ID = "codehint-with-type-dynamic-width"; + + /** + * @const + * @type {string} + */ + var DYNAMIC_CODEHINT_HEIGHT_STYLE_ID = "codehint-dynamic-height"; /** * @const @@ -124,6 +130,30 @@ define(function (require, exports, module) { * @type {number} */ var DEFAULT_TYPED_HINT_SPAN_WIDTH = 300; + + /** + * @const + * @private + * The default hint menu max-height + * @type {number} + */ + var DEFAULT_HINT_MENU_HEIGHT = 160; + + /** + * @const + * @private + * The default hint menu item line height offset + * @type {number} + */ + var DEFAULT_HINT_MENU_LINE_HEIGHT_OFFSET = 7; + + /** + * @const + * @private + * The default number of visible menu items + * @type {number} + */ + var DEFAULT_VISIBLE_HINT_MENU_ITEMS_COUNT = 8; /** * @private @@ -155,7 +185,7 @@ define(function (require, exports, module) { _removeDynamicProperty(propertyID); $("head").append($style); } - + /** * @private * Removes the styles used to update the font size @@ -164,16 +194,18 @@ define(function (require, exports, module) { _removeDynamicProperty(DYNAMIC_FONT_STYLE_ID); _removeDynamicProperty(DYNAMIC_CODEHINT_FONT_STYLE_ID); _removeDynamicProperty(DYNAMIC_CODEHINT_WITH_TYPE_STYLE_ID); + _removeDynamicProperty(DYNAMIC_CODEHINT_HEIGHT_STYLE_ID); } /** * @private * Adds a new embeded style top sync code-hint font size with codeview font size + * @param {string} fontSize A string with the font size and the size unit */ function _addDynamicFontSizeForCodeHints(fontSize) { var styleStr = ""; styleStr = styleStr + StringUtils.format("{0}: {1} {2};", "font-size", fontSize, " !important"); - styleStr = styleStr + StringUtils.format("{0}: {1} {2};", "line-height", (parseInt(fontSize, 10) + 2) + fontSize.replace(parseInt(fontSize, 10), ""), " !important"); + styleStr = styleStr + StringUtils.format("{0}: {1} {2};", "line-height", (parseInt(fontSize, 10) + 5) + fontSize.replace(parseInt(fontSize, 10), ""), " !important"); _addDynamicProperty(DYNAMIC_CODEHINT_FONT_STYLE_ID, { propName: "font-size", @@ -190,6 +222,14 @@ define(function (require, exports, module) { ruleName: "span.brackets-js-hints-with-type-details", ruleText: "" }); + + _addDynamicProperty(DYNAMIC_CODEHINT_HEIGHT_STYLE_ID, { + propName: "max-height", + propValue: DEFAULT_VISIBLE_HINT_MENU_ITEMS_COUNT * (parseInt(fontSize, 10) + DEFAULT_HINT_MENU_LINE_HEIGHT_OFFSET) + "px", + priorityFlag: true, + ruleName: ".codehint-menu .dropdown-menu", + ruleText: "" + }); } /** From 1aec6554abe8d80ff7761c00bd35ce18d2c4f1e9 Mon Sep 17 00:00:00 2001 From: Bomani McClendon Date: Tue, 7 Mar 2017 08:00:25 -0600 Subject: [PATCH 068/121] Only displays the character limit when exclusion name length is more that 75% of the max characters allowed --- src/search/FileFilters.js | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/search/FileFilters.js b/src/search/FileFilters.js index 0de66a7b912..117f7eed1ae 100644 --- a/src/search/FileFilters.js +++ b/src/search/FileFilters.js @@ -346,15 +346,22 @@ define(function (require, exports, module) { $nameField.bind('input', function () { var remainingCharacters = FILTER_NAME_CHARACTER_MAX - $(this).val().length; - $remainingField.text(StringUtils.format( - Strings.FILTER_NAME_REMAINING, - remainingCharacters - )); + if (remainingCharacters < 0.25*FILTER_NAME_CHARACTER_MAX) { + $remainingField.show(); - if (remainingCharacters < 0) { - $remainingField.addClass("exclusions-name-characters-limit-reached"); - } else { - $remainingField.removeClass("exclusions-name-characters-limit-reached"); + $remainingField.text(StringUtils.format( + Strings.FILTER_NAME_REMAINING, + remainingCharacters + )); + + if (remainingCharacters < 0) { + $remainingField.addClass("exclusions-name-characters-limit-reached"); + } else { + $remainingField.removeClass("exclusions-name-characters-limit-reached"); + } + } + else { + $remainingField.hide(); } }); From 2b19d72370f296a22d3c36a14224748994e66784 Mon Sep 17 00:00:00 2001 From: Bomani McClendon Date: Tue, 7 Mar 2017 08:23:47 -0600 Subject: [PATCH 069/121] Disables OK button on Edit File Filters modal if the character limit is exceeded, rather than truncating characters from exclusion name automatically --- src/search/FileFilters.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/search/FileFilters.js b/src/search/FileFilters.js index 117f7eed1ae..1b81de362df 100644 --- a/src/search/FileFilters.js +++ b/src/search/FileFilters.js @@ -363,12 +363,13 @@ define(function (require, exports, module) { else { $remainingField.hide(); } + updatePrimaryButton(); }); dialog.done(function (buttonId) { if (buttonId === Dialogs.DIALOG_BTN_OK) { // Update saved filter preference - setActiveFilter({ name: $nameField.val().substr(0, FILTER_NAME_CHARACTER_MAX), patterns: getValue() }, index); + setActiveFilter({ name: $nameField.val(), patterns: getValue() }, index); _updatePicker(); _doPopulate(); } @@ -395,8 +396,9 @@ define(function (require, exports, module) { function updatePrimaryButton() { var trimmedValue = $editField.val().trim(); + var exclusionNameLength = $nameField.val().length; - $primaryBtn.prop("disabled", !trimmedValue.length); + $primaryBtn.prop("disabled", !trimmedValue.length || (exclusionNameLength > FILTER_NAME_CHARACTER_MAX)); } $editField.on("input", updatePrimaryButton); From a481e474db88d84b9841dba5130366ed3cfd01ad Mon Sep 17 00:00:00 2001 From: Swagatam Mitra Date: Tue, 7 Mar 2017 20:46:44 +0530 Subject: [PATCH 070/121] New implementation based on less template --- src/view/ViewCommandHandlers.js | 117 ++++------------------- src/view/fontrules/font-based-rules.less | 24 +++++ 2 files changed, 42 insertions(+), 99 deletions(-) create mode 100644 src/view/fontrules/font-based-rules.less diff --git a/src/view/ViewCommandHandlers.js b/src/view/ViewCommandHandlers.js index 4d71e041dd4..3d4e0130de7 100644 --- a/src/view/ViewCommandHandlers.js +++ b/src/view/ViewCommandHandlers.js @@ -42,7 +42,8 @@ define(function (require, exports, module) { ThemeSettings = require("view/ThemeSettings"), MainViewManager = require("view/MainViewManager"), AppInit = require("utils/AppInit"), - _ = require("thirdparty/lodash"); + _ = require("thirdparty/lodash"), + FontRuleTemplate = require("text!view/fontrules/font-based-rules.less"); var prefs = PreferencesManager.getExtensionPrefs("fonts"); @@ -66,24 +67,6 @@ define(function (require, exports, module) { * @type {string} */ var DYNAMIC_FONT_STYLE_ID = "codemirror-dynamic-fonts"; - - /** - * @const - * @type {string} - */ - var DYNAMIC_CODEHINT_FONT_STYLE_ID = "codehint-dynamic-fonts"; - - /** - * @const - * @type {string} - */ - var DYNAMIC_CODEHINT_WITH_TYPE_STYLE_ID = "codehint-with-type-dynamic-width"; - - /** - * @const - * @type {string} - */ - var DYNAMIC_CODEHINT_HEIGHT_STYLE_ID = "codehint-dynamic-height"; /** * @const @@ -123,38 +106,6 @@ define(function (require, exports, module) { */ var DEFAULT_FONT_FAMILY = "'SourceCodePro-Medium', MS ゴシック, 'MS Gothic', monospace"; - /** - * @const - * @private - * The default hint span width for hints with annotated type details - * @type {number} - */ - var DEFAULT_TYPED_HINT_SPAN_WIDTH = 300; - - /** - * @const - * @private - * The default hint menu max-height - * @type {number} - */ - var DEFAULT_HINT_MENU_HEIGHT = 160; - - /** - * @const - * @private - * The default hint menu item line height offset - * @type {number} - */ - var DEFAULT_HINT_MENU_LINE_HEIGHT_OFFSET = 7; - - /** - * @const - * @private - * The default number of visible menu items - * @type {number} - */ - var DEFAULT_VISIBLE_HINT_MENU_ITEMS_COUNT = 8; - /** * @private * Removes style property from the DOM @@ -176,10 +127,14 @@ define(function (require, exports, module) { * @param {string} ruleCfg.ruleText Optional selector definition text */ function _addDynamicProperty(propertyID, ruleCfg) { - var cssRule = ruleCfg.ruleName || ".CodeMirror"; var $style = $("").attr("id", propertyID); - var styleStr = ruleCfg.ruleText || StringUtils.format("{0}: {1} {2}", ruleCfg.propName, ruleCfg.propValue, ruleCfg.priorityFlag ? "!important" : ""); - $style.html(cssRule + "{ " + styleStr + " }"); + if (ruleCfg.ruleText) { + $style.html(ruleCfg.ruleText); + } else { + var cssRule = ruleCfg.ruleName || ".CodeMirror"; + var styleStr = ruleCfg.ruleText || StringUtils.format("{0}: {1} {2}", ruleCfg.propName, ruleCfg.propValue, ruleCfg.priorityFlag ? "!important" : ""); + $style.html(cssRule + "{ " + styleStr + " }"); + } // Let's make sure we remove the already existing item from the DOM. _removeDynamicProperty(propertyID); @@ -192,44 +147,6 @@ define(function (require, exports, module) { */ function _removeDynamicFontSize() { _removeDynamicProperty(DYNAMIC_FONT_STYLE_ID); - _removeDynamicProperty(DYNAMIC_CODEHINT_FONT_STYLE_ID); - _removeDynamicProperty(DYNAMIC_CODEHINT_WITH_TYPE_STYLE_ID); - _removeDynamicProperty(DYNAMIC_CODEHINT_HEIGHT_STYLE_ID); - } - - /** - * @private - * Adds a new embeded style top sync code-hint font size with codeview font size - * @param {string} fontSize A string with the font size and the size unit - */ - function _addDynamicFontSizeForCodeHints(fontSize) { - var styleStr = ""; - styleStr = styleStr + StringUtils.format("{0}: {1} {2};", "font-size", fontSize, " !important"); - styleStr = styleStr + StringUtils.format("{0}: {1} {2};", "line-height", (parseInt(fontSize, 10) + 5) + fontSize.replace(parseInt(fontSize, 10), ""), " !important"); - - _addDynamicProperty(DYNAMIC_CODEHINT_FONT_STYLE_ID, { - propName: "font-size", - propValue: fontSize, - priorityFlag: true, - ruleName: ".codehint-menu .dropdown-menu li a", - ruleText: styleStr - }); - - _addDynamicProperty(DYNAMIC_CODEHINT_WITH_TYPE_STYLE_ID, { - propName: "width", - propValue: DEFAULT_TYPED_HINT_SPAN_WIDTH * (parseInt(fontSize, 10) / DEFAULT_FONT_SIZE) + "px", - priorityFlag: true, - ruleName: "span.brackets-js-hints-with-type-details", - ruleText: "" - }); - - _addDynamicProperty(DYNAMIC_CODEHINT_HEIGHT_STYLE_ID, { - propName: "max-height", - propValue: DEFAULT_VISIBLE_HINT_MENU_ITEMS_COUNT * (parseInt(fontSize, 10) + DEFAULT_HINT_MENU_LINE_HEIGHT_OFFSET) + "px", - priorityFlag: true, - ruleName: ".codehint-menu .dropdown-menu", - ruleText: "" - }); } /** @@ -238,14 +155,16 @@ define(function (require, exports, module) { * @param {string} fontSize A string with the font size and the size unit */ function _addDynamicFontSize(fontSize) { - _addDynamicProperty(DYNAMIC_FONT_STYLE_ID, { - propName: "font-size", - propValue: fontSize, - priorityFlag: true + var template = FontRuleTemplate.split("{font-size-param}").join(fontSize); + less.render(template, null, function onParse(err, tree) { + if (err) { + console.error(err); + } else { + _addDynamicProperty(DYNAMIC_FONT_STYLE_ID, { + ruleText: tree.css + }); + } }); - - // Sync code-hint font size - _addDynamicFontSizeForCodeHints(fontSize); } /** diff --git a/src/view/fontrules/font-based-rules.less b/src/view/fontrules/font-based-rules.less new file mode 100644 index 00000000000..d556de44e39 --- /dev/null +++ b/src/view/fontrules/font-based-rules.less @@ -0,0 +1,24 @@ +@defaultfontsize : 12px; +@maxvisibleitems: 8; +@lineheightoffset: 7px; +@defaultmenuwidth: 300px; + +@fontsize : {font-size-param}; +@lineheight: @fontsize + @lineheightoffset; + +.CodeMirror { + font-size: @fontsize !important +} + +.codehint-menu .dropdown-menu li a { + font-size: @fontsize !important; + line-height: @lineheight !important; +} + +span.brackets-js-hints-with-type-details { + width: @defaultmenuwidth * (@fontsize / @defaultfontsize) !important; +} + +.codehint-menu .dropdown-menu { + max-height: @maxvisibleitems * @lineheight !important; +} \ No newline at end of file From 43b8d4dcc7591310e4fc79373012e29494c71dd1 Mon Sep 17 00:00:00 2001 From: Swagatam Mitra Date: Wed, 8 Mar 2017 12:34:02 +0530 Subject: [PATCH 071/121] Handle all units for less templating --- src/view/fontrules/font-based-rules.less | 41 +++++++++++++++++------- 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/src/view/fontrules/font-based-rules.less b/src/view/fontrules/font-based-rules.less index d556de44e39..a9e80a345cc 100644 --- a/src/view/fontrules/font-based-rules.less +++ b/src/view/fontrules/font-based-rules.less @@ -1,24 +1,41 @@ +@basefontsize: 16; + +/* mixin for converting EM to PX */ +.emtoPx( @emvalue ) when (isem( @emvalue)) { + @return: (unit(@emvalue) * @basefontsize) + 0px; +} + +/* mixin for passthrough other units */ +.emtoPx( @emvalue ) when (isem(@emvalue) = false) { + @return: @emvalue; +} + +@fontsizeparam : {font-size-param}; + +@value: return; +.emtoPx(@fontsizeparam); +@fontsize: @@value; + @defaultfontsize : 12px; @maxvisibleitems: 8; -@lineheightoffset: 7px; -@defaultmenuwidth: 300px; +@lineheightoffset: 5px/@defaultfontsize; +@defaultmenuwidth: 300px/@defaultfontsize; -@fontsize : {font-size-param}; -@lineheight: @fontsize + @lineheightoffset; +@lineheight: @fontsize + @fontsize * @lineheightoffset; -.CodeMirror { - font-size: @fontsize !important +.CodeMirror { + font-size: @fontsize !important; } -.codehint-menu .dropdown-menu li a { +.codehint-menu .dropdown-menu li a { font-size: @fontsize !important; - line-height: @lineheight !important; + line-height: @lineheight !important; } -span.brackets-js-hints-with-type-details { - width: @defaultmenuwidth * (@fontsize / @defaultfontsize) !important; +span.brackets-js-hints-with-type-details { + width: @defaultmenuwidth * @fontsize !important; } -.codehint-menu .dropdown-menu { - max-height: @maxvisibleitems * @lineheight !important; +.codehint-menu .dropdown-menu { + max-height: @maxvisibleitems * @lineheight !important; } \ No newline at end of file From def4c85c2802179262fc321c8cf733d3693edaa1 Mon Sep 17 00:00:00 2001 From: Swagatam Mitra Date: Wed, 8 Mar 2017 12:38:54 +0530 Subject: [PATCH 072/121] Fix eslint error --- src/view/ViewCommandHandlers.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/view/ViewCommandHandlers.js b/src/view/ViewCommandHandlers.js index 3d4e0130de7..a50367faa6a 100644 --- a/src/view/ViewCommandHandlers.js +++ b/src/view/ViewCommandHandlers.js @@ -21,6 +21,8 @@ * */ +/*global less */ + /** * The ViewCommandHandlers object dispatches the following event(s): * - fontSizeChange -- Triggered when the font size is changed via the From d24e27d54f9bdfaa9b39801f631b12b943ae029a Mon Sep 17 00:00:00 2001 From: Martin Zagora Date: Wed, 8 Mar 2017 19:37:10 +1100 Subject: [PATCH 073/121] add husky to prevent pushing failing code (#13151) --- package.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package.json b/package.json index d5f820e9a44..858652514dd 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "fs-extra": "0.5.0", "glob": "7.0.6", "grunt": "0.4.5", + "husky": "0.13.2", "jasmine-node": "1.11.0", "grunt-jasmine-node": "0.1.0", "grunt-cli": "0.1.9", @@ -50,6 +51,7 @@ "grunt-cleanempty": "1.0.3" }, "scripts": { + "prepush": "npm run eslint", "postinstall": "grunt install", "test": "grunt test cla-check-pull", "eslint": "grunt eslint" From 4047c4dfe1d7b488f90e8546e027467aa126f1c8 Mon Sep 17 00:00:00 2001 From: Saurabh Kathpalia Date: Wed, 8 Mar 2017 14:55:38 +0530 Subject: [PATCH 074/121] Fixed - #13158 --- src/document/DocumentCommandHandlers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/document/DocumentCommandHandlers.js b/src/document/DocumentCommandHandlers.js index 49f9d4bdb76..a0c2794a1be 100644 --- a/src/document/DocumentCommandHandlers.js +++ b/src/document/DocumentCommandHandlers.js @@ -451,7 +451,7 @@ define(function (require, exports, module) { _doOpenWithOptionalPath(fileInfo.path, silent, paneId, commandData && commandData.options) .done(function (file) { - HealthLogger.fileOpened(fileInfo.path); + HealthLogger.fileOpened(file._path); if (!commandData || !commandData.options || !commandData.options.noPaneActivate) { MainViewManager.setActivePaneId(paneId); } From 68e3705d49ac2ead44fd3195cdf18c4a77f96395 Mon Sep 17 00:00:00 2001 From: Swagatam Mitra Date: Wed, 8 Mar 2017 15:34:52 +0530 Subject: [PATCH 075/121] Fix typo error (#13160) Fix the spelling for description --- build.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.json b/build.json index 35883b8483a..3378b86d94a 100644 --- a/build.json +++ b/build.json @@ -1,5 +1,5 @@ { "version": "1.9.0-0", "title" : "Brackets 1.9 ", - "desciption" : "This is a Brackets pre-release build" -} \ No newline at end of file + "description" : "This is a Brackets pre-release build" +} From 2fca191c3ac64360c6ec12ad5266fe9555ca3b6c Mon Sep 17 00:00:00 2001 From: Saurabh Kathpalia Date: Thu, 9 Mar 2017 11:08:27 +0530 Subject: [PATCH 076/121] Enhancements in Extension Manager UI (#13162) * Enhancements in Extension Manager UI * Removed EXTENSIONS_SORT_BY string from strings.js of all languages --- src/htmlContent/extension-manager-dialog.html | 14 +++++---- src/nls/fi/strings.js | 3 +- src/nls/fr/strings.js | 1 - src/nls/ja/strings.js | 1 - src/nls/root/strings.js | 1 - src/styles/brackets_patterns_override.less | 31 ++++++++++++++----- src/styles/images/sort-by-attributes.svg | 18 +++++++++++ src/styles/images/topcoat-search-20.svg | 18 +++++++++-- 8 files changed, 67 insertions(+), 20 deletions(-) create mode 100644 src/styles/images/sort-by-attributes.svg diff --git a/src/htmlContent/extension-manager-dialog.html b/src/htmlContent/extension-manager-dialog.html index 53ab9562bff..733ef69c0c6 100644 --- a/src/htmlContent/extension-manager-dialog.html +++ b/src/htmlContent/extension-manager-dialog.html @@ -9,13 +9,15 @@

  • {{Strings.EXTENSIONS_INSTALLED_TITLE}}
  • - {{Strings.EXTENSIONS_SORT_BY}} - +
    +
    + +
    - +
    " + swatch.value + ""); }); @@ -413,6 +413,7 @@ define(function (require, exports, module) { event.keyCode === KeyEvent.DOM_VK_ENTER || event.keyCode === KeyEvent.DOM_VK_SPACE) { // Enter/Space is same as clicking on swatch + self._commitColor($(event.currentTarget).find(".value").html()); } else if (event.keyCode === KeyEvent.DOM_VK_TAB) { // Tab on last swatch loops back to color square @@ -444,9 +445,8 @@ define(function (require, exports, module) { */ ColorEditor.prototype.setColorAsHsv = function (hsv) { var colorVal, newColor, - oldFormat = tinycolor(this.getColor()).getFormat(); //|| "0x"; - //IF STILL UNDETECTABLE VIA TINYCOLOR .getFormat(), METHOD, THEN FORMAT IS SET TO '0x' NOTATION - + oldFormat = tinycolor(this.getColor()).getFormat(); + // Set our state to the new color $.extend(this._hsv, hsv); newColor = tinycolor(this._hsv); @@ -466,8 +466,8 @@ define(function (require, exports, module) { colorVal = this._hsv.a < 1 ? newColor.toRgbString() : newColor.toHexString(); break; case "0x": - colorVal = newColor.toHexString().to0xString(); - //NEED TO IMPLEMENT .to0xString() method + colorVal = newColor.toHexString().replace("#","0x"); + break; } colorVal = this._isUpperCase ? colorVal.toUpperCase() : colorVal; this._commitColor(colorVal, false); @@ -480,11 +480,19 @@ define(function (require, exports, module) { * @param {boolean=} resetHsv Pass false ONLY if hsv set already been modified to match colorVal. Default: true. */ ColorEditor.prototype._commitColor = function (colorVal, resetHsv) { + // + // + //TO-DO: WORKS. NEED TO ADD EXPORTED FUNCTION TO CHECK IF 0x + // + // if (resetHsv === undefined) { resetHsv = true; - } + } this._callback(colorVal); - this._color = tinycolor(colorVal); + + var colorObj = checkSetFormat(colorVal); + colorObj._originalInput = colorVal; + this._color = colorObj; if (resetHsv) { this._hsv = this._color.toHsv(); @@ -499,7 +507,7 @@ define(function (require, exports, module) { * format determines the new selected color's format. * @param {!string} colorVal */ - ColorEditor.prototype.setColorFromString = function (colorVal) { + ColorEditor.prototype.setColorFromString = function (colorVal) { this._commitColor(colorVal, true); // TODO (#2204): make this less entangled with setColorAsHsv() }; diff --git a/src/extensions/default/InlineColorEditor/InlineColorEditor.js b/src/extensions/default/InlineColorEditor/InlineColorEditor.js index d3cf335ab2b..b54c0eef161 100644 --- a/src/extensions/default/InlineColorEditor/InlineColorEditor.js +++ b/src/extensions/default/InlineColorEditor/InlineColorEditor.js @@ -131,6 +131,7 @@ define(function (require, exports, module) { var self = this; if (colorString !== this._color) { var range = this.getCurrentRange(); + if (!range) { return; } diff --git a/src/extensions/default/QuickView/main.js b/src/extensions/default/QuickView/main.js index e8c57773bd1..6c63049d670 100644 --- a/src/extensions/default/QuickView/main.js +++ b/src/extensions/default/QuickView/main.js @@ -400,15 +400,18 @@ define(function (require, exports, module) { } } else if (pos.ch <= match.index + match[0].length) { // build the css for previewing the gradient from the regex result - var previewCSS = gradientMatch.prefix + (gradientMatch.colorValue || match[0]); + var previewCSS = gradientMatch.prefix + (gradientMatch.colorValue || match[0]); + + if((/^0x/).test(previewCSS)){ + previewCSS = previewCSS.replace("0x","#"); + }; // normalize the arguments to something that we can display to the user // NOTE: we need both the div and the popover's _previewCSS member // (used by unit tests) to match so normalize the css for both previewCSS = normalizeGradientExpressionForQuickview(previewCSS); - var preview = "
    " + - "
    "; + var preview = "
    " + "
    "; var startPos = {line: pos.line, ch: match.index}, endPos = {line: pos.line, ch: match.index + match[0].length}, startCoords = cm.charCoords(startPos), From fa0bb466fe9b21dd1b91189caaf8aa634a830e7e Mon Sep 17 00:00:00 2001 From: nyteksf Date: Sun, 12 Mar 2017 01:35:49 -0800 Subject: [PATCH 084/121] #7723 - Cleaned up code as best I could --- .../default/InlineColorEditor/ColorEditor.js | 54 +++++++++---------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/src/extensions/default/InlineColorEditor/ColorEditor.js b/src/extensions/default/InlineColorEditor/ColorEditor.js index 726329f5f0f..22645d8a784 100644 --- a/src/extensions/default/InlineColorEditor/ColorEditor.js +++ b/src/extensions/default/InlineColorEditor/ColorEditor.js @@ -40,29 +40,34 @@ define(function (require, exports, module) { * @const @type {number} */ var STEP_MULTIPLIER = 5; - + /** - * Convert 0x notation into hex6 format: ("0xFFAACC" => "#FFAACC") + * Convert 0x notation into hex6 format for tinycolor + * compatibility: ("0xFFAACC" => "#FFFFFF") */ - function color0xToHex(color,str){ + function color0xToHex(color,toStr){ var format0xToHexColor = color.replace("0x","#"); var hexColor = tinycolor(format0xToHexColor); hexColor._format = "0x"; - - if(str){ + + if(toStr !== null){ hexColor.toString(); } return hexColor; } - - function checkSetFormat(color,str){ + + function as0xString(color){ + return color.toHexString().replace("#","0x"); + } + + function checkSetFormat(color,toStr){ if((/^0x/).test(color)){ - var colorRes = color0xToHex(color,str); + var colorRes = color0xToHex(color,toStr); return colorRes; }else{ return tinycolor(color); - } } + } /** * Color picker control; may be used standalone or within an InlineColorEditor inline widget. @@ -89,7 +94,6 @@ define(function (require, exports, module) { this._originalColor = color; this._color = checkSetFormat(color); - this._redoColor = null; this._isUpperCase = PreferencesManager.get("uppercaseColors"); PreferencesManager.on("change", "uppercaseColors", function () { @@ -113,13 +117,13 @@ define(function (require, exports, module) { this.$opacitySlider = this.$element.find(".opacity-slider"); this.$opacitySelector = this.$element.find(".opacity-slider .selector-base"); this.$swatches = this.$element.find(".swatches"); - + // Create quick-access color swatches this._addSwatches(swatches); // Attach event listeners to main UI elements this._addListeners(); - + this._commitColor(color); this.$originalColor.css("background-color", checkSetFormat(this._originalColor)); } @@ -186,7 +190,7 @@ define(function (require, exports, module) { ColorEditor.prototype._synchronize = function () { var colorValue = this.getColor().getOriginalInput(); - var colorObject = checkSetFormat(colorValue); + var colorObject = checkSetFormat(colorValue); var hueColor = "hsl(" + this._hsv.h + ", 100%, 50%)"; this._updateColorTypeRadioButtons(colorObject.getFormat()); this.$colorValue.val(colorValue); @@ -266,7 +270,7 @@ define(function (require, exports, module) { handler = function (event) { var newFormat = $(event.currentTarget).html().toLowerCase().replace("%", "p"), newColor = self.getColor().toString(); - + var colorObject = checkSetFormat(newColor); switch (newFormat) { @@ -284,7 +288,7 @@ define(function (require, exports, module) { self._hsv.a = 1; break; case "0x": - newColor = colorObject.toHexString().replace("#","0x"); + newColor = as0xString(colorObject); self._hsv.a = 1; self._format = "0x"; break; @@ -353,7 +357,7 @@ define(function (require, exports, module) { var newColor = $.trim(this.$colorValue.val()), newColorObj = checkSetFormat(newColor), newColorOk = newColorObj.isValid(); - + // TinyColor will auto correct an incomplete rgb or hsl value into a valid color value. // eg. rgb(0,0,0 -> rgb(0, 0, 0) // We want to avoid having TinyColor do this, because we don't want to sync the color @@ -401,7 +405,7 @@ define(function (require, exports, module) { var swatchValue = swatch.value.replace("0x","#") || swatch.value; var stringFormat = (swatch.count > 1) ? Strings.COLOR_EDITOR_USED_COLOR_TIP_PLURAL : Strings.COLOR_EDITOR_USED_COLOR_TIP_SINGULAR, usedColorTip = StringUtils.format(stringFormat, swatch.value, swatch.count); - + self.$swatches.append("
  • " + swatch.value + "
  • "); @@ -466,7 +470,7 @@ define(function (require, exports, module) { colorVal = this._hsv.a < 1 ? newColor.toRgbString() : newColor.toHexString(); break; case "0x": - colorVal = newColor.toHexString().replace("#","0x"); + colorVal = as0xString(newColor); break; } colorVal = this._isUpperCase ? colorVal.toUpperCase() : colorVal; @@ -480,16 +484,12 @@ define(function (require, exports, module) { * @param {boolean=} resetHsv Pass false ONLY if hsv set already been modified to match colorVal. Default: true. */ ColorEditor.prototype._commitColor = function (colorVal, resetHsv) { - // - // - //TO-DO: WORKS. NEED TO ADD EXPORTED FUNCTION TO CHECK IF 0x - // - // + if (resetHsv === undefined) { resetHsv = true; - } + } this._callback(colorVal); - + var colorObj = checkSetFormat(colorVal); colorObj._originalInput = colorVal; this._color = colorObj; @@ -507,7 +507,7 @@ define(function (require, exports, module) { * format determines the new selected color's format. * @param {!string} colorVal */ - ColorEditor.prototype.setColorFromString = function (colorVal) { + ColorEditor.prototype.setColorFromString = function (colorVal) { this._commitColor(colorVal, true); // TODO (#2204): make this less entangled with setColorAsHsv() }; @@ -758,4 +758,4 @@ define(function (require, exports, module) { }); exports.ColorEditor = ColorEditor; -}); \ No newline at end of file +}); From f8cd91172ba2e1935f8a17564a854e3cb46aff64 Mon Sep 17 00:00:00 2001 From: nyteksf Date: Sun, 12 Mar 2017 01:43:47 -0800 Subject: [PATCH 085/121] #7723 - Restored original whitespace --- src/extensions/default/InlineColorEditor/ColorEditor.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/extensions/default/InlineColorEditor/ColorEditor.js b/src/extensions/default/InlineColorEditor/ColorEditor.js index 22645d8a784..de72113a05e 100644 --- a/src/extensions/default/InlineColorEditor/ColorEditor.js +++ b/src/extensions/default/InlineColorEditor/ColorEditor.js @@ -94,6 +94,7 @@ define(function (require, exports, module) { this._originalColor = color; this._color = checkSetFormat(color); + this._redoColor = null; this._isUpperCase = PreferencesManager.get("uppercaseColors"); PreferencesManager.on("change", "uppercaseColors", function () { From 9c7187ada784ffb6ade5c980a62be92f188cfe4b Mon Sep 17 00:00:00 2001 From: nyteksf Date: Sun, 12 Mar 2017 22:45:18 -0700 Subject: [PATCH 086/121] #7723 - Completed change requests of @zaggino and @petetnt --- .../default/InlineColorEditor/ColorEditor.js | 16 +++++++--------- src/extensions/default/QuickView/main.js | 4 ++-- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/extensions/default/InlineColorEditor/ColorEditor.js b/src/extensions/default/InlineColorEditor/ColorEditor.js index de72113a05e..c9d28b7da42 100644 --- a/src/extensions/default/InlineColorEditor/ColorEditor.js +++ b/src/extensions/default/InlineColorEditor/ColorEditor.js @@ -45,13 +45,13 @@ define(function (require, exports, module) { * Convert 0x notation into hex6 format for tinycolor * compatibility: ("0xFFAACC" => "#FFFFFF") */ - function color0xToHex(color,toStr){ + function color0xToHex(color,convertToStr){ var format0xToHexColor = color.replace("0x","#"); var hexColor = tinycolor(format0xToHexColor); hexColor._format = "0x"; - if(toStr !== null){ - hexColor.toString(); + if(convertToStr){ + return hexColor.toString(); } return hexColor; } @@ -60,13 +60,11 @@ define(function (require, exports, module) { return color.toHexString().replace("#","0x"); } - function checkSetFormat(color,toStr){ - if((/^0x/).test(color)){ - var colorRes = color0xToHex(color,toStr); - return colorRes; - }else{ - return tinycolor(color); + function checkSetFormat(color,convertToStr){ + if ((/^0x/).test(color)) { + return color0xToHex(color,convertToStr); } + return tinycolor(color); } /** diff --git a/src/extensions/default/QuickView/main.js b/src/extensions/default/QuickView/main.js index 6c63049d670..fda3b03eac2 100644 --- a/src/extensions/default/QuickView/main.js +++ b/src/extensions/default/QuickView/main.js @@ -402,9 +402,9 @@ define(function (require, exports, module) { // build the css for previewing the gradient from the regex result var previewCSS = gradientMatch.prefix + (gradientMatch.colorValue || match[0]); - if((/^0x/).test(previewCSS)){ + if ((/^0x/).test(previewCSS)) { previewCSS = previewCSS.replace("0x","#"); - }; + }; // normalize the arguments to something that we can display to the user // NOTE: we need both the div and the popover's _previewCSS member From c08ceb383f83b7ab49d27bf457894c1694abbe72 Mon Sep 17 00:00:00 2001 From: nyteksf Date: Sun, 12 Mar 2017 23:16:40 -0700 Subject: [PATCH 087/121] #7723 - Modified function '_normalizeColorString' to include prior externalized code fragment --- .../default/InlineColorEditor/ColorEditor.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/extensions/default/InlineColorEditor/ColorEditor.js b/src/extensions/default/InlineColorEditor/ColorEditor.js index c9d28b7da42..841ff8018f3 100644 --- a/src/extensions/default/InlineColorEditor/ColorEditor.js +++ b/src/extensions/default/InlineColorEditor/ColorEditor.js @@ -92,7 +92,7 @@ define(function (require, exports, module) { this._originalColor = color; this._color = checkSetFormat(color); - + this._redoColor = null; this._isUpperCase = PreferencesManager.get("uppercaseColors"); PreferencesManager.on("change", "uppercaseColors", function () { @@ -193,7 +193,7 @@ define(function (require, exports, module) { var hueColor = "hsl(" + this._hsv.h + ", 100%, 50%)"; this._updateColorTypeRadioButtons(colorObject.getFormat()); this.$colorValue.val(colorValue); - this.$currentColor.css("background-color", checkSetFormat(colorValue,"toStr")); + this.$currentColor.css("background-color", checkSetFormat(colorValue,true)); this.$selection.css("background-color", hueColor); this.$hueBase.css("background-color", hueColor); @@ -339,6 +339,10 @@ define(function (require, exports, module) { ColorEditor.prototype._normalizeColorString = function (color) { var normalizedColor = color; + // Convert from 0x notation into hex format string + if (color.match(/^0x[0-9a-fA-F]{6}/)) { + return color.replace("0x","#") || color; + } // Convert 6-digit hex to 3-digit hex as TinyColor (#ffaacc -> #fac) if (color.match(/^#[0-9a-fA-F]{6}/)) { return tinycolor(color).toString(); @@ -365,8 +369,7 @@ define(function (require, exports, module) { // TinyColor actually generates to see if it's different. If so, then we assume the color // was incomplete to begin with. if (newColorOk) { - var colorStr = newColor.replace("0x","#") || newColor; - newColorOk = (newColorObj.toString() === this._normalizeColorString(colorStr)); + newColorOk = (newColorObj.toString() === this._normalizeColorString(newColor)); } // Restore to the previous valid color if the new color is invalid or incomplete. From 738a6d91f8dcd2735e582a269ce4497b7d9496c4 Mon Sep 17 00:00:00 2001 From: nyteksf Date: Mon, 13 Mar 2017 02:59:16 -0700 Subject: [PATCH 088/121] #7723 - Another round of change requests handled --- .../default/InlineColorEditor/ColorEditor.js | 32 ++++++++----------- src/extensions/default/QuickView/main.js | 11 ++++--- 2 files changed, 19 insertions(+), 24 deletions(-) diff --git a/src/extensions/default/InlineColorEditor/ColorEditor.js b/src/extensions/default/InlineColorEditor/ColorEditor.js index 841ff8018f3..837e810cd14 100644 --- a/src/extensions/default/InlineColorEditor/ColorEditor.js +++ b/src/extensions/default/InlineColorEditor/ColorEditor.js @@ -45,24 +45,23 @@ define(function (require, exports, module) { * Convert 0x notation into hex6 format for tinycolor * compatibility: ("0xFFAACC" => "#FFFFFF") */ - function color0xToHex(color,convertToStr){ - var format0xToHexColor = color.replace("0x","#"); - var hexColor = tinycolor(format0xToHexColor); + function as0xString(color) { + return color.toHexString().replace("#", "0x"); + } + + function _0xColorToHex(color, convertToStr) { + var hexColor = tinycolor(color.replace("0x", "#")); hexColor._format = "0x"; - if(convertToStr){ + if (convertToStr) { return hexColor.toString(); } return hexColor; } - function as0xString(color){ - return color.toHexString().replace("#","0x"); - } - - function checkSetFormat(color,convertToStr){ + function checkSetFormat(color, convertToStr) { if ((/^0x/).test(color)) { - return color0xToHex(color,convertToStr); + return _0xColorToHex(color, convertToStr); } return tinycolor(color); } @@ -193,7 +192,7 @@ define(function (require, exports, module) { var hueColor = "hsl(" + this._hsv.h + ", 100%, 50%)"; this._updateColorTypeRadioButtons(colorObject.getFormat()); this.$colorValue.val(colorValue); - this.$currentColor.css("background-color", checkSetFormat(colorValue,true)); + this.$currentColor.css("background-color", checkSetFormat(colorValue, true)); this.$selection.css("background-color", hueColor); this.$hueBase.css("background-color", hueColor); @@ -339,10 +338,6 @@ define(function (require, exports, module) { ColorEditor.prototype._normalizeColorString = function (color) { var normalizedColor = color; - // Convert from 0x notation into hex format string - if (color.match(/^0x[0-9a-fA-F]{6}/)) { - return color.replace("0x","#") || color; - } // Convert 6-digit hex to 3-digit hex as TinyColor (#ffaacc -> #fac) if (color.match(/^#[0-9a-fA-F]{6}/)) { return tinycolor(color).toString(); @@ -369,7 +364,7 @@ define(function (require, exports, module) { // TinyColor actually generates to see if it's different. If so, then we assume the color // was incomplete to begin with. if (newColorOk) { - newColorOk = (newColorObj.toString() === this._normalizeColorString(newColor)); + newColorOk = (newColorObj.toString() === this._normalizeColorString(checkSetFormat(newColor, true))); } // Restore to the previous valid color if the new color is invalid or incomplete. @@ -404,7 +399,7 @@ define(function (require, exports, module) { // Create swatches swatches.forEach(function (swatch) { - var swatchValue = swatch.value.replace("0x","#") || swatch.value; + var swatchValue = checkSetFormat(swatch.value, true); var stringFormat = (swatch.count > 1) ? Strings.COLOR_EDITOR_USED_COLOR_TIP_PLURAL : Strings.COLOR_EDITOR_USED_COLOR_TIP_SINGULAR, usedColorTip = StringUtils.format(stringFormat, swatch.value, swatch.count); @@ -582,9 +577,8 @@ define(function (require, exports, module) { */ ColorEditor.prototype.undo = function () { if (this._originalColor.toString() !== this._color.toString()) { - var curColor = this._color.toString(); this._commitColor(this._originalColor, true); - this._redoColor = curColor; + this._redoColor = this._color.toString(); } }; diff --git a/src/extensions/default/QuickView/main.js b/src/extensions/default/QuickView/main.js index fda3b03eac2..4e5b483e5f8 100644 --- a/src/extensions/default/QuickView/main.js +++ b/src/extensions/default/QuickView/main.js @@ -325,6 +325,11 @@ define(function (require, exports, module) { function hasLengthInPixels(args) { return (args.length > 1 && args[1].indexOf("px") > 0); } + + // Ensures that input is in usable hex format + function ensureHexFormat(str) { + return (/^0x/).test(str) ? str.replace("0x","#") : str; + } // Normalizes px color stops to % function normalizeGradientExpressionForQuickview(expression) { @@ -401,15 +406,11 @@ define(function (require, exports, module) { } else if (pos.ch <= match.index + match[0].length) { // build the css for previewing the gradient from the regex result var previewCSS = gradientMatch.prefix + (gradientMatch.colorValue || match[0]); - - if ((/^0x/).test(previewCSS)) { - previewCSS = previewCSS.replace("0x","#"); - }; // normalize the arguments to something that we can display to the user // NOTE: we need both the div and the popover's _previewCSS member // (used by unit tests) to match so normalize the css for both - previewCSS = normalizeGradientExpressionForQuickview(previewCSS); + previewCSS = normalizeGradientExpressionForQuickview(ensureHexFormat(previewCSS)); var preview = "
    " + "
    "; var startPos = {line: pos.line, ch: match.index}, From fd6e7d8a8a479b3ea22c3146e8c5fdb1b215b321 Mon Sep 17 00:00:00 2001 From: nyteksf Date: Mon, 13 Mar 2017 05:54:12 -0700 Subject: [PATCH 089/121] #7723 - Fixed nits & added ensureHexFormat() --- .../default/InlineColorEditor/ColorEditor.js | 16 ++++++++++++---- .../InlineColorEditor/InlineColorEditor.js | 2 +- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/extensions/default/InlineColorEditor/ColorEditor.js b/src/extensions/default/InlineColorEditor/ColorEditor.js index 837e810cd14..f32bff069e7 100644 --- a/src/extensions/default/InlineColorEditor/ColorEditor.js +++ b/src/extensions/default/InlineColorEditor/ColorEditor.js @@ -45,10 +45,14 @@ define(function (require, exports, module) { * Convert 0x notation into hex6 format for tinycolor * compatibility: ("0xFFAACC" => "#FFFFFF") */ + function ensureHexFormat(str) { + return (/^0x/).test(str) ? str.replace("0x","#") : str; + } + function as0xString(color) { return color.toHexString().replace("#", "0x"); } - + function _0xColorToHex(color, convertToStr) { var hexColor = tinycolor(color.replace("0x", "#")); hexColor._format = "0x"; @@ -63,6 +67,9 @@ define(function (require, exports, module) { if ((/^0x/).test(color)) { return _0xColorToHex(color, convertToStr); } + if (convertToStr) { + return tinycolor(color).toString(); //HAD NO .TOSTRING() BEFORE. WITHOUT IT BLOCKS HEX3. + } return tinycolor(color); } @@ -351,11 +358,12 @@ define(function (require, exports, module) { }; /** Handle changes in text field */ - ColorEditor.prototype._handleTextFieldInput = function (losingFocus) { + ColorEditor.prototype._handleTextFieldInput = function (losingFocus) { var newColor = $.trim(this.$colorValue.val()), newColorObj = checkSetFormat(newColor), newColorOk = newColorObj.isValid(); + // TinyColor will auto correct an incomplete rgb or hsl value into a valid color value. // eg. rgb(0,0,0 -> rgb(0, 0, 0) // We want to avoid having TinyColor do this, because we don't want to sync the color @@ -364,7 +372,7 @@ define(function (require, exports, module) { // TinyColor actually generates to see if it's different. If so, then we assume the color // was incomplete to begin with. if (newColorOk) { - newColorOk = (newColorObj.toString() === this._normalizeColorString(checkSetFormat(newColor, true))); + newColorOk = (newColorObj.toString() === this._normalizeColorString(ensureHexFormat(newColor))); } // Restore to the previous valid color if the new color is invalid or incomplete. @@ -402,7 +410,7 @@ define(function (require, exports, module) { var swatchValue = checkSetFormat(swatch.value, true); var stringFormat = (swatch.count > 1) ? Strings.COLOR_EDITOR_USED_COLOR_TIP_PLURAL : Strings.COLOR_EDITOR_USED_COLOR_TIP_SINGULAR, usedColorTip = StringUtils.format(stringFormat, swatch.value, swatch.count); - +//#f44fe4 self.$swatches.append("
  • " + swatch.value + "
  • "); diff --git a/src/extensions/default/InlineColorEditor/InlineColorEditor.js b/src/extensions/default/InlineColorEditor/InlineColorEditor.js index b54c0eef161..b40410c1886 100644 --- a/src/extensions/default/InlineColorEditor/InlineColorEditor.js +++ b/src/extensions/default/InlineColorEditor/InlineColorEditor.js @@ -131,7 +131,7 @@ define(function (require, exports, module) { var self = this; if (colorString !== this._color) { var range = this.getCurrentRange(); - + if (!range) { return; } From e71807cb6fdaf4c5b396d9613b5b9d1eb842df4f Mon Sep 17 00:00:00 2001 From: Joe Date: Mon, 13 Mar 2017 12:19:11 -0700 Subject: [PATCH 090/121] Update ColorEditor.js #7723 - Removed stray comment, restored proper indentation of function --- src/extensions/default/InlineColorEditor/ColorEditor.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/extensions/default/InlineColorEditor/ColorEditor.js b/src/extensions/default/InlineColorEditor/ColorEditor.js index f32bff069e7..075d6c1297e 100644 --- a/src/extensions/default/InlineColorEditor/ColorEditor.js +++ b/src/extensions/default/InlineColorEditor/ColorEditor.js @@ -358,7 +358,7 @@ define(function (require, exports, module) { }; /** Handle changes in text field */ - ColorEditor.prototype._handleTextFieldInput = function (losingFocus) { + ColorEditor.prototype._handleTextFieldInput = function (losingFocus) { var newColor = $.trim(this.$colorValue.val()), newColorObj = checkSetFormat(newColor), newColorOk = newColorObj.isValid(); @@ -410,7 +410,7 @@ define(function (require, exports, module) { var swatchValue = checkSetFormat(swatch.value, true); var stringFormat = (swatch.count > 1) ? Strings.COLOR_EDITOR_USED_COLOR_TIP_PLURAL : Strings.COLOR_EDITOR_USED_COLOR_TIP_SINGULAR, usedColorTip = StringUtils.format(stringFormat, swatch.value, swatch.count); -//#f44fe4 + self.$swatches.append("
  • " + swatch.value + "
  • "); From e67b8983f4db4f8076bce24517a4e564ebcedf10 Mon Sep 17 00:00:00 2001 From: Joe Date: Mon, 13 Mar 2017 12:22:31 -0700 Subject: [PATCH 091/121] #7723 - Restored explanatory comment back to feature --- src/extensions/default/InlineColorEditor/ColorEditor.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/extensions/default/InlineColorEditor/ColorEditor.js b/src/extensions/default/InlineColorEditor/ColorEditor.js index 075d6c1297e..6603cbba177 100644 --- a/src/extensions/default/InlineColorEditor/ColorEditor.js +++ b/src/extensions/default/InlineColorEditor/ColorEditor.js @@ -129,8 +129,10 @@ define(function (require, exports, module) { // Attach event listeners to main UI elements this._addListeners(); - this._commitColor(color); + // Initially selected color this.$originalColor.css("background-color", checkSetFormat(this._originalColor)); + + this._commitColor(color); } /** From d00e46476f1253d774cadfd7937ab14ab190fe3f Mon Sep 17 00:00:00 2001 From: Martin Zagora Date: Tue, 14 Mar 2017 06:27:39 +1100 Subject: [PATCH 092/121] eslint stylistic rules (#13177) * add some styling rules * fix trailing commas --- .eslintrc.js | 9 +++++++++ Gruntfile.js | 4 ++-- src/language/HTMLSimpleDOM.js | 2 +- src/nls/hr/strings.js | 2 +- src/preferences/PreferencesBase.js | 2 +- src/project/FileTreeView.js | 2 +- src/utils/AnimationUtils.js | 2 +- test/spec/PreferencesBase-test.js | 2 +- 8 files changed, 17 insertions(+), 8 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 67de082dafc..3663e2f317d 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -36,8 +36,17 @@ module.exports = { // http://eslint.org/docs/rules/#nodejs-and-commonjs "no-new-require": 2, // http://eslint.org/docs/rules/#stylistic-issues + "block-spacing": 1, + "brace-style": [1, "1tbs", { allowSingleLine: true }], + "camelcase": 1, + "comma-dangle": 2, + "comma-spacing": 1, + "comma-style": [1, "last"], + "computed-property-spacing": 1, "eol-last": 1, + "func-call-spacing": 1, "indent": [1, 4], + "key-spacing": [1, { beforeColon: false, afterColon: true }], "max-len": [1, 120], "new-cap": [0, { "capIsNewExceptions": [ diff --git a/Gruntfile.js b/Gruntfile.js index 9f56ba54111..d768df5d37a 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -129,7 +129,7 @@ module.exports = function (grunt) { 'keymap/{,*/}*', 'lib/{,*/}*', 'mode/{,*/}*', - 'theme/{,*/}*', + 'theme/{,*/}*' ] }, { @@ -149,7 +149,7 @@ module.exports = function (grunt) { force: true, files: false }, - src: ['dist/**/*'], + src: ['dist/**/*'] }, less: { dist: { diff --git a/src/language/HTMLSimpleDOM.js b/src/language/HTMLSimpleDOM.js index 304182a9b40..c82ee1b263f 100644 --- a/src/language/HTMLSimpleDOM.js +++ b/src/language/HTMLSimpleDOM.js @@ -82,7 +82,7 @@ define(function (require, exports, module) { rtc : { rb: true, rt: true, rtc: true, rp: true }, optgroup: { optgroup: true, option: true }, option : { option: true }, - tbody : { caption: true, colgroup: true, thead: true, tbody: true, tfoot: true, }, + tbody : { caption: true, colgroup: true, thead: true, tbody: true, tfoot: true }, tfoot : { caption: true, colgroup: true, thead: true, tbody: true }, thead : { caption: true, colgroup: true }, tr : { tr: true, th: true, td: true, caption: true }, diff --git a/src/nls/hr/strings.js b/src/nls/hr/strings.js index 4efe3348a68..182062981c5 100644 --- a/src/nls/hr/strings.js +++ b/src/nls/hr/strings.js @@ -565,7 +565,7 @@ define({ "COLLAPSE_ALL" : "Skupi Sve", "EXPAND_ALL" : "Proširi Sve", "COLLAPSE_CURRENT" : "Skupi Trenutno", - "EXPAND_CURRENT" : "Proširi Trenutno", + "EXPAND_CURRENT" : "Proširi Trenutno" }); /* Last translated for a57bd8888da0b44f382e591c64b394b065178277 */ diff --git a/src/preferences/PreferencesBase.js b/src/preferences/PreferencesBase.js index dce4ba4c353..509bf0b6813 100644 --- a/src/preferences/PreferencesBase.js +++ b/src/preferences/PreferencesBase.js @@ -1937,7 +1937,7 @@ define(function (require, exports, module) { */ getPrefixedSystem: function (prefix) { return new PrefixedPreferencesSystem(this, prefix + "."); - }, + } }); diff --git a/src/project/FileTreeView.js b/src/project/FileTreeView.js index ab21056a346..3ea667c145e 100644 --- a/src/project/FileTreeView.js +++ b/src/project/FileTreeView.js @@ -503,7 +503,7 @@ define(function (require, exports, module) { }, DOM.ins({ className: "jstree-icon" - }), + }) ]; var thickness = _createThickness(this.props.depth); diff --git a/src/utils/AnimationUtils.js b/src/utils/AnimationUtils.js index 7cea1492849..119a10160c2 100644 --- a/src/utils/AnimationUtils.js +++ b/src/utils/AnimationUtils.js @@ -42,7 +42,7 @@ define(function (require, exports, module) { "OTransition" : "oTransitionEnd", "MozTransition" : "transitionend", "WebkitTransition": "webkitTransitionEnd", - "transition" : "transitionend", + "transition" : "transitionend" }; _.forEach(transitions, function (value, key) { diff --git a/test/spec/PreferencesBase-test.js b/test/spec/PreferencesBase-test.js index 8995eb45e5a..e283f746cfd 100644 --- a/test/spec/PreferencesBase-test.js +++ b/test/spec/PreferencesBase-test.js @@ -901,7 +901,7 @@ define(function (require, exports, module) { "dontCloseTags": [], "indentTags": [], "whenClosing": true, - "whenOpening": false, + "whenOpening": false }); }); From 1bacc513c9e5de8789291834b546144d34458a94 Mon Sep 17 00:00:00 2001 From: Joe Date: Mon, 13 Mar 2017 12:28:38 -0700 Subject: [PATCH 093/121] #7723 - Unnecessary comment removed --- src/extensions/default/InlineColorEditor/ColorEditor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/extensions/default/InlineColorEditor/ColorEditor.js b/src/extensions/default/InlineColorEditor/ColorEditor.js index 6603cbba177..fd8ca577b58 100644 --- a/src/extensions/default/InlineColorEditor/ColorEditor.js +++ b/src/extensions/default/InlineColorEditor/ColorEditor.js @@ -68,7 +68,7 @@ define(function (require, exports, module) { return _0xColorToHex(color, convertToStr); } if (convertToStr) { - return tinycolor(color).toString(); //HAD NO .TOSTRING() BEFORE. WITHOUT IT BLOCKS HEX3. + return tinycolor(color).toString(); } return tinycolor(color); } From e83621fa7be14490c301576f436dcc8f9f77384e Mon Sep 17 00:00:00 2001 From: nyteksf Date: Tue, 14 Mar 2017 05:09:20 -0700 Subject: [PATCH 094/121] #7723 - Fixed indentation error --- src/extensions/default/QuickView/main.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/extensions/default/QuickView/main.js b/src/extensions/default/QuickView/main.js index 4e5b483e5f8..0a647bba433 100644 --- a/src/extensions/default/QuickView/main.js +++ b/src/extensions/default/QuickView/main.js @@ -327,9 +327,9 @@ define(function (require, exports, module) { } // Ensures that input is in usable hex format - function ensureHexFormat(str) { - return (/^0x/).test(str) ? str.replace("0x","#") : str; - } + function ensureHexFormat(str) { + return (/^0x/).test(str) ? str.replace("0x","#") : str; + } // Normalizes px color stops to % function normalizeGradientExpressionForQuickview(expression) { From 1dccc61c1373e6bbaf4382b90284c5c0f2b31efa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pete=20Nyk=C3=A4nen?= Date: Tue, 14 Mar 2017 13:21:32 +0200 Subject: [PATCH 095/121] Add JSDoc for new functions --- .../default/InlineColorEditor/ColorEditor.js | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/extensions/default/InlineColorEditor/ColorEditor.js b/src/extensions/default/InlineColorEditor/ColorEditor.js index fd8ca577b58..d62e4871bda 100644 --- a/src/extensions/default/InlineColorEditor/ColorEditor.js +++ b/src/extensions/default/InlineColorEditor/ColorEditor.js @@ -44,15 +44,30 @@ define(function (require, exports, module) { /** * Convert 0x notation into hex6 format for tinycolor * compatibility: ("0xFFAACC" => "#FFFFFF") + * @param {string} str - String to ensure hex format for + * @returns {string} - str in hex format */ function ensureHexFormat(str) { return (/^0x/).test(str) ? str.replace("0x","#") : str; } + /** + * Converts a color to a 0x-prefixed string + * @param {tinycolor} color - color to convert + * @returns {string} - color as 0x-prefixed string + */ function as0xString(color) { return color.toHexString().replace("#", "0x"); } + /** + * Converts 0x-prefixed color to hex + * @param {string} color - Color to convert + * @param {boolean} convertToString - true if color should + * be returned as string + * @returns {tinycolor|string} - Hex color as a Tinycolor object + * or a hex string + */ function _0xColorToHex(color, convertToStr) { var hexColor = tinycolor(color.replace("0x", "#")); hexColor._format = "0x"; @@ -63,6 +78,14 @@ define(function (require, exports, module) { return hexColor; } + /** + * Ensures that a string is in Tinycolor supported format + * @param {string} color - Color to check the format for + * @param {boolean} convertToString - true if color should + * be returned as string + * @returns {tinycolor|string} - Color as a Tinycolor object + * or a hex string + */ function checkSetFormat(color, convertToStr) { if ((/^0x/).test(color)) { return _0xColorToHex(color, convertToStr); From 8ddead0d5e2cb8d0cbb092d13f7d043cae2a261a Mon Sep 17 00:00:00 2001 From: Lee Yi Min Date: Wed, 15 Mar 2017 05:23:03 +0800 Subject: [PATCH 096/121] Create tests for Disabled context menu items for unsaved files / #12806 #13134 (#13178) * Add test case for disabled items in unsaved file * add saved file test case --- test/spec/Menu-test.js | 53 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/test/spec/Menu-test.js b/test/spec/Menu-test.js index 1fcba13130f..961bba6bc19 100644 --- a/test/spec/Menu-test.js +++ b/test/spec/Menu-test.js @@ -21,7 +21,7 @@ * */ -/*global describe, it, expect, runs, beforeFirst, afterLast */ +/*global describe, it, expect, runs, beforeFirst, afterLast, waitsForDone, spyOn*/ define(function (require, exports, module) { "use strict"; @@ -30,6 +30,7 @@ define(function (require, exports, module) { Commands, // Load from brackets.test KeyBindingManager, // Load from brackets.test Menus, // Load from brackets.test + FileSystem, // Load from brackets.test SpecRunnerUtils = require("spec/SpecRunnerUtils"), KeyEvent = require("utils/KeyEvent"); @@ -52,6 +53,7 @@ define(function (require, exports, module) { Commands = testWindow.brackets.test.Commands; KeyBindingManager = testWindow.brackets.test.KeyBindingManager; Menus = testWindow.brackets.test.Menus; + FileSystem = testWindow.brackets.test.FileSystem; }, testWindowOptions); }); @@ -299,6 +301,55 @@ define(function (require, exports, module) { isOpen = cmenu.isOpen(); expect(isOpen).toBe(false); }); + + it("it should disable context menu items when file doesn't exist ", function () { + runs(function () { + // runs create a new file + var promise = CommandManager.execute(Commands.FILE_NEW_UNTITLED); + waitsForDone(promise, "FILE_NEW_UNTITLED"); + + // opens context menu + var cmenu = Menus.getContextMenu(Menus.ContextMenuIds.WORKING_SET_CONTEXT_MENU); + cmenu.open({pageX: 0, pageY: 0}); + + // checks that all the relevant items are disabled + var notVisible = [Commands.FILE_RENAME, Commands.NAVIGATE_SHOW_IN_FILE_TREE, Commands.NAVIGATE_SHOW_IN_OS]; + notVisible.forEach(function (item) { expect(CommandManager.get(item).getEnabled()).toBe(false); }); + + //close menu and new file + cmenu.close(); + + }); + }); + + it("it should enable context menu items when file does exist ", function () { + var testPath = SpecRunnerUtils.getTempDirectory(); + var newFilePath = testPath + "/contextMenuTest.js"; + runs(function () { + // runs create a new file and saves it + SpecRunnerUtils.createTempDirectory(); + SpecRunnerUtils.loadProjectInTestWindow(testPath); + var promise = CommandManager.execute(Commands.FILE_NEW_UNTITLED); + + waitsForDone(promise, "FILE_NEW_UNTITLED"); + + spyOn(FileSystem, 'showSaveDialog').andCallFake(function (dialogTitle, initialPath, proposedNewName, callback) { + callback(undefined, newFilePath); + }); + + promise = CommandManager.execute(Commands.FILE_SAVE); + waitsForDone(promise, "Provide new filename", 5000); + }); + runs(function () { + // opens context menu + var cmenu = Menus.getContextMenu(Menus.ContextMenuIds.WORKING_SET_CONTEXT_MENU); + cmenu.open({pageX: 0, pageY: 0}); + + // checks that all the items are enabled + var visible = [Commands.FILE_SAVE, Commands.FILE_SAVE_AS, Commands.FILE_RENAME, Commands.NAVIGATE_SHOW_IN_FILE_TREE, Commands.NAVIGATE_SHOW_IN_OS, Commands.CMD_FIND_IN_SUBTREE, Commands.CMD_REPLACE_IN_SUBTREE, Commands.FILE_CLOSE]; + visible.forEach(function (item) { expect(CommandManager.get(item).getEnabled()).toBe(true); }); + }); + }); }); }); From 125868b3f1f3e0878ad828531c843e1bdc8000be Mon Sep 17 00:00:00 2001 From: Saurabh Kathpalia Date: Wed, 15 Mar 2017 11:22:59 +0530 Subject: [PATCH 097/121] Fixed #13180 (#13181) --- src/extensibility/ExtensionManagerDialog.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/extensibility/ExtensionManagerDialog.js b/src/extensibility/ExtensionManagerDialog.js index 315e428799a..64d4b712ec0 100644 --- a/src/extensibility/ExtensionManagerDialog.js +++ b/src/extensibility/ExtensionManagerDialog.js @@ -500,7 +500,11 @@ define(function (require, exports, module) { } else { // Otherwise show the first tab $dlg.find(".nav-tabs a:first").tab("show"); } - if ($activeTab.hasClass("installed")) { + // If activeTab was explicitly selected by user, + // then check for the selection + // Or if there was an update available since activeTab.length would be 0, + // then check for updatesAvailable class in toolbar-extension-manager + if (($activeTab.length && $activeTab.hasClass("installed")) || (!$activeTab.length && $("#toolbar-extension-manager").hasClass('updatesAvailable'))) { $(".ext-sort-group").hide(); } else { $(".ext-sort-group").show(); From 57600be4eb62eb473d9b3916fa0e96ee00881ea4 Mon Sep 17 00:00:00 2001 From: ficristo Date: Wed, 15 Mar 2017 07:13:49 +0100 Subject: [PATCH 098/121] Create config.json based on task run (#12778) --- .gitignore | 3 +++ Gruntfile.js | 5 +++-- src/brackets.config.dev.json | 3 +++ src/brackets.config.dist.json | 3 +++ src/brackets.config.json | 3 +-- tasks/write-config.js | 16 ++++++++++++++-- 6 files changed, 27 insertions(+), 6 deletions(-) create mode 100644 src/brackets.config.dev.json create mode 100644 src/brackets.config.dist.json diff --git a/.gitignore b/.gitignore index 415a22353f8..11228855c39 100644 --- a/.gitignore +++ b/.gitignore @@ -30,6 +30,9 @@ Thumbs.db # ignore .disabled file for default extensions /src/extensions/default/*/.disabled +# generate through grunt +/src/config.json + #OSX .DS_Store files .DS_Store diff --git a/Gruntfile.js b/Gruntfile.js index d768df5d37a..860e6556a90 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -341,7 +341,7 @@ module.exports = function (grunt) { }); // task: install - grunt.registerTask('install', ['write-config', 'less', 'npm-install-source']); + grunt.registerTask('install', ['write-config:dev', 'less', 'npm-install-source']); // task: test grunt.registerTask('test', ['eslint', 'jasmine', 'nls-check']); @@ -349,10 +349,11 @@ module.exports = function (grunt) { // task: set-release // Update version number in package.json and rewrite src/config.json - grunt.registerTask('set-release', ['update-release-number', 'write-config']); + grunt.registerTask('set-release', ['update-release-number', 'write-config:dev']); // task: build grunt.registerTask('build', [ + 'write-config:dist', 'eslint:src', 'jasmine', 'clean', diff --git a/src/brackets.config.dev.json b/src/brackets.config.dev.json new file mode 100644 index 00000000000..fb63f4d01ba --- /dev/null +++ b/src/brackets.config.dev.json @@ -0,0 +1,3 @@ +{ + "healthDataServerURL" : "https://healthdev.brackets.io/healthDataLog" +} diff --git a/src/brackets.config.dist.json b/src/brackets.config.dist.json new file mode 100644 index 00000000000..51a409ad9a0 --- /dev/null +++ b/src/brackets.config.dist.json @@ -0,0 +1,3 @@ +{ + "healthDataServerURL" : "https://health.brackets.io/healthDataLog" +} diff --git a/src/brackets.config.json b/src/brackets.config.json index 25041fd3938..89a0db49067 100644 --- a/src/brackets.config.json +++ b/src/brackets.config.json @@ -20,7 +20,6 @@ "extension_registry" : "https://s3.amazonaws.com/extend.brackets/registry.json", "extension_url" : "https://s3.amazonaws.com/extend.brackets/{0}/{0}-{1}.zip", "linting.enabled_by_default" : true, - "build_timestamp" : "", - "healthDataServerURL" : "https://health.brackets.io/healthDataLog" + "build_timestamp" : "" } } diff --git a/tasks/write-config.js b/tasks/write-config.js index 1a3b4003cb8..86a7e24c5d3 100644 --- a/tasks/write-config.js +++ b/tasks/write-config.js @@ -31,9 +31,21 @@ module.exports = function (grunt) { // task: write-config grunt.registerTask("write-config", "Merge package.json and src/brackets.config.json into src/config.json", function () { - var packageJSON = grunt.file.readJSON("package.json"), - appConfigJSON = grunt.file.readJSON("src/brackets.config.json"); + var name = "dev"; + if (this.flags.dist === true) { + name = "dist"; + } + var appConfigJSON = grunt.file.readJSON("src/brackets.config.json"), + appConfigEnvJSON = grunt.file.readJSON("src/brackets.config." + name + ".json"), + key; + for (key in appConfigEnvJSON) { + if (appConfigEnvJSON.hasOwnProperty(key)) { + appConfigJSON.config[key] = appConfigEnvJSON[key]; + } + } + + var packageJSON = grunt.file.readJSON("package.json"); Object.keys(packageJSON).forEach(function (key) { if (appConfigJSON[key] === undefined) { appConfigJSON[key] = packageJSON[key]; From 9352e39d55288f2187c8643611ed5a4ce53920cc Mon Sep 17 00:00:00 2001 From: Damien Date: Wed, 15 Mar 2017 07:18:53 +0100 Subject: [PATCH 099/121] Update uppercases (#12420) Add missing accents on some uppercase letters. --- src/nls/fr/strings.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/nls/fr/strings.js b/src/nls/fr/strings.js index 6b36c5bb0e6..a032cfed163 100644 --- a/src/nls/fr/strings.js +++ b/src/nls/fr/strings.js @@ -217,13 +217,13 @@ define({ "FILTER_FILE_COUNT_ALL": "Autorise les {0} fichiers {1}", // Quick Edit - "ERROR_QUICK_EDIT_PROVIDER_NOT_FOUND": "Fonction Edition rapide non disponible pour la position actuelle du curseur", - "ERROR_CSSQUICKEDIT_BETWEENCLASSES": "Edition rapide CSS : placez le curseur sur un seul nom de classe", - "ERROR_CSSQUICKEDIT_CLASSNOTFOUND": "Edition rapide CSS : attribut de classe incomplet", - "ERROR_CSSQUICKEDIT_IDNOTFOUND": "Edition rapide CSS : attribut d’ID incomplet", - "ERROR_CSSQUICKEDIT_UNSUPPORTEDATTR": "Edition rapide CSS : placez le curseur dans la balise, la classe ou l’ID", - "ERROR_TIMINGQUICKEDIT_INVALIDSYNTAX": "Edition rapide des fonctions de temporisation CSS : syntaxe incorrecte", - "ERROR_JSQUICKEDIT_FUNCTIONNOTFOUND": "Edition rapide JS : placez le curseur dans le nom de fonction", + "ERROR_QUICK_EDIT_PROVIDER_NOT_FOUND": "Fonction Édition rapide non disponible pour la position actuelle du curseur", + "ERROR_CSSQUICKEDIT_BETWEENCLASSES": "Édition rapide CSS : placez le curseur sur un seul nom de classe", + "ERROR_CSSQUICKEDIT_CLASSNOTFOUND": "Édition rapide CSS : attribut de classe incomplet", + "ERROR_CSSQUICKEDIT_IDNOTFOUND": "Édition rapide CSS : attribut d’ID incomplet", + "ERROR_CSSQUICKEDIT_UNSUPPORTEDATTR": "Édition rapide CSS : placez le curseur dans la balise, la classe ou l’ID", + "ERROR_TIMINGQUICKEDIT_INVALIDSYNTAX": "Édition rapide des fonctions de temporisation CSS : syntaxe incorrecte", + "ERROR_JSQUICKEDIT_FUNCTIONNOTFOUND": "Édition rapide JS : placez le curseur dans le nom de fonction", // Quick Docs "ERROR_QUICK_DOCS_PROVIDER_NOT_FOUND": "Fonction Documentation rapide non disponible pour la position actuelle du curseur", @@ -407,7 +407,7 @@ define({ "CMD_GOTO_LINE": "Atteindre la ligne", "CMD_GOTO_DEFINITION": "Accès rapide à la définition", "CMD_GOTO_FIRST_PROBLEM": "Accéder au premier problème", - "CMD_TOGGLE_QUICK_EDIT": "Edition rapide", + "CMD_TOGGLE_QUICK_EDIT": "Édition rapide", "CMD_TOGGLE_QUICK_DOCS": "Documentation rapide", "CMD_QUICK_EDIT_PREV_MATCH": "Correspondance précédente", "CMD_QUICK_EDIT_NEXT_MATCH": "Correspondance suivante", @@ -434,7 +434,7 @@ define({ "CMD_HEALTH_DATA_STATISTICS": "Rapport d’intégrité", "CMD_HOMEPAGE": "Page d’accueil de {APP_TITLE}", "CMD_TWITTER": "{TWITTER_NAME} sur Twitter", - "CMD_ABOUT": "A propos de {APP_TITLE}", + "CMD_ABOUT": "À propos de {APP_TITLE}", "CMD_OPEN_PREFERENCES": "Ouvrir le fichier de préférences", "CMD_OPEN_KEYMAP": "Ouvrir le mappage de touches utilisateur", @@ -446,7 +446,7 @@ define({ "KEEP_CHANGES_IN_EDITOR": "Conserver les modifications dans l’éditeur", "CLOSE_DONT_SAVE": "Fermer (sans enregistrer)", "RELAUNCH_CHROME": "Relancer Chrome", - "ABOUT": "A propos", + "ABOUT": "À propos", "CLOSE": "Fermer", "ABOUT_TEXT_LINE1": "Version {VERSION_MAJOR}.{VERSION_MINOR} {BUILD_TYPE} {VERSION}", "ABOUT_TEXT_BUILD_TIMESTAMP": "Horodatage de la version : ", @@ -659,7 +659,7 @@ define({ "CMD_SHOW_PARAMETER_HINT": "Afficher l’indicateur de paramètre", "NO_ARGUMENTS": "", "DETECTED_EXCLUSION_TITLE": "Problème d’inférence de fichier Javascript", - "DETECTED_EXCLUSION_INFO": "{APP_NAME} a rencontré des problèmes lors du traitement du fichier {0}.

    La fonction d’accès aux définitions, les indicateurs de code et la fonction Edition rapide de ce fichier ne seront plus traités. Pour réactiver ce fichier, ouvrez .brackets.json dans votre projet et éditez la section jscodehints.detectedExclusions.

    Il s’agit vraisemblablement d’un bug au niveau de l’application {APP_NAME}. Si vous pouvez nous transmettre une copie de ce fichier, merci de consigner un bug en fournissant un lien vers le fichier en question.", + "DETECTED_EXCLUSION_INFO": "{APP_NAME} a rencontré des problèmes lors du traitement du fichier {0}.

    La fonction d’accès aux définitions, les indicateurs de code et la fonction Édition rapide de ce fichier ne seront plus traités. Pour réactiver ce fichier, ouvrez .brackets.json dans votre projet et éditez la section jscodehints.detectedExclusions.

    Il s’agit vraisemblablement d’un bug au niveau de l’application {APP_NAME}. Si vous pouvez nous transmettre une copie de ce fichier, merci de consigner un bug en fournissant un lien vers le fichier en question.", // extensions/default/JSLint "JSLINT_NAME": "JSLint", From 18824346b8438ac4ea8dfaaf2286b0aa996ccf77 Mon Sep 17 00:00:00 2001 From: Martin Zagora Date: Wed, 15 Mar 2017 18:48:06 +1100 Subject: [PATCH 100/121] Zaggino/update extension manager deps (#12933) * delete node_modules from extensibility/node * add dependencies from extensibility/node to main package.json * update outdated deps * use webpack to bundle semver which doesnt provide amd build * update config.json * update webpack to latest --- .gitignore | 2 + Gruntfile.js | 2 +- npm-shrinkwrap.json | 2811 ++++++++++++++++- package.json | 18 +- src/config.json | 23 +- src/extensibility/ExtensionManager.js | 2 +- .../node/node_modules/.bin/decompress-zip | 1 - .../node/node_modules/.bin/semver | 1 - .../node/node_modules/async/LICENSE | 19 - .../node/node_modules/async/README.md | 1365 -------- .../node/node_modules/async/lib/async.js | 982 ------ .../node/node_modules/async/package.json | 46 - .../node_modules/decompress-zip/.editorconfig | 12 - .../node_modules/decompress-zip/.jshintrc | 62 - .../node_modules/decompress-zip/.npmignore | 3 - .../node_modules/decompress-zip/.travis.yml | 7 - .../node_modules/decompress-zip/Gruntfile.js | 47 - .../node_modules/decompress-zip/README.md | 61 - .../decompress-zip/bin/decompress-zip | 82 - .../decompress-zip/download-test-assets.js | 38 - .../decompress-zip/lib/decompress-zip.js | 257 -- .../decompress-zip/lib/extractors.js | 121 - .../decompress-zip/lib/file-details.js | 37 - .../decompress-zip/lib/signatures.js | 10 - .../decompress-zip/lib/structures.js | 222 -- .../decompress-zip/node_modules/.bin/nopt | 1 - .../node_modules/binary/.npmignore | 1 - .../node_modules/binary/.travis.yml | 4 - .../node_modules/binary/README.markdown | 177 -- .../node_modules/binary/example/buf.js | 11 - .../node_modules/binary/example/parse.js | 10 - .../node_modules/binary/example/stream.js | 12 - .../node_modules/binary/index.js | 397 --- .../node_modules/binary/lib/vars.js | 28 - .../node_modules/buffers/README.markdown | 122 - .../node_modules/buffers/examples/slice.js | 9 - .../node_modules/buffers/examples/splice.js | 17 - .../binary/node_modules/buffers/index.js | 269 -- .../binary/node_modules/buffers/package.json | 28 - .../node_modules/buffers/test/buffers.js | 209 -- .../binary/node_modules/chainsaw/.npmignore | 1 - .../node_modules/chainsaw/README.markdown | 157 - .../node_modules/chainsaw/examples/add_do.js | 25 - .../node_modules/chainsaw/examples/prompt.js | 67 - .../binary/node_modules/chainsaw/index.js | 145 - .../chainsaw/node_modules/traverse/.npmignore | 1 - .../chainsaw/node_modules/traverse/LICENSE | 24 - .../node_modules/traverse/README.markdown | 247 -- .../node_modules/traverse/examples/json.js | 16 - .../node_modules/traverse/examples/leaves.js | 15 - .../traverse/examples/negative.js | 8 - .../traverse/examples/stringify.js | 38 - .../chainsaw/node_modules/traverse/index.js | 322 -- .../node_modules/traverse/package.json | 27 - .../node_modules/traverse/test/circular.js | 114 - .../node_modules/traverse/test/date.js | 35 - .../node_modules/traverse/test/equal.js | 219 -- .../node_modules/traverse/test/instance.js | 17 - .../node_modules/traverse/test/interface.js | 42 - .../node_modules/traverse/test/json.js | 47 - .../node_modules/traverse/test/leaves.js | 21 - .../node_modules/traverse/test/mutability.js | 203 -- .../node_modules/traverse/test/negative.js | 20 - .../node_modules/traverse/test/obj.js | 15 - .../node_modules/traverse/test/stop.js | 41 - .../node_modules/traverse/test/stringify.js | 36 - .../node_modules/traverse/test/super_deep.js | 54 - .../binary/node_modules/chainsaw/package.json | 36 - .../node_modules/chainsaw/test/chainsaw.js | 418 --- .../node_modules/binary/package.json | 45 - .../node_modules/binary/perf/loop.js | 92 - .../node_modules/binary/perf/small.js | 80 - .../node_modules/binary/test/bu.js | 46 - .../node_modules/binary/test/deferred.js | 20 - .../node_modules/binary/test/dots.js | 23 - .../node_modules/binary/test/eof.js | 41 - .../node_modules/binary/test/flush.js | 17 - .../node_modules/binary/test/from_buffer.js | 14 - .../node_modules/binary/test/get_buffer.js | 28 - .../node_modules/binary/test/immediate.js | 18 - .../node_modules/binary/test/interval.js | 38 - .../node_modules/binary/test/into_buffer.js | 35 - .../node_modules/binary/test/into_stream.js | 43 - .../node_modules/binary/test/loop.js | 44 - .../node_modules/binary/test/loop_scan.js | 54 - .../node_modules/binary/test/lu.js | 46 - .../node_modules/binary/test/negbs.js | 29 - .../node_modules/binary/test/negls.js | 29 - .../node_modules/binary/test/nested.js | 35 - .../binary/test/not_enough_buf.js | 17 - .../binary/test/not_enough_parse.js | 19 - .../node_modules/binary/test/parse.js | 54 - .../node_modules/binary/test/peek.js | 40 - .../node_modules/binary/test/pipe.js | 49 - .../node_modules/binary/test/posbs.js | 29 - .../node_modules/binary/test/posls.js | 29 - .../node_modules/binary/test/scan.js | 33 - .../node_modules/binary/test/scan_buf.js | 18 - .../node_modules/binary/test/scan_buf_null.js | 16 - .../node_modules/binary/test/skip.js | 58 - .../node_modules/binary/test/split.js | 34 - .../node_modules/mkpath/.npmignore | 1 - .../node_modules/mkpath/LICENSE | 7 - .../node_modules/mkpath/README.md | 27 - .../node_modules/mkpath/mkpath.js | 59 - .../node_modules/mkpath/package.json | 35 - .../node_modules/mkpath/test/chmod.js | 42 - .../node_modules/mkpath/test/clobber.js | 41 - .../node_modules/mkpath/test/mkpath.js | 32 - .../node_modules/mkpath/test/perm.js | 36 - .../node_modules/mkpath/test/perm_sync.js | 43 - .../node_modules/mkpath/test/rel.js | 36 - .../node_modules/mkpath/test/root.js | 22 - .../node_modules/mkpath/test/sync.js | 36 - .../node_modules/mkpath/test/umask.js | 32 - .../node_modules/mkpath/test/umask_sync.js | 36 - .../node_modules/nopt/.npmignore | 1 - .../decompress-zip/node_modules/nopt/LICENSE | 23 - .../node_modules/nopt/README.md | 210 -- .../node_modules/nopt/bin/nopt.js | 51 - .../node_modules/nopt/examples/my-program.js | 30 - .../node_modules/nopt/lib/nopt.js | 612 ---- .../nopt/node_modules/abbrev/LICENSE | 23 - .../nopt/node_modules/abbrev/README.md | 23 - .../nopt/node_modules/abbrev/lib/abbrev.js | 111 - .../nopt/node_modules/abbrev/package.json | 28 - .../node_modules/nopt/package.json | 35 - .../node_modules/q/CONTRIBUTING.md | 40 - .../decompress-zip/node_modules/q/LICENSE | 19 - .../decompress-zip/node_modules/q/README.md | 813 ----- .../q/benchmark/compare-with-callbacks.js | 71 - .../node_modules/q/benchmark/scenarios.js | 36 - .../node_modules/q/package.json | 93 - .../decompress-zip/node_modules/q/q.js | 1937 ------------ .../decompress-zip/node_modules/q/queue.js | 35 - .../node_modules/readable-stream/LICENSE | 18 - .../node_modules/readable-stream/README.md | 768 ----- .../node_modules/readable-stream/duplex.js | 1 - .../readable-stream/examples/CAPSLOCKTYPER.JS | 32 - .../readable-stream/examples/typer-fsr.js | 15 - .../readable-stream/examples/typer.js | 17 - .../node_modules/readable-stream/float.patch | 923 ------ .../node_modules/readable-stream/fs.js | 1705 ---------- .../readable-stream/lib/_stream_duplex.js | 69 - .../lib/_stream_passthrough.js | 41 - .../readable-stream/lib/_stream_readable.js | 920 ------ .../readable-stream/lib/_stream_transform.js | 210 -- .../readable-stream/lib/_stream_writable.js | 459 --- .../node_modules/core-util-is/README.md | 3 - .../node_modules/core-util-is/float.patch | 590 ---- .../node_modules/core-util-is/lib/util.js | 106 - .../node_modules/core-util-is/package.json | 34 - .../node_modules/core-util-is/util.js | 106 - .../node_modules/debuglog/LICENSE | 19 - .../node_modules/debuglog/README.md | 40 - .../node_modules/debuglog/debuglog.js | 22 - .../node_modules/debuglog/package.json | 25 - .../node_modules/readable-stream/package.json | 41 - .../readable-stream/passthrough.js | 1 - .../node_modules/readable-stream/readable.js | 7 - .../readable-stream/test/common.js | 200 -- .../readable-stream/test/fixtures/x1024.txt | 1 - .../readable-stream/test/simple/test-GH-64.js | 18 - .../readable-stream/test/simple/test-GH-66.js | 18 - .../test/simple/test-stream-big-push.js | 84 - .../test/simple/test-stream-end-paused.js | 53 - .../test/simple/test-stream-pipe-after-end.js | 86 - .../simple/test-stream-pipe-error-handling.js | 131 - .../test/simple/test-stream-pipe-event.js | 49 - .../test/simple/test-stream-push-order.js | 52 - .../test/simple/test-stream-push-strings.js | 66 - .../test/simple/test-stream-readable-event.js | 126 - .../test-stream-readable-flow-recursion.js | 76 - .../simple/test-stream-unshift-empty-chunk.js | 81 - .../simple/test-stream-unshift-read-race.js | 140 - .../test/simple/test-stream-writev.js | 121 - .../test/simple/test-stream2-basic.js | 475 --- .../test/simple/test-stream2-compatibility.js | 53 - .../test/simple/test-stream2-finish-pipe.js | 41 - .../simple/test-stream2-large-read-stall.js | 82 - .../test/simple/test-stream2-objects.js | 351 -- .../test-stream2-pipe-error-handling.js | 105 - .../test-stream2-pipe-error-once-listener.js | 64 - .../test/simple/test-stream2-push.js | 138 - .../simple/test-stream2-read-sync-stack.js | 54 - ...st-stream2-readable-empty-buffer-no-eof.js | 89 - .../simple/test-stream2-readable-from-list.js | 120 - .../test-stream2-readable-legacy-drain.js | 75 - .../test-stream2-readable-non-empty-end.js | 78 - .../test-stream2-readable-wrap-empty.js | 43 - .../test/simple/test-stream2-readable-wrap.js | 105 - .../test/simple/test-stream2-set-encoding.js | 361 --- .../test/simple/test-stream2-transform.js | 522 --- .../test/simple/test-stream2-unpipe-drain.js | 76 - .../test/simple/test-stream2-unpipe-leak.js | 75 - .../test/simple/test-stream2-writable.js | 393 --- .../simple/test-stream3-pause-then-read.js | 167 - .../node_modules/readable-stream/transform.js | 1 - .../node_modules/readable-stream/writable.js | 1 - .../node_modules/readable-stream/zlib.js | 452 --- .../decompress-zip/node_modules/touch/LICENSE | 23 - .../node_modules/touch/README.md | 33 - .../node_modules/touch/bin/touch.js | 31 - .../node_modules/touch/node_modules/.bin/nopt | 1 - .../touch/node_modules/nopt/.npmignore | 0 .../touch/node_modules/nopt/LICENSE | 23 - .../touch/node_modules/nopt/README.md | 208 -- .../touch/node_modules/nopt/bin/nopt.js | 44 - .../node_modules/nopt/examples/my-program.js | 30 - .../touch/node_modules/nopt/lib/nopt.js | 552 ---- .../nopt/node_modules/abbrev/LICENSE | 23 - .../nopt/node_modules/abbrev/README.md | 23 - .../nopt/node_modules/abbrev/lib/abbrev.js | 111 - .../nopt/node_modules/abbrev/package.json | 28 - .../touch/node_modules/nopt/package.json | 35 - .../node_modules/touch/package.json | 28 - .../node_modules/touch/test/sanity.js | 31 - .../node_modules/touch/touch.js | 154 - .../node_modules/decompress-zip/package.json | 67 - .../node_modules/decompress-zip/test/test.js | 110 - .../node/node_modules/fs-extra/.npmignore | 2 - .../node/node_modules/fs-extra/CHANGELOG.md | 94 - .../node/node_modules/fs-extra/LICENSE | 16 - .../node/node_modules/fs-extra/README.md | 310 -- .../node/node_modules/fs-extra/lib/copy.js | 44 - .../node/node_modules/fs-extra/lib/create.js | 55 - .../node/node_modules/fs-extra/lib/index.js | 109 - .../node/node_modules/fs-extra/lib/json.js | 30 - .../node/node_modules/fs-extra/lib/mkdir.js | 8 - .../node/node_modules/fs-extra/lib/output.js | 37 - .../node/node_modules/fs-extra/lib/remove.js | 19 - .../fs-extra/node_modules/.bin/ncp | 1 - .../fs-extra/node_modules/.bin/rimraf | 1 - .../fs-extra/node_modules/jsonfile/.npmignore | 2 - .../node_modules/jsonfile/CHANGELOG.md | 12 - .../fs-extra/node_modules/jsonfile/LICENSE | 15 - .../fs-extra/node_modules/jsonfile/README.md | 109 - .../node_modules/jsonfile/lib/jsonfile.js | 37 - .../node_modules/jsonfile/package.json | 40 - .../fs-extra/node_modules/mkdirp/.npmignore | 2 - .../fs-extra/node_modules/mkdirp/.travis.yml | 5 - .../fs-extra/node_modules/mkdirp/LICENSE | 21 - .../node_modules/mkdirp/examples/pow.js | 6 - .../fs-extra/node_modules/mkdirp/index.js | 82 - .../fs-extra/node_modules/mkdirp/package.json | 33 - .../node_modules/mkdirp/readme.markdown | 63 - .../node_modules/mkdirp/test/chmod.js | 38 - .../node_modules/mkdirp/test/clobber.js | 37 - .../node_modules/mkdirp/test/mkdirp.js | 28 - .../fs-extra/node_modules/mkdirp/test/perm.js | 32 - .../node_modules/mkdirp/test/perm_sync.js | 39 - .../fs-extra/node_modules/mkdirp/test/race.js | 41 - .../fs-extra/node_modules/mkdirp/test/rel.js | 32 - .../node_modules/mkdirp/test/return.js | 25 - .../node_modules/mkdirp/test/return_sync.js | 24 - .../fs-extra/node_modules/mkdirp/test/root.js | 18 - .../fs-extra/node_modules/mkdirp/test/sync.js | 32 - .../node_modules/mkdirp/test/umask.js | 28 - .../node_modules/mkdirp/test/umask_sync.js | 32 - .../fs-extra/node_modules/ncp/.npmignore | 4 - .../fs-extra/node_modules/ncp/.travis.yml | 7 - .../fs-extra/node_modules/ncp/LICENSE.md | 21 - .../fs-extra/node_modules/ncp/README.md | 52 - .../fs-extra/node_modules/ncp/bin/ncp | 48 - .../fs-extra/node_modules/ncp/lib/ncp.js | 222 -- .../fs-extra/node_modules/ncp/package.json | 40 - .../node_modules/ncp/test/fixtures/src/a | 1 - .../node_modules/ncp/test/fixtures/src/b | 1 - .../node_modules/ncp/test/fixtures/src/c | 0 .../node_modules/ncp/test/fixtures/src/d | 0 .../node_modules/ncp/test/fixtures/src/e | 0 .../node_modules/ncp/test/fixtures/src/f | 0 .../node_modules/ncp/test/fixtures/src/sub/a | 1 - .../node_modules/ncp/test/fixtures/src/sub/b | 0 .../node_modules/ncp/test/ncp-test.js | 86 - .../fs-extra/node_modules/rimraf/AUTHORS | 6 - .../fs-extra/node_modules/rimraf/LICENSE | 23 - .../fs-extra/node_modules/rimraf/README.md | 26 - .../fs-extra/node_modules/rimraf/bin.js | 33 - .../node_modules/graceful-fs/.npmignore | 1 - .../rimraf/node_modules/graceful-fs/LICENSE | 27 - .../rimraf/node_modules/graceful-fs/README.md | 26 - .../node_modules/graceful-fs/graceful-fs.js | 159 - .../node_modules/graceful-fs/package.json | 48 - .../node_modules/graceful-fs/polyfills.js | 228 -- .../node_modules/graceful-fs/test/open.js | 39 - .../fs-extra/node_modules/rimraf/package.json | 61 - .../fs-extra/node_modules/rimraf/rimraf.js | 184 -- .../fs-extra/node_modules/rimraf/test/run.sh | 10 - .../node_modules/rimraf/test/setup.sh | 47 - .../node_modules/rimraf/test/test-async.js | 5 - .../node_modules/rimraf/test/test-sync.js | 3 - .../node/node_modules/fs-extra/package.json | 68 - .../node/node_modules/request/.npmignore | 1 - .../node/node_modules/request/LICENSE | 55 - .../node/node_modules/request/README.md | 332 -- .../node/node_modules/request/index.js | 149 - .../node/node_modules/request/lib/copy.js | 8 - .../node/node_modules/request/lib/debug.js | 5 - .../node/node_modules/request/lib/getSafe.js | 34 - .../request/node_modules/aws-sign/LICENSE | 55 - .../request/node_modules/aws-sign/README.md | 4 - .../request/node_modules/aws-sign/index.js | 202 -- .../node_modules/aws-sign/package.json | 27 - .../request/node_modules/cookie-jar/LICENSE | 55 - .../request/node_modules/cookie-jar/README.md | 4 - .../request/node_modules/cookie-jar/index.js | 67 - .../request/node_modules/cookie-jar/jar.js | 72 - .../node_modules/cookie-jar/package.json | 30 - .../node_modules/cookie-jar/tests/run.js | 40 - .../cookie-jar/tests/test-cookie.js | 29 - .../cookie-jar/tests/test-cookiejar.js | 90 - .../node_modules/forever-agent/LICENSE | 55 - .../node_modules/forever-agent/README.md | 4 - .../node_modules/forever-agent/index.js | 119 - .../node_modules/forever-agent/package.json | 27 - .../request/node_modules/form-data/License | 19 - .../request/node_modules/form-data/Readme.md | 160 - .../node_modules/form-data/lib/form_data.js | 324 -- .../form-data/node_modules/async/LICENSE | 19 - .../form-data/node_modules/async/README.md | 1414 --------- .../node_modules/async/component.json | 11 - .../form-data/node_modules/async/lib/async.js | 955 ------ .../form-data/node_modules/async/package.json | 42 - .../node_modules/combined-stream/.npmignore | 3 - .../node_modules/combined-stream/License | 19 - .../node_modules/combined-stream/Makefile | 7 - .../node_modules/combined-stream/Readme.md | 132 - .../combined-stream/lib/combined_stream.js | 185 -- .../node_modules/delayed-stream/.npmignore | 2 - .../node_modules/delayed-stream/License | 19 - .../node_modules/delayed-stream/Makefile | 7 - .../node_modules/delayed-stream/Readme.md | 154 - .../delayed-stream/lib/delayed_stream.js | 99 - .../node_modules/delayed-stream/package.json | 31 - .../delayed-stream/test/common.js | 6 - .../integration/test-delayed-http-upload.js | 38 - .../test-delayed-stream-auto-pause.js | 21 - .../integration/test-delayed-stream-pause.js | 14 - .../test/integration/test-delayed-stream.js | 48 - .../integration/test-handle-source-errors.js | 15 - .../test/integration/test-max-data-size.js | 18 - .../test/integration/test-pipe-resumes.js | 13 - .../test/integration/test-proxy-readable.js | 13 - .../node_modules/delayed-stream/test/run.js | 7 - .../node_modules/combined-stream/package.json | 32 - .../combined-stream/test/common.js | 23 - .../combined-stream/test/fixture/file1.txt | 256 -- .../combined-stream/test/fixture/file2.txt | 256 -- .../test/integration/test-callback-streams.js | 27 - .../test/integration/test-data-size.js | 34 - ...delayed-streams-and-buffers-and-strings.js | 38 - .../test/integration/test-delayed-streams.js | 35 - .../test/integration/test-empty-string.js | 39 - .../test/integration/test-is-stream-like.js | 17 - .../test/integration/test-max-data-size.js | 24 - .../test/integration/test-unpaused-streams.js | 30 - .../node_modules/combined-stream/test/run.js | 7 - .../node_modules/form-data/package.json | 45 - .../request/node_modules/hawk/.npmignore | 18 - .../request/node_modules/hawk/.travis.yml | 5 - .../request/node_modules/hawk/LICENSE | 24 - .../request/node_modules/hawk/Makefile | 10 - .../request/node_modules/hawk/README.md | 627 ---- .../node_modules/hawk/example/usage.js | 78 - .../request/node_modules/hawk/images/hawk.png | Bin 6945 -> 0 bytes .../request/node_modules/hawk/images/logo.png | Bin 71732 -> 0 bytes .../request/node_modules/hawk/index.js | 1 - .../request/node_modules/hawk/lib/browser.js | 485 --- .../request/node_modules/hawk/lib/client.js | 367 --- .../request/node_modules/hawk/lib/crypto.js | 111 - .../request/node_modules/hawk/lib/index.js | 15 - .../request/node_modules/hawk/lib/server.js | 524 --- .../request/node_modules/hawk/lib/utils.js | 183 -- .../hawk/node_modules/boom/.npmignore | 18 - .../hawk/node_modules/boom/.travis.yml | 5 - .../hawk/node_modules/boom/LICENSE | 24 - .../hawk/node_modules/boom/Makefile | 11 - .../hawk/node_modules/boom/README.md | 6 - .../hawk/node_modules/boom/images/boom.png | Bin 29479 -> 0 bytes .../hawk/node_modules/boom/index.js | 1 - .../hawk/node_modules/boom/lib/index.js | 207 -- .../hawk/node_modules/boom/package.json | 46 - .../hawk/node_modules/boom/test/index.js | 245 -- .../hawk/node_modules/cryptiles/.npmignore | 18 - .../hawk/node_modules/cryptiles/.travis.yml | 5 - .../hawk/node_modules/cryptiles/LICENSE | 24 - .../hawk/node_modules/cryptiles/Makefile | 11 - .../hawk/node_modules/cryptiles/README.md | 6 - .../hawk/node_modules/cryptiles/index.js | 1 - .../hawk/node_modules/cryptiles/lib/index.js | 68 - .../hawk/node_modules/cryptiles/package.json | 47 - .../hawk/node_modules/cryptiles/test/index.js | 101 - .../hawk/node_modules/hoek/.npmignore | 18 - .../hawk/node_modules/hoek/.travis.yml | 5 - .../hawk/node_modules/hoek/LICENSE | 33 - .../hawk/node_modules/hoek/Makefile | 10 - .../hawk/node_modules/hoek/README.md | 436 --- .../hawk/node_modules/hoek/images/hoek.png | Bin 37939 -> 0 bytes .../hawk/node_modules/hoek/index.js | 1 - .../hawk/node_modules/hoek/lib/escape.js | 132 - .../hawk/node_modules/hoek/lib/index.js | 585 ---- .../hawk/node_modules/hoek/package.json | 48 - .../hawk/node_modules/hoek/test/escaper.js | 86 - .../hawk/node_modules/hoek/test/index.js | 1078 ------- .../node_modules/hoek/test/modules/test1.js | 1 - .../node_modules/hoek/test/modules/test2.js | 1 - .../node_modules/hoek/test/modules/test3.js | 1 - .../hawk/node_modules/sntp/.npmignore | 18 - .../hawk/node_modules/sntp/.travis.yml | 5 - .../hawk/node_modules/sntp/LICENSE | 24 - .../hawk/node_modules/sntp/Makefile | 11 - .../hawk/node_modules/sntp/README.md | 68 - .../hawk/node_modules/sntp/examples/offset.js | 16 - .../hawk/node_modules/sntp/examples/time.js | 25 - .../hawk/node_modules/sntp/index.js | 1 - .../hawk/node_modules/sntp/lib/index.js | 409 --- .../hawk/node_modules/sntp/package.json | 47 - .../hawk/node_modules/sntp/test/index.js | 359 --- .../request/node_modules/hawk/package.json | 52 - .../request/node_modules/hawk/test/browser.js | 771 ----- .../request/node_modules/hawk/test/client.js | 206 -- .../request/node_modules/hawk/test/crypto.js | 86 - .../request/node_modules/hawk/test/index.js | 316 -- .../request/node_modules/hawk/test/message.js | 246 -- .../request/node_modules/hawk/test/readme.js | 98 - .../request/node_modules/hawk/test/server.js | 686 ---- .../request/node_modules/hawk/test/uri.js | 456 --- .../request/node_modules/hawk/test/utils.js | 120 - .../http-signature/.dir-locals.el | 6 - .../node_modules/http-signature/.npmignore | 7 - .../node_modules/http-signature/LICENSE | 18 - .../node_modules/http-signature/README.md | 75 - .../http-signature/http_signing.md | 296 -- .../node_modules/http-signature/lib/index.js | 25 - .../node_modules/http-signature/lib/parser.js | 304 -- .../node_modules/http-signature/lib/signer.js | 179 -- .../node_modules/http-signature/lib/util.js | 249 -- .../node_modules/http-signature/lib/verify.js | 42 - .../node_modules/asn1/.npmignore | 2 - .../http-signature/node_modules/asn1/LICENSE | 19 - .../node_modules/asn1/README.md | 50 - .../node_modules/asn1/lib/ber/errors.js | 13 - .../node_modules/asn1/lib/ber/index.js | 27 - .../node_modules/asn1/lib/ber/reader.js | 267 -- .../node_modules/asn1/lib/ber/types.js | 36 - .../node_modules/asn1/lib/ber/writer.js | 317 -- .../node_modules/asn1/lib/index.js | 20 - .../node_modules/asn1/package.json | 42 - .../node_modules/asn1/tst/ber/reader.test.js | 172 - .../node_modules/asn1/tst/ber/writer.test.js | 296 -- .../node_modules/assert-plus/README.md | 126 - .../node_modules/assert-plus/assert.js | 196 -- .../node_modules/assert-plus/package.json | 20 - .../node_modules/ctype/CHANGELOG | 71 - .../http-signature/node_modules/ctype/LICENSE | 24 - .../http-signature/node_modules/ctype/README | 82 - .../node_modules/ctype/README.old | 298 -- .../http-signature/node_modules/ctype/ctf.js | 245 -- .../http-signature/node_modules/ctype/ctio.js | 1485 --------- .../node_modules/ctype/ctype.js | 944 ------ .../ctype/man/man3ctype/ctio.3ctype | 241 -- .../node_modules/ctype/package.json | 18 - .../node_modules/ctype/tools/jsl.conf | 129 - .../node_modules/ctype/tools/jsstyle | 839 ----- .../node_modules/ctype/tst/ctf/float.json | 13 - .../node_modules/ctype/tst/ctf/int.json | 13 - .../node_modules/ctype/tst/ctf/psinfo.json | 104 - .../node_modules/ctype/tst/ctf/struct.json | 19 - .../node_modules/ctype/tst/ctf/tst.fail.js | 39 - .../node_modules/ctype/tst/ctf/tst.float.js | 14 - .../node_modules/ctype/tst/ctf/tst.int.js | 14 - .../node_modules/ctype/tst/ctf/tst.psinfo.js | 17 - .../node_modules/ctype/tst/ctf/tst.struct.js | 18 - .../node_modules/ctype/tst/ctf/tst.typedef.js | 15 - .../node_modules/ctype/tst/ctf/typedef.json | 14 - .../ctype/tst/ctio/float/tst.rfloat.js | 767 ----- .../ctype/tst/ctio/float/tst.wfloat.js | 753 ----- .../node_modules/ctype/tst/ctio/int/tst.64.js | 638 ---- .../ctype/tst/ctio/int/tst.rint.js | 101 - .../ctype/tst/ctio/int/tst.wbounds.js | 53 - .../ctype/tst/ctio/int/tst.wint.js | 92 - .../ctype/tst/ctio/uint/tst.64.js | 451 --- .../ctype/tst/ctio/uint/tst.roundtrip.js | 81 - .../ctype/tst/ctio/uint/tst.ruint.js | 95 - .../ctype/tst/ctio/uint/tst.wuint.js | 156 - .../ctype/tst/ctype/tst.basicr.js | 50 - .../ctype/tst/ctype/tst.basicw.js | 44 - .../node_modules/ctype/tst/ctype/tst.char.js | 42 - .../ctype/tst/ctype/tst.endian.js | 45 - .../ctype/tst/ctype/tst.oldwrite.js | 28 - .../ctype/tst/ctype/tst.readSize.js | 128 - .../ctype/tst/ctype/tst.structw.js | 28 - .../ctype/tst/ctype/tst.writeStruct.js | 31 - .../node_modules/http-signature/package.json | 35 - .../node_modules/json-stringify-safe/LICENSE | 27 - .../json-stringify-safe/README.md | 49 - .../json-stringify-safe/package.json | 32 - .../json-stringify-safe/stringify.js | 39 - .../node_modules/json-stringify-safe/test.js | 128 - .../request/node_modules/mime/LICENSE | 19 - .../request/node_modules/mime/README.md | 66 - .../request/node_modules/mime/mime.js | 114 - .../request/node_modules/mime/package.json | 35 - .../request/node_modules/mime/test.js | 84 - .../node_modules/mime/types/mime.types | 1588 ---------- .../node_modules/mime/types/node.types | 77 - .../request/node_modules/node-uuid/.npmignore | 2 - .../request/node_modules/node-uuid/LICENSE.md | 2 - .../request/node_modules/node-uuid/README.md | 207 -- .../node-uuid/benchmark/README.md | 53 - .../node-uuid/benchmark/bench.gnu | 174 - .../node_modules/node-uuid/benchmark/bench.sh | 34 - .../node-uuid/benchmark/benchmark-native.c | 34 - .../node-uuid/benchmark/benchmark.js | 84 - .../node_modules/node-uuid/component.json | 18 - .../node_modules/node-uuid/package.json | 34 - .../node_modules/node-uuid/test/compare_v1.js | 63 - .../node_modules/node-uuid/test/test.html | 17 - .../node_modules/node-uuid/test/test.js | 228 -- .../request/node_modules/node-uuid/uuid.js | 245 -- .../request/node_modules/oauth-sign/LICENSE | 55 - .../request/node_modules/oauth-sign/README.md | 4 - .../request/node_modules/oauth-sign/index.js | 43 - .../node_modules/oauth-sign/package.json | 30 - .../request/node_modules/oauth-sign/test.js | 49 - .../request/node_modules/qs/.gitmodules | 6 - .../request/node_modules/qs/.npmignore | 7 - .../request/node_modules/qs/Readme.md | 58 - .../request/node_modules/qs/index.js | 387 --- .../request/node_modules/qs/package.json | 37 - .../request/node_modules/tunnel-agent/LICENSE | 55 - .../node_modules/tunnel-agent/README.md | 4 - .../node_modules/tunnel-agent/index.js | 227 -- .../node_modules/tunnel-agent/package.json | 27 - .../node/node_modules/request/package.json | 47 - .../node/node_modules/request/request.js | 1235 -------- .../node/node_modules/rewire/.npmignore | 15 - .../node/node_modules/rewire/.travis.yml | 7 - .../node/node_modules/rewire/CHANGELOG.md | 30 - .../node/node_modules/rewire/LICENSE | 18 - .../node/node_modules/rewire/README.md | 146 - .../node/node_modules/rewire/lib/__get__.js | 21 - .../node/node_modules/rewire/lib/__set__.js | 42 - .../browserify/browserifyMiddleware.js | 113 - .../bundlers/browserify/browserifyRewire.js | 189 -- .../rewire/lib/bundlers/getRewireRegExp.js | 15 - .../rewire/lib/bundlers/getRewireRequires.js | 24 - .../rewire/lib/bundlers/injectRewire.js | 46 - .../lib/bundlers/webpack/configureWebpack.js | 26 - .../bundlers/webpack/getLoaderTestRegExp.js | 16 - .../lib/bundlers/webpack/webpackPostLoader.js | 80 - .../bundlers/webpack/webpackPostProcessor.js | 24 - .../lib/bundlers/webpack/webpackRewire.js | 76 - .../rewire/lib/detectStrictMode.js | 12 - .../rewire/lib/getImportGlobalsSrc.js | 29 - .../node/node_modules/rewire/lib/index.js | 21 - .../node/node_modules/rewire/lib/moduleEnv.js | 82 - .../node/node_modules/rewire/lib/rewire.js | 57 - .../node/node_modules/rewire/package.json | 45 - .../node_modules/rewire/test/__get__.test.js | 79 - .../node_modules/rewire/test/__set__.test.js | 104 - .../node_modules/rewire/test/debug.test.js | 11 - .../rewire/test/detectStrictMode.test.js | 23 - .../rewire/test/getImportGlobalsSrc.test.js | 42 - .../node_modules/rewire/test/rewire.test.js | 34 - .../rewire/test/testModules/debuggerModule.js | 7 - .../rewire/test/testModules/emptyModule.js | 5 - .../fake_node_modules/rewire/package.json | 3 - .../rewire/test/testModules/module.coffee | 3 - .../rewire/test/testModules/moduleA.js | 135 - .../rewire/test/testModules/moduleB.js | 137 - .../test/testModules/sharedTestCases.js | 179 -- .../test/testModules/someOtherModule.js | 6 - .../rewire/test/testModules/strictModule.js | 7 - .../rewire/test/testModules/throwError.js | 3 - .../node/node_modules/semver/.npmignore | 1 - .../node/node_modules/semver/LICENSE | 27 - .../node/node_modules/semver/Makefile | 24 - .../node/node_modules/semver/README.md | 123 - .../node/node_modules/semver/bin/semver | 119 - .../node/node_modules/semver/foot.js | 6 - .../node/node_modules/semver/head.js | 2 - .../node/node_modules/semver/package.json | 31 - .../node_modules/semver/semver.browser.js | 919 ------ .../node_modules/semver/semver.browser.js.gz | Bin 6347 -> 0 bytes .../node/node_modules/semver/semver.js | 923 ------ .../node/node_modules/semver/semver.min.js | 1 - .../node/node_modules/semver/semver.min.js.gz | Bin 2982 -> 0 bytes .../node/node_modules/semver/test/amd.js | 15 - .../node/node_modules/semver/test/index.js | 556 ---- .../node_modules/semver/test/no-module.js | 19 - .../node/node_modules/temp/.npmignore | 7 - .../node/node_modules/temp/.travis.yml | 6 - .../node/node_modules/temp/LICENSE | 20 - .../node/node_modules/temp/README.md | 277 -- .../node_modules/temp/examples/grepcount.js | 18 - .../node_modules/temp/examples/pdfcreator.js | 22 - .../node/node_modules/temp/lib/temp.js | 182 -- .../temp/node_modules/osenv/LICENSE | 25 - .../temp/node_modules/osenv/README.md | 63 - .../temp/node_modules/osenv/osenv.js | 80 - .../temp/node_modules/osenv/package.json | 42 - .../temp/node_modules/osenv/test/unix.js | 76 - .../temp/node_modules/osenv/test/windows.js | 82 - .../temp/node_modules/rimraf/AUTHORS | 6 - .../temp/node_modules/rimraf/LICENSE | 23 - .../temp/node_modules/rimraf/README.md | 21 - .../node_modules/graceful-fs/.npmignore | 1 - .../rimraf/node_modules/graceful-fs/LICENSE | 27 - .../rimraf/node_modules/graceful-fs/README.md | 33 - .../node_modules/graceful-fs/graceful-fs.js | 442 --- .../node_modules/graceful-fs/package.json | 48 - .../node_modules/graceful-fs/test/open.js | 46 - .../node_modules/graceful-fs/test/ulimit.js | 158 - .../temp/node_modules/rimraf/package.json | 58 - .../temp/node_modules/rimraf/rimraf.js | 132 - .../temp/node_modules/rimraf/test/run.sh | 10 - .../temp/node_modules/rimraf/test/setup.sh | 47 - .../node_modules/rimraf/test/test-async.js | 5 - .../node_modules/rimraf/test/test-sync.js | 3 - .../node/node_modules/temp/package.json | 48 - .../node/node_modules/temp/test/temp-test.js | 77 - src/extensibility/node/package.json | 16 - tasks/pack-web-dependencies.js | 49 + 625 files changed, 2874 insertions(+), 68397 deletions(-) delete mode 120000 src/extensibility/node/node_modules/.bin/decompress-zip delete mode 120000 src/extensibility/node/node_modules/.bin/semver delete mode 100644 src/extensibility/node/node_modules/async/LICENSE delete mode 100644 src/extensibility/node/node_modules/async/README.md delete mode 100755 src/extensibility/node/node_modules/async/lib/async.js delete mode 100644 src/extensibility/node/node_modules/async/package.json delete mode 100644 src/extensibility/node/node_modules/decompress-zip/.editorconfig delete mode 100644 src/extensibility/node/node_modules/decompress-zip/.jshintrc delete mode 100644 src/extensibility/node/node_modules/decompress-zip/.npmignore delete mode 100644 src/extensibility/node/node_modules/decompress-zip/.travis.yml delete mode 100644 src/extensibility/node/node_modules/decompress-zip/Gruntfile.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/README.md delete mode 100755 src/extensibility/node/node_modules/decompress-zip/bin/decompress-zip delete mode 100644 src/extensibility/node/node_modules/decompress-zip/download-test-assets.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/lib/decompress-zip.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/lib/extractors.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/lib/file-details.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/lib/signatures.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/lib/structures.js delete mode 120000 src/extensibility/node/node_modules/decompress-zip/node_modules/.bin/nopt delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/.npmignore delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/.travis.yml delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/README.markdown delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/example/buf.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/example/parse.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/example/stream.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/index.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/lib/vars.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/buffers/README.markdown delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/buffers/examples/slice.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/buffers/examples/splice.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/buffers/index.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/buffers/package.json delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/buffers/test/buffers.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/.npmignore delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/README.markdown delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/examples/add_do.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/examples/prompt.js delete mode 100755 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/index.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/.npmignore delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/LICENSE delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/README.markdown delete mode 100755 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/examples/json.js delete mode 100755 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/examples/leaves.js delete mode 100755 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/examples/negative.js delete mode 100755 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/examples/stringify.js delete mode 100755 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/index.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/package.json delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/test/circular.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/test/date.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/test/equal.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/test/instance.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/test/interface.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/test/json.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/test/leaves.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/test/mutability.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/test/negative.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/test/obj.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/test/stop.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/test/stringify.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/test/super_deep.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/package.json delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/test/chainsaw.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/package.json delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/perf/loop.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/perf/small.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/bu.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/deferred.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/dots.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/eof.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/flush.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/from_buffer.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/get_buffer.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/immediate.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/interval.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/into_buffer.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/into_stream.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/loop.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/loop_scan.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/lu.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/negbs.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/negls.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/nested.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/not_enough_buf.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/not_enough_parse.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/parse.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/peek.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/pipe.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/posbs.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/posls.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/scan.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/scan_buf.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/scan_buf_null.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/skip.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/split.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/.npmignore delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/LICENSE delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/README.md delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/mkpath.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/package.json delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/test/chmod.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/test/clobber.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/test/mkpath.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/test/perm.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/test/perm_sync.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/test/rel.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/test/root.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/test/sync.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/test/umask.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/test/umask_sync.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/nopt/.npmignore delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/nopt/LICENSE delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/nopt/README.md delete mode 100755 src/extensibility/node/node_modules/decompress-zip/node_modules/nopt/bin/nopt.js delete mode 100755 src/extensibility/node/node_modules/decompress-zip/node_modules/nopt/examples/my-program.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/nopt/lib/nopt.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/nopt/node_modules/abbrev/LICENSE delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/nopt/node_modules/abbrev/README.md delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/nopt/node_modules/abbrev/lib/abbrev.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/nopt/node_modules/abbrev/package.json delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/nopt/package.json delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/q/CONTRIBUTING.md delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/q/LICENSE delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/q/README.md delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/q/benchmark/compare-with-callbacks.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/q/benchmark/scenarios.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/q/package.json delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/q/q.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/q/queue.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/LICENSE delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/README.md delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/duplex.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/examples/CAPSLOCKTYPER.JS delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/examples/typer-fsr.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/examples/typer.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/float.patch delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/fs.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/lib/_stream_duplex.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/lib/_stream_passthrough.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/lib/_stream_readable.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/lib/_stream_transform.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/lib/_stream_writable.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/node_modules/core-util-is/README.md delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/node_modules/core-util-is/float.patch delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/node_modules/core-util-is/lib/util.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/node_modules/core-util-is/package.json delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/node_modules/core-util-is/util.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/node_modules/debuglog/LICENSE delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/node_modules/debuglog/README.md delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/node_modules/debuglog/debuglog.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/node_modules/debuglog/package.json delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/package.json delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/passthrough.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/readable.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/test/common.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/test/fixtures/x1024.txt delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/test/simple/test-GH-64.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/test/simple/test-GH-66.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/test/simple/test-stream-big-push.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/test/simple/test-stream-end-paused.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/test/simple/test-stream-pipe-after-end.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/test/simple/test-stream-pipe-error-handling.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/test/simple/test-stream-pipe-event.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/test/simple/test-stream-push-order.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/test/simple/test-stream-push-strings.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/test/simple/test-stream-readable-event.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/test/simple/test-stream-readable-flow-recursion.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/test/simple/test-stream-unshift-empty-chunk.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/test/simple/test-stream-unshift-read-race.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/test/simple/test-stream-writev.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/test/simple/test-stream2-basic.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/test/simple/test-stream2-compatibility.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/test/simple/test-stream2-finish-pipe.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/test/simple/test-stream2-large-read-stall.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/test/simple/test-stream2-objects.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/test/simple/test-stream2-pipe-error-handling.js delete mode 100755 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/test/simple/test-stream2-pipe-error-once-listener.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/test/simple/test-stream2-push.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/test/simple/test-stream2-read-sync-stack.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/test/simple/test-stream2-readable-empty-buffer-no-eof.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/test/simple/test-stream2-readable-from-list.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/test/simple/test-stream2-readable-legacy-drain.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/test/simple/test-stream2-readable-non-empty-end.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/test/simple/test-stream2-readable-wrap-empty.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/test/simple/test-stream2-readable-wrap.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/test/simple/test-stream2-set-encoding.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/test/simple/test-stream2-transform.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/test/simple/test-stream2-unpipe-drain.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/test/simple/test-stream2-unpipe-leak.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/test/simple/test-stream2-writable.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/test/simple/test-stream3-pause-then-read.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/transform.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/writable.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/readable-stream/zlib.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/touch/LICENSE delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/touch/README.md delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/touch/bin/touch.js delete mode 120000 src/extensibility/node/node_modules/decompress-zip/node_modules/touch/node_modules/.bin/nopt delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/touch/node_modules/nopt/.npmignore delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/touch/node_modules/nopt/LICENSE delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/touch/node_modules/nopt/README.md delete mode 100755 src/extensibility/node/node_modules/decompress-zip/node_modules/touch/node_modules/nopt/bin/nopt.js delete mode 100755 src/extensibility/node/node_modules/decompress-zip/node_modules/touch/node_modules/nopt/examples/my-program.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/touch/node_modules/nopt/lib/nopt.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/touch/node_modules/nopt/node_modules/abbrev/LICENSE delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/touch/node_modules/nopt/node_modules/abbrev/README.md delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/touch/node_modules/nopt/node_modules/abbrev/lib/abbrev.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/touch/node_modules/nopt/node_modules/abbrev/package.json delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/touch/node_modules/nopt/package.json delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/touch/package.json delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/touch/test/sanity.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/node_modules/touch/touch.js delete mode 100644 src/extensibility/node/node_modules/decompress-zip/package.json delete mode 100644 src/extensibility/node/node_modules/decompress-zip/test/test.js delete mode 100644 src/extensibility/node/node_modules/fs-extra/.npmignore delete mode 100644 src/extensibility/node/node_modules/fs-extra/CHANGELOG.md delete mode 100644 src/extensibility/node/node_modules/fs-extra/LICENSE delete mode 100644 src/extensibility/node/node_modules/fs-extra/README.md delete mode 100644 src/extensibility/node/node_modules/fs-extra/lib/copy.js delete mode 100644 src/extensibility/node/node_modules/fs-extra/lib/create.js delete mode 100644 src/extensibility/node/node_modules/fs-extra/lib/index.js delete mode 100644 src/extensibility/node/node_modules/fs-extra/lib/json.js delete mode 100644 src/extensibility/node/node_modules/fs-extra/lib/mkdir.js delete mode 100644 src/extensibility/node/node_modules/fs-extra/lib/output.js delete mode 100644 src/extensibility/node/node_modules/fs-extra/lib/remove.js delete mode 120000 src/extensibility/node/node_modules/fs-extra/node_modules/.bin/ncp delete mode 120000 src/extensibility/node/node_modules/fs-extra/node_modules/.bin/rimraf delete mode 100644 src/extensibility/node/node_modules/fs-extra/node_modules/jsonfile/.npmignore delete mode 100644 src/extensibility/node/node_modules/fs-extra/node_modules/jsonfile/CHANGELOG.md delete mode 100644 src/extensibility/node/node_modules/fs-extra/node_modules/jsonfile/LICENSE delete mode 100644 src/extensibility/node/node_modules/fs-extra/node_modules/jsonfile/README.md delete mode 100644 src/extensibility/node/node_modules/fs-extra/node_modules/jsonfile/lib/jsonfile.js delete mode 100644 src/extensibility/node/node_modules/fs-extra/node_modules/jsonfile/package.json delete mode 100644 src/extensibility/node/node_modules/fs-extra/node_modules/mkdirp/.npmignore delete mode 100644 src/extensibility/node/node_modules/fs-extra/node_modules/mkdirp/.travis.yml delete mode 100644 src/extensibility/node/node_modules/fs-extra/node_modules/mkdirp/LICENSE delete mode 100644 src/extensibility/node/node_modules/fs-extra/node_modules/mkdirp/examples/pow.js delete mode 100644 src/extensibility/node/node_modules/fs-extra/node_modules/mkdirp/index.js delete mode 100644 src/extensibility/node/node_modules/fs-extra/node_modules/mkdirp/package.json delete mode 100644 src/extensibility/node/node_modules/fs-extra/node_modules/mkdirp/readme.markdown delete mode 100644 src/extensibility/node/node_modules/fs-extra/node_modules/mkdirp/test/chmod.js delete mode 100644 src/extensibility/node/node_modules/fs-extra/node_modules/mkdirp/test/clobber.js delete mode 100644 src/extensibility/node/node_modules/fs-extra/node_modules/mkdirp/test/mkdirp.js delete mode 100644 src/extensibility/node/node_modules/fs-extra/node_modules/mkdirp/test/perm.js delete mode 100644 src/extensibility/node/node_modules/fs-extra/node_modules/mkdirp/test/perm_sync.js delete mode 100644 src/extensibility/node/node_modules/fs-extra/node_modules/mkdirp/test/race.js delete mode 100644 src/extensibility/node/node_modules/fs-extra/node_modules/mkdirp/test/rel.js delete mode 100644 src/extensibility/node/node_modules/fs-extra/node_modules/mkdirp/test/return.js delete mode 100644 src/extensibility/node/node_modules/fs-extra/node_modules/mkdirp/test/return_sync.js delete mode 100644 src/extensibility/node/node_modules/fs-extra/node_modules/mkdirp/test/root.js delete mode 100644 src/extensibility/node/node_modules/fs-extra/node_modules/mkdirp/test/sync.js delete mode 100644 src/extensibility/node/node_modules/fs-extra/node_modules/mkdirp/test/umask.js delete mode 100644 src/extensibility/node/node_modules/fs-extra/node_modules/mkdirp/test/umask_sync.js delete mode 100644 src/extensibility/node/node_modules/fs-extra/node_modules/ncp/.npmignore delete mode 100644 src/extensibility/node/node_modules/fs-extra/node_modules/ncp/.travis.yml delete mode 100644 src/extensibility/node/node_modules/fs-extra/node_modules/ncp/LICENSE.md delete mode 100644 src/extensibility/node/node_modules/fs-extra/node_modules/ncp/README.md delete mode 100755 src/extensibility/node/node_modules/fs-extra/node_modules/ncp/bin/ncp delete mode 100644 src/extensibility/node/node_modules/fs-extra/node_modules/ncp/lib/ncp.js delete mode 100644 src/extensibility/node/node_modules/fs-extra/node_modules/ncp/package.json delete mode 100644 src/extensibility/node/node_modules/fs-extra/node_modules/ncp/test/fixtures/src/a delete mode 100644 src/extensibility/node/node_modules/fs-extra/node_modules/ncp/test/fixtures/src/b delete mode 100644 src/extensibility/node/node_modules/fs-extra/node_modules/ncp/test/fixtures/src/c delete mode 100644 src/extensibility/node/node_modules/fs-extra/node_modules/ncp/test/fixtures/src/d delete mode 100644 src/extensibility/node/node_modules/fs-extra/node_modules/ncp/test/fixtures/src/e delete mode 100644 src/extensibility/node/node_modules/fs-extra/node_modules/ncp/test/fixtures/src/f delete mode 100644 src/extensibility/node/node_modules/fs-extra/node_modules/ncp/test/fixtures/src/sub/a delete mode 100644 src/extensibility/node/node_modules/fs-extra/node_modules/ncp/test/fixtures/src/sub/b delete mode 100644 src/extensibility/node/node_modules/fs-extra/node_modules/ncp/test/ncp-test.js delete mode 100644 src/extensibility/node/node_modules/fs-extra/node_modules/rimraf/AUTHORS delete mode 100644 src/extensibility/node/node_modules/fs-extra/node_modules/rimraf/LICENSE delete mode 100644 src/extensibility/node/node_modules/fs-extra/node_modules/rimraf/README.md delete mode 100755 src/extensibility/node/node_modules/fs-extra/node_modules/rimraf/bin.js delete mode 100644 src/extensibility/node/node_modules/fs-extra/node_modules/rimraf/node_modules/graceful-fs/.npmignore delete mode 100644 src/extensibility/node/node_modules/fs-extra/node_modules/rimraf/node_modules/graceful-fs/LICENSE delete mode 100644 src/extensibility/node/node_modules/fs-extra/node_modules/rimraf/node_modules/graceful-fs/README.md delete mode 100644 src/extensibility/node/node_modules/fs-extra/node_modules/rimraf/node_modules/graceful-fs/graceful-fs.js delete mode 100644 src/extensibility/node/node_modules/fs-extra/node_modules/rimraf/node_modules/graceful-fs/package.json delete mode 100644 src/extensibility/node/node_modules/fs-extra/node_modules/rimraf/node_modules/graceful-fs/polyfills.js delete mode 100644 src/extensibility/node/node_modules/fs-extra/node_modules/rimraf/node_modules/graceful-fs/test/open.js delete mode 100644 src/extensibility/node/node_modules/fs-extra/node_modules/rimraf/package.json delete mode 100644 src/extensibility/node/node_modules/fs-extra/node_modules/rimraf/rimraf.js delete mode 100644 src/extensibility/node/node_modules/fs-extra/node_modules/rimraf/test/run.sh delete mode 100644 src/extensibility/node/node_modules/fs-extra/node_modules/rimraf/test/setup.sh delete mode 100644 src/extensibility/node/node_modules/fs-extra/node_modules/rimraf/test/test-async.js delete mode 100644 src/extensibility/node/node_modules/fs-extra/node_modules/rimraf/test/test-sync.js delete mode 100755 src/extensibility/node/node_modules/fs-extra/package.json delete mode 100644 src/extensibility/node/node_modules/request/.npmignore delete mode 100644 src/extensibility/node/node_modules/request/LICENSE delete mode 100644 src/extensibility/node/node_modules/request/README.md delete mode 100755 src/extensibility/node/node_modules/request/index.js delete mode 100644 src/extensibility/node/node_modules/request/lib/copy.js delete mode 100644 src/extensibility/node/node_modules/request/lib/debug.js delete mode 100644 src/extensibility/node/node_modules/request/lib/getSafe.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/aws-sign/LICENSE delete mode 100644 src/extensibility/node/node_modules/request/node_modules/aws-sign/README.md delete mode 100644 src/extensibility/node/node_modules/request/node_modules/aws-sign/index.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/aws-sign/package.json delete mode 100644 src/extensibility/node/node_modules/request/node_modules/cookie-jar/LICENSE delete mode 100644 src/extensibility/node/node_modules/request/node_modules/cookie-jar/README.md delete mode 100644 src/extensibility/node/node_modules/request/node_modules/cookie-jar/index.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/cookie-jar/jar.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/cookie-jar/package.json delete mode 100644 src/extensibility/node/node_modules/request/node_modules/cookie-jar/tests/run.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/cookie-jar/tests/test-cookie.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/cookie-jar/tests/test-cookiejar.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/forever-agent/LICENSE delete mode 100644 src/extensibility/node/node_modules/request/node_modules/forever-agent/README.md delete mode 100644 src/extensibility/node/node_modules/request/node_modules/forever-agent/index.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/forever-agent/package.json delete mode 100644 src/extensibility/node/node_modules/request/node_modules/form-data/License delete mode 100644 src/extensibility/node/node_modules/request/node_modules/form-data/Readme.md delete mode 100644 src/extensibility/node/node_modules/request/node_modules/form-data/lib/form_data.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/async/LICENSE delete mode 100644 src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/async/README.md delete mode 100644 src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/async/component.json delete mode 100755 src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/async/package.json delete mode 100644 src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/.npmignore delete mode 100644 src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/License delete mode 100644 src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/Makefile delete mode 100644 src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/Readme.md delete mode 100644 src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/lib/combined_stream.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/.npmignore delete mode 100644 src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/License delete mode 100644 src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Makefile delete mode 100644 src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Readme.md delete mode 100644 src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/lib/delayed_stream.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/package.json delete mode 100644 src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/common.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-auto-pause.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-pause.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-handle-source-errors.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-max-data-size.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-pipe-resumes.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-proxy-readable.js delete mode 100755 src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/run.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/package.json delete mode 100644 src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/common.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/fixture/file1.txt delete mode 100644 src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/fixture/file2.txt delete mode 100644 src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-callback-streams.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-data-size.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-delayed-streams-and-buffers-and-strings.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-delayed-streams.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-empty-string.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-is-stream-like.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-max-data-size.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-unpaused-streams.js delete mode 100755 src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/run.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/form-data/package.json delete mode 100644 src/extensibility/node/node_modules/request/node_modules/hawk/.npmignore delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/.travis.yml delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/LICENSE delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/Makefile delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/README.md delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/example/usage.js delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/images/hawk.png delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/images/logo.png delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/index.js delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/lib/browser.js delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/lib/client.js delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/lib/crypto.js delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/lib/index.js delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/lib/server.js delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/lib/utils.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/hawk/node_modules/boom/.npmignore delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/node_modules/boom/.travis.yml delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/node_modules/boom/LICENSE delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/node_modules/boom/Makefile delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/node_modules/boom/README.md delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/node_modules/boom/images/boom.png delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/node_modules/boom/index.js delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/node_modules/boom/lib/index.js delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/node_modules/boom/package.json delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/node_modules/boom/test/index.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/hawk/node_modules/cryptiles/.npmignore delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/node_modules/cryptiles/.travis.yml delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/node_modules/cryptiles/LICENSE delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/node_modules/cryptiles/Makefile delete mode 100644 src/extensibility/node/node_modules/request/node_modules/hawk/node_modules/cryptiles/README.md delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/node_modules/cryptiles/index.js delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/node_modules/cryptiles/lib/index.js delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/node_modules/cryptiles/package.json delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/node_modules/cryptiles/test/index.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/hawk/node_modules/hoek/.npmignore delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/node_modules/hoek/.travis.yml delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/node_modules/hoek/LICENSE delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/node_modules/hoek/Makefile delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/node_modules/hoek/README.md delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/node_modules/hoek/images/hoek.png delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/node_modules/hoek/index.js delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/node_modules/hoek/lib/escape.js delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/node_modules/hoek/lib/index.js delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/node_modules/hoek/package.json delete mode 100644 src/extensibility/node/node_modules/request/node_modules/hawk/node_modules/hoek/test/escaper.js delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/node_modules/hoek/test/index.js delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test1.js delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test2.js delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test3.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/hawk/node_modules/sntp/.npmignore delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/node_modules/sntp/.travis.yml delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/node_modules/sntp/LICENSE delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/node_modules/sntp/Makefile delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/node_modules/sntp/README.md delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/node_modules/sntp/examples/offset.js delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/node_modules/sntp/examples/time.js delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/node_modules/sntp/index.js delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/node_modules/sntp/lib/index.js delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/node_modules/sntp/package.json delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/node_modules/sntp/test/index.js delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/package.json delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/test/browser.js delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/test/client.js delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/test/crypto.js delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/test/index.js delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/test/message.js delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/test/readme.js delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/test/server.js delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/test/uri.js delete mode 100755 src/extensibility/node/node_modules/request/node_modules/hawk/test/utils.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/.dir-locals.el delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/.npmignore delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/LICENSE delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/README.md delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/http_signing.md delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/lib/index.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/lib/parser.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/lib/signer.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/lib/util.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/lib/verify.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/node_modules/asn1/.npmignore delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/node_modules/asn1/LICENSE delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/node_modules/asn1/README.md delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/errors.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/index.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/reader.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/types.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/writer.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/index.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/node_modules/asn1/package.json delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/node_modules/asn1/tst/ber/reader.test.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/node_modules/asn1/tst/ber/writer.test.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/node_modules/assert-plus/README.md delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/node_modules/assert-plus/assert.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/node_modules/assert-plus/package.json delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/node_modules/ctype/CHANGELOG delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/node_modules/ctype/LICENSE delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/node_modules/ctype/README delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/node_modules/ctype/README.old delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/node_modules/ctype/ctf.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/node_modules/ctype/ctio.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/node_modules/ctype/ctype.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/node_modules/ctype/man/man3ctype/ctio.3ctype delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/node_modules/ctype/package.json delete mode 100755 src/extensibility/node/node_modules/request/node_modules/http-signature/node_modules/ctype/tools/jsl.conf delete mode 100755 src/extensibility/node/node_modules/request/node_modules/http-signature/node_modules/ctype/tools/jsstyle delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/float.json delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/int.json delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/psinfo.json delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/struct.json delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.fail.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.float.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.int.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.psinfo.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.struct.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.typedef.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/typedef.json delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/float/tst.rfloat.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/float/tst.wfloat.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/int/tst.64.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/int/tst.rint.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/int/tst.wbounds.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/int/tst.wint.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/uint/tst.64.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/uint/tst.roundtrip.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/uint/tst.ruint.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/uint/tst.wuint.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.basicr.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.basicw.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.char.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.endian.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.oldwrite.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.readSize.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.structw.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.writeStruct.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/http-signature/package.json delete mode 100644 src/extensibility/node/node_modules/request/node_modules/json-stringify-safe/LICENSE delete mode 100644 src/extensibility/node/node_modules/request/node_modules/json-stringify-safe/README.md delete mode 100644 src/extensibility/node/node_modules/request/node_modules/json-stringify-safe/package.json delete mode 100644 src/extensibility/node/node_modules/request/node_modules/json-stringify-safe/stringify.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/json-stringify-safe/test.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/mime/LICENSE delete mode 100644 src/extensibility/node/node_modules/request/node_modules/mime/README.md delete mode 100644 src/extensibility/node/node_modules/request/node_modules/mime/mime.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/mime/package.json delete mode 100644 src/extensibility/node/node_modules/request/node_modules/mime/test.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/mime/types/mime.types delete mode 100644 src/extensibility/node/node_modules/request/node_modules/mime/types/node.types delete mode 100644 src/extensibility/node/node_modules/request/node_modules/node-uuid/.npmignore delete mode 100644 src/extensibility/node/node_modules/request/node_modules/node-uuid/LICENSE.md delete mode 100644 src/extensibility/node/node_modules/request/node_modules/node-uuid/README.md delete mode 100644 src/extensibility/node/node_modules/request/node_modules/node-uuid/benchmark/README.md delete mode 100644 src/extensibility/node/node_modules/request/node_modules/node-uuid/benchmark/bench.gnu delete mode 100755 src/extensibility/node/node_modules/request/node_modules/node-uuid/benchmark/bench.sh delete mode 100644 src/extensibility/node/node_modules/request/node_modules/node-uuid/benchmark/benchmark-native.c delete mode 100644 src/extensibility/node/node_modules/request/node_modules/node-uuid/benchmark/benchmark.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/node-uuid/component.json delete mode 100644 src/extensibility/node/node_modules/request/node_modules/node-uuid/package.json delete mode 100644 src/extensibility/node/node_modules/request/node_modules/node-uuid/test/compare_v1.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/node-uuid/test/test.html delete mode 100644 src/extensibility/node/node_modules/request/node_modules/node-uuid/test/test.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/node-uuid/uuid.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/oauth-sign/LICENSE delete mode 100644 src/extensibility/node/node_modules/request/node_modules/oauth-sign/README.md delete mode 100644 src/extensibility/node/node_modules/request/node_modules/oauth-sign/index.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/oauth-sign/package.json delete mode 100644 src/extensibility/node/node_modules/request/node_modules/oauth-sign/test.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/qs/.gitmodules delete mode 100644 src/extensibility/node/node_modules/request/node_modules/qs/.npmignore delete mode 100644 src/extensibility/node/node_modules/request/node_modules/qs/Readme.md delete mode 100644 src/extensibility/node/node_modules/request/node_modules/qs/index.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/qs/package.json delete mode 100644 src/extensibility/node/node_modules/request/node_modules/tunnel-agent/LICENSE delete mode 100644 src/extensibility/node/node_modules/request/node_modules/tunnel-agent/README.md delete mode 100644 src/extensibility/node/node_modules/request/node_modules/tunnel-agent/index.js delete mode 100644 src/extensibility/node/node_modules/request/node_modules/tunnel-agent/package.json delete mode 100755 src/extensibility/node/node_modules/request/package.json delete mode 100644 src/extensibility/node/node_modules/request/request.js delete mode 100644 src/extensibility/node/node_modules/rewire/.npmignore delete mode 100644 src/extensibility/node/node_modules/rewire/.travis.yml delete mode 100644 src/extensibility/node/node_modules/rewire/CHANGELOG.md delete mode 100644 src/extensibility/node/node_modules/rewire/LICENSE delete mode 100644 src/extensibility/node/node_modules/rewire/README.md delete mode 100644 src/extensibility/node/node_modules/rewire/lib/__get__.js delete mode 100644 src/extensibility/node/node_modules/rewire/lib/__set__.js delete mode 100644 src/extensibility/node/node_modules/rewire/lib/bundlers/browserify/browserifyMiddleware.js delete mode 100644 src/extensibility/node/node_modules/rewire/lib/bundlers/browserify/browserifyRewire.js delete mode 100644 src/extensibility/node/node_modules/rewire/lib/bundlers/getRewireRegExp.js delete mode 100644 src/extensibility/node/node_modules/rewire/lib/bundlers/getRewireRequires.js delete mode 100644 src/extensibility/node/node_modules/rewire/lib/bundlers/injectRewire.js delete mode 100644 src/extensibility/node/node_modules/rewire/lib/bundlers/webpack/configureWebpack.js delete mode 100644 src/extensibility/node/node_modules/rewire/lib/bundlers/webpack/getLoaderTestRegExp.js delete mode 100644 src/extensibility/node/node_modules/rewire/lib/bundlers/webpack/webpackPostLoader.js delete mode 100644 src/extensibility/node/node_modules/rewire/lib/bundlers/webpack/webpackPostProcessor.js delete mode 100644 src/extensibility/node/node_modules/rewire/lib/bundlers/webpack/webpackRewire.js delete mode 100644 src/extensibility/node/node_modules/rewire/lib/detectStrictMode.js delete mode 100644 src/extensibility/node/node_modules/rewire/lib/getImportGlobalsSrc.js delete mode 100644 src/extensibility/node/node_modules/rewire/lib/index.js delete mode 100644 src/extensibility/node/node_modules/rewire/lib/moduleEnv.js delete mode 100644 src/extensibility/node/node_modules/rewire/lib/rewire.js delete mode 100644 src/extensibility/node/node_modules/rewire/package.json delete mode 100644 src/extensibility/node/node_modules/rewire/test/__get__.test.js delete mode 100644 src/extensibility/node/node_modules/rewire/test/__set__.test.js delete mode 100644 src/extensibility/node/node_modules/rewire/test/debug.test.js delete mode 100644 src/extensibility/node/node_modules/rewire/test/detectStrictMode.test.js delete mode 100644 src/extensibility/node/node_modules/rewire/test/getImportGlobalsSrc.test.js delete mode 100644 src/extensibility/node/node_modules/rewire/test/rewire.test.js delete mode 100644 src/extensibility/node/node_modules/rewire/test/testModules/debuggerModule.js delete mode 100644 src/extensibility/node/node_modules/rewire/test/testModules/emptyModule.js delete mode 100644 src/extensibility/node/node_modules/rewire/test/testModules/fake_node_modules/rewire/package.json delete mode 100644 src/extensibility/node/node_modules/rewire/test/testModules/module.coffee delete mode 100644 src/extensibility/node/node_modules/rewire/test/testModules/moduleA.js delete mode 100644 src/extensibility/node/node_modules/rewire/test/testModules/moduleB.js delete mode 100644 src/extensibility/node/node_modules/rewire/test/testModules/sharedTestCases.js delete mode 100644 src/extensibility/node/node_modules/rewire/test/testModules/someOtherModule.js delete mode 100644 src/extensibility/node/node_modules/rewire/test/testModules/strictModule.js delete mode 100644 src/extensibility/node/node_modules/rewire/test/testModules/throwError.js delete mode 100644 src/extensibility/node/node_modules/semver/.npmignore delete mode 100644 src/extensibility/node/node_modules/semver/LICENSE delete mode 100644 src/extensibility/node/node_modules/semver/Makefile delete mode 100644 src/extensibility/node/node_modules/semver/README.md delete mode 100755 src/extensibility/node/node_modules/semver/bin/semver delete mode 100644 src/extensibility/node/node_modules/semver/foot.js delete mode 100644 src/extensibility/node/node_modules/semver/head.js delete mode 100644 src/extensibility/node/node_modules/semver/package.json delete mode 100644 src/extensibility/node/node_modules/semver/semver.browser.js delete mode 100644 src/extensibility/node/node_modules/semver/semver.browser.js.gz delete mode 100644 src/extensibility/node/node_modules/semver/semver.js delete mode 100644 src/extensibility/node/node_modules/semver/semver.min.js delete mode 100644 src/extensibility/node/node_modules/semver/semver.min.js.gz delete mode 100644 src/extensibility/node/node_modules/semver/test/amd.js delete mode 100644 src/extensibility/node/node_modules/semver/test/index.js delete mode 100644 src/extensibility/node/node_modules/semver/test/no-module.js delete mode 100644 src/extensibility/node/node_modules/temp/.npmignore delete mode 100644 src/extensibility/node/node_modules/temp/.travis.yml delete mode 100644 src/extensibility/node/node_modules/temp/LICENSE delete mode 100644 src/extensibility/node/node_modules/temp/README.md delete mode 100644 src/extensibility/node/node_modules/temp/examples/grepcount.js delete mode 100644 src/extensibility/node/node_modules/temp/examples/pdfcreator.js delete mode 100644 src/extensibility/node/node_modules/temp/lib/temp.js delete mode 100644 src/extensibility/node/node_modules/temp/node_modules/osenv/LICENSE delete mode 100644 src/extensibility/node/node_modules/temp/node_modules/osenv/README.md delete mode 100644 src/extensibility/node/node_modules/temp/node_modules/osenv/osenv.js delete mode 100644 src/extensibility/node/node_modules/temp/node_modules/osenv/package.json delete mode 100644 src/extensibility/node/node_modules/temp/node_modules/osenv/test/unix.js delete mode 100644 src/extensibility/node/node_modules/temp/node_modules/osenv/test/windows.js delete mode 100644 src/extensibility/node/node_modules/temp/node_modules/rimraf/AUTHORS delete mode 100644 src/extensibility/node/node_modules/temp/node_modules/rimraf/LICENSE delete mode 100644 src/extensibility/node/node_modules/temp/node_modules/rimraf/README.md delete mode 100644 src/extensibility/node/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/.npmignore delete mode 100644 src/extensibility/node/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/LICENSE delete mode 100644 src/extensibility/node/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/README.md delete mode 100644 src/extensibility/node/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/graceful-fs.js delete mode 100644 src/extensibility/node/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/package.json delete mode 100644 src/extensibility/node/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/test/open.js delete mode 100644 src/extensibility/node/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/test/ulimit.js delete mode 100644 src/extensibility/node/node_modules/temp/node_modules/rimraf/package.json delete mode 100644 src/extensibility/node/node_modules/temp/node_modules/rimraf/rimraf.js delete mode 100644 src/extensibility/node/node_modules/temp/node_modules/rimraf/test/run.sh delete mode 100644 src/extensibility/node/node_modules/temp/node_modules/rimraf/test/setup.sh delete mode 100644 src/extensibility/node/node_modules/temp/node_modules/rimraf/test/test-async.js delete mode 100644 src/extensibility/node/node_modules/temp/node_modules/rimraf/test/test-sync.js delete mode 100644 src/extensibility/node/node_modules/temp/package.json delete mode 100644 src/extensibility/node/node_modules/temp/test/temp-test.js delete mode 100644 src/extensibility/node/package.json create mode 100644 tasks/pack-web-dependencies.js diff --git a/.gitignore b/.gitignore index 11228855c39..41dc4b68697 100644 --- a/.gitignore +++ b/.gitignore @@ -49,3 +49,5 @@ Thumbs.db # Files that can be automatically downloaded that we don't want to ship with our builds /src/extensibility/node/node_modules/request/tests/ +# Files build by scripts +/src/thirdparty/semver.browser.js diff --git a/Gruntfile.js b/Gruntfile.js index 860e6556a90..a6b638113b6 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -341,7 +341,7 @@ module.exports = function (grunt) { }); // task: install - grunt.registerTask('install', ['write-config:dev', 'less', 'npm-install-source']); + grunt.registerTask('install', ['write-config:dev', 'less', 'npm-install-source', 'pack-web-dependencies']); // task: test grunt.registerTask('test', ['eslint', 'jasmine', 'nls-check']); diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index ee760bc6e09..a96f2cea66a 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -2,11 +2,102 @@ "name": "Brackets", "version": "1.9.0-0", "dependencies": { + "abbrev": { + "version": "1.1.0", + "from": "abbrev@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.0.tgz" + }, + "acorn": { + "version": "4.0.4", + "from": "acorn@4.0.4", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-4.0.4.tgz", + "dev": true + }, + "acorn-dynamic-import": { + "version": "2.0.2", + "from": "acorn-dynamic-import@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/acorn-dynamic-import/-/acorn-dynamic-import-2.0.2.tgz", + "dev": true + }, + "acorn-jsx": { + "version": "3.0.1", + "from": "acorn-jsx@>=3.0.0 <4.0.0", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz", + "dev": true, + "dependencies": { + "acorn": { + "version": "3.3.0", + "from": "acorn@>=3.0.4 <4.0.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", + "dev": true + } + } + }, + "adm-zip": { + "version": "0.4.4", + "from": "adm-zip@0.4.4", + "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.4.4.tgz", + "dev": true + }, + "ajv": { + "version": "4.11.5", + "from": "ajv@>=4.7.0 <5.0.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.5.tgz", + "dev": true + }, + "ajv-keywords": { + "version": "1.5.1", + "from": "ajv-keywords@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-1.5.1.tgz", + "dev": true + }, + "align-text": { + "version": "0.1.4", + "from": "align-text@>=0.1.3 <0.2.0", + "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", + "dev": true + }, + "amdefine": { + "version": "1.0.1", + "from": "amdefine@>=0.0.4", + "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", + "dev": true + }, + "ansi-escapes": { + "version": "1.4.0", + "from": "ansi-escapes@>=1.1.0 <2.0.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-1.4.0.tgz", + "dev": true + }, + "ansi-regex": { + "version": "2.1.1", + "from": "ansi-regex@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz" + }, + "ansi-styles": { + "version": "2.2.1", + "from": "ansi-styles@>=2.2.1 <3.0.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz" + }, "anymatch": { "version": "1.3.0", - "from": "anymatch@>=1.3.0 <2.0.0", + "from": "anymatch@1.3.0", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.0.tgz" }, + "argparse": { + "version": "0.1.16", + "from": "argparse@>=0.1.11 <0.2.0", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-0.1.16.tgz", + "dev": true, + "dependencies": { + "underscore.string": { + "version": "2.4.0", + "from": "underscore.string@>=2.4.0 <2.5.0", + "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-2.4.0.tgz", + "dev": true + } + } + }, "arr-diff": { "version": "2.0.0", "from": "arr-diff@>=2.0.0 <3.0.0", @@ -17,6 +108,24 @@ "from": "arr-flatten@>=1.0.1 <2.0.0", "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.0.1.tgz" }, + "array-differ": { + "version": "1.0.0", + "from": "array-differ@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-1.0.0.tgz", + "dev": true + }, + "array-union": { + "version": "1.0.2", + "from": "array-union@>=1.0.1 <2.0.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", + "dev": true + }, + "array-uniq": { + "version": "1.0.3", + "from": "array-uniq@>=1.0.1 <2.0.0", + "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", + "dev": true + }, "array-unique": { "version": "0.2.1", "from": "array-unique@>=0.2.1 <0.3.0", @@ -27,21 +136,124 @@ "from": "arrify@>=1.0.0 <2.0.0", "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz" }, + "asap": { + "version": "2.0.5", + "from": "asap@>=2.0.3 <2.1.0", + "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.5.tgz", + "dev": true, + "optional": true + }, + "asn1": { + "version": "0.2.3", + "from": "asn1@>=0.2.3 <0.3.0", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz" + }, + "asn1.js": { + "version": "4.9.1", + "from": "asn1.js@>=4.0.0 <5.0.0", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.9.1.tgz", + "dev": true + }, + "assert": { + "version": "1.4.1", + "from": "assert@>=1.1.1 <2.0.0", + "resolved": "https://registry.npmjs.org/assert/-/assert-1.4.1.tgz", + "dev": true + }, + "assert-plus": { + "version": "0.2.0", + "from": "assert-plus@>=0.2.0 <0.3.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz" + }, + "async": { + "version": "2.1.4", + "from": "async@2.1.4", + "resolved": "https://registry.npmjs.org/async/-/async-2.1.4.tgz" + }, "async-each": { "version": "1.0.1", "from": "async-each@>=1.0.0 <2.0.0", "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz" }, + "asynckit": { + "version": "0.4.0", + "from": "asynckit@>=0.4.0 <0.5.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz" + }, + "aws-sign2": { + "version": "0.6.0", + "from": "aws-sign2@>=0.6.0 <0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz" + }, + "aws4": { + "version": "1.6.0", + "from": "aws4@>=1.2.1 <2.0.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz" + }, "balanced-match": { "version": "0.4.2", "from": "balanced-match@>=0.4.1 <0.5.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz" }, + "base64-js": { + "version": "1.2.0", + "from": "base64-js@>=1.0.2 <2.0.0", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.2.0.tgz", + "dev": true + }, + "bcrypt-pbkdf": { + "version": "1.0.1", + "from": "bcrypt-pbkdf@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", + "optional": true + }, + "big.js": { + "version": "3.1.3", + "from": "big.js@>=3.1.3 <4.0.0", + "resolved": "https://registry.npmjs.org/big.js/-/big.js-3.1.3.tgz", + "dev": true + }, + "binary": { + "version": "0.3.0", + "from": "binary@>=0.3.0 <0.4.0", + "resolved": "https://registry.npmjs.org/binary/-/binary-0.3.0.tgz" + }, "binary-extensions": { "version": "1.8.0", "from": "binary-extensions@>=1.0.0 <2.0.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.8.0.tgz" }, + "bl": { + "version": "0.9.5", + "from": "bl@>=0.9.0 <0.10.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-0.9.5.tgz", + "dev": true, + "dependencies": { + "isarray": { + "version": "0.0.1", + "from": "isarray@0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "dev": true + }, + "readable-stream": { + "version": "1.0.34", + "from": "readable-stream@>=1.0.26 <1.1.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "dev": true + } + } + }, + "bn.js": { + "version": "4.11.6", + "from": "bn.js@>=4.1.1 <5.0.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", + "dev": true + }, + "boom": { + "version": "2.10.1", + "from": "boom@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz" + }, "brace-expansion": { "version": "1.1.6", "from": "brace-expansion@>=1.0.0 <2.0.0", @@ -52,26 +264,577 @@ "from": "braces@>=1.8.2 <2.0.0", "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz" }, + "brorand": { + "version": "1.1.0", + "from": "brorand@>=1.0.1 <2.0.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "dev": true + }, + "browserify-aes": { + "version": "1.0.6", + "from": "browserify-aes@>=1.0.4 <2.0.0", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.0.6.tgz", + "dev": true + }, + "browserify-cipher": { + "version": "1.0.0", + "from": "browserify-cipher@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.0.tgz", + "dev": true + }, + "browserify-des": { + "version": "1.0.0", + "from": "browserify-des@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.0.tgz", + "dev": true + }, + "browserify-rsa": { + "version": "4.0.1", + "from": "browserify-rsa@>=4.0.0 <5.0.0", + "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", + "dev": true + }, + "browserify-sign": { + "version": "4.0.0", + "from": "browserify-sign@>=4.0.0 <5.0.0", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.0.0.tgz", + "dev": true + }, + "browserify-zlib": { + "version": "0.1.4", + "from": "browserify-zlib@>=0.1.4 <0.2.0", + "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.1.4.tgz", + "dev": true + }, + "buffer": { + "version": "4.9.1", + "from": "buffer@>=4.3.0 <5.0.0", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz", + "dev": true + }, "buffer-shims": { "version": "1.0.0", "from": "buffer-shims@>=1.0.0 <2.0.0", "resolved": "https://registry.npmjs.org/buffer-shims/-/buffer-shims-1.0.0.tgz" }, + "buffer-xor": { + "version": "1.0.3", + "from": "buffer-xor@>=1.0.2 <2.0.0", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "dev": true + }, + "buffers": { + "version": "0.1.1", + "from": "buffers@>=0.1.1 <0.2.0", + "resolved": "https://registry.npmjs.org/buffers/-/buffers-0.1.1.tgz" + }, + "builtin-modules": { + "version": "1.1.1", + "from": "builtin-modules@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", + "dev": true + }, + "builtin-status-codes": { + "version": "3.0.0", + "from": "builtin-status-codes@>=3.0.0 <4.0.0", + "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", + "dev": true + }, + "caller-path": { + "version": "0.1.0", + "from": "caller-path@>=0.1.0 <0.2.0", + "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", + "dev": true + }, + "callsites": { + "version": "0.2.0", + "from": "callsites@>=0.2.0 <0.3.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", + "dev": true + }, + "camelcase": { + "version": "1.2.1", + "from": "camelcase@>=1.0.2 <2.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", + "dev": true + }, + "caseless": { + "version": "0.11.0", + "from": "caseless@>=0.11.0 <0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz" + }, + "center-align": { + "version": "0.1.3", + "from": "center-align@>=0.1.1 <0.2.0", + "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", + "dev": true + }, + "chainsaw": { + "version": "0.1.0", + "from": "chainsaw@>=0.1.0 <0.2.0", + "resolved": "https://registry.npmjs.org/chainsaw/-/chainsaw-0.1.0.tgz" + }, + "chalk": { + "version": "1.1.3", + "from": "chalk@>=1.1.1 <2.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz" + }, "chokidar": { - "version": "1.6.0", - "from": "chokidar@1.6.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.6.0.tgz" + "version": "1.6.1", + "from": "chokidar@1.6.1", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.6.1.tgz" + }, + "ci-info": { + "version": "1.0.0", + "from": "ci-info@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-1.0.0.tgz", + "dev": true + }, + "cipher-base": { + "version": "1.0.3", + "from": "cipher-base@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.3.tgz", + "dev": true + }, + "circular-json": { + "version": "0.3.1", + "from": "circular-json@>=0.3.1 <0.4.0", + "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.1.tgz", + "dev": true + }, + "clean-css": { + "version": "1.0.12", + "from": "clean-css@>=1.0.0 <1.1.0", + "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-1.0.12.tgz", + "dev": true, + "dependencies": { + "commander": { + "version": "1.3.2", + "from": "commander@>=1.3.0 <1.4.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-1.3.2.tgz", + "dev": true + } + } + }, + "cli-cursor": { + "version": "1.0.2", + "from": "cli-cursor@>=1.0.1 <2.0.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-1.0.2.tgz", + "dev": true + }, + "cli-width": { + "version": "2.1.0", + "from": "cli-width@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.1.0.tgz", + "dev": true + }, + "cliui": { + "version": "2.1.0", + "from": "cliui@>=2.1.0 <3.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", + "dev": true, + "dependencies": { + "wordwrap": { + "version": "0.0.2", + "from": "wordwrap@0.0.2", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", + "dev": true + } + } + }, + "co": { + "version": "4.6.0", + "from": "co@>=4.6.0 <5.0.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "dev": true + }, + "code-point-at": { + "version": "1.1.0", + "from": "code-point-at@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "dev": true + }, + "coffee-script": { + "version": "1.3.3", + "from": "coffee-script@>=1.3.3 <1.4.0", + "resolved": "https://registry.npmjs.org/coffee-script/-/coffee-script-1.3.3.tgz", + "dev": true + }, + "colors": { + "version": "0.6.2", + "from": "colors@>=0.6.2 <0.7.0", + "resolved": "https://registry.npmjs.org/colors/-/colors-0.6.2.tgz", + "dev": true + }, + "combined-stream": { + "version": "1.0.5", + "from": "combined-stream@>=1.0.5 <1.1.0", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz" + }, + "commander": { + "version": "2.9.0", + "from": "commander@>=2.9.0 <3.0.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz" }, "concat-map": { "version": "0.0.1", "from": "concat-map@0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" }, + "concat-stream": { + "version": "1.6.0", + "from": "concat-stream@>=1.4.6 <2.0.0", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.0.tgz", + "dev": true + }, + "config-chain": { + "version": "1.1.11", + "from": "config-chain@>=1.1.8 <1.2.0", + "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.11.tgz", + "dev": true + }, + "console-browserify": { + "version": "1.1.0", + "from": "console-browserify@>=1.1.0 <2.0.0", + "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz", + "dev": true + }, + "constants-browserify": { + "version": "1.0.0", + "from": "constants-browserify@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", + "dev": true + }, "core-util-is": { "version": "1.0.2", "from": "core-util-is@>=1.0.0 <1.1.0", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz" }, + "create-ecdh": { + "version": "4.0.0", + "from": "create-ecdh@>=4.0.0 <5.0.0", + "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.0.tgz", + "dev": true + }, + "create-hash": { + "version": "1.1.2", + "from": "create-hash@>=1.1.0 <2.0.0", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.1.2.tgz", + "dev": true + }, + "create-hmac": { + "version": "1.1.4", + "from": "create-hmac@>=1.1.0 <2.0.0", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.4.tgz", + "dev": true + }, + "cryptiles": { + "version": "2.0.5", + "from": "cryptiles@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz" + }, + "crypto-browserify": { + "version": "3.11.0", + "from": "crypto-browserify@>=3.11.0 <4.0.0", + "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.11.0.tgz", + "dev": true + }, + "ctype": { + "version": "0.5.3", + "from": "ctype@0.5.3", + "resolved": "https://registry.npmjs.org/ctype/-/ctype-0.5.3.tgz", + "dev": true, + "optional": true + }, + "d": { + "version": "0.1.1", + "from": "d@>=0.1.1 <0.2.0", + "resolved": "https://registry.npmjs.org/d/-/d-0.1.1.tgz", + "dev": true + }, + "dashdash": { + "version": "1.14.1", + "from": "dashdash@>=1.12.0 <2.0.0", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "from": "assert-plus@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz" + } + } + }, + "date-now": { + "version": "0.1.4", + "from": "date-now@>=0.1.4 <0.2.0", + "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", + "dev": true + }, + "dateformat": { + "version": "1.0.2-1.2.3", + "from": "dateformat@1.0.2-1.2.3", + "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-1.0.2-1.2.3.tgz", + "dev": true + }, + "debug": { + "version": "0.7.4", + "from": "debug@>=0.7.0 <0.8.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-0.7.4.tgz", + "dev": true + }, + "decamelize": { + "version": "1.2.0", + "from": "decamelize@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "dev": true + }, + "decompress-zip": { + "version": "0.3.0", + "from": "decompress-zip@0.3.0", + "resolved": "https://registry.npmjs.org/decompress-zip/-/decompress-zip-0.3.0.tgz", + "dependencies": { + "isarray": { + "version": "0.0.1", + "from": "isarray@0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz" + }, + "readable-stream": { + "version": "1.1.14", + "from": "readable-stream@>=1.1.8 <2.0.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz" + } + } + }, + "deep-is": { + "version": "0.1.3", + "from": "deep-is@>=0.1.3 <0.2.0", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "dev": true + }, + "del": { + "version": "2.2.2", + "from": "del@>=2.0.2 <3.0.0", + "resolved": "https://registry.npmjs.org/del/-/del-2.2.2.tgz", + "dev": true + }, + "delayed-stream": { + "version": "1.0.0", + "from": "delayed-stream@>=1.0.0 <1.1.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz" + }, + "des.js": { + "version": "1.0.0", + "from": "des.js@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.0.tgz", + "dev": true + }, + "diffie-hellman": { + "version": "5.0.2", + "from": "diffie-hellman@>=5.0.0 <6.0.0", + "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.2.tgz", + "dev": true + }, + "doctrine": { + "version": "1.5.0", + "from": "doctrine@>=1.2.2 <2.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", + "dev": true + }, + "domain-browser": { + "version": "1.1.7", + "from": "domain-browser@>=1.1.1 <2.0.0", + "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.1.7.tgz", + "dev": true + }, + "ecc-jsbn": { + "version": "0.1.1", + "from": "ecc-jsbn@>=0.1.1 <0.2.0", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", + "optional": true + }, + "elliptic": { + "version": "6.4.0", + "from": "elliptic@>=6.0.0 <7.0.0", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz", + "dev": true + }, + "emojis-list": { + "version": "2.1.0", + "from": "emojis-list@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz", + "dev": true + }, + "enhanced-resolve": { + "version": "3.1.0", + "from": "enhanced-resolve@>=3.0.0 <4.0.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-3.1.0.tgz", + "dev": true + }, + "errno": { + "version": "0.1.4", + "from": "errno@>=0.1.1 <0.2.0", + "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.4.tgz", + "dev": true + }, + "error-ex": { + "version": "1.3.1", + "from": "error-ex@>=1.2.0 <2.0.0", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz", + "dev": true + }, + "es5-ext": { + "version": "0.10.13", + "from": "es5-ext@>=0.10.11 <0.11.0", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.13.tgz", + "dev": true + }, + "es6-iterator": { + "version": "2.0.0", + "from": "es6-iterator@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.0.tgz", + "dev": true + }, + "es6-map": { + "version": "0.1.4", + "from": "es6-map@>=0.1.3 <0.2.0", + "resolved": "https://registry.npmjs.org/es6-map/-/es6-map-0.1.4.tgz", + "dev": true + }, + "es6-set": { + "version": "0.1.4", + "from": "es6-set@>=0.1.3 <0.2.0", + "resolved": "https://registry.npmjs.org/es6-set/-/es6-set-0.1.4.tgz", + "dev": true + }, + "es6-symbol": { + "version": "3.1.0", + "from": "es6-symbol@>=3.1.0 <3.2.0", + "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.0.tgz", + "dev": true + }, + "es6-weak-map": { + "version": "2.0.1", + "from": "es6-weak-map@>=2.0.1 <3.0.0", + "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.1.tgz", + "dev": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "from": "escape-string-regexp@>=1.0.2 <2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz" + }, + "escope": { + "version": "3.6.0", + "from": "escope@>=3.6.0 <4.0.0", + "resolved": "https://registry.npmjs.org/escope/-/escope-3.6.0.tgz", + "dev": true + }, + "eslint": { + "version": "2.13.1", + "from": "eslint@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-2.13.1.tgz", + "dev": true, + "dependencies": { + "argparse": { + "version": "1.0.9", + "from": "argparse@>=1.0.7 <2.0.0", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.9.tgz", + "dev": true + }, + "debug": { + "version": "2.6.3", + "from": "debug@>=2.1.1 <3.0.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.3.tgz", + "dev": true + }, + "esprima": { + "version": "3.1.3", + "from": "esprima@>=3.1.1 <4.0.0", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-3.1.3.tgz", + "dev": true + }, + "js-yaml": { + "version": "3.8.2", + "from": "js-yaml@>=3.5.1 <4.0.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.8.2.tgz", + "dev": true + } + } + }, + "espree": { + "version": "3.4.0", + "from": "espree@>=3.1.6 <4.0.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-3.4.0.tgz", + "dev": true + }, + "esprima": { + "version": "1.0.4", + "from": "esprima@>=1.0.2 <1.1.0", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-1.0.4.tgz", + "dev": true + }, + "esrecurse": { + "version": "4.1.0", + "from": "esrecurse@>=4.1.0 <5.0.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.1.0.tgz", + "dev": true, + "dependencies": { + "estraverse": { + "version": "4.1.1", + "from": "estraverse@>=4.1.0 <4.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.1.1.tgz", + "dev": true + } + } + }, + "estraverse": { + "version": "4.2.0", + "from": "estraverse@>=4.2.0 <5.0.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "dev": true + }, + "esutils": { + "version": "2.0.2", + "from": "esutils@>=2.0.2 <3.0.0", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "dev": true + }, + "event-emitter": { + "version": "0.3.4", + "from": "event-emitter@>=0.3.4 <0.4.0", + "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.4.tgz", + "dev": true + }, + "eventemitter2": { + "version": "0.4.14", + "from": "eventemitter2@>=0.4.13 <0.5.0", + "resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-0.4.14.tgz", + "dev": true + }, + "events": { + "version": "1.1.1", + "from": "events@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz", + "dev": true + }, + "evp_bytestokey": { + "version": "1.0.0", + "from": "evp_bytestokey@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.0.tgz", + "dev": true + }, + "exit": { + "version": "0.1.2", + "from": "exit@>=0.1.1 <0.2.0", + "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "dev": true + }, + "exit-hook": { + "version": "1.1.1", + "from": "exit-hook@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/exit-hook/-/exit-hook-1.1.1.tgz", + "dev": true + }, "expand-brackets": { "version": "0.1.5", "from": "expand-brackets@>=0.1.4 <0.2.0", @@ -82,30 +845,211 @@ "from": "expand-range@>=1.8.1 <2.0.0", "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz" }, + "extend": { + "version": "3.0.0", + "from": "extend@>=3.0.0 <3.1.0", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.0.tgz" + }, "extglob": { "version": "0.3.2", "from": "extglob@>=0.3.1 <0.4.0", "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz" }, + "extsprintf": { + "version": "1.0.2", + "from": "extsprintf@1.0.2", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.0.2.tgz" + }, + "fast-levenshtein": { + "version": "2.0.6", + "from": "fast-levenshtein@>=2.0.4 <2.1.0", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "dev": true + }, + "faye-websocket": { + "version": "0.4.4", + "from": "faye-websocket@>=0.4.3 <0.5.0", + "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.4.4.tgz", + "dev": true + }, + "figures": { + "version": "1.7.0", + "from": "figures@>=1.3.5 <2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", + "dev": true + }, + "file-entry-cache": { + "version": "1.3.1", + "from": "file-entry-cache@>=1.1.1 <2.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-1.3.1.tgz", + "dev": true + }, "filename-regex": { "version": "2.0.0", "from": "filename-regex@>=2.0.0 <3.0.0", "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.0.tgz" }, + "fileset": { + "version": "0.1.8", + "from": "fileset@>=0.1.5 <0.2.0", + "resolved": "https://registry.npmjs.org/fileset/-/fileset-0.1.8.tgz", + "dev": true, + "dependencies": { + "glob": { + "version": "3.2.11", + "from": "glob@>=3.0.0 <4.0.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-3.2.11.tgz", + "dev": true, + "dependencies": { + "minimatch": { + "version": "0.3.0", + "from": "minimatch@>=0.3.0 <0.4.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.3.0.tgz", + "dev": true + } + } + }, + "minimatch": { + "version": "0.4.0", + "from": "minimatch@>=0.0.0 <1.0.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.4.0.tgz", + "dev": true + } + } + }, "fill-range": { "version": "2.2.3", "from": "fill-range@>=2.1.0 <3.0.0", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.3.tgz" }, + "find-parent-dir": { + "version": "0.3.0", + "from": "find-parent-dir@>=0.3.0 <0.4.0", + "resolved": "https://registry.npmjs.org/find-parent-dir/-/find-parent-dir-0.3.0.tgz", + "dev": true + }, + "find-up": { + "version": "1.1.2", + "from": "find-up@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "dev": true + }, + "findup-sync": { + "version": "0.1.3", + "from": "findup-sync@>=0.1.2 <0.2.0", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-0.1.3.tgz", + "dev": true, + "dependencies": { + "glob": { + "version": "3.2.11", + "from": "glob@>=3.2.9 <3.3.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-3.2.11.tgz", + "dev": true + }, + "lodash": { + "version": "2.4.2", + "from": "lodash@>=2.4.1 <2.5.0", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-2.4.2.tgz", + "dev": true + }, + "minimatch": { + "version": "0.3.0", + "from": "minimatch@>=0.3.0 <0.4.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.3.0.tgz", + "dev": true + } + } + }, + "flat-cache": { + "version": "1.2.2", + "from": "flat-cache@>=1.2.1 <2.0.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.2.2.tgz", + "dev": true + }, "for-in": { - "version": "0.1.6", - "from": "for-in@>=0.1.5 <0.2.0", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-0.1.6.tgz" + "version": "1.0.2", + "from": "for-in@>=1.0.1 <2.0.0", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz" }, "for-own": { - "version": "0.1.4", + "version": "0.1.5", "from": "for-own@>=0.1.4 <0.2.0", - "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.4.tgz" + "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz" + }, + "forever-agent": { + "version": "0.6.1", + "from": "forever-agent@>=0.6.1 <0.7.0", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz" + }, + "form-data": { + "version": "2.1.2", + "from": "form-data@>=2.1.1 <2.2.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.1.2.tgz" + }, + "fs-extra": { + "version": "2.0.0", + "from": "fs-extra@2.0.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-2.0.0.tgz" + }, + "fs.realpath": { + "version": "1.0.0", + "from": "fs.realpath@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "dev": true + }, + "gaze": { + "version": "0.3.4", + "from": "gaze@>=0.3.4 <0.4.0", + "resolved": "https://registry.npmjs.org/gaze/-/gaze-0.3.4.tgz", + "dev": true, + "dependencies": { + "minimatch": { + "version": "0.2.14", + "from": "minimatch@>=0.2.9 <0.3.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz", + "dev": true + } + } + }, + "generate-function": { + "version": "2.0.0", + "from": "generate-function@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz" + }, + "generate-object-property": { + "version": "1.2.0", + "from": "generate-object-property@>=1.1.0 <2.0.0", + "resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz" + }, + "get-caller-file": { + "version": "1.0.2", + "from": "get-caller-file@>=1.0.1 <2.0.0", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.2.tgz", + "dev": true + }, + "getobject": { + "version": "0.1.0", + "from": "getobject@>=0.1.0 <0.2.0", + "resolved": "https://registry.npmjs.org/getobject/-/getobject-0.1.0.tgz", + "dev": true + }, + "getpass": { + "version": "0.1.6", + "from": "getpass@>=0.1.1 <0.2.0", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.6.tgz", + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "from": "assert-plus@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz" + } + } + }, + "glob": { + "version": "7.1.1", + "from": "glob@7.1.1", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.1.tgz", + "dev": true }, "glob-base": { "version": "0.3.0", @@ -117,25 +1061,469 @@ "from": "glob-parent@>=2.0.0 <3.0.0", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz" }, + "globals": { + "version": "9.16.0", + "from": "globals@>=9.2.0 <10.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-9.16.0.tgz", + "dev": true + }, + "globby": { + "version": "5.0.0", + "from": "globby@>=5.0.0 <6.0.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-5.0.0.tgz", + "dev": true + }, "graceful-fs": { "version": "4.1.11", "from": "graceful-fs@>=4.1.2 <5.0.0", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz" }, + "graceful-readlink": { + "version": "1.0.1", + "from": "graceful-readlink@>=1.0.0", + "resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz" + }, + "growl": { + "version": "1.7.0", + "from": "growl@>=1.7.0 <1.8.0", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.7.0.tgz", + "dev": true + }, + "grunt": { + "version": "0.4.5", + "from": "grunt@0.4.5", + "resolved": "https://registry.npmjs.org/grunt/-/grunt-0.4.5.tgz", + "dev": true, + "dependencies": { + "async": { + "version": "0.1.22", + "from": "async@>=0.1.22 <0.2.0", + "resolved": "https://registry.npmjs.org/async/-/async-0.1.22.tgz", + "dev": true + }, + "glob": { + "version": "3.1.21", + "from": "glob@>=3.1.21 <3.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-3.1.21.tgz", + "dev": true + }, + "graceful-fs": { + "version": "1.2.3", + "from": "graceful-fs@>=1.2.0 <1.3.0", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.2.3.tgz", + "dev": true + }, + "inherits": { + "version": "1.0.2", + "from": "inherits@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-1.0.2.tgz", + "dev": true + }, + "lodash": { + "version": "0.9.2", + "from": "lodash@>=0.9.2 <0.10.0", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-0.9.2.tgz", + "dev": true + }, + "minimatch": { + "version": "0.2.14", + "from": "minimatch@>=0.2.12 <0.3.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz", + "dev": true + }, + "nopt": { + "version": "1.0.10", + "from": "nopt@>=1.0.10 <1.1.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", + "dev": true + } + } + }, + "grunt-cleanempty": { + "version": "1.0.3", + "from": "grunt-cleanempty@1.0.3", + "resolved": "https://registry.npmjs.org/grunt-cleanempty/-/grunt-cleanempty-1.0.3.tgz", + "dev": true + }, + "grunt-cli": { + "version": "0.1.9", + "from": "grunt-cli@0.1.9", + "resolved": "https://registry.npmjs.org/grunt-cli/-/grunt-cli-0.1.9.tgz", + "dev": true, + "dependencies": { + "nopt": { + "version": "1.0.10", + "from": "nopt@>=1.0.10 <1.1.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", + "dev": true + } + } + }, + "grunt-contrib-clean": { + "version": "0.4.1", + "from": "grunt-contrib-clean@0.4.1", + "resolved": "https://registry.npmjs.org/grunt-contrib-clean/-/grunt-contrib-clean-0.4.1.tgz", + "dev": true + }, + "grunt-contrib-concat": { + "version": "0.3.0", + "from": "grunt-contrib-concat@0.3.0", + "resolved": "https://registry.npmjs.org/grunt-contrib-concat/-/grunt-contrib-concat-0.3.0.tgz", + "dev": true + }, + "grunt-contrib-copy": { + "version": "0.4.1", + "from": "grunt-contrib-copy@0.4.1", + "resolved": "https://registry.npmjs.org/grunt-contrib-copy/-/grunt-contrib-copy-0.4.1.tgz", + "dev": true + }, + "grunt-contrib-cssmin": { + "version": "0.6.0", + "from": "grunt-contrib-cssmin@0.6.0", + "resolved": "https://registry.npmjs.org/grunt-contrib-cssmin/-/grunt-contrib-cssmin-0.6.0.tgz", + "dev": true + }, + "grunt-contrib-htmlmin": { + "version": "0.1.3", + "from": "grunt-contrib-htmlmin@0.1.3", + "resolved": "https://registry.npmjs.org/grunt-contrib-htmlmin/-/grunt-contrib-htmlmin-0.1.3.tgz", + "dev": true + }, + "grunt-contrib-jasmine": { + "version": "0.4.2", + "from": "grunt-contrib-jasmine@0.4.2", + "resolved": "https://registry.npmjs.org/grunt-contrib-jasmine/-/grunt-contrib-jasmine-0.4.2.tgz", + "dev": true, + "dependencies": { + "graceful-fs": { + "version": "1.1.14", + "from": "graceful-fs@>=1.1.0 <1.2.0", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.1.14.tgz", + "dev": true, + "optional": true + }, + "rimraf": { + "version": "2.0.3", + "from": "rimraf@>=2.0.3 <2.1.0", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.0.3.tgz", + "dev": true + } + } + }, + "grunt-contrib-less": { + "version": "1.4.0", + "from": "grunt-contrib-less@1.4.0", + "resolved": "https://registry.npmjs.org/grunt-contrib-less/-/grunt-contrib-less-1.4.0.tgz", + "dev": true + }, + "grunt-contrib-requirejs": { + "version": "0.4.1", + "from": "grunt-contrib-requirejs@0.4.1", + "resolved": "https://registry.npmjs.org/grunt-contrib-requirejs/-/grunt-contrib-requirejs-0.4.1.tgz", + "dev": true + }, + "grunt-contrib-uglify": { + "version": "0.2.0", + "from": "grunt-contrib-uglify@0.2.0", + "resolved": "https://registry.npmjs.org/grunt-contrib-uglify/-/grunt-contrib-uglify-0.2.0.tgz", + "dev": true + }, + "grunt-contrib-watch": { + "version": "0.4.3", + "from": "grunt-contrib-watch@0.4.3", + "resolved": "https://registry.npmjs.org/grunt-contrib-watch/-/grunt-contrib-watch-0.4.3.tgz", + "dev": true + }, + "grunt-eslint": { + "version": "18.1.0", + "from": "grunt-eslint@18.1.0", + "resolved": "https://registry.npmjs.org/grunt-eslint/-/grunt-eslint-18.1.0.tgz", + "dev": true + }, + "grunt-jasmine-node": { + "version": "0.1.0", + "from": "grunt-jasmine-node@0.1.0", + "resolved": "https://registry.npmjs.org/grunt-jasmine-node/-/grunt-jasmine-node-0.1.0.tgz", + "dev": true + }, + "grunt-legacy-log": { + "version": "0.1.3", + "from": "grunt-legacy-log@>=0.1.0 <0.2.0", + "resolved": "https://registry.npmjs.org/grunt-legacy-log/-/grunt-legacy-log-0.1.3.tgz", + "dev": true, + "dependencies": { + "lodash": { + "version": "2.4.2", + "from": "lodash@>=2.4.1 <2.5.0", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-2.4.2.tgz", + "dev": true + }, + "underscore.string": { + "version": "2.3.3", + "from": "underscore.string@>=2.3.3 <2.4.0", + "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-2.3.3.tgz", + "dev": true + } + } + }, + "grunt-legacy-log-utils": { + "version": "0.1.1", + "from": "grunt-legacy-log-utils@>=0.1.1 <0.2.0", + "resolved": "https://registry.npmjs.org/grunt-legacy-log-utils/-/grunt-legacy-log-utils-0.1.1.tgz", + "dev": true, + "dependencies": { + "lodash": { + "version": "2.4.2", + "from": "lodash@>=2.4.1 <2.5.0", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-2.4.2.tgz", + "dev": true + }, + "underscore.string": { + "version": "2.3.3", + "from": "underscore.string@>=2.3.3 <2.4.0", + "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-2.3.3.tgz", + "dev": true + } + } + }, + "grunt-legacy-util": { + "version": "0.2.0", + "from": "grunt-legacy-util@>=0.2.0 <0.3.0", + "resolved": "https://registry.npmjs.org/grunt-legacy-util/-/grunt-legacy-util-0.2.0.tgz", + "dev": true, + "dependencies": { + "async": { + "version": "0.1.22", + "from": "async@>=0.1.22 <0.2.0", + "resolved": "https://registry.npmjs.org/async/-/async-0.1.22.tgz", + "dev": true + }, + "lodash": { + "version": "0.9.2", + "from": "lodash@>=0.9.2 <0.10.0", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-0.9.2.tgz", + "dev": true + } + } + }, + "grunt-lib-contrib": { + "version": "0.6.1", + "from": "grunt-lib-contrib@>=0.6.0 <0.7.0", + "resolved": "https://registry.npmjs.org/grunt-lib-contrib/-/grunt-lib-contrib-0.6.1.tgz", + "dev": true + }, + "grunt-lib-phantomjs": { + "version": "0.3.0", + "from": "grunt-lib-phantomjs@0.3.0", + "resolved": "https://registry.npmjs.org/grunt-lib-phantomjs/-/grunt-lib-phantomjs-0.3.0.tgz", + "dev": true, + "dependencies": { + "semver": { + "version": "1.0.14", + "from": "semver@>=1.0.14 <1.1.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-1.0.14.tgz", + "dev": true + } + } + }, + "grunt-targethtml": { + "version": "0.2.6", + "from": "grunt-targethtml@0.2.6", + "resolved": "https://registry.npmjs.org/grunt-targethtml/-/grunt-targethtml-0.2.6.tgz", + "dev": true + }, + "grunt-template-jasmine-requirejs": { + "version": "0.1.0", + "from": "grunt-template-jasmine-requirejs@0.1.0", + "resolved": "https://registry.npmjs.org/grunt-template-jasmine-requirejs/-/grunt-template-jasmine-requirejs-0.1.0.tgz", + "dev": true + }, + "grunt-usemin": { + "version": "0.1.11", + "from": "grunt-usemin@0.1.11", + "resolved": "https://registry.npmjs.org/grunt-usemin/-/grunt-usemin-0.1.11.tgz", + "dev": true + }, + "har-validator": { + "version": "2.0.6", + "from": "har-validator@>=2.0.6 <2.1.0", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-2.0.6.tgz" + }, + "has-ansi": { + "version": "2.0.0", + "from": "has-ansi@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz" + }, + "has-flag": { + "version": "1.0.0", + "from": "has-flag@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", + "dev": true + }, + "hash.js": { + "version": "1.0.3", + "from": "hash.js@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.0.3.tgz", + "dev": true + }, + "hawk": { + "version": "3.1.3", + "from": "hawk@>=3.1.3 <3.2.0", + "resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz" + }, + "hmac-drbg": { + "version": "1.0.0", + "from": "hmac-drbg@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.0.tgz", + "dev": true + }, + "hoek": { + "version": "2.16.3", + "from": "hoek@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz" + }, + "hooker": { + "version": "0.2.3", + "from": "hooker@>=0.2.3 <0.3.0", + "resolved": "https://registry.npmjs.org/hooker/-/hooker-0.2.3.tgz", + "dev": true + }, + "hosted-git-info": { + "version": "2.2.0", + "from": "hosted-git-info@>=2.1.4 <3.0.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.2.0.tgz", + "dev": true + }, + "html-minifier": { + "version": "0.5.6", + "from": "html-minifier@>=0.5.0 <0.6.0", + "resolved": "https://registry.npmjs.org/html-minifier/-/html-minifier-0.5.6.tgz", + "dev": true + }, + "http-signature": { + "version": "1.1.1", + "from": "http-signature@>=1.1.0 <1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz" + }, + "https-browserify": { + "version": "0.0.1", + "from": "https-browserify@0.0.1", + "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-0.0.1.tgz", + "dev": true + }, + "husky": { + "version": "0.13.2", + "from": "husky@0.13.2", + "resolved": "https://registry.npmjs.org/husky/-/husky-0.13.2.tgz", + "dev": true, + "dependencies": { + "normalize-path": { + "version": "1.0.0", + "from": "normalize-path@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-1.0.0.tgz", + "dev": true + } + } + }, + "iconv-lite": { + "version": "0.2.11", + "from": "iconv-lite@>=0.2.11 <0.3.0", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.2.11.tgz", + "dev": true + }, + "ieee754": { + "version": "1.1.8", + "from": "ieee754@>=1.1.4 <2.0.0", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.8.tgz", + "dev": true + }, + "ignore": { + "version": "3.2.4", + "from": "ignore@>=3.1.2 <4.0.0", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.2.4.tgz", + "dev": true + }, + "image-size": { + "version": "0.5.1", + "from": "image-size@>=0.5.0 <0.6.0", + "resolved": "https://registry.npmjs.org/image-size/-/image-size-0.5.1.tgz", + "dev": true, + "optional": true + }, + "imurmurhash": { + "version": "0.1.4", + "from": "imurmurhash@>=0.1.4 <0.2.0", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "dev": true + }, + "indexof": { + "version": "0.0.1", + "from": "indexof@0.0.1", + "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "from": "inflight@>=1.0.4 <2.0.0", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "dev": true + }, "inherits": { "version": "2.0.3", - "from": "inherits@>=2.0.0 <3.0.0", + "from": "inherits@>=2.0.1 <3.0.0", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz" }, + "ini": { + "version": "1.3.4", + "from": "ini@>=1.2.0 <2.0.0", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.4.tgz", + "dev": true + }, + "inquirer": { + "version": "0.12.0", + "from": "inquirer@>=0.12.0 <0.13.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-0.12.0.tgz", + "dev": true + }, + "interpret": { + "version": "1.0.1", + "from": "interpret@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.0.1.tgz", + "dev": true + }, + "invert-kv": { + "version": "1.0.0", + "from": "invert-kv@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", + "dev": true + }, + "is-arrayish": { + "version": "0.2.1", + "from": "is-arrayish@>=0.2.1 <0.3.0", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "dev": true + }, "is-binary-path": { "version": "1.0.1", "from": "is-binary-path@>=1.0.0 <2.0.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz" }, "is-buffer": { - "version": "1.1.4", + "version": "1.1.5", "from": "is-buffer@>=1.0.2 <2.0.0", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.4.tgz" + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.5.tgz" + }, + "is-builtin-module": { + "version": "1.0.0", + "from": "is-builtin-module@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", + "dev": true + }, + "is-ci": { + "version": "1.0.10", + "from": "is-ci@>=1.0.9 <2.0.0", + "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-1.0.10.tgz", + "dev": true }, "is-dotfile": { "version": "1.0.2", @@ -157,16 +1545,45 @@ "from": "is-extglob@>=1.0.0 <2.0.0", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz" }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "from": "is-fullwidth-code-point@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "dev": true + }, "is-glob": { "version": "2.0.1", - "from": "is-glob@>=2.0.0 <3.0.0", + "from": "is-glob@>=2.0.1 <3.0.0", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz" }, + "is-my-json-valid": { + "version": "2.16.0", + "from": "is-my-json-valid@>=2.12.4 <3.0.0", + "resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.16.0.tgz" + }, "is-number": { "version": "2.1.0", "from": "is-number@>=2.1.0 <3.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz" }, + "is-path-cwd": { + "version": "1.0.0", + "from": "is-path-cwd@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz", + "dev": true + }, + "is-path-in-cwd": { + "version": "1.0.0", + "from": "is-path-in-cwd@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.0.tgz", + "dev": true + }, + "is-path-inside": { + "version": "1.0.0", + "from": "is-path-inside@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.0.tgz", + "dev": true + }, "is-posix-bracket": { "version": "0.1.1", "from": "is-posix-bracket@>=0.1.0 <0.2.0", @@ -177,6 +1594,28 @@ "from": "is-primitive@>=2.0.0 <3.0.0", "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz" }, + "is-property": { + "version": "1.0.2", + "from": "is-property@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz" + }, + "is-resolvable": { + "version": "1.0.0", + "from": "is-resolvable@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.0.0.tgz", + "dev": true + }, + "is-typedarray": { + "version": "1.0.0", + "from": "is-typedarray@>=1.0.0 <1.1.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz" + }, + "is-utf8": { + "version": "0.2.1", + "from": "is-utf8@>=0.2.0 <0.3.0", + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "dev": true + }, "isarray": { "version": "1.0.0", "from": "isarray@1.0.0", @@ -187,31 +1626,333 @@ "from": "isobject@>=2.0.0 <3.0.0", "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz" }, + "isstream": { + "version": "0.1.2", + "from": "isstream@>=0.1.2 <0.2.0", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz" + }, + "jasmine": { + "version": "2.5.3", + "from": "jasmine@>=2.4.1 <3.0.0", + "resolved": "https://registry.npmjs.org/jasmine/-/jasmine-2.5.3.tgz", + "dev": true + }, + "jasmine-core": { + "version": "2.5.2", + "from": "jasmine-core@>=2.5.2 <2.6.0", + "resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-2.5.2.tgz", + "dev": true + }, + "jasmine-growl-reporter": { + "version": "0.0.3", + "from": "jasmine-growl-reporter@>=0.0.2 <0.1.0", + "resolved": "https://registry.npmjs.org/jasmine-growl-reporter/-/jasmine-growl-reporter-0.0.3.tgz", + "dev": true + }, + "jasmine-node": { + "version": "1.11.0", + "from": "jasmine-node@1.11.0", + "resolved": "https://registry.npmjs.org/jasmine-node/-/jasmine-node-1.11.0.tgz", + "dev": true, + "dependencies": { + "mkdirp": { + "version": "0.3.5", + "from": "mkdirp@>=0.3.5 <0.4.0", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.5.tgz", + "dev": true + } + } + }, + "jasmine-reporters": { + "version": "2.2.0", + "from": "jasmine-reporters@>=0.2.0", + "resolved": "https://registry.npmjs.org/jasmine-reporters/-/jasmine-reporters-2.2.0.tgz", + "dev": true + }, + "jodid25519": { + "version": "1.0.2", + "from": "jodid25519@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/jodid25519/-/jodid25519-1.0.2.tgz", + "optional": true + }, + "js-yaml": { + "version": "2.0.5", + "from": "js-yaml@>=2.0.5 <2.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-2.0.5.tgz", + "dev": true + }, + "jsbn": { + "version": "0.1.1", + "from": "jsbn@>=0.1.0 <0.2.0", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "optional": true + }, + "json-loader": { + "version": "0.5.4", + "from": "json-loader@>=0.5.4 <0.6.0", + "resolved": "https://registry.npmjs.org/json-loader/-/json-loader-0.5.4.tgz", + "dev": true + }, + "json-schema": { + "version": "0.2.3", + "from": "json-schema@0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz" + }, + "json-stable-stringify": { + "version": "1.0.1", + "from": "json-stable-stringify@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", + "dev": true + }, + "json-stringify-safe": { + "version": "5.0.1", + "from": "json-stringify-safe@>=5.0.1 <5.1.0", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz" + }, + "json5": { + "version": "0.5.1", + "from": "json5@>=0.5.0 <0.6.0", + "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", + "dev": true + }, + "jsonfile": { + "version": "2.4.0", + "from": "jsonfile@>=2.1.0 <3.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz" + }, + "jsonify": { + "version": "0.0.0", + "from": "jsonify@>=0.0.0 <0.1.0", + "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", + "dev": true + }, + "jsonpointer": { + "version": "4.0.1", + "from": "jsonpointer@>=4.0.0 <5.0.0", + "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-4.0.1.tgz" + }, + "jsprim": { + "version": "1.4.0", + "from": "jsprim@>=1.2.2 <2.0.0", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.0.tgz", + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "from": "assert-plus@1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz" + } + } + }, + "junk": { + "version": "1.0.3", + "from": "junk@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/junk/-/junk-1.0.3.tgz", + "dev": true + }, + "kew": { + "version": "0.4.0", + "from": "kew@0.4.0", + "resolved": "https://registry.npmjs.org/kew/-/kew-0.4.0.tgz", + "dev": true + }, + "keypress": { + "version": "0.1.0", + "from": "keypress@>=0.1.0 <0.2.0", + "resolved": "https://registry.npmjs.org/keypress/-/keypress-0.1.0.tgz", + "dev": true + }, "kind-of": { "version": "3.1.0", "from": "kind-of@>=3.0.2 <4.0.0", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.1.0.tgz" }, + "lazy-cache": { + "version": "1.0.4", + "from": "lazy-cache@>=1.0.3 <2.0.0", + "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", + "dev": true + }, + "lcid": { + "version": "1.0.0", + "from": "lcid@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", + "dev": true + }, + "less": { + "version": "2.7.2", + "from": "less@>=2.7.1 <2.8.0", + "resolved": "https://registry.npmjs.org/less/-/less-2.7.2.tgz", + "dev": true + }, + "levn": { + "version": "0.3.0", + "from": "levn@>=0.3.0 <0.4.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "dev": true + }, + "load-grunt-tasks": { + "version": "3.5.0", + "from": "load-grunt-tasks@3.5.0", + "resolved": "https://registry.npmjs.org/load-grunt-tasks/-/load-grunt-tasks-3.5.0.tgz", + "dev": true + }, + "load-json-file": { + "version": "1.1.0", + "from": "load-json-file@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "dev": true + }, + "loader-runner": { + "version": "2.3.0", + "from": "loader-runner@>=2.3.0 <3.0.0", + "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-2.3.0.tgz", + "dev": true + }, + "loader-utils": { + "version": "0.2.17", + "from": "loader-utils@>=0.2.16 <0.3.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-0.2.17.tgz", + "dev": true + }, "lodash": { - "version": "4.15.0", - "from": "lodash@4.15.0", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.15.0.tgz" + "version": "4.17.4", + "from": "lodash@4.17.4", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz" + }, + "longest": { + "version": "1.0.1", + "from": "longest@>=1.0.1 <2.0.0", + "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", + "dev": true + }, + "lru-cache": { + "version": "2.7.3", + "from": "lru-cache@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz", + "dev": true + }, + "memory-fs": { + "version": "0.4.1", + "from": "memory-fs@>=0.4.1 <0.5.0", + "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.4.1.tgz", + "dev": true }, "micromatch": { "version": "2.3.11", "from": "micromatch@>=2.1.5 <3.0.0", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz" }, + "miller-rabin": { + "version": "4.0.0", + "from": "miller-rabin@>=4.0.0 <5.0.0", + "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.0.tgz", + "dev": true + }, + "mime": { + "version": "1.2.11", + "from": "mime@>=1.2.11 <1.3.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.2.11.tgz", + "dev": true, + "optional": true + }, + "mime-db": { + "version": "1.26.0", + "from": "mime-db@>=1.26.0 <1.27.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.26.0.tgz" + }, + "mime-types": { + "version": "2.1.14", + "from": "mime-types@>=2.1.7 <2.2.0", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.14.tgz" + }, + "minimalistic-assert": { + "version": "1.0.0", + "from": "minimalistic-assert@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.0.tgz", + "dev": true + }, + "minimalistic-crypto-utils": { + "version": "1.0.1", + "from": "minimalistic-crypto-utils@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "dev": true + }, "minimatch": { "version": "3.0.3", "from": "minimatch@>=3.0.2 <4.0.0", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz" }, + "minimist": { + "version": "0.0.8", + "from": "minimist@0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "dev": true + }, + "mkdirp": { + "version": "0.5.1", + "from": "mkdirp@>=0.5.0 <0.6.0", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "dev": true + }, + "mkpath": { + "version": "0.1.0", + "from": "mkpath@>=0.1.0 <0.2.0", + "resolved": "https://registry.npmjs.org/mkpath/-/mkpath-0.1.0.tgz" + }, + "ms": { + "version": "0.7.2", + "from": "ms@0.7.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.2.tgz", + "dev": true + }, + "multimatch": { + "version": "2.1.0", + "from": "multimatch@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-2.1.0.tgz", + "dev": true + }, + "mute-stream": { + "version": "0.0.5", + "from": "mute-stream@0.0.5", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.5.tgz", + "dev": true + }, "nan": { "version": "1.0.0", "from": "nan@>=1.0.0 <1.1.0", "resolved": "https://registry.npmjs.org/nan/-/nan-1.0.0.tgz" }, + "node-libs-browser": { + "version": "2.0.0", + "from": "node-libs-browser@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.0.0.tgz", + "dev": true + }, + "nopt": { + "version": "3.0.6", + "from": "nopt@>=3.0.1 <4.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz" + }, + "noptify": { + "version": "0.0.3", + "from": "noptify@latest", + "resolved": "https://registry.npmjs.org/noptify/-/noptify-0.0.3.tgz", + "dev": true, + "dependencies": { + "nopt": { + "version": "2.0.0", + "from": "nopt@>=2.0.0 <2.1.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-2.0.0.tgz", + "dev": true + } + } + }, + "normalize-package-data": { + "version": "2.3.6", + "from": "normalize-package-data@>=2.3.2 <3.0.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.3.6.tgz", + "dev": true + }, "normalize-path": { "version": "2.0.1", "from": "normalize-path@>=2.0.1 <3.0.0", @@ -1706,6 +3447,37 @@ } } }, + "npmconf": { + "version": "2.1.1", + "from": "npmconf@2.1.1", + "resolved": "https://registry.npmjs.org/npmconf/-/npmconf-2.1.1.tgz", + "dev": true, + "dependencies": { + "once": { + "version": "1.3.3", + "from": "once@>=1.3.0 <1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.3.3.tgz", + "dev": true + }, + "semver": { + "version": "4.3.6", + "from": "semver@>=2.0.0 <3.0.0||>=3.0.0 <4.0.0||>=4.0.0 <5.0.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-4.3.6.tgz", + "dev": true + } + } + }, + "number-is-nan": { + "version": "1.0.1", + "from": "number-is-nan@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "dev": true + }, + "oauth-sign": { + "version": "0.8.2", + "from": "oauth-sign@>=0.8.1 <0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz" + }, "object-assign": { "version": "4.1.1", "from": "object-assign@>=4.0.1 <5.0.0", @@ -1716,26 +3488,293 @@ "from": "object.omit@>=2.0.0 <3.0.0", "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz" }, + "once": { + "version": "1.4.0", + "from": "once@>=1.3.0 <2.0.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "dev": true + }, + "onetime": { + "version": "1.1.0", + "from": "onetime@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz", + "dev": true + }, "opn": { "version": "4.0.2", "from": "opn@4.0.2", "resolved": "https://registry.npmjs.org/opn/-/opn-4.0.2.tgz" }, + "optimist": { + "version": "0.3.7", + "from": "optimist@>=0.3.5 <0.4.0", + "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.3.7.tgz", + "dev": true + }, + "optionator": { + "version": "0.8.2", + "from": "optionator@>=0.8.1 <0.9.0", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", + "dev": true, + "dependencies": { + "wordwrap": { + "version": "1.0.0", + "from": "wordwrap@>=1.0.0 <1.1.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "dev": true + } + } + }, "options": { "version": "0.0.6", "from": "options@>=0.0.5", "resolved": "https://registry.npmjs.org/options/-/options-0.0.6.tgz" }, + "os-browserify": { + "version": "0.2.1", + "from": "os-browserify@>=0.2.0 <0.3.0", + "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.2.1.tgz", + "dev": true + }, + "os-homedir": { + "version": "1.0.2", + "from": "os-homedir@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "dev": true + }, + "os-locale": { + "version": "1.4.0", + "from": "os-locale@>=1.4.0 <2.0.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", + "dev": true + }, + "os-tmpdir": { + "version": "1.0.2", + "from": "os-tmpdir@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz" + }, + "osenv": { + "version": "0.1.4", + "from": "osenv@>=0.1.0 <0.2.0", + "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.4.tgz", + "dev": true + }, + "package": { + "version": "1.0.1", + "from": "package@>=1.0.0 <1.2.0", + "resolved": "https://registry.npmjs.org/package/-/package-1.0.1.tgz", + "dev": true + }, + "pako": { + "version": "0.2.9", + "from": "pako@>=0.2.0 <0.3.0", + "resolved": "https://registry.npmjs.org/pako/-/pako-0.2.9.tgz", + "dev": true + }, + "parse-asn1": { + "version": "5.1.0", + "from": "parse-asn1@>=5.0.0 <6.0.0", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.0.tgz", + "dev": true + }, "parse-glob": { "version": "3.0.4", "from": "parse-glob@>=3.0.4 <4.0.0", "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz" }, + "parse-json": { + "version": "2.2.0", + "from": "parse-json@>=2.2.0 <3.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "dev": true + }, + "path-browserify": { + "version": "0.0.0", + "from": "path-browserify@0.0.0", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.0.tgz", + "dev": true + }, + "path-exists": { + "version": "2.1.0", + "from": "path-exists@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "dev": true + }, "path-is-absolute": { "version": "1.0.1", "from": "path-is-absolute@>=1.0.0 <2.0.0", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" }, + "path-is-inside": { + "version": "1.0.2", + "from": "path-is-inside@>=1.0.1 <2.0.0", + "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", + "dev": true + }, + "path-type": { + "version": "1.1.0", + "from": "path-type@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", + "dev": true + }, + "pbkdf2": { + "version": "3.0.9", + "from": "pbkdf2@>=3.0.3 <4.0.0", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.9.tgz", + "dev": true + }, + "phantomjs": { + "version": "1.9.18", + "from": "phantomjs@1.9.18", + "resolved": "https://registry.npmjs.org/phantomjs/-/phantomjs-1.9.18.tgz", + "dev": true, + "dependencies": { + "asn1": { + "version": "0.1.11", + "from": "asn1@0.1.11", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.1.11.tgz", + "dev": true, + "optional": true + }, + "assert-plus": { + "version": "0.1.5", + "from": "assert-plus@>=0.1.5 <0.2.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.1.5.tgz", + "dev": true, + "optional": true + }, + "async": { + "version": "0.9.2", + "from": "async@>=0.9.0 <0.10.0", + "resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz", + "dev": true, + "optional": true + }, + "aws-sign2": { + "version": "0.5.0", + "from": "aws-sign2@>=0.5.0 <0.6.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.5.0.tgz", + "dev": true, + "optional": true + }, + "boom": { + "version": "0.4.2", + "from": "boom@>=0.4.0 <0.5.0", + "resolved": "https://registry.npmjs.org/boom/-/boom-0.4.2.tgz", + "dev": true + }, + "caseless": { + "version": "0.6.0", + "from": "caseless@>=0.6.0 <0.7.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.6.0.tgz", + "dev": true + }, + "combined-stream": { + "version": "0.0.7", + "from": "combined-stream@>=0.0.4 <0.1.0", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-0.0.7.tgz", + "dev": true, + "optional": true + }, + "cryptiles": { + "version": "0.2.2", + "from": "cryptiles@>=0.2.0 <0.3.0", + "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-0.2.2.tgz", + "dev": true, + "optional": true + }, + "delayed-stream": { + "version": "0.0.5", + "from": "delayed-stream@0.0.5", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-0.0.5.tgz", + "dev": true, + "optional": true + }, + "forever-agent": { + "version": "0.5.2", + "from": "forever-agent@>=0.5.0 <0.6.0", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.5.2.tgz", + "dev": true + }, + "form-data": { + "version": "0.1.4", + "from": "form-data@>=0.1.0 <0.2.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-0.1.4.tgz", + "dev": true, + "optional": true + }, + "fs-extra": { + "version": "0.23.1", + "from": "fs-extra@>=0.23.1 <0.24.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.23.1.tgz", + "dev": true + }, + "hawk": { + "version": "1.1.1", + "from": "hawk@1.1.1", + "resolved": "https://registry.npmjs.org/hawk/-/hawk-1.1.1.tgz", + "dev": true, + "optional": true + }, + "hoek": { + "version": "0.9.1", + "from": "hoek@>=0.9.0 <0.10.0", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-0.9.1.tgz", + "dev": true + }, + "http-signature": { + "version": "0.10.1", + "from": "http-signature@>=0.10.0 <0.11.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-0.10.1.tgz", + "dev": true, + "optional": true + }, + "mime-types": { + "version": "1.0.2", + "from": "mime-types@>=1.0.1 <1.1.0", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-1.0.2.tgz", + "dev": true + }, + "node-uuid": { + "version": "1.4.7", + "from": "node-uuid@>=1.4.0 <1.5.0", + "resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.7.tgz", + "dev": true + }, + "oauth-sign": { + "version": "0.4.0", + "from": "oauth-sign@>=0.4.0 <0.5.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.4.0.tgz", + "dev": true, + "optional": true + }, + "qs": { + "version": "1.2.2", + "from": "qs@>=1.2.0 <1.3.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-1.2.2.tgz", + "dev": true + }, + "request": { + "version": "2.42.0", + "from": "request@2.42.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.42.0.tgz", + "dev": true + }, + "sntp": { + "version": "0.2.4", + "from": "sntp@>=0.2.0 <0.3.0", + "resolved": "https://registry.npmjs.org/sntp/-/sntp-0.2.4.tgz", + "dev": true, + "optional": true + } + } + }, + "pify": { + "version": "2.3.0", + "from": "pify@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "dev": true + }, "pinkie": { "version": "2.0.4", "from": "pinkie@>=2.0.0 <3.0.0", @@ -1746,31 +3785,137 @@ "from": "pinkie-promise@>=2.0.0 <3.0.0", "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz" }, + "pkg-up": { + "version": "1.0.0", + "from": "pkg-up@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/pkg-up/-/pkg-up-1.0.0.tgz", + "dev": true + }, + "pluralize": { + "version": "1.2.1", + "from": "pluralize@>=1.2.1 <2.0.0", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-1.2.1.tgz", + "dev": true + }, + "prelude-ls": { + "version": "1.1.2", + "from": "prelude-ls@>=1.1.2 <1.2.0", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "dev": true + }, "preserve": { "version": "0.2.0", "from": "preserve@>=0.2.0 <0.3.0", "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz" }, + "process": { + "version": "0.11.9", + "from": "process@>=0.11.0 <0.12.0", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.9.tgz", + "dev": true + }, "process-nextick-args": { "version": "1.0.7", "from": "process-nextick-args@>=1.0.6 <1.1.0", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz" }, + "progress": { + "version": "1.1.8", + "from": "progress@1.1.8", + "resolved": "https://registry.npmjs.org/progress/-/progress-1.1.8.tgz", + "dev": true + }, + "promise": { + "version": "7.1.1", + "from": "promise@>=7.1.1 <8.0.0", + "resolved": "https://registry.npmjs.org/promise/-/promise-7.1.1.tgz", + "dev": true, + "optional": true + }, + "proto-list": { + "version": "1.2.4", + "from": "proto-list@>=1.2.1 <1.3.0", + "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", + "dev": true + }, + "prr": { + "version": "0.0.0", + "from": "prr@>=0.0.0 <0.1.0", + "resolved": "https://registry.npmjs.org/prr/-/prr-0.0.0.tgz", + "dev": true + }, + "public-encrypt": { + "version": "4.0.0", + "from": "public-encrypt@>=4.0.0 <5.0.0", + "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.0.tgz", + "dev": true + }, + "punycode": { + "version": "1.4.1", + "from": "punycode@>=1.4.1 <2.0.0", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz" + }, + "q": { + "version": "1.4.1", + "from": "q@>=1.1.2 <2.0.0", + "resolved": "https://registry.npmjs.org/q/-/q-1.4.1.tgz" + }, + "qs": { + "version": "6.3.2", + "from": "qs@>=6.3.0 <6.4.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.3.2.tgz" + }, + "querystring": { + "version": "0.2.0", + "from": "querystring@0.2.0", + "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", + "dev": true + }, + "querystring-es3": { + "version": "0.2.1", + "from": "querystring-es3@>=0.2.0 <0.3.0", + "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", + "dev": true + }, "randomatic": { "version": "1.1.6", "from": "randomatic@>=1.1.3 <2.0.0", "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.6.tgz" }, + "randombytes": { + "version": "2.0.3", + "from": "randombytes@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.0.3.tgz", + "dev": true + }, + "read-pkg": { + "version": "1.1.0", + "from": "read-pkg@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", + "dev": true + }, + "read-pkg-up": { + "version": "1.0.1", + "from": "read-pkg-up@>=1.0.1 <2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "dev": true + }, "readable-stream": { - "version": "2.2.2", + "version": "2.2.5", "from": "readable-stream@>=2.0.2 <3.0.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.2.tgz" + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.5.tgz" }, "readdirp": { "version": "2.1.0", "from": "readdirp@>=2.0.0 <3.0.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.1.0.tgz" }, + "readline2": { + "version": "1.0.1", + "from": "readline2@>=1.0.1 <2.0.0", + "resolved": "https://registry.npmjs.org/readline2/-/readline2-1.0.1.tgz", + "dev": true + }, "regex-cache": { "version": "0.4.3", "from": "regex-cache@>=0.4.2 <0.5.0", @@ -1786,26 +3931,593 @@ "from": "repeat-string@>=1.5.2 <2.0.0", "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz" }, + "request": { + "version": "2.79.0", + "from": "request@2.79.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.79.0.tgz" + }, + "request-progress": { + "version": "0.3.1", + "from": "request-progress@0.3.1", + "resolved": "https://registry.npmjs.org/request-progress/-/request-progress-0.3.1.tgz", + "dev": true + }, + "require-directory": { + "version": "2.1.1", + "from": "require-directory@>=2.1.1 <3.0.0", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "dev": true + }, + "require-main-filename": { + "version": "1.0.1", + "from": "require-main-filename@>=1.0.1 <2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "dev": true + }, + "require-uncached": { + "version": "1.0.3", + "from": "require-uncached@>=1.0.2 <2.0.0", + "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", + "dev": true + }, + "requirejs": { + "version": "2.1.22", + "from": "requirejs@>=2.1.0 <2.2.0", + "resolved": "https://registry.npmjs.org/requirejs/-/requirejs-2.1.22.tgz", + "dev": true + }, + "resolve": { + "version": "0.3.1", + "from": "resolve@>=0.3.1 <0.4.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-0.3.1.tgz", + "dev": true + }, + "resolve-from": { + "version": "1.0.1", + "from": "resolve-from@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", + "dev": true + }, + "resolve-pkg": { + "version": "0.1.0", + "from": "resolve-pkg@>=0.1.0 <0.2.0", + "resolved": "https://registry.npmjs.org/resolve-pkg/-/resolve-pkg-0.1.0.tgz", + "dev": true, + "dependencies": { + "resolve-from": { + "version": "2.0.0", + "from": "resolve-from@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-2.0.0.tgz", + "dev": true + } + } + }, + "restore-cursor": { + "version": "1.0.1", + "from": "restore-cursor@>=1.0.1 <2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-1.0.1.tgz", + "dev": true + }, + "rewire": { + "version": "1.1.2", + "from": "rewire@1.1.2", + "resolved": "https://registry.npmjs.org/rewire/-/rewire-1.1.2.tgz", + "dev": true + }, + "right-align": { + "version": "0.1.3", + "from": "right-align@>=0.1.1 <0.2.0", + "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", + "dev": true + }, + "rimraf": { + "version": "2.2.8", + "from": "rimraf@>=2.2.6 <2.3.0", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.2.8.tgz" + }, + "ripemd160": { + "version": "1.0.1", + "from": "ripemd160@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-1.0.1.tgz", + "dev": true + }, + "run-async": { + "version": "0.1.0", + "from": "run-async@>=0.1.0 <0.2.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-0.1.0.tgz", + "dev": true + }, + "rx-lite": { + "version": "3.1.2", + "from": "rx-lite@>=3.1.2 <4.0.0", + "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-3.1.2.tgz", + "dev": true + }, + "sax": { + "version": "0.6.1", + "from": "sax@>=0.6.1 <0.7.0", + "resolved": "https://registry.npmjs.org/sax/-/sax-0.6.1.tgz", + "dev": true + }, + "semver": { + "version": "5.3.0", + "from": "semver@5.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz" + }, + "set-blocking": { + "version": "2.0.0", + "from": "set-blocking@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "dev": true + }, "set-immediate-shim": { "version": "1.0.1", "from": "set-immediate-shim@>=1.0.1 <2.0.0", "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz" }, + "setimmediate": { + "version": "1.0.5", + "from": "setimmediate@>=1.0.4 <2.0.0", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "dev": true + }, + "sha.js": { + "version": "2.4.8", + "from": "sha.js@>=2.3.6 <3.0.0", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.8.tgz", + "dev": true + }, + "shelljs": { + "version": "0.6.1", + "from": "shelljs@>=0.6.0 <0.7.0", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.6.1.tgz", + "dev": true + }, + "sigmund": { + "version": "1.0.1", + "from": "sigmund@>=1.0.0 <1.1.0", + "resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz", + "dev": true + }, + "slice-ansi": { + "version": "0.0.4", + "from": "slice-ansi@0.0.4", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-0.0.4.tgz", + "dev": true + }, + "sntp": { + "version": "1.0.9", + "from": "sntp@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz" + }, + "source-list-map": { + "version": "0.1.8", + "from": "source-list-map@>=0.1.7 <0.2.0", + "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-0.1.8.tgz", + "dev": true + }, + "source-map": { + "version": "0.5.6", + "from": "source-map@>=0.5.3 <0.6.0", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.6.tgz", + "dev": true + }, + "spdx-correct": { + "version": "1.0.2", + "from": "spdx-correct@>=1.0.0 <1.1.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-1.0.2.tgz", + "dev": true + }, + "spdx-expression-parse": { + "version": "1.0.4", + "from": "spdx-expression-parse@>=1.0.0 <1.1.0", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-1.0.4.tgz", + "dev": true + }, + "spdx-license-ids": { + "version": "1.2.2", + "from": "spdx-license-ids@>=1.0.2 <2.0.0", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz", + "dev": true + }, + "sprintf-js": { + "version": "1.0.3", + "from": "sprintf-js@>=1.0.2 <1.1.0", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "dev": true + }, + "sshpk": { + "version": "1.11.0", + "from": "sshpk@>=1.7.0 <2.0.0", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.11.0.tgz", + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "from": "assert-plus@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz" + } + } + }, + "stream-browserify": { + "version": "2.0.1", + "from": "stream-browserify@>=2.0.1 <3.0.0", + "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.1.tgz", + "dev": true + }, + "stream-http": { + "version": "2.6.3", + "from": "stream-http@>=2.3.1 <3.0.0", + "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.6.3.tgz", + "dev": true + }, "string_decoder": { "version": "0.10.31", "from": "string_decoder@>=0.10.0 <0.11.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" }, + "string-width": { + "version": "1.0.2", + "from": "string-width@>=1.0.1 <2.0.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "dev": true + }, + "stringstream": { + "version": "0.0.5", + "from": "stringstream@>=0.0.4 <0.1.0", + "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz" + }, + "strip-ansi": { + "version": "3.0.1", + "from": "strip-ansi@>=3.0.0 <4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz" + }, + "strip-bom": { + "version": "2.0.0", + "from": "strip-bom@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "dev": true + }, + "strip-json-comments": { + "version": "1.0.4", + "from": "strip-json-comments@>=1.0.1 <1.1.0", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-1.0.4.tgz", + "dev": true + }, + "supports-color": { + "version": "2.0.0", + "from": "supports-color@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz" + }, + "table": { + "version": "3.8.3", + "from": "table@>=3.7.8 <4.0.0", + "resolved": "https://registry.npmjs.org/table/-/table-3.8.3.tgz", + "dev": true, + "dependencies": { + "is-fullwidth-code-point": { + "version": "2.0.0", + "from": "is-fullwidth-code-point@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "dev": true + }, + "string-width": { + "version": "2.0.0", + "from": "string-width@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.0.0.tgz", + "dev": true + } + } + }, + "tapable": { + "version": "0.2.6", + "from": "tapable@>=0.2.5 <0.3.0", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-0.2.6.tgz", + "dev": true + }, + "temp": { + "version": "0.8.3", + "from": "temp@0.8.3", + "resolved": "https://registry.npmjs.org/temp/-/temp-0.8.3.tgz" + }, + "temporary": { + "version": "0.0.8", + "from": "temporary@>=0.0.4 <0.1.0", + "resolved": "https://registry.npmjs.org/temporary/-/temporary-0.0.8.tgz", + "dev": true + }, + "text-table": { + "version": "0.2.0", + "from": "text-table@>=0.2.0 <0.3.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "dev": true + }, + "throttleit": { + "version": "0.0.2", + "from": "throttleit@>=0.0.2 <0.1.0", + "resolved": "https://registry.npmjs.org/throttleit/-/throttleit-0.0.2.tgz", + "dev": true + }, + "through": { + "version": "2.3.8", + "from": "through@>=2.3.6 <3.0.0", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "dev": true + }, + "timers-browserify": { + "version": "2.0.2", + "from": "timers-browserify@>=2.0.2 <3.0.0", + "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.2.tgz", + "dev": true + }, + "tiny-lr": { + "version": "0.0.4", + "from": "tiny-lr@0.0.4", + "resolved": "https://registry.npmjs.org/tiny-lr/-/tiny-lr-0.0.4.tgz", + "dev": true, + "dependencies": { + "qs": { + "version": "0.5.6", + "from": "qs@>=0.5.2 <0.6.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-0.5.6.tgz", + "dev": true + } + } + }, "tinycolor": { "version": "0.0.1", "from": "tinycolor@>=0.0.0 <1.0.0", "resolved": "https://registry.npmjs.org/tinycolor/-/tinycolor-0.0.1.tgz" }, + "to-arraybuffer": { + "version": "1.0.1", + "from": "to-arraybuffer@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", + "dev": true + }, + "touch": { + "version": "0.0.3", + "from": "touch@0.0.3", + "resolved": "https://registry.npmjs.org/touch/-/touch-0.0.3.tgz", + "dependencies": { + "nopt": { + "version": "1.0.10", + "from": "nopt@>=1.0.10 <1.1.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz" + } + } + }, + "tough-cookie": { + "version": "2.3.2", + "from": "tough-cookie@>=2.3.0 <2.4.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.2.tgz" + }, + "traverse": { + "version": "0.3.9", + "from": "traverse@>=0.3.0 <0.4.0", + "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.3.9.tgz" + }, + "tryit": { + "version": "1.0.3", + "from": "tryit@>=1.0.1 <2.0.0", + "resolved": "https://registry.npmjs.org/tryit/-/tryit-1.0.3.tgz", + "dev": true + }, + "tty-browserify": { + "version": "0.0.0", + "from": "tty-browserify@0.0.0", + "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", + "dev": true + }, + "tunnel-agent": { + "version": "0.4.3", + "from": "tunnel-agent@>=0.4.1 <0.5.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.3.tgz" + }, + "tweetnacl": { + "version": "0.14.5", + "from": "tweetnacl@>=0.14.0 <0.15.0", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "optional": true + }, + "type-check": { + "version": "0.3.2", + "from": "type-check@>=0.3.2 <0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "dev": true + }, + "typedarray": { + "version": "0.0.6", + "from": "typedarray@>=0.0.6 <0.0.7", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "dev": true + }, + "uglify-js": { + "version": "2.2.5", + "from": "uglify-js@>=2.2.1 <2.3.0", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.2.5.tgz", + "dev": true, + "dependencies": { + "source-map": { + "version": "0.1.43", + "from": "source-map@>=0.1.7 <0.2.0", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz", + "dev": true + } + } + }, + "uglify-to-browserify": { + "version": "1.0.2", + "from": "uglify-to-browserify@>=1.0.0 <1.1.0", + "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", + "dev": true + }, + "uid-number": { + "version": "0.0.5", + "from": "uid-number@0.0.5", + "resolved": "https://registry.npmjs.org/uid-number/-/uid-number-0.0.5.tgz", + "dev": true + }, + "underscore": { + "version": "1.7.0", + "from": "underscore@>=1.7.0 <1.8.0", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.7.0.tgz", + "dev": true + }, + "underscore.string": { + "version": "2.2.1", + "from": "underscore.string@>=2.2.1 <2.3.0", + "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-2.2.1.tgz", + "dev": true + }, + "url": { + "version": "0.11.0", + "from": "url@>=0.11.0 <0.12.0", + "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", + "dev": true, + "dependencies": { + "punycode": { + "version": "1.3.2", + "from": "punycode@1.3.2", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", + "dev": true + } + } + }, + "user-home": { + "version": "2.0.0", + "from": "user-home@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/user-home/-/user-home-2.0.0.tgz", + "dev": true + }, + "util": { + "version": "0.10.3", + "from": "util@>=0.10.3 <0.11.0", + "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", + "dev": true, + "dependencies": { + "inherits": { + "version": "2.0.1", + "from": "inherits@2.0.1", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", + "dev": true + } + } + }, "util-deprecate": { "version": "1.0.2", "from": "util-deprecate@>=1.0.1 <1.1.0", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz" }, + "uuid": { + "version": "3.0.1", + "from": "uuid@>=3.0.0 <4.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.0.1.tgz" + }, + "validate-npm-package-license": { + "version": "3.0.1", + "from": "validate-npm-package-license@>=3.0.1 <4.0.0", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz", + "dev": true + }, + "verror": { + "version": "1.3.6", + "from": "verror@1.3.6", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.3.6.tgz" + }, + "vm-browserify": { + "version": "0.0.4", + "from": "vm-browserify@0.0.4", + "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz", + "dev": true + }, + "walkdir": { + "version": "0.0.11", + "from": "walkdir@>=0.0.1", + "resolved": "https://registry.npmjs.org/walkdir/-/walkdir-0.0.11.tgz", + "dev": true + }, + "watchpack": { + "version": "1.3.1", + "from": "watchpack@>=1.2.0 <2.0.0", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.3.1.tgz", + "dev": true + }, + "webpack": { + "version": "2.2.1", + "from": "webpack@2.2.1", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-2.2.1.tgz", + "dev": true, + "dependencies": { + "supports-color": { + "version": "3.2.3", + "from": "supports-color@>=3.1.0 <4.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", + "dev": true + }, + "uglify-js": { + "version": "2.8.12", + "from": "uglify-js@>=2.7.5 <3.0.0", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.12.tgz", + "dev": true, + "dependencies": { + "yargs": { + "version": "3.10.0", + "from": "yargs@>=3.10.0 <3.11.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", + "dev": true + } + } + } + } + }, + "webpack-sources": { + "version": "0.1.5", + "from": "webpack-sources@>=0.1.4 <0.2.0", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-0.1.5.tgz", + "dev": true + }, + "which": { + "version": "1.0.9", + "from": "which@>=1.0.5 <1.1.0", + "resolved": "https://registry.npmjs.org/which/-/which-1.0.9.tgz", + "dev": true + }, + "which-module": { + "version": "1.0.0", + "from": "which-module@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", + "dev": true + }, + "window-size": { + "version": "0.1.0", + "from": "window-size@0.1.0", + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", + "dev": true + }, + "wordwrap": { + "version": "0.0.3", + "from": "wordwrap@>=0.0.2 <0.1.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", + "dev": true + }, + "wrap-ansi": { + "version": "2.1.0", + "from": "wrap-ansi@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "dev": true + }, + "wrappy": { + "version": "1.0.2", + "from": "wrappy@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "dev": true + }, + "write": { + "version": "0.2.1", + "from": "write@>=0.2.1 <0.3.0", + "resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz", + "dev": true + }, "ws": { "version": "0.4.32", "from": "ws@>=0.4.31 <0.5.0", @@ -1817,6 +4529,69 @@ "resolved": "https://registry.npmjs.org/commander/-/commander-2.1.0.tgz" } } + }, + "xmldoc": { + "version": "0.1.4", + "from": "xmldoc@>=0.1.2 <0.2.0", + "resolved": "https://registry.npmjs.org/xmldoc/-/xmldoc-0.1.4.tgz", + "dev": true + }, + "xmldom": { + "version": "0.1.27", + "from": "xmldom@>=0.1.22 <0.2.0", + "resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.27.tgz", + "dev": true + }, + "xtend": { + "version": "4.0.1", + "from": "xtend@>=4.0.0 <5.0.0", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz" + }, + "y18n": { + "version": "3.2.1", + "from": "y18n@>=3.2.1 <4.0.0", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", + "dev": true + }, + "yargs": { + "version": "6.6.0", + "from": "yargs@>=6.0.0 <7.0.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-6.6.0.tgz", + "dev": true, + "dependencies": { + "camelcase": { + "version": "3.0.0", + "from": "camelcase@>=3.0.0 <4.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", + "dev": true + }, + "cliui": { + "version": "3.2.0", + "from": "cliui@>=3.2.0 <4.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", + "dev": true + } + } + }, + "yargs-parser": { + "version": "4.2.1", + "from": "yargs-parser@>=4.2.0 <5.0.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-4.2.1.tgz", + "dev": true, + "dependencies": { + "camelcase": { + "version": "3.0.0", + "from": "camelcase@>=3.0.0 <4.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", + "dev": true + } + } + }, + "zlib-browserify": { + "version": "0.0.1", + "from": "zlib-browserify@0.0.1", + "resolved": "https://registry.npmjs.org/zlib-browserify/-/zlib-browserify-0.0.1.tgz", + "dev": true } } } diff --git a/package.json b/package.json index 858652514dd..35de9fe30e1 100644 --- a/package.json +++ b/package.json @@ -14,15 +14,20 @@ }, "dependencies": { "anymatch": "1.3.0", - "chokidar": "1.6.0", - "lodash": "4.15.0", + "async": "2.1.4", + "chokidar": "1.6.1", + "decompress-zip": "0.3.0", + "fs-extra": "2.0.0", + "lodash": "4.17.4", "npm": "3.10.9", "opn": "4.0.2", + "request": "2.79.0", + "semver": "5.3.0", + "temp": "0.8.3", "ws": "~0.4.31" }, "devDependencies": { - "fs-extra": "0.5.0", - "glob": "7.0.6", + "glob": "7.1.1", "grunt": "0.4.5", "husky": "0.13.2", "jasmine-node": "1.11.0", @@ -46,9 +51,10 @@ "grunt-usemin": "0.1.11", "load-grunt-tasks": "3.5.0", "q": "1.4.1", - "semver": "^4.1.0", + "rewire": "1.1.2", "xmldoc": "^0.1.2", - "grunt-cleanempty": "1.0.3" + "grunt-cleanempty": "1.0.3", + "webpack": "2.2.1" }, "scripts": { "prepush": "npm run eslint", diff --git a/src/config.json b/src/config.json index 3775afad8db..55a2c5db84c 100644 --- a/src/config.json +++ b/src/config.json @@ -37,16 +37,22 @@ }, "dependencies": { "anymatch": "1.3.0", - "chokidar": "1.6.0", - "lodash": "4.15.0", + "async": "2.1.4", + "chokidar": "1.6.1", + "decompress-zip": "0.3.0", + "fs-extra": "2.0.0", + "lodash": "4.17.4", "npm": "3.10.9", "opn": "4.0.2", + "request": "2.79.0", + "semver": "5.3.0", + "temp": "0.8.3", "ws": "~0.4.31" }, "devDependencies": { - "fs-extra": "0.5.0", - "glob": "7.0.6", + "glob": "7.1.1", "grunt": "0.4.5", + "husky": "0.13.2", "jasmine-node": "1.11.0", "grunt-jasmine-node": "0.1.0", "grunt-cli": "0.1.9", @@ -68,13 +74,16 @@ "grunt-usemin": "0.1.11", "load-grunt-tasks": "3.5.0", "q": "1.4.1", - "semver": "^4.1.0", + "rewire": "1.1.2", "xmldoc": "^0.1.2", - "grunt-cleanempty": "1.0.3" + "grunt-cleanempty": "1.0.3", + "webpack": "2.2.1" }, "scripts": { + "prepush": "npm run eslint", "postinstall": "grunt install", - "test": "grunt cla-check-pull test" + "test": "grunt test cla-check-pull", + "eslint": "grunt eslint" }, "licenses": [ { diff --git a/src/extensibility/ExtensionManager.js b/src/extensibility/ExtensionManager.js index 5997d482abc..7dde5e617b4 100644 --- a/src/extensibility/ExtensionManager.js +++ b/src/extensibility/ExtensionManager.js @@ -52,7 +52,7 @@ define(function (require, exports, module) { ThemeManager = require("view/ThemeManager"); // semver.browser is an AMD-compatible module - var semver = require("extensibility/node/node_modules/semver/semver.browser"); + var semver = require("thirdparty/semver.browser"); /** * @private diff --git a/src/extensibility/node/node_modules/.bin/decompress-zip b/src/extensibility/node/node_modules/.bin/decompress-zip deleted file mode 120000 index 83255291682..00000000000 --- a/src/extensibility/node/node_modules/.bin/decompress-zip +++ /dev/null @@ -1 +0,0 @@ -../decompress-zip/bin/decompress-zip \ No newline at end of file diff --git a/src/extensibility/node/node_modules/.bin/semver b/src/extensibility/node/node_modules/.bin/semver deleted file mode 120000 index 317eb293d8e..00000000000 --- a/src/extensibility/node/node_modules/.bin/semver +++ /dev/null @@ -1 +0,0 @@ -../semver/bin/semver \ No newline at end of file diff --git a/src/extensibility/node/node_modules/async/LICENSE b/src/extensibility/node/node_modules/async/LICENSE deleted file mode 100644 index b7f9d5001c0..00000000000 --- a/src/extensibility/node/node_modules/async/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2010 Caolan McMahon - -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/src/extensibility/node/node_modules/async/README.md b/src/extensibility/node/node_modules/async/README.md deleted file mode 100644 index 17164760b99..00000000000 --- a/src/extensibility/node/node_modules/async/README.md +++ /dev/null @@ -1,1365 +0,0 @@ -# Async.js - -Async is a utility module which provides straight-forward, powerful functions -for working with asynchronous JavaScript. Although originally designed for -use with [node.js](http://nodejs.org), it can also be used directly in the -browser. - -Async provides around 20 functions that include the usual 'functional' -suspects (map, reduce, filter, each…) as well as some common patterns -for asynchronous control flow (parallel, series, waterfall…). All these -functions assume you follow the node.js convention of providing a single -callback as the last argument of your async function. - - -## Quick Examples - -```javascript -async.map(['file1','file2','file3'], fs.stat, function(err, results){ - // results is now an array of stats for each file -}); - -async.filter(['file1','file2','file3'], path.exists, function(results){ - // results now equals an array of the existing files -}); - -async.parallel([ - function(){ ... }, - function(){ ... } -], callback); - -async.series([ - function(){ ... }, - function(){ ... } -]); -``` - -There are many more functions available so take a look at the docs below for a -full list. This module aims to be comprehensive, so if you feel anything is -missing please create a GitHub issue for it. - - -## Download - -Releases are available for download from -[GitHub](http://github.com/caolan/async/downloads). -Alternatively, you can install using Node Package Manager (npm): - - npm install async - - -__Development:__ [async.js](https://github.com/caolan/async/raw/master/lib/async.js) - 17.5kb Uncompressed - -__Production:__ [async.min.js](https://github.com/caolan/async/raw/master/dist/async.min.js) - 1.7kb Packed and Gzipped - - -## In the Browser - -So far its been tested in IE6, IE7, IE8, FF3.6 and Chrome 5. Usage: - -```html - - -``` - -## Documentation - -### Collections - -* [each](#each) -* [map](#map) -* [filter](#filter) -* [reject](#reject) -* [reduce](#reduce) -* [detect](#detect) -* [sortBy](#sortBy) -* [some](#some) -* [every](#every) -* [concat](#concat) - -### Control Flow - -* [series](#series) -* [parallel](#parallel) -* [whilst](#whilst) -* [doWhilst](#doWhilst) -* [until](#until) -* [doUntil](#doUntil) -* [waterfall](#waterfall) -* [compose](#compose) -* [applyEach](#applyEach) -* [queue](#queue) -* [cargo](#cargo) -* [auto](#auto) -* [iterator](#iterator) -* [apply](#apply) -* [nextTick](#nextTick) -* [times](#times) -* [timesSeries](#timesSeries) - -### Utils - -* [memoize](#memoize) -* [unmemoize](#unmemoize) -* [log](#log) -* [dir](#dir) -* [noConflict](#noConflict) - - -## Collections - - - -### each(arr, iterator, callback) - -Applies an iterator function to each item in an array, in parallel. -The iterator is called with an item from the list and a callback for when it -has finished. If the iterator passes an error to this callback, the main -callback for the each function is immediately called with the error. - -Note, that since this function applies the iterator to each item in parallel -there is no guarantee that the iterator functions will complete in order. - -__Arguments__ - -* arr - An array to iterate over. -* iterator(item, callback) - A function to apply to each item in the array. - The iterator is passed a callback(err) which must be called once it has - completed. If no error has occured, the callback should be run without - arguments or with an explicit null argument. -* callback(err) - A callback which is called after all the iterator functions - have finished, or an error has occurred. - -__Example__ - -```js -// assuming openFiles is an array of file names and saveFile is a function -// to save the modified contents of that file: - -async.each(openFiles, saveFile, function(err){ - // if any of the saves produced an error, err would equal that error -}); -``` - ---------------------------------------- - - - -### eachSeries(arr, iterator, callback) - -The same as each only the iterator is applied to each item in the array in -series. The next iterator is only called once the current one has completed -processing. This means the iterator functions will complete in order. - - ---------------------------------------- - - - -### eachLimit(arr, limit, iterator, callback) - -The same as each only no more than "limit" iterators will be simultaneously -running at any time. - -Note that the items are not processed in batches, so there is no guarantee that - the first "limit" iterator functions will complete before any others are -started. - -__Arguments__ - -* arr - An array to iterate over. -* limit - The maximum number of iterators to run at any time. -* iterator(item, callback) - A function to apply to each item in the array. - The iterator is passed a callback(err) which must be called once it has - completed. If no error has occured, the callback should be run without - arguments or with an explicit null argument. -* callback(err) - A callback which is called after all the iterator functions - have finished, or an error has occurred. - -__Example__ - -```js -// Assume documents is an array of JSON objects and requestApi is a -// function that interacts with a rate-limited REST api. - -async.eachLimit(documents, 20, requestApi, function(err){ - // if any of the saves produced an error, err would equal that error -}); -``` - ---------------------------------------- - - -### map(arr, iterator, callback) - -Produces a new array of values by mapping each value in the given array through -the iterator function. The iterator is called with an item from the array and a -callback for when it has finished processing. The callback takes 2 arguments, -an error and the transformed item from the array. If the iterator passes an -error to this callback, the main callback for the map function is immediately -called with the error. - -Note, that since this function applies the iterator to each item in parallel -there is no guarantee that the iterator functions will complete in order, however -the results array will be in the same order as the original array. - -__Arguments__ - -* arr - An array to iterate over. -* iterator(item, callback) - A function to apply to each item in the array. - The iterator is passed a callback(err, transformed) which must be called once - it has completed with an error (which can be null) and a transformed item. -* callback(err, results) - A callback which is called after all the iterator - functions have finished, or an error has occurred. Results is an array of the - transformed items from the original array. - -__Example__ - -```js -async.map(['file1','file2','file3'], fs.stat, function(err, results){ - // results is now an array of stats for each file -}); -``` - ---------------------------------------- - - -### mapSeries(arr, iterator, callback) - -The same as map only the iterator is applied to each item in the array in -series. The next iterator is only called once the current one has completed -processing. The results array will be in the same order as the original. - - ---------------------------------------- - - -### mapLimit(arr, limit, iterator, callback) - -The same as map only no more than "limit" iterators will be simultaneously -running at any time. - -Note that the items are not processed in batches, so there is no guarantee that - the first "limit" iterator functions will complete before any others are -started. - -__Arguments__ - -* arr - An array to iterate over. -* limit - The maximum number of iterators to run at any time. -* iterator(item, callback) - A function to apply to each item in the array. - The iterator is passed a callback(err, transformed) which must be called once - it has completed with an error (which can be null) and a transformed item. -* callback(err, results) - A callback which is called after all the iterator - functions have finished, or an error has occurred. Results is an array of the - transformed items from the original array. - -__Example__ - -```js -async.map(['file1','file2','file3'], 1, fs.stat, function(err, results){ - // results is now an array of stats for each file -}); -``` - ---------------------------------------- - - -### filter(arr, iterator, callback) - -__Alias:__ select - -Returns a new array of all the values which pass an async truth test. -_The callback for each iterator call only accepts a single argument of true or -false, it does not accept an error argument first!_ This is in-line with the -way node libraries work with truth tests like path.exists. This operation is -performed in parallel, but the results array will be in the same order as the -original. - -__Arguments__ - -* arr - An array to iterate over. -* iterator(item, callback) - A truth test to apply to each item in the array. - The iterator is passed a callback(truthValue) which must be called with a - boolean argument once it has completed. -* callback(results) - A callback which is called after all the iterator - functions have finished. - -__Example__ - -```js -async.filter(['file1','file2','file3'], path.exists, function(results){ - // results now equals an array of the existing files -}); -``` - ---------------------------------------- - - -### filterSeries(arr, iterator, callback) - -__alias:__ selectSeries - -The same as filter only the iterator is applied to each item in the array in -series. The next iterator is only called once the current one has completed -processing. The results array will be in the same order as the original. - ---------------------------------------- - - -### reject(arr, iterator, callback) - -The opposite of filter. Removes values that pass an async truth test. - ---------------------------------------- - - -### rejectSeries(arr, iterator, callback) - -The same as reject, only the iterator is applied to each item in the array -in series. - - ---------------------------------------- - - -### reduce(arr, memo, iterator, callback) - -__aliases:__ inject, foldl - -Reduces a list of values into a single value using an async iterator to return -each successive step. Memo is the initial state of the reduction. This -function only operates in series. For performance reasons, it may make sense to -split a call to this function into a parallel map, then use the normal -Array.prototype.reduce on the results. This function is for situations where -each step in the reduction needs to be async, if you can get the data before -reducing it then its probably a good idea to do so. - -__Arguments__ - -* arr - An array to iterate over. -* memo - The initial state of the reduction. -* iterator(memo, item, callback) - A function applied to each item in the - array to produce the next step in the reduction. The iterator is passed a - callback(err, reduction) which accepts an optional error as its first - argument, and the state of the reduction as the second. If an error is - passed to the callback, the reduction is stopped and the main callback is - immediately called with the error. -* callback(err, result) - A callback which is called after all the iterator - functions have finished. Result is the reduced value. - -__Example__ - -```js -async.reduce([1,2,3], 0, function(memo, item, callback){ - // pointless async: - process.nextTick(function(){ - callback(null, memo + item) - }); -}, function(err, result){ - // result is now equal to the last value of memo, which is 6 -}); -``` - ---------------------------------------- - - -### reduceRight(arr, memo, iterator, callback) - -__Alias:__ foldr - -Same as reduce, only operates on the items in the array in reverse order. - - ---------------------------------------- - - -### detect(arr, iterator, callback) - -Returns the first value in a list that passes an async truth test. The -iterator is applied in parallel, meaning the first iterator to return true will -fire the detect callback with that result. That means the result might not be -the first item in the original array (in terms of order) that passes the test. - -If order within the original array is important then look at detectSeries. - -__Arguments__ - -* arr - An array to iterate over. -* iterator(item, callback) - A truth test to apply to each item in the array. - The iterator is passed a callback(truthValue) which must be called with a - boolean argument once it has completed. -* callback(result) - A callback which is called as soon as any iterator returns - true, or after all the iterator functions have finished. Result will be - the first item in the array that passes the truth test (iterator) or the - value undefined if none passed. - -__Example__ - -```js -async.detect(['file1','file2','file3'], path.exists, function(result){ - // result now equals the first file in the list that exists -}); -``` - ---------------------------------------- - - -### detectSeries(arr, iterator, callback) - -The same as detect, only the iterator is applied to each item in the array -in series. This means the result is always the first in the original array (in -terms of array order) that passes the truth test. - - ---------------------------------------- - - -### sortBy(arr, iterator, callback) - -Sorts a list by the results of running each value through an async iterator. - -__Arguments__ - -* arr - An array to iterate over. -* iterator(item, callback) - A function to apply to each item in the array. - The iterator is passed a callback(err, sortValue) which must be called once it - has completed with an error (which can be null) and a value to use as the sort - criteria. -* callback(err, results) - A callback which is called after all the iterator - functions have finished, or an error has occurred. Results is the items from - the original array sorted by the values returned by the iterator calls. - -__Example__ - -```js -async.sortBy(['file1','file2','file3'], function(file, callback){ - fs.stat(file, function(err, stats){ - callback(err, stats.mtime); - }); -}, function(err, results){ - // results is now the original array of files sorted by - // modified date -}); -``` - ---------------------------------------- - - -### some(arr, iterator, callback) - -__Alias:__ any - -Returns true if at least one element in the array satisfies an async test. -_The callback for each iterator call only accepts a single argument of true or -false, it does not accept an error argument first!_ This is in-line with the -way node libraries work with truth tests like path.exists. Once any iterator -call returns true, the main callback is immediately called. - -__Arguments__ - -* arr - An array to iterate over. -* iterator(item, callback) - A truth test to apply to each item in the array. - The iterator is passed a callback(truthValue) which must be called with a - boolean argument once it has completed. -* callback(result) - A callback which is called as soon as any iterator returns - true, or after all the iterator functions have finished. Result will be - either true or false depending on the values of the async tests. - -__Example__ - -```js -async.some(['file1','file2','file3'], path.exists, function(result){ - // if result is true then at least one of the files exists -}); -``` - ---------------------------------------- - - -### every(arr, iterator, callback) - -__Alias:__ all - -Returns true if every element in the array satisfies an async test. -_The callback for each iterator call only accepts a single argument of true or -false, it does not accept an error argument first!_ This is in-line with the -way node libraries work with truth tests like path.exists. - -__Arguments__ - -* arr - An array to iterate over. -* iterator(item, callback) - A truth test to apply to each item in the array. - The iterator is passed a callback(truthValue) which must be called with a - boolean argument once it has completed. -* callback(result) - A callback which is called after all the iterator - functions have finished. Result will be either true or false depending on - the values of the async tests. - -__Example__ - -```js -async.every(['file1','file2','file3'], path.exists, function(result){ - // if result is true then every file exists -}); -``` - ---------------------------------------- - - -### concat(arr, iterator, callback) - -Applies an iterator to each item in a list, concatenating the results. Returns the -concatenated list. The iterators are called in parallel, and the results are -concatenated as they return. There is no guarantee that the results array will -be returned in the original order of the arguments passed to the iterator function. - -__Arguments__ - -* arr - An array to iterate over -* iterator(item, callback) - A function to apply to each item in the array. - The iterator is passed a callback(err, results) which must be called once it - has completed with an error (which can be null) and an array of results. -* callback(err, results) - A callback which is called after all the iterator - functions have finished, or an error has occurred. Results is an array containing - the concatenated results of the iterator function. - -__Example__ - -```js -async.concat(['dir1','dir2','dir3'], fs.readdir, function(err, files){ - // files is now a list of filenames that exist in the 3 directories -}); -``` - ---------------------------------------- - - -### concatSeries(arr, iterator, callback) - -Same as async.concat, but executes in series instead of parallel. - - -## Control Flow - - -### series(tasks, [callback]) - -Run an array of functions in series, each one running once the previous -function has completed. If any functions in the series pass an error to its -callback, no more functions are run and the callback for the series is -immediately called with the value of the error. Once the tasks have completed, -the results are passed to the final callback as an array. - -It is also possible to use an object instead of an array. Each property will be -run as a function and the results will be passed to the final callback as an object -instead of an array. This can be a more readable way of handling results from -async.series. - - -__Arguments__ - -* tasks - An array or object containing functions to run, each function is passed - a callback(err, result) it must call on completion with an error (which can - be null) and an optional result value. -* callback(err, results) - An optional callback to run once all the functions - have completed. This function gets a results array (or object) containing all - the result arguments passed to the task callbacks. - -__Example__ - -```js -async.series([ - function(callback){ - // do some stuff ... - callback(null, 'one'); - }, - function(callback){ - // do some more stuff ... - callback(null, 'two'); - } -], -// optional callback -function(err, results){ - // results is now equal to ['one', 'two'] -}); - - -// an example using an object instead of an array -async.series({ - one: function(callback){ - setTimeout(function(){ - callback(null, 1); - }, 200); - }, - two: function(callback){ - setTimeout(function(){ - callback(null, 2); - }, 100); - } -}, -function(err, results) { - // results is now equal to: {one: 1, two: 2} -}); -``` - ---------------------------------------- - - -### parallel(tasks, [callback]) - -Run an array of functions in parallel, without waiting until the previous -function has completed. If any of the functions pass an error to its -callback, the main callback is immediately called with the value of the error. -Once the tasks have completed, the results are passed to the final callback as an -array. - -It is also possible to use an object instead of an array. Each property will be -run as a function and the results will be passed to the final callback as an object -instead of an array. This can be a more readable way of handling results from -async.parallel. - - -__Arguments__ - -* tasks - An array or object containing functions to run, each function is passed - a callback(err, result) it must call on completion with an error (which can - be null) and an optional result value. -* callback(err, results) - An optional callback to run once all the functions - have completed. This function gets a results array (or object) containing all - the result arguments passed to the task callbacks. - -__Example__ - -```js -async.parallel([ - function(callback){ - setTimeout(function(){ - callback(null, 'one'); - }, 200); - }, - function(callback){ - setTimeout(function(){ - callback(null, 'two'); - }, 100); - } -], -// optional callback -function(err, results){ - // the results array will equal ['one','two'] even though - // the second function had a shorter timeout. -}); - - -// an example using an object instead of an array -async.parallel({ - one: function(callback){ - setTimeout(function(){ - callback(null, 1); - }, 200); - }, - two: function(callback){ - setTimeout(function(){ - callback(null, 2); - }, 100); - } -}, -function(err, results) { - // results is now equals to: {one: 1, two: 2} -}); -``` - ---------------------------------------- - - -### parallelLimit(tasks, limit, [callback]) - -The same as parallel only the tasks are executed in parallel with a maximum of "limit" -tasks executing at any time. - -Note that the tasks are not executed in batches, so there is no guarantee that -the first "limit" tasks will complete before any others are started. - -__Arguments__ - -* tasks - An array or object containing functions to run, each function is passed - a callback(err, result) it must call on completion with an error (which can - be null) and an optional result value. -* limit - The maximum number of tasks to run at any time. -* callback(err, results) - An optional callback to run once all the functions - have completed. This function gets a results array (or object) containing all - the result arguments passed to the task callbacks. - ---------------------------------------- - - -### whilst(test, fn, callback) - -Repeatedly call fn, while test returns true. Calls the callback when stopped, -or an error occurs. - -__Arguments__ - -* test() - synchronous truth test to perform before each execution of fn. -* fn(callback) - A function to call each time the test passes. The function is - passed a callback(err) which must be called once it has completed with an - optional error argument. -* callback(err) - A callback which is called after the test fails and repeated - execution of fn has stopped. - -__Example__ - -```js -var count = 0; - -async.whilst( - function () { return count < 5; }, - function (callback) { - count++; - setTimeout(callback, 1000); - }, - function (err) { - // 5 seconds have passed - } -); -``` - ---------------------------------------- - - -### doWhilst(fn, test, callback) - -The post check version of whilst. To reflect the difference in the order of operations `test` and `fn` arguments are switched. `doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript. - ---------------------------------------- - - -### until(test, fn, callback) - -Repeatedly call fn, until test returns true. Calls the callback when stopped, -or an error occurs. - -The inverse of async.whilst. - ---------------------------------------- - - -### doUntil(fn, test, callback) - -Like doWhilst except the test is inverted. Note the argument ordering differs from `until`. - - ---------------------------------------- - - -### waterfall(tasks, [callback]) - -Runs an array of functions in series, each passing their results to the next in -the array. However, if any of the functions pass an error to the callback, the -next function is not executed and the main callback is immediately called with -the error. - -__Arguments__ - -* tasks - An array of functions to run, each function is passed a - callback(err, result1, result2, ...) it must call on completion. The first - argument is an error (which can be null) and any further arguments will be - passed as arguments in order to the next task. -* callback(err, [results]) - An optional callback to run once all the functions - have completed. This will be passed the results of the last task's callback. - - - -__Example__ - -```js -async.waterfall([ - function(callback){ - callback(null, 'one', 'two'); - }, - function(arg1, arg2, callback){ - callback(null, 'three'); - }, - function(arg1, callback){ - // arg1 now equals 'three' - callback(null, 'done'); - } -], function (err, result) { - // result now equals 'done' -}); -``` - ---------------------------------------- - -### compose(fn1, fn2...) - -Creates a function which is a composition of the passed asynchronous -functions. Each function consumes the return value of the function that -follows. Composing functions f(), g() and h() would produce the result of -f(g(h())), only this version uses callbacks to obtain the return values. - -Each function is executed with the `this` binding of the composed function. - -__Arguments__ - -* functions... - the asynchronous functions to compose - - -__Example__ - -```js -function add1(n, callback) { - setTimeout(function () { - callback(null, n + 1); - }, 10); -} - -function mul3(n, callback) { - setTimeout(function () { - callback(null, n * 3); - }, 10); -} - -var add1mul3 = async.compose(mul3, add1); - -add1mul3(4, function (err, result) { - // result now equals 15 -}); -``` - ---------------------------------------- - -### applyEach(fns, args..., callback) - -Applies the provided arguments to each function in the array, calling the -callback after all functions have completed. If you only provide the first -argument then it will return a function which lets you pass in the -arguments as if it were a single function call. - -__Arguments__ - -* fns - the asynchronous functions to all call with the same arguments -* args... - any number of separate arguments to pass to the function -* callback - the final argument should be the callback, called when all - functions have completed processing - - -__Example__ - -```js -async.applyEach([enableSearch, updateSchema], 'bucket', callback); - -// partial application example: -async.each( - buckets, - async.applyEach([enableSearch, updateSchema]), - callback -); -``` - ---------------------------------------- - - -### queue(worker, concurrency) - -Creates a queue object with the specified concurrency. Tasks added to the -queue will be processed in parallel (up to the concurrency limit). If all -workers are in progress, the task is queued until one is available. Once -a worker has completed a task, the task's callback is called. - -__Arguments__ - -* worker(task, callback) - An asynchronous function for processing a queued - task, which must call its callback(err) argument when finished, with an - optional error as an argument. -* concurrency - An integer for determining how many worker functions should be - run in parallel. - -__Queue objects__ - -The queue object returned by this function has the following properties and -methods: - -* length() - a function returning the number of items waiting to be processed. -* concurrency - an integer for determining how many worker functions should be - run in parallel. This property can be changed after a queue is created to - alter the concurrency on-the-fly. -* push(task, [callback]) - add a new task to the queue, the callback is called - once the worker has finished processing the task. - instead of a single task, an array of tasks can be submitted. the respective callback is used for every task in the list. -* unshift(task, [callback]) - add a new task to the front of the queue. -* saturated - a callback that is called when the queue length hits the concurrency and further tasks will be queued -* empty - a callback that is called when the last item from the queue is given to a worker -* drain - a callback that is called when the last item from the queue has returned from the worker - -__Example__ - -```js -// create a queue object with concurrency 2 - -var q = async.queue(function (task, callback) { - console.log('hello ' + task.name); - callback(); -}, 2); - - -// assign a callback -q.drain = function() { - console.log('all items have been processed'); -} - -// add some items to the queue - -q.push({name: 'foo'}, function (err) { - console.log('finished processing foo'); -}); -q.push({name: 'bar'}, function (err) { - console.log('finished processing bar'); -}); - -// add some items to the queue (batch-wise) - -q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function (err) { - console.log('finished processing bar'); -}); - -// add some items to the front of the queue - -q.unshift({name: 'bar'}, function (err) { - console.log('finished processing bar'); -}); -``` - ---------------------------------------- - - -### cargo(worker, [payload]) - -Creates a cargo object with the specified payload. Tasks added to the -cargo will be processed altogether (up to the payload limit). If the -worker is in progress, the task is queued until it is available. Once -the worker has completed some tasks, each callback of those tasks is called. - -__Arguments__ - -* worker(tasks, callback) - An asynchronous function for processing queued - tasks, which must call its callback(err) argument when finished, with an - optional error as an argument. -* payload - An optional integer for determining how many tasks should be - process per round, default is unlimited. - -__Cargo objects__ - -The cargo object returned by this function has the following properties and -methods: - -* length() - a function returning the number of items waiting to be processed. -* payload - an integer for determining how many tasks should be - process per round. This property can be changed after a cargo is created to - alter the payload on-the-fly. -* push(task, [callback]) - add a new task to the queue, the callback is called - once the worker has finished processing the task. - instead of a single task, an array of tasks can be submitted. the respective callback is used for every task in the list. -* saturated - a callback that is called when the queue length hits the concurrency and further tasks will be queued -* empty - a callback that is called when the last item from the queue is given to a worker -* drain - a callback that is called when the last item from the queue has returned from the worker - -__Example__ - -```js -// create a cargo object with payload 2 - -var cargo = async.cargo(function (task, callback) { - console.log('hello ' + task.name); - callback(); -}, 2); - - -// add some items - -cargo.push({name: 'foo'}, function (err) { - console.log('finished processing foo'); -}); -cargo.push({name: 'bar'}, function (err) { - console.log('finished processing bar'); -}); -cargo.push({name: 'baz'}, function (err) { - console.log('finished processing baz'); -}); -``` - ---------------------------------------- - - -### auto(tasks, [callback]) - -Determines the best order for running functions based on their requirements. -Each function can optionally depend on other functions being completed first, -and each function is run as soon as its requirements are satisfied. If any of -the functions pass an error to their callback, that function will not complete -(so any other functions depending on it will not run) and the main callback -will be called immediately with the error. Functions also receive an object -containing the results of functions which have completed so far. - -Note, all functions are called with a results object as a second argument, -so it is unsafe to pass functions in the tasks object which cannot handle the -extra argument. For example, this snippet of code: - -```js -async.auto({ - readData: async.apply(fs.readFile, 'data.txt', 'utf-8'); -}, callback); -``` - -will have the effect of calling readFile with the results object as the last -argument, which will fail: - -```js -fs.readFile('data.txt', 'utf-8', cb, {}); -``` - -Instead, wrap the call to readFile in a function which does not forward the -results object: - -```js -async.auto({ - readData: function(cb, results){ - fs.readFile('data.txt', 'utf-8', cb); - } -}, callback); -``` - -__Arguments__ - -* tasks - An object literal containing named functions or an array of - requirements, with the function itself the last item in the array. The key - used for each function or array is used when specifying requirements. The - function receives two arguments: (1) a callback(err, result) which must be - called when finished, passing an error (which can be null) and the result of - the function's execution, and (2) a results object, containing the results of - the previously executed functions. -* callback(err, results) - An optional callback which is called when all the - tasks have been completed. The callback will receive an error as an argument - if any tasks pass an error to their callback. Results will always be passed - but if an error occurred, no other tasks will be performed, and the results - object will only contain partial results. - - -__Example__ - -```js -async.auto({ - get_data: function(callback){ - // async code to get some data - }, - make_folder: function(callback){ - // async code to create a directory to store a file in - // this is run at the same time as getting the data - }, - write_file: ['get_data', 'make_folder', function(callback){ - // once there is some data and the directory exists, - // write the data to a file in the directory - callback(null, filename); - }], - email_link: ['write_file', function(callback, results){ - // once the file is written let's email a link to it... - // results.write_file contains the filename returned by write_file. - }] -}); -``` - -This is a fairly trivial example, but to do this using the basic parallel and -series functions would look like this: - -```js -async.parallel([ - function(callback){ - // async code to get some data - }, - function(callback){ - // async code to create a directory to store a file in - // this is run at the same time as getting the data - } -], -function(err, results){ - async.series([ - function(callback){ - // once there is some data and the directory exists, - // write the data to a file in the directory - }, - function(callback){ - // once the file is written let's email a link to it... - } - ]); -}); -``` - -For a complicated series of async tasks using the auto function makes adding -new tasks much easier and makes the code more readable. - - ---------------------------------------- - - -### iterator(tasks) - -Creates an iterator function which calls the next function in the array, -returning a continuation to call the next one after that. Its also possible to -'peek' the next iterator by doing iterator.next(). - -This function is used internally by the async module but can be useful when -you want to manually control the flow of functions in series. - -__Arguments__ - -* tasks - An array of functions to run. - -__Example__ - -```js -var iterator = async.iterator([ - function(){ sys.p('one'); }, - function(){ sys.p('two'); }, - function(){ sys.p('three'); } -]); - -node> var iterator2 = iterator(); -'one' -node> var iterator3 = iterator2(); -'two' -node> iterator3(); -'three' -node> var nextfn = iterator2.next(); -node> nextfn(); -'three' -``` - ---------------------------------------- - - -### apply(function, arguments..) - -Creates a continuation function with some arguments already applied, a useful -shorthand when combined with other control flow functions. Any arguments -passed to the returned function are added to the arguments originally passed -to apply. - -__Arguments__ - -* function - The function you want to eventually apply all arguments to. -* arguments... - Any number of arguments to automatically apply when the - continuation is called. - -__Example__ - -```js -// using apply - -async.parallel([ - async.apply(fs.writeFile, 'testfile1', 'test1'), - async.apply(fs.writeFile, 'testfile2', 'test2'), -]); - - -// the same process without using apply - -async.parallel([ - function(callback){ - fs.writeFile('testfile1', 'test1', callback); - }, - function(callback){ - fs.writeFile('testfile2', 'test2', callback); - } -]); -``` - -It's possible to pass any number of additional arguments when calling the -continuation: - -```js -node> var fn = async.apply(sys.puts, 'one'); -node> fn('two', 'three'); -one -two -three -``` - ---------------------------------------- - - -### nextTick(callback) - -Calls the callback on a later loop around the event loop. In node.js this just -calls process.nextTick, in the browser it falls back to setImmediate(callback) -if available, otherwise setTimeout(callback, 0), which means other higher priority -events may precede the execution of the callback. - -This is used internally for browser-compatibility purposes. - -__Arguments__ - -* callback - The function to call on a later loop around the event loop. - -__Example__ - -```js -var call_order = []; -async.nextTick(function(){ - call_order.push('two'); - // call_order now equals ['one','two'] -}); -call_order.push('one') -``` - - -### times(n, callback) - -Calls the callback n times and accumulates results in the same manner -you would use with async.map. - -__Arguments__ - -* n - The number of times to run the function. -* callback - The function to call n times. - -__Example__ - -```js -// Pretend this is some complicated async factory -var createUser = function(id, callback) { - callback(null, { - id: 'user' + id - }) -} -// generate 5 users -async.times(5, function(n, next){ - createUser(n, function(err, user) { - next(err, user) - }) -}, function(err, users) { - // we should now have 5 users -}); -``` - - -### timesSeries(n, callback) - -The same as times only the iterator is applied to each item in the array in -series. The next iterator is only called once the current one has completed -processing. The results array will be in the same order as the original. - - -## Utils - - -### memoize(fn, [hasher]) - -Caches the results of an async function. When creating a hash to store function -results against, the callback is omitted from the hash and an optional hash -function can be used. - -The cache of results is exposed as the `memo` property of the function returned -by `memoize`. - -__Arguments__ - -* fn - the function you to proxy and cache results from. -* hasher - an optional function for generating a custom hash for storing - results, it has all the arguments applied to it apart from the callback, and - must be synchronous. - -__Example__ - -```js -var slow_fn = function (name, callback) { - // do something - callback(null, result); -}; -var fn = async.memoize(slow_fn); - -// fn can now be used as if it were slow_fn -fn('some name', function () { - // callback -}); -``` - - -### unmemoize(fn) - -Undoes a memoized function, reverting it to the original, unmemoized -form. Comes handy in tests. - -__Arguments__ - -* fn - the memoized function - - -### log(function, arguments) - -Logs the result of an async function to the console. Only works in node.js or -in browsers that support console.log and console.error (such as FF and Chrome). -If multiple arguments are returned from the async function, console.log is -called on each argument in order. - -__Arguments__ - -* function - The function you want to eventually apply all arguments to. -* arguments... - Any number of arguments to apply to the function. - -__Example__ - -```js -var hello = function(name, callback){ - setTimeout(function(){ - callback(null, 'hello ' + name); - }, 1000); -}; -``` -```js -node> async.log(hello, 'world'); -'hello world' -``` - ---------------------------------------- - - -### dir(function, arguments) - -Logs the result of an async function to the console using console.dir to -display the properties of the resulting object. Only works in node.js or -in browsers that support console.dir and console.error (such as FF and Chrome). -If multiple arguments are returned from the async function, console.dir is -called on each argument in order. - -__Arguments__ - -* function - The function you want to eventually apply all arguments to. -* arguments... - Any number of arguments to apply to the function. - -__Example__ - -```js -var hello = function(name, callback){ - setTimeout(function(){ - callback(null, {hello: name}); - }, 1000); -}; -``` -```js -node> async.dir(hello, 'world'); -{hello: 'world'} -``` - ---------------------------------------- - - -### noConflict() - -Changes the value of async back to its original value, returning a reference to the -async object. diff --git a/src/extensibility/node/node_modules/async/lib/async.js b/src/extensibility/node/node_modules/async/lib/async.js deleted file mode 100755 index ad3982a56db..00000000000 --- a/src/extensibility/node/node_modules/async/lib/async.js +++ /dev/null @@ -1,982 +0,0 @@ -/*global setImmediate: false, setTimeout: false, console: false */ -(function () { - - var async = {}; - - // global on the server, window in the browser - var root, previous_async; - - root = this; - if (root != null) { - previous_async = root.async; - } - - async.noConflict = function () { - root.async = previous_async; - return async; - }; - - function only_once(fn) { - var called = false; - return function() { - if (called) throw new Error("Callback was already called."); - called = true; - fn.apply(root, arguments); - } - } - - //// cross-browser compatiblity functions //// - - var _each = function (arr, iterator) { - if (arr.forEach) { - return arr.forEach(iterator); - } - for (var i = 0; i < arr.length; i += 1) { - iterator(arr[i], i, arr); - } - }; - - var _map = function (arr, iterator) { - if (arr.map) { - return arr.map(iterator); - } - var results = []; - _each(arr, function (x, i, a) { - results.push(iterator(x, i, a)); - }); - return results; - }; - - var _reduce = function (arr, iterator, memo) { - if (arr.reduce) { - return arr.reduce(iterator, memo); - } - _each(arr, function (x, i, a) { - memo = iterator(memo, x, i, a); - }); - return memo; - }; - - var _keys = function (obj) { - if (Object.keys) { - return Object.keys(obj); - } - var keys = []; - for (var k in obj) { - if (obj.hasOwnProperty(k)) { - keys.push(k); - } - } - return keys; - }; - - //// exported async module functions //// - - //// nextTick implementation with browser-compatible fallback //// - if (typeof process === 'undefined' || !(process.nextTick)) { - if (typeof setImmediate === 'function') { - async.nextTick = function (fn) { - setImmediate(fn); - }; - } - else { - async.nextTick = function (fn) { - setTimeout(fn, 0); - }; - } - } - else { - async.nextTick = process.nextTick; - } - - async.each = function (arr, iterator, callback) { - callback = callback || function () {}; - if (!arr.length) { - return callback(); - } - var completed = 0; - _each(arr, function (x) { - iterator(x, only_once(function (err) { - if (err) { - callback(err); - callback = function () {}; - } - else { - completed += 1; - if (completed >= arr.length) { - callback(null); - } - } - })); - }); - }; - async.forEach = async.each; - - async.eachSeries = function (arr, iterator, callback) { - callback = callback || function () {}; - if (!arr.length) { - return callback(); - } - var completed = 0; - var iterate = function () { - var sync = true; - iterator(arr[completed], function (err) { - if (err) { - callback(err); - callback = function () {}; - } - else { - completed += 1; - if (completed >= arr.length) { - callback(null); - } - else { - if (sync) { - async.nextTick(iterate); - } - else { - iterate(); - } - } - } - }); - sync = false; - }; - iterate(); - }; - async.forEachSeries = async.eachSeries; - - async.eachLimit = function (arr, limit, iterator, callback) { - var fn = _eachLimit(limit); - fn.apply(null, [arr, iterator, callback]); - }; - async.forEachLimit = async.eachLimit; - - var _eachLimit = function (limit) { - - return function (arr, iterator, callback) { - callback = callback || function () {}; - if (!arr.length || limit <= 0) { - return callback(); - } - var completed = 0; - var started = 0; - var running = 0; - - (function replenish () { - if (completed >= arr.length) { - return callback(); - } - - while (running < limit && started < arr.length) { - started += 1; - running += 1; - iterator(arr[started - 1], function (err) { - if (err) { - callback(err); - callback = function () {}; - } - else { - completed += 1; - running -= 1; - if (completed >= arr.length) { - callback(); - } - else { - replenish(); - } - } - }); - } - })(); - }; - }; - - - var doParallel = function (fn) { - return function () { - var args = Array.prototype.slice.call(arguments); - return fn.apply(null, [async.each].concat(args)); - }; - }; - var doParallelLimit = function(limit, fn) { - return function () { - var args = Array.prototype.slice.call(arguments); - return fn.apply(null, [_eachLimit(limit)].concat(args)); - }; - }; - var doSeries = function (fn) { - return function () { - var args = Array.prototype.slice.call(arguments); - return fn.apply(null, [async.eachSeries].concat(args)); - }; - }; - - - var _asyncMap = function (eachfn, arr, iterator, callback) { - var results = []; - arr = _map(arr, function (x, i) { - return {index: i, value: x}; - }); - eachfn(arr, function (x, callback) { - iterator(x.value, function (err, v) { - results[x.index] = v; - callback(err); - }); - }, function (err) { - callback(err, results); - }); - }; - async.map = doParallel(_asyncMap); - async.mapSeries = doSeries(_asyncMap); - async.mapLimit = function (arr, limit, iterator, callback) { - return _mapLimit(limit)(arr, iterator, callback); - }; - - var _mapLimit = function(limit) { - return doParallelLimit(limit, _asyncMap); - }; - - // reduce only has a series version, as doing reduce in parallel won't - // work in many situations. - async.reduce = function (arr, memo, iterator, callback) { - async.eachSeries(arr, function (x, callback) { - iterator(memo, x, function (err, v) { - memo = v; - callback(err); - }); - }, function (err) { - callback(err, memo); - }); - }; - // inject alias - async.inject = async.reduce; - // foldl alias - async.foldl = async.reduce; - - async.reduceRight = function (arr, memo, iterator, callback) { - var reversed = _map(arr, function (x) { - return x; - }).reverse(); - async.reduce(reversed, memo, iterator, callback); - }; - // foldr alias - async.foldr = async.reduceRight; - - var _filter = function (eachfn, arr, iterator, callback) { - var results = []; - arr = _map(arr, function (x, i) { - return {index: i, value: x}; - }); - eachfn(arr, function (x, callback) { - iterator(x.value, function (v) { - if (v) { - results.push(x); - } - callback(); - }); - }, function (err) { - callback(_map(results.sort(function (a, b) { - return a.index - b.index; - }), function (x) { - return x.value; - })); - }); - }; - async.filter = doParallel(_filter); - async.filterSeries = doSeries(_filter); - // select alias - async.select = async.filter; - async.selectSeries = async.filterSeries; - - var _reject = function (eachfn, arr, iterator, callback) { - var results = []; - arr = _map(arr, function (x, i) { - return {index: i, value: x}; - }); - eachfn(arr, function (x, callback) { - iterator(x.value, function (v) { - if (!v) { - results.push(x); - } - callback(); - }); - }, function (err) { - callback(_map(results.sort(function (a, b) { - return a.index - b.index; - }), function (x) { - return x.value; - })); - }); - }; - async.reject = doParallel(_reject); - async.rejectSeries = doSeries(_reject); - - var _detect = function (eachfn, arr, iterator, main_callback) { - eachfn(arr, function (x, callback) { - iterator(x, function (result) { - if (result) { - main_callback(x); - main_callback = function () {}; - } - else { - callback(); - } - }); - }, function (err) { - main_callback(); - }); - }; - async.detect = doParallel(_detect); - async.detectSeries = doSeries(_detect); - - async.some = function (arr, iterator, main_callback) { - async.each(arr, function (x, callback) { - iterator(x, function (v) { - if (v) { - main_callback(true); - main_callback = function () {}; - } - callback(); - }); - }, function (err) { - main_callback(false); - }); - }; - // any alias - async.any = async.some; - - async.every = function (arr, iterator, main_callback) { - async.each(arr, function (x, callback) { - iterator(x, function (v) { - if (!v) { - main_callback(false); - main_callback = function () {}; - } - callback(); - }); - }, function (err) { - main_callback(true); - }); - }; - // all alias - async.all = async.every; - - async.sortBy = function (arr, iterator, callback) { - async.map(arr, function (x, callback) { - iterator(x, function (err, criteria) { - if (err) { - callback(err); - } - else { - callback(null, {value: x, criteria: criteria}); - } - }); - }, function (err, results) { - if (err) { - return callback(err); - } - else { - var fn = function (left, right) { - var a = left.criteria, b = right.criteria; - return a < b ? -1 : a > b ? 1 : 0; - }; - callback(null, _map(results.sort(fn), function (x) { - return x.value; - })); - } - }); - }; - - async.auto = function (tasks, callback) { - callback = callback || function () {}; - var keys = _keys(tasks); - if (!keys.length) { - return callback(null); - } - - var results = {}; - - var listeners = []; - var addListener = function (fn) { - listeners.unshift(fn); - }; - var removeListener = function (fn) { - for (var i = 0; i < listeners.length; i += 1) { - if (listeners[i] === fn) { - listeners.splice(i, 1); - return; - } - } - }; - var taskComplete = function () { - _each(listeners.slice(0), function (fn) { - fn(); - }); - }; - - addListener(function () { - if (_keys(results).length === keys.length) { - callback(null, results); - callback = function () {}; - } - }); - - _each(keys, function (k) { - var task = (tasks[k] instanceof Function) ? [tasks[k]]: tasks[k]; - var taskCallback = function (err) { - var args = Array.prototype.slice.call(arguments, 1); - if (args.length <= 1) { - args = args[0]; - } - if (err) { - var safeResults = {}; - _each(_keys(results), function(rkey) { - safeResults[rkey] = results[rkey]; - }); - safeResults[k] = args; - callback(err, safeResults); - // stop subsequent errors hitting callback multiple times - callback = function () {}; - } - else { - results[k] = args; - async.nextTick(taskComplete); - } - }; - var requires = task.slice(0, Math.abs(task.length - 1)) || []; - var ready = function () { - return _reduce(requires, function (a, x) { - return (a && results.hasOwnProperty(x)); - }, true) && !results.hasOwnProperty(k); - }; - if (ready()) { - task[task.length - 1](taskCallback, results); - } - else { - var listener = function () { - if (ready()) { - removeListener(listener); - task[task.length - 1](taskCallback, results); - } - }; - addListener(listener); - } - }); - }; - - async.waterfall = function (tasks, callback) { - callback = callback || function () {}; - if (!tasks.length) { - return callback(); - } - var wrapIterator = function (iterator) { - return function (err) { - if (err) { - callback.apply(null, arguments); - callback = function () {}; - } - else { - var args = Array.prototype.slice.call(arguments, 1); - var next = iterator.next(); - if (next) { - args.push(wrapIterator(next)); - } - else { - args.push(callback); - } - async.nextTick(function () { - iterator.apply(null, args); - }); - } - }; - }; - wrapIterator(async.iterator(tasks))(); - }; - - var _parallel = function(eachfn, tasks, callback) { - callback = callback || function () {}; - if (tasks.constructor === Array) { - eachfn.map(tasks, function (fn, callback) { - if (fn) { - fn(function (err) { - var args = Array.prototype.slice.call(arguments, 1); - if (args.length <= 1) { - args = args[0]; - } - callback.call(null, err, args); - }); - } - }, callback); - } - else { - var results = {}; - eachfn.each(_keys(tasks), function (k, callback) { - tasks[k](function (err) { - var args = Array.prototype.slice.call(arguments, 1); - if (args.length <= 1) { - args = args[0]; - } - results[k] = args; - callback(err); - }); - }, function (err) { - callback(err, results); - }); - } - }; - - async.parallel = function (tasks, callback) { - _parallel({ map: async.map, each: async.each }, tasks, callback); - }; - - async.parallelLimit = function(tasks, limit, callback) { - _parallel({ map: _mapLimit(limit), each: _eachLimit(limit) }, tasks, callback); - }; - - async.series = function (tasks, callback) { - callback = callback || function () {}; - if (tasks.constructor === Array) { - async.mapSeries(tasks, function (fn, callback) { - if (fn) { - fn(function (err) { - var args = Array.prototype.slice.call(arguments, 1); - if (args.length <= 1) { - args = args[0]; - } - callback.call(null, err, args); - }); - } - }, callback); - } - else { - var results = {}; - async.eachSeries(_keys(tasks), function (k, callback) { - tasks[k](function (err) { - var args = Array.prototype.slice.call(arguments, 1); - if (args.length <= 1) { - args = args[0]; - } - results[k] = args; - callback(err); - }); - }, function (err) { - callback(err, results); - }); - } - }; - - async.iterator = function (tasks) { - var makeCallback = function (index) { - var fn = function () { - if (tasks.length) { - tasks[index].apply(null, arguments); - } - return fn.next(); - }; - fn.next = function () { - return (index < tasks.length - 1) ? makeCallback(index + 1): null; - }; - return fn; - }; - return makeCallback(0); - }; - - async.apply = function (fn) { - var args = Array.prototype.slice.call(arguments, 1); - return function () { - return fn.apply( - null, args.concat(Array.prototype.slice.call(arguments)) - ); - }; - }; - - var _concat = function (eachfn, arr, fn, callback) { - var r = []; - eachfn(arr, function (x, cb) { - fn(x, function (err, y) { - r = r.concat(y || []); - cb(err); - }); - }, function (err) { - callback(err, r); - }); - }; - async.concat = doParallel(_concat); - async.concatSeries = doSeries(_concat); - - async.whilst = function (test, iterator, callback) { - if (test()) { - var sync = true; - iterator(function (err) { - if (err) { - return callback(err); - } - if (sync) { - async.nextTick(function () { - async.whilst(test, iterator, callback); - }); - } - else { - async.whilst(test, iterator, callback); - } - }); - sync = false; - } - else { - callback(); - } - }; - - async.doWhilst = function (iterator, test, callback) { - var sync = true; - iterator(function (err) { - if (err) { - return callback(err); - } - if (test()) { - if (sync) { - async.nextTick(function () { - async.doWhilst(iterator, test, callback); - }); - } - else { - async.doWhilst(iterator, test, callback); - } - } - else { - callback(); - } - }); - sync = false; - }; - - async.until = function (test, iterator, callback) { - if (!test()) { - var sync = true; - iterator(function (err) { - if (err) { - return callback(err); - } - if (sync) { - async.nextTick(function () { - async.until(test, iterator, callback); - }); - } - else { - async.until(test, iterator, callback); - } - }); - sync = false; - } - else { - callback(); - } - }; - - async.doUntil = function (iterator, test, callback) { - var sync = true; - iterator(function (err) { - if (err) { - return callback(err); - } - if (!test()) { - if (sync) { - async.nextTick(function () { - async.doUntil(iterator, test, callback); - }); - } - else { - async.doUntil(iterator, test, callback); - } - } - else { - callback(); - } - }); - sync = false; - }; - - async.queue = function (worker, concurrency) { - if (concurrency === undefined) { - concurrency = 1; - } - function _insert(q, data, pos, callback) { - if(data.constructor !== Array) { - data = [data]; - } - _each(data, function(task) { - var item = { - data: task, - callback: typeof callback === 'function' ? callback : null - }; - - if (pos) { - q.tasks.unshift(item); - } else { - q.tasks.push(item); - } - - if (q.saturated && q.tasks.length === concurrency) { - q.saturated(); - } - async.nextTick(q.process); - }); - } - - var workers = 0; - var q = { - tasks: [], - concurrency: concurrency, - saturated: null, - empty: null, - drain: null, - push: function (data, callback) { - _insert(q, data, false, callback); - }, - unshift: function (data, callback) { - _insert(q, data, true, callback); - }, - process: function () { - if (workers < q.concurrency && q.tasks.length) { - var task = q.tasks.shift(); - if (q.empty && q.tasks.length === 0) { - q.empty(); - } - workers += 1; - var sync = true; - var next = function () { - workers -= 1; - if (task.callback) { - task.callback.apply(task, arguments); - } - if (q.drain && q.tasks.length + workers === 0) { - q.drain(); - } - q.process(); - }; - var cb = only_once(function () { - var cbArgs = arguments; - - if (sync) { - async.nextTick(function () { - next.apply(null, cbArgs); - }); - } else { - next.apply(null, arguments); - } - }); - worker(task.data, cb); - sync = false; - } - }, - length: function () { - return q.tasks.length; - }, - running: function () { - return workers; - } - }; - return q; - }; - - async.cargo = function (worker, payload) { - var working = false, - tasks = []; - - var cargo = { - tasks: tasks, - payload: payload, - saturated: null, - empty: null, - drain: null, - push: function (data, callback) { - if(data.constructor !== Array) { - data = [data]; - } - _each(data, function(task) { - tasks.push({ - data: task, - callback: typeof callback === 'function' ? callback : null - }); - if (cargo.saturated && tasks.length === payload) { - cargo.saturated(); - } - }); - async.nextTick(cargo.process); - }, - process: function process() { - if (working) return; - if (tasks.length === 0) { - if(cargo.drain) cargo.drain(); - return; - } - - var ts = typeof payload === 'number' - ? tasks.splice(0, payload) - : tasks.splice(0); - - var ds = _map(ts, function (task) { - return task.data; - }); - - if(cargo.empty) cargo.empty(); - working = true; - worker(ds, function () { - working = false; - - var args = arguments; - _each(ts, function (data) { - if (data.callback) { - data.callback.apply(null, args); - } - }); - - process(); - }); - }, - length: function () { - return tasks.length; - }, - running: function () { - return working; - } - }; - return cargo; - }; - - var _console_fn = function (name) { - return function (fn) { - var args = Array.prototype.slice.call(arguments, 1); - fn.apply(null, args.concat([function (err) { - var args = Array.prototype.slice.call(arguments, 1); - if (typeof console !== 'undefined') { - if (err) { - if (console.error) { - console.error(err); - } - } - else if (console[name]) { - _each(args, function (x) { - console[name](x); - }); - } - } - }])); - }; - }; - async.log = _console_fn('log'); - async.dir = _console_fn('dir'); - /*async.info = _console_fn('info'); - async.warn = _console_fn('warn'); - async.error = _console_fn('error');*/ - - async.memoize = function (fn, hasher) { - var memo = {}; - var queues = {}; - hasher = hasher || function (x) { - return x; - }; - var memoized = function () { - var args = Array.prototype.slice.call(arguments); - var callback = args.pop(); - var key = hasher.apply(null, args); - if (key in memo) { - callback.apply(null, memo[key]); - } - else if (key in queues) { - queues[key].push(callback); - } - else { - queues[key] = [callback]; - fn.apply(null, args.concat([function () { - memo[key] = arguments; - var q = queues[key]; - delete queues[key]; - for (var i = 0, l = q.length; i < l; i++) { - q[i].apply(null, arguments); - } - }])); - } - }; - memoized.memo = memo; - memoized.unmemoized = fn; - return memoized; - }; - - async.unmemoize = function (fn) { - return function () { - return (fn.unmemoized || fn).apply(null, arguments); - }; - }; - - async.times = function (count, iterator, callback) { - var counter = []; - for (var i = 0; i < count; i++) { - counter.push(i); - } - return async.map(counter, iterator, callback); - }; - - async.timesSeries = function (count, iterator, callback) { - var counter = []; - for (var i = 0; i < count; i++) { - counter.push(i); - } - return async.mapSeries(counter, iterator, callback); - }; - - async.compose = function (/* functions... */) { - var fns = Array.prototype.reverse.call(arguments); - return function () { - var that = this; - var args = Array.prototype.slice.call(arguments); - var callback = args.pop(); - async.reduce(fns, args, function (newargs, fn, cb) { - fn.apply(that, newargs.concat([function () { - var err = arguments[0]; - var nextargs = Array.prototype.slice.call(arguments, 1); - cb(err, nextargs); - }])) - }, - function (err, results) { - callback.apply(that, [err].concat(results)); - }); - }; - }; - - async.applyEach = function (fns /*args...*/) { - var go = function () { - var that = this; - var args = Array.prototype.slice.call(arguments); - var callback = args.pop(); - return async.each(fns, function (fn, cb) { - fn.apply(that, args.concat([cb])); - }, - callback); - }; - if (arguments.length > 1) { - var args = Array.prototype.slice.call(arguments, 1); - return go.apply(this, args); - } - else { - return go; - } - }; - - // AMD / RequireJS - if (typeof define !== 'undefined' && define.amd) { - define([], function () { - return async; - }); - } - // Node.js - else if (typeof module !== 'undefined' && module.exports) { - module.exports = async; - } - // included directly via \n\n```\n\n## Documentation\n\n### Collections\n\n* [each](#each)\n* [map](#map)\n* [filter](#filter)\n* [reject](#reject)\n* [reduce](#reduce)\n* [detect](#detect)\n* [sortBy](#sortBy)\n* [some](#some)\n* [every](#every)\n* [concat](#concat)\n\n### Control Flow\n\n* [series](#series)\n* [parallel](#parallel)\n* [whilst](#whilst)\n* [doWhilst](#doWhilst)\n* [until](#until)\n* [doUntil](#doUntil)\n* [waterfall](#waterfall)\n* [compose](#compose)\n* [applyEach](#applyEach)\n* [queue](#queue)\n* [cargo](#cargo)\n* [auto](#auto)\n* [iterator](#iterator)\n* [apply](#apply)\n* [nextTick](#nextTick)\n* [times](#times)\n* [timesSeries](#timesSeries)\n\n### Utils\n\n* [memoize](#memoize)\n* [unmemoize](#unmemoize)\n* [log](#log)\n* [dir](#dir)\n* [noConflict](#noConflict)\n\n\n## Collections\n\n\n\n### each(arr, iterator, callback)\n\nApplies an iterator function to each item in an array, in parallel.\nThe iterator is called with an item from the list and a callback for when it\nhas finished. If the iterator passes an error to this callback, the main\ncallback for the each function is immediately called with the error.\n\nNote, that since this function applies the iterator to each item in parallel\nthere is no guarantee that the iterator functions will complete in order.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback(err) which must be called once it has \n completed. If no error has occured, the callback should be run without \n arguments or with an explicit null argument.\n* callback(err) - A callback which is called after all the iterator functions\n have finished, or an error has occurred.\n\n__Example__\n\n```js\n// assuming openFiles is an array of file names and saveFile is a function\n// to save the modified contents of that file:\n\nasync.each(openFiles, saveFile, function(err){\n // if any of the saves produced an error, err would equal that error\n});\n```\n\n---------------------------------------\n\n\n\n### eachSeries(arr, iterator, callback)\n\nThe same as each only the iterator is applied to each item in the array in\nseries. The next iterator is only called once the current one has completed\nprocessing. This means the iterator functions will complete in order.\n\n\n---------------------------------------\n\n\n\n### eachLimit(arr, limit, iterator, callback)\n\nThe same as each only no more than \"limit\" iterators will be simultaneously \nrunning at any time.\n\nNote that the items are not processed in batches, so there is no guarantee that\n the first \"limit\" iterator functions will complete before any others are \nstarted.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* limit - The maximum number of iterators to run at any time.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback(err) which must be called once it has \n completed. If no error has occured, the callback should be run without \n arguments or with an explicit null argument.\n* callback(err) - A callback which is called after all the iterator functions\n have finished, or an error has occurred.\n\n__Example__\n\n```js\n// Assume documents is an array of JSON objects and requestApi is a\n// function that interacts with a rate-limited REST api.\n\nasync.eachLimit(documents, 20, requestApi, function(err){\n // if any of the saves produced an error, err would equal that error\n});\n```\n\n---------------------------------------\n\n\n### map(arr, iterator, callback)\n\nProduces a new array of values by mapping each value in the given array through\nthe iterator function. The iterator is called with an item from the array and a\ncallback for when it has finished processing. The callback takes 2 arguments, \nan error and the transformed item from the array. If the iterator passes an\nerror to this callback, the main callback for the map function is immediately\ncalled with the error.\n\nNote, that since this function applies the iterator to each item in parallel\nthere is no guarantee that the iterator functions will complete in order, however\nthe results array will be in the same order as the original array.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback(err, transformed) which must be called once \n it has completed with an error (which can be null) and a transformed item.\n* callback(err, results) - A callback which is called after all the iterator\n functions have finished, or an error has occurred. Results is an array of the\n transformed items from the original array.\n\n__Example__\n\n```js\nasync.map(['file1','file2','file3'], fs.stat, function(err, results){\n // results is now an array of stats for each file\n});\n```\n\n---------------------------------------\n\n\n### mapSeries(arr, iterator, callback)\n\nThe same as map only the iterator is applied to each item in the array in\nseries. The next iterator is only called once the current one has completed\nprocessing. The results array will be in the same order as the original.\n\n\n---------------------------------------\n\n\n### mapLimit(arr, limit, iterator, callback)\n\nThe same as map only no more than \"limit\" iterators will be simultaneously \nrunning at any time.\n\nNote that the items are not processed in batches, so there is no guarantee that\n the first \"limit\" iterator functions will complete before any others are \nstarted.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* limit - The maximum number of iterators to run at any time.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback(err, transformed) which must be called once \n it has completed with an error (which can be null) and a transformed item.\n* callback(err, results) - A callback which is called after all the iterator\n functions have finished, or an error has occurred. Results is an array of the\n transformed items from the original array.\n\n__Example__\n\n```js\nasync.map(['file1','file2','file3'], 1, fs.stat, function(err, results){\n // results is now an array of stats for each file\n});\n```\n\n---------------------------------------\n\n\n### filter(arr, iterator, callback)\n\n__Alias:__ select\n\nReturns a new array of all the values which pass an async truth test.\n_The callback for each iterator call only accepts a single argument of true or\nfalse, it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like path.exists. This operation is\nperformed in parallel, but the results array will be in the same order as the\noriginal.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A truth test to apply to each item in the array.\n The iterator is passed a callback(truthValue) which must be called with a \n boolean argument once it has completed.\n* callback(results) - A callback which is called after all the iterator\n functions have finished.\n\n__Example__\n\n```js\nasync.filter(['file1','file2','file3'], path.exists, function(results){\n // results now equals an array of the existing files\n});\n```\n\n---------------------------------------\n\n\n### filterSeries(arr, iterator, callback)\n\n__alias:__ selectSeries\n\nThe same as filter only the iterator is applied to each item in the array in\nseries. The next iterator is only called once the current one has completed\nprocessing. The results array will be in the same order as the original.\n\n---------------------------------------\n\n\n### reject(arr, iterator, callback)\n\nThe opposite of filter. Removes values that pass an async truth test.\n\n---------------------------------------\n\n\n### rejectSeries(arr, iterator, callback)\n\nThe same as reject, only the iterator is applied to each item in the array\nin series.\n\n\n---------------------------------------\n\n\n### reduce(arr, memo, iterator, callback)\n\n__aliases:__ inject, foldl\n\nReduces a list of values into a single value using an async iterator to return\neach successive step. Memo is the initial state of the reduction. This\nfunction only operates in series. For performance reasons, it may make sense to\nsplit a call to this function into a parallel map, then use the normal\nArray.prototype.reduce on the results. This function is for situations where\neach step in the reduction needs to be async, if you can get the data before\nreducing it then its probably a good idea to do so.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* memo - The initial state of the reduction.\n* iterator(memo, item, callback) - A function applied to each item in the\n array to produce the next step in the reduction. The iterator is passed a\n callback(err, reduction) which accepts an optional error as its first \n argument, and the state of the reduction as the second. If an error is \n passed to the callback, the reduction is stopped and the main callback is \n immediately called with the error.\n* callback(err, result) - A callback which is called after all the iterator\n functions have finished. Result is the reduced value.\n\n__Example__\n\n```js\nasync.reduce([1,2,3], 0, function(memo, item, callback){\n // pointless async:\n process.nextTick(function(){\n callback(null, memo + item)\n });\n}, function(err, result){\n // result is now equal to the last value of memo, which is 6\n});\n```\n\n---------------------------------------\n\n\n### reduceRight(arr, memo, iterator, callback)\n\n__Alias:__ foldr\n\nSame as reduce, only operates on the items in the array in reverse order.\n\n\n---------------------------------------\n\n\n### detect(arr, iterator, callback)\n\nReturns the first value in a list that passes an async truth test. The\niterator is applied in parallel, meaning the first iterator to return true will\nfire the detect callback with that result. That means the result might not be\nthe first item in the original array (in terms of order) that passes the test.\n\nIf order within the original array is important then look at detectSeries.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A truth test to apply to each item in the array.\n The iterator is passed a callback(truthValue) which must be called with a \n boolean argument once it has completed.\n* callback(result) - A callback which is called as soon as any iterator returns\n true, or after all the iterator functions have finished. Result will be\n the first item in the array that passes the truth test (iterator) or the\n value undefined if none passed.\n\n__Example__\n\n```js\nasync.detect(['file1','file2','file3'], path.exists, function(result){\n // result now equals the first file in the list that exists\n});\n```\n\n---------------------------------------\n\n\n### detectSeries(arr, iterator, callback)\n\nThe same as detect, only the iterator is applied to each item in the array\nin series. This means the result is always the first in the original array (in\nterms of array order) that passes the truth test.\n\n\n---------------------------------------\n\n\n### sortBy(arr, iterator, callback)\n\nSorts a list by the results of running each value through an async iterator.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback(err, sortValue) which must be called once it\n has completed with an error (which can be null) and a value to use as the sort\n criteria.\n* callback(err, results) - A callback which is called after all the iterator\n functions have finished, or an error has occurred. Results is the items from\n the original array sorted by the values returned by the iterator calls.\n\n__Example__\n\n```js\nasync.sortBy(['file1','file2','file3'], function(file, callback){\n fs.stat(file, function(err, stats){\n callback(err, stats.mtime);\n });\n}, function(err, results){\n // results is now the original array of files sorted by\n // modified date\n});\n```\n\n---------------------------------------\n\n\n### some(arr, iterator, callback)\n\n__Alias:__ any\n\nReturns true if at least one element in the array satisfies an async test.\n_The callback for each iterator call only accepts a single argument of true or\nfalse, it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like path.exists. Once any iterator\ncall returns true, the main callback is immediately called.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A truth test to apply to each item in the array.\n The iterator is passed a callback(truthValue) which must be called with a \n boolean argument once it has completed.\n* callback(result) - A callback which is called as soon as any iterator returns\n true, or after all the iterator functions have finished. Result will be\n either true or false depending on the values of the async tests.\n\n__Example__\n\n```js\nasync.some(['file1','file2','file3'], path.exists, function(result){\n // if result is true then at least one of the files exists\n});\n```\n\n---------------------------------------\n\n\n### every(arr, iterator, callback)\n\n__Alias:__ all\n\nReturns true if every element in the array satisfies an async test.\n_The callback for each iterator call only accepts a single argument of true or\nfalse, it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like path.exists.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A truth test to apply to each item in the array.\n The iterator is passed a callback(truthValue) which must be called with a \n boolean argument once it has completed.\n* callback(result) - A callback which is called after all the iterator\n functions have finished. Result will be either true or false depending on\n the values of the async tests.\n\n__Example__\n\n```js\nasync.every(['file1','file2','file3'], path.exists, function(result){\n // if result is true then every file exists\n});\n```\n\n---------------------------------------\n\n\n### concat(arr, iterator, callback)\n\nApplies an iterator to each item in a list, concatenating the results. Returns the\nconcatenated list. The iterators are called in parallel, and the results are\nconcatenated as they return. There is no guarantee that the results array will\nbe returned in the original order of the arguments passed to the iterator function.\n\n__Arguments__\n\n* arr - An array to iterate over\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback(err, results) which must be called once it \n has completed with an error (which can be null) and an array of results.\n* callback(err, results) - A callback which is called after all the iterator\n functions have finished, or an error has occurred. Results is an array containing\n the concatenated results of the iterator function.\n\n__Example__\n\n```js\nasync.concat(['dir1','dir2','dir3'], fs.readdir, function(err, files){\n // files is now a list of filenames that exist in the 3 directories\n});\n```\n\n---------------------------------------\n\n\n### concatSeries(arr, iterator, callback)\n\nSame as async.concat, but executes in series instead of parallel.\n\n\n## Control Flow\n\n\n### series(tasks, [callback])\n\nRun an array of functions in series, each one running once the previous\nfunction has completed. If any functions in the series pass an error to its\ncallback, no more functions are run and the callback for the series is\nimmediately called with the value of the error. Once the tasks have completed,\nthe results are passed to the final callback as an array.\n\nIt is also possible to use an object instead of an array. Each property will be\nrun as a function and the results will be passed to the final callback as an object\ninstead of an array. This can be a more readable way of handling results from\nasync.series.\n\n\n__Arguments__\n\n* tasks - An array or object containing functions to run, each function is passed\n a callback(err, result) it must call on completion with an error (which can\n be null) and an optional result value.\n* callback(err, results) - An optional callback to run once all the functions\n have completed. This function gets a results array (or object) containing all \n the result arguments passed to the task callbacks.\n\n__Example__\n\n```js\nasync.series([\n function(callback){\n // do some stuff ...\n callback(null, 'one');\n },\n function(callback){\n // do some more stuff ...\n callback(null, 'two');\n }\n],\n// optional callback\nfunction(err, results){\n // results is now equal to ['one', 'two']\n});\n\n\n// an example using an object instead of an array\nasync.series({\n one: function(callback){\n setTimeout(function(){\n callback(null, 1);\n }, 200);\n },\n two: function(callback){\n setTimeout(function(){\n callback(null, 2);\n }, 100);\n }\n},\nfunction(err, results) {\n // results is now equal to: {one: 1, two: 2}\n});\n```\n\n---------------------------------------\n\n\n### parallel(tasks, [callback])\n\nRun an array of functions in parallel, without waiting until the previous\nfunction has completed. If any of the functions pass an error to its\ncallback, the main callback is immediately called with the value of the error.\nOnce the tasks have completed, the results are passed to the final callback as an\narray.\n\nIt is also possible to use an object instead of an array. Each property will be\nrun as a function and the results will be passed to the final callback as an object\ninstead of an array. This can be a more readable way of handling results from\nasync.parallel.\n\n\n__Arguments__\n\n* tasks - An array or object containing functions to run, each function is passed \n a callback(err, result) it must call on completion with an error (which can\n be null) and an optional result value.\n* callback(err, results) - An optional callback to run once all the functions\n have completed. This function gets a results array (or object) containing all \n the result arguments passed to the task callbacks.\n\n__Example__\n\n```js\nasync.parallel([\n function(callback){\n setTimeout(function(){\n callback(null, 'one');\n }, 200);\n },\n function(callback){\n setTimeout(function(){\n callback(null, 'two');\n }, 100);\n }\n],\n// optional callback\nfunction(err, results){\n // the results array will equal ['one','two'] even though\n // the second function had a shorter timeout.\n});\n\n\n// an example using an object instead of an array\nasync.parallel({\n one: function(callback){\n setTimeout(function(){\n callback(null, 1);\n }, 200);\n },\n two: function(callback){\n setTimeout(function(){\n callback(null, 2);\n }, 100);\n }\n},\nfunction(err, results) {\n // results is now equals to: {one: 1, two: 2}\n});\n```\n\n---------------------------------------\n\n\n### parallelLimit(tasks, limit, [callback])\n\nThe same as parallel only the tasks are executed in parallel with a maximum of \"limit\" \ntasks executing at any time.\n\nNote that the tasks are not executed in batches, so there is no guarantee that \nthe first \"limit\" tasks will complete before any others are started.\n\n__Arguments__\n\n* tasks - An array or object containing functions to run, each function is passed \n a callback(err, result) it must call on completion with an error (which can\n be null) and an optional result value.\n* limit - The maximum number of tasks to run at any time.\n* callback(err, results) - An optional callback to run once all the functions\n have completed. This function gets a results array (or object) containing all \n the result arguments passed to the task callbacks.\n\n---------------------------------------\n\n\n### whilst(test, fn, callback)\n\nRepeatedly call fn, while test returns true. Calls the callback when stopped,\nor an error occurs.\n\n__Arguments__\n\n* test() - synchronous truth test to perform before each execution of fn.\n* fn(callback) - A function to call each time the test passes. The function is\n passed a callback(err) which must be called once it has completed with an \n optional error argument.\n* callback(err) - A callback which is called after the test fails and repeated\n execution of fn has stopped.\n\n__Example__\n\n```js\nvar count = 0;\n\nasync.whilst(\n function () { return count < 5; },\n function (callback) {\n count++;\n setTimeout(callback, 1000);\n },\n function (err) {\n // 5 seconds have passed\n }\n);\n```\n\n---------------------------------------\n\n\n### doWhilst(fn, test, callback)\n\nThe post check version of whilst. To reflect the difference in the order of operations `test` and `fn` arguments are switched. `doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript.\n\n---------------------------------------\n\n\n### until(test, fn, callback)\n\nRepeatedly call fn, until test returns true. Calls the callback when stopped,\nor an error occurs.\n\nThe inverse of async.whilst.\n\n---------------------------------------\n\n\n### doUntil(fn, test, callback)\n\nLike doWhilst except the test is inverted. Note the argument ordering differs from `until`.\n\n\n---------------------------------------\n\n\n### waterfall(tasks, [callback])\n\nRuns an array of functions in series, each passing their results to the next in\nthe array. However, if any of the functions pass an error to the callback, the\nnext function is not executed and the main callback is immediately called with\nthe error.\n\n__Arguments__\n\n* tasks - An array of functions to run, each function is passed a \n callback(err, result1, result2, ...) it must call on completion. The first\n argument is an error (which can be null) and any further arguments will be \n passed as arguments in order to the next task.\n* callback(err, [results]) - An optional callback to run once all the functions\n have completed. This will be passed the results of the last task's callback.\n\n\n\n__Example__\n\n```js\nasync.waterfall([\n function(callback){\n callback(null, 'one', 'two');\n },\n function(arg1, arg2, callback){\n callback(null, 'three');\n },\n function(arg1, callback){\n // arg1 now equals 'three'\n callback(null, 'done');\n }\n], function (err, result) {\n // result now equals 'done' \n});\n```\n\n---------------------------------------\n\n### compose(fn1, fn2...)\n\nCreates a function which is a composition of the passed asynchronous\nfunctions. Each function consumes the return value of the function that\nfollows. Composing functions f(), g() and h() would produce the result of\nf(g(h())), only this version uses callbacks to obtain the return values.\n\nEach function is executed with the `this` binding of the composed function.\n\n__Arguments__\n\n* functions... - the asynchronous functions to compose\n\n\n__Example__\n\n```js\nfunction add1(n, callback) {\n setTimeout(function () {\n callback(null, n + 1);\n }, 10);\n}\n\nfunction mul3(n, callback) {\n setTimeout(function () {\n callback(null, n * 3);\n }, 10);\n}\n\nvar add1mul3 = async.compose(mul3, add1);\n\nadd1mul3(4, function (err, result) {\n // result now equals 15\n});\n```\n\n---------------------------------------\n\n### applyEach(fns, args..., callback)\n\nApplies the provided arguments to each function in the array, calling the\ncallback after all functions have completed. If you only provide the first\nargument then it will return a function which lets you pass in the\narguments as if it were a single function call.\n\n__Arguments__\n\n* fns - the asynchronous functions to all call with the same arguments\n* args... - any number of separate arguments to pass to the function\n* callback - the final argument should be the callback, called when all\n functions have completed processing\n\n\n__Example__\n\n```js\nasync.applyEach([enableSearch, updateSchema], 'bucket', callback);\n\n// partial application example:\nasync.each(\n buckets,\n async.applyEach([enableSearch, updateSchema]),\n callback\n);\n```\n\n---------------------------------------\n\n\n### queue(worker, concurrency)\n\nCreates a queue object with the specified concurrency. Tasks added to the\nqueue will be processed in parallel (up to the concurrency limit). If all\nworkers are in progress, the task is queued until one is available. Once\na worker has completed a task, the task's callback is called.\n\n__Arguments__\n\n* worker(task, callback) - An asynchronous function for processing a queued\n task, which must call its callback(err) argument when finished, with an \n optional error as an argument.\n* concurrency - An integer for determining how many worker functions should be\n run in parallel.\n\n__Queue objects__\n\nThe queue object returned by this function has the following properties and\nmethods:\n\n* length() - a function returning the number of items waiting to be processed.\n* concurrency - an integer for determining how many worker functions should be\n run in parallel. This property can be changed after a queue is created to\n alter the concurrency on-the-fly.\n* push(task, [callback]) - add a new task to the queue, the callback is called\n once the worker has finished processing the task.\n instead of a single task, an array of tasks can be submitted. the respective callback is used for every task in the list.\n* unshift(task, [callback]) - add a new task to the front of the queue.\n* saturated - a callback that is called when the queue length hits the concurrency and further tasks will be queued\n* empty - a callback that is called when the last item from the queue is given to a worker\n* drain - a callback that is called when the last item from the queue has returned from the worker\n\n__Example__\n\n```js\n// create a queue object with concurrency 2\n\nvar q = async.queue(function (task, callback) {\n console.log('hello ' + task.name);\n callback();\n}, 2);\n\n\n// assign a callback\nq.drain = function() {\n console.log('all items have been processed');\n}\n\n// add some items to the queue\n\nq.push({name: 'foo'}, function (err) {\n console.log('finished processing foo');\n});\nq.push({name: 'bar'}, function (err) {\n console.log('finished processing bar');\n});\n\n// add some items to the queue (batch-wise)\n\nq.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function (err) {\n console.log('finished processing bar');\n});\n\n// add some items to the front of the queue\n\nq.unshift({name: 'bar'}, function (err) {\n console.log('finished processing bar');\n});\n```\n\n---------------------------------------\n\n\n### cargo(worker, [payload])\n\nCreates a cargo object with the specified payload. Tasks added to the\ncargo will be processed altogether (up to the payload limit). If the\nworker is in progress, the task is queued until it is available. Once\nthe worker has completed some tasks, each callback of those tasks is called.\n\n__Arguments__\n\n* worker(tasks, callback) - An asynchronous function for processing queued\n tasks, which must call its callback(err) argument when finished, with an \n optional error as an argument.\n* payload - An optional integer for determining how many tasks should be\n process per round, default is unlimited.\n\n__Cargo objects__\n\nThe cargo object returned by this function has the following properties and\nmethods:\n\n* length() - a function returning the number of items waiting to be processed.\n* payload - an integer for determining how many tasks should be\n process per round. This property can be changed after a cargo is created to\n alter the payload on-the-fly.\n* push(task, [callback]) - add a new task to the queue, the callback is called\n once the worker has finished processing the task.\n instead of a single task, an array of tasks can be submitted. the respective callback is used for every task in the list.\n* saturated - a callback that is called when the queue length hits the concurrency and further tasks will be queued\n* empty - a callback that is called when the last item from the queue is given to a worker\n* drain - a callback that is called when the last item from the queue has returned from the worker\n\n__Example__\n\n```js\n// create a cargo object with payload 2\n\nvar cargo = async.cargo(function (task, callback) {\n console.log('hello ' + task.name);\n callback();\n}, 2);\n\n\n// add some items\n\ncargo.push({name: 'foo'}, function (err) {\n console.log('finished processing foo');\n});\ncargo.push({name: 'bar'}, function (err) {\n console.log('finished processing bar');\n});\ncargo.push({name: 'baz'}, function (err) {\n console.log('finished processing baz');\n});\n```\n\n---------------------------------------\n\n\n### auto(tasks, [callback])\n\nDetermines the best order for running functions based on their requirements.\nEach function can optionally depend on other functions being completed first,\nand each function is run as soon as its requirements are satisfied. If any of\nthe functions pass an error to their callback, that function will not complete\n(so any other functions depending on it will not run) and the main callback\nwill be called immediately with the error. Functions also receive an object\ncontaining the results of functions which have completed so far.\n\nNote, all functions are called with a results object as a second argument, \nso it is unsafe to pass functions in the tasks object which cannot handle the\nextra argument. For example, this snippet of code:\n\n```js\nasync.auto({\n readData: async.apply(fs.readFile, 'data.txt', 'utf-8');\n}, callback);\n```\n\nwill have the effect of calling readFile with the results object as the last\nargument, which will fail:\n\n```js\nfs.readFile('data.txt', 'utf-8', cb, {});\n```\n\nInstead, wrap the call to readFile in a function which does not forward the \nresults object:\n\n```js\nasync.auto({\n readData: function(cb, results){\n fs.readFile('data.txt', 'utf-8', cb);\n }\n}, callback);\n```\n\n__Arguments__\n\n* tasks - An object literal containing named functions or an array of\n requirements, with the function itself the last item in the array. The key\n used for each function or array is used when specifying requirements. The \n function receives two arguments: (1) a callback(err, result) which must be \n called when finished, passing an error (which can be null) and the result of \n the function's execution, and (2) a results object, containing the results of\n the previously executed functions.\n* callback(err, results) - An optional callback which is called when all the\n tasks have been completed. The callback will receive an error as an argument\n if any tasks pass an error to their callback. Results will always be passed\n\tbut if an error occurred, no other tasks will be performed, and the results\n\tobject will only contain partial results.\n \n\n__Example__\n\n```js\nasync.auto({\n get_data: function(callback){\n // async code to get some data\n },\n make_folder: function(callback){\n // async code to create a directory to store a file in\n // this is run at the same time as getting the data\n },\n write_file: ['get_data', 'make_folder', function(callback){\n // once there is some data and the directory exists,\n // write the data to a file in the directory\n callback(null, filename);\n }],\n email_link: ['write_file', function(callback, results){\n // once the file is written let's email a link to it...\n // results.write_file contains the filename returned by write_file.\n }]\n});\n```\n\nThis is a fairly trivial example, but to do this using the basic parallel and\nseries functions would look like this:\n\n```js\nasync.parallel([\n function(callback){\n // async code to get some data\n },\n function(callback){\n // async code to create a directory to store a file in\n // this is run at the same time as getting the data\n }\n],\nfunction(err, results){\n async.series([\n function(callback){\n // once there is some data and the directory exists,\n // write the data to a file in the directory\n },\n function(callback){\n // once the file is written let's email a link to it...\n }\n ]);\n});\n```\n\nFor a complicated series of async tasks using the auto function makes adding\nnew tasks much easier and makes the code more readable.\n\n\n---------------------------------------\n\n\n### iterator(tasks)\n\nCreates an iterator function which calls the next function in the array,\nreturning a continuation to call the next one after that. Its also possible to\n'peek' the next iterator by doing iterator.next().\n\nThis function is used internally by the async module but can be useful when\nyou want to manually control the flow of functions in series.\n\n__Arguments__\n\n* tasks - An array of functions to run.\n\n__Example__\n\n```js\nvar iterator = async.iterator([\n function(){ sys.p('one'); },\n function(){ sys.p('two'); },\n function(){ sys.p('three'); }\n]);\n\nnode> var iterator2 = iterator();\n'one'\nnode> var iterator3 = iterator2();\n'two'\nnode> iterator3();\n'three'\nnode> var nextfn = iterator2.next();\nnode> nextfn();\n'three'\n```\n\n---------------------------------------\n\n\n### apply(function, arguments..)\n\nCreates a continuation function with some arguments already applied, a useful\nshorthand when combined with other control flow functions. Any arguments\npassed to the returned function are added to the arguments originally passed\nto apply.\n\n__Arguments__\n\n* function - The function you want to eventually apply all arguments to.\n* arguments... - Any number of arguments to automatically apply when the\n continuation is called.\n\n__Example__\n\n```js\n// using apply\n\nasync.parallel([\n async.apply(fs.writeFile, 'testfile1', 'test1'),\n async.apply(fs.writeFile, 'testfile2', 'test2'),\n]);\n\n\n// the same process without using apply\n\nasync.parallel([\n function(callback){\n fs.writeFile('testfile1', 'test1', callback);\n },\n function(callback){\n fs.writeFile('testfile2', 'test2', callback);\n }\n]);\n```\n\nIt's possible to pass any number of additional arguments when calling the\ncontinuation:\n\n```js\nnode> var fn = async.apply(sys.puts, 'one');\nnode> fn('two', 'three');\none\ntwo\nthree\n```\n\n---------------------------------------\n\n\n### nextTick(callback)\n\nCalls the callback on a later loop around the event loop. In node.js this just\ncalls process.nextTick, in the browser it falls back to setImmediate(callback)\nif available, otherwise setTimeout(callback, 0), which means other higher priority\nevents may precede the execution of the callback.\n\nThis is used internally for browser-compatibility purposes.\n\n__Arguments__\n\n* callback - The function to call on a later loop around the event loop.\n\n__Example__\n\n```js\nvar call_order = [];\nasync.nextTick(function(){\n call_order.push('two');\n // call_order now equals ['one','two']\n});\ncall_order.push('one')\n```\n\n\n### times(n, callback)\n\nCalls the callback n times and accumulates results in the same manner\nyou would use with async.map.\n\n__Arguments__\n\n* n - The number of times to run the function.\n* callback - The function to call n times.\n\n__Example__\n\n```js\n// Pretend this is some complicated async factory\nvar createUser = function(id, callback) {\n callback(null, {\n id: 'user' + id\n })\n}\n// generate 5 users\nasync.times(5, function(n, next){\n createUser(n, function(err, user) {\n next(err, user)\n })\n}, function(err, users) {\n // we should now have 5 users\n});\n```\n\n\n### timesSeries(n, callback)\n\nThe same as times only the iterator is applied to each item in the array in\nseries. The next iterator is only called once the current one has completed\nprocessing. The results array will be in the same order as the original.\n\n\n## Utils\n\n\n### memoize(fn, [hasher])\n\nCaches the results of an async function. When creating a hash to store function\nresults against, the callback is omitted from the hash and an optional hash\nfunction can be used.\n\nThe cache of results is exposed as the `memo` property of the function returned\nby `memoize`.\n\n__Arguments__\n\n* fn - the function you to proxy and cache results from.\n* hasher - an optional function for generating a custom hash for storing\n results, it has all the arguments applied to it apart from the callback, and\n must be synchronous.\n\n__Example__\n\n```js\nvar slow_fn = function (name, callback) {\n // do something\n callback(null, result);\n};\nvar fn = async.memoize(slow_fn);\n\n// fn can now be used as if it were slow_fn\nfn('some name', function () {\n // callback\n});\n```\n\n\n### unmemoize(fn)\n\nUndoes a memoized function, reverting it to the original, unmemoized\nform. Comes handy in tests.\n\n__Arguments__\n\n* fn - the memoized function\n\n\n### log(function, arguments)\n\nLogs the result of an async function to the console. Only works in node.js or\nin browsers that support console.log and console.error (such as FF and Chrome).\nIf multiple arguments are returned from the async function, console.log is\ncalled on each argument in order.\n\n__Arguments__\n\n* function - The function you want to eventually apply all arguments to.\n* arguments... - Any number of arguments to apply to the function.\n\n__Example__\n\n```js\nvar hello = function(name, callback){\n setTimeout(function(){\n callback(null, 'hello ' + name);\n }, 1000);\n};\n```\n```js\nnode> async.log(hello, 'world');\n'hello world'\n```\n\n---------------------------------------\n\n\n### dir(function, arguments)\n\nLogs the result of an async function to the console using console.dir to\ndisplay the properties of the resulting object. Only works in node.js or\nin browsers that support console.dir and console.error (such as FF and Chrome).\nIf multiple arguments are returned from the async function, console.dir is\ncalled on each argument in order.\n\n__Arguments__\n\n* function - The function you want to eventually apply all arguments to.\n* arguments... - Any number of arguments to apply to the function.\n\n__Example__\n\n```js\nvar hello = function(name, callback){\n setTimeout(function(){\n callback(null, {hello: name});\n }, 1000);\n};\n```\n```js\nnode> async.dir(hello, 'world');\n{hello: 'world'}\n```\n\n---------------------------------------\n\n\n### noConflict()\n\nChanges the value of async back to its original value, returning a reference to the\nasync object.\n", - "readmeFilename": "README.md", - "_id": "async@0.2.6", - "dist": { - "shasum": "dc49b443d8bbbfe21caf53e432664353b7936b75" - }, - "_from": "async@0.2.x", - "_resolved": "https://registry.npmjs.org/async/-/async-0.2.6.tgz" -} diff --git a/src/extensibility/node/node_modules/decompress-zip/.editorconfig b/src/extensibility/node/node_modules/decompress-zip/.editorconfig deleted file mode 100644 index 779f99a12b5..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/.editorconfig +++ /dev/null @@ -1,12 +0,0 @@ -root = true - -[*] -indent_style = space -indent_size = 4 -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -[*.md] -trim_trailing_whitespace = false diff --git a/src/extensibility/node/node_modules/decompress-zip/.jshintrc b/src/extensibility/node/node_modules/decompress-zip/.jshintrc deleted file mode 100644 index 2d3e74888be..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/.jshintrc +++ /dev/null @@ -1,62 +0,0 @@ -{ - "predef": [ - "console", - "describe", - "it", - "after", - "afterEach", - "before", - "beforeEach" - ], - - "indent": 4, - "node": true, - "devel": true, - - "bitwise": false, - "curly": false, - "eqeqeq": true, - "forin": false, - "immed": true, - "latedef": false, - "newcap": true, - "noarg": true, - "noempty": false, - "nonew": true, - "plusplus": false, - "regexp": false, - "undef": true, - "unused": "vars", - "quotmark": "single", - "strict": false, - "trailing": true, - "camelcase": true, - - "asi": false, - "boss": true, - "debug": false, - "eqnull": true, - "es5": false, - "esnext": false, - "evil": false, - "expr": false, - "funcscope": false, - "globalstrict": false, - "iterator": false, - "lastsemic": false, - "laxbreak": true, - "laxcomma": false, - "loopfunc": true, - "multistr": false, - "onecase": true, - "regexdash": false, - "scripturl": false, - "smarttabs": false, - "shadow": false, - "sub": false, - "supernew": true, - "validthis": false, - - "nomen": false, - "white": true -} diff --git a/src/extensibility/node/node_modules/decompress-zip/.npmignore b/src/extensibility/node/node_modules/decompress-zip/.npmignore deleted file mode 100644 index d9301a291ea..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -/node_modules -/npm-debug.log -/test/assets diff --git a/src/extensibility/node/node_modules/decompress-zip/.travis.yml b/src/extensibility/node/node_modules/decompress-zip/.travis.yml deleted file mode 100644 index 3f4ff1a7999..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/.travis.yml +++ /dev/null @@ -1,7 +0,0 @@ -language: node_js -node_js: - - "0.10" - - "0.8" -before_script: - - npm install grunt-cli -g - - grunt test-files diff --git a/src/extensibility/node/node_modules/decompress-zip/Gruntfile.js b/src/extensibility/node/node_modules/decompress-zip/Gruntfile.js deleted file mode 100644 index 511085576d7..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/Gruntfile.js +++ /dev/null @@ -1,47 +0,0 @@ -'use strict'; - -module.exports = function (grunt) { - grunt.initConfig({ - jshint: { - options: { - jshintrc: '.jshintrc' - }, - files: ['Gruntfile.js', 'bin/*', 'lib/**/*.js', 'test/*.js'] - }, - simplemocha: { - options: { - reporter: 'spec', - timeout: '5000' - }, - full: { src: ['test/*.js'] }, - short: { - options: { - reporter: 'dot' - }, - src: ['<%= simplemocha.full.src %>'] - } - }, - exec: { - coverage: { - command: 'node node_modules/istanbul/lib/cli.js cover --dir ./coverage node_modules/mocha/bin/_mocha -- -R dot test/*.js' - }, - 'test-files': { - command: 'node download-test-assets.js' - } - }, - watch: { - files: ['<%= jshint.files %>'], - tasks: ['jshint', 'simplemocha:short'] - } - }); - - grunt.loadNpmTasks('grunt-contrib-jshint'); - grunt.loadNpmTasks('grunt-contrib-watch'); - grunt.loadNpmTasks('grunt-simple-mocha'); - grunt.loadNpmTasks('grunt-exec'); - - grunt.registerTask('test', ['jshint', 'simplemocha:full']); - grunt.registerTask('coverage', 'exec:coverage'); - grunt.registerTask('test-files', 'exec:test-files'); - grunt.registerTask('default', 'test'); -}; diff --git a/src/extensibility/node/node_modules/decompress-zip/README.md b/src/extensibility/node/node_modules/decompress-zip/README.md deleted file mode 100644 index c88e26bf44c..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/README.md +++ /dev/null @@ -1,61 +0,0 @@ -# decompress-zip [![Build Status](https://secure.travis-ci.org/bower/decompress-zip.png?branch=master)](http://travis-ci.org/bower/decompress-zip) - -Extract files from a ZIP archive - -## Usage - -### .extract(options) - -Extracts the contents of the ZIP archive `file`. - -Returns an EventEmitter with two possible events - `error` on an error, and `extract` when the extraction has completed. The value passed to the `extract` event is a basic log of each file and how it was compressed. - -The default value for `options` is `{ path: '.' }`. Currently `path` is the -only option, and is the output path for the extraction. - -```js -var DecompressZip = require('decompress-zip'); -var unzipper = new DecompressZip(filename) - -unzipper.on('error', function (err) { - console.log('Caught an error'); -}); - -unzipper.on('extract', function (log) { - console.log('Finished extracting'); -}); - -unzipper.extract({ - path: 'some/path' -}); -``` - -If `path` does not exist, decompress-zip will attempt to create it first. - -### .list() - -Much like extract, except: -- the success event is `list` -- the data for the event is an array of paths -- no files are actually extracted -- there are no options - -```js -var DecompressZip = require('decompress-zip'); -var unzipper = new DecompressZip(filename) - -unzipper.on('error', function (err) { - console.log('Caught an error'); -}); - -unzipper.on('list', function (files) { - console.log('The archive contains:'); - console.log(files); -}); - -unzipper.list(); -``` - -## License - -Released under the [MIT License](http://www.opensource.org/licenses/mit-license.php). diff --git a/src/extensibility/node/node_modules/decompress-zip/bin/decompress-zip b/src/extensibility/node/node_modules/decompress-zip/bin/decompress-zip deleted file mode 100755 index b5e1df34cb6..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/bin/decompress-zip +++ /dev/null @@ -1,82 +0,0 @@ -#!/usr/bin/env node -'use strict'; - -var nopt = require('nopt'); -var path = require('path'); -var version = require('../package.json').version; - -var knownOptions = { - 'list': Boolean, - 'extract': Boolean, - 'path': path -}; - -var shortcuts = { - 'x': ['--extract'], - 'l': ['--list'], - 'p': ['--path'], - 'v': ['--version'] -}; - -var parsedOptions = nopt(knownOptions, shortcuts); - -var pad = function (string, length) { - string = String(string); - - if (length <= string.length) { - return string; - } - - return string + (new Array(length - string.length).join(' ')); -}; - -var octal = function (number, digits) { - var result = ''; - for (var i = 0; i < digits; i++) { - result = (number & 0x07) + result; - number >>= 3; - } - return result; -}; - -var DecompressZip = require('../lib/decompress-zip'); -var zip = new DecompressZip(parsedOptions.argv.remain[0]); - -zip.on('file', function (file) { - console.log([octal(file.mode, 4), pad(file.type, 12), pad(file.compressedSize, 10), pad(file.uncompressedSize, 10), file.path].join(' ')); -}); - -zip.on('list', function (fileList) { - // console.log(fileList); -}); - -zip.on('extract', function (result) { - console.log(result); -}); - -zip.on('error', function (error) { - console.error(error.message, error.stack); -}); - -if (parsedOptions.version) { - console.log('version ' + version); -} else if (parsedOptions.list) { - console.log('Mode Type Zip size Full size Path'); - console.log('---- ---- -------- --------- ----'); - zip.list(); -} else if (parsedOptions.extract) { - var options = {}; - - if (parsedOptions.path) { - options.path = parsedOptions.path; - } - - zip.extract(options); -} else { - console.log('Usage: decompress-zip '); - console.log(' -x, --extract extract the given file'); - console.log(' -l, --list list the contents of the given file'); - console.log(' -v, --version extract the given file'); - console.log(' -p, --path extract the file into '); - console.log(' -h, --help show this message'); -} diff --git a/src/extensibility/node/node_modules/decompress-zip/download-test-assets.js b/src/extensibility/node/node_modules/decompress-zip/download-test-assets.js deleted file mode 100644 index 5c27e47d97c..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/download-test-assets.js +++ /dev/null @@ -1,38 +0,0 @@ -var fs = require('fs'); -var request = require('request'); -var tmp = require('tmp'); -var exec = require('child_process').exec; -var path = require('path'); - -var url = 'https://drive.google.com/uc?id=0Bxxp2pVhWG1DTFNWQ1hsSkZKZmM&export=download'; - -var errorHandler = function (error) { - throw error; -}; - -var extract = function (filename) { - exec('tar -xvzf ' + filename, {cwd: path.join(__dirname, 'test'), maxBuffer: 1024*1024}, function (err, stdout, stderr) { - if (err) { - throw err; - } - - console.log('Done'); - }); -}; - -tmp.file({prefix: 'assets', postfix: '.tgz'}, function (err, filename, fd) { - console.log('Downloading ' + url + ' to ' + filename); - - var read = request(url); - var write = fs.createWriteStream(filename); - - read.on('error', errorHandler); - write.on('error', errorHandler); - - // For node 0.8 we can't just use the 'finish' event of the pipe - read.on('end', function () { - write.end(extract.bind(null, filename)); - }); - - read.pipe(write, {end: false}); -}); diff --git a/src/extensibility/node/node_modules/decompress-zip/lib/decompress-zip.js b/src/extensibility/node/node_modules/decompress-zip/lib/decompress-zip.js deleted file mode 100644 index 08c21ecdc8f..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/lib/decompress-zip.js +++ /dev/null @@ -1,257 +0,0 @@ -'use strict'; - -// The zip file spec is at http://www.pkware.com/documents/casestudies/APPNOTE.TXT -// TODO: There is fair chunk of the spec that I have ignored. Need to add -// assertions everywhere to make sure that we are not dealing with a ZIP type -// that I haven't designed for. Things like spanning archives, non-DEFLATE -// compression, encryption, etc. -var fs = require('fs'); -var Q = require('q'); -var path = require('path'); -var util = require('util'); -var events = require('events'); -var structures = require('./structures'); -var signatures = require('./signatures'); -var extractors = require('./extractors'); -var FileDetails = require('./file-details'); - -// Denodify some node lib methods - -var fstat = Q.denodeify(fs.fstat); -var read = Q.denodeify(fs.read); -var fopen = Q.denodeify(fs.open); - -// Class definition - -function DecompressZip(filename) { - events.EventEmitter.call(this); - - this.filename = filename; - this.stats = null; - this.fd = null; - this.chunkSize = 1024 * 1024; // Buffer up to 1Mb at a time - - // When we need a resource, we should check if there is a promise for it - // already and use that. If the promise is already fulfilled we don't do the - // async work again and we get to queue up dependant tasks. - this._p = {}; // _p instead of _promises because it is a lot easier to read -} - -util.inherits(DecompressZip, events.EventEmitter); - -DecompressZip.version = require('../package.json').version; - -DecompressZip.prototype.openFile = function () { - return fopen(this.filename, 'r'); -}; - -DecompressZip.prototype.statFile = function (fd) { - this.fd = fd; - return fstat(fd); -}; - -DecompressZip.prototype.list = function () { - var self = this; - - this.getFiles() - .then(function (files) { - var result = []; - - files.forEach(function (file) { - result.push(file.path); - }); - - self.emit('list', result); - }) - .fail(function (error) { - self.emit('error', error); - }); - - return this; -}; - -DecompressZip.prototype.extract = function (options) { - var self = this; - - options = options || {}; - options.path = options.path || '.'; - - this.getFiles() - .then(function (files) { - var promises = []; - var results = []; - - if (options.filter) { - files = files.filter(options.filter); - } - - files.forEach(function (file) { - var promise = self._extract(file, options.path) - .then(function (result) { - results.push(result); - }); - - promises.push(promise); - }); - - return Q.all(promises) - .then(function () { - self.emit('extract', results); - }); - }) - .fail(function (error) { - self.emit('error', error); - }); - - return this; -}; - -// Utility methods -DecompressZip.prototype.getSearchBuffer = function (stats) { - var size = Math.min(stats.size, this.chunkSize); - this.stats = stats; - return this.getBuffer(stats.size - size, stats.size); -}; - -DecompressZip.prototype.getBuffer = function (start, end) { - var size = end - start; - return read(this.fd, new Buffer(size), 0, size, start) - .then(function (result) { - return result[1]; - }); -}; - -DecompressZip.prototype.findEndOfDirectory = function (buffer) { - var index = buffer.length - 3; - var chunk = ''; - - // Apparently the ZIP spec is not very good and it is impossible to - // guarantee that you have read a zip file correctly, or to determine - // the location of the CD without hunting. - // Search backwards through the buffer, as it is very likely to be near the - // end of the file. - while (index > Math.max(buffer.length - this.chunkSize, 0) && chunk !== signatures.END_OF_CENTRAL_DIRECTORY) { - index--; - chunk = buffer.readUInt32LE(index); - } - - if (chunk !== signatures.END_OF_CENTRAL_DIRECTORY) { - throw new Error('Could not find the End of Central Directory Record'); - } - - return buffer.slice(index); -}; - -// Directory here means the ZIP Central Directory, not a folder -DecompressZip.prototype.readDirectory = function (recordBuffer) { - var record = structures.readEndRecord(recordBuffer); - - return this.getBuffer(record.directoryOffset, record.directoryOffset + record.directorySize) - .then(structures.readDirectory.bind(null)); -}; - -DecompressZip.prototype.getFiles = function () { - if (!this._p.getFiles) { - this._p.getFiles = this.openFile() - .then(this.statFile.bind(this)) - .then(this.getSearchBuffer.bind(this)) - .then(this.findEndOfDirectory.bind(this)) - .then(this.readDirectory.bind(this)) - .then(this.readFileEntries.bind(this)); - } - - return this._p.getFiles; -}; - -DecompressZip.prototype.readFileEntries = function (directory) { - var promises = []; - var files = []; - var self = this; - - directory.forEach(function (directoryEntry, index) { - var start = directoryEntry.relativeOffsetOfLocalHeader; - var end = Math.min(self.stats.size, start + structures.maxFileEntrySize); - var fileDetails = new FileDetails(directoryEntry); - - var promise = self.getBuffer(start, end) - .then(structures.readFileEntry.bind(null)) - .then(function (fileEntry) { - var maxSize; - - if (fileDetails.compressedSize > 0) { - maxSize = fileDetails.compressedSize; - } else { - maxSize = self.stats.size; - - if (index < directory.length - 1) { - maxSize = directory[index + 1].relativeOffsetOfLocalHeader; - } - - maxSize -= start + fileEntry.entryLength; - } - - fileDetails._offset = start + fileEntry.entryLength; - fileDetails._maxSize = maxSize; - - self.emit('file', fileDetails); - files[index] = fileDetails; - }); - - promises.push(promise); - }); - - return Q.all(promises) - .then(function () { - return files; - }); -}; - -DecompressZip.prototype._extract = function (file, destination) { - destination = path.join(destination, file.path); - - // Possible compression methods: - // 0 - The file is stored (no compression) - // 1 - The file is Shrunk - // 2 - The file is Reduced with compression factor 1 - // 3 - The file is Reduced with compression factor 2 - // 4 - The file is Reduced with compression factor 3 - // 5 - The file is Reduced with compression factor 4 - // 6 - The file is Imploded - // 7 - Reserved for Tokenizing compression algorithm - // 8 - The file is Deflated - // 9 - Enhanced Deflating using Deflate64(tm) - // 10 - PKWARE Data Compression Library Imploding (old IBM TERSE) - // 11 - Reserved by PKWARE - // 12 - File is compressed using BZIP2 algorithm - // 13 - Reserved by PKWARE - // 14 - LZMA (EFS) - // 15 - Reserved by PKWARE - // 16 - Reserved by PKWARE - // 17 - Reserved by PKWARE - // 18 - File is compressed using IBM TERSE (new) - // 19 - IBM LZ77 z Architecture (PFS) - // 97 - WavPack compressed data - // 98 - PPMd version I, Rev 1 - - if (file.type === 'Directory') { - return extractors.folder(file, destination); - } - - if (file.type === 'File') { - switch (file.compressionMethod) { - case 0: - return extractors.store(file, destination, this); - - case 8: - return extractors.deflate(file, destination, this); - - default: - throw new Error('Unsupported compression type'); - } - } - - throw new Error('Unsupported file type "' + file.type + '"'); -}; - - -module.exports = DecompressZip; diff --git a/src/extensibility/node/node_modules/decompress-zip/lib/extractors.js b/src/extensibility/node/node_modules/decompress-zip/lib/extractors.js deleted file mode 100644 index c43a6228453..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/lib/extractors.js +++ /dev/null @@ -1,121 +0,0 @@ -var stream = require('stream'); -if (!stream.Readable) { - var stream = require('readable-stream'); -} -var fs = require('fs'); -var Q = require('q'); -var path = require('path'); -var zlib = require('zlib'); -var touch = Q.denodeify(require('touch')); -var mkpath = Q.denodeify(require('mkpath')); -var writeFile = Q.denodeify(fs.writeFile); -var inflateRaw = Q.denodeify(zlib.inflateRaw); -var cache = {}; - -// Use a cache of promises for building the directory tree. This allows us to -// correctly queue up file extractions for after their path has been created, -// avoid trying to create the path twice and still be async. -var mkdir = function (dir) { - dir = path.normalize(path.resolve(process.cwd(), dir) + path.sep); - - if (!cache[dir]) { - var parent; - - if (fs.existsSync(dir)) { - parent = new Q(); - } else { - parent = mkdir(path.dirname(dir)); - } - - cache[dir] = parent.then(function () { - return mkpath(dir); - }); - } - - return cache[dir]; -}; - -// Utility methods for writing output files -var extractors = { - folder: function (folder, destination) { - return mkdir(destination) - .then(function () { - return {folder: folder.path}; - }); - }, - store: function (file, destination, zip) { - var writer; - - if (file.uncompressedSize === 0) { - writer = touch.bind(null, destination); - } else if (file.uncompressedSize <= zip.chunkSize) { - writer = function () { - return zip.getBuffer(file._offset, file._offset + file.uncompressedSize) - .then(writeFile.bind(null, destination)); - }; - } else { - var input = new stream.Readable(); - input.wrap(fs.createReadStream(zip.filename, {start: file._offset, end: file._offset + file.uncompressedSize - 1})); - writer = pipePromise.bind(null, input, destination); - } - - return mkdir(path.dirname(destination)) - .then(writer) - .then(function () { - return {stored: file.path}; - }); - }, - deflate: function (file, destination, zip) { - // For Deflate you don't actually need to specify the end offset - and - // in fact many ZIP files don't include compressed file sizes for - // Deflated files so we don't even know what the end offset is. - - return mkdir(path.dirname(destination)) - .then(function () { - if (file._maxSize <= zip.chunkSize) { - return zip.getBuffer(file._offset, file._offset + file._maxSize) - .then(inflateRaw) - .then(function (buffer) { - return writeFile(destination, buffer); - }); - } else { - // For node 0.8 we need to create the Zlib stream and attach - // handlers in the same tick of the event loop, which is why we do - // the creation in here - var input = new stream.Readable(); - input.wrap(fs.createReadStream(zip.filename, {start: file._offset})); - var inflater = input.pipe(zlib.createInflateRaw({highWaterMark: 32 * 1024})); - - return pipePromise(inflater, destination); - } - }) - .then(function () { - return {deflated: file.path}; - }); - } -}; - -var pipePromise = function (input, destination) { - var deferred = Q.defer(); - var output = fs.createWriteStream(destination); - var errorHandler = function (error) { - deferred.reject(error); - }; - - input.on('error', errorHandler); - output.on('error', errorHandler); - - // For node 0.8 we can't just use the 'finish' event of the pipe - input.on('end', function () { - output.end(function () { - deferred.resolve(); - }); - }); - - input.pipe(output, {end: false}); - - return deferred.promise; -}; - - -module.exports = extractors; diff --git a/src/extensibility/node/node_modules/decompress-zip/lib/file-details.js b/src/extensibility/node/node_modules/decompress-zip/lib/file-details.js deleted file mode 100644 index 1f3ca689817..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/lib/file-details.js +++ /dev/null @@ -1,37 +0,0 @@ -// Objects with this prototype are used as the public representation of a file -var path = require('path'); - -var FileDetails = function (directoryEntry) { - // TODO: Add 'extra field' support - - this._offset = 0; - this._maxSize = 0; - - this.parent = path.dirname(directoryEntry.fileName); - this.filename = path.basename(directoryEntry.fileName); - this.path = path.normalize(directoryEntry.fileName); - - this.type = directoryEntry.fileAttributes.type; - this.mode = directoryEntry.fileAttributes.mode; - this.compressionMethod = directoryEntry.compressionMethod; - this.modified = directoryEntry.modifiedTime; - this.crc32 = directoryEntry.crc32; - this.compressedSize = directoryEntry.compressedSize; - this.uncompressedSize = directoryEntry.uncompressedSize; - this.comment = directoryEntry.fileComment; - - this.flags = { - encrypted: directoryEntry.generalPurposeFlags.encrypted, - compressionFlag1: directoryEntry.generalPurposeFlags.compressionFlag1, - compressionFlag2: directoryEntry.generalPurposeFlags.compressionFlag2, - useDataDescriptor: directoryEntry.generalPurposeFlags.useDataDescriptor, - enhancedDeflating: directoryEntry.generalPurposeFlags.enhancedDeflating, - compressedPatched: directoryEntry.generalPurposeFlags.compressedPatched, - strongEncryption: directoryEntry.generalPurposeFlags.strongEncryption, - utf8: directoryEntry.generalPurposeFlags.utf8, - encryptedCD: directoryEntry.generalPurposeFlags.encryptedCD - }; - -}; - -module.exports = FileDetails; diff --git a/src/extensibility/node/node_modules/decompress-zip/lib/signatures.js b/src/extensibility/node/node_modules/decompress-zip/lib/signatures.js deleted file mode 100644 index 1d299414440..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/lib/signatures.js +++ /dev/null @@ -1,10 +0,0 @@ -module.exports = { - LOCAL_FILE_HEADER: 0x04034b50, - DATA_DESCRIPTOR_RECORD: 0x08074b50, - ARCHIVE_EXTRA_DATA: 0x08064b50, - CENTRAL_FILE_HEADER: 0x02014b50, - HEADER: 0x05054b50, - ZIP64_END_OF_CENTRAL_DIRECTORY: 0x06064b50, - ZIP64_END_OF_CENTRAL_DIRECTORY_LOCATOR: 0x07064b50, - END_OF_CENTRAL_DIRECTORY: 0x06054b50 -}; diff --git a/src/extensibility/node/node_modules/decompress-zip/lib/structures.js b/src/extensibility/node/node_modules/decompress-zip/lib/structures.js deleted file mode 100644 index 66096ec4ae7..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/lib/structures.js +++ /dev/null @@ -1,222 +0,0 @@ -'use strict'; - -var binary = require('binary'); - -var convertDateTime = function (dosDate, dosTime) { - var year = ((dosDate >> 9) & 0x7F) + 1980; - var month = (dosDate >> 5) & 0x0F; - var day = dosDate & 0x1F; - - var hour = (dosTime >> 11); - var minute = (dosTime >> 5) & 0x3F; - var second = (dosTime & 0x1F) * 2; - - var result = new Date(year, month - 1, day, hour, minute, second, 0); - - return result; -}; - -var convertGeneralPurposeFlags = function (value) { - var bits = []; - - for (var i = 0; i < 16; i++) { - bits[i] = (value >> i) & 1; - } - - return { - encrypted: !!bits[0], - compressionFlag1: !!bits[1], - compressionFlag2: !!bits[2], - useDataDescriptor: !!bits[3], - enhancedDeflating: !!bits[4], - compressedPatched: !!bits[5], - strongEncryption: !!bits[6], - utf8: !!bits[11], - encryptedCD: !!bits[13] - }; -}; - -var parseExternalFileAttributes = function (externalAttributes, platform) { - var types = { - // In theory, any of these could be set. Realistically, though, it will - // be regular, directory or symlink - 1: 'NamedPipe', - 2: 'Character', - 4: 'Directory', - 6: 'Block', - 8: 'File', - 10: 'SymbolicLink', - 12: 'Socket' - }; - - switch (platform) { - case 0: // MSDOS - var attribs = { - A: (externalAttributes >> 5) & 0x01, - D: (externalAttributes >> 4) & 0x01, - V: (externalAttributes >> 3) & 0x01, - S: (externalAttributes >> 2) & 0x01, - H: (externalAttributes >> 1) & 0x01, - R: externalAttributes & 0x01 - }; - - // With no better guidance we'll make the default permissions ugo+r - var mode = parseInt('0444', 8); - - if (attribs.D) { - mode |= parseInt('0111', 8); // Set the execute bit - } - - if (!attribs.R) { - mode |= parseInt('0222', 8); // Set the write bit - } - - mode &= ~process.umask(); - - return { - platform: 'DOS', - type: attribs.D ? 'Directory' : 'File', - mode: mode - }; - - case 3: // Unix - return { - platform: 'Unix', - type: types[(externalAttributes >> 60) & 0x0F], - mode: (externalAttributes >> 48) & 0xFFF - }; - - default: - throw new Error('Unsupported platform type (' + platform + ')'); - } -}; - -var readEndRecord = function (buffer) { - var data = binary.parse(buffer) - .word32lu('signature') - .word16lu('diskNumber') - .word16lu('directoryStartDisk') - .word16lu('directoryEntryCountDisk') - .word16lu('directoryEntryCount') - .word32lu('directorySize') - .word32lu('directoryOffset') - .word16lu('commentLength') - .buffer('comment', 'commentLength') - .vars; - - data.comment = data.comment.toString(); - - return data; -}; - -var directorySort = function (a, b) { - return a.relativeOffsetOfLocalHeader - b.relativeOffsetOfLocalHeader; -}; - -var readDirectory = function (buffer) { - var directory = []; - var current; - var index = 0; - - while (index < buffer.length) { - current = binary.parse(buffer.slice(index, index + 46)) - .word32lu('signature') - .word8lu('creatorSpecVersion') - .word8lu('creatorPlatform') - .word8lu('requiredSpecVersion') - .word8lu('requiredPlatform') - .word16lu('generalPurposeBitFlag') - .word16lu('compressionMethod') - .word16lu('lastModFileTime') - .word16lu('lastModFileDate') - .word32lu('crc32') - .word32lu('compressedSize') - .word32lu('uncompressedSize') - .word16lu('fileNameLength') - .word16lu('extraFieldLength') - .word16lu('fileCommentLength') - .word16lu('diskNumberStart') - .word16lu('internalFileAttributes') - .word32lu('externalFileAttributes') - .word32lu('relativeOffsetOfLocalHeader') - .vars; - - index += 46; - - current.generalPurposeFlags = convertGeneralPurposeFlags(current.generalPurposeBitFlag); - current.fileAttributes = parseExternalFileAttributes(current.externalFileAttributes, current.creatorPlatform); - - current.modifiedTime = convertDateTime(current.lastModFileDate, current.lastModFileTime); - current.fileName = current.extraField = current.fileComment = ''; - current.headerLength = 46 + current.fileNameLength + current.extraFieldLength + current.fileCommentLength; - - if (current.fileNameLength > 0) { - current.fileName = buffer.slice(index, index + current.fileNameLength).toString(); - index += current.fileNameLength; - } - - if (current.extraFieldLength > 0) { - current.extraField = buffer.slice(index, index + current.extraFieldLength).toString(); - index += current.extraFieldLength; - } - - if (current.fileCommentLength > 0) { - current.fileComment = buffer.slice(index, index + current.fileCommentLength).toString(); - index += current.fileCommentLength; - } - - directory.push(current); - } - - directory.sort(directorySort); - - return directory; -}; - -var readFileEntry = function (buffer) { - var index = 0; - - var fileEntry = binary.parse(buffer.slice(index, 30)) - .word32lu('signature') - .word16lu('versionNeededToExtract') - .word16lu('generalPurposeBitFlag') - .word16lu('compressionMethod') - .word16lu('lastModFileTime') - .word16lu('lastModFileDate') - .word32lu('crc32') - .word32lu('compressedSize') - .word32lu('uncompressedSize') - .word16lu('fileNameLength') - .word16lu('extraFieldLength') - .vars; - - index += 30; - - fileEntry.fileName = fileEntry.extraField = ''; - - fileEntry.entryLength = 30 + fileEntry.fileNameLength + fileEntry.extraFieldLength; - - if (fileEntry.entryLength > structures.maxFileEntrySize) { - throw new Error('File entry unexpectedly large: ' + fileEntry.entryLength + ' (max: ' + structures.maxFileEntrySize + ')'); - } - - if (fileEntry.fileNameLength > 0) { - fileEntry.fileName = buffer.slice(index, index + fileEntry.fileNameLength).toString(); - index += fileEntry.fileNameLength; - } - - if (fileEntry.extraFieldLength > 0) { - fileEntry.extraField = buffer.slice(index, index + fileEntry.extraFieldLength).toString(); - index += fileEntry.extraFieldLength; - } - - return fileEntry; -}; - - -var structures = module.exports = { - readEndRecord: readEndRecord, - readDirectory: readDirectory, - readFileEntry: readFileEntry, - maxFileEntrySize: 4096 -}; diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/.bin/nopt b/src/extensibility/node/node_modules/decompress-zip/node_modules/.bin/nopt deleted file mode 120000 index 6b6566ea7fe..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/.bin/nopt +++ /dev/null @@ -1 +0,0 @@ -../nopt/bin/nopt.js \ No newline at end of file diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/.npmignore b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/.npmignore deleted file mode 100644 index 3c3629e647f..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/.travis.yml b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/.travis.yml deleted file mode 100644 index f1d0f13c8a5..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.4 - - 0.6 diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/README.markdown b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/README.markdown deleted file mode 100644 index bbeac2e51f2..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/README.markdown +++ /dev/null @@ -1,177 +0,0 @@ -binary -====== - -Unpack multibyte binary values from buffers and streams. -You can specify the endianness and signedness of the fields to be unpacked too. - -This module is a cleaner and more complete version of -[bufferlist](https://github.com/substack/node-bufferlist)'s binary module that -runs on pre-allocated buffers instead of a linked list. - -[![build status](https://secure.travis-ci.org/substack/node-binary.png)](http://travis-ci.org/substack/node-binary) - -examples -======== - -stream.js ---------- - -``` js -var binary = require('binary'); - -var ws = binary() - .word32lu('x') - .word16bs('y') - .word16bu('z') - .tap(function (vars) { - console.dir(vars); - }) -; -process.stdin.pipe(ws); -process.stdin.resume(); -``` - -output: - -``` -$ node examples/stream.js -abcdefgh -{ x: 1684234849, y: 25958, z: 26472 } -^D -``` - -parse.js --------- - -``` js -var buf = new Buffer([ 97, 98, 99, 100, 101, 102, 0 ]); - -var binary = require('binary'); -var vars = binary.parse(buf) - .word16ls('ab') - .word32bu('cf') - .word8('x') - .vars -; -console.dir(vars); -``` - -output: - -``` -{ ab: 25185, cf: 1667523942, x: 0 } -``` - -methods -======= - -`var binary = require('binary')` - -var b = binary() ----------------- - -Return a new writable stream `b` that has the chainable methods documented below -for buffering binary input. - -binary.parse(buf) ------------------ - -Parse a static buffer in one pass. Returns a chainable interface with the -methods below plus a `vars` field to get at the variable stash as the last item -in a chain. - -In parse mode, methods will set their keys to `null` if the buffer isn't big -enough except `buffer()` and `scan()` which read up up to the end of the buffer -and stop. - -b.word{8,16,32,64}{l,b}{e,u,s}(key) ------------------------------------ - -Parse bytes in the buffer or stream given: - -* number of bits -* endianness ( l : little, b : big ), -* signedness ( u and e : unsigned, s : signed ) - -These functions won't start parsing until all previous parser functions have run -and the data is available. - -The result of the parse goes into the variable stash at `key`. -If `key` has dots (`.`s), it refers to a nested address. If parent container -values don't exist they will be created automatically, so for instance you can -assign into `dst.addr` and `dst.port` and the `dst` key in the variable stash -will be `{ addr : x, port : y }` afterwards. - -b.buffer(key, size) -------------------- - -Take `size` bytes directly off the buffer stream, putting the resulting buffer -slice in the variable stash at `key`. If `size` is a string, use the value at -`vars[size]`. The key follows the same dotted address rules as the word -functions. - -b.scan(key, buffer) -------------------- - -Search for `buffer` in the stream and store all the intervening data in the -stash at at `key`, excluding the search buffer. If `buffer` passed as a string, -it will be converted into a Buffer internally. - -For example, to read in a line you can just do: - -``` js -var b = binary() - .scan('line', new Buffer('\r\n')) - .tap(function (vars) { - console.log(vars.line) - }) -; -stream.pipe(b); -``` - -b.tap(cb) ---------- - -The callback `cb` is provided with the variable stash from all the previous -actions once they've all finished. - -You can nest additional actions onto `this` inside the callback. - -b.into(key, cb) ---------------- - -Like `.tap()`, except all nested actions will assign into a `key` in the `vars` -stash. - -b.loop(cb) ----------- - -Loop, each time calling `cb(end, vars)` for function `end` and the variable -stash with `this` set to a new chain for nested parsing. The loop terminates -once `end` is called. - -b.flush() ---------- - -Clear the variable stash entirely. - -installation -============ - -To install with [npm](http://github.com/isaacs/npm): - -``` -npm install binary -``` - -notes -===== - -The word64 functions will only return approximations since javascript uses ieee -floating point for all number types. Mind the loss of precision. - -license -======= - -MIT - diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/example/buf.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/example/buf.js deleted file mode 100644 index 7f5d30b8dd5..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/example/buf.js +++ /dev/null @@ -1,11 +0,0 @@ -var buf = new Buffer([ 97, 98, 99, 100, 101, 102, 0 ]); - -var binary = require('binary'); -binary(buf) - .word16ls('ab') - .word32bu('cf') - .word8('x') - .tap(function (vars) { - console.dir(vars); - }) -; diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/example/parse.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/example/parse.js deleted file mode 100644 index b3268838347..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/example/parse.js +++ /dev/null @@ -1,10 +0,0 @@ -var buf = new Buffer([ 97, 98, 99, 100, 101, 102, 0 ]); - -var binary = require('binary'); -var vars = binary.parse(buf) - .word16ls('ab') - .word32bu('cf') - .word8('x') - .vars -; -console.dir(vars); diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/example/stream.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/example/stream.js deleted file mode 100644 index 28a6f96948a..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/example/stream.js +++ /dev/null @@ -1,12 +0,0 @@ -var binary = require('binary'); - -var ws = binary() - .word32lu('x') - .word16bs('y') - .word16bu('z') - .tap(function (vars) { - console.dir(vars); - }) -; -process.stdin.pipe(ws); -process.stdin.resume(); diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/index.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/index.js deleted file mode 100644 index bf2ba4b66f1..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/index.js +++ /dev/null @@ -1,397 +0,0 @@ -var Chainsaw = require('chainsaw'); -var EventEmitter = require('events').EventEmitter; -var Buffers = require('buffers'); -var Vars = require('./lib/vars.js'); -var Stream = require('stream').Stream; - -exports = module.exports = function (bufOrEm, eventName) { - if (Buffer.isBuffer(bufOrEm)) { - return exports.parse(bufOrEm); - } - - var s = exports.stream(); - if (bufOrEm && bufOrEm.pipe) { - bufOrEm.pipe(s); - } - else if (bufOrEm) { - bufOrEm.on(eventName || 'data', function (buf) { - s.write(buf); - }); - - bufOrEm.on('end', function () { - s.end(); - }); - } - return s; -}; - -exports.stream = function (input) { - if (input) return exports.apply(null, arguments); - - var pending = null; - function getBytes (bytes, cb, skip) { - pending = { - bytes : bytes, - skip : skip, - cb : function (buf) { - pending = null; - cb(buf); - }, - }; - dispatch(); - } - - var offset = null; - function dispatch () { - if (!pending) { - if (caughtEnd) done = true; - return; - } - if (typeof pending === 'function') { - pending(); - } - else { - var bytes = offset + pending.bytes; - - if (buffers.length >= bytes) { - var buf; - if (offset == null) { - buf = buffers.splice(0, bytes); - if (!pending.skip) { - buf = buf.slice(); - } - } - else { - if (!pending.skip) { - buf = buffers.slice(offset, bytes); - } - offset = bytes; - } - - if (pending.skip) { - pending.cb(); - } - else { - pending.cb(buf); - } - } - } - } - - function builder (saw) { - function next () { if (!done) saw.next() } - - var self = words(function (bytes, cb) { - return function (name) { - getBytes(bytes, function (buf) { - vars.set(name, cb(buf)); - next(); - }); - }; - }); - - self.tap = function (cb) { - saw.nest(cb, vars.store); - }; - - self.into = function (key, cb) { - if (!vars.get(key)) vars.set(key, {}); - var parent = vars; - vars = Vars(parent.get(key)); - - saw.nest(function () { - cb.apply(this, arguments); - this.tap(function () { - vars = parent; - }); - }, vars.store); - }; - - self.flush = function () { - vars.store = {}; - next(); - }; - - self.loop = function (cb) { - var end = false; - - saw.nest(false, function loop () { - this.vars = vars.store; - cb.call(this, function () { - end = true; - next(); - }, vars.store); - this.tap(function () { - if (end) saw.next() - else loop.call(this) - }.bind(this)); - }, vars.store); - }; - - self.buffer = function (name, bytes) { - if (typeof bytes === 'string') { - bytes = vars.get(bytes); - } - - getBytes(bytes, function (buf) { - vars.set(name, buf); - next(); - }); - }; - - self.skip = function (bytes) { - if (typeof bytes === 'string') { - bytes = vars.get(bytes); - } - - getBytes(bytes, function () { - next(); - }); - }; - - self.scan = function find (name, search) { - if (typeof search === 'string') { - search = new Buffer(search); - } - else if (!Buffer.isBuffer(search)) { - throw new Error('search must be a Buffer or a string'); - } - - var taken = 0; - pending = function () { - var pos = buffers.indexOf(search, offset + taken); - var i = pos-offset-taken; - if (pos !== -1) { - pending = null; - if (offset != null) { - vars.set( - name, - buffers.slice(offset, offset + taken + i) - ); - offset += taken + i + search.length; - } - else { - vars.set( - name, - buffers.slice(0, taken + i) - ); - buffers.splice(0, taken + i + search.length); - } - next(); - dispatch(); - } else { - i = Math.max(buffers.length - search.length - offset - taken, 0); - } - taken += i; - }; - dispatch(); - }; - - self.peek = function (cb) { - offset = 0; - saw.nest(function () { - cb.call(this, vars.store); - this.tap(function () { - offset = null; - }); - }); - }; - - return self; - }; - - var stream = Chainsaw.light(builder); - stream.writable = true; - - var buffers = Buffers(); - - stream.write = function (buf) { - buffers.push(buf); - dispatch(); - }; - - var vars = Vars(); - - var done = false, caughtEnd = false; - stream.end = function () { - caughtEnd = true; - }; - - stream.pipe = Stream.prototype.pipe; - Object.getOwnPropertyNames(EventEmitter.prototype).forEach(function (name) { - stream[name] = EventEmitter.prototype[name]; - }); - - return stream; -}; - -exports.parse = function parse (buffer) { - var self = words(function (bytes, cb) { - return function (name) { - if (offset + bytes <= buffer.length) { - var buf = buffer.slice(offset, offset + bytes); - offset += bytes; - vars.set(name, cb(buf)); - } - else { - vars.set(name, null); - } - return self; - }; - }); - - var offset = 0; - var vars = Vars(); - self.vars = vars.store; - - self.tap = function (cb) { - cb.call(self, vars.store); - return self; - }; - - self.into = function (key, cb) { - if (!vars.get(key)) { - vars.set(key, {}); - } - var parent = vars; - vars = Vars(parent.get(key)); - cb.call(self, vars.store); - vars = parent; - return self; - }; - - self.loop = function (cb) { - var end = false; - var ender = function () { end = true }; - while (end === false) { - cb.call(self, ender, vars.store); - } - return self; - }; - - self.buffer = function (name, size) { - if (typeof size === 'string') { - size = vars.get(size); - } - var buf = buffer.slice(offset, Math.min(buffer.length, offset + size)); - offset += size; - vars.set(name, buf); - - return self; - }; - - self.skip = function (bytes) { - if (typeof bytes === 'string') { - bytes = vars.get(bytes); - } - offset += bytes; - - return self; - }; - - self.scan = function (name, search) { - if (typeof search === 'string') { - search = new Buffer(search); - } - else if (!Buffer.isBuffer(search)) { - throw new Error('search must be a Buffer or a string'); - } - vars.set(name, null); - - // simple but slow string search - for (var i = 0; i + offset <= buffer.length - search.length + 1; i++) { - for ( - var j = 0; - j < search.length && buffer[offset+i+j] === search[j]; - j++ - ); - if (j === search.length) break; - } - - vars.set(name, buffer.slice(offset, offset + i)); - offset += i + search.length; - return self; - }; - - self.peek = function (cb) { - var was = offset; - cb.call(self, vars.store); - offset = was; - return self; - }; - - self.flush = function () { - vars.store = {}; - return self; - }; - - self.eof = function () { - return offset >= buffer.length; - }; - - return self; -}; - -// convert byte strings to unsigned little endian numbers -function decodeLEu (bytes) { - var acc = 0; - for (var i = 0; i < bytes.length; i++) { - acc += Math.pow(256,i) * bytes[i]; - } - return acc; -} - -// convert byte strings to unsigned big endian numbers -function decodeBEu (bytes) { - var acc = 0; - for (var i = 0; i < bytes.length; i++) { - acc += Math.pow(256, bytes.length - i - 1) * bytes[i]; - } - return acc; -} - -// convert byte strings to signed big endian numbers -function decodeBEs (bytes) { - var val = decodeBEu(bytes); - if ((bytes[0] & 0x80) == 0x80) { - val -= Math.pow(256, bytes.length); - } - return val; -} - -// convert byte strings to signed little endian numbers -function decodeLEs (bytes) { - var val = decodeLEu(bytes); - if ((bytes[bytes.length - 1] & 0x80) == 0x80) { - val -= Math.pow(256, bytes.length); - } - return val; -} - -function words (decode) { - var self = {}; - - [ 1, 2, 4, 8 ].forEach(function (bytes) { - var bits = bytes * 8; - - self['word' + bits + 'le'] - = self['word' + bits + 'lu'] - = decode(bytes, decodeLEu); - - self['word' + bits + 'ls'] - = decode(bytes, decodeLEs); - - self['word' + bits + 'be'] - = self['word' + bits + 'bu'] - = decode(bytes, decodeBEu); - - self['word' + bits + 'bs'] - = decode(bytes, decodeBEs); - }); - - // word8be(n) == word8le(n) for all n - self.word8 = self.word8u = self.word8be; - self.word8s = self.word8bs; - - return self; -} diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/lib/vars.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/lib/vars.js deleted file mode 100644 index 00d6df6758e..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/lib/vars.js +++ /dev/null @@ -1,28 +0,0 @@ -module.exports = function (store) { - function getset (name, value) { - var node = vars.store; - var keys = name.split('.'); - keys.slice(0,-1).forEach(function (k) { - if (node[k] === undefined) node[k] = {}; - node = node[k] - }); - var key = keys[keys.length - 1]; - if (arguments.length == 1) { - return node[key]; - } - else { - return node[key] = value; - } - } - - var vars = { - get : function (name) { - return getset(name); - }, - set : function (name, value) { - return getset(name, value); - }, - store : store || {}, - }; - return vars; -}; diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/buffers/README.markdown b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/buffers/README.markdown deleted file mode 100644 index 73a18a41e64..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/buffers/README.markdown +++ /dev/null @@ -1,122 +0,0 @@ -buffers -======= - -Treat a collection of Buffers as a single contiguous partially mutable Buffer. - -Where possible, operations execute without creating a new Buffer and copying -everything over. - -This is a cleaner more Buffery rehash of -[bufferlist](http://github.com/substack/node-bufferlist). - -example -======= - -slice ------ - - var Buffers = require('buffers'); - var bufs = Buffers(); - bufs.push(new Buffer([1,2,3])); - bufs.push(new Buffer([4,5,6,7])); - bufs.push(new Buffer([8,9,10])); - - console.dir(bufs.slice(2,8)) - -output: - - $ node examples/slice.js - - -splice ------- - - var Buffers = require('buffers'); - var bufs = Buffers([ - new Buffer([1,2,3]), - new Buffer([4,5,6,7]), - new Buffer([8,9,10]), - ]); - - var removed = bufs.splice(2, 4); - console.dir({ - removed : removed.slice(), - bufs : bufs.slice(), - }); - -output: - - $ node examples/splice.js - { removed: , - bufs: } - -methods -======= - -Buffers(buffers) ----------------- - -Create a Buffers with an array of `Buffer`s if specified, else `[]`. - -.push(buf1, buf2...) --------------------- - -Push buffers onto the end. Just like `Array.prototype.push`. - -.unshift(buf1, buf2...) ------------------------ - -Unshift buffers onto the head. Just like `Array.prototype.unshift`. - -.slice(i, j) ------------- - -Slice a range out of the buffer collection as if it were contiguous. -Works just like the `Array.prototype.slice` version. - -.splice(i, howMany, replacements) ---------------------------------- - -Splice the buffer collection as if it were contiguous. -Works just like `Array.prototype.splice`, even the replacement part! - -.copy(dst, dstStart, start, end) --------------------------------- - -Copy the buffer collection as if it were contiguous to the `dst` Buffer with the -specified bounds. -Works just like `Buffer.prototype.copy`. - -.get(i) -------- - -Get a single element at index `i`. - -.set(i, x) ----------- - -Set a single element's value at index `i`. - -.indexOf(needle, offset) ----------- - -Find a string or buffer `needle` inside the buffer collection. Returns -the position of the search string or -1 if the search string was not -found. - -Provide an `offset` to skip that number of characters at the beginning -of the search. This can be used to find additional matches. - -This function will return the correct result even if the search string -is spread out over multiple internal buffers. - -.toBuffer() ------------ - -Convert the buffer collection to a single buffer, equivalent with `.slice(0, buffers.length)`; - -.toString(encoding, start, end) ------------ - -Decodes and returns a string from the buffer collection. -Works just like `Buffer.prototype.toString` diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/buffers/examples/slice.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/buffers/examples/slice.js deleted file mode 100644 index 0bea38c98af..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/buffers/examples/slice.js +++ /dev/null @@ -1,9 +0,0 @@ -var Buffers = require('buffers'); -var bufs = Buffers(); -bufs.push(new Buffer([1,2,3])); -bufs.push(new Buffer([4,5,6,7])); -bufs.push(new Buffer([8,9,10])); - -console.dir(bufs.slice(2,8)) - -// Output: diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/buffers/examples/splice.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/buffers/examples/splice.js deleted file mode 100644 index 56a17518906..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/buffers/examples/splice.js +++ /dev/null @@ -1,17 +0,0 @@ -var Buffers = require('buffers'); -var bufs = Buffers([ - new Buffer([1,2,3]), - new Buffer([4,5,6,7]), - new Buffer([8,9,10]), -]); - -var removed = bufs.splice(2, 4, new Buffer('ab'), new Buffer('cd')); -console.dir({ - removed : removed.slice(), - bufs : bufs.slice(), -}); - -/* Output: -{ removed: , - bufs: } -*/ diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/buffers/index.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/buffers/index.js deleted file mode 100644 index 86a9696898b..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/buffers/index.js +++ /dev/null @@ -1,269 +0,0 @@ -module.exports = Buffers; - -function Buffers (bufs) { - if (!(this instanceof Buffers)) return new Buffers(bufs); - this.buffers = bufs || []; - this.length = this.buffers.reduce(function (size, buf) { - return size + buf.length - }, 0); -} - -Buffers.prototype.push = function () { - for (var i = 0; i < arguments.length; i++) { - if (!Buffer.isBuffer(arguments[i])) { - throw new TypeError('Tried to push a non-buffer'); - } - } - - for (var i = 0; i < arguments.length; i++) { - var buf = arguments[i]; - this.buffers.push(buf); - this.length += buf.length; - } - return this.length; -}; - -Buffers.prototype.unshift = function () { - for (var i = 0; i < arguments.length; i++) { - if (!Buffer.isBuffer(arguments[i])) { - throw new TypeError('Tried to unshift a non-buffer'); - } - } - - for (var i = 0; i < arguments.length; i++) { - var buf = arguments[i]; - this.buffers.unshift(buf); - this.length += buf.length; - } - return this.length; -}; - -Buffers.prototype.copy = function (dst, dStart, start, end) { - return this.slice(start, end).copy(dst, dStart, 0, end - start); -}; - -Buffers.prototype.splice = function (i, howMany) { - var buffers = this.buffers; - var index = i >= 0 ? i : this.length - i; - var reps = [].slice.call(arguments, 2); - - if (howMany === undefined) { - howMany = this.length - index; - } - else if (howMany > this.length - index) { - howMany = this.length - index; - } - - for (var i = 0; i < reps.length; i++) { - this.length += reps[i].length; - } - - var removed = new Buffers(); - var bytes = 0; - - var startBytes = 0; - for ( - var ii = 0; - ii < buffers.length && startBytes + buffers[ii].length < index; - ii ++ - ) { startBytes += buffers[ii].length } - - if (index - startBytes > 0) { - var start = index - startBytes; - - if (start + howMany < buffers[ii].length) { - removed.push(buffers[ii].slice(start, start + howMany)); - - var orig = buffers[ii]; - //var buf = new Buffer(orig.length - howMany); - var buf0 = new Buffer(start); - for (var i = 0; i < start; i++) { - buf0[i] = orig[i]; - } - - var buf1 = new Buffer(orig.length - start - howMany); - for (var i = start + howMany; i < orig.length; i++) { - buf1[ i - howMany - start ] = orig[i] - } - - if (reps.length > 0) { - var reps_ = reps.slice(); - reps_.unshift(buf0); - reps_.push(buf1); - buffers.splice.apply(buffers, [ ii, 1 ].concat(reps_)); - ii += reps_.length; - reps = []; - } - else { - buffers.splice(ii, 1, buf0, buf1); - //buffers[ii] = buf; - ii += 2; - } - } - else { - removed.push(buffers[ii].slice(start)); - buffers[ii] = buffers[ii].slice(0, start); - ii ++; - } - } - - if (reps.length > 0) { - buffers.splice.apply(buffers, [ ii, 0 ].concat(reps)); - ii += reps.length; - } - - while (removed.length < howMany) { - var buf = buffers[ii]; - var len = buf.length; - var take = Math.min(len, howMany - removed.length); - - if (take === len) { - removed.push(buf); - buffers.splice(ii, 1); - } - else { - removed.push(buf.slice(0, take)); - buffers[ii] = buffers[ii].slice(take); - } - } - - this.length -= removed.length; - - return removed; -}; - -Buffers.prototype.slice = function (i, j) { - var buffers = this.buffers; - if (j === undefined) j = this.length; - if (i === undefined) i = 0; - - if (j > this.length) j = this.length; - - var startBytes = 0; - for ( - var si = 0; - si < buffers.length && startBytes + buffers[si].length <= i; - si ++ - ) { startBytes += buffers[si].length } - - var target = new Buffer(j - i); - - var ti = 0; - for (var ii = si; ti < j - i && ii < buffers.length; ii++) { - var len = buffers[ii].length; - - var start = ti === 0 ? i - startBytes : 0; - var end = ti + len >= j - i - ? Math.min(start + (j - i) - ti, len) - : len - ; - - buffers[ii].copy(target, ti, start, end); - ti += end - start; - } - - return target; -}; - -Buffers.prototype.pos = function (i) { - if (i < 0 || i >= this.length) throw new Error('oob'); - var l = i, bi = 0, bu = null; - for (;;) { - bu = this.buffers[bi]; - if (l < bu.length) { - return {buf: bi, offset: l}; - } else { - l -= bu.length; - } - bi++; - } -}; - -Buffers.prototype.get = function get (i) { - var pos = this.pos(i); - - return this.buffers[pos.buf].get(pos.offset); -}; - -Buffers.prototype.set = function set (i, b) { - var pos = this.pos(i); - - return this.buffers[pos.buf].set(pos.offset, b); -}; - -Buffers.prototype.indexOf = function (needle, offset) { - if ("string" === typeof needle) { - needle = new Buffer(needle); - } else if (needle instanceof Buffer) { - // already a buffer - } else { - throw new Error('Invalid type for a search string'); - } - - if (!needle.length) { - return 0; - } - - if (!this.length) { - return -1; - } - - var i = 0, j = 0, match = 0, mstart, pos = 0; - - // start search from a particular point in the virtual buffer - if (offset) { - var p = this.pos(offset); - i = p.buf; - j = p.offset; - pos = offset; - } - - // for each character in virtual buffer - for (;;) { - while (j >= this.buffers[i].length) { - j = 0; - i++; - - if (i >= this.buffers.length) { - // search string not found - return -1; - } - } - - var char = this.buffers[i][j]; - - if (char == needle[match]) { - // keep track where match started - if (match == 0) { - mstart = { - i: i, - j: j, - pos: pos - }; - } - match++; - if (match == needle.length) { - // full match - return mstart.pos; - } - } else if (match != 0) { - // a partial match ended, go back to match starting position - // this will continue the search at the next character - i = mstart.i; - j = mstart.j; - pos = mstart.pos; - match = 0; - } - - j++; - pos++; - } -}; - -Buffers.prototype.toBuffer = function() { - return this.slice(); -} - -Buffers.prototype.toString = function(encoding, start, end) { - return this.slice(start, end).toString(encoding); -} diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/buffers/package.json b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/buffers/package.json deleted file mode 100644 index fe8306006a2..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/buffers/package.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "buffers", - "description": "Treat a collection of Buffers as a single contiguous partially mutable Buffer.", - "version": "0.1.1", - "repository": { - "type": "git", - "url": "http://github.com/substack/node-buffers.git" - }, - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "main": "./index", - "scripts": { - "test": "expresso" - }, - "engines": { - "node": ">=0.2.0" - }, - "readme": "buffers\n=======\n\nTreat a collection of Buffers as a single contiguous partially mutable Buffer.\n\nWhere possible, operations execute without creating a new Buffer and copying\neverything over.\n\nThis is a cleaner more Buffery rehash of\n[bufferlist](http://github.com/substack/node-bufferlist).\n\nexample\n=======\n\nslice\n-----\n\n var Buffers = require('buffers');\n var bufs = Buffers();\n bufs.push(new Buffer([1,2,3]));\n bufs.push(new Buffer([4,5,6,7]));\n bufs.push(new Buffer([8,9,10]));\n \n console.dir(bufs.slice(2,8))\n\noutput:\n\n $ node examples/slice.js \n \n\nsplice\n------\n\n var Buffers = require('buffers');\n var bufs = Buffers([\n new Buffer([1,2,3]),\n new Buffer([4,5,6,7]),\n new Buffer([8,9,10]),\n ]);\n \n var removed = bufs.splice(2, 4);\n console.dir({\n removed : removed.slice(),\n bufs : bufs.slice(),\n });\n \noutput:\n\n $ node examples/splice.js\n { removed: ,\n bufs: }\n\nmethods\n=======\n\nBuffers(buffers)\n----------------\n\nCreate a Buffers with an array of `Buffer`s if specified, else `[]`.\n\n.push(buf1, buf2...)\n--------------------\n\nPush buffers onto the end. Just like `Array.prototype.push`.\n\n.unshift(buf1, buf2...)\n-----------------------\n\nUnshift buffers onto the head. Just like `Array.prototype.unshift`.\n\n.slice(i, j)\n------------\n\nSlice a range out of the buffer collection as if it were contiguous.\nWorks just like the `Array.prototype.slice` version.\n\n.splice(i, howMany, replacements)\n---------------------------------\n\nSplice the buffer collection as if it were contiguous.\nWorks just like `Array.prototype.splice`, even the replacement part!\n\n.copy(dst, dstStart, start, end)\n--------------------------------\n\nCopy the buffer collection as if it were contiguous to the `dst` Buffer with the\nspecified bounds.\nWorks just like `Buffer.prototype.copy`.\n\n.get(i)\n-------\n\nGet a single element at index `i`.\n\n.set(i, x)\n----------\n\nSet a single element's value at index `i`.\n\n.indexOf(needle, offset)\n----------\n\nFind a string or buffer `needle` inside the buffer collection. Returns\nthe position of the search string or -1 if the search string was not\nfound.\n\nProvide an `offset` to skip that number of characters at the beginning\nof the search. This can be used to find additional matches.\n\nThis function will return the correct result even if the search string\nis spread out over multiple internal buffers.\n\n.toBuffer()\n-----------\n\nConvert the buffer collection to a single buffer, equivalent with `.slice(0, buffers.length)`;\n\n.toString(encoding, start, end)\n-----------\n\nDecodes and returns a string from the buffer collection.\nWorks just like `Buffer.prototype.toString`\n", - "readmeFilename": "README.markdown", - "bugs": { - "url": "https://github.com/substack/node-buffers/issues" - }, - "_id": "buffers@0.1.1", - "_from": "buffers@~0.1.1" -} diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/buffers/test/buffers.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/buffers/test/buffers.js deleted file mode 100644 index 0c2406614c4..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/buffers/test/buffers.js +++ /dev/null @@ -1,209 +0,0 @@ -var assert = require('assert'); -var Buffers = require('../'); - -function create (xs, split) { - var bufs = Buffers(); - var offset = 0; - split.forEach(function (i) { - bufs.push(new Buffer(xs.slice(offset, offset + i))); - offset += i; - }); - return bufs; -} - -exports.slice = function () { - var xs = [0,1,2,3,4,5,6,7,8,9]; - var splits = [ [4,2,3,1], [2,2,2,2,2], [1,6,3,1], [9,2], [10], [5,5] ]; - - splits.forEach(function (split) { - var bufs = create(xs, split); - assert.eql(new Buffer(xs), bufs.slice(), - '[' + xs.join(',') + ']' - + ' != ' + - '[' + [].join.call(bufs.slice(), ',') + ']' - ); - - for (var i = 0; i < xs.length; i++) { - for (var j = i; j < xs.length; j++) { - var a = bufs.slice(i,j); - var b = new Buffer(xs.slice(i,j)); - - assert.eql(a, b, - '[' + [].join.call(a, ',') + ']' - + ' != ' + - '[' + [].join.call(b, ',') + ']' - ); - } - } - }); -}; - -exports.splice = function () { - var xs = [0,1,2,3,4,5,6,7,8,9]; - var splits = [ [4,2,3,1], [2,2,2,2,2], [1,6,3,1], [9,2], [10], [5,5] ]; - - splits.forEach(function (split) { - for (var i = 0; i < xs.length; i++) { - for (var j = i; j < xs.length; j++) { - var bufs = create(xs, split); - var xs_ = xs.slice(); - - var a_ = bufs.splice(i,j); - var a = [].slice.call(a_.slice()); - var b = xs_.splice(i,j); - assert.eql(a, b, - '[' + a.join(',') + ']' - + ' != ' + - '[' + b.join(',') + ']' - ); - - assert.eql(bufs.slice(), new Buffer(xs_), - '[' + [].join.call(bufs.slice(), ',') + ']' - + ' != ' + - '[' + [].join.call(xs_, ',') + ']' - ); - } - } - }); -}; - -exports.spliceRep = function () { - var xs = [0,1,2,3,4,5,6,7,8,9]; - var splits = [ [4,2,3,1], [2,2,2,2,2], [1,6,3,1], [9,2], [10], [5,5] ]; - var reps = [ [], [1], [5,6], [3,1,3,3,7], [9,8,7,6,5,4,3,2,1,2,3,4,5] ]; - - splits.forEach(function (split) { - reps.forEach(function (rep) { - for (var i = 0; i < xs.length; i++) { - for (var j = i; j < xs.length; j++) { - var bufs = create(xs, split); - var xs_ = xs.slice(); - - var a_ = bufs.splice.apply( - bufs, [ i, j ].concat(new Buffer(rep)) - ); - var a = [].slice.call(a_.slice()); - var b = xs_.splice.apply(xs_, [ i, j ].concat(rep)); - - assert.eql(a, b, - '[' + a.join(',') + ']' - + ' != ' + - '[' + b.join(',') + ']' - ); - - assert.eql(bufs.slice(), new Buffer(xs_), - '[' + [].join.call(bufs.slice(), ',') + ']' - + ' != ' + - '[' + [].join.call(xs_, ',') + ']' - ); - } - } - }); - }); -}; - -exports.copy = function () { - var xs = [0,1,2,3,4,5,6,7,8,9]; - var splits = [ [4,2,3,1], [2,2,2,2,2], [1,6,3,1], [9,2], [10], [5,5] ]; - - splits.forEach(function (split) { - var bufs = create(xs, split); - var buf = new Buffer(xs); - - for (var i = 0; i < xs.length; i++) { - for (var j = i; j < xs.length; j++) { - var t0 = new Buffer(j - i); - var t1 = new Buffer(j - i); - - assert.eql( - bufs.copy(t0, 0, i, j), - buf.copy(t1, 0, i, j) - ); - - assert.eql( - [].slice.call(t0), - [].slice.call(t1) - ); - } - } - }); -}; - -exports.push = function () { - var bufs = Buffers(); - bufs.push(new Buffer([0])); - bufs.push(new Buffer([1,2,3])); - bufs.push(new Buffer([4,5])); - bufs.push(new Buffer([6,7,8,9])); - assert.eql( - [].slice.call(bufs.slice()), - [0,1,2,3,4,5,6,7,8,9] - ); - - assert.throws(function () { - bufs.push(new Buffer([11,12]), 'moo'); - }); - assert.eql(bufs.buffers.length, 4); -}; - -exports.unshift = function () { - var bufs = Buffers(); - bufs.unshift(new Buffer([6,7,8,9])); - bufs.unshift(new Buffer([4,5])); - bufs.unshift(new Buffer([1,2,3])); - bufs.unshift(new Buffer([0])); - assert.eql( - [].slice.call(bufs.slice()), - [0,1,2,3,4,5,6,7,8,9] - ); - assert.throws(function () { - bufs.unshift(new Buffer([-2,-1]), 'moo'); - }); - assert.eql(bufs.buffers.length, 4); -}; - -exports.get = function () { - var bufs = Buffers(); - bufs.unshift(new Buffer([6,7,8,9])); - bufs.unshift(new Buffer([4,5])); - bufs.unshift(new Buffer([1,2,3])); - bufs.unshift(new Buffer([0])); - assert.eql( bufs.get(0), 0 ); - assert.eql( bufs.get(1), 1 ); - assert.eql( bufs.get(2), 2 ); - assert.eql( bufs.get(3), 3 ); - assert.eql( bufs.get(4), 4 ); - assert.eql( bufs.get(5), 5 ); - assert.eql( bufs.get(6), 6 ); - assert.eql( bufs.get(7), 7 ); - assert.eql( bufs.get(8), 8 ); - assert.eql( bufs.get(9), 9 ); -}; - -exports.set = function () { - var bufs = Buffers(); - bufs.push(new Buffer("Hel")); - bufs.push(new Buffer("lo")); - bufs.push(new Buffer("!")); - bufs.set(0, 'h'.charCodeAt(0) ); - bufs.set(3, 'L'.charCodeAt(0) ); - bufs.set(5, '.'.charCodeAt(0) ); - assert.eql( bufs.slice(0).toString(), 'helLo.' ); -}; - -exports.indexOf = function () { - var bufs = Buffers(); - bufs.push(new Buffer("Hel")); - bufs.push(new Buffer("lo,")); - bufs.push(new Buffer(" how are ")); - bufs.push(new Buffer("you")); - bufs.push(new Buffer("?")); - assert.eql( bufs.indexOf("Hello"), 0 ); - assert.eql( bufs.indexOf("Hello", 1), -1 ); - assert.eql( bufs.indexOf("ello"), 1 ); - assert.eql( bufs.indexOf("ello", 1), 1 ); - assert.eql( bufs.indexOf("ello", 2), -1 ); - assert.eql( bufs.indexOf("e"), 1 ); - assert.eql( bufs.indexOf("e", 2), 13 ); - assert.eql( bufs.indexOf(new Buffer([0x65]), 2), 13 ); -}; diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/.npmignore b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/.npmignore deleted file mode 100644 index 3c3629e647f..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/README.markdown b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/README.markdown deleted file mode 100644 index 4721f782955..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/README.markdown +++ /dev/null @@ -1,157 +0,0 @@ -Chainsaw -======== - -Build chainable fluent interfaces the easy way in node.js. - -With this meta-module you can write modules with chainable interfaces. -Chainsaw takes care of all of the boring details and makes nested flow control -super simple too. - -Just call `Chainsaw` with a constructor function like in the examples below. -In your methods, just do `saw.next()` to move along to the next event and -`saw.nest()` to create a nested chain. - -Examples -======== - -add_do.js ---------- - -This silly example adds values with a chainsaw. - - var Chainsaw = require('chainsaw'); - - function AddDo (sum) { - return Chainsaw(function (saw) { - this.add = function (n) { - sum += n; - saw.next(); - }; - - this.do = function (cb) { - saw.nest(cb, sum); - }; - }); - } - - AddDo(0) - .add(5) - .add(10) - .do(function (sum) { - if (sum > 12) this.add(-10); - }) - .do(function (sum) { - console.log('Sum: ' + sum); - }) - ; - -Output: - Sum: 5 - -prompt.js ---------- - -This example provides a wrapper on top of stdin with the help of -[node-lazy](https://github.com/pkrumins/node-lazy) for line-processing. - - var Chainsaw = require('chainsaw'); - var Lazy = require('lazy'); - - module.exports = Prompt; - function Prompt (stream) { - var waiting = []; - var lines = []; - var lazy = Lazy(stream).lines.map(String) - .forEach(function (line) { - if (waiting.length) { - var w = waiting.shift(); - w(line); - } - else lines.push(line); - }) - ; - - var vars = {}; - return Chainsaw(function (saw) { - this.getline = function (f) { - var g = function (line) { - saw.nest(f, line, vars); - }; - - if (lines.length) g(lines.shift()); - else waiting.push(g); - }; - - this.do = function (cb) { - saw.nest(cb, vars); - }; - }); - } - -And now for the new Prompt() module in action: - - var util = require('util'); - var stdin = process.openStdin(); - - Prompt(stdin) - .do(function () { - util.print('x = '); - }) - .getline(function (line, vars) { - vars.x = parseInt(line, 10); - }) - .do(function () { - util.print('y = '); - }) - .getline(function (line, vars) { - vars.y = parseInt(line, 10); - }) - .do(function (vars) { - if (vars.x + vars.y < 10) { - util.print('z = '); - this.getline(function (line) { - vars.z = parseInt(line, 10); - }) - } - else { - vars.z = 0; - } - }) - .do(function (vars) { - console.log('x + y + z = ' + (vars.x + vars.y + vars.z)); - process.exit(); - }) - ; - -Installation -============ - -With [npm](http://github.com/isaacs/npm), just do: - npm install chainsaw - -or clone this project on github: - - git clone http://github.com/substack/node-chainsaw.git - -To run the tests with [expresso](http://github.com/visionmedia/expresso), -just do: - - expresso - - -Light Mode vs Full Mode -======================= - -`node-chainsaw` supports two different modes. In full mode, every -action is recorded, which allows you to replay actions using the -`jump()`, `trap()` and `down()` methods. - -However, if your chainsaws are long-lived, recording every action can -consume a tremendous amount of memory, so we also offer a "light" mode -where actions are not recorded and the aforementioned methods are -disabled. - -To enable light mode simply use `Chainsaw.light()` to construct your -saw, instead of `Chainsaw()`. - - diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/examples/add_do.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/examples/add_do.js deleted file mode 100644 index 378705dfbdd..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/examples/add_do.js +++ /dev/null @@ -1,25 +0,0 @@ -var Chainsaw = require('chainsaw'); - -function AddDo (sum) { - return Chainsaw(function (saw) { - this.add = function (n) { - sum += n; - saw.next(); - }; - - this.do = function (cb) { - saw.nest(cb, sum); - }; - }); -} - -AddDo(0) - .add(5) - .add(10) - .do(function (sum) { - if (sum > 12) this.add(-10); - }) - .do(function (sum) { - console.log('Sum: ' + sum); - }) -; diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/examples/prompt.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/examples/prompt.js deleted file mode 100644 index 0a06d71c346..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/examples/prompt.js +++ /dev/null @@ -1,67 +0,0 @@ -var Chainsaw = require('chainsaw'); -var Lazy = require('lazy'); - -module.exports = Prompt; -function Prompt (stream) { - var waiting = []; - var lines = []; - var lazy = Lazy(stream).lines.map(String) - .forEach(function (line) { - if (waiting.length) { - var w = waiting.shift(); - w(line); - } - else lines.push(line); - }) - ; - - var vars = {}; - return Chainsaw(function (saw) { - this.getline = function (f) { - var g = function (line) { - saw.nest(f, line, vars); - }; - - if (lines.length) g(lines.shift()); - else waiting.push(g); - }; - - this.do = function (cb) { - saw.nest(cb, vars); - }; - }); -} - -var util = require('util'); -if (__filename === process.argv[1]) { - var stdin = process.openStdin(); - Prompt(stdin) - .do(function () { - util.print('x = '); - }) - .getline(function (line, vars) { - vars.x = parseInt(line, 10); - }) - .do(function () { - util.print('y = '); - }) - .getline(function (line, vars) { - vars.y = parseInt(line, 10); - }) - .do(function (vars) { - if (vars.x + vars.y < 10) { - util.print('z = '); - this.getline(function (line) { - vars.z = parseInt(line, 10); - }) - } - else { - vars.z = 0; - } - }) - .do(function (vars) { - console.log('x + y + z = ' + (vars.x + vars.y + vars.z)); - process.exit(); - }) - ; -} diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/index.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/index.js deleted file mode 100755 index 39f8c0783fa..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/index.js +++ /dev/null @@ -1,145 +0,0 @@ -var Traverse = require('traverse'); -var EventEmitter = require('events').EventEmitter; - -module.exports = Chainsaw; -function Chainsaw (builder) { - var saw = Chainsaw.saw(builder, {}); - var r = builder.call(saw.handlers, saw); - if (r !== undefined) saw.handlers = r; - saw.record(); - return saw.chain(); -}; - -Chainsaw.light = function ChainsawLight (builder) { - var saw = Chainsaw.saw(builder, {}); - var r = builder.call(saw.handlers, saw); - if (r !== undefined) saw.handlers = r; - return saw.chain(); -}; - -Chainsaw.saw = function (builder, handlers) { - var saw = new EventEmitter; - saw.handlers = handlers; - saw.actions = []; - - saw.chain = function () { - var ch = Traverse(saw.handlers).map(function (node) { - if (this.isRoot) return node; - var ps = this.path; - - if (typeof node === 'function') { - this.update(function () { - saw.actions.push({ - path : ps, - args : [].slice.call(arguments) - }); - return ch; - }); - } - }); - - process.nextTick(function () { - saw.emit('begin'); - saw.next(); - }); - - return ch; - }; - - saw.pop = function () { - return saw.actions.shift(); - }; - - saw.next = function () { - var action = saw.pop(); - - if (!action) { - saw.emit('end'); - } - else if (!action.trap) { - var node = saw.handlers; - action.path.forEach(function (key) { node = node[key] }); - node.apply(saw.handlers, action.args); - } - }; - - saw.nest = function (cb) { - var args = [].slice.call(arguments, 1); - var autonext = true; - - if (typeof cb === 'boolean') { - var autonext = cb; - cb = args.shift(); - } - - var s = Chainsaw.saw(builder, {}); - var r = builder.call(s.handlers, s); - - if (r !== undefined) s.handlers = r; - - // If we are recording... - if ("undefined" !== typeof saw.step) { - // ... our children should, too - s.record(); - } - - cb.apply(s.chain(), args); - if (autonext !== false) s.on('end', saw.next); - }; - - saw.record = function () { - upgradeChainsaw(saw); - }; - - ['trap', 'down', 'jump'].forEach(function (method) { - saw[method] = function () { - throw new Error("To use the trap, down and jump features, please "+ - "call record() first to start recording actions."); - }; - }); - - return saw; -}; - -function upgradeChainsaw(saw) { - saw.step = 0; - - // override pop - saw.pop = function () { - return saw.actions[saw.step++]; - }; - - saw.trap = function (name, cb) { - var ps = Array.isArray(name) ? name : [name]; - saw.actions.push({ - path : ps, - step : saw.step, - cb : cb, - trap : true - }); - }; - - saw.down = function (name) { - var ps = (Array.isArray(name) ? name : [name]).join('/'); - var i = saw.actions.slice(saw.step).map(function (x) { - if (x.trap && x.step <= saw.step) return false; - return x.path.join('/') == ps; - }).indexOf(true); - - if (i >= 0) saw.step += i; - else saw.step = saw.actions.length; - - var act = saw.actions[saw.step - 1]; - if (act && act.trap) { - // It's a trap! - saw.step = act.step; - act.cb(); - } - else saw.next(); - }; - - saw.jump = function (step) { - saw.step = step; - saw.next(); - }; -}; diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/.npmignore b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/.npmignore deleted file mode 100644 index 3c3629e647f..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/LICENSE b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/LICENSE deleted file mode 100644 index 7b75500c5e5..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -Copyright 2010 James Halliday (mail@substack.net) - -This project is free software released under the MIT/X11 license: -http://www.opensource.org/licenses/mit-license.php - -Copyright 2010 James Halliday (mail@substack.net) - -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/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/README.markdown b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/README.markdown deleted file mode 100644 index 5728639aa84..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/README.markdown +++ /dev/null @@ -1,247 +0,0 @@ -traverse -======== - -Traverse and transform objects by visiting every node on a recursive walk. - -examples -======== - -transform negative numbers in-place ------------------------------------ - -negative.js - -````javascript -var traverse = require('traverse'); -var obj = [ 5, 6, -3, [ 7, 8, -2, 1 ], { f : 10, g : -13 } ]; - -traverse(obj).forEach(function (x) { - if (x < 0) this.update(x + 128); -}); - -console.dir(obj); -```` - -Output: - - [ 5, 6, 125, [ 7, 8, 126, 1 ], { f: 10, g: 115 } ] - -collect leaf nodes ------------------- - -leaves.js - -````javascript -var traverse = require('traverse'); - -var obj = { - a : [1,2,3], - b : 4, - c : [5,6], - d : { e : [7,8], f : 9 }, -}; - -var leaves = traverse(obj).reduce(function (acc, x) { - if (this.isLeaf) acc.push(x); - return acc; -}, []); - -console.dir(leaves); -```` - -Output: - - [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ] - -context -======= - -Each method that takes a callback has a context (its `this` object) with these -attributes: - -this.node ---------- - -The present node on the recursive walk - -this.path ---------- - -An array of string keys from the root to the present node - -this.parent ------------ - -The context of the node's parent. -This is `undefined` for the root node. - -this.key --------- - -The name of the key of the present node in its parent. -This is `undefined` for the root node. - -this.isRoot, this.notRoot -------------------------- - -Whether the present node is the root node - -this.isLeaf, this.notLeaf -------------------------- - -Whether or not the present node is a leaf node (has no children) - -this.level ----------- - -Depth of the node within the traversal - -this.circular -------------- - -If the node equals one of its parents, the `circular` attribute is set to the -context of that parent and the traversal progresses no deeper. - -this.update(value) ------------------- - -Set a new value for the present node. - -this.remove() -------------- - -Remove the current element from the output. If the node is in an Array it will -be spliced off. Otherwise it will be deleted from its parent. - -this.delete() -------------- - -Delete the current element from its parent in the output. Calls `delete` even on -Arrays. - -this.before(fn) ---------------- - -Call this function before any of the children are traversed. - -this.after(fn) --------------- - -Call this function after any of the children are traversed. - -this.pre(fn) ------------- - -Call this function before each of the children are traversed. - -this.post(fn) -------------- - -Call this function after each of the children are traversed. - -methods -======= - -.map(fn) --------- - -Execute `fn` for each node in the object and return a new object with the -results of the walk. To update nodes in the result use `this.update(value)`. - -.forEach(fn) ------------- - -Execute `fn` for each node in the object but unlike `.map()`, when -`this.update()` is called it updates the object in-place. - -.reduce(fn, acc) ----------------- - -For each node in the object, perform a -[left-fold](http://en.wikipedia.org/wiki/Fold_(higher-order_function)) -with the return value of `fn(acc, node)`. - -If `acc` isn't specified, `acc` is set to the root object for the first step -and the root element is skipped. - -.deepEqual(obj) ---------------- - -Returns a boolean, whether the instance value is equal to the supplied object -along a deep traversal using some opinionated choices. - -Some notes: - -* RegExps are equal if their .toString()s match, but not functions since -functions can close over different variables. - -* Date instances are compared using `.getTime()` just like `assert.deepEqual()`. - -* Circular references must refer to the same paths within the data structure for -both objects. For instance, in this snippet: - -````javascript -var a = [1]; -a.push(a); // a = [ 1, *a ] - -var b = [1]; -b.push(a); // b = [ 1, [ 1, *a ] ] -```` - -`a` is not the same as `b` since even though the expansion is the same, the -circular references in each refer to different paths into the data structure. - -However, in: - -````javascript -var c = [1]; -c.push(c); // c = [ 1, *c ]; -```` - -`c` is equal to `a` in a `deepEqual()` because they have the same terminal node -structure. - -* Arguments objects are not arrays and neither are they the same as regular -objects. - -* Instances created with `new` of String, Boolean, and Number types are never -equal to the native versions. - -.paths() --------- - -Return an `Array` of every possible non-cyclic path in the object. -Paths are `Array`s of string keys. - -.nodes() --------- - -Return an `Array` of every node in the object. - -.clone() --------- - -Create a deep clone of the object. - -installation -============ - -Using npm: - npm install traverse - -Or check out the repository and link your development copy: - git clone http://github.com/substack/js-traverse.git - cd js-traverse - npm link . - -You can test traverse with "expresso":http://github.com/visionmedia/expresso -(`npm install expresso`): - js-traverse $ expresso - - 100% wahoo, your stuff is not broken! - -hash transforms -=============== - -This library formerly had a hash transformation component. It has been -[moved to the hashish package](https://github.com/substack/node-hashish). diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/examples/json.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/examples/json.js deleted file mode 100755 index f3bd989355b..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/examples/json.js +++ /dev/null @@ -1,16 +0,0 @@ -var Traverse = require('traverse'); - -var id = 54; -var callbacks = {}; -var obj = { moo : function () {}, foo : [2,3,4, function () {}] }; - -var scrubbed = Traverse(obj).map(function (x) { - if (typeof x === 'function') { - callbacks[id] = { id : id, f : x, path : this.path }; - this.update('[Function]'); - id++; - } -}); - -console.dir(scrubbed); -console.dir(callbacks); diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/examples/leaves.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/examples/leaves.js deleted file mode 100755 index ef5325fb1ec..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/examples/leaves.js +++ /dev/null @@ -1,15 +0,0 @@ -var Traverse = require('traverse'); - -var obj = { - a : [1,2,3], - b : 4, - c : [5,6], - d : { e : [7,8], f : 9 }, -}; - -var leaves = Traverse(obj).reduce(function (acc, x) { - if (this.isLeaf) acc.push(x); - return acc; -}, []); - -console.dir(leaves); diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/examples/negative.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/examples/negative.js deleted file mode 100755 index a3996c55fdf..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/examples/negative.js +++ /dev/null @@ -1,8 +0,0 @@ -var Traverse = require('traverse'); -var obj = [ 5, 6, -3, [ 7, 8, -2, 1 ], { f : 10, g : -13 } ]; - -Traverse(obj).forEach(function (x) { - if (x < 0) this.update(x + 128); -}); - -console.dir(obj); diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/examples/stringify.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/examples/stringify.js deleted file mode 100755 index 0cef7ece193..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/examples/stringify.js +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env node -var Traverse = require('traverse'); - -var obj = [ 'five', 6, -3, [ 7, 8, -2, 1 ], { f : 10, g : -13 } ]; - -var s = ''; -Traverse(obj).forEach(function to_s (node) { - if (Array.isArray(node)) { - this.before(function () { s += '[' }); - this.post(function (child) { - if (!child.isLast) s += ','; - }); - this.after(function () { s += ']' }); - } - else if (typeof node == 'object') { - this.before(function () { s += '{' }); - this.pre(function (x, key) { - to_s(key); - s += ':'; - }); - this.post(function (child) { - if (!child.isLast) s += ','; - }); - this.after(function () { s += '}' }); - } - else if (typeof node == 'string') { - s += '"' + node.toString().replace(/"/g, '\\"') + '"'; - } - else if (typeof node == 'function') { - s += 'null'; - } - else { - s += node.toString(); - } -}); - -console.log('JSON.stringify: ' + JSON.stringify(obj)); -console.log('this stringify: ' + s); diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/index.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/index.js deleted file mode 100755 index 7a34c8a05bb..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/index.js +++ /dev/null @@ -1,322 +0,0 @@ -module.exports = Traverse; -function Traverse (obj) { - if (!(this instanceof Traverse)) return new Traverse(obj); - this.value = obj; -} - -Traverse.prototype.get = function (ps) { - var node = this.value; - for (var i = 0; i < ps.length; i ++) { - var key = ps[i]; - if (!Object.hasOwnProperty.call(node, key)) { - node = undefined; - break; - } - node = node[key]; - } - return node; -}; - -Traverse.prototype.set = function (ps, value) { - var node = this.value; - for (var i = 0; i < ps.length - 1; i ++) { - var key = ps[i]; - if (!Object.hasOwnProperty.call(node, key)) node[key] = {}; - node = node[key]; - } - node[ps[i]] = value; - return value; -}; - -Traverse.prototype.map = function (cb) { - return walk(this.value, cb, true); -}; - -Traverse.prototype.forEach = function (cb) { - this.value = walk(this.value, cb, false); - return this.value; -}; - -Traverse.prototype.reduce = function (cb, init) { - var skip = arguments.length === 1; - var acc = skip ? this.value : init; - this.forEach(function (x) { - if (!this.isRoot || !skip) { - acc = cb.call(this, acc, x); - } - }); - return acc; -}; - -Traverse.prototype.deepEqual = function (obj) { - if (arguments.length !== 1) { - throw new Error( - 'deepEqual requires exactly one object to compare against' - ); - } - - var equal = true; - var node = obj; - - this.forEach(function (y) { - var notEqual = (function () { - equal = false; - //this.stop(); - return undefined; - }).bind(this); - - //if (node === undefined || node === null) return notEqual(); - - if (!this.isRoot) { - /* - if (!Object.hasOwnProperty.call(node, this.key)) { - return notEqual(); - } - */ - if (typeof node !== 'object') return notEqual(); - node = node[this.key]; - } - - var x = node; - - this.post(function () { - node = x; - }); - - var toS = function (o) { - return Object.prototype.toString.call(o); - }; - - if (this.circular) { - if (Traverse(obj).get(this.circular.path) !== x) notEqual(); - } - else if (typeof x !== typeof y) { - notEqual(); - } - else if (x === null || y === null || x === undefined || y === undefined) { - if (x !== y) notEqual(); - } - else if (x.__proto__ !== y.__proto__) { - notEqual(); - } - else if (x === y) { - // nop - } - else if (typeof x === 'function') { - if (x instanceof RegExp) { - // both regexps on account of the __proto__ check - if (x.toString() != y.toString()) notEqual(); - } - else if (x !== y) notEqual(); - } - else if (typeof x === 'object') { - if (toS(y) === '[object Arguments]' - || toS(x) === '[object Arguments]') { - if (toS(x) !== toS(y)) { - notEqual(); - } - } - else if (x instanceof Date || y instanceof Date) { - if (!(x instanceof Date) || !(y instanceof Date) - || x.getTime() !== y.getTime()) { - notEqual(); - } - } - else { - var kx = Object.keys(x); - var ky = Object.keys(y); - if (kx.length !== ky.length) return notEqual(); - for (var i = 0; i < kx.length; i++) { - var k = kx[i]; - if (!Object.hasOwnProperty.call(y, k)) { - notEqual(); - } - } - } - } - }); - - return equal; -}; - -Traverse.prototype.paths = function () { - var acc = []; - this.forEach(function (x) { - acc.push(this.path); - }); - return acc; -}; - -Traverse.prototype.nodes = function () { - var acc = []; - this.forEach(function (x) { - acc.push(this.node); - }); - return acc; -}; - -Traverse.prototype.clone = function () { - var parents = [], nodes = []; - - return (function clone (src) { - for (var i = 0; i < parents.length; i++) { - if (parents[i] === src) { - return nodes[i]; - } - } - - if (typeof src === 'object' && src !== null) { - var dst = copy(src); - - parents.push(src); - nodes.push(dst); - - Object.keys(src).forEach(function (key) { - dst[key] = clone(src[key]); - }); - - parents.pop(); - nodes.pop(); - return dst; - } - else { - return src; - } - })(this.value); -}; - -function walk (root, cb, immutable) { - var path = []; - var parents = []; - var alive = true; - - return (function walker (node_) { - var node = immutable ? copy(node_) : node_; - var modifiers = {}; - - var state = { - node : node, - node_ : node_, - path : [].concat(path), - parent : parents.slice(-1)[0], - key : path.slice(-1)[0], - isRoot : path.length === 0, - level : path.length, - circular : null, - update : function (x) { - if (!state.isRoot) { - state.parent.node[state.key] = x; - } - state.node = x; - }, - 'delete' : function () { - delete state.parent.node[state.key]; - }, - remove : function () { - if (Array.isArray(state.parent.node)) { - state.parent.node.splice(state.key, 1); - } - else { - delete state.parent.node[state.key]; - } - }, - before : function (f) { modifiers.before = f }, - after : function (f) { modifiers.after = f }, - pre : function (f) { modifiers.pre = f }, - post : function (f) { modifiers.post = f }, - stop : function () { alive = false } - }; - - if (!alive) return state; - - if (typeof node === 'object' && node !== null) { - state.isLeaf = Object.keys(node).length == 0; - - for (var i = 0; i < parents.length; i++) { - if (parents[i].node_ === node_) { - state.circular = parents[i]; - break; - } - } - } - else { - state.isLeaf = true; - } - - state.notLeaf = !state.isLeaf; - state.notRoot = !state.isRoot; - - // use return values to update if defined - var ret = cb.call(state, state.node); - if (ret !== undefined && state.update) state.update(ret); - if (modifiers.before) modifiers.before.call(state, state.node); - - if (typeof state.node == 'object' - && state.node !== null && !state.circular) { - parents.push(state); - - var keys = Object.keys(state.node); - keys.forEach(function (key, i) { - path.push(key); - - if (modifiers.pre) modifiers.pre.call(state, state.node[key], key); - - var child = walker(state.node[key]); - if (immutable && Object.hasOwnProperty.call(state.node, key)) { - state.node[key] = child.node; - } - - child.isLast = i == keys.length - 1; - child.isFirst = i == 0; - - if (modifiers.post) modifiers.post.call(state, child); - - path.pop(); - }); - parents.pop(); - } - - if (modifiers.after) modifiers.after.call(state, state.node); - - return state; - })(root).node; -} - -Object.keys(Traverse.prototype).forEach(function (key) { - Traverse[key] = function (obj) { - var args = [].slice.call(arguments, 1); - var t = Traverse(obj); - return t[key].apply(t, args); - }; -}); - -function copy (src) { - if (typeof src === 'object' && src !== null) { - var dst; - - if (Array.isArray(src)) { - dst = []; - } - else if (src instanceof Date) { - dst = new Date(src); - } - else if (src instanceof Boolean) { - dst = new Boolean(src); - } - else if (src instanceof Number) { - dst = new Number(src); - } - else if (src instanceof String) { - dst = new String(src); - } - else { - dst = Object.create(Object.getPrototypeOf(src)); - } - - Object.keys(src).forEach(function (key) { - dst[key] = src[key]; - }); - return dst; - } - else return src; -} diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/package.json b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/package.json deleted file mode 100644 index d61c0c00a5f..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/package.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "traverse", - "version": "0.3.9", - "description": "Traverse and transform objects by visiting every node on a recursive walk", - "author": { - "name": "James Halliday" - }, - "license": "MIT/X11", - "main": "./index", - "repository": { - "type": "git", - "url": "http://github.com/substack/js-traverse.git" - }, - "devDependencies": { - "expresso": "0.7.x" - }, - "scripts": { - "test": "expresso" - }, - "readme": "traverse\n========\n\nTraverse and transform objects by visiting every node on a recursive walk.\n\nexamples\n========\n\ntransform negative numbers in-place\n-----------------------------------\n\nnegative.js\n\n````javascript\nvar traverse = require('traverse');\nvar obj = [ 5, 6, -3, [ 7, 8, -2, 1 ], { f : 10, g : -13 } ];\n\ntraverse(obj).forEach(function (x) {\n if (x < 0) this.update(x + 128);\n});\n\nconsole.dir(obj);\n````\n\nOutput:\n\n [ 5, 6, 125, [ 7, 8, 126, 1 ], { f: 10, g: 115 } ]\n\ncollect leaf nodes\n------------------\n\nleaves.js\n\n````javascript\nvar traverse = require('traverse');\n\nvar obj = {\n a : [1,2,3],\n b : 4,\n c : [5,6],\n d : { e : [7,8], f : 9 },\n};\n\nvar leaves = traverse(obj).reduce(function (acc, x) {\n if (this.isLeaf) acc.push(x);\n return acc;\n}, []);\n\nconsole.dir(leaves);\n````\n\nOutput:\n\n [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ]\n\ncontext\n=======\n\nEach method that takes a callback has a context (its `this` object) with these\nattributes:\n\nthis.node\n---------\n\nThe present node on the recursive walk\n\nthis.path\n---------\n\nAn array of string keys from the root to the present node\n\nthis.parent\n-----------\n\nThe context of the node's parent.\nThis is `undefined` for the root node.\n\nthis.key\n--------\n\nThe name of the key of the present node in its parent.\nThis is `undefined` for the root node.\n\nthis.isRoot, this.notRoot\n-------------------------\n\nWhether the present node is the root node\n\nthis.isLeaf, this.notLeaf\n-------------------------\n\nWhether or not the present node is a leaf node (has no children)\n\nthis.level\n----------\n\nDepth of the node within the traversal\n\nthis.circular\n-------------\n\nIf the node equals one of its parents, the `circular` attribute is set to the\ncontext of that parent and the traversal progresses no deeper.\n\nthis.update(value)\n------------------\n\nSet a new value for the present node.\n\nthis.remove()\n-------------\n\nRemove the current element from the output. If the node is in an Array it will\nbe spliced off. Otherwise it will be deleted from its parent.\n\nthis.delete()\n-------------\n\nDelete the current element from its parent in the output. Calls `delete` even on\nArrays.\n\nthis.before(fn)\n---------------\n\nCall this function before any of the children are traversed.\n\nthis.after(fn)\n--------------\n\nCall this function after any of the children are traversed.\n\nthis.pre(fn)\n------------\n\nCall this function before each of the children are traversed.\n\nthis.post(fn)\n-------------\n\nCall this function after each of the children are traversed.\n\nmethods\n=======\n\n.map(fn)\n--------\n\nExecute `fn` for each node in the object and return a new object with the\nresults of the walk. To update nodes in the result use `this.update(value)`.\n\n.forEach(fn)\n------------\n\nExecute `fn` for each node in the object but unlike `.map()`, when\n`this.update()` is called it updates the object in-place.\n\n.reduce(fn, acc)\n----------------\n\nFor each node in the object, perform a\n[left-fold](http://en.wikipedia.org/wiki/Fold_(higher-order_function))\nwith the return value of `fn(acc, node)`.\n\nIf `acc` isn't specified, `acc` is set to the root object for the first step\nand the root element is skipped.\n\n.deepEqual(obj)\n---------------\n\nReturns a boolean, whether the instance value is equal to the supplied object\nalong a deep traversal using some opinionated choices.\n\nSome notes:\n\n* RegExps are equal if their .toString()s match, but not functions since\nfunctions can close over different variables.\n\n* Date instances are compared using `.getTime()` just like `assert.deepEqual()`.\n\n* Circular references must refer to the same paths within the data structure for\nboth objects. For instance, in this snippet:\n\n````javascript\nvar a = [1];\na.push(a); // a = [ 1, *a ]\n\nvar b = [1];\nb.push(a); // b = [ 1, [ 1, *a ] ]\n````\n\n`a` is not the same as `b` since even though the expansion is the same, the\ncircular references in each refer to different paths into the data structure.\n\nHowever, in:\n\n````javascript\nvar c = [1];\nc.push(c); // c = [ 1, *c ];\n````\n\n`c` is equal to `a` in a `deepEqual()` because they have the same terminal node\nstructure.\n\n* Arguments objects are not arrays and neither are they the same as regular\nobjects.\n\n* Instances created with `new` of String, Boolean, and Number types are never\nequal to the native versions.\n\n.paths()\n--------\n\nReturn an `Array` of every possible non-cyclic path in the object.\nPaths are `Array`s of string keys.\n\n.nodes()\n--------\n\nReturn an `Array` of every node in the object.\n\n.clone()\n--------\n\nCreate a deep clone of the object.\n\ninstallation\n============\n\nUsing npm:\n npm install traverse\n\nOr check out the repository and link your development copy:\n git clone http://github.com/substack/js-traverse.git\n cd js-traverse\n npm link .\n\nYou can test traverse with \"expresso\":http://github.com/visionmedia/expresso\n(`npm install expresso`):\n js-traverse $ expresso\n \n 100% wahoo, your stuff is not broken!\n\nhash transforms\n===============\n\nThis library formerly had a hash transformation component. It has been\n[moved to the hashish package](https://github.com/substack/node-hashish).\n", - "readmeFilename": "README.markdown", - "bugs": { - "url": "https://github.com/substack/js-traverse/issues" - }, - "_id": "traverse@0.3.9", - "_from": "traverse@>=0.3.0 <0.4" -} diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/test/circular.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/test/circular.js deleted file mode 100644 index e1eef3f86a4..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/test/circular.js +++ /dev/null @@ -1,114 +0,0 @@ -var assert = require('assert'); -var Traverse = require('traverse'); -var util = require('util'); - -exports.circular = function () { - var obj = { x : 3 }; - obj.y = obj; - var foundY = false; - Traverse(obj).forEach(function (x) { - if (this.path.join('') == 'y') { - assert.equal( - util.inspect(this.circular.node), - util.inspect(obj) - ); - foundY = true; - } - }); - assert.ok(foundY); -}; - -exports.deepCirc = function () { - var obj = { x : [ 1, 2, 3 ], y : [ 4, 5 ] }; - obj.y[2] = obj; - - var times = 0; - Traverse(obj).forEach(function (x) { - if (this.circular) { - assert.deepEqual(this.circular.path, []); - assert.deepEqual(this.path, [ 'y', 2 ]); - times ++; - } - }); - - assert.deepEqual(times, 1); -}; - -exports.doubleCirc = function () { - var obj = { x : [ 1, 2, 3 ], y : [ 4, 5 ] }; - obj.y[2] = obj; - obj.x.push(obj.y); - - var circs = []; - Traverse(obj).forEach(function (x) { - if (this.circular) { - circs.push({ circ : this.circular, self : this, node : x }); - } - }); - - assert.deepEqual(circs[0].self.path, [ 'x', 3, 2 ]); - assert.deepEqual(circs[0].circ.path, []); - - assert.deepEqual(circs[1].self.path, [ 'y', 2 ]); - assert.deepEqual(circs[1].circ.path, []); - - assert.deepEqual(circs.length, 2); -}; - -exports.circDubForEach = function () { - var obj = { x : [ 1, 2, 3 ], y : [ 4, 5 ] }; - obj.y[2] = obj; - obj.x.push(obj.y); - - Traverse(obj).forEach(function (x) { - if (this.circular) this.update('...'); - }); - - assert.deepEqual(obj, { x : [ 1, 2, 3, [ 4, 5, '...' ] ], y : [ 4, 5, '...' ] }); -}; - -exports.circDubMap = function () { - var obj = { x : [ 1, 2, 3 ], y : [ 4, 5 ] }; - obj.y[2] = obj; - obj.x.push(obj.y); - - var c = Traverse(obj).map(function (x) { - if (this.circular) { - this.update('...'); - } - }); - - assert.deepEqual(c, { x : [ 1, 2, 3, [ 4, 5, '...' ] ], y : [ 4, 5, '...' ] }); -}; - -exports.circClone = function () { - var obj = { x : [ 1, 2, 3 ], y : [ 4, 5 ] }; - obj.y[2] = obj; - obj.x.push(obj.y); - - var clone = Traverse.clone(obj); - assert.ok(obj !== clone); - - assert.ok(clone.y[2] === clone); - assert.ok(clone.y[2] !== obj); - assert.ok(clone.x[3][2] === clone); - assert.ok(clone.x[3][2] !== obj); - assert.deepEqual(clone.x.slice(0,3), [1,2,3]); - assert.deepEqual(clone.y.slice(0,2), [4,5]); -}; - -exports.circMapScrub = function () { - var obj = { a : 1, b : 2 }; - obj.c = obj; - - var scrubbed = Traverse(obj).map(function (node) { - if (this.circular) this.remove(); - }); - assert.deepEqual( - Object.keys(scrubbed).sort(), - [ 'a', 'b' ] - ); - assert.ok(Traverse.deepEqual(scrubbed, { a : 1, b : 2 })); - - assert.equal(obj.c, obj); -}; diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/test/date.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/test/date.js deleted file mode 100644 index 2cb825257e0..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/test/date.js +++ /dev/null @@ -1,35 +0,0 @@ -var assert = require('assert'); -var Traverse = require('traverse'); - -exports.dateEach = function () { - var obj = { x : new Date, y : 10, z : 5 }; - - var counts = {}; - - Traverse(obj).forEach(function (node) { - var t = (node instanceof Date && 'Date') || typeof node; - counts[t] = (counts[t] || 0) + 1; - }); - - assert.deepEqual(counts, { - object : 1, - Date : 1, - number : 2, - }); -}; - -exports.dateMap = function () { - var obj = { x : new Date, y : 10, z : 5 }; - - var res = Traverse(obj).map(function (node) { - if (typeof node === 'number') this.update(node + 100); - }); - - assert.ok(obj.x !== res.x); - assert.deepEqual(res, { - x : obj.x, - y : 110, - z : 105, - }); -}; - diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/test/equal.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/test/equal.js deleted file mode 100644 index 4d732fab1b6..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/test/equal.js +++ /dev/null @@ -1,219 +0,0 @@ -var assert = require('assert'); -var traverse = require('traverse'); - -exports.deepDates = function () { - assert.ok( - traverse.deepEqual( - { d : new Date, x : [ 1, 2, 3 ] }, - { d : new Date, x : [ 1, 2, 3 ] } - ), - 'dates should be equal' - ); - - var d0 = new Date; - setTimeout(function () { - assert.ok( - !traverse.deepEqual( - { d : d0, x : [ 1, 2, 3 ], }, - { d : new Date, x : [ 1, 2, 3 ] } - ), - 'microseconds should count in date equality' - ); - }, 5); -}; - -exports.deepCircular = function () { - var a = [1]; - a.push(a); // a = [ 1, *a ] - - var b = [1]; - b.push(a); // b = [ 1, [ 1, *a ] ] - - assert.ok( - !traverse.deepEqual(a, b), - 'circular ref mount points count towards equality' - ); - - var c = [1]; - c.push(c); // c = [ 1, *c ] - assert.ok( - traverse.deepEqual(a, c), - 'circular refs are structurally the same here' - ); - - var d = [1]; - d.push(a); // c = [ 1, [ 1, *d ] ] - assert.ok( - traverse.deepEqual(b, d), - 'non-root circular ref structural comparison' - ); -}; - -exports.deepInstances = function () { - assert.ok( - !traverse.deepEqual([ new Boolean(false) ], [ false ]), - 'boolean instances are not real booleans' - ); - - assert.ok( - !traverse.deepEqual([ new String('x') ], [ 'x' ]), - 'string instances are not real strings' - ); - - assert.ok( - !traverse.deepEqual([ new Number(4) ], [ 4 ]), - 'number instances are not real numbers' - ); - - assert.ok( - traverse.deepEqual([ new RegExp('x') ], [ /x/ ]), - 'regexp instances are real regexps' - ); - - assert.ok( - !traverse.deepEqual([ new RegExp(/./) ], [ /../ ]), - 'these regexps aren\'t the same' - ); - - assert.ok( - !traverse.deepEqual( - [ function (x) { return x * 2 } ], - [ function (x) { return x * 2 } ] - ), - 'functions with the same .toString() aren\'t necessarily the same' - ); - - var f = function (x) { return x * 2 }; - assert.ok( - traverse.deepEqual([ f ], [ f ]), - 'these functions are actually equal' - ); -}; - -exports.deepEqual = function () { - assert.ok( - !traverse.deepEqual([ 1, 2, 3 ], { 0 : 1, 1 : 2, 2 : 3 }), - 'arrays are not objects' - ); -}; - -exports.falsy = function () { - assert.ok( - !traverse.deepEqual([ undefined ], [ null ]), - 'null is not undefined!' - ); - - assert.ok( - !traverse.deepEqual([ null ], [ undefined ]), - 'undefined is not null!' - ); - - assert.ok( - !traverse.deepEqual( - { a : 1, b : 2, c : [ 3, undefined, 5 ] }, - { a : 1, b : 2, c : [ 3, null, 5 ] } - ), - 'undefined is not null, however deeply!' - ); - - assert.ok( - !traverse.deepEqual( - { a : 1, b : 2, c : [ 3, undefined, 5 ] }, - { a : 1, b : 2, c : [ 3, null, 5 ] } - ), - 'null is not undefined, however deeply!' - ); - - assert.ok( - !traverse.deepEqual( - { a : 1, b : 2, c : [ 3, undefined, 5 ] }, - { a : 1, b : 2, c : [ 3, null, 5 ] } - ), - 'null is not undefined, however deeply!' - ); -}; - -exports.deletedArrayEqual = function () { - var xs = [ 1, 2, 3, 4 ]; - delete xs[2]; - - var ys = Object.create(Array.prototype); - ys[0] = 1; - ys[1] = 2; - ys[3] = 4; - - assert.ok( - traverse.deepEqual(xs, ys), - 'arrays with deleted elements are only equal to' - + ' arrays with similarly deleted elements' - ); - - assert.ok( - !traverse.deepEqual(xs, [ 1, 2, undefined, 4 ]), - 'deleted array elements cannot be undefined' - ); - - assert.ok( - !traverse.deepEqual(xs, [ 1, 2, null, 4 ]), - 'deleted array elements cannot be null' - ); -}; - -exports.deletedObjectEqual = function () { - var obj = { a : 1, b : 2, c : 3 }; - delete obj.c; - - assert.ok( - traverse.deepEqual(obj, { a : 1, b : 2 }), - 'deleted object elements should not show up' - ); - - assert.ok( - !traverse.deepEqual(obj, { a : 1, b : 2, c : undefined }), - 'deleted object elements are not undefined' - ); - - assert.ok( - !traverse.deepEqual(obj, { a : 1, b : 2, c : null }), - 'deleted object elements are not null' - ); -}; - -exports.emptyKeyEqual = function () { - assert.ok(!traverse.deepEqual( - { a : 1 }, { a : 1, '' : 55 } - )); -}; - -exports.deepArguments = function () { - assert.ok( - !traverse.deepEqual( - [ 4, 5, 6 ], - (function () { return arguments })(4, 5, 6) - ), - 'arguments are not arrays' - ); - - assert.ok( - traverse.deepEqual( - (function () { return arguments })(4, 5, 6), - (function () { return arguments })(4, 5, 6) - ), - 'arguments should equal' - ); -}; - -exports.deepUn = function () { - assert.ok(!traverse.deepEqual({ a : 1, b : 2 }, undefined)); - assert.ok(!traverse.deepEqual({ a : 1, b : 2 }, {})); - assert.ok(!traverse.deepEqual(undefined, { a : 1, b : 2 })); - assert.ok(!traverse.deepEqual({}, { a : 1, b : 2 })); - assert.ok(traverse.deepEqual(undefined, undefined)); - assert.ok(traverse.deepEqual(null, null)); - assert.ok(!traverse.deepEqual(undefined, null)); -}; - -exports.deepLevels = function () { - var xs = [ 1, 2, [ 3, 4, [ 5, 6 ] ] ]; - assert.ok(!traverse.deepEqual(xs, [])); -}; diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/test/instance.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/test/instance.js deleted file mode 100644 index 501981ff0ca..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/test/instance.js +++ /dev/null @@ -1,17 +0,0 @@ -var assert = require('assert'); -var Traverse = require('traverse'); -var EventEmitter = require('events').EventEmitter; - -exports['check instanceof on node elems'] = function () { - - var counts = { emitter : 0 }; - - Traverse([ new EventEmitter, 3, 4, { ev : new EventEmitter }]) - .forEach(function (node) { - if (node instanceof EventEmitter) counts.emitter ++; - }) - ; - - assert.equal(counts.emitter, 2); -}; - diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/test/interface.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/test/interface.js deleted file mode 100644 index df5b037d205..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/test/interface.js +++ /dev/null @@ -1,42 +0,0 @@ -var assert = require('assert'); -var Traverse = require('traverse'); - -exports['interface map'] = function () { - var obj = { a : [ 5,6,7 ], b : { c : [8] } }; - - assert.deepEqual( - Traverse.paths(obj) - .sort() - .map(function (path) { return path.join('/') }) - .slice(1) - .join(' ') - , - 'a a/0 a/1 a/2 b b/c b/c/0' - ); - - assert.deepEqual( - Traverse.nodes(obj), - [ - { a: [ 5, 6, 7 ], b: { c: [ 8 ] } }, - [ 5, 6, 7 ], 5, 6, 7, - { c: [ 8 ] }, [ 8 ], 8 - ] - ); - - assert.deepEqual( - Traverse.map(obj, function (node) { - if (typeof node == 'number') { - return node + 1000; - } - else if (Array.isArray(node)) { - return node.join(' '); - } - }), - { a: '5 6 7', b: { c: '8' } } - ); - - var nodes = 0; - Traverse.forEach(obj, function (node) { nodes ++ }); - assert.deepEqual(nodes, 8); -}; - diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/test/json.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/test/json.js deleted file mode 100644 index bf366204295..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/test/json.js +++ /dev/null @@ -1,47 +0,0 @@ -var assert = require('assert'); -var Traverse = require('traverse'); - -exports['json test'] = function () { - var id = 54; - var callbacks = {}; - var obj = { moo : function () {}, foo : [2,3,4, function () {}] }; - - var scrubbed = Traverse(obj).map(function (x) { - if (typeof x === 'function') { - callbacks[id] = { id : id, f : x, path : this.path }; - this.update('[Function]'); - id++; - } - }); - - assert.equal( - scrubbed.moo, '[Function]', - 'obj.moo replaced with "[Function]"' - ); - - assert.equal( - scrubbed.foo[3], '[Function]', - 'obj.foo[3] replaced with "[Function]"' - ); - - assert.deepEqual(scrubbed, { - moo : '[Function]', - foo : [ 2, 3, 4, "[Function]" ] - }, 'Full JSON string matches'); - - assert.deepEqual( - typeof obj.moo, 'function', - 'Original obj.moo still a function' - ); - - assert.deepEqual( - typeof obj.foo[3], 'function', - 'Original obj.foo[3] still a function' - ); - - assert.deepEqual(callbacks, { - 54: { id: 54, f : obj.moo, path: [ 'moo' ] }, - 55: { id: 55, f : obj.foo[3], path: [ 'foo', '3' ] }, - }, 'Check the generated callbacks list'); -}; - diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/test/leaves.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/test/leaves.js deleted file mode 100644 index 4e8d2801cf9..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/test/leaves.js +++ /dev/null @@ -1,21 +0,0 @@ -var assert = require('assert'); -var Traverse = require('traverse'); - -exports['leaves test'] = function () { - var acc = []; - Traverse({ - a : [1,2,3], - b : 4, - c : [5,6], - d : { e : [7,8], f : 9 } - }).forEach(function (x) { - if (this.isLeaf) acc.push(x); - }); - - assert.equal( - acc.join(' '), - '1 2 3 4 5 6 7 8 9', - 'Traversal in the right(?) order' - ); -}; - diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/test/mutability.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/test/mutability.js deleted file mode 100644 index 5a4d6dd0bea..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/test/mutability.js +++ /dev/null @@ -1,203 +0,0 @@ -var assert = require('assert'); -var Traverse = require('traverse'); - -exports.mutate = function () { - var obj = { a : 1, b : 2, c : [ 3, 4 ] }; - var res = Traverse(obj).forEach(function (x) { - if (typeof x === 'number' && x % 2 === 0) { - this.update(x * 10); - } - }); - assert.deepEqual(obj, res); - assert.deepEqual(obj, { a : 1, b : 20, c : [ 3, 40 ] }); -}; - -exports.mutateT = function () { - var obj = { a : 1, b : 2, c : [ 3, 4 ] }; - var res = Traverse.forEach(obj, function (x) { - if (typeof x === 'number' && x % 2 === 0) { - this.update(x * 10); - } - }); - assert.deepEqual(obj, res); - assert.deepEqual(obj, { a : 1, b : 20, c : [ 3, 40 ] }); -}; - -exports.map = function () { - var obj = { a : 1, b : 2, c : [ 3, 4 ] }; - var res = Traverse(obj).map(function (x) { - if (typeof x === 'number' && x % 2 === 0) { - this.update(x * 10); - } - }); - assert.deepEqual(obj, { a : 1, b : 2, c : [ 3, 4 ] }); - assert.deepEqual(res, { a : 1, b : 20, c : [ 3, 40 ] }); -}; - -exports.mapT = function () { - var obj = { a : 1, b : 2, c : [ 3, 4 ] }; - var res = Traverse.map(obj, function (x) { - if (typeof x === 'number' && x % 2 === 0) { - this.update(x * 10); - } - }); - assert.deepEqual(obj, { a : 1, b : 2, c : [ 3, 4 ] }); - assert.deepEqual(res, { a : 1, b : 20, c : [ 3, 40 ] }); -}; - -exports.clone = function () { - var obj = { a : 1, b : 2, c : [ 3, 4 ] }; - var res = Traverse(obj).clone(); - assert.deepEqual(obj, res); - assert.ok(obj !== res); - obj.a ++; - assert.deepEqual(res.a, 1); - obj.c.push(5); - assert.deepEqual(res.c, [ 3, 4 ]); -}; - -exports.cloneT = function () { - var obj = { a : 1, b : 2, c : [ 3, 4 ] }; - var res = Traverse.clone(obj); - assert.deepEqual(obj, res); - assert.ok(obj !== res); - obj.a ++; - assert.deepEqual(res.a, 1); - obj.c.push(5); - assert.deepEqual(res.c, [ 3, 4 ]); -}; - -exports.reduce = function () { - var obj = { a : 1, b : 2, c : [ 3, 4 ] }; - var res = Traverse(obj).reduce(function (acc, x) { - if (this.isLeaf) acc.push(x); - return acc; - }, []); - assert.deepEqual(obj, { a : 1, b : 2, c : [ 3, 4 ] }); - assert.deepEqual(res, [ 1, 2, 3, 4 ]); -}; - -exports.reduceInit = function () { - var obj = { a : 1, b : 2, c : [ 3, 4 ] }; - var res = Traverse(obj).reduce(function (acc, x) { - if (this.isRoot) assert.fail('got root'); - return acc; - }); - assert.deepEqual(obj, { a : 1, b : 2, c : [ 3, 4 ] }); - assert.deepEqual(res, obj); -}; - -exports.remove = function () { - var obj = { a : 1, b : 2, c : [ 3, 4 ] }; - Traverse(obj).forEach(function (x) { - if (this.isLeaf && x % 2 == 0) this.remove(); - }); - - assert.deepEqual(obj, { a : 1, c : [ 3 ] }); -}; - -exports.removeMap = function () { - var obj = { a : 1, b : 2, c : [ 3, 4 ] }; - var res = Traverse(obj).map(function (x) { - if (this.isLeaf && x % 2 == 0) this.remove(); - }); - - assert.deepEqual(obj, { a : 1, b : 2, c : [ 3, 4 ] }); - assert.deepEqual(res, { a : 1, c : [ 3 ] }); -}; - -exports.delete = function () { - var obj = { a : 1, b : 2, c : [ 3, 4 ] }; - Traverse(obj).forEach(function (x) { - if (this.isLeaf && x % 2 == 0) this.delete(); - }); - - assert.ok(!Traverse.deepEqual( - obj, { a : 1, c : [ 3, undefined ] } - )); - - assert.ok(Traverse.deepEqual( - obj, { a : 1, c : [ 3 ] } - )); - - assert.ok(!Traverse.deepEqual( - obj, { a : 1, c : [ 3, null ] } - )); -}; - -exports.deleteRedux = function () { - var obj = { a : 1, b : 2, c : [ 3, 4, 5 ] }; - Traverse(obj).forEach(function (x) { - if (this.isLeaf && x % 2 == 0) this.delete(); - }); - - assert.ok(!Traverse.deepEqual( - obj, { a : 1, c : [ 3, undefined, 5 ] } - )); - - assert.ok(Traverse.deepEqual( - obj, { a : 1, c : [ 3 ,, 5 ] } - )); - - assert.ok(!Traverse.deepEqual( - obj, { a : 1, c : [ 3, null, 5 ] } - )); - - assert.ok(!Traverse.deepEqual( - obj, { a : 1, c : [ 3, 5 ] } - )); -}; - -exports.deleteMap = function () { - var obj = { a : 1, b : 2, c : [ 3, 4 ] }; - var res = Traverse(obj).map(function (x) { - if (this.isLeaf && x % 2 == 0) this.delete(); - }); - - assert.ok(Traverse.deepEqual( - obj, - { a : 1, b : 2, c : [ 3, 4 ] } - )); - - var xs = [ 3, 4 ]; - delete xs[1]; - - assert.ok(Traverse.deepEqual( - res, { a : 1, c : xs } - )); - - assert.ok(Traverse.deepEqual( - res, { a : 1, c : [ 3, ] } - )); - - assert.ok(Traverse.deepEqual( - res, { a : 1, c : [ 3 ] } - )); -}; - -exports.deleteMapRedux = function () { - var obj = { a : 1, b : 2, c : [ 3, 4, 5 ] }; - var res = Traverse(obj).map(function (x) { - if (this.isLeaf && x % 2 == 0) this.delete(); - }); - - assert.ok(Traverse.deepEqual( - obj, - { a : 1, b : 2, c : [ 3, 4, 5 ] } - )); - - var xs = [ 3, 4, 5 ]; - delete xs[1]; - - assert.ok(Traverse.deepEqual( - res, { a : 1, c : xs } - )); - - assert.ok(!Traverse.deepEqual( - res, { a : 1, c : [ 3, 5 ] } - )); - - assert.ok(Traverse.deepEqual( - res, { a : 1, c : [ 3 ,, 5 ] } - )); -}; diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/test/negative.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/test/negative.js deleted file mode 100644 index 6cf287d6173..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/test/negative.js +++ /dev/null @@ -1,20 +0,0 @@ -var Traverse = require('traverse'); -var assert = require('assert'); - -exports['negative update test'] = function () { - var obj = [ 5, 6, -3, [ 7, 8, -2, 1 ], { f : 10, g : -13 } ]; - var fixed = Traverse.map(obj, function (x) { - if (x < 0) this.update(x + 128); - }); - - assert.deepEqual(fixed, - [ 5, 6, 125, [ 7, 8, 126, 1 ], { f: 10, g: 115 } ], - 'Negative values += 128' - ); - - assert.deepEqual(obj, - [ 5, 6, -3, [ 7, 8, -2, 1 ], { f: 10, g: -13 } ], - 'Original references not modified' - ); -} - diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/test/obj.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/test/obj.js deleted file mode 100644 index 9c3b0db5670..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/test/obj.js +++ /dev/null @@ -1,15 +0,0 @@ -var assert = require('assert'); -var Traverse = require('traverse'); - -exports['traverse an object with nested functions'] = function () { - var to = setTimeout(function () { - assert.fail('never ran'); - }, 1000); - - function Cons (x) { - clearTimeout(to); - assert.equal(x, 10); - }; - Traverse(new Cons(10)); -}; - diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/test/stop.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/test/stop.js deleted file mode 100644 index ef6b36e55ad..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/test/stop.js +++ /dev/null @@ -1,41 +0,0 @@ -var assert = require('assert'); -var traverse = require('traverse'); - -exports.stop = function () { - var visits = 0; - traverse('abcdefghij'.split('')).forEach(function (node) { - if (typeof node === 'string') { - visits ++; - if (node === 'e') this.stop() - } - }); - - assert.equal(visits, 5); -}; - -exports.stopMap = function () { - var s = traverse('abcdefghij'.split('')).map(function (node) { - if (typeof node === 'string') { - if (node === 'e') this.stop() - return node.toUpperCase(); - } - }).join(''); - - assert.equal(s, 'ABCDEfghij'); -}; - -exports.stopReduce = function () { - var obj = { - a : [ 4, 5 ], - b : [ 6, [ 7, 8, 9 ] ] - }; - var xs = traverse(obj).reduce(function (acc, node) { - if (this.isLeaf) { - if (node === 7) this.stop(); - else acc.push(node) - } - return acc; - }, []); - - assert.deepEqual(xs, [ 4, 5, 6 ]); -}; diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/test/stringify.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/test/stringify.js deleted file mode 100644 index bf36f6354b3..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/test/stringify.js +++ /dev/null @@ -1,36 +0,0 @@ -var assert = require('assert'); -var Traverse = require('traverse'); - -exports.stringify = function () { - var obj = [ 5, 6, -3, [ 7, 8, -2, 1 ], { f : 10, g : -13 } ]; - - var s = ''; - Traverse(obj).forEach(function (node) { - if (Array.isArray(node)) { - this.before(function () { s += '[' }); - this.post(function (child) { - if (!child.isLast) s += ','; - }); - this.after(function () { s += ']' }); - } - else if (typeof node == 'object') { - this.before(function () { s += '{' }); - this.pre(function (x, key) { - s += '"' + key + '"' + ':'; - }); - this.post(function (child) { - if (!child.isLast) s += ','; - }); - this.after(function () { s += '}' }); - } - else if (typeof node == 'function') { - s += 'null'; - } - else { - s += node.toString(); - } - }); - - assert.equal(s, JSON.stringify(obj)); -} - diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/test/super_deep.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/test/super_deep.js deleted file mode 100644 index 974181e3124..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/node_modules/traverse/test/super_deep.js +++ /dev/null @@ -1,54 +0,0 @@ -var assert = require('assert'); -var traverse = require('traverse'); - -exports.super_deep = function () { - var util = require('util'); - var a0 = make(); - var a1 = make(); - assert.ok(traverse.deepEqual(a0, a1)); - - a0.c.d.moo = true; - assert.ok(!traverse.deepEqual(a0, a1)); - - a1.c.d.moo = true; - assert.ok(traverse.deepEqual(a0, a1)); - - // TODO: this one - //a0.c.a = a1; - //assert.ok(!traverse.deepEqual(a0, a1)); -}; - -function make () { - var a = { self : 'a' }; - var b = { self : 'b' }; - var c = { self : 'c' }; - var d = { self : 'd' }; - var e = { self : 'e' }; - - a.a = a; - a.b = b; - a.c = c; - - b.a = a; - b.b = b; - b.c = c; - - c.a = a; - c.b = b; - c.c = c; - c.d = d; - - d.a = a; - d.b = b; - d.c = c; - d.d = d; - d.e = e; - - e.a = a; - e.b = b; - e.c = c; - e.d = d; - e.e = e; - - return a; -} diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/package.json b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/package.json deleted file mode 100644 index 2973539c4d0..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/package.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "chainsaw", - "version": "0.1.0", - "description": "Build chainable fluent interfaces the easy way... with a freakin' chainsaw!", - "main": "./index.js", - "repository": { - "type": "git", - "url": "http://github.com/substack/node-chainsaw.git" - }, - "dependencies": { - "traverse": ">=0.3.0 <0.4" - }, - "keywords": [ - "chain", - "fluent", - "interface", - "monad", - "monadic" - ], - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "license": "MIT/X11", - "engine": { - "node": ">=0.4.0" - }, - "readme": "Chainsaw\n========\n\nBuild chainable fluent interfaces the easy way in node.js.\n\nWith this meta-module you can write modules with chainable interfaces.\nChainsaw takes care of all of the boring details and makes nested flow control\nsuper simple too.\n\nJust call `Chainsaw` with a constructor function like in the examples below.\nIn your methods, just do `saw.next()` to move along to the next event and\n`saw.nest()` to create a nested chain.\n\nExamples\n========\n\nadd_do.js\n---------\n\nThis silly example adds values with a chainsaw.\n\n var Chainsaw = require('chainsaw');\n \n function AddDo (sum) {\n return Chainsaw(function (saw) {\n this.add = function (n) {\n sum += n;\n saw.next();\n };\n \n this.do = function (cb) {\n saw.nest(cb, sum);\n };\n });\n }\n \n AddDo(0)\n .add(5)\n .add(10)\n .do(function (sum) {\n if (sum > 12) this.add(-10);\n })\n .do(function (sum) {\n console.log('Sum: ' + sum);\n })\n ;\n\nOutput:\n Sum: 5\n\nprompt.js\n---------\n\nThis example provides a wrapper on top of stdin with the help of\n[node-lazy](https://github.com/pkrumins/node-lazy) for line-processing.\n\n var Chainsaw = require('chainsaw');\n var Lazy = require('lazy');\n \n module.exports = Prompt;\n function Prompt (stream) {\n var waiting = [];\n var lines = [];\n var lazy = Lazy(stream).lines.map(String)\n .forEach(function (line) {\n if (waiting.length) {\n var w = waiting.shift();\n w(line);\n }\n else lines.push(line);\n })\n ;\n \n var vars = {};\n return Chainsaw(function (saw) {\n this.getline = function (f) {\n var g = function (line) {\n saw.nest(f, line, vars);\n };\n \n if (lines.length) g(lines.shift());\n else waiting.push(g);\n };\n \n this.do = function (cb) {\n saw.nest(cb, vars);\n };\n });\n }\n\nAnd now for the new Prompt() module in action:\n\n var util = require('util');\n var stdin = process.openStdin();\n \n Prompt(stdin)\n .do(function () {\n util.print('x = ');\n })\n .getline(function (line, vars) {\n vars.x = parseInt(line, 10);\n })\n .do(function () {\n util.print('y = ');\n })\n .getline(function (line, vars) {\n vars.y = parseInt(line, 10);\n })\n .do(function (vars) {\n if (vars.x + vars.y < 10) {\n util.print('z = ');\n this.getline(function (line) {\n vars.z = parseInt(line, 10);\n })\n }\n else {\n vars.z = 0;\n }\n })\n .do(function (vars) {\n console.log('x + y + z = ' + (vars.x + vars.y + vars.z));\n process.exit();\n })\n ;\n\nInstallation\n============\n\nWith [npm](http://github.com/isaacs/npm), just do:\n npm install chainsaw\n\nor clone this project on github:\n\n git clone http://github.com/substack/node-chainsaw.git\n\nTo run the tests with [expresso](http://github.com/visionmedia/expresso),\njust do:\n\n expresso\n\n\nLight Mode vs Full Mode\n=======================\n\n`node-chainsaw` supports two different modes. In full mode, every\naction is recorded, which allows you to replay actions using the\n`jump()`, `trap()` and `down()` methods.\n\nHowever, if your chainsaws are long-lived, recording every action can\nconsume a tremendous amount of memory, so we also offer a \"light\" mode\nwhere actions are not recorded and the aforementioned methods are\ndisabled.\n\nTo enable light mode simply use `Chainsaw.light()` to construct your\nsaw, instead of `Chainsaw()`.\n\n\n", - "readmeFilename": "README.markdown", - "bugs": { - "url": "https://github.com/substack/node-chainsaw/issues" - }, - "_id": "chainsaw@0.1.0", - "_from": "chainsaw@~0.1.0" -} diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/test/chainsaw.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/test/chainsaw.js deleted file mode 100644 index 8895e89955d..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/node_modules/chainsaw/test/chainsaw.js +++ /dev/null @@ -1,418 +0,0 @@ -var assert = require('assert'); -var Chainsaw = require('../index'); - -exports.getset = function () { - var to = setTimeout(function () { - assert.fail('builder never fired'); - }, 1000); - - var ch = Chainsaw(function (saw) { - clearTimeout(to); - var num = 0; - - this.get = function (cb) { - cb(num); - saw.next(); - }; - - this.set = function (n) { - num = n; - saw.next(); - }; - - var ti = setTimeout(function () { - assert.fail('end event not emitted'); - }, 50); - - saw.on('end', function () { - clearTimeout(ti); - assert.equal(times, 3); - }); - }); - - var times = 0; - ch - .get(function (x) { - assert.equal(x, 0); - times ++; - }) - .set(10) - .get(function (x) { - assert.equal(x, 10); - times ++; - }) - .set(20) - .get(function (x) { - assert.equal(x, 20); - times ++; - }) - ; -}; - -exports.nest = function () { - var ch = (function () { - var vars = {}; - return Chainsaw(function (saw) { - this.do = function (cb) { - saw.nest(cb, vars); - }; - }); - })(); - - var order = []; - var to = setTimeout(function () { - assert.fail("Didn't get to the end"); - }, 50); - - ch - .do(function (vars) { - vars.x = 'y'; - order.push(1); - - this - .do(function (vs) { - order.push(2); - vs.x = 'x'; - }) - .do(function (vs) { - order.push(3); - vs.z = 'z'; - }) - ; - }) - .do(function (vars) { - vars.y = 'y'; - order.push(4); - }) - .do(function (vars) { - assert.eql(order, [1,2,3,4]); - assert.eql(vars, { x : 'x', y : 'y', z : 'z' }); - clearTimeout(to); - }) - ; -}; - -exports.nestWait = function () { - var ch = (function () { - var vars = {}; - return Chainsaw(function (saw) { - this.do = function (cb) { - saw.nest(cb, vars); - }; - - this.wait = function (n) { - setTimeout(function () { - saw.next(); - }, n); - }; - }); - })(); - - var order = []; - var to = setTimeout(function () { - assert.fail("Didn't get to the end"); - }, 1000); - - var times = {}; - - ch - .do(function (vars) { - vars.x = 'y'; - order.push(1); - - this - .do(function (vs) { - order.push(2); - vs.x = 'x'; - times.x = Date.now(); - }) - .wait(50) - .do(function (vs) { - order.push(3); - vs.z = 'z'; - - times.z = Date.now(); - var dt = times.z - times.x; - assert.ok(dt >= 50 && dt < 75); - }) - ; - }) - .do(function (vars) { - vars.y = 'y'; - order.push(4); - - times.y = Date.now(); - }) - .wait(100) - .do(function (vars) { - assert.eql(order, [1,2,3,4]); - assert.eql(vars, { x : 'x', y : 'y', z : 'z' }); - clearTimeout(to); - - times.end = Date.now(); - var dt = times.end - times.y; - assert.ok(dt >= 100 && dt < 125) - }) - ; -}; - -exports.nestNext = function () { - var ch = (function () { - var vars = {}; - return Chainsaw(function (saw) { - this.do = function (cb) { - saw.nest(false, function () { - var args = [].slice.call(arguments); - args.push(saw.next); - cb.apply(this, args); - }, vars); - }; - }); - })(); - - var order = []; - var to = setTimeout(function () { - assert.fail("Didn't get to the end"); - }, 500); - - var times = []; - - ch - .do(function (vars, next_) { - vars.x = 'y'; - order.push(1); - - this - .do(function (vs, next) { - order.push(2); - vs.x = 'x'; - setTimeout(next, 30); - }) - .do(function (vs, next) { - order.push(3); - vs.z = 'z'; - setTimeout(next, 10); - }) - .do(function () { - setTimeout(next_, 20); - }) - ; - }) - .do(function (vars, next) { - vars.y = 'y'; - order.push(4); - setTimeout(next, 5); - }) - .do(function (vars) { - assert.eql(order, [1,2,3,4]); - assert.eql(vars, { x : 'x', y : 'y', z : 'z' }); - - clearTimeout(to); - }) - ; -}; - -exports.builder = function () { - var cx = Chainsaw(function (saw) { - this.x = function () {}; - }); - assert.ok(cx.x); - - var cy = Chainsaw(function (saw) { - return { y : function () {} }; - }); - assert.ok(cy.y); - - var cz = Chainsaw(function (saw) { - return { z : function (cb) { saw.nest(cb) } }; - }); - assert.ok(cz.z); - - var to = setTimeout(function () { - assert.fail("Nested z didn't run"); - }, 50); - - cz.z(function () { - clearTimeout(to); - assert.ok(this.z); - }); -}; - -this.attr = function () { - var to = setTimeout(function () { - assert.fail("attr chain didn't finish"); - }, 50); - - var xy = []; - var ch = Chainsaw(function (saw) { - this.h = { - x : function () { - xy.push('x'); - saw.next(); - }, - y : function () { - xy.push('y'); - saw.next(); - assert.eql(xy, ['x','y']); - clearTimeout(to); - } - }; - }); - assert.ok(ch.h); - assert.ok(ch.h.x); - assert.ok(ch.h.y); - - ch.h.x().h.y(); -}; - -exports.down = function () { - var error = null; - var s; - var ch = Chainsaw(function (saw) { - s = saw; - this.raise = function (err) { - error = err; - saw.down('catch'); - }; - - this.do = function (cb) { - cb.call(this); - }; - - this.catch = function (cb) { - if (error) { - saw.nest(cb, error); - error = null; - } - else saw.next(); - }; - }); - - var to = setTimeout(function () { - assert.fail(".do() after .catch() didn't fire"); - }, 50); - - ch - .do(function () { - this.raise('pow'); - }) - .do(function () { - assert.fail("raise didn't skip over this do block"); - }) - .catch(function (err) { - assert.equal(err, 'pow'); - }) - .do(function () { - clearTimeout(to); - }) - ; -}; - -exports.trap = function () { - var error = null; - var ch = Chainsaw(function (saw) { - var pars = 0; - var stack = []; - var i = 0; - - this.par = function (cb) { - pars ++; - var j = i ++; - cb.call(function () { - pars --; - stack[j] = [].slice.call(arguments); - saw.down('result'); - }); - saw.next(); - }; - - this.join = function (cb) { - saw.trap('result', function () { - if (pars == 0) { - cb.apply(this, stack); - saw.next(); - } - }); - }; - - this.raise = function (err) { - error = err; - saw.down('catch'); - }; - - this.do = function (cb) { - cb.call(this); - }; - - this.catch = function (cb) { - if (error) { - saw.nest(cb, error); - error = null; - } - else saw.next(); - }; - }); - - var to = setTimeout(function () { - assert.fail(".do() after .join() didn't fire"); - }, 100); - var tj = setTimeout(function () { - assert.fail('.join() never fired'); - }, 100); - - var joined = false; - ch - .par(function () { - setTimeout(this.bind(null, 1), 50); - }) - .par(function () { - setTimeout(this.bind(null, 2), 25); - }) - .join(function (x, y) { - assert.equal(x[0], 1); - assert.equal(y[0], 2); - clearTimeout(tj); - joined = true; - }) - .do(function () { - clearTimeout(to); - assert.ok(joined); - }) - ; -}; - -exports.jump = function () { - var to = setTimeout(function () { - assert.fail('builder never fired'); - }, 50); - - var xs = [ 4, 5, 6, -4, 8, 9, -1, 8 ]; - var xs_ = []; - - var ch = Chainsaw(function (saw) { - this.x = function (i) { - xs_.push(i); - saw.next(); - }; - - this.y = function (step) { - var x = xs.shift(); - if (x > 0) saw.jump(step); - else saw.next(); - }; - - saw.on('end', function () { - clearTimeout(to); - assert.eql(xs, [ 8 ]); - assert.eql(xs_, [ 1, 1, 1, 1, 2, 3, 2, 3, 2, 3 ]); - }); - }); - - ch - .x(1) - .y(0) - .x(2) - .x(3) - .y(2) - ; -}; diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/package.json b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/package.json deleted file mode 100644 index 41fda8a030a..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/package.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "binary", - "version": "0.3.0", - "description": "Unpack multibyte binary values from buffers", - "main": "./index.js", - "repository": { - "type": "git", - "url": "http://github.com/substack/node-binary.git" - }, - "keywords": [ - "binary", - "decode", - "endian", - "unpack", - "signed", - "unsigned" - ], - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "dependencies": { - "chainsaw": "~0.1.0", - "buffers": "~0.1.1" - }, - "devDependencies": { - "seq": "~0.2.5", - "tap": "~0.2.4" - }, - "scripts": { - "test": "tap test/*.js" - }, - "license": "MIT", - "engine": { - "node": ">=0.4.0" - }, - "readme": "binary\n======\n\nUnpack multibyte binary values from buffers and streams.\nYou can specify the endianness and signedness of the fields to be unpacked too.\n\nThis module is a cleaner and more complete version of\n[bufferlist](https://github.com/substack/node-bufferlist)'s binary module that\nruns on pre-allocated buffers instead of a linked list.\n\n[![build status](https://secure.travis-ci.org/substack/node-binary.png)](http://travis-ci.org/substack/node-binary)\n\nexamples\n========\n\nstream.js\n---------\n\n``` js\nvar binary = require('binary');\n\nvar ws = binary()\n .word32lu('x')\n .word16bs('y')\n .word16bu('z')\n .tap(function (vars) {\n console.dir(vars);\n })\n;\nprocess.stdin.pipe(ws);\nprocess.stdin.resume();\n```\n\noutput:\n\n```\n$ node examples/stream.js\nabcdefgh\n{ x: 1684234849, y: 25958, z: 26472 }\n^D\n```\n\nparse.js\n--------\n\n``` js\nvar buf = new Buffer([ 97, 98, 99, 100, 101, 102, 0 ]);\n\nvar binary = require('binary');\nvar vars = binary.parse(buf)\n .word16ls('ab')\n .word32bu('cf')\n .word8('x')\n .vars\n;\nconsole.dir(vars);\n```\n\noutput:\n\n```\n{ ab: 25185, cf: 1667523942, x: 0 }\n```\n\nmethods\n=======\n\n`var binary = require('binary')`\n\nvar b = binary()\n----------------\n\nReturn a new writable stream `b` that has the chainable methods documented below\nfor buffering binary input.\n\nbinary.parse(buf)\n-----------------\n\nParse a static buffer in one pass. Returns a chainable interface with the\nmethods below plus a `vars` field to get at the variable stash as the last item\nin a chain.\n\nIn parse mode, methods will set their keys to `null` if the buffer isn't big\nenough except `buffer()` and `scan()` which read up up to the end of the buffer\nand stop.\n\nb.word{8,16,32,64}{l,b}{e,u,s}(key)\n-----------------------------------\n\nParse bytes in the buffer or stream given:\n\n* number of bits\n* endianness ( l : little, b : big ),\n* signedness ( u and e : unsigned, s : signed )\n\nThese functions won't start parsing until all previous parser functions have run\nand the data is available.\n\nThe result of the parse goes into the variable stash at `key`.\nIf `key` has dots (`.`s), it refers to a nested address. If parent container\nvalues don't exist they will be created automatically, so for instance you can\nassign into `dst.addr` and `dst.port` and the `dst` key in the variable stash\nwill be `{ addr : x, port : y }` afterwards.\n\nb.buffer(key, size)\n-------------------\n\nTake `size` bytes directly off the buffer stream, putting the resulting buffer\nslice in the variable stash at `key`. If `size` is a string, use the value at\n`vars[size]`. The key follows the same dotted address rules as the word\nfunctions.\n\nb.scan(key, buffer)\n-------------------\n\nSearch for `buffer` in the stream and store all the intervening data in the\nstash at at `key`, excluding the search buffer. If `buffer` passed as a string,\nit will be converted into a Buffer internally.\n\nFor example, to read in a line you can just do:\n\n``` js\nvar b = binary()\n .scan('line', new Buffer('\\r\\n'))\n .tap(function (vars) {\n console.log(vars.line)\n })\n;\nstream.pipe(b);\n```\n\nb.tap(cb)\n---------\n\nThe callback `cb` is provided with the variable stash from all the previous\nactions once they've all finished.\n\nYou can nest additional actions onto `this` inside the callback.\n\nb.into(key, cb)\n---------------\n\nLike `.tap()`, except all nested actions will assign into a `key` in the `vars`\nstash.\n\nb.loop(cb)\n----------\n\nLoop, each time calling `cb(end, vars)` for function `end` and the variable\nstash with `this` set to a new chain for nested parsing. The loop terminates\nonce `end` is called.\n\nb.flush()\n---------\n\nClear the variable stash entirely.\n\ninstallation\n============\n\nTo install with [npm](http://github.com/isaacs/npm):\n\n```\nnpm install binary\n```\n\nnotes\n=====\n\nThe word64 functions will only return approximations since javascript uses ieee\nfloating point for all number types. Mind the loss of precision.\n\nlicense\n=======\n\nMIT\n\n", - "readmeFilename": "README.markdown", - "bugs": { - "url": "https://github.com/substack/node-binary/issues" - }, - "_id": "binary@0.3.0", - "_from": "binary@~0.3.0" -} diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/perf/loop.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/perf/loop.js deleted file mode 100644 index bec60a84182..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/perf/loop.js +++ /dev/null @@ -1,92 +0,0 @@ -var Seq = require('seq'); -var Hash = require('hashish'); -var EventEmitter = require('events').EventEmitter; - -var Bin = require('binary'); -var Buf = require('bufferlist/binary'); -var BufferList = require('bufferlist'); - -console.log('loop'); -function emitter () { - var em = new EventEmitter; - - var i = 0; - var iv = setInterval(function () { - var buf = new Buffer(10000); - buf[0] = 0xff; - - if (++ i >= 2000) { - buf[0] = 0; - clearInterval(iv); - } - em.emit('data', buf); - }, 1); - - return em; -} - -Seq() - .seq(function () { - var next = this.bind({}, null); - bufferlist(next); - }) - .seq(function () { - var next = this.bind({}, null); - binary(next); - }) -; - -function binary (next) { - var em = emitter(); - var t0 = Date.now(); - - Bin(em) - .loop(function (end) { - this - .word8('x') - .word8('y') - .word32be('z') - .word32le('w') - .buffer('buf', 10000 - 10) - .tap(function (vars) { - if (vars.x === 0) { - var tf = Date.now(); - console.log(' binary: ' + (tf - t0) + ' ms'); - end(); - setTimeout(next, 20); - } - }) - }) - ; -} - -function bufferlist (next) { - var em = emitter(); - var t0 = Date.now(); - - var blist = new BufferList; - em.on('data', function (buf) { - blist.push(buf); - }); - - Buf(blist) - .forever(function () { - var top = this; - this - .getWord8('x') - .getWord8('y') - .getWord32be('z') - .getWord32le('w') - .getBuffer('buf', 10000 - 10) - .tap(function (vars) { - if (vars.x === 0) { - var tf = Date.now(); - console.log(' bufferlist: ' + (tf - t0) + ' ms'); - top.exit(); - setTimeout(next, 20); - } - }) - }) - .end() - ; -} diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/perf/small.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/perf/small.js deleted file mode 100644 index 2a5ed525bd5..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/perf/small.js +++ /dev/null @@ -1,80 +0,0 @@ -var Seq = require('seq'); -var Hash = require('hashish'); - -var Bin = require('binary'); -var Buf = require('bufferlist/binary'); -var BufferList = require('bufferlist'); -var EventEmitter = require('events').EventEmitter; - -function binary (buf, cb) { - Bin(buf) - .word32le('x') - .word16be('y') - .word16be('z') - .word32le('w') - .tap(cb) - ; -}; - -function stream (buf, cb) { - var em = new EventEmitter; - Bin(em) - .word32le('x') - .word16be('y') - .word16be('z') - .word32le('w') - .tap(cb) - ; - em.emit('data', buf); -}; - -function parse (buf, cb) { - cb(Bin.parse(buf) - .word32le('x') - .word16be('y') - .word16be('z') - .word32le('w') - .vars - ); -}; - -function bufferlist (buf, cb) { - var blist = new BufferList; - blist.push(buf); - Buf(blist) - .getWord32le('x') - .getWord16be('y') - .getWord16be('z') - .getWord32le('w') - .tap(cb) - .end() - ; -}; - - -var buffers = []; -for (var i = 0; i < 200; i++) { - buffers.push(new Buffer(12)); -} - -console.log('small'); -Seq(binary, stream, parse, bufferlist) - .seqEach(function (f) { - var t = this; - var t0 = Date.now(); - Seq() - .extend(buffers) - .seqEach(function (buf) { - f(buf, this.bind(this, null)); - }) - .seq(function () { - var tf = Date.now(); - console.log(' ' + f.name + ': ' + (tf - t0)); - t(null); - }) - ; - }) - .seq(function () { - this(null); - }) -; diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/bu.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/bu.js deleted file mode 100644 index d557e3ce819..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/bu.js +++ /dev/null @@ -1,46 +0,0 @@ -var binary = require('../'); -var test = require('tap').test; - -test('bu', function (t) { - t.plan(8); - - // note: can't store -12667700813876161 exactly in an ieee float - - var buf = new Buffer([ - 44, // a == 44 - 2, 43, // b == 555 - 164, 213, 37, 37, // c == 2765432101 - 29, 81, 180, 20, 155, 115, 203, 193, // d == 2112667700813876161 - ]); - - binary.parse(buf) - .word8bu('a') - .word16bu('b') - .word32bu('c') - .word64bu('d') - .tap(function (vars) { - t.same(vars.a, 44); - t.same(vars.b, 555); - t.same(vars.c, 2765432101); - t.ok( - Math.abs(vars.d - 2112667700813876161) < 1500 - ); - }) - ; - - // also check aliases here: - binary.parse(buf) - .word8be('a') - .word16be('b') - .word32be('c') - .word64be('d') - .tap(function (vars) { - t.same(vars.a, 44); - t.same(vars.b, 555); - t.same(vars.c, 2765432101); - t.ok( - Math.abs(vars.d - 2112667700813876161) < 1500 - ); - }) - ; -}); diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/deferred.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/deferred.js deleted file mode 100644 index 52623f7c4b2..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/deferred.js +++ /dev/null @@ -1,20 +0,0 @@ -var binary = require('../'); -var test = require('tap').test; -var EventEmitter = require('events').EventEmitter; - -test('deferred', function (t) { - t.plan(1); - - var em = new EventEmitter; - binary.stream(em) - .word8('a') - .word16be('bc') - .tap(function (vars) { - t.same(vars, { a : 97, bc : 25187 }); - }) - ; - - setTimeout(function () { - em.emit('data', new Buffer([ 97, 98, 99 ])); - }, 10); -}); diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/dots.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/dots.js deleted file mode 100644 index f730eb3832f..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/dots.js +++ /dev/null @@ -1,23 +0,0 @@ -var binary = require('../'); -var test = require('tap').test; - -test('dots', function (t) { - t.plan(1); - - binary.parse(new Buffer([ 97, 98, 99, 100, 101, 102 ])) - .word8('a') - .word16be('b.x') - .word16be('b.y') - .word8('b.z') - .tap(function (vars) { - t.same(vars, { - a : 97, - b : { - x : 256 * 98 + 99, - y : 256 * 100 + 101, - z : 102 - }, - }); - }) - ; -}); diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/eof.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/eof.js deleted file mode 100644 index e5268ffc2b4..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/eof.js +++ /dev/null @@ -1,41 +0,0 @@ -var binary = require('../'); -var test = require('tap').test; -var EventEmitter = require('events').EventEmitter; - -test('eof', function (t) { - t.plan(4); - - var stream = new EventEmitter; - binary.stream(stream) - .buffer('sixone', 5) - .peek(function () { - this.word32le('len'); - }) - .buffer('buf', 'len') - .word8('x') - .tap(function (vars) { - t.same( - [].slice.call(vars.sixone), - [].slice.call(new Buffer([ 6, 1, 6, 1, 6 ])) - ); - t.same(vars.buf.length, vars.len); - t.same( - [].slice.call(vars.buf), - [ 9, 0, 0, 0, 97, 98, 99, 100, 101 ] - ); - t.same(vars.x, 102); - }) - ; - - var bufs = [ - new Buffer([ 6, 1, 6, 1, 6, 9, 0, 0, 0, 97 ]), - new Buffer([ 98, 99 ]), - new Buffer([ 100, 101, 102 ]), - ]; - - bufs.forEach(function (buf) { - stream.emit('data', buf); - }); - - stream.emit('end'); -}); diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/flush.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/flush.js deleted file mode 100644 index b9c0dde873b..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/flush.js +++ /dev/null @@ -1,17 +0,0 @@ -var binary = require('../'); -var test = require('tap').test; - -test('flush', function (t) { - t.plan(1); - - binary.parse(new Buffer([ 97, 98, 99, 100, 101, 102 ])) - .word8('a') - .word16be('b') - .word16be('c') - .flush() - .word8('d') - .tap(function (vars) { - t.same(vars, { d : 102 }); - }) - ; -}); diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/from_buffer.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/from_buffer.js deleted file mode 100644 index b5061e7e43a..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/from_buffer.js +++ /dev/null @@ -1,14 +0,0 @@ -var binary = require('../'); -var test = require('tap').test; - -test('from buffer', function (t) { - t.plan(1); - - binary(new Buffer([ 97, 98, 99 ])) - .word8('a') - .word16be('bc') - .tap(function (vars) { - t.same(vars, { a : 97, bc : 25187 }); - }) - ; -}); diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/get_buffer.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/get_buffer.js deleted file mode 100644 index 1c621922708..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/get_buffer.js +++ /dev/null @@ -1,28 +0,0 @@ -var binary = require('../'); -var test = require('tap').test; - -test('get buffer', function (t) { - t.plan(4); - - var buf = new Buffer([ 4, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 ]); - binary.parse(buf) - .word8('a') - .buffer('b', 7) - .word16lu('c') - .tap(function (vars) { - t.equal(vars.a, 4); - t.equal( - vars.b.toString(), - new Buffer([ 2, 3, 4, 5, 6, 7, 8 ]).toString() - ); - t.equal(vars.c, 2569); - }) - .buffer('d', 'a') - .tap(function (vars) { - t.equal( - vars.d.toString(), - new Buffer([ 11, 12, 13, 14 ]).toString() - ); - }) - ; -}); diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/immediate.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/immediate.js deleted file mode 100644 index 1f0ea776725..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/immediate.js +++ /dev/null @@ -1,18 +0,0 @@ -var binary = require('../'); -var test = require('tap').test; -var EventEmitter = require('events').EventEmitter; - -test('immediate', function (t) { - t.plan(1); - - var em = new EventEmitter; - binary.stream(em, 'moo') - .word8('a') - .word16be('bc') - .tap(function (vars) { - t.same(vars, { a : 97, bc : 25187 }); - }) - ; - - em.emit('moo', new Buffer([ 97, 98, 99 ])); -}); diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/interval.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/interval.js deleted file mode 100644 index b17c0cb2bda..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/interval.js +++ /dev/null @@ -1,38 +0,0 @@ -var binary = require('../'); -var test = require('tap').test; -var EventEmitter = require('events').EventEmitter; - -test('interval', function (t) { - t.plan(1); - - var em = new EventEmitter; - var i = 0; - var iv = setInterval(function () { - var buf = new Buffer(1000); - buf[0] = 0xff; - if (++i >= 1000) { - clearInterval(iv); - buf[0] = 0; - } - em.emit('data', buf); - }, 1); - - var loops = 0; - binary(em) - .loop(function (end) { - this - .word8('x') - .word8('y') - .word32be('z') - .word32le('w') - .buffer('buf', 1000 - 10) - .tap(function (vars) { - loops ++; - if (vars.x == 0) end(); - }) - }) - .tap(function () { - t.same(loops, 1000); - }) - ; -}); diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/into_buffer.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/into_buffer.js deleted file mode 100644 index 10d3d4add76..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/into_buffer.js +++ /dev/null @@ -1,35 +0,0 @@ -var binary = require('../'); -var test = require('tap').test; - -test('intoBuffer', function (t) { - t.plan(3); - var buf = new Buffer([ 1, 2, 3, 4, 5, 6 ]) - - binary.parse(buf) - .into('moo', function () { - this - .word8('x') - .word8('y') - .word8('z') - ; - }) - .tap(function (vars) { - t.same(vars, { moo : { x : 1, y : 2, z : 3 } }); - }) - .word8('w') - .tap(function (vars) { - t.same(vars, { - moo : { x : 1, y : 2, z : 3 }, - w : 4, - }); - }) - .word8('x') - .tap(function (vars) { - t.same(vars, { - moo : { x : 1, y : 2, z : 3 }, - w : 4, - x : 5, - }); - }) - ; -}); diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/into_stream.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/into_stream.js deleted file mode 100644 index db77092830c..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/into_stream.js +++ /dev/null @@ -1,43 +0,0 @@ -var binary = require('../'); -var test = require('tap').test; -var EventEmitter = require('events').EventEmitter; - -test('into stream', function (t) { - t.plan(3); - - var digits = [ 1, 2, 3, 4, 5, 6 ]; - var stream = new EventEmitter; - var iv = setInterval(function () { - var d = digits.shift(); - if (d) stream.emit('data', new Buffer([ d ])) - else clearInterval(iv) - }, 20); - - binary.stream(stream) - .into('moo', function () { - this - .word8('x') - .word8('y') - .word8('z') - ; - }) - .tap(function (vars) { - t.same(vars, { moo : { x : 1, y : 2, z : 3 } }); - }) - .word8('w') - .tap(function (vars) { - t.same(vars, { - moo : { x : 1, y : 2, z : 3 }, - w : 4, - }); - }) - .word8('x') - .tap(function (vars) { - t.same(vars, { - moo : { x : 1, y : 2, z : 3 }, - w : 4, - x : 5, - }); - }) - ; -}); diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/loop.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/loop.js deleted file mode 100644 index 74576a972f4..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/loop.js +++ /dev/null @@ -1,44 +0,0 @@ -var binary = require('../'); -var test = require('tap').test; -var EventEmitter = require('events').EventEmitter; - -test('loop', function (t) { - t.plan(3 * 2 + 1); - - var em = new EventEmitter; - - binary.stream(em) - .loop(function (end, vars) { - t.strictEqual(vars, this.vars); - this - .word16lu('a') - .word8u('b') - .word8s('c') - .tap(function (vars_) { - t.strictEqual(vars, vars_); - if (vars.c < 0) end(); - }) - ; - }) - .tap(function (vars) { - t.same(vars, { a : 1337, b : 55, c : -5 }); - }) - ; - - setTimeout(function () { - em.emit('data', new Buffer([ 2, 10, 88 ])); - }, 10); - setTimeout(function () { - em.emit('data', new Buffer([ 100, 3, 6, 242, 30 ])); - }, 20); - setTimeout(function () { - em.emit('data', new Buffer([ 60, 60, 199, 44 ])); - }, 30); - - setTimeout(function () { - em.emit('data', new Buffer([ 57, 5 ])); - }, 80); - setTimeout(function () { - em.emit('data', new Buffer([ 55, 251 ])); - }, 90); -}); diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/loop_scan.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/loop_scan.js deleted file mode 100644 index 394603a9235..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/loop_scan.js +++ /dev/null @@ -1,54 +0,0 @@ -var binary = require('../'); -var test = require('tap').test; -var EventEmitter = require('events').EventEmitter; - -test('loop scan', function (t) { - t.plan(8 + 6 + 2); - - var em = new EventEmitter; - - binary.stream(em) - .loop(function (end) { - var vars_ = this.vars; - this - .scan('filler', 'BEGINMSG') - .buffer('cmd', 3) - .word8('num') - .tap(function (vars) { - t.strictEqual(vars, vars_); - if (vars.num != 0x02 && vars.num != 0x06) { - t.same(vars.filler.length, 0); - } - if (vars.cmd.toString() == 'end') end(); - }) - ; - }) - .tap(function (vars) { - t.same(vars.cmd.toString(), 'end'); - t.same(vars.num, 0x08); - }) - ; - - setTimeout(function () { - em.emit('data', new Buffer( - 'BEGINMSGcmd\x01' - + 'GARBAGEDATAXXXX' - + 'BEGINMSGcmd\x02' - + 'BEGINMSGcmd\x03' - )); - }, 10); - - setTimeout(function () { - em.emit('data', new Buffer( - 'BEGINMSGcmd\x04' - + 'BEGINMSGcmd\x05' - + 'GARBAGEDATAXXXX' - + 'BEGINMSGcmd\x06' - )); - em.emit('data', new Buffer('BEGINMSGcmd\x07')); - }, 20); - - setTimeout(function () { - em.emit('data', new Buffer('BEGINMSGend\x08')); - }, 30); -}); diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/lu.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/lu.js deleted file mode 100644 index 8d3e9e7cc87..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/lu.js +++ /dev/null @@ -1,46 +0,0 @@ -var binary = require('../'); -var test = require('tap').test; - -test('lu', function (t) { - t.plan(8); - - // note: can't store -12667700813876161 exactly in an ieee float - - var buf = new Buffer([ - 44, // a == 44 - 43, 2, // b == 555 - 37, 37, 213, 164, // c == 2765432101 - 193, 203, 115, 155, 20, 180, 81, 29, // d == 2112667700813876161 - ]); - - binary.parse(buf) - .word8lu('a') - .word16lu('b') - .word32lu('c') - .word64lu('d') - .tap(function (vars) { - t.same(vars.a, 44); - t.same(vars.b, 555); - t.same(vars.c, 2765432101); - t.ok( - Math.abs(vars.d - 2112667700813876161) < 1500 - ); - }) - ; - - // also check aliases here: - binary.parse(buf) - .word8le('a') - .word16le('b') - .word32le('c') - .word64le('d') - .tap(function (vars) { - t.same(vars.a, 44); - t.same(vars.b, 555); - t.same(vars.c, 2765432101); - t.ok( - Math.abs(vars.d - 2112667700813876161) < 1500 - ); - }) - ; -}); diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/negbs.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/negbs.js deleted file mode 100644 index dd23a9a6b75..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/negbs.js +++ /dev/null @@ -1,29 +0,0 @@ -var binary = require('../'); -var test = require('tap').test; - -test('negbs', function (t) { - t.plan(4); - // note: can't store -12667700813876161 exactly in an ieee float - - var buf = new Buffer([ - 226, // a == -30 - 246, 219, // b == -2341 - 255, 243, 245, 236, // c == -789012 - 255, 210, 254, 203, 16, 222, 52, 63, // d == -12667700813876161 - ]); - - binary.parse(buf) - .word8bs('a') - .word16bs('b') - .word32bs('c') - .word64bs('d') - .tap(function (vars) { - t.same(vars.a, -30); - t.same(vars.b, -2341); - t.same(vars.c, -789012); - t.ok( - Math.abs(vars.d - -12667700813876161) < 1500 - ); - }) - ; -}); diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/negls.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/negls.js deleted file mode 100644 index 2a229f47595..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/negls.js +++ /dev/null @@ -1,29 +0,0 @@ -var binary = require('../'); -var test = require('tap').test; - -test('negls', function (t) { - t.plan(4); - // note: can't store -12667700813876161 exactly in an ieee float - - var buf = new Buffer([ - 226, // a == -30 - 219, 246, // b == -2341 - 236, 245, 243, 255, // c == -789012 - 63, 52, 222, 16, 203, 254, 210, 255, // d == -12667700813876161 - ]); - - binary.parse(buf) - .word8ls('a') - .word16ls('b') - .word32ls('c') - .word64ls('d') - .tap(function (vars) { - t.same(vars.a, -30); - t.same(vars.b, -2341); - t.same(vars.c, -789012); - t.ok( - Math.abs(vars.d - -12667700813876161) < 1000 - ); - }) - ; -}); diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/nested.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/nested.js deleted file mode 100644 index 869d51c9fae..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/nested.js +++ /dev/null @@ -1,35 +0,0 @@ -var binary = require('../'); -var test = require('tap').test; -var EventEmitter = require('events').EventEmitter; - -test('nested', function (t) { - t.plan(3); - var insideDone = false; - - var em = new EventEmitter; - binary.stream(em) - .word16be('ab') - .tap(function () { - this - .word8('c') - .word8('d') - .tap(function () { - insideDone = true; - }) - ; - }) - .tap(function (vars) { - t.ok(insideDone); - t.same(vars.c, 'c'.charCodeAt(0)); - t.same(vars.d, 'd'.charCodeAt(0)); - - }) - ; - - var strs = [ 'abc', 'def', 'hi', 'jkl' ]; - var iv = setInterval(function () { - var s = strs.shift(); - if (s) em.emit('data', new Buffer(s)); - else clearInterval(iv); - }, 50); -}); diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/not_enough_buf.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/not_enough_buf.js deleted file mode 100644 index bbf8ffff69b..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/not_enough_buf.js +++ /dev/null @@ -1,17 +0,0 @@ -var binary = require('../'); -var test = require('tap').test; - -test('not enough buf', function (t) { - t.plan(3); - - var vars = binary(new Buffer([1,2,3,4])) - .word8('a') - .buffer('b', 10) - .word8('c') - .vars - ; - - t.same(vars.a, 1); - t.equal(vars.b.toString(), new Buffer([2,3,4]).toString()); - t.strictEqual(vars.c, null); -}); diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/not_enough_parse.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/not_enough_parse.js deleted file mode 100644 index f9a32e2eacd..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/not_enough_parse.js +++ /dev/null @@ -1,19 +0,0 @@ -var binary = require('../'); -var test = require('tap').test; - -test('not enough parse', function (t) { - t.plan(4); - - var vars = binary(new Buffer([1,2])) - .word8('a') - .word8('b') - .word8('c') - .word8('d') - .vars - ; - - t.same(vars.a, 1); - t.same(vars.b, 2); - t.strictEqual(vars.c, null); - t.strictEqual(vars.d, null); -}); diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/parse.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/parse.js deleted file mode 100644 index fbc9f5bd5ef..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/parse.js +++ /dev/null @@ -1,54 +0,0 @@ -var binary = require('../'); -var test = require('tap').test; - -test('parse', function (t) { - t.plan(6); - var res = binary.parse(new Buffer([ 97, 98, 99, 99, 99, 99, 1, 2, 3 ])) - .word8('a') - .word16be('bc') - .skip(3) - .buffer('def', 3) - .tap(function (vars) { - t.equal(vars.a, 97); - t.equal(vars.bc, 25187); - t.same( - [].slice.call(vars.def), - [].slice.call(new Buffer([ 1, 2, 3])) - ); - }) - .vars - ; - t.equal(res.a, 97); - t.equal(res.bc, 25187); - t.same( - [].slice.call(res.def), - [].slice.call(new Buffer([ 1, 2, 3 ])) - ); -}); - -test('loop', function (t) { - t.plan(2); - var res = binary.parse(new Buffer([ 97, 98, 99, 4, 5, 2, -3, 9 ])) - .word8('a') - .word16be('bc') - .loop(function (end) { - var x = this.word8s('x').vars.x; - if (x < 0) end(); - }) - .tap(function (vars) { - t.same(vars, { - a : 97, - bc : 25187, - x : -3, - }); - }) - .word8('y') - .vars - ; - t.same(res, { - a : 97, - bc : 25187, - x : -3, - y : 9, - }); -}); diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/peek.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/peek.js deleted file mode 100644 index 00109d396f8..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/peek.js +++ /dev/null @@ -1,40 +0,0 @@ -var binary = require('../'); -var test = require('tap').test; -var EventEmitter = require('events').EventEmitter; - -test('peek', function (t) { - t.plan(4); - var bufs = [ - new Buffer([ 6, 1, 6, 1, 6, 9, 0, 0, 0, 97 ]), - new Buffer([ 98, 99 ]), - new Buffer([ 100, 101, 102 ]), - ]; - - var stream = new EventEmitter; - var iv = setInterval(function () { - var buf = bufs.shift(); - if (buf) stream.emit('data', buf) - else clearInterval(iv) - }, 20); - - binary.stream(stream) - .buffer('sixone', 5) - .peek(function () { - this.word32le('len'); - }) - .buffer('buf', 'len') - .word8('x') - .tap(function (vars) { - t.same( - [].slice.call(vars.sixone), - [].slice.call(new Buffer([ 6, 1, 6, 1, 6 ])) - ); - t.same(vars.buf.length, vars.len); - t.same( - [].slice.call(vars.buf), - [ 9, 0, 0, 0, 97, 98, 99, 100, 101 ] - ); - t.same(vars.x, 102); - }) - ; -}); diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/pipe.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/pipe.js deleted file mode 100644 index 7c260cdc692..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/pipe.js +++ /dev/null @@ -1,49 +0,0 @@ -var binary = require('../'); -var test = require('tap').test; -var Stream = require('stream').Stream; - -test('loop', function (t) { - t.plan(3 * 2 + 1); - - var rs = new Stream; - rs.readable = true; - - var ws = binary() - .loop(function (end, vars) { - t.strictEqual(vars, this.vars); - this - .word16lu('a') - .word8u('b') - .word8s('c') - .tap(function (vars_) { - t.strictEqual(vars, vars_); - if (vars.c < 0) end(); - }) - ; - }) - .tap(function (vars) { - t.same(vars, { a : 1337, b : 55, c : -5 }); - }) - ; - rs.pipe(ws); - - setTimeout(function () { - rs.emit('data', new Buffer([ 2, 10, 88 ])); - }, 10); - setTimeout(function () { - rs.emit('data', new Buffer([ 100, 3, 6, 242, 30 ])); - }, 20); - setTimeout(function () { - rs.emit('data', new Buffer([ 60, 60, 199, 44 ])); - }, 30); - - setTimeout(function () { - rs.emit('data', new Buffer([ 57, 5 ])); - }, 80); - setTimeout(function () { - rs.emit('data', new Buffer([ 55, 251 ])); - }, 90); - setTimeout(function () { - rs.emit('end'); - }, 100); -}); diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/posbs.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/posbs.js deleted file mode 100644 index 0642948ef18..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/posbs.js +++ /dev/null @@ -1,29 +0,0 @@ -var binary = require('../'); -var test = require('tap').test; - -test('posbs', function (t) { - t.plan(4); - // note: can't store 12667700813876161 exactly in an ieee float - - var buf = new Buffer([ - 30, // a == -30 - 9, 37, // b == -2341 - 0, 12, 10, 20, // c == -789012 - 0, 45, 1, 52, 239, 33, 203, 193, // d == 12667700813876161 - ]); - - binary.parse(buf) - .word8bs('a') - .word16bs('b') - .word32bs('c') - .word64bs('d') - .tap(function (vars) { - t.same(vars.a, 30); - t.same(vars.b, 2341); - t.same(vars.c, 789012); - t.ok( - Math.abs(vars.d - 12667700813876161) < 1000 - ); - }) - ; -}); diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/posls.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/posls.js deleted file mode 100644 index 2b8f2083911..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/posls.js +++ /dev/null @@ -1,29 +0,0 @@ -var binary = require('../'); -var test = require('tap').test; - -test('posls', function (t) { - t.plan(4); - - // note: can't store 12667700813876161 exactly in an ieee float - var buf = new Buffer([ - 30, // a == -30 - 37, 9, // b == -2341 - 20, 10, 12, 0, // c == -789012 - 193, 203, 33, 239, 52, 1, 45, 0, // d == 12667700813876161 - ]); - - binary.parse(buf) - .word8ls('a') - .word16ls('b') - .word32ls('c') - .word64ls('d') - .tap(function (vars) { - t.same(vars.a, 30); - t.same(vars.b, 2341); - t.same(vars.c, 789012); - t.ok( - Math.abs(vars.d - 12667700813876161) < 1000 - ); - }) - ; -}); diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/scan.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/scan.js deleted file mode 100644 index 6acf2b2df2b..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/scan.js +++ /dev/null @@ -1,33 +0,0 @@ -var binary = require('../'); -var test = require('tap').test; -var EventEmitter = require('events').EventEmitter; - -test('scan', function (t) { - t.plan(4); - - var em = new EventEmitter; - binary(em) - .word8('a') - .scan('l1', new Buffer('\r\n')) - .scan('l2', '\r\n') - .word8('z') - .tap(function (vars) { - t.same(vars.a, 99); - t.same(vars.l1.toString(), 'foo bar'); - t.same(vars.l2.toString(), 'baz'); - t.same(vars.z, 42); - }) - ; - - setTimeout(function () { - em.emit('data', new Buffer([99,0x66,0x6f,0x6f,0x20])); - }, 20); - - setTimeout(function () { - em.emit('data', new Buffer('bar\r')); - }, 40); - - setTimeout(function () { - em.emit('data', new Buffer('\nbaz\r\n*')); - }, 60); -}); diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/scan_buf.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/scan_buf.js deleted file mode 100644 index 5e975c86d46..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/scan_buf.js +++ /dev/null @@ -1,18 +0,0 @@ -var binary = require('../'); -var test = require('tap').test; - -test('scan buf', function (t) { - t.plan(4); - - var vars = binary(new Buffer('\x63foo bar\r\nbaz\r\n*')) - .word8('a') - .scan('l1', new Buffer('\r\n')) - .scan('l2', '\r\n') - .word8('z') - .vars - ; - t.same(vars.a, 99); - t.same(vars.z, 42); - t.same(vars.l1.toString(), 'foo bar'); - t.same(vars.l2.toString(), 'baz'); -}); diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/scan_buf_null.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/scan_buf_null.js deleted file mode 100644 index 96d97674abd..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/scan_buf_null.js +++ /dev/null @@ -1,16 +0,0 @@ -var binary = require('../'); -var test = require('tap').test; - -test('scan buf null', function (t) { - t.plan(3); - var vars = binary(new Buffer('\x63foo bar baz')) - .word8('a') - .scan('b', '\r\n') - .word8('c') - .vars - ; - - t.same(vars.a, 99); - t.same(vars.b.toString(), 'foo bar baz'); - t.strictEqual(vars.c, null); -}); diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/skip.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/skip.js deleted file mode 100644 index 6a26051fcdb..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/skip.js +++ /dev/null @@ -1,58 +0,0 @@ -var binary = require('../'); -var test = require('tap').test; -var EventEmitter = require('events').EventEmitter; -var seq = require('seq'); - -test('skip', function (t) { - t.plan(7); - var em = new EventEmitter; - var state = 0; - - binary(em) - .word16lu('a') - .tap(function () { state = 1 }) - .skip(7) - .tap(function () { state = 2 }) - .word8('b') - .tap(function () { state = 3 }) - .tap(function (vars) { - t.same(state, 3); - t.same(vars, { - a : 2569, - b : 8, - }); - }) - ; - - seq() - .seq(setTimeout, seq, 20) - .seq(function () { - t.same(state, 0); - em.emit('data', new Buffer([ 9 ])); - this(null); - }) - .seq(setTimeout, seq, 5) - .seq(function () { - t.same(state, 0); - em.emit('data', new Buffer([ 10, 1, 2 ])); - this(null); - }) - .seq(setTimeout, seq, 30) - .seq(function () { - t.same(state, 1); - em.emit('data', new Buffer([ 3, 4, 5 ])); - this(null); - }) - .seq(setTimeout, seq, 15) - .seq(function () { - t.same(state, 1); - em.emit('data', new Buffer([ 6, 7 ])); - this(null); - }) - .seq(function () { - t.same(state, 2); - em.emit('data', new Buffer([ 8 ])); - this(null); - }) - ; -}); diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/split.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/split.js deleted file mode 100644 index cb9dffcc71a..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/binary/test/split.js +++ /dev/null @@ -1,34 +0,0 @@ -var binary = require('../'); -var test = require('tap').test; -var EventEmitter = require('events').EventEmitter; - -test('split', function (t) { - t.plan(1); - - var em = new EventEmitter; - binary.stream(em) - .word8('a') - .word16be('bc') - .word32ls('x') - .word32bs('y') - .tap(function (vars) { - t.same(vars, { - a : 97, - bc : 25187, - x : 621609828, - y : 621609828, - }); - }) - ; - - em.emit('data', new Buffer([ 97, 98 ])); - setTimeout(function () { - em.emit('data', new Buffer([ 99, 100 ])); - }, 25); - setTimeout(function () { - em.emit('data', new Buffer([ 3, 13, 37, 37 ])); - }, 30); - setTimeout(function () { - em.emit('data', new Buffer([ 13, 3, 100 ])); - }, 40); -}); diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/.npmignore b/src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/.npmignore deleted file mode 100644 index c8f50f7cd31..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/.npmignore +++ /dev/null @@ -1 +0,0 @@ -npm-debug.log diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/LICENSE b/src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/LICENSE deleted file mode 100644 index 45b6725d749..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/LICENSE +++ /dev/null @@ -1,7 +0,0 @@ -Copyright (C) 2012 Jonathan Rajavuori - -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/src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/README.md b/src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/README.md deleted file mode 100644 index 1a6b51dd207..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/README.md +++ /dev/null @@ -1,27 +0,0 @@ -# mkpath - -Make all directories in a path, like `mkdir -p`. - -## How to use - - var mkpath = require('mkpath'); - - mkpath('red/green/violet', function (err) { - if (err) throw err; - console.log('Directory structure red/green/violet created'); - }); - - mkpath.sync('/tmp/blue/orange', 0700); - -### mkpath(path, [mode = 0777 & (~process.umask()),] [callback]) - -Create all directories that don't exist in `path` with permissions `mode`. When finished, `callback(err)` fires with the error, if any. - -### mkpath.sync(path, [mode = 0777 & (~process.umask())]); - -Synchronous version of the same. Throws error, if any. - -## License - -This software is released under the [MIT license](http://www.opensource.org/licenses/MIT). - diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/mkpath.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/mkpath.js deleted file mode 100644 index aa62f040607..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/mkpath.js +++ /dev/null @@ -1,59 +0,0 @@ -var fs = require('fs'); -var path = require('path'); - -var mkpath = function mkpath(dirpath, mode, callback) { - dirpath = path.resolve(dirpath); - - if (typeof mode === 'function' || typeof mode === 'undefined') { - callback = mode; - mode = 0777 & (~process.umask()); - } - - if (!callback) { - callback = function () {}; - } - - fs.stat(dirpath, function (err, stats) { - if (err) { - if (err.code === 'ENOENT') { - mkpath(path.dirname(dirpath), mode, function (err) { - if (err) { - callback(err); - } else { - fs.mkdir(dirpath, mode, callback); - } - }); - } else { - callback(err); - } - } else if (stats.isDirectory()) { - callback(null); - } else { - callback(new Error(dirpath + ' exists and is not a directory')); - } - }); -}; - -mkpath.sync = function mkpathsync(dirpath, mode) { - dirpath = path.resolve(dirpath); - - if (typeof mode === 'undefined') { - mode = 0777 & (~process.umask()); - } - - try { - if (!fs.statSync(dirpath).isDirectory()) { - throw new Error(dirpath + ' exists and is not a directory'); - } - } catch (err) { - if (err.code === 'ENOENT') { - mkpathsync(path.dirname(dirpath), mode); - fs.mkdirSync(dirpath, mode); - } else { - throw err; - } - } -}; - -module.exports = mkpath; - diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/package.json b/src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/package.json deleted file mode 100644 index e5dbbfcef72..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "mkpath", - "version": "0.1.0", - "author": { - "name": "Jonathan Rajavuori", - "email": "jrajav@gmail.com" - }, - "description": "Make all directories in a path, like mkdir -p", - "repository": { - "type": "git", - "url": "https://github.com/jrajav/mkpath" - }, - "keywords": [ - "mkdir", - "mkdirp", - "directory", - "path", - "tree" - ], - "main": "./mkpath", - "scripts": { - "test": "node node_modules/tap/bin/tap.js ./test" - }, - "devDependencies": { - "tap": "~0.3" - }, - "license": "MIT", - "readme": "# mkpath\n\nMake all directories in a path, like `mkdir -p`.\n\n## How to use\n\n var mkpath = require('mkpath');\n \n mkpath('red/green/violet', function (err) {\n if (err) throw err;\n console.log('Directory structure red/green/violet created');\n });\n \n mkpath.sync('/tmp/blue/orange', 0700);\n\n### mkpath(path, [mode = 0777 & (~process.umask()),] [callback])\n\nCreate all directories that don't exist in `path` with permissions `mode`. When finished, `callback(err)` fires with the error, if any.\n\n### mkpath.sync(path, [mode = 0777 & (~process.umask())]);\n\nSynchronous version of the same. Throws error, if any.\n\n## License\n\nThis software is released under the [MIT license](http://www.opensource.org/licenses/MIT).\n\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/jrajav/mkpath/issues" - }, - "_id": "mkpath@0.1.0", - "_from": "mkpath@~0.1.0" -} diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/test/chmod.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/test/chmod.js deleted file mode 100644 index 96d51bd3bc8..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/test/chmod.js +++ /dev/null @@ -1,42 +0,0 @@ -/* Tests borrowed from substack's node-mkdirp - * https://github.com/substack/node-mkdirp */ - -var mkpath = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -var ps = [ '', 'tmp' ]; - -for (var i = 0; i < 25; i++) { - var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - ps.push(dir); -} - -var file = ps.join('/'); - -test('chmod-pre', function (t) { - var mode = 0744 - mkpath(file, mode, function (er) { - t.ifError(er, 'should not error'); - fs.stat(file, function (er, stat) { - t.ifError(er, 'should exist'); - t.ok(stat && stat.isDirectory(), 'should be directory'); - t.equal(stat && stat.mode & 0777, mode, 'should be 0744'); - t.end(); - }); - }); -}); - -test('chmod', function (t) { - var mode = 0755 - mkpath(file, mode, function (er) { - t.ifError(er, 'should not error'); - fs.stat(file, function (er, stat) { - t.ifError(er, 'should exist'); - t.ok(stat && stat.isDirectory(), 'should be directory'); - t.end(); - }); - }); -}); - diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/test/clobber.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/test/clobber.js deleted file mode 100644 index 16d48ca104e..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/test/clobber.js +++ /dev/null @@ -1,41 +0,0 @@ -/* Tests borrowed from substack's node-mkdirp - * https://github.com/substack/node-mkdirp */ - -var mkpath = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -var ps = [ '', 'tmp' ]; - -for (var i = 0; i < 25; i++) { - var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - ps.push(dir); -} - -var file = ps.join('/'); - -// a file in the way -var itw = ps.slice(0, 3).join('/'); - - -test('clobber-pre', function (t) { - console.error("about to write to "+itw) - fs.writeFileSync(itw, 'I AM IN THE WAY, THE TRUTH, AND THE LIGHT.'); - - fs.stat(itw, function (er, stat) { - t.ifError(er) - t.ok(stat && stat.isFile(), 'should be file') - t.end() - }) -}) - -test('clobber', function (t) { - t.plan(2); - mkpath(file, 0755, function (err) { - t.ok(err); - t.equal(err.code, 'ENOTDIR'); - t.end(); - }); -}); - diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/test/mkpath.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/test/mkpath.js deleted file mode 100644 index 75cd4ec5e28..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/test/mkpath.js +++ /dev/null @@ -1,32 +0,0 @@ -/* Tests borrowed from substack's node-mkdirp - * https://github.com/substack/node-mkdirp */ - -var mkpath = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('woo', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - mkpath(file, 0755, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) - }); -}); - diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/test/perm.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/test/perm.js deleted file mode 100644 index bb09d2024a5..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/test/perm.js +++ /dev/null @@ -1,36 +0,0 @@ -/* Tests borrowed from substack's node-mkdirp - * https://github.com/substack/node-mkdirp */ - -var mkpath = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('async perm', function (t) { - t.plan(2); - var file = '/tmp/' + (Math.random() * (1<<30)).toString(16); - - mkpath(file, 0755, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) - }); -}); - -test('async root perm', function (t) { - mkpath('/tmp', 0755, function (err) { - if (err) t.fail(err); - t.end(); - }); - t.end(); -}); - diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/test/perm_sync.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/test/perm_sync.js deleted file mode 100644 index ee7f330c503..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/test/perm_sync.js +++ /dev/null @@ -1,43 +0,0 @@ -/* Tests borrowed from substack's node-mkdirp - * https://github.com/substack/node-mkdirp */ - -var mkpath = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('sync perm', function (t) { - t.plan(2); - var file = '/tmp/' + (Math.random() * (1<<30)).toString(16) + '.json'; - - mkpath.sync(file, 0755); - path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }); -}); - -test('sync root perm', function (t) { - t.plan(1); - - var file = '/tmp'; - mkpath.sync(file, 0755); - path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }); -}); - diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/test/rel.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/test/rel.js deleted file mode 100644 index 20ea10e46ac..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/test/rel.js +++ /dev/null @@ -1,36 +0,0 @@ -/* Tests borrowed from substack's node-mkdirp - * https://github.com/substack/node-mkdirp */ - -var mkpath = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('rel', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var cwd = process.cwd(); - process.chdir('/tmp'); - - var file = [x,y,z].join('/'); - - mkpath(file, 0755, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - process.chdir(cwd); - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) - }); -}); - diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/test/root.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/test/root.js deleted file mode 100644 index 78d4a027afb..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/test/root.js +++ /dev/null @@ -1,22 +0,0 @@ -/* Tests borrowed from substack's node-mkdirp - * https://github.com/substack/node-mkdirp */ - -var mkpath = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('root', function (t) { - // '/' on unix, 'c:/' on windows. - var file = path.resolve('/'); - - mkpath(file, 0755, function (err) { - if (err) throw err - fs.stat(file, function (er, stat) { - if (er) throw er - t.ok(stat.isDirectory(), 'target is a directory'); - t.end(); - }) - }); -}); - diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/test/sync.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/test/sync.js deleted file mode 100644 index 20fbc4739f6..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/test/sync.js +++ /dev/null @@ -1,36 +0,0 @@ -/* Tests borrowed from substack's node-mkdirp - * https://github.com/substack/node-mkdirp */ - -var mkpath = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('sync', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - try { - mkpath.sync(file, 0755); - } catch (err) { - t.fail(err); - return t.end(); - } - - path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }); - }); -}); - diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/test/umask.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/test/umask.js deleted file mode 100644 index d2f8a71e6b9..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/test/umask.js +++ /dev/null @@ -1,32 +0,0 @@ -/* Tests borrowed from substack's node-mkdirp - * https://github.com/substack/node-mkdirp */ - -var mkpath = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('implicit mode from umask', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - mkpath(file, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0777 & (~process.umask())); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) - }); -}); - diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/test/umask_sync.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/test/umask_sync.js deleted file mode 100644 index 4b9e7ba739b..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/mkpath/test/umask_sync.js +++ /dev/null @@ -1,36 +0,0 @@ -/* Tests borrowed from substack's node-mkdirp - * https://github.com/substack/node-mkdirp */ - -var mkpath = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('umask sync modes', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - try { - mkpath.sync(file); - } catch (err) { - t.fail(err); - return t.end(); - } - - path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, (0777 & (~process.umask()))); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }); - }); -}); - diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/nopt/.npmignore b/src/extensibility/node/node_modules/decompress-zip/node_modules/nopt/.npmignore deleted file mode 100644 index 3c3629e647f..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/nopt/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/nopt/LICENSE b/src/extensibility/node/node_modules/decompress-zip/node_modules/nopt/LICENSE deleted file mode 100644 index 05a4010949c..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/nopt/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright 2009, 2010, 2011 Isaac Z. Schlueter. -All rights reserved. - -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/src/extensibility/node/node_modules/decompress-zip/node_modules/nopt/README.md b/src/extensibility/node/node_modules/decompress-zip/node_modules/nopt/README.md deleted file mode 100644 index f290da8f4f7..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/nopt/README.md +++ /dev/null @@ -1,210 +0,0 @@ -If you want to write an option parser, and have it be good, there are -two ways to do it. The Right Way, and the Wrong Way. - -The Wrong Way is to sit down and write an option parser. We've all done -that. - -The Right Way is to write some complex configurable program with so many -options that you go half-insane just trying to manage them all, and put -it off with duct-tape solutions until you see exactly to the core of the -problem, and finally snap and write an awesome option parser. - -If you want to write an option parser, don't write an option parser. -Write a package manager, or a source control system, or a service -restarter, or an operating system. You probably won't end up with a -good one of those, but if you don't give up, and you are relentless and -diligent enough in your procrastination, you may just end up with a very -nice option parser. - -## USAGE - - // my-program.js - var nopt = require("nopt") - , Stream = require("stream").Stream - , path = require("path") - , knownOpts = { "foo" : [String, null] - , "bar" : [Stream, Number] - , "baz" : path - , "bloo" : [ "big", "medium", "small" ] - , "flag" : Boolean - , "pick" : Boolean - , "many" : [String, Array] - } - , shortHands = { "foofoo" : ["--foo", "Mr. Foo"] - , "b7" : ["--bar", "7"] - , "m" : ["--bloo", "medium"] - , "p" : ["--pick"] - , "f" : ["--flag"] - } - // everything is optional. - // knownOpts and shorthands default to {} - // arg list defaults to process.argv - // slice defaults to 2 - , parsed = nopt(knownOpts, shortHands, process.argv, 2) - console.log(parsed) - -This would give you support for any of the following: - -```bash -$ node my-program.js --foo "blerp" --no-flag -{ "foo" : "blerp", "flag" : false } - -$ node my-program.js ---bar 7 --foo "Mr. Hand" --flag -{ bar: 7, foo: "Mr. Hand", flag: true } - -$ node my-program.js --foo "blerp" -f -----p -{ foo: "blerp", flag: true, pick: true } - -$ node my-program.js -fp --foofoo -{ foo: "Mr. Foo", flag: true, pick: true } - -$ node my-program.js --foofoo -- -fp # -- stops the flag parsing. -{ foo: "Mr. Foo", argv: { remain: ["-fp"] } } - -$ node my-program.js --blatzk 1000 -fp # unknown opts are ok. -{ blatzk: 1000, flag: true, pick: true } - -$ node my-program.js --blatzk true -fp # but they need a value -{ blatzk: true, flag: true, pick: true } - -$ node my-program.js --no-blatzk -fp # unless they start with "no-" -{ blatzk: false, flag: true, pick: true } - -$ node my-program.js --baz b/a/z # known paths are resolved. -{ baz: "/Users/isaacs/b/a/z" } - -# if Array is one of the types, then it can take many -# values, and will always be an array. The other types provided -# specify what types are allowed in the list. - -$ node my-program.js --many 1 --many null --many foo -{ many: ["1", "null", "foo"] } - -$ node my-program.js --many foo -{ many: ["foo"] } -``` - -Read the tests at the bottom of `lib/nopt.js` for more examples of -what this puppy can do. - -## Types - -The following types are supported, and defined on `nopt.typeDefs` - -* String: A normal string. No parsing is done. -* path: A file system path. Gets resolved against cwd if not absolute. -* url: A url. If it doesn't parse, it isn't accepted. -* Number: Must be numeric. -* Date: Must parse as a date. If it does, and `Date` is one of the options, - then it will return a Date object, not a string. -* Boolean: Must be either `true` or `false`. If an option is a boolean, - then it does not need a value, and its presence will imply `true` as - the value. To negate boolean flags, do `--no-whatever` or `--whatever - false` -* NaN: Means that the option is strictly not allowed. Any value will - fail. -* Stream: An object matching the "Stream" class in node. Valuable - for use when validating programmatically. (npm uses this to let you - supply any WriteStream on the `outfd` and `logfd` config options.) -* Array: If `Array` is specified as one of the types, then the value - will be parsed as a list of options. This means that multiple values - can be specified, and that the value will always be an array. - -If a type is an array of values not on this list, then those are -considered valid values. For instance, in the example above, the -`--bloo` option can only be one of `"big"`, `"medium"`, or `"small"`, -and any other value will be rejected. - -When parsing unknown fields, `"true"`, `"false"`, and `"null"` will be -interpreted as their JavaScript equivalents, and numeric values will be -interpreted as a number. - -You can also mix types and values, or multiple types, in a list. For -instance `{ blah: [Number, null] }` would allow a value to be set to -either a Number or null. When types are ordered, this implies a -preference, and the first type that can be used to properly interpret -the value will be used. - -To define a new type, add it to `nopt.typeDefs`. Each item in that -hash is an object with a `type` member and a `validate` method. The -`type` member is an object that matches what goes in the type list. The -`validate` method is a function that gets called with `validate(data, -key, val)`. Validate methods should assign `data[key]` to the valid -value of `val` if it can be handled properly, or return boolean -`false` if it cannot. - -You can also call `nopt.clean(data, types, typeDefs)` to clean up a -config object and remove its invalid properties. - -## Error Handling - -By default, nopt outputs a warning to standard error when invalid -options are found. You can change this behavior by assigning a method -to `nopt.invalidHandler`. This method will be called with -the offending `nopt.invalidHandler(key, val, types)`. - -If no `nopt.invalidHandler` is assigned, then it will console.error -its whining. If it is assigned to boolean `false` then the warning is -suppressed. - -## Abbreviations - -Yes, they are supported. If you define options like this: - -```javascript -{ "foolhardyelephants" : Boolean -, "pileofmonkeys" : Boolean } -``` - -Then this will work: - -```bash -node program.js --foolhar --pil -node program.js --no-f --pileofmon -# etc. -``` - -## Shorthands - -Shorthands are a hash of shorter option names to a snippet of args that -they expand to. - -If multiple one-character shorthands are all combined, and the -combination does not unambiguously match any other option or shorthand, -then they will be broken up into their constituent parts. For example: - -```json -{ "s" : ["--loglevel", "silent"] -, "g" : "--global" -, "f" : "--force" -, "p" : "--parseable" -, "l" : "--long" -} -``` - -```bash -npm ls -sgflp -# just like doing this: -npm ls --loglevel silent --global --force --long --parseable -``` - -## The Rest of the args - -The config object returned by nopt is given a special member called -`argv`, which is an object with the following fields: - -* `remain`: The remaining args after all the parsing has occurred. -* `original`: The args as they originally appeared. -* `cooked`: The args after flags and shorthands are expanded. - -## Slicing - -Node programs are called with more or less the exact argv as it appears -in C land, after the v8 and node-specific options have been plucked off. -As such, `argv[0]` is always `node` and `argv[1]` is always the -JavaScript program being run. - -That's usually not very useful to you. So they're sliced off by -default. If you want them, then you can pass in `0` as the last -argument, or any other number that you'd like to slice off the start of -the list. diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/nopt/bin/nopt.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/nopt/bin/nopt.js deleted file mode 100755 index 30e9fdbab5d..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/nopt/bin/nopt.js +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env node -var nopt = require("../lib/nopt") - , types = { num: Number - , bool: Boolean - , help: Boolean - , list: Array - , "num-list": [Number, Array] - , "str-list": [String, Array] - , "bool-list": [Boolean, Array] - , str: String - , clear: Boolean - , config: Boolean - , length: Number - } - , shorthands = { s: [ "--str", "astring" ] - , b: [ "--bool" ] - , nb: [ "--no-bool" ] - , tft: [ "--bool-list", "--no-bool-list", "--bool-list", "true" ] - , "?": ["--help"] - , h: ["--help"] - , H: ["--help"] - , n: [ "--num", "125" ] - , c: ["--config"] - , l: ["--length"] - } - , parsed = nopt( types - , shorthands - , process.argv - , 2 ) - -console.log("parsed", parsed) - -if (parsed.help) { - console.log("") - console.log("nopt cli tester") - console.log("") - console.log("types") - console.log(Object.keys(types).map(function M (t) { - var type = types[t] - if (Array.isArray(type)) { - return [t, type.map(function (type) { return type.name })] - } - return [t, type && type.name] - }).reduce(function (s, i) { - s[i[0]] = i[1] - return s - }, {})) - console.log("") - console.log("shorthands") - console.log(shorthands) -} diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/nopt/examples/my-program.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/nopt/examples/my-program.js deleted file mode 100755 index 142447e18e7..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/nopt/examples/my-program.js +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env node - -//process.env.DEBUG_NOPT = 1 - -// my-program.js -var nopt = require("../lib/nopt") - , Stream = require("stream").Stream - , path = require("path") - , knownOpts = { "foo" : [String, null] - , "bar" : [Stream, Number] - , "baz" : path - , "bloo" : [ "big", "medium", "small" ] - , "flag" : Boolean - , "pick" : Boolean - } - , shortHands = { "foofoo" : ["--foo", "Mr. Foo"] - , "b7" : ["--bar", "7"] - , "m" : ["--bloo", "medium"] - , "p" : ["--pick"] - , "f" : ["--flag", "true"] - , "g" : ["--flag"] - , "s" : "--flag" - } - // everything is optional. - // knownOpts and shorthands default to {} - // arg list defaults to process.argv - // slice defaults to 2 - , parsed = nopt(knownOpts, shortHands, process.argv, 2) - -console.log("parsed =\n"+ require("util").inspect(parsed)) diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/nopt/lib/nopt.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/nopt/lib/nopt.js deleted file mode 100644 index 20f3b5b1ddd..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/nopt/lib/nopt.js +++ /dev/null @@ -1,612 +0,0 @@ -// info about each config option. - -var debug = process.env.DEBUG_NOPT || process.env.NOPT_DEBUG - ? function () { console.error.apply(console, arguments) } - : function () {} - -var url = require("url") - , path = require("path") - , Stream = require("stream").Stream - , abbrev = require("abbrev") - -module.exports = exports = nopt -exports.clean = clean - -exports.typeDefs = - { String : { type: String, validate: validateString } - , Boolean : { type: Boolean, validate: validateBoolean } - , url : { type: url, validate: validateUrl } - , Number : { type: Number, validate: validateNumber } - , path : { type: path, validate: validatePath } - , Stream : { type: Stream, validate: validateStream } - , Date : { type: Date, validate: validateDate } - } - -function nopt (types, shorthands, args, slice) { - args = args || process.argv - types = types || {} - shorthands = shorthands || {} - if (typeof slice !== "number") slice = 2 - - debug(types, shorthands, args, slice) - - args = args.slice(slice) - var data = {} - , key - , remain = [] - , cooked = args - , original = args.slice(0) - - parse(args, data, remain, types, shorthands) - // now data is full - clean(data, types, exports.typeDefs) - data.argv = {remain:remain,cooked:cooked,original:original} - Object.defineProperty(data.argv, 'toString', { value: function () { - return this.original.map(JSON.stringify).join(" ") - }, enumerable: false }) - return data -} - -function clean (data, types, typeDefs) { - typeDefs = typeDefs || exports.typeDefs - var remove = {} - , typeDefault = [false, true, null, String, Number, Array] - - Object.keys(data).forEach(function (k) { - if (k === "argv") return - var val = data[k] - , isArray = Array.isArray(val) - , type = types[k] - if (!isArray) val = [val] - if (!type) type = typeDefault - if (type === Array) type = typeDefault.concat(Array) - if (!Array.isArray(type)) type = [type] - - debug("val=%j", val) - debug("types=", type) - val = val.map(function (val) { - // if it's an unknown value, then parse false/true/null/numbers/dates - if (typeof val === "string") { - debug("string %j", val) - val = val.trim() - if ((val === "null" && ~type.indexOf(null)) - || (val === "true" && - (~type.indexOf(true) || ~type.indexOf(Boolean))) - || (val === "false" && - (~type.indexOf(false) || ~type.indexOf(Boolean)))) { - val = JSON.parse(val) - debug("jsonable %j", val) - } else if (~type.indexOf(Number) && !isNaN(val)) { - debug("convert to number", val) - val = +val - } else if (~type.indexOf(Date) && !isNaN(Date.parse(val))) { - debug("convert to date", val) - val = new Date(val) - } - } - - if (!types.hasOwnProperty(k)) { - return val - } - - // allow `--no-blah` to set 'blah' to null if null is allowed - if (val === false && ~type.indexOf(null) && - !(~type.indexOf(false) || ~type.indexOf(Boolean))) { - val = null - } - - var d = {} - d[k] = val - debug("prevalidated val", d, val, types[k]) - if (!validate(d, k, val, types[k], typeDefs)) { - if (exports.invalidHandler) { - exports.invalidHandler(k, val, types[k], data) - } else if (exports.invalidHandler !== false) { - debug("invalid: "+k+"="+val, types[k]) - } - return remove - } - debug("validated val", d, val, types[k]) - return d[k] - }).filter(function (val) { return val !== remove }) - - if (!val.length) delete data[k] - else if (isArray) { - debug(isArray, data[k], val) - data[k] = val - } else data[k] = val[0] - - debug("k=%s val=%j", k, val, data[k]) - }) -} - -function validateString (data, k, val) { - data[k] = String(val) -} - -function validatePath (data, k, val) { - data[k] = path.resolve(String(val)) - return true -} - -function validateNumber (data, k, val) { - debug("validate Number %j %j %j", k, val, isNaN(val)) - if (isNaN(val)) return false - data[k] = +val -} - -function validateDate (data, k, val) { - debug("validate Date %j %j %j", k, val, Date.parse(val)) - var s = Date.parse(val) - if (isNaN(s)) return false - data[k] = new Date(val) -} - -function validateBoolean (data, k, val) { - if (val instanceof Boolean) val = val.valueOf() - else if (typeof val === "string") { - if (!isNaN(val)) val = !!(+val) - else if (val === "null" || val === "false") val = false - else val = true - } else val = !!val - data[k] = val -} - -function validateUrl (data, k, val) { - val = url.parse(String(val)) - if (!val.host) return false - data[k] = val.href -} - -function validateStream (data, k, val) { - if (!(val instanceof Stream)) return false - data[k] = val -} - -function validate (data, k, val, type, typeDefs) { - // arrays are lists of types. - if (Array.isArray(type)) { - for (var i = 0, l = type.length; i < l; i ++) { - if (type[i] === Array) continue - if (validate(data, k, val, type[i], typeDefs)) return true - } - delete data[k] - return false - } - - // an array of anything? - if (type === Array) return true - - // NaN is poisonous. Means that something is not allowed. - if (type !== type) { - debug("Poison NaN", k, val, type) - delete data[k] - return false - } - - // explicit list of values - if (val === type) { - debug("Explicitly allowed %j", val) - // if (isArray) (data[k] = data[k] || []).push(val) - // else data[k] = val - data[k] = val - return true - } - - // now go through the list of typeDefs, validate against each one. - var ok = false - , types = Object.keys(typeDefs) - for (var i = 0, l = types.length; i < l; i ++) { - debug("test type %j %j %j", k, val, types[i]) - var t = typeDefs[types[i]] - if (t && type === t.type) { - var d = {} - ok = false !== t.validate(d, k, val) - val = d[k] - if (ok) { - // if (isArray) (data[k] = data[k] || []).push(val) - // else data[k] = val - data[k] = val - break - } - } - } - debug("OK? %j (%j %j %j)", ok, k, val, types[i]) - - if (!ok) delete data[k] - return ok -} - -function parse (args, data, remain, types, shorthands) { - debug("parse", args, data, remain) - - var key = null - , abbrevs = abbrev(Object.keys(types)) - , shortAbbr = abbrev(Object.keys(shorthands)) - - for (var i = 0; i < args.length; i ++) { - var arg = args[i] - debug("arg", arg) - - if (arg.match(/^-{2,}$/)) { - // done with keys. - // the rest are args. - remain.push.apply(remain, args.slice(i + 1)) - args[i] = "--" - break - } - var hadEq = false - if (arg.charAt(0) === "-" && arg.length > 1) { - if (arg.indexOf("=") !== -1) { - hadEq = true - var v = arg.split("=") - arg = v.shift() - v = v.join("=") - args.splice.apply(args, [i, 1].concat([arg, v])) - } - - // see if it's a shorthand - // if so, splice and back up to re-parse it. - var shRes = resolveShort(arg, shorthands, shortAbbr, abbrevs) - debug("arg=%j shRes=%j", arg, shRes) - if (shRes) { - debug(arg, shRes) - args.splice.apply(args, [i, 1].concat(shRes)) - if (arg !== shRes[0]) { - i -- - continue - } - } - arg = arg.replace(/^-+/, "") - var no = null - while (arg.toLowerCase().indexOf("no-") === 0) { - no = !no - arg = arg.substr(3) - } - - if (abbrevs[arg]) arg = abbrevs[arg] - - var isArray = types[arg] === Array || - Array.isArray(types[arg]) && types[arg].indexOf(Array) !== -1 - - // allow unknown things to be arrays if specified multiple times. - if (!types.hasOwnProperty(arg) && data.hasOwnProperty(arg)) { - if (!Array.isArray(data[arg])) - data[arg] = [data[arg]] - isArray = true - } - - var val - , la = args[i + 1] - - var isBool = typeof no === 'boolean' || - types[arg] === Boolean || - Array.isArray(types[arg]) && types[arg].indexOf(Boolean) !== -1 || - (typeof types[arg] === 'undefined' && !hadEq) || - (la === "false" && - (types[arg] === null || - Array.isArray(types[arg]) && ~types[arg].indexOf(null))) - - if (isBool) { - // just set and move along - val = !no - // however, also support --bool true or --bool false - if (la === "true" || la === "false") { - val = JSON.parse(la) - la = null - if (no) val = !val - i ++ - } - - // also support "foo":[Boolean, "bar"] and "--foo bar" - if (Array.isArray(types[arg]) && la) { - if (~types[arg].indexOf(la)) { - // an explicit type - val = la - i ++ - } else if ( la === "null" && ~types[arg].indexOf(null) ) { - // null allowed - val = null - i ++ - } else if ( !la.match(/^-{2,}[^-]/) && - !isNaN(la) && - ~types[arg].indexOf(Number) ) { - // number - val = +la - i ++ - } else if ( !la.match(/^-[^-]/) && ~types[arg].indexOf(String) ) { - // string - val = la - i ++ - } - } - - if (isArray) (data[arg] = data[arg] || []).push(val) - else data[arg] = val - - continue - } - - if (la && la.match(/^-{2,}$/)) { - la = undefined - i -- - } - - val = la === undefined ? true : la - if (isArray) (data[arg] = data[arg] || []).push(val) - else data[arg] = val - - i ++ - continue - } - remain.push(arg) - } -} - -function resolveShort (arg, shorthands, shortAbbr, abbrevs) { - // handle single-char shorthands glommed together, like - // npm ls -glp, but only if there is one dash, and only if - // all of the chars are single-char shorthands, and it's - // not a match to some other abbrev. - arg = arg.replace(/^-+/, '') - - // if it's an exact known option, then don't go any further - if (abbrevs[arg] === arg) - return null - - // if it's an exact known shortopt, same deal - if (shorthands[arg]) { - // make it an array, if it's a list of words - if (shorthands[arg] && !Array.isArray(shorthands[arg])) - shorthands[arg] = shorthands[arg].split(/\s+/) - - return shorthands[arg] - } - - // first check to see if this arg is a set of single-char shorthands - var singles = shorthands.___singles - if (!singles) { - singles = Object.keys(shorthands).filter(function (s) { - return s.length === 1 - }).reduce(function (l,r) { - l[r] = true - return l - }, {}) - shorthands.___singles = singles - debug('shorthand singles', singles) - } - - var chrs = arg.split("").filter(function (c) { - return singles[c] - }) - - if (chrs.join("") === arg) return chrs.map(function (c) { - return shorthands[c] - }).reduce(function (l, r) { - return l.concat(r) - }, []) - - - // if it's an arg abbrev, and not a literal shorthand, then prefer the arg - if (abbrevs[arg] && !shorthands[arg]) - return null - - // if it's an abbr for a shorthand, then use that - if (shortAbbr[arg]) - arg = shortAbbr[arg] - - // make it an array, if it's a list of words - if (shorthands[arg] && !Array.isArray(shorthands[arg])) - shorthands[arg] = shorthands[arg].split(/\s+/) - - return shorthands[arg] -} - -if (module === require.main) { -var assert = require("assert") - , util = require("util") - - , shorthands = - { s : ["--loglevel", "silent"] - , d : ["--loglevel", "info"] - , dd : ["--loglevel", "verbose"] - , ddd : ["--loglevel", "silly"] - , noreg : ["--no-registry"] - , reg : ["--registry"] - , "no-reg" : ["--no-registry"] - , silent : ["--loglevel", "silent"] - , verbose : ["--loglevel", "verbose"] - , h : ["--usage"] - , H : ["--usage"] - , "?" : ["--usage"] - , help : ["--usage"] - , v : ["--version"] - , f : ["--force"] - , desc : ["--description"] - , "no-desc" : ["--no-description"] - , "local" : ["--no-global"] - , l : ["--long"] - , p : ["--parseable"] - , porcelain : ["--parseable"] - , g : ["--global"] - } - - , types = - { aoa: Array - , nullstream: [null, Stream] - , date: Date - , str: String - , browser : String - , cache : path - , color : ["always", Boolean] - , depth : Number - , description : Boolean - , dev : Boolean - , editor : path - , force : Boolean - , global : Boolean - , globalconfig : path - , group : [String, Number] - , gzipbin : String - , logfd : [Number, Stream] - , loglevel : ["silent","win","error","warn","info","verbose","silly"] - , long : Boolean - , "node-version" : [false, String] - , npaturl : url - , npat : Boolean - , "onload-script" : [false, String] - , outfd : [Number, Stream] - , parseable : Boolean - , pre: Boolean - , prefix: path - , proxy : url - , "rebuild-bundle" : Boolean - , registry : url - , searchopts : String - , searchexclude: [null, String] - , shell : path - , t: [Array, String] - , tag : String - , tar : String - , tmp : path - , "unsafe-perm" : Boolean - , usage : Boolean - , user : String - , username : String - , userconfig : path - , version : Boolean - , viewer: path - , _exit : Boolean - } - -; [["-v", {version:true}, []] - ,["---v", {version:true}, []] - ,["ls -s --no-reg connect -d", - {loglevel:"info",registry:null},["ls","connect"]] - ,["ls ---s foo",{loglevel:"silent"},["ls","foo"]] - ,["ls --registry blargle", {}, ["ls"]] - ,["--no-registry", {registry:null}, []] - ,["--no-color true", {color:false}, []] - ,["--no-color false", {color:true}, []] - ,["--no-color", {color:false}, []] - ,["--color false", {color:false}, []] - ,["--color --logfd 7", {logfd:7,color:true}, []] - ,["--color=true", {color:true}, []] - ,["--logfd=10", {logfd:10}, []] - ,["--tmp=/tmp -tar=gtar",{tmp:"/tmp",tar:"gtar"},[]] - ,["--tmp=tmp -tar=gtar", - {tmp:path.resolve(process.cwd(), "tmp"),tar:"gtar"},[]] - ,["--logfd x", {}, []] - ,["a -true -- -no-false", {true:true},["a","-no-false"]] - ,["a -no-false", {false:false},["a"]] - ,["a -no-no-true", {true:true}, ["a"]] - ,["a -no-no-no-false", {false:false}, ["a"]] - ,["---NO-no-No-no-no-no-nO-no-no"+ - "-No-no-no-no-no-no-no-no-no"+ - "-no-no-no-no-NO-NO-no-no-no-no-no-no"+ - "-no-body-can-do-the-boogaloo-like-I-do" - ,{"body-can-do-the-boogaloo-like-I-do":false}, []] - ,["we are -no-strangers-to-love "+ - "--you-know=the-rules --and=so-do-i "+ - "---im-thinking-of=a-full-commitment "+ - "--no-you-would-get-this-from-any-other-guy "+ - "--no-gonna-give-you-up "+ - "-no-gonna-let-you-down=true "+ - "--no-no-gonna-run-around false "+ - "--desert-you=false "+ - "--make-you-cry false "+ - "--no-tell-a-lie "+ - "--no-no-and-hurt-you false" - ,{"strangers-to-love":false - ,"you-know":"the-rules" - ,"and":"so-do-i" - ,"you-would-get-this-from-any-other-guy":false - ,"gonna-give-you-up":false - ,"gonna-let-you-down":false - ,"gonna-run-around":false - ,"desert-you":false - ,"make-you-cry":false - ,"tell-a-lie":false - ,"and-hurt-you":false - },["we", "are"]] - ,["-t one -t two -t three" - ,{t: ["one", "two", "three"]} - ,[]] - ,["-t one -t null -t three four five null" - ,{t: ["one", "null", "three"]} - ,["four", "five", "null"]] - ,["-t foo" - ,{t:["foo"]} - ,[]] - ,["--no-t" - ,{t:["false"]} - ,[]] - ,["-no-no-t" - ,{t:["true"]} - ,[]] - ,["-aoa one -aoa null -aoa 100" - ,{aoa:["one", null, 100]} - ,[]] - ,["-str 100" - ,{str:"100"} - ,[]] - ,["--color always" - ,{color:"always"} - ,[]] - ,["--no-nullstream" - ,{nullstream:null} - ,[]] - ,["--nullstream false" - ,{nullstream:null} - ,[]] - ,["--notadate=2011-01-25" - ,{notadate: "2011-01-25"} - ,[]] - ,["--date 2011-01-25" - ,{date: new Date("2011-01-25")} - ,[]] - ,["-cl 1" - ,{config: true, length: 1} - ,[] - ,{config: Boolean, length: Number, clear: Boolean} - ,{c: "--config", l: "--length"}] - ,["--acount bla" - ,{"acount":true} - ,["bla"] - ,{account: Boolean, credentials: Boolean, options: String} - ,{a:"--account", c:"--credentials",o:"--options"}] - ,["--clear" - ,{clear:true} - ,[] - ,{clear:Boolean,con:Boolean,len:Boolean,exp:Boolean,add:Boolean,rep:Boolean} - ,{c:"--con",l:"--len",e:"--exp",a:"--add",r:"--rep"}] - ,["--file -" - ,{"file":"-"} - ,[] - ,{file:String} - ,{}] - ,["--file -" - ,{"file":true} - ,["-"] - ,{file:Boolean} - ,{}] - ].forEach(function (test) { - var argv = test[0].split(/\s+/) - , opts = test[1] - , rem = test[2] - , actual = nopt(test[3] || types, test[4] || shorthands, argv, 0) - , parsed = actual.argv - delete actual.argv - console.log(util.inspect(actual, false, 2, true), parsed.remain) - for (var i in opts) { - var e = JSON.stringify(opts[i]) - , a = JSON.stringify(actual[i] === undefined ? null : actual[i]) - if (e && typeof e === "object") { - assert.deepEqual(e, a) - } else { - assert.equal(e, a) - } - } - assert.deepEqual(rem, parsed.remain) - }) -} diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/nopt/node_modules/abbrev/LICENSE b/src/extensibility/node/node_modules/decompress-zip/node_modules/nopt/node_modules/abbrev/LICENSE deleted file mode 100644 index 05a4010949c..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/nopt/node_modules/abbrev/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright 2009, 2010, 2011 Isaac Z. Schlueter. -All rights reserved. - -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/src/extensibility/node/node_modules/decompress-zip/node_modules/nopt/node_modules/abbrev/README.md b/src/extensibility/node/node_modules/decompress-zip/node_modules/nopt/node_modules/abbrev/README.md deleted file mode 100644 index 99746fe67c4..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/nopt/node_modules/abbrev/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# abbrev-js - -Just like [ruby's Abbrev](http://apidock.com/ruby/Abbrev). - -Usage: - - var abbrev = require("abbrev"); - abbrev("foo", "fool", "folding", "flop"); - - // returns: - { fl: 'flop' - , flo: 'flop' - , flop: 'flop' - , fol: 'folding' - , fold: 'folding' - , foldi: 'folding' - , foldin: 'folding' - , folding: 'folding' - , foo: 'foo' - , fool: 'fool' - } - -This is handy for command-line scripts, or other cases where you want to be able to accept shorthands. diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/nopt/node_modules/abbrev/lib/abbrev.js b/src/extensibility/node/node_modules/decompress-zip/node_modules/nopt/node_modules/abbrev/lib/abbrev.js deleted file mode 100644 index bee4132c92b..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/nopt/node_modules/abbrev/lib/abbrev.js +++ /dev/null @@ -1,111 +0,0 @@ - -module.exports = exports = abbrev.abbrev = abbrev - -abbrev.monkeyPatch = monkeyPatch - -function monkeyPatch () { - Object.defineProperty(Array.prototype, 'abbrev', { - value: function () { return abbrev(this) }, - enumerable: false, configurable: true, writable: true - }) - - Object.defineProperty(Object.prototype, 'abbrev', { - value: function () { return abbrev(Object.keys(this)) }, - enumerable: false, configurable: true, writable: true - }) -} - -function abbrev (list) { - if (arguments.length !== 1 || !Array.isArray(list)) { - list = Array.prototype.slice.call(arguments, 0) - } - for (var i = 0, l = list.length, args = [] ; i < l ; i ++) { - args[i] = typeof list[i] === "string" ? list[i] : String(list[i]) - } - - // sort them lexicographically, so that they're next to their nearest kin - args = args.sort(lexSort) - - // walk through each, seeing how much it has in common with the next and previous - var abbrevs = {} - , prev = "" - for (var i = 0, l = args.length ; i < l ; i ++) { - var current = args[i] - , next = args[i + 1] || "" - , nextMatches = true - , prevMatches = true - if (current === next) continue - for (var j = 0, cl = current.length ; j < cl ; j ++) { - var curChar = current.charAt(j) - nextMatches = nextMatches && curChar === next.charAt(j) - prevMatches = prevMatches && curChar === prev.charAt(j) - if (!nextMatches && !prevMatches) { - j ++ - break - } - } - prev = current - if (j === cl) { - abbrevs[current] = current - continue - } - for (var a = current.substr(0, j) ; j <= cl ; j ++) { - abbrevs[a] = current - a += current.charAt(j) - } - } - return abbrevs -} - -function lexSort (a, b) { - return a === b ? 0 : a > b ? 1 : -1 -} - - -// tests -if (module === require.main) { - -var assert = require("assert") -var util = require("util") - -console.log("running tests") -function test (list, expect) { - var actual = abbrev(list) - assert.deepEqual(actual, expect, - "abbrev("+util.inspect(list)+") === " + util.inspect(expect) + "\n"+ - "actual: "+util.inspect(actual)) - actual = abbrev.apply(exports, list) - assert.deepEqual(abbrev.apply(exports, list), expect, - "abbrev("+list.map(JSON.stringify).join(",")+") === " + util.inspect(expect) + "\n"+ - "actual: "+util.inspect(actual)) -} - -test([ "ruby", "ruby", "rules", "rules", "rules" ], -{ rub: 'ruby' -, ruby: 'ruby' -, rul: 'rules' -, rule: 'rules' -, rules: 'rules' -}) -test(["fool", "foom", "pool", "pope"], -{ fool: 'fool' -, foom: 'foom' -, poo: 'pool' -, pool: 'pool' -, pop: 'pope' -, pope: 'pope' -}) -test(["a", "ab", "abc", "abcd", "abcde", "acde"], -{ a: 'a' -, ab: 'ab' -, abc: 'abc' -, abcd: 'abcd' -, abcde: 'abcde' -, ac: 'acde' -, acd: 'acde' -, acde: 'acde' -}) - -console.log("pass") - -} diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/nopt/node_modules/abbrev/package.json b/src/extensibility/node/node_modules/decompress-zip/node_modules/nopt/node_modules/abbrev/package.json deleted file mode 100644 index 55ed011bf1f..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/nopt/node_modules/abbrev/package.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "abbrev", - "version": "1.0.4", - "description": "Like ruby's abbrev module, but in js", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me" - }, - "main": "./lib/abbrev.js", - "scripts": { - "test": "node lib/abbrev.js" - }, - "repository": { - "type": "git", - "url": "http://github.com/isaacs/abbrev-js" - }, - "license": { - "type": "MIT", - "url": "https://github.com/isaacs/abbrev-js/raw/master/LICENSE" - }, - "readme": "# abbrev-js\n\nJust like [ruby's Abbrev](http://apidock.com/ruby/Abbrev).\n\nUsage:\n\n var abbrev = require(\"abbrev\");\n abbrev(\"foo\", \"fool\", \"folding\", \"flop\");\n \n // returns:\n { fl: 'flop'\n , flo: 'flop'\n , flop: 'flop'\n , fol: 'folding'\n , fold: 'folding'\n , foldi: 'folding'\n , foldin: 'folding'\n , folding: 'folding'\n , foo: 'foo'\n , fool: 'fool'\n }\n\nThis is handy for command-line scripts, or other cases where you want to be able to accept shorthands.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/abbrev-js/issues" - }, - "_id": "abbrev@1.0.4", - "_from": "abbrev@1" -} diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/nopt/package.json b/src/extensibility/node/node_modules/decompress-zip/node_modules/nopt/package.json deleted file mode 100644 index cdf2b96fb60..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/nopt/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "nopt", - "version": "2.1.2", - "description": "Option parsing for Node, supporting types, shorthands, etc. Used by npm.", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "main": "lib/nopt.js", - "scripts": { - "test": "node lib/nopt.js" - }, - "repository": { - "type": "git", - "url": "http://github.com/isaacs/nopt" - }, - "bin": { - "nopt": "./bin/nopt.js" - }, - "license": { - "type": "MIT", - "url": "https://github.com/isaacs/nopt/raw/master/LICENSE" - }, - "dependencies": { - "abbrev": "1" - }, - "readme": "If you want to write an option parser, and have it be good, there are\ntwo ways to do it. The Right Way, and the Wrong Way.\n\nThe Wrong Way is to sit down and write an option parser. We've all done\nthat.\n\nThe Right Way is to write some complex configurable program with so many\noptions that you go half-insane just trying to manage them all, and put\nit off with duct-tape solutions until you see exactly to the core of the\nproblem, and finally snap and write an awesome option parser.\n\nIf you want to write an option parser, don't write an option parser.\nWrite a package manager, or a source control system, or a service\nrestarter, or an operating system. You probably won't end up with a\ngood one of those, but if you don't give up, and you are relentless and\ndiligent enough in your procrastination, you may just end up with a very\nnice option parser.\n\n## USAGE\n\n // my-program.js\n var nopt = require(\"nopt\")\n , Stream = require(\"stream\").Stream\n , path = require(\"path\")\n , knownOpts = { \"foo\" : [String, null]\n , \"bar\" : [Stream, Number]\n , \"baz\" : path\n , \"bloo\" : [ \"big\", \"medium\", \"small\" ]\n , \"flag\" : Boolean\n , \"pick\" : Boolean\n , \"many\" : [String, Array]\n }\n , shortHands = { \"foofoo\" : [\"--foo\", \"Mr. Foo\"]\n , \"b7\" : [\"--bar\", \"7\"]\n , \"m\" : [\"--bloo\", \"medium\"]\n , \"p\" : [\"--pick\"]\n , \"f\" : [\"--flag\"]\n }\n // everything is optional.\n // knownOpts and shorthands default to {}\n // arg list defaults to process.argv\n // slice defaults to 2\n , parsed = nopt(knownOpts, shortHands, process.argv, 2)\n console.log(parsed)\n\nThis would give you support for any of the following:\n\n```bash\n$ node my-program.js --foo \"blerp\" --no-flag\n{ \"foo\" : \"blerp\", \"flag\" : false }\n\n$ node my-program.js ---bar 7 --foo \"Mr. Hand\" --flag\n{ bar: 7, foo: \"Mr. Hand\", flag: true }\n\n$ node my-program.js --foo \"blerp\" -f -----p\n{ foo: \"blerp\", flag: true, pick: true }\n\n$ node my-program.js -fp --foofoo\n{ foo: \"Mr. Foo\", flag: true, pick: true }\n\n$ node my-program.js --foofoo -- -fp # -- stops the flag parsing.\n{ foo: \"Mr. Foo\", argv: { remain: [\"-fp\"] } }\n\n$ node my-program.js --blatzk 1000 -fp # unknown opts are ok.\n{ blatzk: 1000, flag: true, pick: true }\n\n$ node my-program.js --blatzk true -fp # but they need a value\n{ blatzk: true, flag: true, pick: true }\n\n$ node my-program.js --no-blatzk -fp # unless they start with \"no-\"\n{ blatzk: false, flag: true, pick: true }\n\n$ node my-program.js --baz b/a/z # known paths are resolved.\n{ baz: \"/Users/isaacs/b/a/z\" }\n\n# if Array is one of the types, then it can take many\n# values, and will always be an array. The other types provided\n# specify what types are allowed in the list.\n\n$ node my-program.js --many 1 --many null --many foo\n{ many: [\"1\", \"null\", \"foo\"] }\n\n$ node my-program.js --many foo\n{ many: [\"foo\"] }\n```\n\nRead the tests at the bottom of `lib/nopt.js` for more examples of\nwhat this puppy can do.\n\n## Types\n\nThe following types are supported, and defined on `nopt.typeDefs`\n\n* String: A normal string. No parsing is done.\n* path: A file system path. Gets resolved against cwd if not absolute.\n* url: A url. If it doesn't parse, it isn't accepted.\n* Number: Must be numeric.\n* Date: Must parse as a date. If it does, and `Date` is one of the options,\n then it will return a Date object, not a string.\n* Boolean: Must be either `true` or `false`. If an option is a boolean,\n then it does not need a value, and its presence will imply `true` as\n the value. To negate boolean flags, do `--no-whatever` or `--whatever\n false`\n* NaN: Means that the option is strictly not allowed. Any value will\n fail.\n* Stream: An object matching the \"Stream\" class in node. Valuable\n for use when validating programmatically. (npm uses this to let you\n supply any WriteStream on the `outfd` and `logfd` config options.)\n* Array: If `Array` is specified as one of the types, then the value\n will be parsed as a list of options. This means that multiple values\n can be specified, and that the value will always be an array.\n\nIf a type is an array of values not on this list, then those are\nconsidered valid values. For instance, in the example above, the\n`--bloo` option can only be one of `\"big\"`, `\"medium\"`, or `\"small\"`,\nand any other value will be rejected.\n\nWhen parsing unknown fields, `\"true\"`, `\"false\"`, and `\"null\"` will be\ninterpreted as their JavaScript equivalents, and numeric values will be\ninterpreted as a number.\n\nYou can also mix types and values, or multiple types, in a list. For\ninstance `{ blah: [Number, null] }` would allow a value to be set to\neither a Number or null. When types are ordered, this implies a\npreference, and the first type that can be used to properly interpret\nthe value will be used.\n\nTo define a new type, add it to `nopt.typeDefs`. Each item in that\nhash is an object with a `type` member and a `validate` method. The\n`type` member is an object that matches what goes in the type list. The\n`validate` method is a function that gets called with `validate(data,\nkey, val)`. Validate methods should assign `data[key]` to the valid\nvalue of `val` if it can be handled properly, or return boolean\n`false` if it cannot.\n\nYou can also call `nopt.clean(data, types, typeDefs)` to clean up a\nconfig object and remove its invalid properties.\n\n## Error Handling\n\nBy default, nopt outputs a warning to standard error when invalid\noptions are found. You can change this behavior by assigning a method\nto `nopt.invalidHandler`. This method will be called with\nthe offending `nopt.invalidHandler(key, val, types)`.\n\nIf no `nopt.invalidHandler` is assigned, then it will console.error\nits whining. If it is assigned to boolean `false` then the warning is\nsuppressed.\n\n## Abbreviations\n\nYes, they are supported. If you define options like this:\n\n```javascript\n{ \"foolhardyelephants\" : Boolean\n, \"pileofmonkeys\" : Boolean }\n```\n\nThen this will work:\n\n```bash\nnode program.js --foolhar --pil\nnode program.js --no-f --pileofmon\n# etc.\n```\n\n## Shorthands\n\nShorthands are a hash of shorter option names to a snippet of args that\nthey expand to.\n\nIf multiple one-character shorthands are all combined, and the\ncombination does not unambiguously match any other option or shorthand,\nthen they will be broken up into their constituent parts. For example:\n\n```json\n{ \"s\" : [\"--loglevel\", \"silent\"]\n, \"g\" : \"--global\"\n, \"f\" : \"--force\"\n, \"p\" : \"--parseable\"\n, \"l\" : \"--long\"\n}\n```\n\n```bash\nnpm ls -sgflp\n# just like doing this:\nnpm ls --loglevel silent --global --force --long --parseable\n```\n\n## The Rest of the args\n\nThe config object returned by nopt is given a special member called\n`argv`, which is an object with the following fields:\n\n* `remain`: The remaining args after all the parsing has occurred.\n* `original`: The args as they originally appeared.\n* `cooked`: The args after flags and shorthands are expanded.\n\n## Slicing\n\nNode programs are called with more or less the exact argv as it appears\nin C land, after the v8 and node-specific options have been plucked off.\nAs such, `argv[0]` is always `node` and `argv[1]` is always the\nJavaScript program being run.\n\nThat's usually not very useful to you. So they're sliced off by\ndefault. If you want them, then you can pass in `0` as the last\nargument, or any other number that you'd like to slice off the start of\nthe list.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/nopt/issues" - }, - "_id": "nopt@2.1.2", - "_from": "nopt@~2.1.2" -} diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/q/CONTRIBUTING.md b/src/extensibility/node/node_modules/decompress-zip/node_modules/q/CONTRIBUTING.md deleted file mode 100644 index 500ab17b1f5..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/q/CONTRIBUTING.md +++ /dev/null @@ -1,40 +0,0 @@ - -For pull requests: - -- Be consistent with prevalent style and design decisions. -- Add a Jasmine spec to `specs/q-spec.js`. -- Use `npm test` to avoid regressions. -- Run tests in `q-spec/run.html` in as many supported browsers as you - can find the will to deal with. -- Do not build minified versions; we do this each release. -- If you would be so kind, add a note to `CHANGES.md` in an - appropriate section: - - - `Next Major Version` if it introduces backward incompatibilities - to code in the wild using documented features. - - `Next Minor Version` if it adds a new feature. - - `Next Patch Version` if it fixes a bug. - -For releases: - -- Run `npm test`. -- Run tests in `q-spec/run.html` in a representative sample of every - browser under the sun. -- Run `npm run cover` and make sure you're happy with the results. -- Run `npm run minify` and be sure to commit the resulting `q.min.js`. -- Note the Gzipped size output by the previous command, and update - `README.md` if it has changed to 1 significant digit. -- Stash any local changes. -- Update `CHANGES.md` to reflect all changes in the differences - between `HEAD` and the previous tagged version. Give credit where - credit is due. -- Update `README.md` to address all new, non-experimental features. -- Update the API reference on the Wiki to reflect all non-experimental - features. -- Use `npm version major|minor|patch` to update `package.json`, - commit, and tag the new version. -- Use `npm publish` to send up a new release. -- Send an email to the q-continuum mailing list announcing the new - release and the notes from the change log. This helps folks - maintaining other package ecosystems. - diff --git a/src/extensibility/node/node_modules/decompress-zip/node_modules/q/LICENSE b/src/extensibility/node/node_modules/decompress-zip/node_modules/q/LICENSE deleted file mode 100644 index 76c5fe4c01e..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/q/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ - -Copyright 2009–2012 Kristopher Michael Kowal. All rights reserved. -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/src/extensibility/node/node_modules/decompress-zip/node_modules/q/README.md b/src/extensibility/node/node_modules/decompress-zip/node_modules/q/README.md deleted file mode 100644 index c0f513cecb3..00000000000 --- a/src/extensibility/node/node_modules/decompress-zip/node_modules/q/README.md +++ /dev/null @@ -1,813 +0,0 @@ -[![Build Status](https://secure.travis-ci.org/kriskowal/q.png?branch=master)](http://travis-ci.org/kriskowal/q) - - - Promises/A+ logo - - -If a function cannot return a value or throw an exception without -blocking, it can return a promise instead. A promise is an object -that represents the return value or the thrown exception that the -function may eventually provide. A promise can also be used as a -proxy for a [remote object][Q-Connection] to overcome latency. - -[Q-Connection]: https://github.com/kriskowal/q-connection - -On the first pass, promises can mitigate the “[Pyramid of -Doom][POD]”: the situation where code marches to the right faster -than it marches forward. - -[POD]: http://calculist.org/blog/2011/12/14/why-coroutines-wont-work-on-the-web/ - -```javascript -step1(function (value1) { - step2(value1, function(value2) { - step3(value2, function(value3) { - step4(value3, function(value4) { - // Do something with value4 - }); - }); - }); -}); -``` - -With a promise library, you can flatten the pyramid. - -```javascript -Q.fcall(promisedStep1) -.then(promisedStep2) -.then(promisedStep3) -.then(promisedStep4) -.then(function (value4) { - // Do something with value4 -}) -.catch(function (error) { - // Handle any error from all above steps -}) -.done(); -``` - -With this approach, you also get implicit error propagation, just like `try`, -`catch`, and `finally`. An error in `promisedStep1` will flow all the way to -the `catch` function, where it’s caught and handled. (Here `promisedStepN` is -a version of `stepN` that returns a promise.) - -The callback approach is called an “inversion of control”. -A function that accepts a callback instead of a return value -is saying, “Don’t call me, I’ll call you.”. Promises -[un-invert][IOC] the inversion, cleanly separating the input -arguments from control flow arguments. This simplifies the -use and creation of API’s, particularly variadic, -rest and spread arguments. - -[IOC]: http://www.slideshare.net/domenicdenicola/callbacks-promises-and-coroutines-oh-my-the-evolution-of-asynchronicity-in-javascript - - -## Getting Started - -The Q module can be loaded as: - -- A `` - -``` - -## Documentation - -### Collections - -* [each](#each) -* [map](#map) -* [filter](#filter) -* [reject](#reject) -* [reduce](#reduce) -* [detect](#detect) -* [sortBy](#sortBy) -* [some](#some) -* [every](#every) -* [concat](#concat) - -### Control Flow - -* [series](#series) -* [parallel](#parallel) -* [whilst](#whilst) -* [doWhilst](#doWhilst) -* [until](#until) -* [doUntil](#doUntil) -* [forever](#forever) -* [waterfall](#waterfall) -* [compose](#compose) -* [applyEach](#applyEach) -* [queue](#queue) -* [cargo](#cargo) -* [auto](#auto) -* [iterator](#iterator) -* [apply](#apply) -* [nextTick](#nextTick) -* [times](#times) -* [timesSeries](#timesSeries) - -### Utils - -* [memoize](#memoize) -* [unmemoize](#unmemoize) -* [log](#log) -* [dir](#dir) -* [noConflict](#noConflict) - - -## Collections - - - -### each(arr, iterator, callback) - -Applies an iterator function to each item in an array, in parallel. -The iterator is called with an item from the list and a callback for when it -has finished. If the iterator passes an error to this callback, the main -callback for the each function is immediately called with the error. - -Note, that since this function applies the iterator to each item in parallel -there is no guarantee that the iterator functions will complete in order. - -__Arguments__ - -* arr - An array to iterate over. -* iterator(item, callback) - A function to apply to each item in the array. - The iterator is passed a callback(err) which must be called once it has - completed. If no error has occured, the callback should be run without - arguments or with an explicit null argument. -* callback(err) - A callback which is called after all the iterator functions - have finished, or an error has occurred. - -__Example__ - -```js -// assuming openFiles is an array of file names and saveFile is a function -// to save the modified contents of that file: - -async.each(openFiles, saveFile, function(err){ - // if any of the saves produced an error, err would equal that error -}); -``` - ---------------------------------------- - - - -### eachSeries(arr, iterator, callback) - -The same as each only the iterator is applied to each item in the array in -series. The next iterator is only called once the current one has completed -processing. This means the iterator functions will complete in order. - - ---------------------------------------- - - - -### eachLimit(arr, limit, iterator, callback) - -The same as each only no more than "limit" iterators will be simultaneously -running at any time. - -Note that the items are not processed in batches, so there is no guarantee that - the first "limit" iterator functions will complete before any others are -started. - -__Arguments__ - -* arr - An array to iterate over. -* limit - The maximum number of iterators to run at any time. -* iterator(item, callback) - A function to apply to each item in the array. - The iterator is passed a callback(err) which must be called once it has - completed. If no error has occured, the callback should be run without - arguments or with an explicit null argument. -* callback(err) - A callback which is called after all the iterator functions - have finished, or an error has occurred. - -__Example__ - -```js -// Assume documents is an array of JSON objects and requestApi is a -// function that interacts with a rate-limited REST api. - -async.eachLimit(documents, 20, requestApi, function(err){ - // if any of the saves produced an error, err would equal that error -}); -``` - ---------------------------------------- - - -### map(arr, iterator, callback) - -Produces a new array of values by mapping each value in the given array through -the iterator function. The iterator is called with an item from the array and a -callback for when it has finished processing. The callback takes 2 arguments, -an error and the transformed item from the array. If the iterator passes an -error to this callback, the main callback for the map function is immediately -called with the error. - -Note, that since this function applies the iterator to each item in parallel -there is no guarantee that the iterator functions will complete in order, however -the results array will be in the same order as the original array. - -__Arguments__ - -* arr - An array to iterate over. -* iterator(item, callback) - A function to apply to each item in the array. - The iterator is passed a callback(err, transformed) which must be called once - it has completed with an error (which can be null) and a transformed item. -* callback(err, results) - A callback which is called after all the iterator - functions have finished, or an error has occurred. Results is an array of the - transformed items from the original array. - -__Example__ - -```js -async.map(['file1','file2','file3'], fs.stat, function(err, results){ - // results is now an array of stats for each file -}); -``` - ---------------------------------------- - - -### mapSeries(arr, iterator, callback) - -The same as map only the iterator is applied to each item in the array in -series. The next iterator is only called once the current one has completed -processing. The results array will be in the same order as the original. - - ---------------------------------------- - - -### mapLimit(arr, limit, iterator, callback) - -The same as map only no more than "limit" iterators will be simultaneously -running at any time. - -Note that the items are not processed in batches, so there is no guarantee that - the first "limit" iterator functions will complete before any others are -started. - -__Arguments__ - -* arr - An array to iterate over. -* limit - The maximum number of iterators to run at any time. -* iterator(item, callback) - A function to apply to each item in the array. - The iterator is passed a callback(err, transformed) which must be called once - it has completed with an error (which can be null) and a transformed item. -* callback(err, results) - A callback which is called after all the iterator - functions have finished, or an error has occurred. Results is an array of the - transformed items from the original array. - -__Example__ - -```js -async.map(['file1','file2','file3'], 1, fs.stat, function(err, results){ - // results is now an array of stats for each file -}); -``` - ---------------------------------------- - - -### filter(arr, iterator, callback) - -__Alias:__ select - -Returns a new array of all the values which pass an async truth test. -_The callback for each iterator call only accepts a single argument of true or -false, it does not accept an error argument first!_ This is in-line with the -way node libraries work with truth tests like fs.exists. This operation is -performed in parallel, but the results array will be in the same order as the -original. - -__Arguments__ - -* arr - An array to iterate over. -* iterator(item, callback) - A truth test to apply to each item in the array. - The iterator is passed a callback(truthValue) which must be called with a - boolean argument once it has completed. -* callback(results) - A callback which is called after all the iterator - functions have finished. - -__Example__ - -```js -async.filter(['file1','file2','file3'], fs.exists, function(results){ - // results now equals an array of the existing files -}); -``` - ---------------------------------------- - - -### filterSeries(arr, iterator, callback) - -__alias:__ selectSeries - -The same as filter only the iterator is applied to each item in the array in -series. The next iterator is only called once the current one has completed -processing. The results array will be in the same order as the original. - ---------------------------------------- - - -### reject(arr, iterator, callback) - -The opposite of filter. Removes values that pass an async truth test. - ---------------------------------------- - - -### rejectSeries(arr, iterator, callback) - -The same as reject, only the iterator is applied to each item in the array -in series. - - ---------------------------------------- - - -### reduce(arr, memo, iterator, callback) - -__aliases:__ inject, foldl - -Reduces a list of values into a single value using an async iterator to return -each successive step. Memo is the initial state of the reduction. This -function only operates in series. For performance reasons, it may make sense to -split a call to this function into a parallel map, then use the normal -Array.prototype.reduce on the results. This function is for situations where -each step in the reduction needs to be async, if you can get the data before -reducing it then it's probably a good idea to do so. - -__Arguments__ - -* arr - An array to iterate over. -* memo - The initial state of the reduction. -* iterator(memo, item, callback) - A function applied to each item in the - array to produce the next step in the reduction. The iterator is passed a - callback(err, reduction) which accepts an optional error as its first - argument, and the state of the reduction as the second. If an error is - passed to the callback, the reduction is stopped and the main callback is - immediately called with the error. -* callback(err, result) - A callback which is called after all the iterator - functions have finished. Result is the reduced value. - -__Example__ - -```js -async.reduce([1,2,3], 0, function(memo, item, callback){ - // pointless async: - process.nextTick(function(){ - callback(null, memo + item) - }); -}, function(err, result){ - // result is now equal to the last value of memo, which is 6 -}); -``` - ---------------------------------------- - - -### reduceRight(arr, memo, iterator, callback) - -__Alias:__ foldr - -Same as reduce, only operates on the items in the array in reverse order. - - ---------------------------------------- - - -### detect(arr, iterator, callback) - -Returns the first value in a list that passes an async truth test. The -iterator is applied in parallel, meaning the first iterator to return true will -fire the detect callback with that result. That means the result might not be -the first item in the original array (in terms of order) that passes the test. - -If order within the original array is important then look at detectSeries. - -__Arguments__ - -* arr - An array to iterate over. -* iterator(item, callback) - A truth test to apply to each item in the array. - The iterator is passed a callback(truthValue) which must be called with a - boolean argument once it has completed. -* callback(result) - A callback which is called as soon as any iterator returns - true, or after all the iterator functions have finished. Result will be - the first item in the array that passes the truth test (iterator) or the - value undefined if none passed. - -__Example__ - -```js -async.detect(['file1','file2','file3'], fs.exists, function(result){ - // result now equals the first file in the list that exists -}); -``` - ---------------------------------------- - - -### detectSeries(arr, iterator, callback) - -The same as detect, only the iterator is applied to each item in the array -in series. This means the result is always the first in the original array (in -terms of array order) that passes the truth test. - - ---------------------------------------- - - -### sortBy(arr, iterator, callback) - -Sorts a list by the results of running each value through an async iterator. - -__Arguments__ - -* arr - An array to iterate over. -* iterator(item, callback) - A function to apply to each item in the array. - The iterator is passed a callback(err, sortValue) which must be called once it - has completed with an error (which can be null) and a value to use as the sort - criteria. -* callback(err, results) - A callback which is called after all the iterator - functions have finished, or an error has occurred. Results is the items from - the original array sorted by the values returned by the iterator calls. - -__Example__ - -```js -async.sortBy(['file1','file2','file3'], function(file, callback){ - fs.stat(file, function(err, stats){ - callback(err, stats.mtime); - }); -}, function(err, results){ - // results is now the original array of files sorted by - // modified date -}); -``` - ---------------------------------------- - - -### some(arr, iterator, callback) - -__Alias:__ any - -Returns true if at least one element in the array satisfies an async test. -_The callback for each iterator call only accepts a single argument of true or -false, it does not accept an error argument first!_ This is in-line with the -way node libraries work with truth tests like fs.exists. Once any iterator -call returns true, the main callback is immediately called. - -__Arguments__ - -* arr - An array to iterate over. -* iterator(item, callback) - A truth test to apply to each item in the array. - The iterator is passed a callback(truthValue) which must be called with a - boolean argument once it has completed. -* callback(result) - A callback which is called as soon as any iterator returns - true, or after all the iterator functions have finished. Result will be - either true or false depending on the values of the async tests. - -__Example__ - -```js -async.some(['file1','file2','file3'], fs.exists, function(result){ - // if result is true then at least one of the files exists -}); -``` - ---------------------------------------- - - -### every(arr, iterator, callback) - -__Alias:__ all - -Returns true if every element in the array satisfies an async test. -_The callback for each iterator call only accepts a single argument of true or -false, it does not accept an error argument first!_ This is in-line with the -way node libraries work with truth tests like fs.exists. - -__Arguments__ - -* arr - An array to iterate over. -* iterator(item, callback) - A truth test to apply to each item in the array. - The iterator is passed a callback(truthValue) which must be called with a - boolean argument once it has completed. -* callback(result) - A callback which is called after all the iterator - functions have finished. Result will be either true or false depending on - the values of the async tests. - -__Example__ - -```js -async.every(['file1','file2','file3'], fs.exists, function(result){ - // if result is true then every file exists -}); -``` - ---------------------------------------- - - -### concat(arr, iterator, callback) - -Applies an iterator to each item in a list, concatenating the results. Returns the -concatenated list. The iterators are called in parallel, and the results are -concatenated as they return. There is no guarantee that the results array will -be returned in the original order of the arguments passed to the iterator function. - -__Arguments__ - -* arr - An array to iterate over -* iterator(item, callback) - A function to apply to each item in the array. - The iterator is passed a callback(err, results) which must be called once it - has completed with an error (which can be null) and an array of results. -* callback(err, results) - A callback which is called after all the iterator - functions have finished, or an error has occurred. Results is an array containing - the concatenated results of the iterator function. - -__Example__ - -```js -async.concat(['dir1','dir2','dir3'], fs.readdir, function(err, files){ - // files is now a list of filenames that exist in the 3 directories -}); -``` - ---------------------------------------- - - -### concatSeries(arr, iterator, callback) - -Same as async.concat, but executes in series instead of parallel. - - -## Control Flow - - -### series(tasks, [callback]) - -Run an array of functions in series, each one running once the previous -function has completed. If any functions in the series pass an error to its -callback, no more functions are run and the callback for the series is -immediately called with the value of the error. Once the tasks have completed, -the results are passed to the final callback as an array. - -It is also possible to use an object instead of an array. Each property will be -run as a function and the results will be passed to the final callback as an object -instead of an array. This can be a more readable way of handling results from -async.series. - - -__Arguments__ - -* tasks - An array or object containing functions to run, each function is passed - a callback(err, result) it must call on completion with an error (which can - be null) and an optional result value. -* callback(err, results) - An optional callback to run once all the functions - have completed. This function gets a results array (or object) containing all - the result arguments passed to the task callbacks. - -__Example__ - -```js -async.series([ - function(callback){ - // do some stuff ... - callback(null, 'one'); - }, - function(callback){ - // do some more stuff ... - callback(null, 'two'); - } -], -// optional callback -function(err, results){ - // results is now equal to ['one', 'two'] -}); - - -// an example using an object instead of an array -async.series({ - one: function(callback){ - setTimeout(function(){ - callback(null, 1); - }, 200); - }, - two: function(callback){ - setTimeout(function(){ - callback(null, 2); - }, 100); - } -}, -function(err, results) { - // results is now equal to: {one: 1, two: 2} -}); -``` - ---------------------------------------- - - -### parallel(tasks, [callback]) - -Run an array of functions in parallel, without waiting until the previous -function has completed. If any of the functions pass an error to its -callback, the main callback is immediately called with the value of the error. -Once the tasks have completed, the results are passed to the final callback as an -array. - -It is also possible to use an object instead of an array. Each property will be -run as a function and the results will be passed to the final callback as an object -instead of an array. This can be a more readable way of handling results from -async.parallel. - - -__Arguments__ - -* tasks - An array or object containing functions to run, each function is passed - a callback(err, result) it must call on completion with an error (which can - be null) and an optional result value. -* callback(err, results) - An optional callback to run once all the functions - have completed. This function gets a results array (or object) containing all - the result arguments passed to the task callbacks. - -__Example__ - -```js -async.parallel([ - function(callback){ - setTimeout(function(){ - callback(null, 'one'); - }, 200); - }, - function(callback){ - setTimeout(function(){ - callback(null, 'two'); - }, 100); - } -], -// optional callback -function(err, results){ - // the results array will equal ['one','two'] even though - // the second function had a shorter timeout. -}); - - -// an example using an object instead of an array -async.parallel({ - one: function(callback){ - setTimeout(function(){ - callback(null, 1); - }, 200); - }, - two: function(callback){ - setTimeout(function(){ - callback(null, 2); - }, 100); - } -}, -function(err, results) { - // results is now equals to: {one: 1, two: 2} -}); -``` - ---------------------------------------- - - -### parallelLimit(tasks, limit, [callback]) - -The same as parallel only the tasks are executed in parallel with a maximum of "limit" -tasks executing at any time. - -Note that the tasks are not executed in batches, so there is no guarantee that -the first "limit" tasks will complete before any others are started. - -__Arguments__ - -* tasks - An array or object containing functions to run, each function is passed - a callback(err, result) it must call on completion with an error (which can - be null) and an optional result value. -* limit - The maximum number of tasks to run at any time. -* callback(err, results) - An optional callback to run once all the functions - have completed. This function gets a results array (or object) containing all - the result arguments passed to the task callbacks. - ---------------------------------------- - - -### whilst(test, fn, callback) - -Repeatedly call fn, while test returns true. Calls the callback when stopped, -or an error occurs. - -__Arguments__ - -* test() - synchronous truth test to perform before each execution of fn. -* fn(callback) - A function to call each time the test passes. The function is - passed a callback(err) which must be called once it has completed with an - optional error argument. -* callback(err) - A callback which is called after the test fails and repeated - execution of fn has stopped. - -__Example__ - -```js -var count = 0; - -async.whilst( - function () { return count < 5; }, - function (callback) { - count++; - setTimeout(callback, 1000); - }, - function (err) { - // 5 seconds have passed - } -); -``` - ---------------------------------------- - - -### doWhilst(fn, test, callback) - -The post check version of whilst. To reflect the difference in the order of operations `test` and `fn` arguments are switched. `doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript. - ---------------------------------------- - - -### until(test, fn, callback) - -Repeatedly call fn, until test returns true. Calls the callback when stopped, -or an error occurs. - -The inverse of async.whilst. - ---------------------------------------- - - -### doUntil(fn, test, callback) - -Like doWhilst except the test is inverted. Note the argument ordering differs from `until`. - ---------------------------------------- - - -### forever(fn, callback) - -Calls the asynchronous function 'fn' repeatedly, in series, indefinitely. -If an error is passed to fn's callback then 'callback' is called with the -error, otherwise it will never be called. - ---------------------------------------- - - -### waterfall(tasks, [callback]) - -Runs an array of functions in series, each passing their results to the next in -the array. However, if any of the functions pass an error to the callback, the -next function is not executed and the main callback is immediately called with -the error. - -__Arguments__ - -* tasks - An array of functions to run, each function is passed a - callback(err, result1, result2, ...) it must call on completion. The first - argument is an error (which can be null) and any further arguments will be - passed as arguments in order to the next task. -* callback(err, [results]) - An optional callback to run once all the functions - have completed. This will be passed the results of the last task's callback. - - - -__Example__ - -```js -async.waterfall([ - function(callback){ - callback(null, 'one', 'two'); - }, - function(arg1, arg2, callback){ - callback(null, 'three'); - }, - function(arg1, callback){ - // arg1 now equals 'three' - callback(null, 'done'); - } -], function (err, result) { - // result now equals 'done' -}); -``` - ---------------------------------------- - -### compose(fn1, fn2...) - -Creates a function which is a composition of the passed asynchronous -functions. Each function consumes the return value of the function that -follows. Composing functions f(), g() and h() would produce the result of -f(g(h())), only this version uses callbacks to obtain the return values. - -Each function is executed with the `this` binding of the composed function. - -__Arguments__ - -* functions... - the asynchronous functions to compose - - -__Example__ - -```js -function add1(n, callback) { - setTimeout(function () { - callback(null, n + 1); - }, 10); -} - -function mul3(n, callback) { - setTimeout(function () { - callback(null, n * 3); - }, 10); -} - -var add1mul3 = async.compose(mul3, add1); - -add1mul3(4, function (err, result) { - // result now equals 15 -}); -``` - ---------------------------------------- - -### applyEach(fns, args..., callback) - -Applies the provided arguments to each function in the array, calling the -callback after all functions have completed. If you only provide the first -argument then it will return a function which lets you pass in the -arguments as if it were a single function call. - -__Arguments__ - -* fns - the asynchronous functions to all call with the same arguments -* args... - any number of separate arguments to pass to the function -* callback - the final argument should be the callback, called when all - functions have completed processing - - -__Example__ - -```js -async.applyEach([enableSearch, updateSchema], 'bucket', callback); - -// partial application example: -async.each( - buckets, - async.applyEach([enableSearch, updateSchema]), - callback -); -``` - ---------------------------------------- - - -### applyEachSeries(arr, iterator, callback) - -The same as applyEach only the functions are applied in series. - ---------------------------------------- - - -### queue(worker, concurrency) - -Creates a queue object with the specified concurrency. Tasks added to the -queue will be processed in parallel (up to the concurrency limit). If all -workers are in progress, the task is queued until one is available. Once -a worker has completed a task, the task's callback is called. - -__Arguments__ - -* worker(task, callback) - An asynchronous function for processing a queued - task, which must call its callback(err) argument when finished, with an - optional error as an argument. -* concurrency - An integer for determining how many worker functions should be - run in parallel. - -__Queue objects__ - -The queue object returned by this function has the following properties and -methods: - -* length() - a function returning the number of items waiting to be processed. -* concurrency - an integer for determining how many worker functions should be - run in parallel. This property can be changed after a queue is created to - alter the concurrency on-the-fly. -* push(task, [callback]) - add a new task to the queue, the callback is called - once the worker has finished processing the task. - instead of a single task, an array of tasks can be submitted. the respective callback is used for every task in the list. -* unshift(task, [callback]) - add a new task to the front of the queue. -* saturated - a callback that is called when the queue length hits the concurrency and further tasks will be queued -* empty - a callback that is called when the last item from the queue is given to a worker -* drain - a callback that is called when the last item from the queue has returned from the worker - -__Example__ - -```js -// create a queue object with concurrency 2 - -var q = async.queue(function (task, callback) { - console.log('hello ' + task.name); - callback(); -}, 2); - - -// assign a callback -q.drain = function() { - console.log('all items have been processed'); -} - -// add some items to the queue - -q.push({name: 'foo'}, function (err) { - console.log('finished processing foo'); -}); -q.push({name: 'bar'}, function (err) { - console.log('finished processing bar'); -}); - -// add some items to the queue (batch-wise) - -q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function (err) { - console.log('finished processing bar'); -}); - -// add some items to the front of the queue - -q.unshift({name: 'bar'}, function (err) { - console.log('finished processing bar'); -}); -``` - ---------------------------------------- - - -### cargo(worker, [payload]) - -Creates a cargo object with the specified payload. Tasks added to the -cargo will be processed altogether (up to the payload limit). If the -worker is in progress, the task is queued until it is available. Once -the worker has completed some tasks, each callback of those tasks is called. - -__Arguments__ - -* worker(tasks, callback) - An asynchronous function for processing an array of - queued tasks, which must call its callback(err) argument when finished, with - an optional error as an argument. -* payload - An optional integer for determining how many tasks should be - processed per round; if omitted, the default is unlimited. - -__Cargo objects__ - -The cargo object returned by this function has the following properties and -methods: - -* length() - a function returning the number of items waiting to be processed. -* payload - an integer for determining how many tasks should be - process per round. This property can be changed after a cargo is created to - alter the payload on-the-fly. -* push(task, [callback]) - add a new task to the queue, the callback is called - once the worker has finished processing the task. - instead of a single task, an array of tasks can be submitted. the respective callback is used for every task in the list. -* saturated - a callback that is called when the queue length hits the concurrency and further tasks will be queued -* empty - a callback that is called when the last item from the queue is given to a worker -* drain - a callback that is called when the last item from the queue has returned from the worker - -__Example__ - -```js -// create a cargo object with payload 2 - -var cargo = async.cargo(function (tasks, callback) { - for(var i=0; i -### auto(tasks, [callback]) - -Determines the best order for running functions based on their requirements. -Each function can optionally depend on other functions being completed first, -and each function is run as soon as its requirements are satisfied. If any of -the functions pass an error to their callback, that function will not complete -(so any other functions depending on it will not run) and the main callback -will be called immediately with the error. Functions also receive an object -containing the results of functions which have completed so far. - -Note, all functions are called with a results object as a second argument, -so it is unsafe to pass functions in the tasks object which cannot handle the -extra argument. For example, this snippet of code: - -```js -async.auto({ - readData: async.apply(fs.readFile, 'data.txt', 'utf-8'); -}, callback); -``` - -will have the effect of calling readFile with the results object as the last -argument, which will fail: - -```js -fs.readFile('data.txt', 'utf-8', cb, {}); -``` - -Instead, wrap the call to readFile in a function which does not forward the -results object: - -```js -async.auto({ - readData: function(cb, results){ - fs.readFile('data.txt', 'utf-8', cb); - } -}, callback); -``` - -__Arguments__ - -* tasks - An object literal containing named functions or an array of - requirements, with the function itself the last item in the array. The key - used for each function or array is used when specifying requirements. The - function receives two arguments: (1) a callback(err, result) which must be - called when finished, passing an error (which can be null) and the result of - the function's execution, and (2) a results object, containing the results of - the previously executed functions. -* callback(err, results) - An optional callback which is called when all the - tasks have been completed. The callback will receive an error as an argument - if any tasks pass an error to their callback. Results will always be passed - but if an error occurred, no other tasks will be performed, and the results - object will only contain partial results. - - -__Example__ - -```js -async.auto({ - get_data: function(callback){ - // async code to get some data - }, - make_folder: function(callback){ - // async code to create a directory to store a file in - // this is run at the same time as getting the data - }, - write_file: ['get_data', 'make_folder', function(callback){ - // once there is some data and the directory exists, - // write the data to a file in the directory - callback(null, filename); - }], - email_link: ['write_file', function(callback, results){ - // once the file is written let's email a link to it... - // results.write_file contains the filename returned by write_file. - }] -}); -``` - -This is a fairly trivial example, but to do this using the basic parallel and -series functions would look like this: - -```js -async.parallel([ - function(callback){ - // async code to get some data - }, - function(callback){ - // async code to create a directory to store a file in - // this is run at the same time as getting the data - } -], -function(err, results){ - async.series([ - function(callback){ - // once there is some data and the directory exists, - // write the data to a file in the directory - }, - function(callback){ - // once the file is written let's email a link to it... - } - ]); -}); -``` - -For a complicated series of async tasks using the auto function makes adding -new tasks much easier and makes the code more readable. - - ---------------------------------------- - - -### iterator(tasks) - -Creates an iterator function which calls the next function in the array, -returning a continuation to call the next one after that. It's also possible to -'peek' the next iterator by doing iterator.next(). - -This function is used internally by the async module but can be useful when -you want to manually control the flow of functions in series. - -__Arguments__ - -* tasks - An array of functions to run. - -__Example__ - -```js -var iterator = async.iterator([ - function(){ sys.p('one'); }, - function(){ sys.p('two'); }, - function(){ sys.p('three'); } -]); - -node> var iterator2 = iterator(); -'one' -node> var iterator3 = iterator2(); -'two' -node> iterator3(); -'three' -node> var nextfn = iterator2.next(); -node> nextfn(); -'three' -``` - ---------------------------------------- - - -### apply(function, arguments..) - -Creates a continuation function with some arguments already applied, a useful -shorthand when combined with other control flow functions. Any arguments -passed to the returned function are added to the arguments originally passed -to apply. - -__Arguments__ - -* function - The function you want to eventually apply all arguments to. -* arguments... - Any number of arguments to automatically apply when the - continuation is called. - -__Example__ - -```js -// using apply - -async.parallel([ - async.apply(fs.writeFile, 'testfile1', 'test1'), - async.apply(fs.writeFile, 'testfile2', 'test2'), -]); - - -// the same process without using apply - -async.parallel([ - function(callback){ - fs.writeFile('testfile1', 'test1', callback); - }, - function(callback){ - fs.writeFile('testfile2', 'test2', callback); - } -]); -``` - -It's possible to pass any number of additional arguments when calling the -continuation: - -```js -node> var fn = async.apply(sys.puts, 'one'); -node> fn('two', 'three'); -one -two -three -``` - ---------------------------------------- - - -### nextTick(callback) - -Calls the callback on a later loop around the event loop. In node.js this just -calls process.nextTick, in the browser it falls back to setImmediate(callback) -if available, otherwise setTimeout(callback, 0), which means other higher priority -events may precede the execution of the callback. - -This is used internally for browser-compatibility purposes. - -__Arguments__ - -* callback - The function to call on a later loop around the event loop. - -__Example__ - -```js -var call_order = []; -async.nextTick(function(){ - call_order.push('two'); - // call_order now equals ['one','two'] -}); -call_order.push('one') -``` - - -### times(n, callback) - -Calls the callback n times and accumulates results in the same manner -you would use with async.map. - -__Arguments__ - -* n - The number of times to run the function. -* callback - The function to call n times. - -__Example__ - -```js -// Pretend this is some complicated async factory -var createUser = function(id, callback) { - callback(null, { - id: 'user' + id - }) -} -// generate 5 users -async.times(5, function(n, next){ - createUser(n, function(err, user) { - next(err, user) - }) -}, function(err, users) { - // we should now have 5 users -}); -``` - - -### timesSeries(n, callback) - -The same as times only the iterator is applied to each item in the array in -series. The next iterator is only called once the current one has completed -processing. The results array will be in the same order as the original. - - -## Utils - - -### memoize(fn, [hasher]) - -Caches the results of an async function. When creating a hash to store function -results against, the callback is omitted from the hash and an optional hash -function can be used. - -The cache of results is exposed as the `memo` property of the function returned -by `memoize`. - -__Arguments__ - -* fn - the function you to proxy and cache results from. -* hasher - an optional function for generating a custom hash for storing - results, it has all the arguments applied to it apart from the callback, and - must be synchronous. - -__Example__ - -```js -var slow_fn = function (name, callback) { - // do something - callback(null, result); -}; -var fn = async.memoize(slow_fn); - -// fn can now be used as if it were slow_fn -fn('some name', function () { - // callback -}); -``` - - -### unmemoize(fn) - -Undoes a memoized function, reverting it to the original, unmemoized -form. Comes handy in tests. - -__Arguments__ - -* fn - the memoized function - - -### log(function, arguments) - -Logs the result of an async function to the console. Only works in node.js or -in browsers that support console.log and console.error (such as FF and Chrome). -If multiple arguments are returned from the async function, console.log is -called on each argument in order. - -__Arguments__ - -* function - The function you want to eventually apply all arguments to. -* arguments... - Any number of arguments to apply to the function. - -__Example__ - -```js -var hello = function(name, callback){ - setTimeout(function(){ - callback(null, 'hello ' + name); - }, 1000); -}; -``` -```js -node> async.log(hello, 'world'); -'hello world' -``` - ---------------------------------------- - - -### dir(function, arguments) - -Logs the result of an async function to the console using console.dir to -display the properties of the resulting object. Only works in node.js or -in browsers that support console.dir and console.error (such as FF and Chrome). -If multiple arguments are returned from the async function, console.dir is -called on each argument in order. - -__Arguments__ - -* function - The function you want to eventually apply all arguments to. -* arguments... - Any number of arguments to apply to the function. - -__Example__ - -```js -var hello = function(name, callback){ - setTimeout(function(){ - callback(null, {hello: name}); - }, 1000); -}; -``` -```js -node> async.dir(hello, 'world'); -{hello: 'world'} -``` - ---------------------------------------- - - -### noConflict() - -Changes the value of async back to its original value, returning a reference to the -async object. diff --git a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/async/component.json b/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/async/component.json deleted file mode 100644 index bbb011548c0..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/async/component.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "async", - "repo": "caolan/async", - "description": "Higher-order functions and common patterns for asynchronous code", - "version": "0.1.23", - "keywords": [], - "dependencies": {}, - "development": {}, - "main": "lib/async.js", - "scripts": [ "lib/async.js" ] -} diff --git a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js b/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js deleted file mode 100755 index cb6320d6ad7..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js +++ /dev/null @@ -1,955 +0,0 @@ -/*global setImmediate: false, setTimeout: false, console: false */ -(function () { - - var async = {}; - - // global on the server, window in the browser - var root, previous_async; - - root = this; - if (root != null) { - previous_async = root.async; - } - - async.noConflict = function () { - root.async = previous_async; - return async; - }; - - function only_once(fn) { - var called = false; - return function() { - if (called) throw new Error("Callback was already called."); - called = true; - fn.apply(root, arguments); - } - } - - //// cross-browser compatiblity functions //// - - var _each = function (arr, iterator) { - if (arr.forEach) { - return arr.forEach(iterator); - } - for (var i = 0; i < arr.length; i += 1) { - iterator(arr[i], i, arr); - } - }; - - var _map = function (arr, iterator) { - if (arr.map) { - return arr.map(iterator); - } - var results = []; - _each(arr, function (x, i, a) { - results.push(iterator(x, i, a)); - }); - return results; - }; - - var _reduce = function (arr, iterator, memo) { - if (arr.reduce) { - return arr.reduce(iterator, memo); - } - _each(arr, function (x, i, a) { - memo = iterator(memo, x, i, a); - }); - return memo; - }; - - var _keys = function (obj) { - if (Object.keys) { - return Object.keys(obj); - } - var keys = []; - for (var k in obj) { - if (obj.hasOwnProperty(k)) { - keys.push(k); - } - } - return keys; - }; - - //// exported async module functions //// - - //// nextTick implementation with browser-compatible fallback //// - if (typeof process === 'undefined' || !(process.nextTick)) { - if (typeof setImmediate === 'function') { - async.nextTick = function (fn) { - // not a direct alias for IE10 compatibility - setImmediate(fn); - }; - async.setImmediate = async.nextTick; - } - else { - async.nextTick = function (fn) { - setTimeout(fn, 0); - }; - async.setImmediate = async.nextTick; - } - } - else { - async.nextTick = process.nextTick; - if (typeof setImmediate !== 'undefined') { - async.setImmediate = setImmediate; - } - else { - async.setImmediate = async.nextTick; - } - } - - async.each = function (arr, iterator, callback) { - callback = callback || function () {}; - if (!arr.length) { - return callback(); - } - var completed = 0; - _each(arr, function (x) { - iterator(x, only_once(function (err) { - if (err) { - callback(err); - callback = function () {}; - } - else { - completed += 1; - if (completed >= arr.length) { - callback(null); - } - } - })); - }); - }; - async.forEach = async.each; - - async.eachSeries = function (arr, iterator, callback) { - callback = callback || function () {}; - if (!arr.length) { - return callback(); - } - var completed = 0; - var iterate = function () { - iterator(arr[completed], function (err) { - if (err) { - callback(err); - callback = function () {}; - } - else { - completed += 1; - if (completed >= arr.length) { - callback(null); - } - else { - iterate(); - } - } - }); - }; - iterate(); - }; - async.forEachSeries = async.eachSeries; - - async.eachLimit = function (arr, limit, iterator, callback) { - var fn = _eachLimit(limit); - fn.apply(null, [arr, iterator, callback]); - }; - async.forEachLimit = async.eachLimit; - - var _eachLimit = function (limit) { - - return function (arr, iterator, callback) { - callback = callback || function () {}; - if (!arr.length || limit <= 0) { - return callback(); - } - var completed = 0; - var started = 0; - var running = 0; - - (function replenish () { - if (completed >= arr.length) { - return callback(); - } - - while (running < limit && started < arr.length) { - started += 1; - running += 1; - iterator(arr[started - 1], function (err) { - if (err) { - callback(err); - callback = function () {}; - } - else { - completed += 1; - running -= 1; - if (completed >= arr.length) { - callback(); - } - else { - replenish(); - } - } - }); - } - })(); - }; - }; - - - var doParallel = function (fn) { - return function () { - var args = Array.prototype.slice.call(arguments); - return fn.apply(null, [async.each].concat(args)); - }; - }; - var doParallelLimit = function(limit, fn) { - return function () { - var args = Array.prototype.slice.call(arguments); - return fn.apply(null, [_eachLimit(limit)].concat(args)); - }; - }; - var doSeries = function (fn) { - return function () { - var args = Array.prototype.slice.call(arguments); - return fn.apply(null, [async.eachSeries].concat(args)); - }; - }; - - - var _asyncMap = function (eachfn, arr, iterator, callback) { - var results = []; - arr = _map(arr, function (x, i) { - return {index: i, value: x}; - }); - eachfn(arr, function (x, callback) { - iterator(x.value, function (err, v) { - results[x.index] = v; - callback(err); - }); - }, function (err) { - callback(err, results); - }); - }; - async.map = doParallel(_asyncMap); - async.mapSeries = doSeries(_asyncMap); - async.mapLimit = function (arr, limit, iterator, callback) { - return _mapLimit(limit)(arr, iterator, callback); - }; - - var _mapLimit = function(limit) { - return doParallelLimit(limit, _asyncMap); - }; - - // reduce only has a series version, as doing reduce in parallel won't - // work in many situations. - async.reduce = function (arr, memo, iterator, callback) { - async.eachSeries(arr, function (x, callback) { - iterator(memo, x, function (err, v) { - memo = v; - callback(err); - }); - }, function (err) { - callback(err, memo); - }); - }; - // inject alias - async.inject = async.reduce; - // foldl alias - async.foldl = async.reduce; - - async.reduceRight = function (arr, memo, iterator, callback) { - var reversed = _map(arr, function (x) { - return x; - }).reverse(); - async.reduce(reversed, memo, iterator, callback); - }; - // foldr alias - async.foldr = async.reduceRight; - - var _filter = function (eachfn, arr, iterator, callback) { - var results = []; - arr = _map(arr, function (x, i) { - return {index: i, value: x}; - }); - eachfn(arr, function (x, callback) { - iterator(x.value, function (v) { - if (v) { - results.push(x); - } - callback(); - }); - }, function (err) { - callback(_map(results.sort(function (a, b) { - return a.index - b.index; - }), function (x) { - return x.value; - })); - }); - }; - async.filter = doParallel(_filter); - async.filterSeries = doSeries(_filter); - // select alias - async.select = async.filter; - async.selectSeries = async.filterSeries; - - var _reject = function (eachfn, arr, iterator, callback) { - var results = []; - arr = _map(arr, function (x, i) { - return {index: i, value: x}; - }); - eachfn(arr, function (x, callback) { - iterator(x.value, function (v) { - if (!v) { - results.push(x); - } - callback(); - }); - }, function (err) { - callback(_map(results.sort(function (a, b) { - return a.index - b.index; - }), function (x) { - return x.value; - })); - }); - }; - async.reject = doParallel(_reject); - async.rejectSeries = doSeries(_reject); - - var _detect = function (eachfn, arr, iterator, main_callback) { - eachfn(arr, function (x, callback) { - iterator(x, function (result) { - if (result) { - main_callback(x); - main_callback = function () {}; - } - else { - callback(); - } - }); - }, function (err) { - main_callback(); - }); - }; - async.detect = doParallel(_detect); - async.detectSeries = doSeries(_detect); - - async.some = function (arr, iterator, main_callback) { - async.each(arr, function (x, callback) { - iterator(x, function (v) { - if (v) { - main_callback(true); - main_callback = function () {}; - } - callback(); - }); - }, function (err) { - main_callback(false); - }); - }; - // any alias - async.any = async.some; - - async.every = function (arr, iterator, main_callback) { - async.each(arr, function (x, callback) { - iterator(x, function (v) { - if (!v) { - main_callback(false); - main_callback = function () {}; - } - callback(); - }); - }, function (err) { - main_callback(true); - }); - }; - // all alias - async.all = async.every; - - async.sortBy = function (arr, iterator, callback) { - async.map(arr, function (x, callback) { - iterator(x, function (err, criteria) { - if (err) { - callback(err); - } - else { - callback(null, {value: x, criteria: criteria}); - } - }); - }, function (err, results) { - if (err) { - return callback(err); - } - else { - var fn = function (left, right) { - var a = left.criteria, b = right.criteria; - return a < b ? -1 : a > b ? 1 : 0; - }; - callback(null, _map(results.sort(fn), function (x) { - return x.value; - })); - } - }); - }; - - async.auto = function (tasks, callback) { - callback = callback || function () {}; - var keys = _keys(tasks); - if (!keys.length) { - return callback(null); - } - - var results = {}; - - var listeners = []; - var addListener = function (fn) { - listeners.unshift(fn); - }; - var removeListener = function (fn) { - for (var i = 0; i < listeners.length; i += 1) { - if (listeners[i] === fn) { - listeners.splice(i, 1); - return; - } - } - }; - var taskComplete = function () { - _each(listeners.slice(0), function (fn) { - fn(); - }); - }; - - addListener(function () { - if (_keys(results).length === keys.length) { - callback(null, results); - callback = function () {}; - } - }); - - _each(keys, function (k) { - var task = (tasks[k] instanceof Function) ? [tasks[k]]: tasks[k]; - var taskCallback = function (err) { - var args = Array.prototype.slice.call(arguments, 1); - if (args.length <= 1) { - args = args[0]; - } - if (err) { - var safeResults = {}; - _each(_keys(results), function(rkey) { - safeResults[rkey] = results[rkey]; - }); - safeResults[k] = args; - callback(err, safeResults); - // stop subsequent errors hitting callback multiple times - callback = function () {}; - } - else { - results[k] = args; - async.setImmediate(taskComplete); - } - }; - var requires = task.slice(0, Math.abs(task.length - 1)) || []; - var ready = function () { - return _reduce(requires, function (a, x) { - return (a && results.hasOwnProperty(x)); - }, true) && !results.hasOwnProperty(k); - }; - if (ready()) { - task[task.length - 1](taskCallback, results); - } - else { - var listener = function () { - if (ready()) { - removeListener(listener); - task[task.length - 1](taskCallback, results); - } - }; - addListener(listener); - } - }); - }; - - async.waterfall = function (tasks, callback) { - callback = callback || function () {}; - if (tasks.constructor !== Array) { - var err = new Error('First argument to waterfall must be an array of functions'); - return callback(err); - } - if (!tasks.length) { - return callback(); - } - var wrapIterator = function (iterator) { - return function (err) { - if (err) { - callback.apply(null, arguments); - callback = function () {}; - } - else { - var args = Array.prototype.slice.call(arguments, 1); - var next = iterator.next(); - if (next) { - args.push(wrapIterator(next)); - } - else { - args.push(callback); - } - async.setImmediate(function () { - iterator.apply(null, args); - }); - } - }; - }; - wrapIterator(async.iterator(tasks))(); - }; - - var _parallel = function(eachfn, tasks, callback) { - callback = callback || function () {}; - if (tasks.constructor === Array) { - eachfn.map(tasks, function (fn, callback) { - if (fn) { - fn(function (err) { - var args = Array.prototype.slice.call(arguments, 1); - if (args.length <= 1) { - args = args[0]; - } - callback.call(null, err, args); - }); - } - }, callback); - } - else { - var results = {}; - eachfn.each(_keys(tasks), function (k, callback) { - tasks[k](function (err) { - var args = Array.prototype.slice.call(arguments, 1); - if (args.length <= 1) { - args = args[0]; - } - results[k] = args; - callback(err); - }); - }, function (err) { - callback(err, results); - }); - } - }; - - async.parallel = function (tasks, callback) { - _parallel({ map: async.map, each: async.each }, tasks, callback); - }; - - async.parallelLimit = function(tasks, limit, callback) { - _parallel({ map: _mapLimit(limit), each: _eachLimit(limit) }, tasks, callback); - }; - - async.series = function (tasks, callback) { - callback = callback || function () {}; - if (tasks.constructor === Array) { - async.mapSeries(tasks, function (fn, callback) { - if (fn) { - fn(function (err) { - var args = Array.prototype.slice.call(arguments, 1); - if (args.length <= 1) { - args = args[0]; - } - callback.call(null, err, args); - }); - } - }, callback); - } - else { - var results = {}; - async.eachSeries(_keys(tasks), function (k, callback) { - tasks[k](function (err) { - var args = Array.prototype.slice.call(arguments, 1); - if (args.length <= 1) { - args = args[0]; - } - results[k] = args; - callback(err); - }); - }, function (err) { - callback(err, results); - }); - } - }; - - async.iterator = function (tasks) { - var makeCallback = function (index) { - var fn = function () { - if (tasks.length) { - tasks[index].apply(null, arguments); - } - return fn.next(); - }; - fn.next = function () { - return (index < tasks.length - 1) ? makeCallback(index + 1): null; - }; - return fn; - }; - return makeCallback(0); - }; - - async.apply = function (fn) { - var args = Array.prototype.slice.call(arguments, 1); - return function () { - return fn.apply( - null, args.concat(Array.prototype.slice.call(arguments)) - ); - }; - }; - - var _concat = function (eachfn, arr, fn, callback) { - var r = []; - eachfn(arr, function (x, cb) { - fn(x, function (err, y) { - r = r.concat(y || []); - cb(err); - }); - }, function (err) { - callback(err, r); - }); - }; - async.concat = doParallel(_concat); - async.concatSeries = doSeries(_concat); - - async.whilst = function (test, iterator, callback) { - if (test()) { - iterator(function (err) { - if (err) { - return callback(err); - } - async.whilst(test, iterator, callback); - }); - } - else { - callback(); - } - }; - - async.doWhilst = function (iterator, test, callback) { - iterator(function (err) { - if (err) { - return callback(err); - } - if (test()) { - async.doWhilst(iterator, test, callback); - } - else { - callback(); - } - }); - }; - - async.until = function (test, iterator, callback) { - if (!test()) { - iterator(function (err) { - if (err) { - return callback(err); - } - async.until(test, iterator, callback); - }); - } - else { - callback(); - } - }; - - async.doUntil = function (iterator, test, callback) { - iterator(function (err) { - if (err) { - return callback(err); - } - if (!test()) { - async.doUntil(iterator, test, callback); - } - else { - callback(); - } - }); - }; - - async.queue = function (worker, concurrency) { - if (concurrency === undefined) { - concurrency = 1; - } - function _insert(q, data, pos, callback) { - if(data.constructor !== Array) { - data = [data]; - } - _each(data, function(task) { - var item = { - data: task, - callback: typeof callback === 'function' ? callback : null - }; - - if (pos) { - q.tasks.unshift(item); - } else { - q.tasks.push(item); - } - - if (q.saturated && q.tasks.length === concurrency) { - q.saturated(); - } - async.setImmediate(q.process); - }); - } - - var workers = 0; - var q = { - tasks: [], - concurrency: concurrency, - saturated: null, - empty: null, - drain: null, - push: function (data, callback) { - _insert(q, data, false, callback); - }, - unshift: function (data, callback) { - _insert(q, data, true, callback); - }, - process: function () { - if (workers < q.concurrency && q.tasks.length) { - var task = q.tasks.shift(); - if (q.empty && q.tasks.length === 0) { - q.empty(); - } - workers += 1; - var next = function () { - workers -= 1; - if (task.callback) { - task.callback.apply(task, arguments); - } - if (q.drain && q.tasks.length + workers === 0) { - q.drain(); - } - q.process(); - }; - var cb = only_once(next); - worker(task.data, cb); - } - }, - length: function () { - return q.tasks.length; - }, - running: function () { - return workers; - } - }; - return q; - }; - - async.cargo = function (worker, payload) { - var working = false, - tasks = []; - - var cargo = { - tasks: tasks, - payload: payload, - saturated: null, - empty: null, - drain: null, - push: function (data, callback) { - if(data.constructor !== Array) { - data = [data]; - } - _each(data, function(task) { - tasks.push({ - data: task, - callback: typeof callback === 'function' ? callback : null - }); - if (cargo.saturated && tasks.length === payload) { - cargo.saturated(); - } - }); - async.setImmediate(cargo.process); - }, - process: function process() { - if (working) return; - if (tasks.length === 0) { - if(cargo.drain) cargo.drain(); - return; - } - - var ts = typeof payload === 'number' - ? tasks.splice(0, payload) - : tasks.splice(0); - - var ds = _map(ts, function (task) { - return task.data; - }); - - if(cargo.empty) cargo.empty(); - working = true; - worker(ds, function () { - working = false; - - var args = arguments; - _each(ts, function (data) { - if (data.callback) { - data.callback.apply(null, args); - } - }); - - process(); - }); - }, - length: function () { - return tasks.length; - }, - running: function () { - return working; - } - }; - return cargo; - }; - - var _console_fn = function (name) { - return function (fn) { - var args = Array.prototype.slice.call(arguments, 1); - fn.apply(null, args.concat([function (err) { - var args = Array.prototype.slice.call(arguments, 1); - if (typeof console !== 'undefined') { - if (err) { - if (console.error) { - console.error(err); - } - } - else if (console[name]) { - _each(args, function (x) { - console[name](x); - }); - } - } - }])); - }; - }; - async.log = _console_fn('log'); - async.dir = _console_fn('dir'); - /*async.info = _console_fn('info'); - async.warn = _console_fn('warn'); - async.error = _console_fn('error');*/ - - async.memoize = function (fn, hasher) { - var memo = {}; - var queues = {}; - hasher = hasher || function (x) { - return x; - }; - var memoized = function () { - var args = Array.prototype.slice.call(arguments); - var callback = args.pop(); - var key = hasher.apply(null, args); - if (key in memo) { - callback.apply(null, memo[key]); - } - else if (key in queues) { - queues[key].push(callback); - } - else { - queues[key] = [callback]; - fn.apply(null, args.concat([function () { - memo[key] = arguments; - var q = queues[key]; - delete queues[key]; - for (var i = 0, l = q.length; i < l; i++) { - q[i].apply(null, arguments); - } - }])); - } - }; - memoized.memo = memo; - memoized.unmemoized = fn; - return memoized; - }; - - async.unmemoize = function (fn) { - return function () { - return (fn.unmemoized || fn).apply(null, arguments); - }; - }; - - async.times = function (count, iterator, callback) { - var counter = []; - for (var i = 0; i < count; i++) { - counter.push(i); - } - return async.map(counter, iterator, callback); - }; - - async.timesSeries = function (count, iterator, callback) { - var counter = []; - for (var i = 0; i < count; i++) { - counter.push(i); - } - return async.mapSeries(counter, iterator, callback); - }; - - async.compose = function (/* functions... */) { - var fns = Array.prototype.reverse.call(arguments); - return function () { - var that = this; - var args = Array.prototype.slice.call(arguments); - var callback = args.pop(); - async.reduce(fns, args, function (newargs, fn, cb) { - fn.apply(that, newargs.concat([function () { - var err = arguments[0]; - var nextargs = Array.prototype.slice.call(arguments, 1); - cb(err, nextargs); - }])) - }, - function (err, results) { - callback.apply(that, [err].concat(results)); - }); - }; - }; - - var _applyEach = function (eachfn, fns /*args...*/) { - var go = function () { - var that = this; - var args = Array.prototype.slice.call(arguments); - var callback = args.pop(); - return eachfn(fns, function (fn, cb) { - fn.apply(that, args.concat([cb])); - }, - callback); - }; - if (arguments.length > 2) { - var args = Array.prototype.slice.call(arguments, 2); - return go.apply(this, args); - } - else { - return go; - } - }; - async.applyEach = doParallel(_applyEach); - async.applyEachSeries = doSeries(_applyEach); - - async.forever = function (fn, callback) { - function next(err) { - if (err) { - if (callback) { - return callback(err); - } - throw err; - } - fn(next); - } - next(); - }; - - // AMD / RequireJS - if (typeof define !== 'undefined' && define.amd) { - define([], function () { - return async; - }); - } - // Node.js - else if (typeof module !== 'undefined' && module.exports) { - module.exports = async; - } - // included directly via \n\n```\n\n## Documentation\n\n### Collections\n\n* [each](#each)\n* [map](#map)\n* [filter](#filter)\n* [reject](#reject)\n* [reduce](#reduce)\n* [detect](#detect)\n* [sortBy](#sortBy)\n* [some](#some)\n* [every](#every)\n* [concat](#concat)\n\n### Control Flow\n\n* [series](#series)\n* [parallel](#parallel)\n* [whilst](#whilst)\n* [doWhilst](#doWhilst)\n* [until](#until)\n* [doUntil](#doUntil)\n* [forever](#forever)\n* [waterfall](#waterfall)\n* [compose](#compose)\n* [applyEach](#applyEach)\n* [queue](#queue)\n* [cargo](#cargo)\n* [auto](#auto)\n* [iterator](#iterator)\n* [apply](#apply)\n* [nextTick](#nextTick)\n* [times](#times)\n* [timesSeries](#timesSeries)\n\n### Utils\n\n* [memoize](#memoize)\n* [unmemoize](#unmemoize)\n* [log](#log)\n* [dir](#dir)\n* [noConflict](#noConflict)\n\n\n## Collections\n\n\n\n### each(arr, iterator, callback)\n\nApplies an iterator function to each item in an array, in parallel.\nThe iterator is called with an item from the list and a callback for when it\nhas finished. If the iterator passes an error to this callback, the main\ncallback for the each function is immediately called with the error.\n\nNote, that since this function applies the iterator to each item in parallel\nthere is no guarantee that the iterator functions will complete in order.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback(err) which must be called once it has \n completed. If no error has occured, the callback should be run without \n arguments or with an explicit null argument.\n* callback(err) - A callback which is called after all the iterator functions\n have finished, or an error has occurred.\n\n__Example__\n\n```js\n// assuming openFiles is an array of file names and saveFile is a function\n// to save the modified contents of that file:\n\nasync.each(openFiles, saveFile, function(err){\n // if any of the saves produced an error, err would equal that error\n});\n```\n\n---------------------------------------\n\n\n\n### eachSeries(arr, iterator, callback)\n\nThe same as each only the iterator is applied to each item in the array in\nseries. The next iterator is only called once the current one has completed\nprocessing. This means the iterator functions will complete in order.\n\n\n---------------------------------------\n\n\n\n### eachLimit(arr, limit, iterator, callback)\n\nThe same as each only no more than \"limit\" iterators will be simultaneously \nrunning at any time.\n\nNote that the items are not processed in batches, so there is no guarantee that\n the first \"limit\" iterator functions will complete before any others are \nstarted.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* limit - The maximum number of iterators to run at any time.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback(err) which must be called once it has \n completed. If no error has occured, the callback should be run without \n arguments or with an explicit null argument.\n* callback(err) - A callback which is called after all the iterator functions\n have finished, or an error has occurred.\n\n__Example__\n\n```js\n// Assume documents is an array of JSON objects and requestApi is a\n// function that interacts with a rate-limited REST api.\n\nasync.eachLimit(documents, 20, requestApi, function(err){\n // if any of the saves produced an error, err would equal that error\n});\n```\n\n---------------------------------------\n\n\n### map(arr, iterator, callback)\n\nProduces a new array of values by mapping each value in the given array through\nthe iterator function. The iterator is called with an item from the array and a\ncallback for when it has finished processing. The callback takes 2 arguments, \nan error and the transformed item from the array. If the iterator passes an\nerror to this callback, the main callback for the map function is immediately\ncalled with the error.\n\nNote, that since this function applies the iterator to each item in parallel\nthere is no guarantee that the iterator functions will complete in order, however\nthe results array will be in the same order as the original array.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback(err, transformed) which must be called once \n it has completed with an error (which can be null) and a transformed item.\n* callback(err, results) - A callback which is called after all the iterator\n functions have finished, or an error has occurred. Results is an array of the\n transformed items from the original array.\n\n__Example__\n\n```js\nasync.map(['file1','file2','file3'], fs.stat, function(err, results){\n // results is now an array of stats for each file\n});\n```\n\n---------------------------------------\n\n\n### mapSeries(arr, iterator, callback)\n\nThe same as map only the iterator is applied to each item in the array in\nseries. The next iterator is only called once the current one has completed\nprocessing. The results array will be in the same order as the original.\n\n\n---------------------------------------\n\n\n### mapLimit(arr, limit, iterator, callback)\n\nThe same as map only no more than \"limit\" iterators will be simultaneously \nrunning at any time.\n\nNote that the items are not processed in batches, so there is no guarantee that\n the first \"limit\" iterator functions will complete before any others are \nstarted.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* limit - The maximum number of iterators to run at any time.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback(err, transformed) which must be called once \n it has completed with an error (which can be null) and a transformed item.\n* callback(err, results) - A callback which is called after all the iterator\n functions have finished, or an error has occurred. Results is an array of the\n transformed items from the original array.\n\n__Example__\n\n```js\nasync.map(['file1','file2','file3'], 1, fs.stat, function(err, results){\n // results is now an array of stats for each file\n});\n```\n\n---------------------------------------\n\n\n### filter(arr, iterator, callback)\n\n__Alias:__ select\n\nReturns a new array of all the values which pass an async truth test.\n_The callback for each iterator call only accepts a single argument of true or\nfalse, it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like fs.exists. This operation is\nperformed in parallel, but the results array will be in the same order as the\noriginal.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A truth test to apply to each item in the array.\n The iterator is passed a callback(truthValue) which must be called with a \n boolean argument once it has completed.\n* callback(results) - A callback which is called after all the iterator\n functions have finished.\n\n__Example__\n\n```js\nasync.filter(['file1','file2','file3'], fs.exists, function(results){\n // results now equals an array of the existing files\n});\n```\n\n---------------------------------------\n\n\n### filterSeries(arr, iterator, callback)\n\n__alias:__ selectSeries\n\nThe same as filter only the iterator is applied to each item in the array in\nseries. The next iterator is only called once the current one has completed\nprocessing. The results array will be in the same order as the original.\n\n---------------------------------------\n\n\n### reject(arr, iterator, callback)\n\nThe opposite of filter. Removes values that pass an async truth test.\n\n---------------------------------------\n\n\n### rejectSeries(arr, iterator, callback)\n\nThe same as reject, only the iterator is applied to each item in the array\nin series.\n\n\n---------------------------------------\n\n\n### reduce(arr, memo, iterator, callback)\n\n__aliases:__ inject, foldl\n\nReduces a list of values into a single value using an async iterator to return\neach successive step. Memo is the initial state of the reduction. This\nfunction only operates in series. For performance reasons, it may make sense to\nsplit a call to this function into a parallel map, then use the normal\nArray.prototype.reduce on the results. This function is for situations where\neach step in the reduction needs to be async, if you can get the data before\nreducing it then it's probably a good idea to do so.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* memo - The initial state of the reduction.\n* iterator(memo, item, callback) - A function applied to each item in the\n array to produce the next step in the reduction. The iterator is passed a\n callback(err, reduction) which accepts an optional error as its first \n argument, and the state of the reduction as the second. If an error is \n passed to the callback, the reduction is stopped and the main callback is \n immediately called with the error.\n* callback(err, result) - A callback which is called after all the iterator\n functions have finished. Result is the reduced value.\n\n__Example__\n\n```js\nasync.reduce([1,2,3], 0, function(memo, item, callback){\n // pointless async:\n process.nextTick(function(){\n callback(null, memo + item)\n });\n}, function(err, result){\n // result is now equal to the last value of memo, which is 6\n});\n```\n\n---------------------------------------\n\n\n### reduceRight(arr, memo, iterator, callback)\n\n__Alias:__ foldr\n\nSame as reduce, only operates on the items in the array in reverse order.\n\n\n---------------------------------------\n\n\n### detect(arr, iterator, callback)\n\nReturns the first value in a list that passes an async truth test. The\niterator is applied in parallel, meaning the first iterator to return true will\nfire the detect callback with that result. That means the result might not be\nthe first item in the original array (in terms of order) that passes the test.\n\nIf order within the original array is important then look at detectSeries.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A truth test to apply to each item in the array.\n The iterator is passed a callback(truthValue) which must be called with a \n boolean argument once it has completed.\n* callback(result) - A callback which is called as soon as any iterator returns\n true, or after all the iterator functions have finished. Result will be\n the first item in the array that passes the truth test (iterator) or the\n value undefined if none passed.\n\n__Example__\n\n```js\nasync.detect(['file1','file2','file3'], fs.exists, function(result){\n // result now equals the first file in the list that exists\n});\n```\n\n---------------------------------------\n\n\n### detectSeries(arr, iterator, callback)\n\nThe same as detect, only the iterator is applied to each item in the array\nin series. This means the result is always the first in the original array (in\nterms of array order) that passes the truth test.\n\n\n---------------------------------------\n\n\n### sortBy(arr, iterator, callback)\n\nSorts a list by the results of running each value through an async iterator.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback(err, sortValue) which must be called once it\n has completed with an error (which can be null) and a value to use as the sort\n criteria.\n* callback(err, results) - A callback which is called after all the iterator\n functions have finished, or an error has occurred. Results is the items from\n the original array sorted by the values returned by the iterator calls.\n\n__Example__\n\n```js\nasync.sortBy(['file1','file2','file3'], function(file, callback){\n fs.stat(file, function(err, stats){\n callback(err, stats.mtime);\n });\n}, function(err, results){\n // results is now the original array of files sorted by\n // modified date\n});\n```\n\n---------------------------------------\n\n\n### some(arr, iterator, callback)\n\n__Alias:__ any\n\nReturns true if at least one element in the array satisfies an async test.\n_The callback for each iterator call only accepts a single argument of true or\nfalse, it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like fs.exists. Once any iterator\ncall returns true, the main callback is immediately called.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A truth test to apply to each item in the array.\n The iterator is passed a callback(truthValue) which must be called with a \n boolean argument once it has completed.\n* callback(result) - A callback which is called as soon as any iterator returns\n true, or after all the iterator functions have finished. Result will be\n either true or false depending on the values of the async tests.\n\n__Example__\n\n```js\nasync.some(['file1','file2','file3'], fs.exists, function(result){\n // if result is true then at least one of the files exists\n});\n```\n\n---------------------------------------\n\n\n### every(arr, iterator, callback)\n\n__Alias:__ all\n\nReturns true if every element in the array satisfies an async test.\n_The callback for each iterator call only accepts a single argument of true or\nfalse, it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like fs.exists.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A truth test to apply to each item in the array.\n The iterator is passed a callback(truthValue) which must be called with a \n boolean argument once it has completed.\n* callback(result) - A callback which is called after all the iterator\n functions have finished. Result will be either true or false depending on\n the values of the async tests.\n\n__Example__\n\n```js\nasync.every(['file1','file2','file3'], fs.exists, function(result){\n // if result is true then every file exists\n});\n```\n\n---------------------------------------\n\n\n### concat(arr, iterator, callback)\n\nApplies an iterator to each item in a list, concatenating the results. Returns the\nconcatenated list. The iterators are called in parallel, and the results are\nconcatenated as they return. There is no guarantee that the results array will\nbe returned in the original order of the arguments passed to the iterator function.\n\n__Arguments__\n\n* arr - An array to iterate over\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback(err, results) which must be called once it \n has completed with an error (which can be null) and an array of results.\n* callback(err, results) - A callback which is called after all the iterator\n functions have finished, or an error has occurred. Results is an array containing\n the concatenated results of the iterator function.\n\n__Example__\n\n```js\nasync.concat(['dir1','dir2','dir3'], fs.readdir, function(err, files){\n // files is now a list of filenames that exist in the 3 directories\n});\n```\n\n---------------------------------------\n\n\n### concatSeries(arr, iterator, callback)\n\nSame as async.concat, but executes in series instead of parallel.\n\n\n## Control Flow\n\n\n### series(tasks, [callback])\n\nRun an array of functions in series, each one running once the previous\nfunction has completed. If any functions in the series pass an error to its\ncallback, no more functions are run and the callback for the series is\nimmediately called with the value of the error. Once the tasks have completed,\nthe results are passed to the final callback as an array.\n\nIt is also possible to use an object instead of an array. Each property will be\nrun as a function and the results will be passed to the final callback as an object\ninstead of an array. This can be a more readable way of handling results from\nasync.series.\n\n\n__Arguments__\n\n* tasks - An array or object containing functions to run, each function is passed\n a callback(err, result) it must call on completion with an error (which can\n be null) and an optional result value.\n* callback(err, results) - An optional callback to run once all the functions\n have completed. This function gets a results array (or object) containing all \n the result arguments passed to the task callbacks.\n\n__Example__\n\n```js\nasync.series([\n function(callback){\n // do some stuff ...\n callback(null, 'one');\n },\n function(callback){\n // do some more stuff ...\n callback(null, 'two');\n }\n],\n// optional callback\nfunction(err, results){\n // results is now equal to ['one', 'two']\n});\n\n\n// an example using an object instead of an array\nasync.series({\n one: function(callback){\n setTimeout(function(){\n callback(null, 1);\n }, 200);\n },\n two: function(callback){\n setTimeout(function(){\n callback(null, 2);\n }, 100);\n }\n},\nfunction(err, results) {\n // results is now equal to: {one: 1, two: 2}\n});\n```\n\n---------------------------------------\n\n\n### parallel(tasks, [callback])\n\nRun an array of functions in parallel, without waiting until the previous\nfunction has completed. If any of the functions pass an error to its\ncallback, the main callback is immediately called with the value of the error.\nOnce the tasks have completed, the results are passed to the final callback as an\narray.\n\nIt is also possible to use an object instead of an array. Each property will be\nrun as a function and the results will be passed to the final callback as an object\ninstead of an array. This can be a more readable way of handling results from\nasync.parallel.\n\n\n__Arguments__\n\n* tasks - An array or object containing functions to run, each function is passed \n a callback(err, result) it must call on completion with an error (which can\n be null) and an optional result value.\n* callback(err, results) - An optional callback to run once all the functions\n have completed. This function gets a results array (or object) containing all \n the result arguments passed to the task callbacks.\n\n__Example__\n\n```js\nasync.parallel([\n function(callback){\n setTimeout(function(){\n callback(null, 'one');\n }, 200);\n },\n function(callback){\n setTimeout(function(){\n callback(null, 'two');\n }, 100);\n }\n],\n// optional callback\nfunction(err, results){\n // the results array will equal ['one','two'] even though\n // the second function had a shorter timeout.\n});\n\n\n// an example using an object instead of an array\nasync.parallel({\n one: function(callback){\n setTimeout(function(){\n callback(null, 1);\n }, 200);\n },\n two: function(callback){\n setTimeout(function(){\n callback(null, 2);\n }, 100);\n }\n},\nfunction(err, results) {\n // results is now equals to: {one: 1, two: 2}\n});\n```\n\n---------------------------------------\n\n\n### parallelLimit(tasks, limit, [callback])\n\nThe same as parallel only the tasks are executed in parallel with a maximum of \"limit\" \ntasks executing at any time.\n\nNote that the tasks are not executed in batches, so there is no guarantee that \nthe first \"limit\" tasks will complete before any others are started.\n\n__Arguments__\n\n* tasks - An array or object containing functions to run, each function is passed \n a callback(err, result) it must call on completion with an error (which can\n be null) and an optional result value.\n* limit - The maximum number of tasks to run at any time.\n* callback(err, results) - An optional callback to run once all the functions\n have completed. This function gets a results array (or object) containing all \n the result arguments passed to the task callbacks.\n\n---------------------------------------\n\n\n### whilst(test, fn, callback)\n\nRepeatedly call fn, while test returns true. Calls the callback when stopped,\nor an error occurs.\n\n__Arguments__\n\n* test() - synchronous truth test to perform before each execution of fn.\n* fn(callback) - A function to call each time the test passes. The function is\n passed a callback(err) which must be called once it has completed with an \n optional error argument.\n* callback(err) - A callback which is called after the test fails and repeated\n execution of fn has stopped.\n\n__Example__\n\n```js\nvar count = 0;\n\nasync.whilst(\n function () { return count < 5; },\n function (callback) {\n count++;\n setTimeout(callback, 1000);\n },\n function (err) {\n // 5 seconds have passed\n }\n);\n```\n\n---------------------------------------\n\n\n### doWhilst(fn, test, callback)\n\nThe post check version of whilst. To reflect the difference in the order of operations `test` and `fn` arguments are switched. `doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript.\n\n---------------------------------------\n\n\n### until(test, fn, callback)\n\nRepeatedly call fn, until test returns true. Calls the callback when stopped,\nor an error occurs.\n\nThe inverse of async.whilst.\n\n---------------------------------------\n\n\n### doUntil(fn, test, callback)\n\nLike doWhilst except the test is inverted. Note the argument ordering differs from `until`.\n\n---------------------------------------\n\n\n### forever(fn, callback)\n\nCalls the asynchronous function 'fn' repeatedly, in series, indefinitely.\nIf an error is passed to fn's callback then 'callback' is called with the\nerror, otherwise it will never be called.\n\n---------------------------------------\n\n\n### waterfall(tasks, [callback])\n\nRuns an array of functions in series, each passing their results to the next in\nthe array. However, if any of the functions pass an error to the callback, the\nnext function is not executed and the main callback is immediately called with\nthe error.\n\n__Arguments__\n\n* tasks - An array of functions to run, each function is passed a \n callback(err, result1, result2, ...) it must call on completion. The first\n argument is an error (which can be null) and any further arguments will be \n passed as arguments in order to the next task.\n* callback(err, [results]) - An optional callback to run once all the functions\n have completed. This will be passed the results of the last task's callback.\n\n\n\n__Example__\n\n```js\nasync.waterfall([\n function(callback){\n callback(null, 'one', 'two');\n },\n function(arg1, arg2, callback){\n callback(null, 'three');\n },\n function(arg1, callback){\n // arg1 now equals 'three'\n callback(null, 'done');\n }\n], function (err, result) {\n // result now equals 'done' \n});\n```\n\n---------------------------------------\n\n### compose(fn1, fn2...)\n\nCreates a function which is a composition of the passed asynchronous\nfunctions. Each function consumes the return value of the function that\nfollows. Composing functions f(), g() and h() would produce the result of\nf(g(h())), only this version uses callbacks to obtain the return values.\n\nEach function is executed with the `this` binding of the composed function.\n\n__Arguments__\n\n* functions... - the asynchronous functions to compose\n\n\n__Example__\n\n```js\nfunction add1(n, callback) {\n setTimeout(function () {\n callback(null, n + 1);\n }, 10);\n}\n\nfunction mul3(n, callback) {\n setTimeout(function () {\n callback(null, n * 3);\n }, 10);\n}\n\nvar add1mul3 = async.compose(mul3, add1);\n\nadd1mul3(4, function (err, result) {\n // result now equals 15\n});\n```\n\n---------------------------------------\n\n### applyEach(fns, args..., callback)\n\nApplies the provided arguments to each function in the array, calling the\ncallback after all functions have completed. If you only provide the first\nargument then it will return a function which lets you pass in the\narguments as if it were a single function call.\n\n__Arguments__\n\n* fns - the asynchronous functions to all call with the same arguments\n* args... - any number of separate arguments to pass to the function\n* callback - the final argument should be the callback, called when all\n functions have completed processing\n\n\n__Example__\n\n```js\nasync.applyEach([enableSearch, updateSchema], 'bucket', callback);\n\n// partial application example:\nasync.each(\n buckets,\n async.applyEach([enableSearch, updateSchema]),\n callback\n);\n```\n\n---------------------------------------\n\n\n### applyEachSeries(arr, iterator, callback)\n\nThe same as applyEach only the functions are applied in series.\n\n---------------------------------------\n\n\n### queue(worker, concurrency)\n\nCreates a queue object with the specified concurrency. Tasks added to the\nqueue will be processed in parallel (up to the concurrency limit). If all\nworkers are in progress, the task is queued until one is available. Once\na worker has completed a task, the task's callback is called.\n\n__Arguments__\n\n* worker(task, callback) - An asynchronous function for processing a queued\n task, which must call its callback(err) argument when finished, with an \n optional error as an argument.\n* concurrency - An integer for determining how many worker functions should be\n run in parallel.\n\n__Queue objects__\n\nThe queue object returned by this function has the following properties and\nmethods:\n\n* length() - a function returning the number of items waiting to be processed.\n* concurrency - an integer for determining how many worker functions should be\n run in parallel. This property can be changed after a queue is created to\n alter the concurrency on-the-fly.\n* push(task, [callback]) - add a new task to the queue, the callback is called\n once the worker has finished processing the task.\n instead of a single task, an array of tasks can be submitted. the respective callback is used for every task in the list.\n* unshift(task, [callback]) - add a new task to the front of the queue.\n* saturated - a callback that is called when the queue length hits the concurrency and further tasks will be queued\n* empty - a callback that is called when the last item from the queue is given to a worker\n* drain - a callback that is called when the last item from the queue has returned from the worker\n\n__Example__\n\n```js\n// create a queue object with concurrency 2\n\nvar q = async.queue(function (task, callback) {\n console.log('hello ' + task.name);\n callback();\n}, 2);\n\n\n// assign a callback\nq.drain = function() {\n console.log('all items have been processed');\n}\n\n// add some items to the queue\n\nq.push({name: 'foo'}, function (err) {\n console.log('finished processing foo');\n});\nq.push({name: 'bar'}, function (err) {\n console.log('finished processing bar');\n});\n\n// add some items to the queue (batch-wise)\n\nq.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function (err) {\n console.log('finished processing bar');\n});\n\n// add some items to the front of the queue\n\nq.unshift({name: 'bar'}, function (err) {\n console.log('finished processing bar');\n});\n```\n\n---------------------------------------\n\n\n### cargo(worker, [payload])\n\nCreates a cargo object with the specified payload. Tasks added to the\ncargo will be processed altogether (up to the payload limit). If the\nworker is in progress, the task is queued until it is available. Once\nthe worker has completed some tasks, each callback of those tasks is called.\n\n__Arguments__\n\n* worker(tasks, callback) - An asynchronous function for processing an array of\n queued tasks, which must call its callback(err) argument when finished, with \n an optional error as an argument.\n* payload - An optional integer for determining how many tasks should be\n processed per round; if omitted, the default is unlimited.\n\n__Cargo objects__\n\nThe cargo object returned by this function has the following properties and\nmethods:\n\n* length() - a function returning the number of items waiting to be processed.\n* payload - an integer for determining how many tasks should be\n process per round. This property can be changed after a cargo is created to\n alter the payload on-the-fly.\n* push(task, [callback]) - add a new task to the queue, the callback is called\n once the worker has finished processing the task.\n instead of a single task, an array of tasks can be submitted. the respective callback is used for every task in the list.\n* saturated - a callback that is called when the queue length hits the concurrency and further tasks will be queued\n* empty - a callback that is called when the last item from the queue is given to a worker\n* drain - a callback that is called when the last item from the queue has returned from the worker\n\n__Example__\n\n```js\n// create a cargo object with payload 2\n\nvar cargo = async.cargo(function (tasks, callback) {\n for(var i=0; i\n### auto(tasks, [callback])\n\nDetermines the best order for running functions based on their requirements.\nEach function can optionally depend on other functions being completed first,\nand each function is run as soon as its requirements are satisfied. If any of\nthe functions pass an error to their callback, that function will not complete\n(so any other functions depending on it will not run) and the main callback\nwill be called immediately with the error. Functions also receive an object\ncontaining the results of functions which have completed so far.\n\nNote, all functions are called with a results object as a second argument, \nso it is unsafe to pass functions in the tasks object which cannot handle the\nextra argument. For example, this snippet of code:\n\n```js\nasync.auto({\n readData: async.apply(fs.readFile, 'data.txt', 'utf-8');\n}, callback);\n```\n\nwill have the effect of calling readFile with the results object as the last\nargument, which will fail:\n\n```js\nfs.readFile('data.txt', 'utf-8', cb, {});\n```\n\nInstead, wrap the call to readFile in a function which does not forward the \nresults object:\n\n```js\nasync.auto({\n readData: function(cb, results){\n fs.readFile('data.txt', 'utf-8', cb);\n }\n}, callback);\n```\n\n__Arguments__\n\n* tasks - An object literal containing named functions or an array of\n requirements, with the function itself the last item in the array. The key\n used for each function or array is used when specifying requirements. The \n function receives two arguments: (1) a callback(err, result) which must be \n called when finished, passing an error (which can be null) and the result of \n the function's execution, and (2) a results object, containing the results of\n the previously executed functions.\n* callback(err, results) - An optional callback which is called when all the\n tasks have been completed. The callback will receive an error as an argument\n if any tasks pass an error to their callback. Results will always be passed\n\tbut if an error occurred, no other tasks will be performed, and the results\n\tobject will only contain partial results.\n \n\n__Example__\n\n```js\nasync.auto({\n get_data: function(callback){\n // async code to get some data\n },\n make_folder: function(callback){\n // async code to create a directory to store a file in\n // this is run at the same time as getting the data\n },\n write_file: ['get_data', 'make_folder', function(callback){\n // once there is some data and the directory exists,\n // write the data to a file in the directory\n callback(null, filename);\n }],\n email_link: ['write_file', function(callback, results){\n // once the file is written let's email a link to it...\n // results.write_file contains the filename returned by write_file.\n }]\n});\n```\n\nThis is a fairly trivial example, but to do this using the basic parallel and\nseries functions would look like this:\n\n```js\nasync.parallel([\n function(callback){\n // async code to get some data\n },\n function(callback){\n // async code to create a directory to store a file in\n // this is run at the same time as getting the data\n }\n],\nfunction(err, results){\n async.series([\n function(callback){\n // once there is some data and the directory exists,\n // write the data to a file in the directory\n },\n function(callback){\n // once the file is written let's email a link to it...\n }\n ]);\n});\n```\n\nFor a complicated series of async tasks using the auto function makes adding\nnew tasks much easier and makes the code more readable.\n\n\n---------------------------------------\n\n\n### iterator(tasks)\n\nCreates an iterator function which calls the next function in the array,\nreturning a continuation to call the next one after that. It's also possible to\n'peek' the next iterator by doing iterator.next().\n\nThis function is used internally by the async module but can be useful when\nyou want to manually control the flow of functions in series.\n\n__Arguments__\n\n* tasks - An array of functions to run.\n\n__Example__\n\n```js\nvar iterator = async.iterator([\n function(){ sys.p('one'); },\n function(){ sys.p('two'); },\n function(){ sys.p('three'); }\n]);\n\nnode> var iterator2 = iterator();\n'one'\nnode> var iterator3 = iterator2();\n'two'\nnode> iterator3();\n'three'\nnode> var nextfn = iterator2.next();\nnode> nextfn();\n'three'\n```\n\n---------------------------------------\n\n\n### apply(function, arguments..)\n\nCreates a continuation function with some arguments already applied, a useful\nshorthand when combined with other control flow functions. Any arguments\npassed to the returned function are added to the arguments originally passed\nto apply.\n\n__Arguments__\n\n* function - The function you want to eventually apply all arguments to.\n* arguments... - Any number of arguments to automatically apply when the\n continuation is called.\n\n__Example__\n\n```js\n// using apply\n\nasync.parallel([\n async.apply(fs.writeFile, 'testfile1', 'test1'),\n async.apply(fs.writeFile, 'testfile2', 'test2'),\n]);\n\n\n// the same process without using apply\n\nasync.parallel([\n function(callback){\n fs.writeFile('testfile1', 'test1', callback);\n },\n function(callback){\n fs.writeFile('testfile2', 'test2', callback);\n }\n]);\n```\n\nIt's possible to pass any number of additional arguments when calling the\ncontinuation:\n\n```js\nnode> var fn = async.apply(sys.puts, 'one');\nnode> fn('two', 'three');\none\ntwo\nthree\n```\n\n---------------------------------------\n\n\n### nextTick(callback)\n\nCalls the callback on a later loop around the event loop. In node.js this just\ncalls process.nextTick, in the browser it falls back to setImmediate(callback)\nif available, otherwise setTimeout(callback, 0), which means other higher priority\nevents may precede the execution of the callback.\n\nThis is used internally for browser-compatibility purposes.\n\n__Arguments__\n\n* callback - The function to call on a later loop around the event loop.\n\n__Example__\n\n```js\nvar call_order = [];\nasync.nextTick(function(){\n call_order.push('two');\n // call_order now equals ['one','two']\n});\ncall_order.push('one')\n```\n\n\n### times(n, callback)\n\nCalls the callback n times and accumulates results in the same manner\nyou would use with async.map.\n\n__Arguments__\n\n* n - The number of times to run the function.\n* callback - The function to call n times.\n\n__Example__\n\n```js\n// Pretend this is some complicated async factory\nvar createUser = function(id, callback) {\n callback(null, {\n id: 'user' + id\n })\n}\n// generate 5 users\nasync.times(5, function(n, next){\n createUser(n, function(err, user) {\n next(err, user)\n })\n}, function(err, users) {\n // we should now have 5 users\n});\n```\n\n\n### timesSeries(n, callback)\n\nThe same as times only the iterator is applied to each item in the array in\nseries. The next iterator is only called once the current one has completed\nprocessing. The results array will be in the same order as the original.\n\n\n## Utils\n\n\n### memoize(fn, [hasher])\n\nCaches the results of an async function. When creating a hash to store function\nresults against, the callback is omitted from the hash and an optional hash\nfunction can be used.\n\nThe cache of results is exposed as the `memo` property of the function returned\nby `memoize`.\n\n__Arguments__\n\n* fn - the function you to proxy and cache results from.\n* hasher - an optional function for generating a custom hash for storing\n results, it has all the arguments applied to it apart from the callback, and\n must be synchronous.\n\n__Example__\n\n```js\nvar slow_fn = function (name, callback) {\n // do something\n callback(null, result);\n};\nvar fn = async.memoize(slow_fn);\n\n// fn can now be used as if it were slow_fn\nfn('some name', function () {\n // callback\n});\n```\n\n\n### unmemoize(fn)\n\nUndoes a memoized function, reverting it to the original, unmemoized\nform. Comes handy in tests.\n\n__Arguments__\n\n* fn - the memoized function\n\n\n### log(function, arguments)\n\nLogs the result of an async function to the console. Only works in node.js or\nin browsers that support console.log and console.error (such as FF and Chrome).\nIf multiple arguments are returned from the async function, console.log is\ncalled on each argument in order.\n\n__Arguments__\n\n* function - The function you want to eventually apply all arguments to.\n* arguments... - Any number of arguments to apply to the function.\n\n__Example__\n\n```js\nvar hello = function(name, callback){\n setTimeout(function(){\n callback(null, 'hello ' + name);\n }, 1000);\n};\n```\n```js\nnode> async.log(hello, 'world');\n'hello world'\n```\n\n---------------------------------------\n\n\n### dir(function, arguments)\n\nLogs the result of an async function to the console using console.dir to\ndisplay the properties of the resulting object. Only works in node.js or\nin browsers that support console.dir and console.error (such as FF and Chrome).\nIf multiple arguments are returned from the async function, console.dir is\ncalled on each argument in order.\n\n__Arguments__\n\n* function - The function you want to eventually apply all arguments to.\n* arguments... - Any number of arguments to apply to the function.\n\n__Example__\n\n```js\nvar hello = function(name, callback){\n setTimeout(function(){\n callback(null, {hello: name});\n }, 1000);\n};\n```\n```js\nnode> async.dir(hello, 'world');\n{hello: 'world'}\n```\n\n---------------------------------------\n\n\n### noConflict()\n\nChanges the value of async back to its original value, returning a reference to the\nasync object.\n", - "readmeFilename": "README.md", - "_id": "async@0.2.9", - "_from": "async@~0.2.9" -} diff --git a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/.npmignore b/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/.npmignore deleted file mode 100644 index aba34f0127c..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -*.un~ -/node_modules -/test/tmp diff --git a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/License b/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/License deleted file mode 100644 index 4804b7ab411..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/License +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2011 Debuggable Limited - -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/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/Makefile b/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/Makefile deleted file mode 100644 index b4ff85a33b6..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -SHELL := /bin/bash - -test: - @./test/run.js - -.PHONY: test - diff --git a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/Readme.md b/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/Readme.md deleted file mode 100644 index 1a9999eb0e1..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/Readme.md +++ /dev/null @@ -1,132 +0,0 @@ -# combined-stream - -A stream that emits multiple other streams one after another. - -## Installation - -``` bash -npm install combined-stream -``` - -## Usage - -Here is a simple example that shows how you can use combined-stream to combine -two files into one: - -``` javascript -var CombinedStream = require('combined-stream'); -var fs = require('fs'); - -var combinedStream = CombinedStream.create(); -combinedStream.append(fs.createReadStream('file1.txt')); -combinedStream.append(fs.createReadStream('file2.txt')); - -combinedStream.pipe(fs.createWriteStream('combined.txt')); -``` - -While the example above works great, it will pause all source streams until -they are needed. If you don't want that to happen, you can set `pauseStreams` -to `false`: - -``` javascript -var CombinedStream = require('combined-stream'); -var fs = require('fs'); - -var combinedStream = CombinedStream.create({pauseStreams: false}); -combinedStream.append(fs.createReadStream('file1.txt')); -combinedStream.append(fs.createReadStream('file2.txt')); - -combinedStream.pipe(fs.createWriteStream('combined.txt')); -``` - -However, what if you don't have all the source streams yet, or you don't want -to allocate the resources (file descriptors, memory, etc.) for them right away? -Well, in that case you can simply provide a callback that supplies the stream -by calling a `next()` function: - -``` javascript -var CombinedStream = require('combined-stream'); -var fs = require('fs'); - -var combinedStream = CombinedStream.create(); -combinedStream.append(function(next) { - next(fs.createReadStream('file1.txt')); -}); -combinedStream.append(function(next) { - next(fs.createReadStream('file2.txt')); -}); - -combinedStream.pipe(fs.createWriteStream('combined.txt')); -``` - -## API - -### CombinedStream.create([options]) - -Returns a new combined stream object. Available options are: - -* `maxDataSize` -* `pauseStreams` - -The effect of those options is described below. - -### combinedStream.pauseStreams = true - -Whether to apply back pressure to the underlaying streams. If set to `false`, -the underlaying streams will never be paused. If set to `true`, the -underlaying streams will be paused right after being appended, as well as when -`delayedStream.pipe()` wants to throttle. - -### combinedStream.maxDataSize = 2 * 1024 * 1024 - -The maximum amount of bytes (or characters) to buffer for all source streams. -If this value is exceeded, `combinedStream` emits an `'error'` event. - -### combinedStream.dataSize = 0 - -The amount of bytes (or characters) currently buffered by `combinedStream`. - -### combinedStream.append(stream) - -Appends the given `stream` to the combinedStream object. If `pauseStreams` is -set to `true, this stream will also be paused right away. - -`streams` can also be a function that takes one parameter called `next`. `next` -is a function that must be invoked in order to provide the `next` stream, see -example above. - -Regardless of how the `stream` is appended, combined-stream always attaches an -`'error'` listener to it, so you don't have to do that manually. - -Special case: `stream` can also be a String or Buffer. - -### combinedStream.write(data) - -You should not call this, `combinedStream` takes care of piping the appended -streams into itself for you. - -### combinedStream.resume() - -Causes `combinedStream` to start drain the streams it manages. The function is -idempotent, and also emits a `'resume'` event each time which usually goes to -the stream that is currently being drained. - -### combinedStream.pause(); - -If `combinedStream.pauseStreams` is set to `false`, this does nothing. -Otherwise a `'pause'` event is emitted, this goes to the stream that is -currently being drained, so you can use it to apply back pressure. - -### combinedStream.end(); - -Sets `combinedStream.writable` to false, emits an `'end'` event, and removes -all streams from the queue. - -### combinedStream.destroy(); - -Same as `combinedStream.end()`, except it emits a `'close'` event instead of -`'end'`. - -## License - -combined-stream is licensed under the MIT license. diff --git a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/lib/combined_stream.js b/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/lib/combined_stream.js deleted file mode 100644 index 32849fd109e..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/lib/combined_stream.js +++ /dev/null @@ -1,185 +0,0 @@ -var util = require('util'); -var Stream = require('stream').Stream; -var DelayedStream = require('delayed-stream'); - -module.exports = CombinedStream; -function CombinedStream() { - this.writable = false; - this.readable = true; - this.dataSize = 0; - this.maxDataSize = 2 * 1024 * 1024; - this.pauseStreams = true; - - this._released = false; - this._streams = []; - this._currentStream = null; -} -util.inherits(CombinedStream, Stream); - -CombinedStream.create = function(options) { - var combinedStream = new this(); - - options = options || {}; - for (var option in options) { - combinedStream[option] = options[option]; - } - - return combinedStream; -}; - -CombinedStream.isStreamLike = function(stream) { - return (typeof stream !== 'function') - && (typeof stream !== 'string') - && (typeof stream !== 'boolean') - && (typeof stream !== 'number') - && (!Buffer.isBuffer(stream)); -}; - -CombinedStream.prototype.append = function(stream) { - var isStreamLike = CombinedStream.isStreamLike(stream); - - if (isStreamLike) { - if (!(stream instanceof DelayedStream)) { - stream.on('data', this._checkDataSize.bind(this)); - - stream = DelayedStream.create(stream, { - maxDataSize: Infinity, - pauseStream: this.pauseStreams, - }); - } - - this._handleErrors(stream); - - if (this.pauseStreams) { - stream.pause(); - } - } - - this._streams.push(stream); - return this; -}; - -CombinedStream.prototype.pipe = function(dest, options) { - Stream.prototype.pipe.call(this, dest, options); - this.resume(); -}; - -CombinedStream.prototype._getNext = function() { - this._currentStream = null; - var stream = this._streams.shift(); - - - if (typeof stream == 'undefined') { - this.end(); - return; - } - - if (typeof stream !== 'function') { - this._pipeNext(stream); - return; - } - - var getStream = stream; - getStream(function(stream) { - var isStreamLike = CombinedStream.isStreamLike(stream); - if (isStreamLike) { - stream.on('data', this._checkDataSize.bind(this)); - this._handleErrors(stream); - } - - this._pipeNext(stream); - }.bind(this)); -}; - -CombinedStream.prototype._pipeNext = function(stream) { - this._currentStream = stream; - - var isStreamLike = CombinedStream.isStreamLike(stream); - if (isStreamLike) { - stream.on('end', this._getNext.bind(this)) - stream.pipe(this, {end: false}); - return; - } - - var value = stream; - this.write(value); - this._getNext(); -}; - -CombinedStream.prototype._handleErrors = function(stream) { - var self = this; - stream.on('error', function(err) { - self._emitError(err); - }); -}; - -CombinedStream.prototype.write = function(data) { - this.emit('data', data); -}; - -CombinedStream.prototype.pause = function() { - if (!this.pauseStreams) { - return; - } - - this.emit('pause'); -}; - -CombinedStream.prototype.resume = function() { - if (!this._released) { - this._released = true; - this.writable = true; - this._getNext(); - } - - this.emit('resume'); -}; - -CombinedStream.prototype.end = function() { - this._reset(); - this.emit('end'); -}; - -CombinedStream.prototype.destroy = function() { - this._reset(); - this.emit('close'); -}; - -CombinedStream.prototype._reset = function() { - this.writable = false; - this._streams = []; - this._currentStream = null; -}; - -CombinedStream.prototype._checkDataSize = function() { - this._updateDataSize(); - if (this.dataSize <= this.maxDataSize) { - return; - } - - var message = - 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.' - this._emitError(new Error(message)); -}; - -CombinedStream.prototype._updateDataSize = function() { - this.dataSize = 0; - - var self = this; - this._streams.forEach(function(stream) { - if (!stream.dataSize) { - return; - } - - self.dataSize += stream.dataSize; - }); - - if (this._currentStream && this._currentStream.dataSize) { - this.dataSize += this._currentStream.dataSize; - } -}; - -CombinedStream.prototype._emitError = function(err) { - this._reset(); - this.emit('error', err); -}; diff --git a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/.npmignore b/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/.npmignore deleted file mode 100644 index 2fedb26cce9..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -*.un~ -/node_modules/* diff --git a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/License b/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/License deleted file mode 100644 index 4804b7ab411..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/License +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2011 Debuggable Limited - -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/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Makefile b/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Makefile deleted file mode 100644 index b4ff85a33b6..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -SHELL := /bin/bash - -test: - @./test/run.js - -.PHONY: test - diff --git a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Readme.md b/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Readme.md deleted file mode 100644 index 5cb5b35e5bb..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Readme.md +++ /dev/null @@ -1,154 +0,0 @@ -# delayed-stream - -Buffers events from a stream until you are ready to handle them. - -## Installation - -``` bash -npm install delayed-stream -``` - -## Usage - -The following example shows how to write a http echo server that delays its -response by 1000 ms. - -``` javascript -var DelayedStream = require('delayed-stream'); -var http = require('http'); - -http.createServer(function(req, res) { - var delayed = DelayedStream.create(req); - - setTimeout(function() { - res.writeHead(200); - delayed.pipe(res); - }, 1000); -}); -``` - -If you are not using `Stream#pipe`, you can also manually release the buffered -events by calling `delayedStream.resume()`: - -``` javascript -var delayed = DelayedStream.create(req); - -setTimeout(function() { - // Emit all buffered events and resume underlaying source - delayed.resume(); -}, 1000); -``` - -## Implementation - -In order to use this meta stream properly, here are a few things you should -know about the implementation. - -### Event Buffering / Proxying - -All events of the `source` stream are hijacked by overwriting the `source.emit` -method. Until node implements a catch-all event listener, this is the only way. - -However, delayed-stream still continues to emit all events it captures on the -`source`, regardless of whether you have released the delayed stream yet or -not. - -Upon creation, delayed-stream captures all `source` events and stores them in -an internal event buffer. Once `delayedStream.release()` is called, all -buffered events are emitted on the `delayedStream`, and the event buffer is -cleared. After that, delayed-stream merely acts as a proxy for the underlaying -source. - -### Error handling - -Error events on `source` are buffered / proxied just like any other events. -However, `delayedStream.create` attaches a no-op `'error'` listener to the -`source`. This way you only have to handle errors on the `delayedStream` -object, rather than in two places. - -### Buffer limits - -delayed-stream provides a `maxDataSize` property that can be used to limit -the amount of data being buffered. In order to protect you from bad `source` -streams that don't react to `source.pause()`, this feature is enabled by -default. - -## API - -### DelayedStream.create(source, [options]) - -Returns a new `delayedStream`. Available options are: - -* `pauseStream` -* `maxDataSize` - -The description for those properties can be found below. - -### delayedStream.source - -The `source` stream managed by this object. This is useful if you are -passing your `delayedStream` around, and you still want to access properties -on the `source` object. - -### delayedStream.pauseStream = true - -Whether to pause the underlaying `source` when calling -`DelayedStream.create()`. Modifying this property afterwards has no effect. - -### delayedStream.maxDataSize = 1024 * 1024 - -The amount of data to buffer before emitting an `error`. - -If the underlaying source is emitting `Buffer` objects, the `maxDataSize` -refers to bytes. - -If the underlaying source is emitting JavaScript strings, the size refers to -characters. - -If you know what you are doing, you can set this property to `Infinity` to -disable this feature. You can also modify this property during runtime. - -### delayedStream.maxDataSize = 1024 * 1024 - -The amount of data to buffer before emitting an `error`. - -If the underlaying source is emitting `Buffer` objects, the `maxDataSize` -refers to bytes. - -If the underlaying source is emitting JavaScript strings, the size refers to -characters. - -If you know what you are doing, you can set this property to `Infinity` to -disable this feature. - -### delayedStream.dataSize = 0 - -The amount of data buffered so far. - -### delayedStream.readable - -An ECMA5 getter that returns the value of `source.readable`. - -### delayedStream.resume() - -If the `delayedStream` has not been released so far, `delayedStream.release()` -is called. - -In either case, `source.resume()` is called. - -### delayedStream.pause() - -Calls `source.pause()`. - -### delayedStream.pipe(dest) - -Calls `delayedStream.resume()` and then proxies the arguments to `source.pipe`. - -### delayedStream.release() - -Emits and clears all events that have been buffered up so far. This does not -resume the underlaying source, use `delayedStream.resume()` instead. - -## License - -delayed-stream is licensed under the MIT license. diff --git a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/lib/delayed_stream.js b/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/lib/delayed_stream.js deleted file mode 100644 index 7c10d482531..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/lib/delayed_stream.js +++ /dev/null @@ -1,99 +0,0 @@ -var Stream = require('stream').Stream; -var util = require('util'); - -module.exports = DelayedStream; -function DelayedStream() { - this.source = null; - this.dataSize = 0; - this.maxDataSize = 1024 * 1024; - this.pauseStream = true; - - this._maxDataSizeExceeded = false; - this._released = false; - this._bufferedEvents = []; -} -util.inherits(DelayedStream, Stream); - -DelayedStream.create = function(source, options) { - var delayedStream = new this(); - - options = options || {}; - for (var option in options) { - delayedStream[option] = options[option]; - } - - delayedStream.source = source; - - var realEmit = source.emit; - source.emit = function() { - delayedStream._handleEmit(arguments); - return realEmit.apply(source, arguments); - }; - - source.on('error', function() {}); - if (delayedStream.pauseStream) { - source.pause(); - } - - return delayedStream; -}; - -DelayedStream.prototype.__defineGetter__('readable', function() { - return this.source.readable; -}); - -DelayedStream.prototype.resume = function() { - if (!this._released) { - this.release(); - } - - this.source.resume(); -}; - -DelayedStream.prototype.pause = function() { - this.source.pause(); -}; - -DelayedStream.prototype.release = function() { - this._released = true; - - this._bufferedEvents.forEach(function(args) { - this.emit.apply(this, args); - }.bind(this)); - this._bufferedEvents = []; -}; - -DelayedStream.prototype.pipe = function() { - var r = Stream.prototype.pipe.apply(this, arguments); - this.resume(); - return r; -}; - -DelayedStream.prototype._handleEmit = function(args) { - if (this._released) { - this.emit.apply(this, args); - return; - } - - if (args[0] === 'data') { - this.dataSize += args[1].length; - this._checkIfMaxDataSizeExceeded(); - } - - this._bufferedEvents.push(args); -}; - -DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() { - if (this._maxDataSizeExceeded) { - return; - } - - if (this.dataSize <= this.maxDataSize) { - return; - } - - this._maxDataSizeExceeded = true; - var message = - 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.' - this.emit('error', new Error(message)); -}; diff --git a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/package.json b/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/package.json deleted file mode 100644 index 38341b8a08f..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/package.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "author": { - "name": "Felix Geisendörfer", - "email": "felix@debuggable.com", - "url": "http://debuggable.com/" - }, - "name": "delayed-stream", - "description": "Buffers events from a stream until you are ready to handle them.", - "version": "0.0.5", - "homepage": "https://github.com/felixge/node-delayed-stream", - "repository": { - "type": "git", - "url": "git://github.com/felixge/node-delayed-stream.git" - }, - "main": "./lib/delayed_stream", - "engines": { - "node": ">=0.4.0" - }, - "dependencies": {}, - "devDependencies": { - "fake": "0.2.0", - "far": "0.0.1" - }, - "readme": "# delayed-stream\n\nBuffers events from a stream until you are ready to handle them.\n\n## Installation\n\n``` bash\nnpm install delayed-stream\n```\n\n## Usage\n\nThe following example shows how to write a http echo server that delays its\nresponse by 1000 ms.\n\n``` javascript\nvar DelayedStream = require('delayed-stream');\nvar http = require('http');\n\nhttp.createServer(function(req, res) {\n var delayed = DelayedStream.create(req);\n\n setTimeout(function() {\n res.writeHead(200);\n delayed.pipe(res);\n }, 1000);\n});\n```\n\nIf you are not using `Stream#pipe`, you can also manually release the buffered\nevents by calling `delayedStream.resume()`:\n\n``` javascript\nvar delayed = DelayedStream.create(req);\n\nsetTimeout(function() {\n // Emit all buffered events and resume underlaying source\n delayed.resume();\n}, 1000);\n```\n\n## Implementation\n\nIn order to use this meta stream properly, here are a few things you should\nknow about the implementation.\n\n### Event Buffering / Proxying\n\nAll events of the `source` stream are hijacked by overwriting the `source.emit`\nmethod. Until node implements a catch-all event listener, this is the only way.\n\nHowever, delayed-stream still continues to emit all events it captures on the\n`source`, regardless of whether you have released the delayed stream yet or\nnot.\n\nUpon creation, delayed-stream captures all `source` events and stores them in\nan internal event buffer. Once `delayedStream.release()` is called, all\nbuffered events are emitted on the `delayedStream`, and the event buffer is\ncleared. After that, delayed-stream merely acts as a proxy for the underlaying\nsource.\n\n### Error handling\n\nError events on `source` are buffered / proxied just like any other events.\nHowever, `delayedStream.create` attaches a no-op `'error'` listener to the\n`source`. This way you only have to handle errors on the `delayedStream`\nobject, rather than in two places.\n\n### Buffer limits\n\ndelayed-stream provides a `maxDataSize` property that can be used to limit\nthe amount of data being buffered. In order to protect you from bad `source`\nstreams that don't react to `source.pause()`, this feature is enabled by\ndefault.\n\n## API\n\n### DelayedStream.create(source, [options])\n\nReturns a new `delayedStream`. Available options are:\n\n* `pauseStream`\n* `maxDataSize`\n\nThe description for those properties can be found below.\n\n### delayedStream.source\n\nThe `source` stream managed by this object. This is useful if you are\npassing your `delayedStream` around, and you still want to access properties\non the `source` object.\n\n### delayedStream.pauseStream = true\n\nWhether to pause the underlaying `source` when calling\n`DelayedStream.create()`. Modifying this property afterwards has no effect.\n\n### delayedStream.maxDataSize = 1024 * 1024\n\nThe amount of data to buffer before emitting an `error`.\n\nIf the underlaying source is emitting `Buffer` objects, the `maxDataSize`\nrefers to bytes.\n\nIf the underlaying source is emitting JavaScript strings, the size refers to\ncharacters.\n\nIf you know what you are doing, you can set this property to `Infinity` to\ndisable this feature. You can also modify this property during runtime.\n\n### delayedStream.maxDataSize = 1024 * 1024\n\nThe amount of data to buffer before emitting an `error`.\n\nIf the underlaying source is emitting `Buffer` objects, the `maxDataSize`\nrefers to bytes.\n\nIf the underlaying source is emitting JavaScript strings, the size refers to\ncharacters.\n\nIf you know what you are doing, you can set this property to `Infinity` to\ndisable this feature.\n\n### delayedStream.dataSize = 0\n\nThe amount of data buffered so far.\n\n### delayedStream.readable\n\nAn ECMA5 getter that returns the value of `source.readable`.\n\n### delayedStream.resume()\n\nIf the `delayedStream` has not been released so far, `delayedStream.release()`\nis called.\n\nIn either case, `source.resume()` is called.\n\n### delayedStream.pause()\n\nCalls `source.pause()`.\n\n### delayedStream.pipe(dest)\n\nCalls `delayedStream.resume()` and then proxies the arguments to `source.pipe`.\n\n### delayedStream.release()\n\nEmits and clears all events that have been buffered up so far. This does not\nresume the underlaying source, use `delayedStream.resume()` instead.\n\n## License\n\ndelayed-stream is licensed under the MIT license.\n", - "readmeFilename": "Readme.md", - "bugs": { - "url": "https://github.com/felixge/node-delayed-stream/issues" - }, - "_id": "delayed-stream@0.0.5", - "_from": "delayed-stream@0.0.5" -} diff --git a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/common.js b/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/common.js deleted file mode 100644 index 4d71b8a6471..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/common.js +++ /dev/null @@ -1,6 +0,0 @@ -var common = module.exports; - -common.DelayedStream = require('..'); -common.assert = require('assert'); -common.fake = require('fake'); -common.PORT = 49252; diff --git a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js b/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js deleted file mode 100644 index 9ecad5b8ad1..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js +++ /dev/null @@ -1,38 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var DelayedStream = common.DelayedStream; -var http = require('http'); - -var UPLOAD = new Buffer(10 * 1024 * 1024); - -var server = http.createServer(function(req, res) { - var delayed = DelayedStream.create(req, {maxDataSize: UPLOAD.length}); - - setTimeout(function() { - res.writeHead(200); - delayed.pipe(res); - }, 10); -}); -server.listen(common.PORT, function() { - var request = http.request({ - method: 'POST', - port: common.PORT, - }); - - request.write(UPLOAD); - request.end(); - - request.on('response', function(res) { - var received = 0; - res - .on('data', function(chunk) { - received += chunk.length; - }) - .on('end', function() { - assert.equal(received, UPLOAD.length); - server.close(); - }); - }); -}); - - diff --git a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-auto-pause.js b/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-auto-pause.js deleted file mode 100644 index 6f417f3e90f..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-auto-pause.js +++ /dev/null @@ -1,21 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var fake = common.fake.create(); -var DelayedStream = common.DelayedStream; -var Stream = require('stream').Stream; - -(function testAutoPause() { - var source = new Stream(); - - fake.expect(source, 'pause', 1); - var delayedStream = DelayedStream.create(source); - fake.verify(); -})(); - -(function testDisableAutoPause() { - var source = new Stream(); - fake.expect(source, 'pause', 0); - - var delayedStream = DelayedStream.create(source, {pauseStream: false}); - fake.verify(); -})(); diff --git a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-pause.js b/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-pause.js deleted file mode 100644 index b50c39783a0..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-pause.js +++ /dev/null @@ -1,14 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var fake = common.fake.create(); -var DelayedStream = common.DelayedStream; -var Stream = require('stream').Stream; - -(function testDelayEventsUntilResume() { - var source = new Stream(); - var delayedStream = DelayedStream.create(source, {pauseStream: false}); - - fake.expect(source, 'pause'); - delayedStream.pause(); - fake.verify(); -})(); diff --git a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream.js b/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream.js deleted file mode 100644 index fc4047e08b2..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream.js +++ /dev/null @@ -1,48 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var fake = common.fake.create(); -var DelayedStream = common.DelayedStream; -var Stream = require('stream').Stream; - -(function testDelayEventsUntilResume() { - var source = new Stream(); - var delayedStream = DelayedStream.create(source, {pauseStream: false}); - - // delayedStream must not emit until we resume - fake.expect(delayedStream, 'emit', 0); - - // but our original source must emit - var params = []; - source.on('foo', function(param) { - params.push(param); - }); - - source.emit('foo', 1); - source.emit('foo', 2); - - // Make sure delayedStream did not emit, and source did - assert.deepEqual(params, [1, 2]); - fake.verify(); - - // After resume, delayedStream must playback all events - fake - .stub(delayedStream, 'emit') - .times(Infinity) - .withArg(1, 'newListener'); - fake.expect(delayedStream, 'emit', ['foo', 1]); - fake.expect(delayedStream, 'emit', ['foo', 2]); - fake.expect(source, 'resume'); - - delayedStream.resume(); - fake.verify(); - - // Calling resume again will delegate to source - fake.expect(source, 'resume'); - delayedStream.resume(); - fake.verify(); - - // Emitting more events directly leads to them being emitted - fake.expect(delayedStream, 'emit', ['foo', 3]); - source.emit('foo', 3); - fake.verify(); -})(); diff --git a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-handle-source-errors.js b/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-handle-source-errors.js deleted file mode 100644 index a9d35e72ca2..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-handle-source-errors.js +++ /dev/null @@ -1,15 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var fake = common.fake.create(); -var DelayedStream = common.DelayedStream; -var Stream = require('stream').Stream; - -(function testHandleSourceErrors() { - var source = new Stream(); - var delayedStream = DelayedStream.create(source, {pauseStream: false}); - - // We deal with this by attaching a no-op listener to 'error' on the source - // when creating a new DelayedStream. This way error events on the source - // won't throw. - source.emit('error', new Error('something went wrong')); -})(); diff --git a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-max-data-size.js b/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-max-data-size.js deleted file mode 100644 index 7638a2bf040..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-max-data-size.js +++ /dev/null @@ -1,18 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var fake = common.fake.create(); -var DelayedStream = common.DelayedStream; -var Stream = require('stream').Stream; - -(function testMaxDataSize() { - var source = new Stream(); - var delayedStream = DelayedStream.create(source, {maxDataSize: 1024, pauseStream: false}); - - source.emit('data', new Buffer(1024)); - - fake - .expect(delayedStream, 'emit') - .withArg(1, 'error'); - source.emit('data', new Buffer(1)); - fake.verify(); -})(); diff --git a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-pipe-resumes.js b/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-pipe-resumes.js deleted file mode 100644 index 7d312ab1f88..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-pipe-resumes.js +++ /dev/null @@ -1,13 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var fake = common.fake.create(); -var DelayedStream = common.DelayedStream; -var Stream = require('stream').Stream; - -(function testPipeReleases() { - var source = new Stream(); - var delayedStream = DelayedStream.create(source, {pauseStream: false}); - - fake.expect(delayedStream, 'resume'); - delayedStream.pipe(new Stream()); -})(); diff --git a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-proxy-readable.js b/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-proxy-readable.js deleted file mode 100644 index d436163b7cd..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-proxy-readable.js +++ /dev/null @@ -1,13 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var fake = common.fake.create(); -var DelayedStream = common.DelayedStream; -var Stream = require('stream').Stream; - -(function testProxyReadableProperty() { - var source = new Stream(); - var delayedStream = DelayedStream.create(source, {pauseStream: false}); - - source.readable = fake.value('source.readable'); - assert.strictEqual(delayedStream.readable, source.readable); -})(); diff --git a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/run.js b/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/run.js deleted file mode 100755 index 0bb8e822414..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/run.js +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env node -var far = require('far').create(); - -far.add(__dirname); -far.include(/test-.*\.js$/); - -far.execute(); diff --git a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/package.json b/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/package.json deleted file mode 100644 index 0dd41416227..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "author": { - "name": "Felix Geisendörfer", - "email": "felix@debuggable.com", - "url": "http://debuggable.com/" - }, - "name": "combined-stream", - "description": "A stream that emits multiple other streams one after another.", - "version": "0.0.4", - "homepage": "https://github.com/felixge/node-combined-stream", - "repository": { - "type": "git", - "url": "git://github.com/felixge/node-combined-stream.git" - }, - "main": "./lib/combined_stream", - "engines": { - "node": "*" - }, - "dependencies": { - "delayed-stream": "0.0.5" - }, - "devDependencies": { - "far": "0.0.1" - }, - "readme": "# combined-stream\n\nA stream that emits multiple other streams one after another.\n\n## Installation\n\n``` bash\nnpm install combined-stream\n```\n\n## Usage\n\nHere is a simple example that shows how you can use combined-stream to combine\ntwo files into one:\n\n``` javascript\nvar CombinedStream = require('combined-stream');\nvar fs = require('fs');\n\nvar combinedStream = CombinedStream.create();\ncombinedStream.append(fs.createReadStream('file1.txt'));\ncombinedStream.append(fs.createReadStream('file2.txt'));\n\ncombinedStream.pipe(fs.createWriteStream('combined.txt'));\n```\n\nWhile the example above works great, it will pause all source streams until\nthey are needed. If you don't want that to happen, you can set `pauseStreams`\nto `false`:\n\n``` javascript\nvar CombinedStream = require('combined-stream');\nvar fs = require('fs');\n\nvar combinedStream = CombinedStream.create({pauseStreams: false});\ncombinedStream.append(fs.createReadStream('file1.txt'));\ncombinedStream.append(fs.createReadStream('file2.txt'));\n\ncombinedStream.pipe(fs.createWriteStream('combined.txt'));\n```\n\nHowever, what if you don't have all the source streams yet, or you don't want\nto allocate the resources (file descriptors, memory, etc.) for them right away?\nWell, in that case you can simply provide a callback that supplies the stream\nby calling a `next()` function:\n\n``` javascript\nvar CombinedStream = require('combined-stream');\nvar fs = require('fs');\n\nvar combinedStream = CombinedStream.create();\ncombinedStream.append(function(next) {\n next(fs.createReadStream('file1.txt'));\n});\ncombinedStream.append(function(next) {\n next(fs.createReadStream('file2.txt'));\n});\n\ncombinedStream.pipe(fs.createWriteStream('combined.txt'));\n```\n\n## API\n\n### CombinedStream.create([options])\n\nReturns a new combined stream object. Available options are:\n\n* `maxDataSize`\n* `pauseStreams`\n\nThe effect of those options is described below.\n\n### combinedStream.pauseStreams = true\n\nWhether to apply back pressure to the underlaying streams. If set to `false`,\nthe underlaying streams will never be paused. If set to `true`, the\nunderlaying streams will be paused right after being appended, as well as when\n`delayedStream.pipe()` wants to throttle.\n\n### combinedStream.maxDataSize = 2 * 1024 * 1024\n\nThe maximum amount of bytes (or characters) to buffer for all source streams.\nIf this value is exceeded, `combinedStream` emits an `'error'` event.\n\n### combinedStream.dataSize = 0\n\nThe amount of bytes (or characters) currently buffered by `combinedStream`.\n\n### combinedStream.append(stream)\n\nAppends the given `stream` to the combinedStream object. If `pauseStreams` is\nset to `true, this stream will also be paused right away.\n\n`streams` can also be a function that takes one parameter called `next`. `next`\nis a function that must be invoked in order to provide the `next` stream, see\nexample above.\n\nRegardless of how the `stream` is appended, combined-stream always attaches an\n`'error'` listener to it, so you don't have to do that manually.\n\nSpecial case: `stream` can also be a String or Buffer.\n\n### combinedStream.write(data)\n\nYou should not call this, `combinedStream` takes care of piping the appended\nstreams into itself for you.\n\n### combinedStream.resume()\n\nCauses `combinedStream` to start drain the streams it manages. The function is\nidempotent, and also emits a `'resume'` event each time which usually goes to\nthe stream that is currently being drained.\n\n### combinedStream.pause();\n\nIf `combinedStream.pauseStreams` is set to `false`, this does nothing.\nOtherwise a `'pause'` event is emitted, this goes to the stream that is\ncurrently being drained, so you can use it to apply back pressure.\n\n### combinedStream.end();\n\nSets `combinedStream.writable` to false, emits an `'end'` event, and removes\nall streams from the queue.\n\n### combinedStream.destroy();\n\nSame as `combinedStream.end()`, except it emits a `'close'` event instead of\n`'end'`.\n\n## License\n\ncombined-stream is licensed under the MIT license.\n", - "readmeFilename": "Readme.md", - "bugs": { - "url": "https://github.com/felixge/node-combined-stream/issues" - }, - "_id": "combined-stream@0.0.4", - "_from": "combined-stream@~0.0.4" -} diff --git a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/common.js b/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/common.js deleted file mode 100644 index 81543485e02..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/common.js +++ /dev/null @@ -1,23 +0,0 @@ -var common = module.exports; - -var path = require('path'); -var fs = require('fs'); -var root = path.join(__dirname, '..'); - -common.dir = { - fixture: root + '/test/fixture', - tmp: root + '/test/tmp', -}; - -// Create tmp directory if it does not exist -// Not using fs.exists so as to be node 0.6.x compatible -try { - fs.statSync(common.dir.tmp); -} -catch (e) { - // Dir does not exist - fs.mkdirSync(common.dir.tmp); -} - -common.CombinedStream = require(root); -common.assert = require('assert'); diff --git a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/fixture/file1.txt b/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/fixture/file1.txt deleted file mode 100644 index 50e0218df4d..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/fixture/file1.txt +++ /dev/null @@ -1,256 +0,0 @@ -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 diff --git a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/fixture/file2.txt b/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/fixture/file2.txt deleted file mode 100644 index da1d821fe80..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/fixture/file2.txt +++ /dev/null @@ -1,256 +0,0 @@ -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 diff --git a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-callback-streams.js b/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-callback-streams.js deleted file mode 100644 index 44ecabab69c..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-callback-streams.js +++ /dev/null @@ -1,27 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var CombinedStream = common.CombinedStream; -var fs = require('fs'); - -var FILE1 = common.dir.fixture + '/file1.txt'; -var FILE2 = common.dir.fixture + '/file2.txt'; -var EXPECTED = fs.readFileSync(FILE1) + fs.readFileSync(FILE2); - -(function testDelayedStreams() { - var combinedStream = CombinedStream.create(); - combinedStream.append(function(next) { - next(fs.createReadStream(FILE1)); - }); - combinedStream.append(function(next) { - next(fs.createReadStream(FILE2)); - }); - - var tmpFile = common.dir.tmp + '/combined.txt'; - var dest = fs.createWriteStream(tmpFile); - combinedStream.pipe(dest); - - dest.on('end', function() { - var written = fs.readFileSync(tmpFile, 'utf8'); - assert.strictEqual(written, EXPECTED); - }); -})(); diff --git a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-data-size.js b/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-data-size.js deleted file mode 100644 index e3fbd1842f8..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-data-size.js +++ /dev/null @@ -1,34 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var CombinedStream = common.CombinedStream; - -(function testDataSizeGetter() { - var combinedStream = CombinedStream.create(); - - assert.strictEqual(combinedStream.dataSize, 0); - - // Test one stream - combinedStream._streams.push({dataSize: 10}); - combinedStream._updateDataSize(); - assert.strictEqual(combinedStream.dataSize, 10); - - // Test two streams - combinedStream._streams.push({dataSize: 23}); - combinedStream._updateDataSize(); - assert.strictEqual(combinedStream.dataSize, 33); - - // Test currentStream - combinedStream._currentStream = {dataSize: 20}; - combinedStream._updateDataSize(); - assert.strictEqual(combinedStream.dataSize, 53); - - // Test currentStream without dataSize - combinedStream._currentStream = {}; - combinedStream._updateDataSize(); - assert.strictEqual(combinedStream.dataSize, 33); - - // Test stream function - combinedStream._streams.push(function() {}); - combinedStream._updateDataSize(); - assert.strictEqual(combinedStream.dataSize, 33); -})(); diff --git a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-delayed-streams-and-buffers-and-strings.js b/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-delayed-streams-and-buffers-and-strings.js deleted file mode 100644 index c678575c07b..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-delayed-streams-and-buffers-and-strings.js +++ /dev/null @@ -1,38 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var CombinedStream = common.CombinedStream; -var fs = require('fs'); - -var FILE1 = common.dir.fixture + '/file1.txt'; -var BUFFER = new Buffer('Bacon is delicious'); -var FILE2 = common.dir.fixture + '/file2.txt'; -var STRING = 'The € kicks the $\'s ass!'; - -var EXPECTED = - fs.readFileSync(FILE1) - + BUFFER - + fs.readFileSync(FILE2) - + STRING; -var GOT; - -(function testDelayedStreams() { - var combinedStream = CombinedStream.create(); - combinedStream.append(fs.createReadStream(FILE1)); - combinedStream.append(BUFFER); - combinedStream.append(fs.createReadStream(FILE2)); - combinedStream.append(function(next) { - next(STRING); - }); - - var tmpFile = common.dir.tmp + '/combined-file1-buffer-file2-string.txt'; - var dest = fs.createWriteStream(tmpFile); - combinedStream.pipe(dest); - - dest.on('close', function() { - GOT = fs.readFileSync(tmpFile, 'utf8'); - }); -})(); - -process.on('exit', function() { - assert.strictEqual(GOT, EXPECTED); -}); diff --git a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-delayed-streams.js b/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-delayed-streams.js deleted file mode 100644 index 263cfdf7222..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-delayed-streams.js +++ /dev/null @@ -1,35 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var CombinedStream = common.CombinedStream; -var fs = require('fs'); - -var FILE1 = common.dir.fixture + '/file1.txt'; -var FILE2 = common.dir.fixture + '/file2.txt'; -var EXPECTED = fs.readFileSync(FILE1) + fs.readFileSync(FILE2); -var GOT; - -(function testDelayedStreams() { - var combinedStream = CombinedStream.create(); - combinedStream.append(fs.createReadStream(FILE1)); - combinedStream.append(fs.createReadStream(FILE2)); - - var stream1 = combinedStream._streams[0]; - var stream2 = combinedStream._streams[1]; - - stream1.on('end', function() { - assert.equal(stream2.dataSize, 0); - }); - - var tmpFile = common.dir.tmp + '/combined.txt'; - var dest = fs.createWriteStream(tmpFile); - combinedStream.pipe(dest); - - dest.on('close', function() { - GOT = fs.readFileSync(tmpFile, 'utf8'); - }); -})(); - -process.on('exit', function() { - console.error(GOT.length, EXPECTED.length); - assert.strictEqual(GOT, EXPECTED); -}); diff --git a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-empty-string.js b/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-empty-string.js deleted file mode 100644 index c3d288d013c..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-empty-string.js +++ /dev/null @@ -1,39 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var CombinedStream = common.CombinedStream; -var util = require('util'); -var Stream = require('stream').Stream; - -var s = CombinedStream.create(); - - -function StringStream(){ - this.writable=true; - this.str="" -} -util.inherits(StringStream,Stream); - -StringStream.prototype.write=function(chunk,encoding){ - this.str+=chunk.toString(); - this.emit('data',chunk); -} - -StringStream.prototype.end=function(chunk,encoding){ - this.emit('end'); -} - -StringStream.prototype.toString=function(){ - return this.str; -} - - -s.append("foo."); -s.append(""); -s.append("bar"); - -var ss = new StringStream(); - -s.pipe(ss); -s.resume(); - -assert.equal(ss.toString(),"foo.bar"); diff --git a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-is-stream-like.js b/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-is-stream-like.js deleted file mode 100644 index aefa36e6b7a..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-is-stream-like.js +++ /dev/null @@ -1,17 +0,0 @@ -var fs = require('fs'); -var common = require('../common'); -var assert = common.assert; -var CombinedStream = common.CombinedStream; -var FILE1 = common.dir.fixture + '/file1.txt'; -var fileStream = fs.createReadStream(FILE1); - -var foo = function(){}; - -(function testIsStreamLike() { - assert(! CombinedStream.isStreamLike(true)); - assert(! CombinedStream.isStreamLike("I am a string")); - assert(! CombinedStream.isStreamLike(7)); - assert(! CombinedStream.isStreamLike(foo)); - - assert(CombinedStream.isStreamLike(fileStream)); -})(); \ No newline at end of file diff --git a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-max-data-size.js b/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-max-data-size.js deleted file mode 100644 index 25f47a47c3a..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-max-data-size.js +++ /dev/null @@ -1,24 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var CombinedStream = common.CombinedStream; -var fs = require('fs'); - -var FILE1 = common.dir.fixture + '/file1.txt'; -var FILE2 = common.dir.fixture + '/file2.txt'; -var EXPECTED = fs.readFileSync(FILE1) + fs.readFileSync(FILE2); - -(function testDelayedStreams() { - var combinedStream = CombinedStream.create({pauseStreams: false, maxDataSize: 20736}); - combinedStream.append(fs.createReadStream(FILE1)); - combinedStream.append(fs.createReadStream(FILE2)); - - var gotErr = null; - combinedStream.on('error', function(err) { - gotErr = err; - }); - - process.on('exit', function() { - assert.ok(gotErr); - assert.ok(gotErr.message.match(/bytes/)); - }); -})(); diff --git a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-unpaused-streams.js b/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-unpaused-streams.js deleted file mode 100644 index 30a3a6f84e5..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-unpaused-streams.js +++ /dev/null @@ -1,30 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var CombinedStream = common.CombinedStream; -var fs = require('fs'); - -var FILE1 = common.dir.fixture + '/file1.txt'; -var FILE2 = common.dir.fixture + '/file2.txt'; -var EXPECTED = fs.readFileSync(FILE1) + fs.readFileSync(FILE2); - -(function testDelayedStreams() { - var combinedStream = CombinedStream.create({pauseStreams: false}); - combinedStream.append(fs.createReadStream(FILE1)); - combinedStream.append(fs.createReadStream(FILE2)); - - var stream1 = combinedStream._streams[0]; - var stream2 = combinedStream._streams[1]; - - stream1.on('end', function() { - assert.ok(stream2.dataSize > 0); - }); - - var tmpFile = common.dir.tmp + '/combined.txt'; - var dest = fs.createWriteStream(tmpFile); - combinedStream.pipe(dest); - - dest.on('end', function() { - var written = fs.readFileSync(tmpFile, 'utf8'); - assert.strictEqual(written, EXPECTED); - }); -})(); diff --git a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/run.js b/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/run.js deleted file mode 100755 index 0bb8e822414..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/run.js +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env node -var far = require('far').create(); - -far.add(__dirname); -far.include(/test-.*\.js$/); - -far.execute(); diff --git a/src/extensibility/node/node_modules/request/node_modules/form-data/package.json b/src/extensibility/node/node_modules/request/node_modules/form-data/package.json deleted file mode 100644 index 3900bf2dac7..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/form-data/package.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "author": { - "name": "Felix Geisendörfer", - "email": "felix@debuggable.com", - "url": "http://debuggable.com/" - }, - "name": "form-data", - "description": "A module to create readable \"multipart/form-data\" streams. Can be used to submit forms and file uploads to other web applications.", - "version": "0.1.1", - "repository": { - "type": "git", - "url": "git://github.com/felixge/node-form-data.git" - }, - "main": "./lib/form_data", - "scripts": { - "test": "node test/run.js" - }, - "engines": { - "node": ">= 0.6" - }, - "dependencies": { - "combined-stream": "~0.0.4", - "mime": "~1.2.11", - "async": "~0.2.9" - }, - "licenses": [ - { - "type": "MIT", - "url": "https://raw.github.com/felixge/node-form-data/master/License" - } - ], - "devDependencies": { - "fake": "~0.2.2", - "far": "~0.0.7", - "formidable": "~1.0.14", - "request": "~2.27.0" - }, - "readme": "# Form-Data [![Build Status](https://travis-ci.org/felixge/node-form-data.png?branch=master)](https://travis-ci.org/felixge/node-form-data) [![Dependency Status](https://gemnasium.com/felixge/node-form-data.png)](https://gemnasium.com/felixge/node-form-data)\n\nA module to create readable ```\"multipart/form-data\"``` streams. Can be used to submit forms and file uploads to other web applications.\n\nThe API of this module is inspired by the [XMLHttpRequest-2 FormData Interface][xhr2-fd].\n\n[xhr2-fd]: http://dev.w3.org/2006/webapi/XMLHttpRequest-2/Overview.html#the-formdata-interface\n\n## Install\n\n```\nnpm install form-data\n```\n\n## Usage\n\nIn this example we are constructing a form with 3 fields that contain a string,\na buffer and a file stream.\n\n``` javascript\nvar FormData = require('form-data');\nvar fs = require('fs');\n\nvar form = new FormData();\nform.append('my_field', 'my value');\nform.append('my_buffer', new Buffer(10));\nform.append('my_file', fs.createReadStream('/foo/bar.jpg'));\n```\n\nAlso you can use http-response stream:\n\n``` javascript\nvar FormData = require('form-data');\nvar http = require('http');\n\nvar form = new FormData();\n\nhttp.request('http://nodejs.org/images/logo.png', function(response) {\n form.append('my_field', 'my value');\n form.append('my_buffer', new Buffer(10));\n form.append('my_logo', response);\n});\n```\n\nOr @mikeal's request stream:\n\n``` javascript\nvar FormData = require('form-data');\nvar request = require('request');\n\nvar form = new FormData();\n\nform.append('my_field', 'my value');\nform.append('my_buffer', new Buffer(10));\nform.append('my_logo', request('http://nodejs.org/images/logo.png'));\n```\n\nIn order to submit this form to a web application, call ```submit(url, [callback])``` method:\n\n``` javascript\nform.submit('http://example.org/', function(err, res) {\n // res – response object (http.IncomingMessage)\n});\n\n```\n\nFor more advanced request manipulations ```submit()``` method returns ```http.ClientRequest``` object, or you can choose from one of the alternative submission methods.\n\n### Alternative submission methods\n\nYou can use node's http client interface:\n\n``` javascript\nvar http = require('http');\n\nvar request = http.request({\n method: 'post',\n host: 'example.org',\n path: '/upload',\n headers: form.getHeaders()\n});\n\nform.pipe(request);\n\nrequest.on('response', function(res) {\n console.log(res.statusCode);\n});\n```\n\nOr if you would prefer the `'Content-Length'` header to be set for you:\n\n``` javascript\nform.submit('example.org/upload', function(err, res) {\n console.log(res.statusCode);\n});\n```\n\nTo use custom headers and pre-known length in parts:\n\n``` javascript\nvar CRLF = '\\r\\n';\nvar form = new FormData();\n\nvar options = {\n header: CRLF + '--' + form.getBoundary() + CRLF + 'X-Custom-Header: 123' + CRLF + CRLF,\n knownLength: 1\n};\n\nform.append('my_buffer', buffer, options);\n\nform.submit('http://example.com/', function(err, res) {\n if (err) throw err;\n console.log('Done');\n});\n```\n\nForm-Data can recognize and fetch all the required information from common types of streams (```fs.readStream```, ```http.response``` and ```mikeal's request```), for some other types of streams you'd need to provide \"file\"-related information manually:\n\n``` javascript\nsomeModule.stream(function(err, stdout, stderr) {\n if (err) throw err;\n\n var form = new FormData();\n\n form.append('file', stdout, {\n filename: 'unicycle.jpg',\n contentType: 'image/jpg',\n knownLength: 19806\n });\n\n form.submit('http://example.com/', function(err, res) {\n if (err) throw err;\n console.log('Done');\n });\n});\n```\n\nFor edge cases, like POST request to URL with query string or to pass HTTP auth credentials, object can be passed to `form.submit()` as first parameter:\n\n``` javascript\nform.submit({\n host: 'example.com',\n path: '/probably.php?extra=params',\n auth: 'username:password'\n}, function(err, res) {\n console.log(res.statusCode);\n});\n```\n\n## Notes\n\n- ```getLengthSync()``` method DOESN'T calculate length for streams, use ```knownLength``` options as workaround.\n\n## TODO\n\n- Add new streams (0.10) support and try really hard not to break it for 0.8.x.\n\n## License\n\nForm-Data is licensed under the MIT license.\n", - "readmeFilename": "Readme.md", - "bugs": { - "url": "https://github.com/felixge/node-form-data/issues" - }, - "_id": "form-data@0.1.1", - "_from": "form-data@~0.1.0" -} diff --git a/src/extensibility/node/node_modules/request/node_modules/hawk/.npmignore b/src/extensibility/node/node_modules/request/node_modules/hawk/.npmignore deleted file mode 100644 index 77ba16cb055..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/hawk/.npmignore +++ /dev/null @@ -1,18 +0,0 @@ -.idea -*.iml -npm-debug.log -dump.rdb -node_modules -results.tap -results.xml -npm-shrinkwrap.json -config.json -.DS_Store -*/.DS_Store -*/*/.DS_Store -._* -*/._* -*/*/._* -coverage.* -lib-cov - diff --git a/src/extensibility/node/node_modules/request/node_modules/hawk/.travis.yml b/src/extensibility/node/node_modules/request/node_modules/hawk/.travis.yml deleted file mode 100755 index 047f7e3d5e1..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/hawk/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js - -node_js: - - 0.10 - diff --git a/src/extensibility/node/node_modules/request/node_modules/hawk/LICENSE b/src/extensibility/node/node_modules/request/node_modules/hawk/LICENSE deleted file mode 100755 index e699a7bdbaa..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/hawk/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -Copyright (c) 2012-2013, Eran Hammer. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of Eran Hammer nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL ERAN HAMMER BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/src/extensibility/node/node_modules/request/node_modules/hawk/Makefile b/src/extensibility/node/node_modules/request/node_modules/hawk/Makefile deleted file mode 100755 index 5f339bf3474..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/hawk/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -test: - @node node_modules/lab/bin/lab -test-cov: - @node node_modules/lab/bin/lab -r threshold -t 100 -test-cov-html: - @node node_modules/lab/bin/lab -r html -o coverage.html -complexity: - @node node_modules/complexity-report/src/cli.js -o complexity.md -f markdown lib - -.PHONY: test test-cov test-cov-html complexity diff --git a/src/extensibility/node/node_modules/request/node_modules/hawk/README.md b/src/extensibility/node/node_modules/request/node_modules/hawk/README.md deleted file mode 100755 index 010bac6d01a..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/hawk/README.md +++ /dev/null @@ -1,627 +0,0 @@ -![hawk Logo](https://raw.github.com/hueniverse/hawk/master/images/hawk.png) - - **Hawk** is an HTTP authentication scheme using a message authentication code (MAC) algorithm to provide partial -HTTP request cryptographic verification. For more complex use cases such as access delegation, see [Oz](https://github.com/hueniverse/oz). - -Current version: **1.0** - -[![Build Status](https://secure.travis-ci.org/hueniverse/hawk.png)](http://travis-ci.org/hueniverse/hawk) - -# Table of Content - -- [**Introduction**](#introduction) - - [Replay Protection](#replay-protection) - - [Usage Example](#usage-example) - - [Protocol Example](#protocol-example) - - [Payload Validation](#payload-validation) - - [Response Payload Validation](#response-payload-validation) - - [Browser Support and Considerations](#browser-support-and-considerations) -

    -- [**Single URI Authorization**](#single-uri-authorization) - - [Usage Example](#bewit-usage-example) -

    -- [**Security Considerations**](#security-considerations) - - [MAC Keys Transmission](#mac-keys-transmission) - - [Confidentiality of Requests](#confidentiality-of-requests) - - [Spoofing by Counterfeit Servers](#spoofing-by-counterfeit-servers) - - [Plaintext Storage of Credentials](#plaintext-storage-of-credentials) - - [Entropy of Keys](#entropy-of-keys) - - [Coverage Limitations](#coverage-limitations) - - [Future Time Manipulation](#future-time-manipulation) - - [Client Clock Poisoning](#client-clock-poisoning) - - [Bewit Limitations](#bewit-limitations) - - [Host Header Forgery](#host-header-forgery) -

    -- [**Frequently Asked Questions**](#frequently-asked-questions) -

    -- [**Acknowledgements**](#acknowledgements) - -# Introduction - -**Hawk** is an HTTP authentication scheme providing mechanisms for making authenticated HTTP requests with -partial cryptographic verification of the request and response, covering the HTTP method, request URI, host, -and optionally the request payload. - -Similar to the HTTP [Digest access authentication schemes](http://www.ietf.org/rfc/rfc2617.txt), **Hawk** uses a set of -client credentials which include an identifier (e.g. username) and key (e.g. password). Likewise, just as with the Digest scheme, -the key is never included in authenticated requests. Instead, it is used to calculate a request MAC value which is -included in its place. - -However, **Hawk** has several differences from Digest. In particular, while both use a nonce to limit the possibility of -replay attacks, in **Hawk** the client generates the nonce and uses it in combination with a timestamp, leading to less -"chattiness" (interaction with the server). - -Also unlike Digest, this scheme is not intended to protect the key itself (the password in Digest) because -the client and server must both have access to the key material in the clear. - -The primary design goals of this scheme are to: -* simplify and improve HTTP authentication for services that are unwilling or unable to deploy TLS for all resources, -* secure credentials against leakage (e.g., when the client uses some form of dynamic configuration to determine where - to send an authenticated request), and -* avoid the exposure of credentials sent to a malicious server over an unauthenticated secure channel due to client - failure to validate the server's identity as part of its TLS handshake. - -In addition, **Hawk** supports a method for granting third-parties temporary access to individual resources using -a query parameter called _bewit_ (in falconry, a leather strap used to attach a tracking device to the leg of a hawk). - -The **Hawk** scheme requires the establishment of a shared symmetric key between the client and the server, -which is beyond the scope of this module. Typically, the shared credentials are established via an initial -TLS-protected phase or derived from some other shared confidential information available to both the client -and the server. - - -## Replay Protection - -Without replay protection, an attacker can use a compromised (but otherwise valid and authenticated) request more -than once, gaining access to a protected resource. To mitigate this, clients include both a nonce and a timestamp when -making requests. This gives the server enough information to prevent replay attacks. - -The nonce is generated by the client, and is a string unique across all requests with the same timestamp and -key identifier combination. - -The timestamp enables the server to restrict the validity period of the credentials where requests occuring afterwards -are rejected. It also removes the need for the server to retain an unbounded number of nonce values for future checks. -By default, **Hawk** uses a time window of 1 minute to allow for time skew between the client and server (which in -practice translates to a maximum of 2 minutes as the skew can be positive or negative). - -Using a timestamp requires the client's clock to be in sync with the server's clock. **Hawk** requires both the client -clock and the server clock to use NTP to ensure synchronization. However, given the limitations of some client types -(e.g. browsers) to deploy NTP, the server provides the client with its current time (in seconds precision) in response -to a bad timestamp. - -There is no expectation that the client will adjust its system clock to match the server (in fact, this would be a -potential attack vector). Instead, the client only uses the server's time to calculate an offset used only -for communications with that particular server. The protocol rewards clients with synchronized clocks by reducing -the number of round trips required to authenticate the first request. - - -## Usage Example - -Server code: - -```javascript -var Http = require('http'); -var Hawk = require('hawk'); - - -// Credentials lookup function - -var credentialsFunc = function (id, callback) { - - var credentials = { - key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn', - algorithm: 'sha256', - user: 'Steve' - }; - - return callback(null, credentials); -}; - -// Create HTTP server - -var handler = function (req, res) { - - // Authenticate incoming request - - Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) { - - // Prepare response - - var payload = (!err ? 'Hello ' + credentials.user + ' ' + artifacts.ext : 'Shoosh!'); - var headers = { 'Content-Type': 'text/plain' }; - - // Generate Server-Authorization response header - - var header = Hawk.server.header(credentials, artifacts, { payload: payload, contentType: headers['Content-Type'] }); - headers['Server-Authorization'] = header; - - // Send the response back - - res.writeHead(!err ? 200 : 401, headers); - res.end(payload); - }); -}; - -// Start server - -Http.createServer(handler).listen(8000, 'example.com'); -``` - -Client code: - -```javascript -var Request = require('request'); -var Hawk = require('hawk'); - - -// Client credentials - -var credentials = { - id: 'dh37fgj492je', - key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn', - algorithm: 'sha256' -} - -// Request options - -var requestOptions = { - uri: 'http://example.com:8000/resource/1?b=1&a=2', - method: 'GET', - headers: {} -}; - -// Generate Authorization request header - -var header = Hawk.client.header('http://example.com:8000/resource/1?b=1&a=2', 'GET', { credentials: credentials, ext: 'some-app-data' }); -requestOptions.headers.Authorization = header.field; - -// Send authenticated request - -Request(requestOptions, function (error, response, body) { - - // Authenticate the server's response - - var isValid = Hawk.client.authenticate(response, credentials, header.artifacts, { payload: body }); - - // Output results - - console.log(response.statusCode + ': ' + body + (isValid ? ' (valid)' : ' (invalid)')); -}); -``` - -**Hawk** utilized the [**SNTP**](https://github.com/hueniverse/sntp) module for time sync management. By default, the local -machine time is used. To automatically retrieve and synchronice the clock within the application, use the SNTP 'start()' method. - -```javascript -Hawk.sntp.start(); -``` - - -## Protocol Example - -The client attempts to access a protected resource without authentication, sending the following HTTP request to -the resource server: - -``` -GET /resource/1?b=1&a=2 HTTP/1.1 -Host: example.com:8000 -``` - -The resource server returns an authentication challenge. - -``` -HTTP/1.1 401 Unauthorized -WWW-Authenticate: Hawk -``` - -The client has previously obtained a set of **Hawk** credentials for accessing resources on the "http://example.com/" -server. The **Hawk** credentials issued to the client include the following attributes: - -* Key identifier: dh37fgj492je -* Key: werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn -* Algorithm: sha256 - -The client generates the authentication header by calculating a timestamp (e.g. the number of seconds since January 1, -1970 00:00:00 GMT), generating a nonce, and constructing the normalized request string (each value followed by a newline -character): - -``` -hawk.1.header -1353832234 -j4h3g2 -GET -/resource/1?b=1&a=2 -example.com -8000 - -some-app-ext-data - -``` - -The request MAC is calculated using HMAC with the specified hash algorithm "sha256" and the key over the normalized request string. -The result is base64-encoded to produce the request MAC: - -``` -6R4rV5iE+NPoym+WwjeHzjAGXUtLNIxmo1vpMofpLAE= -``` - -The client includes the **Hawk** key identifier, timestamp, nonce, application specific data, and request MAC with the request using -the HTTP `Authorization` request header field: - -``` -GET /resource/1?b=1&a=2 HTTP/1.1 -Host: example.com:8000 -Authorization: Hawk id="dh37fgj492je", ts="1353832234", nonce="j4h3g2", ext="some-app-ext-data", mac="6R4rV5iE+NPoym+WwjeHzjAGXUtLNIxmo1vpMofpLAE=" -``` - -The server validates the request by calculating the request MAC again based on the request received and verifies the validity -and scope of the **Hawk** credentials. If valid, the server responds with the requested resource. - - -### Payload Validation - -**Hawk** provides optional payload validation. When generating the authentication header, the client calculates a payload hash -using the specified hash algorithm. The hash is calculated over the concatenated value of (each followed by a newline character): -* `hawk.1.payload` -* the content-type in lowercase, without any parameters (e.g. `application/json`) -* the request payload prior to any content encoding (the exact representation requirements should be specified by the server for payloads other than simple single-part ascii to ensure interoperability) - -For example: - -* Payload: `Thank you for flying Hawk` -* Content Type: `text/plain` -* Hash (sha256): `Yi9LfIIFRtBEPt74PVmbTF/xVAwPn7ub15ePICfgnuY=` - -Results in the following input to the payload hash function (newline terminated values): - -``` -hawk.1.payload -text/plain -Thank you for flying Hawk - -``` - -Which produces the following hash value: - -``` -Yi9LfIIFRtBEPt74PVmbTF/xVAwPn7ub15ePICfgnuY= -``` - -The client constructs the normalized request string (newline terminated values): - -``` -hawk.1.header -1353832234 -j4h3g2 -POST -/resource/1?a=1&b=2 -example.com -8000 -Yi9LfIIFRtBEPt74PVmbTF/xVAwPn7ub15ePICfgnuY= -some-app-ext-data - -``` - -Then calculates the request MAC and includes the **Hawk** key identifier, timestamp, nonce, payload hash, application specific data, -and request MAC, with the request using the HTTP `Authorization` request header field: - -``` -POST /resource/1?a=1&b=2 HTTP/1.1 -Host: example.com:8000 -Authorization: Hawk id="dh37fgj492je", ts="1353832234", nonce="j4h3g2", hash="Yi9LfIIFRtBEPt74PVmbTF/xVAwPn7ub15ePICfgnuY=", ext="some-app-ext-data", mac="aSe1DERmZuRl3pI36/9BdZmnErTw3sNzOOAUlfeKjVw=" -``` - -It is up to the server if and when it validates the payload for any given request, based solely on it's security policy -and the nature of the data included. - -If the payload is available at the time of authentication, the server uses the hash value provided by the client to construct -the normalized string and validates the MAC. If the MAC is valid, the server calculates the payload hash and compares the value -with the provided payload hash in the header. In many cases, checking the MAC first is faster than calculating the payload hash. - -However, if the payload is not available at authentication time (e.g. too large to fit in memory, streamed elsewhere, or processed -at a different stage in the application), the server may choose to defer payload validation for later by retaining the hash value -provided by the client after validating the MAC. - -It is important to note that MAC validation does not mean the hash value provided by the client is valid, only that the value -included in the header was not modified. Without calculating the payload hash on the server and comparing it to the value provided -by the client, the payload may be modified by an attacker. - - -## Response Payload Validation - -**Hawk** provides partial response payload validation. The server includes the `Server-Authorization` response header which enables the -client to authenticate the response and ensure it is talking to the right server. **Hawk** defines the HTTP `Server-Authorization` header -as a response header using the exact same syntax as the `Authorization` request header field. - -The header is contructed using the same process as the client's request header. The server uses the same credentials and other -artifacts provided by the client to constructs the normalized request string. The `ext` and `hash` values are replaced with -new values based on the server response. The rest as identical to those used by the client. - -The result MAC digest is included with the optional `hash` and `ext` values: - -``` -Server-Authorization: Hawk mac="XIJRsMl/4oL+nn+vKoeVZPdCHXB4yJkNnBbTbHFZUYE=", hash="f9cDF/TDm7TkYRLnGwRMfeDzT6LixQVLvrIKhh0vgmM=", ext="response-specific" -``` - - -## Browser Support and Considerations - -A browser script is provided for including using a `')); - expect(boom.response.payload.message).to.not.contain(''); - expect(encoded).to.equal('\\x3cscript\\x3ealert\\x281\\x29\\x3c\\x2fscript\\x3e'); - done(); - }); - - it('encodes \' characters', function (done) { - - var encoded = Hoek.escapeJavaScript('something(\'param\')'); - expect(encoded).to.equal('something\\x28\\x27param\\x27\\x29'); - done(); - }); - - it('encodes large unicode characters with the correct padding', function (done) { - - var encoded = Hoek.escapeJavaScript(String.fromCharCode(500) + String.fromCharCode(1000)); - expect(encoded).to.equal('\\u0500\\u1000'); - done(); - }); - - it('doesn\'t throw an exception when passed null', function (done) { - - var encoded = Hoek.escapeJavaScript(null); - expect(encoded).to.equal(''); - done(); - }); - }); - - describe('#escapeHtml', function () { - - it('encodes / characters', function (done) { - - var encoded = Hoek.escapeHtml(''); - expect(encoded).to.equal('<script>alert(1)</script>'); - done(); - }); - - it('encodes < and > as named characters', function (done) { - - var encoded = Hoek.escapeHtml(' -``` - -Or in node.js: - -``` -npm install node-uuid -``` - -```javascript -var uuid = require('node-uuid'); -``` - -Then create some ids ... - -```javascript -// Generate a v1 (time-based) id -uuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a' - -// Generate a v4 (random) id -uuid.v4(); // -> '110ec58a-a0f2-4ac4-8393-c866d813b8d1' -``` - -## API - -### uuid.v1([`options` [, `buffer` [, `offset`]]]) - -Generate and return a RFC4122 v1 (timestamp-based) UUID. - -* `options` - (Object) Optional uuid state to apply. Properties may include: - - * `node` - (Array) Node id as Array of 6 bytes (per 4.1.6). Default: Randomly generated ID. See note 1. - * `clockseq` - (Number between 0 - 0x3fff) RFC clock sequence. Default: An internally maintained clockseq is used. - * `msecs` - (Number | Date) Time in milliseconds since unix Epoch. Default: The current time is used. - * `nsecs` - (Number between 0-9999) additional time, in 100-nanosecond units. Ignored if `msecs` is unspecified. Default: internal uuid counter is used, as per 4.2.1.2. - -* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. -* `offset` - (Number) Starting index in `buffer` at which to begin writing. - -Returns `buffer`, if specified, otherwise the string form of the UUID - -Notes: - -1. The randomly generated node id is only guaranteed to stay constant for the lifetime of the current JS runtime. (Future versions of this module may use persistent storage mechanisms to extend this guarantee.) - -Example: Generate string UUID with fully-specified options - -```javascript -uuid.v1({ - node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab], - clockseq: 0x1234, - msecs: new Date('2011-11-01').getTime(), - nsecs: 5678 -}); // -> "710b962e-041c-11e1-9234-0123456789ab" -``` - -Example: In-place generation of two binary IDs - -```javascript -// Generate two ids in an array -var arr = new Array(32); // -> [] -uuid.v1(null, arr, 0); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15] -uuid.v1(null, arr, 16); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15 02 a3 1c b0 14 32 11 e1 85 58 0b 48 8e 4f c1 15] - -// Optionally use uuid.unparse() to get stringify the ids -uuid.unparse(buffer); // -> '02a2ce90-1432-11e1-8558-0b488e4fc115' -uuid.unparse(buffer, 16) // -> '02a31cb0-1432-11e1-8558-0b488e4fc115' -``` - -### uuid.v4([`options` [, `buffer` [, `offset`]]]) - -Generate and return a RFC4122 v4 UUID. - -* `options` - (Object) Optional uuid state to apply. Properties may include: - - * `random` - (Number[16]) Array of 16 numbers (0-255) to use in place of randomly generated values - * `rng` - (Function) Random # generator to use. Set to one of the built-in generators - `uuid.mathRNG` (all platforms), `uuid.nodeRNG` (node.js only), `uuid.whatwgRNG` (WebKit only) - or a custom function that returns an array[16] of byte values. - -* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. -* `offset` - (Number) Starting index in `buffer` at which to begin writing. - -Returns `buffer`, if specified, otherwise the string form of the UUID - -Example: Generate string UUID with fully-specified options - -```javascript -uuid.v4({ - random: [ - 0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea, - 0x71, 0xb4, 0xef, 0xe1, 0x67, 0x1c, 0x58, 0x36 - ] -}); -// -> "109156be-c4fb-41ea-b1b4-efe1671c5836" -``` - -Example: Generate two IDs in a single buffer - -```javascript -var buffer = new Array(32); // (or 'new Buffer' in node.js) -uuid.v4(null, buffer, 0); -uuid.v4(null, buffer, 16); -``` - -### uuid.parse(id[, buffer[, offset]]) -### uuid.unparse(buffer[, offset]) - -Parse and unparse UUIDs - - * `id` - (String) UUID(-like) string - * `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. Default: A new Array or Buffer is used - * `offset` - (Number) Starting index in `buffer` at which to begin writing. Default: 0 - -Example parsing and unparsing a UUID string - -```javascript -var bytes = uuid.parse('797ff043-11eb-11e1-80d6-510998755d10'); // -> -var string = uuid.unparse(bytes); // -> '797ff043-11eb-11e1-80d6-510998755d10' -``` - -### uuid.noConflict() - -(Browsers only) Set `uuid` property back to it's previous value. - -Returns the node-uuid object. - -Example: - -```javascript -var myUuid = uuid.noConflict(); -myUuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a' -``` - -## Deprecated APIs - -Support for the following v1.2 APIs is available in v1.3, but is deprecated and will be removed in the next major version. - -### uuid([format [, buffer [, offset]]]) - -uuid() has become uuid.v4(), and the `format` argument is now implicit in the `buffer` argument. (i.e. if you specify a buffer, the format is assumed to be binary). - -### uuid.BufferClass - -The class of container created when generating binary uuid data if no buffer argument is specified. This is expected to go away, with no replacement API. - -## Testing - -In node.js - -``` -> cd test -> node test.js -``` - -In Browser - -``` -open test/test.html -``` - -### Benchmarking - -Requires node.js - -``` -npm install uuid uuid-js -node benchmark/benchmark.js -``` - -For a more complete discussion of node-uuid performance, please see the `benchmark/README.md` file, and the [benchmark wiki](https://github.com/broofa/node-uuid/wiki/Benchmark) - -For browser performance [checkout the JSPerf tests](http://jsperf.com/node-uuid-performance). - -## Release notes - -### 1.4.0 - -* Improved module context detection -* Removed public RNG functions - -### 1.3.2 - -* Improve tests and handling of v1() options (Issue #24) -* Expose RNG option to allow for perf testing with different generators - -### 1.3.0 - -* Support for version 1 ids, thanks to [@ctavan](https://github.com/ctavan)! -* Support for node.js crypto API -* De-emphasizing performance in favor of a) cryptographic quality PRNGs where available and b) more manageable code diff --git a/src/extensibility/node/node_modules/request/node_modules/node-uuid/benchmark/README.md b/src/extensibility/node/node_modules/request/node_modules/node-uuid/benchmark/README.md deleted file mode 100644 index aaeb2ea0132..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/node-uuid/benchmark/README.md +++ /dev/null @@ -1,53 +0,0 @@ -# node-uuid Benchmarks - -### Results - -To see the results of our benchmarks visit https://github.com/broofa/node-uuid/wiki/Benchmark - -### Run them yourself - -node-uuid comes with some benchmarks to measure performance of generating UUIDs. These can be run using node.js. node-uuid is being benchmarked against some other uuid modules, that are available through npm namely `uuid` and `uuid-js`. - -To prepare and run the benchmark issue; - -``` -npm install uuid uuid-js -node benchmark/benchmark.js -``` - -You'll see an output like this one: - -``` -# v4 -nodeuuid.v4(): 854700 uuids/second -nodeuuid.v4('binary'): 788643 uuids/second -nodeuuid.v4('binary', buffer): 1336898 uuids/second -uuid(): 479386 uuids/second -uuid('binary'): 582072 uuids/second -uuidjs.create(4): 312304 uuids/second - -# v1 -nodeuuid.v1(): 938086 uuids/second -nodeuuid.v1('binary'): 683060 uuids/second -nodeuuid.v1('binary', buffer): 1644736 uuids/second -uuidjs.create(1): 190621 uuids/second -``` - -* The `uuid()` entries are for Nikhil Marathe's [uuid module](https://bitbucket.org/nikhilm/uuidjs) which is a wrapper around the native libuuid library. -* The `uuidjs()` entries are for Patrick Negri's [uuid-js module](https://github.com/pnegri/uuid-js) which is a pure javascript implementation based on [UUID.js](https://github.com/LiosK/UUID.js) by LiosK. - -If you want to get more reliable results you can run the benchmark multiple times and write the output into a log file: - -``` -for i in {0..9}; do node benchmark/benchmark.js >> benchmark/bench_0.4.12.log; done; -``` - -If you're interested in how performance varies between different node versions, you can issue the above command multiple times. - -You can then use the shell script `bench.sh` provided in this directory to calculate the averages over all benchmark runs and draw a nice plot: - -``` -(cd benchmark/ && ./bench.sh) -``` - -This assumes you have [gnuplot](http://www.gnuplot.info/) and [ImageMagick](http://www.imagemagick.org/) installed. You'll find a nice `bench.png` graph in the `benchmark/` directory then. diff --git a/src/extensibility/node/node_modules/request/node_modules/node-uuid/benchmark/bench.gnu b/src/extensibility/node/node_modules/request/node_modules/node-uuid/benchmark/bench.gnu deleted file mode 100644 index a342fbbe04e..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/node-uuid/benchmark/bench.gnu +++ /dev/null @@ -1,174 +0,0 @@ -#!/opt/local/bin/gnuplot -persist -# -# -# G N U P L O T -# Version 4.4 patchlevel 3 -# last modified March 2011 -# System: Darwin 10.8.0 -# -# Copyright (C) 1986-1993, 1998, 2004, 2007-2010 -# Thomas Williams, Colin Kelley and many others -# -# gnuplot home: http://www.gnuplot.info -# faq, bugs, etc: type "help seeking-assistance" -# immediate help: type "help" -# plot window: hit 'h' -set terminal postscript eps noenhanced defaultplex \ - leveldefault color colortext \ - solid linewidth 1.2 butt noclip \ - palfuncparam 2000,0.003 \ - "Helvetica" 14 -set output 'bench.eps' -unset clip points -set clip one -unset clip two -set bar 1.000000 front -set border 31 front linetype -1 linewidth 1.000 -set xdata -set ydata -set zdata -set x2data -set y2data -set timefmt x "%d/%m/%y,%H:%M" -set timefmt y "%d/%m/%y,%H:%M" -set timefmt z "%d/%m/%y,%H:%M" -set timefmt x2 "%d/%m/%y,%H:%M" -set timefmt y2 "%d/%m/%y,%H:%M" -set timefmt cb "%d/%m/%y,%H:%M" -set boxwidth -set style fill empty border -set style rectangle back fc lt -3 fillstyle solid 1.00 border lt -1 -set style circle radius graph 0.02, first 0, 0 -set dummy x,y -set format x "% g" -set format y "% g" -set format x2 "% g" -set format y2 "% g" -set format z "% g" -set format cb "% g" -set angles radians -unset grid -set key title "" -set key outside left top horizontal Right noreverse enhanced autotitles columnhead nobox -set key noinvert samplen 4 spacing 1 width 0 height 0 -set key maxcolumns 2 maxrows 0 -unset label -unset arrow -set style increment default -unset style line -set style line 1 linetype 1 linewidth 2.000 pointtype 1 pointsize default pointinterval 0 -unset style arrow -set style histogram clustered gap 2 title offset character 0, 0, 0 -unset logscale -set offsets graph 0.05, 0.15, 0, 0 -set pointsize 1.5 -set pointintervalbox 1 -set encoding default -unset polar -unset parametric -unset decimalsign -set view 60, 30, 1, 1 -set samples 100, 100 -set isosamples 10, 10 -set surface -unset contour -set clabel '%8.3g' -set mapping cartesian -set datafile separator whitespace -unset hidden3d -set cntrparam order 4 -set cntrparam linear -set cntrparam levels auto 5 -set cntrparam points 5 -set size ratio 0 1,1 -set origin 0,0 -set style data points -set style function lines -set xzeroaxis linetype -2 linewidth 1.000 -set yzeroaxis linetype -2 linewidth 1.000 -set zzeroaxis linetype -2 linewidth 1.000 -set x2zeroaxis linetype -2 linewidth 1.000 -set y2zeroaxis linetype -2 linewidth 1.000 -set ticslevel 0.5 -set mxtics default -set mytics default -set mztics default -set mx2tics default -set my2tics default -set mcbtics default -set xtics border in scale 1,0.5 mirror norotate offset character 0, 0, 0 -set xtics norangelimit -set xtics () -set ytics border in scale 1,0.5 mirror norotate offset character 0, 0, 0 -set ytics autofreq norangelimit -set ztics border in scale 1,0.5 nomirror norotate offset character 0, 0, 0 -set ztics autofreq norangelimit -set nox2tics -set noy2tics -set cbtics border in scale 1,0.5 mirror norotate offset character 0, 0, 0 -set cbtics autofreq norangelimit -set title "" -set title offset character 0, 0, 0 font "" norotate -set timestamp bottom -set timestamp "" -set timestamp offset character 0, 0, 0 font "" norotate -set rrange [ * : * ] noreverse nowriteback # (currently [8.98847e+307:-8.98847e+307] ) -set autoscale rfixmin -set autoscale rfixmax -set trange [ * : * ] noreverse nowriteback # (currently [-5.00000:5.00000] ) -set autoscale tfixmin -set autoscale tfixmax -set urange [ * : * ] noreverse nowriteback # (currently [-10.0000:10.0000] ) -set autoscale ufixmin -set autoscale ufixmax -set vrange [ * : * ] noreverse nowriteback # (currently [-10.0000:10.0000] ) -set autoscale vfixmin -set autoscale vfixmax -set xlabel "" -set xlabel offset character 0, 0, 0 font "" textcolor lt -1 norotate -set x2label "" -set x2label offset character 0, 0, 0 font "" textcolor lt -1 norotate -set xrange [ * : * ] noreverse nowriteback # (currently [-0.150000:3.15000] ) -set autoscale xfixmin -set autoscale xfixmax -set x2range [ * : * ] noreverse nowriteback # (currently [0.00000:3.00000] ) -set autoscale x2fixmin -set autoscale x2fixmax -set ylabel "" -set ylabel offset character 0, 0, 0 font "" textcolor lt -1 rotate by -270 -set y2label "" -set y2label offset character 0, 0, 0 font "" textcolor lt -1 rotate by -270 -set yrange [ 0.00000 : 1.90000e+06 ] noreverse nowriteback # (currently [:] ) -set autoscale yfixmin -set autoscale yfixmax -set y2range [ * : * ] noreverse nowriteback # (currently [0.00000:1.90000e+06] ) -set autoscale y2fixmin -set autoscale y2fixmax -set zlabel "" -set zlabel offset character 0, 0, 0 font "" textcolor lt -1 norotate -set zrange [ * : * ] noreverse nowriteback # (currently [-10.0000:10.0000] ) -set autoscale zfixmin -set autoscale zfixmax -set cblabel "" -set cblabel offset character 0, 0, 0 font "" textcolor lt -1 rotate by -270 -set cbrange [ * : * ] noreverse nowriteback # (currently [8.98847e+307:-8.98847e+307] ) -set autoscale cbfixmin -set autoscale cbfixmax -set zero 1e-08 -set lmargin -1 -set bmargin -1 -set rmargin -1 -set tmargin -1 -set pm3d explicit at s -set pm3d scansautomatic -set pm3d interpolate 1,1 flush begin noftriangles nohidden3d corners2color mean -set palette positive nops_allcF maxcolors 0 gamma 1.5 color model RGB -set palette rgbformulae 7, 5, 15 -set colorbox default -set colorbox vertical origin screen 0.9, 0.2, 0 size screen 0.05, 0.6, 0 front bdefault -set loadpath -set fontpath -set fit noerrorvariables -GNUTERM = "aqua" -plot 'bench_results.txt' using 2:xticlabel(1) w lp lw 2, '' using 3:xticlabel(1) w lp lw 2, '' using 4:xticlabel(1) w lp lw 2, '' using 5:xticlabel(1) w lp lw 2, '' using 6:xticlabel(1) w lp lw 2, '' using 7:xticlabel(1) w lp lw 2, '' using 8:xticlabel(1) w lp lw 2, '' using 9:xticlabel(1) w lp lw 2 -# EOF diff --git a/src/extensibility/node/node_modules/request/node_modules/node-uuid/benchmark/bench.sh b/src/extensibility/node/node_modules/request/node_modules/node-uuid/benchmark/bench.sh deleted file mode 100755 index d870a0cb098..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/node-uuid/benchmark/bench.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash - -# for a given node version run: -# for i in {0..9}; do node benchmark.js >> bench_0.6.2.log; done; - -PATTERNS=('nodeuuid.v1()' "nodeuuid.v1('binary'," 'nodeuuid.v4()' "nodeuuid.v4('binary'," "uuid()" "uuid('binary')" 'uuidjs.create(1)' 'uuidjs.create(4)' '140byte') -FILES=(node_uuid_v1_string node_uuid_v1_buf node_uuid_v4_string node_uuid_v4_buf libuuid_v4_string libuuid_v4_binary uuidjs_v1_string uuidjs_v4_string 140byte_es) -INDICES=(2 3 2 3 2 2 2 2 2) -VERSIONS=$( ls bench_*.log | sed -e 's/^bench_\([0-9\.]*\)\.log/\1/' | tr "\\n" " " ) -TMPJOIN="tmp_join" -OUTPUT="bench_results.txt" - -for I in ${!FILES[*]}; do - F=${FILES[$I]} - P=${PATTERNS[$I]} - INDEX=${INDICES[$I]} - echo "version $F" > $F - for V in $VERSIONS; do - (VAL=$( grep "$P" bench_$V.log | LC_ALL=en_US awk '{ sum += $'$INDEX' } END { print sum/NR }' ); echo $V $VAL) >> $F - done - if [ $I == 0 ]; then - cat $F > $TMPJOIN - else - join $TMPJOIN $F > $OUTPUT - cp $OUTPUT $TMPJOIN - fi - rm $F -done - -rm $TMPJOIN - -gnuplot bench.gnu -convert -density 200 -resize 800x560 -flatten bench.eps bench.png -rm bench.eps diff --git a/src/extensibility/node/node_modules/request/node_modules/node-uuid/benchmark/benchmark-native.c b/src/extensibility/node/node_modules/request/node_modules/node-uuid/benchmark/benchmark-native.c deleted file mode 100644 index dbfc75f6d71..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/node-uuid/benchmark/benchmark-native.c +++ /dev/null @@ -1,34 +0,0 @@ -/* -Test performance of native C UUID generation - -To Compile: cc -luuid benchmark-native.c -o benchmark-native -*/ - -#include -#include -#include -#include - -int main() { - uuid_t myid; - char buf[36+1]; - int i; - struct timeval t; - double start, finish; - - gettimeofday(&t, NULL); - start = t.tv_sec + t.tv_usec/1e6; - - int n = 2e5; - for (i = 0; i < n; i++) { - uuid_generate(myid); - uuid_unparse(myid, buf); - } - - gettimeofday(&t, NULL); - finish = t.tv_sec + t.tv_usec/1e6; - double dur = finish - start; - - printf("%d uuids/sec", (int)(n/dur)); - return 0; -} diff --git a/src/extensibility/node/node_modules/request/node_modules/node-uuid/benchmark/benchmark.js b/src/extensibility/node/node_modules/request/node_modules/node-uuid/benchmark/benchmark.js deleted file mode 100644 index 40e6efbe762..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/node-uuid/benchmark/benchmark.js +++ /dev/null @@ -1,84 +0,0 @@ -try { - var nodeuuid = require('../uuid'); -} catch (e) { - console.error('node-uuid require failed - skipping tests'); -} - -try { - var uuid = require('uuid'); -} catch (e) { - console.error('uuid require failed - skipping tests'); -} - -try { - var uuidjs = require('uuid-js'); -} catch (e) { - console.error('uuid-js require failed - skipping tests'); -} - -var N = 5e5; - -function rate(msg, t) { - console.log(msg + ': ' + - (N / (Date.now() - t) * 1e3 | 0) + - ' uuids/second'); -} - -console.log('# v4'); - -// node-uuid - string form -if (nodeuuid) { - for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v4(); - rate('nodeuuid.v4() - using node.js crypto RNG', t); - - for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v4({rng: nodeuuid.mathRNG}); - rate('nodeuuid.v4() - using Math.random() RNG', t); - - for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v4('binary'); - rate('nodeuuid.v4(\'binary\')', t); - - var buffer = new nodeuuid.BufferClass(16); - for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v4('binary', buffer); - rate('nodeuuid.v4(\'binary\', buffer)', t); -} - -// libuuid - string form -if (uuid) { - for (var i = 0, t = Date.now(); i < N; i++) uuid(); - rate('uuid()', t); - - for (var i = 0, t = Date.now(); i < N; i++) uuid('binary'); - rate('uuid(\'binary\')', t); -} - -// uuid-js - string form -if (uuidjs) { - for (var i = 0, t = Date.now(); i < N; i++) uuidjs.create(4); - rate('uuidjs.create(4)', t); -} - -// 140byte.es -for (var i = 0, t = Date.now(); i < N; i++) 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g,function(s,r){r=Math.random()*16|0;return (s=='x'?r:r&0x3|0x8).toString(16)}); -rate('140byte.es_v4', t); - -console.log(''); -console.log('# v1'); - -// node-uuid - v1 string form -if (nodeuuid) { - for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v1(); - rate('nodeuuid.v1()', t); - - for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v1('binary'); - rate('nodeuuid.v1(\'binary\')', t); - - var buffer = new nodeuuid.BufferClass(16); - for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v1('binary', buffer); - rate('nodeuuid.v1(\'binary\', buffer)', t); -} - -// uuid-js - v1 string form -if (uuidjs) { - for (var i = 0, t = Date.now(); i < N; i++) uuidjs.create(1); - rate('uuidjs.create(1)', t); -} diff --git a/src/extensibility/node/node_modules/request/node_modules/node-uuid/component.json b/src/extensibility/node/node_modules/request/node_modules/node-uuid/component.json deleted file mode 100644 index ace213481cc..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/node-uuid/component.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "node-uuid", - "repo": "broofa/node-uuid", - "description": "Rigorous implementation of RFC4122 (v1 and v4) UUIDs.", - "version": "1.4.0", - "author": "Robert Kieffer ", - "contributors": [ - {"name": "Christoph Tavan ", "github": "https://github.com/ctavan"} - ], - "keywords": ["uuid", "guid", "rfc4122"], - "dependencies": {}, - "development": {}, - "main": "uuid.js", - "scripts": [ - "uuid.js" - ], - "license": "MIT" -} \ No newline at end of file diff --git a/src/extensibility/node/node_modules/request/node_modules/node-uuid/package.json b/src/extensibility/node/node_modules/request/node_modules/node-uuid/package.json deleted file mode 100644 index 3fb5825b5af..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/node-uuid/package.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "node-uuid", - "description": "Rigorous implementation of RFC4122 (v1 and v4) UUIDs.", - "url": "http://github.com/broofa/node-uuid", - "keywords": [ - "uuid", - "guid", - "rfc4122" - ], - "author": { - "name": "Robert Kieffer", - "email": "robert@broofa.com" - }, - "contributors": [ - { - "name": "Christoph Tavan", - "email": "dev@tavan.de" - } - ], - "lib": ".", - "main": "./uuid.js", - "repository": { - "type": "git", - "url": "https://github.com/broofa/node-uuid.git" - }, - "version": "1.4.1", - "readme": "# node-uuid\n\nSimple, fast generation of [RFC4122](http://www.ietf.org/rfc/rfc4122.txt) UUIDS.\n\nFeatures:\n\n* Generate RFC4122 version 1 or version 4 UUIDs\n* Runs in node.js and all browsers.\n* Registered as a [ComponentJS](https://github.com/component/component) [component](https://github.com/component/component/wiki/Components) ('broofa/node-uuid').\n* Cryptographically strong random # generation on supporting platforms\n* 1.1K minified and gzip'ed (Want something smaller? Check this [crazy shit](https://gist.github.com/982883) out! )\n* [Annotated source code](http://broofa.github.com/node-uuid/docs/uuid.html)\n\n## Getting Started\n\nInstall it in your browser:\n\n```html\n\n```\n\nOr in node.js:\n\n```\nnpm install node-uuid\n```\n\n```javascript\nvar uuid = require('node-uuid');\n```\n\nThen create some ids ...\n\n```javascript\n// Generate a v1 (time-based) id\nuuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a'\n\n// Generate a v4 (random) id\nuuid.v4(); // -> '110ec58a-a0f2-4ac4-8393-c866d813b8d1'\n```\n\n## API\n\n### uuid.v1([`options` [, `buffer` [, `offset`]]])\n\nGenerate and return a RFC4122 v1 (timestamp-based) UUID.\n\n* `options` - (Object) Optional uuid state to apply. Properties may include:\n\n * `node` - (Array) Node id as Array of 6 bytes (per 4.1.6). Default: Randomly generated ID. See note 1.\n * `clockseq` - (Number between 0 - 0x3fff) RFC clock sequence. Default: An internally maintained clockseq is used.\n * `msecs` - (Number | Date) Time in milliseconds since unix Epoch. Default: The current time is used.\n * `nsecs` - (Number between 0-9999) additional time, in 100-nanosecond units. Ignored if `msecs` is unspecified. Default: internal uuid counter is used, as per 4.2.1.2.\n\n* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written.\n* `offset` - (Number) Starting index in `buffer` at which to begin writing.\n\nReturns `buffer`, if specified, otherwise the string form of the UUID\n\nNotes:\n\n1. The randomly generated node id is only guaranteed to stay constant for the lifetime of the current JS runtime. (Future versions of this module may use persistent storage mechanisms to extend this guarantee.)\n\nExample: Generate string UUID with fully-specified options\n\n```javascript\nuuid.v1({\n node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab],\n clockseq: 0x1234,\n msecs: new Date('2011-11-01').getTime(),\n nsecs: 5678\n}); // -> \"710b962e-041c-11e1-9234-0123456789ab\"\n```\n\nExample: In-place generation of two binary IDs\n\n```javascript\n// Generate two ids in an array\nvar arr = new Array(32); // -> []\nuuid.v1(null, arr, 0); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15]\nuuid.v1(null, arr, 16); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15 02 a3 1c b0 14 32 11 e1 85 58 0b 48 8e 4f c1 15]\n\n// Optionally use uuid.unparse() to get stringify the ids\nuuid.unparse(buffer); // -> '02a2ce90-1432-11e1-8558-0b488e4fc115'\nuuid.unparse(buffer, 16) // -> '02a31cb0-1432-11e1-8558-0b488e4fc115'\n```\n\n### uuid.v4([`options` [, `buffer` [, `offset`]]])\n\nGenerate and return a RFC4122 v4 UUID.\n\n* `options` - (Object) Optional uuid state to apply. Properties may include:\n\n * `random` - (Number[16]) Array of 16 numbers (0-255) to use in place of randomly generated values\n * `rng` - (Function) Random # generator to use. Set to one of the built-in generators - `uuid.mathRNG` (all platforms), `uuid.nodeRNG` (node.js only), `uuid.whatwgRNG` (WebKit only) - or a custom function that returns an array[16] of byte values.\n\n* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written.\n* `offset` - (Number) Starting index in `buffer` at which to begin writing.\n\nReturns `buffer`, if specified, otherwise the string form of the UUID\n\nExample: Generate string UUID with fully-specified options\n\n```javascript\nuuid.v4({\n random: [\n 0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea,\n 0x71, 0xb4, 0xef, 0xe1, 0x67, 0x1c, 0x58, 0x36\n ]\n});\n// -> \"109156be-c4fb-41ea-b1b4-efe1671c5836\"\n```\n\nExample: Generate two IDs in a single buffer\n\n```javascript\nvar buffer = new Array(32); // (or 'new Buffer' in node.js)\nuuid.v4(null, buffer, 0);\nuuid.v4(null, buffer, 16);\n```\n\n### uuid.parse(id[, buffer[, offset]])\n### uuid.unparse(buffer[, offset])\n\nParse and unparse UUIDs\n\n * `id` - (String) UUID(-like) string\n * `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. Default: A new Array or Buffer is used\n * `offset` - (Number) Starting index in `buffer` at which to begin writing. Default: 0\n\nExample parsing and unparsing a UUID string\n\n```javascript\nvar bytes = uuid.parse('797ff043-11eb-11e1-80d6-510998755d10'); // -> \nvar string = uuid.unparse(bytes); // -> '797ff043-11eb-11e1-80d6-510998755d10'\n```\n\n### uuid.noConflict()\n\n(Browsers only) Set `uuid` property back to it's previous value.\n\nReturns the node-uuid object.\n\nExample:\n\n```javascript\nvar myUuid = uuid.noConflict();\nmyUuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a'\n```\n\n## Deprecated APIs\n\nSupport for the following v1.2 APIs is available in v1.3, but is deprecated and will be removed in the next major version.\n\n### uuid([format [, buffer [, offset]]])\n\nuuid() has become uuid.v4(), and the `format` argument is now implicit in the `buffer` argument. (i.e. if you specify a buffer, the format is assumed to be binary).\n\n### uuid.BufferClass\n\nThe class of container created when generating binary uuid data if no buffer argument is specified. This is expected to go away, with no replacement API.\n\n## Testing\n\nIn node.js\n\n```\n> cd test\n> node test.js\n```\n\nIn Browser\n\n```\nopen test/test.html\n```\n\n### Benchmarking\n\nRequires node.js\n\n```\nnpm install uuid uuid-js\nnode benchmark/benchmark.js\n```\n\nFor a more complete discussion of node-uuid performance, please see the `benchmark/README.md` file, and the [benchmark wiki](https://github.com/broofa/node-uuid/wiki/Benchmark)\n\nFor browser performance [checkout the JSPerf tests](http://jsperf.com/node-uuid-performance).\n\n## Release notes\n\n### 1.4.0\n\n* Improved module context detection\n* Removed public RNG functions\n\n### 1.3.2\n\n* Improve tests and handling of v1() options (Issue #24)\n* Expose RNG option to allow for perf testing with different generators\n\n### 1.3.0\n\n* Support for version 1 ids, thanks to [@ctavan](https://github.com/ctavan)!\n* Support for node.js crypto API\n* De-emphasizing performance in favor of a) cryptographic quality PRNGs where available and b) more manageable code\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/broofa/node-uuid/issues" - }, - "_id": "node-uuid@1.4.1", - "_from": "node-uuid@~1.4.0" -} diff --git a/src/extensibility/node/node_modules/request/node_modules/node-uuid/test/compare_v1.js b/src/extensibility/node/node_modules/request/node_modules/node-uuid/test/compare_v1.js deleted file mode 100644 index 05af82215fd..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/node-uuid/test/compare_v1.js +++ /dev/null @@ -1,63 +0,0 @@ -var assert = require('assert'), - nodeuuid = require('../uuid'), - uuidjs = require('uuid-js'), - libuuid = require('uuid').generate, - util = require('util'), - exec = require('child_process').exec, - os = require('os'); - -// On Mac Os X / macports there's only the ossp-uuid package that provides uuid -// On Linux there's uuid-runtime which provides uuidgen -var uuidCmd = os.type() === 'Darwin' ? 'uuid -1' : 'uuidgen -t'; - -function compare(ids) { - console.log(ids); - for (var i = 0; i < ids.length; i++) { - var id = ids[i].split('-'); - id = [id[2], id[1], id[0]].join(''); - ids[i] = id; - } - var sorted = ([].concat(ids)).sort(); - - if (sorted.toString() !== ids.toString()) { - console.log('Warning: sorted !== ids'); - } else { - console.log('everything in order!'); - } -} - -// Test time order of v1 uuids -var ids = []; -while (ids.length < 10e3) ids.push(nodeuuid.v1()); - -var max = 10; -console.log('node-uuid:'); -ids = []; -for (var i = 0; i < max; i++) ids.push(nodeuuid.v1()); -compare(ids); - -console.log(''); -console.log('uuidjs:'); -ids = []; -for (var i = 0; i < max; i++) ids.push(uuidjs.create(1).toString()); -compare(ids); - -console.log(''); -console.log('libuuid:'); -ids = []; -var count = 0; -var last = function() { - compare(ids); -} -var cb = function(err, stdout, stderr) { - ids.push(stdout.substring(0, stdout.length-1)); - count++; - if (count < max) { - return next(); - } - last(); -}; -var next = function() { - exec(uuidCmd, cb); -}; -next(); diff --git a/src/extensibility/node/node_modules/request/node_modules/node-uuid/test/test.html b/src/extensibility/node/node_modules/request/node_modules/node-uuid/test/test.html deleted file mode 100644 index d80326ec5a8..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/node-uuid/test/test.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - diff --git a/src/extensibility/node/node_modules/request/node_modules/node-uuid/test/test.js b/src/extensibility/node/node_modules/request/node_modules/node-uuid/test/test.js deleted file mode 100644 index 24692256161..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/node-uuid/test/test.js +++ /dev/null @@ -1,228 +0,0 @@ -if (!this.uuid) { - // node.js - uuid = require('../uuid'); -} - -// -// x-platform log/assert shims -// - -function _log(msg, type) { - type = type || 'log'; - - if (typeof(document) != 'undefined') { - document.write('
    ' + msg.replace(/\n/g, '
    ') + '
    '); - } - if (typeof(console) != 'undefined') { - var color = { - log: '\033[39m', - warn: '\033[33m', - error: '\033[31m' - }; - console[type](color[type] + msg + color.log); - } -} - -function log(msg) {_log(msg, 'log');} -function warn(msg) {_log(msg, 'warn');} -function error(msg) {_log(msg, 'error');} - -function assert(res, msg) { - if (!res) { - error('FAIL: ' + msg); - } else { - log('Pass: ' + msg); - } -} - -// -// Unit tests -// - -// Verify ordering of v1 ids created with explicit times -var TIME = 1321644961388; // 2011-11-18 11:36:01.388-08:00 - -function compare(name, ids) { - ids = ids.map(function(id) { - return id.split('-').reverse().join('-'); - }).sort(); - var sorted = ([].concat(ids)).sort(); - - assert(sorted.toString() == ids.toString(), name + ' have expected order'); -} - -// Verify ordering of v1 ids created using default behavior -compare('uuids with current time', [ - uuid.v1(), - uuid.v1(), - uuid.v1(), - uuid.v1(), - uuid.v1() -]); - -// Verify ordering of v1 ids created with explicit times -compare('uuids with time option', [ - uuid.v1({msecs: TIME - 10*3600*1000}), - uuid.v1({msecs: TIME - 1}), - uuid.v1({msecs: TIME}), - uuid.v1({msecs: TIME + 1}), - uuid.v1({msecs: TIME + 28*24*3600*1000}) -]); - -assert( - uuid.v1({msecs: TIME}) != uuid.v1({msecs: TIME}), - 'IDs created at same msec are different' -); - -// Verify throw if too many ids created -var thrown = false; -try { - uuid.v1({msecs: TIME, nsecs: 10000}); -} catch (e) { - thrown = true; -} -assert(thrown, 'Exception thrown when > 10K ids created in 1 ms'); - -// Verify clock regression bumps clockseq -var uidt = uuid.v1({msecs: TIME}); -var uidtb = uuid.v1({msecs: TIME - 1}); -assert( - parseInt(uidtb.split('-')[3], 16) - parseInt(uidt.split('-')[3], 16) === 1, - 'Clock regression by msec increments the clockseq' -); - -// Verify clock regression bumps clockseq -var uidtn = uuid.v1({msecs: TIME, nsecs: 10}); -var uidtnb = uuid.v1({msecs: TIME, nsecs: 9}); -assert( - parseInt(uidtnb.split('-')[3], 16) - parseInt(uidtn.split('-')[3], 16) === 1, - 'Clock regression by nsec increments the clockseq' -); - -// Verify explicit options produce expected id -var id = uuid.v1({ - msecs: 1321651533573, - nsecs: 5432, - clockseq: 0x385c, - node: [ 0x61, 0xcd, 0x3c, 0xbb, 0x32, 0x10 ] -}); -assert(id == 'd9428888-122b-11e1-b85c-61cd3cbb3210', 'Explicit options produce expected id'); - -// Verify adjacent ids across a msec boundary are 1 time unit apart -var u0 = uuid.v1({msecs: TIME, nsecs: 9999}); -var u1 = uuid.v1({msecs: TIME + 1, nsecs: 0}); - -var before = u0.split('-')[0], after = u1.split('-')[0]; -var dt = parseInt(after, 16) - parseInt(before, 16); -assert(dt === 1, 'Ids spanning 1ms boundary are 100ns apart'); - -// -// Test parse/unparse -// - -id = '00112233445566778899aabbccddeeff'; -assert(uuid.unparse(uuid.parse(id.substr(0,10))) == - '00112233-4400-0000-0000-000000000000', 'Short parse'); -assert(uuid.unparse(uuid.parse('(this is the uuid -> ' + id + id)) == - '00112233-4455-6677-8899-aabbccddeeff', 'Dirty parse'); - -// -// Perf tests -// - -var generators = { - v1: uuid.v1, - v4: uuid.v4 -}; - -var UUID_FORMAT = { - v1: /[0-9a-f]{8}-[0-9a-f]{4}-1[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}/i, - v4: /[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}/i -}; - -var N = 1e4; - -// Get %'age an actual value differs from the ideal value -function divergence(actual, ideal) { - return Math.round(100*100*(actual - ideal)/ideal)/100; -} - -function rate(msg, t) { - log(msg + ': ' + (N / (Date.now() - t) * 1e3 | 0) + ' uuids\/second'); -} - -for (var version in generators) { - var counts = {}, max = 0; - var generator = generators[version]; - var format = UUID_FORMAT[version]; - - log('\nSanity check ' + N + ' ' + version + ' uuids'); - for (var i = 0, ok = 0; i < N; i++) { - id = generator(); - if (!format.test(id)) { - throw Error(id + ' is not a valid UUID string'); - } - - if (id != uuid.unparse(uuid.parse(id))) { - assert(fail, id + ' is not a valid id'); - } - - // Count digits for our randomness check - if (version == 'v4') { - var digits = id.replace(/-/g, '').split(''); - for (var j = digits.length-1; j >= 0; j--) { - var c = digits[j]; - max = Math.max(max, counts[c] = (counts[c] || 0) + 1); - } - } - } - - // Check randomness for v4 UUIDs - if (version == 'v4') { - // Limit that we get worried about randomness. (Purely empirical choice, this!) - var limit = 2*100*Math.sqrt(1/N); - - log('\nChecking v4 randomness. Distribution of Hex Digits (% deviation from ideal)'); - - for (var i = 0; i < 16; i++) { - var c = i.toString(16); - var bar = '', n = counts[c], p = Math.round(n/max*100|0); - - // 1-3,5-8, and D-F: 1:16 odds over 30 digits - var ideal = N*30/16; - if (i == 4) { - // 4: 1:1 odds on 1 digit, plus 1:16 odds on 30 digits - ideal = N*(1 + 30/16); - } else if (i >= 8 && i <= 11) { - // 8-B: 1:4 odds on 1 digit, plus 1:16 odds on 30 digits - ideal = N*(1/4 + 30/16); - } else { - // Otherwise: 1:16 odds on 30 digits - ideal = N*30/16; - } - var d = divergence(n, ideal); - - // Draw bar using UTF squares (just for grins) - var s = n/max*50 | 0; - while (s--) bar += '='; - - assert(Math.abs(d) < limit, c + ' |' + bar + '| ' + counts[c] + ' (' + d + '% < ' + limit + '%)'); - } - } -} - -// Perf tests -for (var version in generators) { - log('\nPerformance testing ' + version + ' UUIDs'); - var generator = generators[version]; - var buf = new uuid.BufferClass(16); - - for (var i = 0, t = Date.now(); i < N; i++) generator(); - rate('uuid.' + version + '()', t); - - for (var i = 0, t = Date.now(); i < N; i++) generator('binary'); - rate('uuid.' + version + '(\'binary\')', t); - - for (var i = 0, t = Date.now(); i < N; i++) generator('binary', buf); - rate('uuid.' + version + '(\'binary\', buffer)', t); -} diff --git a/src/extensibility/node/node_modules/request/node_modules/node-uuid/uuid.js b/src/extensibility/node/node_modules/request/node_modules/node-uuid/uuid.js deleted file mode 100644 index 2fac6dc4b97..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/node-uuid/uuid.js +++ /dev/null @@ -1,245 +0,0 @@ -// uuid.js -// -// Copyright (c) 2010-2012 Robert Kieffer -// MIT License - http://opensource.org/licenses/mit-license.php - -(function() { - var _global = this; - - // Unique ID creation requires a high quality random # generator. We feature - // detect to determine the best RNG source, normalizing to a function that - // returns 128-bits of randomness, since that's what's usually required - var _rng; - - // Node.js crypto-based RNG - http://nodejs.org/docs/v0.6.2/api/crypto.html - // - // Moderately fast, high quality - if (typeof(require) == 'function') { - try { - var _rb = require('crypto').randomBytes; - _rng = _rb && function() {return _rb(16);}; - } catch(e) {} - } - - if (!_rng && _global.crypto && crypto.getRandomValues) { - // WHATWG crypto-based RNG - http://wiki.whatwg.org/wiki/Crypto - // - // Moderately fast, high quality - var _rnds8 = new Uint8Array(16); - _rng = function whatwgRNG() { - crypto.getRandomValues(_rnds8); - return _rnds8; - }; - } - - if (!_rng) { - // Math.random()-based (RNG) - // - // If all else fails, use Math.random(). It's fast, but is of unspecified - // quality. - var _rnds = new Array(16); - _rng = function() { - for (var i = 0, r; i < 16; i++) { - if ((i & 0x03) === 0) r = Math.random() * 0x100000000; - _rnds[i] = r >>> ((i & 0x03) << 3) & 0xff; - } - - return _rnds; - }; - } - - // Buffer class to use - var BufferClass = typeof(Buffer) == 'function' ? Buffer : Array; - - // Maps for number <-> hex string conversion - var _byteToHex = []; - var _hexToByte = {}; - for (var i = 0; i < 256; i++) { - _byteToHex[i] = (i + 0x100).toString(16).substr(1); - _hexToByte[_byteToHex[i]] = i; - } - - // **`parse()` - Parse a UUID into it's component bytes** - function parse(s, buf, offset) { - var i = (buf && offset) || 0, ii = 0; - - buf = buf || []; - s.toLowerCase().replace(/[0-9a-f]{2}/g, function(oct) { - if (ii < 16) { // Don't overflow! - buf[i + ii++] = _hexToByte[oct]; - } - }); - - // Zero out remaining bytes if string was short - while (ii < 16) { - buf[i + ii++] = 0; - } - - return buf; - } - - // **`unparse()` - Convert UUID byte array (ala parse()) into a string** - function unparse(buf, offset) { - var i = offset || 0, bth = _byteToHex; - return bth[buf[i++]] + bth[buf[i++]] + - bth[buf[i++]] + bth[buf[i++]] + '-' + - bth[buf[i++]] + bth[buf[i++]] + '-' + - bth[buf[i++]] + bth[buf[i++]] + '-' + - bth[buf[i++]] + bth[buf[i++]] + '-' + - bth[buf[i++]] + bth[buf[i++]] + - bth[buf[i++]] + bth[buf[i++]] + - bth[buf[i++]] + bth[buf[i++]]; - } - - // **`v1()` - Generate time-based UUID** - // - // Inspired by https://github.com/LiosK/UUID.js - // and http://docs.python.org/library/uuid.html - - // random #'s we need to init node and clockseq - var _seedBytes = _rng(); - - // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) - var _nodeId = [ - _seedBytes[0] | 0x01, - _seedBytes[1], _seedBytes[2], _seedBytes[3], _seedBytes[4], _seedBytes[5] - ]; - - // Per 4.2.2, randomize (14 bit) clockseq - var _clockseq = (_seedBytes[6] << 8 | _seedBytes[7]) & 0x3fff; - - // Previous uuid creation time - var _lastMSecs = 0, _lastNSecs = 0; - - // See https://github.com/broofa/node-uuid for API details - function v1(options, buf, offset) { - var i = buf && offset || 0; - var b = buf || []; - - options = options || {}; - - var clockseq = options.clockseq != null ? options.clockseq : _clockseq; - - // UUID timestamps are 100 nano-second units since the Gregorian epoch, - // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so - // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs' - // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00. - var msecs = options.msecs != null ? options.msecs : new Date().getTime(); - - // Per 4.2.1.2, use count of uuid's generated during the current clock - // cycle to simulate higher resolution clock - var nsecs = options.nsecs != null ? options.nsecs : _lastNSecs + 1; - - // Time since last uuid creation (in msecs) - var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000; - - // Per 4.2.1.2, Bump clockseq on clock regression - if (dt < 0 && options.clockseq == null) { - clockseq = clockseq + 1 & 0x3fff; - } - - // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new - // time interval - if ((dt < 0 || msecs > _lastMSecs) && options.nsecs == null) { - nsecs = 0; - } - - // Per 4.2.1.2 Throw error if too many uuids are requested - if (nsecs >= 10000) { - throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec'); - } - - _lastMSecs = msecs; - _lastNSecs = nsecs; - _clockseq = clockseq; - - // Per 4.1.4 - Convert from unix epoch to Gregorian epoch - msecs += 12219292800000; - - // `time_low` - var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; - b[i++] = tl >>> 24 & 0xff; - b[i++] = tl >>> 16 & 0xff; - b[i++] = tl >>> 8 & 0xff; - b[i++] = tl & 0xff; - - // `time_mid` - var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff; - b[i++] = tmh >>> 8 & 0xff; - b[i++] = tmh & 0xff; - - // `time_high_and_version` - b[i++] = tmh >>> 24 & 0xf | 0x10; // include version - b[i++] = tmh >>> 16 & 0xff; - - // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) - b[i++] = clockseq >>> 8 | 0x80; - - // `clock_seq_low` - b[i++] = clockseq & 0xff; - - // `node` - var node = options.node || _nodeId; - for (var n = 0; n < 6; n++) { - b[i + n] = node[n]; - } - - return buf ? buf : unparse(b); - } - - // **`v4()` - Generate random UUID** - - // See https://github.com/broofa/node-uuid for API details - function v4(options, buf, offset) { - // Deprecated - 'format' argument, as supported in v1.2 - var i = buf && offset || 0; - - if (typeof(options) == 'string') { - buf = options == 'binary' ? new BufferClass(16) : null; - options = null; - } - options = options || {}; - - var rnds = options.random || (options.rng || _rng)(); - - // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` - rnds[6] = (rnds[6] & 0x0f) | 0x40; - rnds[8] = (rnds[8] & 0x3f) | 0x80; - - // Copy bytes to buffer, if provided - if (buf) { - for (var ii = 0; ii < 16; ii++) { - buf[i + ii] = rnds[ii]; - } - } - - return buf || unparse(rnds); - } - - // Export public API - var uuid = v4; - uuid.v1 = v1; - uuid.v4 = v4; - uuid.parse = parse; - uuid.unparse = unparse; - uuid.BufferClass = BufferClass; - - if (typeof define === 'function' && define.amd) { - // Publish as AMD module - define(function() {return uuid;}); - } else if (typeof(module) != 'undefined' && module.exports) { - // Publish as node.js module - module.exports = uuid; - } else { - // Publish as global (in browsers) - var _previousRoot = _global.uuid; - - // **`noConflict()` - (browser only) to reset global 'uuid' var** - uuid.noConflict = function() { - _global.uuid = _previousRoot; - return uuid; - }; - - _global.uuid = uuid; - } -}).call(this); diff --git a/src/extensibility/node/node_modules/request/node_modules/oauth-sign/LICENSE b/src/extensibility/node/node_modules/request/node_modules/oauth-sign/LICENSE deleted file mode 100644 index a4a9aee0c2f..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/oauth-sign/LICENSE +++ /dev/null @@ -1,55 +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: - -You must give any other recipients of the Work or Derivative Works a copy of this License; and - -You must cause any modified files to carry prominent notices stating that You changed the files; and - -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 - -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 \ No newline at end of file diff --git a/src/extensibility/node/node_modules/request/node_modules/oauth-sign/README.md b/src/extensibility/node/node_modules/request/node_modules/oauth-sign/README.md deleted file mode 100644 index 34c4a85d2dd..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/oauth-sign/README.md +++ /dev/null @@ -1,4 +0,0 @@ -oauth-sign -========== - -OAuth 1 signing. Formerly a vendor lib in mikeal/request, now a standalone module. diff --git a/src/extensibility/node/node_modules/request/node_modules/oauth-sign/index.js b/src/extensibility/node/node_modules/request/node_modules/oauth-sign/index.js deleted file mode 100644 index e35bfa67075..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/oauth-sign/index.js +++ /dev/null @@ -1,43 +0,0 @@ -var crypto = require('crypto') - , qs = require('querystring') - ; - -function sha1 (key, body) { - return crypto.createHmac('sha1', key).update(body).digest('base64') -} - -function rfc3986 (str) { - return encodeURIComponent(str) - .replace(/!/g,'%21') - .replace(/\*/g,'%2A') - .replace(/\(/g,'%28') - .replace(/\)/g,'%29') - .replace(/'/g,'%27') - ; -} - -function hmacsign (httpMethod, base_uri, params, consumer_secret, token_secret) { - // adapted from https://dev.twitter.com/docs/auth/oauth and - // https://dev.twitter.com/docs/auth/creating-signature - - var querystring = Object.keys(params).sort().map(function(key){ - // big WTF here with the escape + encoding but it's what twitter wants - return escape(rfc3986(key)) + "%3D" + escape(rfc3986(params[key])) - }).join('%26') - - var base = [ - httpMethod ? httpMethod.toUpperCase() : 'GET', - rfc3986(base_uri), - querystring - ].join('&') - - var key = [ - consumer_secret, - token_secret || '' - ].map(rfc3986).join('&') - - return sha1(key, base) -} - -exports.hmacsign = hmacsign -exports.rfc3986 = rfc3986 diff --git a/src/extensibility/node/node_modules/request/node_modules/oauth-sign/package.json b/src/extensibility/node/node_modules/request/node_modules/oauth-sign/package.json deleted file mode 100644 index f211ed34eb8..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/oauth-sign/package.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "author": { - "name": "Mikeal Rogers", - "email": "mikeal.rogers@gmail.com", - "url": "http://www.futurealoof.com" - }, - "name": "oauth-sign", - "description": "OAuth 1 signing. Formerly a vendor lib in mikeal/request, now a standalone module.", - "version": "0.3.0", - "repository": { - "url": "https://github.com/mikeal/oauth-sign" - }, - "main": "index.js", - "dependencies": {}, - "devDependencies": {}, - "optionalDependencies": {}, - "engines": { - "node": "*" - }, - "scripts": { - "test": "node test.js" - }, - "readme": "oauth-sign\n==========\n\nOAuth 1 signing. Formerly a vendor lib in mikeal/request, now a standalone module. \n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/mikeal/oauth-sign/issues" - }, - "_id": "oauth-sign@0.3.0", - "_from": "oauth-sign@~0.3.0" -} diff --git a/src/extensibility/node/node_modules/request/node_modules/oauth-sign/test.js b/src/extensibility/node/node_modules/request/node_modules/oauth-sign/test.js deleted file mode 100644 index 46955ff6939..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/oauth-sign/test.js +++ /dev/null @@ -1,49 +0,0 @@ -var hmacsign = require('./index').hmacsign - , assert = require('assert') - , qs = require('querystring') - ; - -// Tests from Twitter documentation https://dev.twitter.com/docs/auth/oauth - -var reqsign = hmacsign('POST', 'https://api.twitter.com/oauth/request_token', - { oauth_callback: 'http://localhost:3005/the_dance/process_callback?service_provider_id=11' - , oauth_consumer_key: 'GDdmIQH6jhtmLUypg82g' - , oauth_nonce: 'QP70eNmVz8jvdPevU3oJD2AfF7R7odC2XJcn4XlZJqk' - , oauth_signature_method: 'HMAC-SHA1' - , oauth_timestamp: '1272323042' - , oauth_version: '1.0' - }, "MCD8BKwGdgPHvAuvgvz4EQpqDAtx89grbuNMRd7Eh98") - -console.log(reqsign) -console.log('8wUi7m5HFQy76nowoCThusfgB+Q=') -assert.equal(reqsign, '8wUi7m5HFQy76nowoCThusfgB+Q=') - -var accsign = hmacsign('POST', 'https://api.twitter.com/oauth/access_token', - { oauth_consumer_key: 'GDdmIQH6jhtmLUypg82g' - , oauth_nonce: '9zWH6qe0qG7Lc1telCn7FhUbLyVdjEaL3MO5uHxn8' - , oauth_signature_method: 'HMAC-SHA1' - , oauth_token: '8ldIZyxQeVrFZXFOZH5tAwj6vzJYuLQpl0WUEYtWc' - , oauth_timestamp: '1272323047' - , oauth_verifier: 'pDNg57prOHapMbhv25RNf75lVRd6JDsni1AJJIDYoTY' - , oauth_version: '1.0' - }, "MCD8BKwGdgPHvAuvgvz4EQpqDAtx89grbuNMRd7Eh98", "x6qpRnlEmW9JbQn4PQVVeVG8ZLPEx6A0TOebgwcuA") - -console.log(accsign) -console.log('PUw/dHA4fnlJYM6RhXk5IU/0fCc=') -assert.equal(accsign, 'PUw/dHA4fnlJYM6RhXk5IU/0fCc=') - -var upsign = hmacsign('POST', 'http://api.twitter.com/1/statuses/update.json', - { oauth_consumer_key: "GDdmIQH6jhtmLUypg82g" - , oauth_nonce: "oElnnMTQIZvqvlfXM56aBLAf5noGD0AQR3Fmi7Q6Y" - , oauth_signature_method: "HMAC-SHA1" - , oauth_token: "819797-Jxq8aYUDRmykzVKrgoLhXSq67TEa5ruc4GJC2rWimw" - , oauth_timestamp: "1272325550" - , oauth_version: "1.0" - , status: 'setting up my twitter 私のさえずりを設定する' - }, "MCD8BKwGdgPHvAuvgvz4EQpqDAtx89grbuNMRd7Eh98", "J6zix3FfA9LofH0awS24M3HcBYXO5nI1iYe8EfBA") - -console.log(upsign) -console.log('yOahq5m0YjDDjfjxHaXEsW9D+X0=') -assert.equal(upsign, 'yOahq5m0YjDDjfjxHaXEsW9D+X0=') - - diff --git a/src/extensibility/node/node_modules/request/node_modules/qs/.gitmodules b/src/extensibility/node/node_modules/request/node_modules/qs/.gitmodules deleted file mode 100644 index 49e31dac7d7..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/qs/.gitmodules +++ /dev/null @@ -1,6 +0,0 @@ -[submodule "support/expresso"] - path = support/expresso - url = git://github.com/visionmedia/expresso.git -[submodule "support/should"] - path = support/should - url = git://github.com/visionmedia/should.js.git diff --git a/src/extensibility/node/node_modules/request/node_modules/qs/.npmignore b/src/extensibility/node/node_modules/request/node_modules/qs/.npmignore deleted file mode 100644 index e85ce2afa21..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/qs/.npmignore +++ /dev/null @@ -1,7 +0,0 @@ -test -.travis.yml -benchmark.js -component.json -examples.js -History.md -Makefile diff --git a/src/extensibility/node/node_modules/request/node_modules/qs/Readme.md b/src/extensibility/node/node_modules/request/node_modules/qs/Readme.md deleted file mode 100644 index 27e54a4af18..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/qs/Readme.md +++ /dev/null @@ -1,58 +0,0 @@ -# node-querystring - - query string parser for node and the browser supporting nesting, as it was removed from `0.3.x`, so this library provides the previous and commonly desired behaviour (and twice as fast). Used by [express](http://expressjs.com), [connect](http://senchalabs.github.com/connect) and others. - -## Installation - - $ npm install qs - -## Examples - -```js -var qs = require('qs'); - -qs.parse('user[name][first]=Tobi&user[email]=tobi@learnboost.com'); -// => { user: { name: { first: 'Tobi' }, email: 'tobi@learnboost.com' } } - -qs.stringify({ user: { name: 'Tobi', email: 'tobi@learnboost.com' }}) -// => user[name]=Tobi&user[email]=tobi%40learnboost.com -``` - -## Testing - -Install dev dependencies: - - $ npm install -d - -and execute: - - $ make test - -browser: - - $ open test/browser/index.html - -## License - -(The MIT License) - -Copyright (c) 2010 TJ Holowaychuk <tj@vision-media.ca> - -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. \ No newline at end of file diff --git a/src/extensibility/node/node_modules/request/node_modules/qs/index.js b/src/extensibility/node/node_modules/request/node_modules/qs/index.js deleted file mode 100644 index 590491e31ed..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/qs/index.js +++ /dev/null @@ -1,387 +0,0 @@ -/** - * Object#toString() ref for stringify(). - */ - -var toString = Object.prototype.toString; - -/** - * Object#hasOwnProperty ref - */ - -var hasOwnProperty = Object.prototype.hasOwnProperty; - -/** - * Array#indexOf shim. - */ - -var indexOf = typeof Array.prototype.indexOf === 'function' - ? function(arr, el) { return arr.indexOf(el); } - : function(arr, el) { - for (var i = 0; i < arr.length; i++) { - if (arr[i] === el) return i; - } - return -1; - }; - -/** - * Array.isArray shim. - */ - -var isArray = Array.isArray || function(arr) { - return toString.call(arr) == '[object Array]'; -}; - -/** - * Object.keys shim. - */ - -var objectKeys = Object.keys || function(obj) { - var ret = []; - for (var key in obj) ret.push(key); - return ret; -}; - -/** - * Array#forEach shim. - */ - -var forEach = typeof Array.prototype.forEach === 'function' - ? function(arr, fn) { return arr.forEach(fn); } - : function(arr, fn) { - for (var i = 0; i < arr.length; i++) fn(arr[i]); - }; - -/** - * Array#reduce shim. - */ - -var reduce = function(arr, fn, initial) { - if (typeof arr.reduce === 'function') return arr.reduce(fn, initial); - var res = initial; - for (var i = 0; i < arr.length; i++) res = fn(res, arr[i]); - return res; -}; - -/** - * Create a nullary object if possible - */ - -function createObject() { - return Object.create - ? Object.create(null) - : {}; -} - -/** - * Cache non-integer test regexp. - */ - -var isint = /^[0-9]+$/; - -function promote(parent, key) { - if (parent[key].length == 0) return parent[key] = createObject(); - var t = createObject(); - for (var i in parent[key]) { - if (hasOwnProperty.call(parent[key], i)) { - t[i] = parent[key][i]; - } - } - parent[key] = t; - return t; -} - -function parse(parts, parent, key, val) { - var part = parts.shift(); - // end - if (!part) { - if (isArray(parent[key])) { - parent[key].push(val); - } else if ('object' == typeof parent[key]) { - parent[key] = val; - } else if ('undefined' == typeof parent[key]) { - parent[key] = val; - } else { - parent[key] = [parent[key], val]; - } - // array - } else { - var obj = parent[key] = parent[key] || []; - if (']' == part) { - if (isArray(obj)) { - if ('' != val) obj.push(val); - } else if ('object' == typeof obj) { - obj[objectKeys(obj).length] = val; - } else { - obj = parent[key] = [parent[key], val]; - } - // prop - } else if (~indexOf(part, ']')) { - part = part.substr(0, part.length - 1); - if (!isint.test(part) && isArray(obj)) obj = promote(parent, key); - parse(parts, obj, part, val); - // key - } else { - if (!isint.test(part) && isArray(obj)) obj = promote(parent, key); - parse(parts, obj, part, val); - } - } -} - -/** - * Merge parent key/val pair. - */ - -function merge(parent, key, val){ - if (~indexOf(key, ']')) { - var parts = key.split('[') - , len = parts.length - , last = len - 1; - parse(parts, parent, 'base', val); - // optimize - } else { - if (!isint.test(key) && isArray(parent.base)) { - var t = createObject(); - for (var k in parent.base) t[k] = parent.base[k]; - parent.base = t; - } - set(parent.base, key, val); - } - - return parent; -} - -/** - * Compact sparse arrays. - */ - -function compact(obj) { - if ('object' != typeof obj) return obj; - - if (isArray(obj)) { - var ret = []; - - for (var i in obj) { - if (hasOwnProperty.call(obj, i)) { - ret.push(obj[i]); - } - } - - return ret; - } - - for (var key in obj) { - obj[key] = compact(obj[key]); - } - - return obj; -} - -/** - * Restore Object.prototype. - * see pull-request #58 - */ - -function restoreProto(obj) { - if (!Object.create) return obj; - if (isArray(obj)) return obj; - if (obj && 'object' != typeof obj) return obj; - - for (var key in obj) { - if (hasOwnProperty.call(obj, key)) { - obj[key] = restoreProto(obj[key]); - } - } - - obj.__proto__ = Object.prototype; - return obj; -} - -/** - * Parse the given obj. - */ - -function parseObject(obj){ - var ret = { base: {} }; - - forEach(objectKeys(obj), function(name){ - merge(ret, name, obj[name]); - }); - - return compact(ret.base); -} - -/** - * Parse the given str. - */ - -function parseString(str){ - var ret = reduce(String(str).split('&'), function(ret, pair){ - var eql = indexOf(pair, '=') - , brace = lastBraceInKey(pair) - , key = pair.substr(0, brace || eql) - , val = pair.substr(brace || eql, pair.length) - , val = val.substr(indexOf(val, '=') + 1, val.length); - - // ?foo - if ('' == key) key = pair, val = ''; - if ('' == key) return ret; - - return merge(ret, decode(key), decode(val)); - }, { base: createObject() }).base; - - return restoreProto(compact(ret)); -} - -/** - * Parse the given query `str` or `obj`, returning an object. - * - * @param {String} str | {Object} obj - * @return {Object} - * @api public - */ - -exports.parse = function(str){ - if (null == str || '' == str) return {}; - return 'object' == typeof str - ? parseObject(str) - : parseString(str); -}; - -/** - * Turn the given `obj` into a query string - * - * @param {Object} obj - * @return {String} - * @api public - */ - -var stringify = exports.stringify = function(obj, prefix) { - if (isArray(obj)) { - return stringifyArray(obj, prefix); - } else if ('[object Object]' == toString.call(obj)) { - return stringifyObject(obj, prefix); - } else if ('string' == typeof obj) { - return stringifyString(obj, prefix); - } else { - return prefix + '=' + encodeURIComponent(String(obj)); - } -}; - -/** - * Stringify the given `str`. - * - * @param {String} str - * @param {String} prefix - * @return {String} - * @api private - */ - -function stringifyString(str, prefix) { - if (!prefix) throw new TypeError('stringify expects an object'); - return prefix + '=' + encodeURIComponent(str); -} - -/** - * Stringify the given `arr`. - * - * @param {Array} arr - * @param {String} prefix - * @return {String} - * @api private - */ - -function stringifyArray(arr, prefix) { - var ret = []; - if (!prefix) throw new TypeError('stringify expects an object'); - for (var i = 0; i < arr.length; i++) { - ret.push(stringify(arr[i], prefix + '[' + i + ']')); - } - return ret.join('&'); -} - -/** - * Stringify the given `obj`. - * - * @param {Object} obj - * @param {String} prefix - * @return {String} - * @api private - */ - -function stringifyObject(obj, prefix) { - var ret = [] - , keys = objectKeys(obj) - , key; - - for (var i = 0, len = keys.length; i < len; ++i) { - key = keys[i]; - if ('' == key) continue; - if (null == obj[key]) { - ret.push(encodeURIComponent(key) + '='); - } else { - ret.push(stringify(obj[key], prefix - ? prefix + '[' + encodeURIComponent(key) + ']' - : encodeURIComponent(key))); - } - } - - return ret.join('&'); -} - -/** - * Set `obj`'s `key` to `val` respecting - * the weird and wonderful syntax of a qs, - * where "foo=bar&foo=baz" becomes an array. - * - * @param {Object} obj - * @param {String} key - * @param {String} val - * @api private - */ - -function set(obj, key, val) { - var v = obj[key]; - if (undefined === v) { - obj[key] = val; - } else if (isArray(v)) { - v.push(val); - } else { - obj[key] = [v, val]; - } -} - -/** - * Locate last brace in `str` within the key. - * - * @param {String} str - * @return {Number} - * @api private - */ - -function lastBraceInKey(str) { - var len = str.length - , brace - , c; - for (var i = 0; i < len; ++i) { - c = str[i]; - if (']' == c) brace = false; - if ('[' == c) brace = true; - if ('=' == c && !brace) return i; - } -} - -/** - * Decode `str`. - * - * @param {String} str - * @return {String} - * @api private - */ - -function decode(str) { - try { - return decodeURIComponent(str.replace(/\+/g, ' ')); - } catch (err) { - return str; - } -} diff --git a/src/extensibility/node/node_modules/request/node_modules/qs/package.json b/src/extensibility/node/node_modules/request/node_modules/qs/package.json deleted file mode 100644 index d1475f93466..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/qs/package.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "qs", - "description": "querystring parser", - "version": "0.6.5", - "keywords": [ - "query string", - "parser", - "component" - ], - "repository": { - "type": "git", - "url": "git://github.com/visionmedia/node-querystring.git" - }, - "devDependencies": { - "mocha": "*", - "expect.js": "*" - }, - "scripts": { - "test": "make test" - }, - "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca", - "url": "http://tjholowaychuk.com" - }, - "main": "index", - "engines": { - "node": "*" - }, - "readme": "# node-querystring\n\n query string parser for node and the browser supporting nesting, as it was removed from `0.3.x`, so this library provides the previous and commonly desired behaviour (and twice as fast). Used by [express](http://expressjs.com), [connect](http://senchalabs.github.com/connect) and others.\n\n## Installation\n\n $ npm install qs\n\n## Examples\n\n```js\nvar qs = require('qs');\n\nqs.parse('user[name][first]=Tobi&user[email]=tobi@learnboost.com');\n// => { user: { name: { first: 'Tobi' }, email: 'tobi@learnboost.com' } }\n\nqs.stringify({ user: { name: 'Tobi', email: 'tobi@learnboost.com' }})\n// => user[name]=Tobi&user[email]=tobi%40learnboost.com\n```\n\n## Testing\n\nInstall dev dependencies:\n\n $ npm install -d\n\nand execute:\n\n $ make test\n\nbrowser:\n\n $ open test/browser/index.html\n\n## License \n\n(The MIT License)\n\nCopyright (c) 2010 TJ Holowaychuk <tj@vision-media.ca>\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.", - "readmeFilename": "Readme.md", - "bugs": { - "url": "https://github.com/visionmedia/node-querystring/issues" - }, - "_id": "qs@0.6.5", - "_from": "qs@~0.6.0" -} diff --git a/src/extensibility/node/node_modules/request/node_modules/tunnel-agent/LICENSE b/src/extensibility/node/node_modules/request/node_modules/tunnel-agent/LICENSE deleted file mode 100644 index a4a9aee0c2f..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/tunnel-agent/LICENSE +++ /dev/null @@ -1,55 +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: - -You must give any other recipients of the Work or Derivative Works a copy of this License; and - -You must cause any modified files to carry prominent notices stating that You changed the files; and - -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 - -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 \ No newline at end of file diff --git a/src/extensibility/node/node_modules/request/node_modules/tunnel-agent/README.md b/src/extensibility/node/node_modules/request/node_modules/tunnel-agent/README.md deleted file mode 100644 index bb533d56b1a..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/tunnel-agent/README.md +++ /dev/null @@ -1,4 +0,0 @@ -tunnel-agent -============ - -HTTP proxy tunneling agent. Formerly part of mikeal/request, now a standalone module. diff --git a/src/extensibility/node/node_modules/request/node_modules/tunnel-agent/index.js b/src/extensibility/node/node_modules/request/node_modules/tunnel-agent/index.js deleted file mode 100644 index 3f7bbb909fd..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/tunnel-agent/index.js +++ /dev/null @@ -1,227 +0,0 @@ -'use strict' - -var net = require('net') - , tls = require('tls') - , http = require('http') - , https = require('https') - , events = require('events') - , assert = require('assert') - , util = require('util') - ; - -exports.httpOverHttp = httpOverHttp -exports.httpsOverHttp = httpsOverHttp -exports.httpOverHttps = httpOverHttps -exports.httpsOverHttps = httpsOverHttps - - -function httpOverHttp(options) { - var agent = new TunnelingAgent(options) - agent.request = http.request - return agent -} - -function httpsOverHttp(options) { - var agent = new TunnelingAgent(options) - agent.request = http.request - agent.createSocket = createSecureSocket - return agent -} - -function httpOverHttps(options) { - var agent = new TunnelingAgent(options) - agent.request = https.request - return agent -} - -function httpsOverHttps(options) { - var agent = new TunnelingAgent(options) - agent.request = https.request - agent.createSocket = createSecureSocket - return agent -} - - -function TunnelingAgent(options) { - var self = this - self.options = options || {} - self.proxyOptions = self.options.proxy || {} - self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets - self.requests = [] - self.sockets = [] - - self.on('free', function onFree(socket, host, port) { - for (var i = 0, len = self.requests.length; i < len; ++i) { - var pending = self.requests[i] - if (pending.host === host && pending.port === port) { - // Detect the request to connect same origin server, - // reuse the connection. - self.requests.splice(i, 1) - pending.request.onSocket(socket) - return - } - } - socket.destroy() - self.removeSocket(socket) - }) -} -util.inherits(TunnelingAgent, events.EventEmitter) - -TunnelingAgent.prototype.addRequest = function addRequest(req, host, port) { - var self = this - - if (self.sockets.length >= this.maxSockets) { - // We are over limit so we'll add it to the queue. - self.requests.push({host: host, port: port, request: req}) - return - } - - // If we are under maxSockets create a new one. - self.createSocket({host: host, port: port, request: req}, function(socket) { - socket.on('free', onFree) - socket.on('close', onCloseOrRemove) - socket.on('agentRemove', onCloseOrRemove) - req.onSocket(socket) - - function onFree() { - self.emit('free', socket, host, port) - } - - function onCloseOrRemove(err) { - self.removeSocket() - socket.removeListener('free', onFree) - socket.removeListener('close', onCloseOrRemove) - socket.removeListener('agentRemove', onCloseOrRemove) - } - }) -} - -TunnelingAgent.prototype.createSocket = function createSocket(options, cb) { - var self = this - var placeholder = {} - self.sockets.push(placeholder) - - var connectOptions = mergeOptions({}, self.proxyOptions, - { method: 'CONNECT' - , path: options.host + ':' + options.port - , agent: false - } - ) - if (connectOptions.proxyAuth) { - connectOptions.headers = connectOptions.headers || {} - connectOptions.headers['Proxy-Authorization'] = 'Basic ' + - new Buffer(connectOptions.proxyAuth).toString('base64') - } - - debug('making CONNECT request') - var connectReq = self.request(connectOptions) - connectReq.useChunkedEncodingByDefault = false // for v0.6 - connectReq.once('response', onResponse) // for v0.6 - connectReq.once('upgrade', onUpgrade) // for v0.6 - connectReq.once('connect', onConnect) // for v0.7 or later - connectReq.once('error', onError) - connectReq.end() - - function onResponse(res) { - // Very hacky. This is necessary to avoid http-parser leaks. - res.upgrade = true - } - - function onUpgrade(res, socket, head) { - // Hacky. - process.nextTick(function() { - onConnect(res, socket, head) - }) - } - - function onConnect(res, socket, head) { - connectReq.removeAllListeners() - socket.removeAllListeners() - - if (res.statusCode === 200) { - assert.equal(head.length, 0) - debug('tunneling connection has established') - self.sockets[self.sockets.indexOf(placeholder)] = socket - cb(socket) - } else { - debug('tunneling socket could not be established, statusCode=%d', res.statusCode) - var error = new Error('tunneling socket could not be established, ' + 'statusCode=' + res.statusCode) - error.code = 'ECONNRESET' - options.request.emit('error', error) - self.removeSocket(placeholder) - } - } - - function onError(cause) { - connectReq.removeAllListeners() - - debug('tunneling socket could not be established, cause=%s\n', cause.message, cause.stack) - var error = new Error('tunneling socket could not be established, ' + 'cause=' + cause.message) - error.code = 'ECONNRESET' - options.request.emit('error', error) - self.removeSocket(placeholder) - } -} - -TunnelingAgent.prototype.removeSocket = function removeSocket(socket) { - var pos = this.sockets.indexOf(socket) - if (pos === -1) return - - this.sockets.splice(pos, 1) - - var pending = this.requests.shift() - if (pending) { - // If we have pending requests and a socket gets closed a new one - // needs to be created to take over in the pool for the one that closed. - this.createSocket(pending, function(socket) { - pending.request.onSocket(socket) - }) - } -} - -function createSecureSocket(options, cb) { - var self = this - TunnelingAgent.prototype.createSocket.call(self, options, function(socket) { - // 0 is dummy port for v0.6 - var secureSocket = tls.connect(0, mergeOptions({}, self.options, - { servername: options.host - , socket: socket - } - )) - cb(secureSocket) - }) -} - - -function mergeOptions(target) { - for (var i = 1, len = arguments.length; i < len; ++i) { - var overrides = arguments[i] - if (typeof overrides === 'object') { - var keys = Object.keys(overrides) - for (var j = 0, keyLen = keys.length; j < keyLen; ++j) { - var k = keys[j] - if (overrides[k] !== undefined) { - target[k] = overrides[k] - } - } - } - } - return target -} - - -var debug -if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) { - debug = function() { - var args = Array.prototype.slice.call(arguments) - if (typeof args[0] === 'string') { - args[0] = 'TUNNEL: ' + args[0] - } else { - args.unshift('TUNNEL:') - } - console.error.apply(console, args) - } -} else { - debug = function() {} -} -exports.debug = debug // for test diff --git a/src/extensibility/node/node_modules/request/node_modules/tunnel-agent/package.json b/src/extensibility/node/node_modules/request/node_modules/tunnel-agent/package.json deleted file mode 100644 index 9b14d25863d..00000000000 --- a/src/extensibility/node/node_modules/request/node_modules/tunnel-agent/package.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "author": { - "name": "Mikeal Rogers", - "email": "mikeal.rogers@gmail.com", - "url": "http://www.futurealoof.com" - }, - "name": "tunnel-agent", - "description": "HTTP proxy tunneling agent. Formerly part of mikeal/request, now a standalone module.", - "version": "0.3.0", - "repository": { - "url": "https://github.com/mikeal/tunnel-agent" - }, - "main": "index.js", - "dependencies": {}, - "devDependencies": {}, - "optionalDependencies": {}, - "engines": { - "node": "*" - }, - "readme": "tunnel-agent\n============\n\nHTTP proxy tunneling agent. Formerly part of mikeal/request, now a standalone module.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/mikeal/tunnel-agent/issues" - }, - "_id": "tunnel-agent@0.3.0", - "_from": "tunnel-agent@~0.3.0" -} diff --git a/src/extensibility/node/node_modules/request/package.json b/src/extensibility/node/node_modules/request/package.json deleted file mode 100755 index eb5e8082500..00000000000 --- a/src/extensibility/node/node_modules/request/package.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "request", - "description": "Simplified HTTP request client.", - "tags": [ - "http", - "simple", - "util", - "utility" - ], - "version": "2.27.0", - "author": { - "name": "Mikeal Rogers", - "email": "mikeal.rogers@gmail.com" - }, - "repository": { - "type": "git", - "url": "http://github.com/mikeal/request.git" - }, - "bugs": { - "url": "http://github.com/mikeal/request/issues" - }, - "engines": [ - "node >= 0.8.0" - ], - "main": "index.js", - "dependencies": { - "qs": "~0.6.0", - "json-stringify-safe": "~5.0.0", - "forever-agent": "~0.5.0", - "tunnel-agent": "~0.3.0", - "http-signature": "~0.10.0", - "hawk": "~1.0.0", - "aws-sign": "~0.3.0", - "oauth-sign": "~0.3.0", - "cookie-jar": "~0.3.0", - "node-uuid": "~1.4.0", - "mime": "~1.2.9", - "form-data": "~0.1.0" - }, - "scripts": { - "test": "node tests/run.js" - }, - "readme": "# Request -- Simplified HTTP client\n\n[![NPM](https://nodei.co/npm/request.png)](https://nodei.co/npm/request/)\n\n## Super simple to use\n\nRequest is designed to be the simplest way possible to make http calls. It supports HTTPS and follows redirects by default.\n\n```javascript\nvar request = require('request');\nrequest('http://www.google.com', function (error, response, body) {\n if (!error && response.statusCode == 200) {\n console.log(body) // Print the google web page.\n }\n})\n```\n\n## Streaming\n\nYou can stream any response to a file stream.\n\n```javascript\nrequest('http://google.com/doodle.png').pipe(fs.createWriteStream('doodle.png'))\n```\n\nYou can also stream a file to a PUT or POST request. This method will also check the file extension against a mapping of file extensions to content-types, in this case `application/json`, and use the proper content-type in the PUT request if one is not already provided in the headers.\n\n```javascript\nfs.createReadStream('file.json').pipe(request.put('http://mysite.com/obj.json'))\n```\n\nRequest can also pipe to itself. When doing so the content-type and content-length will be preserved in the PUT headers.\n\n```javascript\nrequest.get('http://google.com/img.png').pipe(request.put('http://mysite.com/img.png'))\n```\n\nNow let's get fancy.\n\n```javascript\nhttp.createServer(function (req, resp) {\n if (req.url === '/doodle.png') {\n if (req.method === 'PUT') {\n req.pipe(request.put('http://mysite.com/doodle.png'))\n } else if (req.method === 'GET' || req.method === 'HEAD') {\n request.get('http://mysite.com/doodle.png').pipe(resp)\n }\n }\n})\n```\n\nYou can also pipe() from a http.ServerRequest instance and to a http.ServerResponse instance. The HTTP method and headers will be sent as well as the entity-body data. Which means that, if you don't really care about security, you can do:\n\n```javascript\nhttp.createServer(function (req, resp) {\n if (req.url === '/doodle.png') {\n var x = request('http://mysite.com/doodle.png')\n req.pipe(x)\n x.pipe(resp)\n }\n})\n```\n\nAnd since pipe() returns the destination stream in node 0.5.x you can do one line proxying :)\n\n```javascript\nreq.pipe(request('http://mysite.com/doodle.png')).pipe(resp)\n```\n\nAlso, none of this new functionality conflicts with requests previous features, it just expands them.\n\n```javascript\nvar r = request.defaults({'proxy':'http://localproxy.com'})\n\nhttp.createServer(function (req, resp) {\n if (req.url === '/doodle.png') {\n r.get('http://google.com/doodle.png').pipe(resp)\n }\n})\n```\nYou can still use intermediate proxies, the requests will still follow HTTP forwards, etc.\n\n## Forms\n\n`request` supports `application/x-www-form-urlencoded` and `multipart/form-data` form uploads. For `multipart/related` refer to the `multipart` API.\n\nUrl encoded forms are simple\n\n```javascript\nrequest.post('http://service.com/upload', {form:{key:'value'}})\n// or\nrequest.post('http://service.com/upload').form({key:'value'})\n```\n\nFor `multipart/form-data` we use the [form-data](https://github.com/felixge/node-form-data) library by [@felixge](https://github.com/felixge). You don't need to worry about piping the form object or setting the headers, `request` will handle that for you.\n\n```javascript\nvar r = request.post('http://service.com/upload')\nvar form = r.form()\nform.append('my_field', 'my_value')\nform.append('my_buffer', new Buffer([1, 2, 3]))\nform.append('my_file', fs.createReadStream(path.join(__dirname, 'doodle.png'))\nform.append('remote_file', request('http://google.com/doodle.png'))\n```\n\n## HTTP Authentication\n\n```javascript\nrequest.get('http://some.server.com/').auth('username', 'password', false);\n// or\nrequest.get('http://some.server.com/', {\n 'auth': {\n 'user': 'username',\n 'pass': 'password',\n 'sendImmediately': false\n }\n});\n```\n\nIf passed as an option, `auth` should be a hash containing values `user` || `username`, `password` || `pass`, and `sendImmediately` (optional). The method form takes parameters `auth(username, password, sendImmediately)`.\n\n`sendImmediately` defaults to true, which will cause a basic authentication header to be sent. If `sendImmediately` is `false`, then `request` will retry with a proper authentication header after receiving a 401 response from the server (which must contain a `WWW-Authenticate` header indicating the required authentication method).\n\nDigest authentication is supported, but it only works with `sendImmediately` set to `false` (otherwise `request` will send basic authentication on the initial request, which will probably cause the request to fail).\n\n## OAuth Signing\n\n```javascript\n// Twitter OAuth\nvar qs = require('querystring')\n , oauth =\n { callback: 'http://mysite.com/callback/'\n , consumer_key: CONSUMER_KEY\n , consumer_secret: CONSUMER_SECRET\n }\n , url = 'https://api.twitter.com/oauth/request_token'\n ;\nrequest.post({url:url, oauth:oauth}, function (e, r, body) {\n // Ideally, you would take the body in the response\n // and construct a URL that a user clicks on (like a sign in button).\n // The verifier is only available in the response after a user has\n // verified with twitter that they are authorizing your app.\n var access_token = qs.parse(body)\n , oauth =\n { consumer_key: CONSUMER_KEY\n , consumer_secret: CONSUMER_SECRET\n , token: access_token.oauth_token\n , verifier: access_token.oauth_verifier\n }\n , url = 'https://api.twitter.com/oauth/access_token'\n ;\n request.post({url:url, oauth:oauth}, function (e, r, body) {\n var perm_token = qs.parse(body)\n , oauth =\n { consumer_key: CONSUMER_KEY\n , consumer_secret: CONSUMER_SECRET\n , token: perm_token.oauth_token\n , token_secret: perm_token.oauth_token_secret\n }\n , url = 'https://api.twitter.com/1/users/show.json?'\n , params =\n { screen_name: perm_token.screen_name\n , user_id: perm_token.user_id\n }\n ;\n url += qs.stringify(params)\n request.get({url:url, oauth:oauth, json:true}, function (e, r, user) {\n console.log(user)\n })\n })\n})\n```\n\n\n\n### request(options, callback)\n\nThe first argument can be either a url or an options object. The only required option is uri, all others are optional.\n\n* `uri` || `url` - fully qualified uri or a parsed url object from url.parse()\n* `qs` - object containing querystring values to be appended to the uri\n* `method` - http method, defaults to GET\n* `headers` - http headers, defaults to {}\n* `body` - entity body for PATCH, POST and PUT requests. Must be buffer or string.\n* `form` - when passed an object this will set `body` but to a querystring representation of value and adds `Content-type: application/x-www-form-urlencoded; charset=utf-8` header. When passed no option a FormData instance is returned that will be piped to request.\n* `auth` - A hash containing values `user` || `username`, `password` || `pass`, and `sendImmediately` (optional). See documentation above.\n* `json` - sets `body` but to JSON representation of value and adds `Content-type: application/json` header. Additionally, parses the response body as json.\n* `multipart` - (experimental) array of objects which contains their own headers and `body` attribute. Sends `multipart/related` request. See example below.\n* `followRedirect` - follow HTTP 3xx responses as redirects. defaults to true.\n* `followAllRedirects` - follow non-GET HTTP 3xx responses as redirects. defaults to false.\n* `maxRedirects` - the maximum number of redirects to follow, defaults to 10.\n* `encoding` - Encoding to be used on `setEncoding` of response data. If set to `null`, the body is returned as a Buffer.\n* `pool` - A hash object containing the agents for these requests. If omitted this request will use the global pool which is set to node's default maxSockets.\n* `pool.maxSockets` - Integer containing the maximum amount of sockets in the pool.\n* `timeout` - Integer containing the number of milliseconds to wait for a request to respond before aborting the request\n* `proxy` - An HTTP proxy to be used. Support proxy Auth with Basic Auth the same way it's supported with the `url` parameter by embedding the auth info in the uri.\n* `oauth` - Options for OAuth HMAC-SHA1 signing, see documentation above.\n* `hawk` - Options for [Hawk signing](https://github.com/hueniverse/hawk). The `credentials` key must contain the necessary signing info, [see hawk docs for details](https://github.com/hueniverse/hawk#usage-example).\n* `strictSSL` - Set to `true` to require that SSL certificates be valid. Note: to use your own certificate authority, you need to specify an agent that was created with that ca as an option.\n* `jar` - Set to `true` if you want cookies to be remembered for future use, or define your custom cookie jar (see examples section)\n* `aws` - object containing aws signing information, should have the properties `key` and `secret` as well as `bucket` unless you're specifying your bucket as part of the path, or you are making a request that doesn't use a bucket (i.e. GET Services)\n* `httpSignature` - Options for the [HTTP Signature Scheme](https://github.com/joyent/node-http-signature/blob/master/http_signing.md) using [Joyent's library](https://github.com/joyent/node-http-signature). The `keyId` and `key` properties must be specified. See the docs for other options.\n* `localAddress` - Local interface to bind for network connections.\n\n\nThe callback argument gets 3 arguments. The first is an error when applicable (usually from the http.Client option not the http.ClientRequest object). The second is an http.ClientResponse object. The third is the response body String or Buffer.\n\n## Convenience methods\n\nThere are also shorthand methods for different HTTP METHODs and some other conveniences.\n\n### request.defaults(options)\n\nThis method returns a wrapper around the normal request API that defaults to whatever options you pass in to it.\n\n### request.put\n\nSame as request() but defaults to `method: \"PUT\"`.\n\n```javascript\nrequest.put(url)\n```\n\n### request.patch\n\nSame as request() but defaults to `method: \"PATCH\"`.\n\n```javascript\nrequest.patch(url)\n```\n\n### request.post\n\nSame as request() but defaults to `method: \"POST\"`.\n\n```javascript\nrequest.post(url)\n```\n\n### request.head\n\nSame as request() but defaults to `method: \"HEAD\"`.\n\n```javascript\nrequest.head(url)\n```\n\n### request.del\n\nSame as request() but defaults to `method: \"DELETE\"`.\n\n```javascript\nrequest.del(url)\n```\n\n### request.get\n\nAlias to normal request method for uniformity.\n\n```javascript\nrequest.get(url)\n```\n### request.cookie\n\nFunction that creates a new cookie.\n\n```javascript\nrequest.cookie('cookie_string_here')\n```\n### request.jar\n\nFunction that creates a new cookie jar.\n\n```javascript\nrequest.jar()\n```\n\n\n## Examples:\n\n```javascript\n var request = require('request')\n , rand = Math.floor(Math.random()*100000000).toString()\n ;\n request(\n { method: 'PUT'\n , uri: 'http://mikeal.iriscouch.com/testjs/' + rand\n , multipart:\n [ { 'content-type': 'application/json'\n , body: JSON.stringify({foo: 'bar', _attachments: {'message.txt': {follows: true, length: 18, 'content_type': 'text/plain' }}})\n }\n , { body: 'I am an attachment' }\n ]\n }\n , function (error, response, body) {\n if(response.statusCode == 201){\n console.log('document saved as: http://mikeal.iriscouch.com/testjs/'+ rand)\n } else {\n console.log('error: '+ response.statusCode)\n console.log(body)\n }\n }\n )\n```\nCookies are disabled by default (else, they would be used in subsequent requests). To enable cookies set jar to true (either in defaults or in the options sent).\n\n```javascript\nvar request = request.defaults({jar: true})\nrequest('http://www.google.com', function () {\n request('http://images.google.com')\n})\n```\n\nIf you to use a custom cookie jar (instead of letting request use its own global cookie jar) you do so by setting the jar default or by specifying it as an option:\n\n```javascript\nvar j = request.jar()\nvar request = request.defaults({jar:j})\nrequest('http://www.google.com', function () {\n request('http://images.google.com')\n})\n```\nOR\n\n```javascript\nvar j = request.jar()\nvar cookie = request.cookie('your_cookie_here')\nj.add(cookie)\nrequest({url: 'http://www.google.com', jar: j}, function () {\n request('http://images.google.com')\n})\n```\n", - "readmeFilename": "README.md", - "_id": "request@2.27.0", - "_from": "request@2.27.x" -} diff --git a/src/extensibility/node/node_modules/request/request.js b/src/extensibility/node/node_modules/request/request.js deleted file mode 100644 index 0311f743dd4..00000000000 --- a/src/extensibility/node/node_modules/request/request.js +++ /dev/null @@ -1,1235 +0,0 @@ -var http = require('http') - , https = false - , tls = false - , url = require('url') - , util = require('util') - , stream = require('stream') - , qs = require('qs') - , querystring = require('querystring') - , crypto = require('crypto') - - , oauth = require('oauth-sign') - , hawk = require('hawk') - , aws = require('aws-sign') - , httpSignature = require('http-signature') - , uuid = require('node-uuid') - , mime = require('mime') - , tunnel = require('tunnel-agent') - , _safeStringify = require('json-stringify-safe') - - , ForeverAgent = require('forever-agent') - , FormData = require('form-data') - - , Cookie = require('cookie-jar') - , CookieJar = Cookie.Jar - , cookieJar = new CookieJar - - , copy = require('./lib/copy') - , debug = require('./lib/debug') - , getSafe = require('./lib/getSafe') - ; - -function safeStringify (obj) { - var ret - try { ret = JSON.stringify(obj) } - catch (e) { ret = _safeStringify(obj) } - return ret -} - -var globalPool = {} -var isUrl = /^https?:/i - -try { - https = require('https') -} catch (e) {} - -try { - tls = require('tls') -} catch (e) {} - - - -// Hacky fix for pre-0.4.4 https -if (https && !https.Agent) { - https.Agent = function (options) { - http.Agent.call(this, options) - } - util.inherits(https.Agent, http.Agent) - https.Agent.prototype._getConnection = function (host, port, cb) { - var s = tls.connect(port, host, this.options, function () { - // do other checks here? - if (cb) cb() - }) - return s - } -} - -function isReadStream (rs) { - if (rs.readable && rs.path && rs.mode) { - return true - } -} - -function toBase64 (str) { - return (new Buffer(str || "", "ascii")).toString("base64") -} - -function md5 (str) { - return crypto.createHash('md5').update(str).digest('hex') -} - -function Request (options) { - stream.Stream.call(this) - this.readable = true - this.writable = true - - if (typeof options === 'string') { - options = {uri:options} - } - - var reserved = Object.keys(Request.prototype) - for (var i in options) { - if (reserved.indexOf(i) === -1) { - this[i] = options[i] - } else { - if (typeof options[i] === 'function') { - delete options[i] - } - } - } - - if (options.method) { - this.explicitMethod = true - } - - this.init(options) -} -util.inherits(Request, stream.Stream) -Request.prototype.init = function (options) { - // init() contains all the code to setup the request object. - // the actual outgoing request is not started until start() is called - // this function is called from both the constructor and on redirect. - var self = this - if (!options) options = {} - - if (!self.method) self.method = options.method || 'GET' - self.localAddress = options.localAddress - - debug(options) - if (!self.pool && self.pool !== false) self.pool = globalPool - self.dests = self.dests || [] - self.__isRequestRequest = true - - // Protect against double callback - if (!self._callback && self.callback) { - self._callback = self.callback - self.callback = function () { - if (self._callbackCalled) return // Print a warning maybe? - self._callbackCalled = true - self._callback.apply(self, arguments) - } - self.on('error', self.callback.bind()) - self.on('complete', self.callback.bind(self, null)) - } - - if (self.url && !self.uri) { - // People use this property instead all the time so why not just support it. - self.uri = self.url - delete self.url - } - - if (!self.uri) { - // this will throw if unhandled but is handleable when in a redirect - return self.emit('error', new Error("options.uri is a required argument")) - } else { - if (typeof self.uri == "string") self.uri = url.parse(self.uri) - } - - if (self.strictSSL === false) { - self.rejectUnauthorized = false - } - - if (self.proxy) { - if (typeof self.proxy == 'string') self.proxy = url.parse(self.proxy) - - // do the HTTP CONNECT dance using koichik/node-tunnel - if (http.globalAgent && self.uri.protocol === "https:") { - var tunnelFn = self.proxy.protocol === "http:" - ? tunnel.httpsOverHttp : tunnel.httpsOverHttps - - var tunnelOptions = { proxy: { host: self.proxy.hostname - , port: +self.proxy.port - , proxyAuth: self.proxy.auth - , headers: { Host: self.uri.hostname + ':' + - (self.uri.port || self.uri.protocol === 'https:' ? 443 : 80) }} - , rejectUnauthorized: self.rejectUnauthorized - , ca: this.ca } - - self.agent = tunnelFn(tunnelOptions) - self.tunnel = true - } - } - - if (!self.uri.pathname) {self.uri.pathname = '/'} - - if (!self.uri.host) { - // Invalid URI: it may generate lot of bad errors, like "TypeError: Cannot call method 'indexOf' of undefined" in CookieJar - // Detect and reject it as soon as possible - var faultyUri = url.format(self.uri) - var message = 'Invalid URI "' + faultyUri + '"' - if (Object.keys(options).length === 0) { - // No option ? This can be the sign of a redirect - // As this is a case where the user cannot do anything (he didn't call request directly with this URL) - // he should be warned that it can be caused by a redirection (can save some hair) - message += '. This can be caused by a crappy redirection.' - } - self.emit('error', new Error(message)) - return // This error was fatal - } - - self._redirectsFollowed = self._redirectsFollowed || 0 - self.maxRedirects = (self.maxRedirects !== undefined) ? self.maxRedirects : 10 - self.followRedirect = (self.followRedirect !== undefined) ? self.followRedirect : true - self.followAllRedirects = (self.followAllRedirects !== undefined) ? self.followAllRedirects : false - if (self.followRedirect || self.followAllRedirects) - self.redirects = self.redirects || [] - - self.headers = self.headers ? copy(self.headers) : {} - - self.setHost = false - if (!self.hasHeader('host')) { - self.setHeader('host', self.uri.hostname) - if (self.uri.port) { - if ( !(self.uri.port === 80 && self.uri.protocol === 'http:') && - !(self.uri.port === 443 && self.uri.protocol === 'https:') ) - self.setHeader('host', self.getHeader('host') + (':'+self.uri.port) ) - } - self.setHost = true - } - - self.jar(self._jar || options.jar) - - if (!self.uri.port) { - if (self.uri.protocol == 'http:') {self.uri.port = 80} - else if (self.uri.protocol == 'https:') {self.uri.port = 443} - } - - if (self.proxy && !self.tunnel) { - self.port = self.proxy.port - self.host = self.proxy.hostname - } else { - self.port = self.uri.port - self.host = self.uri.hostname - } - - self.clientErrorHandler = function (error) { - if (self._aborted) return - - if (self.req && self.req._reusedSocket && error.code === 'ECONNRESET' - && self.agent.addRequestNoreuse) { - self.agent = { addRequest: self.agent.addRequestNoreuse.bind(self.agent) } - self.start() - self.req.end() - return - } - if (self.timeout && self.timeoutTimer) { - clearTimeout(self.timeoutTimer) - self.timeoutTimer = null - } - self.emit('error', error) - } - - self._parserErrorHandler = function (error) { - if (this.res) { - if (this.res.request) { - this.res.request.emit('error', error) - } else { - this.res.emit('error', error) - } - } else { - this._httpMessage.emit('error', error) - } - } - - if (options.form) { - self.form(options.form) - } - - if (options.qs) self.qs(options.qs) - - if (self.uri.path) { - self.path = self.uri.path - } else { - self.path = self.uri.pathname + (self.uri.search || "") - } - - if (self.path.length === 0) self.path = '/' - - - // Auth must happen last in case signing is dependent on other headers - if (options.oauth) { - self.oauth(options.oauth) - } - - if (options.aws) { - self.aws(options.aws) - } - - if (options.hawk) { - self.hawk(options.hawk) - } - - if (options.httpSignature) { - self.httpSignature(options.httpSignature) - } - - if (options.auth) { - self.auth( - (options.auth.user==="") ? options.auth.user : (options.auth.user || options.auth.username ), - options.auth.pass || options.auth.password, - options.auth.sendImmediately) - } - - if (self.uri.auth && !self.hasHeader('authorization')) { - var authPieces = self.uri.auth.split(':').map(function(item){ return querystring.unescape(item) }) - self.auth(authPieces[0], authPieces.slice(1).join(':'), true) - } - if (self.proxy && self.proxy.auth && !self.hasHeader('proxy-authorization') && !self.tunnel) { - self.setHeader('proxy-authorization', "Basic " + toBase64(self.proxy.auth.split(':').map(function(item){ return querystring.unescape(item)}).join(':'))) - } - - - if (self.proxy && !self.tunnel) self.path = (self.uri.protocol + '//' + self.uri.host + self.path) - - if (options.json) { - self.json(options.json) - } else if (options.multipart) { - self.boundary = uuid() - self.multipart(options.multipart) - } - - if (self.body) { - var length = 0 - if (!Buffer.isBuffer(self.body)) { - if (Array.isArray(self.body)) { - for (var i = 0; i < self.body.length; i++) { - length += self.body[i].length - } - } else { - self.body = new Buffer(self.body) - length = self.body.length - } - } else { - length = self.body.length - } - if (length) { - if (!self.hasHeader('content-length')) self.setHeader('content-length', length) - } else { - throw new Error('Argument error, options.body.') - } - } - - var protocol = self.proxy && !self.tunnel ? self.proxy.protocol : self.uri.protocol - , defaultModules = {'http:':http, 'https:':https} - , httpModules = self.httpModules || {} - ; - self.httpModule = httpModules[protocol] || defaultModules[protocol] - - if (!self.httpModule) return this.emit('error', new Error("Invalid protocol")) - - if (options.ca) self.ca = options.ca - - if (!self.agent) { - if (options.agentOptions) self.agentOptions = options.agentOptions - - if (options.agentClass) { - self.agentClass = options.agentClass - } else if (options.forever) { - self.agentClass = protocol === 'http:' ? ForeverAgent : ForeverAgent.SSL - } else { - self.agentClass = self.httpModule.Agent - } - } - - if (self.pool === false) { - self.agent = false - } else { - self.agent = self.agent || self.getAgent() - if (self.maxSockets) { - // Don't use our pooling if node has the refactored client - self.agent.maxSockets = self.maxSockets - } - if (self.pool.maxSockets) { - // Don't use our pooling if node has the refactored client - self.agent.maxSockets = self.pool.maxSockets - } - } - - self.on('pipe', function (src) { - if (self.ntick && self._started) throw new Error("You cannot pipe to this stream after the outbound request has started.") - self.src = src - if (isReadStream(src)) { - if (!self.hasHeader('content-type')) self.setHeader('content-type', mime.lookup(src.path)) - } else { - if (src.headers) { - for (var i in src.headers) { - if (!self.hasHeader(i)) { - self.setHeader(i, src.headers[i]) - } - } - } - if (self._json && !self.hasHeader('content-type')) - self.setHeader('content-type', 'application/json') - if (src.method && !self.explicitMethod) { - self.method = src.method - } - } - - // self.on('pipe', function () { - // console.error("You have already piped to this stream. Pipeing twice is likely to break the request.") - // }) - }) - - process.nextTick(function () { - if (self._aborted) return - - if (self._form) { - self.setHeaders(self._form.getHeaders()) - self._form.pipe(self) - } - if (self.body) { - if (Array.isArray(self.body)) { - self.body.forEach(function (part) { - self.write(part) - }) - } else { - self.write(self.body) - } - self.end() - } else if (self.requestBodyStream) { - console.warn("options.requestBodyStream is deprecated, please pass the request object to stream.pipe.") - self.requestBodyStream.pipe(self) - } else if (!self.src) { - if (self.method !== 'GET' && typeof self.method !== 'undefined') { - self.setHeader('content-length', 0) - } - self.end() - } - self.ntick = true - }) -} - -// Must call this when following a redirect from https to http or vice versa -// Attempts to keep everything as identical as possible, but update the -// httpModule, Tunneling agent, and/or Forever Agent in use. -Request.prototype._updateProtocol = function () { - var self = this - var protocol = self.uri.protocol - - if (protocol === 'https:') { - // previously was doing http, now doing https - // if it's https, then we might need to tunnel now. - if (self.proxy) { - self.tunnel = true - var tunnelFn = self.proxy.protocol === 'http:' - ? tunnel.httpsOverHttp : tunnel.httpsOverHttps - var tunnelOptions = { proxy: { host: self.proxy.hostname - , port: +self.proxy.port - , proxyAuth: self.proxy.auth } - , rejectUnauthorized: self.rejectUnauthorized - , ca: self.ca } - self.agent = tunnelFn(tunnelOptions) - return - } - - self.httpModule = https - switch (self.agentClass) { - case ForeverAgent: - self.agentClass = ForeverAgent.SSL - break - case http.Agent: - self.agentClass = https.Agent - break - default: - // nothing we can do. Just hope for the best. - return - } - - // if there's an agent, we need to get a new one. - if (self.agent) self.agent = self.getAgent() - - } else { - // previously was doing https, now doing http - // stop any tunneling. - if (self.tunnel) self.tunnel = false - self.httpModule = http - switch (self.agentClass) { - case ForeverAgent.SSL: - self.agentClass = ForeverAgent - break - case https.Agent: - self.agentClass = http.Agent - break - default: - // nothing we can do. just hope for the best - return - } - - // if there's an agent, then get a new one. - if (self.agent) { - self.agent = null - self.agent = self.getAgent() - } - } -} - -Request.prototype.getAgent = function () { - var Agent = this.agentClass - var options = {} - if (this.agentOptions) { - for (var i in this.agentOptions) { - options[i] = this.agentOptions[i] - } - } - if (this.ca) options.ca = this.ca - if (typeof this.rejectUnauthorized !== 'undefined') options.rejectUnauthorized = this.rejectUnauthorized - - if (this.cert && this.key) { - options.key = this.key - options.cert = this.cert - } - - var poolKey = '' - - // different types of agents are in different pools - if (Agent !== this.httpModule.Agent) { - poolKey += Agent.name - } - - if (!this.httpModule.globalAgent) { - // node 0.4.x - options.host = this.host - options.port = this.port - if (poolKey) poolKey += ':' - poolKey += this.host + ':' + this.port - } - - // ca option is only relevant if proxy or destination are https - var proxy = this.proxy - if (typeof proxy === 'string') proxy = url.parse(proxy) - var isHttps = (proxy && proxy.protocol === 'https:') || this.uri.protocol === 'https:' - if (isHttps) { - if (options.ca) { - if (poolKey) poolKey += ':' - poolKey += options.ca - } - - if (typeof options.rejectUnauthorized !== 'undefined') { - if (poolKey) poolKey += ':' - poolKey += options.rejectUnauthorized - } - - if (options.cert) - poolKey += options.cert.toString('ascii') + options.key.toString('ascii') - - if (options.ciphers) { - if (poolKey) poolKey += ':' - poolKey += options.ciphers - } - - if (options.secureOptions) { - if (poolKey) poolKey += ':' - poolKey += options.secureOptions - } - } - - if (this.pool === globalPool && !poolKey && Object.keys(options).length === 0 && this.httpModule.globalAgent) { - // not doing anything special. Use the globalAgent - return this.httpModule.globalAgent - } - - // we're using a stored agent. Make sure it's protocol-specific - poolKey = this.uri.protocol + poolKey - - // already generated an agent for this setting - if (this.pool[poolKey]) return this.pool[poolKey] - - return this.pool[poolKey] = new Agent(options) -} - -Request.prototype.start = function () { - // start() is called once we are ready to send the outgoing HTTP request. - // this is usually called on the first write(), end() or on nextTick() - var self = this - - if (self._aborted) return - - self._started = true - self.method = self.method || 'GET' - self.href = self.uri.href - - if (self.src && self.src.stat && self.src.stat.size && !self.hasHeader('content-length')) { - self.setHeader('content-length', self.src.stat.size) - } - if (self._aws) { - self.aws(self._aws, true) - } - - // We have a method named auth, which is completely different from the http.request - // auth option. If we don't remove it, we're gonna have a bad time. - var reqOptions = copy(self) - delete reqOptions.auth - - debug('make request', self.uri.href) - self.req = self.httpModule.request(reqOptions, self.onResponse.bind(self)) - - if (self.timeout && !self.timeoutTimer) { - self.timeoutTimer = setTimeout(function () { - self.req.abort() - var e = new Error("ETIMEDOUT") - e.code = "ETIMEDOUT" - self.emit("error", e) - }, self.timeout) - - // Set additional timeout on socket - in case if remote - // server freeze after sending headers - if (self.req.setTimeout) { // only works on node 0.6+ - self.req.setTimeout(self.timeout, function () { - if (self.req) { - self.req.abort() - var e = new Error("ESOCKETTIMEDOUT") - e.code = "ESOCKETTIMEDOUT" - self.emit("error", e) - } - }) - } - } - - self.req.on('error', self.clientErrorHandler) - self.req.on('drain', function() { - self.emit('drain') - }) - self.on('end', function() { - if ( self.req.connection ) self.req.connection.removeListener('error', self._parserErrorHandler) - }) - self.emit('request', self.req) -} -Request.prototype.onResponse = function (response) { - var self = this - debug('onResponse', self.uri.href, response.statusCode, response.headers) - response.on('end', function() { - debug('response end', self.uri.href, response.statusCode, response.headers) - }); - - if (response.connection.listeners('error').indexOf(self._parserErrorHandler) === -1) { - response.connection.once('error', self._parserErrorHandler) - } - if (self._aborted) { - debug('aborted', self.uri.href) - response.resume() - return - } - if (self._paused) response.pause() - else response.resume() - - self.response = response - response.request = self - response.toJSON = toJSON - - // XXX This is different on 0.10, because SSL is strict by default - if (self.httpModule === https && - self.strictSSL && - !response.client.authorized) { - debug('strict ssl error', self.uri.href) - var sslErr = response.client.authorizationError - self.emit('error', new Error('SSL Error: '+ sslErr)) - return - } - - if (self.setHost && self.hasHeader('host')) delete self.headers[self.hasHeader('host')] - if (self.timeout && self.timeoutTimer) { - clearTimeout(self.timeoutTimer) - self.timeoutTimer = null - } - - var addCookie = function (cookie) { - if (self._jar){ - if(self._jar.add){ - self._jar.add(new Cookie(cookie)) - } - else cookieJar.add(new Cookie(cookie)) - } - - } - - if (hasHeader('set-cookie', response.headers) && (!self._disableCookies)) { - var headerName = hasHeader('set-cookie', response.headers) - if (Array.isArray(response.headers[headerName])) response.headers[headerName].forEach(addCookie) - else addCookie(response.headers[headerName]) - } - - var redirectTo = null - if (response.statusCode >= 300 && response.statusCode < 400 && hasHeader('location', response.headers)) { - var location = response.headers[hasHeader('location', response.headers)] - debug('redirect', location) - - if (self.followAllRedirects) { - redirectTo = location - } else if (self.followRedirect) { - switch (self.method) { - case 'PATCH': - case 'PUT': - case 'POST': - case 'DELETE': - // Do not follow redirects - break - default: - redirectTo = location - break - } - } - } else if (response.statusCode == 401 && self._hasAuth && !self._sentAuth) { - var authHeader = response.headers[hasHeader('www-authenticate', response.headers)] - var authVerb = authHeader && authHeader.split(' ')[0] - debug('reauth', authVerb) - - switch (authVerb) { - case 'Basic': - self.auth(self._user, self._pass, true) - redirectTo = self.uri - break - - case 'Digest': - // TODO: More complete implementation of RFC 2617. For reference: - // http://tools.ietf.org/html/rfc2617#section-3 - // https://github.com/bagder/curl/blob/master/lib/http_digest.c - - var matches = authHeader.match(/([a-z0-9_-]+)="([^"]+)"/gi) - var challenge = {} - - for (var i = 0; i < matches.length; i++) { - var eqPos = matches[i].indexOf('=') - var key = matches[i].substring(0, eqPos) - var quotedValue = matches[i].substring(eqPos + 1) - challenge[key] = quotedValue.substring(1, quotedValue.length - 1) - } - - var ha1 = md5(self._user + ':' + challenge.realm + ':' + self._pass) - var ha2 = md5(self.method + ':' + self.uri.path) - var digestResponse = md5(ha1 + ':' + challenge.nonce + ':1::auth:' + ha2) - var authValues = { - username: self._user, - realm: challenge.realm, - nonce: challenge.nonce, - uri: self.uri.path, - qop: challenge.qop, - response: digestResponse, - nc: 1, - cnonce: '' - } - - authHeader = [] - for (var k in authValues) { - authHeader.push(k + '="' + authValues[k] + '"') - } - authHeader = 'Digest ' + authHeader.join(', ') - self.setHeader('authorization', authHeader) - self._sentAuth = true - - redirectTo = self.uri - break - } - } - - if (redirectTo) { - debug('redirect to', redirectTo) - - // ignore any potential response body. it cannot possibly be useful - // to us at this point. - if (self._paused) response.resume() - - if (self._redirectsFollowed >= self.maxRedirects) { - self.emit('error', new Error("Exceeded maxRedirects. Probably stuck in a redirect loop "+self.uri.href)) - return - } - self._redirectsFollowed += 1 - - if (!isUrl.test(redirectTo)) { - redirectTo = url.resolve(self.uri.href, redirectTo) - } - - var uriPrev = self.uri - self.uri = url.parse(redirectTo) - - // handle the case where we change protocol from https to http or vice versa - if (self.uri.protocol !== uriPrev.protocol) { - self._updateProtocol() - } - - self.redirects.push( - { statusCode : response.statusCode - , redirectUri: redirectTo - } - ) - if (self.followAllRedirects && response.statusCode != 401) self.method = 'GET' - // self.method = 'GET' // Force all redirects to use GET || commented out fixes #215 - delete self.src - delete self.req - delete self.agent - delete self._started - if (response.statusCode != 401) { - // Remove parameters from the previous response, unless this is the second request - // for a server that requires digest authentication. - delete self.body - delete self._form - if (self.headers) { - if (self.hasHeader('host')) delete self.headers[self.hasHeader('host')] - if (self.hasHeader('content-type')) delete self.headers[self.hasHeader('content-type')] - if (self.hasHeader('content-length')) delete self.headers[self.hasHeader('content-length')] - } - } - - self.emit('redirect'); - - self.init() - return // Ignore the rest of the response - } else { - self._redirectsFollowed = self._redirectsFollowed || 0 - // Be a good stream and emit end when the response is finished. - // Hack to emit end on close because of a core bug that never fires end - response.on('close', function () { - if (!self._ended) self.response.emit('end') - }) - - if (self.encoding) { - if (self.dests.length !== 0) { - console.error("Ignoring encoding parameter as this stream is being piped to another stream which makes the encoding option invalid.") - } else { - response.setEncoding(self.encoding) - } - } - - self.emit('response', response) - - self.dests.forEach(function (dest) { - self.pipeDest(dest) - }) - - response.on("data", function (chunk) { - self._destdata = true - self.emit("data", chunk) - }) - response.on("end", function (chunk) { - self._ended = true - self.emit("end", chunk) - }) - response.on("close", function () {self.emit("close")}) - - if (self.callback) { - var buffer = [] - var bodyLen = 0 - self.on("data", function (chunk) { - buffer.push(chunk) - bodyLen += chunk.length - }) - self.on("end", function () { - debug('end event', self.uri.href) - if (self._aborted) { - debug('aborted', self.uri.href) - return - } - - if (buffer.length && Buffer.isBuffer(buffer[0])) { - debug('has body', self.uri.href, bodyLen) - var body = new Buffer(bodyLen) - var i = 0 - buffer.forEach(function (chunk) { - chunk.copy(body, i, 0, chunk.length) - i += chunk.length - }) - if (self.encoding === null) { - response.body = body - } else { - response.body = body.toString(self.encoding) - } - } else if (buffer.length) { - // The UTF8 BOM [0xEF,0xBB,0xBF] is converted to [0xFE,0xFF] in the JS UTC16/UCS2 representation. - // Strip this value out when the encoding is set to 'utf8', as upstream consumers won't expect it and it breaks JSON.parse(). - if (self.encoding === 'utf8' && buffer[0].length > 0 && buffer[0][0] === "\uFEFF") { - buffer[0] = buffer[0].substring(1) - } - response.body = buffer.join('') - } - - if (self._json) { - try { - response.body = JSON.parse(response.body) - } catch (e) {} - } - debug('emitting complete', self.uri.href) - if(response.body == undefined && !self._json) { - response.body = ""; - } - self.emit('complete', response, response.body) - }) - } - //if no callback - else{ - self.on("end", function () { - if (self._aborted) { - debug('aborted', self.uri.href) - return - } - self.emit('complete', response); - }); - } - } - debug('finish init function', self.uri.href) -} - -Request.prototype.abort = function () { - this._aborted = true - - if (this.req) { - this.req.abort() - } - else if (this.response) { - this.response.abort() - } - - this.emit("abort") -} - -Request.prototype.pipeDest = function (dest) { - var response = this.response - // Called after the response is received - if (dest.headers && !dest.headersSent) { - if (hasHeader('content-type', response.headers)) { - var ctname = hasHeader('content-type', response.headers) - if (dest.setHeader) dest.setHeader(ctname, response.headers[ctname]) - else dest.headers[ctname] = response.headers[ctname] - } - - if (hasHeader('content-length', response.headers)) { - var clname = hasHeader('content-length', response.headers) - if (dest.setHeader) dest.setHeader(clname, response.headers[clname]) - else dest.headers[clname] = response.headers[clname] - } - } - if (dest.setHeader && !dest.headersSent) { - for (var i in response.headers) { - dest.setHeader(i, response.headers[i]) - } - dest.statusCode = response.statusCode - } - if (this.pipefilter) this.pipefilter(response, dest) -} - -// Composable API -Request.prototype.setHeader = function (name, value, clobber) { - if (clobber === undefined) clobber = true - if (clobber || !this.hasHeader(name)) this.headers[name] = value - else this.headers[this.hasHeader(name)] += ',' + value - return this -} -Request.prototype.setHeaders = function (headers) { - for (var i in headers) {this.setHeader(i, headers[i])} - return this -} -Request.prototype.hasHeader = function (header, headers) { - var headers = Object.keys(headers || this.headers) - , lheaders = headers.map(function (h) {return h.toLowerCase()}) - ; - header = header.toLowerCase() - for (var i=0;i - -Installation ------------- - -`npm install rewire` - -
    - -Examples --------- - -Imagine you want to test this module: - -```javascript -// lib/myModule.js - -// With rewire you can change all these variables -var fs = require("fs"), - http = require("http"), - someOtherVar = "hi", - myPrivateVar = 1; - -function readSomethingFromFileSystem(cb) { - // But no scoped variables - var path = "/somewhere/on/the/disk"; - - console.log("Reading from file system ..."); - fs.readFile(path, "utf8", cb); -} - -exports.readSomethingFromFileSystem = readSomethingFromFileSystem; -``` - -Now within your test module: - -```javascript -// test/myModule.test.js - -var rewire = require("rewire"); - -// rewire acts exactly like require. -var myModule = rewire("../lib/myModule.js"); - -// Just with one difference: -// Your module will now export a special setter and getter for private variables. -myModule.__set__("myPrivateVar", 123); -myModule.__get__("myPrivateVar"); // = 123 - -// This allows you to mock almost everything within the module e.g. the fs-module. -// Just pass the variable name as first parameter and your mock as second. -myModule.__set__("fs", { - readFile: function (path, encoding, cb) { - cb(null, "Success!"); - } -}); -myModule.readSomethingFromFileSystem(function (err, data) { - console.log(data); // = Success! -}); - -// You can set different variables with one call. -myModule.__set__({ - fs: fsMock, - http: httpMock, - someOtherVar: "hello" -}); - -// You may also override globals. These changes are only within the module, so -// you don't have to be concerned that other modules are influenced by your mock. -myModule.__set__({ - console: { - log: function () { /* be quiet */ } - }, - process: { - argv: ["testArg1", "testArg2"] - } -}); - -// But be careful, if you do something like this you'll change your global -// console instance. -myModule.__set__("console.log", function () { /* be quiet */ }); - -// There is another difference to require: -// Every call of rewire() returns a new instance. -rewire("./myModule.js") === rewire("./myModule.js"); // = false -``` - -
    - -##API - -###rewire(filename): rewiredModule - -- *filename*:
    -Path to the module that shall be rewired. Use it exactly like require(). - -###rewiredModule.__set__(name, value) - -- *name*:
    -Name of the variable to set. The variable should be global or defined with `var` in the top-leve scope of the module. -- *value*:
    -The value to set. - -###rewiredModule.__set__(env) -- *env*:
    -Takes all keys as variable names and sets the values respectively. - -###rewiredModule.__get__(name): value - -Returns the private variable. - -
    - -##Client-Side Bundlers - -###webpack -See [rewire-webpack](https://github.com/jhnns/rewire-webpack) - -###browserify -rewire currently only supports browserify@1.x. I'm not planing to continue development, but if you're relying on this feature [please let me know](https://github.com/jhnns/rewire/issues/13). - -
    - -##License - -MIT diff --git a/src/extensibility/node/node_modules/rewire/lib/__get__.js b/src/extensibility/node/node_modules/rewire/lib/__get__.js deleted file mode 100644 index cb6fe689915..00000000000 --- a/src/extensibility/node/node_modules/rewire/lib/__get__.js +++ /dev/null @@ -1,21 +0,0 @@ -/** - * This function will be stringified and then injected into every rewired module. - * Then you can leak private variables by calling myModule.__get__("myPrivateVar"); - * - * All variables within this function are namespaced in the arguments array because every - * var declaration could possibly clash with a variable in the module scope. - * - * @param {!String} name name of the variable to retrieve - * @throws {TypeError} - * @return {*} - */ -function __get__() { - arguments.varName = arguments[0]; - if (arguments.varName && typeof arguments.varName === "string") { - return eval(arguments.varName); - } else { - throw new TypeError("__get__ expects a non-empty string"); - } -} - -module.exports = __get__; \ No newline at end of file diff --git a/src/extensibility/node/node_modules/rewire/lib/__set__.js b/src/extensibility/node/node_modules/rewire/lib/__set__.js deleted file mode 100644 index 66e8c0a5a65..00000000000 --- a/src/extensibility/node/node_modules/rewire/lib/__set__.js +++ /dev/null @@ -1,42 +0,0 @@ -/** - * This function will be stringified and then injected into every rewired module. - * Then you can set private variables by calling myModule.__set__("myPrivateVar", newValue); - * - * All variables within this function are namespaced in the arguments array because every - * var declaration could possibly clash with a variable in the module scope. - * - * @param {!String|!Object} varName name of the variable to set - * @param {String} varValue new value - * @throws {TypeError} - * @throws {ReferenceError} When the variable is unknown - * @return {*} - */ -function __set__() { - arguments.varName = arguments[0]; - arguments.varValue = arguments[1]; - arguments.src = ""; - - if (typeof arguments[0] === "object" && arguments.length === 1) { - arguments.env = arguments.varName; - if (!arguments.env || Array.isArray(arguments.env)) { - throw new TypeError("__set__ expects an object as env"); - } - for (arguments.varName in arguments.env) { - if (arguments.env.hasOwnProperty(arguments.varName)) { - arguments.varValue = arguments.env[arguments.varName]; - arguments.src += arguments.varName + " = arguments.env." + arguments.varName + "; "; - } - } - } else if (typeof arguments.varName === "string" && arguments.length === 2) { - if (!arguments.varName) { - throw new TypeError("__set__ expects a non-empty string as a variable name"); - } - arguments.src = arguments.varName + " = arguments.varValue;"; - } else { - throw new TypeError("__set__ expects an environment object or a non-empty string as a variable name"); - } - - eval(arguments.src); -} - -module.exports = __set__; \ No newline at end of file diff --git a/src/extensibility/node/node_modules/rewire/lib/bundlers/browserify/browserifyMiddleware.js b/src/extensibility/node/node_modules/rewire/lib/bundlers/browserify/browserifyMiddleware.js deleted file mode 100644 index a161369ab90..00000000000 --- a/src/extensibility/node/node_modules/rewire/lib/bundlers/browserify/browserifyMiddleware.js +++ /dev/null @@ -1,113 +0,0 @@ -var setterSrc = require("../../__set__.js").toString(), - getterSrc = require("../../__get__.js").toString(), - path = require("path"), - injectRewire = require("../injectRewire.js"), - getRewireRequires = require("../getRewireRequires.js"), - - rewireIndex = path.resolve(__dirname, "../../index.js"), - rewireLib = path.join("rewire", "lib"), - settersAndGettersSrc; - -/** - * This function can be added to browserify via b.use(). - * @see https://github.com/substack/node-browserify/blob/master/doc/methods.markdown#methods - * - * It injects special code before every module in order to gain access to the private scope - * of the module. Additionally it forwards all calls of require("rewire") to the module - * browserifyRewire.js. Thus we don't need any cumbersome client/server-switches in the index.js. - * - * @param {browserify} b the bundle returned by browserify() - * @return {browserify} b - */ -function browserifyMiddleware(b) { - - console.log("(DEPRECATED) rewire won't support browserify anymore. Please let me know if you're relying on this feature (https://github.com/jhnns/rewire/issues/13)"); - - /** - * Does actually the injecting of the special code. It is called by browserify for every - * js-module. - * - * @param {String} src - * @param {String} filename - * @return {String} src - */ - function doInjectRewire(src, filename) { - var rewireRequires; - - // We don't want to inject this code at the beginning of a rewire/lib-module. Otherwise - // it would cause a black hole that devours our universe. - if (filename.indexOf(rewireLib) === -1) { - // Search for all rewire() statements an return the required path. - rewireRequires = getRewireRequires(src); - - // Add all modules that are loaded by rewire() manually to browserify because browserify's - // require-sniffing doesn't work here. - rewireRequires.forEach(function forEachRewireRequire(requirePath) { - - // Resolve to absolute paths - if (requirePath.charAt(0) === ".") { - requirePath = path.resolve(path.dirname(filename), requirePath); - } - b.require(requirePath); - - }); - - // Injects the special code - src = injectRewire(src, settersAndGettersSrc); - - // Because browserify doesn't create a new, independent module instance each time the module is - // executed we have to make it fake-independent. Thus the rewired module doesn't influence the original module. - // This is a crazy hack, but: hey don't blame me! Make a pull-request to browserify :) - src += ' module = require("rewire").getIndependentModule(module);'; - } - - return src; - } - - /** - * Gets called before each module is loaded. - * This function ensures that lib/bundlers/browserify/browserifyRewire.js is returned instead of lib/index.js - * - * @param {String} filename - * @return {String} filename - */ - function forwardBrowserifyRewire(filename) { - if (filename === rewireIndex) { - filename = __dirname + "/browserifyRewire.js"; - } - - return filename; - } - - // Register file handler - b.register(".js", doInjectRewire); - b.register("path", forwardBrowserifyRewire); - - return b; -} - -/** - * This string gets injected at the beginning of every module. Its purpose is to - * - register the setters and getters according to the module's filename - * - override the internal require with a require proxy. - * - * @private - * @type {String} - */ -settersAndGettersSrc = ( - 'var rewire = require("rewire"); ' + - - // Registers the setters and getters of every module according to their filename. These setter and getter - // allow us to gain access to the private scope of the module. - 'rewire.register(__filename, module, ' + setterSrc + ', ' + getterSrc + '); ' + - - // Overrides the module internal require with a require proxy. This proxy is necessary to call rewire with the - // module's filename at the first parameter to resolve the path. This way rewire() works exactly like require(). - 'require = rewire.getProxy(require, __dirname); ' + - - // Cleaning up - 'rewire = undefined;' - -).replace(/\s+/g, " "); // strip out unnecessary spaces to be unobtrusive in the debug view - -module.exports = browserifyMiddleware; \ No newline at end of file diff --git a/src/extensibility/node/node_modules/rewire/lib/bundlers/browserify/browserifyRewire.js b/src/extensibility/node/node_modules/rewire/lib/bundlers/browserify/browserifyRewire.js deleted file mode 100644 index b09b51ad460..00000000000 --- a/src/extensibility/node/node_modules/rewire/lib/bundlers/browserify/browserifyRewire.js +++ /dev/null @@ -1,189 +0,0 @@ -var pathUtil = require("path"), - getImportGlobalsSrc = require("./getImportGlobalsSrc.js"); // must be relative to lib/index.js because of forwardBrowserifyRewire() - -/** - * Clones an object deeply. Used to clone the module-object that is - * stored in the cache. Because browserify doesn't create the module- - * object newly if the module is executed again we can't modify the - * exports object directly. Instead of we have to make an independent copy. - * - * @param {!Object} obj - * @return {Object} - */ -function clone(obj) { - var target = {}, - value, - key; - - for (key in obj) { - if (obj.hasOwnProperty(key)) { - value = obj[key]; - if (Array.isArray(value)) { - target[key] = value.slice(0); - } else if (typeof value === "object" && value !== null) { - target[key] = clone(value); - } else { - target[key] = value; - } - - } - } - - return target; -} - -// Saves all setters and getters for every module according to its filename -var registry = {}; - -/** - * Executes the given module and adds a special setter and getter that allow you to set and get private variables. - * The parentModulePath is usually set by the requireProxy. - * - * @param {!String} parentModulePath __filename of the module, that wants to rewire() another module. - * @param {!String} path path to the module that shall be rewired - * @return {Object} the rewired module - */ -function browserifyRewire(parentModulePath, path) { - var cached, - originalModule, - originalExports, - absPath, - rewiredExports = {}, - registryEntry, - _require = require; // hide it from browserify to avoid annoying console warnings - - // Normalize path with file extensions - absPath = pathUtil.resolve(parentModulePath, path); - - // Retrieve original module from cache - cached = originalModule = require.cache[absPath]; - - if (cached) { - // If there is already a module instance in the cache we have to store the original exports-object - // manually so it won't be overwritten by the next execution. This is all necessary due to browserify's - // odd way of module creation. - originalExports = originalModule.exports; - originalModule.exports = rewiredExports; - - // Delete the original module from the cache so the next call to _require() - // executes the module - delete require.cache[absPath]; - } - - // Require module to trigger rewire.register(). - _require(absPath); - - originalModule = require.cache[absPath]; - - // Now we're cloning the exports-obj so later modifications of the rewired module won't influence the - // cached, original version of this module. - rewiredExports = clone(originalModule.exports); - - if (cached) { - // Restore original exports - originalModule.exports = originalExports; - } - - // Get registry entry of the target module - registryEntry = registry[absPath]; - - // Apply setter and getters - rewiredExports.__set__ = registryEntry.setter; - rewiredExports.__get__ = registryEntry.getter; - - return rewiredExports; -} - -/** - * Registers the setter and getter of every module according to its filename - * - * @param {!String} filename the absolute path to the module (module id) - * @param {!Function} setter - * @param {!Function} getter - */ -browserifyRewire.register = function (filename, module, setter, getter) { - registry[filename] = { - module: module, - setter: setter, - getter: getter - }; -}; - -/** - * Provides a special require-proxy. Every module calls require("rewire").getProxy(require, __filename) at the - * beginning and overrides its own require with this proxy. - * - * This is necessary to call rewire() with the original __filename. Thus you can use rewire() like require(). - * - * @param {!Function} internalRequire the module's own require - * @param {String} dirname the __dirname of the module - * @return {Function} requireProxy - */ -browserifyRewire.getProxy = function (internalRequire, dirname) { - var rewire = internalRequire("rewire"), - rewireProxyInit = false; - - function copyProperties(from, to) { - var key; - - for (key in from) { - if (from.hasOwnProperty(key)) { - to[key] = from[key]; - } - } - } - - function rewireProxy(path, cache) { - return rewire(dirname, path, cache); - } - - function requireProxy(path) { - if (path === "rewire") { - if (rewireProxyInit === false) { - copyProperties(rewire, rewireProxy); // lazy copy - rewireProxyInit = true; - } - return rewireProxy; - } else { - return internalRequire(path); - } - } - - copyProperties(internalRequire, requireProxy); - - return requireProxy; -}; - -/** - * Scans for global vars and returns an evalable string that declares all globals as a var. - * This way a global variable can be overridden by __set__ without changing the global instance. - * It is executed each time again to include global variables that have been added later. - * - * @return {String} - */ -browserifyRewire.getImportGlobalsSrc = function () { - return getImportGlobalsSrc(['require','module','exports','__dirname','__filename','process']); -}; - -/** - * Returns a new object that inherits from the original module via prototype inheritance. - * - * Any changes to the module, e.g. assigning another exports-object will now modify the object - * instead of original module. - * - * @param {Object} originalModule - * @return {Object} the independent module - */ -browserifyRewire.getIndependentModule = function (originalModule) { - var independentModule; - - function IndependentModule() {} - IndependentModule.prototype = originalModule; - - independentModule = new IndependentModule(); - independentModule.exports = originalModule.exports; - - return independentModule; -}; - -module.exports = browserifyRewire; \ No newline at end of file diff --git a/src/extensibility/node/node_modules/rewire/lib/bundlers/getRewireRegExp.js b/src/extensibility/node/node_modules/rewire/lib/bundlers/getRewireRegExp.js deleted file mode 100644 index 69e4ef5514b..00000000000 --- a/src/extensibility/node/node_modules/rewire/lib/bundlers/getRewireRegExp.js +++ /dev/null @@ -1,15 +0,0 @@ -/** - * Returns a regular expression that matches all rewire() statements. - * - * Captures: - * - * 1. the character before rewire - * 2. the path between the parenthesis without quotation marks - * - * @return {RegExp} - */ -function getRewireRegExp() { - return /([^a-zA-Z0-9_])rewire\(["'](.+?)["']\)/g; -} - -module.exports = getRewireRegExp; \ No newline at end of file diff --git a/src/extensibility/node/node_modules/rewire/lib/bundlers/getRewireRequires.js b/src/extensibility/node/node_modules/rewire/lib/bundlers/getRewireRequires.js deleted file mode 100644 index 2c800917a0a..00000000000 --- a/src/extensibility/node/node_modules/rewire/lib/bundlers/getRewireRequires.js +++ /dev/null @@ -1,24 +0,0 @@ -var getRewireRegExp = require("./getRewireRegExp.js"); - -/** - * Searches for rewire(); statements and returns all strings that are between the brackets. - * - * @param {!String} src - * @return {Array} - */ -function getRewireRequires(src) { - var result = [], - regExp = getRewireRegExp(), - match; - - src = " " + src; // ensure that rewire() is not at index 0 otherwise the regexp won't work in this case - match = regExp.exec(src); - while (match !== null) { - result.push(match[2]); - match = regExp.exec(src); - } - - return result; -} - -module.exports = getRewireRequires; \ No newline at end of file diff --git a/src/extensibility/node/node_modules/rewire/lib/bundlers/injectRewire.js b/src/extensibility/node/node_modules/rewire/lib/bundlers/injectRewire.js deleted file mode 100644 index 52e37424d27..00000000000 --- a/src/extensibility/node/node_modules/rewire/lib/bundlers/injectRewire.js +++ /dev/null @@ -1,46 +0,0 @@ -"use strict"; // run code in ES5 strict mode - -var path = require("path"), - getRewireRequires = require("./getRewireRequires.js"), - detectStrictMode = require("../detectStrictMode.js"); - -/** - * Gets called by the bundler for every module. Injects special code so rewire is able to access private variables. - * This module doesn't contain bundler specific code. All bundler specific stuff should be done in the settersAndGettersSrc. - * - * @param {!String} src the module's src - * @param {!String} settersAndGettersSrc source that injects the setters and getters into the module scope - * @return {String} - */ -function injectRewire(src, settersAndGettersSrc) { - - src = - // Trying to hide the injected line in the debug view with extra whitespaces. - ' ' + - '/* this line was injected by rewire() */ ' + // Comment for the curious developer - - // Now all global variables are declared with a var statement so they can be changed via __set__() - // without influencing global objects. - 'var global = window; ' + // window is our new global object - 'eval(require("rewire").getImportGlobalsSrc()); ' + - - // The module src is wrapped inside a self-executing function. - // This is necessary to separate the module src from the preceding eval(importGlobalsSrc), - // because the module src can be in strict mode. - // In strict mode eval() can only declare vars in the current scope. In this case our setters - // and getters won't work. - // @see https://developer.mozilla.org/en/JavaScript/Strict_mode#Making_eval_and_arguments_simpler - "(function () { " + - - // If the module uses strict mode we must ensure that "use strict" stays at the beginning of the function. - (detectStrictMode(src)? ' "use strict"; ': ' ') + - - settersAndGettersSrc + "\n" + - src + "\n" + - - " })();"; - - return src; -} - -module.exports = injectRewire; \ No newline at end of file diff --git a/src/extensibility/node/node_modules/rewire/lib/bundlers/webpack/configureWebpack.js b/src/extensibility/node/node_modules/rewire/lib/bundlers/webpack/configureWebpack.js deleted file mode 100644 index 0738e16580e..00000000000 --- a/src/extensibility/node/node_modules/rewire/lib/bundlers/webpack/configureWebpack.js +++ /dev/null @@ -1,26 +0,0 @@ -"use strict"; // run code in ES5 strict mode - -/** - * Configures webpack so it can be used with rewire. Make sure that the options aren't modified - * after calling this function. It's important that the rewire()-postLoader is the last loader called on a module. - * - * @see https://github.com/webpack/webpack - * - * @param {Object} options a webpack option object - */ -function configureWebpack(options) { - console.log("(DEPRECATED) rewire itself doesn't support webpack anymore. Please use rewire-webpack (https://github.com/jhnns/rewire-webpack)"); - - options.resolve = options.resolve || {}; - options.postLoaders = options.postLoaders || []; - options.resolve.postprocess = options.resolve.postprocess || {}; - options.resolve.postprocess.normal = options.resolve.postprocess.normal || []; - - // Registering the postLoader for injecting the special rewire code - options.postLoaders.push(require("./webpackPostLoader.js")); - - // Registering the postProcessor for resolving paths - options.resolve.postprocess.normal.push(require("./webpackPostProcessor.js")); -} - -module.exports = configureWebpack; \ No newline at end of file diff --git a/src/extensibility/node/node_modules/rewire/lib/bundlers/webpack/getLoaderTestRegExp.js b/src/extensibility/node/node_modules/rewire/lib/bundlers/webpack/getLoaderTestRegExp.js deleted file mode 100644 index 40119c2a43e..00000000000 --- a/src/extensibility/node/node_modules/rewire/lib/bundlers/webpack/getLoaderTestRegExp.js +++ /dev/null @@ -1,16 +0,0 @@ -"use strict"; // run code in ES5 strict mode - -var pathUtil = require("path"), - match, - basePath; - - - -match = __dirname.match(/(.*)[\\\/].+[\\\/]rewire[\\\/]lib[\\\/]/); -if (match === null) { - return (/\.js$/); -} else { - basePath = match[1]; - basePath.replace(/([\\\/])/g, "\\$1"); - return new RegExp() -} \ No newline at end of file diff --git a/src/extensibility/node/node_modules/rewire/lib/bundlers/webpack/webpackPostLoader.js b/src/extensibility/node/node_modules/rewire/lib/bundlers/webpack/webpackPostLoader.js deleted file mode 100644 index a381f8dcf30..00000000000 --- a/src/extensibility/node/node_modules/rewire/lib/bundlers/webpack/webpackPostLoader.js +++ /dev/null @@ -1,80 +0,0 @@ -"use strict"; // run code in ES5 strict mode - -var setterSrc = require("../../__set__.js").toString(), - getterSrc = require("../../__get__.js").toString(), - path = require("path"), - injectRewire = require("../injectRewire.js"), - getRewireRegExp = require("../getRewireRegExp.js"), - - rewireLib = path.resolve(__dirname, "../../"), - projectBasePath = path.resolve(__dirname, "../../../../../"), - nodeModulesPath = path.join(projectBasePath, "node_modules"), - webpackPath = path.join("node_modules", "webpack"), - settersAndGettersSrc; - -/** - * Injects special code so rewire gains access to the module's private scope. - * - * Furthermore it changes all calls of rewire("some/path") to rewire("some/path", require("some/path")) so webpack - * recognizes the additional dependency. This also enables rewire to resolve the module because webpack replaces all - * paths to numeric ids. - * - * @param {!String} src - * @return {String} src - */ -function webpackPostLoader(src) { - var filename = this.request.split("!").pop(), - rewireRegExp = getRewireRegExp(); - - if (isRewireableModule(filename)) { - // replaces rewire("some/path") into rewire("some/path", require("some/path")) - src = src.replace(rewireRegExp, '$1rewire("$2", require("$2"))'); - - // Inject special code - src = injectRewire(src, settersAndGettersSrc); - } - - return src; -} - -webpackPostLoader.loader = __filename; -webpackPostLoader.test = /\.js$/; - -/** - * Returns true if the module is rewireable. Rewireable are all modules of the project. - * - * Example: - * Imagine rewire lies under "~/myProject/node_modules/rewire". All files in "~/myProject" are rewireable except - * the "~/myProject/node_modules"-path. - * - * @param {!String} path - * @return {Boolean} - */ -function isRewireableModule(path) { - return path.indexOf(projectBasePath) !== -1 && - path.indexOf(nodeModulesPath) === -1 && - - // "rewire/lib" and "node_modules/webpack" are explicitly excluded to make the tests work - path.indexOf(rewireLib) === -1 && - path.indexOf(webpackPath) === -1; -} - -/** - * This string gets injected at the beginning of every module. Its purpose is to - * - register the setters and getters according to the module's filename - * - * @private - * @type {String} - */ -settersAndGettersSrc = ( - 'var rewire = require("rewire"); ' + - - // Registers the setters and getters of every module according to their filename. The setters and getters must be - // injected as string here to gain access to the private scope of the module. - 'rewire.register(module, ' + setterSrc + ', ' + getterSrc + '); ' + - - // Cleaning up - 'rewire = undefined;' -).replace(/\s+/g, " "); // strip out unnecessary spaces to be unobtrusive in the debug view - -module.exports = webpackPostLoader; \ No newline at end of file diff --git a/src/extensibility/node/node_modules/rewire/lib/bundlers/webpack/webpackPostProcessor.js b/src/extensibility/node/node_modules/rewire/lib/bundlers/webpack/webpackPostProcessor.js deleted file mode 100644 index ee10c405d13..00000000000 --- a/src/extensibility/node/node_modules/rewire/lib/bundlers/webpack/webpackPostProcessor.js +++ /dev/null @@ -1,24 +0,0 @@ -"use strict"; // run code in ES5 strict mode - -var path = require("path"), - - rewireLibIndex = path.join("rewire", "lib", "index.js"); - -/** - * Gets called before each module is loaded. - * This function ensures that lib/bundlers/webpack/webpackRewire.js is returned instead of lib/index.js. - * - * The callback gets called with (null, filename) - * - * @param {!String} filename - * @param {!Function} callback - */ -function webpackPostProcessor(filename, callback) { - if (filename.indexOf(rewireLibIndex) !== -1) { - filename = __dirname + "/webpackRewire.js"; - } - - callback(null, filename); -} - -module.exports = webpackPostProcessor; \ No newline at end of file diff --git a/src/extensibility/node/node_modules/rewire/lib/bundlers/webpack/webpackRewire.js b/src/extensibility/node/node_modules/rewire/lib/bundlers/webpack/webpackRewire.js deleted file mode 100644 index db7830297b9..00000000000 --- a/src/extensibility/node/node_modules/rewire/lib/bundlers/webpack/webpackRewire.js +++ /dev/null @@ -1,76 +0,0 @@ -"use strict"; // run code in ES5 strict mode - -var registry = {}, - getImportGlobalsSrc = require("../../getImportGlobalsSrc.js"); - -var requireInDisguise; - -eval("requireInDisguise = require"); - -function getModuleId(exports) { - var cache = require.cache, - id; - - for (id in cache) { - if (cache.hasOwnProperty(id)) { - if (cache[id].exports === exports) { - return Number(id); - } - } - } - - return null; -} - -function webpackRewire(path, moduleExports) { - var id = getModuleId(moduleExports), - previousRegistryEntry, - cachedModule, - rewiredModule, - setter, - getter; - - if (typeof id !== "number") { - throw new Error("(rewire) Sorry, rewiring '" + path + "' is currently not supported."); - } - - previousRegistryEntry = registry[id]; - - cachedModule = require.cache[id]; - delete require.cache[id]; - rewiredModule = requireInDisguise(id); - require.cache[id] = cachedModule; - - setter = registry[id].setter; - getter = registry[id].getter; - - registry[id] = previousRegistryEntry; - - rewiredModule.__set__ = setter; - rewiredModule.__get__ = getter; - - return rewiredModule; -} - -webpackRewire.register = function (module, setter, getter) { - var id = module.id; - - registry[id] = { - module: module, - setter: setter, - getter: getter - }; -}; - -/** - * Scans for global vars and returns an evalable string that declares all globals as a var. - * This way a global variable can be overridden by __set__ without changing the global instance. - * It is executed each time again to include global variables that have been added later. - * - * @return {String} - */ -webpackRewire.getImportGlobalsSrc = function () { - return getImportGlobalsSrc(['require','module','exports','__dirname','__filename','process']); -}; - -module.exports = webpackRewire; \ No newline at end of file diff --git a/src/extensibility/node/node_modules/rewire/lib/detectStrictMode.js b/src/extensibility/node/node_modules/rewire/lib/detectStrictMode.js deleted file mode 100644 index 13584b5f227..00000000000 --- a/src/extensibility/node/node_modules/rewire/lib/detectStrictMode.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * Returns true if the source code is intended to run in strict mode. Does not detect - * "use strict" if it occurs in a nested function. - * - * @param {String} src - * @return {Boolean} - */ -function detectStrictMode(src) { - return (/^\s*(?:"use strict"|'use strict')[ \t]*(?:[\r\n]|;)/g).test(src); -} - -module.exports = detectStrictMode; \ No newline at end of file diff --git a/src/extensibility/node/node_modules/rewire/lib/getImportGlobalsSrc.js b/src/extensibility/node/node_modules/rewire/lib/getImportGlobalsSrc.js deleted file mode 100644 index 8ed8545dfee..00000000000 --- a/src/extensibility/node/node_modules/rewire/lib/getImportGlobalsSrc.js +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Declares all globals with a var and assigns the global object. Thus you're able to - * override globals without changing the global object itself. - * - * Returns something like - * "var console = global.console; var process = global.process; ..." - * - * @return {String} - */ -function getImportGlobalsSrc(ignore) { - var key, - value, - src = "", - globalObj = typeof global === "undefined"? window: global; - - ignore = ignore || []; - - for (key in globalObj) { - if (key !== "global" && ignore.indexOf(key) === -1) { // we don't use hasOwnProperty here because in some browsers not all global objects will be enumerated - value = globalObj[key]; - src += "var " + key + " = global." + key + "; "; - } - } - - - return src; -} - -module.exports = getImportGlobalsSrc; \ No newline at end of file diff --git a/src/extensibility/node/node_modules/rewire/lib/index.js b/src/extensibility/node/node_modules/rewire/lib/index.js deleted file mode 100644 index 6858598a58d..00000000000 --- a/src/extensibility/node/node_modules/rewire/lib/index.js +++ /dev/null @@ -1,21 +0,0 @@ -var rewireModule = require("./rewire.js"); - -/** - * Adds a special setter and getter to the module located at filename. After the module has been rewired, you can - * call myModule.__set__(name, value) and myModule.__get__(name) to manipulate private variables. - * - * @param {!String} filename Path to the module that shall be rewired. Use it exactly like require(). - * @return {*} the rewired module - */ -function rewire(filename) { - return rewireModule(module.parent, filename); -} - -rewire.bundlers = { - browserify: require("./bundlers/browserify/browserifyMiddleware.js"), - webpack: require("./bundlers/webpack/configureWebpack.js") -}; - -module.exports = rewire; - -delete require.cache[__filename]; // deleting self from module cache so the parent module is always up to date \ No newline at end of file diff --git a/src/extensibility/node/node_modules/rewire/lib/moduleEnv.js b/src/extensibility/node/node_modules/rewire/lib/moduleEnv.js deleted file mode 100644 index d17918bd403..00000000000 --- a/src/extensibility/node/node_modules/rewire/lib/moduleEnv.js +++ /dev/null @@ -1,82 +0,0 @@ -"use strict"; - -var Module = require("module"), - fs = require("fs"); - - // caching original wrapper -var moduleWrapper0 = Module.wrapper[0], - moduleWrapper1 = Module.wrapper[1], - originalExtensions = {}, - nodeRequire, - currentModule; - -function load(targetModule) { - nodeRequire = targetModule.require; - targetModule.require = requireProxy; - currentModule = targetModule; - - registerExtensions(); - targetModule.load(targetModule.id); - - // This is only necessary if nothing has been required within the module - reset(); -} - -function reset() { - Module.wrapper[0] = moduleWrapper0; - Module.wrapper[1] = moduleWrapper1; - restoreExtensions(); -} - -function inject(prelude, appendix) { - Module.wrapper[0] = moduleWrapper0 + prelude; - Module.wrapper[1] = appendix + moduleWrapper1; -} - -/** - * Proxies the first require call in order to draw back all changes to the Module.wrapper. - * Thus our changes don't influence other modules - * - * @param {!String} path - */ -function requireProxy(path) { - reset(); - currentModule.require = nodeRequire; - return nodeRequire.call(currentModule, path); // node's require only works when "this" points to the module -} - -function registerExtensions() { - originalExtensions.coffee = require.extensions[".coffee"]; - require.extensions[".coffee"] = coffeeExtension; -} - -function restoreExtensions() { - require.extensions[".coffee"] = originalExtensions.coffee; -} - -function coffeeExtension(module, filename) { - var coffee = require("coffee-script"), - content = stripBOM(fs.readFileSync(filename, "utf8")); - - content = coffee.compile(content, { - filename: filename, - bare: true - }); - module._compile(content, filename); -} - -/** - * @see https://github.com/joyent/node/blob/master/lib/module.js - */ -function stripBOM(content) { - // Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) - // because the buffer-to-string conversion in `fs.readFileSync()` - // translates it to FEFF, the UTF-16 BOM. - if (content.charCodeAt(0) === 0xFEFF) { - content = content.slice(1); - } - return content; -} - -exports.load = load; -exports.inject = inject; \ No newline at end of file diff --git a/src/extensibility/node/node_modules/rewire/lib/rewire.js b/src/extensibility/node/node_modules/rewire/lib/rewire.js deleted file mode 100644 index bb7c176104b..00000000000 --- a/src/extensibility/node/node_modules/rewire/lib/rewire.js +++ /dev/null @@ -1,57 +0,0 @@ -var Module = require("module"), - fs = require("fs"), - __get__ = require("./__get__.js"), - __set__ = require("./__set__.js"), - getImportGlobalsSrc = require("./getImportGlobalsSrc.js"), - detectStrictMode = require("./detectStrictMode.js"), - moduleEnv = require("./moduleEnv.js"); - -/** - * Does actual rewiring the module. For further documentation @see index.js - */ -function internalRewire(parentModulePath, targetPath) { - var targetModule, - prelude, - appendix, - src; - - // Checking params - if (typeof targetPath !== "string") { - throw new TypeError("Filename must be a string"); - } - - // Resolve full filename relative to the parent module - targetPath = Module._resolveFilename(targetPath, parentModulePath); - - // Special support for older node versions that returned an array on Module._resolveFilename - // @see https://github.com/joyent/node/blob/865b077819a9271a29f982faaef99dc635b57fbc/lib/module.js#L319 - // TODO Remove this switch on the next major release - if (Array.isArray(targetPath)) { - targetPath = targetPath[1]; - } - - // Create testModule as it would be created by require() - targetModule = new Module(targetPath, parentModulePath); - - // We prepend a list of all globals declared with var so they can be overridden (without changing original globals) - prelude = getImportGlobalsSrc(); - - // We append our special setter and getter. - appendix = "\n"; - appendix += "module.exports.__set__ = " + __set__.toString() + "; "; - appendix += "module.exports.__get__ = " + __get__.toString() + "; "; - - // Check if the module uses the strict mode. - // If so we must ensure that "use strict"; stays at the beginning of the module. - src = fs.readFileSync(targetPath, "utf8"); - if (detectStrictMode(src) === true) { - prelude = ' "use strict"; ' + prelude; - } - - moduleEnv.inject(prelude, appendix); - moduleEnv.load(targetModule); - - return targetModule.exports; -} - -module.exports = internalRewire; \ No newline at end of file diff --git a/src/extensibility/node/node_modules/rewire/package.json b/src/extensibility/node/node_modules/rewire/package.json deleted file mode 100644 index bf40b9a9a36..00000000000 --- a/src/extensibility/node/node_modules/rewire/package.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "rewire", - "version": "1.1.2", - "description": "Dependency injection for node.js applications", - "keywords": [ - "dependency", - "injection", - "mock", - "shim", - "module", - "unit", - "test", - "leak", - "inspect" - ], - "author": { - "name": "Johannes Ewald", - "email": "mail@johannesewald.de" - }, - "main": "lib/index.js", - "homepage": "https://github.com/jhnns/rewire", - "bugs": { - "url": "https://github.com/jhnns/rewire/issues", - "email": "mail@johannesewald.de" - }, - "repository": { - "type": "git", - "url": "git://github.com/jhnns/rewire.git" - }, - "engines": { - "node": "<0.12.x" - }, - "devDependencies": { - "mocha": "1.x", - "expect.js": "0.x", - "coffee-script": "1.x" - }, - "scripts": { - "test": "node node_modules/mocha/bin/mocha -R spec" - }, - "readme": "rewire\n=====\n**Dependency injection for node.js applications**.\n\nrewire adds a special setter and getter to modules so you can modify their behaviour for better unit testing. You may\n\n- inject mocks for other modules or globals like `process`\n- leak private variables\n- override variables within the module.\n\nrewire does **not** load the file and eval the contents to emulate node's require mechanism. In fact it uses node's own require to load the module. Thus your module behaves exactly the same in your test environment as under regular circumstances (except your modifications).\n\nGood news to all caffeine-addicts: rewire works also with [Coffee-Script](http://coffeescript.org/). Note that in this case CS needs to be listed in your devDependencies.\n\nIf you want to use rewire also on the client-side take a look at [client-side bundlers](https://github.com/jhnns/rewire#client-side-bundlers)\n\n[![Build Status](https://secure.travis-ci.org/jhnns/rewire.png?branch=master)](http://travis-ci.org/jhnns/rewire)\n[![Dependency Status](http://david-dm.org/jhnns/rewire/status.png)](http://david-dm.org/jhnns/rewire)\nDependency tracking by [David](http://david-dm.org/)\n\n
    \n\nInstallation\n------------\n\n`npm install rewire`\n\n
    \n\nExamples\n--------\n\nImagine you want to test this module:\n\n```javascript\n// lib/myModule.js\n\n// With rewire you can change all these variables\nvar fs = require(\"fs\"),\n http = require(\"http\"),\n someOtherVar = \"hi\",\n myPrivateVar = 1;\n\nfunction readSomethingFromFileSystem(cb) {\n // But no scoped variables\n var path = \"/somewhere/on/the/disk\";\n\n console.log(\"Reading from file system ...\");\n fs.readFile(path, \"utf8\", cb);\n}\n\nexports.readSomethingFromFileSystem = readSomethingFromFileSystem;\n```\n\nNow within your test module:\n\n```javascript\n// test/myModule.test.js\n\nvar rewire = require(\"rewire\");\n\n// rewire acts exactly like require.\nvar myModule = rewire(\"../lib/myModule.js\");\n\n// Just with one difference:\n// Your module will now export a special setter and getter for private variables.\nmyModule.__set__(\"myPrivateVar\", 123);\nmyModule.__get__(\"myPrivateVar\"); // = 123\n\n// This allows you to mock almost everything within the module e.g. the fs-module.\n// Just pass the variable name as first parameter and your mock as second.\nmyModule.__set__(\"fs\", {\n readFile: function (path, encoding, cb) {\n cb(null, \"Success!\");\n }\n});\nmyModule.readSomethingFromFileSystem(function (err, data) {\n console.log(data); // = Success!\n});\n\n// You can set different variables with one call.\nmyModule.__set__({\n fs: fsMock,\n http: httpMock,\n someOtherVar: \"hello\"\n});\n\n// You may also override globals. These changes are only within the module, so\n// you don't have to be concerned that other modules are influenced by your mock.\nmyModule.__set__({\n console: {\n log: function () { /* be quiet */ }\n },\n process: {\n argv: [\"testArg1\", \"testArg2\"]\n }\n});\n\n// But be careful, if you do something like this you'll change your global\n// console instance.\nmyModule.__set__(\"console.log\", function () { /* be quiet */ });\n\n// There is another difference to require:\n// Every call of rewire() returns a new instance.\nrewire(\"./myModule.js\") === rewire(\"./myModule.js\"); // = false\n```\n\n
    \n\n##API\n\n###rewire(filename): rewiredModule\n\n- *filename*:
    \nPath to the module that shall be rewired. Use it exactly like require().\n\n###rewiredModule.__set__(name, value)\n\n- *name*:
    \nName of the variable to set. The variable should be global or defined with `var` in the top-leve scope of the module.\n- *value*:
    \nThe value to set.\n\n###rewiredModule.__set__(env)\n- *env*:
    \nTakes all keys as variable names and sets the values respectively.\n\n###rewiredModule.__get__(name): value\n\nReturns the private variable.\n\n
    \n\n##Client-Side Bundlers\n\n###webpack\nSee [rewire-webpack](https://github.com/jhnns/rewire-webpack)\n\n###browserify\nrewire currently only supports browserify@1.x. I'm not planing to continue development, but if you're relying on this feature [please let me know](https://github.com/jhnns/rewire/issues/13).\n\n
    \n\n##License\n\nMIT\n", - "readmeFilename": "README.md", - "_id": "rewire@1.1.2", - "_from": "rewire@" -} diff --git a/src/extensibility/node/node_modules/rewire/test/__get__.test.js b/src/extensibility/node/node_modules/rewire/test/__get__.test.js deleted file mode 100644 index 8f060f72283..00000000000 --- a/src/extensibility/node/node_modules/rewire/test/__get__.test.js +++ /dev/null @@ -1,79 +0,0 @@ -var expect = require("expect.js"), - vm = require("vm"), - __get__ = require("../lib/__get__.js"), - - expectReferenceError = expectError(ReferenceError), - expectTypeError = expectError(TypeError); - -function expectError(ErrConstructor) { - return function expectReferenceError(err) { - expect(err.constructor.name).to.be(ErrConstructor.name); - }; -} - - -describe("__get__", function () { - var moduleFake; - - beforeEach(function () { - moduleFake = { - __filename: "some/file.js", - myNumber: 0, - myObj: {} - }; - - vm.runInNewContext( - "__get__ = " + __get__.toString() + "; " + - "setNumber = function (value) { myNumber = value; }; " + - "setObj = function (value) { myObj = value; }; ", - moduleFake, - __filename - ); - }); - it("should return the initial value", function () { - expect(moduleFake.__get__("myNumber")).to.be(0); - expect(moduleFake.__get__("myObj")).to.eql({}); - }); - it("should return the changed value of the number", function () { - var newObj = { hello: "hello" }; - - moduleFake.setNumber(2); - moduleFake.setObj(newObj); - expect(moduleFake.__get__("myNumber")).to.be(2); - expect(moduleFake.__get__("myObj")).to.be(newObj); - }); - it("should throw a ReferenceError when getting not existing vars", function () { - expect(function () { - moduleFake.__get__("blabla"); - }).to.throwException(expectReferenceError); - }); - it("should throw a TypeError when passing misfitting params", function () { - expect(function () { - moduleFake.__get__(); - }).to.throwException(expectTypeError); - expect(function () { - moduleFake.__get__(undefined); - }).to.throwException(expectTypeError); - expect(function () { - moduleFake.__get__(null); - }).to.throwException(expectTypeError); - expect(function () { - moduleFake.__get__(true); - }).to.throwException(expectTypeError); - expect(function () { - moduleFake.__get__(2); - }).to.throwException(expectTypeError); - expect(function () { - moduleFake.__get__(""); - }).to.throwException(expectTypeError); - expect(function () { - moduleFake.__get__([]); - }).to.throwException(expectTypeError); - expect(function () { - moduleFake.__get__({}); - }).to.throwException(expectTypeError); - expect(function () { - moduleFake.__get__(function () {}); - }).to.throwException(expectTypeError); - }); -}); \ No newline at end of file diff --git a/src/extensibility/node/node_modules/rewire/test/__set__.test.js b/src/extensibility/node/node_modules/rewire/test/__set__.test.js deleted file mode 100644 index 7b9c2cb37ec..00000000000 --- a/src/extensibility/node/node_modules/rewire/test/__set__.test.js +++ /dev/null @@ -1,104 +0,0 @@ -var expect = require("expect.js"), - __set__ = require("../lib/__set__.js"), - vm = require("vm"), - - expectReferenceError = expectError(ReferenceError), - expectTypeError = expectError(TypeError); - -function expectError(ErrConstructor) { - return function expectReferenceError(err) { - expect(err.constructor.name).to.be(ErrConstructor.name); - }; -} - -describe("__set__", function () { - var moduleFake; - - beforeEach(function () { - moduleFake = { - myValue: 0, // copy by value - myReference: {} // copy by reference - }; - - vm.runInNewContext( - "__set__ = " + __set__.toString() + "; " + - "getValue = function () { return myValue; }; " + - "getReference = function () { return myReference; }; ", - moduleFake - ); - }); - it("should set the new value when calling with varName, varValue", function () { - expect(moduleFake.getValue()).to.be(0); - moduleFake.__set__("myValue", undefined); - expect(moduleFake.getValue()).to.be(undefined); - moduleFake.__set__("myValue", null); - expect(moduleFake.getValue()).to.be(null); - moduleFake.__set__("myValue", 2); - expect(moduleFake.getValue()).to.be(2); - moduleFake.__set__("myValue", "hello"); - expect(moduleFake.getValue()).to.be("hello"); - }); - it("should set the new reference when calling with varName, varValue", function () { - var newObj = { hello: "hello" }, - newArr = [1, 2, 3], - regExp = /123/gi; - - function newFn() { - console.log("hello"); - } - - expect(moduleFake.getReference()).to.eql({}); - moduleFake.__set__("myReference", newObj); - expect(moduleFake.getReference()).to.be(newObj); - moduleFake.__set__("myReference", newArr); - expect(moduleFake.getReference()).to.be(newArr); - moduleFake.__set__("myReference", newFn); - expect(moduleFake.getReference()).to.be(newFn); - moduleFake.__set__("myReference", regExp); - expect(moduleFake.getReference()).to.be(regExp); - }); - it("should set the new number and the new obj when calling with an env-obj", function () { - var newObj = { hello: "hello" }; - - expect(moduleFake.getValue()).to.be(0); - expect(moduleFake.getReference()).to.eql({}); - moduleFake.__set__({ - myValue: 2, - myReference: newObj - }); - expect(moduleFake.getValue()).to.be(2); - expect(moduleFake.getReference()).to.be(newObj); - }); - it("should return undefined", function () { - expect(moduleFake.__set__("myValue", 4)).to.be(undefined); - }); - it("should throw a TypeError when passing misfitting params", function () { - expect(function () { - moduleFake.__set__(); - }).to.throwException(expectTypeError); - expect(function () { - moduleFake.__set__(undefined); - }).to.throwException(expectTypeError); - expect(function () { - moduleFake.__set__(null); - }).to.throwException(expectTypeError); - expect(function () { - moduleFake.__set__(true); - }).to.throwException(expectTypeError); - expect(function () { - moduleFake.__set__(2); - }).to.throwException(expectTypeError); - expect(function () { - moduleFake.__set__(""); - }).to.throwException(expectTypeError); - expect(function () { - moduleFake.__set__(function () {}); - }).to.throwException(expectTypeError); - expect(function () { - moduleFake.__set__({}, true); // misfitting number of params - }).to.throwException(expectTypeError); - expect(function () { - moduleFake.__set__("someVar"); // misfitting number of params - }).to.throwException(expectTypeError); - }); -}); \ No newline at end of file diff --git a/src/extensibility/node/node_modules/rewire/test/debug.test.js b/src/extensibility/node/node_modules/rewire/test/debug.test.js deleted file mode 100644 index 0a1016a4dc9..00000000000 --- a/src/extensibility/node/node_modules/rewire/test/debug.test.js +++ /dev/null @@ -1,11 +0,0 @@ -var rewire = require("../lib/index.js"); - -// add breakpoints in testModules/debuggerModule.js and debug this file with your IDE to -// check if debugging works with rewire. -var debuggerModule = rewire("./testModules/debuggerModule.js"); - -debugger; - -debuggerModule.__set__("myNumber", 1); - -debuggerModule(); \ No newline at end of file diff --git a/src/extensibility/node/node_modules/rewire/test/detectStrictMode.test.js b/src/extensibility/node/node_modules/rewire/test/detectStrictMode.test.js deleted file mode 100644 index 5cde34e1362..00000000000 --- a/src/extensibility/node/node_modules/rewire/test/detectStrictMode.test.js +++ /dev/null @@ -1,23 +0,0 @@ -var expect = require("expect.js"), - detectStrictMode = require("../lib/detectStrictMode.js"); - -describe("detectStrictMode", function () { - it("should detect all valid uses of \"use strict\";", function () { - expect(detectStrictMode('"use strict";')).to.be(true); - expect(detectStrictMode("'use strict';")).to.be(true); - expect(detectStrictMode(' "use strict";')).to.be(true); - expect(detectStrictMode('\n"use strict";')).to.be(true); - expect(detectStrictMode('\r\n"use strict";')).to.be(true); - expect(detectStrictMode('"use strict"\r\n')).to.be(true); - expect(detectStrictMode('"use strict" ; test();')).to.be(true); - }); - it("should not detect invalid uses of \"use strict\";", function () { - expect(detectStrictMode('" use strict ";')).to.be(false); - expect(detectStrictMode('"use strict".replace("use", "fail");')).to.be(false); - expect(detectStrictMode('"use strict" .replace("use", "fail");')).to.be(false); - expect(detectStrictMode(';"use strict";')).to.be(false); - }); - it("should not detect \"use strict\"; if it occurs in some nested function", function () { - expect(detectStrictMode('function () {"use strict";}')).to.be(false); - }); -}); \ No newline at end of file diff --git a/src/extensibility/node/node_modules/rewire/test/getImportGlobalsSrc.test.js b/src/extensibility/node/node_modules/rewire/test/getImportGlobalsSrc.test.js deleted file mode 100644 index 47752fd3713..00000000000 --- a/src/extensibility/node/node_modules/rewire/test/getImportGlobalsSrc.test.js +++ /dev/null @@ -1,42 +0,0 @@ -var expect = require("expect.js"), - vm = require("vm"), - getImportGlobalsSrc = require("../lib/getImportGlobalsSrc.js"); - -describe("getImportGlobalsSrc", function () { - it("should declare all globals with a var", function () { - var context = { - global: global - }, - src, - actualGlobals, - expectedGlobals = Object.keys(global); - - src = getImportGlobalsSrc(); - vm.runInNewContext(src, context); - actualGlobals = Object.keys(context); - actualGlobals.sort(); - expectedGlobals.sort(); - expect(actualGlobals).to.eql(expectedGlobals); - expect(actualGlobals.length).to.be.above(1); - }); - it("should ignore the given variables", function () { - var context = { - global: global - }, - ignore = ["console", "setTimeout"], - src, - actualGlobals, - expectedGlobals = Object.keys(global); - - src = getImportGlobalsSrc(ignore); - expectedGlobals = expectedGlobals.filter(function filterIgnoredVars(value) { - return ignore.indexOf(value) === -1; - }); - vm.runInNewContext(src, context); - actualGlobals = Object.keys(context); - actualGlobals.sort(); - expectedGlobals.sort(); - expect(actualGlobals).to.eql(expectedGlobals); - expect(actualGlobals.length).to.be.above(1); - }); -}); \ No newline at end of file diff --git a/src/extensibility/node/node_modules/rewire/test/rewire.test.js b/src/extensibility/node/node_modules/rewire/test/rewire.test.js deleted file mode 100644 index 1ac0129510c..00000000000 --- a/src/extensibility/node/node_modules/rewire/test/rewire.test.js +++ /dev/null @@ -1,34 +0,0 @@ -// Don't run code in ES5 strict mode. -// In case this module was in strict mode, all other modules called by this would also be strict. -// But when testing if the strict mode is preserved, we must ensure that this module is NOT strict. - -var expect = require("expect.js"), - fs = require("fs"), - path = require("path"); - -var rewire; - -describe("rewire", function () { - before(function () { - var fakeNodeModules = path.resolve(__dirname, "testModules/fake_node_modules"); - - if (fs.existsSync(fakeNodeModules)) { - fs.renameSync(fakeNodeModules, path.resolve(__dirname, "testModules/node_modules")); - } - }); - it("should pass all shared test cases", function () { - require("./testModules/sharedTestCases.js"); - }); - it("should also work with CoffeeScript", function () { - var coffeeModule; - - rewire = require("../"); - coffeeModule = rewire("./testModules/module.coffee"); - coffeeModule.__set__("fs", { - readFileSync: function () { - return "It works!"; - } - }); - expect(coffeeModule.readFileSync()).to.be("It works!"); - }); -}); \ No newline at end of file diff --git a/src/extensibility/node/node_modules/rewire/test/testModules/debuggerModule.js b/src/extensibility/node/node_modules/rewire/test/testModules/debuggerModule.js deleted file mode 100644 index 9d2b7df5ed2..00000000000 --- a/src/extensibility/node/node_modules/rewire/test/testModules/debuggerModule.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; // run code in ES5 strict mode - -var myNumber = 0; - -module.exports = function () { - myNumber = 1; -}; \ No newline at end of file diff --git a/src/extensibility/node/node_modules/rewire/test/testModules/emptyModule.js b/src/extensibility/node/node_modules/rewire/test/testModules/emptyModule.js deleted file mode 100644 index 8b82a7478bb..00000000000 --- a/src/extensibility/node/node_modules/rewire/test/testModules/emptyModule.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict"; // run code in ES5 strict mode - -var someVar; - -// Comment on file end. Hope this won't break anything \ No newline at end of file diff --git a/src/extensibility/node/node_modules/rewire/test/testModules/fake_node_modules/rewire/package.json b/src/extensibility/node/node_modules/rewire/test/testModules/fake_node_modules/rewire/package.json deleted file mode 100644 index d8927cd1715..00000000000 --- a/src/extensibility/node/node_modules/rewire/test/testModules/fake_node_modules/rewire/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "../../../../lib/index.js" -} \ No newline at end of file diff --git a/src/extensibility/node/node_modules/rewire/test/testModules/module.coffee b/src/extensibility/node/node_modules/rewire/test/testModules/module.coffee deleted file mode 100644 index 02fa5d5cb3f..00000000000 --- a/src/extensibility/node/node_modules/rewire/test/testModules/module.coffee +++ /dev/null @@ -1,3 +0,0 @@ -fs = require "fs" - -exports.readFileSync = () -> fs.readFileSync() \ No newline at end of file diff --git a/src/extensibility/node/node_modules/rewire/test/testModules/moduleA.js b/src/extensibility/node/node_modules/rewire/test/testModules/moduleA.js deleted file mode 100644 index b9dce876231..00000000000 --- a/src/extensibility/node/node_modules/rewire/test/testModules/moduleA.js +++ /dev/null @@ -1,135 +0,0 @@ -"use strict"; // run code in ES5 strict mode - -var someOtherModule = require("./someOtherModule.js"), - myNumber = 0, // copy by value - myObj = {}, // copy by reference - env = "bla", - fs; - -// We need getters and setters for private vars to check if our injected setters and getters actual work -function setMyNumber(newNumber) { - myNumber = newNumber; -} - -function getMyNumber() { - return myNumber; -} - -function setMyObj(newObj) { - myObj = newObj; -} - -function getMyObj() { - return myObj; -} - -function readFileSync() { - fs.readFileSync("bla.txt", "utf8"); -} - -function checkSomeGlobals() { - var isLowerIE, - typeOfGlobalFunc; - - if (typeof navigator !== "undefined") { - isLowerIE = /MSIE [6-8]\.[0-9]/g.test(navigator.userAgent); - } - if (isLowerIE) { - typeOfGlobalFunc = "object"; - } else { - typeOfGlobalFunc = "function"; - } - - if (typeof global !== "object") { - throw new ReferenceError("global is not an object"); - } - if (typeof console !== "object") { - throw new ReferenceError("console is not an object"); - } - if (typeof require !== "function") { - throw new ReferenceError("require is not a function"); - } - if (typeof module !== "object") { - throw new ReferenceError("module is not an object"); - } - if (typeof exports !== "object") { - throw new ReferenceError("exports is not an object"); - } - if (module.exports !== exports) { - throw new Error("module.exports === exports returns false"); - } - if (typeof __dirname !== "string") { - throw new ReferenceError("__dirname is not a string"); - } - if (typeof __filename !== "string") { - throw new ReferenceError("__filename is not a string"); - } - if (typeof setTimeout !== typeOfGlobalFunc) { - throw new ReferenceError("setTimeout is not a function"); - } - if (typeof clearTimeout !== typeOfGlobalFunc) { - throw new ReferenceError("clearTimeout is not a function"); - } - if (typeof setInterval !== typeOfGlobalFunc) { - throw new ReferenceError("setInterval is not a function"); - } - if (typeof clearInterval !== typeOfGlobalFunc) { - throw new ReferenceError("clearInterval is not a function"); - } - if (typeof Error !== "function") { - throw new ReferenceError("Error is not a function"); - } - if (typeof parseFloat !== "function") { - throw new ReferenceError("parseFloat is not a function"); - } - if (typeof parseInt !== "function") { - throw new ReferenceError("parseInt is not a function"); - } - if (typeof window === "undefined") { - if (typeof process !== "object") { - throw new ReferenceError("process is not an object"); - } - if (typeof Buffer !== "function") { - throw new ReferenceError("Buffer is not a function"); - } - } else { - if (typeof encodeURIComponent !== "function") { - throw new ReferenceError("encodeURIComponent is not a function"); - } - if (typeof decodeURIComponent !== "function") { - throw new ReferenceError("decodeURIComponent is not a function"); - } - if (typeof document !== "object") { - throw new ReferenceError("document is not an object"); - } - } -} - -function getConsole() { - return console; -} - -function getFilename() { - return __filename; -} - -function getBuffer() { - return Buffer; -} - -function getDocument() { - return document; -} - -// different styles of exports in moduleA.js and moduleB.js -exports.setMyNumber = setMyNumber; -exports.getMyNumber = getMyNumber; -exports.setMyObj = setMyObj; -exports.getMyObj = getMyObj; -exports.readFileSync = readFileSync; -exports.checkSomeGlobals = checkSomeGlobals; -exports.getConsole = getConsole; -exports.getFilename = getFilename; -exports.getBuffer = getBuffer; -exports.getDocument = getDocument; -exports.someOtherModule = someOtherModule; \ No newline at end of file diff --git a/src/extensibility/node/node_modules/rewire/test/testModules/moduleB.js b/src/extensibility/node/node_modules/rewire/test/testModules/moduleB.js deleted file mode 100644 index 62b2d3f7ad5..00000000000 --- a/src/extensibility/node/node_modules/rewire/test/testModules/moduleB.js +++ /dev/null @@ -1,137 +0,0 @@ -"use strict"; // run code in ES5 strict mode - -var someOtherModule = require("./someOtherModule.js"), - myNumber = 0, // copy by value - myObj = {}, // copy by reference - env = "bla", - fs; - -// We need getters and setters for private vars to check if our injected setters and getters actual work -function setMyNumber(newNumber) { - myNumber = newNumber; -} - -function getMyNumber() { - return myNumber; -} - -function setMyObj(newObj) { - myObj = newObj; -} - -function getMyObj() { - return myObj; -} - -function readFileSync() { - fs.readFileSync("bla.txt", "utf8"); -} - -function checkSomeGlobals() { - var isLowerIE, - typeOfGlobalFunc; - - if (typeof navigator !== "undefined") { - isLowerIE = /MSIE [6-8]\.[0-9]/g.test(navigator.userAgent); - } - if (isLowerIE) { - typeOfGlobalFunc = "object"; - } else { - typeOfGlobalFunc = "function"; - } - - if (typeof global !== "object") { - throw new ReferenceError("global is not an object"); - } - if (typeof console !== "object") { - throw new ReferenceError("console is not an object"); - } - if (typeof require !== "function") { - throw new ReferenceError("require is not a function"); - } - if (typeof module !== "object") { - throw new ReferenceError("module is not an object"); - } - if (typeof exports !== "object") { - throw new ReferenceError("exports is not an object"); - } - if (module.exports === exports) { - throw new Error("module.exports === exports returns true"); - } - if (typeof __dirname !== "string") { - throw new ReferenceError("__dirname is not a string"); - } - if (typeof __filename !== "string") { - throw new ReferenceError("__filename is not a string"); - } - if (typeof setTimeout !== typeOfGlobalFunc) { - throw new ReferenceError("setTimeout is not a function"); - } - if (typeof clearTimeout !== typeOfGlobalFunc) { - throw new ReferenceError("clearTimeout is not a function"); - } - if (typeof setInterval !== typeOfGlobalFunc) { - throw new ReferenceError("setInterval is not a function"); - } - if (typeof clearInterval !== typeOfGlobalFunc) { - throw new ReferenceError("clearInterval is not a function"); - } - if (typeof Error !== "function") { - throw new ReferenceError("Error is not a function"); - } - if (typeof parseFloat !== "function") { - throw new ReferenceError("parseFloat is not a function"); - } - if (typeof parseInt !== "function") { - throw new ReferenceError("parseInt is not a function"); - } - if (typeof window === "undefined") { - if (typeof process !== "object") { - throw new ReferenceError("process is not an object"); - } - if (typeof Buffer !== "function") { - throw new ReferenceError("Buffer is not a function"); - } - } else { - if (typeof encodeURIComponent !== "function") { - throw new ReferenceError("encodeURIComponent is not a function"); - } - if (typeof decodeURIComponent !== "function") { - throw new ReferenceError("decodeURIComponent is not a function"); - } - if (typeof document !== "object") { - throw new ReferenceError("document is not an object"); - } - } -} - -function getConsole() { - return console; -} - -function getFilename() { - return __filename; -} - -function getBuffer() { - return Buffer; -} - -function getDocument() { - return document; -} - -// different styles of exports in moduleA.js and moduleB.js -module.exports = { - setMyNumber: setMyNumber, - getMyNumber: getMyNumber, - setMyObj: setMyObj, - getMyObj: getMyObj, - readFileSync: readFileSync, - checkSomeGlobals: checkSomeGlobals, - getConsole: getConsole, - getFilename: getFilename, - getBuffer: getBuffer, - getDocument: getDocument, - someOtherModule: someOtherModule -}; diff --git a/src/extensibility/node/node_modules/rewire/test/testModules/sharedTestCases.js b/src/extensibility/node/node_modules/rewire/test/testModules/sharedTestCases.js deleted file mode 100644 index 050c753a257..00000000000 --- a/src/extensibility/node/node_modules/rewire/test/testModules/sharedTestCases.js +++ /dev/null @@ -1,179 +0,0 @@ -// Don't run code in ES5 strict mode. -// In case this module was in strict mode, all other modules called by this would also be strict. -// But when testing if the strict mode is preserved, we must ensure that this module is NOT strict. - -var path = require("path"), - expect = require("expect.js"), - rewire = require("rewire"); - -function checkForTypeError(err) { - expect(err.constructor).to.be(TypeError); -} - -describe("rewire " + (typeof testEnv === "undefined"? "(node)": "(" + testEnv + ")"), function () { - it("should work like require()", function () { - rewire("./moduleA.js").getFilename(); - require("./moduleA.js").getFilename(); - expect(rewire("./moduleA.js").getFilename()).to.eql(require("./moduleA.js").getFilename()); - expect(rewire("../testModules/someOtherModule.js").filename).to.eql(require("../testModules/someOtherModule.js").filename); - }); - it("should return a fresh instance of the module", function () { - var someOtherModule = require("./someOtherModule.js"), - rewiredSomeOtherModule; - - someOtherModule.fs = "This has been modified"; - rewiredSomeOtherModule = rewire("./someOtherModule.js"); - expect(rewiredSomeOtherModule.fs).not.to.be("This has been modified"); - }); - it("should not cache the rewired module", function () { - var rewired, - someOtherModule = require("./someOtherModule.js"); - - someOtherModule.fs = "This has been changed"; - - rewired = rewire("./someOtherModule.js"); - expect(someOtherModule).not.to.be(rewired); - expect(require("./moduleA.js").someOtherModule).not.to.be(rewired); - expect(require("./moduleA.js").someOtherModule).to.be(someOtherModule); - expect(require("./moduleA.js").someOtherModule.fs).to.be("This has been changed"); - }); - it("should modify the module so it provides a __set__ - function", function () { - expect(rewire("./moduleA.js").__set__).to.be.a(Function); - expect(rewire("./moduleB.js").__set__).to.be.a(Function); - }); - it("should modify the module so it provides a __get__ - function", function () { - expect(rewire("./moduleA.js").__get__).to.be.a(Function); - expect(rewire("./moduleB.js").__get__).to.be.a(Function); - }); - it("should not influence other modules", function () { - var rewiredModuleA = rewire("./moduleA.js"); - - expect(require("./someOtherModule.js").__set__).to.be(undefined); - expect(require("./someOtherModule.js").__get__).to.be(undefined); - }); - it("should not override/influence global objects by default", function () { - // This should throw no exception - rewire("./moduleA.js").checkSomeGlobals(); - rewire("./moduleB.js").checkSomeGlobals(); - }); - it("should provide the ability to set private vars", function () { - var rewiredModuleA = rewire("./moduleA.js"), - newObj = {}; - - expect(rewiredModuleA.getMyNumber()).to.be(0); - rewiredModuleA.__set__("myNumber", 2); - expect(rewiredModuleA.getMyNumber()).to.be(2); - rewiredModuleA.__set__("myObj", newObj); - expect(rewiredModuleA.getMyObj()).to.be(newObj); - rewiredModuleA.__set__("env", "ENVENV"); - }); - it("should provide the ability to get private vars", function () { - var rewiredModuleA = rewire("./moduleA.js"); - - expect(rewiredModuleA.__get__("myNumber")).to.be(rewiredModuleA.getMyNumber()); - expect(rewiredModuleA.__get__("myObj")).to.be(rewiredModuleA.getMyObj()); - }); - it("should provide the ability to inject mocks", function (done) { - var rewiredModuleA = rewire("./moduleA.js"), - mockedFs = { - readFileSync: function (file) { - expect(file).to.be("bla.txt"); - done(); - } - }; - - rewiredModuleA.__set__("fs", mockedFs); - rewiredModuleA.readFileSync(); - }); - it("should not influence other modules when injecting mocks", function () { - var rewiredModuleA = rewire("./moduleA.js"), - someOtherModule, - mockedFs = {}; - - rewiredModuleA.__set__("fs", mockedFs); - someOtherModule = require("./someOtherModule.js"); - expect(someOtherModule.fs).not.to.be(mockedFs); - }); - it("should provide the ability to mock global objects just within the module", function () { - var rewiredModuleA = rewire("./moduleA.js"), - rewiredModuleB = rewire("./moduleB.js"), - consoleMock = {}, - bufferMock = {}, - documentMock = {}, - newFilename = "myFile.js"; - - rewiredModuleA.__set__({ - console: consoleMock, - __filename: newFilename - }); - expect(rewiredModuleA.getConsole()).to.be(consoleMock); - expect(rewiredModuleB.getConsole()).not.to.be(consoleMock); - expect(console).not.to.be(consoleMock); - expect(rewiredModuleA.getFilename()).to.be(newFilename); - expect(rewiredModuleB.getFilename()).not.to.be(newFilename); - expect(console).not.to.be(newFilename); - if (typeof window === "undefined") { - rewiredModuleA.__set__("Buffer", bufferMock); - expect(rewiredModuleA.getBuffer()).to.be(bufferMock); - expect(rewiredModuleB.getBuffer()).not.to.be(bufferMock); - expect(Buffer).not.to.be(bufferMock); - } else { - rewiredModuleA.__set__("document", documentMock); - expect(rewiredModuleA.getDocument()).to.be(documentMock); - expect(rewiredModuleB.getDocument() === documentMock).to.be(false); - expect(document === documentMock).to.be(false); - } - }); - it("should be possible to mock global objects that are added on runtime", function () { - var rewiredModule; - - if (typeof window === "undefined") { - global.someGlobalVar = "test"; - rewiredModule = rewire("./moduleA.js"); - rewiredModule.__set__("someGlobalVar", "other value"); - expect(global.someGlobalVar).to.be("test"); - expect(rewiredModule.__get__("someGlobalVar")).to.be("other value"); - delete global.someGlobalVar; - } else { - window.someGlobalVar = "test"; - rewiredModule = rewire("./moduleA.js"); - rewiredModule.__set__("someGlobalVar", "other value"); - expect(window.someGlobalVar).to.be("test"); - expect(rewiredModule.__get__("someGlobalVar")).to.be("other value"); - if (typeof navigator !== "undefined" && /MSIE [6-8]\.[0-9]/g.test(navigator.userAgent) === false) { - delete window.someGlobalVar; - } - } - }); - it("should not be a problem to have a comment on file end", function () { - var rewired = rewire("./emptyModule.js"); - - rewired.__set__("someVar", "hello"); - expect(rewired.__get__("someVar")).to.be("hello"); - }); - it("should not influence the original require if nothing has been required within the rewired module", function () { - rewire("./emptyModule.js"); // nothing happens here because emptyModule doesn't require anything - expect(require("./moduleA.js").__set__).to.be(undefined); // if restoring the original node require didn't worked, the module would have a setter - }); - it("subsequent calls of rewire should always return a new instance", function () { - expect(rewire("./moduleA.js")).not.to.be(rewire("./moduleA.js")); - }); - it("should preserve the strict mode", function () { - var strictModule = rewire("./strictModule.js"); - - expect(function () { - strictModule.doSomethingUnstrict(); - }).to.throwException(checkForTypeError); - }); - it("should not modify line numbers in stack traces", function () { - var throwError = rewire("./throwError.js"); - - try { - throwError(); - } catch (err) { - if (err.stack) { - expect(err.stack.split("\n")[1]).to.match(/:2:11/); - } - } - }); -}); \ No newline at end of file diff --git a/src/extensibility/node/node_modules/rewire/test/testModules/someOtherModule.js b/src/extensibility/node/node_modules/rewire/test/testModules/someOtherModule.js deleted file mode 100644 index da38f4c35f8..00000000000 --- a/src/extensibility/node/node_modules/rewire/test/testModules/someOtherModule.js +++ /dev/null @@ -1,6 +0,0 @@ -"use strict"; // run code in ES5 strict mode - -__filename = "/test/testModules/someOtherModule.js"; - -exports.fs = {}; -exports.filename = __filename; \ No newline at end of file diff --git a/src/extensibility/node/node_modules/rewire/test/testModules/strictModule.js b/src/extensibility/node/node_modules/rewire/test/testModules/strictModule.js deleted file mode 100644 index 5d6e3873218..00000000000 --- a/src/extensibility/node/node_modules/rewire/test/testModules/strictModule.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; // run code in ES5 strict mode - -function doSomethingUnstrict() { - var caller = arguments.callee.caller; // this should throw an error as a proof that strict mode is on -} - -exports.doSomethingUnstrict = doSomethingUnstrict; \ No newline at end of file diff --git a/src/extensibility/node/node_modules/rewire/test/testModules/throwError.js b/src/extensibility/node/node_modules/rewire/test/testModules/throwError.js deleted file mode 100644 index 9bdf68bde71..00000000000 --- a/src/extensibility/node/node_modules/rewire/test/testModules/throwError.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function () { - throw new Error(); -}; diff --git a/src/extensibility/node/node_modules/semver/.npmignore b/src/extensibility/node/node_modules/semver/.npmignore deleted file mode 100644 index 7300fbc79a7..00000000000 --- a/src/extensibility/node/node_modules/semver/.npmignore +++ /dev/null @@ -1 +0,0 @@ -# nada diff --git a/src/extensibility/node/node_modules/semver/LICENSE b/src/extensibility/node/node_modules/semver/LICENSE deleted file mode 100644 index 0c44ae716db..00000000000 --- a/src/extensibility/node/node_modules/semver/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) Isaac Z. Schlueter ("Author") -All rights reserved. - -The BSD License - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR -BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN -IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/src/extensibility/node/node_modules/semver/Makefile b/src/extensibility/node/node_modules/semver/Makefile deleted file mode 100644 index e171f70e2c4..00000000000 --- a/src/extensibility/node/node_modules/semver/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -files = semver.browser.js \ - semver.min.js \ - semver.browser.js.gz \ - semver.min.js.gz - -all: $(files) - -clean: - rm $(files) - -semver.browser.js: head.js semver.js foot.js - ( cat head.js; \ - cat semver.js | \ - egrep -v '^ *\/\* nomin \*\/' | \ - perl -pi -e 's/debug\([^\)]+\)//g'; \ - cat foot.js ) > semver.browser.js - -semver.min.js: semver.browser.js - uglifyjs -m semver.min.js - -%.gz: % - gzip --stdout -9 <$< >$@ - -.PHONY: all clean diff --git a/src/extensibility/node/node_modules/semver/README.md b/src/extensibility/node/node_modules/semver/README.md deleted file mode 100644 index 018eb573910..00000000000 --- a/src/extensibility/node/node_modules/semver/README.md +++ /dev/null @@ -1,123 +0,0 @@ -semver(1) -- The semantic versioner for npm -=========================================== - -## Usage - - $ npm install semver - - semver.valid('1.2.3') // '1.2.3' - semver.valid('a.b.c') // null - semver.clean(' =v1.2.3 ') // '1.2.3' - semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true - semver.gt('1.2.3', '9.8.7') // false - semver.lt('1.2.3', '9.8.7') // true - -As a command-line utility: - - $ semver -h - - Usage: semver [ [...]] [-r | -i | -d ] - Test if version(s) satisfy the supplied range(s), and sort them. - - Multiple versions or ranges may be supplied, unless increment - or decrement options are specified. In that case, only a single - version may be used, and it is incremented by the specified level - - Program exits successfully if any valid version satisfies - all supplied ranges, and prints all satisfying versions. - - If no versions are valid, or ranges are not satisfied, - then exits failure. - - Versions are printed in ascending order, so supplying - multiple versions to the utility will just sort them. - -## Versions - -A "version" is described by the v2.0.0 specification found at -. - -A leading `"="` or `"v"` character is stripped off and ignored. - -## Ranges - -The following range styles are supported: - -* `1.2.3` A specific version. When nothing else will do. Note that - build metadata is still ignored, so `1.2.3+build2012` will satisfy - this range. -* `>1.2.3` Greater than a specific version. -* `<1.2.3` Less than a specific version. If there is no prerelease - tag on the version range, then no prerelease version will be allowed - either, even though these are technically "less than". -* `>=1.2.3` Greater than or equal to. Note that prerelease versions - are NOT equal to their "normal" equivalents, so `1.2.3-beta` will - not satisfy this range, but `2.3.0-beta` will. -* `<=1.2.3` Less than or equal to. In this case, prerelease versions - ARE allowed, so `1.2.3-beta` would satisfy. -* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4` -* `~1.2.3` := `>=1.2.3-0 <1.3.0-0` "Reasonably close to 1.2.3". When - using tilde operators, prerelease versions are supported as well, - but a prerelease of the next significant digit will NOT be - satisfactory, so `1.3.0-beta` will not satisfy `~1.2.3`. -* `^1.2.3` := `>=1.2.3-0 <2.0.0-0` "Compatible with 1.2.3". When - using caret operators, anything from the specified version (including - prerelease) will be supported up to, but not including, the next - major version (or its prereleases). `1.5.1` will satisfy `^1.2.3`, - while `1.2.2` and `2.0.0-beta` will not. -* `^0.1.3` := `>=0.1.3-0 <0.2.0-0` "Compatible with 0.1.3". 0.x.x versions are - special: the first non-zero component indicates potentially breaking changes, - meaning the caret operator matches any version with the same first non-zero - component starting at the specified version. -* `^0.0.2` := `=0.0.2` "Only the version 0.0.2 is considered compatible" -* `~1.2` := `>=1.2.0-0 <1.3.0-0` "Any version starting with 1.2" -* `^1.2` := `>=1.2.0-0 <2.0.0-0` "Any version compatible with 1.2" -* `1.2.x` := `>=1.2.0-0 <1.3.0-0` "Any version starting with 1.2" -* `~1` := `>=1.0.0-0 <2.0.0-0` "Any version starting with 1" -* `^1` := `>=1.0.0-0 <2.0.0-0` "Any version compatible with 1" -* `1.x` := `>=1.0.0-0 <2.0.0-0` "Any version starting with 1" - - -Ranges can be joined with either a space (which implies "and") or a -`||` (which implies "or"). - -## Functions - -All methods and classes take a final `loose` boolean argument that, if -true, will be more forgiving about not-quite-valid semver strings. -The resulting output will always be 100% strict, of course. - -Strict-mode Comparators and Ranges will be strict about the SemVer -strings that they parse. - -* valid(v): Return the parsed version, or null if it's not valid. -* inc(v, release): Return the version incremented by the release type - (major, minor, patch, or prerelease), or null if it's not valid. - -### Comparison - -* gt(v1, v2): `v1 > v2` -* gte(v1, v2): `v1 >= v2` -* lt(v1, v2): `v1 < v2` -* lte(v1, v2): `v1 <= v2` -* eq(v1, v2): `v1 == v2` This is true if they're logically equivalent, - even if they're not the exact same string. You already know how to - compare strings. -* neq(v1, v2): `v1 != v2` The opposite of eq. -* cmp(v1, comparator, v2): Pass in a comparison string, and it'll call - the corresponding function above. `"==="` and `"!=="` do simple - string comparison, but are included for completeness. Throws if an - invalid comparison string is provided. -* compare(v1, v2): Return 0 if v1 == v2, or 1 if v1 is greater, or -1 if - v2 is greater. Sorts in ascending order if passed to Array.sort(). -* rcompare(v1, v2): The reverse of compare. Sorts an array of versions - in descending order when passed to Array.sort(). - - -### Ranges - -* validRange(range): Return the valid range or null if it's not valid -* satisfies(version, range): Return true if the version satisfies the - range. -* maxSatisfying(versions, range): Return the highest version in the list - that satisfies the range, or null if none of them do. diff --git a/src/extensibility/node/node_modules/semver/bin/semver b/src/extensibility/node/node_modules/semver/bin/semver deleted file mode 100755 index a6390b8f566..00000000000 --- a/src/extensibility/node/node_modules/semver/bin/semver +++ /dev/null @@ -1,119 +0,0 @@ -#!/usr/bin/env node -// Standalone semver comparison program. -// Exits successfully and prints matching version(s) if -// any supplied version is valid and passes all tests. - -var argv = process.argv.slice(2) - , versions = [] - , range = [] - , gt = [] - , lt = [] - , eq = [] - , inc = null - , version = require("../package.json").version - , loose = false - , semver = require("../semver") - -main() - -function main () { - if (!argv.length) return help() - while (argv.length) { - var a = argv.shift() - var i = a.indexOf('=') - if (i !== -1) { - a = a.slice(0, i) - argv.unshift(a.slice(i + 1)) - } - switch (a) { - case "-l": case "--loose": - loose = true - break - case "-v": case "--version": - versions.push(argv.shift()) - break - case "-i": case "--inc": case "--increment": - switch (argv[0]) { - case "major": case "minor": case "patch": case "prerelease": - inc = argv.shift() - break - default: - inc = "patch" - break - } - break - case "-r": case "--range": - range.push(argv.shift()) - break - case "-h": case "--help": case "-?": - return help() - default: - versions.push(a) - break - } - } - - versions = versions.filter(function (v) { - return semver.valid(v, loose) - }) - if (!versions.length) return fail() - if (inc && (versions.length !== 1 || range.length)) - return failInc() - - for (var i = 0, l = range.length; i < l ; i ++) { - versions = versions.filter(function (v) { - return semver.satisfies(v, range[i], loose) - }) - if (!versions.length) return fail() - } - return success(versions) -} - -function failInc () { - console.error("--inc can only be used on a single version with no range") - fail() -} - -function fail () { process.exit(1) } - -function success () { - versions.sort(function (a, b) { - return semver.compare(a, b, loose) - }).map(function (v) { - return semver.clean(v, loose) - }).map(function (v) { - return inc ? semver.inc(v, inc, loose) : v - }).forEach(function (v,i,_) { console.log(v) }) -} - -function help () { - console.log(["SemVer " + version - ,"" - ,"A JavaScript implementation of the http://semver.org/ specification" - ,"Copyright Isaac Z. Schlueter" - ,"" - ,"Usage: semver [options] [ [...]]" - ,"Prints valid versions sorted by SemVer precedence" - ,"" - ,"Options:" - ,"-r --range " - ," Print versions that match the specified range." - ,"" - ,"-i --increment []" - ," Increment a version by the specified level. Level can" - ," be one of: major, minor, patch, or prerelease" - ," Default level is 'patch'." - ," Only one version may be specified." - ,"" - ,"-l --loose" - ," Interpret versions and ranges loosely" - ,"" - ,"Program exits successfully if any valid version satisfies" - ,"all supplied ranges, and prints all satisfying versions." - ,"" - ,"If no satisfying versions are found, then exits failure." - ,"" - ,"Versions are printed in ascending order, so supplying" - ,"multiple versions to the utility will just sort them." - ].join("\n")) -} diff --git a/src/extensibility/node/node_modules/semver/foot.js b/src/extensibility/node/node_modules/semver/foot.js deleted file mode 100644 index 8f83c20f8ed..00000000000 --- a/src/extensibility/node/node_modules/semver/foot.js +++ /dev/null @@ -1,6 +0,0 @@ - -})( - typeof exports === 'object' ? exports : - typeof define === 'function' && define.amd ? {} : - semver = {} -); diff --git a/src/extensibility/node/node_modules/semver/head.js b/src/extensibility/node/node_modules/semver/head.js deleted file mode 100644 index 65368651777..00000000000 --- a/src/extensibility/node/node_modules/semver/head.js +++ /dev/null @@ -1,2 +0,0 @@ -;(function(exports) { - diff --git a/src/extensibility/node/node_modules/semver/package.json b/src/extensibility/node/node_modules/semver/package.json deleted file mode 100644 index 9d4abf9d3d1..00000000000 --- a/src/extensibility/node/node_modules/semver/package.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "semver", - "version": "2.1.0", - "description": "The semantic version parser used by npm.", - "main": "semver.js", - "browser": "semver.browser.js", - "min": "semver.min.js", - "scripts": { - "test": "tap test/*.js", - "prepublish": "make" - }, - "devDependencies": { - "tap": "0.x >=0.0.4", - "uglify-js": "~2.3.6" - }, - "license": "BSD", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/node-semver.git" - }, - "bin": { - "semver": "./bin/semver" - }, - "readme": "semver(1) -- The semantic versioner for npm\n===========================================\n\n## Usage\n\n $ npm install semver\n\n semver.valid('1.2.3') // '1.2.3'\n semver.valid('a.b.c') // null\n semver.clean(' =v1.2.3 ') // '1.2.3'\n semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true\n semver.gt('1.2.3', '9.8.7') // false\n semver.lt('1.2.3', '9.8.7') // true\n\nAs a command-line utility:\n\n $ semver -h\n\n Usage: semver [ [...]] [-r | -i | -d ]\n Test if version(s) satisfy the supplied range(s), and sort them.\n\n Multiple versions or ranges may be supplied, unless increment\n or decrement options are specified. In that case, only a single\n version may be used, and it is incremented by the specified level\n\n Program exits successfully if any valid version satisfies\n all supplied ranges, and prints all satisfying versions.\n\n If no versions are valid, or ranges are not satisfied,\n then exits failure.\n\n Versions are printed in ascending order, so supplying\n multiple versions to the utility will just sort them.\n\n## Versions\n\nA \"version\" is described by the v2.0.0 specification found at\n.\n\nA leading `\"=\"` or `\"v\"` character is stripped off and ignored.\n\n## Ranges\n\nThe following range styles are supported:\n\n* `1.2.3` A specific version. When nothing else will do. Note that\n build metadata is still ignored, so `1.2.3+build2012` will satisfy\n this range.\n* `>1.2.3` Greater than a specific version.\n* `<1.2.3` Less than a specific version. If there is no prerelease\n tag on the version range, then no prerelease version will be allowed\n either, even though these are technically \"less than\".\n* `>=1.2.3` Greater than or equal to. Note that prerelease versions\n are NOT equal to their \"normal\" equivalents, so `1.2.3-beta` will\n not satisfy this range, but `2.3.0-beta` will.\n* `<=1.2.3` Less than or equal to. In this case, prerelease versions\n ARE allowed, so `1.2.3-beta` would satisfy.\n* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4`\n* `~1.2.3` := `>=1.2.3-0 <1.3.0-0` \"Reasonably close to 1.2.3\". When\n using tilde operators, prerelease versions are supported as well,\n but a prerelease of the next significant digit will NOT be\n satisfactory, so `1.3.0-beta` will not satisfy `~1.2.3`.\n* `^1.2.3` := `>=1.2.3-0 <2.0.0-0` \"Compatible with 1.2.3\". When\n using caret operators, anything from the specified version (including\n prerelease) will be supported up to, but not including, the next\n major version (or its prereleases). `1.5.1` will satisfy `^1.2.3`,\n while `1.2.2` and `2.0.0-beta` will not.\n* `^0.1.3` := `>=0.1.3-0 <0.2.0-0` \"Compatible with 0.1.3\". 0.x.x versions are\n special: the first non-zero component indicates potentially breaking changes,\n meaning the caret operator matches any version with the same first non-zero\n component starting at the specified version.\n* `^0.0.2` := `=0.0.2` \"Only the version 0.0.2 is considered compatible\"\n* `~1.2` := `>=1.2.0-0 <1.3.0-0` \"Any version starting with 1.2\"\n* `^1.2` := `>=1.2.0-0 <2.0.0-0` \"Any version compatible with 1.2\"\n* `1.2.x` := `>=1.2.0-0 <1.3.0-0` \"Any version starting with 1.2\"\n* `~1` := `>=1.0.0-0 <2.0.0-0` \"Any version starting with 1\"\n* `^1` := `>=1.0.0-0 <2.0.0-0` \"Any version compatible with 1\"\n* `1.x` := `>=1.0.0-0 <2.0.0-0` \"Any version starting with 1\"\n\n\nRanges can be joined with either a space (which implies \"and\") or a\n`||` (which implies \"or\").\n\n## Functions\n\nAll methods and classes take a final `loose` boolean argument that, if\ntrue, will be more forgiving about not-quite-valid semver strings.\nThe resulting output will always be 100% strict, of course.\n\nStrict-mode Comparators and Ranges will be strict about the SemVer\nstrings that they parse.\n\n* valid(v): Return the parsed version, or null if it's not valid.\n* inc(v, release): Return the version incremented by the release type\n (major, minor, patch, or prerelease), or null if it's not valid.\n\n### Comparison\n\n* gt(v1, v2): `v1 > v2`\n* gte(v1, v2): `v1 >= v2`\n* lt(v1, v2): `v1 < v2`\n* lte(v1, v2): `v1 <= v2`\n* eq(v1, v2): `v1 == v2` This is true if they're logically equivalent,\n even if they're not the exact same string. You already know how to\n compare strings.\n* neq(v1, v2): `v1 != v2` The opposite of eq.\n* cmp(v1, comparator, v2): Pass in a comparison string, and it'll call\n the corresponding function above. `\"===\"` and `\"!==\"` do simple\n string comparison, but are included for completeness. Throws if an\n invalid comparison string is provided.\n* compare(v1, v2): Return 0 if v1 == v2, or 1 if v1 is greater, or -1 if\n v2 is greater. Sorts in ascending order if passed to Array.sort().\n* rcompare(v1, v2): The reverse of compare. Sorts an array of versions\n in descending order when passed to Array.sort().\n\n\n### Ranges\n\n* validRange(range): Return the valid range or null if it's not valid\n* satisfies(version, range): Return true if the version satisfies the\n range.\n* maxSatisfying(versions, range): Return the highest version in the list\n that satisfies the range, or null if none of them do.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/node-semver/issues" - }, - "_id": "semver@2.1.0", - "_from": "semver@2.x" -} diff --git a/src/extensibility/node/node_modules/semver/semver.browser.js b/src/extensibility/node/node_modules/semver/semver.browser.js deleted file mode 100644 index 087133e6921..00000000000 --- a/src/extensibility/node/node_modules/semver/semver.browser.js +++ /dev/null @@ -1,919 +0,0 @@ -;(function(exports) { - -// export the class if we are in a Node-like system. -if (typeof module === 'object' && module.exports === exports) - exports = module.exports = SemVer; - -// The debug function is excluded entirely from the minified version. - -// Note: this is the semver.org version of the spec that it implements -// Not necessarily the package version of this code. -exports.SEMVER_SPEC_VERSION = '2.0.0'; - -// The actual regexps go on exports.re -var re = exports.re = []; -var src = exports.src = []; -var R = 0; - -// The following Regular Expressions can be used for tokenizing, -// validating, and parsing SemVer version strings. - -// ## Numeric Identifier -// A single `0`, or a non-zero digit followed by zero or more digits. - -var NUMERICIDENTIFIER = R++; -src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'; -var NUMERICIDENTIFIERLOOSE = R++; -src[NUMERICIDENTIFIERLOOSE] = '[0-9]+'; - - -// ## Non-numeric Identifier -// Zero or more digits, followed by a letter or hyphen, and then zero or -// more letters, digits, or hyphens. - -var NONNUMERICIDENTIFIER = R++; -src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'; - - -// ## Main Version -// Three dot-separated numeric identifiers. - -var MAINVERSION = R++; -src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' + - '(' + src[NUMERICIDENTIFIER] + ')\\.' + - '(' + src[NUMERICIDENTIFIER] + ')'; - -var MAINVERSIONLOOSE = R++; -src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + - '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + - '(' + src[NUMERICIDENTIFIERLOOSE] + ')'; - -// ## Pre-release Version Identifier -// A numeric identifier, or a non-numeric identifier. - -var PRERELEASEIDENTIFIER = R++; -src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] + - '|' + src[NONNUMERICIDENTIFIER] + ')'; - -var PRERELEASEIDENTIFIERLOOSE = R++; -src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] + - '|' + src[NONNUMERICIDENTIFIER] + ')'; - - -// ## Pre-release Version -// Hyphen, followed by one or more dot-separated pre-release version -// identifiers. - -var PRERELEASE = R++; -src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] + - '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))'; - -var PRERELEASELOOSE = R++; -src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] + - '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))'; - -// ## Build Metadata Identifier -// Any combination of digits, letters, or hyphens. - -var BUILDIDENTIFIER = R++; -src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+'; - -// ## Build Metadata -// Plus sign, followed by one or more period-separated build metadata -// identifiers. - -var BUILD = R++; -src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] + - '(?:\\.' + src[BUILDIDENTIFIER] + ')*))'; - - -// ## Full Version String -// A main version, followed optionally by a pre-release version and -// build metadata. - -// Note that the only major, minor, patch, and pre-release sections of -// the version string are capturing groups. The build metadata is not a -// capturing group, because it should not ever be used in version -// comparison. - -var FULL = R++; -var FULLPLAIN = 'v?' + src[MAINVERSION] + - src[PRERELEASE] + '?' + - src[BUILD] + '?'; - -src[FULL] = '^' + FULLPLAIN + '$'; - -// like full, but allows v1.2.3 and =1.2.3, which people do sometimes. -// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty -// common in the npm registry. -var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] + - src[PRERELEASELOOSE] + '?' + - src[BUILD] + '?'; - -var LOOSE = R++; -src[LOOSE] = '^' + LOOSEPLAIN + '$'; - -var GTLT = R++; -src[GTLT] = '((?:<|>)?=?)'; - -// Something like "2.*" or "1.2.x". -// Note that "x.x" is a valid xRange identifer, meaning "any version" -// Only the first item is strictly required. -var XRANGEIDENTIFIERLOOSE = R++; -src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'; -var XRANGEIDENTIFIER = R++; -src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*'; - -var XRANGEPLAIN = R++; -src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' + - '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + - '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + - '(?:(' + src[PRERELEASE] + ')' + - ')?)?)?'; - -var XRANGEPLAINLOOSE = R++; -src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' + - '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + - '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + - '(?:(' + src[PRERELEASELOOSE] + ')' + - ')?)?)?'; - -// >=2.x, for example, means >=2.0.0-0 -// <1.x would be the same as "<1.0.0-0", though. -var XRANGE = R++; -src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'; -var XRANGELOOSE = R++; -src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$'; - -// Tilde ranges. -// Meaning is "reasonably at or greater than" -var LONETILDE = R++; -src[LONETILDE] = '(?:~>?)'; - -var TILDETRIM = R++; -src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+'; -re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g'); -var tildeTrimReplace = '$1~'; - -var TILDE = R++; -src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'; -var TILDELOOSE = R++; -src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'; - -// Caret ranges. -// Meaning is "at least and backwards compatible with" -var LONECARET = R++; -src[LONECARET] = '(?:\\^)'; - -var CARETTRIM = R++; -src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+'; -re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g'); -var caretTrimReplace = '$1^'; - -var CARET = R++; -src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$'; -var CARETLOOSE = R++; -src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$'; - -// A simple gt/lt/eq thing, or just "" to indicate "any version" -var COMPARATORLOOSE = R++; -src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$'; -var COMPARATOR = R++; -src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$'; - - -// An expression to strip any whitespace between the gtlt and the thing -// it modifies, so that `> 1.2.3` ==> `>1.2.3` -var COMPARATORTRIM = R++; -src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] + - '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'; - -// this one has to use the /g flag -re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g'); -var comparatorTrimReplace = '$1$2$3'; - - -// Something like `1.2.3 - 1.2.4` -// Note that these all use the loose form, because they'll be -// checked against either the strict or loose comparator form -// later. -var HYPHENRANGE = R++; -src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' + - '\\s+-\\s+' + - '(' + src[XRANGEPLAIN] + ')' + - '\\s*$'; - -var HYPHENRANGELOOSE = R++; -src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' + - '\\s+-\\s+' + - '(' + src[XRANGEPLAINLOOSE] + ')' + - '\\s*$'; - -// Star ranges basically just allow anything at all. -var STAR = R++; -src[STAR] = '(<|>)?=?\\s*\\*'; - -// Compile to actual regexp objects. -// All are flag-free, unless they were created above with a flag. -for (var i = 0; i < R; i++) { - ; - if (!re[i]) - re[i] = new RegExp(src[i]); -} - -exports.parse = parse; -function parse(version, loose) { - var r = loose ? re[LOOSE] : re[FULL]; - return (r.test(version)) ? new SemVer(version, loose) : null; -} - -exports.valid = valid; -function valid(version, loose) { - var v = parse(version, loose); - return v ? v.version : null; -} - - -exports.clean = clean; -function clean(version, loose) { - var s = parse(version, loose); - return s ? s.version : null; -} - -exports.SemVer = SemVer; - -function SemVer(version, loose) { - if (version instanceof SemVer) { - if (version.loose === loose) - return version; - else - version = version.version; - } - - if (!(this instanceof SemVer)) - return new SemVer(version, loose); - - ; - this.loose = loose; - var m = version.trim().match(loose ? re[LOOSE] : re[FULL]); - - if (!m) - throw new TypeError('Invalid Version: ' + version); - - this.raw = version; - - // these are actually numbers - this.major = +m[1]; - this.minor = +m[2]; - this.patch = +m[3]; - - // numberify any prerelease numeric ids - if (!m[4]) - this.prerelease = []; - else - this.prerelease = m[4].split('.').map(function(id) { - return (/^[0-9]+$/.test(id)) ? +id : id; - }); - - this.build = m[5] ? m[5].split('.') : []; - this.format(); -} - -SemVer.prototype.format = function() { - this.version = this.major + '.' + this.minor + '.' + this.patch; - if (this.prerelease.length) - this.version += '-' + this.prerelease.join('.'); - return this.version; -}; - -SemVer.prototype.inspect = function() { - return ''; -}; - -SemVer.prototype.toString = function() { - return this.version; -}; - -SemVer.prototype.compare = function(other) { - ; - if (!(other instanceof SemVer)) - other = new SemVer(other, this.loose); - - return this.compareMain(other) || this.comparePre(other); -}; - -SemVer.prototype.compareMain = function(other) { - if (!(other instanceof SemVer)) - other = new SemVer(other, this.loose); - - return compareIdentifiers(this.major, other.major) || - compareIdentifiers(this.minor, other.minor) || - compareIdentifiers(this.patch, other.patch); -}; - -SemVer.prototype.comparePre = function(other) { - if (!(other instanceof SemVer)) - other = new SemVer(other, this.loose); - - // NOT having a prerelease is > having one - if (this.prerelease.length && !other.prerelease.length) - return -1; - else if (!this.prerelease.length && other.prerelease.length) - return 1; - else if (!this.prerelease.lenth && !other.prerelease.length) - return 0; - - var i = 0; - do { - var a = this.prerelease[i]; - var b = other.prerelease[i]; - ; - if (a === undefined && b === undefined) - return 0; - else if (b === undefined) - return 1; - else if (a === undefined) - return -1; - else if (a === b) - continue; - else - return compareIdentifiers(a, b); - } while (++i); -}; - -SemVer.prototype.inc = function(release) { - switch (release) { - case 'major': - this.major++; - this.minor = -1; - case 'minor': - this.minor++; - this.patch = -1; - case 'patch': - this.patch++; - this.prerelease = []; - break; - case 'prerelease': - if (this.prerelease.length === 0) - this.prerelease = [0]; - else { - var i = this.prerelease.length; - while (--i >= 0) { - if (typeof this.prerelease[i] === 'number') { - this.prerelease[i]++; - i = -2; - } - } - if (i === -1) // didn't increment anything - this.prerelease.push(0); - } - break; - - default: - throw new Error('invalid increment argument: ' + release); - } - this.format(); - return this; -}; - -exports.inc = inc; -function inc(version, release, loose) { - try { - return new SemVer(version, loose).inc(release).version; - } catch (er) { - return null; - } -} - -exports.compareIdentifiers = compareIdentifiers; - -var numeric = /^[0-9]+$/; -function compareIdentifiers(a, b) { - var anum = numeric.test(a); - var bnum = numeric.test(b); - - if (anum && bnum) { - a = +a; - b = +b; - } - - return (anum && !bnum) ? -1 : - (bnum && !anum) ? 1 : - a < b ? -1 : - a > b ? 1 : - 0; -} - -exports.rcompareIdentifiers = rcompareIdentifiers; -function rcompareIdentifiers(a, b) { - return compareIdentifiers(b, a); -} - -exports.compare = compare; -function compare(a, b, loose) { - return new SemVer(a, loose).compare(b); -} - -exports.compareLoose = compareLoose; -function compareLoose(a, b) { - return compare(a, b, true); -} - -exports.rcompare = rcompare; -function rcompare(a, b, loose) { - return compare(b, a, loose); -} - -exports.sort = sort; -function sort(list, loose) { - return list.sort(function(a, b) { - return exports.compare(a, b, loose); - }); -} - -exports.rsort = rsort; -function rsort(list, loose) { - return list.sort(function(a, b) { - return exports.rcompare(a, b, loose); - }); -} - -exports.gt = gt; -function gt(a, b, loose) { - return compare(a, b, loose) > 0; -} - -exports.lt = lt; -function lt(a, b, loose) { - return compare(a, b, loose) < 0; -} - -exports.eq = eq; -function eq(a, b, loose) { - return compare(a, b, loose) === 0; -} - -exports.neq = neq; -function neq(a, b, loose) { - return compare(a, b, loose) !== 0; -} - -exports.gte = gte; -function gte(a, b, loose) { - return compare(a, b, loose) >= 0; -} - -exports.lte = lte; -function lte(a, b, loose) { - return compare(a, b, loose) <= 0; -} - -exports.cmp = cmp; -function cmp(a, op, b, loose) { - var ret; - switch (op) { - case '===': ret = a === b; break; - case '!==': ret = a !== b; break; - case '': case '=': case '==': ret = eq(a, b, loose); break; - case '!=': ret = neq(a, b, loose); break; - case '>': ret = gt(a, b, loose); break; - case '>=': ret = gte(a, b, loose); break; - case '<': ret = lt(a, b, loose); break; - case '<=': ret = lte(a, b, loose); break; - default: throw new TypeError('Invalid operator: ' + op); - } - return ret; -} - -exports.Comparator = Comparator; -function Comparator(comp, loose) { - if (comp instanceof Comparator) { - if (comp.loose === loose) - return comp; - else - comp = comp.value; - } - - if (!(this instanceof Comparator)) - return new Comparator(comp, loose); - - ; - this.loose = loose; - this.parse(comp); - - if (this.semver === ANY) - this.value = ''; - else - this.value = this.operator + this.semver.version; -} - -var ANY = {}; -Comparator.prototype.parse = function(comp) { - var r = this.loose ? re[COMPARATORLOOSE] : re[COMPARATOR]; - var m = comp.match(r); - - if (!m) - throw new TypeError('Invalid comparator: ' + comp); - - this.operator = m[1]; - // if it literally is just '>' or '' then allow anything. - if (!m[2]) - this.semver = ANY; - else { - this.semver = new SemVer(m[2], this.loose); - - // <1.2.3-rc DOES allow 1.2.3-beta (has prerelease) - // >=1.2.3 DOES NOT allow 1.2.3-beta - // <=1.2.3 DOES allow 1.2.3-beta - // However, <1.2.3 does NOT allow 1.2.3-beta, - // even though `1.2.3-beta < 1.2.3` - // The assumption is that the 1.2.3 version has something you - // *don't* want, so we push the prerelease down to the minimum. - if (this.operator === '<' && !this.semver.prerelease.length) { - this.semver.prerelease = ['0']; - this.semver.format(); - } - } -}; - -Comparator.prototype.inspect = function() { - return ''; -}; - -Comparator.prototype.toString = function() { - return this.value; -}; - -Comparator.prototype.test = function(version) { - ; - return (this.semver === ANY) ? true : - cmp(version, this.operator, this.semver, this.loose); -}; - - -exports.Range = Range; -function Range(range, loose) { - if ((range instanceof Range) && range.loose === loose) - return range; - - if (!(this instanceof Range)) - return new Range(range, loose); - - this.loose = loose; - - // First, split based on boolean or || - this.raw = range; - this.set = range.split(/\s*\|\|\s*/).map(function(range) { - return this.parseRange(range.trim()); - }, this).filter(function(c) { - // throw out any that are not relevant for whatever reason - return c.length; - }); - - if (!this.set.length) { - throw new TypeError('Invalid SemVer Range: ' + range); - } - - this.format(); -} - -Range.prototype.inspect = function() { - return ''; -}; - -Range.prototype.format = function() { - this.range = this.set.map(function(comps) { - return comps.join(' ').trim(); - }).join('||').trim(); - return this.range; -}; - -Range.prototype.toString = function() { - return this.range; -}; - -Range.prototype.parseRange = function(range) { - var loose = this.loose; - range = range.trim(); - ; - // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` - var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE]; - range = range.replace(hr, hyphenReplace); - ; - // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` - range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace); - ; - - // `~ 1.2.3` => `~1.2.3` - range = range.replace(re[TILDETRIM], tildeTrimReplace); - - // `^ 1.2.3` => `^1.2.3` - range = range.replace(re[CARETTRIM], caretTrimReplace); - - // normalize spaces - range = range.split(/\s+/).join(' '); - - // At this point, the range is completely trimmed and - // ready to be split into comparators. - - var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR]; - var set = range.split(' ').map(function(comp) { - return parseComparator(comp, loose); - }).join(' ').split(/\s+/); - if (this.loose) { - // in loose mode, throw out any that are not valid comparators - set = set.filter(function(comp) { - return !!comp.match(compRe); - }); - } - set = set.map(function(comp) { - return new Comparator(comp, loose); - }); - - return set; -}; - -// Mostly just for testing and legacy API reasons -exports.toComparators = toComparators; -function toComparators(range, loose) { - return new Range(range, loose).set.map(function(comp) { - return comp.map(function(c) { - return c.value; - }).join(' ').trim().split(' '); - }); -} - -// comprised of xranges, tildes, stars, and gtlt's at this point. -// already replaced the hyphen ranges -// turn into a set of JUST comparators. -function parseComparator(comp, loose) { - ; - comp = replaceCarets(comp, loose); - ; - comp = replaceTildes(comp, loose); - ; - comp = replaceXRanges(comp, loose); - ; - comp = replaceStars(comp, loose); - ; - return comp; -} - -function isX(id) { - return !id || id.toLowerCase() === 'x' || id === '*'; -} - -// ~, ~> --> * (any, kinda silly) -// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0 -// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0 -// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0 -// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0 -// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0 -function replaceTildes(comp, loose) { - return comp.trim().split(/\s+/).map(function(comp) { - return replaceTilde(comp, loose); - }).join(' '); -} - -function replaceTilde(comp, loose) { - var r = loose ? re[TILDELOOSE] : re[TILDE]; - return comp.replace(r, function(_, M, m, p, pr) { - ; - var ret; - - if (isX(M)) - ret = ''; - else if (isX(m)) - ret = '>=' + M + '.0.0-0 <' + (+M + 1) + '.0.0-0'; - else if (isX(p)) - // ~1.2 == >=1.2.0- <1.3.0- - ret = '>=' + M + '.' + m + '.0-0 <' + M + '.' + (+m + 1) + '.0-0'; - else if (pr) { - ; - if (pr.charAt(0) !== '-') - pr = '-' + pr; - ret = '>=' + M + '.' + m + '.' + p + pr + - ' <' + M + '.' + (+m + 1) + '.0-0'; - } else - // ~1.2.3 == >=1.2.3-0 <1.3.0-0 - ret = '>=' + M + '.' + m + '.' + p + '-0' + - ' <' + M + '.' + (+m + 1) + '.0-0'; - - ; - return ret; - }); -} - -// ^ --> * (any, kinda silly) -// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0 -// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0 -// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0 -// ^1.2.3 --> >=1.2.3 <2.0.0 -// ^1.2.0 --> >=1.2.0 <2.0.0 -function replaceCarets(comp, loose) { - return comp.trim().split(/\s+/).map(function(comp) { - return replaceCaret(comp, loose); - }).join(' '); -} - -function replaceCaret(comp, loose) { - var r = loose ? re[CARETLOOSE] : re[CARET]; - return comp.replace(r, function(_, M, m, p, pr) { - ; - var ret; - - if (isX(M)) - ret = ''; - else if (isX(m)) - ret = '>=' + M + '.0.0-0 <' + (+M + 1) + '.0.0-0'; - else if (isX(p)) - if (M === '0') ret = '>=' + M + '.' + m + '.0-0 <' + M + '.' + (+m + 1) + '.0-0'; - else ret = '>=' + M + '.' + m + '.0-0 <' + (+M + 1) + '.0.0-0'; - else if (pr) { - ; - if (pr.charAt(0) !== '-') - pr = '-' + pr; - if (M === '0') - if (m === '0') ret = '=' + M + '.' + m + '.' + p + pr; - else ret = '>=' + M + '.' + m + '.' + p + pr + - ' <' + M + '.' + (+m + 1) + '.0-0'; - else ret = '>=' + M + '.' + m + '.' + p + pr + - ' <' + (+M + 1) + '.0.0-0'; - } else - if (M === '0') - if (m === '0') ret = '=' + M + '.' + m + '.' + p; - else ret = '>=' + M + '.' + m + '.' + p + '-0' + - ' <' + M + '.' + (+m + 1) + '.0-0'; - else ret = '>=' + M + '.' + m + '.' + p + '-0' + - ' <' + (+M + 1) + '.0.0-0'; - - ; - return ret; - }); -} - -function replaceXRanges(comp, loose) { - ; - return comp.split(/\s+/).map(function(comp) { - return replaceXRange(comp, loose); - }).join(' '); -} - -function replaceXRange(comp, loose) { - comp = comp.trim(); - var r = loose ? re[XRANGELOOSE] : re[XRANGE]; - return comp.replace(r, function(ret, gtlt, M, m, p, pr) { - ; - var xM = isX(M); - var xm = xM || isX(m); - var xp = xm || isX(p); - var anyX = xp; - - if (gtlt === '=' && anyX) - gtlt = ''; - - if (gtlt && anyX) { - // replace X with 0, and then append the -0 min-prerelease - if (xM) - M = 0; - if (xm) - m = 0; - if (xp) - p = 0; - - if (gtlt === '>') { - // >1 => >=2.0.0-0 - // >1.2 => >=1.3.0-0 - // >1.2.3 => >= 1.2.4-0 - gtlt = '>='; - if (xM) { - // no change - } else if (xm) { - M = +M + 1; - m = 0; - p = 0; - } else if (xp) { - m = +m + 1; - p = 0; - } - } - - - ret = gtlt + M + '.' + m + '.' + p + '-0'; - } else if (xM) { - // allow any - ret = '*'; - } else if (xm) { - // append '-0' onto the version, otherwise - // '1.x.x' matches '2.0.0-beta', since the tag - // *lowers* the version value - ret = '>=' + M + '.0.0-0 <' + (+M + 1) + '.0.0-0'; - } else if (xp) { - ret = '>=' + M + '.' + m + '.0-0 <' + M + '.' + (+m + 1) + '.0-0'; - } - - ; - - return ret; - }); -} - -// Because * is AND-ed with everything else in the comparator, -// and '' means "any version", just remove the *s entirely. -function replaceStars(comp, loose) { - ; - // Looseness is ignored here. star is always as loose as it gets! - return comp.trim().replace(re[STAR], ''); -} - -// This function is passed to string.replace(re[HYPHENRANGE]) -// M, m, patch, prerelease, build -// 1.2 - 3.4.5 => >=1.2.0-0 <=3.4.5 -// 1.2.3 - 3.4 => >=1.2.0-0 <3.5.0-0 Any 3.4.x will do -// 1.2 - 3.4 => >=1.2.0-0 <3.5.0-0 -function hyphenReplace($0, - from, fM, fm, fp, fpr, fb, - to, tM, tm, tp, tpr, tb) { - - if (isX(fM)) - from = ''; - else if (isX(fm)) - from = '>=' + fM + '.0.0-0'; - else if (isX(fp)) - from = '>=' + fM + '.' + fm + '.0-0'; - else - from = '>=' + from; - - if (isX(tM)) - to = ''; - else if (isX(tm)) - to = '<' + (+tM + 1) + '.0.0-0'; - else if (isX(tp)) - to = '<' + tM + '.' + (+tm + 1) + '.0-0'; - else if (tpr) - to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr; - else - to = '<=' + to; - - return (from + ' ' + to).trim(); -} - - -// if ANY of the sets match ALL of its comparators, then pass -Range.prototype.test = function(version) { - if (!version) - return false; - for (var i = 0; i < this.set.length; i++) { - if (testSet(this.set[i], version)) - return true; - } - return false; -}; - -function testSet(set, version) { - for (var i = 0; i < set.length; i++) { - if (!set[i].test(version)) - return false; - } - return true; -} - -exports.satisfies = satisfies; -function satisfies(version, range, loose) { - try { - range = new Range(range, loose); - } catch (er) { - return false; - } - return range.test(version); -} - -exports.maxSatisfying = maxSatisfying; -function maxSatisfying(versions, range, loose) { - return versions.filter(function(version) { - return satisfies(version, range, loose); - }).sort(function(a, b) { - return rcompare(a, b, loose); - })[0] || null; -} - -exports.validRange = validRange; -function validRange(range, loose) { - try { - // Return '*' instead of '' so that truthiness works. - // This will throw if it's invalid anyway - return new Range(range, loose).range || '*'; - } catch (er) { - return null; - } -} - -// Use the define() function if we're in AMD land -if (typeof define === 'function' && define.amd) - define(exports); - -})( - typeof exports === 'object' ? exports : - typeof define === 'function' && define.amd ? {} : - semver = {} -); diff --git a/src/extensibility/node/node_modules/semver/semver.browser.js.gz b/src/extensibility/node/node_modules/semver/semver.browser.js.gz deleted file mode 100644 index fe7ba007c88f9c8f4e86e919f6a06ab77df05438..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6347 zcmV;+7&PY}iwFR4>H1Lu1Km7pa~n63-}NhCt!qh2Bu&Z5hm%CPw2rdTl_k3*CFNaP ziiadbP0V>@W~fIj`L|y`@SF!pWu3dKi(_*JXfzuALZbo9Zu@E;kBcyg+wv|=vLf$@ zFKcTrUI=~_#kCaUS&-)Yal z&!iX*hoY5?ev{*(CI0?*RoquSQMK-MO$bw5ffHvk`bB2DMA$h{G?AnERA|ygm_y_7 zY(9|_A>$&<ytyP=j$X4`w2hQ)rlrX(9ll#*xXjn;?TqF?7n{<-^4; z)#TaOsp2w zfMFbQ?V$f%9Y)t1XCP*>D1ey&bbX&*%a~aW8W(FOARA&=>2if`*-g`J-{$~7aPtvj{|TLzp&ITMN{U`CK{tW|#-#ZW8a`;+jt`Db ztVtM>oMNJ+-4dIkL6)1M)%p0b4-nv4D*yeJO_2+wK~z+xT(@L63T823%c%R-NR*EP zVZX~{4_vMca;arrvFNI>9m}p(Dn)pAdU$&H=J4R`uwF^)>Y10Xb{2`Lap*Ms2h+6H z23#T65m1qKBhXS(HMI!JCTlBzvh2Gp}f^Py)H zuU@cqe86_B&x;zu=r=kwQd=M^PeQ#{3rSlhrxl2FEK5ReJF zoPz=&8f@%`TokvDgS42_+cZn&Y2FtU`1yojG#o=vOTs9%=t2lM4j=}^I5@vf=Fkpd zC3I$@L(3P!kVGKsFsHB^rTOE}Z{BEO>i2hVU_L~7-n`PX@#gxfU6uU@NbXgu0Zyq4 zfq-PO2s|n4sW>fdu0Z@S=sBnM%8^}cUK>vvFwybO4S zBJNIu7*=M=$zTu?$sk5_>jC&urMT;eRghbT={e^dCSoZvbWuEe94qGperG*{83RI#5x5@kY{0N7 zlwdvpJRNu}_P-~G=irq~K3Em%i0SM8D-#J*#rf&cvD?BFatkECqv?0B@yIYF%%tBY zmbaKhI=oBUKEAGKOs=d&Ddf9RXD&XG>Q{ zTNT=C2(5}Hp@F1urY|UB7zN|cw?Q_^IVvi`(Tqa?E4|kTr-$cd=~1DLcQ1|fsG=-A zQ`jIqh0T+m*QO*rTjxq|jH9kd@6w~JLRFQ`hL}atBcO`(Z0YJ~tJ1?a5Z8cKP8h@niofk@l7glln{s(GEY&sBU#)^$>Ha;m=!wl$jqW;TY*`7 zT(`lJGfz1D`m`@7Nd6>-!+m(;m(qwT`s>xyD6tw|!wl2J&W9%Vt|LoI(c@zE8m1Ls z1TJ%Mh%ct%Y8Fh%Oe&<6ZN&%h42Bj$L6Kw?t9ict{H2yhDZc&0>x~}q@w-ozH6qXm zD-%QOEJ<2 z6An+XKmF_7PlqR!S=K3Lr8MHG=Y2!qg|4Yb{%Khj_9-Yg%#y<)vtqU7y2ayIHSAe7 zqUK>ep@$9a*3Jst7NR)`rkxyo7p5f0q0vef4V=|1pc0np+4+IzVDOy{P_4qS3$W|tjvNxebw}+^Kf?52 zdy#rFVxll&Qi|&g`~gyOexJ(2EK9O>>nLW`Q>o7#fqqHrF`*#3vf$PdLB*VX%=w@I zdj)Vj@jMy_XK7DnlTXM@_BPIud{> zg_7Y8`@JIKz4ovr=JaPWo)*^*XLT2wFk$p84%_0lB#dcPjxTUq!mxI0#sxN%!gNv{ zm_pIoQ~qLIcZ#D}-)}YGD-urRHzHhtCXS7yiz2~5sx&EaVWSt|+M(+PsHp2$J*$dK znd%$2*mb854_?)~Osbm2REX4=Zn5ZR|2We!(HxNT;zKZ;GgP__A6% zwTr^-=w%6`-ZhH)+wuv+`?u$?0=c2k%=K)b)%&^vRw)aO63<#aQ=_XlSS66&miB)< zkY;qNU|Wvt38W2(AvW@Zmr0`BEtUq_m02_p;q99G5!9FaF#x+J76@qmpT`q<6~+*P z0(m39s1z0qY(PK=7DI29po4|by?XGG1{)`!$MIZNVv=V23Sc2f{`L{q^AN1JH#fsh zqo*CaYOc7(ik?GQ4im9o2qd9yw#a5%JBk`>)3}gu%hU|7$Eg})X{j+5l^W|nz;8^Y zeq$;sH?Ge5_}>T?9-lpQ2F~DIU}h+sLC5%;nw|!xE0XCK1FIFg9`mk&Q$p+YLa~pX zIVcoqeB!cd3ViyKBc+z#PSk)~hAG_0>TS2|ajp7<6ok}MZ>xjuYZ6Z4RspUM)^vDC z(kwLB8awZ&^ZdF!=;*#4ec{j>*h?^<6;{qVW>xWOsNz+p-)uU^2M%4e)^dzq38%aX zmW@NNMc5|bUuOvfZ#G_6sJ*2~k=-kXFAemu17lR)QUX+xEY2=oG%{K*;Xs@bsCutD5PN{Q+$exabyNl&c#F}jma|zMYYqRh zg$!)=)}yWn{3L}9G}Tj8N`%={zpBy&M%{FyQEfkO)I!sJt@cR8jRR8j6xm#MYB}k! zuZCxh!!eWtlk76t!Jp%S^`XEY2QR+1XJKB{;ly%kXIFK0SO%)ZB#%N;)6zH>HAjtw_rh37NW7OpB!)_UiXb_Aom;> zSm>^CExemtMW`j2RRpOlVF)`wzBaGRq*W~ z8q>kazudGJ5{sK8t!ge&*U^iXn9hu;`$jg=#Gx5rhZbKT2DQU*)@XXy!b}oGtG7Mj z43Cn)m2K!9zx2Y*D3bsi~aeRe)$Fs12N=y}llxdp^ zj25>dTP?oe;_q7ZZE|2!gor#9t+q64fnPj-wb@T+?L3N<2`ng3GAB$0v(55NKpVH9I9+{%dXknqt)Mn2M+*yBsKl#Rs(l%4Z z4Dgl#cCK=0SG#~539w)~{i_gyjm%;jYfQ9Lhu$0ypyM_g**-4M@JK(}&7 zwhC(^M51cts^hNmKcH`=(@cU6g{di!r^4?(Dg4)^a~9P@IXk7|iz)#bpR#ISgPY>( z73$oTN0d6Gre??Q6PkN~yRhM7Qxj5+RtC^G=`*2Utme0+aouf~e zF4oKCSlyGI<@1~dYm90?3;)1d@KByt5E}or`J!X>SvNl@cos~dqUh56uRJ`Tf}P0% zFYBYKM0f%yo^U(xG?ROb7)DZgS!ka)yv5sLtSVS`Dt&cXIpnQ+VzS1H`IfAgY@~6S z;n*-Db2;SgraN;V$HK81LzGNpcaeK82i!TK;K88#sd#;72xbt^o;krjbFpI&C~#P0 zQ7&W2!iATa9P|+&TAlJSvg0H#^x-u6v;aghwEY=R#7s_u@x3^BcckW?+(Z{eVtd1k ztoQCj8(w)$)Uh}Y=&v$##m2N|mUSjdv#KqrhdR4swa-c8sT*`zND;=BxZ^W@$_wC8 z+akbAp2#aanA^%l;98uzgT~gROn>5BH&bT>>HI5FNk$fs)Sb35SF_gg4hNSx(9>* z((nE@{nNkWf8iGqs5>!Y?(4OBCF-KTfI$##EBHGzqtOaF2cex>SY;fprHnJxNIuCQPSl+r*9r=nptL$F8YPO*%x_Zv!>IZ?hTS1 zQ*cqzD?8_QZ9MgBR~&am)D_T4YBFf{`~v0g%n})u@wnsU(M-b0IW2%dQ5k4|h%xRl z9qgiuQeqDa+M8Ik)v@Ju*iwT{$rqGc%e1G2+H39)pCax-_iHQKn~_67wSUVL%@(1` z`{U~%J1E)%&d|4dExQMwqJ;SPS(@#xLK=Y*c}j0kqiu9+PxNm8d0(w1T=)FvH)7YH;Z%*k{R?^3)Y~F%EpzQ<|5Fzqm-E5o zSN@DoWaLkGiZ$&Bzq^xjDTE%BC6-=&q(60doOcM{oII)%7F1~nMx zlZ$k!kann7RjE@2lk9t}OdU5&mncb{hqTjyFk0KWj=ZuDui=bqqC5#-Bz(`;rUuS8 z;es@k>Y65az9@`)c5lS7w!33%X2<%dt*MM`WmKt59p9%uCTMHz5cj>~hqynsg()g~ z!{4jIAd~0&mvxmGSz$Hj5S@C>HZZ$g&u_p0z0;4B)DqywK@IJZM(h0VA|D=^!q(`X zhV;1MaG(xh>LZNkI!hU0xxG0Jx#rEoG|a_r#dWI{4p2To?WOt?{6Qe3o=06Wke(1>w8!m3Is2iC~C119-$rt*}CfatZrM{5i zT}AJ5{w$LbUZKRM8@c%wYQN%ytN9Q!FF-eRzAwf*nz(&7jgt(>1mViQpo9~BQD=4= z+~@cS4tCA(5EfzzQTVg^xZ6oQ)4kFzjKuKe95Yt#_gvE;$CQ`4kRDIn=5ErTRxHYs z^Q{i+)5F95zs@h@)7(%Hc^8~0!7 zz@I*i>z-J#AW;c~&Eo2~WKDjfbWtOEj67>G@m{F`yzROK7n)#DgIaQn$OBOJU(`AP zzhPQ!ShzM`)EK$J0POWz4@=Dp>yrz1%KVu5CxqO_iJKj76JMa6;5xet_{d)g03z_1 zkp4U|7#+JIha_wC*rH`lI0Pj7Yra zy=3p*8HZP{QRQ`m@$XgVl|3p?Y<8z;37^!OW9h-^1qY@-3@$KkufKh-H^S{p`5u1L zaTY5)u-H>|{$Qg;=TT%p+c_|o>u;ri0^#(JlkRPjea`##kQPjbG~e)kARU-%;jtFp z1cWF6X5tl&w5UT0Fj5ujt$4!(X!u!uUxcr%wL8vKjbDXt@kikgj(-p{+`)D3C2nB#z79@n7H N{{fj{;Ykf&005HBRG0t& diff --git a/src/extensibility/node/node_modules/semver/semver.js b/src/extensibility/node/node_modules/semver/semver.js deleted file mode 100644 index 5445fc170b1..00000000000 --- a/src/extensibility/node/node_modules/semver/semver.js +++ /dev/null @@ -1,923 +0,0 @@ -// export the class if we are in a Node-like system. -if (typeof module === 'object' && module.exports === exports) - exports = module.exports = SemVer; - -// The debug function is excluded entirely from the minified version. -/* nomin */ var debug; -/* nomin */ if (typeof process === 'object' && - /* nomin */ process.env && - /* nomin */ process.env.NODE_DEBUG && - /* nomin */ /\bsemver\b/i.test(process.env.NODE_DEBUG)) - /* nomin */ debug = function() { - /* nomin */ var args = Array.prototype.slice.call(arguments, 0); - /* nomin */ args.unshift('SEMVER'); - /* nomin */ console.log.apply(console, args); - /* nomin */ }; -/* nomin */ else - /* nomin */ debug = function() {}; - -// Note: this is the semver.org version of the spec that it implements -// Not necessarily the package version of this code. -exports.SEMVER_SPEC_VERSION = '2.0.0'; - -// The actual regexps go on exports.re -var re = exports.re = []; -var src = exports.src = []; -var R = 0; - -// The following Regular Expressions can be used for tokenizing, -// validating, and parsing SemVer version strings. - -// ## Numeric Identifier -// A single `0`, or a non-zero digit followed by zero or more digits. - -var NUMERICIDENTIFIER = R++; -src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'; -var NUMERICIDENTIFIERLOOSE = R++; -src[NUMERICIDENTIFIERLOOSE] = '[0-9]+'; - - -// ## Non-numeric Identifier -// Zero or more digits, followed by a letter or hyphen, and then zero or -// more letters, digits, or hyphens. - -var NONNUMERICIDENTIFIER = R++; -src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'; - - -// ## Main Version -// Three dot-separated numeric identifiers. - -var MAINVERSION = R++; -src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' + - '(' + src[NUMERICIDENTIFIER] + ')\\.' + - '(' + src[NUMERICIDENTIFIER] + ')'; - -var MAINVERSIONLOOSE = R++; -src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + - '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + - '(' + src[NUMERICIDENTIFIERLOOSE] + ')'; - -// ## Pre-release Version Identifier -// A numeric identifier, or a non-numeric identifier. - -var PRERELEASEIDENTIFIER = R++; -src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] + - '|' + src[NONNUMERICIDENTIFIER] + ')'; - -var PRERELEASEIDENTIFIERLOOSE = R++; -src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] + - '|' + src[NONNUMERICIDENTIFIER] + ')'; - - -// ## Pre-release Version -// Hyphen, followed by one or more dot-separated pre-release version -// identifiers. - -var PRERELEASE = R++; -src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] + - '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))'; - -var PRERELEASELOOSE = R++; -src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] + - '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))'; - -// ## Build Metadata Identifier -// Any combination of digits, letters, or hyphens. - -var BUILDIDENTIFIER = R++; -src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+'; - -// ## Build Metadata -// Plus sign, followed by one or more period-separated build metadata -// identifiers. - -var BUILD = R++; -src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] + - '(?:\\.' + src[BUILDIDENTIFIER] + ')*))'; - - -// ## Full Version String -// A main version, followed optionally by a pre-release version and -// build metadata. - -// Note that the only major, minor, patch, and pre-release sections of -// the version string are capturing groups. The build metadata is not a -// capturing group, because it should not ever be used in version -// comparison. - -var FULL = R++; -var FULLPLAIN = 'v?' + src[MAINVERSION] + - src[PRERELEASE] + '?' + - src[BUILD] + '?'; - -src[FULL] = '^' + FULLPLAIN + '$'; - -// like full, but allows v1.2.3 and =1.2.3, which people do sometimes. -// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty -// common in the npm registry. -var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] + - src[PRERELEASELOOSE] + '?' + - src[BUILD] + '?'; - -var LOOSE = R++; -src[LOOSE] = '^' + LOOSEPLAIN + '$'; - -var GTLT = R++; -src[GTLT] = '((?:<|>)?=?)'; - -// Something like "2.*" or "1.2.x". -// Note that "x.x" is a valid xRange identifer, meaning "any version" -// Only the first item is strictly required. -var XRANGEIDENTIFIERLOOSE = R++; -src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'; -var XRANGEIDENTIFIER = R++; -src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*'; - -var XRANGEPLAIN = R++; -src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' + - '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + - '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + - '(?:(' + src[PRERELEASE] + ')' + - ')?)?)?'; - -var XRANGEPLAINLOOSE = R++; -src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' + - '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + - '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + - '(?:(' + src[PRERELEASELOOSE] + ')' + - ')?)?)?'; - -// >=2.x, for example, means >=2.0.0-0 -// <1.x would be the same as "<1.0.0-0", though. -var XRANGE = R++; -src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'; -var XRANGELOOSE = R++; -src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$'; - -// Tilde ranges. -// Meaning is "reasonably at or greater than" -var LONETILDE = R++; -src[LONETILDE] = '(?:~>?)'; - -var TILDETRIM = R++; -src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+'; -re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g'); -var tildeTrimReplace = '$1~'; - -var TILDE = R++; -src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'; -var TILDELOOSE = R++; -src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'; - -// Caret ranges. -// Meaning is "at least and backwards compatible with" -var LONECARET = R++; -src[LONECARET] = '(?:\\^)'; - -var CARETTRIM = R++; -src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+'; -re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g'); -var caretTrimReplace = '$1^'; - -var CARET = R++; -src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$'; -var CARETLOOSE = R++; -src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$'; - -// A simple gt/lt/eq thing, or just "" to indicate "any version" -var COMPARATORLOOSE = R++; -src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$'; -var COMPARATOR = R++; -src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$'; - - -// An expression to strip any whitespace between the gtlt and the thing -// it modifies, so that `> 1.2.3` ==> `>1.2.3` -var COMPARATORTRIM = R++; -src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] + - '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'; - -// this one has to use the /g flag -re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g'); -var comparatorTrimReplace = '$1$2$3'; - - -// Something like `1.2.3 - 1.2.4` -// Note that these all use the loose form, because they'll be -// checked against either the strict or loose comparator form -// later. -var HYPHENRANGE = R++; -src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' + - '\\s+-\\s+' + - '(' + src[XRANGEPLAIN] + ')' + - '\\s*$'; - -var HYPHENRANGELOOSE = R++; -src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' + - '\\s+-\\s+' + - '(' + src[XRANGEPLAINLOOSE] + ')' + - '\\s*$'; - -// Star ranges basically just allow anything at all. -var STAR = R++; -src[STAR] = '(<|>)?=?\\s*\\*'; - -// Compile to actual regexp objects. -// All are flag-free, unless they were created above with a flag. -for (var i = 0; i < R; i++) { - debug(i, src[i]); - if (!re[i]) - re[i] = new RegExp(src[i]); -} - -exports.parse = parse; -function parse(version, loose) { - var r = loose ? re[LOOSE] : re[FULL]; - return (r.test(version)) ? new SemVer(version, loose) : null; -} - -exports.valid = valid; -function valid(version, loose) { - var v = parse(version, loose); - return v ? v.version : null; -} - - -exports.clean = clean; -function clean(version, loose) { - var s = parse(version, loose); - return s ? s.version : null; -} - -exports.SemVer = SemVer; - -function SemVer(version, loose) { - if (version instanceof SemVer) { - if (version.loose === loose) - return version; - else - version = version.version; - } - - if (!(this instanceof SemVer)) - return new SemVer(version, loose); - - debug('SemVer', version, loose); - this.loose = loose; - var m = version.trim().match(loose ? re[LOOSE] : re[FULL]); - - if (!m) - throw new TypeError('Invalid Version: ' + version); - - this.raw = version; - - // these are actually numbers - this.major = +m[1]; - this.minor = +m[2]; - this.patch = +m[3]; - - // numberify any prerelease numeric ids - if (!m[4]) - this.prerelease = []; - else - this.prerelease = m[4].split('.').map(function(id) { - return (/^[0-9]+$/.test(id)) ? +id : id; - }); - - this.build = m[5] ? m[5].split('.') : []; - this.format(); -} - -SemVer.prototype.format = function() { - this.version = this.major + '.' + this.minor + '.' + this.patch; - if (this.prerelease.length) - this.version += '-' + this.prerelease.join('.'); - return this.version; -}; - -SemVer.prototype.inspect = function() { - return ''; -}; - -SemVer.prototype.toString = function() { - return this.version; -}; - -SemVer.prototype.compare = function(other) { - debug('SemVer.compare', this.version, this.loose, other); - if (!(other instanceof SemVer)) - other = new SemVer(other, this.loose); - - return this.compareMain(other) || this.comparePre(other); -}; - -SemVer.prototype.compareMain = function(other) { - if (!(other instanceof SemVer)) - other = new SemVer(other, this.loose); - - return compareIdentifiers(this.major, other.major) || - compareIdentifiers(this.minor, other.minor) || - compareIdentifiers(this.patch, other.patch); -}; - -SemVer.prototype.comparePre = function(other) { - if (!(other instanceof SemVer)) - other = new SemVer(other, this.loose); - - // NOT having a prerelease is > having one - if (this.prerelease.length && !other.prerelease.length) - return -1; - else if (!this.prerelease.length && other.prerelease.length) - return 1; - else if (!this.prerelease.lenth && !other.prerelease.length) - return 0; - - var i = 0; - do { - var a = this.prerelease[i]; - var b = other.prerelease[i]; - debug('prerelease compare', i, a, b); - if (a === undefined && b === undefined) - return 0; - else if (b === undefined) - return 1; - else if (a === undefined) - return -1; - else if (a === b) - continue; - else - return compareIdentifiers(a, b); - } while (++i); -}; - -SemVer.prototype.inc = function(release) { - switch (release) { - case 'major': - this.major++; - this.minor = -1; - case 'minor': - this.minor++; - this.patch = -1; - case 'patch': - this.patch++; - this.prerelease = []; - break; - case 'prerelease': - if (this.prerelease.length === 0) - this.prerelease = [0]; - else { - var i = this.prerelease.length; - while (--i >= 0) { - if (typeof this.prerelease[i] === 'number') { - this.prerelease[i]++; - i = -2; - } - } - if (i === -1) // didn't increment anything - this.prerelease.push(0); - } - break; - - default: - throw new Error('invalid increment argument: ' + release); - } - this.format(); - return this; -}; - -exports.inc = inc; -function inc(version, release, loose) { - try { - return new SemVer(version, loose).inc(release).version; - } catch (er) { - return null; - } -} - -exports.compareIdentifiers = compareIdentifiers; - -var numeric = /^[0-9]+$/; -function compareIdentifiers(a, b) { - var anum = numeric.test(a); - var bnum = numeric.test(b); - - if (anum && bnum) { - a = +a; - b = +b; - } - - return (anum && !bnum) ? -1 : - (bnum && !anum) ? 1 : - a < b ? -1 : - a > b ? 1 : - 0; -} - -exports.rcompareIdentifiers = rcompareIdentifiers; -function rcompareIdentifiers(a, b) { - return compareIdentifiers(b, a); -} - -exports.compare = compare; -function compare(a, b, loose) { - return new SemVer(a, loose).compare(b); -} - -exports.compareLoose = compareLoose; -function compareLoose(a, b) { - return compare(a, b, true); -} - -exports.rcompare = rcompare; -function rcompare(a, b, loose) { - return compare(b, a, loose); -} - -exports.sort = sort; -function sort(list, loose) { - return list.sort(function(a, b) { - return exports.compare(a, b, loose); - }); -} - -exports.rsort = rsort; -function rsort(list, loose) { - return list.sort(function(a, b) { - return exports.rcompare(a, b, loose); - }); -} - -exports.gt = gt; -function gt(a, b, loose) { - return compare(a, b, loose) > 0; -} - -exports.lt = lt; -function lt(a, b, loose) { - return compare(a, b, loose) < 0; -} - -exports.eq = eq; -function eq(a, b, loose) { - return compare(a, b, loose) === 0; -} - -exports.neq = neq; -function neq(a, b, loose) { - return compare(a, b, loose) !== 0; -} - -exports.gte = gte; -function gte(a, b, loose) { - return compare(a, b, loose) >= 0; -} - -exports.lte = lte; -function lte(a, b, loose) { - return compare(a, b, loose) <= 0; -} - -exports.cmp = cmp; -function cmp(a, op, b, loose) { - var ret; - switch (op) { - case '===': ret = a === b; break; - case '!==': ret = a !== b; break; - case '': case '=': case '==': ret = eq(a, b, loose); break; - case '!=': ret = neq(a, b, loose); break; - case '>': ret = gt(a, b, loose); break; - case '>=': ret = gte(a, b, loose); break; - case '<': ret = lt(a, b, loose); break; - case '<=': ret = lte(a, b, loose); break; - default: throw new TypeError('Invalid operator: ' + op); - } - return ret; -} - -exports.Comparator = Comparator; -function Comparator(comp, loose) { - if (comp instanceof Comparator) { - if (comp.loose === loose) - return comp; - else - comp = comp.value; - } - - if (!(this instanceof Comparator)) - return new Comparator(comp, loose); - - debug('comparator', comp, loose); - this.loose = loose; - this.parse(comp); - - if (this.semver === ANY) - this.value = ''; - else - this.value = this.operator + this.semver.version; -} - -var ANY = {}; -Comparator.prototype.parse = function(comp) { - var r = this.loose ? re[COMPARATORLOOSE] : re[COMPARATOR]; - var m = comp.match(r); - - if (!m) - throw new TypeError('Invalid comparator: ' + comp); - - this.operator = m[1]; - // if it literally is just '>' or '' then allow anything. - if (!m[2]) - this.semver = ANY; - else { - this.semver = new SemVer(m[2], this.loose); - - // <1.2.3-rc DOES allow 1.2.3-beta (has prerelease) - // >=1.2.3 DOES NOT allow 1.2.3-beta - // <=1.2.3 DOES allow 1.2.3-beta - // However, <1.2.3 does NOT allow 1.2.3-beta, - // even though `1.2.3-beta < 1.2.3` - // The assumption is that the 1.2.3 version has something you - // *don't* want, so we push the prerelease down to the minimum. - if (this.operator === '<' && !this.semver.prerelease.length) { - this.semver.prerelease = ['0']; - this.semver.format(); - } - } -}; - -Comparator.prototype.inspect = function() { - return ''; -}; - -Comparator.prototype.toString = function() { - return this.value; -}; - -Comparator.prototype.test = function(version) { - debug('Comparator.test', version, this.loose); - return (this.semver === ANY) ? true : - cmp(version, this.operator, this.semver, this.loose); -}; - - -exports.Range = Range; -function Range(range, loose) { - if ((range instanceof Range) && range.loose === loose) - return range; - - if (!(this instanceof Range)) - return new Range(range, loose); - - this.loose = loose; - - // First, split based on boolean or || - this.raw = range; - this.set = range.split(/\s*\|\|\s*/).map(function(range) { - return this.parseRange(range.trim()); - }, this).filter(function(c) { - // throw out any that are not relevant for whatever reason - return c.length; - }); - - if (!this.set.length) { - throw new TypeError('Invalid SemVer Range: ' + range); - } - - this.format(); -} - -Range.prototype.inspect = function() { - return ''; -}; - -Range.prototype.format = function() { - this.range = this.set.map(function(comps) { - return comps.join(' ').trim(); - }).join('||').trim(); - return this.range; -}; - -Range.prototype.toString = function() { - return this.range; -}; - -Range.prototype.parseRange = function(range) { - var loose = this.loose; - range = range.trim(); - debug('range', range, loose); - // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` - var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE]; - range = range.replace(hr, hyphenReplace); - debug('hyphen replace', range); - // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` - range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace); - debug('comparator trim', range, re[COMPARATORTRIM]); - - // `~ 1.2.3` => `~1.2.3` - range = range.replace(re[TILDETRIM], tildeTrimReplace); - - // `^ 1.2.3` => `^1.2.3` - range = range.replace(re[CARETTRIM], caretTrimReplace); - - // normalize spaces - range = range.split(/\s+/).join(' '); - - // At this point, the range is completely trimmed and - // ready to be split into comparators. - - var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR]; - var set = range.split(' ').map(function(comp) { - return parseComparator(comp, loose); - }).join(' ').split(/\s+/); - if (this.loose) { - // in loose mode, throw out any that are not valid comparators - set = set.filter(function(comp) { - return !!comp.match(compRe); - }); - } - set = set.map(function(comp) { - return new Comparator(comp, loose); - }); - - return set; -}; - -// Mostly just for testing and legacy API reasons -exports.toComparators = toComparators; -function toComparators(range, loose) { - return new Range(range, loose).set.map(function(comp) { - return comp.map(function(c) { - return c.value; - }).join(' ').trim().split(' '); - }); -} - -// comprised of xranges, tildes, stars, and gtlt's at this point. -// already replaced the hyphen ranges -// turn into a set of JUST comparators. -function parseComparator(comp, loose) { - debug('comp', comp); - comp = replaceCarets(comp, loose); - debug('caret', comp); - comp = replaceTildes(comp, loose); - debug('tildes', comp); - comp = replaceXRanges(comp, loose); - debug('xrange', comp); - comp = replaceStars(comp, loose); - debug('stars', comp); - return comp; -} - -function isX(id) { - return !id || id.toLowerCase() === 'x' || id === '*'; -} - -// ~, ~> --> * (any, kinda silly) -// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0 -// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0 -// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0 -// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0 -// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0 -function replaceTildes(comp, loose) { - return comp.trim().split(/\s+/).map(function(comp) { - return replaceTilde(comp, loose); - }).join(' '); -} - -function replaceTilde(comp, loose) { - var r = loose ? re[TILDELOOSE] : re[TILDE]; - return comp.replace(r, function(_, M, m, p, pr) { - debug('tilde', comp, _, M, m, p, pr); - var ret; - - if (isX(M)) - ret = ''; - else if (isX(m)) - ret = '>=' + M + '.0.0-0 <' + (+M + 1) + '.0.0-0'; - else if (isX(p)) - // ~1.2 == >=1.2.0- <1.3.0- - ret = '>=' + M + '.' + m + '.0-0 <' + M + '.' + (+m + 1) + '.0-0'; - else if (pr) { - debug('replaceTilde pr', pr); - if (pr.charAt(0) !== '-') - pr = '-' + pr; - ret = '>=' + M + '.' + m + '.' + p + pr + - ' <' + M + '.' + (+m + 1) + '.0-0'; - } else - // ~1.2.3 == >=1.2.3-0 <1.3.0-0 - ret = '>=' + M + '.' + m + '.' + p + '-0' + - ' <' + M + '.' + (+m + 1) + '.0-0'; - - debug('tilde return', ret); - return ret; - }); -} - -// ^ --> * (any, kinda silly) -// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0 -// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0 -// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0 -// ^1.2.3 --> >=1.2.3 <2.0.0 -// ^1.2.0 --> >=1.2.0 <2.0.0 -function replaceCarets(comp, loose) { - return comp.trim().split(/\s+/).map(function(comp) { - return replaceCaret(comp, loose); - }).join(' '); -} - -function replaceCaret(comp, loose) { - var r = loose ? re[CARETLOOSE] : re[CARET]; - return comp.replace(r, function(_, M, m, p, pr) { - debug('caret', comp, _, M, m, p, pr); - var ret; - - if (isX(M)) - ret = ''; - else if (isX(m)) - ret = '>=' + M + '.0.0-0 <' + (+M + 1) + '.0.0-0'; - else if (isX(p)) - if (M === '0') ret = '>=' + M + '.' + m + '.0-0 <' + M + '.' + (+m + 1) + '.0-0'; - else ret = '>=' + M + '.' + m + '.0-0 <' + (+M + 1) + '.0.0-0'; - else if (pr) { - debug('replaceCaret pr', pr); - if (pr.charAt(0) !== '-') - pr = '-' + pr; - if (M === '0') - if (m === '0') ret = '=' + M + '.' + m + '.' + p + pr; - else ret = '>=' + M + '.' + m + '.' + p + pr + - ' <' + M + '.' + (+m + 1) + '.0-0'; - else ret = '>=' + M + '.' + m + '.' + p + pr + - ' <' + (+M + 1) + '.0.0-0'; - } else - if (M === '0') - if (m === '0') ret = '=' + M + '.' + m + '.' + p; - else ret = '>=' + M + '.' + m + '.' + p + '-0' + - ' <' + M + '.' + (+m + 1) + '.0-0'; - else ret = '>=' + M + '.' + m + '.' + p + '-0' + - ' <' + (+M + 1) + '.0.0-0'; - - debug('caret return', ret); - return ret; - }); -} - -function replaceXRanges(comp, loose) { - debug('replaceXRanges', comp, loose); - return comp.split(/\s+/).map(function(comp) { - return replaceXRange(comp, loose); - }).join(' '); -} - -function replaceXRange(comp, loose) { - comp = comp.trim(); - var r = loose ? re[XRANGELOOSE] : re[XRANGE]; - return comp.replace(r, function(ret, gtlt, M, m, p, pr) { - debug('xRange', comp, ret, gtlt, M, m, p, pr); - var xM = isX(M); - var xm = xM || isX(m); - var xp = xm || isX(p); - var anyX = xp; - - if (gtlt === '=' && anyX) - gtlt = ''; - - if (gtlt && anyX) { - // replace X with 0, and then append the -0 min-prerelease - if (xM) - M = 0; - if (xm) - m = 0; - if (xp) - p = 0; - - if (gtlt === '>') { - // >1 => >=2.0.0-0 - // >1.2 => >=1.3.0-0 - // >1.2.3 => >= 1.2.4-0 - gtlt = '>='; - if (xM) { - // no change - } else if (xm) { - M = +M + 1; - m = 0; - p = 0; - } else if (xp) { - m = +m + 1; - p = 0; - } - } - - - ret = gtlt + M + '.' + m + '.' + p + '-0'; - } else if (xM) { - // allow any - ret = '*'; - } else if (xm) { - // append '-0' onto the version, otherwise - // '1.x.x' matches '2.0.0-beta', since the tag - // *lowers* the version value - ret = '>=' + M + '.0.0-0 <' + (+M + 1) + '.0.0-0'; - } else if (xp) { - ret = '>=' + M + '.' + m + '.0-0 <' + M + '.' + (+m + 1) + '.0-0'; - } - - debug('xRange return', ret); - - return ret; - }); -} - -// Because * is AND-ed with everything else in the comparator, -// and '' means "any version", just remove the *s entirely. -function replaceStars(comp, loose) { - debug('replaceStars', comp, loose); - // Looseness is ignored here. star is always as loose as it gets! - return comp.trim().replace(re[STAR], ''); -} - -// This function is passed to string.replace(re[HYPHENRANGE]) -// M, m, patch, prerelease, build -// 1.2 - 3.4.5 => >=1.2.0-0 <=3.4.5 -// 1.2.3 - 3.4 => >=1.2.0-0 <3.5.0-0 Any 3.4.x will do -// 1.2 - 3.4 => >=1.2.0-0 <3.5.0-0 -function hyphenReplace($0, - from, fM, fm, fp, fpr, fb, - to, tM, tm, tp, tpr, tb) { - - if (isX(fM)) - from = ''; - else if (isX(fm)) - from = '>=' + fM + '.0.0-0'; - else if (isX(fp)) - from = '>=' + fM + '.' + fm + '.0-0'; - else - from = '>=' + from; - - if (isX(tM)) - to = ''; - else if (isX(tm)) - to = '<' + (+tM + 1) + '.0.0-0'; - else if (isX(tp)) - to = '<' + tM + '.' + (+tm + 1) + '.0-0'; - else if (tpr) - to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr; - else - to = '<=' + to; - - return (from + ' ' + to).trim(); -} - - -// if ANY of the sets match ALL of its comparators, then pass -Range.prototype.test = function(version) { - if (!version) - return false; - for (var i = 0; i < this.set.length; i++) { - if (testSet(this.set[i], version)) - return true; - } - return false; -}; - -function testSet(set, version) { - for (var i = 0; i < set.length; i++) { - if (!set[i].test(version)) - return false; - } - return true; -} - -exports.satisfies = satisfies; -function satisfies(version, range, loose) { - try { - range = new Range(range, loose); - } catch (er) { - return false; - } - return range.test(version); -} - -exports.maxSatisfying = maxSatisfying; -function maxSatisfying(versions, range, loose) { - return versions.filter(function(version) { - return satisfies(version, range, loose); - }).sort(function(a, b) { - return rcompare(a, b, loose); - })[0] || null; -} - -exports.validRange = validRange; -function validRange(range, loose) { - try { - // Return '*' instead of '' so that truthiness works. - // This will throw if it's invalid anyway - return new Range(range, loose).range || '*'; - } catch (er) { - return null; - } -} - -// Use the define() function if we're in AMD land -if (typeof define === 'function' && define.amd) - define(exports); diff --git a/src/extensibility/node/node_modules/semver/semver.min.js b/src/extensibility/node/node_modules/semver/semver.min.js deleted file mode 100644 index 45e22e0bcab..00000000000 --- a/src/extensibility/node/node_modules/semver/semver.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(e){if(typeof module==="object"&&module.exports===e)e=module.exports=H;e.SEMVER_SPEC_VERSION="2.0.0";var r=e.re=[];var t=e.src=[];var n=0;var i=n++;t[i]="0|[1-9]\\d*";var s=n++;t[s]="[0-9]+";var o=n++;t[o]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var a=n++;t[a]="("+t[i]+")\\."+"("+t[i]+")\\."+"("+t[i]+")";var f=n++;t[f]="("+t[s]+")\\."+"("+t[s]+")\\."+"("+t[s]+")";var u=n++;t[u]="(?:"+t[i]+"|"+t[o]+")";var c=n++;t[c]="(?:"+t[s]+"|"+t[o]+")";var l=n++;t[l]="(?:-("+t[u]+"(?:\\."+t[u]+")*))";var p=n++;t[p]="(?:-?("+t[c]+"(?:\\."+t[c]+")*))";var h=n++;t[h]="[0-9A-Za-z-]+";var v=n++;t[v]="(?:\\+("+t[h]+"(?:\\."+t[h]+")*))";var m=n++;var g="v?"+t[a]+t[l]+"?"+t[v]+"?";t[m]="^"+g+"$";var w="[v=\\s]*"+t[f]+t[p]+"?"+t[v]+"?";var d=n++;t[d]="^"+w+"$";var y=n++;t[y]="((?:<|>)?=?)";var $=n++;t[$]=t[s]+"|x|X|\\*";var j=n++;t[j]=t[i]+"|x|X|\\*";var b=n++;t[b]="[v=\\s]*("+t[j]+")"+"(?:\\.("+t[j]+")"+"(?:\\.("+t[j]+")"+"(?:("+t[l]+")"+")?)?)?";var E=n++;t[E]="[v=\\s]*("+t[$]+")"+"(?:\\.("+t[$]+")"+"(?:\\.("+t[$]+")"+"(?:("+t[p]+")"+")?)?)?";var x=n++;t[x]="^"+t[y]+"\\s*"+t[b]+"$";var R=n++;t[R]="^"+t[y]+"\\s*"+t[E]+"$";var S=n++;t[S]="(?:~>?)";var k=n++;t[k]="(\\s*)"+t[S]+"\\s+";r[k]=new RegExp(t[k],"g");var V="$1~";var I=n++;t[I]="^"+t[S]+t[b]+"$";var A=n++;t[A]="^"+t[S]+t[E]+"$";var C=n++;t[C]="(?:\\^)";var T=n++;t[T]="(\\s*)"+t[C]+"\\s+";r[T]=new RegExp(t[T],"g");var z="$1^";var M=n++;t[M]="^"+t[C]+t[b]+"$";var P=n++;t[P]="^"+t[C]+t[E]+"$";var Z=n++;t[Z]="^"+t[y]+"\\s*("+w+")$|^$";var q=n++;t[q]="^"+t[y]+"\\s*("+g+")$|^$";var L=n++;t[L]="(\\s*)"+t[y]+"\\s*("+w+"|"+t[b]+")";r[L]=new RegExp(t[L],"g");var X="$1$2$3";var _=n++;t[_]="^\\s*("+t[b]+")"+"\\s+-\\s+"+"("+t[b]+")"+"\\s*$";var N=n++;t[N]="^\\s*("+t[E]+")"+"\\s+-\\s+"+"("+t[E]+")"+"\\s*$";var O=n++;t[O]="(<|>)?=?\\s*\\*";for(var B=0;B'};H.prototype.toString=function(){return this.version};H.prototype.compare=function(e){if(!(e instanceof H))e=new H(e,this.loose);return this.compareMain(e)||this.comparePre(e)};H.prototype.compareMain=function(e){if(!(e instanceof H))e=new H(e,this.loose);return Q(this.major,e.major)||Q(this.minor,e.minor)||Q(this.patch,e.patch)};H.prototype.comparePre=function(e){if(!(e instanceof H))e=new H(e,this.loose);if(this.prerelease.length&&!e.prerelease.length)return-1;else if(!this.prerelease.length&&e.prerelease.length)return 1;else if(!this.prerelease.lenth&&!e.prerelease.length)return 0;var r=0;do{var t=this.prerelease[r];var n=e.prerelease[r];if(t===undefined&&n===undefined)return 0;else if(n===undefined)return 1;else if(t===undefined)return-1;else if(t===n)continue;else return Q(t,n)}while(++r)};H.prototype.inc=function(e){switch(e){case"major":this.major++;this.minor=-1;case"minor":this.minor++;this.patch=-1;case"patch":this.patch++;this.prerelease=[];break;case"prerelease":if(this.prerelease.length===0)this.prerelease=[0];else{var r=this.prerelease.length;while(--r>=0){if(typeof this.prerelease[r]==="number"){this.prerelease[r]++;r=-2}}if(r===-1)this.prerelease.push(0)}break;default:throw new Error("invalid increment argument: "+e)}this.format();return this};e.inc=J;function J(e,r,t){try{return new H(e,t).inc(r).version}catch(n){return null}}e.compareIdentifiers=Q;var K=/^[0-9]+$/;function Q(e,r){var t=K.test(e);var n=K.test(r);if(t&&n){e=+e;r=+r}return t&&!n?-1:n&&!t?1:er?1:0}e.rcompareIdentifiers=U;function U(e,r){return Q(r,e)}e.compare=W;function W(e,r,t){return new H(e,t).compare(r)}e.compareLoose=Y;function Y(e,r){return W(e,r,true)}e.rcompare=er;function er(e,r,t){return W(r,e,t)}e.sort=rr;function rr(r,t){return r.sort(function(r,n){return e.compare(r,n,t)})}e.rsort=tr;function tr(r,t){return r.sort(function(r,n){return e.rcompare(r,n,t)})}e.gt=nr;function nr(e,r,t){return W(e,r,t)>0}e.lt=ir;function ir(e,r,t){return W(e,r,t)<0}e.eq=sr;function sr(e,r,t){return W(e,r,t)===0}e.neq=or;function or(e,r,t){return W(e,r,t)!==0}e.gte=ar;function ar(e,r,t){return W(e,r,t)>=0}e.lte=fr;function fr(e,r,t){return W(e,r,t)<=0}e.cmp=ur;function ur(e,r,t,n){var i;switch(r){case"===":i=e===t;break;case"!==":i=e!==t;break;case"":case"=":case"==":i=sr(e,t,n);break;case"!=":i=or(e,t,n);break;case">":i=nr(e,t,n);break;case">=":i=ar(e,t,n);break;case"<":i=ir(e,t,n);break;case"<=":i=fr(e,t,n);break;default:throw new TypeError("Invalid operator: "+r)}return i}e.Comparator=cr;function cr(e,r){if(e instanceof cr){if(e.loose===r)return e;else e=e.value}if(!(this instanceof cr))return new cr(e,r);this.loose=r;this.parse(e);if(this.semver===lr)this.value="";else this.value=this.operator+this.semver.version}var lr={};cr.prototype.parse=function(e){var t=this.loose?r[Z]:r[q];var n=e.match(t);if(!n)throw new TypeError("Invalid comparator: "+e);this.operator=n[1];if(!n[2])this.semver=lr;else{this.semver=new H(n[2],this.loose);if(this.operator==="<"&&!this.semver.prerelease.length){this.semver.prerelease=["0"];this.semver.format()}}};cr.prototype.inspect=function(){return''};cr.prototype.toString=function(){return this.value};cr.prototype.test=function(e){return this.semver===lr?true:ur(e,this.operator,this.semver,this.loose)};e.Range=pr;function pr(e,r){if(e instanceof pr&&e.loose===r)return e;if(!(this instanceof pr))return new pr(e,r);this.loose=r;this.raw=e;this.set=e.split(/\s*\|\|\s*/).map(function(e){return this.parseRange(e.trim())},this).filter(function(e){return e.length});if(!this.set.length){throw new TypeError("Invalid SemVer Range: "+e)}this.format()}pr.prototype.inspect=function(){return''};pr.prototype.format=function(){this.range=this.set.map(function(e){return e.join(" ").trim()}).join("||").trim();return this.range};pr.prototype.toString=function(){return this.range};pr.prototype.parseRange=function(e){var t=this.loose;e=e.trim();var n=t?r[N]:r[_];e=e.replace(n,Er);e=e.replace(r[L],X);e=e.replace(r[k],V);e=e.replace(r[T],z);e=e.split(/\s+/).join(" ");var i=t?r[Z]:r[q];var s=e.split(" ").map(function(e){return vr(e,t)}).join(" ").split(/\s+/);if(this.loose){s=s.filter(function(e){return!!e.match(i)})}s=s.map(function(e){return new cr(e,t)});return s};e.toComparators=hr;function hr(e,r){return new pr(e,r).set.map(function(e){return e.map(function(e){return e.value}).join(" ").trim().split(" ")})}function vr(e,r){e=dr(e,r);e=gr(e,r);e=$r(e,r);e=br(e,r);return e}function mr(e){return!e||e.toLowerCase()==="x"||e==="*"}function gr(e,r){return e.trim().split(/\s+/).map(function(e){return wr(e,r)}).join(" ")}function wr(e,t){var n=t?r[A]:r[I];return e.replace(n,function(e,r,t,n,i){var s;if(mr(r))s="";else if(mr(t))s=">="+r+".0.0-0 <"+(+r+1)+".0.0-0";else if(mr(n))s=">="+r+"."+t+".0-0 <"+r+"."+(+t+1)+".0-0";else if(i){if(i.charAt(0)!=="-")i="-"+i;s=">="+r+"."+t+"."+n+i+" <"+r+"."+(+t+1)+".0-0"}else s=">="+r+"."+t+"."+n+"-0"+" <"+r+"."+(+t+1)+".0-0";return s})}function dr(e,r){return e.trim().split(/\s+/).map(function(e){return yr(e,r)}).join(" ")}function yr(e,t){var n=t?r[P]:r[M];return e.replace(n,function(e,r,t,n,i){var s;if(mr(r))s="";else if(mr(t))s=">="+r+".0.0-0 <"+(+r+1)+".0.0-0";else if(mr(n))if(r==="0")s=">="+r+"."+t+".0-0 <"+r+"."+(+t+1)+".0-0";else s=">="+r+"."+t+".0-0 <"+(+r+1)+".0.0-0";else if(i){if(i.charAt(0)!=="-")i="-"+i;if(r==="0")if(t==="0")s="="+r+"."+t+"."+n+i;else s=">="+r+"."+t+"."+n+i+" <"+r+"."+(+t+1)+".0-0";else s=">="+r+"."+t+"."+n+i+" <"+(+r+1)+".0.0-0"}else if(r==="0")if(t==="0")s="="+r+"."+t+"."+n;else s=">="+r+"."+t+"."+n+"-0"+" <"+r+"."+(+t+1)+".0-0";else s=">="+r+"."+t+"."+n+"-0"+" <"+(+r+1)+".0.0-0";return s})}function $r(e,r){return e.split(/\s+/).map(function(e){return jr(e,r)}).join(" ")}function jr(e,t){e=e.trim();var n=t?r[R]:r[x];return e.replace(n,function(e,r,t,n,i,s){var o=mr(t);var a=o||mr(n);var f=a||mr(i);var u=f;if(r==="="&&u)r="";if(r&&u){if(o)t=0;if(a)n=0;if(f)i=0;if(r===">"){r=">=";if(o){}else if(a){t=+t+1;n=0;i=0}else if(f){n=+n+1;i=0}}e=r+t+"."+n+"."+i+"-0"}else if(o){e="*"}else if(a){e=">="+t+".0.0-0 <"+(+t+1)+".0.0-0"}else if(f){e=">="+t+"."+n+".0-0 <"+t+"."+(+n+1)+".0-0"}return e})}function br(e,t){return e.trim().replace(r[O],"")}function Er(e,r,t,n,i,s,o,a,f,u,c,l,p){if(mr(t))r="";else if(mr(n))r=">="+t+".0.0-0";else if(mr(i))r=">="+t+"."+n+".0-0";else r=">="+r;if(mr(f))a="";else if(mr(u))a="<"+(+f+1)+".0.0-0";else if(mr(c))a="<"+f+"."+(+u+1)+".0-0";else if(l)a="<="+f+"."+u+"."+c+"-"+l;else a="<="+a;return(r+" "+a).trim()}pr.prototype.test=function(e){if(!e)return false;for(var r=0;rH1Lu1I1cxciXlO{wt17PAgTm>vX#xt{ujw&9b#yUz4uw>bO0M zLfcAh$))JL)Yg9c1xQe$WGPLz5BKz(Mg$&!AP9m0lby*b4rP?YF89{a#FaNoo=jSc zxUyWpX8?%mU*F27zTLZ-mt9%mKe(*f_E9KCpVbo}|`_0i#H_&9m?>Lqg? zb$i{OGq?;yOEBIQoQ=k6Bw>__&^9Nc(O3W0P zqaLt)O;3oP03Fezp!4l<=VNC~9{}x)Nk>4~0I;s(<4nHeot}0b|CX_qosjIr$fgx+ z?O4mMNOpy?!@kkH!H=YXg#-%=SXu*{6Kt+w9W~nu_%KlO>yh`sBY`CeEJN~qy^a^aaWT&SoY@?4G;Nw!tVu(8@tIoB8t6aeiF>cUYFmQi!;0@W3EZZgS z?wFCkuQwkyr>7J%7sS3mcC^JlBlg+2uu?hWLT#9F$Q?*(Jg2cY#D98qj` zzS~J^ysVkxnx?qcu0vP(aGFx(@UwC5$z#GD*Wr!|+zH`Mbb$PQV4VGh7+;Wqf*wkq zXe|(30y#0iY8~_G(e=_rWZRiKo|1mYoZY>@wWepJ>6tO*WL&oOF##Tz0G5%51UNKN z{E3WwON_TABM&Vj-&Tx#YZ>_sjr^oFy&z35j17ksBVQBXbqQb@`H=u0s~&e%gnPT2 zPlWtR$gefXX$kq9kk3o&D=XfZo%e9P&nxSFZmstNu6Os*?oV3zXHxzd%^-b7lXhT7 zd6BZD#dtvGy(A4UOB#-vG#qVfctsjs;R5NjBU_!?Ng`YXJ%L;2$$mU|;`{0n+!3QE zV-No;uN8+?=gnT;7)6THjxCC?M_h1thP5;BqD6R@{|5m2klhQQK36 z?#HY79F$!K^XQ!YS}6M!*g`9l>=!jKdgM@cFS$qoX2ioe4`TLPA^zJBiJ$PrJ1*eb z&gHdr=mg%1;#3B4i1olzP3q2*B*n5odZd&O_&nt;4%ay8&d`CboJDC_fsrVDFhCHg zlyv>`t`yP2^}35dhBMdlrZ+&vu_tFDxl&r*LalNn1Z<-7ELM(ey`%ND9G{bZ5nM5@ zKNrD8BA6eK_QphrVoi8NgeA_3grCNGy3x;LPjdtp9K4;X(nT%0N=I-vUCtxvI$Z~s zuypP6N;}};Ctb7bKFq_y=Y5`$xo4|r4%gS{KjR_(XX)#Y$VdoV@Q&+cPhs{%CRno( zk>&GwYlWpvVa57=2k+#3^~F%F9amjhS9i|ishoMXKA$-qBUS(}k|G$tD2lvaeGC6@DiKpAbw@er&3plu(RqEZHYMet+n@4CK zp5+CRsuw|oS~eS-_*!tF)lQB0e>wddx7f!v*FV7kL&p6?GX5;cYG2!2|ExFd^*?t^ zW4zqEx5I0qNUx-`r;iX$)Fj?4-MU@+J9D>s)Q9v2=Lu!Xik6WW=lQ5i#pOc&TgB&m z62<)d-o4l!7E>4lYuSbUvWDF$vtutzVj0CN%C$u-v|}&3nniQ&`o8e02P`aYX?hi5 zLWQpomg1<;ar#zT@a>ccCTJLr3{0g9-%gYUrbYx)-#M(5HO~YOzK}%DaQclQ1dH!& zXWyPqziYjT^^ybamQF_;fC{Uz-QH+ya^uzFj0=ZyW{C|e0e3vg@LCgq?d(-8>MmF5 z%HJs-l)L;gB90QG3gt-xcI|dUvyGv zEObhMbK$Ky^Er6W7nxZM9L#vw+3UyfA%}Z?zAtdd4+IQ)V3DXX>CeJ~KeYw<5rA~( z73*N{3*>v_pl#<68cZ!jpQ|e5uR{K>(oCdHtkiVINXA7Wz(r-o_h=oAK_E?pWWoXq z;o4B45Jj;d+QnY+!rpd_>XZdaqqH>2AJHgkR8A#}Eq(F!a`gBBw`nd}WPzh5@IHe1 zSC(4fvs&UiaS->J}@z7{h-6-xOC=O}AHR#L}0Ku%oCQ9?l-YacmLEk_AW zDy;3yR#Sl|OD+PL2+V14z{sZ&c=Axi9P(IbIW!ddq*YsvP*i#jQP*<>^A)e}I6&TR zIcOTY=Md&9gMQAnN|}@|AaTNsb3sKf&cYnWD*H7_eVP^fmT;bV)hnG~>ueAT>vq;X zq4S$&eQm2aOlldfY3034Ez|2xBFMd>PSnIkreoX8Z$->4p-wxlCatTa zvgMD3j#6Zz20Q{Iik*_8hK5_=S-ye>UzuLH<#^d z!^@;dODUUK$9yJA<)(E=Z;zrzhR$5xR+w3CgH`17U()=Xol|b$Y?^=V=3i%`^rXlO z4GUrUif=Z!+ULm?7l)ABU99b#Ylv<2JH-c1AvZ0roR{sScxYJWm6o-aStz~|)o0nq z7(vhSXIVRf3+1}DYe!lz#TbF5LH*IINjSh*N<7JWNC~`He@q~ndb!wv1Itu? z9VqlV-_ZbS8-|-OP=eSO6KCSBV+O9@Q`8LV$YM9(|48jgj!w`wnEfrqT<@eTpF&w1 zS(6f6PeLM+A|`$jQfX-=epKS;YatA=1SPPE=LHr0D@9Vynlz=X&|oIyomI{CGFKR8Kr8is=wp_d zYY_1Rid`2@9hBKYUb!xBZI7^^=cfCZ1fVegy(>P!i~UNqKM?d=*lS_haXAv>HqToa zY^*X{VOA7U*L14Q6d3YyKYtdM<~O{2B**5#vSeIlPXb9HkWo5`c*>5ga_v}@o?jW& zYe?C8Yb|LN=Fv36+U@#8X}`e={=`y$Qhk!*xAacAEs&JTZ+@lpR-i_`@n&QH`dK#v zUn~Q@kQXbD%cdk%Z3XlxaFRoMlPJF|7w_%*HyfBz)f2;V~EaD~r0Ha&v6aWAK diff --git a/src/extensibility/node/node_modules/semver/test/amd.js b/src/extensibility/node/node_modules/semver/test/amd.js deleted file mode 100644 index a6041341b37..00000000000 --- a/src/extensibility/node/node_modules/semver/test/amd.js +++ /dev/null @@ -1,15 +0,0 @@ -var tap = require('tap'); -var test = tap.test; - -test('amd', function(t) { - global.define = define; - define.amd = true; - var defined = null; - function define(stuff) { - defined = stuff; - } - var fromRequire = require('../'); - t.ok(defined, 'amd function called'); - t.equal(fromRequire, defined, 'amd stuff same as require stuff'); - t.end(); -}); diff --git a/src/extensibility/node/node_modules/semver/test/index.js b/src/extensibility/node/node_modules/semver/test/index.js deleted file mode 100644 index 5b488b2f847..00000000000 --- a/src/extensibility/node/node_modules/semver/test/index.js +++ /dev/null @@ -1,556 +0,0 @@ -var tap = require('tap'); -var test = tap.test; -var semver = require('../semver.js'); -var eq = semver.eq; -var gt = semver.gt; -var lt = semver.lt; -var neq = semver.neq; -var cmp = semver.cmp; -var gte = semver.gte; -var lte = semver.lte; -var satisfies = semver.satisfies; -var validRange = semver.validRange; -var inc = semver.inc; -var replaceStars = semver.replaceStars; -var toComparators = semver.toComparators; -var SemVer = semver.SemVer; -var Range = semver.Range; - -test('\ncomparison tests', function(t) { - // [version1, version2] - // version1 should be greater than version2 - [['0.0.0', '0.0.0-foo'], - ['0.0.1', '0.0.0'], - ['1.0.0', '0.9.9'], - ['0.10.0', '0.9.0'], - ['0.99.0', '0.10.0'], - ['2.0.0', '1.2.3'], - ['v0.0.0', '0.0.0-foo', true], - ['v0.0.1', '0.0.0', true], - ['v1.0.0', '0.9.9', true], - ['v0.10.0', '0.9.0', true], - ['v0.99.0', '0.10.0', true], - ['v2.0.0', '1.2.3', true], - ['0.0.0', 'v0.0.0-foo', true], - ['0.0.1', 'v0.0.0', true], - ['1.0.0', 'v0.9.9', true], - ['0.10.0', 'v0.9.0', true], - ['0.99.0', 'v0.10.0', true], - ['2.0.0', 'v1.2.3', true], - ['1.2.3', '1.2.3-asdf'], - ['1.2.3', '1.2.3-4'], - ['1.2.3', '1.2.3-4-foo'], - ['1.2.3-5-foo', '1.2.3-5'], - ['1.2.3-5', '1.2.3-4'], - ['1.2.3-5-foo', '1.2.3-5-Foo'], - ['3.0.0', '2.7.2+asdf'], - ['1.2.3-a.10', '1.2.3-a.5'], - ['1.2.3-a.b', '1.2.3-a.5'], - ['1.2.3-a.b', '1.2.3-a'], - ['1.2.3-a.b.c.10.d.5', '1.2.3-a.b.c.5.d.100'] - ].forEach(function(v) { - var v0 = v[0]; - var v1 = v[1]; - var loose = v[2]; - t.ok(gt(v0, v1, loose), "gt('" + v0 + "', '" + v1 + "')"); - t.ok(lt(v1, v0, loose), "lt('" + v1 + "', '" + v0 + "')"); - t.ok(!gt(v1, v0, loose), "!gt('" + v1 + "', '" + v0 + "')"); - t.ok(!lt(v0, v1, loose), "!lt('" + v0 + "', '" + v1 + "')"); - t.ok(eq(v0, v0, loose), "eq('" + v0 + "', '" + v0 + "')"); - t.ok(eq(v1, v1, loose), "eq('" + v1 + "', '" + v1 + "')"); - t.ok(neq(v0, v1, loose), "neq('" + v0 + "', '" + v1 + "')"); - t.ok(cmp(v1, '==', v1, loose), "cmp('" + v1 + "' == '" + v1 + "')"); - t.ok(cmp(v0, '>=', v1, loose), "cmp('" + v0 + "' >= '" + v1 + "')"); - t.ok(cmp(v1, '<=', v0, loose), "cmp('" + v1 + "' <= '" + v0 + "')"); - t.ok(cmp(v0, '!=', v1, loose), "cmp('" + v0 + "' != '" + v1 + "')"); - }); - t.end(); -}); - -test('\nequality tests', function(t) { - // [version1, version2] - // version1 should be equivalent to version2 - [['1.2.3', 'v1.2.3', true], - ['1.2.3', '=1.2.3', true], - ['1.2.3', 'v 1.2.3', true], - ['1.2.3', '= 1.2.3', true], - ['1.2.3', ' v1.2.3', true], - ['1.2.3', ' =1.2.3', true], - ['1.2.3', ' v 1.2.3', true], - ['1.2.3', ' = 1.2.3', true], - ['1.2.3-0', 'v1.2.3-0', true], - ['1.2.3-0', '=1.2.3-0', true], - ['1.2.3-0', 'v 1.2.3-0', true], - ['1.2.3-0', '= 1.2.3-0', true], - ['1.2.3-0', ' v1.2.3-0', true], - ['1.2.3-0', ' =1.2.3-0', true], - ['1.2.3-0', ' v 1.2.3-0', true], - ['1.2.3-0', ' = 1.2.3-0', true], - ['1.2.3-1', 'v1.2.3-1', true], - ['1.2.3-1', '=1.2.3-1', true], - ['1.2.3-1', 'v 1.2.3-1', true], - ['1.2.3-1', '= 1.2.3-1', true], - ['1.2.3-1', ' v1.2.3-1', true], - ['1.2.3-1', ' =1.2.3-1', true], - ['1.2.3-1', ' v 1.2.3-1', true], - ['1.2.3-1', ' = 1.2.3-1', true], - ['1.2.3-beta', 'v1.2.3-beta', true], - ['1.2.3-beta', '=1.2.3-beta', true], - ['1.2.3-beta', 'v 1.2.3-beta', true], - ['1.2.3-beta', '= 1.2.3-beta', true], - ['1.2.3-beta', ' v1.2.3-beta', true], - ['1.2.3-beta', ' =1.2.3-beta', true], - ['1.2.3-beta', ' v 1.2.3-beta', true], - ['1.2.3-beta', ' = 1.2.3-beta', true], - ['1.2.3-beta+build', ' = 1.2.3-beta+otherbuild', true], - ['1.2.3+build', ' = 1.2.3+otherbuild', true], - ['1.2.3-beta+build', '1.2.3-beta+otherbuild'], - ['1.2.3+build', '1.2.3+otherbuild'], - [' v1.2.3+build', '1.2.3+otherbuild'] - ].forEach(function(v) { - var v0 = v[0]; - var v1 = v[1]; - var loose = v[2]; - t.ok(eq(v0, v1, loose), "eq('" + v0 + "', '" + v1 + "')"); - t.ok(!neq(v0, v1, loose), "!neq('" + v0 + "', '" + v1 + "')"); - t.ok(cmp(v0, '==', v1, loose), 'cmp(' + v0 + '==' + v1 + ')'); - t.ok(!cmp(v0, '!=', v1, loose), '!cmp(' + v0 + '!=' + v1 + ')'); - t.ok(!cmp(v0, '===', v1, loose), '!cmp(' + v0 + '===' + v1 + ')'); - t.ok(cmp(v0, '!==', v1, loose), 'cmp(' + v0 + '!==' + v1 + ')'); - t.ok(!gt(v0, v1, loose), "!gt('" + v0 + "', '" + v1 + "')"); - t.ok(gte(v0, v1, loose), "gte('" + v0 + "', '" + v1 + "')"); - t.ok(!lt(v0, v1, loose), "!lt('" + v0 + "', '" + v1 + "')"); - t.ok(lte(v0, v1, loose), "lte('" + v0 + "', '" + v1 + "')"); - }); - t.end(); -}); - - -test('\nrange tests', function(t) { - // [range, version] - // version should be included by range - [['1.0.0 - 2.0.0', '1.2.3'], - ['1.0.0', '1.0.0'], - ['>=*', '0.2.4'], - ['', '1.0.0'], - ['*', '1.2.3'], - ['*', 'v1.2.3-foo', true], - ['>=1.0.0', '1.0.0'], - ['>=1.0.0', '1.0.1'], - ['>=1.0.0', '1.1.0'], - ['>1.0.0', '1.0.1'], - ['>1.0.0', '1.1.0'], - ['<=2.0.0', '2.0.0'], - ['<=2.0.0', '1.9999.9999'], - ['<=2.0.0', '0.2.9'], - ['<2.0.0', '1.9999.9999'], - ['<2.0.0', '0.2.9'], - ['>= 1.0.0', '1.0.0'], - ['>= 1.0.0', '1.0.1'], - ['>= 1.0.0', '1.1.0'], - ['> 1.0.0', '1.0.1'], - ['> 1.0.0', '1.1.0'], - ['<= 2.0.0', '2.0.0'], - ['<= 2.0.0', '1.9999.9999'], - ['<= 2.0.0', '0.2.9'], - ['< 2.0.0', '1.9999.9999'], - ['<\t2.0.0', '0.2.9'], - ['>=0.1.97', 'v0.1.97', true], - ['>=0.1.97', '0.1.97'], - ['0.1.20 || 1.2.4', '1.2.4'], - ['>=0.2.3 || <0.0.1', '0.0.0'], - ['>=0.2.3 || <0.0.1', '0.2.3'], - ['>=0.2.3 || <0.0.1', '0.2.4'], - ['||', '1.3.4'], - ['2.x.x', '2.1.3'], - ['1.2.x', '1.2.3'], - ['1.2.x || 2.x', '2.1.3'], - ['1.2.x || 2.x', '1.2.3'], - ['x', '1.2.3'], - ['2.*.*', '2.1.3'], - ['1.2.*', '1.2.3'], - ['1.2.* || 2.*', '2.1.3'], - ['1.2.* || 2.*', '1.2.3'], - ['*', '1.2.3'], - ['2', '2.1.2'], - ['2.3', '2.3.1'], - ['~2.4', '2.4.0'], // >=2.4.0 <2.5.0 - ['~2.4', '2.4.5'], - ['~>3.2.1', '3.2.2'], // >=3.2.1 <3.3.0, - ['~1', '1.2.3'], // >=1.0.0 <2.0.0 - ['~>1', '1.2.3'], - ['~> 1', '1.2.3'], - ['~1.0', '1.0.2'], // >=1.0.0 <1.1.0, - ['~ 1.0', '1.0.2'], - ['~ 1.0.3', '1.0.12'], - ['>=1', '1.0.0'], - ['>= 1', '1.0.0'], - ['<1.2', '1.1.1'], - ['< 1.2', '1.1.1'], - ['1', '1.0.0beta', true], - ['~v0.5.4-pre', '0.5.5'], - ['~v0.5.4-pre', '0.5.4'], - ['=0.7.x', '0.7.2'], - ['>=0.7.x', '0.7.2'], - ['=0.7.x', '0.7.0-asdf'], - ['>=0.7.x', '0.7.0-asdf'], - ['<=0.7.x', '0.6.2'], - ['~1.2.1 >=1.2.3', '1.2.3'], - ['~1.2.1 =1.2.3', '1.2.3'], - ['~1.2.1 1.2.3', '1.2.3'], - ['~1.2.1 >=1.2.3 1.2.3', '1.2.3'], - ['~1.2.1 1.2.3 >=1.2.3', '1.2.3'], - ['~1.2.1 1.2.3', '1.2.3'], - ['>=1.2.1 1.2.3', '1.2.3'], - ['1.2.3 >=1.2.1', '1.2.3'], - ['>=1.2.3 >=1.2.1', '1.2.3'], - ['>=1.2.1 >=1.2.3', '1.2.3'], - ['<=1.2.3', '1.2.3-beta'], - ['>1.2', '1.3.0-beta'], - ['>=1.2', '1.2.8'], - ['^1.2.3', '1.8.1'], - ['^1.2.3', '1.2.3-beta'], - ['^0.1.2', '0.1.2'], - ['^0.1', '0.1.2'], - ['^1.2', '1.4.2'], - ['^1.2 ^1', '1.4.2'], - ['^1.2', '1.2.0-pre'], - ['^1.2.3', '1.2.3-pre'] - ].forEach(function(v) { - var range = v[0]; - var ver = v[1]; - var loose = v[2]; - t.ok(satisfies(ver, range, loose), range + ' satisfied by ' + ver); - }); - t.end(); -}); - -test('\nnegative range tests', function(t) { - // [range, version] - // version should not be included by range - [['1.0.0 - 2.0.0', '2.2.3'], - ['1.0.0', '1.0.1'], - ['>=1.0.0', '0.0.0'], - ['>=1.0.0', '0.0.1'], - ['>=1.0.0', '0.1.0'], - ['>1.0.0', '0.0.1'], - ['>1.0.0', '0.1.0'], - ['<=2.0.0', '3.0.0'], - ['<=2.0.0', '2.9999.9999'], - ['<=2.0.0', '2.2.9'], - ['<2.0.0', '2.9999.9999'], - ['<2.0.0', '2.2.9'], - ['>=0.1.97', 'v0.1.93', true], - ['>=0.1.97', '0.1.93'], - ['0.1.20 || 1.2.4', '1.2.3'], - ['>=0.2.3 || <0.0.1', '0.0.3'], - ['>=0.2.3 || <0.0.1', '0.2.2'], - ['2.x.x', '1.1.3'], - ['2.x.x', '3.1.3'], - ['1.2.x', '1.3.3'], - ['1.2.x || 2.x', '3.1.3'], - ['1.2.x || 2.x', '1.1.3'], - ['2.*.*', '1.1.3'], - ['2.*.*', '3.1.3'], - ['1.2.*', '1.3.3'], - ['1.2.* || 2.*', '3.1.3'], - ['1.2.* || 2.*', '1.1.3'], - ['2', '1.1.2'], - ['2.3', '2.4.1'], - ['~2.4', '2.5.0'], // >=2.4.0 <2.5.0 - ['~2.4', '2.3.9'], - ['~>3.2.1', '3.3.2'], // >=3.2.1 <3.3.0 - ['~>3.2.1', '3.2.0'], // >=3.2.1 <3.3.0 - ['~1', '0.2.3'], // >=1.0.0 <2.0.0 - ['~>1', '2.2.3'], - ['~1.0', '1.1.0'], // >=1.0.0 <1.1.0 - ['<1', '1.0.0'], - ['>=1.2', '1.1.1'], - ['1', '2.0.0beta', true], - ['~v0.5.4-beta', '0.5.4-alpha'], - ['<1', '1.0.0beta', true], - ['< 1', '1.0.0beta', true], - ['=0.7.x', '0.8.2'], - ['>=0.7.x', '0.6.2'], - ['<=0.7.x', '0.7.2'], - ['<1.2.3', '1.2.3-beta'], - ['=1.2.3', '1.2.3-beta'], - ['>1.2', '1.2.8'], - ['^1.2.3', '2.0.0-alpha'], - ['^1.2.3', '1.2.2'], - ['^1.2', '1.1.9'], - // invalid ranges never satisfied! - ['blerg', '1.2.3'], - ['git+https://user:password0123@github.com/foo', '123.0.0', true], - ['^1.2.3', '2.0.0-pre'] - ].forEach(function(v) { - var range = v[0]; - var ver = v[1]; - var loose = v[2]; - var found = satisfies(ver, range, loose); - t.ok(!found, ver + ' not satisfied by ' + range); - }); - t.end(); -}); - -test('\nincrement versions test', function(t) { - // [version, inc, result] - // inc(version, inc) -> result - [['1.2.3', 'major', '2.0.0'], - ['1.2.3', 'minor', '1.3.0'], - ['1.2.3', 'patch', '1.2.4'], - ['1.2.3tag', 'major', '2.0.0', true], - ['1.2.3-tag', 'major', '2.0.0'], - ['1.2.3', 'fake', null], - ['fake', 'major', null], - ['1.2.3', 'prerelease', '1.2.3-0'], - ['1.2.3-0', 'prerelease', '1.2.3-1'], - ['1.2.3-alpha.0', 'prerelease', '1.2.3-alpha.1'], - ['1.2.3-alpha.1', 'prerelease', '1.2.3-alpha.2'], - ['1.2.3-alpha.2', 'prerelease', '1.2.3-alpha.3'], - ['1.2.3-alpha.0.beta', 'prerelease', '1.2.3-alpha.1.beta'], - ['1.2.3-alpha.1.beta', 'prerelease', '1.2.3-alpha.2.beta'], - ['1.2.3-alpha.2.beta', 'prerelease', '1.2.3-alpha.3.beta'], - ['1.2.3-alpha.10.0.beta', 'prerelease', '1.2.3-alpha.10.1.beta'], - ['1.2.3-alpha.10.1.beta', 'prerelease', '1.2.3-alpha.10.2.beta'], - ['1.2.3-alpha.10.2.beta', 'prerelease', '1.2.3-alpha.10.3.beta'], - ['1.2.3-alpha.10.beta.0', 'prerelease', '1.2.3-alpha.10.beta.1'], - ['1.2.3-alpha.10.beta.1', 'prerelease', '1.2.3-alpha.10.beta.2'], - ['1.2.3-alpha.10.beta.2', 'prerelease', '1.2.3-alpha.10.beta.3'], - ['1.2.3-alpha.9.beta', 'prerelease', '1.2.3-alpha.10.beta'], - ['1.2.3-alpha.10.beta', 'prerelease', '1.2.3-alpha.11.beta'], - ['1.2.3-alpha.11.beta', 'prerelease', '1.2.3-alpha.12.beta'] - ].forEach(function(v) { - var pre = v[0]; - var what = v[1]; - var wanted = v[2]; - var loose = v[3]; - var found = inc(pre, what, loose); - t.equal(found, wanted, 'inc(' + pre + ', ' + what + ') === ' + wanted); - }); - - t.end(); -}); - -test('\nvalid range test', function(t) { - // [range, result] - // validRange(range) -> result - // translate ranges into their canonical form - [['1.0.0 - 2.0.0', '>=1.0.0 <=2.0.0'], - ['1.0.0', '1.0.0'], - ['>=*', '>=0.0.0-0'], - ['', '*'], - ['*', '*'], - ['*', '*'], - ['>=1.0.0', '>=1.0.0'], - ['>1.0.0', '>1.0.0'], - ['<=2.0.0', '<=2.0.0'], - ['1', '>=1.0.0-0 <2.0.0-0'], - ['<=2.0.0', '<=2.0.0'], - ['<=2.0.0', '<=2.0.0'], - ['<2.0.0', '<2.0.0-0'], - ['<2.0.0', '<2.0.0-0'], - ['>= 1.0.0', '>=1.0.0'], - ['>= 1.0.0', '>=1.0.0'], - ['>= 1.0.0', '>=1.0.0'], - ['> 1.0.0', '>1.0.0'], - ['> 1.0.0', '>1.0.0'], - ['<= 2.0.0', '<=2.0.0'], - ['<= 2.0.0', '<=2.0.0'], - ['<= 2.0.0', '<=2.0.0'], - ['< 2.0.0', '<2.0.0-0'], - ['< 2.0.0', '<2.0.0-0'], - ['>=0.1.97', '>=0.1.97'], - ['>=0.1.97', '>=0.1.97'], - ['0.1.20 || 1.2.4', '0.1.20||1.2.4'], - ['>=0.2.3 || <0.0.1', '>=0.2.3||<0.0.1-0'], - ['>=0.2.3 || <0.0.1', '>=0.2.3||<0.0.1-0'], - ['>=0.2.3 || <0.0.1', '>=0.2.3||<0.0.1-0'], - ['||', '||'], - ['2.x.x', '>=2.0.0-0 <3.0.0-0'], - ['1.2.x', '>=1.2.0-0 <1.3.0-0'], - ['1.2.x || 2.x', '>=1.2.0-0 <1.3.0-0||>=2.0.0-0 <3.0.0-0'], - ['1.2.x || 2.x', '>=1.2.0-0 <1.3.0-0||>=2.0.0-0 <3.0.0-0'], - ['x', '*'], - ['2.*.*', '>=2.0.0-0 <3.0.0-0'], - ['1.2.*', '>=1.2.0-0 <1.3.0-0'], - ['1.2.* || 2.*', '>=1.2.0-0 <1.3.0-0||>=2.0.0-0 <3.0.0-0'], - ['*', '*'], - ['2', '>=2.0.0-0 <3.0.0-0'], - ['2.3', '>=2.3.0-0 <2.4.0-0'], - ['~2.4', '>=2.4.0-0 <2.5.0-0'], - ['~2.4', '>=2.4.0-0 <2.5.0-0'], - ['~>3.2.1', '>=3.2.1-0 <3.3.0-0'], - ['~1', '>=1.0.0-0 <2.0.0-0'], - ['~>1', '>=1.0.0-0 <2.0.0-0'], - ['~> 1', '>=1.0.0-0 <2.0.0-0'], - ['~1.0', '>=1.0.0-0 <1.1.0-0'], - ['~ 1.0', '>=1.0.0-0 <1.1.0-0'], - ['^0', '>=0.0.0-0 <1.0.0-0'], - ['^ 1', '>=1.0.0-0 <2.0.0-0'], - ['^0.1', '>=0.1.0-0 <0.2.0-0'], - ['^1.0', '>=1.0.0-0 <2.0.0-0'], - ['^1.2', '>=1.2.0-0 <2.0.0-0'], - ['^0.0.1', '=0.0.1'], - ['^0.0.1-beta', '=0.0.1-beta'], - ['^0.1.2', '>=0.1.2-0 <0.2.0-0'], - ['^1.2.3', '>=1.2.3-0 <2.0.0-0'], - ['^1.2.3-beta.4', '>=1.2.3-beta.4 <2.0.0-0'], - ['<1', '<1.0.0-0'], - ['< 1', '<1.0.0-0'], - ['>=1', '>=1.0.0-0'], - ['>= 1', '>=1.0.0-0'], - ['<1.2', '<1.2.0-0'], - ['< 1.2', '<1.2.0-0'], - ['1', '>=1.0.0-0 <2.0.0-0'], - ['>01.02.03', '>1.2.3', true], - ['>01.02.03', null], - ['~1.2.3beta', '>=1.2.3-beta <1.3.0-0', true], - ['~1.2.3beta', null], - ['^ 1.2 ^ 1', '>=1.2.0-0 <2.0.0-0 >=1.0.0-0 <2.0.0-0'] - ].forEach(function(v) { - var pre = v[0]; - var wanted = v[1]; - var loose = v[2]; - var found = validRange(pre, loose); - - t.equal(found, wanted, 'validRange(' + pre + ') === ' + wanted); - }); - - t.end(); -}); - -test('\ncomparators test', function(t) { - // [range, comparators] - // turn range into a set of individual comparators - [['1.0.0 - 2.0.0', [['>=1.0.0', '<=2.0.0']]], - ['1.0.0', [['1.0.0']]], - ['>=*', [['>=0.0.0-0']]], - ['', [['']]], - ['*', [['']]], - ['*', [['']]], - ['>=1.0.0', [['>=1.0.0']]], - ['>=1.0.0', [['>=1.0.0']]], - ['>=1.0.0', [['>=1.0.0']]], - ['>1.0.0', [['>1.0.0']]], - ['>1.0.0', [['>1.0.0']]], - ['<=2.0.0', [['<=2.0.0']]], - ['1', [['>=1.0.0-0', '<2.0.0-0']]], - ['<=2.0.0', [['<=2.0.0']]], - ['<=2.0.0', [['<=2.0.0']]], - ['<2.0.0', [['<2.0.0-0']]], - ['<2.0.0', [['<2.0.0-0']]], - ['>= 1.0.0', [['>=1.0.0']]], - ['>= 1.0.0', [['>=1.0.0']]], - ['>= 1.0.0', [['>=1.0.0']]], - ['> 1.0.0', [['>1.0.0']]], - ['> 1.0.0', [['>1.0.0']]], - ['<= 2.0.0', [['<=2.0.0']]], - ['<= 2.0.0', [['<=2.0.0']]], - ['<= 2.0.0', [['<=2.0.0']]], - ['< 2.0.0', [['<2.0.0-0']]], - ['<\t2.0.0', [['<2.0.0-0']]], - ['>=0.1.97', [['>=0.1.97']]], - ['>=0.1.97', [['>=0.1.97']]], - ['0.1.20 || 1.2.4', [['0.1.20'], ['1.2.4']]], - ['>=0.2.3 || <0.0.1', [['>=0.2.3'], ['<0.0.1-0']]], - ['>=0.2.3 || <0.0.1', [['>=0.2.3'], ['<0.0.1-0']]], - ['>=0.2.3 || <0.0.1', [['>=0.2.3'], ['<0.0.1-0']]], - ['||', [[''], ['']]], - ['2.x.x', [['>=2.0.0-0', '<3.0.0-0']]], - ['1.2.x', [['>=1.2.0-0', '<1.3.0-0']]], - ['1.2.x || 2.x', [['>=1.2.0-0', '<1.3.0-0'], ['>=2.0.0-0', '<3.0.0-0']]], - ['1.2.x || 2.x', [['>=1.2.0-0', '<1.3.0-0'], ['>=2.0.0-0', '<3.0.0-0']]], - ['x', [['']]], - ['2.*.*', [['>=2.0.0-0', '<3.0.0-0']]], - ['1.2.*', [['>=1.2.0-0', '<1.3.0-0']]], - ['1.2.* || 2.*', [['>=1.2.0-0', '<1.3.0-0'], ['>=2.0.0-0', '<3.0.0-0']]], - ['1.2.* || 2.*', [['>=1.2.0-0', '<1.3.0-0'], ['>=2.0.0-0', '<3.0.0-0']]], - ['*', [['']]], - ['2', [['>=2.0.0-0', '<3.0.0-0']]], - ['2.3', [['>=2.3.0-0', '<2.4.0-0']]], - ['~2.4', [['>=2.4.0-0', '<2.5.0-0']]], - ['~2.4', [['>=2.4.0-0', '<2.5.0-0']]], - ['~>3.2.1', [['>=3.2.1-0', '<3.3.0-0']]], - ['~1', [['>=1.0.0-0', '<2.0.0-0']]], - ['~>1', [['>=1.0.0-0', '<2.0.0-0']]], - ['~> 1', [['>=1.0.0-0', '<2.0.0-0']]], - ['~1.0', [['>=1.0.0-0', '<1.1.0-0']]], - ['~ 1.0', [['>=1.0.0-0', '<1.1.0-0']]], - ['~ 1.0.3', [['>=1.0.3-0', '<1.1.0-0']]], - ['~> 1.0.3', [['>=1.0.3-0', '<1.1.0-0']]], - ['<1', [['<1.0.0-0']]], - ['< 1', [['<1.0.0-0']]], - ['>=1', [['>=1.0.0-0']]], - ['>= 1', [['>=1.0.0-0']]], - ['<1.2', [['<1.2.0-0']]], - ['< 1.2', [['<1.2.0-0']]], - ['1', [['>=1.0.0-0', '<2.0.0-0']]], - ['1 2', [['>=1.0.0-0', '<2.0.0-0', '>=2.0.0-0', '<3.0.0-0']]], - ['1.2 - 3.4.5', [['>=1.2.0-0', '<=3.4.5']]], - ['1.2.3 - 3.4', [['>=1.2.3', '<3.5.0-0']]] - ].forEach(function(v) { - var pre = v[0]; - var wanted = v[1]; - var found = toComparators(v[0]); - var jw = JSON.stringify(wanted); - t.equivalent(found, wanted, 'toComparators(' + pre + ') === ' + jw); - }); - - t.end(); -}); - -test('\nstrict vs loose version numbers', function(t) { - [['=1.2.3', '1.2.3'], - ['01.02.03', '1.2.3'], - ['1.2.3-beta.01', '1.2.3-beta.1'], - [' =1.2.3', '1.2.3'], - ['1.2.3foo', '1.2.3-foo'] - ].forEach(function(v) { - var loose = v[0]; - var strict = v[1]; - t.throws(function() { - new SemVer(loose); - }); - var lv = new SemVer(loose, true); - t.equal(lv.version, strict); - t.ok(eq(loose, strict, true)); - t.throws(function() { - eq(loose, strict); - }); - t.throws(function() { - new SemVer(strict).compare(loose); - }); - }); - t.end(); -}); - -test('\nstrict vs loose ranges', function(t) { - [['>=01.02.03', '>=1.2.3'], - ['~1.02.03beta', '>=1.2.3-beta <1.3.0-0'] - ].forEach(function(v) { - var loose = v[0]; - var comps = v[1]; - t.throws(function() { - new Range(loose); - }); - t.equal(new Range(loose, true).range, comps); - }); - t.end(); -}); - -test('\nmax satisfying', function(t) { - [[['1.2.3', '1.2.4'], '1.2', '1.2.4'], - [['1.2.4', '1.2.3'], '1.2', '1.2.4'], - [['1.2.3','1.2.4','1.2.5','1.2.6'], '~1.2.3', '1.2.6'], - [['1.1.0', '1.2.0', '1.2.1', '1.3.0', '2.0.0b1', '2.0.0b2', '2.0.0b3', '2.0.0', '2.1.0'], '~2.0.0', '2.0.0', true] - ].forEach(function(v) { - var versions = v[0]; - var range = v[1]; - var expect = v[2]; - var loose = v[3]; - var actual = semver.maxSatisfying(versions, range, loose); - t.equal(actual, expect); - }); - t.end(); -}); diff --git a/src/extensibility/node/node_modules/semver/test/no-module.js b/src/extensibility/node/node_modules/semver/test/no-module.js deleted file mode 100644 index 96d1cd1fc52..00000000000 --- a/src/extensibility/node/node_modules/semver/test/no-module.js +++ /dev/null @@ -1,19 +0,0 @@ -var tap = require('tap'); -var test = tap.test; - -test('no module system', function(t) { - var fs = require('fs'); - var vm = require('vm'); - var head = fs.readFileSync(require.resolve('../head.js'), 'utf8'); - var src = fs.readFileSync(require.resolve('../'), 'utf8'); - var foot = fs.readFileSync(require.resolve('../foot.js'), 'utf8'); - vm.runInThisContext(head + src + foot, 'semver.js'); - - // just some basic poking to see if it did some stuff - t.type(global.semver, 'object'); - t.type(global.semver.SemVer, 'function'); - t.type(global.semver.Range, 'function'); - t.ok(global.semver.satisfies('1.2.3', '1.2')); - t.end(); -}); - diff --git a/src/extensibility/node/node_modules/temp/.npmignore b/src/extensibility/node/node_modules/temp/.npmignore deleted file mode 100644 index 05936003261..00000000000 --- a/src/extensibility/node/node_modules/temp/.npmignore +++ /dev/null @@ -1,7 +0,0 @@ -.DS_Store -.\#* -/node_modules -\#* -npm-debug.log -node_modules -*.tgz diff --git a/src/extensibility/node/node_modules/temp/.travis.yml b/src/extensibility/node/node_modules/temp/.travis.yml deleted file mode 100644 index ec4312514d8..00000000000 --- a/src/extensibility/node/node_modules/temp/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: node_js -node_js: - - "0.11" - - "0.10" - - "0.8" - - "0.6" \ No newline at end of file diff --git a/src/extensibility/node/node_modules/temp/LICENSE b/src/extensibility/node/node_modules/temp/LICENSE deleted file mode 100644 index 0146c4a3beb..00000000000 --- a/src/extensibility/node/node_modules/temp/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) 2009 Bruce Williams - -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/src/extensibility/node/node_modules/temp/README.md b/src/extensibility/node/node_modules/temp/README.md deleted file mode 100644 index d7fb9c3f98e..00000000000 --- a/src/extensibility/node/node_modules/temp/README.md +++ /dev/null @@ -1,277 +0,0 @@ -node-temp -========= - -Temporary files, directories, and streams for Node.js. - -Handles generating a unique file/directory name under the appropriate -system temporary directory, changing the file to an appropriate mode, -and supports automatic removal (if asked) - -`temp` has a similar API to the `fs` module. - -Node.js Compatibility ---------------------- - -Supports v0.6.0+. - -[![Build Status](https://travis-ci.org/bruce/node-temp.png)](https://travis-ci.org/bruce/node-temp) - -Please let me know if you have problems running it on a later version of Node.js or -have platform-specific problems. - -Installation ------------- - -Install it using [npm](http://github.com/isaacs/npm): - - $ npm install temp - -Or get it directly from: -http://github.com/bruce/node-temp - -Synopsis --------- - -You can create temporary files with `open` and `openSync`, temporary -directories with `mkdir` and `mkdirSync`, or you can get a unique name -in the system temporary directory with `path`. - -Working copies of the following examples can be found under the -`examples` directory. - -### Temporary Files - -To create a temporary file use `open` or `openSync`, passing -them an optional prefix, suffix, or both (see below for details on -affixes). The object passed to the callback (or returned) has -`path` and `fd` keys: - -```javascript -{ path: "/path/to/file", -, fd: theFileDescriptor -} -``` - -In this example we write to a temporary file and call out to `grep` and -`wc -l` to determine the number of time `foo` occurs in the text. The -temporary file is chmod'd `0600` and cleaned up automatically when the -process at exit (because `temp.track()` is called): - -```javascript -var temp = require('temp'), - fs = require('fs'), - util = require('util'), - exec = require('child_process').exec; - -// Automatically track and cleanup files at exit -temp.track(); - -// Fake data -var myData = "foo\nbar\nfoo\nbaz"; - -// Process the data (note: error handling omitted) -temp.open('myprefix', function(err, info) { - fs.write(info.fd, myData); - fs.close(info.fd, function(err) { - exec("grep foo '" + info.path + "' | wc -l", function(err, stdout) { - util.puts(stdout.trim()); - }); - }); -}); -``` - -### Want Cleanup? Make sure you ask for it. - -As noted in the example above, if you want temp to track the files and directories -it creates and handle removing those files and directories on exit, you must call `track()`. -It's recommended that you do this immediately after requiring the module. - -```javascript -var temp = require("temp"); -temp.track(); -``` - -Why is this necessary? In pre-0.6 versions of temp, tracking was automatic. While this works -great for scripts and [Grunt tasks](http://gruntjs.com/), it's not so great for long-running -server processes. Since that's arguably what Node.js is _for_, you have to opt-in to tracking. - -But it's easy. - -#### Cleanup anytime - -When tracking, you can `cleanup()` anytime. An object will be returned with cleanup statistics -and the file/directory lists will be reset. - -```javascript -> temp.cleanup(); -{ files: { removed: 1, missing: 0 }, - dirs: { removed: 0, missing: 0 } } -``` - -Note: If you're not tracking, `false` will be returned. - -### Temporary Directories - -To create a temporary directory, use `mkdir` or `mkdirSync`, passing -it an optional prefix, suffix, or both (see below for details on affixes). - -In this example we create a temporary directory, write to a file -within it, call out to an external program to create a PDF, and read -the result. While the external process creates a lot of additional -files, the temporary directory is removed automatically at exit (because -`temp.track()` is called): - -```javascript -var temp = require('../lib/temp'), - fs = require('fs'), - util = require('util'), - path = require('path'), - exec = require('child_process').exec; - -// Automatically track and cleanup files at exit -temp.track(); - -// For use with ConTeXt, http://wiki.contextgarden.net -var myData = "\\starttext\nHello World\n\\stoptext"; - -temp.mkdir('pdfcreator', function(err, dirPath) { - var inputPath = path.join(dirPath, 'input.tex') - fs.writeFile(inputPath, myData, function(err) { - if (err) throw err; - process.chdir(dirPath); - exec("texexec '" + inputPath + "'", function(err) { - if (err) throw err; - fs.readFile(path.join(dirPath, 'input.pdf'), function(err, data) { - if (err) throw err; - sys.print(data); - }); - }); - }); -}); -``` - -### Temporary Streams - -To create a temporary WriteStream, use 'createWriteStream', which sits -on top of `fs.createWriteStream`. The return value is a -`fs.WriteStream` whose `path` is registered for removal when -`temp.cleanup` is called (because `temp.track()` is called). - -```javascript -var temp = require('temp'); - -// Automatically track and cleanup files at exit -temp.track(); - -var stream = temp.createWriteStream(); -stream.write("Some data"); -// Maybe do some other things -stream.end(); -``` - -### Affixes - -You can provide custom prefixes and suffixes when creating temporary -files and directories. If you provide a string, it is used as the prefix -for the temporary name. If you provide an object with `prefix`, -`suffix` and `dir` keys, they are used for the temporary name. - -Here are some examples: - -* `"aprefix"`: A simple prefix, prepended to the filename; this is - shorthand for: -* `{prefix: "aprefix"}`: A simple prefix, prepended to the filename -* `{suffix: ".asuffix"}`: A suffix, appended to the filename - (especially useful when the file needs to be named with specific - extension for use with an external program). -* `{prefix: "myprefix", suffix: "mysuffix"}`: Customize both affixes -* `{dir: path.join(os.tmpDir()), "myapp"}`: default prefix and suffix - within a new temporary directory. -* `null`: Use the defaults for files and directories (prefixes `"f-"` - and `"d-"`, respectively, no suffixes). - -In this simple example we read a `pdf`, write it to a temporary file with -a `.pdf` extension, and close it. - -```javascript -var fs = require('fs'), - temp = require('temp'); - -fs.readFile('/path/to/source.pdf', function(err, data) { - temp.open({suffix: '.pdf'}, function(err, info) { - if (err) throw err; - fs.write(info.fd, contents); - fs.close(info.fd, function(err) { - if (err) throw err; - // Do something with the file - }); - }); -}); -``` - -### Just a path, please - -If you just want a unique name in your temporary directory, use -`path`: - -```javascript -var fs = require('fs'); -var tempName = temp.path({suffix: '.pdf'}); -// Do something with tempName -``` - -Note: The file isn't created for you, and the mode is not changed -- and it -will not be removed automatically at exit. If you use `path`, it's -all up to you. - -Using it with Grunt -------------------- - -If you want to use the module with [Grunt](http://gruntjs.com/), make sure you -use `async()` in your Gruntfile: - -```javascript -module.exports = function (grunt) { - var temp = require("temp"); - temp.track(); // Cleanup files, please - grunt.registerTast("temptest", "Testing temp", function() { - - var done = this.async(); // Don't forget this! - - grunt.log.writeln("About to write a file..."); - temp.open('tempfile', function(err, info) { - // File writing shenanigans here - grunt.log.writeln("Wrote a file!") - - done(); // REALLY don't forget this! - - }); - }); -}; -``` - -For more information, see the [Grunt FAQ](http://gruntjs.com/frequently-asked-questions#why-doesn-t-my-asynchronous-task-complete). - -Testing -------- - -For now, run `test/temp-test.js`: - - $ node test/temp-test.js - -Contributing ------------- - -You can find the repository at: -http://github.com/bruce/node-temp - -Issues/Feature Requests can be submitted at: -http://github.com/bruce/node-temp/issues - -I'd really like to hear your feedback, and I'd love to receive your -pull-requests! - -Copyright ---------- - -Copyright (c) 2010-2012 Bruce Williams. See LICENSE for details. diff --git a/src/extensibility/node/node_modules/temp/examples/grepcount.js b/src/extensibility/node/node_modules/temp/examples/grepcount.js deleted file mode 100644 index 420d864531a..00000000000 --- a/src/extensibility/node/node_modules/temp/examples/grepcount.js +++ /dev/null @@ -1,18 +0,0 @@ -var temp = require('../lib/temp'), - fs = require('fs'), - util = require('util'), - exec = require('child_process').exec; - -var myData = "foo\nbar\nfoo\nbaz"; - -temp.open('myprefix', function(err, info) { - if (err) throw err; - fs.write(info.fd, myData); - fs.close(info.fd, function(err) { - if (err) throw err; - exec("grep foo '" + info.path + "' | wc -l", function(err, stdout) { - if (err) throw err; - util.puts(stdout.trim()); - }); - }); -}); diff --git a/src/extensibility/node/node_modules/temp/examples/pdfcreator.js b/src/extensibility/node/node_modules/temp/examples/pdfcreator.js deleted file mode 100644 index 63fd277fdc1..00000000000 --- a/src/extensibility/node/node_modules/temp/examples/pdfcreator.js +++ /dev/null @@ -1,22 +0,0 @@ -var temp = require('../lib/temp'), - fs = require('fs'), - util = require('util'), - path = require('path'), - exec = require('child_process').exec; - -var myData = "\\starttext\nHello World\n\\stoptext"; - -temp.mkdir('pdfcreator', function(err, dirPath) { - var inputPath = path.join(dirPath, 'input.tex') - fs.writeFile(inputPath, myData, function(err) { - if (err) throw err; - process.chdir(dirPath); - exec("texexec '" + inputPath + "'", function(err) { - if (err) throw err; - fs.readFile(path.join(dirPath, 'input.pdf'), function(err, data) { - if (err) throw err; - util.print(data); - }); - }); - }); -}); diff --git a/src/extensibility/node/node_modules/temp/lib/temp.js b/src/extensibility/node/node_modules/temp/lib/temp.js deleted file mode 100644 index 41edf98ce85..00000000000 --- a/src/extensibility/node/node_modules/temp/lib/temp.js +++ /dev/null @@ -1,182 +0,0 @@ -var fs = require('fs'), - os = require('osenv'), - path = require('path'), - cnst = require('constants'); - -/* HELPERS */ - -var RDWR_EXCL = cnst.O_CREAT | cnst.O_TRUNC | cnst.O_RDWR | cnst.O_EXCL; - -var environmentVariables = ['TMPDIR', 'TMP', 'TEMP']; - -var generateName = function(rawAffixes, defaultPrefix) { - var affixes = parseAffixes(rawAffixes, defaultPrefix); - var now = new Date(); - var name = [affixes.prefix, - now.getYear(), now.getMonth(), now.getDate(), - '-', - process.pid, - '-', - (Math.random() * 0x100000000 + 1).toString(36), - affixes.suffix].join(''); - return path.join(affixes.dir || exports.dir, name); -} - -var parseAffixes = function(rawAffixes, defaultPrefix) { - var affixes = {prefix: null, suffix: null}; - if(rawAffixes) { - switch (typeof(rawAffixes)) { - case 'string': - affixes.prefix = rawAffixes; - break; - case 'object': - affixes = rawAffixes; - break - default: - throw("Unknown affix declaration: " + affixes); - } - } else { - affixes.prefix = defaultPrefix; - } - return affixes; -} - -/* ------------------------------------------------------------------------- - * Don't forget to call track() if you want file tracking and exit handlers! - * ------------------------------------------------------------------------- - * When any temp file or directory is created, it is added to filesToDelete - * or dirsToDelete. The first time any temp file is created, a listener is - * added to remove all temp files and directories at exit. - */ -var tracking = false; -var track = function(value) { - tracking = (value != false) -}; -var exitListenerAttached = false; -var filesToDelete = []; -var dirsToDelete = []; - -var deleteFileOnExit = function(filePath) { - if (!tracking) return false; - attachExitListener(); - filesToDelete.push(filePath); -}; - -var deleteDirOnExit = function(dirPath) { - if (!tracking) return false; - attachExitListener(); - dirsToDelete.push(dirPath); -}; - -var attachExitListener = function() { - if (!tracking) return false; - if (!exitListenerAttached) { - process.addListener('exit', cleanup); - exitListenerAttached = true; - } -}; - -var cleanupFiles = function() { - if (!tracking) return false; - var counts = {removed: 0, missing: 0} - var toDelete; - while (toDelete = filesToDelete.shift()) { - try { - fs.unlinkSync(toDelete); - counts.removed++; - } catch (rmErr) { - /* removed normally */ - counts.missing++; - } - } - return counts; -}; - -var cleanupDirs = function() { - if (!tracking) return false; - var rimrafSync = require('rimraf').sync; - var counts = {removed: 0, missing: 0} - var toDelete; - while (toDelete = dirsToDelete.shift()) { - try { - rimrafSync(toDelete, function (er) { - if (er) { - throw er; - } else { - counts.removed++; - } - }); - } catch (rmErr) { - /* removed normally */ - counts.missing++; - } - } - return counts; -}; - -var cleanup = function() { - if (!tracking) return false; - fileCount = cleanupFiles(); - dirCount = cleanupDirs(); - return {files: fileCount, dirs: dirCount}; -} - -/* DIRECTORIES */ - -var mkdir = function(affixes, callback) { - var dirPath = generateName(affixes, 'd-'); - fs.mkdir(dirPath, 0700, function(err) { - if (!err) { - deleteDirOnExit(dirPath); - } - if (callback) - callback(err, dirPath); - }); -} -var mkdirSync = function(affixes) { - var dirPath = generateName(affixes, 'd-'); - fs.mkdirSync(dirPath, 0700); - deleteDirOnExit(dirPath); - return dirPath; -} - -/* FILES */ - -var open = function(affixes, callback) { - var filePath = generateName(affixes, 'f-') - fs.open(filePath, RDWR_EXCL, 0600, function(err, fd) { - if (!err) - deleteFileOnExit(filePath); - if (callback) - callback(err, {path: filePath, fd: fd}); - }); -} - -var openSync = function(affixes) { - var filePath = generateName(affixes, 'f-') - var fd = fs.openSync(filePath, RDWR_EXCL, 0600); - deleteFileOnExit(filePath); - return {path: filePath, fd: fd}; -} - -var createWriteStream = function(affixes) { - var filePath = generateName(affixes, 's-') - var stream = fs.createWriteStream(filePath, {flags: RDWR_EXCL, mode: 0600}); - deleteFileOnExit(filePath); - return stream; -} - -/* EXPORTS */ -// Settings -exports.dir = path.resolve(os.tmpdir()); -exports.track = track; -// Functions -exports.mkdir = mkdir; -exports.mkdirSync = mkdirSync; -exports.open = open; -exports.openSync = openSync; -exports.path = generateName; -exports.cleanup = cleanup; -exports.createWriteStream = createWriteStream; - - diff --git a/src/extensibility/node/node_modules/temp/node_modules/osenv/LICENSE b/src/extensibility/node/node_modules/temp/node_modules/osenv/LICENSE deleted file mode 100644 index 74489e2e265..00000000000 --- a/src/extensibility/node/node_modules/temp/node_modules/osenv/LICENSE +++ /dev/null @@ -1,25 +0,0 @@ -Copyright (c) Isaac Z. Schlueter -All rights reserved. - -The BSD License - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS -``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. diff --git a/src/extensibility/node/node_modules/temp/node_modules/osenv/README.md b/src/extensibility/node/node_modules/temp/node_modules/osenv/README.md deleted file mode 100644 index 08fd90023dc..00000000000 --- a/src/extensibility/node/node_modules/temp/node_modules/osenv/README.md +++ /dev/null @@ -1,63 +0,0 @@ -# osenv - -Look up environment settings specific to different operating systems. - -## Usage - -```javascript -var osenv = require('osenv') -var path = osenv.path() -var user = osenv.user() -// etc. - -// Some things are not reliably in the env, and have a fallback command: -var h = osenv.hostname(function (er, hostname) { - h = hostname -}) -// This will still cause it to be memoized, so calling osenv.hostname() -// is now an immediate operation. - -// You can always send a cb, which will get called in the nextTick -// if it's been memoized, or wait for the fallback data if it wasn't -// found in the environment. -osenv.hostname(function (er, hostname) { - if (er) console.error('error looking up hostname') - else console.log('this machine calls itself %s', hostname) -}) -``` - -## osenv.hostname() - -The machine name. Calls `hostname` if not found. - -## osenv.user() - -The currently logged-in user. Calls `whoami` if not found. - -## osenv.prompt() - -Either PS1 on unix, or PROMPT on Windows. - -## osenv.tmpdir() - -The place where temporary files should be created. - -## osenv.home() - -No place like it. - -## osenv.path() - -An array of the places that the operating system will search for -executables. - -## osenv.editor() - -Return the executable name of the editor program. This uses the EDITOR -and VISUAL environment variables, and falls back to `vi` on Unix, or -`notepad.exe` on Windows. - -## osenv.shell() - -The SHELL on Unix, which Windows calls the ComSpec. Defaults to 'bash' -or 'cmd'. diff --git a/src/extensibility/node/node_modules/temp/node_modules/osenv/osenv.js b/src/extensibility/node/node_modules/temp/node_modules/osenv/osenv.js deleted file mode 100644 index e3367a77439..00000000000 --- a/src/extensibility/node/node_modules/temp/node_modules/osenv/osenv.js +++ /dev/null @@ -1,80 +0,0 @@ -var isWindows = process.platform === 'win32' -var windir = isWindows ? process.env.windir || 'C:\\Windows' : null -var path = require('path') -var exec = require('child_process').exec - -// looking up envs is a bit costly. -// Also, sometimes we want to have a fallback -// Pass in a callback to wait for the fallback on failures -// After the first lookup, always returns the same thing. -function memo (key, lookup, fallback) { - var fell = false - var falling = false - exports[key] = function (cb) { - var val = lookup() - if (!val && !fell && !falling && fallback) { - fell = true - falling = true - exec(fallback, function (er, output, stderr) { - falling = false - if (er) return // oh well, we tried - val = output.trim() - }) - } - exports[key] = function (cb) { - if (cb) process.nextTick(cb.bind(null, null, val)) - return val - } - if (cb && !falling) process.nextTick(cb.bind(null, null, val)) - return val - } -} - -memo('user', function () { - return ( isWindows - ? process.env.USERDOMAIN + '\\' + process.env.USERNAME - : process.env.USER - ) -}, 'whoami') - -memo('prompt', function () { - return isWindows ? process.env.PROMPT : process.env.PS1 -}) - -memo('hostname', function () { - return isWindows ? process.env.COMPUTERNAME : process.env.HOSTNAME -}, 'hostname') - -memo('tmpdir', function () { - var t = isWindows ? 'temp' : 'tmp' - return process.env.TMPDIR || - process.env.TMP || - process.env.TEMP || - ( exports.home() ? path.resolve(exports.home(), t) - : isWindows ? path.resolve(windir, t) - : '/tmp' - ) -}) - -memo('home', function () { - return ( isWindows ? process.env.USERPROFILE - : process.env.HOME - ) -}) - -memo('path', function () { - return (process.env.PATH || - process.env.Path || - process.env.path).split(isWindows ? ';' : ':') -}) - -memo('editor', function () { - return process.env.EDITOR || - process.env.VISUAL || - (isWindows ? 'notepad.exe' : 'vi') -}) - -memo('shell', function () { - return isWindows ? process.env.ComSpec || 'cmd' - : process.env.SHELL || 'bash' -}) diff --git a/src/extensibility/node/node_modules/temp/node_modules/osenv/package.json b/src/extensibility/node/node_modules/temp/node_modules/osenv/package.json deleted file mode 100644 index 721c45ff1eb..00000000000 --- a/src/extensibility/node/node_modules/temp/node_modules/osenv/package.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "osenv", - "version": "0.0.3", - "main": "osenv.js", - "directories": { - "test": "test" - }, - "dependencies": {}, - "devDependencies": { - "tap": "~0.2.5" - }, - "scripts": { - "test": "tap test/*.js" - }, - "repository": { - "type": "git", - "url": "git://github.com/isaacs/osenv" - }, - "keywords": [ - "environment", - "variable", - "home", - "tmpdir", - "path", - "prompt", - "ps1" - ], - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "license": "BSD", - "description": "Look up environment settings specific to different operating systems", - "readme": "# osenv\n\nLook up environment settings specific to different operating systems.\n\n## Usage\n\n```javascript\nvar osenv = require('osenv')\nvar path = osenv.path()\nvar user = osenv.user()\n// etc.\n\n// Some things are not reliably in the env, and have a fallback command:\nvar h = osenv.hostname(function (er, hostname) {\n h = hostname\n})\n// This will still cause it to be memoized, so calling osenv.hostname()\n// is now an immediate operation.\n\n// You can always send a cb, which will get called in the nextTick\n// if it's been memoized, or wait for the fallback data if it wasn't\n// found in the environment.\nosenv.hostname(function (er, hostname) {\n if (er) console.error('error looking up hostname')\n else console.log('this machine calls itself %s', hostname)\n})\n```\n\n## osenv.hostname()\n\nThe machine name. Calls `hostname` if not found.\n\n## osenv.user()\n\nThe currently logged-in user. Calls `whoami` if not found.\n\n## osenv.prompt()\n\nEither PS1 on unix, or PROMPT on Windows.\n\n## osenv.tmpdir()\n\nThe place where temporary files should be created.\n\n## osenv.home()\n\nNo place like it.\n\n## osenv.path()\n\nAn array of the places that the operating system will search for\nexecutables.\n\n## osenv.editor() \n\nReturn the executable name of the editor program. This uses the EDITOR\nand VISUAL environment variables, and falls back to `vi` on Unix, or\n`notepad.exe` on Windows.\n\n## osenv.shell()\n\nThe SHELL on Unix, which Windows calls the ComSpec. Defaults to 'bash'\nor 'cmd'.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/osenv/issues" - }, - "_id": "osenv@0.0.3", - "_from": "osenv@0.0.3" -} diff --git a/src/extensibility/node/node_modules/temp/node_modules/osenv/test/unix.js b/src/extensibility/node/node_modules/temp/node_modules/osenv/test/unix.js deleted file mode 100644 index b72eb0b3f50..00000000000 --- a/src/extensibility/node/node_modules/temp/node_modules/osenv/test/unix.js +++ /dev/null @@ -1,76 +0,0 @@ -// only run this test on windows -// pretending to be another platform is too hacky, since it breaks -// how the underlying system looks up module paths and runs -// child processes, and all that stuff is cached. -if (process.platform === 'win32') { - console.log('TAP Version 13\n' + - '1..0\n' + - '# Skip unix tests, this is not unix\n') - return -} -var tap = require('tap') - -// like unix, but funny -process.env.USER = 'sirUser' -process.env.HOME = '/home/sirUser' -process.env.HOSTNAME = 'my-machine' -process.env.TMPDIR = '/tmpdir' -process.env.TMP = '/tmp' -process.env.TEMP = '/temp' -process.env.PATH = '/opt/local/bin:/usr/local/bin:/usr/bin/:bin' -process.env.PS1 = '(o_o) $ ' -process.env.EDITOR = 'edit' -process.env.VISUAL = 'visualedit' -process.env.SHELL = 'zsh' - - -tap.test('basic unix sanity test', function (t) { - var osenv = require('../osenv.js') - - t.equal(osenv.user(), process.env.USER) - t.equal(osenv.home(), process.env.HOME) - t.equal(osenv.hostname(), process.env.HOSTNAME) - t.same(osenv.path(), process.env.PATH.split(':')) - t.equal(osenv.prompt(), process.env.PS1) - t.equal(osenv.tmpdir(), process.env.TMPDIR) - - // mildly evil, but it's for a test. - process.env.TMPDIR = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - t.equal(osenv.tmpdir(), process.env.TMP) - - process.env.TMP = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - t.equal(osenv.tmpdir(), process.env.TEMP) - - process.env.TEMP = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - t.equal(osenv.tmpdir(), '/home/sirUser/tmp') - - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - osenv.home = function () { return null } - t.equal(osenv.tmpdir(), '/tmp') - - t.equal(osenv.editor(), 'edit') - process.env.EDITOR = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - t.equal(osenv.editor(), 'visualedit') - - process.env.VISUAL = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - t.equal(osenv.editor(), 'vi') - - t.equal(osenv.shell(), 'zsh') - process.env.SHELL = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - t.equal(osenv.shell(), 'bash') - - t.end() -}) diff --git a/src/extensibility/node/node_modules/temp/node_modules/osenv/test/windows.js b/src/extensibility/node/node_modules/temp/node_modules/osenv/test/windows.js deleted file mode 100644 index dd3fe807002..00000000000 --- a/src/extensibility/node/node_modules/temp/node_modules/osenv/test/windows.js +++ /dev/null @@ -1,82 +0,0 @@ -// only run this test on windows -// pretending to be another platform is too hacky, since it breaks -// how the underlying system looks up module paths and runs -// child processes, and all that stuff is cached. -if (process.platform !== 'win32') { - console.log('TAP Version 13\n' + - '1..0\n' + - '# Skip windows tests, this is not windows\n') - return -} - -// load this before clubbing the platform name. -var tap = require('tap') - -process.env.windir = 'C:\\windows' -process.env.USERDOMAIN = 'some-domain' -process.env.USERNAME = 'sirUser' -process.env.USERPROFILE = 'C:\\Users\\sirUser' -process.env.COMPUTERNAME = 'my-machine' -process.env.TMPDIR = 'C:\\tmpdir' -process.env.TMP = 'C:\\tmp' -process.env.TEMP = 'C:\\temp' -process.env.Path = 'C:\\Program Files\\;C:\\Binary Stuff\\bin' -process.env.PROMPT = '(o_o) $ ' -process.env.EDITOR = 'edit' -process.env.VISUAL = 'visualedit' -process.env.ComSpec = 'some-com' - -tap.test('basic windows sanity test', function (t) { - var osenv = require('../osenv.js') - - var osenv = require('../osenv.js') - - t.equal(osenv.user(), - process.env.USERDOMAIN + '\\' + process.env.USERNAME) - t.equal(osenv.home(), process.env.USERPROFILE) - t.equal(osenv.hostname(), process.env.COMPUTERNAME) - t.same(osenv.path(), process.env.Path.split(';')) - t.equal(osenv.prompt(), process.env.PROMPT) - t.equal(osenv.tmpdir(), process.env.TMPDIR) - - // mildly evil, but it's for a test. - process.env.TMPDIR = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - t.equal(osenv.tmpdir(), process.env.TMP) - - process.env.TMP = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - t.equal(osenv.tmpdir(), process.env.TEMP) - - process.env.TEMP = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - t.equal(osenv.tmpdir(), 'C:\\Users\\sirUser\\temp') - - process.env.TEMP = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - osenv.home = function () { return null } - t.equal(osenv.tmpdir(), 'C:\\windows\\temp') - - t.equal(osenv.editor(), 'edit') - process.env.EDITOR = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - t.equal(osenv.editor(), 'visualedit') - - process.env.VISUAL = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - t.equal(osenv.editor(), 'notepad.exe') - - t.equal(osenv.shell(), 'some-com') - process.env.ComSpec = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - t.equal(osenv.shell(), 'cmd') - - t.end() -}) diff --git a/src/extensibility/node/node_modules/temp/node_modules/rimraf/AUTHORS b/src/extensibility/node/node_modules/temp/node_modules/rimraf/AUTHORS deleted file mode 100644 index 247b7543737..00000000000 --- a/src/extensibility/node/node_modules/temp/node_modules/rimraf/AUTHORS +++ /dev/null @@ -1,6 +0,0 @@ -# Authors sorted by whether or not they're me. -Isaac Z. Schlueter (http://blog.izs.me) -Wayne Larsen (http://github.com/wvl) -ritch -Marcel Laverdet -Yosef Dinerstein diff --git a/src/extensibility/node/node_modules/temp/node_modules/rimraf/LICENSE b/src/extensibility/node/node_modules/temp/node_modules/rimraf/LICENSE deleted file mode 100644 index 05a4010949c..00000000000 --- a/src/extensibility/node/node_modules/temp/node_modules/rimraf/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright 2009, 2010, 2011 Isaac Z. Schlueter. -All rights reserved. - -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/src/extensibility/node/node_modules/temp/node_modules/rimraf/README.md b/src/extensibility/node/node_modules/temp/node_modules/rimraf/README.md deleted file mode 100644 index 96ce9b2a0bd..00000000000 --- a/src/extensibility/node/node_modules/temp/node_modules/rimraf/README.md +++ /dev/null @@ -1,21 +0,0 @@ -A `rm -rf` for node. - -Install with `npm install rimraf`, or just drop rimraf.js somewhere. - -## API - -`rimraf(f, callback)` - -The callback will be called with an error if there is one. Certain -errors are handled for you: - -* `EBUSY` - rimraf will back off a maximum of opts.maxBusyTries times - before giving up. -* `EMFILE` - If too many file descriptors get opened, rimraf will - patiently wait until more become available. - - -## rimraf.sync - -It can remove stuff synchronously, too. But that's not so good. Use -the async API. It's better. diff --git a/src/extensibility/node/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/.npmignore b/src/extensibility/node/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/.npmignore deleted file mode 100644 index c2658d7d1b3..00000000000 --- a/src/extensibility/node/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules/ diff --git a/src/extensibility/node/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/LICENSE b/src/extensibility/node/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/LICENSE deleted file mode 100644 index 0c44ae716db..00000000000 --- a/src/extensibility/node/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) Isaac Z. Schlueter ("Author") -All rights reserved. - -The BSD License - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR -BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN -IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/src/extensibility/node/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/README.md b/src/extensibility/node/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/README.md deleted file mode 100644 index 01af3d6b63b..00000000000 --- a/src/extensibility/node/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/README.md +++ /dev/null @@ -1,33 +0,0 @@ -# graceful-fs - -graceful-fs functions as a drop-in replacement for the fs module, -making various improvements. - -The improvements are meant to normalize behavior across different -platforms and environments, and to make filesystem access more -resilient to errors. - -## Improvements over fs module - -graceful-fs: - -* keeps track of how many file descriptors are open, and by default - limits this to 1024. Any further requests to open a file are put in a - queue until new slots become available. If 1024 turns out to be too - much, it decreases the limit further. -* fixes `lchmod` for Node versions prior to 0.6.2. -* implements `fs.lutimes` if possible. Otherwise it becomes a noop. -* ignores `EINVAL` and `EPERM` errors in `chown`, `fchown` or - `lchown` if the user isn't root. -* makes `lchmod` and `lchown` become noops, if not available. -* retries reading a file if `read` results in EAGAIN error. - -On Windows, it retries renaming a file for up to one second if `EACCESS` -or `EPERM` error occurs, likely because antivirus software has locked -the directory. - -## Configuration - -The maximum number of open file descriptors that graceful-fs manages may -be adjusted by setting `fs.MAX_OPEN` to a different number. The default -is 1024. diff --git a/src/extensibility/node/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/graceful-fs.js b/src/extensibility/node/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/graceful-fs.js deleted file mode 100644 index ca9115243be..00000000000 --- a/src/extensibility/node/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/graceful-fs.js +++ /dev/null @@ -1,442 +0,0 @@ -// this keeps a queue of opened file descriptors, and will make -// fs operations wait until some have closed before trying to open more. - -var fs = exports = module.exports = {} -fs._originalFs = require("fs") - -Object.getOwnPropertyNames(fs._originalFs).forEach(function(prop) { - var desc = Object.getOwnPropertyDescriptor(fs._originalFs, prop) - Object.defineProperty(fs, prop, desc) -}) - -var queue = [] - , constants = require("constants") - -fs._curOpen = 0 - -fs.MIN_MAX_OPEN = 64 -fs.MAX_OPEN = 1024 - -// prevent EMFILE errors -function OpenReq (path, flags, mode, cb) { - this.path = path - this.flags = flags - this.mode = mode - this.cb = cb -} - -function noop () {} - -fs.open = gracefulOpen - -function gracefulOpen (path, flags, mode, cb) { - if (typeof mode === "function") cb = mode, mode = null - if (typeof cb !== "function") cb = noop - - if (fs._curOpen >= fs.MAX_OPEN) { - queue.push(new OpenReq(path, flags, mode, cb)) - setTimeout(flush) - return - } - open(path, flags, mode, function (er, fd) { - if (er && er.code === "EMFILE" && fs._curOpen > fs.MIN_MAX_OPEN) { - // that was too many. reduce max, get back in queue. - // this should only happen once in a great while, and only - // if the ulimit -n is set lower than 1024. - fs.MAX_OPEN = fs._curOpen - 1 - return fs.open(path, flags, mode, cb) - } - cb(er, fd) - }) -} - -function open (path, flags, mode, cb) { - cb = cb || noop - fs._curOpen ++ - fs._originalFs.open.call(fs, path, flags, mode, function (er, fd) { - if (er) onclose() - cb(er, fd) - }) -} - -fs.openSync = function (path, flags, mode) { - var ret - ret = fs._originalFs.openSync.call(fs, path, flags, mode) - fs._curOpen ++ - return ret -} - -function onclose () { - fs._curOpen -- - flush() -} - -function flush () { - while (fs._curOpen < fs.MAX_OPEN) { - var req = queue.shift() - if (!req) return - switch (req.constructor.name) { - case 'OpenReq': - open(req.path, req.flags || "r", req.mode || 0777, req.cb) - break - case 'ReaddirReq': - readdir(req.path, req.cb) - break - case 'ReadFileReq': - readFile(req.path, req.options, req.cb) - break - case 'WriteFileReq': - writeFile(req.path, req.data, req.options, req.cb) - break - default: - throw new Error('Unknown req type: ' + req.constructor.name) - } - } -} - -fs.close = function (fd, cb) { - cb = cb || noop - fs._originalFs.close.call(fs, fd, function (er) { - onclose() - cb(er) - }) -} - -fs.closeSync = function (fd) { - try { - return fs._originalFs.closeSync.call(fs, fd) - } finally { - onclose() - } -} - - -// readdir takes a fd as well. -// however, the sync version closes it right away, so -// there's no need to wrap. -// It would be nice to catch when it throws an EMFILE, -// but that's relatively rare anyway. - -fs.readdir = gracefulReaddir - -function gracefulReaddir (path, cb) { - if (fs._curOpen >= fs.MAX_OPEN) { - queue.push(new ReaddirReq(path, cb)) - setTimeout(flush) - return - } - - readdir(path, function (er, files) { - if (er && er.code === "EMFILE" && fs._curOpen > fs.MIN_MAX_OPEN) { - fs.MAX_OPEN = fs._curOpen - 1 - return fs.readdir(path, cb) - } - cb(er, files) - }) -} - -function readdir (path, cb) { - cb = cb || noop - fs._curOpen ++ - fs._originalFs.readdir.call(fs, path, function (er, files) { - onclose() - cb(er, files) - }) -} - -function ReaddirReq (path, cb) { - this.path = path - this.cb = cb -} - - -fs.readFile = gracefulReadFile - -function gracefulReadFile(path, options, cb) { - if (typeof options === "function") cb = options, options = null - if (typeof cb !== "function") cb = noop - - if (fs._curOpen >= fs.MAX_OPEN) { - queue.push(new ReadFileReq(path, options, cb)) - setTimeout(flush) - return - } - - readFile(path, options, function (er, data) { - if (er && er.code === "EMFILE" && fs._curOpen > fs.MIN_MAX_OPEN) { - fs.MAX_OPEN = fs._curOpen - 1 - return fs.readFile(path, options, cb) - } - cb(er, data) - }) -} - -function readFile (path, options, cb) { - cb = cb || noop - fs._curOpen ++ - fs._originalFs.readFile.call(fs, path, options, function (er, data) { - onclose() - cb(er, data) - }) -} - -function ReadFileReq (path, options, cb) { - this.path = path - this.options = options - this.cb = cb -} - - - - -fs.writeFile = gracefulWriteFile - -function gracefulWriteFile(path, data, options, cb) { - if (typeof options === "function") cb = options, options = null - if (typeof cb !== "function") cb = noop - - if (fs._curOpen >= fs.MAX_OPEN) { - queue.push(new WriteFileReq(path, data, options, cb)) - setTimeout(flush) - return - } - - writeFile(path, data, options, function (er) { - if (er && er.code === "EMFILE" && fs._curOpen > fs.MIN_MAX_OPEN) { - fs.MAX_OPEN = fs._curOpen - 1 - return fs.writeFile(path, data, options, cb) - } - cb(er) - }) -} - -function writeFile (path, data, options, cb) { - cb = cb || noop - fs._curOpen ++ - fs._originalFs.writeFile.call(fs, path, data, options, function (er) { - onclose() - cb(er) - }) -} - -function WriteFileReq (path, data, options, cb) { - this.path = path - this.data = data - this.options = options - this.cb = cb -} - - -// (re-)implement some things that are known busted or missing. - -var constants = require("constants") - -// lchmod, broken prior to 0.6.2 -// back-port the fix here. -if (constants.hasOwnProperty('O_SYMLINK') && - process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { - fs.lchmod = function (path, mode, callback) { - callback = callback || noop - fs.open( path - , constants.O_WRONLY | constants.O_SYMLINK - , mode - , function (err, fd) { - if (err) { - callback(err) - return - } - // prefer to return the chmod error, if one occurs, - // but still try to close, and report closing errors if they occur. - fs.fchmod(fd, mode, function (err) { - fs.close(fd, function(err2) { - callback(err || err2) - }) - }) - }) - } - - fs.lchmodSync = function (path, mode) { - var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode) - - // prefer to return the chmod error, if one occurs, - // but still try to close, and report closing errors if they occur. - var err, err2 - try { - var ret = fs.fchmodSync(fd, mode) - } catch (er) { - err = er - } - try { - fs.closeSync(fd) - } catch (er) { - err2 = er - } - if (err || err2) throw (err || err2) - return ret - } -} - - -// lutimes implementation, or no-op -if (!fs.lutimes) { - if (constants.hasOwnProperty("O_SYMLINK")) { - fs.lutimes = function (path, at, mt, cb) { - fs.open(path, constants.O_SYMLINK, function (er, fd) { - cb = cb || noop - if (er) return cb(er) - fs.futimes(fd, at, mt, function (er) { - fs.close(fd, function (er2) { - return cb(er || er2) - }) - }) - }) - } - - fs.lutimesSync = function (path, at, mt) { - var fd = fs.openSync(path, constants.O_SYMLINK) - , err - , err2 - , ret - - try { - var ret = fs.futimesSync(fd, at, mt) - } catch (er) { - err = er - } - try { - fs.closeSync(fd) - } catch (er) { - err2 = er - } - if (err || err2) throw (err || err2) - return ret - } - - } else if (fs.utimensat && constants.hasOwnProperty("AT_SYMLINK_NOFOLLOW")) { - // maybe utimensat will be bound soonish? - fs.lutimes = function (path, at, mt, cb) { - fs.utimensat(path, at, mt, constants.AT_SYMLINK_NOFOLLOW, cb) - } - - fs.lutimesSync = function (path, at, mt) { - return fs.utimensatSync(path, at, mt, constants.AT_SYMLINK_NOFOLLOW) - } - - } else { - fs.lutimes = function (_a, _b, _c, cb) { process.nextTick(cb) } - fs.lutimesSync = function () {} - } -} - - -// https://github.com/isaacs/node-graceful-fs/issues/4 -// Chown should not fail on einval or eperm if non-root. - -fs.chown = chownFix(fs.chown) -fs.fchown = chownFix(fs.fchown) -fs.lchown = chownFix(fs.lchown) - -fs.chownSync = chownFixSync(fs.chownSync) -fs.fchownSync = chownFixSync(fs.fchownSync) -fs.lchownSync = chownFixSync(fs.lchownSync) - -function chownFix (orig) { - if (!orig) return orig - return function (target, uid, gid, cb) { - return orig.call(fs, target, uid, gid, function (er, res) { - if (chownErOk(er)) er = null - cb(er, res) - }) - } -} - -function chownFixSync (orig) { - if (!orig) return orig - return function (target, uid, gid) { - try { - return orig.call(fs, target, uid, gid) - } catch (er) { - if (!chownErOk(er)) throw er - } - } -} - -function chownErOk (er) { - // if there's no getuid, or if getuid() is something other than 0, - // and the error is EINVAL or EPERM, then just ignore it. - // This specific case is a silent failure in cp, install, tar, - // and most other unix tools that manage permissions. - // When running as root, or if other types of errors are encountered, - // then it's strict. - if (!er || (!process.getuid || process.getuid() !== 0) - && (er.code === "EINVAL" || er.code === "EPERM")) return true -} - - -// if lchmod/lchown do not exist, then make them no-ops -if (!fs.lchmod) { - fs.lchmod = function (path, mode, cb) { - process.nextTick(cb) - } - fs.lchmodSync = function () {} -} -if (!fs.lchown) { - fs.lchown = function (path, uid, gid, cb) { - process.nextTick(cb) - } - fs.lchownSync = function () {} -} - - - -// on Windows, A/V software can lock the directory, causing this -// to fail with an EACCES or EPERM if the directory contains newly -// created files. Try again on failure, for up to 1 second. -if (process.platform === "win32") { - var rename_ = fs.rename - fs.rename = function rename (from, to, cb) { - var start = Date.now() - rename_(from, to, function CB (er) { - if (er - && (er.code === "EACCES" || er.code === "EPERM") - && Date.now() - start < 1000) { - return rename_(from, to, CB) - } - cb(er) - }) - } -} - - -// if read() returns EAGAIN, then just try it again. -var read = fs.read -fs.read = function (fd, buffer, offset, length, position, callback_) { - var callback - if (callback_ && typeof callback_ === 'function') { - var eagCounter = 0 - callback = function (er, _, __) { - if (er && er.code === 'EAGAIN' && eagCounter < 10) { - eagCounter ++ - return read.call(fs, fd, buffer, offset, length, position, callback) - } - callback_.apply(this, arguments) - } - } - return read.call(fs, fd, buffer, offset, length, position, callback) -} - -var readSync = fs.readSync -fs.readSync = function (fd, buffer, offset, length, position) { - var eagCounter = 0 - while (true) { - try { - return readSync.call(fs, fd, buffer, offset, length, position) - } catch (er) { - if (er.code === 'EAGAIN' && eagCounter < 10) { - eagCounter ++ - continue - } - throw er - } - } -} diff --git a/src/extensibility/node/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/package.json b/src/extensibility/node/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/package.json deleted file mode 100644 index bfc503c3fb6..00000000000 --- a/src/extensibility/node/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me" - }, - "name": "graceful-fs", - "description": "A drop-in replacement for fs, making various improvements.", - "version": "1.2.3", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/node-graceful-fs.git" - }, - "main": "graceful-fs.js", - "engines": { - "node": ">=0.4.0" - }, - "directories": { - "test": "test" - }, - "scripts": { - "test": "tap test/*.js" - }, - "keywords": [ - "fs", - "module", - "reading", - "retry", - "retries", - "queue", - "error", - "errors", - "handling", - "EMFILE", - "EAGAIN", - "EINVAL", - "EPERM", - "EACCESS" - ], - "license": "BSD", - "readme": "# graceful-fs\n\ngraceful-fs functions as a drop-in replacement for the fs module,\nmaking various improvements.\n\nThe improvements are meant to normalize behavior across different\nplatforms and environments, and to make filesystem access more\nresilient to errors.\n\n## Improvements over fs module\n\ngraceful-fs:\n\n* keeps track of how many file descriptors are open, and by default\n limits this to 1024. Any further requests to open a file are put in a\n queue until new slots become available. If 1024 turns out to be too\n much, it decreases the limit further.\n* fixes `lchmod` for Node versions prior to 0.6.2.\n* implements `fs.lutimes` if possible. Otherwise it becomes a noop.\n* ignores `EINVAL` and `EPERM` errors in `chown`, `fchown` or\n `lchown` if the user isn't root.\n* makes `lchmod` and `lchown` become noops, if not available.\n* retries reading a file if `read` results in EAGAIN error.\n\nOn Windows, it retries renaming a file for up to one second if `EACCESS`\nor `EPERM` error occurs, likely because antivirus software has locked\nthe directory.\n\n## Configuration\n\nThe maximum number of open file descriptors that graceful-fs manages may\nbe adjusted by setting `fs.MAX_OPEN` to a different number. The default\nis 1024.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/node-graceful-fs/issues" - }, - "_id": "graceful-fs@1.2.3", - "_from": "graceful-fs@~1" -} diff --git a/src/extensibility/node/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/test/open.js b/src/extensibility/node/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/test/open.js deleted file mode 100644 index 930d53257c2..00000000000 --- a/src/extensibility/node/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/test/open.js +++ /dev/null @@ -1,46 +0,0 @@ -var test = require('tap').test -var fs = require('../graceful-fs.js') - -test('graceful fs is not fs', function (t) { - t.notEqual(fs, require('fs')) - t.end() -}) - -test('open an existing file works', function (t) { - var start = fs._curOpen - var fd = fs.openSync(__filename, 'r') - t.equal(fs._curOpen, start + 1) - fs.closeSync(fd) - t.equal(fs._curOpen, start) - fs.open(__filename, 'r', function (er, fd) { - if (er) throw er - t.equal(fs._curOpen, start + 1) - fs.close(fd, function (er) { - if (er) throw er - t.equal(fs._curOpen, start) - t.end() - }) - }) -}) - -test('open a non-existing file throws', function (t) { - var start = fs._curOpen - var er - try { - var fd = fs.openSync('this file does not exist', 'r') - } catch (x) { - er = x - } - t.ok(er, 'should throw') - t.notOk(fd, 'should not get an fd') - t.equal(er.code, 'ENOENT') - t.equal(fs._curOpen, start) - - fs.open('neither does this file', 'r', function (er, fd) { - t.ok(er, 'should throw') - t.notOk(fd, 'should not get an fd') - t.equal(er.code, 'ENOENT') - t.equal(fs._curOpen, start) - t.end() - }) -}) diff --git a/src/extensibility/node/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/test/ulimit.js b/src/extensibility/node/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/test/ulimit.js deleted file mode 100644 index 8d0882d0c1e..00000000000 --- a/src/extensibility/node/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/test/ulimit.js +++ /dev/null @@ -1,158 +0,0 @@ -var test = require('tap').test - -// simulated ulimit -// this is like graceful-fs, but in reverse -var fs_ = require('fs') -var fs = require('../graceful-fs.js') -var files = fs.readdirSync(__dirname) - -// Ok, no more actual file reading! - -var fds = 0 -var nextFd = 60 -var limit = 8 -fs_.open = function (path, flags, mode, cb) { - process.nextTick(function() { - ++fds - if (fds >= limit) { - --fds - var er = new Error('EMFILE Curses!') - er.code = 'EMFILE' - er.path = path - return cb(er) - } else { - cb(null, nextFd++) - } - }) -} - -fs_.openSync = function (path, flags, mode) { - if (fds >= limit) { - var er = new Error('EMFILE Curses!') - er.code = 'EMFILE' - er.path = path - throw er - } else { - ++fds - return nextFd++ - } -} - -fs_.close = function (fd, cb) { - process.nextTick(function () { - --fds - cb() - }) -} - -fs_.closeSync = function (fd) { - --fds -} - -fs_.readdir = function (path, cb) { - process.nextTick(function() { - if (fds >= limit) { - var er = new Error('EMFILE Curses!') - er.code = 'EMFILE' - er.path = path - return cb(er) - } else { - ++fds - process.nextTick(function () { - --fds - cb(null, [__filename, "some-other-file.js"]) - }) - } - }) -} - -fs_.readdirSync = function (path) { - if (fds >= limit) { - var er = new Error('EMFILE Curses!') - er.code = 'EMFILE' - er.path = path - throw er - } else { - return [__filename, "some-other-file.js"] - } -} - - -test('open emfile autoreduce', function (t) { - fs.MIN_MAX_OPEN = 4 - t.equal(fs.MAX_OPEN, 1024) - - var max = 12 - for (var i = 0; i < max; i++) { - fs.open(__filename, 'r', next(i)) - } - - var phase = 0 - - var expect = - [ [ 0, 60, null, 1024, 4, 12, 1 ], - [ 1, 61, null, 1024, 4, 12, 2 ], - [ 2, 62, null, 1024, 4, 12, 3 ], - [ 3, 63, null, 1024, 4, 12, 4 ], - [ 4, 64, null, 1024, 4, 12, 5 ], - [ 5, 65, null, 1024, 4, 12, 6 ], - [ 6, 66, null, 1024, 4, 12, 7 ], - [ 7, 67, null, 6, 4, 5, 1 ], - [ 8, 68, null, 6, 4, 5, 2 ], - [ 9, 69, null, 6, 4, 5, 3 ], - [ 10, 70, null, 6, 4, 5, 4 ], - [ 11, 71, null, 6, 4, 5, 5 ] ] - - var actual = [] - - function next (i) { return function (er, fd) { - if (er) - throw er - actual.push([i, fd, er, fs.MAX_OPEN, fs.MIN_MAX_OPEN, fs._curOpen, fds]) - - if (i === max - 1) { - t.same(actual, expect) - t.ok(fs.MAX_OPEN < limit) - t.end() - } - - fs.close(fd) - } } -}) - -test('readdir emfile autoreduce', function (t) { - fs.MAX_OPEN = 1024 - var max = 12 - for (var i = 0; i < max; i ++) { - fs.readdir(__dirname, next(i)) - } - - var expect = - [ [0,[__filename,"some-other-file.js"],null,7,4,7,7], - [1,[__filename,"some-other-file.js"],null,7,4,7,6], - [2,[__filename,"some-other-file.js"],null,7,4,7,5], - [3,[__filename,"some-other-file.js"],null,7,4,7,4], - [4,[__filename,"some-other-file.js"],null,7,4,7,3], - [5,[__filename,"some-other-file.js"],null,7,4,6,2], - [6,[__filename,"some-other-file.js"],null,7,4,5,1], - [7,[__filename,"some-other-file.js"],null,7,4,4,0], - [8,[__filename,"some-other-file.js"],null,7,4,3,3], - [9,[__filename,"some-other-file.js"],null,7,4,2,2], - [10,[__filename,"some-other-file.js"],null,7,4,1,1], - [11,[__filename,"some-other-file.js"],null,7,4,0,0] ] - - var actual = [] - - function next (i) { return function (er, files) { - if (er) - throw er - var line = [i, files, er, fs.MAX_OPEN, fs.MIN_MAX_OPEN, fs._curOpen, fds ] - actual.push(line) - - if (i === max - 1) { - t.ok(fs.MAX_OPEN < limit) - t.same(actual, expect) - t.end() - } - } } -}) diff --git a/src/extensibility/node/node_modules/temp/node_modules/rimraf/package.json b/src/extensibility/node/node_modules/temp/node_modules/rimraf/package.json deleted file mode 100644 index f5072d7cb0a..00000000000 --- a/src/extensibility/node/node_modules/temp/node_modules/rimraf/package.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "name": "rimraf", - "version": "2.1.4", - "main": "rimraf.js", - "description": "A deep deletion module for node (like `rm -rf`)", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "license": { - "type": "MIT", - "url": "https://github.com/isaacs/rimraf/raw/master/LICENSE" - }, - "optionalDependencies": { - "graceful-fs": "~1" - }, - "repository": { - "type": "git", - "url": "git://github.com/isaacs/rimraf.git" - }, - "scripts": { - "test": "cd test && bash run.sh" - }, - "contributors": [ - { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me" - }, - { - "name": "Wayne Larsen", - "email": "wayne@larsen.st", - "url": "http://github.com/wvl" - }, - { - "name": "ritch", - "email": "skawful@gmail.com" - }, - { - "name": "Marcel Laverdet" - }, - { - "name": "Yosef Dinerstein", - "email": "yosefd@microsoft.com" - } - ], - "readme": "A `rm -rf` for node.\n\nInstall with `npm install rimraf`, or just drop rimraf.js somewhere.\n\n## API\n\n`rimraf(f, callback)`\n\nThe callback will be called with an error if there is one. Certain\nerrors are handled for you:\n\n* `EBUSY` - rimraf will back off a maximum of opts.maxBusyTries times\n before giving up.\n* `EMFILE` - If too many file descriptors get opened, rimraf will\n patiently wait until more become available.\n\n\n## rimraf.sync\n\nIt can remove stuff synchronously, too. But that's not so good. Use\nthe async API. It's better.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/rimraf/issues" - }, - "dependencies": { - "graceful-fs": "~1" - }, - "_id": "rimraf@2.1.4", - "_from": "rimraf@~2.1.4" -} diff --git a/src/extensibility/node/node_modules/temp/node_modules/rimraf/rimraf.js b/src/extensibility/node/node_modules/temp/node_modules/rimraf/rimraf.js deleted file mode 100644 index ed915f982e8..00000000000 --- a/src/extensibility/node/node_modules/temp/node_modules/rimraf/rimraf.js +++ /dev/null @@ -1,132 +0,0 @@ -module.exports = rimraf -rimraf.sync = rimrafSync - -var path = require("path") - , fs - -try { - // optional dependency - fs = require("graceful-fs") -} catch (er) { - fs = require("fs") -} - -// for EMFILE handling -var timeout = 0 -exports.EMFILE_MAX = 1000 -exports.BUSYTRIES_MAX = 3 - -function rimraf (p, cb) { - if (!cb) throw new Error("No callback passed to rimraf()") - - var busyTries = 0 - rimraf_(p, function CB (er) { - if (er) { - if (er.code === "EBUSY" && busyTries < exports.BUSYTRIES_MAX) { - busyTries ++ - var time = busyTries * 100 - // try again, with the same exact callback as this one. - return setTimeout(function () { - rimraf_(p, CB) - }, time) - } - - // this one won't happen if graceful-fs is used. - if (er.code === "EMFILE" && timeout < exports.EMFILE_MAX) { - return setTimeout(function () { - rimraf_(p, CB) - }, timeout ++) - } - - // already gone - if (er.code === "ENOENT") er = null - } - - timeout = 0 - cb(er) - }) -} - -// Two possible strategies. -// 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR -// 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR -// -// Both result in an extra syscall when you guess wrong. However, there -// are likely far more normal files in the world than directories. This -// is based on the assumption that a the average number of files per -// directory is >= 1. -// -// If anyone ever complains about this, then I guess the strategy could -// be made configurable somehow. But until then, YAGNI. -function rimraf_ (p, cb) { - fs.unlink(p, function (er) { - if (er && er.code === "ENOENT") - return cb() - if (er && (er.code === "EPERM" || er.code === "EISDIR")) - return rmdir(p, er, cb) - return cb(er) - }) -} - -function rmdir (p, originalEr, cb) { - // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS) - // if we guessed wrong, and it's not a directory, then - // raise the original error. - fs.rmdir(p, function (er) { - if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST")) - rmkids(p, cb) - else if (er && er.code === "ENOTDIR") - cb(originalEr) - else - cb(er) - }) -} - -function rmkids(p, cb) { - fs.readdir(p, function (er, files) { - if (er) - return cb(er) - var n = files.length - if (n === 0) - return fs.rmdir(p, cb) - var errState - files.forEach(function (f) { - rimraf(path.join(p, f), function (er) { - if (errState) - return - if (er) - return cb(errState = er) - if (--n === 0) - fs.rmdir(p, cb) - }) - }) - }) -} - -// this looks simpler, and is strictly *faster*, but will -// tie up the JavaScript thread and fail on excessively -// deep directory trees. -function rimrafSync (p) { - try { - fs.unlinkSync(p) - } catch (er) { - if (er.code === "ENOENT") - return - if (er.code !== "EPERM" && er.code !== "EISDIR") - throw er - try { - fs.rmdirSync(p) - } catch (er2) { - if (er2.code === "ENOENT") - return - if (er2.code === "ENOTDIR") - throw er - if (er2.code === "ENOTEMPTY") { - fs.readdirSync(p).forEach(function (f) { - rimrafSync(path.join(p, f)) - }) - fs.rmdirSync(p) - } - } - } -} diff --git a/src/extensibility/node/node_modules/temp/node_modules/rimraf/test/run.sh b/src/extensibility/node/node_modules/temp/node_modules/rimraf/test/run.sh deleted file mode 100644 index 598f0163b23..00000000000 --- a/src/extensibility/node/node_modules/temp/node_modules/rimraf/test/run.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -set -e -for i in test-*.js; do - echo -n $i ... - bash setup.sh - node $i - ! [ -d target ] - echo "pass" -done -rm -rf target diff --git a/src/extensibility/node/node_modules/temp/node_modules/rimraf/test/setup.sh b/src/extensibility/node/node_modules/temp/node_modules/rimraf/test/setup.sh deleted file mode 100644 index 2602e631602..00000000000 --- a/src/extensibility/node/node_modules/temp/node_modules/rimraf/test/setup.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash - -set -e - -files=10 -folders=2 -depth=4 -target="$PWD/target" - -rm -rf target - -fill () { - local depth=$1 - local files=$2 - local folders=$3 - local target=$4 - - if ! [ -d $target ]; then - mkdir -p $target - fi - - local f - - f=$files - while [ $f -gt 0 ]; do - touch "$target/f-$depth-$f" - let f-- - done - - let depth-- - - if [ $depth -le 0 ]; then - return 0 - fi - - f=$folders - while [ $f -gt 0 ]; do - mkdir "$target/folder-$depth-$f" - fill $depth $files $folders "$target/d-$depth-$f" - let f-- - done -} - -fill $depth $files $folders $target - -# sanity assert -[ -d $target ] diff --git a/src/extensibility/node/node_modules/temp/node_modules/rimraf/test/test-async.js b/src/extensibility/node/node_modules/temp/node_modules/rimraf/test/test-async.js deleted file mode 100644 index 9c2e0b7be0e..00000000000 --- a/src/extensibility/node/node_modules/temp/node_modules/rimraf/test/test-async.js +++ /dev/null @@ -1,5 +0,0 @@ -var rimraf = require("../rimraf") - , path = require("path") -rimraf(path.join(__dirname, "target"), function (er) { - if (er) throw er -}) diff --git a/src/extensibility/node/node_modules/temp/node_modules/rimraf/test/test-sync.js b/src/extensibility/node/node_modules/temp/node_modules/rimraf/test/test-sync.js deleted file mode 100644 index eb71f10476e..00000000000 --- a/src/extensibility/node/node_modules/temp/node_modules/rimraf/test/test-sync.js +++ /dev/null @@ -1,3 +0,0 @@ -var rimraf = require("../rimraf") - , path = require("path") -rimraf.sync(path.join(__dirname, "target")) diff --git a/src/extensibility/node/node_modules/temp/package.json b/src/extensibility/node/node_modules/temp/package.json deleted file mode 100644 index bcff18a768d..00000000000 --- a/src/extensibility/node/node_modules/temp/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "temp", - "description": "Temporary files and directories", - "tags": [ - "temporary", - "temp", - "tempfile", - "tempdir", - "tmpfile", - "tmpdir", - "security" - ], - "version": "0.6.0", - "author": { - "name": "Bruce Williams", - "email": "bruce@codefluency.com" - }, - "directories": { - "lib": "lib" - }, - "engines": [ - "node >=0.6.0" - ], - "main": "./lib/temp", - "dependencies": { - "rimraf": "~2.1.4", - "osenv": "0.0.3" - }, - "devDependencies": {}, - "repository": { - "type": "git", - "url": "git://github.com/bruce/node-temp.git" - }, - "scripts": { - "test": "node test/temp-test.js" - }, - "readme": "node-temp\n=========\n\nTemporary files, directories, and streams for Node.js.\n\nHandles generating a unique file/directory name under the appropriate\nsystem temporary directory, changing the file to an appropriate mode,\nand supports automatic removal (if asked)\n\n`temp` has a similar API to the `fs` module.\n\nNode.js Compatibility\n---------------------\n\nSupports v0.6.0+.\n\n[![Build Status](https://travis-ci.org/bruce/node-temp.png)](https://travis-ci.org/bruce/node-temp)\n\nPlease let me know if you have problems running it on a later version of Node.js or\nhave platform-specific problems.\n\nInstallation\n------------\n\nInstall it using [npm](http://github.com/isaacs/npm):\n\n $ npm install temp\n\nOr get it directly from:\nhttp://github.com/bruce/node-temp\n\nSynopsis\n--------\n\nYou can create temporary files with `open` and `openSync`, temporary\ndirectories with `mkdir` and `mkdirSync`, or you can get a unique name\nin the system temporary directory with `path`.\n\nWorking copies of the following examples can be found under the\n`examples` directory.\n\n### Temporary Files\n\nTo create a temporary file use `open` or `openSync`, passing\nthem an optional prefix, suffix, or both (see below for details on\naffixes). The object passed to the callback (or returned) has\n`path` and `fd` keys:\n\n```javascript\n{ path: \"/path/to/file\",\n, fd: theFileDescriptor\n}\n```\n\nIn this example we write to a temporary file and call out to `grep` and\n`wc -l` to determine the number of time `foo` occurs in the text. The\ntemporary file is chmod'd `0600` and cleaned up automatically when the\nprocess at exit (because `temp.track()` is called):\n\n```javascript\nvar temp = require('temp'),\n fs = require('fs'),\n util = require('util'),\n exec = require('child_process').exec;\n\n// Automatically track and cleanup files at exit\ntemp.track();\n\n// Fake data\nvar myData = \"foo\\nbar\\nfoo\\nbaz\";\n\n// Process the data (note: error handling omitted)\ntemp.open('myprefix', function(err, info) {\n fs.write(info.fd, myData);\n fs.close(info.fd, function(err) {\n exec(\"grep foo '\" + info.path + \"' | wc -l\", function(err, stdout) {\n util.puts(stdout.trim());\n });\n });\n});\n```\n\n### Want Cleanup? Make sure you ask for it.\n\nAs noted in the example above, if you want temp to track the files and directories\nit creates and handle removing those files and directories on exit, you must call `track()`.\nIt's recommended that you do this immediately after requiring the module.\n\n```javascript\nvar temp = require(\"temp\");\ntemp.track();\n```\n\nWhy is this necessary? In pre-0.6 versions of temp, tracking was automatic. While this works\ngreat for scripts and [Grunt tasks](http://gruntjs.com/), it's not so great for long-running\nserver processes. Since that's arguably what Node.js is _for_, you have to opt-in to tracking.\n\nBut it's easy.\n\n#### Cleanup anytime\n\nWhen tracking, you can `cleanup()` anytime. An object will be returned with cleanup statistics\nand the file/directory lists will be reset.\n\n```javascript\n> temp.cleanup();\n{ files: { removed: 1, missing: 0 },\n dirs: { removed: 0, missing: 0 } }\n```\n\nNote: If you're not tracking, `false` will be returned.\n\n### Temporary Directories\n\nTo create a temporary directory, use `mkdir` or `mkdirSync`, passing\nit an optional prefix, suffix, or both (see below for details on affixes).\n\nIn this example we create a temporary directory, write to a file\nwithin it, call out to an external program to create a PDF, and read\nthe result. While the external process creates a lot of additional\nfiles, the temporary directory is removed automatically at exit (because\n`temp.track()` is called):\n\n```javascript\nvar temp = require('../lib/temp'),\n fs = require('fs'),\n util = require('util'),\n path = require('path'),\n exec = require('child_process').exec;\n\n// Automatically track and cleanup files at exit\ntemp.track();\n\n// For use with ConTeXt, http://wiki.contextgarden.net\nvar myData = \"\\\\starttext\\nHello World\\n\\\\stoptext\";\n\ntemp.mkdir('pdfcreator', function(err, dirPath) {\n var inputPath = path.join(dirPath, 'input.tex')\n fs.writeFile(inputPath, myData, function(err) {\n if (err) throw err;\n process.chdir(dirPath);\n exec(\"texexec '\" + inputPath + \"'\", function(err) {\n if (err) throw err;\n fs.readFile(path.join(dirPath, 'input.pdf'), function(err, data) {\n if (err) throw err;\n sys.print(data);\n });\n });\n });\n});\n```\n\n### Temporary Streams\n\nTo create a temporary WriteStream, use 'createWriteStream', which sits\non top of `fs.createWriteStream`. The return value is a\n`fs.WriteStream` whose `path` is registered for removal when\n`temp.cleanup` is called (because `temp.track()` is called).\n\n```javascript\nvar temp = require('temp');\n\n// Automatically track and cleanup files at exit\ntemp.track();\n\nvar stream = temp.createWriteStream();\nstream.write(\"Some data\");\n// Maybe do some other things\nstream.end();\n```\n\n### Affixes\n\nYou can provide custom prefixes and suffixes when creating temporary\nfiles and directories. If you provide a string, it is used as the prefix\nfor the temporary name. If you provide an object with `prefix`,\n`suffix` and `dir` keys, they are used for the temporary name.\n\nHere are some examples:\n\n* `\"aprefix\"`: A simple prefix, prepended to the filename; this is\n shorthand for:\n* `{prefix: \"aprefix\"}`: A simple prefix, prepended to the filename\n* `{suffix: \".asuffix\"}`: A suffix, appended to the filename\n (especially useful when the file needs to be named with specific\n extension for use with an external program).\n* `{prefix: \"myprefix\", suffix: \"mysuffix\"}`: Customize both affixes\n* `{dir: path.join(os.tmpDir()), \"myapp\"}`: default prefix and suffix\n within a new temporary directory.\n* `null`: Use the defaults for files and directories (prefixes `\"f-\"`\n and `\"d-\"`, respectively, no suffixes).\n\nIn this simple example we read a `pdf`, write it to a temporary file with\na `.pdf` extension, and close it.\n\n```javascript\nvar fs = require('fs'),\n temp = require('temp');\n\nfs.readFile('/path/to/source.pdf', function(err, data) {\n temp.open({suffix: '.pdf'}, function(err, info) {\n if (err) throw err;\n fs.write(info.fd, contents);\n fs.close(info.fd, function(err) {\n if (err) throw err;\n // Do something with the file\n });\n });\n});\n```\n\n### Just a path, please\n\nIf you just want a unique name in your temporary directory, use\n`path`:\n\n```javascript\nvar fs = require('fs');\nvar tempName = temp.path({suffix: '.pdf'});\n// Do something with tempName\n```\n\nNote: The file isn't created for you, and the mode is not changed -- and it\nwill not be removed automatically at exit. If you use `path`, it's\nall up to you.\n\nUsing it with Grunt\n-------------------\n\nIf you want to use the module with [Grunt](http://gruntjs.com/), make sure you\nuse `async()` in your Gruntfile:\n\n```javascript\nmodule.exports = function (grunt) {\n var temp = require(\"temp\");\n temp.track(); // Cleanup files, please\n grunt.registerTast(\"temptest\", \"Testing temp\", function() {\n\n var done = this.async(); // Don't forget this!\n\n grunt.log.writeln(\"About to write a file...\");\n temp.open('tempfile', function(err, info) {\n // File writing shenanigans here\n grunt.log.writeln(\"Wrote a file!\")\n\n done(); // REALLY don't forget this!\n\n });\n });\n};\n```\n\nFor more information, see the [Grunt FAQ](http://gruntjs.com/frequently-asked-questions#why-doesn-t-my-asynchronous-task-complete).\n\nTesting\n-------\n\nFor now, run `test/temp-test.js`:\n\n $ node test/temp-test.js\n\nContributing\n------------\n\nYou can find the repository at:\nhttp://github.com/bruce/node-temp\n\nIssues/Feature Requests can be submitted at:\nhttp://github.com/bruce/node-temp/issues\n\nI'd really like to hear your feedback, and I'd love to receive your\npull-requests!\n\nCopyright\n---------\n\nCopyright (c) 2010-2012 Bruce Williams. See LICENSE for details.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/bruce/node-temp/issues" - }, - "_id": "temp@0.6.0", - "dist": { - "shasum": "29d2d63697c79fb5108af11e1cba8edf097877bd" - }, - "_from": "temp@", - "_resolved": "https://registry.npmjs.org/temp/-/temp-0.6.0.tgz" -} diff --git a/src/extensibility/node/node_modules/temp/test/temp-test.js b/src/extensibility/node/node_modules/temp/test/temp-test.js deleted file mode 100644 index 34071faf59c..00000000000 --- a/src/extensibility/node/node_modules/temp/test/temp-test.js +++ /dev/null @@ -1,77 +0,0 @@ -var assert = require('assert'); -var path = require('path'); -var fs = require('fs'); -var util = require('util'); - -var temp = require('../lib/temp'); -temp.track(); - -var existsSync = function(path){ - try { - fs.statSync(path); - return true; - } catch (e){ - return false; - } -}; - -// Use path.exists for 0.6 if necessary -var safeExists = fs.exists || path.exists; - -var mkdirFired = false; -var mkdirPath = null; -temp.mkdir('foo', function(err, tpath) { - mkdirFired = true; - assert.ok(!err, "temp.mkdir did not execute without errors"); - assert.ok(path.basename(tpath).slice(0, 3) == 'foo', 'temp.mkdir did not use the prefix'); - assert.ok(existsSync(tpath), 'temp.mkdir did not create the directory'); - - fs.writeFileSync(path.join(tpath, 'a file'), 'a content'); - temp.cleanup(); - assert.ok(!existsSync(tpath), 'temp.cleanup did not remove the directory'); - - mkdirPath = tpath; -}); - -var openFired = false; -var openPath = null; -temp.open('bar', function(err, info) { - openFired = true; - assert.equal('object', typeof(info), "temp.open did not invoke the callback with the err and info object"); - assert.equal('number', typeof(info.fd), 'temp.open did not invoke the callback with an fd'); - fs.writeSync(info.fd, 'foo'); - fs.closeSync(info.fd); - assert.equal('string', typeof(info.path), 'temp.open did not invoke the callback with a path'); - assert.ok(existsSync(info.path), 'temp.open did not create a file'); - - temp.cleanup(); - assert.ok(!existsSync(info.path), 'temp.cleanup did not remove the file'); - - openPath = info.path; -}); - - -var stream = temp.createWriteStream('baz'); -assert.ok(stream instanceof fs.WriteStream, "temp.createWriteStream did not invoke the callback with the err and stream object"); -stream.write('foo'); -stream.end("More text here\nand more..."); -assert.ok(existsSync(stream.path), 'temp.createWriteStream did not create a file'); - -console.log(temp.cleanup()); -assert.ok(!existsSync(stream.path), 'temp.cleanup did not remove the createWriteStream file'); - -var tempPath = temp.path(); -assert.ok(path.dirname(tempPath) === temp.dir, "temp.path does not work in default os temporary directory"); - -tempPath = temp.path({dir: process.cwd()}); -assert.ok(path.dirname(tempPath) === process.cwd(), "temp.path does not work in user-provided temporary directory"); - -for (var i=0; i <= 10; i++) { - temp.openSync(); -}; -assert.equal(process.listeners('exit').length, 1, 'temp created more than one listener for exit'); - -process.addListener('exit', function() { - assert.ok(mkdirFired, "temp.mkdir callback did not fire"); - assert.ok(openFired, "temp.open callback did not fire"); -}); diff --git a/src/extensibility/node/package.json b/src/extensibility/node/package.json deleted file mode 100644 index a7e8846cde0..00000000000 --- a/src/extensibility/node/package.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "brackets-extensibility", - "description": "Used in the management of Brackets extensions", - "version": "1.2.0", - "dependencies": { - "decompress-zip": "0.0.2", - "semver": "2.x", - "fs-extra": "0.6.x", - "async": "0.2.x", - "request": "2.27.x", - "temp": "~0.6.0" - }, - "devDependencies": { - "rewire": "1.1.x" - } -} diff --git a/tasks/pack-web-dependencies.js b/tasks/pack-web-dependencies.js new file mode 100644 index 00000000000..83381d01fe3 --- /dev/null +++ b/tasks/pack-web-dependencies.js @@ -0,0 +1,49 @@ +/* eslint-env node */ + +"use strict"; + +module.exports = function (grunt) { + + var _ = require("lodash"), + common = require("./lib/common")(grunt), + build = require("./build")(grunt), + glob = require("glob"), + path = require("path"), + spawn = require("child_process").spawn; + + grunt.registerTask("pack-web-dependencies", "Runs webpack on stuff we need to use from browser", function () { + var done = this.async(); + var webpackPath = path.resolve( + __dirname, + "..", + "node_modules", + ".bin", + process.platform === "win32" ? "webpack.cmd" : "webpack" + ); + var webpackTasks = [ + [ + "./node_modules/semver/semver.js", + "./src/thirdparty/semver.browser.js", + "-p", + "--output-library-target=amd" + ] + ]; + var doneWithWebpackTask = _.after(webpackTasks.length, done); + webpackTasks.forEach(function (args) { + var wp = spawn(webpackPath, args, { + cwd: path.resolve(__dirname, "..") + }); + wp.stdout.on('data', function (data) { + console.log("webpack-stdout: " + data.toString()); + }); + wp.stderr.on('data', function (data) { + console.log("webpack-stderr: " + data.toString()); + }); + wp.on('close', function (code) { + console.log("webpack-exit code " + code.toString()); + return code === 0 ? doneWithWebpackTask() : done(false); + }); + }); + }); + +}; From 64b859d0b3c4d8dffb0fab23c70ee3af55c6eb80 Mon Sep 17 00:00:00 2001 From: Swagatam Mitra Date: Wed, 15 Mar 2017 14:10:44 +0530 Subject: [PATCH 101/121] Brackets 1.9 pre-release --- build.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build.json b/build.json index 95a9ab94bfe..b2d5d0eda9a 100644 --- a/build.json +++ b/build.json @@ -1,6 +1,6 @@ { - "version": "release-1.9-prerelease", - "title" : "Brackets 1.9 Pre-release for community testing", - "description" : "This is a Brackets 1.9 pre-release build. This release contains reverse inspect for live preview, extension sorting mechanism based on download count and much more.", + "version": "release-1.9-prerelease-2", + "title" : "Brackets 1.9 Stable Pre-release for community testing", + "description" : "This is a Brackets 1.9 pre-release build.", "prerelease": true } From 8949cdff6953464827b174803fac65f2d52c2371 Mon Sep 17 00:00:00 2001 From: ficristo Date: Wed, 15 Mar 2017 19:48:00 +0100 Subject: [PATCH 102/121] Do not initialize dontCloseTags --- src/editor/Editor.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/editor/Editor.js b/src/editor/Editor.js index f2a4ff9ab12..0596833d3dc 100644 --- a/src/editor/Editor.js +++ b/src/editor/Editor.js @@ -141,7 +141,10 @@ define(function (require, exports, module) { PreferencesManager.definePreference(CLOSE_BRACKETS, "boolean", true, { description: Strings.DESCRIPTION_CLOSE_BRACKETS }); - PreferencesManager.definePreference(CLOSE_TAGS, "object", { whenOpening: true, whenClosing: true, indentTags: [], dontCloseTags: [] }, { + + // CodeMirror, html mode, set some tags do not close automatically. + // We do not initialize "dontCloseTags" because otherwise we would overwrite the default behavior of CodeMirror. + PreferencesManager.definePreference(CLOSE_TAGS, "object", { whenOpening: true, whenClosing: true, indentTags: [] }, { description: Strings.DESCRIPTION_CLOSE_TAGS, keys: { dontCloseTags: { From 4d7aa16bd634bcd85274e70d3fb6ce0fb9800c81 Mon Sep 17 00:00:00 2001 From: Saurabh Kathpalia Date: Thu, 16 Mar 2017 11:41:26 +0530 Subject: [PATCH 103/121] Upgraded version to 1.10 --- package.json | 6 +++--- src/config.json | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 35de9fe30e1..6446d34744d 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "Brackets", - "version": "1.9.0-0", - "apiVersion": "1.9.0", + "version": "1.10.0-0", + "apiVersion": "1.10.0", "homepage": "http://brackets.io", "issues": { "url": "http://github.com/adobe/brackets/issues" @@ -68,4 +68,4 @@ "url": "https://github.com/adobe/brackets/blob/master/LICENSE" } ] -} +} \ No newline at end of file diff --git a/src/config.json b/src/config.json index 55a2c5db84c..2c292634c54 100644 --- a/src/config.json +++ b/src/config.json @@ -23,8 +23,8 @@ "healthDataServerURL": "https://healthdev.brackets.io/healthDataLog" }, "name": "Brackets", - "version": "1.9.0-0", - "apiVersion": "1.9.0", + "version": "1.10.0-0", + "apiVersion": "1.10.0", "homepage": "http://brackets.io", "issues": { "url": "http://github.com/adobe/brackets/issues" From 0469c0c66fc4b1fb36794b3ad07e7a70befb1a7d Mon Sep 17 00:00:00 2001 From: Saurabh Kathpalia Date: Fri, 17 Mar 2017 11:38:12 +0530 Subject: [PATCH 104/121] Now search history is stored in preferences and user can go through the search history using key up and key down in search bar --- src/nls/root/strings.js | 1 + src/search/FindBar.js | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/src/nls/root/strings.js b/src/nls/root/strings.js index 036b400b9bc..0762329cb94 100644 --- a/src/nls/root/strings.js +++ b/src/nls/root/strings.js @@ -152,6 +152,7 @@ define({ "FIND_MATCH_INDEX" : "{0} of {1}", "FIND_NO_RESULTS" : "No results", "FIND_QUERY_PLACEHOLDER" : "Find\u2026", + "FIND_HISTORY_MAX_COUNT" : "Maximum Number of Search Items in Search History", "REPLACE_PLACEHOLDER" : "Replace with\u2026", "BUTTON_REPLACE_ALL" : "Replace All", "BUTTON_REPLACE_BATCH" : "Batch\u2026", diff --git a/src/search/FindBar.js b/src/search/FindBar.js index 317a0833b57..a0cf00f48ac 100644 --- a/src/search/FindBar.js +++ b/src/search/FindBar.js @@ -267,6 +267,7 @@ define(function (require, exports, module) { FindBar._addFindBar(this); var $root = this._modalBar.getRoot(); + var currentIndex = 0; $root .on("input", "#find-what", function () { self.trigger("queryChange"); @@ -310,9 +311,21 @@ define(function (require, exports, module) { if (intervalId === 0) { intervalId = window.setInterval(executeSearchIfNeeded, 50); } + var searchHistory = PreferencesManager.getViewState("searchHistory"); + var maxCount = PreferencesManager.get("maxSearchHistory"); if (e.keyCode === KeyEvent.DOM_VK_RETURN) { e.preventDefault(); e.stopPropagation(); + var searchQueryIndex = searchHistory.indexOf($('#find-what').val()); + if (searchQueryIndex !== -1) { + searchHistory.splice(searchQueryIndex, 1); + } else { + if (searchHistory.length === maxCount) { + searchHistory.splice(maxCount - 1, 1); + } + } + searchHistory.unshift($('#find-what').val()); + PreferencesManager.setViewState("searchHistory", searchHistory); lastQueriedText = self.getQueryInfo().query; if (self._options.multifile) { if ($(e.target).is("#find-what")) { @@ -333,6 +346,15 @@ define(function (require, exports, module) { // if Shift is held down). self.trigger("doFind", e.shiftKey); } + currentIndex = 0; + } else if (e.keyCode === KeyEvent.DOM_VK_DOWN) { + currentIndex = (currentIndex + 1) % Math.min(maxCount, searchHistory.length); + $("#find-what").val(searchHistory[currentIndex]); + self.trigger("queryChange"); + } else if (e.keyCode === KeyEvent.DOM_VK_UP) { + currentIndex = (currentIndex - 1 + maxCount) % Math.min(maxCount, searchHistory.length); + $("#find-what").val(searchHistory[currentIndex]); + self.trigger("queryChange"); } }); @@ -616,6 +638,10 @@ define(function (require, exports, module) { PreferencesManager.stateManager.definePreference("caseSensitive", "boolean", false); PreferencesManager.stateManager.definePreference("regexp", "boolean", false); + PreferencesManager.stateManager.definePreference("searchHistory", "array", []); + PreferencesManager.definePreference("maxSearchHistory", "number", 10, { + description: Strings.FIND_HISTORY_MAX_COUNT + }); exports.FindBar = FindBar; }); From 251144291b80e6410b90f774112ea50abf105176 Mon Sep 17 00:00:00 2001 From: walfgithub Date: Sun, 19 Mar 2017 20:53:56 -0700 Subject: [PATCH 105/121] ALF Automation (#13179) * Updated by ALF automation. * Updated by ALF automation. * Updated by ALF automation. --- src/nls/fr/strings.js | 45 ++++++++++++++++++++++--------------------- src/nls/ja/strings.js | 15 ++++++++------- 2 files changed, 31 insertions(+), 29 deletions(-) diff --git a/src/nls/fr/strings.js b/src/nls/fr/strings.js index a032cfed163..db014948cdd 100644 --- a/src/nls/fr/strings.js +++ b/src/nls/fr/strings.js @@ -129,7 +129,7 @@ define({ "SAVE_CLOSE_MULTI_MESSAGE": "Souhaitez-vous enregistrer les modifications apportées aux fichiers suivants ?", "EXT_MODIFIED_TITLE": "Modifications externes", "CONFIRM_DELETE_TITLE": "Confirmer la suppression", - "CONFIRM_FILE_DELETE": "Voulez-vous vraiment supprimer le fichier {0} ?", + "CONFIRM_FILE_DELETE": "Souhaitez-vous vraiment supprimer le fichier {0} ?", "CONFIRM_FOLDER_DELETE": "Voulez-vous vraiment supprimer le dossier {0} ?", "FILE_DELETED_TITLE": "Fichier supprimé", "EXT_MODIFIED_WARNING": "{0} a été modifié sur le disque, dans une application autre que {APP_NAME}.

    Voulez-vous enregistrer le fichier et remplacer ces modifications ?", @@ -153,7 +153,7 @@ define({ "FIND_NO_RESULTS": "Aucun résultat", "FIND_QUERY_PLACEHOLDER": "Rechercher\u2026", "REPLACE_PLACEHOLDER": "Remplacer par\u2026", - "BUTTON_REPLACE_ALL": "Remplacer tout", + "BUTTON_REPLACE_ALL": "Tout remplacer", "BUTTON_REPLACE_BATCH": "Traiter par lots\u2026", "BUTTON_REPLACE_ALL_IN_FILES": "Remplacer\u2026", "BUTTON_REPLACE": "Remplacer", @@ -210,20 +210,20 @@ define({ "FILE_FILTER_DIALOG": "Modifier le jeu d’exclusion", "FILE_FILTER_INSTRUCTIONS": "Exclure les fichiers et dossiers correspondant à l’une des chaînes/sous-chaînes ou aux
    caractères génériques suivants. Entrez chaque chaîne sur une ligne différente.", "FILTER_NAME_PLACEHOLDER": "Nommer ce jeu d’exclusion (facultatif)", - "FILTER_NAME_REMAINING": "{0} characters remaining", + "FILTER_NAME_REMAINING": "{0} caractères restants", "FILE_FILTER_CLIPPED_SUFFIX": "et {0} autre(s)", "FILTER_COUNTING_FILES": "Comptage des fichiers\u2026", "FILTER_FILE_COUNT": "Autorise {0} fichier(s) sur les {1} {2}", "FILTER_FILE_COUNT_ALL": "Autorise les {0} fichiers {1}", // Quick Edit - "ERROR_QUICK_EDIT_PROVIDER_NOT_FOUND": "Fonction Édition rapide non disponible pour la position actuelle du curseur", - "ERROR_CSSQUICKEDIT_BETWEENCLASSES": "Édition rapide CSS : placez le curseur sur un seul nom de classe", - "ERROR_CSSQUICKEDIT_CLASSNOTFOUND": "Édition rapide CSS : attribut de classe incomplet", - "ERROR_CSSQUICKEDIT_IDNOTFOUND": "Édition rapide CSS : attribut d’ID incomplet", - "ERROR_CSSQUICKEDIT_UNSUPPORTEDATTR": "Édition rapide CSS : placez le curseur dans la balise, la classe ou l’ID", - "ERROR_TIMINGQUICKEDIT_INVALIDSYNTAX": "Édition rapide des fonctions de temporisation CSS : syntaxe incorrecte", - "ERROR_JSQUICKEDIT_FUNCTIONNOTFOUND": "Édition rapide JS : placez le curseur dans le nom de fonction", + "ERROR_QUICK_EDIT_PROVIDER_NOT_FOUND": "Fonction Edition rapide non disponible pour la position actuelle du curseur", + "ERROR_CSSQUICKEDIT_BETWEENCLASSES": "Edition rapide CSS : placez le curseur sur un seul nom de classe", + "ERROR_CSSQUICKEDIT_CLASSNOTFOUND": "Edition rapide CSS : attribut de classe incomplet", + "ERROR_CSSQUICKEDIT_IDNOTFOUND": "Edition rapide CSS : attribut d’ID incomplet", + "ERROR_CSSQUICKEDIT_UNSUPPORTEDATTR": "Edition rapide CSS : placez le curseur dans la balise, la classe ou l’ID", + "ERROR_TIMINGQUICKEDIT_INVALIDSYNTAX": "Edition rapide des fonctions de temporisation CSS : syntaxe incorrecte", + "ERROR_JSQUICKEDIT_FUNCTIONNOTFOUND": "Edition rapide JS : placez le curseur dans le nom de fonction", // Quick Docs "ERROR_QUICK_DOCS_PROVIDER_NOT_FOUND": "Fonction Documentation rapide non disponible pour la position actuelle du curseur", @@ -384,7 +384,7 @@ define({ "CMD_SHOW_SIDEBAR": "Afficher la barre latérale", "CMD_TOGGLE_SIDEBAR": "Afficher/Masquer la barre latérale", "CMD_TOGGLE_PANELS": "Afficher/Masquer les panneaux", - "CMD_TOGGLE_PURE_CODE": "Aucune distraction", + "CMD_TOGGLE_PURE_CODE": "Pas de distraction", "CMD_INCREASE_FONT_SIZE": "Augmenter la taille de la police", "CMD_DECREASE_FONT_SIZE": "Diminuer la taille de la police", "CMD_RESTORE_FONT_SIZE": "Restaurer la taille de la police", @@ -407,7 +407,7 @@ define({ "CMD_GOTO_LINE": "Atteindre la ligne", "CMD_GOTO_DEFINITION": "Accès rapide à la définition", "CMD_GOTO_FIRST_PROBLEM": "Accéder au premier problème", - "CMD_TOGGLE_QUICK_EDIT": "Édition rapide", + "CMD_TOGGLE_QUICK_EDIT": "Edition rapide", "CMD_TOGGLE_QUICK_DOCS": "Documentation rapide", "CMD_QUICK_EDIT_PREV_MATCH": "Correspondance précédente", "CMD_QUICK_EDIT_NEXT_MATCH": "Correspondance suivante", @@ -420,7 +420,7 @@ define({ "CMD_SHOW_IN_EXPLORER": "Afficher dans l’Explorateur", "CMD_SHOW_IN_FINDER": "Afficher dans le Finder", "CMD_SHOW_IN_OS": "Afficher dans le SE", - "CMD_SWITCH_PANE_FOCUS": "Switch Pane Focus", + "CMD_SWITCH_PANE_FOCUS": "Changer de volet actif", // Help menu commands "HELP_MENU": "Aide", @@ -434,7 +434,7 @@ define({ "CMD_HEALTH_DATA_STATISTICS": "Rapport d’intégrité", "CMD_HOMEPAGE": "Page d’accueil de {APP_TITLE}", "CMD_TWITTER": "{TWITTER_NAME} sur Twitter", - "CMD_ABOUT": "À propos de {APP_TITLE}", + "CMD_ABOUT": "A propos de {APP_TITLE}", "CMD_OPEN_PREFERENCES": "Ouvrir le fichier de préférences", "CMD_OPEN_KEYMAP": "Ouvrir le mappage de touches utilisateur", @@ -446,7 +446,7 @@ define({ "KEEP_CHANGES_IN_EDITOR": "Conserver les modifications dans l’éditeur", "CLOSE_DONT_SAVE": "Fermer (sans enregistrer)", "RELAUNCH_CHROME": "Relancer Chrome", - "ABOUT": "À propos", + "ABOUT": "A propos", "CLOSE": "Fermer", "ABOUT_TEXT_LINE1": "Version {VERSION_MAJOR}.{VERSION_MINOR} {BUILD_TYPE} {VERSION}", "ABOUT_TEXT_BUILD_TIMESTAMP": "Horodatage de la version : ", @@ -504,7 +504,7 @@ define({ "INSTALL_CANCELED": "Installation annulée.", "VIEW_COMPLETE_DESCRIPTION": "Voir la description complète", "VIEW_TRUNCATED_DESCRIPTION": "Voir la description tronquée", - "SORT_EXTENSION_METHOD": "Sort Extensions using downloadCount or publishedDate", + "SORT_EXTENSION_METHOD": "Trier les extensions suivant downloadCount ou publishedDate", // These must match the error codes in ExtensionsDomain.Errors.* : "INVALID_ZIP_FILE": "Le contenu téléchargé n’est pas un fichier zip valide.", "MISSING_PACKAGE_JSON": "Le pack ne contient pas de fichier package.json.", @@ -515,7 +515,7 @@ define({ "INVALID_VERSION_NUMBER": "Le numéro de version du pack ({0}) n’est pas valide.", "INVALID_BRACKETS_VERSION": "La chaîne de compatibilité {APP_NAME} ({0}) n’est pas valide.", "DISALLOWED_WORDS": "Le champ {0} ne peut pas contenir les mots ({1}).", - "NPM_INSTALL_FAILED": "npm install command failed: {0}", + "NPM_INSTALL_FAILED": "Échec de la commande npm install : {0}", "API_NOT_COMPATIBLE": "L’extension n’est pas compatible avec cette version de l’application {APP_NAME}. Elle a été installée dans le dossier contenant les extensions désactivées.", "MISSING_MAIN": "Le pack ne contient pas de fichier main.js.", "EXTENSION_ALREADY_INSTALLED": "L’installation de ce pack remplacera une extension installée précédemment. Voulez-vous remplacer l’extension installée ?", @@ -582,7 +582,7 @@ define({ "EXTENSIONS_AVAILABLE_TITLE": "Disponibles", "EXTENSIONS_THEMES_TITLE": "Thèmes", "EXTENSIONS_UPDATES_TITLE": "Mises à jour", - "EXTENSIONS_LAST_UPDATED": "Dernières mises à jour", + "EXTENSIONS_LAST_UPDATED": "Dernière mise à jour", "EXTENSIONS_DOWNLOADS": "Téléchargements", "INLINE_EDITOR_NO_MATCHES": "Aucun résultat.", @@ -651,6 +651,7 @@ define({ "COLOR_EDITOR_RGBA_BUTTON_TIP": "Format RGBa", "COLOR_EDITOR_HEX_BUTTON_TIP": "Format Hex", "COLOR_EDITOR_HSLA_BUTTON_TIP": "Format HSLa", + "COLOR_EDITOR_0X_BUTTON_TIP": "Format hexadécimal (0x)", "COLOR_EDITOR_USED_COLOR_TIP_SINGULAR": "{0} (utilisé {1} fois)", "COLOR_EDITOR_USED_COLOR_TIP_PLURAL": "{0} (utilisé {1} fois)", @@ -659,7 +660,7 @@ define({ "CMD_SHOW_PARAMETER_HINT": "Afficher l’indicateur de paramètre", "NO_ARGUMENTS": "", "DETECTED_EXCLUSION_TITLE": "Problème d’inférence de fichier Javascript", - "DETECTED_EXCLUSION_INFO": "{APP_NAME} a rencontré des problèmes lors du traitement du fichier {0}.

    La fonction d’accès aux définitions, les indicateurs de code et la fonction Édition rapide de ce fichier ne seront plus traités. Pour réactiver ce fichier, ouvrez .brackets.json dans votre projet et éditez la section jscodehints.detectedExclusions.

    Il s’agit vraisemblablement d’un bug au niveau de l’application {APP_NAME}. Si vous pouvez nous transmettre une copie de ce fichier, merci de consigner un bug en fournissant un lien vers le fichier en question.", + "DETECTED_EXCLUSION_INFO": "{APP_NAME} a rencontré des problèmes lors du traitement du fichier {0}.

    La fonction d’accès aux définitions, les indicateurs de code et la fonction Edition rapide de ce fichier ne seront plus traités. Pour réactiver ce fichier, ouvrez .brackets.json dans votre projet et éditez la section jscodehints.detectedExclusions.

    Il s’agit vraisemblablement d’un bug au niveau de l’application {APP_NAME}. Si vous pouvez nous transmettre une copie de ce fichier, merci de consigner un bug en fournissant un lien vers le fichier en question.", // extensions/default/JSLint "JSLINT_NAME": "JSLint", @@ -704,7 +705,7 @@ define({ "DESCRIPTION_ATTR_HINTS": "Activer/désactiver les indicateurs d’attribut HTML", "DESCRIPTION_CSS_PROP_HINTS": "Activer/désactiver les indicateurs de propriété CSS/LESS/SCSS", "DESCRIPTION_JS_HINTS": "Activer/désactiver les indicateurs de code JavaScript", - "DESCRIPTION_JS_HINTS_TYPE_DETAILS": "Activer/désactiver les détails sur le type de données dans les indicateurs de code JavaScript", + "DESCRIPTION_JS_HINTS_TYPE_DETAILS": "Activer/désactiver les détails de type de données dans les indicateurs de code JavaScript", "DESCRIPTION_PREF_HINTS": "Activer/désactiver les indicateurs de code Préférences", "DESCRIPTION_SPECIAL_CHAR_HINTS": "Activer/désactiver les indicateurs d’entité HTML", "DESCRIPTION_SVG_HINTS": "Activer/désactiver les indicateurs de code SVG", @@ -750,7 +751,7 @@ define({ "DESCRIPTION_LANGUAGE": "Paramètres spécifiques à la langue", "DESCRIPTION_LANGUAGE_FILE_EXTENSIONS": "Mappages supplémentaires entre extension de fichier et nom de langue", "DESCRIPTION_LANGUAGE_FILE_NAMES": "Mappages supplémentaires entre nom de fichier et nom de langue", - "DESCRIPTION_LINEWISE_COPY_CUT": "Si vous coupez ou copiez sans rien avoir sélectionné, la ligne sur laquelle se trouve le curseur est coupée ou copiée dans son intégralité.", + "DESCRIPTION_LINEWISE_COPY_CUT": "En cas d’absence de sélection, un couper-copier coupe ou copie les lignes entières comportant des curseurs.", "DESCRIPTION_LINTING_ENABLED": "vrai pour activer l’inspection de code", "DESCRIPTION_ASYNC_TIMEOUT": "Durée, en millisecondes, après laquelle les utilitaires lint asynchrones échouent", "DESCRIPTION_LINTING_PREFER": "Ensemble d’utilitaires lint à exécuter en premier", @@ -795,5 +796,5 @@ define({ "DESCRIPTION_PURE_CODING_SURFACE": "vrai pour activer le mode code seul et masquer tous les autres éléments de l’interface utilisateur dans {APP_NAME}", "DESCRIPTION_INDENT_LINE_COMMENT": "vrai pour activer la mise en retrait des commentaires sur une ligne", "DESCRIPTION_RECENT_FILES_NAV": "Activer/désactiver la navigation dans les fichiers récents", - "DESCRIPTION_LIVEDEV_WEBSOCKET_PORT": "Port on which WebSocket Server runs for Live Preview" + "DESCRIPTION_LIVEDEV_WEBSOCKET_PORT": "Port sur lequel s’exécute le serveur WebSocket pour le mode Aperçu en direct" }); diff --git a/src/nls/ja/strings.js b/src/nls/ja/strings.js index c9b07715563..00551b504f4 100644 --- a/src/nls/ja/strings.js +++ b/src/nls/ja/strings.js @@ -128,7 +128,7 @@ define({ "SAVE_CLOSE_MESSAGE": "文書 {0} に加えた変更を保存しますか?", "SAVE_CLOSE_MULTI_MESSAGE": "以下のファイルに対する変更を保存しますか?", "EXT_MODIFIED_TITLE": "外部で変更されました。", - "CONFIRM_DELETE_TITLE": "削除の確認", + "CONFIRM_DELETE_TITLE": "削除を確認", "CONFIRM_FILE_DELETE": "ファイル {0} を削除してもよろしいですか?", "CONFIRM_FOLDER_DELETE": "{0} フォルダーを削除してもよろしいですか?", "FILE_DELETED_TITLE": "ファイルは削除されました", @@ -154,7 +154,7 @@ define({ "FIND_QUERY_PLACEHOLDER": "検索\u2026", "REPLACE_PLACEHOLDER": "\u2026 に置換", "BUTTON_REPLACE_ALL": "すべて置換", - "BUTTON_REPLACE_BATCH": "バッチ\u2026", + "BUTTON_REPLACE_BATCH": "バッチ¥u2026", "BUTTON_REPLACE_ALL_IN_FILES": "置換\u2026", "BUTTON_REPLACE": "置換", "BUTTON_NEXT": "\u25B6", @@ -210,7 +210,7 @@ define({ "FILE_FILTER_DIALOG": "除外セットを編集", "FILE_FILTER_INSTRUCTIONS": "次の文字列やサブストリング、またはワイルドカードのいずれかに一致するファイルおよびフォルダーを除外します。各文字列を新しい行に入力してください。", "FILTER_NAME_PLACEHOLDER": "この除外セットに名前を付ける (オプション)", - "FILTER_NAME_REMAINING": "{0} characters remaining", + "FILTER_NAME_REMAINING": "残り {0} 文字", "FILE_FILTER_CLIPPED_SUFFIX": "さらに {0} 件", "FILTER_COUNTING_FILES": "ファイル数を確認中\u2026", "FILTER_FILE_COUNT": "{2}の {1} ファイル中 {0} ファイルを許可", @@ -420,7 +420,7 @@ define({ "CMD_SHOW_IN_EXPLORER": "エクスプローラーで表示", "CMD_SHOW_IN_FINDER": "Finder で表示", "CMD_SHOW_IN_OS": "OS で表示", - "CMD_SWITCH_PANE_FOCUS": "Switch Pane Focus", + "CMD_SWITCH_PANE_FOCUS": "ペインフォーカスの切り替え", // Help menu commands "HELP_MENU": "ヘルプ", @@ -504,7 +504,7 @@ define({ "INSTALL_CANCELED": "インストールはキャンセルされました。", "VIEW_COMPLETE_DESCRIPTION": "詳細な説明を表示", "VIEW_TRUNCATED_DESCRIPTION": "省略された説明を表示", - "SORT_EXTENSION_METHOD": "Sort Extensions using downloadCount or publishedDate", + "SORT_EXTENSION_METHOD": "downloadCount または publishedDate を使用してエクステンションをソート", // These must match the error codes in ExtensionsDomain.Errors.* : "INVALID_ZIP_FILE": "ダウンロードされたコンテンツは有効な zip ファイルではありません。", "MISSING_PACKAGE_JSON": "パッケージに package.json ファイルがありません。", @@ -515,7 +515,7 @@ define({ "INVALID_VERSION_NUMBER": "パッケージバージョン番号 ({0}) は無効です。", "INVALID_BRACKETS_VERSION": "{APP_NAME} 互換文字列 {0} は無効です。", "DISALLOWED_WORDS": "{1} は {0} フィールドでは使用できません。", - "NPM_INSTALL_FAILED": "npm install command failed: {0}", + "NPM_INSTALL_FAILED": "npm install コマンドに失敗しました : {0}", "API_NOT_COMPATIBLE": "拡張機能はこのバージョンの {APP_NAME} と互換性がありません。無効な拡張機能フォルダーにインストールされます。", "MISSING_MAIN": "パッケージに main.js ファイルが含まれていません。", "EXTENSION_ALREADY_INSTALLED": "このパッケージをインストールすると以前にインストールした拡張機能が上書きされます。古い拡張機能を上書きしますか?", @@ -651,6 +651,7 @@ define({ "COLOR_EDITOR_RGBA_BUTTON_TIP": "RGBa 形式", "COLOR_EDITOR_HEX_BUTTON_TIP": "16 進形式", "COLOR_EDITOR_HSLA_BUTTON_TIP": "HSLa 形式", + "COLOR_EDITOR_0X_BUTTON_TIP": "16 進数 (0x) 形式", "COLOR_EDITOR_USED_COLOR_TIP_SINGULAR": "{0} ({1} 回使用)", "COLOR_EDITOR_USED_COLOR_TIP_PLURAL": "{0} ({1} 回使用)", @@ -795,5 +796,5 @@ define({ "DESCRIPTION_PURE_CODING_SURFACE": "{APP_NAME} でコードのみモードを有効にし、その他すべての UI エレメントを非表示にするには true", "DESCRIPTION_INDENT_LINE_COMMENT": "行コメントのインデントを有効にするには true", "DESCRIPTION_RECENT_FILES_NAV": "最近使用したファイルのナビゲーションを有効化/無効化", - "DESCRIPTION_LIVEDEV_WEBSOCKET_PORT": "Port on which WebSocket Server runs for Live Preview" + "DESCRIPTION_LIVEDEV_WEBSOCKET_PORT": "WebSocket サーバーがライブプレビューで実行するポート" }); From 84094f3c60acae395dbd2f039eff6206e094f290 Mon Sep 17 00:00:00 2001 From: Saurabh Kathpalia Date: Mon, 20 Mar 2017 19:50:50 +0530 Subject: [PATCH 106/121] Fixed a minor issue --- src/search/FindBar.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/search/FindBar.js b/src/search/FindBar.js index a0cf00f48ac..dbb79d04f9b 100644 --- a/src/search/FindBar.js +++ b/src/search/FindBar.js @@ -348,11 +348,11 @@ define(function (require, exports, module) { } currentIndex = 0; } else if (e.keyCode === KeyEvent.DOM_VK_DOWN) { - currentIndex = (currentIndex + 1) % Math.min(maxCount, searchHistory.length); + currentIndex = (currentIndex - 1 + Math.min(maxCount, searchHistory.length)) % Math.min(maxCount, searchHistory.length); $("#find-what").val(searchHistory[currentIndex]); self.trigger("queryChange"); } else if (e.keyCode === KeyEvent.DOM_VK_UP) { - currentIndex = (currentIndex - 1 + maxCount) % Math.min(maxCount, searchHistory.length); + currentIndex = (currentIndex + 1 + Math.min(maxCount, searchHistory.length)) % Math.min(maxCount, searchHistory.length); $("#find-what").val(searchHistory[currentIndex]); self.trigger("queryChange"); } From 6ed4e918f3fa42a76e8aa0b544a2beebae0e6fa9 Mon Sep 17 00:00:00 2001 From: Patrick Oladimeji Date: Mon, 20 Mar 2017 18:35:24 +0000 Subject: [PATCH 107/121] Addresses issue where style and script tags (and their contents) did not appear as collapsible in html mixed mode. --- .../default/CodeFolding/foldhelpers/foldcode.js | 2 +- .../CodeFolding/foldhelpers/foldgutter.js | 6 +++--- .../default/CodeFolding/unittest-files/test.html | 16 +++++++++++++--- src/extensions/default/CodeFolding/unittests.js | 10 +++++----- 4 files changed, 22 insertions(+), 12 deletions(-) diff --git a/src/extensions/default/CodeFolding/foldhelpers/foldcode.js b/src/extensions/default/CodeFolding/foldhelpers/foldcode.js index 83b455a900f..b55366da628 100644 --- a/src/extensions/default/CodeFolding/foldhelpers/foldcode.js +++ b/src/extensions/default/CodeFolding/foldhelpers/foldcode.js @@ -139,7 +139,7 @@ define(function (require, exports, module) { keys.forEach(function (lineNumber) { lineNumber = +lineNumber; if (lineNumber >= cm.firstLine() && lineNumber <= cm.lastLine()) { - range = rf(cm, CodeMirror.Pos(lineNumber)); + range = rf(cm, CodeMirror.Pos(lineNumber, 0)); cachedRange = folds[lineNumber]; if (range && cachedRange && range.from.line === cachedRange.from.line && range.to.line === cachedRange.to.line) { diff --git a/src/extensions/default/CodeFolding/foldhelpers/foldgutter.js b/src/extensions/default/CodeFolding/foldhelpers/foldgutter.js index 1b9290cbf03..eda9cb6b414 100644 --- a/src/extensions/default/CodeFolding/foldhelpers/foldgutter.js +++ b/src/extensions/default/CodeFolding/foldhelpers/foldgutter.js @@ -92,7 +92,7 @@ define(function (require, exports, module) { var sr = _isCurrentlyFolded(i), // surrounding range for the current line if one exists range; var mark = marker("CodeMirror-foldgutter-blank"); - var pos = CodeMirror.Pos(i), + var pos = CodeMirror.Pos(i, 0), func = opts.rangeFinder || CodeMirror.fold.auto; // don't look inside collapsed ranges if (sr) { @@ -147,7 +147,7 @@ define(function (require, exports, module) { * @returns {TextMarker} A CodeMirror TextMarker object */ function getFoldOnLine(cm, line) { - var pos = CodeMirror.Pos(line); + var pos = CodeMirror.Pos(line, 0); var folds = cm.findMarksAt(pos) || []; folds = folds.filter(isFold); return folds.length ? folds[0] : undefined; @@ -220,7 +220,7 @@ define(function (require, exports, module) { if (linesDiff === 0) { if (foldedLines.indexOf(from) >= 0) { - newRange = rf(cm, CodeMirror.Pos(from)); + newRange = rf(cm, CodeMirror.Pos(from, 0)); if (newRange && newRange.to.line - newRange.from.line >= minFoldSize) { cm._lineFolds[from] = newRange; } else { diff --git a/src/extensions/default/CodeFolding/unittest-files/test.html b/src/extensions/default/CodeFolding/unittest-files/test.html index 25f9d4232f1..249fb8333bb 100644 --- a/src/extensions/default/CodeFolding/unittest-files/test.html +++ b/src/extensions/default/CodeFolding/unittest-files/test.html @@ -1,9 +1,17 @@ - + + -
    @@ -12,7 +20,9 @@ - + diff --git a/src/extensions/default/CodeFolding/unittests.js b/src/extensions/default/CodeFolding/unittests.js index 36b76713376..eaef8d2ae2f 100644 --- a/src/extensions/default/CodeFolding/unittests.js +++ b/src/extensions/default/CodeFolding/unittests.js @@ -37,10 +37,10 @@ define(function (require, exports, module) { }, html: { filePath: testDocumentDirectory + "test.html", - foldableLines: [1, 2, 5, 7, 8, 12, 13, 14, 18, 19, 24, 27], - sameLevelFoldableLines: [8, 24], - firstSelection: {start: {line: 3, ch: 0}, end: {line: 10, ch: 0}}, - secondSelection: {start: {line: 6, ch: 0}, end: {line: 17, ch: 4}} + foldableLines: [1, 2, 3, 4, 8, 9, 14, 15, 16, 20, 21, 22, 23, 28, 29, 34, 37], + sameLevelFoldableLines: [3, 8], + firstSelection: {start: {line: 38, ch: 0}, end: {line: 41, ch: 0}}, + secondSelection: {start: {line: 42, ch: 0}, end: {line: 45, ch: 4}} }, hbs: { filePath: testDocumentDirectory + "test.hbs", @@ -382,7 +382,7 @@ define(function (require, exports, module) { }); }); - it("can be disable persistence of fold states", function () { + it("can disable persistence of fold states", function () { setPreference("saveFoldStates", false); runs(function () { foldCodeOnLine(foldableLines[0]); From aefd90f94afa1a65a18da99682ca51e5b6442eb6 Mon Sep 17 00:00:00 2001 From: ficristo Date: Mon, 20 Mar 2017 20:47:49 +0100 Subject: [PATCH 108/121] Add no-unsafe-negation rule and upgrade grunt-eslint to 19.0.0 --- .eslintrc.js | 1 + npm-shrinkwrap.json | 214 ++++++++++++++++++++++++++++++++++++-------- package.json | 2 +- src/config.json | 2 +- 4 files changed, 181 insertions(+), 38 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 3663e2f317d..99fea4eb3b8 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -7,6 +7,7 @@ module.exports = { "no-empty": 1, "no-invalid-regexp": 2, "no-regex-spaces": 2, + "no-unsafe-negation": 1, "valid-jsdoc": 0, "valid-typeof": 2, // http://eslint.org/docs/rules/#best-practices diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index a96f2cea66a..b13fae5a396 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "Brackets", - "version": "1.9.0-0", + "version": "1.10.0-0", "dependencies": { "abbrev": { "version": "1.1.0", @@ -190,6 +190,12 @@ "from": "aws4@>=1.2.1 <2.0.0", "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz" }, + "babel-code-frame": { + "version": "6.22.0", + "from": "babel-code-frame@>=6.16.0 <7.0.0", + "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.22.0.tgz", + "dev": true + }, "balanced-match": { "version": "0.4.2", "from": "balanced-match@>=0.4.1 <0.5.0", @@ -635,9 +641,9 @@ "dev": true }, "doctrine": { - "version": "1.5.0", - "from": "doctrine@>=1.2.2 <2.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", + "version": "2.0.0", + "from": "doctrine@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.0.0.tgz", "dev": true }, "domain-browser": { @@ -695,16 +701,68 @@ "dev": true }, "es6-map": { - "version": "0.1.4", + "version": "0.1.5", "from": "es6-map@>=0.1.3 <0.2.0", - "resolved": "https://registry.npmjs.org/es6-map/-/es6-map-0.1.4.tgz", - "dev": true + "resolved": "https://registry.npmjs.org/es6-map/-/es6-map-0.1.5.tgz", + "dev": true, + "dependencies": { + "d": { + "version": "1.0.0", + "from": "d@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", + "dev": true + }, + "es5-ext": { + "version": "0.10.15", + "from": "es5-ext@>=0.10.14 <0.11.0", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.15.tgz", + "dev": true + }, + "es6-iterator": { + "version": "2.0.1", + "from": "es6-iterator@>=2.0.1 <2.1.0", + "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.1.tgz", + "dev": true + }, + "es6-symbol": { + "version": "3.1.1", + "from": "es6-symbol@>=3.1.1 <3.2.0", + "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz", + "dev": true + } + } }, "es6-set": { - "version": "0.1.4", - "from": "es6-set@>=0.1.3 <0.2.0", - "resolved": "https://registry.npmjs.org/es6-set/-/es6-set-0.1.4.tgz", - "dev": true + "version": "0.1.5", + "from": "es6-set@>=0.1.5 <0.2.0", + "resolved": "https://registry.npmjs.org/es6-set/-/es6-set-0.1.5.tgz", + "dev": true, + "dependencies": { + "d": { + "version": "1.0.0", + "from": "d@1", + "resolved": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", + "dev": true + }, + "es5-ext": { + "version": "0.10.15", + "from": "es5-ext@~0.10.14", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.15.tgz", + "dev": true + }, + "es6-iterator": { + "version": "2.0.1", + "from": "es6-iterator@~2.0.1", + "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.1.tgz", + "dev": true + }, + "es6-symbol": { + "version": "3.1.1", + "from": "es6-symbol@3.1.1", + "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz", + "dev": true + } + } }, "es6-symbol": { "version": "3.1.0", @@ -713,10 +771,36 @@ "dev": true }, "es6-weak-map": { - "version": "2.0.1", + "version": "2.0.2", "from": "es6-weak-map@>=2.0.1 <3.0.0", - "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.1.tgz", - "dev": true + "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.2.tgz", + "dev": true, + "dependencies": { + "d": { + "version": "1.0.0", + "from": "d@1", + "resolved": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", + "dev": true + }, + "es5-ext": { + "version": "0.10.15", + "from": "es5-ext@^0.10.14", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.15.tgz", + "dev": true + }, + "es6-iterator": { + "version": "2.0.1", + "from": "es6-iterator@^2.0.1", + "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.1.tgz", + "dev": true + }, + "es6-symbol": { + "version": "3.1.1", + "from": "es6-symbol@^3.1.1", + "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz", + "dev": true + } + } }, "escape-string-regexp": { "version": "1.0.5", @@ -730,9 +814,9 @@ "dev": true }, "eslint": { - "version": "2.13.1", - "from": "eslint@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-2.13.1.tgz", + "version": "3.18.0", + "from": "eslint@>=3.0.0 <4.0.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-3.18.0.tgz", "dev": true, "dependencies": { "argparse": { @@ -758,6 +842,12 @@ "from": "js-yaml@>=3.5.1 <4.0.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.8.2.tgz", "dev": true + }, + "strip-bom": { + "version": "3.0.0", + "from": "strip-bom@>=3.0.0 <4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "dev": true } } }, @@ -773,6 +863,12 @@ "resolved": "https://registry.npmjs.org/esprima/-/esprima-1.0.4.tgz", "dev": true }, + "esquery": { + "version": "1.0.0", + "from": "esquery@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.0.tgz", + "dev": true + }, "esrecurse": { "version": "4.1.0", "from": "esrecurse@>=4.1.0 <5.0.0", @@ -800,10 +896,24 @@ "dev": true }, "event-emitter": { - "version": "0.3.4", - "from": "event-emitter@>=0.3.4 <0.4.0", - "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.4.tgz", - "dev": true + "version": "0.3.5", + "from": "event-emitter@>=0.3.5 <0.4.0", + "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", + "dev": true, + "dependencies": { + "d": { + "version": "1.0.0", + "from": "d@1", + "resolved": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", + "dev": true + }, + "es5-ext": { + "version": "0.10.15", + "from": "es5-ext@~0.10.14", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.15.tgz", + "dev": true + } + } }, "eventemitter2": { "version": "0.4.14", @@ -879,9 +989,9 @@ "dev": true }, "file-entry-cache": { - "version": "1.3.1", - "from": "file-entry-cache@>=1.1.1 <2.0.0", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-1.3.1.tgz", + "version": "2.0.0", + "from": "file-entry-cache@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-2.0.0.tgz", "dev": true }, "filename-regex": { @@ -1235,9 +1345,9 @@ "dev": true }, "grunt-eslint": { - "version": "18.1.0", - "from": "grunt-eslint@18.1.0", - "resolved": "https://registry.npmjs.org/grunt-eslint/-/grunt-eslint-18.1.0.tgz", + "version": "19.0.0", + "from": "grunt-eslint@19.0.0", + "resolved": "https://registry.npmjs.org/grunt-eslint/-/grunt-eslint-19.0.0.tgz", "dev": true }, "grunt-jasmine-node": { @@ -1438,9 +1548,9 @@ "dev": true }, "ignore": { - "version": "3.2.4", - "from": "ignore@>=3.1.2 <4.0.0", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.2.4.tgz", + "version": "3.2.6", + "from": "ignore@>=3.2.0 <4.0.0", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.2.6.tgz", "dev": true }, "image-size": { @@ -1675,6 +1785,12 @@ "resolved": "https://registry.npmjs.org/jodid25519/-/jodid25519-1.0.2.tgz", "optional": true }, + "js-tokens": { + "version": "3.0.1", + "from": "js-tokens@>=3.0.0 <4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.1.tgz", + "dev": true + }, "js-yaml": { "version": "2.0.5", "from": "js-yaml@>=2.0.5 <2.1.0", @@ -1922,6 +2038,12 @@ "from": "nan@>=1.0.0 <1.1.0", "resolved": "https://registry.npmjs.org/nan/-/nan-1.0.0.tgz" }, + "natural-compare": { + "version": "1.4.0", + "from": "natural-compare@>=1.4.0 <2.0.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "dev": true + }, "node-libs-browser": { "version": "2.0.0", "from": "node-libs-browser@>=2.0.0 <3.0.0", @@ -3611,6 +3733,12 @@ "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", "dev": true }, + "path-parse": { + "version": "1.0.5", + "from": "path-parse@>=1.0.5 <2.0.0", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", + "dev": true + }, "path-type": { "version": "1.1.0", "from": "path-type@>=1.0.0 <2.0.0", @@ -3916,6 +4044,20 @@ "resolved": "https://registry.npmjs.org/readline2/-/readline2-1.0.1.tgz", "dev": true }, + "rechoir": { + "version": "0.6.2", + "from": "rechoir@>=0.6.2 <0.7.0", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", + "dev": true, + "dependencies": { + "resolve": { + "version": "1.3.2", + "from": "resolve@>=1.1.6 <2.0.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.3.2.tgz", + "dev": true + } + } + }, "regex-cache": { "version": "0.4.3", "from": "regex-cache@>=0.4.2 <0.5.0", @@ -4068,9 +4210,9 @@ "dev": true }, "shelljs": { - "version": "0.6.1", - "from": "shelljs@>=0.6.0 <0.7.0", - "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.6.1.tgz", + "version": "0.7.7", + "from": "shelljs@>=0.7.5 <0.8.0", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.7.7.tgz", "dev": true }, "sigmund": { @@ -4178,9 +4320,9 @@ "dev": true }, "strip-json-comments": { - "version": "1.0.4", - "from": "strip-json-comments@>=1.0.1 <1.1.0", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-1.0.4.tgz", + "version": "2.0.1", + "from": "strip-json-comments@>=2.0.1 <2.1.0", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", "dev": true }, "supports-color": { diff --git a/package.json b/package.json index 6446d34744d..af90d357b99 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "grunt-cli": "0.1.9", "phantomjs": "1.9.18", "grunt-lib-phantomjs": "0.3.0", - "grunt-eslint": "18.1.0", + "grunt-eslint": "19.0.0", "grunt-contrib-watch": "0.4.3", "grunt-contrib-jasmine": "0.4.2", "grunt-template-jasmine-requirejs": "0.1.0", diff --git a/src/config.json b/src/config.json index 2c292634c54..4c06284a6d8 100644 --- a/src/config.json +++ b/src/config.json @@ -58,7 +58,7 @@ "grunt-cli": "0.1.9", "phantomjs": "1.9.18", "grunt-lib-phantomjs": "0.3.0", - "grunt-eslint": "18.1.0", + "grunt-eslint": "19.0.0", "grunt-contrib-watch": "0.4.3", "grunt-contrib-jasmine": "0.4.2", "grunt-template-jasmine-requirejs": "0.1.0", From 6364893cc50559dbbc6d0df12b2953f65c120ab1 Mon Sep 17 00:00:00 2001 From: Saurabh Kathpalia Date: Tue, 21 Mar 2017 11:40:33 +0530 Subject: [PATCH 109/121] Added a check of Untitled doc in _getNormalizedFilename and _getDenormalizedFilename --- .../default/JavaScriptCodeHints/ScopeManager.js | 15 ++++++++------- .../default/JavaScriptCodeHints/tern-worker.js | 8 +++++--- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/extensions/default/JavaScriptCodeHints/ScopeManager.js b/src/extensions/default/JavaScriptCodeHints/ScopeManager.js index 00d97626464..ad16337c304 100644 --- a/src/extensions/default/JavaScriptCodeHints/ScopeManager.js +++ b/src/extensions/default/JavaScriptCodeHints/ScopeManager.js @@ -927,10 +927,11 @@ define(function (require, exports, module) { * @param {string} path - full path of file * @return {jQuery.Promise} - the promise for the request */ - function primePump(path) { + function primePump(path, isUntitledDoc) { _postMessageByPass({ - type : MessageIds.TERN_PRIME_PUMP_MSG, - path : path + type : MessageIds.TERN_PRIME_PUMP_MSG, + path : path, + isUntitledDoc : isUntitledDoc }); return addPendingRequest(path, OFFSET_ZERO, MessageIds.TERN_PRIME_PUMP_MSG); @@ -1152,7 +1153,7 @@ define(function (require, exports, module) { if (isDocumentDirty && previousDocument) { var updateFilePromise = updateTernFile(previousDocument); updateFilePromise.done(function () { - primePump(path); + primePump(path, document.isUntitled()); addFilesDeferred.resolveWith(null, [_ternWorker]); }); } else { @@ -1171,7 +1172,7 @@ define(function (require, exports, module) { deferredPreferences.done(function () { if (file instanceof InMemoryFile) { initTernServer(pr, []); - var hintsPromise = primePump(path); + var hintsPromise = primePump(path, true); hintsPromise.done(function () { addFilesDeferred.resolveWith(null, [_ternWorker]); }); @@ -1202,7 +1203,7 @@ define(function (require, exports, module) { initTernServer(dir, files); - var hintsPromise = primePump(path); + var hintsPromise = primePump(path, false); hintsPromise.done(function () { if (!usingModules()) { // Read the subdirectories of the new file's directory. @@ -1217,7 +1218,7 @@ define(function (require, exports, module) { addAllFilesAndSubdirectories(projectRoot, function () { // prime the pump again but this time don't wait // for completion. - primePump(path); + primePump(path, false); addFilesDeferred.resolveWith(null, [_ternWorker]); }); diff --git a/src/extensions/default/JavaScriptCodeHints/tern-worker.js b/src/extensions/default/JavaScriptCodeHints/tern-worker.js index 52d6d876f54..74c867cb7c6 100644 --- a/src/extensions/default/JavaScriptCodeHints/tern-worker.js +++ b/src/extensions/default/JavaScriptCodeHints/tern-worker.js @@ -41,7 +41,8 @@ var config = {}; Infer = infer; var ternServer = null, - inferenceTimeout; + inferenceTimeout, + isUntitledDoc = false; // Save the tern callbacks for when we get the contents of the file var fileCallBacks = {}; @@ -107,14 +108,14 @@ var config = {}; } function _getNormalizedFilename(fileName) { - if (ternServer.projectDir && fileName.indexOf(ternServer.projectDir) === -1) { + if (!isUntitledDoc && ternServer.projectDir && fileName.indexOf(ternServer.projectDir) === -1) { fileName = ternServer.projectDir + fileName; } return fileName; } function _getDenormalizedFilename(fileName) { - if (ternServer.projectDir && fileName.indexOf(ternServer.projectDir) === 0) { + if (!isUntitledDoc && ternServer.projectDir && fileName.indexOf(ternServer.projectDir) === 0) { fileName = fileName.slice(ternServer.projectDir.length); } return fileName; @@ -659,6 +660,7 @@ var config = {}; } else if (type === MessageIds.TERN_ADD_FILES_MSG) { handleAddFiles(request.files); } else if (type === MessageIds.TERN_PRIME_PUMP_MSG) { + isUntitledDoc = request.isUntitledDoc; handlePrimePump(request.path); } else if (type === MessageIds.TERN_GET_GUESSES_MSG) { offset = request.offset; From 25292102649f42bcfb881e88670eb8dabf68a341 Mon Sep 17 00:00:00 2001 From: walfgithub Date: Thu, 23 Mar 2017 12:31:54 -0700 Subject: [PATCH 110/121] ALF Automation (#13204) * Updated by ALF automation. * Updated by ALF automation. * Updated by ALF automation. * Updated by ALF automation. * Updated by ALF automation. --- src/nls/fr/strings.js | 22 +++++++++++----------- src/nls/ja/strings.js | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/nls/fr/strings.js b/src/nls/fr/strings.js index db014948cdd..9bc6f328969 100644 --- a/src/nls/fr/strings.js +++ b/src/nls/fr/strings.js @@ -217,13 +217,13 @@ define({ "FILTER_FILE_COUNT_ALL": "Autorise les {0} fichiers {1}", // Quick Edit - "ERROR_QUICK_EDIT_PROVIDER_NOT_FOUND": "Fonction Edition rapide non disponible pour la position actuelle du curseur", - "ERROR_CSSQUICKEDIT_BETWEENCLASSES": "Edition rapide CSS : placez le curseur sur un seul nom de classe", - "ERROR_CSSQUICKEDIT_CLASSNOTFOUND": "Edition rapide CSS : attribut de classe incomplet", - "ERROR_CSSQUICKEDIT_IDNOTFOUND": "Edition rapide CSS : attribut d’ID incomplet", - "ERROR_CSSQUICKEDIT_UNSUPPORTEDATTR": "Edition rapide CSS : placez le curseur dans la balise, la classe ou l’ID", - "ERROR_TIMINGQUICKEDIT_INVALIDSYNTAX": "Edition rapide des fonctions de temporisation CSS : syntaxe incorrecte", - "ERROR_JSQUICKEDIT_FUNCTIONNOTFOUND": "Edition rapide JS : placez le curseur dans le nom de fonction", + "ERROR_QUICK_EDIT_PROVIDER_NOT_FOUND": "Fonction Édition rapide non disponible pour la position actuelle du curseur", + "ERROR_CSSQUICKEDIT_BETWEENCLASSES": "Édition rapide CSS : placez le curseur sur un seul nom de classe", + "ERROR_CSSQUICKEDIT_CLASSNOTFOUND": "Édition rapide CSS : attribut de classe incomplet", + "ERROR_CSSQUICKEDIT_IDNOTFOUND": "Édition rapide CSS : attribut d’ID incomplet", + "ERROR_CSSQUICKEDIT_UNSUPPORTEDATTR": "Édition rapide CSS : placez le curseur dans la balise, la classe ou l’ID", + "ERROR_TIMINGQUICKEDIT_INVALIDSYNTAX": "Édition rapide des fonctions de temporisation CSS : syntaxe incorrecte", + "ERROR_JSQUICKEDIT_FUNCTIONNOTFOUND": "Édition rapide JS : placez le curseur dans le nom de fonction", // Quick Docs "ERROR_QUICK_DOCS_PROVIDER_NOT_FOUND": "Fonction Documentation rapide non disponible pour la position actuelle du curseur", @@ -407,7 +407,7 @@ define({ "CMD_GOTO_LINE": "Atteindre la ligne", "CMD_GOTO_DEFINITION": "Accès rapide à la définition", "CMD_GOTO_FIRST_PROBLEM": "Accéder au premier problème", - "CMD_TOGGLE_QUICK_EDIT": "Edition rapide", + "CMD_TOGGLE_QUICK_EDIT": "Édition rapide", "CMD_TOGGLE_QUICK_DOCS": "Documentation rapide", "CMD_QUICK_EDIT_PREV_MATCH": "Correspondance précédente", "CMD_QUICK_EDIT_NEXT_MATCH": "Correspondance suivante", @@ -434,7 +434,7 @@ define({ "CMD_HEALTH_DATA_STATISTICS": "Rapport d’intégrité", "CMD_HOMEPAGE": "Page d’accueil de {APP_TITLE}", "CMD_TWITTER": "{TWITTER_NAME} sur Twitter", - "CMD_ABOUT": "A propos de {APP_TITLE}", + "CMD_ABOUT": "À propos de {APP_TITLE}", "CMD_OPEN_PREFERENCES": "Ouvrir le fichier de préférences", "CMD_OPEN_KEYMAP": "Ouvrir le mappage de touches utilisateur", @@ -446,7 +446,7 @@ define({ "KEEP_CHANGES_IN_EDITOR": "Conserver les modifications dans l’éditeur", "CLOSE_DONT_SAVE": "Fermer (sans enregistrer)", "RELAUNCH_CHROME": "Relancer Chrome", - "ABOUT": "A propos", + "ABOUT": "À propos", "CLOSE": "Fermer", "ABOUT_TEXT_LINE1": "Version {VERSION_MAJOR}.{VERSION_MINOR} {BUILD_TYPE} {VERSION}", "ABOUT_TEXT_BUILD_TIMESTAMP": "Horodatage de la version : ", @@ -498,7 +498,7 @@ define({ "INSTALL_EXTENSION_HINT": "URL du fichier zip de l’extension ou du référentiel GitHub", "INSTALLING_FROM": "Installation de l’extension depuis·{0}\u2026", "INSTALL_SUCCEEDED": "Installation réussie !", - "INSTALL_FAILED": "Echec de l’installation.", + "INSTALL_FAILED": "Échec de l’installation.", "CANCELING_INSTALL": "Annulation en cours\u2026", "CANCELING_HUNG": "L’annulation de l’installation prend beaucoup de temps. Il est possible qu’une erreur interne se soit produite.", "INSTALL_CANCELED": "Installation annulée.", diff --git a/src/nls/ja/strings.js b/src/nls/ja/strings.js index 00551b504f4..5561b9c5dd8 100644 --- a/src/nls/ja/strings.js +++ b/src/nls/ja/strings.js @@ -796,5 +796,5 @@ define({ "DESCRIPTION_PURE_CODING_SURFACE": "{APP_NAME} でコードのみモードを有効にし、その他すべての UI エレメントを非表示にするには true", "DESCRIPTION_INDENT_LINE_COMMENT": "行コメントのインデントを有効にするには true", "DESCRIPTION_RECENT_FILES_NAV": "最近使用したファイルのナビゲーションを有効化/無効化", - "DESCRIPTION_LIVEDEV_WEBSOCKET_PORT": "WebSocket サーバーがライブプレビューで実行するポート" + "DESCRIPTION_LIVEDEV_WEBSOCKET_PORT": "ライブプレビューで WebSocket サーバーが実行されるポート" }); From 21dfae1f95b13622a76536ecd002528fcac76392 Mon Sep 17 00:00:00 2001 From: Parth Sharma Date: Mon, 27 Mar 2017 19:18:25 +0530 Subject: [PATCH 111/121] Replaced .border-radius with border-radius css in brackets_patterns_override.less This fixes #13227 --- src/styles/brackets_patterns_override.less | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/styles/brackets_patterns_override.less b/src/styles/brackets_patterns_override.less index 61d198d364d..54fd9b5966a 100644 --- a/src/styles/brackets_patterns_override.less +++ b/src/styles/brackets_patterns_override.less @@ -377,7 +377,7 @@ a:focus { width: max-content; background-color: @bc-menu-bg; - .border-radius(0 0 3px 3px); + border-radius: 0 0 3px 3px; box-shadow: 0 3px 9px @bc-shadow; border: none; @@ -475,7 +475,7 @@ a:focus { list-style-type: none; .dropdown-menu { - .border-radius(3px); + border-radius: 3px; box-shadow: 0 3px 9px @bc-shadow; .dark & { @@ -1414,7 +1414,7 @@ input[type="color"], font-weight: normal; -webkit-font-smoothing: antialiased; box-shadow: inset 0 1px 0 @bc-shadow-small; - .border-radius(@bc-border-radius); + border-radius: @bc-border-radius; .transition(~"border linear 180ms, box-shadow linear 180ms"); .dark & { @@ -1552,7 +1552,7 @@ input[type="color"], font-weight: @font-weight-semibold; line-height: normal; border: 1px solid @bc-btn-border; - .border-radius(@bc-border-radius); + border-radius: @bc-border-radius; box-shadow: inset 0 1px @bc-highlight-hard; -webkit-font-smoothing: antialiased; text-shadow: none; @@ -1709,7 +1709,7 @@ input[type="color"], // Button Sizes &.large { font-size: (@baseFontSize + 1px); - .border-radius(@bc-border-radius); + border-radius: @bc-border-radius; } &.small { font-size: (@baseFontSize - 1px); From b99b4ddb222c08bca7e6f4dc3fc520d867ab7662 Mon Sep 17 00:00:00 2001 From: Saurabh Kathpalia Date: Tue, 28 Mar 2017 15:00:27 +0530 Subject: [PATCH 112/121] Addressed review comments and also added tests --- src/search/FindBar.js | 22 ++++++++++---------- test/spec/FindInFiles-test.js | 38 +++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 11 deletions(-) diff --git a/src/search/FindBar.js b/src/search/FindBar.js index dbb79d04f9b..ad50a09f28c 100644 --- a/src/search/FindBar.js +++ b/src/search/FindBar.js @@ -267,7 +267,7 @@ define(function (require, exports, module) { FindBar._addFindBar(this); var $root = this._modalBar.getRoot(); - var currentIndex = 0; + var historyIndex = 0; $root .on("input", "#find-what", function () { self.trigger("queryChange"); @@ -321,7 +321,7 @@ define(function (require, exports, module) { searchHistory.splice(searchQueryIndex, 1); } else { if (searchHistory.length === maxCount) { - searchHistory.splice(maxCount - 1, 1); + searchHistory.pop(); } } searchHistory.unshift($('#find-what').val()); @@ -346,14 +346,14 @@ define(function (require, exports, module) { // if Shift is held down). self.trigger("doFind", e.shiftKey); } - currentIndex = 0; - } else if (e.keyCode === KeyEvent.DOM_VK_DOWN) { - currentIndex = (currentIndex - 1 + Math.min(maxCount, searchHistory.length)) % Math.min(maxCount, searchHistory.length); - $("#find-what").val(searchHistory[currentIndex]); - self.trigger("queryChange"); - } else if (e.keyCode === KeyEvent.DOM_VK_UP) { - currentIndex = (currentIndex + 1 + Math.min(maxCount, searchHistory.length)) % Math.min(maxCount, searchHistory.length); - $("#find-what").val(searchHistory[currentIndex]); + historyIndex = 0; + } else if (e.keyCode === KeyEvent.DOM_VK_DOWN || e.keyCode === KeyEvent.DOM_VK_UP) { + if (e.keyCode === KeyEvent.DOM_VK_DOWN) { + historyIndex = (historyIndex - 1 + searchHistory.length) % searchHistory.length; + } else { + historyIndex = (historyIndex + 1 + searchHistory.length) % searchHistory.length; + } + $("#find-what").val(searchHistory[historyIndex]); self.trigger("queryChange"); } }); @@ -639,7 +639,7 @@ define(function (require, exports, module) { PreferencesManager.stateManager.definePreference("caseSensitive", "boolean", false); PreferencesManager.stateManager.definePreference("regexp", "boolean", false); PreferencesManager.stateManager.definePreference("searchHistory", "array", []); - PreferencesManager.definePreference("maxSearchHistory", "number", 10, { + PreferencesManager.definePreference("maxSearchHistory", "number", 10, { description: Strings.FIND_HISTORY_MAX_COUNT }); diff --git a/test/spec/FindInFiles-test.js b/test/spec/FindInFiles-test.js index 47855104cf3..aa66bd40fb0 100644 --- a/test/spec/FindInFiles-test.js +++ b/test/spec/FindInFiles-test.js @@ -86,6 +86,7 @@ define(function (require, exports, module) { PreferencesManager = testWindow.brackets.test.PreferencesManager; PreferencesManager.set("findInFiles.nodeSearch", false); PreferencesManager.set("findInFiles.instantSearch", false); + PreferencesManager.set("maxSearchHistory", 5); }); }); @@ -409,6 +410,43 @@ define(function (require, exports, module) { expect(fileResults).toBeFalsy(); }); }); + + it("should verify the contents of searchHistory array", function () { + var fileEntry = FileSystem.getFileForPath(testPath + "/foo.js"); + openSearchBar(fileEntry); + executeSearch("foo1"); + executeSearch("foo2"); + executeSearch("foo3"); + executeSearch("foo4"); + executeSearch("foo5"); + + runs(function () { + var searchHistory = PreferencesManager.getViewState("searchHistory"); + expect(searchHistory.length).toBe(5); + expect(searchHistory).toEqual(["foo5", "foo4", "foo3", "foo2", "foo1"]); + }); + }); + + it("should traverse through search history using up and down arrow keys", function () { + var fileEntry = FileSystem.getFileForPath(testPath + "/foo.js"); + openSearchBar(fileEntry); + executeSearch("foo1"); + executeSearch("foo2"); + executeSearch("foo3"); + executeSearch("foo4"); + executeSearch("foo5"); + + runs(function () { + var searchHistory = PreferencesManager.getViewState("searchHistory"); + var $searchField = $("#find-what"); + SpecRunnerUtils.simulateKeyEvent(KeyEvent.DOM_VK_UP, "keydown", $searchField[0]); + expect($("#find-what").val()).toBe("foo4"); + SpecRunnerUtils.simulateKeyEvent(KeyEvent.DOM_VK_DOWN, "keydown", $searchField[0]); + expect($("#find-what").val()).toBe("foo5"); + SpecRunnerUtils.simulateKeyEvent(KeyEvent.DOM_VK_DOWN, "keydown", $searchField[0]); + expect($("#find-what").val()).toBe("foo1"); + }); + }); it("should find start and end positions", function () { var filePath = testPath + "/foo.js", From b81edcd52376b607d90b569a4edb88dab0569a55 Mon Sep 17 00:00:00 2001 From: Justin Russo Date: Tue, 28 Mar 2017 12:13:31 -0400 Subject: [PATCH 113/121] Add jsx language ID to supported languages for JavaScript code hints --- src/extensions/default/JavaScriptCodeHints/HintUtils.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/extensions/default/JavaScriptCodeHints/HintUtils.js b/src/extensions/default/JavaScriptCodeHints/HintUtils.js index 92c1b6f2d7a..b69bb65aeba 100644 --- a/src/extensions/default/JavaScriptCodeHints/HintUtils.js +++ b/src/extensions/default/JavaScriptCodeHints/HintUtils.js @@ -29,9 +29,10 @@ define(function (require, exports, module) { var Acorn = require("node_modules/acorn/dist/acorn"); var LANGUAGE_ID = "javascript", + JSX_LANGUAGE_ID = "jsx", HTML_LANGUAGE_ID = "html", PHP_LANGUAGE_ID = "php", - SUPPORTED_LANGUAGES = [LANGUAGE_ID, HTML_LANGUAGE_ID, PHP_LANGUAGE_ID], + SUPPORTED_LANGUAGES = [LANGUAGE_ID, JSX_LANGUAGE_ID, HTML_LANGUAGE_ID, PHP_LANGUAGE_ID], SINGLE_QUOTE = "'", DOUBLE_QUOTE = "\""; From 7af7bc8bf1cb90edfc0f635636da50dfd7598dce Mon Sep 17 00:00:00 2001 From: Justin Russo Date: Tue, 28 Mar 2017 12:36:17 -0400 Subject: [PATCH 114/121] Style code (cleanup) --- src/extensions/default/JavaScriptCodeHints/HintUtils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/extensions/default/JavaScriptCodeHints/HintUtils.js b/src/extensions/default/JavaScriptCodeHints/HintUtils.js index b69bb65aeba..9a0d4066df3 100644 --- a/src/extensions/default/JavaScriptCodeHints/HintUtils.js +++ b/src/extensions/default/JavaScriptCodeHints/HintUtils.js @@ -29,7 +29,7 @@ define(function (require, exports, module) { var Acorn = require("node_modules/acorn/dist/acorn"); var LANGUAGE_ID = "javascript", - JSX_LANGUAGE_ID = "jsx", + JSX_LANGUAGE_ID = "jsx", HTML_LANGUAGE_ID = "html", PHP_LANGUAGE_ID = "php", SUPPORTED_LANGUAGES = [LANGUAGE_ID, JSX_LANGUAGE_ID, HTML_LANGUAGE_ID, PHP_LANGUAGE_ID], From 665128dd22665a2e2e16ae0fe7c74c5a4dcb2eb3 Mon Sep 17 00:00:00 2001 From: Justin Russo Date: Wed, 29 Mar 2017 07:32:57 -0400 Subject: [PATCH 115/121] Add media queries to display search and filter below tabs --- src/styles/brackets_patterns_override.less | 76 ++++++++++++---------- src/styles/brackets_variables.less | 25 +++---- 2 files changed, 56 insertions(+), 45 deletions(-) diff --git a/src/styles/brackets_patterns_override.less b/src/styles/brackets_patterns_override.less index 54fd9b5966a..78e748237db 100644 --- a/src/styles/brackets_patterns_override.less +++ b/src/styles/brackets_patterns_override.less @@ -45,7 +45,7 @@ a { a:hover { color: @bc-text-link; text-decoration: underline; - + .dark & { color: @dark-bc-text-link; } @@ -89,7 +89,7 @@ a:focus { background-color: transparent; text-shadow: 0 1px 2px @bc-shadow-large; - + .dark & { text-shadow: 0 1px 2px @dark-bc-shadow-large; } @@ -368,7 +368,7 @@ a:focus { // Offset for better alignment with button top: 34px; margin-top: 0; - + // Fix for #4593: don't let narrow parent (menubar item) cause text wrap at the float boundary between // the menu item label and keyboard shortcut. This takes away the "gotta get narrower" pressure. // This technique won't work on all browsers; see comments in #4593 for alternative options. @@ -596,7 +596,7 @@ a:focus { &.dropdown-menu:focus { outline: none; } - + &.dropdown-menu { border: none; border-radius: @bc-border-radius; @@ -614,11 +614,11 @@ a:focus { box-shadow: 0 3px 9px @dark-bc-shadow; } } - + &.dropdown-menu li a { padding: 1px 15px 1px 15px; color: @bc-menu-text; - + .dark & { color: @dark-bc-menu-text; } @@ -631,11 +631,11 @@ a:focus { } } } - + &.dropdown-menu .stylesheet-link { display: block; } - + &.dropdown-menu a.selected { background: @bc-bg-highlight; color: @bc-menu-text !important; @@ -659,7 +659,7 @@ a:focus { display: inline-block; } } - + &.dropdown-menu a:hover { /* toggle checkmark visibility */ &.checked::before { @@ -683,12 +683,12 @@ a:focus { transform-origin: 0 100%; height: auto; max-height: 80%; - + // Improve how bottom of the dropdown joins with top of status bar button margin-top: -6px; border-bottom-left-radius: 0; border-bottom-right-radius: 0; - + li a .default-language { font-style: italic; color: @bc-text-quiet; @@ -716,7 +716,7 @@ a:focus { .stylesheet-link, .stylesheet-name { white-space: nowrap; } - + .stylesheet-name { color: @bc-text; @@ -724,7 +724,7 @@ a:focus { color: @dark-bc-text; } } - + .stylesheet-dir { color: @bc-text-quiet; @@ -981,15 +981,15 @@ a[href^="http"] { // Enable text selection cursor: auto; .user-select(text); - + h3 { font-weight: normal; margin: 0 0 10px; } - + ul { margin-bottom: 0 0 20px; - + > li { margin-bottom: 10px; } @@ -1027,7 +1027,7 @@ a[href^="http"] { .extension-manager-dialog { background-color: @bc-panel-bg-promoted; width: 760px; - + .dark & { background-color: @dark-bc-panel-bg-promoted; } @@ -1035,7 +1035,7 @@ a[href^="http"] { .modal-header { border-bottom: none; padding: 0; - + .nav-tabs { margin: 0; border-color: @bc-panel-separator; @@ -1107,7 +1107,7 @@ a[href^="http"] { border-color: @dark-bc-btn-border @dark-bc-btn-border transparent @dark-bc-btn-border; } } - + > .active > a:focus { background-color: @bc-panel-bg; border-color: @bc-btn-border-focused @bc-btn-border-focused transparent @bc-btn-border-focused; @@ -1141,10 +1141,18 @@ a[href^="http"] { /* Search box */ > :nth-child(2) { - position: absolute; - top: 15px; - right: 15px; + @media (max-width: @extension-manager-min-width) { + overflow: hidden; + padding: 0 15px; + } + + @media (min-width: @extension-manager-min-width) { + position: absolute; + top: 15px; + right: 15px; + } } + .search { background: @bc-input-bg url("images/topcoat-search-20.svg") 2px 2px no-repeat; float: right; @@ -1217,7 +1225,7 @@ a[href^="http"] { overflow-y: scroll; background-color: @bc-panel-bg; padding: 0; - + .dark & { background-color: @dark-bc-panel-bg; } @@ -1482,7 +1490,7 @@ input[type="color"], &.top .tooltip-arrow { border-top-color: @bc-menu-bg; left: 50%; - + .dark & { border-top-color: @dark-bc-menu-bg; } @@ -1490,7 +1498,7 @@ input[type="color"], &.right .tooltip-arrow { border-right-color: @bc-menu-bg; top: 15px; - + .dark & { border-right-color: @dark-bc-menu-bg; } @@ -1498,7 +1506,7 @@ input[type="color"], &.left .tooltip-arrow { border-left-color: @bc-menu-bg; top: 15px; - + .dark & { border-left-color: @dark-bc-menu-bg; } @@ -1506,7 +1514,7 @@ input[type="color"], &.bottom .tooltip-arrow { border-bottom-color: @bc-menu-bg; left: 50%; - + .dark & { border-bottom-color: @dark-bc-menu-bg; } @@ -1610,7 +1618,7 @@ input[type="color"], color: @dark-bc-text-alt; } } - + &:active:not([disabled]) { background-image: none; background-color: @bc-btn-bg-down; @@ -1673,7 +1681,7 @@ input[type="color"], } } } - + // Update Button Type &.update { background-color: @bc-secondary-btn-bg; @@ -1682,7 +1690,7 @@ input[type="color"], color: @bc-text-alt; font-weight: @font-weight-semibold; text-shadow: 0 -1px 0 @bc-shadow-small; - + .dark & { background-color: @dark-bc-secondary-btn-bg; border-color: @dark-bc-secondary-btn-border; @@ -1923,13 +1931,13 @@ select { &:active { background-color: @bc-btn-bg-down; box-shadow: inset 0 1px 0 @bc-shadow-small; - + .dark & { background-color: @dark-bc-btn-bg-down; box-shadow: inset 0 1px 0 @dark-bc-shadow-small; } } - + > option { // Windows (but not Mac) lets you style the dropdown items background-color: @bc-menu-bg; color: @bc-menu-text; @@ -1992,7 +2000,7 @@ code { .dropdown-menu { background-color: @bc-menu-bg; color: @bc-menu-text; - + .dark & { background-color: @dark-bc-menu-bg; color: @dark-bc-menu-text; @@ -2011,7 +2019,7 @@ code { .form-horizontal { .controls { margin-left: 170px; - + input[type='checkbox'] { margin-top: 8px; } diff --git a/src/styles/brackets_variables.less b/src/styles/brackets_variables.less index 2d4f95b1e3e..aa935e7a116 100644 --- a/src/styles/brackets_variables.less +++ b/src/styles/brackets_variables.less @@ -1,21 +1,21 @@ // Copyright (c) 2012 - present Adobe Systems Incorporated. All rights reserved. -// +// // 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 +// 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, +// 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 +// 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. @@ -36,6 +36,9 @@ @sidebar-width: 200px; // user resizable, however @main-toolbar-width: 30px; +/* Extension Manager */ +@extension-manager-min-width: 680px; // Used for responsive styling + /* z-index */ @z-index-cm-dialog-override: 11; @z-index-cm-dialog: 15; From 6a4ec9c6445119de365ac218c8897b39d9758eb0 Mon Sep 17 00:00:00 2001 From: Justin Russo Date: Wed, 29 Mar 2017 07:38:15 -0400 Subject: [PATCH 116/121] Change padding to be consistent with other elements' padding --- src/styles/brackets_patterns_override.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/styles/brackets_patterns_override.less b/src/styles/brackets_patterns_override.less index 78e748237db..ac3b3e9f385 100644 --- a/src/styles/brackets_patterns_override.less +++ b/src/styles/brackets_patterns_override.less @@ -1143,7 +1143,7 @@ a[href^="http"] { > :nth-child(2) { @media (max-width: @extension-manager-min-width) { overflow: hidden; - padding: 0 15px; + padding: 0 1em; } @media (min-width: @extension-manager-min-width) { From 7ba7cccaea62bf2b9eff37da71116240e6fd3e08 Mon Sep 17 00:00:00 2001 From: Justin Russo Date: Wed, 29 Mar 2017 07:47:20 -0400 Subject: [PATCH 117/121] Reset margin of filter dropdown and add top and bottom padding to div container --- src/styles/brackets_patterns_override.less | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/styles/brackets_patterns_override.less b/src/styles/brackets_patterns_override.less index ac3b3e9f385..c95a4a5b8f8 100644 --- a/src/styles/brackets_patterns_override.less +++ b/src/styles/brackets_patterns_override.less @@ -1143,7 +1143,7 @@ a[href^="http"] { > :nth-child(2) { @media (max-width: @extension-manager-min-width) { overflow: hidden; - padding: 0 1em; + padding: 8px 1em; } @media (min-width: @extension-manager-min-width) { @@ -1194,6 +1194,7 @@ a[href^="http"] { .sort-extensions { float: left; margin-right: 10px; + margin-bottom: 0; width: auto; padding-right: 18px; border-bottom-left-radius: 0px; From b3957d0c63893cd4aae90f7c05fd39975bde7a9a Mon Sep 17 00:00:00 2001 From: Justin Russo Date: Wed, 29 Mar 2017 07:52:13 -0400 Subject: [PATCH 118/121] Prevent media queries from overlapping --- src/styles/brackets_patterns_override.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/styles/brackets_patterns_override.less b/src/styles/brackets_patterns_override.less index c95a4a5b8f8..41fffe8e846 100644 --- a/src/styles/brackets_patterns_override.less +++ b/src/styles/brackets_patterns_override.less @@ -1141,7 +1141,7 @@ a[href^="http"] { /* Search box */ > :nth-child(2) { - @media (max-width: @extension-manager-min-width) { + @media (max-width: (@extension-manager-min-width - 1px)) { overflow: hidden; padding: 8px 1em; } From f7632b77af1c1210f70227e6afb94346d0a6dc35 Mon Sep 17 00:00:00 2001 From: Justin Russo Date: Wed, 29 Mar 2017 09:35:21 -0400 Subject: [PATCH 119/121] Wrap search elements in a container & add responsiveness using flex --- src/htmlContent/extension-manager-dialog.html | 6 ++++-- src/styles/brackets_patterns_override.less | 9 ++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/htmlContent/extension-manager-dialog.html b/src/htmlContent/extension-manager-dialog.html index 733ef69c0c6..f222edae186 100644 --- a/src/htmlContent/extension-manager-dialog.html +++ b/src/htmlContent/extension-manager-dialog.html @@ -16,8 +16,10 @@ - - +
    + + +
    + {{handlebars}} +