diff --git a/plugins/music_service/squeezelite/UIConfig.json b/plugins/music_service/squeezelite/UIConfig.json index 1ec82e9d2..ca614b741 100644 --- a/plugins/music_service/squeezelite/UIConfig.json +++ b/plugins/music_service/squeezelite/UIConfig.json @@ -4,15 +4,15 @@ }, "sections": [ { - "id": "section_serverconf", + "id": "section_serviceconf", "element": "section", - "label": "TRANSLATE.SQUEEZELITE.SERVER", - "description": "TRANSLATE.SQUEEZELITE.D_SERVER", - "icon": "fa-server", + "label": "TRANSLATE.SQUEEZELITE.SERVICE", + "description": "TRANSLATE.SQUEEZELITE.D_SERVICE", + "icon": "fa-cogs", "onSave": { "type": "controller", "endpoint": "music_service/squeezelite", - "method": "updateSqueezeliteServerConfig" + "method": "updateSqueezeliteServiceConfig" }, "saveButton": { "label": "TRANSLATE.SQUEEZELITE.SAVE", @@ -54,6 +54,7 @@ "label": "TRANSLATE.SQUEEZELITE.SAVE", "data": [ "output_device", + "soundcard_timeout", "alsa_params", "extra_params" ] @@ -70,6 +71,17 @@ }, "options": [] }, + { + "id": "soundcard_timeout", + "element": "select", + "label": "TRANSLATE.SQUEEZELITE.SOUNDCARD_TIMEOUT", + "doc": "TRANSLATE.SQUEEZELITE.D_SOUNDCARD_TIMEOUT", + "value": { + "value": "2", + "label": "2" + }, + "options": [] + }, { "id": "alsa_params", "type":"text", diff --git a/plugins/music_service/squeezelite/config.json b/plugins/music_service/squeezelite/config.json index af56d1d5c..a15216b52 100644 --- a/plugins/music_service/squeezelite/config.json +++ b/plugins/music_service/squeezelite/config.json @@ -11,6 +11,10 @@ "type": "string", "value": "default" }, + "soundcard_timeout": { + "type": "string", + "value": "2" + }, "alsa_params": { "type": "string", "value": "80:4::" diff --git a/plugins/music_service/squeezelite/i18n/strings_en.json b/plugins/music_service/squeezelite/i18n/strings_en.json index 96deb3d8c..c4942cfe4 100644 --- a/plugins/music_service/squeezelite/i18n/strings_en.json +++ b/plugins/music_service/squeezelite/i18n/strings_en.json @@ -1,16 +1,18 @@ { "SQUEEZELITE":{ "SQUEEZELITECONF":"Squeezelite Configuration", - "SERVER":"Configure server", - "D_CONFIG":"The below settings are for server relation configuration.", + "SERVICE":"Configure service", + "D_SERVICE":"The below settings are for service configuration.", "PLAYER_ENABLED":"Enable auto-start of service", - "D_PLAYER_ENABLED":"If set to ON the Squeezelite-server will start on boot, else you must manually start the service to use it.", + "D_PLAYER_ENABLED":"If set to ON the Squeezelite-service will start on boot, else you must manually start the service to use it.", "INSTANCE_NAME":"Instance name", "D_INSTANCE_NAME":"Controls how the player will appear in the LMS webconsole.", "AUDIO":"Configure audio output settings", "D_AUDIO":"Sound output can be controlled with the below settings.", "OUTPUT_DEVICE":"Output device", "D_OUTPUT_DEVICE":"Choose the output device you want to use for this Squeezelite instance.", + "SOUNDCARD_TIMEOUT":"Close soundcard after x seconds", + "D_SOUNDCARD_TIMEOUT":"Close output device when idle after timeout seconds, default is to keep it open while player is 'on'", "ALSAPARAMS":"ALSA Parameters", "D_ALSAPARAMS":"Fill in the ALSA parameters, don't change them if you have no idea what you are doing (default = 80:4::).

Formatting is as follows: b:p:f:m ", "EXTRAPARAMS":"Extra Parameters", diff --git a/plugins/music_service/squeezelite/index.js b/plugins/music_service/squeezelite/index.js index 3247b93bb..9431fddc7 100644 --- a/plugins/music_service/squeezelite/index.js +++ b/plugins/music_service/squeezelite/index.js @@ -134,6 +134,7 @@ ControllerSqueezelite.prototype.getUIConfig = function() { } } //self.logger.info('Cards: ' + JSON.stringify(cards)); + var seconds = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10"]; self.commandRouter.i18nJson(__dirname+'/i18n/strings_' + lang_code + '.json', __dirname + '/i18n/strings_en.json', @@ -163,8 +164,22 @@ ControllerSqueezelite.prototype.getUIConfig = function() { uiconf.sections[1].content[0].value.label = oLabel; } } - uiconf.sections[1].content[1].value = self.config.get('alsa_params'); - uiconf.sections[1].content[2].value = self.config.get('extra_params'); + + for (var s in seconds) + { + self.configManager.pushUIConfigParam(uiconf, 'sections[1].content[1].options', { + value: s, + label: s + }); + + if(self.config.get('soundcard_timeout') == s) + { + uiconf.sections[1].content[1].value.value = self.config.get('soundcard_timeout'); + uiconf.sections[1].content[1].value.label = self.config.get('soundcard_timeout'); + } + } + uiconf.sections[1].content[2].value = self.config.get('alsa_params'); + uiconf.sections[1].content[3].value = self.config.get('extra_params'); self.logger.info("2/2 Squeezelite settings sections loaded"); self.logger.info("Populated config screen."); @@ -203,7 +218,7 @@ ControllerSqueezelite.prototype.setConf = function(conf) { // Public Methods --------------------------------------------------------------------------------------- -ControllerSqueezelite.prototype.updateSqueezeliteServerConfig = function (data) +ControllerSqueezelite.prototype.updateSqueezeliteServiceConfig = function (data) { var self = this; var defer = libQ.defer(); @@ -211,7 +226,7 @@ ControllerSqueezelite.prototype.updateSqueezeliteServerConfig = function (data) self.config.set('enabled', data['enabled']); self.config.set('name', data['name']); - self.logger.info("Successfully updated Squeezelite server configuration"); + self.logger.info("Successfully updated Squeezelite service configuration"); self.constructUnit(__dirname + "/unit/squeezelite.unit-template", __dirname + "/unit/squeezelite.service") .then(function(stopIfNeeded){ @@ -239,12 +254,13 @@ ControllerSqueezelite.prototype.updateSqueezeliteAudioConfig = function (data) var defer = libQ.defer(); self.config.set('output_device', data['output_device'].value); + self.config.set('soundcard_timeout', data['soundcard_timeout'].value); self.config.set('alsa_params', data['alsa_params']); self.config.set('extra_params', data['extra_params']); self.logger.info("Successfully updated Squeezelite audio configuration"); - self.constructUnit(__dirname + "/unit/squeezelite.unit-template", __dirname + "/unit/squeezelite.service") + self.constructUnit(__dirname + "/unit/squeezelite.unit-template", __dirname + "/squeezelite.service") .then(function(stopIfNeeded){ if(self.config.get('enabled') != true) { @@ -264,26 +280,48 @@ ControllerSqueezelite.prototype.updateSqueezeliteAudioConfig = function (data) return defer.promise; }; -ControllerSqueezelite.prototype.moveAndReloadService = function (unitTemplate, unitFile, serviceName) +ControllerSqueezelite.prototype.restartService = function (serviceName, boot) { var self = this; var defer = libQ.defer(); - var command = "/bin/echo volumio | /usr/bin/sudo -S /bin/cp " + unitTemplate + " " + unitFile; - - exec(command, {uid:1000,gid:1000}, function (error, stdout, stderr) { - if (error !== null) { - self.commandRouter.pushConsoleMessage('The following error occurred while moving ' + serviceName + ': ' + error); - self.commandRouter.pushToastMessage('error', "Moving service failed", "Stopping " + serviceName + " failed with error: " + error); - defer.reject(); - } - else { - self.commandRouter.pushConsoleMessage(serviceName + ' moved'); - self.commandRouter.pushToastMessage('success', "Moved", "Moved " + serviceName + "."); - } - }); + if(self.config.get('enabled')) + { + var command = "/usr/bin/sudo /bin/systemctl restart " + serviceName; - command = "/bin/echo volumio | /usr/bin/sudo -S systemctl daemon-reload"; + self.reloadService(serviceName) + .then(function(restart){ + exec(command, {uid:1000,gid:1000}, function (error, stdout, stderr) { + if (error !== null) { + self.commandRouter.pushConsoleMessage('The following error occurred while starting ' + serviceName + ': ' + error); + self.commandRouter.pushToastMessage('error', "Restart failed", "Restarting " + serviceName + " failed with error: " + error); + defer.reject(); + } + else { + self.commandRouter.pushConsoleMessage(serviceName + ' started'); + if(boot == false) + self.commandRouter.pushToastMessage('success', "Restarted " + serviceName, "Restarted " + serviceName + " for the changes to take effect."); + + defer.resolve(); + } + }); + }); + } + else + { + self.logger.info("Not starting " + serviceName + "; it's not enabled."); + defer.resolve(); + } + + return defer.promise; +}; + +ControllerSqueezelite.prototype.reloadService = function (serviceName) +{ + var self = this; + var defer = libQ.defer(); + + var command = "/usr/bin/sudo /bin/systemctl daemon-reload"; exec(command, {uid:1000,gid:1000}, function (error, stdout, stderr) { if (error !== null) { self.commandRouter.pushConsoleMessage('The following error occurred while reloading ' + serviceName + ': ' + error); @@ -296,41 +334,7 @@ ControllerSqueezelite.prototype.moveAndReloadService = function (unitTemplate, u defer.resolve(); } }); - - - return defer.promise; -}; - -ControllerSqueezelite.prototype.restartService = function (serviceName, boot) -{ - var self = this; - var defer = libQ.defer(); - - if(self.config.get('enabled')) - { - var command = "/bin/echo volumio | /usr/bin/sudo -S /bin/systemctl restart " + serviceName; - exec(command, {uid:1000,gid:1000}, function (error, stdout, stderr) { - if (error !== null) { - self.commandRouter.pushConsoleMessage('The following error occurred while starting ' + serviceName + ': ' + error); - self.commandRouter.pushToastMessage('error', "Restart failed", "Restarting " + serviceName + " failed with error: " + error); - defer.reject(); - } - else { - self.commandRouter.pushConsoleMessage(serviceName + ' started'); - if(boot == false) - self.commandRouter.pushToastMessage('success', "Restarted " + serviceName, "Restarted " + serviceName + " for the changes to take effect."); - - defer.resolve(); - } - }); - } - else - { - self.logger.info("Not starting " + serviceName + "; it's not enabled."); - defer.resolve(); - } - return defer.promise; }; @@ -339,7 +343,7 @@ ControllerSqueezelite.prototype.stopService = function (serviceName) var self = this; var defer = libQ.defer(); - var command = "/bin/echo volumio | /usr/bin/sudo -S /bin/systemctl stop " + serviceName; + var command = "/usr/bin/sudo /bin/systemctl stop " + serviceName; exec(command, {uid:1000,gid:1000}, function (error, stdout, stderr) { if (error !== null) { @@ -365,6 +369,7 @@ ControllerSqueezelite.prototype.constructUnit = function(unitTemplate, unitFile) var replacementDictionary = [ { placeholder: "${NAME}", replacement: self.config.get('name') }, { placeholder: "${OUTPUT_DEVICE}", replacement: self.config.get('output_device') }, + { placeholder: "${SOUNDCARD_TIMEOUT}", replacement: self.config.get('soundcard_timeout') }, { placeholder: "${ALSA_PARAMS}", replacement: self.config.get('alsa_params') }, { placeholder: "${EXTRA_PARAMS}", replacement: self.config.get('extra_params') } ]; @@ -384,18 +389,14 @@ ControllerSqueezelite.prototype.constructUnit = function(unitTemplate, unitFile) else replacementDictionary[rep].replacement = "-o default"; } + else if (replacementDictionary[rep].placeholder == "${SOUNDCARD_TIMEOUT}") + replacementDictionary[rep].replacement = "-C " + replacementDictionary[rep].replacement; else if (replacementDictionary[rep].placeholder == "${ALSA_PARAMS}" && self.config.get('alsa_params') != '') replacementDictionary[rep].replacement = "-a " + replacementDictionary[rep].replacement; } } - //self.logger.info('### Replacement dictionary: ' + JSON.stringify(replacementDictionary)); - self.replaceStringsInFile(unitTemplate, unitFile, replacementDictionary) - .then(function(activate) - { - self.moveAndReloadService(unitFile, '/etc/systemd/system/squeezelite.service', 'Squeezelite'); - }) .then(function(resolve){ self.restartService('squeezelite', false); defer.resolve(); diff --git a/plugins/music_service/squeezelite/install.sh b/plugins/music_service/squeezelite/install.sh index bcc150448..8da6b40a7 100644 --- a/plugins/music_service/squeezelite/install.sh +++ b/plugins/music_service/squeezelite/install.sh @@ -6,27 +6,29 @@ if [ ! -f $INSTALLING ]; then touch $INSTALLING - if [ ! -d /data/plugins/music_services/squeezelite ]; + if [ ! -d /opt/squeezelite ]; then # Download latest squeezelite executable echo "Downloading squeezelite..." - mkdir /home/volumio/logitechmediaserver - wget -O /opt/squeezelite https://github.com/Saiyato/volumio-squeezelite-plugin/raw/master/known_working_versions/squeezelite-armv6hf-noffmpeg + wget -O /opt/squeezelite https://github.com/Saiyato/volumio-squeezelite-plugin/raw/master/known_working_versions/squeezelite-armv6hf-volumio # Fix executable rights chown volumio:volumio /opt/squeezelite chmod 755 /opt/squeezelite # Download and activate default unit - TMPUNIT="/home/volumio/squeezelite.service" + TMPUNIT="/data/plugins/music_service/squeezelite/squeezelite.service" wget -O $TMPUNIT https://raw.githubusercontent.com/Saiyato/volumio-squeezelite-plugin/master/unit/squeezelite.unit-template + chown volumio $TMPUNIT sed 's|${NAME}|-n Volumio|g' -i $TMPUNIT sed 's|${OUTPUT_DEVICE}|-o default|g' -i $TMPUNIT + sed 's|${SOUNDCARD_TIMEOUT}|2|g' -i $TMPUNIT sed 's|${ALSA_PARAMS}|-a 80:4::|g' -i $TMPUNIT sed 's|${EXTRA_PARAMS}||g' -i $TMPUNIT - mv $TMPUNIT /etc/systemd/system/squeezelite.service + #mv $TMPUNIT /etc/systemd/system/squeezelite.service + ln -fs /data/plugins/music_service/squeezelite/squeezelite.service /etc/systemd/system/squeezelite.service systemctl daemon-reload else diff --git a/plugins/music_service/squeezelite/node_modules/.bin/rimraf b/plugins/music_service/squeezelite/node_modules/.bin/rimraf deleted file mode 120000 index 4cd49a49d..000000000 --- a/plugins/music_service/squeezelite/node_modules/.bin/rimraf +++ /dev/null @@ -1 +0,0 @@ -../rimraf/bin.js \ No newline at end of file diff --git a/plugins/music_service/squeezelite/node_modules/balanced-match/.npmignore b/plugins/music_service/squeezelite/node_modules/balanced-match/.npmignore deleted file mode 100644 index ae5d8c36a..000000000 --- a/plugins/music_service/squeezelite/node_modules/balanced-match/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -test -.gitignore -.travis.yml -Makefile -example.js diff --git a/plugins/music_service/squeezelite/node_modules/balanced-match/LICENSE.md b/plugins/music_service/squeezelite/node_modules/balanced-match/LICENSE.md deleted file mode 100644 index 2cdc8e414..000000000 --- a/plugins/music_service/squeezelite/node_modules/balanced-match/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -(MIT) - -Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/plugins/music_service/squeezelite/node_modules/balanced-match/README.md b/plugins/music_service/squeezelite/node_modules/balanced-match/README.md deleted file mode 100644 index 08e918c0d..000000000 --- a/plugins/music_service/squeezelite/node_modules/balanced-match/README.md +++ /dev/null @@ -1,91 +0,0 @@ -# balanced-match - -Match balanced string pairs, like `{` and `}` or `` and ``. Supports regular expressions as well! - -[![build status](https://secure.travis-ci.org/juliangruber/balanced-match.svg)](http://travis-ci.org/juliangruber/balanced-match) -[![downloads](https://img.shields.io/npm/dm/balanced-match.svg)](https://www.npmjs.org/package/balanced-match) - -[![testling badge](https://ci.testling.com/juliangruber/balanced-match.png)](https://ci.testling.com/juliangruber/balanced-match) - -## Example - -Get the first matching pair of braces: - -```js -var balanced = require('balanced-match'); - -console.log(balanced('{', '}', 'pre{in{nested}}post')); -console.log(balanced('{', '}', 'pre{first}between{second}post')); -console.log(balanced(/\s+\{\s+/, /\s+\}\s+/, 'pre { in{nest} } post')); -``` - -The matches are: - -```bash -$ node example.js -{ start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' } -{ start: 3, - end: 9, - pre: 'pre', - body: 'first', - post: 'between{second}post' } -{ start: 3, end: 17, pre: 'pre', body: 'in{nest}', post: 'post' } -``` - -## API - -### var m = balanced(a, b, str) - -For the first non-nested matching pair of `a` and `b` in `str`, return an -object with those keys: - -* **start** the index of the first match of `a` -* **end** the index of the matching `b` -* **pre** the preamble, `a` and `b` not included -* **body** the match, `a` and `b` not included -* **post** the postscript, `a` and `b` not included - -If there's no match, `undefined` will be returned. - -If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']` and `{a}}` will match `['', 'a', '}']`. - -### var r = balanced.range(a, b, str) - -For the first non-nested matching pair of `a` and `b` in `str`, return an -array with indexes: `[ , ]`. - -If there's no match, `undefined` will be returned. - -If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]` and `{a}}` will match `[0, 2]`. - -## Installation - -With [npm](https://npmjs.org) do: - -```bash -npm install balanced-match -``` - -## License - -(MIT) - -Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/plugins/music_service/squeezelite/node_modules/balanced-match/index.js b/plugins/music_service/squeezelite/node_modules/balanced-match/index.js deleted file mode 100644 index e8d858702..000000000 --- a/plugins/music_service/squeezelite/node_modules/balanced-match/index.js +++ /dev/null @@ -1,58 +0,0 @@ -module.exports = balanced; -function balanced(a, b, str) { - if (a instanceof RegExp) a = maybeMatch(a, str); - if (b instanceof RegExp) b = maybeMatch(b, str); - - var r = range(a, b, str); - - return r && { - start: r[0], - end: r[1], - pre: str.slice(0, r[0]), - body: str.slice(r[0] + a.length, r[1]), - post: str.slice(r[1] + b.length) - }; -} - -function maybeMatch(reg, str) { - var m = str.match(reg); - return m ? m[0] : null; -} - -balanced.range = range; -function range(a, b, str) { - var begs, beg, left, right, result; - var ai = str.indexOf(a); - var bi = str.indexOf(b, ai + 1); - var i = ai; - - if (ai >= 0 && bi > 0) { - begs = []; - left = str.length; - - while (i >= 0 && !result) { - if (i == ai) { - begs.push(i); - ai = str.indexOf(a, i + 1); - } else if (begs.length == 1) { - result = [ begs.pop(), bi ]; - } else { - beg = begs.pop(); - if (beg < left) { - left = beg; - right = bi; - } - - bi = str.indexOf(b, i + 1); - } - - i = ai < bi && ai >= 0 ? ai : bi; - } - - if (begs.length) { - result = [ left, right ]; - } - } - - return result; -} diff --git a/plugins/music_service/squeezelite/node_modules/balanced-match/package.json b/plugins/music_service/squeezelite/node_modules/balanced-match/package.json deleted file mode 100644 index 40ef32d8b..000000000 --- a/plugins/music_service/squeezelite/node_modules/balanced-match/package.json +++ /dev/null @@ -1,110 +0,0 @@ -{ - "_args": [ - [ - { - "raw": "balanced-match@^0.4.2", - "scope": null, - "escapedName": "balanced-match", - "name": "balanced-match", - "rawSpec": "^0.4.2", - "spec": ">=0.4.2 <0.5.0", - "type": "range" - }, - "/home/volumio/volumio-plugins/plugins/music_service/squeezelite" - ] - ], - "_from": "balanced-match@>=0.4.2 <0.5.0", - "_id": "balanced-match@0.4.2", - "_inCache": true, - "_location": "/balanced-match", - "_nodeVersion": "4.4.7", - "_npmOperationalInternal": { - "host": "packages-16-east.internal.npmjs.com", - "tmp": "tmp/balanced-match-0.4.2.tgz_1468834991581_0.6590619895141572" - }, - "_npmUser": { - "name": "juliangruber", - "email": "julian@juliangruber.com" - }, - "_npmVersion": "2.15.8", - "_phantomChildren": {}, - "_requested": { - "raw": "balanced-match@^0.4.2", - "scope": null, - "escapedName": "balanced-match", - "name": "balanced-match", - "rawSpec": "^0.4.2", - "spec": ">=0.4.2 <0.5.0", - "type": "range" - }, - "_requiredBy": [ - "/" - ], - "_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz", - "_shasum": "cb3f3e3c732dc0f01ee70b403f302e61d7709838", - "_shrinkwrap": null, - "_spec": "balanced-match@^0.4.2", - "_where": "/home/volumio/volumio-plugins/plugins/music_service/squeezelite", - "author": { - "name": "Julian Gruber", - "email": "mail@juliangruber.com", - "url": "http://juliangruber.com" - }, - "bugs": { - "url": "https://github.com/juliangruber/balanced-match/issues" - }, - "dependencies": {}, - "description": "Match balanced character pairs, like \"{\" and \"}\"", - "devDependencies": { - "tape": "^4.6.0" - }, - "directories": {}, - "dist": { - "shasum": "cb3f3e3c732dc0f01ee70b403f302e61d7709838", - "tarball": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz" - }, - "gitHead": "57c2ea29d89a2844ae3bdcc637c6e2cbb73725e2", - "homepage": "https://github.com/juliangruber/balanced-match", - "keywords": [ - "match", - "regexp", - "test", - "balanced", - "parse" - ], - "license": "MIT", - "main": "index.js", - "maintainers": [ - { - "name": "juliangruber", - "email": "julian@juliangruber.com" - } - ], - "name": "balanced-match", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git://github.com/juliangruber/balanced-match.git" - }, - "scripts": { - "test": "make test" - }, - "testling": { - "files": "test/*.js", - "browsers": [ - "ie/8..latest", - "firefox/20..latest", - "firefox/nightly", - "chrome/25..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2..latest" - ] - }, - "version": "0.4.2" -} diff --git a/plugins/music_service/squeezelite/node_modules/brace-expansion/LICENSE b/plugins/music_service/squeezelite/node_modules/brace-expansion/LICENSE deleted file mode 100644 index de3226673..000000000 --- a/plugins/music_service/squeezelite/node_modules/brace-expansion/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2013 Julian Gruber - -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/plugins/music_service/squeezelite/node_modules/brace-expansion/README.md b/plugins/music_service/squeezelite/node_modules/brace-expansion/README.md deleted file mode 100644 index 6b4e0e164..000000000 --- a/plugins/music_service/squeezelite/node_modules/brace-expansion/README.md +++ /dev/null @@ -1,129 +0,0 @@ -# brace-expansion - -[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), -as known from sh/bash, in JavaScript. - -[![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion) -[![downloads](https://img.shields.io/npm/dm/brace-expansion.svg)](https://www.npmjs.org/package/brace-expansion) -[![Greenkeeper badge](https://badges.greenkeeper.io/juliangruber/brace-expansion.svg)](https://greenkeeper.io/) - -[![testling badge](https://ci.testling.com/juliangruber/brace-expansion.png)](https://ci.testling.com/juliangruber/brace-expansion) - -## Example - -```js -var expand = require('brace-expansion'); - -expand('file-{a,b,c}.jpg') -// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] - -expand('-v{,,}') -// => ['-v', '-v', '-v'] - -expand('file{0..2}.jpg') -// => ['file0.jpg', 'file1.jpg', 'file2.jpg'] - -expand('file-{a..c}.jpg') -// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] - -expand('file{2..0}.jpg') -// => ['file2.jpg', 'file1.jpg', 'file0.jpg'] - -expand('file{0..4..2}.jpg') -// => ['file0.jpg', 'file2.jpg', 'file4.jpg'] - -expand('file-{a..e..2}.jpg') -// => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg'] - -expand('file{00..10..5}.jpg') -// => ['file00.jpg', 'file05.jpg', 'file10.jpg'] - -expand('{{A..C},{a..c}}') -// => ['A', 'B', 'C', 'a', 'b', 'c'] - -expand('ppp{,config,oe{,conf}}') -// => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf'] -``` - -## API - -```js -var expand = require('brace-expansion'); -``` - -### var expanded = expand(str) - -Return an array of all possible and valid expansions of `str`. If none are -found, `[str]` is returned. - -Valid expansions are: - -```js -/^(.*,)+(.+)?$/ -// {a,b,...} -``` - -A comma separated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`. - -```js -/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ -// {x..y[..incr]} -``` - -A numeric sequence from `x` to `y` inclusive, with optional increment. -If `x` or `y` start with a leading `0`, all the numbers will be padded -to have equal length. Negative numbers and backwards iteration work too. - -```js -/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ -// {x..y[..incr]} -``` - -An alphabetic sequence from `x` to `y` inclusive, with optional increment. -`x` and `y` must be exactly one character, and if given, `incr` must be a -number. - -For compatibility reasons, the string `${` is not eligible for brace expansion. - -## Installation - -With [npm](https://npmjs.org) do: - -```bash -npm install brace-expansion -``` - -## Contributors - -- [Julian Gruber](https://github.com/juliangruber) -- [Isaac Z. Schlueter](https://github.com/isaacs) - -## Sponsors - -This module is proudly supported by my [Sponsors](https://github.com/juliangruber/sponsors)! - -Do you want to support modules like this to improve their quality, stability and weigh in on new features? Then please consider donating to my [Patreon](https://www.patreon.com/juliangruber). Not sure how much of my modules you're using? Try [feross/thanks](https://github.com/feross/thanks)! - -## License - -(MIT) - -Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/plugins/music_service/squeezelite/node_modules/brace-expansion/index.js b/plugins/music_service/squeezelite/node_modules/brace-expansion/index.js deleted file mode 100644 index 0478be81e..000000000 --- a/plugins/music_service/squeezelite/node_modules/brace-expansion/index.js +++ /dev/null @@ -1,201 +0,0 @@ -var concatMap = require('concat-map'); -var balanced = require('balanced-match'); - -module.exports = expandTop; - -var escSlash = '\0SLASH'+Math.random()+'\0'; -var escOpen = '\0OPEN'+Math.random()+'\0'; -var escClose = '\0CLOSE'+Math.random()+'\0'; -var escComma = '\0COMMA'+Math.random()+'\0'; -var escPeriod = '\0PERIOD'+Math.random()+'\0'; - -function numeric(str) { - return parseInt(str, 10) == str - ? parseInt(str, 10) - : str.charCodeAt(0); -} - -function escapeBraces(str) { - return str.split('\\\\').join(escSlash) - .split('\\{').join(escOpen) - .split('\\}').join(escClose) - .split('\\,').join(escComma) - .split('\\.').join(escPeriod); -} - -function unescapeBraces(str) { - return str.split(escSlash).join('\\') - .split(escOpen).join('{') - .split(escClose).join('}') - .split(escComma).join(',') - .split(escPeriod).join('.'); -} - - -// Basically just str.split(","), but handling cases -// where we have nested braced sections, which should be -// treated as individual members, like {a,{b,c},d} -function parseCommaParts(str) { - if (!str) - return ['']; - - var parts = []; - var m = balanced('{', '}', str); - - if (!m) - return str.split(','); - - var pre = m.pre; - var body = m.body; - var post = m.post; - var p = pre.split(','); - - p[p.length-1] += '{' + body + '}'; - var postParts = parseCommaParts(post); - if (post.length) { - p[p.length-1] += postParts.shift(); - p.push.apply(p, postParts); - } - - parts.push.apply(parts, p); - - return parts; -} - -function expandTop(str) { - if (!str) - return []; - - // I don't know why Bash 4.3 does this, but it does. - // Anything starting with {} will have the first two bytes preserved - // but *only* at the top level, so {},a}b will not expand to anything, - // but a{},b}c will be expanded to [a}c,abc]. - // One could argue that this is a bug in Bash, but since the goal of - // this module is to match Bash's rules, we escape a leading {} - if (str.substr(0, 2) === '{}') { - str = '\\{\\}' + str.substr(2); - } - - return expand(escapeBraces(str), true).map(unescapeBraces); -} - -function identity(e) { - return e; -} - -function embrace(str) { - return '{' + str + '}'; -} -function isPadded(el) { - return /^-?0\d/.test(el); -} - -function lte(i, y) { - return i <= y; -} -function gte(i, y) { - return i >= y; -} - -function expand(str, isTop) { - var expansions = []; - - var m = balanced('{', '}', str); - if (!m || /\$$/.test(m.pre)) return [str]; - - var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); - var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); - var isSequence = isNumericSequence || isAlphaSequence; - var isOptions = m.body.indexOf(',') >= 0; - if (!isSequence && !isOptions) { - // {a},b} - if (m.post.match(/,.*\}/)) { - str = m.pre + '{' + m.body + escClose + m.post; - return expand(str); - } - return [str]; - } - - var n; - if (isSequence) { - n = m.body.split(/\.\./); - } else { - n = parseCommaParts(m.body); - if (n.length === 1) { - // x{{a,b}}y ==> x{a}y x{b}y - n = expand(n[0], false).map(embrace); - if (n.length === 1) { - var post = m.post.length - ? expand(m.post, false) - : ['']; - return post.map(function(p) { - return m.pre + n[0] + p; - }); - } - } - } - - // at this point, n is the parts, and we know it's not a comma set - // with a single entry. - - // no need to expand pre, since it is guaranteed to be free of brace-sets - var pre = m.pre; - var post = m.post.length - ? expand(m.post, false) - : ['']; - - var N; - - if (isSequence) { - var x = numeric(n[0]); - var y = numeric(n[1]); - var width = Math.max(n[0].length, n[1].length) - var incr = n.length == 3 - ? Math.abs(numeric(n[2])) - : 1; - var test = lte; - var reverse = y < x; - if (reverse) { - incr *= -1; - test = gte; - } - var pad = n.some(isPadded); - - N = []; - - for (var i = x; test(i, y); i += incr) { - var c; - if (isAlphaSequence) { - c = String.fromCharCode(i); - if (c === '\\') - c = ''; - } else { - c = String(i); - if (pad) { - var need = width - c.length; - if (need > 0) { - var z = new Array(need + 1).join('0'); - if (i < 0) - c = '-' + z + c.slice(1); - else - c = z + c; - } - } - } - N.push(c); - } - } else { - N = concatMap(n, function(el) { return expand(el, false) }); - } - - for (var j = 0; j < N.length; j++) { - for (var k = 0; k < post.length; k++) { - var expansion = pre + N[j] + post[k]; - if (!isTop || isSequence || expansion) - expansions.push(expansion); - } - } - - return expansions; -} - diff --git a/plugins/music_service/squeezelite/node_modules/brace-expansion/node_modules/balanced-match/.npmignore b/plugins/music_service/squeezelite/node_modules/brace-expansion/node_modules/balanced-match/.npmignore deleted file mode 100644 index ae5d8c36a..000000000 --- a/plugins/music_service/squeezelite/node_modules/brace-expansion/node_modules/balanced-match/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -test -.gitignore -.travis.yml -Makefile -example.js diff --git a/plugins/music_service/squeezelite/node_modules/brace-expansion/node_modules/balanced-match/LICENSE.md b/plugins/music_service/squeezelite/node_modules/brace-expansion/node_modules/balanced-match/LICENSE.md deleted file mode 100644 index 2cdc8e414..000000000 --- a/plugins/music_service/squeezelite/node_modules/brace-expansion/node_modules/balanced-match/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -(MIT) - -Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/plugins/music_service/squeezelite/node_modules/brace-expansion/node_modules/balanced-match/README.md b/plugins/music_service/squeezelite/node_modules/brace-expansion/node_modules/balanced-match/README.md deleted file mode 100644 index 08e918c0d..000000000 --- a/plugins/music_service/squeezelite/node_modules/brace-expansion/node_modules/balanced-match/README.md +++ /dev/null @@ -1,91 +0,0 @@ -# balanced-match - -Match balanced string pairs, like `{` and `}` or `` and ``. Supports regular expressions as well! - -[![build status](https://secure.travis-ci.org/juliangruber/balanced-match.svg)](http://travis-ci.org/juliangruber/balanced-match) -[![downloads](https://img.shields.io/npm/dm/balanced-match.svg)](https://www.npmjs.org/package/balanced-match) - -[![testling badge](https://ci.testling.com/juliangruber/balanced-match.png)](https://ci.testling.com/juliangruber/balanced-match) - -## Example - -Get the first matching pair of braces: - -```js -var balanced = require('balanced-match'); - -console.log(balanced('{', '}', 'pre{in{nested}}post')); -console.log(balanced('{', '}', 'pre{first}between{second}post')); -console.log(balanced(/\s+\{\s+/, /\s+\}\s+/, 'pre { in{nest} } post')); -``` - -The matches are: - -```bash -$ node example.js -{ start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' } -{ start: 3, - end: 9, - pre: 'pre', - body: 'first', - post: 'between{second}post' } -{ start: 3, end: 17, pre: 'pre', body: 'in{nest}', post: 'post' } -``` - -## API - -### var m = balanced(a, b, str) - -For the first non-nested matching pair of `a` and `b` in `str`, return an -object with those keys: - -* **start** the index of the first match of `a` -* **end** the index of the matching `b` -* **pre** the preamble, `a` and `b` not included -* **body** the match, `a` and `b` not included -* **post** the postscript, `a` and `b` not included - -If there's no match, `undefined` will be returned. - -If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']` and `{a}}` will match `['', 'a', '}']`. - -### var r = balanced.range(a, b, str) - -For the first non-nested matching pair of `a` and `b` in `str`, return an -array with indexes: `[ , ]`. - -If there's no match, `undefined` will be returned. - -If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]` and `{a}}` will match `[0, 2]`. - -## Installation - -With [npm](https://npmjs.org) do: - -```bash -npm install balanced-match -``` - -## License - -(MIT) - -Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/plugins/music_service/squeezelite/node_modules/brace-expansion/node_modules/balanced-match/index.js b/plugins/music_service/squeezelite/node_modules/brace-expansion/node_modules/balanced-match/index.js deleted file mode 100644 index 1685a7629..000000000 --- a/plugins/music_service/squeezelite/node_modules/brace-expansion/node_modules/balanced-match/index.js +++ /dev/null @@ -1,59 +0,0 @@ -'use strict'; -module.exports = balanced; -function balanced(a, b, str) { - if (a instanceof RegExp) a = maybeMatch(a, str); - if (b instanceof RegExp) b = maybeMatch(b, str); - - var r = range(a, b, str); - - return r && { - start: r[0], - end: r[1], - pre: str.slice(0, r[0]), - body: str.slice(r[0] + a.length, r[1]), - post: str.slice(r[1] + b.length) - }; -} - -function maybeMatch(reg, str) { - var m = str.match(reg); - return m ? m[0] : null; -} - -balanced.range = range; -function range(a, b, str) { - var begs, beg, left, right, result; - var ai = str.indexOf(a); - var bi = str.indexOf(b, ai + 1); - var i = ai; - - if (ai >= 0 && bi > 0) { - begs = []; - left = str.length; - - while (i >= 0 && !result) { - if (i == ai) { - begs.push(i); - ai = str.indexOf(a, i + 1); - } else if (begs.length == 1) { - result = [ begs.pop(), bi ]; - } else { - beg = begs.pop(); - if (beg < left) { - left = beg; - right = bi; - } - - bi = str.indexOf(b, i + 1); - } - - i = ai < bi && ai >= 0 ? ai : bi; - } - - if (begs.length) { - result = [ left, right ]; - } - } - - return result; -} diff --git a/plugins/music_service/squeezelite/node_modules/brace-expansion/node_modules/balanced-match/package.json b/plugins/music_service/squeezelite/node_modules/brace-expansion/node_modules/balanced-match/package.json deleted file mode 100644 index 2b5e7b5ed..000000000 --- a/plugins/music_service/squeezelite/node_modules/brace-expansion/node_modules/balanced-match/package.json +++ /dev/null @@ -1,112 +0,0 @@ -{ - "_args": [ - [ - { - "raw": "balanced-match@^1.0.0", - "scope": null, - "escapedName": "balanced-match", - "name": "balanced-match", - "rawSpec": "^1.0.0", - "spec": ">=1.0.0 <2.0.0", - "type": "range" - }, - "/home/volumio/volumio-plugins/plugins/music_service/squeezelite/node_modules/brace-expansion" - ] - ], - "_from": "balanced-match@>=1.0.0 <2.0.0", - "_id": "balanced-match@1.0.0", - "_inCache": true, - "_location": "/brace-expansion/balanced-match", - "_nodeVersion": "7.8.0", - "_npmOperationalInternal": { - "host": "s3://npm-registry-packages", - "tmp": "tmp/balanced-match-1.0.0.tgz_1497251909645_0.8755026108119637" - }, - "_npmUser": { - "name": "juliangruber", - "email": "julian@juliangruber.com" - }, - "_npmVersion": "4.2.0", - "_phantomChildren": {}, - "_requested": { - "raw": "balanced-match@^1.0.0", - "scope": null, - "escapedName": "balanced-match", - "name": "balanced-match", - "rawSpec": "^1.0.0", - "spec": ">=1.0.0 <2.0.0", - "type": "range" - }, - "_requiredBy": [ - "/brace-expansion" - ], - "_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "_shasum": "89b4d199ab2bee49de164ea02b89ce462d71b767", - "_shrinkwrap": null, - "_spec": "balanced-match@^1.0.0", - "_where": "/home/volumio/volumio-plugins/plugins/music_service/squeezelite/node_modules/brace-expansion", - "author": { - "name": "Julian Gruber", - "email": "mail@juliangruber.com", - "url": "http://juliangruber.com" - }, - "bugs": { - "url": "https://github.com/juliangruber/balanced-match/issues" - }, - "dependencies": {}, - "description": "Match balanced character pairs, like \"{\" and \"}\"", - "devDependencies": { - "matcha": "^0.7.0", - "tape": "^4.6.0" - }, - "directories": {}, - "dist": { - "shasum": "89b4d199ab2bee49de164ea02b89ce462d71b767", - "tarball": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz" - }, - "gitHead": "d701a549a7653a874eebce7eca25d3577dc868ac", - "homepage": "https://github.com/juliangruber/balanced-match", - "keywords": [ - "match", - "regexp", - "test", - "balanced", - "parse" - ], - "license": "MIT", - "main": "index.js", - "maintainers": [ - { - "name": "juliangruber", - "email": "julian@juliangruber.com" - } - ], - "name": "balanced-match", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git://github.com/juliangruber/balanced-match.git" - }, - "scripts": { - "bench": "make bench", - "test": "make test" - }, - "testling": { - "files": "test/*.js", - "browsers": [ - "ie/8..latest", - "firefox/20..latest", - "firefox/nightly", - "chrome/25..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2..latest" - ] - }, - "version": "1.0.0" -} diff --git a/plugins/music_service/squeezelite/node_modules/brace-expansion/package.json b/plugins/music_service/squeezelite/node_modules/brace-expansion/package.json deleted file mode 100644 index e80673183..000000000 --- a/plugins/music_service/squeezelite/node_modules/brace-expansion/package.json +++ /dev/null @@ -1,118 +0,0 @@ -{ - "_args": [ - [ - { - "raw": "brace-expansion@^1.1.6", - "scope": null, - "escapedName": "brace-expansion", - "name": "brace-expansion", - "rawSpec": "^1.1.6", - "spec": ">=1.1.6 <2.0.0", - "type": "range" - }, - "/home/volumio/volumio-plugins/plugins/music_service/squeezelite" - ] - ], - "_from": "brace-expansion@>=1.1.6 <2.0.0", - "_id": "brace-expansion@1.1.11", - "_inCache": true, - "_location": "/brace-expansion", - "_nodeVersion": "9.0.0", - "_npmOperationalInternal": { - "host": "s3://npm-registry-packages", - "tmp": "tmp/brace-expansion_1.1.11_1518248541320_0.33962849281003904" - }, - "_npmUser": { - "name": "juliangruber", - "email": "julian@juliangruber.com" - }, - "_npmVersion": "5.5.1", - "_phantomChildren": {}, - "_requested": { - "raw": "brace-expansion@^1.1.6", - "scope": null, - "escapedName": "brace-expansion", - "name": "brace-expansion", - "rawSpec": "^1.1.6", - "spec": ">=1.1.6 <2.0.0", - "type": "range" - }, - "_requiredBy": [ - "/", - "/minimatch" - ], - "_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "_shasum": "3c7fcbf529d87226f3d2f52b966ff5271eb441dd", - "_shrinkwrap": null, - "_spec": "brace-expansion@^1.1.6", - "_where": "/home/volumio/volumio-plugins/plugins/music_service/squeezelite", - "author": { - "name": "Julian Gruber", - "email": "mail@juliangruber.com", - "url": "http://juliangruber.com" - }, - "bugs": { - "url": "https://github.com/juliangruber/brace-expansion/issues" - }, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - }, - "description": "Brace expansion as known from sh/bash", - "devDependencies": { - "matcha": "^0.7.0", - "tape": "^4.6.0" - }, - "directories": {}, - "dist": { - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "shasum": "3c7fcbf529d87226f3d2f52b966ff5271eb441dd", - "tarball": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "fileCount": 4, - "unpackedSize": 11059 - }, - "gitHead": "01a21de7441549d26ac0c0a9ff91385d16e5c21c", - "homepage": "https://github.com/juliangruber/brace-expansion", - "keywords": [], - "license": "MIT", - "main": "index.js", - "maintainers": [ - { - "name": "isaacs", - "email": "isaacs@npmjs.com" - }, - { - "name": "juliangruber", - "email": "julian@juliangruber.com" - } - ], - "name": "brace-expansion", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git://github.com/juliangruber/brace-expansion.git" - }, - "scripts": { - "bench": "matcha test/perf/bench.js", - "gentest": "bash test/generate.sh", - "test": "tape test/*.js" - }, - "testling": { - "files": "test/*.js", - "browsers": [ - "ie/8..latest", - "firefox/20..latest", - "firefox/nightly", - "chrome/25..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2..latest" - ] - }, - "version": "1.1.11" -} diff --git a/plugins/music_service/squeezelite/node_modules/concat-map/.travis.yml b/plugins/music_service/squeezelite/node_modules/concat-map/.travis.yml deleted file mode 100644 index f1d0f13c8..000000000 --- a/plugins/music_service/squeezelite/node_modules/concat-map/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.4 - - 0.6 diff --git a/plugins/music_service/squeezelite/node_modules/concat-map/LICENSE b/plugins/music_service/squeezelite/node_modules/concat-map/LICENSE deleted file mode 100644 index ee27ba4b4..000000000 --- a/plugins/music_service/squeezelite/node_modules/concat-map/LICENSE +++ /dev/null @@ -1,18 +0,0 @@ -This software is released under the MIT license: - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/plugins/music_service/squeezelite/node_modules/concat-map/README.markdown b/plugins/music_service/squeezelite/node_modules/concat-map/README.markdown deleted file mode 100644 index 408f70a1b..000000000 --- a/plugins/music_service/squeezelite/node_modules/concat-map/README.markdown +++ /dev/null @@ -1,62 +0,0 @@ -concat-map -========== - -Concatenative mapdashery. - -[![browser support](http://ci.testling.com/substack/node-concat-map.png)](http://ci.testling.com/substack/node-concat-map) - -[![build status](https://secure.travis-ci.org/substack/node-concat-map.png)](http://travis-ci.org/substack/node-concat-map) - -example -======= - -``` js -var concatMap = require('concat-map'); -var xs = [ 1, 2, 3, 4, 5, 6 ]; -var ys = concatMap(xs, function (x) { - return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; -}); -console.dir(ys); -``` - -*** - -``` -[ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ] -``` - -methods -======= - -``` js -var concatMap = require('concat-map') -``` - -concatMap(xs, fn) ------------------ - -Return an array of concatenated elements by calling `fn(x, i)` for each element -`x` and each index `i` in the array `xs`. - -When `fn(x, i)` returns an array, its result will be concatenated with the -result array. If `fn(x, i)` returns anything else, that value will be pushed -onto the end of the result array. - -install -======= - -With [npm](http://npmjs.org) do: - -``` -npm install concat-map -``` - -license -======= - -MIT - -notes -===== - -This module was written while sitting high above the ground in a tree. diff --git a/plugins/music_service/squeezelite/node_modules/concat-map/example/map.js b/plugins/music_service/squeezelite/node_modules/concat-map/example/map.js deleted file mode 100644 index 33656217b..000000000 --- a/plugins/music_service/squeezelite/node_modules/concat-map/example/map.js +++ /dev/null @@ -1,6 +0,0 @@ -var concatMap = require('../'); -var xs = [ 1, 2, 3, 4, 5, 6 ]; -var ys = concatMap(xs, function (x) { - return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; -}); -console.dir(ys); diff --git a/plugins/music_service/squeezelite/node_modules/concat-map/index.js b/plugins/music_service/squeezelite/node_modules/concat-map/index.js deleted file mode 100644 index b29a7812e..000000000 --- a/plugins/music_service/squeezelite/node_modules/concat-map/index.js +++ /dev/null @@ -1,13 +0,0 @@ -module.exports = function (xs, fn) { - var res = []; - for (var i = 0; i < xs.length; i++) { - var x = fn(xs[i], i); - if (isArray(x)) res.push.apply(res, x); - else res.push(x); - } - return res; -}; - -var isArray = Array.isArray || function (xs) { - return Object.prototype.toString.call(xs) === '[object Array]'; -}; diff --git a/plugins/music_service/squeezelite/node_modules/concat-map/package.json b/plugins/music_service/squeezelite/node_modules/concat-map/package.json deleted file mode 100644 index be6cac622..000000000 --- a/plugins/music_service/squeezelite/node_modules/concat-map/package.json +++ /dev/null @@ -1,118 +0,0 @@ -{ - "_args": [ - [ - { - "raw": "concat-map@^0.0.1", - "scope": null, - "escapedName": "concat-map", - "name": "concat-map", - "rawSpec": "^0.0.1", - "spec": ">=0.0.1 <0.0.2", - "type": "range" - }, - "/home/volumio/volumio-plugins/plugins/music_service/squeezelite" - ] - ], - "_from": "concat-map@>=0.0.1 <0.0.2", - "_id": "concat-map@0.0.1", - "_inCache": true, - "_location": "/concat-map", - "_npmUser": { - "name": "substack", - "email": "mail@substack.net" - }, - "_npmVersion": "1.3.21", - "_phantomChildren": {}, - "_requested": { - "raw": "concat-map@^0.0.1", - "scope": null, - "escapedName": "concat-map", - "name": "concat-map", - "rawSpec": "^0.0.1", - "spec": ">=0.0.1 <0.0.2", - "type": "range" - }, - "_requiredBy": [ - "/", - "/brace-expansion" - ], - "_resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "_shasum": "d8a96bd77fd68df7793a73036a3ba0d5405d477b", - "_shrinkwrap": null, - "_spec": "concat-map@^0.0.1", - "_where": "/home/volumio/volumio-plugins/plugins/music_service/squeezelite", - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "bugs": { - "url": "https://github.com/substack/node-concat-map/issues" - }, - "dependencies": {}, - "description": "concatenative mapdashery", - "devDependencies": { - "tape": "~2.4.0" - }, - "directories": { - "example": "example", - "test": "test" - }, - "dist": { - "shasum": "d8a96bd77fd68df7793a73036a3ba0d5405d477b", - "tarball": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" - }, - "homepage": "https://github.com/substack/node-concat-map", - "keywords": [ - "concat", - "concatMap", - "map", - "functional", - "higher-order" - ], - "license": "MIT", - "main": "index.js", - "maintainers": [ - { - "name": "substack", - "email": "mail@substack.net" - } - ], - "name": "concat-map", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git://github.com/substack/node-concat-map.git" - }, - "scripts": { - "test": "tape test/*.js" - }, - "testling": { - "files": "test/*.js", - "browsers": { - "ie": [ - 6, - 7, - 8, - 9 - ], - "ff": [ - 3.5, - 10, - 15 - ], - "chrome": [ - 10, - 22 - ], - "safari": [ - 5.1 - ], - "opera": [ - 12 - ] - } - }, - "version": "0.0.1" -} diff --git a/plugins/music_service/squeezelite/node_modules/concat-map/test/map.js b/plugins/music_service/squeezelite/node_modules/concat-map/test/map.js deleted file mode 100644 index fdbd7022f..000000000 --- a/plugins/music_service/squeezelite/node_modules/concat-map/test/map.js +++ /dev/null @@ -1,39 +0,0 @@ -var concatMap = require('../'); -var test = require('tape'); - -test('empty or not', function (t) { - var xs = [ 1, 2, 3, 4, 5, 6 ]; - var ixes = []; - var ys = concatMap(xs, function (x, ix) { - ixes.push(ix); - return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; - }); - t.same(ys, [ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ]); - t.same(ixes, [ 0, 1, 2, 3, 4, 5 ]); - t.end(); -}); - -test('always something', function (t) { - var xs = [ 'a', 'b', 'c', 'd' ]; - var ys = concatMap(xs, function (x) { - return x === 'b' ? [ 'B', 'B', 'B' ] : [ x ]; - }); - t.same(ys, [ 'a', 'B', 'B', 'B', 'c', 'd' ]); - t.end(); -}); - -test('scalars', function (t) { - var xs = [ 'a', 'b', 'c', 'd' ]; - var ys = concatMap(xs, function (x) { - return x === 'b' ? [ 'B', 'B', 'B' ] : x; - }); - t.same(ys, [ 'a', 'B', 'B', 'B', 'c', 'd' ]); - t.end(); -}); - -test('undefs', function (t) { - var xs = [ 'a', 'b', 'c', 'd' ]; - var ys = concatMap(xs, function () {}); - t.same(ys, [ undefined, undefined, undefined, undefined ]); - t.end(); -}); diff --git a/plugins/music_service/squeezelite/node_modules/fs-extra/.npmignore b/plugins/music_service/squeezelite/node_modules/fs-extra/.npmignore deleted file mode 100644 index 68eefb7b7..000000000 --- a/plugins/music_service/squeezelite/node_modules/fs-extra/.npmignore +++ /dev/null @@ -1,8 +0,0 @@ -.nyc_output/ -coverage/ -test/ -.travis.yml -appveyor.yml -lib/**/__tests__/ -test/readme.md -test.js diff --git a/plugins/music_service/squeezelite/node_modules/fs-extra/CHANGELOG.md b/plugins/music_service/squeezelite/node_modules/fs-extra/CHANGELOG.md deleted file mode 100644 index 54846dece..000000000 --- a/plugins/music_service/squeezelite/node_modules/fs-extra/CHANGELOG.md +++ /dev/null @@ -1,545 +0,0 @@ -0.28.0 / 2016-04-17 -------------------- -- removed `createOutputStream()`. Use https://www.npmjs.com/package/create-output-stream. See: [#192][#192] -- `mkdirs()/mkdirsSync()` check for invalid win32 path chars. See: [#209][#209], [#237][#237] -- `mkdirs()/mkdirsSync()` if drive not mounted, error. See: [#93][#93] - -0.27.0 / 2016-04-15 -------------------- -- add `dereference` option to `copySync()`. [#235][#235] - -0.26.7 / 2016-03-16 -------------------- -- fixed `copy()` if source and dest are the same. [#230][#230] - -0.26.6 / 2016-03-15 -------------------- -- fixed if `emptyDir()` does not have a callback: [#229][#229] - -0.26.5 / 2016-01-27 -------------------- -- `copy()` with two arguments (w/o callback) was broken. See: [#215][#215] - -0.26.4 / 2016-01-05 -------------------- -- `copySync()` made `preserveTimestamps` default consistent with `copy()` which is `false`. See: [#208][#208] - -0.26.3 / 2015-12-17 -------------------- -- fixed `copy()` hangup in copying blockDevice / characterDevice / `/dev/null`. See: [#193][#193] - -0.26.2 / 2015-11-02 -------------------- -- fixed `outputJson{Sync}()` spacing adherence to `fs.spaces` - -0.26.1 / 2015-11-02 -------------------- -- fixed `copySync()` when `clogger=true` and the destination is read only. See: [#190][#190] - -0.26.0 / 2015-10-25 -------------------- -- extracted the `walk()` function into its own module [`klaw`](https://github.com/jprichardson/node-klaw). - -0.25.0 / 2015-10-24 -------------------- -- now has a file walker `walk()` - -0.24.0 / 2015-08-28 -------------------- -- removed alias `delete()` and `deleteSync()`. See: [#171][#171] - -0.23.1 / 2015-08-07 -------------------- -- Better handling of errors for `move()` when moving across devices. [#170][#170] -- `ensureSymlink()` and `ensureLink()` should not throw errors if link exists. [#169][#169] - -0.23.0 / 2015-08-06 -------------------- -- added `ensureLink{Sync}()` and `ensureSymlink{Sync}()`. See: [#165][#165] - -0.22.1 / 2015-07-09 -------------------- -- Prevent calling `hasMillisResSync()` on module load. See: [#149][#149]. -Fixes regression that was introduced in `0.21.0`. - -0.22.0 / 2015-07-09 -------------------- -- preserve permissions / ownership in `copy()`. See: [#54][#54] - -0.21.0 / 2015-07-04 -------------------- -- add option to preserve timestamps in `copy()` and `copySync()`. See: [#141][#141] -- updated `graceful-fs@3.x` to `4.x`. This brings in features from `amazing-graceful-fs` (much cleaner code / less hacks) - -0.20.1 / 2015-06-23 -------------------- -- fixed regression caused by latest jsonfile update: See: https://github.com/jprichardson/node-jsonfile/issues/26 - -0.20.0 / 2015-06-19 -------------------- -- removed `jsonfile` aliases with `File` in the name, they weren't documented and probably weren't in use e.g. -this package had both `fs.readJsonFile` and `fs.readJson` that were aliases to each other, now use `fs.readJson`. -- preliminary walker created. Intentionally not documented. If you use it, it will almost certainly change and break your code. -- started moving tests inline -- upgraded to `jsonfile@2.1.0`, can now pass JSON revivers/replacers to `readJson()`, `writeJson()`, `outputJson()` - -0.19.0 / 2015-06-08 -------------------- -- `fs.copy()` had support for Node v0.8, dropped support - -0.18.4 / 2015-05-22 -------------------- -- fixed license field according to this: [#136][#136] and https://github.com/npm/npm/releases/tag/v2.10.0 - -0.18.3 / 2015-05-08 -------------------- -- bugfix: handle `EEXIST` when clobbering on some Linux systems. [#134][#134] - -0.18.2 / 2015-04-17 -------------------- -- bugfix: allow `F_OK` ([#120][#120]) - -0.18.1 / 2015-04-15 -------------------- -- improved windows support for `move()` a bit. https://github.com/jprichardson/node-fs-extra/commit/92838980f25dc2ee4ec46b43ee14d3c4a1d30c1b -- fixed a lot of tests for Windows (appveyor) - -0.18.0 / 2015-03-31 -------------------- -- added `emptyDir()` and `emptyDirSync()` - -0.17.0 / 2015-03-28 -------------------- -- `copySync` added `clobber` option (before always would clobber, now if `clobber` is `false` it throws an error if the destination exists). -**Only works with files at the moment.** -- `createOutputStream()` added. See: [#118][#118] - -0.16.5 / 2015-03-08 -------------------- -- fixed `fs.move` when `clobber` is `true` and destination is a directory, it should clobber. [#114][#114] - -0.16.4 / 2015-03-01 -------------------- -- `fs.mkdirs` fix infinite loop on Windows. See: See https://github.com/substack/node-mkdirp/pull/74 and https://github.com/substack/node-mkdirp/issues/66 - -0.16.3 / 2015-01-28 -------------------- -- reverted https://github.com/jprichardson/node-fs-extra/commit/1ee77c8a805eba5b99382a2591ff99667847c9c9 - - -0.16.2 / 2015-01-28 -------------------- -- fixed `fs.copy` for Node v0.8 (support is temporary and will be removed in the near future) - -0.16.1 / 2015-01-28 -------------------- -- if `setImmediate` is not available, fall back to `process.nextTick` - -0.16.0 / 2015-01-28 -------------------- -- bugfix `fs.move()` into itself. Closes #104 -- bugfix `fs.move()` moving directory across device. Closes #108 -- added coveralls support -- bugfix: nasty multiple callback `fs.copy()` bug. Closes #98 -- misc fs.copy code cleanups - -0.15.0 / 2015-01-21 -------------------- -- dropped `ncp`, imported code in -- because of previous, now supports `io.js` -- `graceful-fs` is now a dependency - -0.14.0 / 2015-01-05 -------------------- -- changed `copy`/`copySync` from `fs.copy(src, dest, [filters], callback)` to `fs.copy(src, dest, [options], callback)` [#100][#100] -- removed mockfs tests for mkdirp (this may be temporary, but was getting in the way of other tests) - -0.13.0 / 2014-12-10 -------------------- -- removed `touch` and `touchSync` methods (they didn't handle permissions like UNIX touch) -- updated `"ncp": "^0.6.0"` to `"ncp": "^1.0.1"` -- imported `mkdirp` => `minimist` and `mkdirp` are no longer dependences, should now appease people who wanted `mkdirp` to be `--use_strict` safe. See [#59]([#59][#59]) - -0.12.0 / 2014-09-22 -------------------- -- copy symlinks in `copySync()` [#85][#85] - -0.11.1 / 2014-09-02 -------------------- -- bugfix `copySync()` preserve file permissions [#80][#80] - -0.11.0 / 2014-08-11 -------------------- -- upgraded `"ncp": "^0.5.1"` to `"ncp": "^0.6.0"` -- upgrade `jsonfile": "^1.2.0"` to `jsonfile": "^2.0.0"` => on write, json files now have `\n` at end. Also adds `options.throws` to `readJsonSync()` -see https://github.com/jprichardson/node-jsonfile#readfilesyncfilename-options for more details. - -0.10.0 / 2014-06-29 ------------------- -* bugfix: upgaded `"jsonfile": "~1.1.0"` to `"jsonfile": "^1.2.0"`, bumped minor because of `jsonfile` dep change -from `~` to `^`. #67 - -0.9.1 / 2014-05-22 ------------------- -* removed Node.js `0.8.x` support, `0.9.0` was published moments ago and should have been done there - -0.9.0 / 2014-05-22 ------------------- -* upgraded `ncp` from `~0.4.2` to `^0.5.1`, #58 -* upgraded `rimraf` from `~2.2.6` to `^2.2.8` -* upgraded `mkdirp` from `0.3.x` to `^0.5.0` -* added methods `ensureFile()`, `ensureFileSync()` -* added methods `ensureDir()`, `ensureDirSync()` #31 -* added `move()` method. From: https://github.com/andrewrk/node-mv - - -0.8.1 / 2013-10-24 ------------------- -* copy failed to return an error to the callback if a file doesn't exist (ulikoehler #38, #39) - -0.8.0 / 2013-10-14 ------------------- -* `filter` implemented on `copy()` and `copySync()`. (Srirangan / #36) - -0.7.1 / 2013-10-12 ------------------- -* `copySync()` implemented (Srirangan / #33) -* updated to the latest `jsonfile` version `1.1.0` which gives `options` params for the JSON methods. Closes #32 - -0.7.0 / 2013-10-07 ------------------- -* update readme conventions -* `copy()` now works if destination directory does not exist. Closes #29 - -0.6.4 / 2013-09-05 ------------------- -* changed `homepage` field in package.json to remove NPM warning - -0.6.3 / 2013-06-28 ------------------- -* changed JSON spacing default from `4` to `2` to follow Node conventions -* updated `jsonfile` dep -* updated `rimraf` dep - -0.6.2 / 2013-06-28 ------------------- -* added .npmignore, #25 - -0.6.1 / 2013-05-14 ------------------- -* modified for `strict` mode, closes #24 -* added `outputJson()/outputJsonSync()`, closes #23 - -0.6.0 / 2013-03-18 ------------------- -* removed node 0.6 support -* added node 0.10 support -* upgraded to latest `ncp` and `rimraf`. -* optional `graceful-fs` support. Closes #17 - - -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 - -[#238]: https://github.com/jprichardson/node-fs-extra/issues/238 "Can't write to files while in a worker thread." -[#237]: https://github.com/jprichardson/node-fs-extra/issues/237 ".ensureDir(..) fails silently when passed an invalid path..." -[#236]: https://github.com/jprichardson/node-fs-extra/issues/236 "[Removed] Filed under wrong repo" -[#235]: https://github.com/jprichardson/node-fs-extra/pull/235 "Adds symlink dereference option to `fse.copySync` (#191)" -[#234]: https://github.com/jprichardson/node-fs-extra/issues/234 "ensureDirSync fails silent when EACCES: permission denied on travis-ci" -[#233]: https://github.com/jprichardson/node-fs-extra/issues/233 "please make sure the first argument in callback is error object [feature-copy]" -[#232]: https://github.com/jprichardson/node-fs-extra/issues/232 "Copy a folder content to its child folder. " -[#231]: https://github.com/jprichardson/node-fs-extra/issues/231 "Adding read/write/output functions for YAML" -[#230]: https://github.com/jprichardson/node-fs-extra/pull/230 "throw error if src and dest are the same to avoid zeroing out + test" -[#229]: https://github.com/jprichardson/node-fs-extra/pull/229 "fix 'TypeError: callback is not a function' in emptyDir" -[#228]: https://github.com/jprichardson/node-fs-extra/pull/228 "Throw error when target is empty so file is not accidentally zeroed out" -[#227]: https://github.com/jprichardson/node-fs-extra/issues/227 "Uncatchable errors when there are invalid arguments [feature-move]" -[#226]: https://github.com/jprichardson/node-fs-extra/issues/226 "Moving to the current directory" -[#225]: https://github.com/jprichardson/node-fs-extra/issues/225 "EBUSY: resource busy or locked, unlink" -[#224]: https://github.com/jprichardson/node-fs-extra/issues/224 "fse.copy ENOENT error" -[#223]: https://github.com/jprichardson/node-fs-extra/issues/223 "Suspicious behavior of fs.existsSync" -[#222]: https://github.com/jprichardson/node-fs-extra/pull/222 "A clearer description of emtpyDir function" -[#221]: https://github.com/jprichardson/node-fs-extra/pull/221 "Update README.md" -[#220]: https://github.com/jprichardson/node-fs-extra/pull/220 "Non-breaking feature: add option 'passStats' to copy methods." -[#219]: https://github.com/jprichardson/node-fs-extra/pull/219 "Add closing parenthesis in copySync example" -[#218]: https://github.com/jprichardson/node-fs-extra/pull/218 "fix #187 #70 options.filter bug" -[#217]: https://github.com/jprichardson/node-fs-extra/pull/217 "fix #187 #70 options.filter bug" -[#216]: https://github.com/jprichardson/node-fs-extra/pull/216 "fix #187 #70 options.filter bug" -[#215]: https://github.com/jprichardson/node-fs-extra/pull/215 "fse.copy throws error when only src and dest provided [bug, documentation, feature-copy]" -[#214]: https://github.com/jprichardson/node-fs-extra/pull/214 "Fixing copySync anchor tag" -[#213]: https://github.com/jprichardson/node-fs-extra/issues/213 "Merge extfs with this repo" -[#212]: https://github.com/jprichardson/node-fs-extra/pull/212 "Update year to 2016 in README.md and LICENSE" -[#211]: https://github.com/jprichardson/node-fs-extra/issues/211 "Not copying all files" -[#210]: https://github.com/jprichardson/node-fs-extra/issues/210 "copy/copySync behave differently when copying a symbolic file [bug, documentation, feature-copy]" -[#209]: https://github.com/jprichardson/node-fs-extra/issues/209 "In Windows invalid directory name causes infinite loop in ensureDir(). [bug]" -[#208]: https://github.com/jprichardson/node-fs-extra/pull/208 "fix options.preserveTimestamps to false in copy-sync by default [feature-copy]" -[#207]: https://github.com/jprichardson/node-fs-extra/issues/207 "Add `compare` suite of functions" -[#206]: https://github.com/jprichardson/node-fs-extra/issues/206 "outputFileSync" -[#205]: https://github.com/jprichardson/node-fs-extra/issues/205 "fix documents about copy/copySync [documentation, feature-copy]" -[#204]: https://github.com/jprichardson/node-fs-extra/pull/204 "allow copy of block and character device files" -[#203]: https://github.com/jprichardson/node-fs-extra/issues/203 "copy method's argument options couldn't be undefined [bug, feature-copy]" -[#202]: https://github.com/jprichardson/node-fs-extra/issues/202 "why there is not a walkSync method?" -[#201]: https://github.com/jprichardson/node-fs-extra/issues/201 "clobber for directories [feature-copy, future]" -[#200]: https://github.com/jprichardson/node-fs-extra/issues/200 "'copySync' doesn't work in sync" -[#199]: https://github.com/jprichardson/node-fs-extra/issues/199 "fs.copySync fails if user does not own file [bug, feature-copy]" -[#198]: https://github.com/jprichardson/node-fs-extra/issues/198 "handle copying between identical files [feature-copy]" -[#197]: https://github.com/jprichardson/node-fs-extra/issues/197 "Missing documentation for `outputFile` `options` 3rd parameter [documentation]" -[#196]: https://github.com/jprichardson/node-fs-extra/issues/196 "copy filter: async function and/or function called with `fs.stat` result [future]" -[#195]: https://github.com/jprichardson/node-fs-extra/issues/195 "How to override with outputFile?" -[#194]: https://github.com/jprichardson/node-fs-extra/pull/194 "allow ensureFile(Sync) to provide data to be written to created file" -[#193]: https://github.com/jprichardson/node-fs-extra/issues/193 "`fs.copy` fails silently if source file is /dev/null [bug, feature-copy]" -[#192]: https://github.com/jprichardson/node-fs-extra/issues/192 "Remove fs.createOutputStream()" -[#191]: https://github.com/jprichardson/node-fs-extra/issues/191 "How to copy symlinks to target as normal folders [feature-copy]" -[#190]: https://github.com/jprichardson/node-fs-extra/pull/190 "copySync to overwrite destination file if readonly and clobber true" -[#189]: https://github.com/jprichardson/node-fs-extra/pull/189 "move.test fix to support CRLF on Windows" -[#188]: https://github.com/jprichardson/node-fs-extra/issues/188 "move.test failing on windows platform" -[#187]: https://github.com/jprichardson/node-fs-extra/issues/187 "Not filter each file, stops on first false [feature-copy]" -[#186]: https://github.com/jprichardson/node-fs-extra/issues/186 "Do you need a .size() function in this module? [future]" -[#185]: https://github.com/jprichardson/node-fs-extra/issues/185 "Doesn't work on NodeJS v4.x" -[#184]: https://github.com/jprichardson/node-fs-extra/issues/184 "CLI equivalent for fs-extra" -[#183]: https://github.com/jprichardson/node-fs-extra/issues/183 "with clobber true, copy and copySync behave differently if destination file is read only [bug, feature-copy]" -[#182]: https://github.com/jprichardson/node-fs-extra/issues/182 "ensureDir(dir, callback) second callback parameter not specified" -[#181]: https://github.com/jprichardson/node-fs-extra/issues/181 "Add ability to remove file securely [enhancement, wont-fix]" -[#180]: https://github.com/jprichardson/node-fs-extra/issues/180 "Filter option doesn't work the same way in copy and copySync [bug, feature-copy]" -[#179]: https://github.com/jprichardson/node-fs-extra/issues/179 "Include opendir" -[#178]: https://github.com/jprichardson/node-fs-extra/issues/178 "ENOTEMPTY is thrown on removeSync " -[#177]: https://github.com/jprichardson/node-fs-extra/issues/177 "fix `remove()` wildcards (introduced by rimraf) [feature-remove]" -[#176]: https://github.com/jprichardson/node-fs-extra/issues/176 "createOutputStream doesn't emit 'end' event" -[#175]: https://github.com/jprichardson/node-fs-extra/issues/175 "[Feature Request].moveSync support [feature-move, future]" -[#174]: https://github.com/jprichardson/node-fs-extra/pull/174 "Fix copy formatting and document options.filter" -[#173]: https://github.com/jprichardson/node-fs-extra/issues/173 "Feature Request: writeJson should mkdirs" -[#172]: https://github.com/jprichardson/node-fs-extra/issues/172 "rename `clobber` flags to `overwrite`" -[#171]: https://github.com/jprichardson/node-fs-extra/issues/171 "remove unnecessary aliases" -[#170]: https://github.com/jprichardson/node-fs-extra/pull/170 "More robust handling of errors moving across virtual drives" -[#169]: https://github.com/jprichardson/node-fs-extra/pull/169 "suppress ensureLink & ensureSymlink dest exists error" -[#168]: https://github.com/jprichardson/node-fs-extra/pull/168 "suppress ensurelink dest exists error" -[#167]: https://github.com/jprichardson/node-fs-extra/pull/167 "Adds basic (string, buffer) support for ensureFile content [future]" -[#166]: https://github.com/jprichardson/node-fs-extra/pull/166 "Adds basic (string, buffer) support for ensureFile content" -[#165]: https://github.com/jprichardson/node-fs-extra/pull/165 "ensure for link & symlink" -[#164]: https://github.com/jprichardson/node-fs-extra/issues/164 "Feature Request: ensureFile to take optional argument for file content" -[#163]: https://github.com/jprichardson/node-fs-extra/issues/163 "ouputJson not formatted out of the box [bug]" -[#162]: https://github.com/jprichardson/node-fs-extra/pull/162 "ensure symlink & link" -[#161]: https://github.com/jprichardson/node-fs-extra/pull/161 "ensure symlink & link" -[#160]: https://github.com/jprichardson/node-fs-extra/pull/160 "ensure symlink & link" -[#159]: https://github.com/jprichardson/node-fs-extra/pull/159 "ensure symlink & link" -[#158]: https://github.com/jprichardson/node-fs-extra/issues/158 "Feature Request: ensureLink and ensureSymlink methods" -[#157]: https://github.com/jprichardson/node-fs-extra/issues/157 "writeJson isn't formatted" -[#156]: https://github.com/jprichardson/node-fs-extra/issues/156 "Promise.promisifyAll doesn't work for some methods" -[#155]: https://github.com/jprichardson/node-fs-extra/issues/155 "Readme" -[#154]: https://github.com/jprichardson/node-fs-extra/issues/154 "/tmp/millis-test-sync" -[#153]: https://github.com/jprichardson/node-fs-extra/pull/153 "Make preserveTimes also work on read-only files. Closes #152" -[#152]: https://github.com/jprichardson/node-fs-extra/issues/152 "fs.copy fails for read-only files with preserveTimestamp=true [feature-copy]" -[#151]: https://github.com/jprichardson/node-fs-extra/issues/151 "TOC does not work correctly on npm [documentation]" -[#150]: https://github.com/jprichardson/node-fs-extra/issues/150 "Remove test file fixtures, create with code." -[#149]: https://github.com/jprichardson/node-fs-extra/issues/149 "/tmp/millis-test-sync" -[#148]: https://github.com/jprichardson/node-fs-extra/issues/148 "split out `Sync` methods in documentation" -[#147]: https://github.com/jprichardson/node-fs-extra/issues/147 "Adding rmdirIfEmpty" -[#146]: https://github.com/jprichardson/node-fs-extra/pull/146 "ensure test.js works" -[#145]: https://github.com/jprichardson/node-fs-extra/issues/145 "Add `fs.exists` and `fs.existsSync` if it doesn't exist." -[#144]: https://github.com/jprichardson/node-fs-extra/issues/144 "tests failing" -[#143]: https://github.com/jprichardson/node-fs-extra/issues/143 "update graceful-fs" -[#142]: https://github.com/jprichardson/node-fs-extra/issues/142 "PrependFile Feature" -[#141]: https://github.com/jprichardson/node-fs-extra/pull/141 "Add option to preserve timestamps" -[#140]: https://github.com/jprichardson/node-fs-extra/issues/140 "Json file reading fails with 'utf8'" -[#139]: https://github.com/jprichardson/node-fs-extra/pull/139 "Preserve file timestamp on copy. Closes #138" -[#138]: https://github.com/jprichardson/node-fs-extra/issues/138 "Preserve timestamps on copying files" -[#137]: https://github.com/jprichardson/node-fs-extra/issues/137 "outputFile/outputJson: Unexpected end of input" -[#136]: https://github.com/jprichardson/node-fs-extra/pull/136 "Update license attribute" -[#135]: https://github.com/jprichardson/node-fs-extra/issues/135 "emptyDir throws Error if no callback is provided" -[#134]: https://github.com/jprichardson/node-fs-extra/pull/134 "Handle EEXIST error when clobbering dir" -[#133]: https://github.com/jprichardson/node-fs-extra/pull/133 "Travis runs with `sudo: false`" -[#132]: https://github.com/jprichardson/node-fs-extra/pull/132 "isDirectory method" -[#131]: https://github.com/jprichardson/node-fs-extra/issues/131 "copySync is not working iojs 1.8.4 on linux [feature-copy]" -[#130]: https://github.com/jprichardson/node-fs-extra/pull/130 "Please review additional features." -[#129]: https://github.com/jprichardson/node-fs-extra/pull/129 "can you review this feature?" -[#128]: https://github.com/jprichardson/node-fs-extra/issues/128 "fsExtra.move(filepath, newPath) broken;" -[#127]: https://github.com/jprichardson/node-fs-extra/issues/127 "consider using fs.access to remove deprecated warnings for fs.exists" -[#126]: https://github.com/jprichardson/node-fs-extra/issues/126 " TypeError: Object # has no method 'access'" -[#125]: https://github.com/jprichardson/node-fs-extra/issues/125 "Question: What do the *Sync function do different from non-sync" -[#124]: https://github.com/jprichardson/node-fs-extra/issues/124 "move with clobber option 'ENOTEMPTY'" -[#123]: https://github.com/jprichardson/node-fs-extra/issues/123 "Only copy the content of a directory" -[#122]: https://github.com/jprichardson/node-fs-extra/pull/122 "Update section links in README to match current section ids." -[#121]: https://github.com/jprichardson/node-fs-extra/issues/121 "emptyDir is undefined" -[#120]: https://github.com/jprichardson/node-fs-extra/issues/120 "usage bug caused by shallow cloning methods of 'graceful-fs'" -[#119]: https://github.com/jprichardson/node-fs-extra/issues/119 "mkdirs and ensureDir never invoke callback and consume CPU indefinitely if provided a path with invalid characters on Windows" -[#118]: https://github.com/jprichardson/node-fs-extra/pull/118 "createOutputStream" -[#117]: https://github.com/jprichardson/node-fs-extra/pull/117 "Fixed issue with slash separated paths on windows" -[#116]: https://github.com/jprichardson/node-fs-extra/issues/116 "copySync can only copy directories not files [documentation, feature-copy]" -[#115]: https://github.com/jprichardson/node-fs-extra/issues/115 ".Copy & .CopySync [feature-copy]" -[#114]: https://github.com/jprichardson/node-fs-extra/issues/114 "Fails to move (rename) directory to non-empty directory even with clobber: true" -[#113]: https://github.com/jprichardson/node-fs-extra/issues/113 "fs.copy seems to callback early if the destination file already exists" -[#112]: https://github.com/jprichardson/node-fs-extra/pull/112 "Copying a file into an existing directory" -[#111]: https://github.com/jprichardson/node-fs-extra/pull/111 "Moving a file into an existing directory " -[#110]: https://github.com/jprichardson/node-fs-extra/pull/110 "Moving a file into an existing directory" -[#109]: https://github.com/jprichardson/node-fs-extra/issues/109 "fs.move across windows drives fails" -[#108]: https://github.com/jprichardson/node-fs-extra/issues/108 "fse.move directories across multiple devices doesn't work" -[#107]: https://github.com/jprichardson/node-fs-extra/pull/107 "Check if dest path is an existing dir and copy or move source in it" -[#106]: https://github.com/jprichardson/node-fs-extra/issues/106 "fse.copySync crashes while copying across devices D: [feature-copy]" -[#105]: https://github.com/jprichardson/node-fs-extra/issues/105 "fs.copy hangs on iojs" -[#104]: https://github.com/jprichardson/node-fs-extra/issues/104 "fse.move deletes folders [bug]" -[#103]: https://github.com/jprichardson/node-fs-extra/issues/103 "Error: EMFILE with copy" -[#102]: https://github.com/jprichardson/node-fs-extra/issues/102 "touch / touchSync was removed ?" -[#101]: https://github.com/jprichardson/node-fs-extra/issues/101 "fs-extra promisified" -[#100]: https://github.com/jprichardson/node-fs-extra/pull/100 "copy: options object or filter to pass to ncp" -[#99]: https://github.com/jprichardson/node-fs-extra/issues/99 "ensureDir() modes [future]" -[#98]: https://github.com/jprichardson/node-fs-extra/issues/98 "fs.copy() incorrect async behavior [bug]" -[#97]: https://github.com/jprichardson/node-fs-extra/pull/97 "use path.join; fix copySync bug" -[#96]: https://github.com/jprichardson/node-fs-extra/issues/96 "destFolderExists in copySync is always undefined." -[#95]: https://github.com/jprichardson/node-fs-extra/pull/95 "Using graceful-ncp instead of ncp" -[#94]: https://github.com/jprichardson/node-fs-extra/issues/94 "Error: EEXIST, file already exists '../mkdirp/bin/cmd.js' on fs.copySync() [enhancement, feature-copy]" -[#93]: https://github.com/jprichardson/node-fs-extra/issues/93 "Confusing error if drive not mounted [enhancement]" -[#92]: https://github.com/jprichardson/node-fs-extra/issues/92 "Problems with Bluebird" -[#91]: https://github.com/jprichardson/node-fs-extra/issues/91 "fs.copySync('/test', '/haha') is different with 'cp -r /test /haha' [enhancement]" -[#90]: https://github.com/jprichardson/node-fs-extra/issues/90 "Folder creation and file copy is Happening in 64 bit machine but not in 32 bit machine" -[#89]: https://github.com/jprichardson/node-fs-extra/issues/89 "Error: EEXIST using fs-extra's fs.copy to copy a directory on Windows" -[#88]: https://github.com/jprichardson/node-fs-extra/issues/88 "Stacking those libraries" -[#87]: https://github.com/jprichardson/node-fs-extra/issues/87 "createWriteStream + outputFile = ?" -[#86]: https://github.com/jprichardson/node-fs-extra/issues/86 "no moveSync?" -[#85]: https://github.com/jprichardson/node-fs-extra/pull/85 "Copy symlinks in copySync" -[#84]: https://github.com/jprichardson/node-fs-extra/issues/84 "Push latest version to npm ?" -[#83]: https://github.com/jprichardson/node-fs-extra/issues/83 "Prevent copying a directory into itself [feature-copy]" -[#82]: https://github.com/jprichardson/node-fs-extra/pull/82 "README updates for move" -[#81]: https://github.com/jprichardson/node-fs-extra/issues/81 "fd leak after fs.move" -[#80]: https://github.com/jprichardson/node-fs-extra/pull/80 "Preserve file mode in copySync" -[#79]: https://github.com/jprichardson/node-fs-extra/issues/79 "fs.copy only .html file empty" -[#78]: https://github.com/jprichardson/node-fs-extra/pull/78 "copySync was not applying filters to directories" -[#77]: https://github.com/jprichardson/node-fs-extra/issues/77 "Create README reference to bluebird" -[#76]: https://github.com/jprichardson/node-fs-extra/issues/76 "Create README reference to typescript" -[#75]: https://github.com/jprichardson/node-fs-extra/issues/75 "add glob as a dep? [question]" -[#74]: https://github.com/jprichardson/node-fs-extra/pull/74 "including new emptydir module" -[#73]: https://github.com/jprichardson/node-fs-extra/pull/73 "add dependency status in readme" -[#72]: https://github.com/jprichardson/node-fs-extra/pull/72 "Use svg instead of png to get better image quality" -[#71]: https://github.com/jprichardson/node-fs-extra/issues/71 "fse.copy not working on Windows 7 x64 OS, but, copySync does work" -[#70]: https://github.com/jprichardson/node-fs-extra/issues/70 "Not filter each file, stops on first false [bug]" -[#69]: https://github.com/jprichardson/node-fs-extra/issues/69 "How to check if folder exist and read the folder name" -[#68]: https://github.com/jprichardson/node-fs-extra/issues/68 "consider flag to readJsonSync (throw false) [enhancement]" -[#67]: https://github.com/jprichardson/node-fs-extra/issues/67 "docs for readJson incorrectly states that is accepts options" -[#66]: https://github.com/jprichardson/node-fs-extra/issues/66 "ENAMETOOLONG" -[#65]: https://github.com/jprichardson/node-fs-extra/issues/65 "exclude filter in fs.copy" -[#64]: https://github.com/jprichardson/node-fs-extra/issues/64 "Announce: mfs - monitor your fs-extra calls" -[#63]: https://github.com/jprichardson/node-fs-extra/issues/63 "Walk" -[#62]: https://github.com/jprichardson/node-fs-extra/issues/62 "npm install fs-extra doesn't work" -[#61]: https://github.com/jprichardson/node-fs-extra/issues/61 "No longer supports node 0.8 due to use of `^` in package.json dependencies" -[#60]: https://github.com/jprichardson/node-fs-extra/issues/60 "chmod & chown for mkdirs" -[#59]: https://github.com/jprichardson/node-fs-extra/issues/59 "Consider including mkdirp and making fs-extra "--use_strict" safe [question]" -[#58]: https://github.com/jprichardson/node-fs-extra/issues/58 "Stack trace not included in fs.copy error" -[#57]: https://github.com/jprichardson/node-fs-extra/issues/57 "Possible to include wildcards in delete?" -[#56]: https://github.com/jprichardson/node-fs-extra/issues/56 "Crash when have no access to write to destination file in copy " -[#55]: https://github.com/jprichardson/node-fs-extra/issues/55 "Is it possible to have any console output similar to Grunt copy module?" -[#54]: https://github.com/jprichardson/node-fs-extra/issues/54 "`copy` does not preserve file ownership and permissons" -[#53]: https://github.com/jprichardson/node-fs-extra/issues/53 "outputFile() - ability to write data in appending mode" -[#52]: https://github.com/jprichardson/node-fs-extra/pull/52 "This fixes (what I think) is a bug in copySync" -[#51]: https://github.com/jprichardson/node-fs-extra/pull/51 "Add a Bitdeli Badge to README" -[#50]: https://github.com/jprichardson/node-fs-extra/issues/50 "Replace mechanism in createFile" -[#49]: https://github.com/jprichardson/node-fs-extra/pull/49 "update rimraf to v2.2.6" -[#48]: https://github.com/jprichardson/node-fs-extra/issues/48 "fs.copy issue [bug]" -[#47]: https://github.com/jprichardson/node-fs-extra/issues/47 "Bug in copy - callback called on readStream "close" - Fixed in ncp 0.5.0" -[#46]: https://github.com/jprichardson/node-fs-extra/pull/46 "update copyright year" -[#45]: https://github.com/jprichardson/node-fs-extra/pull/45 "Added note about fse.outputFile() being the one that overwrites" -[#44]: https://github.com/jprichardson/node-fs-extra/pull/44 "Proposal: Stream support" -[#43]: https://github.com/jprichardson/node-fs-extra/issues/43 "Better error reporting " -[#42]: https://github.com/jprichardson/node-fs-extra/issues/42 "Performance issue?" -[#41]: https://github.com/jprichardson/node-fs-extra/pull/41 "There does seem to be a synchronous version now" -[#40]: https://github.com/jprichardson/node-fs-extra/issues/40 "fs.copy throw unexplained error ENOENT, utime " -[#39]: https://github.com/jprichardson/node-fs-extra/pull/39 "Added regression test for copy() return callback on error" -[#38]: https://github.com/jprichardson/node-fs-extra/pull/38 "Return err in copy() fstat cb, because stat could be undefined or null" -[#37]: https://github.com/jprichardson/node-fs-extra/issues/37 "Maybe include a line reader? [enhancement, question]" -[#36]: https://github.com/jprichardson/node-fs-extra/pull/36 "`filter` parameter `fs.copy` and `fs.copySync`" -[#35]: https://github.com/jprichardson/node-fs-extra/pull/35 "`filter` parameter `fs.copy` and `fs.copySync` " -[#34]: https://github.com/jprichardson/node-fs-extra/issues/34 "update docs to include options for JSON methods [enhancement]" -[#33]: https://github.com/jprichardson/node-fs-extra/pull/33 "fs_extra.copySync" -[#32]: https://github.com/jprichardson/node-fs-extra/issues/32 "update to latest jsonfile [enhancement]" -[#31]: https://github.com/jprichardson/node-fs-extra/issues/31 "Add ensure methods [enhancement]" -[#30]: https://github.com/jprichardson/node-fs-extra/issues/30 "update package.json optional dep `graceful-fs`" -[#29]: https://github.com/jprichardson/node-fs-extra/issues/29 "Copy failing if dest directory doesn't exist. Is this intended?" -[#28]: https://github.com/jprichardson/node-fs-extra/issues/28 "homepage field must be a string url. Deleted." -[#27]: https://github.com/jprichardson/node-fs-extra/issues/27 "Update Readme" -[#26]: https://github.com/jprichardson/node-fs-extra/issues/26 "Add readdir recursive method. [enhancement]" -[#25]: https://github.com/jprichardson/node-fs-extra/pull/25 "adding an `.npmignore` file" -[#24]: https://github.com/jprichardson/node-fs-extra/issues/24 "[bug] cannot run in strict mode [bug]" -[#23]: https://github.com/jprichardson/node-fs-extra/issues/23 "`writeJSON()` should create parent directories" -[#22]: https://github.com/jprichardson/node-fs-extra/pull/22 "Add a limit option to mkdirs()" -[#21]: https://github.com/jprichardson/node-fs-extra/issues/21 "touch() in 0.10.0" -[#20]: https://github.com/jprichardson/node-fs-extra/issues/20 "fs.remove yields callback before directory is really deleted" -[#19]: https://github.com/jprichardson/node-fs-extra/issues/19 "fs.copy err is empty array" -[#18]: https://github.com/jprichardson/node-fs-extra/pull/18 "Exposed copyFile Function" -[#17]: https://github.com/jprichardson/node-fs-extra/issues/17 "Use `require("graceful-fs")` if found instead of `require("fs")`" -[#16]: https://github.com/jprichardson/node-fs-extra/pull/16 "Update README.md" -[#15]: https://github.com/jprichardson/node-fs-extra/issues/15 "Implement cp -r but sync aka copySync. [enhancement]" -[#14]: https://github.com/jprichardson/node-fs-extra/issues/14 "fs.mkdirSync is broken in 0.3.1" -[#13]: https://github.com/jprichardson/node-fs-extra/issues/13 "Thoughts on including a directory tree / file watcher? [enhancement, question]" -[#12]: https://github.com/jprichardson/node-fs-extra/issues/12 "copyFile & copyFileSync are global" -[#11]: https://github.com/jprichardson/node-fs-extra/issues/11 "Thoughts on including a file walker? [enhancement, question]" -[#10]: https://github.com/jprichardson/node-fs-extra/issues/10 "move / moveFile API [enhancement]" -[#9]: https://github.com/jprichardson/node-fs-extra/issues/9 "don't import normal fs stuff into fs-extra" -[#8]: https://github.com/jprichardson/node-fs-extra/pull/8 "Update rimraf to latest version" -[#6]: https://github.com/jprichardson/node-fs-extra/issues/6 "Remove CoffeeScript development dependency" -[#5]: https://github.com/jprichardson/node-fs-extra/issues/5 "comments on naming" -[#4]: https://github.com/jprichardson/node-fs-extra/issues/4 "version bump to 0.2" -[#3]: https://github.com/jprichardson/node-fs-extra/pull/3 "Hi! I fixed some code for you!" -[#2]: https://github.com/jprichardson/node-fs-extra/issues/2 "Merge with fs.extra and mkdirp" -[#1]: https://github.com/jprichardson/node-fs-extra/issues/1 "file-extra npm !exist" diff --git a/plugins/music_service/squeezelite/node_modules/fs-extra/LICENSE b/plugins/music_service/squeezelite/node_modules/fs-extra/LICENSE deleted file mode 100644 index f109d236b..000000000 --- a/plugins/music_service/squeezelite/node_modules/fs-extra/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -(The MIT License) - -Copyright (c) 2011-2016 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/plugins/music_service/squeezelite/node_modules/fs-extra/README.md b/plugins/music_service/squeezelite/node_modules/fs-extra/README.md deleted file mode 100644 index 1d156ae57..000000000 --- a/plugins/music_service/squeezelite/node_modules/fs-extra/README.md +++ /dev/null @@ -1,592 +0,0 @@ -Node.js: fs-extra -================= - -`fs-extra` adds file system methods that aren't included in the native `fs` module. It is a drop in replacement for `fs`. - -[![npm Package](https://img.shields.io/npm/v/fs-extra.svg?style=flat-square)](https://www.npmjs.org/package/fs-extra) -[![build status](https://api.travis-ci.org/jprichardson/node-fs-extra.svg)](http://travis-ci.org/jprichardson/node-fs-extra) -[![windows Build status](https://img.shields.io/appveyor/ci/jprichardson/node-fs-extra/master.svg?label=windows%20build)](https://ci.appveyor.com/project/jprichardson/node-fs-extra/branch/master) -[![downloads per month](http://img.shields.io/npm/dm/fs-extra.svg)](https://www.npmjs.org/package/fs-extra) -[![Coverage Status](https://img.shields.io/coveralls/jprichardson/node-fs-extra.svg)](https://coveralls.io/r/jprichardson/node-fs-extra) - -Standard JavaScript - -**NOTE ~~(2016-01-13)~~(2016-04-16):** Node v0.10 (and possibly v0.12) will be unsupported AFTER Ubuntu LTS releases their next version ~~AND [Amazon Lambda -upgrades](http://docs.aws.amazon.com/lambda/latest/dg/current-supported-versions.html) its Node.js runtime from v0.10~~ (see: https://aws.amazon.com/blogs/compute/node-js-4-3-2-runtime-now-available-on-lambda/). -I anticipate this will happen around late spring / summer 2016. Please prepare accordingly. After this, we'll make a strong push -for a 1.0.0 release. - - -Why? ----- - -I got tired of including `mkdirp`, `rimraf`, and `ncp` in most of my projects. - - - - -Installation ------------- - - npm install --save fs-extra - - - -Usage ------ - -`fs-extra` is a drop in replacement for native `fs`. All methods in `fs` are unmodified and attached to `fs-extra`. - -You don't ever need to include the original `fs` module again: - -```js -var fs = require('fs') // this is no longer necessary -``` - -you can now do this: - -```js -var fs = require('fs-extra') -``` - -or if you prefer to make it clear that you're using `fs-extra` and not `fs`, you may want -to name your `fs` variable `fse` like so: - -```js -var fse = require('fs-extra') -``` - -you can also keep both, but it's redundant: - -```js -var fs = require('fs') -var fse = require('fs-extra') -``` - -Sync vs Async -------------- -Most methods are async by default (they take a callback with an `Error` as first argument). - -Sync methods on the other hand will throw if an error occurs. - -Example: - -```js -var fs = require('fs-extra') - -fs.copy('/tmp/myfile', '/tmp/mynewfile', function (err) { - if (err) return console.error(err) - console.log("success!") -}); - -try { - fs.copySync('/tmp/myfile', '/tmp/mynewfile') - console.log("success!") -} catch (err) { - console.error(err) -} -``` - - -Methods -------- -- [copy](#copy) -- [copySync](#copy) -- [createOutputStream](#createoutputstreamfile-options) -- [emptyDir](#emptydirdir-callback) -- [emptyDirSync](#emptydirdir-callback) -- [ensureFile](#ensurefilefile-callback) -- [ensureFileSync](#ensurefilefile-callback) -- [ensureDir](#ensuredirdir-callback) -- [ensureDirSync](#ensuredirdir-callback) -- [ensureLink](#ensurelinksrcpath-dstpath-callback) -- [ensureLinkSync](#ensurelinksrcpath-dstpath-callback) -- [ensureSymlink](#ensuresymlinksrcpath-dstpath-type-callback) -- [ensureSymlinkSync](#ensuresymlinksrcpath-dstpath-type-callback) -- [mkdirs](#mkdirsdir-callback) -- [mkdirsSync](#mkdirsdir-callback) -- [move](#movesrc-dest-options-callback) -- [outputFile](#outputfilefile-data-options-callback) -- [outputFileSync](#outputfilefile-data-options-callback) -- [outputJson](#outputjsonfile-data-options-callback) -- [outputJsonSync](#outputjsonfile-data-options-callback) -- [readJson](#readjsonfile-options-callback) -- [readJsonSync](#readjsonfile-options-callback) -- [remove](#removedir-callback) -- [removeSync](#removedir-callback) -- [walk](#walk) -- [writeJson](#writejsonfile-object-options-callback) -- [writeJsonSync](#writejsonfile-object-options-callback) - - -**NOTE:** You can still use the native Node.js methods. They are copied over to `fs-extra`. - - -### copy() - -**copy(src, dest, [options], callback)** - - -Copy a file or directory. The directory can have contents. Like `cp -r`. - -Options: -- clobber (boolean): overwrite existing file or directory -- dereference (boolean): dereference symlinks -- preserveTimestamps (boolean): will set last modification and access times to the ones of the original source files, default is `false`. -- filter: Function or RegExp to filter copied files. If function, return true to include, false to exclude. If RegExp, same as function, where `filter` is `filter.test`. - -Sync: `copySync()` - -Example: - -```js -var fs = require('fs-extra') - -fs.copy('/tmp/myfile', '/tmp/mynewfile', function (err) { - if (err) return console.error(err) - console.log("success!") -}) // copies file - -fs.copy('/tmp/mydir', '/tmp/mynewdir', function (err) { - if (err) return console.error(err) - console.log('success!') -}) // copies directory, even if it has subdirectories or files -``` - - -### emptyDir(dir, [callback]) - -Ensures that a directory is empty. Deletes directory contents if the directory is not empty. If the directory does not exist, it is created. The directory itself is not deleted. - -Alias: `emptydir()` - -Sync: `emptyDirSync()`, `emptydirSync()` - -Example: - -```js -var fs = require('fs-extra') - -// assume this directory has a lot of files and folders -fs.emptyDir('/tmp/some/dir', function (err) { - if (!err) console.log('success!') -}) -``` - - -### ensureFile(file, callback) - -Ensures that the file exists. 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**. - -Alias: `createFile()` - -Sync: `createFileSync()`,`ensureFileSync()` - - -Example: - -```js -var fs = require('fs-extra') - -var file = '/tmp/this/path/does/not/exist/file.txt' -fs.ensureFile(file, function (err) { - console.log(err) // => null - // file has now been created, including the directory it is to be placed in -}) -``` - - -### ensureDir(dir, callback) - -Ensures that the directory exists. If the directory structure does not exist, it is created. - -Sync: `ensureDirSync()` - - -Example: - -```js -var fs = require('fs-extra') - -var dir = '/tmp/this/path/does/not/exist' -fs.ensureDir(dir, function (err) { - console.log(err) // => null - // dir has now been created, including the directory it is to be placed in -}) -``` - - -### ensureLink(srcpath, dstpath, callback) - -Ensures that the link exists. If the directory structure does not exist, it is created. - -Sync: `ensureLinkSync()` - - -Example: - -```js -var fs = require('fs-extra') - -var srcpath = '/tmp/file.txt' -var dstpath = '/tmp/this/path/does/not/exist/file.txt' -fs.ensureLink(srcpath, dstpath, function (err) { - console.log(err) // => null - // link has now been created, including the directory it is to be placed in -}) -``` - - -### ensureSymlink(srcpath, dstpath, [type], callback) - -Ensures that the symlink exists. If the directory structure does not exist, it is created. - -Sync: `ensureSymlinkSync()` - - -Example: - -```js -var fs = require('fs-extra') - -var srcpath = '/tmp/file.txt' -var dstpath = '/tmp/this/path/does/not/exist/file.txt' -fs.ensureSymlink(srcpath, dstpath, function (err) { - console.log(err) // => null - // symlink has now been created, including the directory it is to be placed in -}) -``` - - -### 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: - -```js -var fs = require('fs-extra') - -fs.mkdirs('/tmp/some/long/path/that/prob/doesnt/exist', function (err) { - if (err) return console.error(err) - console.log("success!") -}) - -fs.mkdirsSync('/tmp/another/path') -``` - - -### move(src, dest, [options], callback) - -Moves a file or directory, even across devices. - -Options: -- clobber (boolean): overwrite existing file or directory -- limit (number): number of concurrent moves, see ncp for more information - -Example: - -```js -var fs = require('fs-extra') - -fs.move('/tmp/somefile', '/tmp/does/not/exist/yet/somefile', function (err) { - if (err) return console.error(err) - console.log("success!") -}) -``` - - -### outputFile(file, data, [options], callback) - -Almost the same as `writeFile` (i.e. it [overwrites](http://pages.citebite.com/v2o5n8l2f5reb)), except that if the parent directory does not exist, it's created. `options` are what you'd pass to [`fs.writeFile()`](https://nodejs.org/api/fs.html#fs_fs_writefile_file_data_options_callback). - -Sync: `outputFileSync()` - - -Example: - -```js -var fs = require('fs-extra') -var 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! - }) -}) -``` - - - -### outputJson(file, data, [options], callback) - -Almost the same as `writeJson`, except that if the directory does not exist, it's created. -`options` are what you'd pass to [`jsonFile.writeFile()`](https://github.com/jprichardson/node-jsonfile#writefilefilename-options-callback). - -Alias: `outputJSON()` - -Sync: `outputJsonSync()`, `outputJSONSync()` - - -Example: - -```js -var fs = require('fs-extra') -var file = '/tmp/this/path/does/not/exist/file.txt' - -fs.outputJson(file, {name: 'JP'}, function (err) { - console.log(err) // => null - - fs.readJson(file, function(err, data) { - console.log(data.name) // => JP - }) -}) -``` - - - -### readJson(file, [options], callback) - -Reads a JSON file and then parses it into an object. `options` are the same -that you'd pass to [`jsonFile.readFile`](https://github.com/jprichardson/node-jsonfile#readfilefilename-options-callback). - -Alias: `readJSON()` - -Sync: `readJsonSync()`, `readJSONSync()` - - -Example: - -```js -var fs = require('fs-extra') - -fs.readJson('./package.json', function (err, packageObj) { - console.log(packageObj.version) // => 0.1.3 -}) -``` - -`readJsonSync()` can take a `throws` option set to `false` and it won't throw if the JSON is invalid. Example: - -```js -var fs = require('fs-extra') -var file = path.join('/tmp/some-invalid.json') -var data = '{not valid JSON' -fs.writeFileSync(file, data) - -var obj = fs.readJsonSync(file, {throws: false}) -console.log(obj) // => null -``` - - -### remove(dir, callback) - -Removes a file or directory. The directory can have contents. Like `rm -rf`. - -Sync: `removeSync()` - - -Examples: - -```js -var fs = require('fs-extra') - -fs.remove('/tmp/myfile', function (err) { - if (err) return console.error(err) - - console.log('success!') -}) - -fs.removeSync('/home/jprichardson') //I just deleted my entire HOME directory. -``` - -### walk() - -**walk(dir, [streamOptions])** - -The function `walk()` from the module [`klaw`](https://github.com/jprichardson/node-klaw). - -Returns a [Readable stream](https://nodejs.org/api/stream.html#stream_class_stream_readable) that iterates -through every file and directory starting with `dir` as the root. Every `read()` or `data` event -returns an object with two properties: `path` and `stats`. `path` is the full path of the file and -`stats` is an instance of [fs.Stats](https://nodejs.org/api/fs.html#fs_class_fs_stats). - -Streams 1 (push) example: - -```js -var items = [] // files, directories, symlinks, etc -fse.walk(TEST_DIR) - .on('data', function (item) { - items.push(item.path) - }) - .on('end', function () { - console.dir(items) // => [ ... array of files] - }) -``` - -Streams 2 & 3 (pull) example: - -```js -var items = [] // files, directories, symlinks, etc -fse.walk(TEST_DIR) - .on('readable', function () { - var item - while ((item = this.read())) { - items.push(item.path) - } - }) - .on('end', function () { - console.dir(items) // => [ ... array of files] - }) -``` - -If you're not sure of the differences on Node.js streams 1, 2, 3 then I'd -recommend this resource as a good starting point: https://strongloop.com/strongblog/whats-new-io-js-beta-streams3/. - -**See [`klaw` documentation](https://github.com/jprichardson/node-klaw) for more detailed usage.** - - -### writeJson(file, object, [options], callback) - -Writes an object to a JSON file. `options` are the same that -you'd pass to [`jsonFile.writeFile()`](https://github.com/jprichardson/node-jsonfile#writefilefilename-options-callback). - -Alias: `writeJSON()` - -Sync: `writeJsonSync()`, `writeJSONSync()` - -Example: - -```js -var fs = require('fs-extra') -fs.writeJson('./package.json', {name: 'fs-extra'}, function (err) { - console.log(err) -}) -``` - - -Third Party ------------ - -### Promises - -Use [Bluebird](https://github.com/petkaantonov/bluebird). See https://github.com/petkaantonov/bluebird/blob/master/API.md#promisification. `fs-extra` is -explicitly listed as supported. - -```js -var Promise = require('bluebird') -var fs = Promise.promisifyAll(require('fs-extra')) -``` - -Or you can use the package [`fs-extra-promise`](https://github.com/overlookmotel/fs-extra-promise) that marries the two together. - - -### TypeScript - -If you like TypeScript, you can use `fs-extra` with it: https://github.com/borisyankov/DefinitelyTyped/tree/master/fs-extra - - -### File / Directory Watching - -If you want to watch for changes to files or directories, then you should use [chokidar](https://github.com/paulmillr/chokidar). - - -### Misc. - -- [mfs](https://github.com/cadorn/mfs) - Monitor your fs-extra calls. - - - -Hacking on fs-extra -------------------- - -Wanna hack on `fs-extra`? Great! Your help is needed! [fs-extra is one of the most depended upon Node.js packages](http://nodei.co/npm/fs-extra.png?downloads=true&downloadRank=true&stars=true). This project -uses [JavaScript Standard Style](https://github.com/feross/standard) - if the name or style choices bother you, -you're gonna have to get over it :) If `standard` is good enough for `npm`, it's good enough for `fs-extra`. - -[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard) - -What's needed? -- First, take a look at existing issues. Those are probably going to be where the priority lies. -- More tests for edge cases. Specifically on different platforms. There can never be enough tests. -- Improve test coverage. See coveralls output for more info. -- After the directory walker is integrated, any function that needs to traverse directories like -`copy`, `remove`, or `mkdirs` should be built on top of it. - -Note: If you make any big changes, **you should definitely file an issue for discussion first.** - -### Running the Test Suite - -fs-extra contains hundreds of tests. - -- `npm run lint`: runs the linter ([standard](http://standardjs.com/)) -- `npm run unit`: runs the unit tests -- `npm test`: runs both the linter and the tests - - -### Windows - -If you run the tests on the Windows and receive a lot of symbolic link `EPERM` permission errors, it's -because on Windows you need elevated privilege to create symbolic links. You can add this to your Windows's -account by following the instructions here: http://superuser.com/questions/104845/permission-to-make-symbolic-links-in-windows-7 -However, I didn't have much luck doing this. - -Since I develop on Mac OS X, I use VMWare Fusion for Windows testing. I create a shared folder that I map to a drive on Windows. -I open the `Node.js command prompt` and run as `Administrator`. I then map the network drive running the following command: - - net use z: "\\vmware-host\Shared Folders" - -I can then navigate to my `fs-extra` directory and run the tests. - - -Naming ------- - -I put a lot of thought into the naming of these functions. 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. A directory is just a hierarchical grouping of directories and files. Consider that for a moment. 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)`. 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)`. - - -Credit ------- - -`fs-extra` wouldn't be possible without using the modules from the following authors: - -- [Isaac Shlueter](https://github.com/isaacs) -- [Charlie McConnel](https://github.com/avianflu) -- [James Halliday](https://github.com/substack) -- [Andrew Kelley](https://github.com/andrewrk) - - - - -License -------- - -Licensed under MIT - -Copyright (c) 2011-2016 [JP Richardson](https://github.com/jprichardson) - -[1]: http://nodejs.org/docs/latest/api/fs.html - - -[jsonfile]: https://github.com/jprichardson/node-jsonfile diff --git a/plugins/music_service/squeezelite/node_modules/fs-extra/lib/copy-sync/copy-file-sync.js b/plugins/music_service/squeezelite/node_modules/fs-extra/lib/copy-sync/copy-file-sync.js deleted file mode 100644 index c6c571182..000000000 --- a/plugins/music_service/squeezelite/node_modules/fs-extra/lib/copy-sync/copy-file-sync.js +++ /dev/null @@ -1,39 +0,0 @@ -var fs = require('graceful-fs') - -var BUF_LENGTH = 64 * 1024 -var _buff = new Buffer(BUF_LENGTH) - -function copyFileSync (srcFile, destFile, options) { - var clobber = options.clobber - var preserveTimestamps = options.preserveTimestamps - - if (fs.existsSync(destFile)) { - if (clobber) { - fs.chmodSync(destFile, parseInt('777', 8)) - fs.unlinkSync(destFile) - } else { - throw Error('EEXIST') - } - } - - var fdr = fs.openSync(srcFile, 'r') - var stat = fs.fstatSync(fdr) - var fdw = fs.openSync(destFile, 'w', stat.mode) - var bytesRead = 1 - var pos = 0 - - while (bytesRead > 0) { - bytesRead = fs.readSync(fdr, _buff, 0, BUF_LENGTH, pos) - fs.writeSync(fdw, _buff, 0, bytesRead) - pos += bytesRead - } - - if (preserveTimestamps) { - fs.futimesSync(fdw, stat.atime, stat.mtime) - } - - fs.closeSync(fdr) - fs.closeSync(fdw) -} - -module.exports = copyFileSync diff --git a/plugins/music_service/squeezelite/node_modules/fs-extra/lib/copy-sync/copy-sync.js b/plugins/music_service/squeezelite/node_modules/fs-extra/lib/copy-sync/copy-sync.js deleted file mode 100644 index 8168deeec..000000000 --- a/plugins/music_service/squeezelite/node_modules/fs-extra/lib/copy-sync/copy-sync.js +++ /dev/null @@ -1,48 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') -var copyFileSync = require('./copy-file-sync') -var mkdir = require('../mkdirs') - -function copySync (src, dest, options) { - if (typeof options === 'function' || options instanceof RegExp) { - options = {filter: options} - } - - options = options || {} - options.recursive = !!options.recursive - - // default to true for now - options.clobber = 'clobber' in options ? !!options.clobber : true - options.dereference = 'dereference' in options ? !!options.dereference : false - options.preserveTimestamps = 'preserveTimestamps' in options ? !!options.preserveTimestamps : false - - options.filter = options.filter || function () { return true } - - var stats = (options.recursive && !options.dereference) ? fs.lstatSync(src) : fs.statSync(src) - var destFolder = path.dirname(dest) - var destFolderExists = fs.existsSync(destFolder) - var performCopy = false - - if (stats.isFile()) { - if (options.filter instanceof RegExp) performCopy = options.filter.test(src) - else if (typeof options.filter === 'function') performCopy = options.filter(src) - - if (performCopy) { - if (!destFolderExists) mkdir.mkdirsSync(destFolder) - copyFileSync(src, dest, {clobber: options.clobber, preserveTimestamps: options.preserveTimestamps}) - } - } else if (stats.isDirectory()) { - if (!fs.existsSync(dest)) mkdir.mkdirsSync(dest) - var contents = fs.readdirSync(src) - contents.forEach(function (content) { - var opts = options - opts.recursive = true - copySync(path.join(src, content), path.join(dest, content), opts) - }) - } else if (options.recursive && stats.isSymbolicLink()) { - var srcPath = fs.readlinkSync(src) - fs.symlinkSync(srcPath, dest) - } -} - -module.exports = copySync diff --git a/plugins/music_service/squeezelite/node_modules/fs-extra/lib/copy-sync/index.js b/plugins/music_service/squeezelite/node_modules/fs-extra/lib/copy-sync/index.js deleted file mode 100644 index ebc7e0b91..000000000 --- a/plugins/music_service/squeezelite/node_modules/fs-extra/lib/copy-sync/index.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - copySync: require('./copy-sync') -} diff --git a/plugins/music_service/squeezelite/node_modules/fs-extra/lib/copy/copy.js b/plugins/music_service/squeezelite/node_modules/fs-extra/lib/copy/copy.js deleted file mode 100644 index d9d291213..000000000 --- a/plugins/music_service/squeezelite/node_modules/fs-extra/lib/copy/copy.js +++ /dev/null @@ -1,44 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') -var ncp = require('./ncp') -var mkdir = require('../mkdirs') - -function copy (src, dest, options, callback) { - if (typeof options === 'function' && !callback) { - callback = options - options = {} - } else if (typeof options === 'function' || options instanceof RegExp) { - options = {filter: options} - } - callback = callback || function () {} - options = options || {} - - // don't allow src and dest to be the same - var basePath = process.cwd() - var currentPath = path.resolve(basePath, src) - var targetPath = path.resolve(basePath, dest) - if (currentPath === targetPath) return callback(new Error('Source and destination must not be the same.')) - - fs.lstat(src, function (err, stats) { - if (err) return callback(err) - - var dir = null - if (stats.isDirectory()) { - var parts = dest.split(path.sep) - parts.pop() - dir = parts.join(path.sep) - } else { - dir = path.dirname(dest) - } - - fs.exists(dir, function (dirExists) { - if (dirExists) return ncp(src, dest, options, callback) - mkdir.mkdirs(dir, function (err) { - if (err) return callback(err) - ncp(src, dest, options, callback) - }) - }) - }) -} - -module.exports = copy diff --git a/plugins/music_service/squeezelite/node_modules/fs-extra/lib/copy/index.js b/plugins/music_service/squeezelite/node_modules/fs-extra/lib/copy/index.js deleted file mode 100644 index 3e0901616..000000000 --- a/plugins/music_service/squeezelite/node_modules/fs-extra/lib/copy/index.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - copy: require('./copy') -} diff --git a/plugins/music_service/squeezelite/node_modules/fs-extra/lib/copy/ncp.js b/plugins/music_service/squeezelite/node_modules/fs-extra/lib/copy/ncp.js deleted file mode 100644 index d30cae579..000000000 --- a/plugins/music_service/squeezelite/node_modules/fs-extra/lib/copy/ncp.js +++ /dev/null @@ -1,243 +0,0 @@ -// imported from ncp (this is temporary, will rewrite) - -var fs = require('graceful-fs') -var path = require('path') -var utimes = require('../util/utimes') - -function ncp (source, dest, options, callback) { - if (!callback) { - callback = options - options = {} - } - - var basePath = process.cwd() - var currentPath = path.resolve(basePath, source) - var targetPath = path.resolve(basePath, dest) - - var filter = options.filter - var transform = options.transform - var clobber = options.clobber !== false - var dereference = options.dereference - var preserveTimestamps = options.preserveTimestamps === true - - var errs = null - - var started = 0 - var finished = 0 - var running = 0 - // this is pretty useless now that we're using graceful-fs - // consider removing - var limit = options.limit || 512 - - startCopy(currentPath) - - function startCopy (source) { - started++ - if (filter) { - if (filter instanceof RegExp) { - if (!filter.test(source)) { - return doneOne(true) - } - } else if (typeof filter === 'function') { - if (!filter(source)) { - return doneOne(true) - } - } - } - return getStats(source) - } - - function getStats (source) { - var stat = dereference ? fs.stat : fs.lstat - if (running >= limit) { - return setImmediate(function () { - getStats(source) - }) - } - running++ - stat(source, function (err, stats) { - if (err) return onError(err) - - // We need to get the mode from the stats object and preserve it. - var item = { - name: source, - mode: stats.mode, - mtime: stats.mtime, // modified time - atime: stats.atime, // access time - stats: stats // temporary - } - - if (stats.isDirectory()) { - return onDir(item) - } else if (stats.isFile() || stats.isCharacterDevice() || stats.isBlockDevice()) { - 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) { - copyFile(file, target) - } else { - if (clobber) { - rmFile(target, function () { - copyFile(file, target) - }) - } else { - doneOne() - } - } - }) - } - - function copyFile (file, target) { - var readStream = fs.createReadStream(file.name) - var writeStream = fs.createWriteStream(target, { mode: file.mode }) - - readStream.on('error', onError) - writeStream.on('error', onError) - - if (transform) { - transform(readStream, writeStream, file) - } else { - writeStream.on('open', function () { - readStream.pipe(writeStream) - }) - } - - writeStream.once('finish', function () { - fs.chmod(target, file.mode, function (err) { - if (err) return onError(err) - if (preserveTimestamps) { - utimes.utimesMillis(target, file.atime, file.mtime, function (err) { - if (err) return onError(err) - return doneOne() - }) - } else { - doneOne() - } - }) - }) - } - - 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) - // despite setting mode in fs.mkdir, doesn't seem to work - // so we set it here. - fs.chmod(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(path.join(dir, item)) - }) - return doneOne() - }) - } - - 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) { - if (dereference) { - resolvedPath = path.resolve(basePath, resolvedPath) - } - isWritable(target, function (writable) { - if (writable) { - return makeLink(resolvedPath, target) - } - fs.readlink(target, function (err, targetDest) { - if (err) return onError(err) - - if (dereference) { - targetDest = path.resolve(basePath, targetDest) - } - if (targetDest === resolvedPath) { - return doneOne() - } - return rmFile(target, function () { - makeLink(resolvedPath, target) - }) - }) - }) - } - - function makeLink (linkPath, target) { - fs.symlink(linkPath, target, function (err) { - if (err) return onError(err) - return doneOne() - }) - } - - function isWritable (path, done) { - fs.lstat(path, function (err) { - 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 = [] - } - if (typeof errs.write === 'undefined') { - errs.push(err) - } else { - errs.write(err.stack + '\n\n') - } - return doneOne() - } - - function doneOne (skipped) { - if (!skipped) running-- - finished++ - if ((started === finished) && (running === 0)) { - if (callback !== undefined) { - return errs ? callback(errs) : callback(null) - } - } - } -} - -module.exports = ncp diff --git a/plugins/music_service/squeezelite/node_modules/fs-extra/lib/empty/index.js b/plugins/music_service/squeezelite/node_modules/fs-extra/lib/empty/index.js deleted file mode 100644 index a17cbae1c..000000000 --- a/plugins/music_service/squeezelite/node_modules/fs-extra/lib/empty/index.js +++ /dev/null @@ -1,47 +0,0 @@ -var fs = require('fs') -var path = require('path') -var mkdir = require('../mkdirs') -var remove = require('../remove') - -function emptyDir (dir, callback) { - callback = callback || function () {} - fs.readdir(dir, function (err, items) { - if (err) return mkdir.mkdirs(dir, callback) - - items = items.map(function (item) { - return path.join(dir, item) - }) - - deleteItem() - - function deleteItem () { - var item = items.pop() - if (!item) return callback() - remove.remove(item, function (err) { - if (err) return callback(err) - deleteItem() - }) - } - }) -} - -function emptyDirSync (dir) { - var items - try { - items = fs.readdirSync(dir) - } catch (err) { - return mkdir.mkdirsSync(dir) - } - - items.forEach(function (item) { - item = path.join(dir, item) - remove.removeSync(item) - }) -} - -module.exports = { - emptyDirSync: emptyDirSync, - emptydirSync: emptyDirSync, - emptyDir: emptyDir, - emptydir: emptyDir -} diff --git a/plugins/music_service/squeezelite/node_modules/fs-extra/lib/ensure/file.js b/plugins/music_service/squeezelite/node_modules/fs-extra/lib/ensure/file.js deleted file mode 100644 index 1c9c2de04..000000000 --- a/plugins/music_service/squeezelite/node_modules/fs-extra/lib/ensure/file.js +++ /dev/null @@ -1,43 +0,0 @@ -var path = require('path') -var fs = require('graceful-fs') -var mkdir = require('../mkdirs') - -function createFile (file, callback) { - function makeFile () { - fs.writeFile(file, '', function (err) { - if (err) return callback(err) - callback() - }) - } - - fs.exists(file, function (fileExists) { - if (fileExists) return callback() - var dir = path.dirname(file) - fs.exists(dir, function (dirExists) { - if (dirExists) return makeFile() - mkdir.mkdirs(dir, function (err) { - if (err) return callback(err) - makeFile() - }) - }) - }) -} - -function createFileSync (file) { - if (fs.existsSync(file)) return - - var dir = path.dirname(file) - if (!fs.existsSync(dir)) { - mkdir.mkdirsSync(dir) - } - - fs.writeFileSync(file, '') -} - -module.exports = { - createFile: createFile, - createFileSync: createFileSync, - // alias - ensureFile: createFile, - ensureFileSync: createFileSync -} diff --git a/plugins/music_service/squeezelite/node_modules/fs-extra/lib/ensure/index.js b/plugins/music_service/squeezelite/node_modules/fs-extra/lib/ensure/index.js deleted file mode 100644 index 26e8705a2..000000000 --- a/plugins/music_service/squeezelite/node_modules/fs-extra/lib/ensure/index.js +++ /dev/null @@ -1,21 +0,0 @@ -var file = require('./file') -var link = require('./link') -var symlink = require('./symlink') - -module.exports = { - // file - createFile: file.createFile, - createFileSync: file.createFileSync, - ensureFile: file.createFile, - ensureFileSync: file.createFileSync, - // link - createLink: link.createLink, - createLinkSync: link.createLinkSync, - ensureLink: link.createLink, - ensureLinkSync: link.createLinkSync, - // symlink - createSymlink: symlink.createSymlink, - createSymlinkSync: symlink.createSymlinkSync, - ensureSymlink: symlink.createSymlink, - ensureSymlinkSync: symlink.createSymlinkSync -} diff --git a/plugins/music_service/squeezelite/node_modules/fs-extra/lib/ensure/link.js b/plugins/music_service/squeezelite/node_modules/fs-extra/lib/ensure/link.js deleted file mode 100644 index 4e4e2833e..000000000 --- a/plugins/music_service/squeezelite/node_modules/fs-extra/lib/ensure/link.js +++ /dev/null @@ -1,58 +0,0 @@ -var path = require('path') -var fs = require('graceful-fs') -var mkdir = require('../mkdirs') - -function createLink (srcpath, dstpath, callback) { - function makeLink (srcpath, dstpath) { - fs.link(srcpath, dstpath, function (err) { - if (err) return callback(err) - callback(null) - }) - } - - fs.exists(dstpath, function (destinationExists) { - if (destinationExists) return callback(null) - fs.lstat(srcpath, function (err, stat) { - if (err) { - err.message = err.message.replace('lstat', 'ensureLink') - return callback(err) - } - - var dir = path.dirname(dstpath) - fs.exists(dir, function (dirExists) { - if (dirExists) return makeLink(srcpath, dstpath) - mkdir.mkdirs(dir, function (err) { - if (err) return callback(err) - makeLink(srcpath, dstpath) - }) - }) - }) - }) -} - -function createLinkSync (srcpath, dstpath, callback) { - var destinationExists = fs.existsSync(dstpath) - if (destinationExists) return undefined - - try { - fs.lstatSync(srcpath) - } catch (err) { - err.message = err.message.replace('lstat', 'ensureLink') - throw err - } - - var dir = path.dirname(dstpath) - var dirExists = fs.existsSync(dir) - if (dirExists) return fs.linkSync(srcpath, dstpath) - mkdir.mkdirsSync(dir) - - return fs.linkSync(srcpath, dstpath) -} - -module.exports = { - createLink: createLink, - createLinkSync: createLinkSync, - // alias - ensureLink: createLink, - ensureLinkSync: createLinkSync -} diff --git a/plugins/music_service/squeezelite/node_modules/fs-extra/lib/ensure/symlink-paths.js b/plugins/music_service/squeezelite/node_modules/fs-extra/lib/ensure/symlink-paths.js deleted file mode 100644 index cc27d040c..000000000 --- a/plugins/music_service/squeezelite/node_modules/fs-extra/lib/ensure/symlink-paths.js +++ /dev/null @@ -1,97 +0,0 @@ -var path = require('path') -// path.isAbsolute shim for Node.js 0.10 support -path.isAbsolute = (path.isAbsolute) ? path.isAbsolute : require('path-is-absolute') -var fs = require('graceful-fs') - -/** - * Function that returns two types of paths, one relative to symlink, and one - * relative to the current working directory. Checks if path is absolute or - * relative. If the path is relative, this function checks if the path is - * relative to symlink or relative to current working directory. This is an - * initiative to find a smarter `srcpath` to supply when building symlinks. - * This allows you to determine which path to use out of one of three possible - * types of source paths. The first is an absolute path. This is detected by - * `path.isAbsolute()`. When an absolute path is provided, it is checked to - * see if it exists. If it does it's used, if not an error is returned - * (callback)/ thrown (sync). The other two options for `srcpath` are a - * relative url. By default Node's `fs.symlink` works by creating a symlink - * using `dstpath` and expects the `srcpath` to be relative to the newly - * created symlink. If you provide a `srcpath` that does not exist on the file - * system it results in a broken symlink. To minimize this, the function - * checks to see if the 'relative to symlink' source file exists, and if it - * does it will use it. If it does not, it checks if there's a file that - * exists that is relative to the current working directory, if does its used. - * This preserves the expectations of the original fs.symlink spec and adds - * the ability to pass in `relative to current working direcotry` paths. - */ - -function symlinkPaths (srcpath, dstpath, callback) { - if (path.isAbsolute(srcpath)) { - return fs.lstat(srcpath, function (err, stat) { - if (err) { - err.message = err.message.replace('lstat', 'ensureSymlink') - return callback(err) - } - return callback(null, { - 'toCwd': srcpath, - 'toDst': srcpath - }) - }) - } else { - var dstdir = path.dirname(dstpath) - var relativeToDst = path.join(dstdir, srcpath) - return fs.exists(relativeToDst, function (exists) { - if (exists) { - return callback(null, { - 'toCwd': relativeToDst, - 'toDst': srcpath - }) - } else { - return fs.lstat(srcpath, function (err, stat) { - if (err) { - err.message = err.message.replace('lstat', 'ensureSymlink') - return callback(err) - } - return callback(null, { - 'toCwd': srcpath, - 'toDst': path.relative(dstdir, srcpath) - }) - }) - } - }) - } -} - -function symlinkPathsSync (srcpath, dstpath) { - var exists - if (path.isAbsolute(srcpath)) { - exists = fs.existsSync(srcpath) - if (!exists) throw new Error('absolute srcpath does not exist') - return { - 'toCwd': srcpath, - 'toDst': srcpath - } - } else { - var dstdir = path.dirname(dstpath) - var relativeToDst = path.join(dstdir, srcpath) - exists = fs.existsSync(relativeToDst) - if (exists) { - return { - 'toCwd': relativeToDst, - 'toDst': srcpath - } - } else { - exists = fs.existsSync(srcpath) - if (!exists) throw new Error('relative srcpath does not exist') - return { - 'toCwd': srcpath, - 'toDst': path.relative(dstdir, srcpath) - } - } - } -} - -module.exports = { - 'symlinkPaths': symlinkPaths, - 'symlinkPathsSync': symlinkPathsSync -} diff --git a/plugins/music_service/squeezelite/node_modules/fs-extra/lib/ensure/symlink-type.js b/plugins/music_service/squeezelite/node_modules/fs-extra/lib/ensure/symlink-type.js deleted file mode 100644 index 81e35884d..000000000 --- a/plugins/music_service/squeezelite/node_modules/fs-extra/lib/ensure/symlink-type.js +++ /dev/null @@ -1,27 +0,0 @@ -var fs = require('graceful-fs') - -function symlinkType (srcpath, type, callback) { - callback = (typeof type === 'function') ? type : callback - type = (typeof type === 'function') ? false : type - if (type) return callback(null, type) - fs.lstat(srcpath, function (err, stats) { - if (err) return callback(null, 'file') - type = (stats && stats.isDirectory()) ? 'dir' : 'file' - callback(null, type) - }) -} - -function symlinkTypeSync (srcpath, type) { - if (type) return type - try { - var stats = fs.lstatSync(srcpath) - } catch (e) { - return 'file' - } - return (stats && stats.isDirectory()) ? 'dir' : 'file' -} - -module.exports = { - symlinkType: symlinkType, - symlinkTypeSync: symlinkTypeSync -} diff --git a/plugins/music_service/squeezelite/node_modules/fs-extra/lib/ensure/symlink.js b/plugins/music_service/squeezelite/node_modules/fs-extra/lib/ensure/symlink.js deleted file mode 100644 index 62447906e..000000000 --- a/plugins/music_service/squeezelite/node_modules/fs-extra/lib/ensure/symlink.js +++ /dev/null @@ -1,62 +0,0 @@ -var path = require('path') -var fs = require('graceful-fs') -var _mkdirs = require('../mkdirs') -var mkdirs = _mkdirs.mkdirs -var mkdirsSync = _mkdirs.mkdirsSync - -var _symlinkPaths = require('./symlink-paths') -var symlinkPaths = _symlinkPaths.symlinkPaths -var symlinkPathsSync = _symlinkPaths.symlinkPathsSync - -var _symlinkType = require('./symlink-type') -var symlinkType = _symlinkType.symlinkType -var symlinkTypeSync = _symlinkType.symlinkTypeSync - -function createSymlink (srcpath, dstpath, type, callback) { - callback = (typeof type === 'function') ? type : callback - type = (typeof type === 'function') ? false : type - - fs.exists(dstpath, function (destinationExists) { - if (destinationExists) return callback(null) - symlinkPaths(srcpath, dstpath, function (err, relative) { - if (err) return callback(err) - srcpath = relative.toDst - symlinkType(relative.toCwd, type, function (err, type) { - if (err) return callback(err) - var dir = path.dirname(dstpath) - fs.exists(dir, function (dirExists) { - if (dirExists) return fs.symlink(srcpath, dstpath, type, callback) - mkdirs(dir, function (err) { - if (err) return callback(err) - fs.symlink(srcpath, dstpath, type, callback) - }) - }) - }) - }) - }) -} - -function createSymlinkSync (srcpath, dstpath, type, callback) { - callback = (typeof type === 'function') ? type : callback - type = (typeof type === 'function') ? false : type - - var destinationExists = fs.existsSync(dstpath) - if (destinationExists) return undefined - - var relative = symlinkPathsSync(srcpath, dstpath) - srcpath = relative.toDst - type = symlinkTypeSync(relative.toCwd, type) - var dir = path.dirname(dstpath) - var exists = fs.existsSync(dir) - if (exists) return fs.symlinkSync(srcpath, dstpath, type) - mkdirsSync(dir) - return fs.symlinkSync(srcpath, dstpath, type) -} - -module.exports = { - createSymlink: createSymlink, - createSymlinkSync: createSymlinkSync, - // alias - ensureSymlink: createSymlink, - ensureSymlinkSync: createSymlinkSync -} diff --git a/plugins/music_service/squeezelite/node_modules/fs-extra/lib/index.js b/plugins/music_service/squeezelite/node_modules/fs-extra/lib/index.js deleted file mode 100644 index a56bb0c6b..000000000 --- a/plugins/music_service/squeezelite/node_modules/fs-extra/lib/index.js +++ /dev/null @@ -1,37 +0,0 @@ -var assign = require('./util/assign') - -var fse = {} -var gfs = require('graceful-fs') - -// attach fs methods to fse -Object.keys(gfs).forEach(function (key) { - fse[key] = gfs[key] -}) - -var fs = fse - -assign(fs, require('./copy')) -assign(fs, require('./copy-sync')) -assign(fs, require('./mkdirs')) -assign(fs, require('./remove')) -assign(fs, require('./json')) -assign(fs, require('./move')) -assign(fs, require('./empty')) -assign(fs, require('./ensure')) -assign(fs, require('./output')) -assign(fs, require('./walk')) - -module.exports = fs - -// maintain backwards compatibility for awhile -var jsonfile = {} -Object.defineProperty(jsonfile, 'spaces', { - get: function () { - return fs.spaces // found in ./json - }, - set: function (val) { - fs.spaces = val - } -}) - -module.exports.jsonfile = jsonfile // so users of fs-extra can modify jsonFile.spaces diff --git a/plugins/music_service/squeezelite/node_modules/fs-extra/lib/json/index.js b/plugins/music_service/squeezelite/node_modules/fs-extra/lib/json/index.js deleted file mode 100644 index b13cf54e4..000000000 --- a/plugins/music_service/squeezelite/node_modules/fs-extra/lib/json/index.js +++ /dev/null @@ -1,9 +0,0 @@ -var jsonFile = require('./jsonfile') - -jsonFile.outputJsonSync = require('./output-json-sync') -jsonFile.outputJson = require('./output-json') -// aliases -jsonFile.outputJSONSync = require('./output-json-sync') -jsonFile.outputJSON = require('./output-json') - -module.exports = jsonFile diff --git a/plugins/music_service/squeezelite/node_modules/fs-extra/lib/json/jsonfile.js b/plugins/music_service/squeezelite/node_modules/fs-extra/lib/json/jsonfile.js deleted file mode 100644 index 51d839066..000000000 --- a/plugins/music_service/squeezelite/node_modules/fs-extra/lib/json/jsonfile.js +++ /dev/null @@ -1,14 +0,0 @@ -var jsonFile = require('jsonfile') - -module.exports = { - // jsonfile exports - readJson: jsonFile.readFile, - readJSON: jsonFile.readFile, - readJsonSync: jsonFile.readFileSync, - readJSONSync: jsonFile.readFileSync, - writeJson: jsonFile.writeFile, - writeJSON: jsonFile.writeFile, - writeJsonSync: jsonFile.writeFileSync, - writeJSONSync: jsonFile.writeFileSync, - spaces: 2 // default in fs-extra -} diff --git a/plugins/music_service/squeezelite/node_modules/fs-extra/lib/json/output-json-sync.js b/plugins/music_service/squeezelite/node_modules/fs-extra/lib/json/output-json-sync.js deleted file mode 100644 index 76848437e..000000000 --- a/plugins/music_service/squeezelite/node_modules/fs-extra/lib/json/output-json-sync.js +++ /dev/null @@ -1,16 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') -var jsonFile = require('./jsonfile') -var mkdir = require('../mkdirs') - -function outputJsonSync (file, data, options) { - var dir = path.dirname(file) - - if (!fs.existsSync(dir)) { - mkdir.mkdirsSync(dir) - } - - jsonFile.writeJsonSync(file, data, options) -} - -module.exports = outputJsonSync diff --git a/plugins/music_service/squeezelite/node_modules/fs-extra/lib/json/output-json.js b/plugins/music_service/squeezelite/node_modules/fs-extra/lib/json/output-json.js deleted file mode 100644 index 7824597be..000000000 --- a/plugins/music_service/squeezelite/node_modules/fs-extra/lib/json/output-json.js +++ /dev/null @@ -1,24 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') -var jsonFile = require('./jsonfile') -var mkdir = require('../mkdirs') - -function outputJson (file, data, options, callback) { - if (typeof options === 'function') { - callback = options - options = {} - } - - var dir = path.dirname(file) - - fs.exists(dir, function (itDoes) { - if (itDoes) return jsonFile.writeJson(file, data, options, callback) - - mkdir.mkdirs(dir, function (err) { - if (err) return callback(err) - jsonFile.writeJson(file, data, options, callback) - }) - }) -} - -module.exports = outputJson diff --git a/plugins/music_service/squeezelite/node_modules/fs-extra/lib/mkdirs/index.js b/plugins/music_service/squeezelite/node_modules/fs-extra/lib/mkdirs/index.js deleted file mode 100644 index 2611217c7..000000000 --- a/plugins/music_service/squeezelite/node_modules/fs-extra/lib/mkdirs/index.js +++ /dev/null @@ -1,9 +0,0 @@ -module.exports = { - mkdirs: require('./mkdirs'), - mkdirsSync: require('./mkdirs-sync'), - // alias - mkdirp: require('./mkdirs'), - mkdirpSync: require('./mkdirs-sync'), - ensureDir: require('./mkdirs'), - ensureDirSync: require('./mkdirs-sync') -} diff --git a/plugins/music_service/squeezelite/node_modules/fs-extra/lib/mkdirs/mkdirs-sync.js b/plugins/music_service/squeezelite/node_modules/fs-extra/lib/mkdirs/mkdirs-sync.js deleted file mode 100644 index 3f30680d9..000000000 --- a/plugins/music_service/squeezelite/node_modules/fs-extra/lib/mkdirs/mkdirs-sync.js +++ /dev/null @@ -1,57 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') -var invalidWin32Path = require('./win32').invalidWin32Path - -var o777 = parseInt('0777', 8) - -function mkdirsSync (p, opts, made) { - if (!opts || typeof opts !== 'object') { - opts = { mode: opts } - } - - var mode = opts.mode - var xfs = opts.fs || fs - - if (process.platform === 'win32' && invalidWin32Path(p)) { - var errInval = new Error(p + ' contains invalid WIN32 path characters.') - errInval.code = 'EINVAL' - throw errInval - } - - if (mode === undefined) { - mode = o777 & (~process.umask()) - } - if (!made) made = null - - p = path.resolve(p) - - try { - xfs.mkdirSync(p, mode) - made = made || p - } catch (err0) { - switch (err0.code) { - case 'ENOENT': - if (path.dirname(p) === p) throw err0 - made = mkdirsSync(path.dirname(p), opts, made) - mkdirsSync(p, opts, 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 = xfs.statSync(p) - } catch (err1) { - throw err0 - } - if (!stat.isDirectory()) throw err0 - break - } - } - - return made -} - -module.exports = mkdirsSync diff --git a/plugins/music_service/squeezelite/node_modules/fs-extra/lib/mkdirs/mkdirs.js b/plugins/music_service/squeezelite/node_modules/fs-extra/lib/mkdirs/mkdirs.js deleted file mode 100644 index 939776c4a..000000000 --- a/plugins/music_service/squeezelite/node_modules/fs-extra/lib/mkdirs/mkdirs.js +++ /dev/null @@ -1,61 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') -var invalidWin32Path = require('./win32').invalidWin32Path - -var o777 = parseInt('0777', 8) - -function mkdirs (p, opts, callback, made) { - if (typeof opts === 'function') { - callback = opts - opts = {} - } else if (!opts || typeof opts !== 'object') { - opts = { mode: opts } - } - - if (process.platform === 'win32' && invalidWin32Path(p)) { - var errInval = new Error(p + ' contains invalid WIN32 path characters.') - errInval.code = 'EINVAL' - return callback(errInval) - } - - var mode = opts.mode - var xfs = opts.fs || fs - - if (mode === undefined) { - mode = o777 & (~process.umask()) - } - if (!made) made = null - - callback = callback || function () {} - p = path.resolve(p) - - xfs.mkdir(p, mode, function (er) { - if (!er) { - made = made || p - return callback(null, made) - } - switch (er.code) { - case 'ENOENT': - if (path.dirname(p) === p) return callback(er) - mkdirs(path.dirname(p), opts, function (er, made) { - if (er) callback(er, made) - else mkdirs(p, opts, callback, 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: - xfs.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()) callback(er, made) - else callback(null, made) - }) - break - } - }) -} - -module.exports = mkdirs diff --git a/plugins/music_service/squeezelite/node_modules/fs-extra/lib/mkdirs/win32.js b/plugins/music_service/squeezelite/node_modules/fs-extra/lib/mkdirs/win32.js deleted file mode 100644 index 569ac1aed..000000000 --- a/plugins/music_service/squeezelite/node_modules/fs-extra/lib/mkdirs/win32.js +++ /dev/null @@ -1,24 +0,0 @@ -'use strict' -var path = require('path') - -// get drive on windows -function getRootPath (p) { - p = path.normalize(path.resolve(p)).split(path.sep) - if (p.length > 0) return p[0] - else return null -} - -// http://stackoverflow.com/a/62888/10333 contains more accurate -// TODO: expand to include the rest -var INVALID_PATH_CHARS = /[<>:"|?*]/ - -function invalidWin32Path (p) { - var rp = getRootPath(p) - p = p.replace(rp, '') - return INVALID_PATH_CHARS.test(p) -} - -module.exports = { - getRootPath: getRootPath, - invalidWin32Path: invalidWin32Path -} diff --git a/plugins/music_service/squeezelite/node_modules/fs-extra/lib/move/index.js b/plugins/music_service/squeezelite/node_modules/fs-extra/lib/move/index.js deleted file mode 100644 index f28152f1a..000000000 --- a/plugins/music_service/squeezelite/node_modules/fs-extra/lib/move/index.js +++ /dev/null @@ -1,161 +0,0 @@ -// most of this code was written by Andrew Kelley -// licensed under the BSD license: see -// https://github.com/andrewrk/node-mv/blob/master/package.json - -// this needs a cleanup - -var fs = require('graceful-fs') -var ncp = require('../copy/ncp') -var path = require('path') -var rimraf = require('rimraf') -var mkdirp = require('../mkdirs').mkdirs - -function mv (source, dest, options, callback) { - if (typeof options === 'function') { - callback = options - options = {} - } - - var shouldMkdirp = ('mkdirp' in options) ? options.mkdirp : true - var clobber = ('clobber' in options) ? options.clobber : false - - var limit = options.limit || 16 - - if (shouldMkdirp) { - mkdirs() - } else { - doRename() - } - - function mkdirs () { - mkdirp(path.dirname(dest), function (err) { - if (err) return callback(err) - doRename() - }) - } - - function doRename () { - if (clobber) { - fs.rename(source, dest, function (err) { - if (!err) return callback() - - if (err.code === 'ENOTEMPTY' || err.code === 'EEXIST') { - rimraf(dest, function (err) { - if (err) return callback(err) - options.clobber = false // just clobbered it, no need to do it again - mv(source, dest, options, callback) - }) - return - } - - // weird Windows shit - if (err.code === 'EPERM') { - setTimeout(function () { - rimraf(dest, function (err) { - if (err) return callback(err) - options.clobber = false - mv(source, dest, options, callback) - }) - }, 200) - return - } - - if (err.code !== 'EXDEV') return callback(err) - moveAcrossDevice(source, dest, clobber, limit, callback) - }) - } else { - fs.link(source, dest, function (err) { - if (err) { - if (err.code === 'EXDEV' || err.code === 'EISDIR' || err.code === 'EPERM') { - moveAcrossDevice(source, dest, clobber, limit, callback) - return - } - callback(err) - return - } - fs.unlink(source, callback) - }) - } - } -} - -function moveAcrossDevice (source, dest, clobber, limit, callback) { - fs.stat(source, function (err, stat) { - if (err) { - callback(err) - return - } - - if (stat.isDirectory()) { - moveDirAcrossDevice(source, dest, clobber, limit, callback) - } else { - moveFileAcrossDevice(source, dest, clobber, limit, callback) - } - }) -} - -function moveFileAcrossDevice (source, dest, clobber, limit, callback) { - var outFlags = clobber ? 'w' : 'wx' - var ins = fs.createReadStream(source) - var outs = fs.createWriteStream(dest, {flags: outFlags}) - - ins.on('error', function (err) { - ins.destroy() - outs.destroy() - outs.removeListener('close', onClose) - - // may want to create a directory but `out` line above - // creates an empty file for us: See #108 - // don't care about error here - fs.unlink(dest, function () { - // note: `err` here is from the input stream errror - if (err.code === 'EISDIR' || err.code === 'EPERM') { - moveDirAcrossDevice(source, dest, clobber, limit, callback) - } else { - callback(err) - } - }) - }) - - outs.on('error', function (err) { - ins.destroy() - outs.destroy() - outs.removeListener('close', onClose) - callback(err) - }) - - outs.once('close', onClose) - ins.pipe(outs) - - function onClose () { - fs.unlink(source, callback) - } -} - -function moveDirAcrossDevice (source, dest, clobber, limit, callback) { - var options = { - stopOnErr: true, - clobber: false, - limit: limit - } - - function startNcp () { - ncp(source, dest, options, function (errList) { - if (errList) return callback(errList[0]) - rimraf(source, callback) - }) - } - - if (clobber) { - rimraf(dest, function (err) { - if (err) return callback(err) - startNcp() - }) - } else { - startNcp() - } -} - -module.exports = { - move: mv -} diff --git a/plugins/music_service/squeezelite/node_modules/fs-extra/lib/output/index.js b/plugins/music_service/squeezelite/node_modules/fs-extra/lib/output/index.js deleted file mode 100644 index e8f45f3ff..000000000 --- a/plugins/music_service/squeezelite/node_modules/fs-extra/lib/output/index.js +++ /dev/null @@ -1,35 +0,0 @@ -var path = require('path') -var fs = require('graceful-fs') -var mkdir = require('../mkdirs') - -function outputFile (file, data, encoding, callback) { - if (typeof encoding === 'function') { - callback = encoding - encoding = 'utf8' - } - - var dir = path.dirname(file) - fs.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 (fs.existsSync(dir)) { - return fs.writeFileSync.apply(fs, arguments) - } - mkdir.mkdirsSync(dir) - fs.writeFileSync.apply(fs, arguments) -} - -module.exports = { - outputFile: outputFile, - outputFileSync: outputFileSync -} diff --git a/plugins/music_service/squeezelite/node_modules/fs-extra/lib/remove/index.js b/plugins/music_service/squeezelite/node_modules/fs-extra/lib/remove/index.js deleted file mode 100644 index 925de6774..000000000 --- a/plugins/music_service/squeezelite/node_modules/fs-extra/lib/remove/index.js +++ /dev/null @@ -1,14 +0,0 @@ -var rimraf = require('rimraf') - -function removeSync (dir) { - return rimraf.sync(dir) -} - -function remove (dir, callback) { - return callback ? rimraf(dir, callback) : rimraf(dir, function () {}) -} - -module.exports = { - remove: remove, - removeSync: removeSync -} diff --git a/plugins/music_service/squeezelite/node_modules/fs-extra/lib/util/assign.js b/plugins/music_service/squeezelite/node_modules/fs-extra/lib/util/assign.js deleted file mode 100644 index 8e41f9a09..000000000 --- a/plugins/music_service/squeezelite/node_modules/fs-extra/lib/util/assign.js +++ /dev/null @@ -1,14 +0,0 @@ -// simple mutable assign -function assign () { - var args = [].slice.call(arguments).filter(function (i) { return i }) - var dest = args.shift() - args.forEach(function (src) { - Object.keys(src).forEach(function (key) { - dest[key] = src[key] - }) - }) - - return dest -} - -module.exports = assign diff --git a/plugins/music_service/squeezelite/node_modules/fs-extra/lib/util/utimes.js b/plugins/music_service/squeezelite/node_modules/fs-extra/lib/util/utimes.js deleted file mode 100644 index c99b010b4..000000000 --- a/plugins/music_service/squeezelite/node_modules/fs-extra/lib/util/utimes.js +++ /dev/null @@ -1,69 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') -var os = require('os') - -// HFS, ext{2,3}, FAT do not, Node.js v0.10 does not -function hasMillisResSync () { - var tmpfile = path.join('millis-test-sync' + Date.now().toString() + Math.random().toString().slice(2)) - tmpfile = path.join(os.tmpdir(), tmpfile) - - // 550 millis past UNIX epoch - var d = new Date(1435410243862) - fs.writeFileSync(tmpfile, 'https://github.com/jprichardson/node-fs-extra/pull/141') - var fd = fs.openSync(tmpfile, 'r+') - fs.futimesSync(fd, d, d) - fs.closeSync(fd) - return fs.statSync(tmpfile).mtime > 1435410243000 -} - -function hasMillisRes (callback) { - var tmpfile = path.join('millis-test' + Date.now().toString() + Math.random().toString().slice(2)) - tmpfile = path.join(os.tmpdir(), tmpfile) - - // 550 millis past UNIX epoch - var d = new Date(1435410243862) - fs.writeFile(tmpfile, 'https://github.com/jprichardson/node-fs-extra/pull/141', function (err) { - if (err) return callback(err) - fs.open(tmpfile, 'r+', function (err, fd) { - if (err) return callback(err) - fs.futimes(fd, d, d, function (err) { - if (err) return callback(err) - fs.close(fd, function (err) { - if (err) return callback(err) - fs.stat(tmpfile, function (err, stats) { - if (err) return callback(err) - callback(null, stats.mtime > 1435410243000) - }) - }) - }) - }) - }) -} - -function timeRemoveMillis (timestamp) { - if (typeof timestamp === 'number') { - return Math.floor(timestamp / 1000) * 1000 - } else if (timestamp instanceof Date) { - return new Date(Math.floor(timestamp.getTime() / 1000) * 1000) - } else { - throw new Error('fs-extra: timeRemoveMillis() unknown parameter type') - } -} - -function utimesMillis (path, atime, mtime, callback) { - // if (!HAS_MILLIS_RES) return fs.utimes(path, atime, mtime, callback) - fs.open(path, 'r+', function (err, fd) { - if (err) return callback(err) - fs.futimes(fd, atime, mtime, function (err) { - if (err) return callback(err) - fs.close(fd, callback) - }) - }) -} - -module.exports = { - hasMillisRes: hasMillisRes, - hasMillisResSync: hasMillisResSync, - timeRemoveMillis: timeRemoveMillis, - utimesMillis: utimesMillis -} diff --git a/plugins/music_service/squeezelite/node_modules/fs-extra/lib/walk/index.js b/plugins/music_service/squeezelite/node_modules/fs-extra/lib/walk/index.js deleted file mode 100644 index 8626d4715..000000000 --- a/plugins/music_service/squeezelite/node_modules/fs-extra/lib/walk/index.js +++ /dev/null @@ -1,5 +0,0 @@ -var klaw = require('klaw') - -module.exports = { - walk: klaw -} diff --git a/plugins/music_service/squeezelite/node_modules/fs-extra/package.json b/plugins/music_service/squeezelite/node_modules/fs-extra/package.json deleted file mode 100644 index a4b90bcbe..000000000 --- a/plugins/music_service/squeezelite/node_modules/fs-extra/package.json +++ /dev/null @@ -1,127 +0,0 @@ -{ - "_args": [ - [ - { - "raw": "fs-extra@^0.28.0", - "scope": null, - "escapedName": "fs-extra", - "name": "fs-extra", - "rawSpec": "^0.28.0", - "spec": ">=0.28.0 <0.29.0", - "type": "range" - }, - "/home/volumio/volumio-plugins/plugins/music_service/squeezelite" - ] - ], - "_from": "fs-extra@>=0.28.0 <0.29.0", - "_id": "fs-extra@0.28.0", - "_inCache": true, - "_location": "/fs-extra", - "_nodeVersion": "5.3.0", - "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/fs-extra-0.28.0.tgz_1460972015862_0.6231312344316393" - }, - "_npmUser": { - "name": "jprichardson", - "email": "jprichardson@gmail.com" - }, - "_npmVersion": "3.8.2", - "_phantomChildren": {}, - "_requested": { - "raw": "fs-extra@^0.28.0", - "scope": null, - "escapedName": "fs-extra", - "name": "fs-extra", - "rawSpec": "^0.28.0", - "spec": ">=0.28.0 <0.29.0", - "type": "range" - }, - "_requiredBy": [ - "/" - ], - "_resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.28.0.tgz", - "_shasum": "9a1c0708ea8c5169297ab06fd8cb914f5647b272", - "_shrinkwrap": null, - "_spec": "fs-extra@^0.28.0", - "_where": "/home/volumio/volumio-plugins/plugins/music_service/squeezelite", - "author": { - "name": "JP Richardson", - "email": "jprichardson@gmail.com" - }, - "bugs": { - "url": "https://github.com/jprichardson/node-fs-extra/issues" - }, - "dependencies": { - "graceful-fs": "^4.1.2", - "jsonfile": "^2.1.0", - "klaw": "^1.0.0", - "path-is-absolute": "^1.0.0", - "rimraf": "^2.2.8" - }, - "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.", - "devDependencies": { - "coveralls": "^2.11.2", - "istanbul": "^0.3.5", - "minimist": "^1.1.1", - "mocha": "^2.1.0", - "read-dir-files": "^0.1.1", - "secure-random": "^1.1.1", - "semver": "^4.3.6", - "standard": "^5.3.1" - }, - "directories": {}, - "dist": { - "shasum": "9a1c0708ea8c5169297ab06fd8cb914f5647b272", - "tarball": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.28.0.tgz" - }, - "gitHead": "ef35b7006ab302e2c6d20977a1e822d323681c6a", - "homepage": "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", - "move" - ], - "license": "MIT", - "main": "./lib/index", - "maintainers": [ - { - "name": "jprichardson", - "email": "jprichardson@gmail.com" - } - ], - "name": "fs-extra", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/jprichardson/node-fs-extra.git" - }, - "scripts": { - "coverage": "istanbul cover test.js", - "coveralls": "npm run coverage && coveralls < coverage/lcov.info", - "lint": "standard", - "test": "npm run lint && npm run unit", - "test-find": "find ./lib/**/__tests__ -name *.test.js | xargs mocha", - "unit": "node test.js" - }, - "version": "0.28.0" -} diff --git a/plugins/music_service/squeezelite/node_modules/fs.realpath/LICENSE b/plugins/music_service/squeezelite/node_modules/fs.realpath/LICENSE deleted file mode 100644 index 5bd884c25..000000000 --- a/plugins/music_service/squeezelite/node_modules/fs.realpath/LICENSE +++ /dev/null @@ -1,43 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ----- - -This library bundles a version of the `fs.realpath` and `fs.realpathSync` -methods from Node.js v0.10 under the terms of the Node.js MIT license. - -Node's license follows, also included at the header of `old.js` which contains -the licensed code: - - Copyright Joyent, Inc. and other Node contributors. - - 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/plugins/music_service/squeezelite/node_modules/fs.realpath/README.md b/plugins/music_service/squeezelite/node_modules/fs.realpath/README.md deleted file mode 100644 index a42ceac62..000000000 --- a/plugins/music_service/squeezelite/node_modules/fs.realpath/README.md +++ /dev/null @@ -1,33 +0,0 @@ -# fs.realpath - -A backwards-compatible fs.realpath for Node v6 and above - -In Node v6, the JavaScript implementation of fs.realpath was replaced -with a faster (but less resilient) native implementation. That raises -new and platform-specific errors and cannot handle long or excessively -symlink-looping paths. - -This module handles those cases by detecting the new errors and -falling back to the JavaScript implementation. On versions of Node -prior to v6, it has no effect. - -## USAGE - -```js -var rp = require('fs.realpath') - -// async version -rp.realpath(someLongAndLoopingPath, function (er, real) { - // the ELOOP was handled, but it was a bit slower -}) - -// sync version -var real = rp.realpathSync(someLongAndLoopingPath) - -// monkeypatch at your own risk! -// This replaces the fs.realpath/fs.realpathSync builtins -rp.monkeypatch() - -// un-do the monkeypatching -rp.unmonkeypatch() -``` diff --git a/plugins/music_service/squeezelite/node_modules/fs.realpath/index.js b/plugins/music_service/squeezelite/node_modules/fs.realpath/index.js deleted file mode 100644 index b09c7c7e6..000000000 --- a/plugins/music_service/squeezelite/node_modules/fs.realpath/index.js +++ /dev/null @@ -1,66 +0,0 @@ -module.exports = realpath -realpath.realpath = realpath -realpath.sync = realpathSync -realpath.realpathSync = realpathSync -realpath.monkeypatch = monkeypatch -realpath.unmonkeypatch = unmonkeypatch - -var fs = require('fs') -var origRealpath = fs.realpath -var origRealpathSync = fs.realpathSync - -var version = process.version -var ok = /^v[0-5]\./.test(version) -var old = require('./old.js') - -function newError (er) { - return er && er.syscall === 'realpath' && ( - er.code === 'ELOOP' || - er.code === 'ENOMEM' || - er.code === 'ENAMETOOLONG' - ) -} - -function realpath (p, cache, cb) { - if (ok) { - return origRealpath(p, cache, cb) - } - - if (typeof cache === 'function') { - cb = cache - cache = null - } - origRealpath(p, cache, function (er, result) { - if (newError(er)) { - old.realpath(p, cache, cb) - } else { - cb(er, result) - } - }) -} - -function realpathSync (p, cache) { - if (ok) { - return origRealpathSync(p, cache) - } - - try { - return origRealpathSync(p, cache) - } catch (er) { - if (newError(er)) { - return old.realpathSync(p, cache) - } else { - throw er - } - } -} - -function monkeypatch () { - fs.realpath = realpath - fs.realpathSync = realpathSync -} - -function unmonkeypatch () { - fs.realpath = origRealpath - fs.realpathSync = origRealpathSync -} diff --git a/plugins/music_service/squeezelite/node_modules/fs.realpath/old.js b/plugins/music_service/squeezelite/node_modules/fs.realpath/old.js deleted file mode 100644 index b40305e73..000000000 --- a/plugins/music_service/squeezelite/node_modules/fs.realpath/old.js +++ /dev/null @@ -1,303 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// 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. - -var pathModule = require('path'); -var isWindows = process.platform === 'win32'; -var fs = require('fs'); - -// JavaScript implementation of realpath, ported from node pre-v6 - -var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG); - -function rethrow() { - // Only enable in debug mode. A backtrace uses ~1000 bytes of heap space and - // is fairly slow to generate. - var callback; - if (DEBUG) { - var backtrace = new Error; - callback = debugCallback; - } else - callback = missingCallback; - - return callback; - - function debugCallback(err) { - if (err) { - backtrace.message = err.message; - err = backtrace; - missingCallback(err); - } - } - - function missingCallback(err) { - if (err) { - if (process.throwDeprecation) - throw err; // Forgot a callback but don't know where? Use NODE_DEBUG=fs - else if (!process.noDeprecation) { - var msg = 'fs: missing callback ' + (err.stack || err.message); - if (process.traceDeprecation) - console.trace(msg); - else - console.error(msg); - } - } - } -} - -function maybeCallback(cb) { - return typeof cb === 'function' ? cb : rethrow(); -} - -var normalize = pathModule.normalize; - -// Regexp that finds the next partion of a (partial) path -// result is [base_with_slash, base], e.g. ['somedir/', 'somedir'] -if (isWindows) { - var nextPartRe = /(.*?)(?:[\/\\]+|$)/g; -} else { - var nextPartRe = /(.*?)(?:[\/]+|$)/g; -} - -// Regex to find the device root, including trailing slash. E.g. 'c:\\'. -if (isWindows) { - var splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/; -} else { - var splitRootRe = /^[\/]*/; -} - -exports.realpathSync = function realpathSync(p, cache) { - // make p is absolute - p = pathModule.resolve(p); - - if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { - return cache[p]; - } - - var original = p, - seenLinks = {}, - knownHard = {}; - - // current character position in p - var pos; - // the partial path so far, including a trailing slash if any - var current; - // the partial path without a trailing slash (except when pointing at a root) - var base; - // the partial path scanned in the previous round, with slash - var previous; - - start(); - - function start() { - // Skip over roots - var m = splitRootRe.exec(p); - pos = m[0].length; - current = m[0]; - base = m[0]; - previous = ''; - - // On windows, check that the root exists. On unix there is no need. - if (isWindows && !knownHard[base]) { - fs.lstatSync(base); - knownHard[base] = true; - } - } - - // walk down the path, swapping out linked pathparts for their real - // values - // NB: p.length changes. - while (pos < p.length) { - // find the next part - nextPartRe.lastIndex = pos; - var result = nextPartRe.exec(p); - previous = current; - current += result[0]; - base = previous + result[1]; - pos = nextPartRe.lastIndex; - - // continue if not a symlink - if (knownHard[base] || (cache && cache[base] === base)) { - continue; - } - - var resolvedLink; - if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { - // some known symbolic link. no need to stat again. - resolvedLink = cache[base]; - } else { - var stat = fs.lstatSync(base); - if (!stat.isSymbolicLink()) { - knownHard[base] = true; - if (cache) cache[base] = base; - continue; - } - - // read the link if it wasn't read before - // dev/ino always return 0 on windows, so skip the check. - var linkTarget = null; - if (!isWindows) { - var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); - if (seenLinks.hasOwnProperty(id)) { - linkTarget = seenLinks[id]; - } - } - if (linkTarget === null) { - fs.statSync(base); - linkTarget = fs.readlinkSync(base); - } - resolvedLink = pathModule.resolve(previous, linkTarget); - // track this, if given a cache. - if (cache) cache[base] = resolvedLink; - if (!isWindows) seenLinks[id] = linkTarget; - } - - // resolve the link, then start over - p = pathModule.resolve(resolvedLink, p.slice(pos)); - start(); - } - - if (cache) cache[original] = p; - - return p; -}; - - -exports.realpath = function realpath(p, cache, cb) { - if (typeof cb !== 'function') { - cb = maybeCallback(cache); - cache = null; - } - - // make p is absolute - p = pathModule.resolve(p); - - if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { - return process.nextTick(cb.bind(null, null, cache[p])); - } - - var original = p, - seenLinks = {}, - knownHard = {}; - - // current character position in p - var pos; - // the partial path so far, including a trailing slash if any - var current; - // the partial path without a trailing slash (except when pointing at a root) - var base; - // the partial path scanned in the previous round, with slash - var previous; - - start(); - - function start() { - // Skip over roots - var m = splitRootRe.exec(p); - pos = m[0].length; - current = m[0]; - base = m[0]; - previous = ''; - - // On windows, check that the root exists. On unix there is no need. - if (isWindows && !knownHard[base]) { - fs.lstat(base, function(err) { - if (err) return cb(err); - knownHard[base] = true; - LOOP(); - }); - } else { - process.nextTick(LOOP); - } - } - - // walk down the path, swapping out linked pathparts for their real - // values - function LOOP() { - // stop if scanned past end of path - if (pos >= p.length) { - if (cache) cache[original] = p; - return cb(null, p); - } - - // find the next part - nextPartRe.lastIndex = pos; - var result = nextPartRe.exec(p); - previous = current; - current += result[0]; - base = previous + result[1]; - pos = nextPartRe.lastIndex; - - // continue if not a symlink - if (knownHard[base] || (cache && cache[base] === base)) { - return process.nextTick(LOOP); - } - - if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { - // known symbolic link. no need to stat again. - return gotResolvedLink(cache[base]); - } - - return fs.lstat(base, gotStat); - } - - function gotStat(err, stat) { - if (err) return cb(err); - - // if not a symlink, skip to the next path part - if (!stat.isSymbolicLink()) { - knownHard[base] = true; - if (cache) cache[base] = base; - return process.nextTick(LOOP); - } - - // stat & read the link if not read before - // call gotTarget as soon as the link target is known - // dev/ino always return 0 on windows, so skip the check. - if (!isWindows) { - var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); - if (seenLinks.hasOwnProperty(id)) { - return gotTarget(null, seenLinks[id], base); - } - } - fs.stat(base, function(err) { - if (err) return cb(err); - - fs.readlink(base, function(err, target) { - if (!isWindows) seenLinks[id] = target; - gotTarget(err, target); - }); - }); - } - - function gotTarget(err, target, base) { - if (err) return cb(err); - - var resolvedLink = pathModule.resolve(previous, target); - if (cache) cache[base] = resolvedLink; - gotResolvedLink(resolvedLink); - } - - function gotResolvedLink(resolvedLink) { - // resolve the link, then start over - p = pathModule.resolve(resolvedLink, p.slice(pos)); - start(); - } -}; diff --git a/plugins/music_service/squeezelite/node_modules/fs.realpath/package.json b/plugins/music_service/squeezelite/node_modules/fs.realpath/package.json deleted file mode 100644 index 1493e80f5..000000000 --- a/plugins/music_service/squeezelite/node_modules/fs.realpath/package.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "_args": [ - [ - { - "raw": "fs.realpath@^1.0.0", - "scope": null, - "escapedName": "fs.realpath", - "name": "fs.realpath", - "rawSpec": "^1.0.0", - "spec": ">=1.0.0 <2.0.0", - "type": "range" - }, - "/home/volumio/volumio-plugins/plugins/music_service/squeezelite" - ] - ], - "_from": "fs.realpath@>=1.0.0 <2.0.0", - "_id": "fs.realpath@1.0.0", - "_inCache": true, - "_location": "/fs.realpath", - "_nodeVersion": "4.4.4", - "_npmOperationalInternal": { - "host": "packages-16-east.internal.npmjs.com", - "tmp": "tmp/fs.realpath-1.0.0.tgz_1466015941059_0.3332864767871797" - }, - "_npmUser": { - "name": "isaacs", - "email": "i@izs.me" - }, - "_npmVersion": "3.9.1", - "_phantomChildren": {}, - "_requested": { - "raw": "fs.realpath@^1.0.0", - "scope": null, - "escapedName": "fs.realpath", - "name": "fs.realpath", - "rawSpec": "^1.0.0", - "spec": ">=1.0.0 <2.0.0", - "type": "range" - }, - "_requiredBy": [ - "/", - "/glob" - ], - "_resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "_shasum": "1504ad2523158caa40db4a2787cb01411994ea4f", - "_shrinkwrap": null, - "_spec": "fs.realpath@^1.0.0", - "_where": "/home/volumio/volumio-plugins/plugins/music_service/squeezelite", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/isaacs/fs.realpath/issues" - }, - "dependencies": {}, - "description": "Use node's fs.realpath, but fall back to the JS implementation if the native one fails", - "devDependencies": {}, - "directories": {}, - "dist": { - "shasum": "1504ad2523158caa40db4a2787cb01411994ea4f", - "tarball": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz" - }, - "files": [ - "old.js", - "index.js" - ], - "gitHead": "03e7c884431fe185dfebbc9b771aeca339c1807a", - "homepage": "https://github.com/isaacs/fs.realpath#readme", - "keywords": [ - "realpath", - "fs", - "polyfill" - ], - "license": "ISC", - "main": "index.js", - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "name": "fs.realpath", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/isaacs/fs.realpath.git" - }, - "scripts": { - "test": "tap test/*.js --cov" - }, - "version": "1.0.0" -} diff --git a/plugins/music_service/squeezelite/node_modules/glob/LICENSE b/plugins/music_service/squeezelite/node_modules/glob/LICENSE deleted file mode 100644 index 19129e315..000000000 --- a/plugins/music_service/squeezelite/node_modules/glob/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/plugins/music_service/squeezelite/node_modules/glob/README.md b/plugins/music_service/squeezelite/node_modules/glob/README.md deleted file mode 100644 index baa1d1ba8..000000000 --- a/plugins/music_service/squeezelite/node_modules/glob/README.md +++ /dev/null @@ -1,368 +0,0 @@ -# Glob - -Match files using the patterns the shell uses, like stars and stuff. - -[![Build Status](https://travis-ci.org/isaacs/node-glob.svg?branch=master)](https://travis-ci.org/isaacs/node-glob/) [![Build Status](https://ci.appveyor.com/api/projects/status/kd7f3yftf7unxlsx?svg=true)](https://ci.appveyor.com/project/isaacs/node-glob) [![Coverage Status](https://coveralls.io/repos/isaacs/node-glob/badge.svg?branch=master&service=github)](https://coveralls.io/github/isaacs/node-glob?branch=master) - -This is a glob implementation in JavaScript. It uses the `minimatch` -library to do its matching. - -![](oh-my-glob.gif) - -## Usage - -Install with npm - -``` -npm i glob -``` - -```javascript -var glob = require("glob") - -// options is optional -glob("**/*.js", options, function (er, files) { - // files is an array of filenames. - // If the `nonull` option is set, and nothing - // was found, then files is ["**/*.js"] - // er is an error object or null. -}) -``` - -## Glob Primer - -"Globs" are the patterns you type when you do stuff like `ls *.js` on -the command line, or put `build/*` in a `.gitignore` file. - -Before parsing the path part patterns, braced sections are expanded -into a set. Braced sections start with `{` and end with `}`, with any -number of comma-delimited sections within. Braced sections may contain -slash characters, so `a{/b/c,bcd}` would expand into `a/b/c` and `abcd`. - -The following characters have special magic meaning when used in a -path portion: - -* `*` Matches 0 or more characters in a single path portion -* `?` Matches 1 character -* `[...]` Matches a range of characters, similar to a RegExp range. - If the first character of the range is `!` or `^` then it matches - any character not in the range. -* `!(pattern|pattern|pattern)` Matches anything that does not match - any of the patterns provided. -* `?(pattern|pattern|pattern)` Matches zero or one occurrence of the - patterns provided. -* `+(pattern|pattern|pattern)` Matches one or more occurrences of the - patterns provided. -* `*(a|b|c)` Matches zero or more occurrences of the patterns provided -* `@(pattern|pat*|pat?erN)` Matches exactly one of the patterns - provided -* `**` If a "globstar" is alone in a path portion, then it matches - zero or more directories and subdirectories searching for matches. - It does not crawl symlinked directories. - -### Dots - -If a file or directory path portion has a `.` as the first character, -then it will not match any glob pattern unless that pattern's -corresponding path part also has a `.` as its first character. - -For example, the pattern `a/.*/c` would match the file at `a/.b/c`. -However the pattern `a/*/c` would not, because `*` does not start with -a dot character. - -You can make glob treat dots as normal characters by setting -`dot:true` in the options. - -### Basename Matching - -If you set `matchBase:true` in the options, and the pattern has no -slashes in it, then it will seek for any file anywhere in the tree -with a matching basename. For example, `*.js` would match -`test/simple/basic.js`. - -### Empty Sets - -If no matching files are found, then an empty array is returned. This -differs from the shell, where the pattern itself is returned. For -example: - - $ echo a*s*d*f - a*s*d*f - -To get the bash-style behavior, set the `nonull:true` in the options. - -### See Also: - -* `man sh` -* `man bash` (Search for "Pattern Matching") -* `man 3 fnmatch` -* `man 5 gitignore` -* [minimatch documentation](https://github.com/isaacs/minimatch) - -## glob.hasMagic(pattern, [options]) - -Returns `true` if there are any special characters in the pattern, and -`false` otherwise. - -Note that the options affect the results. If `noext:true` is set in -the options object, then `+(a|b)` will not be considered a magic -pattern. If the pattern has a brace expansion, like `a/{b/c,x/y}` -then that is considered magical, unless `nobrace:true` is set in the -options. - -## glob(pattern, [options], cb) - -* `pattern` `{String}` Pattern to be matched -* `options` `{Object}` -* `cb` `{Function}` - * `err` `{Error | null}` - * `matches` `{Array}` filenames found matching the pattern - -Perform an asynchronous glob search. - -## glob.sync(pattern, [options]) - -* `pattern` `{String}` Pattern to be matched -* `options` `{Object}` -* return: `{Array}` filenames found matching the pattern - -Perform a synchronous glob search. - -## Class: glob.Glob - -Create a Glob object by instantiating the `glob.Glob` class. - -```javascript -var Glob = require("glob").Glob -var mg = new Glob(pattern, options, cb) -``` - -It's an EventEmitter, and starts walking the filesystem to find matches -immediately. - -### new glob.Glob(pattern, [options], [cb]) - -* `pattern` `{String}` pattern to search for -* `options` `{Object}` -* `cb` `{Function}` Called when an error occurs, or matches are found - * `err` `{Error | null}` - * `matches` `{Array}` filenames found matching the pattern - -Note that if the `sync` flag is set in the options, then matches will -be immediately available on the `g.found` member. - -### Properties - -* `minimatch` The minimatch object that the glob uses. -* `options` The options object passed in. -* `aborted` Boolean which is set to true when calling `abort()`. There - is no way at this time to continue a glob search after aborting, but - you can re-use the statCache to avoid having to duplicate syscalls. -* `cache` Convenience object. Each field has the following possible - values: - * `false` - Path does not exist - * `true` - Path exists - * `'FILE'` - Path exists, and is not a directory - * `'DIR'` - Path exists, and is a directory - * `[file, entries, ...]` - Path exists, is a directory, and the - array value is the results of `fs.readdir` -* `statCache` Cache of `fs.stat` results, to prevent statting the same - path multiple times. -* `symlinks` A record of which paths are symbolic links, which is - relevant in resolving `**` patterns. -* `realpathCache` An optional object which is passed to `fs.realpath` - to minimize unnecessary syscalls. It is stored on the instantiated - Glob object, and may be re-used. - -### Events - -* `end` When the matching is finished, this is emitted with all the - matches found. If the `nonull` option is set, and no match was found, - then the `matches` list contains the original pattern. The matches - are sorted, unless the `nosort` flag is set. -* `match` Every time a match is found, this is emitted with the specific - thing that matched. It is not deduplicated or resolved to a realpath. -* `error` Emitted when an unexpected error is encountered, or whenever - any fs error occurs if `options.strict` is set. -* `abort` When `abort()` is called, this event is raised. - -### Methods - -* `pause` Temporarily stop the search -* `resume` Resume the search -* `abort` Stop the search forever - -### Options - -All the options that can be passed to Minimatch can also be passed to -Glob to change pattern matching behavior. Also, some have been added, -or have glob-specific ramifications. - -All options are false by default, unless otherwise noted. - -All options are added to the Glob object, as well. - -If you are running many `glob` operations, you can pass a Glob object -as the `options` argument to a subsequent operation to shortcut some -`stat` and `readdir` calls. At the very least, you may pass in shared -`symlinks`, `statCache`, `realpathCache`, and `cache` options, so that -parallel glob operations will be sped up by sharing information about -the filesystem. - -* `cwd` The current working directory in which to search. Defaults - to `process.cwd()`. -* `root` The place where patterns starting with `/` will be mounted - onto. Defaults to `path.resolve(options.cwd, "/")` (`/` on Unix - systems, and `C:\` or some such on Windows.) -* `dot` Include `.dot` files in normal matches and `globstar` matches. - Note that an explicit dot in a portion of the pattern will always - match dot files. -* `nomount` By default, a pattern starting with a forward-slash will be - "mounted" onto the root setting, so that a valid filesystem path is - returned. Set this flag to disable that behavior. -* `mark` Add a `/` character to directory matches. Note that this - requires additional stat calls. -* `nosort` Don't sort the results. -* `stat` Set to true to stat *all* results. This reduces performance - somewhat, and is completely unnecessary, unless `readdir` is presumed - to be an untrustworthy indicator of file existence. -* `silent` When an unusual error is encountered when attempting to - read a directory, a warning will be printed to stderr. Set the - `silent` option to true to suppress these warnings. -* `strict` When an unusual error is encountered when attempting to - read a directory, the process will just continue on in search of - other matches. Set the `strict` option to raise an error in these - cases. -* `cache` See `cache` property above. Pass in a previously generated - cache object to save some fs calls. -* `statCache` A cache of results of filesystem information, to prevent - unnecessary stat calls. While it should not normally be necessary - to set this, you may pass the statCache from one glob() call to the - options object of another, if you know that the filesystem will not - change between calls. (See "Race Conditions" below.) -* `symlinks` A cache of known symbolic links. You may pass in a - previously generated `symlinks` object to save `lstat` calls when - resolving `**` matches. -* `sync` DEPRECATED: use `glob.sync(pattern, opts)` instead. -* `nounique` In some cases, brace-expanded patterns can result in the - same file showing up multiple times in the result set. By default, - this implementation prevents duplicates in the result set. Set this - flag to disable that behavior. -* `nonull` Set to never return an empty set, instead returning a set - containing the pattern itself. This is the default in glob(3). -* `debug` Set to enable debug logging in minimatch and glob. -* `nobrace` Do not expand `{a,b}` and `{1..3}` brace sets. -* `noglobstar` Do not match `**` against multiple filenames. (Ie, - treat it as a normal `*` instead.) -* `noext` Do not match `+(a|b)` "extglob" patterns. -* `nocase` Perform a case-insensitive match. Note: on - case-insensitive filesystems, non-magic patterns will match by - default, since `stat` and `readdir` will not raise errors. -* `matchBase` Perform a basename-only match if the pattern does not - contain any slash characters. That is, `*.js` would be treated as - equivalent to `**/*.js`, matching all js files in all directories. -* `nodir` Do not match directories, only files. (Note: to match - *only* directories, simply put a `/` at the end of the pattern.) -* `ignore` Add a pattern or an array of glob patterns to exclude matches. - Note: `ignore` patterns are *always* in `dot:true` mode, regardless - of any other settings. -* `follow` Follow symlinked directories when expanding `**` patterns. - Note that this can result in a lot of duplicate references in the - presence of cyclic links. -* `realpath` Set to true to call `fs.realpath` on all of the results. - In the case of a symlink that cannot be resolved, the full absolute - path to the matched entry is returned (though it will usually be a - broken symlink) -* `absolute` Set to true to always receive absolute paths for matched - files. Unlike `realpath`, this also affects the values returned in - the `match` event. - -## Comparisons to other fnmatch/glob implementations - -While strict compliance with the existing standards is a worthwhile -goal, some discrepancies exist between node-glob and other -implementations, and are intentional. - -The double-star character `**` is supported by default, unless the -`noglobstar` flag is set. This is supported in the manner of bsdglob -and bash 4.3, where `**` only has special significance if it is the only -thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but -`a/**b` will not. - -Note that symlinked directories are not crawled as part of a `**`, -though their contents may match against subsequent portions of the -pattern. This prevents infinite loops and duplicates and the like. - -If an escaped pattern has no matches, and the `nonull` flag is set, -then glob returns the pattern as-provided, rather than -interpreting the character escapes. For example, -`glob.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than -`"*a?"`. This is akin to setting the `nullglob` option in bash, except -that it does not resolve escaped pattern characters. - -If brace expansion is not disabled, then it is performed before any -other interpretation of the glob pattern. Thus, a pattern like -`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded -**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are -checked for validity. Since those two are valid, matching proceeds. - -### Comments and Negation - -Previously, this module let you mark a pattern as a "comment" if it -started with a `#` character, or a "negated" pattern if it started -with a `!` character. - -These options were deprecated in version 5, and removed in version 6. - -To specify things that should not match, use the `ignore` option. - -## Windows - -**Please only use forward-slashes in glob expressions.** - -Though windows uses either `/` or `\` as its path separator, only `/` -characters are used by this glob implementation. You must use -forward-slashes **only** in glob expressions. Back-slashes will always -be interpreted as escape characters, not path separators. - -Results from absolute patterns such as `/foo/*` are mounted onto the -root setting using `path.join`. On windows, this will by default result -in `/foo/*` matching `C:\foo\bar.txt`. - -## Race Conditions - -Glob searching, by its very nature, is susceptible to race conditions, -since it relies on directory walking and such. - -As a result, it is possible that a file that exists when glob looks for -it may have been deleted or modified by the time it returns the result. - -As part of its internal implementation, this program caches all stat -and readdir calls that it makes, in order to cut down on system -overhead. However, this also makes it even more susceptible to races, -especially if the cache or statCache objects are reused between glob -calls. - -Users are thus advised not to use a glob result as a guarantee of -filesystem state in the face of rapid changes. For the vast majority -of operations, this is never a problem. - -## Contributing - -Any change to behavior (including bugfixes) must come with a test. - -Patches that fail tests or reduce performance will be rejected. - -``` -# to run tests -npm test - -# to re-generate test fixtures -npm run test-regen - -# to benchmark against bash/zsh -npm run bench - -# to profile javascript -npm run prof -``` diff --git a/plugins/music_service/squeezelite/node_modules/glob/changelog.md b/plugins/music_service/squeezelite/node_modules/glob/changelog.md deleted file mode 100644 index 41636771e..000000000 --- a/plugins/music_service/squeezelite/node_modules/glob/changelog.md +++ /dev/null @@ -1,67 +0,0 @@ -## 7.0 - -- Raise error if `options.cwd` is specified, and not a directory - -## 6.0 - -- Remove comment and negation pattern support -- Ignore patterns are always in `dot:true` mode - -## 5.0 - -- Deprecate comment and negation patterns -- Fix regression in `mark` and `nodir` options from making all cache - keys absolute path. -- Abort if `fs.readdir` returns an error that's unexpected -- Don't emit `match` events for ignored items -- Treat ENOTSUP like ENOTDIR in readdir - -## 4.5 - -- Add `options.follow` to always follow directory symlinks in globstar -- Add `options.realpath` to call `fs.realpath` on all results -- Always cache based on absolute path - -## 4.4 - -- Add `options.ignore` -- Fix handling of broken symlinks - -## 4.3 - -- Bump minimatch to 2.x -- Pass all tests on Windows - -## 4.2 - -- Add `glob.hasMagic` function -- Add `options.nodir` flag - -## 4.1 - -- Refactor sync and async implementations for performance -- Throw if callback provided to sync glob function -- Treat symbolic links in globstar results the same as Bash 4.3 - -## 4.0 - -- Use `^` for dependency versions (bumped major because this breaks - older npm versions) -- Ensure callbacks are only ever called once -- switch to ISC license - -## 3.x - -- Rewrite in JavaScript -- Add support for setting root, cwd, and windows support -- Cache many fs calls -- Add globstar support -- emit match events - -## 2.x - -- Use `glob.h` and `fnmatch.h` from NetBSD - -## 1.x - -- `glob.h` static binding. diff --git a/plugins/music_service/squeezelite/node_modules/glob/common.js b/plugins/music_service/squeezelite/node_modules/glob/common.js deleted file mode 100644 index 66651bb3a..000000000 --- a/plugins/music_service/squeezelite/node_modules/glob/common.js +++ /dev/null @@ -1,240 +0,0 @@ -exports.alphasort = alphasort -exports.alphasorti = alphasorti -exports.setopts = setopts -exports.ownProp = ownProp -exports.makeAbs = makeAbs -exports.finish = finish -exports.mark = mark -exports.isIgnored = isIgnored -exports.childrenIgnored = childrenIgnored - -function ownProp (obj, field) { - return Object.prototype.hasOwnProperty.call(obj, field) -} - -var path = require("path") -var minimatch = require("minimatch") -var isAbsolute = require("path-is-absolute") -var Minimatch = minimatch.Minimatch - -function alphasorti (a, b) { - return a.toLowerCase().localeCompare(b.toLowerCase()) -} - -function alphasort (a, b) { - return a.localeCompare(b) -} - -function setupIgnores (self, options) { - self.ignore = options.ignore || [] - - if (!Array.isArray(self.ignore)) - self.ignore = [self.ignore] - - if (self.ignore.length) { - self.ignore = self.ignore.map(ignoreMap) - } -} - -// ignore patterns are always in dot:true mode. -function ignoreMap (pattern) { - var gmatcher = null - if (pattern.slice(-3) === '/**') { - var gpattern = pattern.replace(/(\/\*\*)+$/, '') - gmatcher = new Minimatch(gpattern, { dot: true }) - } - - return { - matcher: new Minimatch(pattern, { dot: true }), - gmatcher: gmatcher - } -} - -function setopts (self, pattern, options) { - if (!options) - options = {} - - // base-matching: just use globstar for that. - if (options.matchBase && -1 === pattern.indexOf("/")) { - if (options.noglobstar) { - throw new Error("base matching requires globstar") - } - pattern = "**/" + pattern - } - - self.silent = !!options.silent - self.pattern = pattern - self.strict = options.strict !== false - self.realpath = !!options.realpath - self.realpathCache = options.realpathCache || Object.create(null) - self.follow = !!options.follow - self.dot = !!options.dot - self.mark = !!options.mark - self.nodir = !!options.nodir - if (self.nodir) - self.mark = true - self.sync = !!options.sync - self.nounique = !!options.nounique - self.nonull = !!options.nonull - self.nosort = !!options.nosort - self.nocase = !!options.nocase - self.stat = !!options.stat - self.noprocess = !!options.noprocess - self.absolute = !!options.absolute - - self.maxLength = options.maxLength || Infinity - self.cache = options.cache || Object.create(null) - self.statCache = options.statCache || Object.create(null) - self.symlinks = options.symlinks || Object.create(null) - - setupIgnores(self, options) - - self.changedCwd = false - var cwd = process.cwd() - if (!ownProp(options, "cwd")) - self.cwd = cwd - else { - self.cwd = path.resolve(options.cwd) - self.changedCwd = self.cwd !== cwd - } - - self.root = options.root || path.resolve(self.cwd, "/") - self.root = path.resolve(self.root) - if (process.platform === "win32") - self.root = self.root.replace(/\\/g, "/") - - // TODO: is an absolute `cwd` supposed to be resolved against `root`? - // e.g. { cwd: '/test', root: __dirname } === path.join(__dirname, '/test') - self.cwdAbs = isAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd) - if (process.platform === "win32") - self.cwdAbs = self.cwdAbs.replace(/\\/g, "/") - self.nomount = !!options.nomount - - // disable comments and negation in Minimatch. - // Note that they are not supported in Glob itself anyway. - options.nonegate = true - options.nocomment = true - - self.minimatch = new Minimatch(pattern, options) - self.options = self.minimatch.options -} - -function finish (self) { - var nou = self.nounique - var all = nou ? [] : Object.create(null) - - for (var i = 0, l = self.matches.length; i < l; i ++) { - var matches = self.matches[i] - if (!matches || Object.keys(matches).length === 0) { - if (self.nonull) { - // do like the shell, and spit out the literal glob - var literal = self.minimatch.globSet[i] - if (nou) - all.push(literal) - else - all[literal] = true - } - } else { - // had matches - var m = Object.keys(matches) - if (nou) - all.push.apply(all, m) - else - m.forEach(function (m) { - all[m] = true - }) - } - } - - if (!nou) - all = Object.keys(all) - - if (!self.nosort) - all = all.sort(self.nocase ? alphasorti : alphasort) - - // at *some* point we statted all of these - if (self.mark) { - for (var i = 0; i < all.length; i++) { - all[i] = self._mark(all[i]) - } - if (self.nodir) { - all = all.filter(function (e) { - var notDir = !(/\/$/.test(e)) - var c = self.cache[e] || self.cache[makeAbs(self, e)] - if (notDir && c) - notDir = c !== 'DIR' && !Array.isArray(c) - return notDir - }) - } - } - - if (self.ignore.length) - all = all.filter(function(m) { - return !isIgnored(self, m) - }) - - self.found = all -} - -function mark (self, p) { - var abs = makeAbs(self, p) - var c = self.cache[abs] - var m = p - if (c) { - var isDir = c === 'DIR' || Array.isArray(c) - var slash = p.slice(-1) === '/' - - if (isDir && !slash) - m += '/' - else if (!isDir && slash) - m = m.slice(0, -1) - - if (m !== p) { - var mabs = makeAbs(self, m) - self.statCache[mabs] = self.statCache[abs] - self.cache[mabs] = self.cache[abs] - } - } - - return m -} - -// lotta situps... -function makeAbs (self, f) { - var abs = f - if (f.charAt(0) === '/') { - abs = path.join(self.root, f) - } else if (isAbsolute(f) || f === '') { - abs = f - } else if (self.changedCwd) { - abs = path.resolve(self.cwd, f) - } else { - abs = path.resolve(f) - } - - if (process.platform === 'win32') - abs = abs.replace(/\\/g, '/') - - return abs -} - - -// Return true, if pattern ends with globstar '**', for the accompanying parent directory. -// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents -function isIgnored (self, path) { - if (!self.ignore.length) - return false - - return self.ignore.some(function(item) { - return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path)) - }) -} - -function childrenIgnored (self, path) { - if (!self.ignore.length) - return false - - return self.ignore.some(function(item) { - return !!(item.gmatcher && item.gmatcher.match(path)) - }) -} diff --git a/plugins/music_service/squeezelite/node_modules/glob/glob.js b/plugins/music_service/squeezelite/node_modules/glob/glob.js deleted file mode 100644 index 58dec0f6c..000000000 --- a/plugins/music_service/squeezelite/node_modules/glob/glob.js +++ /dev/null @@ -1,790 +0,0 @@ -// Approach: -// -// 1. Get the minimatch set -// 2. For each pattern in the set, PROCESS(pattern, false) -// 3. Store matches per-set, then uniq them -// -// PROCESS(pattern, inGlobStar) -// Get the first [n] items from pattern that are all strings -// Join these together. This is PREFIX. -// If there is no more remaining, then stat(PREFIX) and -// add to matches if it succeeds. END. -// -// If inGlobStar and PREFIX is symlink and points to dir -// set ENTRIES = [] -// else readdir(PREFIX) as ENTRIES -// If fail, END -// -// with ENTRIES -// If pattern[n] is GLOBSTAR -// // handle the case where the globstar match is empty -// // by pruning it out, and testing the resulting pattern -// PROCESS(pattern[0..n] + pattern[n+1 .. $], false) -// // handle other cases. -// for ENTRY in ENTRIES (not dotfiles) -// // attach globstar + tail onto the entry -// // Mark that this entry is a globstar match -// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true) -// -// else // not globstar -// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) -// Test ENTRY against pattern[n] -// If fails, continue -// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) -// -// Caveat: -// Cache all stats and readdirs results to minimize syscall. Since all -// we ever care about is existence and directory-ness, we can just keep -// `true` for files, and [children,...] for directories, or `false` for -// things that don't exist. - -module.exports = glob - -var fs = require('fs') -var rp = require('fs.realpath') -var minimatch = require('minimatch') -var Minimatch = minimatch.Minimatch -var inherits = require('inherits') -var EE = require('events').EventEmitter -var path = require('path') -var assert = require('assert') -var isAbsolute = require('path-is-absolute') -var globSync = require('./sync.js') -var common = require('./common.js') -var alphasort = common.alphasort -var alphasorti = common.alphasorti -var setopts = common.setopts -var ownProp = common.ownProp -var inflight = require('inflight') -var util = require('util') -var childrenIgnored = common.childrenIgnored -var isIgnored = common.isIgnored - -var once = require('once') - -function glob (pattern, options, cb) { - if (typeof options === 'function') cb = options, options = {} - if (!options) options = {} - - if (options.sync) { - if (cb) - throw new TypeError('callback provided to sync glob') - return globSync(pattern, options) - } - - return new Glob(pattern, options, cb) -} - -glob.sync = globSync -var GlobSync = glob.GlobSync = globSync.GlobSync - -// old api surface -glob.glob = glob - -function extend (origin, add) { - if (add === null || typeof add !== 'object') { - return origin - } - - var keys = Object.keys(add) - var i = keys.length - while (i--) { - origin[keys[i]] = add[keys[i]] - } - return origin -} - -glob.hasMagic = function (pattern, options_) { - var options = extend({}, options_) - options.noprocess = true - - var g = new Glob(pattern, options) - var set = g.minimatch.set - - if (!pattern) - return false - - if (set.length > 1) - return true - - for (var j = 0; j < set[0].length; j++) { - if (typeof set[0][j] !== 'string') - return true - } - - return false -} - -glob.Glob = Glob -inherits(Glob, EE) -function Glob (pattern, options, cb) { - if (typeof options === 'function') { - cb = options - options = null - } - - if (options && options.sync) { - if (cb) - throw new TypeError('callback provided to sync glob') - return new GlobSync(pattern, options) - } - - if (!(this instanceof Glob)) - return new Glob(pattern, options, cb) - - setopts(this, pattern, options) - this._didRealPath = false - - // process each pattern in the minimatch set - var n = this.minimatch.set.length - - // The matches are stored as {: true,...} so that - // duplicates are automagically pruned. - // Later, we do an Object.keys() on these. - // Keep them as a list so we can fill in when nonull is set. - this.matches = new Array(n) - - if (typeof cb === 'function') { - cb = once(cb) - this.on('error', cb) - this.on('end', function (matches) { - cb(null, matches) - }) - } - - var self = this - this._processing = 0 - - this._emitQueue = [] - this._processQueue = [] - this.paused = false - - if (this.noprocess) - return this - - if (n === 0) - return done() - - var sync = true - for (var i = 0; i < n; i ++) { - this._process(this.minimatch.set[i], i, false, done) - } - sync = false - - function done () { - --self._processing - if (self._processing <= 0) { - if (sync) { - process.nextTick(function () { - self._finish() - }) - } else { - self._finish() - } - } - } -} - -Glob.prototype._finish = function () { - assert(this instanceof Glob) - if (this.aborted) - return - - if (this.realpath && !this._didRealpath) - return this._realpath() - - common.finish(this) - this.emit('end', this.found) -} - -Glob.prototype._realpath = function () { - if (this._didRealpath) - return - - this._didRealpath = true - - var n = this.matches.length - if (n === 0) - return this._finish() - - var self = this - for (var i = 0; i < this.matches.length; i++) - this._realpathSet(i, next) - - function next () { - if (--n === 0) - self._finish() - } -} - -Glob.prototype._realpathSet = function (index, cb) { - var matchset = this.matches[index] - if (!matchset) - return cb() - - var found = Object.keys(matchset) - var self = this - var n = found.length - - if (n === 0) - return cb() - - var set = this.matches[index] = Object.create(null) - found.forEach(function (p, i) { - // If there's a problem with the stat, then it means that - // one or more of the links in the realpath couldn't be - // resolved. just return the abs value in that case. - p = self._makeAbs(p) - rp.realpath(p, self.realpathCache, function (er, real) { - if (!er) - set[real] = true - else if (er.syscall === 'stat') - set[p] = true - else - self.emit('error', er) // srsly wtf right here - - if (--n === 0) { - self.matches[index] = set - cb() - } - }) - }) -} - -Glob.prototype._mark = function (p) { - return common.mark(this, p) -} - -Glob.prototype._makeAbs = function (f) { - return common.makeAbs(this, f) -} - -Glob.prototype.abort = function () { - this.aborted = true - this.emit('abort') -} - -Glob.prototype.pause = function () { - if (!this.paused) { - this.paused = true - this.emit('pause') - } -} - -Glob.prototype.resume = function () { - if (this.paused) { - this.emit('resume') - this.paused = false - if (this._emitQueue.length) { - var eq = this._emitQueue.slice(0) - this._emitQueue.length = 0 - for (var i = 0; i < eq.length; i ++) { - var e = eq[i] - this._emitMatch(e[0], e[1]) - } - } - if (this._processQueue.length) { - var pq = this._processQueue.slice(0) - this._processQueue.length = 0 - for (var i = 0; i < pq.length; i ++) { - var p = pq[i] - this._processing-- - this._process(p[0], p[1], p[2], p[3]) - } - } - } -} - -Glob.prototype._process = function (pattern, index, inGlobStar, cb) { - assert(this instanceof Glob) - assert(typeof cb === 'function') - - if (this.aborted) - return - - this._processing++ - if (this.paused) { - this._processQueue.push([pattern, index, inGlobStar, cb]) - return - } - - //console.error('PROCESS %d', this._processing, pattern) - - // Get the first [n] parts of pattern that are all strings. - var n = 0 - while (typeof pattern[n] === 'string') { - n ++ - } - // now n is the index of the first one that is *not* a string. - - // see if there's anything else - var prefix - switch (n) { - // if not, then this is rather simple - case pattern.length: - this._processSimple(pattern.join('/'), index, cb) - return - - case 0: - // pattern *starts* with some non-trivial item. - // going to readdir(cwd), but not include the prefix in matches. - prefix = null - break - - default: - // pattern has some string bits in the front. - // whatever it starts with, whether that's 'absolute' like /foo/bar, - // or 'relative' like '../baz' - prefix = pattern.slice(0, n).join('/') - break - } - - var remain = pattern.slice(n) - - // get the list of entries. - var read - if (prefix === null) - read = '.' - else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { - if (!prefix || !isAbsolute(prefix)) - prefix = '/' + prefix - read = prefix - } else - read = prefix - - var abs = this._makeAbs(read) - - //if ignored, skip _processing - if (childrenIgnored(this, read)) - return cb() - - var isGlobStar = remain[0] === minimatch.GLOBSTAR - if (isGlobStar) - this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) - else - this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb) -} - -Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { - var self = this - this._readdir(abs, inGlobStar, function (er, entries) { - return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) - }) -} - -Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { - - // if the abs isn't a dir, then nothing can match! - if (!entries) - return cb() - - // It will only match dot entries if it starts with a dot, or if - // dot is set. Stuff like @(.foo|.bar) isn't allowed. - var pn = remain[0] - var negate = !!this.minimatch.negate - var rawGlob = pn._glob - var dotOk = this.dot || rawGlob.charAt(0) === '.' - - var matchedEntries = [] - for (var i = 0; i < entries.length; i++) { - var e = entries[i] - if (e.charAt(0) !== '.' || dotOk) { - var m - if (negate && !prefix) { - m = !e.match(pn) - } else { - m = e.match(pn) - } - if (m) - matchedEntries.push(e) - } - } - - //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) - - var len = matchedEntries.length - // If there are no matched entries, then nothing matches. - if (len === 0) - return cb() - - // if this is the last remaining pattern bit, then no need for - // an additional stat *unless* the user has specified mark or - // stat explicitly. We know they exist, since readdir returned - // them. - - if (remain.length === 1 && !this.mark && !this.stat) { - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - if (prefix) { - if (prefix !== '/') - e = prefix + '/' + e - else - e = prefix + e - } - - if (e.charAt(0) === '/' && !this.nomount) { - e = path.join(this.root, e) - } - this._emitMatch(index, e) - } - // This was the last one, and no stats were needed - return cb() - } - - // now test all matched entries as stand-ins for that part - // of the pattern. - remain.shift() - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - var newPattern - if (prefix) { - if (prefix !== '/') - e = prefix + '/' + e - else - e = prefix + e - } - this._process([e].concat(remain), index, inGlobStar, cb) - } - cb() -} - -Glob.prototype._emitMatch = function (index, e) { - if (this.aborted) - return - - if (isIgnored(this, e)) - return - - if (this.paused) { - this._emitQueue.push([index, e]) - return - } - - var abs = isAbsolute(e) ? e : this._makeAbs(e) - - if (this.mark) - e = this._mark(e) - - if (this.absolute) - e = abs - - if (this.matches[index][e]) - return - - if (this.nodir) { - var c = this.cache[abs] - if (c === 'DIR' || Array.isArray(c)) - return - } - - this.matches[index][e] = true - - var st = this.statCache[abs] - if (st) - this.emit('stat', e, st) - - this.emit('match', e) -} - -Glob.prototype._readdirInGlobStar = function (abs, cb) { - if (this.aborted) - return - - // follow all symlinked directories forever - // just proceed as if this is a non-globstar situation - if (this.follow) - return this._readdir(abs, false, cb) - - var lstatkey = 'lstat\0' + abs - var self = this - var lstatcb = inflight(lstatkey, lstatcb_) - - if (lstatcb) - fs.lstat(abs, lstatcb) - - function lstatcb_ (er, lstat) { - if (er && er.code === 'ENOENT') - return cb() - - var isSym = lstat && lstat.isSymbolicLink() - self.symlinks[abs] = isSym - - // If it's not a symlink or a dir, then it's definitely a regular file. - // don't bother doing a readdir in that case. - if (!isSym && lstat && !lstat.isDirectory()) { - self.cache[abs] = 'FILE' - cb() - } else - self._readdir(abs, false, cb) - } -} - -Glob.prototype._readdir = function (abs, inGlobStar, cb) { - if (this.aborted) - return - - cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb) - if (!cb) - return - - //console.error('RD %j %j', +inGlobStar, abs) - if (inGlobStar && !ownProp(this.symlinks, abs)) - return this._readdirInGlobStar(abs, cb) - - if (ownProp(this.cache, abs)) { - var c = this.cache[abs] - if (!c || c === 'FILE') - return cb() - - if (Array.isArray(c)) - return cb(null, c) - } - - var self = this - fs.readdir(abs, readdirCb(this, abs, cb)) -} - -function readdirCb (self, abs, cb) { - return function (er, entries) { - if (er) - self._readdirError(abs, er, cb) - else - self._readdirEntries(abs, entries, cb) - } -} - -Glob.prototype._readdirEntries = function (abs, entries, cb) { - if (this.aborted) - return - - // if we haven't asked to stat everything, then just - // assume that everything in there exists, so we can avoid - // having to stat it a second time. - if (!this.mark && !this.stat) { - for (var i = 0; i < entries.length; i ++) { - var e = entries[i] - if (abs === '/') - e = abs + e - else - e = abs + '/' + e - this.cache[e] = true - } - } - - this.cache[abs] = entries - return cb(null, entries) -} - -Glob.prototype._readdirError = function (f, er, cb) { - if (this.aborted) - return - - // handle errors, and cache the information - switch (er.code) { - case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 - case 'ENOTDIR': // totally normal. means it *does* exist. - var abs = this._makeAbs(f) - this.cache[abs] = 'FILE' - if (abs === this.cwdAbs) { - var error = new Error(er.code + ' invalid cwd ' + this.cwd) - error.path = this.cwd - error.code = er.code - this.emit('error', error) - this.abort() - } - break - - case 'ENOENT': // not terribly unusual - case 'ELOOP': - case 'ENAMETOOLONG': - case 'UNKNOWN': - this.cache[this._makeAbs(f)] = false - break - - default: // some unusual error. Treat as failure. - this.cache[this._makeAbs(f)] = false - if (this.strict) { - this.emit('error', er) - // If the error is handled, then we abort - // if not, we threw out of here - this.abort() - } - if (!this.silent) - console.error('glob error', er) - break - } - - return cb() -} - -Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { - var self = this - this._readdir(abs, inGlobStar, function (er, entries) { - self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb) - }) -} - - -Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { - //console.error('pgs2', prefix, remain[0], entries) - - // no entries means not a dir, so it can never have matches - // foo.txt/** doesn't match foo.txt - if (!entries) - return cb() - - // test without the globstar, and with every child both below - // and replacing the globstar. - var remainWithoutGlobStar = remain.slice(1) - var gspref = prefix ? [ prefix ] : [] - var noGlobStar = gspref.concat(remainWithoutGlobStar) - - // the noGlobStar pattern exits the inGlobStar state - this._process(noGlobStar, index, false, cb) - - var isSym = this.symlinks[abs] - var len = entries.length - - // If it's a symlink, and we're in a globstar, then stop - if (isSym && inGlobStar) - return cb() - - for (var i = 0; i < len; i++) { - var e = entries[i] - if (e.charAt(0) === '.' && !this.dot) - continue - - // these two cases enter the inGlobStar state - var instead = gspref.concat(entries[i], remainWithoutGlobStar) - this._process(instead, index, true, cb) - - var below = gspref.concat(entries[i], remain) - this._process(below, index, true, cb) - } - - cb() -} - -Glob.prototype._processSimple = function (prefix, index, cb) { - // XXX review this. Shouldn't it be doing the mounting etc - // before doing stat? kinda weird? - var self = this - this._stat(prefix, function (er, exists) { - self._processSimple2(prefix, index, er, exists, cb) - }) -} -Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { - - //console.error('ps2', prefix, exists) - - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - // If it doesn't exist, then just mark the lack of results - if (!exists) - return cb() - - if (prefix && isAbsolute(prefix) && !this.nomount) { - var trail = /[\/\\]$/.test(prefix) - if (prefix.charAt(0) === '/') { - prefix = path.join(this.root, prefix) - } else { - prefix = path.resolve(this.root, prefix) - if (trail) - prefix += '/' - } - } - - if (process.platform === 'win32') - prefix = prefix.replace(/\\/g, '/') - - // Mark this as a match - this._emitMatch(index, prefix) - cb() -} - -// Returns either 'DIR', 'FILE', or false -Glob.prototype._stat = function (f, cb) { - var abs = this._makeAbs(f) - var needDir = f.slice(-1) === '/' - - if (f.length > this.maxLength) - return cb() - - if (!this.stat && ownProp(this.cache, abs)) { - var c = this.cache[abs] - - if (Array.isArray(c)) - c = 'DIR' - - // It exists, but maybe not how we need it - if (!needDir || c === 'DIR') - return cb(null, c) - - if (needDir && c === 'FILE') - return cb() - - // otherwise we have to stat, because maybe c=true - // if we know it exists, but not what it is. - } - - var exists - var stat = this.statCache[abs] - if (stat !== undefined) { - if (stat === false) - return cb(null, stat) - else { - var type = stat.isDirectory() ? 'DIR' : 'FILE' - if (needDir && type === 'FILE') - return cb() - else - return cb(null, type, stat) - } - } - - var self = this - var statcb = inflight('stat\0' + abs, lstatcb_) - if (statcb) - fs.lstat(abs, statcb) - - function lstatcb_ (er, lstat) { - if (lstat && lstat.isSymbolicLink()) { - // If it's a symlink, then treat it as the target, unless - // the target does not exist, then treat it as a file. - return fs.stat(abs, function (er, stat) { - if (er) - self._stat2(f, abs, null, lstat, cb) - else - self._stat2(f, abs, er, stat, cb) - }) - } else { - self._stat2(f, abs, er, lstat, cb) - } - } -} - -Glob.prototype._stat2 = function (f, abs, er, stat, cb) { - if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { - this.statCache[abs] = false - return cb() - } - - var needDir = f.slice(-1) === '/' - this.statCache[abs] = stat - - if (abs.slice(-1) === '/' && stat && !stat.isDirectory()) - return cb(null, false, stat) - - var c = true - if (stat) - c = stat.isDirectory() ? 'DIR' : 'FILE' - this.cache[abs] = this.cache[abs] || c - - if (needDir && c === 'FILE') - return cb() - - return cb(null, c, stat) -} diff --git a/plugins/music_service/squeezelite/node_modules/glob/package.json b/plugins/music_service/squeezelite/node_modules/glob/package.json deleted file mode 100644 index 4af2734c6..000000000 --- a/plugins/music_service/squeezelite/node_modules/glob/package.json +++ /dev/null @@ -1,113 +0,0 @@ -{ - "_args": [ - [ - { - "raw": "glob@^7.1.0", - "scope": null, - "escapedName": "glob", - "name": "glob", - "rawSpec": "^7.1.0", - "spec": ">=7.1.0 <8.0.0", - "type": "range" - }, - "/home/volumio/volumio-plugins/plugins/music_service/squeezelite" - ] - ], - "_from": "glob@>=7.1.0 <8.0.0", - "_id": "glob@7.1.2", - "_inCache": true, - "_location": "/glob", - "_nodeVersion": "8.0.0-pre", - "_npmOperationalInternal": { - "host": "s3://npm-registry-packages", - "tmp": "tmp/glob-7.1.2.tgz_1495224925341_0.07115248567424715" - }, - "_npmUser": { - "name": "isaacs", - "email": "i@izs.me" - }, - "_npmVersion": "5.0.0-beta.56", - "_phantomChildren": {}, - "_requested": { - "raw": "glob@^7.1.0", - "scope": null, - "escapedName": "glob", - "name": "glob", - "rawSpec": "^7.1.0", - "spec": ">=7.1.0 <8.0.0", - "type": "range" - }, - "_requiredBy": [ - "/", - "/rimraf" - ], - "_resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "_shasum": "c19c9df9a028702d678612384a6552404c636d15", - "_shrinkwrap": null, - "_spec": "glob@^7.1.0", - "_where": "/home/volumio/volumio-plugins/plugins/music_service/squeezelite", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/isaacs/node-glob/issues" - }, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "description": "a little globber", - "devDependencies": { - "mkdirp": "0", - "rimraf": "^2.2.8", - "tap": "^7.1.2", - "tick": "0.0.6" - }, - "directories": {}, - "dist": { - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", - "shasum": "c19c9df9a028702d678612384a6552404c636d15", - "tarball": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz" - }, - "engines": { - "node": "*" - }, - "files": [ - "glob.js", - "sync.js", - "common.js" - ], - "gitHead": "8fa8d561e08c9eed1d286c6a35be2cd8123b2fb7", - "homepage": "https://github.com/isaacs/node-glob#readme", - "license": "ISC", - "main": "glob.js", - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "name": "glob", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/node-glob.git" - }, - "scripts": { - "bench": "bash benchmark.sh", - "benchclean": "node benchclean.js", - "prepublish": "npm run benchclean", - "prof": "bash prof.sh && cat profile.txt", - "profclean": "rm -f v8.log profile.txt", - "test": "tap test/*.js --cov", - "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js" - }, - "version": "7.1.2" -} diff --git a/plugins/music_service/squeezelite/node_modules/glob/sync.js b/plugins/music_service/squeezelite/node_modules/glob/sync.js deleted file mode 100644 index c952134ba..000000000 --- a/plugins/music_service/squeezelite/node_modules/glob/sync.js +++ /dev/null @@ -1,486 +0,0 @@ -module.exports = globSync -globSync.GlobSync = GlobSync - -var fs = require('fs') -var rp = require('fs.realpath') -var minimatch = require('minimatch') -var Minimatch = minimatch.Minimatch -var Glob = require('./glob.js').Glob -var util = require('util') -var path = require('path') -var assert = require('assert') -var isAbsolute = require('path-is-absolute') -var common = require('./common.js') -var alphasort = common.alphasort -var alphasorti = common.alphasorti -var setopts = common.setopts -var ownProp = common.ownProp -var childrenIgnored = common.childrenIgnored -var isIgnored = common.isIgnored - -function globSync (pattern, options) { - if (typeof options === 'function' || arguments.length === 3) - throw new TypeError('callback provided to sync glob\n'+ - 'See: https://github.com/isaacs/node-glob/issues/167') - - return new GlobSync(pattern, options).found -} - -function GlobSync (pattern, options) { - if (!pattern) - throw new Error('must provide pattern') - - if (typeof options === 'function' || arguments.length === 3) - throw new TypeError('callback provided to sync glob\n'+ - 'See: https://github.com/isaacs/node-glob/issues/167') - - if (!(this instanceof GlobSync)) - return new GlobSync(pattern, options) - - setopts(this, pattern, options) - - if (this.noprocess) - return this - - var n = this.minimatch.set.length - this.matches = new Array(n) - for (var i = 0; i < n; i ++) { - this._process(this.minimatch.set[i], i, false) - } - this._finish() -} - -GlobSync.prototype._finish = function () { - assert(this instanceof GlobSync) - if (this.realpath) { - var self = this - this.matches.forEach(function (matchset, index) { - var set = self.matches[index] = Object.create(null) - for (var p in matchset) { - try { - p = self._makeAbs(p) - var real = rp.realpathSync(p, self.realpathCache) - set[real] = true - } catch (er) { - if (er.syscall === 'stat') - set[self._makeAbs(p)] = true - else - throw er - } - } - }) - } - common.finish(this) -} - - -GlobSync.prototype._process = function (pattern, index, inGlobStar) { - assert(this instanceof GlobSync) - - // Get the first [n] parts of pattern that are all strings. - var n = 0 - while (typeof pattern[n] === 'string') { - n ++ - } - // now n is the index of the first one that is *not* a string. - - // See if there's anything else - var prefix - switch (n) { - // if not, then this is rather simple - case pattern.length: - this._processSimple(pattern.join('/'), index) - return - - case 0: - // pattern *starts* with some non-trivial item. - // going to readdir(cwd), but not include the prefix in matches. - prefix = null - break - - default: - // pattern has some string bits in the front. - // whatever it starts with, whether that's 'absolute' like /foo/bar, - // or 'relative' like '../baz' - prefix = pattern.slice(0, n).join('/') - break - } - - var remain = pattern.slice(n) - - // get the list of entries. - var read - if (prefix === null) - read = '.' - else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { - if (!prefix || !isAbsolute(prefix)) - prefix = '/' + prefix - read = prefix - } else - read = prefix - - var abs = this._makeAbs(read) - - //if ignored, skip processing - if (childrenIgnored(this, read)) - return - - var isGlobStar = remain[0] === minimatch.GLOBSTAR - if (isGlobStar) - this._processGlobStar(prefix, read, abs, remain, index, inGlobStar) - else - this._processReaddir(prefix, read, abs, remain, index, inGlobStar) -} - - -GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) { - var entries = this._readdir(abs, inGlobStar) - - // if the abs isn't a dir, then nothing can match! - if (!entries) - return - - // It will only match dot entries if it starts with a dot, or if - // dot is set. Stuff like @(.foo|.bar) isn't allowed. - var pn = remain[0] - var negate = !!this.minimatch.negate - var rawGlob = pn._glob - var dotOk = this.dot || rawGlob.charAt(0) === '.' - - var matchedEntries = [] - for (var i = 0; i < entries.length; i++) { - var e = entries[i] - if (e.charAt(0) !== '.' || dotOk) { - var m - if (negate && !prefix) { - m = !e.match(pn) - } else { - m = e.match(pn) - } - if (m) - matchedEntries.push(e) - } - } - - var len = matchedEntries.length - // If there are no matched entries, then nothing matches. - if (len === 0) - return - - // if this is the last remaining pattern bit, then no need for - // an additional stat *unless* the user has specified mark or - // stat explicitly. We know they exist, since readdir returned - // them. - - if (remain.length === 1 && !this.mark && !this.stat) { - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - if (prefix) { - if (prefix.slice(-1) !== '/') - e = prefix + '/' + e - else - e = prefix + e - } - - if (e.charAt(0) === '/' && !this.nomount) { - e = path.join(this.root, e) - } - this._emitMatch(index, e) - } - // This was the last one, and no stats were needed - return - } - - // now test all matched entries as stand-ins for that part - // of the pattern. - remain.shift() - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - var newPattern - if (prefix) - newPattern = [prefix, e] - else - newPattern = [e] - this._process(newPattern.concat(remain), index, inGlobStar) - } -} - - -GlobSync.prototype._emitMatch = function (index, e) { - if (isIgnored(this, e)) - return - - var abs = this._makeAbs(e) - - if (this.mark) - e = this._mark(e) - - if (this.absolute) { - e = abs - } - - if (this.matches[index][e]) - return - - if (this.nodir) { - var c = this.cache[abs] - if (c === 'DIR' || Array.isArray(c)) - return - } - - this.matches[index][e] = true - - if (this.stat) - this._stat(e) -} - - -GlobSync.prototype._readdirInGlobStar = function (abs) { - // follow all symlinked directories forever - // just proceed as if this is a non-globstar situation - if (this.follow) - return this._readdir(abs, false) - - var entries - var lstat - var stat - try { - lstat = fs.lstatSync(abs) - } catch (er) { - if (er.code === 'ENOENT') { - // lstat failed, doesn't exist - return null - } - } - - var isSym = lstat && lstat.isSymbolicLink() - this.symlinks[abs] = isSym - - // If it's not a symlink or a dir, then it's definitely a regular file. - // don't bother doing a readdir in that case. - if (!isSym && lstat && !lstat.isDirectory()) - this.cache[abs] = 'FILE' - else - entries = this._readdir(abs, false) - - return entries -} - -GlobSync.prototype._readdir = function (abs, inGlobStar) { - var entries - - if (inGlobStar && !ownProp(this.symlinks, abs)) - return this._readdirInGlobStar(abs) - - if (ownProp(this.cache, abs)) { - var c = this.cache[abs] - if (!c || c === 'FILE') - return null - - if (Array.isArray(c)) - return c - } - - try { - return this._readdirEntries(abs, fs.readdirSync(abs)) - } catch (er) { - this._readdirError(abs, er) - return null - } -} - -GlobSync.prototype._readdirEntries = function (abs, entries) { - // if we haven't asked to stat everything, then just - // assume that everything in there exists, so we can avoid - // having to stat it a second time. - if (!this.mark && !this.stat) { - for (var i = 0; i < entries.length; i ++) { - var e = entries[i] - if (abs === '/') - e = abs + e - else - e = abs + '/' + e - this.cache[e] = true - } - } - - this.cache[abs] = entries - - // mark and cache dir-ness - return entries -} - -GlobSync.prototype._readdirError = function (f, er) { - // handle errors, and cache the information - switch (er.code) { - case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 - case 'ENOTDIR': // totally normal. means it *does* exist. - var abs = this._makeAbs(f) - this.cache[abs] = 'FILE' - if (abs === this.cwdAbs) { - var error = new Error(er.code + ' invalid cwd ' + this.cwd) - error.path = this.cwd - error.code = er.code - throw error - } - break - - case 'ENOENT': // not terribly unusual - case 'ELOOP': - case 'ENAMETOOLONG': - case 'UNKNOWN': - this.cache[this._makeAbs(f)] = false - break - - default: // some unusual error. Treat as failure. - this.cache[this._makeAbs(f)] = false - if (this.strict) - throw er - if (!this.silent) - console.error('glob error', er) - break - } -} - -GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) { - - var entries = this._readdir(abs, inGlobStar) - - // no entries means not a dir, so it can never have matches - // foo.txt/** doesn't match foo.txt - if (!entries) - return - - // test without the globstar, and with every child both below - // and replacing the globstar. - var remainWithoutGlobStar = remain.slice(1) - var gspref = prefix ? [ prefix ] : [] - var noGlobStar = gspref.concat(remainWithoutGlobStar) - - // the noGlobStar pattern exits the inGlobStar state - this._process(noGlobStar, index, false) - - var len = entries.length - var isSym = this.symlinks[abs] - - // If it's a symlink, and we're in a globstar, then stop - if (isSym && inGlobStar) - return - - for (var i = 0; i < len; i++) { - var e = entries[i] - if (e.charAt(0) === '.' && !this.dot) - continue - - // these two cases enter the inGlobStar state - var instead = gspref.concat(entries[i], remainWithoutGlobStar) - this._process(instead, index, true) - - var below = gspref.concat(entries[i], remain) - this._process(below, index, true) - } -} - -GlobSync.prototype._processSimple = function (prefix, index) { - // XXX review this. Shouldn't it be doing the mounting etc - // before doing stat? kinda weird? - var exists = this._stat(prefix) - - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - // If it doesn't exist, then just mark the lack of results - if (!exists) - return - - if (prefix && isAbsolute(prefix) && !this.nomount) { - var trail = /[\/\\]$/.test(prefix) - if (prefix.charAt(0) === '/') { - prefix = path.join(this.root, prefix) - } else { - prefix = path.resolve(this.root, prefix) - if (trail) - prefix += '/' - } - } - - if (process.platform === 'win32') - prefix = prefix.replace(/\\/g, '/') - - // Mark this as a match - this._emitMatch(index, prefix) -} - -// Returns either 'DIR', 'FILE', or false -GlobSync.prototype._stat = function (f) { - var abs = this._makeAbs(f) - var needDir = f.slice(-1) === '/' - - if (f.length > this.maxLength) - return false - - if (!this.stat && ownProp(this.cache, abs)) { - var c = this.cache[abs] - - if (Array.isArray(c)) - c = 'DIR' - - // It exists, but maybe not how we need it - if (!needDir || c === 'DIR') - return c - - if (needDir && c === 'FILE') - return false - - // otherwise we have to stat, because maybe c=true - // if we know it exists, but not what it is. - } - - var exists - var stat = this.statCache[abs] - if (!stat) { - var lstat - try { - lstat = fs.lstatSync(abs) - } catch (er) { - if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { - this.statCache[abs] = false - return false - } - } - - if (lstat && lstat.isSymbolicLink()) { - try { - stat = fs.statSync(abs) - } catch (er) { - stat = lstat - } - } else { - stat = lstat - } - } - - this.statCache[abs] = stat - - var c = true - if (stat) - c = stat.isDirectory() ? 'DIR' : 'FILE' - - this.cache[abs] = this.cache[abs] || c - - if (needDir && c === 'FILE') - return false - - return c -} - -GlobSync.prototype._mark = function (p) { - return common.mark(this, p) -} - -GlobSync.prototype._makeAbs = function (f) { - return common.makeAbs(this, f) -} diff --git a/plugins/music_service/squeezelite/node_modules/graceful-fs/LICENSE b/plugins/music_service/squeezelite/node_modules/graceful-fs/LICENSE deleted file mode 100644 index 9d2c80369..000000000 --- a/plugins/music_service/squeezelite/node_modules/graceful-fs/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter, Ben Noordhuis, and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/plugins/music_service/squeezelite/node_modules/graceful-fs/README.md b/plugins/music_service/squeezelite/node_modules/graceful-fs/README.md deleted file mode 100644 index 5273a50ad..000000000 --- a/plugins/music_service/squeezelite/node_modules/graceful-fs/README.md +++ /dev/null @@ -1,133 +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](https://nodejs.org/api/fs.html) - -* Queues up `open` and `readdir` calls, and retries them once - something closes if there is an EMFILE error from too many file - descriptors. -* 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. - -## USAGE - -```javascript -// use just like fs -var fs = require('graceful-fs') - -// now go and do stuff with it... -fs.readFileSync('some-file-or-whatever') -``` - -## Global Patching - -If you want to patch the global fs module (or any other fs-like -module) you can do this: - -```javascript -// Make sure to read the caveat below. -var realFs = require('fs') -var gracefulFs = require('graceful-fs') -gracefulFs.gracefulify(realFs) -``` - -This should only ever be done at the top-level application layer, in -order to delay on EMFILE errors from any fs-using dependencies. You -should **not** do this in a library, because it can cause unexpected -delays in other parts of the program. - -## Changes - -This module is fairly stable at this point, and used by a lot of -things. That being said, because it implements a subtle behavior -change in a core part of the node API, even modest changes can be -extremely breaking, and the versioning is thus biased towards -bumping the major when in doubt. - -The main change between major versions has been switching between -providing a fully-patched `fs` module vs monkey-patching the node core -builtin, and the approach by which a non-monkey-patched `fs` was -created. - -The goal is to trade `EMFILE` errors for slower fs operations. So, if -you try to open a zillion files, rather than crashing, `open` -operations will be queued up and wait for something else to `close`. - -There are advantages to each approach. Monkey-patching the fs means -that no `EMFILE` errors can possibly occur anywhere in your -application, because everything is using the same core `fs` module, -which is patched. However, it can also obviously cause undesirable -side-effects, especially if the module is loaded multiple times. - -Implementing a separate-but-identical patched `fs` module is more -surgical (and doesn't run the risk of patching multiple times), but -also imposes the challenge of keeping in sync with the core module. - -The current approach loads the `fs` module, and then creates a -lookalike object that has all the same methods, except a few that are -patched. It is safe to use in all versions of Node from 0.8 through -7.0. - -### v4 - -* Do not monkey-patch the fs module. This module may now be used as a - drop-in dep, and users can opt into monkey-patching the fs builtin - if their app requires it. - -### v3 - -* Monkey-patch fs, because the eval approach no longer works on recent - node. -* fixed possible type-error throw if rename fails on windows -* verify that we *never* get EMFILE errors -* Ignore ENOSYS from chmod/chown -* clarify that graceful-fs must be used as a drop-in - -### v2.1.0 - -* Use eval rather than monkey-patching fs. -* readdir: Always sort the results -* win32: requeue a file if error has an OK status - -### v2.0 - -* A return to monkey patching -* wrap process.cwd - -### v1.1 - -* wrap readFile -* Wrap fs.writeFile. -* readdir protection -* Don't clobber the fs builtin -* Handle fs.read EAGAIN errors by trying again -* Expose the curOpen counter -* No-op lchown/lchmod if not implemented -* fs.rename patch only for win32 -* Patch fs.rename to handle AV software on Windows -* Close #4 Chown should not fail on einval or eperm if non-root -* Fix isaacs/fstream#1 Only wrap fs one time -* Fix #3 Start at 1024 max files, then back off on EMFILE -* lutimes that doens't blow up on Linux -* A full on-rewrite using a queue instead of just swallowing the EMFILE error -* Wrap Read/Write streams as well - -### 1.0 - -* Update engines for node 0.6 -* Be lstat-graceful on Windows -* first diff --git a/plugins/music_service/squeezelite/node_modules/graceful-fs/fs.js b/plugins/music_service/squeezelite/node_modules/graceful-fs/fs.js deleted file mode 100644 index 8ad4a3839..000000000 --- a/plugins/music_service/squeezelite/node_modules/graceful-fs/fs.js +++ /dev/null @@ -1,21 +0,0 @@ -'use strict' - -var fs = require('fs') - -module.exports = clone(fs) - -function clone (obj) { - if (obj === null || typeof obj !== 'object') - return obj - - if (obj instanceof Object) - var copy = { __proto__: obj.__proto__ } - else - var copy = Object.create(null) - - Object.getOwnPropertyNames(obj).forEach(function (key) { - Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key)) - }) - - return copy -} diff --git a/plugins/music_service/squeezelite/node_modules/graceful-fs/graceful-fs.js b/plugins/music_service/squeezelite/node_modules/graceful-fs/graceful-fs.js deleted file mode 100644 index 33b30d2e9..000000000 --- a/plugins/music_service/squeezelite/node_modules/graceful-fs/graceful-fs.js +++ /dev/null @@ -1,262 +0,0 @@ -var fs = require('fs') -var polyfills = require('./polyfills.js') -var legacy = require('./legacy-streams.js') -var queue = [] - -var util = require('util') - -function noop () {} - -var debug = noop -if (util.debuglog) - debug = util.debuglog('gfs4') -else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) - debug = function() { - var m = util.format.apply(util, arguments) - m = 'GFS4: ' + m.split(/\n/).join('\nGFS4: ') - console.error(m) - } - -if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) { - process.on('exit', function() { - debug(queue) - require('assert').equal(queue.length, 0) - }) -} - -module.exports = patch(require('./fs.js')) -if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH) { - module.exports = patch(fs) -} - -// Always patch fs.close/closeSync, because we want to -// retry() whenever a close happens *anywhere* in the program. -// This is essential when multiple graceful-fs instances are -// in play at the same time. -module.exports.close = -fs.close = (function (fs$close) { return function (fd, cb) { - return fs$close.call(fs, fd, function (err) { - if (!err) - retry() - - if (typeof cb === 'function') - cb.apply(this, arguments) - }) -}})(fs.close) - -module.exports.closeSync = -fs.closeSync = (function (fs$closeSync) { return function (fd) { - // Note that graceful-fs also retries when fs.closeSync() fails. - // Looks like a bug to me, although it's probably a harmless one. - var rval = fs$closeSync.apply(fs, arguments) - retry() - return rval -}})(fs.closeSync) - -function patch (fs) { - // Everything that references the open() function needs to be in here - polyfills(fs) - fs.gracefulify = patch - fs.FileReadStream = ReadStream; // Legacy name. - fs.FileWriteStream = WriteStream; // Legacy name. - fs.createReadStream = createReadStream - fs.createWriteStream = createWriteStream - var fs$readFile = fs.readFile - fs.readFile = readFile - function readFile (path, options, cb) { - if (typeof options === 'function') - cb = options, options = null - - return go$readFile(path, options, cb) - - function go$readFile (path, options, cb) { - return fs$readFile(path, options, function (err) { - if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) - enqueue([go$readFile, [path, options, cb]]) - else { - if (typeof cb === 'function') - cb.apply(this, arguments) - retry() - } - }) - } - } - - var fs$writeFile = fs.writeFile - fs.writeFile = writeFile - function writeFile (path, data, options, cb) { - if (typeof options === 'function') - cb = options, options = null - - return go$writeFile(path, data, options, cb) - - function go$writeFile (path, data, options, cb) { - return fs$writeFile(path, data, options, function (err) { - if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) - enqueue([go$writeFile, [path, data, options, cb]]) - else { - if (typeof cb === 'function') - cb.apply(this, arguments) - retry() - } - }) - } - } - - var fs$appendFile = fs.appendFile - if (fs$appendFile) - fs.appendFile = appendFile - function appendFile (path, data, options, cb) { - if (typeof options === 'function') - cb = options, options = null - - return go$appendFile(path, data, options, cb) - - function go$appendFile (path, data, options, cb) { - return fs$appendFile(path, data, options, function (err) { - if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) - enqueue([go$appendFile, [path, data, options, cb]]) - else { - if (typeof cb === 'function') - cb.apply(this, arguments) - retry() - } - }) - } - } - - var fs$readdir = fs.readdir - fs.readdir = readdir - function readdir (path, options, cb) { - var args = [path] - if (typeof options !== 'function') { - args.push(options) - } else { - cb = options - } - args.push(go$readdir$cb) - - return go$readdir(args) - - function go$readdir$cb (err, files) { - if (files && files.sort) - files.sort() - - if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) - enqueue([go$readdir, [args]]) - else { - if (typeof cb === 'function') - cb.apply(this, arguments) - retry() - } - } - } - - function go$readdir (args) { - return fs$readdir.apply(fs, args) - } - - if (process.version.substr(0, 4) === 'v0.8') { - var legStreams = legacy(fs) - ReadStream = legStreams.ReadStream - WriteStream = legStreams.WriteStream - } - - var fs$ReadStream = fs.ReadStream - ReadStream.prototype = Object.create(fs$ReadStream.prototype) - ReadStream.prototype.open = ReadStream$open - - var fs$WriteStream = fs.WriteStream - WriteStream.prototype = Object.create(fs$WriteStream.prototype) - WriteStream.prototype.open = WriteStream$open - - fs.ReadStream = ReadStream - fs.WriteStream = WriteStream - - function ReadStream (path, options) { - if (this instanceof ReadStream) - return fs$ReadStream.apply(this, arguments), this - else - return ReadStream.apply(Object.create(ReadStream.prototype), arguments) - } - - function ReadStream$open () { - var that = this - open(that.path, that.flags, that.mode, function (err, fd) { - if (err) { - if (that.autoClose) - that.destroy() - - that.emit('error', err) - } else { - that.fd = fd - that.emit('open', fd) - that.read() - } - }) - } - - function WriteStream (path, options) { - if (this instanceof WriteStream) - return fs$WriteStream.apply(this, arguments), this - else - return WriteStream.apply(Object.create(WriteStream.prototype), arguments) - } - - function WriteStream$open () { - var that = this - open(that.path, that.flags, that.mode, function (err, fd) { - if (err) { - that.destroy() - that.emit('error', err) - } else { - that.fd = fd - that.emit('open', fd) - } - }) - } - - function createReadStream (path, options) { - return new ReadStream(path, options) - } - - function createWriteStream (path, options) { - return new WriteStream(path, options) - } - - var fs$open = fs.open - fs.open = open - function open (path, flags, mode, cb) { - if (typeof mode === 'function') - cb = mode, mode = null - - return go$open(path, flags, mode, cb) - - function go$open (path, flags, mode, cb) { - return fs$open(path, flags, mode, function (err, fd) { - if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) - enqueue([go$open, [path, flags, mode, cb]]) - else { - if (typeof cb === 'function') - cb.apply(this, arguments) - retry() - } - }) - } - } - - return fs -} - -function enqueue (elem) { - debug('ENQUEUE', elem[0].name, elem[1]) - queue.push(elem) -} - -function retry () { - var elem = queue.shift() - if (elem) { - debug('RETRY', elem[0].name, elem[1]) - elem[0].apply(null, elem[1]) - } -} diff --git a/plugins/music_service/squeezelite/node_modules/graceful-fs/legacy-streams.js b/plugins/music_service/squeezelite/node_modules/graceful-fs/legacy-streams.js deleted file mode 100644 index d617b50fc..000000000 --- a/plugins/music_service/squeezelite/node_modules/graceful-fs/legacy-streams.js +++ /dev/null @@ -1,118 +0,0 @@ -var Stream = require('stream').Stream - -module.exports = legacy - -function legacy (fs) { - return { - ReadStream: ReadStream, - WriteStream: WriteStream - } - - function ReadStream (path, options) { - if (!(this instanceof ReadStream)) return new ReadStream(path, options); - - Stream.call(this); - - var self = this; - - this.path = path; - this.fd = null; - this.readable = true; - this.paused = false; - - this.flags = 'r'; - this.mode = 438; /*=0666*/ - this.bufferSize = 64 * 1024; - - options = options || {}; - - // Mixin options into this - var keys = Object.keys(options); - for (var index = 0, length = keys.length; index < length; index++) { - var key = keys[index]; - this[key] = options[key]; - } - - if (this.encoding) this.setEncoding(this.encoding); - - if (this.start !== undefined) { - if ('number' !== typeof this.start) { - throw TypeError('start must be a Number'); - } - if (this.end === undefined) { - this.end = Infinity; - } else if ('number' !== typeof this.end) { - throw TypeError('end must be a Number'); - } - - if (this.start > this.end) { - throw new Error('start must be <= end'); - } - - this.pos = this.start; - } - - if (this.fd !== null) { - process.nextTick(function() { - self._read(); - }); - return; - } - - fs.open(this.path, this.flags, this.mode, function (err, fd) { - if (err) { - self.emit('error', err); - self.readable = false; - return; - } - - self.fd = fd; - self.emit('open', fd); - self._read(); - }) - } - - function WriteStream (path, options) { - if (!(this instanceof WriteStream)) return new WriteStream(path, options); - - Stream.call(this); - - this.path = path; - this.fd = null; - this.writable = true; - - this.flags = 'w'; - this.encoding = 'binary'; - this.mode = 438; /*=0666*/ - this.bytesWritten = 0; - - options = options || {}; - - // Mixin options into this - var keys = Object.keys(options); - for (var index = 0, length = keys.length; index < length; index++) { - var key = keys[index]; - this[key] = options[key]; - } - - if (this.start !== undefined) { - if ('number' !== typeof this.start) { - throw TypeError('start must be a Number'); - } - if (this.start < 0) { - throw new Error('start must be >= zero'); - } - - this.pos = this.start; - } - - this.busy = false; - this._queue = []; - - if (this.fd === null) { - this._open = fs.open; - this._queue.push([this._open, this.path, this.flags, this.mode, undefined]); - this.flush(); - } - } -} diff --git a/plugins/music_service/squeezelite/node_modules/graceful-fs/package.json b/plugins/music_service/squeezelite/node_modules/graceful-fs/package.json deleted file mode 100644 index 85ccf1d6a..000000000 --- a/plugins/music_service/squeezelite/node_modules/graceful-fs/package.json +++ /dev/null @@ -1,115 +0,0 @@ -{ - "_args": [ - [ - { - "raw": "graceful-fs@^4.1.9", - "scope": null, - "escapedName": "graceful-fs", - "name": "graceful-fs", - "rawSpec": "^4.1.9", - "spec": ">=4.1.9 <5.0.0", - "type": "range" - }, - "/home/volumio/volumio-plugins/plugins/music_service/squeezelite" - ] - ], - "_from": "graceful-fs@>=4.1.9 <5.0.0", - "_id": "graceful-fs@4.1.11", - "_inCache": true, - "_location": "/graceful-fs", - "_nodeVersion": "6.5.0", - "_npmOperationalInternal": { - "host": "packages-18-east.internal.npmjs.com", - "tmp": "tmp/graceful-fs-4.1.11.tgz_1479843029430_0.2122855328489095" - }, - "_npmUser": { - "name": "isaacs", - "email": "i@izs.me" - }, - "_npmVersion": "3.10.9", - "_phantomChildren": {}, - "_requested": { - "raw": "graceful-fs@^4.1.9", - "scope": null, - "escapedName": "graceful-fs", - "name": "graceful-fs", - "rawSpec": "^4.1.9", - "spec": ">=4.1.9 <5.0.0", - "type": "range" - }, - "_requiredBy": [ - "/", - "/fs-extra", - "/jsonfile", - "/klaw", - "/v-conf/fs-extra" - ], - "_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "_shasum": "0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658", - "_shrinkwrap": null, - "_spec": "graceful-fs@^4.1.9", - "_where": "/home/volumio/volumio-plugins/plugins/music_service/squeezelite", - "bugs": { - "url": "https://github.com/isaacs/node-graceful-fs/issues" - }, - "dependencies": {}, - "description": "A drop-in replacement for fs, making various improvements.", - "devDependencies": { - "mkdirp": "^0.5.0", - "rimraf": "^2.2.8", - "tap": "^5.4.2" - }, - "directories": { - "test": "test" - }, - "dist": { - "shasum": "0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658", - "tarball": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz" - }, - "engines": { - "node": ">=0.4.0" - }, - "files": [ - "fs.js", - "graceful-fs.js", - "legacy-streams.js", - "polyfills.js" - ], - "gitHead": "65cf80d1fd3413b823c16c626c1e7c326452bee5", - "homepage": "https://github.com/isaacs/node-graceful-fs#readme", - "keywords": [ - "fs", - "module", - "reading", - "retry", - "retries", - "queue", - "error", - "errors", - "handling", - "EMFILE", - "EAGAIN", - "EINVAL", - "EPERM", - "EACCESS" - ], - "license": "ISC", - "main": "graceful-fs.js", - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "name": "graceful-fs", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/isaacs/node-graceful-fs.git" - }, - "scripts": { - "test": "node test.js | tap -" - }, - "version": "4.1.11" -} diff --git a/plugins/music_service/squeezelite/node_modules/graceful-fs/polyfills.js b/plugins/music_service/squeezelite/node_modules/graceful-fs/polyfills.js deleted file mode 100644 index 4c6aca78a..000000000 --- a/plugins/music_service/squeezelite/node_modules/graceful-fs/polyfills.js +++ /dev/null @@ -1,330 +0,0 @@ -var fs = require('./fs.js') -var constants = require('constants') - -var origCwd = process.cwd -var cwd = null - -var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform - -process.cwd = function() { - if (!cwd) - cwd = origCwd.call(process) - return cwd -} -try { - process.cwd() -} catch (er) {} - -var chdir = process.chdir -process.chdir = function(d) { - cwd = null - chdir.call(process, d) -} - -module.exports = patch - -function patch (fs) { - // (re-)implement some things that are known busted or missing. - - // 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\./)) { - patchLchmod(fs) - } - - // lutimes implementation, or no-op - if (!fs.lutimes) { - patchLutimes(fs) - } - - // https://github.com/isaacs/node-graceful-fs/issues/4 - // Chown should not fail on einval or eperm if non-root. - // It should not fail on enosys ever, as this just indicates - // that a fs doesn't support the intended operation. - - fs.chown = chownFix(fs.chown) - fs.fchown = chownFix(fs.fchown) - fs.lchown = chownFix(fs.lchown) - - fs.chmod = chmodFix(fs.chmod) - fs.fchmod = chmodFix(fs.fchmod) - fs.lchmod = chmodFix(fs.lchmod) - - fs.chownSync = chownFixSync(fs.chownSync) - fs.fchownSync = chownFixSync(fs.fchownSync) - fs.lchownSync = chownFixSync(fs.lchownSync) - - fs.chmodSync = chmodFixSync(fs.chmodSync) - fs.fchmodSync = chmodFixSync(fs.fchmodSync) - fs.lchmodSync = chmodFixSync(fs.lchmodSync) - - fs.stat = statFix(fs.stat) - fs.fstat = statFix(fs.fstat) - fs.lstat = statFix(fs.lstat) - - fs.statSync = statFixSync(fs.statSync) - fs.fstatSync = statFixSync(fs.fstatSync) - fs.lstatSync = statFixSync(fs.lstatSync) - - // if lchmod/lchown do not exist, then make them no-ops - if (!fs.lchmod) { - fs.lchmod = function (path, mode, cb) { - if (cb) process.nextTick(cb) - } - fs.lchmodSync = function () {} - } - if (!fs.lchown) { - fs.lchown = function (path, uid, gid, cb) { - if (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 60 seconds. - - // Set the timeout this long because some Windows Anti-Virus, such as Parity - // bit9, may lock files for up to a minute, causing npm package install - // failures. Also, take care to yield the scheduler. Windows scheduling gives - // CPU to a busy looping process, which can cause the program causing the lock - // contention to be starved of CPU by node, so the contention doesn't resolve. - if (platform === "win32") { - fs.rename = (function (fs$rename) { return function (from, to, cb) { - var start = Date.now() - var backoff = 0; - fs$rename(from, to, function CB (er) { - if (er - && (er.code === "EACCES" || er.code === "EPERM") - && Date.now() - start < 60000) { - setTimeout(function() { - fs.stat(to, function (stater, st) { - if (stater && stater.code === "ENOENT") - fs$rename(from, to, CB); - else - cb(er) - }) - }, backoff) - if (backoff < 100) - backoff += 10; - return; - } - if (cb) cb(er) - }) - }})(fs.rename) - } - - // if read() returns EAGAIN, then just try it again. - fs.read = (function (fs$read) { return 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 fs$read.call(fs, fd, buffer, offset, length, position, callback) - } - callback_.apply(this, arguments) - } - } - return fs$read.call(fs, fd, buffer, offset, length, position, callback) - }})(fs.read) - - fs.readSync = (function (fs$readSync) { return function (fd, buffer, offset, length, position) { - var eagCounter = 0 - while (true) { - try { - return fs$readSync.call(fs, fd, buffer, offset, length, position) - } catch (er) { - if (er.code === 'EAGAIN' && eagCounter < 10) { - eagCounter ++ - continue - } - throw er - } - } - }})(fs.readSync) -} - -function patchLchmod (fs) { - fs.lchmod = function (path, mode, callback) { - fs.open( path - , constants.O_WRONLY | constants.O_SYMLINK - , mode - , function (err, fd) { - if (err) { - if (callback) 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) { - if (callback) 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 threw = true - var ret - try { - ret = fs.fchmodSync(fd, mode) - threw = false - } finally { - if (threw) { - try { - fs.closeSync(fd) - } catch (er) {} - } else { - fs.closeSync(fd) - } - } - return ret - } -} - -function patchLutimes (fs) { - if (constants.hasOwnProperty("O_SYMLINK")) { - fs.lutimes = function (path, at, mt, cb) { - fs.open(path, constants.O_SYMLINK, function (er, fd) { - if (er) { - if (cb) cb(er) - return - } - fs.futimes(fd, at, mt, function (er) { - fs.close(fd, function (er2) { - if (cb) cb(er || er2) - }) - }) - }) - } - - fs.lutimesSync = function (path, at, mt) { - var fd = fs.openSync(path, constants.O_SYMLINK) - var ret - var threw = true - try { - ret = fs.futimesSync(fd, at, mt) - threw = false - } finally { - if (threw) { - try { - fs.closeSync(fd) - } catch (er) {} - } else { - fs.closeSync(fd) - } - } - return ret - } - - } else { - fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) } - fs.lutimesSync = function () {} - } -} - -function chmodFix (orig) { - if (!orig) return orig - return function (target, mode, cb) { - return orig.call(fs, target, mode, function (er) { - if (chownErOk(er)) er = null - if (cb) cb.apply(this, arguments) - }) - } -} - -function chmodFixSync (orig) { - if (!orig) return orig - return function (target, mode) { - try { - return orig.call(fs, target, mode) - } catch (er) { - if (!chownErOk(er)) throw er - } - } -} - - -function chownFix (orig) { - if (!orig) return orig - return function (target, uid, gid, cb) { - return orig.call(fs, target, uid, gid, function (er) { - if (chownErOk(er)) er = null - if (cb) cb.apply(this, arguments) - }) - } -} - -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 statFix (orig) { - if (!orig) return orig - // Older versions of Node erroneously returned signed integers for - // uid + gid. - return function (target, cb) { - return orig.call(fs, target, function (er, stats) { - if (!stats) return cb.apply(this, arguments) - if (stats.uid < 0) stats.uid += 0x100000000 - if (stats.gid < 0) stats.gid += 0x100000000 - if (cb) cb.apply(this, arguments) - }) - } -} - -function statFixSync (orig) { - if (!orig) return orig - // Older versions of Node erroneously returned signed integers for - // uid + gid. - return function (target) { - var stats = orig.call(fs, target) - if (stats.uid < 0) stats.uid += 0x100000000 - if (stats.gid < 0) stats.gid += 0x100000000 - return stats; - } -} - -// ENOSYS means that the fs doesn't support the op. Just ignore -// that, because it doesn't matter. -// -// 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. -function chownErOk (er) { - if (!er) - return true - - if (er.code === "ENOSYS") - return true - - var nonroot = !process.getuid || process.getuid() !== 0 - if (nonroot) { - if (er.code === "EINVAL" || er.code === "EPERM") - return true - } - - return false -} diff --git a/plugins/music_service/squeezelite/node_modules/inflight/LICENSE b/plugins/music_service/squeezelite/node_modules/inflight/LICENSE deleted file mode 100644 index 05eeeb88c..000000000 --- a/plugins/music_service/squeezelite/node_modules/inflight/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/plugins/music_service/squeezelite/node_modules/inflight/README.md b/plugins/music_service/squeezelite/node_modules/inflight/README.md deleted file mode 100644 index 6dc892917..000000000 --- a/plugins/music_service/squeezelite/node_modules/inflight/README.md +++ /dev/null @@ -1,37 +0,0 @@ -# inflight - -Add callbacks to requests in flight to avoid async duplication - -## USAGE - -```javascript -var inflight = require('inflight') - -// some request that does some stuff -function req(key, callback) { - // key is any random string. like a url or filename or whatever. - // - // will return either a falsey value, indicating that the - // request for this key is already in flight, or a new callback - // which when called will call all callbacks passed to inflightk - // with the same key - callback = inflight(key, callback) - - // If we got a falsey value back, then there's already a req going - if (!callback) return - - // this is where you'd fetch the url or whatever - // callback is also once()-ified, so it can safely be assigned - // to multiple events etc. First call wins. - setTimeout(function() { - callback(null, key) - }, 100) -} - -// only assigns a single setTimeout -// when it dings, all cbs get called -req('foo', cb1) -req('foo', cb2) -req('foo', cb3) -req('foo', cb4) -``` diff --git a/plugins/music_service/squeezelite/node_modules/inflight/inflight.js b/plugins/music_service/squeezelite/node_modules/inflight/inflight.js deleted file mode 100644 index 48202b3ca..000000000 --- a/plugins/music_service/squeezelite/node_modules/inflight/inflight.js +++ /dev/null @@ -1,54 +0,0 @@ -var wrappy = require('wrappy') -var reqs = Object.create(null) -var once = require('once') - -module.exports = wrappy(inflight) - -function inflight (key, cb) { - if (reqs[key]) { - reqs[key].push(cb) - return null - } else { - reqs[key] = [cb] - return makeres(key) - } -} - -function makeres (key) { - return once(function RES () { - var cbs = reqs[key] - var len = cbs.length - var args = slice(arguments) - - // XXX It's somewhat ambiguous whether a new callback added in this - // pass should be queued for later execution if something in the - // list of callbacks throws, or if it should just be discarded. - // However, it's such an edge case that it hardly matters, and either - // choice is likely as surprising as the other. - // As it happens, we do go ahead and schedule it for later execution. - try { - for (var i = 0; i < len; i++) { - cbs[i].apply(null, args) - } - } finally { - if (cbs.length > len) { - // added more in the interim. - // de-zalgo, just in case, but don't call again. - cbs.splice(0, len) - process.nextTick(function () { - RES.apply(null, args) - }) - } else { - delete reqs[key] - } - } - }) -} - -function slice (args) { - var length = args.length - var array = [] - - for (var i = 0; i < length; i++) array[i] = args[i] - return array -} diff --git a/plugins/music_service/squeezelite/node_modules/inflight/package.json b/plugins/music_service/squeezelite/node_modules/inflight/package.json deleted file mode 100644 index 28935ddfc..000000000 --- a/plugins/music_service/squeezelite/node_modules/inflight/package.json +++ /dev/null @@ -1,106 +0,0 @@ -{ - "_args": [ - [ - { - "raw": "inflight@^1.0.5", - "scope": null, - "escapedName": "inflight", - "name": "inflight", - "rawSpec": "^1.0.5", - "spec": ">=1.0.5 <2.0.0", - "type": "range" - }, - "/home/volumio/volumio-plugins/plugins/music_service/squeezelite" - ] - ], - "_from": "inflight@>=1.0.5 <2.0.0", - "_id": "inflight@1.0.6", - "_inCache": true, - "_location": "/inflight", - "_nodeVersion": "6.5.0", - "_npmOperationalInternal": { - "host": "packages-16-east.internal.npmjs.com", - "tmp": "tmp/inflight-1.0.6.tgz_1476330807696_0.10388551792129874" - }, - "_npmUser": { - "name": "isaacs", - "email": "i@izs.me" - }, - "_npmVersion": "3.10.7", - "_phantomChildren": {}, - "_requested": { - "raw": "inflight@^1.0.5", - "scope": null, - "escapedName": "inflight", - "name": "inflight", - "rawSpec": "^1.0.5", - "spec": ">=1.0.5 <2.0.0", - "type": "range" - }, - "_requiredBy": [ - "/", - "/glob" - ], - "_resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "_shasum": "49bd6331d7d02d0c09bc910a1075ba8165b56df9", - "_shrinkwrap": null, - "_spec": "inflight@^1.0.5", - "_where": "/home/volumio/volumio-plugins/plugins/music_service/squeezelite", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/isaacs/inflight/issues" - }, - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - }, - "description": "Add callbacks to requests in flight to avoid async duplication", - "devDependencies": { - "tap": "^7.1.2" - }, - "directories": {}, - "dist": { - "shasum": "49bd6331d7d02d0c09bc910a1075ba8165b56df9", - "tarball": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz" - }, - "files": [ - "inflight.js" - ], - "gitHead": "a547881738c8f57b27795e584071d67cf6ac1a57", - "homepage": "https://github.com/isaacs/inflight", - "license": "ISC", - "main": "inflight.js", - "maintainers": [ - { - "name": "iarna", - "email": "me@re-becca.org" - }, - { - "name": "isaacs", - "email": "i@izs.me" - }, - { - "name": "othiym23", - "email": "ogd@aoaioxxysz.net" - }, - { - "name": "zkat", - "email": "kat@sykosomatic.org" - } - ], - "name": "inflight", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/npm/inflight.git" - }, - "scripts": { - "test": "tap test.js --100" - }, - "version": "1.0.6" -} diff --git a/plugins/music_service/squeezelite/node_modules/inherits/LICENSE b/plugins/music_service/squeezelite/node_modules/inherits/LICENSE deleted file mode 100644 index dea3013d6..000000000 --- a/plugins/music_service/squeezelite/node_modules/inherits/LICENSE +++ /dev/null @@ -1,16 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. - diff --git a/plugins/music_service/squeezelite/node_modules/inherits/README.md b/plugins/music_service/squeezelite/node_modules/inherits/README.md deleted file mode 100644 index b1c566585..000000000 --- a/plugins/music_service/squeezelite/node_modules/inherits/README.md +++ /dev/null @@ -1,42 +0,0 @@ -Browser-friendly inheritance fully compatible with standard node.js -[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor). - -This package exports standard `inherits` from node.js `util` module in -node environment, but also provides alternative browser-friendly -implementation through [browser -field](https://gist.github.com/shtylman/4339901). Alternative -implementation is a literal copy of standard one located in standalone -module to avoid requiring of `util`. It also has a shim for old -browsers with no `Object.create` support. - -While keeping you sure you are using standard `inherits` -implementation in node.js environment, it allows bundlers such as -[browserify](https://github.com/substack/node-browserify) to not -include full `util` package to your client code if all you need is -just `inherits` function. It worth, because browser shim for `util` -package is large and `inherits` is often the single function you need -from it. - -It's recommended to use this package instead of -`require('util').inherits` for any code that has chances to be used -not only in node.js but in browser too. - -## usage - -```js -var inherits = require('inherits'); -// then use exactly as the standard one -``` - -## note on version ~1.0 - -Version ~1.0 had completely different motivation and is not compatible -neither with 2.0 nor with standard node.js `inherits`. - -If you are using version ~1.0 and planning to switch to ~2.0, be -careful: - -* new version uses `super_` instead of `super` for referencing - superclass -* new version overwrites current prototype while old one preserves any - existing fields on it diff --git a/plugins/music_service/squeezelite/node_modules/inherits/inherits.js b/plugins/music_service/squeezelite/node_modules/inherits/inherits.js deleted file mode 100644 index 3b94763a7..000000000 --- a/plugins/music_service/squeezelite/node_modules/inherits/inherits.js +++ /dev/null @@ -1,7 +0,0 @@ -try { - var util = require('util'); - if (typeof util.inherits !== 'function') throw ''; - module.exports = util.inherits; -} catch (e) { - module.exports = require('./inherits_browser.js'); -} diff --git a/plugins/music_service/squeezelite/node_modules/inherits/inherits_browser.js b/plugins/music_service/squeezelite/node_modules/inherits/inherits_browser.js deleted file mode 100644 index c1e78a75e..000000000 --- a/plugins/music_service/squeezelite/node_modules/inherits/inherits_browser.js +++ /dev/null @@ -1,23 +0,0 @@ -if (typeof Object.create === 'function') { - // implementation from standard node.js 'util' module - module.exports = function inherits(ctor, superCtor) { - ctor.super_ = superCtor - ctor.prototype = Object.create(superCtor.prototype, { - constructor: { - value: ctor, - enumerable: false, - writable: true, - configurable: true - } - }); - }; -} else { - // old school shim for old browsers - module.exports = function inherits(ctor, superCtor) { - ctor.super_ = superCtor - var TempCtor = function () {} - TempCtor.prototype = superCtor.prototype - ctor.prototype = new TempCtor() - ctor.prototype.constructor = ctor - } -} diff --git a/plugins/music_service/squeezelite/node_modules/inherits/package.json b/plugins/music_service/squeezelite/node_modules/inherits/package.json deleted file mode 100644 index 9e6271cb5..000000000 --- a/plugins/music_service/squeezelite/node_modules/inherits/package.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "_args": [ - [ - { - "raw": "inherits@^2.0.3", - "scope": null, - "escapedName": "inherits", - "name": "inherits", - "rawSpec": "^2.0.3", - "spec": ">=2.0.3 <3.0.0", - "type": "range" - }, - "/home/volumio/volumio-plugins/plugins/music_service/squeezelite" - ] - ], - "_from": "inherits@>=2.0.3 <3.0.0", - "_id": "inherits@2.0.3", - "_inCache": true, - "_location": "/inherits", - "_nodeVersion": "6.5.0", - "_npmOperationalInternal": { - "host": "packages-16-east.internal.npmjs.com", - "tmp": "tmp/inherits-2.0.3.tgz_1473295776489_0.08142363070510328" - }, - "_npmUser": { - "name": "isaacs", - "email": "i@izs.me" - }, - "_npmVersion": "3.10.7", - "_phantomChildren": {}, - "_requested": { - "raw": "inherits@^2.0.3", - "scope": null, - "escapedName": "inherits", - "name": "inherits", - "rawSpec": "^2.0.3", - "spec": ">=2.0.3 <3.0.0", - "type": "range" - }, - "_requiredBy": [ - "/", - "/glob" - ], - "_resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "_shasum": "633c2c83e3da42a502f52466022480f4208261de", - "_shrinkwrap": null, - "_spec": "inherits@^2.0.3", - "_where": "/home/volumio/volumio-plugins/plugins/music_service/squeezelite", - "browser": "./inherits_browser.js", - "bugs": { - "url": "https://github.com/isaacs/inherits/issues" - }, - "dependencies": {}, - "description": "Browser-friendly inheritance fully compatible with standard node.js inherits()", - "devDependencies": { - "tap": "^7.1.0" - }, - "directories": {}, - "dist": { - "shasum": "633c2c83e3da42a502f52466022480f4208261de", - "tarball": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz" - }, - "files": [ - "inherits.js", - "inherits_browser.js" - ], - "gitHead": "e05d0fb27c61a3ec687214f0476386b765364d5f", - "homepage": "https://github.com/isaacs/inherits#readme", - "keywords": [ - "inheritance", - "class", - "klass", - "oop", - "object-oriented", - "inherits", - "browser", - "browserify" - ], - "license": "ISC", - "main": "./inherits.js", - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "name": "inherits", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/inherits.git" - }, - "scripts": { - "test": "node test" - }, - "version": "2.0.3" -} diff --git a/plugins/music_service/squeezelite/node_modules/ip/.jscsrc b/plugins/music_service/squeezelite/node_modules/ip/.jscsrc deleted file mode 100644 index dbaae2057..000000000 --- a/plugins/music_service/squeezelite/node_modules/ip/.jscsrc +++ /dev/null @@ -1,46 +0,0 @@ -{ - "disallowKeywordsOnNewLine": [ "else" ], - "disallowMixedSpacesAndTabs": true, - "disallowMultipleLineStrings": true, - "disallowMultipleVarDecl": true, - "disallowNewlineBeforeBlockStatements": true, - "disallowQuotedKeysInObjects": true, - "disallowSpaceAfterObjectKeys": true, - "disallowSpaceAfterPrefixUnaryOperators": true, - "disallowSpaceBeforePostfixUnaryOperators": true, - "disallowSpacesInCallExpression": true, - "disallowTrailingComma": true, - "disallowTrailingWhitespace": true, - "disallowYodaConditions": true, - - "requireCommaBeforeLineBreak": true, - "requireOperatorBeforeLineBreak": true, - "requireSpaceAfterBinaryOperators": true, - "requireSpaceAfterKeywords": [ "if", "for", "while", "else", "try", "catch" ], - "requireSpaceAfterLineComment": true, - "requireSpaceBeforeBinaryOperators": true, - "requireSpaceBeforeBlockStatements": true, - "requireSpaceBeforeKeywords": [ "else", "catch" ], - "requireSpaceBeforeObjectValues": true, - "requireSpaceBetweenArguments": true, - "requireSpacesInAnonymousFunctionExpression": { - "beforeOpeningCurlyBrace": true - }, - "requireSpacesInFunctionDeclaration": { - "beforeOpeningCurlyBrace": true - }, - "requireSpacesInFunctionExpression": { - "beforeOpeningCurlyBrace": true - }, - "requireSpacesInConditionalExpression": true, - "requireSpacesInForStatement": true, - "requireSpacesInsideArrayBrackets": "all", - "requireSpacesInsideObjectBrackets": "all", - "requireDotNotation": true, - - "maximumLineLength": 80, - "validateIndentation": 2, - "validateLineBreaks": "LF", - "validateParameterSeparator": ", ", - "validateQuoteMarks": "'" -} diff --git a/plugins/music_service/squeezelite/node_modules/ip/.jshintrc b/plugins/music_service/squeezelite/node_modules/ip/.jshintrc deleted file mode 100644 index 7e9739029..000000000 --- a/plugins/music_service/squeezelite/node_modules/ip/.jshintrc +++ /dev/null @@ -1,89 +0,0 @@ -{ - // JSHint Default Configuration File (as on JSHint website) - // See http://jshint.com/docs/ for more details - - "maxerr" : 50, // {int} Maximum error before stopping - - // Enforcing - "bitwise" : false, // true: Prohibit bitwise operators (&, |, ^, etc.) - "camelcase" : false, // true: Identifiers must be in camelCase - "curly" : false, // true: Require {} for every new block or scope - "eqeqeq" : true, // true: Require triple equals (===) for comparison - "forin" : true, // true: Require filtering for..in loops with obj.hasOwnProperty() - "freeze" : true, // true: prohibits overwriting prototypes of native objects such as Array, Date etc. - "immed" : false, // true: Require immediate invocations to be wrapped in parens e.g. `(function () { } ());` - "indent" : 2, // {int} Number of spaces to use for indentation - "latedef" : true, // true: Require variables/functions to be defined before being used - "newcap" : true, // true: Require capitalization of all constructor functions e.g. `new F()` - "noarg" : true, // true: Prohibit use of `arguments.caller` and `arguments.callee` - "noempty" : false, // true: Prohibit use of empty blocks - "nonbsp" : true, // true: Prohibit "non-breaking whitespace" characters. - "nonew" : false, // true: Prohibit use of constructors for side-effects (without assignment) - "plusplus" : false, // true: Prohibit use of `++` & `--` - "quotmark" : "single", // Quotation mark consistency: - // false : do nothing (default) - // true : ensure whatever is used is consistent - // "single" : require single quotes - // "double" : require double quotes - "undef" : true, // true: Require all non-global variables to be declared (prevents global leaks) - "unused" : true, // true: Require all defined variables be used - "strict" : true, // true: Requires all functions run in ES5 Strict Mode - "maxparams" : false, // {int} Max number of formal params allowed per function - "maxdepth" : 3, // {int} Max depth of nested blocks (within functions) - "maxstatements" : false, // {int} Max number statements per function - "maxcomplexity" : false, // {int} Max cyclomatic complexity per function - "maxlen" : false, // {int} Max number of characters per line - - // Relaxing - "asi" : false, // true: Tolerate Automatic Semicolon Insertion (no semicolons) - "boss" : false, // true: Tolerate assignments where comparisons would be expected - "debug" : false, // true: Allow debugger statements e.g. browser breakpoints. - "eqnull" : false, // true: Tolerate use of `== null` - "es5" : false, // true: Allow ES5 syntax (ex: getters and setters) - "esnext" : false, // true: Allow ES.next (ES6) syntax (ex: `const`) - "moz" : false, // true: Allow Mozilla specific syntax (extends and overrides esnext features) - // (ex: `for each`, multiple try/catch, function expression…) - "evil" : false, // true: Tolerate use of `eval` and `new Function()` - "expr" : false, // true: Tolerate `ExpressionStatement` as Programs - "funcscope" : false, // true: Tolerate defining variables inside control statements - "globalstrict" : false, // true: Allow global "use strict" (also enables 'strict') - "iterator" : false, // true: Tolerate using the `__iterator__` property - "lastsemic" : false, // true: Tolerate omitting a semicolon for the last statement of a 1-line block - "laxbreak" : false, // true: Tolerate possibly unsafe line breakings - "laxcomma" : false, // true: Tolerate comma-first style coding - "loopfunc" : false, // true: Tolerate functions being defined in loops - "multistr" : false, // true: Tolerate multi-line strings - "noyield" : false, // true: Tolerate generator functions with no yield statement in them. - "notypeof" : false, // true: Tolerate invalid typeof operator values - "proto" : false, // true: Tolerate using the `__proto__` property - "scripturl" : false, // true: Tolerate script-targeted URLs - "shadow" : true, // true: Allows re-define variables later in code e.g. `var x=1; x=2;` - "sub" : false, // true: Tolerate using `[]` notation when it can still be expressed in dot notation - "supernew" : false, // true: Tolerate `new function () { ... };` and `new Object;` - "validthis" : false, // true: Tolerate using this in a non-constructor function - - // Environments - "browser" : true, // Web Browser (window, document, etc) - "browserify" : true, // Browserify (node.js code in the browser) - "couch" : false, // CouchDB - "devel" : true, // Development/debugging (alert, confirm, etc) - "dojo" : false, // Dojo Toolkit - "jasmine" : false, // Jasmine - "jquery" : false, // jQuery - "mocha" : true, // Mocha - "mootools" : false, // MooTools - "node" : true, // Node.js - "nonstandard" : false, // Widely adopted globals (escape, unescape, etc) - "prototypejs" : false, // Prototype and Scriptaculous - "qunit" : false, // QUnit - "rhino" : false, // Rhino - "shelljs" : false, // ShellJS - "worker" : false, // Web Workers - "wsh" : false, // Windows Scripting Host - "yui" : false, // Yahoo User Interface - - // Custom Globals - "globals" : { - "module": true - } // additional predefined global variables -} diff --git a/plugins/music_service/squeezelite/node_modules/ip/.npmignore b/plugins/music_service/squeezelite/node_modules/ip/.npmignore deleted file mode 100644 index 1ca957177..000000000 --- a/plugins/music_service/squeezelite/node_modules/ip/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules/ -npm-debug.log diff --git a/plugins/music_service/squeezelite/node_modules/ip/.travis.yml b/plugins/music_service/squeezelite/node_modules/ip/.travis.yml deleted file mode 100644 index a3a8fad6b..000000000 --- a/plugins/music_service/squeezelite/node_modules/ip/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -sudo: false -language: node_js -node_js: - - "0.8" - - "0.10" - - "0.12" - - "4" - - "6" - -before_install: - - travis_retry npm install -g npm@2.14.5 - - travis_retry npm install - -script: - - npm test diff --git a/plugins/music_service/squeezelite/node_modules/ip/README.md b/plugins/music_service/squeezelite/node_modules/ip/README.md deleted file mode 100644 index 22e5819ff..000000000 --- a/plugins/music_service/squeezelite/node_modules/ip/README.md +++ /dev/null @@ -1,90 +0,0 @@ -# IP -[![](https://badge.fury.io/js/ip.svg)](https://www.npmjs.com/package/ip) - -IP address utilities for node.js - -## Installation - -### npm -```shell -npm install ip -``` - -### git - -```shell -git clone https://github.com/indutny/node-ip.git -``` - -## Usage -Get your ip address, compare ip addresses, validate ip addresses, etc. - -```js -var ip = require('ip'); - -ip.address() // my ip address -ip.isEqual('::1', '::0:1'); // true -ip.toBuffer('127.0.0.1') // Buffer([127, 0, 0, 1]) -ip.toString(new Buffer([127, 0, 0, 1])) // 127.0.0.1 -ip.fromPrefixLen(24) // 255.255.255.0 -ip.mask('192.168.1.134', '255.255.255.0') // 192.168.1.0 -ip.cidr('192.168.1.134/26') // 192.168.1.128 -ip.not('255.255.255.0') // 0.0.0.255 -ip.or('192.168.1.134', '0.0.0.255') // 192.168.1.255 -ip.isPrivate('127.0.0.1') // true -ip.isV4Format('127.0.0.1'); // true -ip.isV6Format('::ffff:127.0.0.1'); // true - -// operate on buffers in-place -var buf = new Buffer(128); -var offset = 64; -ip.toBuffer('127.0.0.1', buf, offset); // [127, 0, 0, 1] at offset 64 -ip.toString(buf, offset, 4); // '127.0.0.1' - -// subnet information -ip.subnet('192.168.1.134', '255.255.255.192') -// { networkAddress: '192.168.1.128', -// firstAddress: '192.168.1.129', -// lastAddress: '192.168.1.190', -// broadcastAddress: '192.168.1.191', -// subnetMask: '255.255.255.192', -// subnetMaskLength: 26, -// numHosts: 62, -// length: 64, -// contains: function(addr){...} } -ip.cidrSubnet('192.168.1.134/26') -// Same as previous. - -// range checking -ip.cidrSubnet('192.168.1.134/26').contains('192.168.1.190') // true - - -// ipv4 long conversion -ip.toLong('127.0.0.1'); // 2130706433 -ip.fromLong(2130706433); // '127.0.0.1' -``` - -### License - -This software is licensed under the MIT License. - -Copyright Fedor Indutny, 2012. - -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/plugins/music_service/squeezelite/node_modules/ip/lib/ip.js b/plugins/music_service/squeezelite/node_modules/ip/lib/ip.js deleted file mode 100644 index c1799a8c5..000000000 --- a/plugins/music_service/squeezelite/node_modules/ip/lib/ip.js +++ /dev/null @@ -1,416 +0,0 @@ -'use strict'; - -var ip = exports; -var Buffer = require('buffer').Buffer; -var os = require('os'); - -ip.toBuffer = function(ip, buff, offset) { - offset = ~~offset; - - var result; - - if (this.isV4Format(ip)) { - result = buff || new Buffer(offset + 4); - ip.split(/\./g).map(function(byte) { - result[offset++] = parseInt(byte, 10) & 0xff; - }); - } else if (this.isV6Format(ip)) { - var sections = ip.split(':', 8); - - var i; - for (i = 0; i < sections.length; i++) { - var isv4 = this.isV4Format(sections[i]); - var v4Buffer; - - if (isv4) { - v4Buffer = this.toBuffer(sections[i]); - sections[i] = v4Buffer.slice(0, 2).toString('hex'); - } - - if (v4Buffer && ++i < 8) { - sections.splice(i, 0, v4Buffer.slice(2, 4).toString('hex')); - } - } - - if (sections[0] === '') { - while (sections.length < 8) sections.unshift('0'); - } else if (sections[sections.length - 1] === '') { - while (sections.length < 8) sections.push('0'); - } else if (sections.length < 8) { - for (i = 0; i < sections.length && sections[i] !== ''; i++); - var argv = [ i, 1 ]; - for (i = 9 - sections.length; i > 0; i--) { - argv.push('0'); - } - sections.splice.apply(sections, argv); - } - - result = buff || new Buffer(offset + 16); - for (i = 0; i < sections.length; i++) { - var word = parseInt(sections[i], 16); - result[offset++] = (word >> 8) & 0xff; - result[offset++] = word & 0xff; - } - } - - if (!result) { - throw Error('Invalid ip address: ' + ip); - } - - return result; -}; - -ip.toString = function(buff, offset, length) { - offset = ~~offset; - length = length || (buff.length - offset); - - var result = []; - if (length === 4) { - // IPv4 - for (var i = 0; i < length; i++) { - result.push(buff[offset + i]); - } - result = result.join('.'); - } else if (length === 16) { - // IPv6 - for (var i = 0; i < length; i += 2) { - result.push(buff.readUInt16BE(offset + i).toString(16)); - } - result = result.join(':'); - result = result.replace(/(^|:)0(:0)*:0(:|$)/, '$1::$3'); - result = result.replace(/:{3,4}/, '::'); - } - - return result; -}; - -var ipv4Regex = /^(\d{1,3}\.){3,3}\d{1,3}$/; -var ipv6Regex = - /^(::)?(((\d{1,3}\.){3}(\d{1,3}){1})?([0-9a-f]){0,4}:{0,2}){1,8}(::)?$/i; - -ip.isV4Format = function(ip) { - return ipv4Regex.test(ip); -}; - -ip.isV6Format = function(ip) { - return ipv6Regex.test(ip); -}; -function _normalizeFamily(family) { - return family ? family.toLowerCase() : 'ipv4'; -} - -ip.fromPrefixLen = function(prefixlen, family) { - if (prefixlen > 32) { - family = 'ipv6'; - } else { - family = _normalizeFamily(family); - } - - var len = 4; - if (family === 'ipv6') { - len = 16; - } - var buff = new Buffer(len); - - for (var i = 0, n = buff.length; i < n; ++i) { - var bits = 8; - if (prefixlen < 8) { - bits = prefixlen; - } - prefixlen -= bits; - - buff[i] = ~(0xff >> bits) & 0xff; - } - - return ip.toString(buff); -}; - -ip.mask = function(addr, mask) { - addr = ip.toBuffer(addr); - mask = ip.toBuffer(mask); - - var result = new Buffer(Math.max(addr.length, mask.length)); - - var i = 0; - // Same protocol - do bitwise and - if (addr.length === mask.length) { - for (i = 0; i < addr.length; i++) { - result[i] = addr[i] & mask[i]; - } - } else if (mask.length === 4) { - // IPv6 address and IPv4 mask - // (Mask low bits) - for (i = 0; i < mask.length; i++) { - result[i] = addr[addr.length - 4 + i] & mask[i]; - } - } else { - // IPv6 mask and IPv4 addr - for (var i = 0; i < result.length - 6; i++) { - result[i] = 0; - } - - // ::ffff:ipv4 - result[10] = 0xff; - result[11] = 0xff; - for (i = 0; i < addr.length; i++) { - result[i + 12] = addr[i] & mask[i + 12]; - } - i = i + 12; - } - for (; i < result.length; i++) - result[i] = 0; - - return ip.toString(result); -}; - -ip.cidr = function(cidrString) { - var cidrParts = cidrString.split('/'); - - var addr = cidrParts[0]; - if (cidrParts.length !== 2) - throw new Error('invalid CIDR subnet: ' + addr); - - var mask = ip.fromPrefixLen(parseInt(cidrParts[1], 10)); - - return ip.mask(addr, mask); -}; - -ip.subnet = function(addr, mask) { - var networkAddress = ip.toLong(ip.mask(addr, mask)); - - // Calculate the mask's length. - var maskBuffer = ip.toBuffer(mask); - var maskLength = 0; - - for (var i = 0; i < maskBuffer.length; i++) { - if (maskBuffer[i] === 0xff) { - maskLength += 8; - } else { - var octet = maskBuffer[i] & 0xff; - while (octet) { - octet = (octet << 1) & 0xff; - maskLength++; - } - } - } - - var numberOfAddresses = Math.pow(2, 32 - maskLength); - - return { - networkAddress: ip.fromLong(networkAddress), - firstAddress: numberOfAddresses <= 2 ? - ip.fromLong(networkAddress) : - ip.fromLong(networkAddress + 1), - lastAddress: numberOfAddresses <= 2 ? - ip.fromLong(networkAddress + numberOfAddresses - 1) : - ip.fromLong(networkAddress + numberOfAddresses - 2), - broadcastAddress: ip.fromLong(networkAddress + numberOfAddresses - 1), - subnetMask: mask, - subnetMaskLength: maskLength, - numHosts: numberOfAddresses <= 2 ? - numberOfAddresses : numberOfAddresses - 2, - length: numberOfAddresses, - contains: function(other) { - return networkAddress === ip.toLong(ip.mask(other, mask)); - } - }; -}; - -ip.cidrSubnet = function(cidrString) { - var cidrParts = cidrString.split('/'); - - var addr = cidrParts[0]; - if (cidrParts.length !== 2) - throw new Error('invalid CIDR subnet: ' + addr); - - var mask = ip.fromPrefixLen(parseInt(cidrParts[1], 10)); - - return ip.subnet(addr, mask); -}; - -ip.not = function(addr) { - var buff = ip.toBuffer(addr); - for (var i = 0; i < buff.length; i++) { - buff[i] = 0xff ^ buff[i]; - } - return ip.toString(buff); -}; - -ip.or = function(a, b) { - a = ip.toBuffer(a); - b = ip.toBuffer(b); - - // same protocol - if (a.length === b.length) { - for (var i = 0; i < a.length; ++i) { - a[i] |= b[i]; - } - return ip.toString(a); - - // mixed protocols - } else { - var buff = a; - var other = b; - if (b.length > a.length) { - buff = b; - other = a; - } - - var offset = buff.length - other.length; - for (var i = offset; i < buff.length; ++i) { - buff[i] |= other[i - offset]; - } - - return ip.toString(buff); - } -}; - -ip.isEqual = function(a, b) { - a = ip.toBuffer(a); - b = ip.toBuffer(b); - - // Same protocol - if (a.length === b.length) { - for (var i = 0; i < a.length; i++) { - if (a[i] !== b[i]) return false; - } - return true; - } - - // Swap - if (b.length === 4) { - var t = b; - b = a; - a = t; - } - - // a - IPv4, b - IPv6 - for (var i = 0; i < 10; i++) { - if (b[i] !== 0) return false; - } - - var word = b.readUInt16BE(10); - if (word !== 0 && word !== 0xffff) return false; - - for (var i = 0; i < 4; i++) { - if (a[i] !== b[i + 12]) return false; - } - - return true; -}; - -ip.isPrivate = function(addr) { - return /^(::f{4}:)?10\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/i - .test(addr) || - /^(::f{4}:)?192\.168\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(addr) || - /^(::f{4}:)?172\.(1[6-9]|2\d|30|31)\.([0-9]{1,3})\.([0-9]{1,3})$/i - .test(addr) || - /^(::f{4}:)?127\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(addr) || - /^(::f{4}:)?169\.254\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(addr) || - /^f[cd][0-9a-f]{2}:/i.test(addr) || - /^fe80:/i.test(addr) || - /^::1$/.test(addr) || - /^::$/.test(addr); -}; - -ip.isPublic = function(addr) { - return !ip.isPrivate(addr); -}; - -ip.isLoopback = function(addr) { - return /^(::f{4}:)?127\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})/ - .test(addr) || - /^fe80::1$/.test(addr) || - /^::1$/.test(addr) || - /^::$/.test(addr); -}; - -ip.loopback = function(family) { - // - // Default to `ipv4` - // - family = _normalizeFamily(family); - - if (family !== 'ipv4' && family !== 'ipv6') { - throw new Error('family must be ipv4 or ipv6'); - } - - return family === 'ipv4' ? '127.0.0.1' : 'fe80::1'; -}; - -// -// ### function address (name, family) -// #### @name {string|'public'|'private'} **Optional** Name or security -// of the network interface. -// #### @family {ipv4|ipv6} **Optional** IP family of the address (defaults -// to ipv4). -// -// Returns the address for the network interface on the current system with -// the specified `name`: -// * String: First `family` address of the interface. -// If not found see `undefined`. -// * 'public': the first public ip address of family. -// * 'private': the first private ip address of family. -// * undefined: First address with `ipv4` or loopback address `127.0.0.1`. -// -ip.address = function(name, family) { - var interfaces = os.networkInterfaces(); - var all; - - // - // Default to `ipv4` - // - family = _normalizeFamily(family); - - // - // If a specific network interface has been named, - // return the address. - // - if (name && name !== 'private' && name !== 'public') { - var res = interfaces[name].filter(function(details) { - var itemFamily = details.family.toLowerCase(); - return itemFamily === family; - }); - if (res.length === 0) - return undefined; - return res[0].address; - } - - var all = Object.keys(interfaces).map(function (nic) { - // - // Note: name will only be `public` or `private` - // when this is called. - // - var addresses = interfaces[nic].filter(function (details) { - details.family = details.family.toLowerCase(); - if (details.family !== family || ip.isLoopback(details.address)) { - return false; - } else if (!name) { - return true; - } - - return name === 'public' ? ip.isPrivate(details.address) : - ip.isPublic(details.address); - }); - - return addresses.length ? addresses[0].address : undefined; - }).filter(Boolean); - - return !all.length ? ip.loopback(family) : all[0]; -}; - -ip.toLong = function(ip) { - var ipl = 0; - ip.split('.').forEach(function(octet) { - ipl <<= 8; - ipl += parseInt(octet); - }); - return(ipl >>> 0); -}; - -ip.fromLong = function(ipl) { - return ((ipl >>> 24) + '.' + - (ipl >> 16 & 255) + '.' + - (ipl >> 8 & 255) + '.' + - (ipl & 255) ); -}; diff --git a/plugins/music_service/squeezelite/node_modules/ip/package.json b/plugins/music_service/squeezelite/node_modules/ip/package.json deleted file mode 100644 index d3759bfd6..000000000 --- a/plugins/music_service/squeezelite/node_modules/ip/package.json +++ /dev/null @@ -1,105 +0,0 @@ -{ - "_args": [ - [ - { - "raw": "ip@^1.1.5", - "scope": null, - "escapedName": "ip", - "name": "ip", - "rawSpec": "^1.1.5", - "spec": ">=1.1.5 <2.0.0", - "type": "range" - }, - "/home/volumio/volumio-plugins/plugins/music_service/squeezelite" - ] - ], - "_from": "ip@>=1.1.5 <2.0.0", - "_id": "ip@1.1.5", - "_inCache": true, - "_location": "/ip", - "_nodeVersion": "7.0.0", - "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/ip-1.1.5.tgz_1488591504778_0.018333946587517858" - }, - "_npmUser": { - "name": "indutny", - "email": "fedor@indutny.com" - }, - "_npmVersion": "3.10.8", - "_phantomChildren": {}, - "_requested": { - "raw": "ip@^1.1.5", - "scope": null, - "escapedName": "ip", - "name": "ip", - "rawSpec": "^1.1.5", - "spec": ">=1.1.5 <2.0.0", - "type": "range" - }, - "_requiredBy": [ - "/" - ], - "_resolved": "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz", - "_shasum": "bdded70114290828c0a039e72ef25f5aaec4354a", - "_shrinkwrap": null, - "_spec": "ip@^1.1.5", - "_where": "/home/volumio/volumio-plugins/plugins/music_service/squeezelite", - "author": { - "name": "Fedor Indutny", - "email": "fedor@indutny.com" - }, - "bugs": { - "url": "https://github.com/indutny/node-ip/issues" - }, - "dependencies": {}, - "description": "[![](https://badge.fury.io/js/ip.svg)](https://www.npmjs.com/package/ip)", - "devDependencies": { - "jscs": "^2.1.1", - "jshint": "^2.8.0", - "mocha": "~1.3.2" - }, - "directories": {}, - "dist": { - "shasum": "bdded70114290828c0a039e72ef25f5aaec4354a", - "tarball": "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz" - }, - "gitHead": "43e442366bf5a93493c8c4c36736f87d675b0c3d", - "homepage": "https://github.com/indutny/node-ip", - "license": "MIT", - "main": "lib/ip", - "maintainers": [ - { - "name": "bcbailey", - "email": "brad@memoryleak.org" - }, - { - "name": "fedor.indutny", - "email": "fedor.indutny@gmail.com" - }, - { - "name": "indexzero", - "email": "charlie.robbins@gmail.com" - }, - { - "name": "indutny", - "email": "fedor@indutny.com" - }, - { - "name": "mmalecki", - "email": "me@mmalecki.com" - } - ], - "name": "ip", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/indutny/node-ip.git" - }, - "scripts": { - "fix": "jscs lib/*.js test/*.js --fix", - "test": "jscs lib/*.js test/*.js && jshint lib/*.js && mocha --reporter spec test/*-test.js" - }, - "version": "1.1.5" -} diff --git a/plugins/music_service/squeezelite/node_modules/ip/test/api-test.js b/plugins/music_service/squeezelite/node_modules/ip/test/api-test.js deleted file mode 100644 index 2e390f986..000000000 --- a/plugins/music_service/squeezelite/node_modules/ip/test/api-test.js +++ /dev/null @@ -1,407 +0,0 @@ -'use strict'; - -var ip = require('..'); -var assert = require('assert'); -var net = require('net'); -var os = require('os'); - -describe('IP library for node.js', function() { - describe('toBuffer()/toString() methods', function() { - it('should convert to buffer IPv4 address', function() { - var buf = ip.toBuffer('127.0.0.1'); - assert.equal(buf.toString('hex'), '7f000001'); - assert.equal(ip.toString(buf), '127.0.0.1'); - }); - - it('should convert to buffer IPv4 address in-place', function() { - var buf = new Buffer(128); - var offset = 64; - ip.toBuffer('127.0.0.1', buf, offset); - assert.equal(buf.toString('hex', offset, offset + 4), '7f000001'); - assert.equal(ip.toString(buf, offset, 4), '127.0.0.1'); - }); - - it('should convert to buffer IPv6 address', function() { - var buf = ip.toBuffer('::1'); - assert(/(00){15,15}01/.test(buf.toString('hex'))); - assert.equal(ip.toString(buf), '::1'); - assert.equal(ip.toString(ip.toBuffer('1::')), '1::'); - assert.equal(ip.toString(ip.toBuffer('abcd::dcba')), 'abcd::dcba'); - }); - - it('should convert to buffer IPv6 address in-place', function() { - var buf = new Buffer(128); - var offset = 64; - ip.toBuffer('::1', buf, offset); - assert(/(00){15,15}01/.test(buf.toString('hex', offset, offset + 16))); - assert.equal(ip.toString(buf, offset, 16), '::1'); - assert.equal(ip.toString(ip.toBuffer('1::', buf, offset), - offset, 16), '1::'); - assert.equal(ip.toString(ip.toBuffer('abcd::dcba', buf, offset), - offset, 16), 'abcd::dcba'); - }); - - it('should convert to buffer IPv6 mapped IPv4 address', function() { - var buf = ip.toBuffer('::ffff:127.0.0.1'); - assert.equal(buf.toString('hex'), '00000000000000000000ffff7f000001'); - assert.equal(ip.toString(buf), '::ffff:7f00:1'); - - buf = ip.toBuffer('ffff::127.0.0.1'); - assert.equal(buf.toString('hex'), 'ffff000000000000000000007f000001'); - assert.equal(ip.toString(buf), 'ffff::7f00:1'); - - buf = ip.toBuffer('0:0:0:0:0:ffff:127.0.0.1'); - assert.equal(buf.toString('hex'), '00000000000000000000ffff7f000001'); - assert.equal(ip.toString(buf), '::ffff:7f00:1'); - }); - }); - - describe('fromPrefixLen() method', function() { - it('should create IPv4 mask', function() { - assert.equal(ip.fromPrefixLen(24), '255.255.255.0'); - }); - it('should create IPv6 mask', function() { - assert.equal(ip.fromPrefixLen(64), 'ffff:ffff:ffff:ffff::'); - }); - it('should create IPv6 mask explicitly', function() { - assert.equal(ip.fromPrefixLen(24, 'IPV6'), 'ffff:ff00::'); - }); - }); - - describe('not() method', function() { - it('should reverse bits in address', function() { - assert.equal(ip.not('255.255.255.0'), '0.0.0.255'); - }); - }); - - describe('or() method', function() { - it('should or bits in ipv4 addresses', function() { - assert.equal(ip.or('0.0.0.255', '192.168.1.10'), '192.168.1.255'); - }); - it('should or bits in ipv6 addresses', function() { - assert.equal(ip.or('::ff', '::abcd:dcba:abcd:dcba'), - '::abcd:dcba:abcd:dcff'); - }); - it('should or bits in mixed addresses', function() { - assert.equal(ip.or('0.0.0.255', '::abcd:dcba:abcd:dcba'), - '::abcd:dcba:abcd:dcff'); - }); - }); - - describe('mask() method', function() { - it('should mask bits in address', function() { - assert.equal(ip.mask('192.168.1.134', '255.255.255.0'), '192.168.1.0'); - assert.equal(ip.mask('192.168.1.134', '::ffff:ff00'), '::ffff:c0a8:100'); - }); - - it('should not leak data', function() { - for (var i = 0; i < 10; i++) - assert.equal(ip.mask('::1', '0.0.0.0'), '::'); - }); - }); - - describe('subnet() method', function() { - // Test cases calculated with http://www.subnet-calculator.com/ - var ipv4Subnet = ip.subnet('192.168.1.134', '255.255.255.192'); - - it('should compute ipv4 network address', function() { - assert.equal(ipv4Subnet.networkAddress, '192.168.1.128'); - }); - - it('should compute ipv4 network\'s first address', function() { - assert.equal(ipv4Subnet.firstAddress, '192.168.1.129'); - }); - - it('should compute ipv4 network\'s last address', function() { - assert.equal(ipv4Subnet.lastAddress, '192.168.1.190'); - }); - - it('should compute ipv4 broadcast address', function() { - assert.equal(ipv4Subnet.broadcastAddress, '192.168.1.191'); - }); - - it('should compute ipv4 subnet number of addresses', function() { - assert.equal(ipv4Subnet.length, 64); - }); - - it('should compute ipv4 subnet number of addressable hosts', function() { - assert.equal(ipv4Subnet.numHosts, 62); - }); - - it('should compute ipv4 subnet mask', function() { - assert.equal(ipv4Subnet.subnetMask, '255.255.255.192'); - }); - - it('should compute ipv4 subnet mask\'s length', function() { - assert.equal(ipv4Subnet.subnetMaskLength, 26); - }); - - it('should know whether a subnet contains an address', function() { - assert.equal(ipv4Subnet.contains('192.168.1.180'), true); - }); - - it('should know whether a subnet does not contain an address', function() { - assert.equal(ipv4Subnet.contains('192.168.1.195'), false); - }); - }); - - describe('subnet() method with mask length 32', function() { - // Test cases calculated with http://www.subnet-calculator.com/ - var ipv4Subnet = ip.subnet('192.168.1.134', '255.255.255.255'); - it('should compute ipv4 network\'s first address', function() { - assert.equal(ipv4Subnet.firstAddress, '192.168.1.134'); - }); - - it('should compute ipv4 network\'s last address', function() { - assert.equal(ipv4Subnet.lastAddress, '192.168.1.134'); - }); - - it('should compute ipv4 subnet number of addressable hosts', function() { - assert.equal(ipv4Subnet.numHosts, 1); - }); - }); - - describe('subnet() method with mask length 31', function() { - // Test cases calculated with http://www.subnet-calculator.com/ - var ipv4Subnet = ip.subnet('192.168.1.134', '255.255.255.254'); - it('should compute ipv4 network\'s first address', function() { - assert.equal(ipv4Subnet.firstAddress, '192.168.1.134'); - }); - - it('should compute ipv4 network\'s last address', function() { - assert.equal(ipv4Subnet.lastAddress, '192.168.1.135'); - }); - - it('should compute ipv4 subnet number of addressable hosts', function() { - assert.equal(ipv4Subnet.numHosts, 2); - }); - }); - - describe('cidrSubnet() method', function() { - // Test cases calculated with http://www.subnet-calculator.com/ - var ipv4Subnet = ip.cidrSubnet('192.168.1.134/26'); - - it('should compute an ipv4 network address', function() { - assert.equal(ipv4Subnet.networkAddress, '192.168.1.128'); - }); - - it('should compute an ipv4 network\'s first address', function() { - assert.equal(ipv4Subnet.firstAddress, '192.168.1.129'); - }); - - it('should compute an ipv4 network\'s last address', function() { - assert.equal(ipv4Subnet.lastAddress, '192.168.1.190'); - }); - - it('should compute an ipv4 broadcast address', function() { - assert.equal(ipv4Subnet.broadcastAddress, '192.168.1.191'); - }); - - it('should compute an ipv4 subnet number of addresses', function() { - assert.equal(ipv4Subnet.length, 64); - }); - - it('should compute an ipv4 subnet number of addressable hosts', function() { - assert.equal(ipv4Subnet.numHosts, 62); - }); - - it('should compute an ipv4 subnet mask', function() { - assert.equal(ipv4Subnet.subnetMask, '255.255.255.192'); - }); - - it('should compute an ipv4 subnet mask\'s length', function() { - assert.equal(ipv4Subnet.subnetMaskLength, 26); - }); - - it('should know whether a subnet contains an address', function() { - assert.equal(ipv4Subnet.contains('192.168.1.180'), true); - }); - - it('should know whether a subnet contains an address', function() { - assert.equal(ipv4Subnet.contains('192.168.1.195'), false); - }); - - }); - - describe('cidr() method', function() { - it('should mask address in CIDR notation', function() { - assert.equal(ip.cidr('192.168.1.134/26'), '192.168.1.128'); - assert.equal(ip.cidr('2607:f0d0:1002:51::4/56'), '2607:f0d0:1002::'); - }); - }); - - describe('isEqual() method', function() { - it('should check if addresses are equal', function() { - assert(ip.isEqual('127.0.0.1', '::7f00:1')); - assert(!ip.isEqual('127.0.0.1', '::7f00:2')); - assert(ip.isEqual('127.0.0.1', '::ffff:7f00:1')); - assert(!ip.isEqual('127.0.0.1', '::ffaf:7f00:1')); - assert(ip.isEqual('::ffff:127.0.0.1', '::ffff:127.0.0.1')); - assert(ip.isEqual('::ffff:127.0.0.1', '127.0.0.1')); - }); - }); - - - describe('isPrivate() method', function() { - it('should check if an address is localhost', function() { - assert.equal(ip.isPrivate('127.0.0.1'), true); - }); - - it('should check if an address is from a 192.168.x.x network', function() { - assert.equal(ip.isPrivate('192.168.0.123'), true); - assert.equal(ip.isPrivate('192.168.122.123'), true); - assert.equal(ip.isPrivate('192.162.1.2'), false); - }); - - it('should check if an address is from a 172.16.x.x network', function() { - assert.equal(ip.isPrivate('172.16.0.5'), true); - assert.equal(ip.isPrivate('172.16.123.254'), true); - assert.equal(ip.isPrivate('171.16.0.5'), false); - assert.equal(ip.isPrivate('172.25.232.15'), true); - assert.equal(ip.isPrivate('172.15.0.5'), false); - assert.equal(ip.isPrivate('172.32.0.5'), false); - }); - - it('should check if an address is from a 169.254.x.x network', function() { - assert.equal(ip.isPrivate('169.254.2.3'), true); - assert.equal(ip.isPrivate('169.254.221.9'), true); - assert.equal(ip.isPrivate('168.254.2.3'), false); - }); - - it('should check if an address is from a 10.x.x.x network', function() { - assert.equal(ip.isPrivate('10.0.2.3'), true); - assert.equal(ip.isPrivate('10.1.23.45'), true); - assert.equal(ip.isPrivate('12.1.2.3'), false); - }); - - it('should check if an address is from a private IPv6 network', function() { - assert.equal(ip.isPrivate('fd12:3456:789a:1::1'), true); - assert.equal(ip.isPrivate('fe80::f2de:f1ff:fe3f:307e'), true); - assert.equal(ip.isPrivate('::ffff:10.100.1.42'), true); - assert.equal(ip.isPrivate('::FFFF:172.16.200.1'), true); - assert.equal(ip.isPrivate('::ffff:192.168.0.1'), true); - }); - - it('should check if an address is from the internet', function() { - assert.equal(ip.isPrivate('165.225.132.33'), false); // joyent.com - }); - - it('should check if an address is a loopback IPv6 address', function() { - assert.equal(ip.isPrivate('::'), true); - assert.equal(ip.isPrivate('::1'), true); - assert.equal(ip.isPrivate('fe80::1'), true); - }); - }); - - describe('loopback() method', function() { - describe('undefined', function() { - it('should respond with 127.0.0.1', function() { - assert.equal(ip.loopback(), '127.0.0.1') - }); - }); - - describe('ipv4', function() { - it('should respond with 127.0.0.1', function() { - assert.equal(ip.loopback('ipv4'), '127.0.0.1') - }); - }); - - describe('ipv6', function() { - it('should respond with fe80::1', function() { - assert.equal(ip.loopback('ipv6'), 'fe80::1') - }); - }); - }); - - describe('isLoopback() method', function() { - describe('127.0.0.1', function() { - it('should respond with true', function() { - assert.ok(ip.isLoopback('127.0.0.1')) - }); - }); - - describe('127.8.8.8', function () { - it('should respond with true', function () { - assert.ok(ip.isLoopback('127.8.8.8')) - }); - }); - - describe('8.8.8.8', function () { - it('should respond with false', function () { - assert.equal(ip.isLoopback('8.8.8.8'), false); - }); - }); - - describe('fe80::1', function() { - it('should respond with true', function() { - assert.ok(ip.isLoopback('fe80::1')) - }); - }); - - describe('::1', function() { - it('should respond with true', function() { - assert.ok(ip.isLoopback('::1')) - }); - }); - - describe('::', function() { - it('should respond with true', function() { - assert.ok(ip.isLoopback('::')) - }); - }); - }); - - describe('address() method', function() { - describe('undefined', function() { - it('should respond with a private ip', function() { - assert.ok(ip.isPrivate(ip.address())); - }); - }); - - describe('private', function() { - [ undefined, 'ipv4', 'ipv6' ].forEach(function(family) { - describe(family, function() { - it('should respond with a private ip', function() { - assert.ok(ip.isPrivate(ip.address('private', family))); - }); - }); - }); - }); - - var interfaces = os.networkInterfaces(); - - Object.keys(interfaces).forEach(function(nic) { - describe(nic, function() { - [ undefined, 'ipv4' ].forEach(function(family) { - describe(family, function() { - it('should respond with an ipv4 address', function() { - var addr = ip.address(nic, family); - assert.ok(!addr || net.isIPv4(addr)); - }); - }); - }); - - describe('ipv6', function() { - it('should respond with an ipv6 address', function() { - var addr = ip.address(nic, 'ipv6'); - assert.ok(!addr || net.isIPv6(addr)); - }); - }) - }); - }); - }); - - describe('toLong() method', function() { - it('should respond with a int', function() { - assert.equal(ip.toLong('127.0.0.1'), 2130706433); - assert.equal(ip.toLong('255.255.255.255'), 4294967295); - }); - }); - - describe('fromLong() method', function() { - it('should repond with ipv4 address', function() { - assert.equal(ip.fromLong(2130706433), '127.0.0.1'); - assert.equal(ip.fromLong(4294967295), '255.255.255.255'); - }); - }) -}); diff --git a/plugins/music_service/squeezelite/node_modules/jsonfile/.npmignore b/plugins/music_service/squeezelite/node_modules/jsonfile/.npmignore deleted file mode 100644 index cefaa67a6..000000000 --- a/plugins/music_service/squeezelite/node_modules/jsonfile/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -test/ -.travis.yml \ No newline at end of file diff --git a/plugins/music_service/squeezelite/node_modules/jsonfile/CHANGELOG.md b/plugins/music_service/squeezelite/node_modules/jsonfile/CHANGELOG.md deleted file mode 100644 index 66fcbb42d..000000000 --- a/plugins/music_service/squeezelite/node_modules/jsonfile/CHANGELOG.md +++ /dev/null @@ -1,126 +0,0 @@ -2.4.0 / 2016-09-15 ------------------- -### Changed -- added optional support for `graceful-fs` [#62] - -2.3.1 / 2016-05-13 ------------------- -- fix to support BOM. [#45][#45] - -2.3.0 / 2016-04-16 ------------------- -- add `throws` to `readFile()`. See [#39][#39] -- add support for any arbitrary `fs` module. Useful with [mock-fs](https://www.npmjs.com/package/mock-fs) - -2.2.3 / 2015-10-14 ------------------- -- include file name in parse error. See: https://github.com/jprichardson/node-jsonfile/pull/34 - -2.2.2 / 2015-09-16 ------------------- -- split out tests into separate files -- fixed `throws` when set to `true` in `readFileSync()`. See: https://github.com/jprichardson/node-jsonfile/pull/33 - -2.2.1 / 2015-06-25 ------------------- -- fixed regression when passing in string as encoding for options in `writeFile()` and `writeFileSync()`. See: https://github.com/jprichardson/node-jsonfile/issues/28 - -2.2.0 / 2015-06-25 ------------------- -- added `options.spaces` to `writeFile()` and `writeFileSync()` - -2.1.2 / 2015-06-22 ------------------- -- fixed if passed `readFileSync(file, 'utf8')`. See: https://github.com/jprichardson/node-jsonfile/issues/25 - -2.1.1 / 2015-06-19 ------------------- -- fixed regressions if `null` is passed for options. See: https://github.com/jprichardson/node-jsonfile/issues/24 - -2.1.0 / 2015-06-19 ------------------- -- cleanup: JavaScript Standard Style, rename files, dropped terst for assert -- methods now support JSON revivers/replacers - -2.0.1 / 2015-05-24 ------------------- -- update license attribute https://github.com/jprichardson/node-jsonfile/pull/21 - -2.0.0 / 2014-07-28 ------------------- -* added `\n` to end of file on write. [#14](https://github.com/jprichardson/node-jsonfile/pull/14) -* added `options.throws` to `readFileSync()` -* dropped support for Node v0.8 - -1.2.0 / 2014-06-29 ------------------- -* removed semicolons -* bugfix: passed `options` to `fs.readFile` and `fs.readFileSync`. This technically changes behavior, but -changes it according to docs. [#12][#12] - -1.1.1 / 2013-11-11 ------------------- -* fixed catching of callback bug (ffissore / #5) - -1.1.0 / 2013-10-11 ------------------- -* added `options` param to methods, (seanodell / #4) - -1.0.1 / 2013-09-05 ------------------- -* removed `homepage` field from package.json to remove NPM warning - -1.0.0 / 2013-06-28 ------------------- -* added `.npmignore`, #1 -* changed spacing default from `4` to `2` to follow Node conventions - -0.0.1 / 2012-09-10 ------------------- -* Initial release. - -[#45]: https://github.com/jprichardson/node-jsonfile/issues/45 "Reading of UTF8-encoded (w/ BOM) files fails" -[#44]: https://github.com/jprichardson/node-jsonfile/issues/44 "Extra characters in written file" -[#43]: https://github.com/jprichardson/node-jsonfile/issues/43 "Prettyfy json when written to file" -[#42]: https://github.com/jprichardson/node-jsonfile/pull/42 "Moved fs.readFileSync within the try/catch" -[#41]: https://github.com/jprichardson/node-jsonfile/issues/41 "Linux: Hidden file not working" -[#40]: https://github.com/jprichardson/node-jsonfile/issues/40 "autocreate folder doesnt work from Path-value" -[#39]: https://github.com/jprichardson/node-jsonfile/pull/39 "Add `throws` option for readFile (async)" -[#38]: https://github.com/jprichardson/node-jsonfile/pull/38 "Update README.md writeFile[Sync] signature" -[#37]: https://github.com/jprichardson/node-jsonfile/pull/37 "support append file" -[#36]: https://github.com/jprichardson/node-jsonfile/pull/36 "Add typescript definition file." -[#35]: https://github.com/jprichardson/node-jsonfile/pull/35 "Add typescript definition file." -[#34]: https://github.com/jprichardson/node-jsonfile/pull/34 "readFile JSON parse error includes filename" -[#33]: https://github.com/jprichardson/node-jsonfile/pull/33 "fix throw->throws typo in readFileSync()" -[#32]: https://github.com/jprichardson/node-jsonfile/issues/32 "readFile & readFileSync can possible have strip-comments as an option?" -[#31]: https://github.com/jprichardson/node-jsonfile/pull/31 "[Modify] Support string include is unicode escape string" -[#30]: https://github.com/jprichardson/node-jsonfile/issues/30 "How to use Jsonfile package in Meteor.js App?" -[#29]: https://github.com/jprichardson/node-jsonfile/issues/29 "writefile callback if no error?" -[#28]: https://github.com/jprichardson/node-jsonfile/issues/28 "writeFile options argument broken " -[#27]: https://github.com/jprichardson/node-jsonfile/pull/27 "Use svg instead of png to get better image quality" -[#26]: https://github.com/jprichardson/node-jsonfile/issues/26 "Breaking change to fs-extra" -[#25]: https://github.com/jprichardson/node-jsonfile/issues/25 "support string encoding param for read methods" -[#24]: https://github.com/jprichardson/node-jsonfile/issues/24 "readFile: Passing in null options with a callback throws an error" -[#23]: https://github.com/jprichardson/node-jsonfile/pull/23 "Add appendFile and appendFileSync" -[#22]: https://github.com/jprichardson/node-jsonfile/issues/22 "Default value for spaces in readme.md is outdated" -[#21]: https://github.com/jprichardson/node-jsonfile/pull/21 "Update license attribute" -[#20]: https://github.com/jprichardson/node-jsonfile/issues/20 "Add simple caching functionallity" -[#19]: https://github.com/jprichardson/node-jsonfile/pull/19 "Add appendFileSync method" -[#18]: https://github.com/jprichardson/node-jsonfile/issues/18 "Add updateFile and updateFileSync methods" -[#17]: https://github.com/jprichardson/node-jsonfile/issues/17 "seem read & write sync has sequentially problem" -[#16]: https://github.com/jprichardson/node-jsonfile/pull/16 "export spaces defaulted to null" -[#15]: https://github.com/jprichardson/node-jsonfile/issues/15 "`jsonfile.spaces` should default to `null`" -[#14]: https://github.com/jprichardson/node-jsonfile/pull/14 "Add EOL at EOF" -[#13]: https://github.com/jprichardson/node-jsonfile/issues/13 "Add a final newline" -[#12]: https://github.com/jprichardson/node-jsonfile/issues/12 "readFile doesn't accept options" -[#11]: https://github.com/jprichardson/node-jsonfile/pull/11 "Added try,catch to readFileSync" -[#10]: https://github.com/jprichardson/node-jsonfile/issues/10 "No output or error from writeFile" -[#9]: https://github.com/jprichardson/node-jsonfile/pull/9 "Change 'js' to 'jf' in example." -[#8]: https://github.com/jprichardson/node-jsonfile/pull/8 "Updated forgotten module.exports to me." -[#7]: https://github.com/jprichardson/node-jsonfile/pull/7 "Add file name in error message" -[#6]: https://github.com/jprichardson/node-jsonfile/pull/6 "Use graceful-fs when possible" -[#5]: https://github.com/jprichardson/node-jsonfile/pull/5 "Jsonfile doesn't behave nicely when used inside a test suite." -[#4]: https://github.com/jprichardson/node-jsonfile/pull/4 "Added options parameter to writeFile and writeFileSync" -[#3]: https://github.com/jprichardson/node-jsonfile/issues/3 "test2" -[#2]: https://github.com/jprichardson/node-jsonfile/issues/2 "homepage field must be a string url. Deleted." -[#1]: https://github.com/jprichardson/node-jsonfile/pull/1 "adding an `.npmignore` file" diff --git a/plugins/music_service/squeezelite/node_modules/jsonfile/LICENSE b/plugins/music_service/squeezelite/node_modules/jsonfile/LICENSE deleted file mode 100644 index cb7e807b9..000000000 --- a/plugins/music_service/squeezelite/node_modules/jsonfile/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -(The MIT License) - -Copyright (c) 2012-2015, 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/plugins/music_service/squeezelite/node_modules/jsonfile/README.md b/plugins/music_service/squeezelite/node_modules/jsonfile/README.md deleted file mode 100644 index 54bca0530..000000000 --- a/plugins/music_service/squeezelite/node_modules/jsonfile/README.md +++ /dev/null @@ -1,162 +0,0 @@ -Node.js - jsonfile -================ - -Easily read/write JSON files. - -[![npm Package](https://img.shields.io/npm/v/jsonfile.svg?style=flat-square)](https://www.npmjs.org/package/jsonfile) -[![build status](https://secure.travis-ci.org/jprichardson/node-jsonfile.svg)](http://travis-ci.org/jprichardson/node-jsonfile) -[![windows Build status](https://img.shields.io/appveyor/ci/jprichardson/node-jsonfile/master.svg?label=windows%20build)](https://ci.appveyor.com/project/jprichardson/node-jsonfile/branch/master) - -Standard JavaScript - -Why? ----- - -Writing `JSON.stringify()` and then `fs.writeFile()` and `JSON.parse()` with `fs.readFile()` enclosed in `try/catch` blocks became annoying. - - - -Installation ------------- - - npm install --save jsonfile - - - -API ---- - -### readFile(filename, [options], callback) - -`options` (`object`, default `undefined`): Pass in any `fs.readFile` options or set `reviver` for a [JSON reviver](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse). - - `throws` (`boolean`, default: `true`). If `JSON.parse` throws an error, pass this error to the callback. - If `false`, returns `null` for the object. - - -```js -var jsonfile = require('jsonfile') -var file = '/tmp/data.json' -jsonfile.readFile(file, function(err, obj) { - console.dir(obj) -}) -``` - - -### readFileSync(filename, [options]) - -`options` (`object`, default `undefined`): Pass in any `fs.readFileSync` options or set `reviver` for a [JSON reviver](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse). -- `throws` (`boolean`, default: `true`). If `JSON.parse` throws an error, throw the error. -If `false`, returns `null` for the object. - -```js -var jsonfile = require('jsonfile') -var file = '/tmp/data.json' - -console.dir(jsonfile.readFileSync(file)) -``` - - -### writeFile(filename, obj, [options], callback) - -`options`: Pass in any `fs.writeFile` options or set `replacer` for a [JSON replacer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify). Can also pass in `spaces`. - - -```js -var jsonfile = require('jsonfile') - -var file = '/tmp/data.json' -var obj = {name: 'JP'} - -jsonfile.writeFile(file, obj, function (err) { - console.error(err) -}) -``` - -**formatting with spaces:** - -```js -var jsonfile = require('jsonfile') - -var file = '/tmp/data.json' -var obj = {name: 'JP'} - -jsonfile.writeFile(file, obj, {spaces: 2}, function(err) { - console.error(err) -}) -``` - - -### writeFileSync(filename, obj, [options]) - -`options`: Pass in any `fs.writeFileSync` options or set `replacer` for a [JSON replacer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify). Can also pass in `spaces`. - -```js -var jsonfile = require('jsonfile') - -var file = '/tmp/data.json' -var obj = {name: 'JP'} - -jsonfile.writeFileSync(file, obj) -``` - -**formatting with spaces:** - -```js -var jsonfile = require('jsonfile') - -var file = '/tmp/data.json' -var obj = {name: 'JP'} - -jsonfile.writeFileSync(file, obj, {spaces: 2}) -``` - - - -### spaces - -Global configuration to set spaces to indent JSON files. - -**default:** `null` - -```js -var jsonfile = require('jsonfile') - -jsonfile.spaces = 4 - -var file = '/tmp/data.json' -var obj = {name: 'JP'} - -// json file has four space indenting now -jsonfile.writeFile(file, obj, function (err) { - console.error(err) -}) -``` - -Note, it's bound to `this.spaces`. So, if you do this: - -```js -var myObj = {} -myObj.writeJsonSync = jsonfile.writeFileSync -// => this.spaces = null -``` - -Could do the following: - -```js -var jsonfile = require('jsonfile') -jsonfile.spaces = 4 -jsonfile.writeFileSync(file, obj) // will have 4 spaces indentation - -var myCrazyObj = {spaces: 32} -myCrazyObj.writeJsonSync = jsonfile.writeFileSync -myCrazyObj.writeJsonSync(file, obj) // will have 32 space indentation -myCrazyObj.writeJsonSync(file, obj, {spaces: 2}) // will have only 2 -``` - - -License -------- - -(MIT License) - -Copyright 2012-2016, JP Richardson diff --git a/plugins/music_service/squeezelite/node_modules/jsonfile/appveyor.yml b/plugins/music_service/squeezelite/node_modules/jsonfile/appveyor.yml deleted file mode 100644 index 872af18de..000000000 --- a/plugins/music_service/squeezelite/node_modules/jsonfile/appveyor.yml +++ /dev/null @@ -1,28 +0,0 @@ -# Test against this version of Node.js -environment: - matrix: - # node.js - - nodejs_version: "0.10" - - nodejs_version: "0.12" - - nodejs_version: "4" - - nodejs_version: "5" - - nodejs_version: "6" - -# Install scripts. (runs after repo cloning) -install: - # Get the latest stable version of Node.js or io.js - - ps: Install-Product node $env:nodejs_version - # install modules - - npm config set loglevel warn - - npm install --silent - -# Post-install test scripts. -test_script: - # Output useful info for debugging. - - node --version - - npm --version - # run tests - - npm test - -# Don't actually build. -build: off diff --git a/plugins/music_service/squeezelite/node_modules/jsonfile/index.js b/plugins/music_service/squeezelite/node_modules/jsonfile/index.js deleted file mode 100644 index 7111e15ae..000000000 --- a/plugins/music_service/squeezelite/node_modules/jsonfile/index.js +++ /dev/null @@ -1,133 +0,0 @@ -var _fs -try { - _fs = require('graceful-fs') -} catch (_) { - _fs = require('fs') -} - -function readFile (file, options, callback) { - if (callback == null) { - callback = options - options = {} - } - - if (typeof options === 'string') { - options = {encoding: options} - } - - options = options || {} - var fs = options.fs || _fs - - var shouldThrow = true - // DO NOT USE 'passParsingErrors' THE NAME WILL CHANGE!!!, use 'throws' instead - if ('passParsingErrors' in options) { - shouldThrow = options.passParsingErrors - } else if ('throws' in options) { - shouldThrow = options.throws - } - - fs.readFile(file, options, function (err, data) { - if (err) return callback(err) - - data = stripBom(data) - - var obj - try { - obj = JSON.parse(data, options ? options.reviver : null) - } catch (err2) { - if (shouldThrow) { - err2.message = file + ': ' + err2.message - return callback(err2) - } else { - return callback(null, null) - } - } - - callback(null, obj) - }) -} - -function readFileSync (file, options) { - options = options || {} - if (typeof options === 'string') { - options = {encoding: options} - } - - var fs = options.fs || _fs - - var shouldThrow = true - // DO NOT USE 'passParsingErrors' THE NAME WILL CHANGE!!!, use 'throws' instead - if ('passParsingErrors' in options) { - shouldThrow = options.passParsingErrors - } else if ('throws' in options) { - shouldThrow = options.throws - } - - var content = fs.readFileSync(file, options) - content = stripBom(content) - - try { - return JSON.parse(content, options.reviver) - } catch (err) { - if (shouldThrow) { - err.message = file + ': ' + err.message - throw err - } else { - return null - } - } -} - -function writeFile (file, obj, options, callback) { - if (callback == null) { - callback = options - options = {} - } - options = options || {} - var fs = options.fs || _fs - - var spaces = typeof options === 'object' && options !== null - ? 'spaces' in options - ? options.spaces : this.spaces - : this.spaces - - var str = '' - try { - str = JSON.stringify(obj, options ? options.replacer : null, spaces) + '\n' - } catch (err) { - if (callback) return callback(err, null) - } - - fs.writeFile(file, str, options, callback) -} - -function writeFileSync (file, obj, options) { - options = options || {} - var fs = options.fs || _fs - - var spaces = typeof options === 'object' && options !== null - ? 'spaces' in options - ? options.spaces : this.spaces - : this.spaces - - var str = JSON.stringify(obj, options.replacer, spaces) + '\n' - // not sure if fs.writeFileSync returns anything, but just in case - return fs.writeFileSync(file, str, options) -} - -function stripBom (content) { - // we do this because JSON.parse would convert it to a utf8 string if encoding wasn't specified - if (Buffer.isBuffer(content)) content = content.toString('utf8') - content = content.replace(/^\uFEFF/, '') - return content -} - -var jsonfile = { - spaces: null, - readFile: readFile, - readFileSync: readFileSync, - writeFile: writeFile, - writeFileSync: writeFileSync -} - -module.exports = jsonfile diff --git a/plugins/music_service/squeezelite/node_modules/jsonfile/package.json b/plugins/music_service/squeezelite/node_modules/jsonfile/package.json deleted file mode 100644 index 80c98db77..000000000 --- a/plugins/music_service/squeezelite/node_modules/jsonfile/package.json +++ /dev/null @@ -1,105 +0,0 @@ -{ - "_args": [ - [ - { - "raw": "jsonfile@^2.3.1", - "scope": null, - "escapedName": "jsonfile", - "name": "jsonfile", - "rawSpec": "^2.3.1", - "spec": ">=2.3.1 <3.0.0", - "type": "range" - }, - "/home/volumio/volumio-plugins/plugins/music_service/squeezelite" - ] - ], - "_from": "jsonfile@>=2.3.1 <3.0.0", - "_id": "jsonfile@2.4.0", - "_inCache": true, - "_location": "/jsonfile", - "_nodeVersion": "6.1.0", - "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/jsonfile-2.4.0.tgz_1473989978270_0.6271681792568415" - }, - "_npmUser": { - "name": "jprichardson", - "email": "jprichardson@gmail.com" - }, - "_npmVersion": "3.8.6", - "_phantomChildren": {}, - "_requested": { - "raw": "jsonfile@^2.3.1", - "scope": null, - "escapedName": "jsonfile", - "name": "jsonfile", - "rawSpec": "^2.3.1", - "spec": ">=2.3.1 <3.0.0", - "type": "range" - }, - "_requiredBy": [ - "/", - "/fs-extra", - "/v-conf/fs-extra" - ], - "_resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", - "_shasum": "3736a2b428b87bbda0cc83b53fa3d633a35c2ae8", - "_shrinkwrap": null, - "_spec": "jsonfile@^2.3.1", - "_where": "/home/volumio/volumio-plugins/plugins/music_service/squeezelite", - "author": { - "name": "JP Richardson", - "email": "jprichardson@gmail.com" - }, - "bugs": { - "url": "https://github.com/jprichardson/node-jsonfile/issues" - }, - "dependencies": { - "graceful-fs": "^4.1.6" - }, - "description": "Easily read/write JSON files.", - "devDependencies": { - "mocha": "2.x", - "mock-fs": "^3.8.0", - "rimraf": "^2.4.0", - "standard": "^6.0.8" - }, - "directories": {}, - "dist": { - "shasum": "3736a2b428b87bbda0cc83b53fa3d633a35c2ae8", - "tarball": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz" - }, - "gitHead": "00b3983ac4aade79c64c7a8c2ced257078625c6d", - "homepage": "https://github.com/jprichardson/node-jsonfile#readme", - "keywords": [ - "read", - "write", - "file", - "json", - "fs", - "fs-extra" - ], - "license": "MIT", - "main": "index.js", - "maintainers": [ - { - "name": "jprichardson", - "email": "jprichardson@gmail.com" - } - ], - "name": "jsonfile", - "optionalDependencies": { - "graceful-fs": "^4.1.6" - }, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/jprichardson/node-jsonfile.git" - }, - "scripts": { - "lint": "standard", - "test": "npm run lint && npm run unit", - "unit": "mocha" - }, - "version": "2.4.0" -} diff --git a/plugins/music_service/squeezelite/node_modules/kew/.npmignore b/plugins/music_service/squeezelite/node_modules/kew/.npmignore deleted file mode 100644 index 7dccd9707..000000000 --- a/plugins/music_service/squeezelite/node_modules/kew/.npmignore +++ /dev/null @@ -1,15 +0,0 @@ -lib-cov -*.seed -*.log -*.csv -*.dat -*.out -*.pid -*.gz - -pids -logs -results - -node_modules -npm-debug.log \ No newline at end of file diff --git a/plugins/music_service/squeezelite/node_modules/kew/.travis.yml b/plugins/music_service/squeezelite/node_modules/kew/.travis.yml deleted file mode 100644 index 54655e8c8..000000000 --- a/plugins/music_service/squeezelite/node_modules/kew/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js -node_js: - - "0.12" - - "0.10" - diff --git a/plugins/music_service/squeezelite/node_modules/kew/LICENSE.TXT b/plugins/music_service/squeezelite/node_modules/kew/LICENSE.TXT deleted file mode 100644 index 55e332a8f..000000000 --- a/plugins/music_service/squeezelite/node_modules/kew/LICENSE.TXT +++ /dev/null @@ -1,194 +0,0 @@ -Copyright 2012 The Obvious Corporation. -http://obvious.com/ - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - - -------------------------------------------------------------------------- - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - -2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - -3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - -4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - -5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - -6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - -8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS diff --git a/plugins/music_service/squeezelite/node_modules/kew/README.md b/plugins/music_service/squeezelite/node_modules/kew/README.md deleted file mode 100644 index a2eac8ce7..000000000 --- a/plugins/music_service/squeezelite/node_modules/kew/README.md +++ /dev/null @@ -1,320 +0,0 @@ -kew: a lightweight (and super fast) promise/deferred framework for node.js -================================== - -[![Build Status](https://travis-ci.org/Medium/kew.svg)](https://travis-ci.org/Medium/kew) - -**kew** is a lightweight promise framework with an aim of providing a base set of functionality similar to that provided by the [Q library](https://github.com/kriskowal/q "Q"). - -A few answers (for a few questions) -------- - -*Why'd we write it?* - -During our initial usage of **Q** we found that it was consuming 80% of the cpu under load (primarily in chained database callbacks). We spent some time looking at patching **Q** and ultimately found that creating our own lightweight library for server-usage would suit our needs better than figuring out how to make a large cross-platform library more performant on one very specific platform. - -*So this does everything Q does?* - -Nope! **Q** is still an awesome library and does *way* more than **kew**. We support a tiny subset of the **Q** functionality (the subset that we happen to use in our actual use cases). - -What are Promises? -------- - -At its core, a *Promise* is a promise to return a value at some point in the future. A *Promise* represents a value that will be (or may return an error if something goes wrong). *Promises* heavily reduce the complexity of asynchronous coding in node.js-like environments. Example: - -```javascript -// assuming the getUrlContent() function exists and retrieves the content of a url -var htmlPromise = getUrlContent(myUrl) - -// we can then filter that through an http parser (our imaginary parseHtml() function) asynchronously (or maybe synchronously, who knows) -var tagsPromise = htmlPromise.then(parseHtml) - -// and then filter it through another function (getLinks()) which retrieves only the link tags -var linksPromise = tagsPromise.then(getLinks) - -// and then parses the actual urls from the links (using parseUrlsFromLinks()) -var urlsPromise = linksPromise.then(parseUrlsFromLinks) - -// finally, we have a promise that should only provide us with the urls and will run once all the previous steps have ran -urlsPromise.then(function (urls) { - // do something with the urls -}) -``` - -How do I use **kew**? -------- - -As a precursor to all the examples, the following code must be at the top of your page: - -```javascript -var Q = require('kew') -``` - -### Convert a literal into a promise - -The easiest way to start a promise chain is by creating a new promise with a specified literal using Q.resolve() or Q.reject() - -```javascript -// create a promise which passes a value to the next then() call -var successPromise = Q.resolve(val) - -// create a promise which throws an error to be caught by the next fail() call -var failPromise = Q.reject(err) -``` - -In addition, you can create deferreds which can be used if you need to create a promise but resolve it later: - -```javascript -// create the deferreds -var successDefer = Q.defer() -var failDefer = Q.defer() - -// resolve or reject the defers in 1 second -setTimeout(function () { - successDefer.resolve("ok") - failDefer.reject(new Error("this failed")) -}, 1000) - -// extract promises from the deferreds -var successPromise = successDefer.promise -var failPromise = failDefer.promise -``` - -If you have a node-style callback (taking an **Error** as the first parameter and a response as the second), you can call the magic `makeNodeResolver()` function on a defer to allow the defer to handle the callbacks: - -```javascript -// create the deferred -var defer = Q.defer() - -// some node-style function -getObjectFromDatabase(myObjectId, defer.makeNodeResolver()) - -// grab the output -defer.promise - .then(function (obj) { - // successfully retrieved the object - }) - .fail(function (e) { - // failed retrieving the object - }) -``` - -### Handling successful results with `.then()` - -When a promise is resolved, you may call the `.then()` method to retrieve the value of the promise: - -```javascript -promise.then(function (result) { - // do something with the result here -}) -``` - -`.then()` will in turn return a promise which will return the results of whatever it returns (asynchronously or not), allowing it to be chained indefinitely: - -```javascript -Q.resolve('a') - .then(function (result) { - return result + 'b' - }) - .then(function (result) { - return result + 'c' - }) - .then(function (result) { - // result should be 'abc' - }) -``` - -In addition, `.then()` calls may return promises themselves, allowing for complex nesting of asynchronous calls in a flat manner: - -```javascript -var htmlPromise = getUrlContent(myUrl) - -var tagsPromise = htmlPromise.then(function (html) { - if (!validHtml(html)) throw new Error("Invalid HTML") - - // pretend that parseHtml() returns a promise and is asynchronous - return parseHtml(html) -}) -``` - -### Handling errors with `.fail()` - -If a promise is rejected for some reason, you may handle the failure case with the `.fail()` function: - -```javascript -getObjectPromise - .fail(function (e) { - console.error("Failed to retrieve object", e) - }) -``` - -Like `.then()`, `.fail()` also returns a promise. If the `.fail()` call does not throw an error, it will pass the return value of the `.fail()` handler to any `.then()` calls chained to it: - -```javascript -getObjectPromise - .fail(function (e) { - return retryGetObject(objId) - }) - .then(function (obj) { - // yay, we received an object - }) - .fail(function (e) { - // the retry failed :( - console.error("Retrieving the object '" + objId + "' failed") - }) -}) -``` - -If you've reached the end of your promise chain, you may call `.end()` which signifies that the promise chain is ended and any errors should be thrown in whatever scope the code is currently in: - -```javascript -getObjectPromise - // this will throw an error to the uncaught exception handler if the getObjectPromise call is asynchronous - .end() -``` - -### `.fin()` when things are finished - -You may attach a handler to a promise which will be ran regardless of whether the promise was resolved or rejected (but will only run upon completion). This is useful in the cases where you may have set up resources to run a request and wish to tear them down afterwards. `.fin()` will return the promise it is called upon: - -```javascript -var connection = db.connect() - -var itemPromise = db.getItem(itemId) - .fin(function () { - db.close() - }) -``` - -Other utility methods -------- - -### `.all()` for many things - -If you're waiting for multiple promises to return, you may pass them (mixed in with literals if you desire) into `.all()` which will create a promise that resolves successfully with an array of the results of the promises: - -```javascript -var promises = [] -promises.push(getUrlContent(url1)) -promises.push(getUrlContent(url2)) -promises.push(getUrlContent(url3)) - -Q.all(promises) - .then(function (content) { - // content[0] === content for url 1 - // content[1] === content for url 2 - // content[2] === content for url 3 - }) -``` - -If any of the promises fail, Q.all will fail as well (so make sure to guard your promises with a `.fail()` call beforehand if you don't care whether they succeed or not): - -```javascript -var promises = [] -promises.push(getUrlContent(url1)) -promises.push(getUrlContent(url2)) -promises.push(getUrlContent(url3)) - -Q.all(promises) - .fail(function (e) { - console.log("Failed retrieving a url", e) - }) -``` - -### `.delay()` for future promises - -If you need a little bit of delay (such as retrying a method call to a service that is "eventually consistent") before doing something else, ``Q.delay()`` is your friend: - -```javascript -getUrlContent(url1) -.fail(function () { - // Retry again after 200 milisseconds - return Q.delay(200).then(function () { - return getUrlContent(url1) - }) -}) -``` - -If two arguments are passed, the first will be used as the return value, and the -second will be the delay in milliseconds. - -```javascript -Q.delay(obj, 20).then(function (result) { - console.log(result) // logs `obj` after 20ms -}) -``` - -### `.fcall()` for delaying a function invocation until the next tick: -```javascript -// Assume someFn() is a synchronous 2 argument function you want to delay. -Q.fcall(someFn, arg1, arg2) - .then(function (result) { - console.log('someFn(' + arg1 + ', ' + arg2 + ') = ' + result) - }) -``` - -You can also use ``Q.fcall()`` with functions that return promises. - -### `.ncall()` and `.nfcall()` for Node.js callbacks - -``Q.nfcall()`` can be used to convert node-style callbacks into promises: - -```javascript -Q.nfcall(fs.writeFile, '/tmp/myFile', 'content') - .then(function () { - console.log('File written successfully') - }) - .fail(function (err) { - console.log('Failed to write file', err) - }) -``` - -If your Node-style callback needs a `this` context, you can use `Q.ncall`: - -```js -Q.ncall(redis.del, redis, 'my-key') - .then(function () { return true }) - .fail(function () { return false }) -``` - - -### `.spread()` for arrays of promises - -``()`` can be used to convert node-style callbacks into promises: - -```javascript -Q.nfcall(function () { - return ['a', Q.resolve('b')] -}) -.spread(function (a, b) { - // ... -}) -``` - - -Contributing ------------- - -Questions, comments, bug reports, and pull requests are all welcome. -Submit them at [the project on GitHub](https://github.com/Obvious/kew/). - -Bug reports that include steps-to-reproduce (including code) are the -best. Even better, make them in the form of pull requests that update -the test suite. Thanks! - - -Author ------- - -[Jeremy Stanley](https://github.com/azulus) -supported by -[The Obvious Corporation](http://obvious.com/). - - -License -------- - -Copyright 2013 [The Obvious Corporation](http://obvious.com/). - -Licensed under the Apache License, Version 2.0. -See the top-level file `LICENSE.TXT` and -(http://www.apache.org/licenses/LICENSE-2.0). diff --git a/plugins/music_service/squeezelite/node_modules/kew/kew.js b/plugins/music_service/squeezelite/node_modules/kew/kew.js deleted file mode 100644 index 71a90d16e..000000000 --- a/plugins/music_service/squeezelite/node_modules/kew/kew.js +++ /dev/null @@ -1,860 +0,0 @@ - -/** - * An object representing a "promise" for a future value - * - * @param {?function(T, ?)=} onSuccess a function to handle successful - * resolution of this promise - * @param {?function(!Error, ?)=} onFail a function to handle failed - * resolution of this promise - * @constructor - * @template T - */ -function Promise(onSuccess, onFail) { - this.promise = this - this._isPromise = true - this._successFn = onSuccess - this._failFn = onFail - this._scope = this - this._boundArgs = null - this._hasContext = false - this._nextContext = undefined - this._currentContext = undefined -} - -/** - * @param {function()} callback - */ -function nextTick (callback) { - callback() -} - -if (typeof process !== 'undefined' && typeof process.nextTick === 'function') { - nextTick = process.nextTick -} - -/** - * All callback execution should go through this function. While the - * implementation below is simple, it can be replaced with more sophisticated - * implementations that enforce QoS on the event loop. - * - * @param {Promise} defer - * @param {Function} callback - * @param {Object|undefined} scope - * @param {Array} args - */ -function nextTickCallback (defer, callback, scope, args) { - try { - defer.resolve(callback.apply(scope, args)) - } catch (thrown) { - defer.reject(thrown) - } -} - -/** - * Used for accessing the nextTick function from outside the kew module. - * - * @return {Function} - */ -function getNextTickFunction () { - return nextTick -} - -/** - * Used for overriding the nextTick function from outside the kew module so that - * the user can plug and play lower level schedulers - * @param {!Function} fn - */ -function setNextTickFunction (fn) { - nextTick = fn -} - -/** - * Keep track of the number of promises that are rejected along side - * the number of rejected promises we call _failFn on so we can look - * for leaked rejections. - * @constructor - */ -function PromiseStats() { - /** @type {number} */ - this.errorsEmitted = 0 - - /** @type {number} */ - this.errorsHandled = 0 -} - -var stats = new PromiseStats() - -Promise.prototype._handleError = function () { - if (!this._errorHandled) { - stats.errorsHandled++ - this._errorHandled = true - } -} - -/** - * Specify that the current promise should have a specified context - * @param {*} context context - * @private - */ -Promise.prototype._useContext = function (context) { - this._nextContext = this._currentContext = context - this._hasContext = true - return this -} - -Promise.prototype.clearContext = function () { - this._hasContext = false - this._nextContext = undefined - return this -} - -/** - * Set the context for all promise handlers to follow - * - * NOTE(dpup): This should be considered deprecated. It does not do what most - * people would expect. The context will be passed as a second argument to all - * subsequent callbacks. - * - * @param {*} context An arbitrary context - */ -Promise.prototype.setContext = function (context) { - this._nextContext = context - this._hasContext = true - return this -} - -/** - * Get the context for a promise - * @return {*} the context set by setContext - */ -Promise.prototype.getContext = function () { - return this._nextContext -} - -/** - * Resolve this promise with a specified value - * - * @param {*=} data - */ -Promise.prototype.resolve = function (data) { - if (this._error || this._hasData) throw new Error("Unable to resolve or reject the same promise twice") - - var i - if (data && isPromise(data)) { - this._child = data - if (this._promises) { - for (i = 0; i < this._promises.length; i += 1) { - data._chainPromise(this._promises[i]) - } - delete this._promises - } - - if (this._onComplete) { - for (i = 0; i < this._onComplete.length; i+= 1) { - data.fin(this._onComplete[i]) - } - delete this._onComplete - } - } else if (data && isPromiseLike(data)) { - data.then( - function(data) { this.resolve(data) }.bind(this), - function(err) { this.reject(err) }.bind(this) - ) - } else { - this._hasData = true - this._data = data - - if (this._onComplete) { - for (i = 0; i < this._onComplete.length; i++) { - this._onComplete[i]() - } - } - - if (this._promises) { - for (i = 0; i < this._promises.length; i += 1) { - this._promises[i]._useContext(this._nextContext) - this._promises[i]._withInput(data) - } - delete this._promises - } - } -} - -/** - * Reject this promise with an error - * - * @param {!Error} e - */ -Promise.prototype.reject = function (e) { - if (this._error || this._hasData) throw new Error("Unable to resolve or reject the same promise twice") - - var i - this._error = e - stats.errorsEmitted++ - - if (this._ended) { - this._handleError() - process.nextTick(function onPromiseThrow() { - throw e - }) - } - - if (this._onComplete) { - for (i = 0; i < this._onComplete.length; i++) { - this._onComplete[i]() - } - } - - if (this._promises) { - this._handleError() - for (i = 0; i < this._promises.length; i += 1) { - this._promises[i]._useContext(this._nextContext) - this._promises[i]._withError(e) - } - delete this._promises - } -} - -/** - * Provide a callback to be called whenever this promise successfully - * resolves. Allows for an optional second callback to handle the failure - * case. - * - * @param {?function(this:void, T, ?): RESULT|undefined} onSuccess - * @param {?function(this:void, !Error, ?): RESULT=} onFail - * @return {!Promise.} returns a new promise with the output of the onSuccess or - * onFail handler - * @template RESULT - */ -Promise.prototype.then = function (onSuccess, onFail) { - var promise = new Promise(onSuccess, onFail) - if (this._nextContext) promise._useContext(this._nextContext) - - if (this._child) this._child._chainPromise(promise) - else this._chainPromise(promise) - - return promise -} - -/** - * Provide a callback to be called whenever this promise successfully - * resolves. The callback will be executed in the context of the provided scope. - * - * @param {function(this:SCOPE, ...): RESULT} onSuccess - * @param {SCOPE} scope Object whose context callback will be executed in. - * @param {...*} var_args Additional arguments to be passed to the promise callback. - * @return {!Promise.} returns a new promise with the output of the onSuccess - * @template SCOPE, RESULT - */ -Promise.prototype.thenBound = function (onSuccess, scope, var_args) { - var promise = new Promise(onSuccess) - if (this._nextContext) promise._useContext(this._nextContext) - - promise._scope = scope - if (arguments.length > 2) { - promise._boundArgs = Array.prototype.slice.call(arguments, 2) - } - - // Chaining must happen after setting args and scope since it may fire callback. - if (this._child) this._child._chainPromise(promise) - else this._chainPromise(promise) - - return promise -} - -/** - * Provide a callback to be called whenever this promise is rejected - * - * @param {function(this:void, !Error, ?)} onFail - * @return {!Promise.} returns a new promise with the output of the onFail handler - */ -Promise.prototype.fail = function (onFail) { - return this.then(null, onFail) -} - -/** - * Provide a callback to be called whenever this promise is rejected. - * The callback will be executed in the context of the provided scope. - * - * @param {function(this:SCOPE, ...)} onFail - * @param {SCOPE} scope Object whose context callback will be executed in. - * @param {...?} var_args - * @return {!Promise.} returns a new promise with the output of the onSuccess - * @template SCOPE - */ -Promise.prototype.failBound = function (onFail, scope, var_args) { - var promise = new Promise(null, onFail) - if (this._nextContext) promise._useContext(this._nextContext) - - promise._scope = scope - if (arguments.length > 2) { - promise._boundArgs = Array.prototype.slice.call(arguments, 2) - } - - // Chaining must happen after setting args and scope since it may fire callback. - if (this._child) this._child._chainPromise(promise) - else this._chainPromise(promise) - - return promise -} - -/** - * Spread a promises outputs to the functions arguments. - * @param {?function(this:void, ...): RESULT|undefined} onSuccess - * @return {!Promise.} returns a new promise with the output of the onSuccess or - * onFail handler - * @template RESULT - */ -Promise.prototype.spread = function (onSuccess) { - return this.then(allInternal) - .then(function (array) { - return onSuccess.apply(null, array) - }) -} - -/** - * Spread a promises outputs to the functions arguments. - * @param {function(this:SCOPE, ...): RESULT} onSuccess - * @param {SCOPE} scope Object whose context callback will be executed in. - * @param {...*} var_args Additional arguments to be passed to the promise callback. - * @return {!Promise.} returns a new promise with the output of the onSuccess - * @template SCOPE, RESULT - */ -Promise.prototype.spreadBound = function (onSuccess, scope, var_args) { - var args = Array.prototype.slice.call(arguments, 2) - return this.then(allInternal) - .then(function (array) { - return onSuccess.apply(scope, args.concat(array)) - }) -} - -/** - * Provide a callback to be called whenever this promise is either resolved - * or rejected. - * - * @param {function()} onComplete - * @return {!Promise.} returns the current promise - */ -Promise.prototype.fin = function (onComplete) { - if (this._hasData || this._error) { - onComplete() - return this - } - - if (this._child) { - this._child.fin(onComplete) - } else { - if (!this._onComplete) this._onComplete = [onComplete] - else this._onComplete.push(onComplete) - } - - return this -} - -/** - * Mark this promise as "ended". If the promise is rejected, this will throw an - * error in whatever scope it happens to be in - * - * @return {!Promise.} returns the current promise - * @deprecated Prefer done(), because it's consistent with Q. - */ -Promise.prototype.end = function () { - this._end() - return this -} - - -/** - * Mark this promise as "ended". - * @private - */ -Promise.prototype._end = function () { - if (this._error) { - this._handleError() - throw this._error - } - this._ended = true - return this -} - -/** - * Close the promise. Any errors after this completes will be thrown to the global handler. - * - * @param {?function(this:void, T, ?)=} onSuccess a function to handle successful - * resolution of this promise - * @param {?function(this:void, !Error, ?)=} onFailure a function to handle failed - * resolution of this promise - * @return {void} - */ -Promise.prototype.done = function (onSuccess, onFailure) { - var self = this - if (onSuccess || onFailure) { - self = self.then(onSuccess, onFailure) - } - self._end() -} - -/** - * Return a new promise that behaves the same as the current promise except - * that it will be rejected if the current promise does not get fulfilled - * after a certain amount of time. - * - * @param {number} timeoutMs The timeout threshold in msec - * @param {string=} timeoutMsg error message - * @return {!Promise.} a new promise with timeout - */ - Promise.prototype.timeout = function (timeoutMs, timeoutMsg) { - var deferred = new Promise() - var isTimeout = false - - var timeout = setTimeout(function() { - deferred.reject(new Error(timeoutMsg || 'Promise timeout after ' + timeoutMs + ' ms.')) - isTimeout = true - }, timeoutMs) - - this.then(function (data) { - if (!isTimeout) { - clearTimeout(timeout) - deferred.resolve(data) - } - }, - function (err) { - if (!isTimeout) { - clearTimeout(timeout) - deferred.reject(err) - } - }) - - return deferred.promise -} - -/** - * Attempt to resolve this promise with the specified input - * - * @param {*} data the input - */ -Promise.prototype._withInput = function (data) { - if (this._successFn) { - this._nextTick(this._successFn, [data, this._currentContext]) - } else { - this.resolve(data) - } - - // context is no longer needed - delete this._currentContext -} - -/** - * Attempt to reject this promise with the specified error - * - * @param {!Error} e - * @private - */ -Promise.prototype._withError = function (e) { - if (this._failFn) { - this._nextTick(this._failFn, [e, this._currentContext]) - } else { - this.reject(e) - } - - // context is no longer needed - delete this._currentContext -} - -/** - * Calls a function in the correct scope, and includes bound arguments. - * @param {Function} fn - * @param {Array} args - * @private - */ -Promise.prototype._nextTick = function (fn, args) { - if (this._boundArgs) { - args = this._boundArgs.concat(args) - } - nextTick(nextTickCallback.bind(null, this, fn, this._scope, args)) -} - -/** - * Chain a promise to the current promise - * - * @param {!Promise} promise the promise to chain - * @private - */ -Promise.prototype._chainPromise = function (promise) { - var i - if (this._hasContext) promise._useContext(this._nextContext) - - if (this._child) { - this._child._chainPromise(promise) - } else if (this._hasData) { - promise._withInput(this._data) - } else if (this._error) { - // We can't rely on _withError() because it's called on the chained promises - // and we need to use the source's _errorHandled state - this._handleError() - promise._withError(this._error) - } else if (!this._promises) { - this._promises = [promise] - } else { - this._promises.push(promise) - } -} - -/** - * Utility function used for creating a node-style resolver - * for deferreds - * - * @param {!Promise} deferred a promise that looks like a deferred - * @param {Error=} err an optional error - * @param {*=} data optional data - */ -function resolver(deferred, err, data) { - if (err) deferred.reject(err) - else deferred.resolve(data) -} - -/** - * Creates a node-style resolver for a deferred by wrapping - * resolver() - * - * @return {function(?Error, *)} node-style callback - */ -Promise.prototype.makeNodeResolver = function () { - return resolver.bind(null, this) -} - -/** - * Return true iff the given object is a promise of this library. - * - * Because kew's API is slightly different than other promise libraries, - * it's important that we have a test for its promise type. If you want - * to test for a more general A+ promise, you should do a cap test for - * the features you want. - * - * @param {*} obj The object to test - * @return {boolean} Whether the object is a promise - */ -function isPromise(obj) { - return !!obj._isPromise -} - -/** - * Return true iff the given object is a promise-like object, e.g. appears to - * implement Promises/A+ specification - * - * @param {*} obj The object to test - * @return {boolean} Whether the object is a promise-like object - */ -function isPromiseLike(obj) { - return (typeof obj === 'object' || typeof obj === 'function') && - typeof obj.then === 'function' -} - -/** - * Static function which creates and resolves a promise immediately - * - * @param {T} data data to resolve the promise with - * @return {!Promise.} - * @template T - */ -function resolve(data) { - var promise = new Promise() - promise.resolve(data) - return promise -} - -/** - * Static function which creates and rejects a promise immediately - * - * @param {!Error} e error to reject the promise with - * @return {!Promise} - */ -function reject(e) { - var promise = new Promise() - promise.reject(e) - return promise -} - -/** - * Replace an element in an array with a new value. Used by .all() to - * call from .then() - * - * @param {!Array} arr - * @param {number} idx - * @param {*} val - * @return {*} the val that's being injected into the array - */ -function replaceEl(arr, idx, val) { - arr[idx] = val - return val -} - -/** - * Replace an element in an array as it is resolved with its value. - * Used by .allSettled(). - * - * @param {!Array} arr - * @param {number} idx - * @param {*} value The value from a resolved promise. - * @return {*} the data that's being passed in - */ -function replaceElFulfilled(arr, idx, value) { - arr[idx] = { - state: 'fulfilled', - value: value - } - return value -} - -/** - * Replace an element in an array as it is rejected with the reason. - * Used by .allSettled(). - * - * @param {!Array} arr - * @param {number} idx - * @param {*} reason The reason why the original promise is rejected - * @return {*} the data that's being passed in - */ -function replaceElRejected(arr, idx, reason) { - arr[idx] = { - state: 'rejected', - reason: reason - } - return reason -} - -/** - * Takes in an array of promises or literals and returns a promise which returns - * an array of values when all have resolved. If any fail, the promise fails. - * - * @param {!Array.} promises - * @return {!Promise.} - */ -function all(promises) { - if (arguments.length != 1 || !Array.isArray(promises)) { - promises = Array.prototype.slice.call(arguments, 0) - } - return allInternal(promises) -} - -/** - * A version of all() that does not accept var_args - * - * @param {!Array.} promises - * @return {!Promise.} - */ -function allInternal(promises) { - if (!promises.length) return resolve([]) - - var outputs = [] - var finished = false - var promise = new Promise() - var counter = promises.length - - for (var i = 0; i < promises.length; i += 1) { - if (!promises[i] || !isPromiseLike(promises[i])) { - outputs[i] = promises[i] - counter -= 1 - } else { - promises[i].then(replaceEl.bind(null, outputs, i)) - .then(function decrementAllCounter() { - counter-- - if (!finished && counter === 0) { - finished = true - promise.resolve(outputs) - } - }, function onAllError(e) { - if (!finished) { - finished = true - promise.reject(e) - } - }) - } - } - - if (counter === 0 && !finished) { - finished = true - promise.resolve(outputs) - } - - return promise -} - -/** - * Takes in an array of promises or values and returns a promise that is - * fulfilled with an array of state objects when all have resolved or - * rejected. If a promise is resolved, its corresponding state object is - * {state: 'fulfilled', value: Object}; whereas if a promise is rejected, its - * corresponding state object is {state: 'rejected', reason: Object}. - * - * @param {!Array} promises or values - * @return {!Promise.} Promise fulfilled with state objects for each input - */ -function allSettled(promises) { - if (!Array.isArray(promises)) { - throw Error('The input to "allSettled()" should be an array of Promise or values') - } - if (!promises.length) return resolve([]) - - var outputs = [] - var promise = new Promise() - var counter = promises.length - - for (var i = 0; i < promises.length; i += 1) { - if (!promises[i] || !isPromiseLike(promises[i])) { - replaceElFulfilled(outputs, i, promises[i]) - if ((--counter) === 0) promise.resolve(outputs) - } else { - promises[i] - .then(replaceElFulfilled.bind(null, outputs, i), replaceElRejected.bind(null, outputs, i)) - .then(function () { - if ((--counter) === 0) promise.resolve(outputs) - }) - } - } - - return promise -} - -/** - * Takes an array of results and spreads them to the arguments of a function. - * @param {!Array} array - * @param {!Function} fn - */ -function spread(array, fn) { - resolve(array).spread(fn) -} - -/** - * Create a new Promise which looks like a deferred - * - * @return {!Promise} - */ -function defer() { - return new Promise() -} - -/** - * Return a promise which will wait a specified number of ms to resolve - * - * @param {*} delayMsOrVal A delay (in ms) if this takes one argument, or ther - * return value if it takes two. - * @param {number=} opt_delayMs - * @return {!Promise} - */ -function delay(delayMsOrVal, opt_delayMs) { - var returnVal = undefined - var delayMs = delayMsOrVal - if (typeof opt_delayMs != 'undefined') { - delayMs = opt_delayMs - returnVal = delayMsOrVal - } - - if (typeof delayMs != 'number') { - throw new Error('Bad delay value ' + delayMs) - } - - var defer = new Promise() - setTimeout(function onDelay() { - defer.resolve(returnVal) - }, delayMs) - return defer -} - -/** - * Returns a promise that has the same result as `this`, but fulfilled - * after at least ms milliseconds - * @param {number} ms - */ -Promise.prototype.delay = function (ms) { - return this.then(function (val) { - return delay(val, ms) - }) -} - -/** - * Return a promise which will evaluate the function fn in a future turn with - * the provided args - * - * @param {function(...)} fn - * @param {...*} var_args a variable number of arguments - * @return {!Promise} - */ -function fcall(fn, var_args) { - var rootArgs = Array.prototype.slice.call(arguments, 1) - var defer = new Promise() - nextTick(nextTickCallback.bind(null, defer, fn, undefined, rootArgs)) - return defer -} - - -/** - * Returns a promise that will be invoked with the result of a node style - * callback. All args to fn should be given except for the final callback arg - * - * @param {function(...)} fn - * @param {...*} var_args a variable number of arguments - * @return {!Promise} - */ -function nfcall(fn, var_args) { - // Insert an undefined argument for scope and let bindPromise() do the work. - var args = Array.prototype.slice.call(arguments, 0) - args.splice(1, 0, undefined) - return ncall.apply(undefined, args) -} - - -/** - * Like `nfcall`, but permits passing a `this` context for the call. - * - * @param {function(...)} fn - * @param {Object} scope - * @param {...*} var_args - * @return {!Promise} - */ -function ncall(fn, scope, var_args) { - return bindPromise.apply(null, arguments)() -} - - -/** - * Binds a function to a scope with an optional number of curried arguments. Attaches - * a node style callback as the last argument and returns a promise - * - * @param {function(...)} fn - * @param {Object} scope - * @param {...*} var_args a variable number of arguments - * @return {function(...)}: !Promise} - */ -function bindPromise(fn, scope, var_args) { - var rootArgs = Array.prototype.slice.call(arguments, 2) - return function onBoundPromise(var_args) { - var defer = new Promise() - try { - fn.apply(scope, rootArgs.concat(Array.prototype.slice.call(arguments, 0), defer.makeNodeResolver())) - } catch (e) { - defer.reject(e) - } - return defer - } -} - -module.exports = { - all: all, - bindPromise: bindPromise, - defer: defer, - delay: delay, - fcall: fcall, - isPromise: isPromise, - isPromiseLike: isPromiseLike, - ncall: ncall, - nfcall: nfcall, - resolve: resolve, - reject: reject, - spread: spread, - stats: stats, - allSettled: allSettled, - Promise: Promise, - getNextTickFunction: getNextTickFunction, - setNextTickFunction: setNextTickFunction, -} diff --git a/plugins/music_service/squeezelite/node_modules/kew/package.json b/plugins/music_service/squeezelite/node_modules/kew/package.json deleted file mode 100644 index 900401340..000000000 --- a/plugins/music_service/squeezelite/node_modules/kew/package.json +++ /dev/null @@ -1,110 +0,0 @@ -{ - "_args": [ - [ - { - "raw": "kew@^0.7.0", - "scope": null, - "escapedName": "kew", - "name": "kew", - "rawSpec": "^0.7.0", - "spec": ">=0.7.0 <0.8.0", - "type": "range" - }, - "/home/volumio/volumio-plugins/plugins/music_service/squeezelite" - ] - ], - "_from": "kew@>=0.7.0 <0.8.0", - "_id": "kew@0.7.0", - "_inCache": true, - "_location": "/kew", - "_nodeVersion": "0.12.7", - "_npmUser": { - "name": "nicks", - "email": "nicholas.j.santos@gmail.com" - }, - "_npmVersion": "2.11.3", - "_phantomChildren": {}, - "_requested": { - "raw": "kew@^0.7.0", - "scope": null, - "escapedName": "kew", - "name": "kew", - "rawSpec": "^0.7.0", - "spec": ">=0.7.0 <0.8.0", - "type": "range" - }, - "_requiredBy": [ - "/" - ], - "_resolved": "https://registry.npmjs.org/kew/-/kew-0.7.0.tgz", - "_shasum": "79d93d2d33363d6fdd2970b335d9141ad591d79b", - "_shrinkwrap": null, - "_spec": "kew@^0.7.0", - "_where": "/home/volumio/volumio-plugins/plugins/music_service/squeezelite", - "authors": [ - "Jeremy Stanley (https://github.com/azulus)", - "Nick Santos ", - "Xiao Ma " - ], - "bugs": { - "url": "https://github.com/Medium/kew/issues" - }, - "contributors": [], - "dependencies": {}, - "description": "a lightweight promise library for node", - "devDependencies": { - "closure-npc": "0.1.5", - "nodeunit": "0.9.0", - "q": "0.9.7" - }, - "directories": {}, - "dist": { - "shasum": "79d93d2d33363d6fdd2970b335d9141ad591d79b", - "tarball": "https://registry.npmjs.org/kew/-/kew-0.7.0.tgz" - }, - "gitHead": "5773bcb8e6c27b531e366cd247b83b8cbf7bc989", - "homepage": "https://github.com/Medium/kew", - "keywords": [ - "kew", - "promises" - ], - "license": "Apache-2.0", - "main": "./kew.js", - "maintainers": [ - { - "name": "azulus", - "email": "npm@azulus.com" - }, - { - "name": "nicks", - "email": "nicholas.j.santos@gmail.com" - }, - { - "name": "dpup", - "email": "dan@pupi.us" - }, - { - "name": "medium", - "email": "npm@medium.com" - }, - { - "name": "xiao", - "email": "x@medium.com" - }, - { - "name": "chaosgame", - "email": "chaosgame@gmail.com" - } - ], - "name": "kew", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/Medium/kew.git" - }, - "scripts": { - "test": "nodeunit test && closure-npc ./test/closure_test.js --jscomp_error=checkTypes" - }, - "version": "0.7.0" -} diff --git a/plugins/music_service/squeezelite/node_modules/kew/test/chain.js b/plugins/music_service/squeezelite/node_modules/kew/test/chain.js deleted file mode 100644 index f0abdcbd1..000000000 --- a/plugins/music_service/squeezelite/node_modules/kew/test/chain.js +++ /dev/null @@ -1,434 +0,0 @@ -var Q = require('../kew') -var originalQ = require('q') - -// test that fin() works with a synchronous resolve -exports.testSynchronousThenAndFin = function (test) { - var vals = ['a', 'b'] - var counter = 0 - - var promise1 = Q.resolve(vals[0]) - var promise2 = promise1.fin(function () { - counter++ - }) - var promise3 = promise2.then(function (data) { - if (data === vals[0]) return vals[1] - }) - var promise4 = promise3.fin(function () { - counter++ - }) - - Q.all([promise2, promise4]) - .then(function (data) { - test.equal(counter, 2, "fin() should have been called twice") - test.equal(data[0], vals[0], "first fin() should return the first val") - test.equal(data[1], vals[1], "second fin() should return the second val") - test.done() - }) -} - -// test that fin() works with a synchronous reject -exports.testSynchronousFailAndFin = function (test) { - var errs = [] - errs.push(new Error('nope 1')) - errs.push(new Error('nope 2')) - var counter = 0 - - var promise1 = Q.reject(errs[0]) - var promise2 = promise1.fin(function () { - counter++ - }) - var promise3 = promise2.fail(function (e) { - if (e === errs[0]) throw errs[1] - }) - var promise4 = promise3.fin(function () { - counter++ - }) - - Q.all([ - promise2.fail(function (e) { - return e === errs[0] - }), - promise4.fail(function (e) { - return e === errs[1] - }) - ]) - .then(function (data) { - test.equal(counter, 2, "fin() should have been called twice") - test.equal(data[0] && data[1], true, "all promises should return true") - test.done() - }) -} - -// test that fin() works with an asynchrnous resolve -exports.testAsynchronousThenAndFin = function (test) { - var vals = ['a', 'b'] - var counter = 0 - - var defer = Q.defer() - setTimeout(function () { - defer.resolve(vals[0]) - }) - var promise1 = defer.promise - var promise2 = promise1.fin(function () { - counter++ - }) - var promise3 = promise2.then(function (data) { - if (data !== vals[0]) return - - var defer = Q.defer() - setTimeout(function () { - defer.resolve(vals[1]) - }) - return defer.promise - }) - var promise4 = promise3.fin(function () { - counter++ - }) - - Q.all([promise2, promise4]) - .then(function (data) { - test.equal(counter, 2, "fin() should have been called twice") - test.equal(data[0], vals[0], "first fin() should return the first val") - test.equal(data[1], vals[1], "second fin() should return the second val") - test.done() - }) -} - -// test that fin() works with an asynchronous reject -exports.testAsynchronousFailAndFin = function (test) { - var errs = [] - errs.push(new Error('nope 1')) - errs.push(new Error('nope 2')) - var counter = 0 - - var defer = Q.defer() - setTimeout(function () { - defer.reject(errs[0]) - }, 10) - var promise1 = defer.promise - var promise2 = promise1.fin(function () { - counter++ - }) - var promise3 = promise2.fail(function (e) { - if (e !== errs[0]) return - - var defer = Q.defer() - setTimeout(function () { - defer.reject(errs[1]) - }, 10) - - return defer.promise - }) - var promise4 = promise3.fin(function () { - counter++ - }) - - Q.all([ - promise2.fail(function (e) { - return e === errs[0] - }), - promise4.fail(function (e) { - return e === errs[1] - }) - ]) - .then(function (data) { - test.equal(counter, 2, "fin() should have been called twice") - test.equal(data[0] && data[1], true, "all promises should return true") - test.done() - }) -} - -// test several thens chaining -exports.testChainedThens = function (test) { - var promise1 = Q.resolve('a') - var promise2 = promise1.then(function(data) { - return data + 'b' - }) - var promise3 = promise2.then(function (data) { - return data + 'c' - }) - // testing the same promise again to make sure they can run side by side - var promise4 = promise2.then(function (data) { - return data + 'c' - }) - - Q.all([promise1, promise2, promise3, promise4]) - .then(function (data) { - test.equal(data[0], 'a') - test.equal(data[1], 'ab') - test.equal(data[2], 'abc') - test.equal(data[3], 'abc') - test.done() - }) -} - -// test several fails chaining -exports.testChainedFails = function (test) { - var errs = [] - errs.push(new Error("first err")) - errs.push(new Error("second err")) - errs.push(new Error("third err")) - - var promise1 = Q.reject(errs[0]) - var promise2 = promise1.fail(function (e) { - if (e === errs[0]) throw errs[1] - }) - var promise3 = promise2.fail(function (e) { - if (e === errs[1]) throw errs[2] - }) - var promise4 = promise2.fail(function (e) { - if (e === errs[1]) throw errs[2] - }) - - Q.all([ - promise1.fail(function (e) { - return e === errs[0] - }), - promise2.fail(function (e) { - return e === errs[1] - }), - promise3.fail(function (e) { - return e === errs[2] - }), - promise4.fail(function (e) { - return e === errs[2] - }) - ]) - .then(function (data) { - test.equal(data[0] && data[1] && data[2] && data[3], true) - test.done() - }) -} - -// test that we can call end without callbacks and not fail -exports.testEndNoCallbacks = function (test) { - Q.resolve(true).end() - test.ok("Ended successfully") - test.done() -} - -// test that we can call end with callbacks and fail -exports.testEndNoCallbacksThrows = function (test) { - var testError = new Error('Testing') - try { - Q.reject(testError).end() - test.fail("Should throw an error") - } catch (e) { - test.equal(e, testError, "Should throw the correct error") - } - test.done() -} - -// test chaining when a promise returns a promise -exports.testChainedPromises = function (test) { - var err = new Error('nope') - var val = 'ok' - - var shouldFail = Q.reject(err) - var shouldSucceed = Q.resolve(val) - - Q.resolve("start") - .then(function () { - return shouldFail - }) - .fail(function (e) { - if (e === err) return shouldSucceed - else throw e - }) - .then(function (data) { - test.equal(data, val, "val should be returned") - test.done() - }) -} - -// test .end() is called with no parent scope (causing an uncaught exception) -exports.testChainedEndUncaught = function (test) { - var uncaughtErrors = 0 - var errs = [] - errs.push(new Error('nope 1')) - errs.push(new Error('nope 2')) - errs.push(new Error('nope 3')) - - var cb = function (e) { - uncaughtErrors++ - if (e === errs[2]) { - test.equal(uncaughtErrors, 3, "Errors should be uncaught") - process.removeListener('uncaughtException', cb) - test.done() - } - } - process.on('uncaughtException', cb) - - var defer = Q.defer() - defer.promise.end() - - var promise1 = defer.promise - var promise2 = promise1.fail(function (e) { - if (e === errs[0]) throw errs[1] - }) - var promise3 = promise2.fail(function (e) { - if (e === errs[1]) throw errs[2] - }) - - promise1.end() - promise2.end() - promise3.end() - - setTimeout(function () { - defer.reject(errs[0]) - }, 10) -} - -// test .end() is called with a parent scope and is caught -exports.testChainedCaught = function (test) { - var err = new Error('nope') - - try { - Q.reject(err).end() - } catch (e) { - test.equal(e, err, "Error should be caught") - test.done() - } -} - -// test a mix of fails and thens -exports.testChainedMixed = function (test) { - var errs = [] - errs.push(new Error('nope 1')) - errs.push(new Error('nope 2')) - errs.push(new Error('nope 3')) - - var vals = [3, 2, 1] - - var promise1 = Q.reject(errs[0]) - var promise2 = promise1.fail(function (e) { - if (e === errs[0]) return vals[0] - }) - var promise3 = promise2.then(function (data) { - if (data === vals[0]) throw errs[1] - }) - var promise4 = promise3.fail(function (e) { - if (e === errs[1]) return vals[1] - }) - var promise5 = promise4.then(function (data) { - if (data === vals[1]) throw errs[2] - }) - var promise6 = promise5.fail(function (e) { - if (e === errs[2]) return vals[2] - }) - - Q.all([ - promise1.fail(function (e) { - return e === errs[0] - }), - promise2.then(function (data) { - return data === vals[0] - }), - promise3.fail(function (e) { - return e === errs[1] - }), - promise4.then(function (data) { - return data === vals[1] - }), - promise5.fail(function (e) { - return e === errs[2] - }), - promise6.then(function (data) { - return data === vals[2] - }) - ]) - .then(function (data) { - test.equal(data[0] && data[1] && data[2] && data[3] && data[4] && data[5], true, "All values should return true") - test.done() - }) -} - -exports.testInteroperabilityWithOtherPromises = function(test) { - var promise1 = Q.defer() - promise1.then(function(value) { - return originalQ(1 + value) - }).then(function(result) { - test.equal(result, 11) - }) - - var promise2 = Q.defer(), - errToThrow = new Error('error') - promise2.then(function() { - return originalQ.reject(errToThrow) - }).fail(function(err) { - test.equal(err, errToThrow) - }) - - promise1.resolve(10) - promise2.resolve() - - Q.all([promise1, promise2]).then(function() { - test.done() - }) -} - -exports.testAllSettled = function(test) { - var promise1 = Q.resolve('woot') - var promise2 = Q.reject(new Error('oops')) - - Q.allSettled([promise1, promise2, 'just a string']) - .then(function (data) { - test.equals('fulfilled', data[0].state) - test.equals('woot', data[0].value) - test.equals('rejected', data[1].state) - test.equals('oops', data[1].reason.message) - test.equals('fulfilled', data[2].state) - test.equals('just a string', data[2].value) - }) - - Q.allSettled([]) - .then(function (data) { - test.equals(0, data.length) - test.done() - }) -} - -exports.testTimeout = function(test) { - var promise = Q.delay(50).timeout(45, 'Timeout message') - promise.then(function () { - test.fail('The promise is supposed to be timeout') - }) - .fail(function (e) { - test.equals('Timeout message', e.message, 'The error message should be the one passed into timeout()') - }) - .fin(test.done) -} - -exports.testNotTimeout = function(test) { - var promise = Q.delay('expected data', 40).timeout(45, 'Timeout message') - promise.then(function (data) { - test.equals('expected data', data, 'The data should be the data from the original promise') - }) - .fail(function (e) { - test.fail('The promise is supposed to be resolved before the timeout') - }) - .fin(test.done) -} - -exports.testNotTimeoutButReject = function(test) { - var promise = Q.delay(40).then(function() {throw new Error('Reject message')}).timeout(45, 'Timeout message') - promise.then(function (data) { - test.fail('The promise is supposed to be rejected') - }) - .fail(function (e) { - test.equals('Reject message', e.message, 'The error message should be from the original promise') - }) - .fin(test.done) -} - -exports.testDelay = function (test) { - var timePassed = false - setTimeout(function () { - timePassed = true - }, 10) - Q.resolve('expected').delay(20).then(function (result) { - test.equal('expected', result) - test.ok(timePassed) - test.done() - }) -} diff --git a/plugins/music_service/squeezelite/node_modules/kew/test/closure_test.js b/plugins/music_service/squeezelite/node_modules/kew/test/closure_test.js deleted file mode 100644 index 624e439d1..000000000 --- a/plugins/music_service/squeezelite/node_modules/kew/test/closure_test.js +++ /dev/null @@ -1,135 +0,0 @@ -/** - * @fileoverview A sample file to test type-checking - */ - -var kew = require('../kew') -var Promise = kew.Promise -var all = kew.all -var allSettled = kew.allSettled -var fcall = kew.fcall -var nfcall = kew.nfcall -var bindPromise = kew.bindPromise - -/** -@param {Array} result -*/ -var callback = function (result) {}; - -/** -@param {Array} result -@param {Array} context -*/ -var callbackWithContext = function (result, context) {}; - -/** - * @param {number} n - * @param {*} result - */ -var callbackNeedsBind = function (n, result) {}; - -/** -@param {Error} error -*/ -var errorCallback = function (error) {}; - -/** -@param {Error} error -@param {Array} context -*/ -var errorCallbackWithContext = function (error, context) {}; - -/** @return {kew.Promise.} */ -var stringPromise = function () { - return kew.resolve('string') -} - -var exampleThen = function () { - var examplePromise = new Promise(); - examplePromise.then(callback); - examplePromise.setContext([]); - examplePromise.then(callbackWithContext); - - examplePromise.then(null, errorCallback); - examplePromise.then(null, errorCallbackWithContext); -}; - - -var thenBound = function () { - stringPromise().thenBound(callbackNeedsBind, null, 3).failBound(callbackNeedsBind, null, 3); -}; - -var examplePromise = function () { - var promise = new Promise(callback); - promise = new Promise(callbackWithContext); - promise = new Promise(null, errorCallback); - promise = new Promise(null, errorCallbackWithContext); -}; - -var exampleFail = function () { - var promise = new Promise(); - promise.fail(errorCallback); - promise.fail(errorCallbackWithContext); -}; - -var exampleResolver = function () { - var promise = new Promise(); - var resolver = promise.makeNodeResolver(); - // success - resolver(null, {}); - // failure - resolver(new Error(), null); -}; - -var exampleAll = function () { - // should not compile, but does - all([5]); - all([{}]); - all([null]); - all([new Promise(), {}]); - all([new Promise(), null]); - - // good - var promise = all([]); - all([new Promise(), new Promise()]); -}; - -var exampleAllSettled = function () { - allSettled([]); - allSettled([5, {}, null, 'string']); - var promise = allSettled([new Promise()]); - promise.then(function(results){}); -}; - -var exampleTimeout = function () { - var promise = new Promise(); - var timeoutPromise = promise.timeout(50); - timeoutPromise.then(function(result){}); -}; - -var noArgsFunction = function () {}; - -var exampleFcall = function () { - fcall(noArgsFunction); - fcall(callback, []); - fcall(callbackWithContext, [], 5); -}; - -/** @param {function(Error, *)} nodeCallback */ -var noArgsWithNodeCallback = function (nodeCallback) {}; - -/** -@param {!Array} argument -@param {function(Error, *)} nodeCallback -*/ -var oneArgWithNodeCallback = function (argument, nodeCallback) {}; - -var exampleNfcall = function () { - var promise = nfcall(noArgsWithNodeCallback); - promise = nfcall(oneArgWithNodeCallback, []); -}; - -var exampleBindPromise = function () { - callback = bindPromise(noArgsWithNodeCallback, null); - callback = bindPromise(noArgsWithNodeCallback, {}); - callback = bindPromise(oneArgWithNodeCallback, null, []); -}; diff --git a/plugins/music_service/squeezelite/node_modules/kew/test/context.js b/plugins/music_service/squeezelite/node_modules/kew/test/context.js deleted file mode 100644 index b41668166..000000000 --- a/plugins/music_service/squeezelite/node_modules/kew/test/context.js +++ /dev/null @@ -1,89 +0,0 @@ -var Q = require('../kew') - -// test that contexts are propogated based on position -exports.testContextWithDelay = function (test) { - - Q.resolve(true) - .setContext({id: 1}) - .then(function (val, context) { - test.equal(context.id, 1, 'Should return the first context') - return Q.delay(500) - }) - .setContext({id: 2}) - .then(function (val, context) { - test.equal(context.id, 2, 'Should return the second context') - return Q.delay(500) - }) - .clearContext() - .then(function (val, context) { - test.equal(typeof context, 'undefined', 'Should return an undefined context') - return Q.delay(500) - }) - .setContext({id: 3}) - .fin(test.done) -} - -// test adding and removing contexts -exports.testGeneralContextFlow = function (test) { - Q.resolve(true) - // test no context exists - .then(function (val, context) { - test.equal(typeof context, 'undefined', 'Context should be undefined') - throw new Error() - }) - .fail(function (e, context) { - test.equal(typeof context, 'undefined', 'Context should be undefined') - }) - - // set the context and mutate it - .setContext({counter: 1}) - .then(function (val, context) { - test.equal(context.counter, 1, 'Counter should be 1') - context.counter++ - }) - .then(function (val, context) { - test.equal(context.counter, 2, 'Counter should be 2') - context.counter++ - throw new Error() - }) - .fail(function (e, context) { - test.equal(context.counter, 3, 'Counter should be 3') - }) - - // return a context - .then(function (val, context) { - return Q.resolve(false) - .setContext({counter: 0}) - }) - .then(function (val, context) { - test.equal(context.counter, 0, 'Counter should be 0') - throw new Error() - }) - .fail(function (e, context) { - test.equal(context.counter, 0, 'Counter should be 0') - }) - - // returning a promise with a cleared context won't clear the parent context - .then(function (val, context) { - return Q.resolve(false).clearContext() - }) - .then(function (val, context) { - test.equal(context.counter, 0, 'Counter should be 0') - throw new Error() - }) - .fail(function (e, context) { - test.equal(context.counter, 0, 'Counter should be 0') - }) - - // test that clearing the context works - .clearContext() - .then(function (val, context) { - test.equal(typeof context, 'undefined', 'Context should be undefined') - throw new Error() - }) - .fail(function (e, context) { - test.equal(typeof context, 'undefined', 'Context should be undefined') - }) - - .fin(test.done) -} \ No newline at end of file diff --git a/plugins/music_service/squeezelite/node_modules/kew/test/defer.js b/plugins/music_service/squeezelite/node_modules/kew/test/defer.js deleted file mode 100644 index 3684f79f5..000000000 --- a/plugins/music_service/squeezelite/node_modules/kew/test/defer.js +++ /dev/null @@ -1,120 +0,0 @@ -var Q = require('../kew') - -// create a deferred which returns a promise -exports.testDeferredResolve = function (test) { - var val = "ok" - var defer = Q.defer() - - defer.promise - .then(function (data) { - test.equal(data, val, "Promise successfully returned") - test.done() - }) - - setTimeout(function () { - defer.resolve(val) - }, 50) -} - -// make sure a deferred can only resolve once -exports.testDeferredResolveOnce = function (test) { - var defer = Q.defer() - - try { - defer.resolve(true) - defer.resolve(true) - test.fail("Unable to resolve the same deferred twice") - } catch (e) { - } - - test.done() -} - -// create a deferred which returns a failed promise -exports.testDeferredReject = function (test) { - var err = new Error("hello") - var defer = Q.defer() - - defer.promise - .fail(function (e) { - test.equal(e, err, "Promise successfully failed") - test.done() - }) - - setTimeout(function () { - defer.reject(err) - }, 50) -} - -// make sure a deferred can only reject once -exports.testDeferredRejectOnce = function (test) { - var defer = Q.defer() - - try { - defer.reject(new Error("nope 1")) - defer.reject(new Error("nope 2")) - test.fail("Unable to reject the same deferred twice") - } catch (e) { - } - - test.done() -} - -// make sure a deferred can only reject once -exports.testDeferAndRejectFail = function (test) { - var defer - - try { - defer = Q.defer() - defer.reject(new Error("nope 1")) - defer.resolve(true) - test.fail("Unable to reject and resolve the same deferred") - } catch (e) { - test.ok(true, "Unable to reject and resolve same deferred") - } - - try { - defer = Q.defer() - defer.resolve(true) - defer.reject(new Error("nope 1")) - test.fail("Unable to reject and resolve the same deferred") - } catch (e) { - test.ok(true, "Unable to reject and resolve same deferred") - } - - test.done() -} - -// create a deferred which resolves with a node-standard callback -exports.testDeferredResolverSuccess = function (test) { - var val = "ok" - var defer = Q.defer() - var callback = defer.makeNodeResolver() - - defer.promise - .then(function (data) { - test.equal(data, val, "Promise successfully returned") - test.done() - }) - - setTimeout(function () { - callback(null, val) - }, 50) -} - -// create a deferred which rejects with a node-standard callback -exports.testDeferredResolverSuccess = function (test) { - var err = new Error("hello") - var defer = Q.defer() - var callback = defer.makeNodeResolver() - - defer.promise - .fail(function (e) { - test.equal(e, err, "Promise successfully failed") - test.done() - }) - - setTimeout(function () { - callback(err) - }, 50) -} \ No newline at end of file diff --git a/plugins/music_service/squeezelite/node_modules/kew/test/externs_node.js b/plugins/music_service/squeezelite/node_modules/kew/test/externs_node.js deleted file mode 100644 index 33d924d64..000000000 --- a/plugins/music_service/squeezelite/node_modules/kew/test/externs_node.js +++ /dev/null @@ -1,9 +0,0 @@ -/* Node externs for Closure Compiler (just enough for kew.js). */ - -/** @const */ -var module = {}; - -/** @const */ -var process = {}; -/** @param {function()} callback */ -process.nextTick = function (callback) {}; diff --git a/plugins/music_service/squeezelite/node_modules/kew/test/later.js b/plugins/music_service/squeezelite/node_modules/kew/test/later.js deleted file mode 100644 index 8206a0759..000000000 --- a/plugins/music_service/squeezelite/node_modules/kew/test/later.js +++ /dev/null @@ -1,45 +0,0 @@ -var Q = require('../kew') - -function synchronous (callback) { - callback() -} - -var asynchronous = Q.getNextTickFunction() - -exports.testAsynchronousSynchronous = function (test) { - Q.setNextTickFunction(synchronous) - - var number = 5 - - Q.resolve(true).then(function () { - number = 6 - }) - test.equals(number, 6, 'Q should resolve synchronously') - - Q.setNextTickFunction(asynchronous) - - Q.resolve(true).then(function () { - number = 7 - }) - test.equals(number, 6, 'Q should resolve asynchronously') - test.done() -} - -exports.testSetImmediate = function (test) { - if (typeof setImmediate == 'undefined') { - test.done() - return - } - - Q.setNextTickFunction(setImmediate) - - var number = 5 - Q.resolve(true).then(function () { - number = 6 - }) - test.equals(number, 5, 'Q should resolve asynchronously') - setImmediate(function () { - test.equals(number, 6, 'Q should schedule _successFn synchronously') - test.done() - }) -} diff --git a/plugins/music_service/squeezelite/node_modules/kew/test/scopes.js b/plugins/music_service/squeezelite/node_modules/kew/test/scopes.js deleted file mode 100644 index d84e6ef90..000000000 --- a/plugins/music_service/squeezelite/node_modules/kew/test/scopes.js +++ /dev/null @@ -1,59 +0,0 @@ -var Q = require('../kew') - -exports.testThen = function (test) { - var detectedScope = null - Q.resolve(true).then(function () { - detectedScope = this - }).then(function () { - test.ok(Q.isPromise(detectedScope), 'then() should be called in context of promise') - test.done() - }) -} - -exports.testFail = function (test) { - var detectedScope = null - Q.reject(new Error()).fail(function () { - detectedScope = this - }).then(function () { - test.ok(Q.isPromise(detectedScope), 'fail() should be called in context of promise') - test.done() - }) -} - -exports.testThenBound = function (test) { - var detectedScope = scope - var scope = {} - Q.resolve(true).thenBound(function () { - detectedScope = scope - }, scope).then(function () { - test.ok(detectedScope === scope, 'thenScoped() should be called in context of scope') - test.done() - }) -} - -exports.testFailBound = function (test) { - var detectedScope = scope - var scope = {} - Q.reject(new Error()).failBound(function () { - detectedScope = scope - }, scope).then(function () { - test.equal(detectedScope, scope, 'failBound() should be called in context of scope') - test.done() - }) -} - -exports.testThenBoundWithArgs = function (test) { - var detectedScope = scope - var scope = {} - Q.resolve(-1).thenBound(function (a, b, c, d) { - test.equal(a, 1) - test.equal(b, 2) - test.equal(c, 3) - test.equal(d, -1) - detectedScope = scope - }, scope, 1, 2, 3).then(function () { - test.ok(detectedScope === scope, 'failScoped() should be called in context of scope') - test.done() - }) -} - diff --git a/plugins/music_service/squeezelite/node_modules/kew/test/spread.js b/plugins/music_service/squeezelite/node_modules/kew/test/spread.js deleted file mode 100644 index c62269a66..000000000 --- a/plugins/music_service/squeezelite/node_modules/kew/test/spread.js +++ /dev/null @@ -1,59 +0,0 @@ -var Q = require('../kew') - -exports.testSpreadStatic = function (test) { - Q.spread([Q.resolve('a'), 'b'], function (a, b) { - test.equal('a', a) - test.equal('b', b) - test.done() - }) -} - -exports.testSpreadMethod = function (test) { - Q.resolve(true) - .then(function () { - return ['a', 'b'] - }) - .spread(function (a, b) { - test.equal('a', a) - test.equal('b', b) - test.done() - }) -} - -exports.testSpreadBoundMethod = function (test) { - Q.resolve(true) - .then(function () { - return [Q.resolve('a'), 'b'] - }) - .spreadBound(function (c, a, b) { - test.equal('scope', this.scope) - test.equal('c', c) - test.equal('a', a) - test.equal('b', b) - test.done() - }, {scope: 'scope'}, 'c') -} - -exports.testAllSynchronization1 = function (test) { - var order = [] - Q.resolve(true) - .then(function () { - var promiseA = Q.fcall(function () { - order.push('a') - }) - var promiseB = Q.fcall(function () { - order.push('b') - }) - - test.deepEqual([], order) - - var promiseAB = Q.all([promiseA, promiseB]) - test.deepEqual([], order) - - return [promiseA, promiseB] - }) - .then(function (results) { - test.deepEqual(['a', 'b'], order) - test.done() - }) -} diff --git a/plugins/music_service/squeezelite/node_modules/kew/test/static.js b/plugins/music_service/squeezelite/node_modules/kew/test/static.js deleted file mode 100644 index 6d5d209b7..000000000 --- a/plugins/music_service/squeezelite/node_modules/kew/test/static.js +++ /dev/null @@ -1,393 +0,0 @@ -var Q = require('../kew') -var originalQ = require('q') - -// create a promise from a literal -exports.testQResolve = function (test) { - var val = "ok" - - Q.resolve(val) - .then(function (data) { - test.equal(data, val, "Promise successfully returned") - test.done() - }) -} - -// create a failed promise from an error literal -exports.testQReject = function (test) { - var err = new Error("hello") - - Q.reject(err) - .fail(function (e) { - test.equal(e, err, "Promise successfully failed") - test.done() - }) -} - -// Test Q.stats -exports.testQStatistics = function (test) { - var err = new Error("hello") - - var errorsEmitted = Q.stats.errorsEmitted - var errorsHandled = Q.stats.errorsHandled - - var rejected = Q.reject(err) - test.equal(errorsEmitted + 1, Q.stats.errorsEmitted, "One additional error emitted") - test.equal(errorsHandled, Q.stats.errorsHandled, "Error hasn't been handled yet") - - rejected.fail(function (e) { - test.equal(e, err, "Promise successfully failed") - test.equal(errorsEmitted + 1, Q.stats.errorsEmitted, "One additional error emitted") - test.equal(errorsHandled + 1, Q.stats.errorsHandled, "One additional error handled") - }) - - rejected.fail(function (e) { - test.equal(e, err, "Promise successfully failed") - test.equal(errorsEmitted + 1, Q.stats.errorsEmitted, "One additional error emitted") - test.equal(errorsHandled + 1, Q.stats.errorsHandled, "Only count error handling once") - }) - test.done() -} - -exports.testQDeferredStatistics = function (test) { - var err = new Error("hello") - - var errorsEmitted = Q.stats.errorsEmitted - var errorsHandled = Q.stats.errorsHandled - - var deferred = Q.defer() - - deferred.fail(function (e) { - test.equal(e, err, "Promise successfully failed") - test.equal(errorsEmitted + 1, Q.stats.errorsEmitted, "One additional error emitted") - test.equal(errorsHandled + 1, Q.stats.errorsHandled, "One additional error handled") - test.done() - }) - - var rejected = deferred.reject(err) - -} - -// test Q.all with an empty array -exports.testQEmptySuccess = function (test) { - var promises = [] - - // make sure all results come back - Q.all(promises) - .then(function (data) { - test.equal(data.length, 0, "No records should be returned") - test.done() - }) -} - -// test Q.all with only literals -exports.testQAllLiteralsSuccess = function (test) { - var vals = [3, 2, 1] - var promises = [] - - promises.push(vals[0]) - promises.push(vals[1]) - promises.push(vals[2]) - - // make sure all results come back - Q.all(promises) - .then(function (data) { - test.equal(data[0], vals[0], "First val should be returned") - test.equal(data[1], vals[1], "Second val should be returned") - test.equal(data[2], vals[2], "Third val should be returned") - test.done() - }) -} - -// test Q.all with only promises -exports.testQAllPromisesSuccess = function (test) { - var vals = [3, 2, 1] - var promises = [] - - promises.push(Q.resolve(vals[0])) - promises.push(Q.resolve(vals[1])) - promises.push(Q.resolve(vals[2])) - - // make sure all results come back - Q.all(promises) - .then(function (data) { - test.equal(data[0], vals[0], "First val should be returned") - test.equal(data[1], vals[1], "Second val should be returned") - test.equal(data[2], vals[2], "Third val should be returned") - test.done() - }) -} - -// create a promise which waits for other promises -exports.testQAllAssortedSuccess = function (test) { - var vals = [3, 2, 1] - var promises = [] - - // a promise that returns the value immediately - promises.push(Q.resolve(vals[0])) - - // the value itself - promises.push(vals[1]) - - // a promise which returns in 10ms - var defer = Q.defer() - promises.push(defer.promise) - setTimeout(function () { - defer.resolve(vals[2]) - }, 10) - - // make sure all results come back - Q.all(promises) - .then(function (data) { - test.equal(data[0], vals[0], "First val should be returned") - test.equal(data[1], vals[1], "Second val should be returned") - test.equal(data[2], vals[2], "Third val should be returned") - test.done() - }) -} - -// test Q.all with a failing promise -exports.testQAllError = function (test) { - var vals = [3, 2, 1] - var err = new Error("hello") - var promises = [] - - promises.push(vals[0]) - promises.push(vals[1]) - - var defer = Q.defer() - promises.push(defer.promise) - defer.reject(err) - - // make sure all results come back - Q.all(promises) - .fail(function (e) { - test.equal(e, err) - test.done() - }) -} - -// test all var_args -exports.testAllVarArgs = function (test) { - var promises = ['a', 'b'] - - Q.all.apply(Q, promises) - .then(function (results) { - test.equal(promises[0], results[0], "First element should be returned") - test.equal(promises[1], results[1], "Second element should be returned") - test.done() - }) -} - -// test all array -exports.testAllArray = function (test) { - var promises = ['a', 'b'] - - Q.all(promises) - .then(function (results) { - test.equal(promises[0], results[0], "First element should be returned") - test.equal(promises[1], results[1], "Second element should be returned") - test.done() - }) -} - -exports.testAllIsPromiseLike = function(test) { - var promises = ['a', originalQ('b')] - - Q.all(promises) - .then(function (results) { - test.equal(promises[0], 'a', "First element should be returned") - test.equal(promises[1], 'b', "Second element should be returned") - test.done() - }) -} - -// test delay -exports.testDelay = function (test) { - var val = "Hello, there" - var startTime = Date.now() - - Q.resolve(val) - .then(function (v) { - return Q.delay(v, 1000) - }) - .then(function (returnVal) { - test.equal(returnVal, val, "Val should be passed through") - - var diff = Date.now() - startTime - - // clock granularity may be off by 15 - test.equal(diff >= 1000 - 15, true, "Should have waited a second. Actually waited " + diff) - test.done() - }) -} - -// test fcall -exports.testFcall = function (test) { - var calledYet = false - var adder = function (a, b) { - calledYet = true - return a + b - } - - Q.fcall(adder, 2, 3) - .then(function (val) { - test.equal(val, 5, "Val should be 2 + 3") - test.done() - }) - test.ok(!calledYet, "fcall() should delay function invocation until next tick") -} - -// test fcall -exports.testFcallError = function (test) { - var error = function () { - throw new Error('my error') - } - - Q.fcall(error) - .then(function (val) { - test.fail('fcall should throw exception') - }, function (err) { - test.equal('my error', err.message) - }) - .then(function () { - test.done() - }) -} - -// test fcall works when fn returns a promise -exports.testFcallGivenPromise = function (test) { - var calledYet = false - var eventualAdd = function (a, b) { - calledYet = true - return Q.resolve(a + b) - } - - Q.fcall(eventualAdd, 2, 3) - .then(function (val) { - test.equal(val, 5, "Val should be 2 + 3") - test.done() - }) - test.ok(!calledYet, "fcall() should delay function invocation until next tick") -} - -// test nfcall, successful case -exports.testNfcall = function (test) { - var nodeStyleEventualAdder = function (a, b, callback) { - setTimeout(function () { - callback(undefined, a + b) - }, 2) - } - - Q.nfcall(nodeStyleEventualAdder, 2, 3) - .then(function (val) { - test.equal(val, 5, "Val should be 2 + 3") - test.done() - }) -} - -// test nfcall, error case -exports.testNfcallErrors = function (test) { - var err = new Error('fail') - - var nodeStyleFailer = function (a, b, callback) { - setTimeout(function() { - callback(err) - }, 2) - } - - Q.nfcall(nodeStyleFailer, 2, 3) - .fail(function (e) { - test.equal(e, err, "Promise successfully failed") - test.done() - }) -} - -// test fcall -exports.testNFcallErrorSync = function (test) { - var error = function () { - throw new Error('my error') - } - - Q.nfcall(error) - .then(function (val) { - test.fail('nfcall should throw exception') - }, function (err) { - test.equal('my error', err.message) - }) - .then(function () { - test.done() - }) -} - -exports.testNcall = function (test) { - function TwoAdder() { - this.a = 2 - } - TwoAdder.prototype.add = function (num, callback) { - setTimeout(function () { - callback(null, this.a + num) - }.bind(this), 10) - } - var adder = new TwoAdder() - Q.ncall(adder.add, adder, 3) - .then(function (val) { - test.equal(val, 5, "Val should be 2 + 3") - test.done() - }) -} - -// test binding a callback function with a promise -exports.testBindPromise = function (test) { - var adder = function (a, b, callback) { - callback(null, a + b) - } - - var boundAdder = Q.bindPromise(adder, null, 2) - boundAdder(3) - .then(function (val) { - test.equal(val, 5, "Val should be 2 + 3") - test.done() - }) -} - -// test checking whether something is a promise -exports.testIsPromise = function (test) { - var kewPromise = Q.defer() - var qPromise = originalQ(10) - var kewLikeObject = { - promise: function () { - return 'not a promise sucka!' - }, - then: function (fn) { - fn('like a promise, brah!') - } - } - test.equal(Q.isPromise(kewPromise), true, 'A Kew promise is a promise') - test.equal(Q.isPromise(qPromise), false, 'A Q promise is not a promise') - test.equal(Q.isPromise(kewLikeObject), false, 'A pretend promise is not a promise') - test.done() -} - -// test checking whether something is a promise-like object -exports.testIsPromiseLike = function (test) { - var kewPromise = Q.defer() - var qPromise = originalQ(10) - var kewLikeObject = { - promise: function () { - return 'not a promise sucka!' - }, - then: function (fn) { - fn('like a promise, brah!') - } - } - var kewLikeFunction = function() {} - kewLikeFunction.then = function(fn) { - fn('like a promise, brah!') - } - test.equal(Q.isPromiseLike(kewPromise), true, 'A Kew promise is promise-like') - test.equal(Q.isPromiseLike(qPromise), true, 'A Q promise is promise-like') - test.equal(Q.isPromiseLike(kewLikeObject), true, 'A pretend promise is a promise-like') - test.equal(Q.isPromiseLike(kewLikeFunction), true, 'A pretend function promise is a promise-like') - - test.done() -} diff --git a/plugins/music_service/squeezelite/node_modules/klaw/.npmignore b/plugins/music_service/squeezelite/node_modules/klaw/.npmignore deleted file mode 100644 index 2db813b91..000000000 --- a/plugins/music_service/squeezelite/node_modules/klaw/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -tests/ -appveyor.yml -.travis.yml diff --git a/plugins/music_service/squeezelite/node_modules/klaw/CHANGELOG.md b/plugins/music_service/squeezelite/node_modules/klaw/CHANGELOG.md deleted file mode 100644 index 83410c741..000000000 --- a/plugins/music_service/squeezelite/node_modules/klaw/CHANGELOG.md +++ /dev/null @@ -1,42 +0,0 @@ -1.3.1 / 2016-10-25 ------------------- -### Added -- `graceful-fs` added as an `optionalDependencies`. Thanks [ryanzim]! - -1.3.0 / 2016-06-09 ------------------- -### Added -- `filter` option to pre-filter and not walk directories. - -1.2.0 / 2016-04-16 ------------------- -- added support for custom `fs` implementation. Useful for https://github.com/tschaub/mock-fs - -1.1.3 / 2015-12-23 ------------------- -- bugfix: if `readdir` error, got hung up. See: https://github.com/jprichardson/node-klaw/issues/1 - -1.1.2 / 2015-11-12 ------------------- -- assert that param `dir` is a `string` - -1.1.1 / 2015-10-25 ------------------- -- bug fix, options not being passed - -1.1.0 / 2015-10-25 ------------------- -- added `queueMethod` and `pathSorter` to `options` to affect searching strategy. - -1.0.0 / 2015-10-25 ------------------- -- removed unused `filter` param -- bugfix: always set `streamOptions` to `objectMode` -- simplified, converted from push mode (streams 1) to proper pull mode (streams 3) - -0.1.0 / 2015-10-25 ------------------- -- initial release - - -[ryanzim]: https://github.com/ryanzim diff --git a/plugins/music_service/squeezelite/node_modules/klaw/LICENSE b/plugins/music_service/squeezelite/node_modules/klaw/LICENSE deleted file mode 100644 index ddb217c97..000000000 --- a/plugins/music_service/squeezelite/node_modules/klaw/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -(The MIT License) - -Copyright (c) 2015-2016 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/plugins/music_service/squeezelite/node_modules/klaw/README.md b/plugins/music_service/squeezelite/node_modules/klaw/README.md deleted file mode 100644 index 78386e4b0..000000000 --- a/plugins/music_service/squeezelite/node_modules/klaw/README.md +++ /dev/null @@ -1,270 +0,0 @@ -Node.js - klaw -============== - -A Node.js file system walker extracted from [fs-extra](https://github.com/jprichardson/node-fs-extra). - -[![npm Package](https://img.shields.io/npm/v/klaw.svg?style=flat-square)](https://www.npmjs.org/package/klaw) -[![build status](https://api.travis-ci.org/jprichardson/node-klaw.svg)](http://travis-ci.org/jprichardson/node-klaw) -[![windows build status](https://ci.appveyor.com/api/projects/status/github/jprichardson/node-klaw?branch=master&svg=true)](https://ci.appveyor.com/project/jprichardson/node-klaw/branch/master) - - -Standard - -Install -------- - - npm i --save klaw - - -Name ----- - -`klaw` is `walk` backwards :p - - -Usage ------ - -### klaw(directory, [options]) - -Returns a [Readable stream](https://nodejs.org/api/stream.html#stream_class_stream_readable) that iterates -through every file and directory starting with `dir` as the root. Every `read()` or `data` event -returns an object with two properties: `path` and `stats`. `path` is the full path of the file and -`stats` is an instance of [fs.Stats](https://nodejs.org/api/fs.html#fs_class_fs_stats). - -- `directory`: The directory to recursively walk. Type `string`. -- `options`: [Readable stream options](https://nodejs.org/api/stream.html#stream_new_stream_readable_options) and -the following: - - `queueMethod` (`string`, default: `'shift'`): Either `'shift'` or `'pop'`. On `readdir()` array, call either `shift()` or `pop()`. - - `pathSorter` (`function`, default: `undefined`): Sorting [function for Arrays](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort). - - `fs` (`object`, default: `require('fs')`): Use this to hook into the `fs` methods or to use [`mock-fs`](https://github.com/tschaub/mock-fs) - - `filter` (`function`, default: `undefined`): Filtering [function for Arrays](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) - -**Streams 1 (push) example:** - -```js -var klaw = require('klaw') - -var items = [] // files, directories, symlinks, etc -klaw('/some/dir') - .on('data', function (item) { - items.push(item.path) - }) - .on('end', function () { - console.dir(items) // => [ ... array of files] - }) -``` - -**Streams 2 & 3 (pull) example:** - -```js -var klaw = require('klaw') - -var items = [] // files, directories, symlinks, etc -klaw('/some/dir') - .on('readable', function () { - var item - while ((item = this.read())) { - items.push(item.path) - } - }) - .on('end', function () { - console.dir(items) // => [ ... array of files] - }) -``` - -If you're not sure of the differences on Node.js streams 1, 2, 3 then I'd -recommend this resource as a good starting point: https://strongloop.com/strongblog/whats-new-io-js-beta-streams3/. - - -### Error Handling - -Listen for the `error` event. - -Example: - -```js -var klaw = require('klaw') -klaw('/some/dir') - .on('readable', function () { - var item - while ((item = this.read())) { - // do something with the file - } - }) - .on('error', function (err, item) { - console.log(err.message) - console.log(item.path) // the file the error occurred on - }) - .on('end', function () { - console.dir(items) // => [ ... array of files] - }) - -``` - - -### Aggregation / Filtering / Executing Actions (Through Streams) - -On many occasions you may want to filter files based upon size, extension, etc. -Or you may want to aggregate stats on certain file types. Or maybe you want to -perform an action on certain file types. - -You should use the module [`through2`](https://www.npmjs.com/package/through2) to easily -accomplish this. - -Install `through2`: - - npm i --save through2 - - -**Example (skipping directories):** - -```js -var klaw = require('klaw') -var through2 = require('through2') - -var excludeDirFilter = through2.obj(function (item, enc, next) { - if (!item.stats.isDirectory()) this.push(item) - next() -}) - -var items = [] // files, directories, symlinks, etc -klaw('/some/dir') - .pipe(excludeDirFilter) - .on('data', function (item) { - items.push(item.path) - }) - .on('end', function () { - console.dir(items) // => [ ... array of files without directories] - }) - -``` -**Example (ignore hidden directories):** -```js -var klaw = require('klaw') -var path = require('path') - -var filterFunc = function(item){ - var basename = path.basename(item) - return basename === '.' || basename[0] !== '.' -} - -klaw('/some/dir', { filter : filterFunc }) - .on('data', function(item){ - // only items of none hidden folders will reach here - }) - -``` - -**Example (totaling size of PNG files):** - -```js -var klaw = require('klaw') -var path = require('path') -var through2 = require('through2') - -var totalPngsInBytes = 0 -var aggregatePngSize = through2.obj(function (item, enc, next) { - if (path.extname(item.path) === '.png') { - totalPngsInBytes += item.stats.size - } - this.push(item) - next() -}) - -klaw('/some/dir') - .pipe(aggregatePngSize) - .on('data', function (item) { - items.push(item.path) - }) - .on('end', function () { - console.dir(totalPngsInBytes) // => total of all pngs (bytes) - }) -``` - - -**Example (deleting all .tmp files):** - -```js -var fs = require('fs') -var klaw = require('klaw') -var through2 = require('through2') - -var deleteAction = through2.obj(function (item, enc, next) { - this.push(item) - - if (path.extname(item.path) === '.tmp') { - item.deleted = true - fs.unklink(item.path, next) - } else { - item.deleted = false - next() - } -}) - -var deletedFiles = [] -klaw('/some/dir') - .pipe(deleteAction) - .on('data', function (item) { - if (!item.deleted) return - deletedFiles.push(item.path) - }) - .on('end', function () { - console.dir(deletedFiles) // => all deleted files - }) -``` - -You can even chain a bunch of these filters and aggregators together. By using -multiple pipes. - -**Example (using multiple filters / aggregators):** - -```js -klaw('/some/dir') - .pipe(filterCertainFiles) - .pipe(deleteSomeOtherFiles) - .on('end', function () { - console.log('all done!') - }) -``` - -**Example passing (piping) through errors:** - -Node.js does not `pipe()` errors. This means that the error on one stream, like -`klaw` will not pipe through to the next. If you want to do this, do the following: - -```js -var klaw = require('klaw') -var through2 = require('through2') - -var excludeDirFilter = through2.obj(function (item, enc, next) { - if (!item.stats.isDirectory()) this.push(item) - next() -}) - -var items = [] // files, directories, symlinks, etc -klaw('/some/dir') - .on('error', function (err) { excludeDirFilter.emit('error', err) }) // forward the error on - .pipe(excludeDirFilter) - .on('data', function (item) { - items.push(item.path) - }) - .on('end', function () { - console.dir(items) // => [ ... array of files without directories] - }) -``` - - -### Searching Strategy - -Pass in options for `queueMethod` and `pathSorter` to affect how the file system -is recursively iterated. See the code for more details, it's less than 50 lines :) - - - -License -------- - -MIT - -Copyright (c) 2015 [JP Richardson](https://github.com/jprichardson) diff --git a/plugins/music_service/squeezelite/node_modules/klaw/package.json b/plugins/music_service/squeezelite/node_modules/klaw/package.json deleted file mode 100644 index 770aebfae..000000000 --- a/plugins/music_service/squeezelite/node_modules/klaw/package.json +++ /dev/null @@ -1,105 +0,0 @@ -{ - "_args": [ - [ - { - "raw": "klaw@^1.3.0", - "scope": null, - "escapedName": "klaw", - "name": "klaw", - "rawSpec": "^1.3.0", - "spec": ">=1.3.0 <2.0.0", - "type": "range" - }, - "/home/volumio/volumio-plugins/plugins/music_service/squeezelite" - ] - ], - "_from": "klaw@>=1.3.0 <2.0.0", - "_id": "klaw@1.3.1", - "_inCache": true, - "_location": "/klaw", - "_nodeVersion": "6.5.0", - "_npmOperationalInternal": { - "host": "packages-18-east.internal.npmjs.com", - "tmp": "tmp/klaw-1.3.1.tgz_1477411628636_0.7360875811427832" - }, - "_npmUser": { - "name": "jprichardson", - "email": "jprichardson@gmail.com" - }, - "_npmVersion": "3.10.3", - "_phantomChildren": {}, - "_requested": { - "raw": "klaw@^1.3.0", - "scope": null, - "escapedName": "klaw", - "name": "klaw", - "rawSpec": "^1.3.0", - "spec": ">=1.3.0 <2.0.0", - "type": "range" - }, - "_requiredBy": [ - "/", - "/fs-extra" - ], - "_resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", - "_shasum": "4088433b46b3b1ba259d78785d8e96f73ba02439", - "_shrinkwrap": null, - "_spec": "klaw@^1.3.0", - "_where": "/home/volumio/volumio-plugins/plugins/music_service/squeezelite", - "author": { - "name": "JP Richardson" - }, - "bugs": { - "url": "https://github.com/jprichardson/node-klaw/issues" - }, - "dependencies": { - "graceful-fs": "^4.1.9" - }, - "description": "File system walker with Readable stream interface.", - "devDependencies": { - "mkdirp": "^0.5.1", - "mock-fs": "^3.8.0", - "rimraf": "^2.4.3", - "standard": "^8.4.0", - "tap-spec": "^4.1.1", - "tape": "^4.2.2" - }, - "directories": {}, - "dist": { - "shasum": "4088433b46b3b1ba259d78785d8e96f73ba02439", - "tarball": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz" - }, - "gitHead": "7ceea730d54726affeaca62d6e362db0b6881f93", - "homepage": "https://github.com/jprichardson/node-klaw#readme", - "keywords": [ - "walk", - "walker", - "fs", - "fs-extra", - "readable", - "streams" - ], - "license": "MIT", - "main": "./src/index.js", - "maintainers": [ - { - "name": "jprichardson", - "email": "jprichardson@gmail.com" - } - ], - "name": "klaw", - "optionalDependencies": { - "graceful-fs": "^4.1.9" - }, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/jprichardson/node-klaw.git" - }, - "scripts": { - "lint": "standard", - "test": "npm run lint && npm run unit", - "unit": "tape tests/**/*.js | tap-spec" - }, - "version": "1.3.1" -} diff --git a/plugins/music_service/squeezelite/node_modules/klaw/src/assign.js b/plugins/music_service/squeezelite/node_modules/klaw/src/assign.js deleted file mode 100644 index 69740f642..000000000 --- a/plugins/music_service/squeezelite/node_modules/klaw/src/assign.js +++ /dev/null @@ -1,16 +0,0 @@ -// simple mutable assign (extracted from fs-extra) -// I really like object-assign package, but I wanted a lean package with zero deps -function _assign () { - var args = [].slice.call(arguments).filter(function (i) { return i }) - var dest = args.shift() - args.forEach(function (src) { - Object.keys(src).forEach(function (key) { - dest[key] = src[key] - }) - }) - - return dest -} - -// thank you baby Jesus for Node v4 and Object.assign -module.exports = Object.assign || _assign diff --git a/plugins/music_service/squeezelite/node_modules/klaw/src/index.js b/plugins/music_service/squeezelite/node_modules/klaw/src/index.js deleted file mode 100644 index ae4a20ecf..000000000 --- a/plugins/music_service/squeezelite/node_modules/klaw/src/index.js +++ /dev/null @@ -1,57 +0,0 @@ -var assert = require('assert') -var fs -try { - fs = require('graceful-fs') -} catch (e) { - fs = require('fs') -} -var path = require('path') -var Readable = require('stream').Readable -var util = require('util') -var assign = require('./assign') - -function Walker (dir, options) { - assert.strictEqual(typeof dir, 'string', '`dir` parameter should be of type string. Got type: ' + typeof dir) - var defaultStreamOptions = { objectMode: true } - var defaultOpts = { queueMethod: 'shift', pathSorter: undefined, filter: undefined } - options = assign(defaultOpts, options, defaultStreamOptions) - - Readable.call(this, options) - this.root = path.resolve(dir) - this.paths = [this.root] - this.options = options - this.fs = options.fs || fs // mock-fs -} -util.inherits(Walker, Readable) - -Walker.prototype._read = function () { - if (this.paths.length === 0) return this.push(null) - var self = this - var pathItem = this.paths[this.options.queueMethod]() - - self.fs.lstat(pathItem, function (err, stats) { - var item = { path: pathItem, stats: stats } - if (err) return self.emit('error', err, item) - if (!stats.isDirectory()) return self.push(item) - - self.fs.readdir(pathItem, function (err, pathItems) { - if (err) { - self.push(item) - return self.emit('error', err, item) - } - - pathItems = pathItems.map(function (part) { return path.join(pathItem, part) }) - if (self.options.filter) pathItems = pathItems.filter(self.options.filter) - if (self.options.pathSorter) pathItems.sort(self.options.pathSorter) - pathItems.forEach(function (pi) { self.paths.push(pi) }) - - self.push(item) - }) - }) -} - -function walk (root, options) { - return new Walker(root, options) -} - -module.exports = walk diff --git a/plugins/music_service/squeezelite/node_modules/minimatch/LICENSE b/plugins/music_service/squeezelite/node_modules/minimatch/LICENSE deleted file mode 100644 index 19129e315..000000000 --- a/plugins/music_service/squeezelite/node_modules/minimatch/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/plugins/music_service/squeezelite/node_modules/minimatch/README.md b/plugins/music_service/squeezelite/node_modules/minimatch/README.md deleted file mode 100644 index ad72b8133..000000000 --- a/plugins/music_service/squeezelite/node_modules/minimatch/README.md +++ /dev/null @@ -1,209 +0,0 @@ -# minimatch - -A minimal matching utility. - -[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.svg)](http://travis-ci.org/isaacs/minimatch) - - -This is the matching library used internally by npm. - -It works by converting glob expressions into JavaScript `RegExp` -objects. - -## Usage - -```javascript -var minimatch = require("minimatch") - -minimatch("bar.foo", "*.foo") // true! -minimatch("bar.foo", "*.bar") // false! -minimatch("bar.foo", "*.+(bar|foo)", { debug: true }) // true, and noisy! -``` - -## Features - -Supports these glob features: - -* Brace Expansion -* Extended glob matching -* "Globstar" `**` matching - -See: - -* `man sh` -* `man bash` -* `man 3 fnmatch` -* `man 5 gitignore` - -## Minimatch Class - -Create a minimatch object by instantiating the `minimatch.Minimatch` class. - -```javascript -var Minimatch = require("minimatch").Minimatch -var mm = new Minimatch(pattern, options) -``` - -### Properties - -* `pattern` The original pattern the minimatch object represents. -* `options` The options supplied to the constructor. -* `set` A 2-dimensional array of regexp or string expressions. - Each row in the - array corresponds to a brace-expanded pattern. Each item in the row - corresponds to a single path-part. For example, the pattern - `{a,b/c}/d` would expand to a set of patterns like: - - [ [ a, d ] - , [ b, c, d ] ] - - If a portion of the pattern doesn't have any "magic" in it - (that is, it's something like `"foo"` rather than `fo*o?`), then it - will be left as a string rather than converted to a regular - expression. - -* `regexp` Created by the `makeRe` method. A single regular expression - expressing the entire pattern. This is useful in cases where you wish - to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled. -* `negate` True if the pattern is negated. -* `comment` True if the pattern is a comment. -* `empty` True if the pattern is `""`. - -### Methods - -* `makeRe` Generate the `regexp` member if necessary, and return it. - Will return `false` if the pattern is invalid. -* `match(fname)` Return true if the filename matches the pattern, or - false otherwise. -* `matchOne(fileArray, patternArray, partial)` Take a `/`-split - filename, and match it against a single row in the `regExpSet`. This - method is mainly for internal use, but is exposed so that it can be - used by a glob-walker that needs to avoid excessive filesystem calls. - -All other methods are internal, and will be called as necessary. - -### minimatch(path, pattern, options) - -Main export. Tests a path against the pattern using the options. - -```javascript -var isJS = minimatch(file, "*.js", { matchBase: true }) -``` - -### minimatch.filter(pattern, options) - -Returns a function that tests its -supplied argument, suitable for use with `Array.filter`. Example: - -```javascript -var javascripts = fileList.filter(minimatch.filter("*.js", {matchBase: true})) -``` - -### minimatch.match(list, pattern, options) - -Match against the list of -files, in the style of fnmatch or glob. If nothing is matched, and -options.nonull is set, then return a list containing the pattern itself. - -```javascript -var javascripts = minimatch.match(fileList, "*.js", {matchBase: true})) -``` - -### minimatch.makeRe(pattern, options) - -Make a regular expression object from the pattern. - -## Options - -All options are `false` by default. - -### debug - -Dump a ton of stuff to stderr. - -### nobrace - -Do not expand `{a,b}` and `{1..3}` brace sets. - -### noglobstar - -Disable `**` matching against multiple folder names. - -### dot - -Allow patterns to match filenames starting with a period, even if -the pattern does not explicitly have a period in that spot. - -Note that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot` -is set. - -### noext - -Disable "extglob" style patterns like `+(a|b)`. - -### nocase - -Perform a case-insensitive match. - -### nonull - -When a match is not found by `minimatch.match`, return a list containing -the pattern itself if this option is set. When not set, an empty list -is returned if there are no matches. - -### matchBase - -If set, then patterns without slashes will be matched -against the basename of the path if it contains slashes. For example, -`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`. - -### nocomment - -Suppress the behavior of treating `#` at the start of a pattern as a -comment. - -### nonegate - -Suppress the behavior of treating a leading `!` character as negation. - -### flipNegate - -Returns from negate expressions the same as if they were not negated. -(Ie, true on a hit, false on a miss.) - - -## Comparisons to other fnmatch/glob implementations - -While strict compliance with the existing standards is a worthwhile -goal, some discrepancies exist between minimatch and other -implementations, and are intentional. - -If the pattern starts with a `!` character, then it is negated. Set the -`nonegate` flag to suppress this behavior, and treat leading `!` -characters normally. This is perhaps relevant if you wish to start the -pattern with a negative extglob pattern like `!(a|B)`. Multiple `!` -characters at the start of a pattern will negate the pattern multiple -times. - -If a pattern starts with `#`, then it is treated as a comment, and -will not match anything. Use `\#` to match a literal `#` at the -start of a line, or set the `nocomment` flag to suppress this behavior. - -The double-star character `**` is supported by default, unless the -`noglobstar` flag is set. This is supported in the manner of bsdglob -and bash 4.1, where `**` only has special significance if it is the only -thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but -`a/**b` will not. - -If an escaped pattern has no matches, and the `nonull` flag is set, -then minimatch.match returns the pattern as-provided, rather than -interpreting the character escapes. For example, -`minimatch.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than -`"*a?"`. This is akin to setting the `nullglob` option in bash, except -that it does not resolve escaped pattern characters. - -If brace expansion is not disabled, then it is performed before any -other interpretation of the glob pattern. Thus, a pattern like -`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded -**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are -checked for validity. Since those two are valid, matching proceeds. diff --git a/plugins/music_service/squeezelite/node_modules/minimatch/minimatch.js b/plugins/music_service/squeezelite/node_modules/minimatch/minimatch.js deleted file mode 100644 index 5b5f8cf44..000000000 --- a/plugins/music_service/squeezelite/node_modules/minimatch/minimatch.js +++ /dev/null @@ -1,923 +0,0 @@ -module.exports = minimatch -minimatch.Minimatch = Minimatch - -var path = { sep: '/' } -try { - path = require('path') -} catch (er) {} - -var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} -var expand = require('brace-expansion') - -var plTypes = { - '!': { open: '(?:(?!(?:', close: '))[^/]*?)'}, - '?': { open: '(?:', close: ')?' }, - '+': { open: '(?:', close: ')+' }, - '*': { open: '(?:', close: ')*' }, - '@': { open: '(?:', close: ')' } -} - -// any single thing other than / -// don't need to escape / when using new RegExp() -var qmark = '[^/]' - -// * => any number of characters -var star = qmark + '*?' - -// ** when dots are allowed. Anything goes, except .. and . -// not (^ or / followed by one or two dots followed by $ or /), -// followed by anything, any number of times. -var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?' - -// not a ^ or / followed by a dot, -// followed by anything, any number of times. -var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?' - -// characters that need to be escaped in RegExp. -var reSpecials = charSet('().*{}+?[]^$\\!') - -// "abc" -> { a:true, b:true, c:true } -function charSet (s) { - return s.split('').reduce(function (set, c) { - set[c] = true - return set - }, {}) -} - -// normalizes slashes. -var slashSplit = /\/+/ - -minimatch.filter = filter -function filter (pattern, options) { - options = options || {} - return function (p, i, list) { - return minimatch(p, pattern, options) - } -} - -function ext (a, b) { - a = a || {} - b = b || {} - var t = {} - Object.keys(b).forEach(function (k) { - t[k] = b[k] - }) - Object.keys(a).forEach(function (k) { - t[k] = a[k] - }) - return t -} - -minimatch.defaults = function (def) { - if (!def || !Object.keys(def).length) return minimatch - - var orig = minimatch - - var m = function minimatch (p, pattern, options) { - return orig.minimatch(p, pattern, ext(def, options)) - } - - m.Minimatch = function Minimatch (pattern, options) { - return new orig.Minimatch(pattern, ext(def, options)) - } - - return m -} - -Minimatch.defaults = function (def) { - if (!def || !Object.keys(def).length) return Minimatch - return minimatch.defaults(def).Minimatch -} - -function minimatch (p, pattern, options) { - if (typeof pattern !== 'string') { - throw new TypeError('glob pattern string required') - } - - if (!options) options = {} - - // shortcut: comments match nothing. - if (!options.nocomment && pattern.charAt(0) === '#') { - return false - } - - // "" only matches "" - if (pattern.trim() === '') return p === '' - - return new Minimatch(pattern, options).match(p) -} - -function Minimatch (pattern, options) { - if (!(this instanceof Minimatch)) { - return new Minimatch(pattern, options) - } - - if (typeof pattern !== 'string') { - throw new TypeError('glob pattern string required') - } - - if (!options) options = {} - pattern = pattern.trim() - - // windows support: need to use /, not \ - if (path.sep !== '/') { - pattern = pattern.split(path.sep).join('/') - } - - this.options = options - this.set = [] - this.pattern = pattern - this.regexp = null - this.negate = false - this.comment = false - this.empty = false - - // make the set of regexps etc. - this.make() -} - -Minimatch.prototype.debug = function () {} - -Minimatch.prototype.make = make -function make () { - // don't do it more than once. - if (this._made) return - - var pattern = this.pattern - var options = this.options - - // empty patterns and comments match nothing. - if (!options.nocomment && pattern.charAt(0) === '#') { - this.comment = true - return - } - if (!pattern) { - this.empty = true - return - } - - // step 1: figure out negation, etc. - this.parseNegate() - - // step 2: expand braces - var set = this.globSet = this.braceExpand() - - if (options.debug) this.debug = console.error - - this.debug(this.pattern, set) - - // step 3: now we have a set, so turn each one into a series of path-portion - // matching patterns. - // These will be regexps, except in the case of "**", which is - // set to the GLOBSTAR object for globstar behavior, - // and will not contain any / characters - set = this.globParts = set.map(function (s) { - return s.split(slashSplit) - }) - - this.debug(this.pattern, set) - - // glob --> regexps - set = set.map(function (s, si, set) { - return s.map(this.parse, this) - }, this) - - this.debug(this.pattern, set) - - // filter out everything that didn't compile properly. - set = set.filter(function (s) { - return s.indexOf(false) === -1 - }) - - this.debug(this.pattern, set) - - this.set = set -} - -Minimatch.prototype.parseNegate = parseNegate -function parseNegate () { - var pattern = this.pattern - var negate = false - var options = this.options - var negateOffset = 0 - - if (options.nonegate) return - - for (var i = 0, l = pattern.length - ; i < l && pattern.charAt(i) === '!' - ; i++) { - negate = !negate - negateOffset++ - } - - if (negateOffset) this.pattern = pattern.substr(negateOffset) - this.negate = negate -} - -// Brace expansion: -// a{b,c}d -> abd acd -// a{b,}c -> abc ac -// a{0..3}d -> a0d a1d a2d a3d -// a{b,c{d,e}f}g -> abg acdfg acefg -// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg -// -// Invalid sets are not expanded. -// a{2..}b -> a{2..}b -// a{b}c -> a{b}c -minimatch.braceExpand = function (pattern, options) { - return braceExpand(pattern, options) -} - -Minimatch.prototype.braceExpand = braceExpand - -function braceExpand (pattern, options) { - if (!options) { - if (this instanceof Minimatch) { - options = this.options - } else { - options = {} - } - } - - pattern = typeof pattern === 'undefined' - ? this.pattern : pattern - - if (typeof pattern === 'undefined') { - throw new TypeError('undefined pattern') - } - - if (options.nobrace || - !pattern.match(/\{.*\}/)) { - // shortcut. no need to expand. - return [pattern] - } - - return expand(pattern) -} - -// parse a component of the expanded set. -// At this point, no pattern may contain "/" in it -// so we're going to return a 2d array, where each entry is the full -// pattern, split on '/', and then turned into a regular expression. -// A regexp is made at the end which joins each array with an -// escaped /, and another full one which joins each regexp with |. -// -// Following the lead of Bash 4.1, note that "**" only has special meaning -// when it is the *only* thing in a path portion. Otherwise, any series -// of * is equivalent to a single *. Globstar behavior is enabled by -// default, and can be disabled by setting options.noglobstar. -Minimatch.prototype.parse = parse -var SUBPARSE = {} -function parse (pattern, isSub) { - if (pattern.length > 1024 * 64) { - throw new TypeError('pattern is too long') - } - - var options = this.options - - // shortcuts - if (!options.noglobstar && pattern === '**') return GLOBSTAR - if (pattern === '') return '' - - var re = '' - var hasMagic = !!options.nocase - var escaping = false - // ? => one single character - var patternListStack = [] - var negativeLists = [] - var stateChar - var inClass = false - var reClassStart = -1 - var classStart = -1 - // . and .. never match anything that doesn't start with ., - // even when options.dot is set. - var patternStart = pattern.charAt(0) === '.' ? '' // anything - // not (start or / followed by . or .. followed by / or end) - : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' - : '(?!\\.)' - var self = this - - function clearStateChar () { - if (stateChar) { - // we had some state-tracking character - // that wasn't consumed by this pass. - switch (stateChar) { - case '*': - re += star - hasMagic = true - break - case '?': - re += qmark - hasMagic = true - break - default: - re += '\\' + stateChar - break - } - self.debug('clearStateChar %j %j', stateChar, re) - stateChar = false - } - } - - for (var i = 0, len = pattern.length, c - ; (i < len) && (c = pattern.charAt(i)) - ; i++) { - this.debug('%s\t%s %s %j', pattern, i, re, c) - - // skip over any that are escaped. - if (escaping && reSpecials[c]) { - re += '\\' + c - escaping = false - continue - } - - switch (c) { - case '/': - // completely not allowed, even escaped. - // Should already be path-split by now. - return false - - case '\\': - clearStateChar() - escaping = true - continue - - // the various stateChar values - // for the "extglob" stuff. - case '?': - case '*': - case '+': - case '@': - case '!': - this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c) - - // all of those are literals inside a class, except that - // the glob [!a] means [^a] in regexp - if (inClass) { - this.debug(' in class') - if (c === '!' && i === classStart + 1) c = '^' - re += c - continue - } - - // if we already have a stateChar, then it means - // that there was something like ** or +? in there. - // Handle the stateChar, then proceed with this one. - self.debug('call clearStateChar %j', stateChar) - clearStateChar() - stateChar = c - // if extglob is disabled, then +(asdf|foo) isn't a thing. - // just clear the statechar *now*, rather than even diving into - // the patternList stuff. - if (options.noext) clearStateChar() - continue - - case '(': - if (inClass) { - re += '(' - continue - } - - if (!stateChar) { - re += '\\(' - continue - } - - patternListStack.push({ - type: stateChar, - start: i - 1, - reStart: re.length, - open: plTypes[stateChar].open, - close: plTypes[stateChar].close - }) - // negation is (?:(?!js)[^/]*) - re += stateChar === '!' ? '(?:(?!(?:' : '(?:' - this.debug('plType %j %j', stateChar, re) - stateChar = false - continue - - case ')': - if (inClass || !patternListStack.length) { - re += '\\)' - continue - } - - clearStateChar() - hasMagic = true - var pl = patternListStack.pop() - // negation is (?:(?!js)[^/]*) - // The others are (?:) - re += pl.close - if (pl.type === '!') { - negativeLists.push(pl) - } - pl.reEnd = re.length - continue - - case '|': - if (inClass || !patternListStack.length || escaping) { - re += '\\|' - escaping = false - continue - } - - clearStateChar() - re += '|' - continue - - // these are mostly the same in regexp and glob - case '[': - // swallow any state-tracking char before the [ - clearStateChar() - - if (inClass) { - re += '\\' + c - continue - } - - inClass = true - classStart = i - reClassStart = re.length - re += c - continue - - case ']': - // a right bracket shall lose its special - // meaning and represent itself in - // a bracket expression if it occurs - // first in the list. -- POSIX.2 2.8.3.2 - if (i === classStart + 1 || !inClass) { - re += '\\' + c - escaping = false - continue - } - - // handle the case where we left a class open. - // "[z-a]" is valid, equivalent to "\[z-a\]" - if (inClass) { - // split where the last [ was, make sure we don't have - // an invalid re. if so, re-walk the contents of the - // would-be class to re-translate any characters that - // were passed through as-is - // TODO: It would probably be faster to determine this - // without a try/catch and a new RegExp, but it's tricky - // to do safely. For now, this is safe and works. - var cs = pattern.substring(classStart + 1, i) - try { - RegExp('[' + cs + ']') - } catch (er) { - // not a valid class! - var sp = this.parse(cs, SUBPARSE) - re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]' - hasMagic = hasMagic || sp[1] - inClass = false - continue - } - } - - // finish up the class. - hasMagic = true - inClass = false - re += c - continue - - default: - // swallow any state char that wasn't consumed - clearStateChar() - - if (escaping) { - // no need - escaping = false - } else if (reSpecials[c] - && !(c === '^' && inClass)) { - re += '\\' - } - - re += c - - } // switch - } // for - - // handle the case where we left a class open. - // "[abc" is valid, equivalent to "\[abc" - if (inClass) { - // split where the last [ was, and escape it - // this is a huge pita. We now have to re-walk - // the contents of the would-be class to re-translate - // any characters that were passed through as-is - cs = pattern.substr(classStart + 1) - sp = this.parse(cs, SUBPARSE) - re = re.substr(0, reClassStart) + '\\[' + sp[0] - hasMagic = hasMagic || sp[1] - } - - // handle the case where we had a +( thing at the *end* - // of the pattern. - // each pattern list stack adds 3 chars, and we need to go through - // and escape any | chars that were passed through as-is for the regexp. - // Go through and escape them, taking care not to double-escape any - // | chars that were already escaped. - for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { - var tail = re.slice(pl.reStart + pl.open.length) - this.debug('setting tail', re, pl) - // maybe some even number of \, then maybe 1 \, followed by a | - tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) { - if (!$2) { - // the | isn't already escaped, so escape it. - $2 = '\\' - } - - // need to escape all those slashes *again*, without escaping the - // one that we need for escaping the | character. As it works out, - // escaping an even number of slashes can be done by simply repeating - // it exactly after itself. That's why this trick works. - // - // I am sorry that you have to see this. - return $1 + $1 + $2 + '|' - }) - - this.debug('tail=%j\n %s', tail, tail, pl, re) - var t = pl.type === '*' ? star - : pl.type === '?' ? qmark - : '\\' + pl.type - - hasMagic = true - re = re.slice(0, pl.reStart) + t + '\\(' + tail - } - - // handle trailing things that only matter at the very end. - clearStateChar() - if (escaping) { - // trailing \\ - re += '\\\\' - } - - // only need to apply the nodot start if the re starts with - // something that could conceivably capture a dot - var addPatternStart = false - switch (re.charAt(0)) { - case '.': - case '[': - case '(': addPatternStart = true - } - - // Hack to work around lack of negative lookbehind in JS - // A pattern like: *.!(x).!(y|z) needs to ensure that a name - // like 'a.xyz.yz' doesn't match. So, the first negative - // lookahead, has to look ALL the way ahead, to the end of - // the pattern. - for (var n = negativeLists.length - 1; n > -1; n--) { - var nl = negativeLists[n] - - var nlBefore = re.slice(0, nl.reStart) - var nlFirst = re.slice(nl.reStart, nl.reEnd - 8) - var nlLast = re.slice(nl.reEnd - 8, nl.reEnd) - var nlAfter = re.slice(nl.reEnd) - - nlLast += nlAfter - - // Handle nested stuff like *(*.js|!(*.json)), where open parens - // mean that we should *not* include the ) in the bit that is considered - // "after" the negated section. - var openParensBefore = nlBefore.split('(').length - 1 - var cleanAfter = nlAfter - for (i = 0; i < openParensBefore; i++) { - cleanAfter = cleanAfter.replace(/\)[+*?]?/, '') - } - nlAfter = cleanAfter - - var dollar = '' - if (nlAfter === '' && isSub !== SUBPARSE) { - dollar = '$' - } - var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast - re = newRe - } - - // if the re is not "" at this point, then we need to make sure - // it doesn't match against an empty path part. - // Otherwise a/* will match a/, which it should not. - if (re !== '' && hasMagic) { - re = '(?=.)' + re - } - - if (addPatternStart) { - re = patternStart + re - } - - // parsing just a piece of a larger pattern. - if (isSub === SUBPARSE) { - return [re, hasMagic] - } - - // skip the regexp for non-magical patterns - // unescape anything in it, though, so that it'll be - // an exact match against a file etc. - if (!hasMagic) { - return globUnescape(pattern) - } - - var flags = options.nocase ? 'i' : '' - try { - var regExp = new RegExp('^' + re + '$', flags) - } catch (er) { - // If it was an invalid regular expression, then it can't match - // anything. This trick looks for a character after the end of - // the string, which is of course impossible, except in multi-line - // mode, but it's not a /m regex. - return new RegExp('$.') - } - - regExp._glob = pattern - regExp._src = re - - return regExp -} - -minimatch.makeRe = function (pattern, options) { - return new Minimatch(pattern, options || {}).makeRe() -} - -Minimatch.prototype.makeRe = makeRe -function makeRe () { - if (this.regexp || this.regexp === false) return this.regexp - - // at this point, this.set is a 2d array of partial - // pattern strings, or "**". - // - // It's better to use .match(). This function shouldn't - // be used, really, but it's pretty convenient sometimes, - // when you just want to work with a regex. - var set = this.set - - if (!set.length) { - this.regexp = false - return this.regexp - } - var options = this.options - - var twoStar = options.noglobstar ? star - : options.dot ? twoStarDot - : twoStarNoDot - var flags = options.nocase ? 'i' : '' - - var re = set.map(function (pattern) { - return pattern.map(function (p) { - return (p === GLOBSTAR) ? twoStar - : (typeof p === 'string') ? regExpEscape(p) - : p._src - }).join('\\\/') - }).join('|') - - // must match entire pattern - // ending in a * or ** will make it less strict. - re = '^(?:' + re + ')$' - - // can match anything, as long as it's not this. - if (this.negate) re = '^(?!' + re + ').*$' - - try { - this.regexp = new RegExp(re, flags) - } catch (ex) { - this.regexp = false - } - return this.regexp -} - -minimatch.match = function (list, pattern, options) { - options = options || {} - var mm = new Minimatch(pattern, options) - list = list.filter(function (f) { - return mm.match(f) - }) - if (mm.options.nonull && !list.length) { - list.push(pattern) - } - return list -} - -Minimatch.prototype.match = match -function match (f, partial) { - this.debug('match', f, this.pattern) - // short-circuit in the case of busted things. - // comments, etc. - if (this.comment) return false - if (this.empty) return f === '' - - if (f === '/' && partial) return true - - var options = this.options - - // windows: need to use /, not \ - if (path.sep !== '/') { - f = f.split(path.sep).join('/') - } - - // treat the test path as a set of pathparts. - f = f.split(slashSplit) - this.debug(this.pattern, 'split', f) - - // just ONE of the pattern sets in this.set needs to match - // in order for it to be valid. If negating, then just one - // match means that we have failed. - // Either way, return on the first hit. - - var set = this.set - this.debug(this.pattern, 'set', set) - - // Find the basename of the path by looking for the last non-empty segment - var filename - var i - for (i = f.length - 1; i >= 0; i--) { - filename = f[i] - if (filename) break - } - - for (i = 0; i < set.length; i++) { - var pattern = set[i] - var file = f - if (options.matchBase && pattern.length === 1) { - file = [filename] - } - var hit = this.matchOne(file, pattern, partial) - if (hit) { - if (options.flipNegate) return true - return !this.negate - } - } - - // didn't get any hits. this is success if it's a negative - // pattern, failure otherwise. - if (options.flipNegate) return false - return this.negate -} - -// set partial to true to test if, for example, -// "/a/b" matches the start of "/*/b/*/d" -// Partial means, if you run out of file before you run -// out of pattern, then that's fine, as long as all -// the parts match. -Minimatch.prototype.matchOne = function (file, pattern, partial) { - var options = this.options - - this.debug('matchOne', - { 'this': this, file: file, pattern: pattern }) - - this.debug('matchOne', file.length, pattern.length) - - for (var fi = 0, - pi = 0, - fl = file.length, - pl = pattern.length - ; (fi < fl) && (pi < pl) - ; fi++, pi++) { - this.debug('matchOne loop') - var p = pattern[pi] - var f = file[fi] - - this.debug(pattern, p, f) - - // should be impossible. - // some invalid regexp stuff in the set. - if (p === false) return false - - if (p === GLOBSTAR) { - this.debug('GLOBSTAR', [pattern, p, f]) - - // "**" - // a/**/b/**/c would match the following: - // a/b/x/y/z/c - // a/x/y/z/b/c - // a/b/x/b/x/c - // a/b/c - // To do this, take the rest of the pattern after - // the **, and see if it would match the file remainder. - // If so, return success. - // If not, the ** "swallows" a segment, and try again. - // This is recursively awful. - // - // a/**/b/**/c matching a/b/x/y/z/c - // - a matches a - // - doublestar - // - matchOne(b/x/y/z/c, b/**/c) - // - b matches b - // - doublestar - // - matchOne(x/y/z/c, c) -> no - // - matchOne(y/z/c, c) -> no - // - matchOne(z/c, c) -> no - // - matchOne(c, c) yes, hit - var fr = fi - var pr = pi + 1 - if (pr === pl) { - this.debug('** at the end') - // a ** at the end will just swallow the rest. - // We have found a match. - // however, it will not swallow /.x, unless - // options.dot is set. - // . and .. are *never* matched by **, for explosively - // exponential reasons. - for (; fi < fl; fi++) { - if (file[fi] === '.' || file[fi] === '..' || - (!options.dot && file[fi].charAt(0) === '.')) return false - } - return true - } - - // ok, let's see if we can swallow whatever we can. - while (fr < fl) { - var swallowee = file[fr] - - this.debug('\nglobstar while', file, fr, pattern, pr, swallowee) - - // XXX remove this slice. Just pass the start index. - if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { - this.debug('globstar found match!', fr, fl, swallowee) - // found a match. - return true - } else { - // can't swallow "." or ".." ever. - // can only swallow ".foo" when explicitly asked. - if (swallowee === '.' || swallowee === '..' || - (!options.dot && swallowee.charAt(0) === '.')) { - this.debug('dot detected!', file, fr, pattern, pr) - break - } - - // ** swallows a segment, and continue. - this.debug('globstar swallow a segment, and continue') - fr++ - } - } - - // no match was found. - // However, in partial mode, we can't say this is necessarily over. - // If there's more *pattern* left, then - if (partial) { - // ran out of file - this.debug('\n>>> no match, partial?', file, fr, pattern, pr) - if (fr === fl) return true - } - return false - } - - // something other than ** - // non-magic patterns just have to match exactly - // patterns with magic have been turned into regexps. - var hit - if (typeof p === 'string') { - if (options.nocase) { - hit = f.toLowerCase() === p.toLowerCase() - } else { - hit = f === p - } - this.debug('string match', p, f, hit) - } else { - hit = f.match(p) - this.debug('pattern match', p, f, hit) - } - - if (!hit) return false - } - - // Note: ending in / means that we'll get a final "" - // at the end of the pattern. This can only match a - // corresponding "" at the end of the file. - // If the file ends in /, then it can only match a - // a pattern that ends in /, unless the pattern just - // doesn't have any more for it. But, a/b/ should *not* - // match "a/b/*", even though "" matches against the - // [^/]*? pattern, except in partial mode, where it might - // simply not be reached yet. - // However, a/b/ should still satisfy a/* - - // now either we fell off the end of the pattern, or we're done. - if (fi === fl && pi === pl) { - // ran out of pattern and filename at the same time. - // an exact hit! - return true - } else if (fi === fl) { - // ran out of file, but still had pattern left. - // this is ok if we're doing the match as part of - // a glob fs traversal. - return partial - } else if (pi === pl) { - // ran out of pattern, still have file left. - // this is only acceptable if we're on the very last - // empty segment of a file with a trailing slash. - // a/* should match a/b/ - var emptyFileEnd = (fi === fl - 1) && (file[fi] === '') - return emptyFileEnd - } - - // should be unreachable. - throw new Error('wtf?') -} - -// replace stuff like \* with * -function globUnescape (s) { - return s.replace(/\\(.)/g, '$1') -} - -function regExpEscape (s) { - return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') -} diff --git a/plugins/music_service/squeezelite/node_modules/minimatch/package.json b/plugins/music_service/squeezelite/node_modules/minimatch/package.json deleted file mode 100644 index 52f707229..000000000 --- a/plugins/music_service/squeezelite/node_modules/minimatch/package.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "_args": [ - [ - { - "raw": "minimatch@^3.0.3", - "scope": null, - "escapedName": "minimatch", - "name": "minimatch", - "rawSpec": "^3.0.3", - "spec": ">=3.0.3 <4.0.0", - "type": "range" - }, - "/home/volumio/volumio-plugins/plugins/music_service/squeezelite" - ] - ], - "_from": "minimatch@>=3.0.3 <4.0.0", - "_id": "minimatch@3.0.4", - "_inCache": true, - "_location": "/minimatch", - "_nodeVersion": "8.0.0-pre", - "_npmOperationalInternal": { - "host": "packages-18-east.internal.npmjs.com", - "tmp": "tmp/minimatch-3.0.4.tgz_1494180669024_0.22628829116001725" - }, - "_npmUser": { - "name": "isaacs", - "email": "i@izs.me" - }, - "_npmVersion": "5.0.0-beta.43", - "_phantomChildren": {}, - "_requested": { - "raw": "minimatch@^3.0.3", - "scope": null, - "escapedName": "minimatch", - "name": "minimatch", - "rawSpec": "^3.0.3", - "spec": ">=3.0.3 <4.0.0", - "type": "range" - }, - "_requiredBy": [ - "/", - "/glob" - ], - "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "_shasum": "5166e286457f03306064be5497e8dbb0c3d32083", - "_shrinkwrap": null, - "_spec": "minimatch@^3.0.3", - "_where": "/home/volumio/volumio-plugins/plugins/music_service/squeezelite", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me" - }, - "bugs": { - "url": "https://github.com/isaacs/minimatch/issues" - }, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "description": "a glob matcher in javascript", - "devDependencies": { - "tap": "^10.3.2" - }, - "directories": {}, - "dist": { - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "shasum": "5166e286457f03306064be5497e8dbb0c3d32083", - "tarball": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz" - }, - "engines": { - "node": "*" - }, - "files": [ - "minimatch.js" - ], - "gitHead": "e46989a323d5f0aa4781eff5e2e6e7aafa223321", - "homepage": "https://github.com/isaacs/minimatch#readme", - "license": "ISC", - "main": "minimatch.js", - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "name": "minimatch", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/minimatch.git" - }, - "scripts": { - "postpublish": "git push origin --all; git push origin --tags", - "postversion": "npm publish", - "preversion": "npm test", - "test": "tap test/*.js --cov" - }, - "version": "3.0.4" -} diff --git a/plugins/music_service/squeezelite/node_modules/multimap/.jshintrc b/plugins/music_service/squeezelite/node_modules/multimap/.jshintrc deleted file mode 100644 index 93da3d468..000000000 --- a/plugins/music_service/squeezelite/node_modules/multimap/.jshintrc +++ /dev/null @@ -1,41 +0,0 @@ -{ - "passfail" : false, - "maxerr" : 20, - "browser" : false, - "node" : true, - "debug" : false, - "devel" : true, - "es5" : false, - "strict" : false, - "globalstrict" : false, - "asi" : false, - "laxbreak" : false, - "bitwise" : false, - "boss" : true, - "curly" : false, - "eqeqeq" : false, - "eqnull" : false, - "evil" : true, - "expr" : true, - "forin" : false, - "immed" : true, - "latedef" : false, - "loopfunc" : true, - "noarg" : true, - "regexp" : true, - "regexdash" : false, - "scripturl" : true, - "shadow" : true, - "supernew" : false, - "undef" : false, - "newcap" : false, - "proto" : true, - "noempty" : true, - "nonew" : false, - "nomen" : false, - "onevar" : false, - "plusplus" : false, - "sub" : false, - "trailing" : false, - "white" : false -} \ No newline at end of file diff --git a/plugins/music_service/squeezelite/node_modules/multimap/.npmignore b/plugins/music_service/squeezelite/node_modules/multimap/.npmignore deleted file mode 100644 index 37e0121c3..000000000 --- a/plugins/music_service/squeezelite/node_modules/multimap/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -.DS_Store -node_modules -*.log diff --git a/plugins/music_service/squeezelite/node_modules/multimap/.travis.yml b/plugins/music_service/squeezelite/node_modules/multimap/.travis.yml deleted file mode 100644 index ee21a4a07..000000000 --- a/plugins/music_service/squeezelite/node_modules/multimap/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: node_js -node_js: - - "0.10" - - "0.11" - -script: npm run test \ No newline at end of file diff --git a/plugins/music_service/squeezelite/node_modules/multimap/README.md b/plugins/music_service/squeezelite/node_modules/multimap/README.md deleted file mode 100644 index ba8ef67ac..000000000 --- a/plugins/music_service/squeezelite/node_modules/multimap/README.md +++ /dev/null @@ -1,130 +0,0 @@ -# Multimap - Map which Allow Multiple Values for the same Key - -[![NPM version](https://badge.fury.io/js/multimap.svg)](http://badge.fury.io/js/multimap) -[![Build Status](https://travis-ci.org/villadora/multi-map.png?branch=master)](https://travis-ci.org/villadora/multi-map) - -## Install - -```bash -npm install multimap --save -``` - -## Usage - - -If you'd like to use native version when it exists and fallback to polyfill if it doesn't, but without implementing `Map` on global scope, do: - -```javascript -var Multimap = require('multimap'); -var m = new Multimap(); -``` - -If the global es6 `Map` exists or `Multimap.Map` is set, `Multimap` will use the `Map` as inner store, that means Object can be used as key. - -```javascript -var Multimap = require('multimap'); - -// if harmony is on -/* nothing need to do */ -// or if you are using es6-shim -Multimap.Map = ShimMap; - -var m = new Multimap(); -var key = {}; -m.set(key, 'one'); - -``` - -Otherwise, an object will be used, all the keys will be transformed into string. - - -### In Modern Browser - -Just download the `index.js` as `Multimap.js`. - -``` - - -``` - -Or use as an AMD loader: - -``` -require(['./Multimap.js'], function (Multimap) { - var map = new Multimap([['a', 1], ['b', 2], ['c', 3]]); - map = map.set('b', 20); - map.get('b'); // [2, 20] -}); -``` - -* Browsers should support `Object.defineProperty` and `Array.prototype.forEach`. - - -## API - -Following shows how to use `Multimap`: - -```javascript -var Multimap = require('multimap'); - -var map = new Multimap([['a', 'one'], ['b', 1], ['a', 'two'], ['b', 2]]); - -map.size; // 4 - -map.get('a'); // ['one', 'two'] -map.get('b'); // [1, 2] - -map.has('a'); // true -map.has('foo'); // false - -map.has('a', 'one'); // true -map.has('b', 3); // false - -map.set('a', 'three'); -map.size; // 5 -map.get('a'); // ['one', 'two', 'three'] - -map.set('b', 3, 4); -map.size; // 7 - -map.delete('a', 'three'); // true -map.delete('x'); // false -map.delete('a', 'four'); // false -map.delete('b'); // true - -map.size; // 2 - -map.set('b', 1, 2); -map.size; // 4 - - -map.forEach(function (value, key) { - // iterates { 'one', 'a' }, { 'two', 'a' }, { 1, b }, { 2, 'b' } -}); - -map.forEachEntry(function (entry, key) { - // iterates {['one', 'two'], 'a' }, {[1, 2], 'b' } -}); - - -var keys = map.keys(); // iterator with ['a', 'b'] -keys.next().value; // 'a' -var values = map.values(); // iterator ['one', 'two', 1, 2] - -map.clear(); // undefined -map.size; // 0 -``` - - - - -## License - -(The MIT License) - -Copyright (c) 2013, Villa.Gao ; -All rights reserved. diff --git a/plugins/music_service/squeezelite/node_modules/multimap/index.js b/plugins/music_service/squeezelite/node_modules/multimap/index.js deleted file mode 100644 index c42151950..000000000 --- a/plugins/music_service/squeezelite/node_modules/multimap/index.js +++ /dev/null @@ -1,216 +0,0 @@ -"use strict"; - -/* global module, define */ - -function mapEach(map, operation){ - var keys = map.keys(); - var next; - while(!(next = keys.next()).done) { - operation(map.get(next.value), next.value, map); - } -} - -var Multimap = (function() { - var mapCtor; - if (typeof Map !== 'undefined') { - mapCtor = Map; - - if (!Map.prototype.keys) { - Map.prototype.keys = function() { - var keys = []; - this.forEach(function(item, key) { - keys.push(key); - }); - return keys; - }; - } - } - - function Multimap(iterable) { - var self = this; - - self._map = mapCtor; - - if (Multimap.Map) { - self._map = Multimap.Map; - } - - self._ = self._map ? new self._map() : {}; - - if (iterable) { - iterable.forEach(function(i) { - self.set(i[0], i[1]); - }); - } - } - - /** - * @param {Object} key - * @return {Array} An array of values, undefined if no such a key; - */ - Multimap.prototype.get = function(key) { - return this._map ? this._.get(key) : this._[key]; - }; - - /** - * @param {Object} key - * @param {Object} val... - */ - Multimap.prototype.set = function(key, val) { - var args = Array.prototype.slice.call(arguments); - - key = args.shift(); - - var entry = this.get(key); - if (!entry) { - entry = []; - if (this._map) - this._.set(key, entry); - else - this._[key] = entry; - } - - Array.prototype.push.apply(entry, args); - return this; - }; - - /** - * @param {Object} key - * @param {Object=} val - * @return {boolean} true if any thing changed - */ - Multimap.prototype.delete = function(key, val) { - if (!this.has(key)) - return false; - - if (arguments.length == 1) { - this._map ? (this._.delete(key)) : (delete this._[key]); - return true; - } else { - var entry = this.get(key); - var idx = entry.indexOf(val); - if (idx != -1) { - entry.splice(idx, 1); - return true; - } - } - - return false; - }; - - /** - * @param {Object} key - * @param {Object=} val - * @return {boolean} whether the map contains 'key' or 'key=>val' pair - */ - Multimap.prototype.has = function(key, val) { - var hasKey = this._map ? this._.has(key) : this._.hasOwnProperty(key); - - if (arguments.length == 1 || !hasKey) - return hasKey; - - var entry = this.get(key) || []; - return entry.indexOf(val) != -1; - }; - - - /** - * @return {Array} all the keys in the map - */ - Multimap.prototype.keys = function() { - if (this._map) - return makeIterator(this._.keys()); - - return makeIterator(Object.keys(this._)); - }; - - /** - * @return {Array} all the values in the map - */ - Multimap.prototype.values = function() { - var vals = []; - this.forEachEntry(function(entry) { - Array.prototype.push.apply(vals, entry); - }); - - return makeIterator(vals); - }; - - /** - * - */ - Multimap.prototype.forEachEntry = function(iter) { - mapEach(this, iter); - }; - - Multimap.prototype.forEach = function(iter) { - var self = this; - self.forEachEntry(function(entry, key) { - entry.forEach(function(item) { - iter(item, key, self); - }); - }); - }; - - - Multimap.prototype.clear = function() { - if (this._map) { - this._.clear(); - } else { - this._ = {}; - } - }; - - Object.defineProperty( - Multimap.prototype, - "size", { - configurable: false, - enumerable: true, - get: function() { - var total = 0; - - mapEach(this, function(value){ - total += value.length; - }); - - return total; - } - }); - - var safariNext; - - try{ - safariNext = new Function('iterator', 'makeIterator', 'var keysArray = []; for(var key of iterator){keysArray.push(key);} return makeIterator(keysArray).next;'); - }catch(error){ - // for of not implemented; - } - - function makeIterator(iterator){ - if(Array.isArray(iterator)){ - var nextIndex = 0; - - return { - next: function(){ - return nextIndex < iterator.length ? - {value: iterator[nextIndex++], done: false} : - {done: true}; - } - }; - } - - // Only an issue in safari - if(!iterator.next && safariNext){ - iterator.next = safariNext(iterator, makeIterator); - } - - return iterator; - } - - return Multimap; -})(); - - -if(typeof exports === 'object' && module && module.exports) - module.exports = Multimap; -else if(typeof define === 'function' && define.amd) - define(function() { return Multimap; }); diff --git a/plugins/music_service/squeezelite/node_modules/multimap/package.json b/plugins/music_service/squeezelite/node_modules/multimap/package.json deleted file mode 100644 index 19dddb6f7..000000000 --- a/plugins/music_service/squeezelite/node_modules/multimap/package.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "_args": [ - [ - { - "raw": "multimap@^1.0.1", - "scope": null, - "escapedName": "multimap", - "name": "multimap", - "rawSpec": "^1.0.1", - "spec": ">=1.0.1 <2.0.0", - "type": "range" - }, - "/home/volumio/volumio-plugins/plugins/music_service/squeezelite" - ] - ], - "_from": "multimap@>=1.0.1 <2.0.0", - "_id": "multimap@1.0.2", - "_inCache": true, - "_location": "/multimap", - "_nodeVersion": "5.3.0", - "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/multimap-1.0.2.tgz_1457653851539_0.21096828300505877" - }, - "_npmUser": { - "name": "korynunn", - "email": "knunn187@gmail.com" - }, - "_npmVersion": "3.5.3", - "_phantomChildren": {}, - "_requested": { - "raw": "multimap@^1.0.1", - "scope": null, - "escapedName": "multimap", - "name": "multimap", - "rawSpec": "^1.0.1", - "spec": ">=1.0.1 <2.0.0", - "type": "range" - }, - "_requiredBy": [ - "/" - ], - "_resolved": "https://registry.npmjs.org/multimap/-/multimap-1.0.2.tgz", - "_shasum": "6aa76fc3233905ba948bbe4c74dc2c3a0356eb36", - "_shrinkwrap": null, - "_spec": "multimap@^1.0.1", - "_where": "/home/volumio/volumio-plugins/plugins/music_service/squeezelite", - "author": { - "name": "villa.gao", - "email": "jky239@gmail.com" - }, - "bugs": { - "url": "https://github.com/villadora/multi-map/issues" - }, - "dependencies": {}, - "description": "multi-map which allow multiple values for the same key", - "devDependencies": { - "chai": "~1.7.2", - "es6-shim": "^0.13.0", - "jshint": "~2.1.9" - }, - "directories": {}, - "dist": { - "shasum": "6aa76fc3233905ba948bbe4c74dc2c3a0356eb36", - "tarball": "https://registry.npmjs.org/multimap/-/multimap-1.0.2.tgz" - }, - "gitHead": "9fe12001b197fc4ed25e1b836e76eb4c88f1368f", - "homepage": "https://github.com/villadora/multi-map#readme", - "keywords": [ - "keys", - "map", - "multiple" - ], - "license": "MIT", - "main": "index.js", - "maintainers": [ - { - "name": "korynunn", - "email": "knunn187@gmail.com" - }, - { - "name": "villadora", - "email": "jky239@gmail.com" - } - ], - "name": "multimap", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git://github.com/villadora/multi-map.git" - }, - "scripts": { - "lint": "jshint *.js test/*.js", - "test": "npm run lint; node test/index.js;node test/es6map.js" - }, - "version": "1.0.2" -} diff --git a/plugins/music_service/squeezelite/node_modules/multimap/test/es6map.js b/plugins/music_service/squeezelite/node_modules/multimap/test/es6map.js deleted file mode 100644 index c7c0c2311..000000000 --- a/plugins/music_service/squeezelite/node_modules/multimap/test/es6map.js +++ /dev/null @@ -1,86 +0,0 @@ -"use strict"; - -var assert = require('chai').assert; -require('es6-shim'); - -var Multimap = require('..'); - -var map = new Multimap([ - ['a', 'one'], - ['b', 1], - ['a', 'two'], - ['b', 2] -]); - -assert.equal(map.size, 4); - -assert.equal(map.get('a').length, 2); -assert.equal(map.get('a')[0], 'one'); // ['one', 'two'] -assert.equal(map.get('a')[1], 'two'); // ['one', 'two'] - -assert.equal(map.get('b').length, 2); -assert.equal(map.get('b')[0], 1); // [1, 2] -assert.equal(map.get('b')[1], 2); // [1, 2] - - -assert(map.has('a'), "map contains key 'a'"); -assert(!map.has('foo'), "map does not contain key 'foo'"); - -assert(map.has('a', 'one'), "map contains entry 'a'=>'one'"); -assert(!map.has('b', 3), "map does not contain entry 'b'=>3"); - -map.set('a', 'three'); - -assert.equal(map.size, 5); -assert.equal(map.get('a').length, 3); // ['one', 'two', 'three'] - -map.set('b', 3, 4); -assert.equal(map.size, 7); - -assert(map.delete('a', 'three'), "delete 'a'=>'three'"); -assert.equal(map.size, 6); -assert(!map.delete('x'), "empty 'x' for delete"); -assert(!map.delete('a', 'four'), "no such entry 'a'=>'four'"); -assert(map.delete('b'), "delete all 'b'"); - -assert.equal(map.size, 2); - -map.set('b', 1, 2); -assert.equal(map.size, 4); // 4 - -var cnt = 0; -map.forEach(function(value, key) { - // iterates { 'a', 'one' }, { 'a', 'two' }, { 'b', 1 }, { 'b', 2 } - cnt++; - assert(key == 'a' || key == 'b', "key must be either 'a' or 'b'"); -}); - -assert.equal(cnt, 4); - -cnt = 0; -map.forEachEntry(function(entry, key) { - // iterates { 'a', ['one', 'two'] }, { 'b', [1, 2] } - cnt++; - assert(key == 'a' || key == 'b', "key must be either 'a' or 'b'"); - assert.equal(entry.length, 2); -}); - -assert.equal(cnt, 2); - - - -var keys = map.keys(); // ['a', 'b'] -assert.equal(keys.next().value, 'a'); -assert.equal(keys.next().value, 'b'); -assert(keys.next().done); - -var values = map.values(); // ['one', 'two', 1, 2] -assert.equal(values.next().value, 'one'); -assert.equal(values.next().value, 'two'); -assert.equal(values.next().value, 1); -assert.equal(values.next().value, 2); -assert(values.next().done); - -map.clear(); - -assert.equal(map.size, 0); diff --git a/plugins/music_service/squeezelite/node_modules/multimap/test/index.js b/plugins/music_service/squeezelite/node_modules/multimap/test/index.js deleted file mode 100644 index 6bfa10565..000000000 --- a/plugins/music_service/squeezelite/node_modules/multimap/test/index.js +++ /dev/null @@ -1,84 +0,0 @@ -"use strict"; - -var assert = require('chai').assert; -var Multimap = require('..'); - -var map = new Multimap([ - ['a', 'one'], - ['b', 1], - ['a', 'two'], - ['b', 2] -]); - -assert.equal(map.size, 4); - -assert.equal(map.get('a').length, 2); -assert.equal(map.get('a')[0], 'one'); // ['one', 'two'] -assert.equal(map.get('a')[1], 'two'); // ['one', 'two'] - -assert.equal(map.get('b').length, 2); -assert.equal(map.get('b')[0], 1); // [1, 2] -assert.equal(map.get('b')[1], 2); // [1, 2] - - -assert(map.has('a'), "map contains key 'a'"); -assert(!map.has('foo'), "map does not contain key 'foo'"); - -assert(map.has('a', 'one'), "map contains entry 'a'=>'one'"); -assert(!map.has('b', 3), "map does not contain entry 'b'=>3"); - -map.set('a', 'three'); - -assert.equal(map.size, 5); -assert.equal(map.get('a').length, 3); // ['one', 'two', 'three'] - -map.set('b', 3, 4); -assert.equal(map.size, 7); - -assert(map.delete('a', 'three'), "delete 'a'=>'three'"); -assert.equal(map.size, 6); -assert(!map.delete('x'), "empty 'x' for delete"); -assert(!map.delete('a', 'four'), "no such entry 'a'=>'four'"); -assert(map.delete('b'), "delete all 'b'"); - -assert.equal(map.size, 2); - -map.set('b', 1, 2); -assert.equal(map.size, 4); // 4 - -var cnt = 0; -map.forEach(function(value, key) { - // iterates { 'a', 'one' }, { 'a', 'two' }, { 'b', 1 }, { 'b', 2 } - cnt++; - assert(key == 'a' || key == 'b', "key must be either 'a' or 'b'"); -}); - -assert.equal(cnt, 4); - -cnt = 0; -map.forEachEntry(function(entry, key) { - // iterates { 'a', ['one', 'two'] }, { 'b', [1, 2] } - cnt++; - assert(key == 'a' || key == 'b', "key must be either 'a' or 'b'"); - assert.equal(entry.length, 2); -}); - -assert.equal(cnt, 2); - - -var keys = map.keys(); // ['a', 'b'] -assert.equal(keys.next().value, 'a'); -assert.equal(keys.next().value, 'b'); -assert(keys.next().done); - -var values = map.values(); // ['one', 'two', 1, 2] -assert.equal(values.next().value, 'one'); -assert.equal(values.next().value, 'two'); -assert.equal(values.next().value, 1); -assert.equal(values.next().value, 2); -assert(values.next().done); - - -map.clear(); - -assert.equal(map.size, 0); diff --git a/plugins/music_service/squeezelite/node_modules/multimap/test/test.html b/plugins/music_service/squeezelite/node_modules/multimap/test/test.html deleted file mode 100644 index 899d9de89..000000000 --- a/plugins/music_service/squeezelite/node_modules/multimap/test/test.html +++ /dev/null @@ -1,92 +0,0 @@ - - - MultiMap Tests - - - - - - - diff --git a/plugins/music_service/squeezelite/node_modules/once/LICENSE b/plugins/music_service/squeezelite/node_modules/once/LICENSE deleted file mode 100644 index 19129e315..000000000 --- a/plugins/music_service/squeezelite/node_modules/once/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/plugins/music_service/squeezelite/node_modules/once/README.md b/plugins/music_service/squeezelite/node_modules/once/README.md deleted file mode 100644 index 1f1ffca93..000000000 --- a/plugins/music_service/squeezelite/node_modules/once/README.md +++ /dev/null @@ -1,79 +0,0 @@ -# once - -Only call a function once. - -## usage - -```javascript -var once = require('once') - -function load (file, cb) { - cb = once(cb) - loader.load('file') - loader.once('load', cb) - loader.once('error', cb) -} -``` - -Or add to the Function.prototype in a responsible way: - -```javascript -// only has to be done once -require('once').proto() - -function load (file, cb) { - cb = cb.once() - loader.load('file') - loader.once('load', cb) - loader.once('error', cb) -} -``` - -Ironically, the prototype feature makes this module twice as -complicated as necessary. - -To check whether you function has been called, use `fn.called`. Once the -function is called for the first time the return value of the original -function is saved in `fn.value` and subsequent calls will continue to -return this value. - -```javascript -var once = require('once') - -function load (cb) { - cb = once(cb) - var stream = createStream() - stream.once('data', cb) - stream.once('end', function () { - if (!cb.called) cb(new Error('not found')) - }) -} -``` - -## `once.strict(func)` - -Throw an error if the function is called twice. - -Some functions are expected to be called only once. Using `once` for them would -potentially hide logical errors. - -In the example below, the `greet` function has to call the callback only once: - -```javascript -function greet (name, cb) { - // return is missing from the if statement - // when no name is passed, the callback is called twice - if (!name) cb('Hello anonymous') - cb('Hello ' + name) -} - -function log (msg) { - console.log(msg) -} - -// this will print 'Hello anonymous' but the logical error will be missed -greet(null, once(msg)) - -// once.strict will print 'Hello anonymous' and throw an error when the callback will be called the second time -greet(null, once.strict(msg)) -``` diff --git a/plugins/music_service/squeezelite/node_modules/once/once.js b/plugins/music_service/squeezelite/node_modules/once/once.js deleted file mode 100644 index 235406736..000000000 --- a/plugins/music_service/squeezelite/node_modules/once/once.js +++ /dev/null @@ -1,42 +0,0 @@ -var wrappy = require('wrappy') -module.exports = wrappy(once) -module.exports.strict = wrappy(onceStrict) - -once.proto = once(function () { - Object.defineProperty(Function.prototype, 'once', { - value: function () { - return once(this) - }, - configurable: true - }) - - Object.defineProperty(Function.prototype, 'onceStrict', { - value: function () { - return onceStrict(this) - }, - configurable: true - }) -}) - -function once (fn) { - var f = function () { - if (f.called) return f.value - f.called = true - return f.value = fn.apply(this, arguments) - } - f.called = false - return f -} - -function onceStrict (fn) { - var f = function () { - if (f.called) - throw new Error(f.onceError) - f.called = true - return f.value = fn.apply(this, arguments) - } - var name = fn.name || 'Function wrapped with `once`' - f.onceError = name + " shouldn't be called more than once" - f.called = false - return f -} diff --git a/plugins/music_service/squeezelite/node_modules/once/package.json b/plugins/music_service/squeezelite/node_modules/once/package.json deleted file mode 100644 index d61b729a1..000000000 --- a/plugins/music_service/squeezelite/node_modules/once/package.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "_args": [ - [ - { - "raw": "once@^1.4.0", - "scope": null, - "escapedName": "once", - "name": "once", - "rawSpec": "^1.4.0", - "spec": ">=1.4.0 <2.0.0", - "type": "range" - }, - "/home/volumio/volumio-plugins/plugins/music_service/squeezelite" - ] - ], - "_from": "once@>=1.4.0 <2.0.0", - "_id": "once@1.4.0", - "_inCache": true, - "_location": "/once", - "_nodeVersion": "6.5.0", - "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/once-1.4.0.tgz_1473196269128_0.537820661207661" - }, - "_npmUser": { - "name": "isaacs", - "email": "i@izs.me" - }, - "_npmVersion": "3.10.7", - "_phantomChildren": {}, - "_requested": { - "raw": "once@^1.4.0", - "scope": null, - "escapedName": "once", - "name": "once", - "rawSpec": "^1.4.0", - "spec": ">=1.4.0 <2.0.0", - "type": "range" - }, - "_requiredBy": [ - "/", - "/glob", - "/inflight" - ], - "_resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "_shasum": "583b1aa775961d4b113ac17d9c50baef9dd76bd1", - "_shrinkwrap": null, - "_spec": "once@^1.4.0", - "_where": "/home/volumio/volumio-plugins/plugins/music_service/squeezelite", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/isaacs/once/issues" - }, - "dependencies": { - "wrappy": "1" - }, - "description": "Run a function exactly one time", - "devDependencies": { - "tap": "^7.0.1" - }, - "directories": { - "test": "test" - }, - "dist": { - "shasum": "583b1aa775961d4b113ac17d9c50baef9dd76bd1", - "tarball": "https://registry.npmjs.org/once/-/once-1.4.0.tgz" - }, - "files": [ - "once.js" - ], - "gitHead": "0e614d9f5a7e6f0305c625f6b581f6d80b33b8a6", - "homepage": "https://github.com/isaacs/once#readme", - "keywords": [ - "once", - "function", - "one", - "single" - ], - "license": "ISC", - "main": "once.js", - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "name": "once", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/once.git" - }, - "scripts": { - "test": "tap test/*.js" - }, - "version": "1.4.0" -} diff --git a/plugins/music_service/squeezelite/node_modules/path-is-absolute/index.js b/plugins/music_service/squeezelite/node_modules/path-is-absolute/index.js deleted file mode 100644 index 22aa6c356..000000000 --- a/plugins/music_service/squeezelite/node_modules/path-is-absolute/index.js +++ /dev/null @@ -1,20 +0,0 @@ -'use strict'; - -function posix(path) { - return path.charAt(0) === '/'; -} - -function win32(path) { - // https://github.com/nodejs/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56 - var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; - var result = splitDeviceRe.exec(path); - var device = result[1] || ''; - var isUnc = Boolean(device && device.charAt(1) !== ':'); - - // UNC paths are always absolute - return Boolean(result[2] || isUnc); -} - -module.exports = process.platform === 'win32' ? win32 : posix; -module.exports.posix = posix; -module.exports.win32 = win32; diff --git a/plugins/music_service/squeezelite/node_modules/path-is-absolute/license b/plugins/music_service/squeezelite/node_modules/path-is-absolute/license deleted file mode 100644 index 654d0bfe9..000000000 --- a/plugins/music_service/squeezelite/node_modules/path-is-absolute/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/plugins/music_service/squeezelite/node_modules/path-is-absolute/package.json b/plugins/music_service/squeezelite/node_modules/path-is-absolute/package.json deleted file mode 100644 index cdc120506..000000000 --- a/plugins/music_service/squeezelite/node_modules/path-is-absolute/package.json +++ /dev/null @@ -1,114 +0,0 @@ -{ - "_args": [ - [ - { - "raw": "path-is-absolute@^1.0.1", - "scope": null, - "escapedName": "path-is-absolute", - "name": "path-is-absolute", - "rawSpec": "^1.0.1", - "spec": ">=1.0.1 <2.0.0", - "type": "range" - }, - "/home/volumio/volumio-plugins/plugins/music_service/squeezelite" - ] - ], - "_from": "path-is-absolute@>=1.0.1 <2.0.0", - "_id": "path-is-absolute@1.0.1", - "_inCache": true, - "_location": "/path-is-absolute", - "_nodeVersion": "6.6.0", - "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/path-is-absolute-1.0.1.tgz_1475210523565_0.9876507974695414" - }, - "_npmUser": { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - "_npmVersion": "3.10.3", - "_phantomChildren": {}, - "_requested": { - "raw": "path-is-absolute@^1.0.1", - "scope": null, - "escapedName": "path-is-absolute", - "name": "path-is-absolute", - "rawSpec": "^1.0.1", - "spec": ">=1.0.1 <2.0.0", - "type": "range" - }, - "_requiredBy": [ - "/", - "/fs-extra", - "/glob", - "/v-conf/fs-extra" - ], - "_resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "_shasum": "174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f", - "_shrinkwrap": null, - "_spec": "path-is-absolute@^1.0.1", - "_where": "/home/volumio/volumio-plugins/plugins/music_service/squeezelite", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/path-is-absolute/issues" - }, - "dependencies": {}, - "description": "Node.js 0.12 path.isAbsolute() ponyfill", - "devDependencies": { - "xo": "^0.16.0" - }, - "directories": {}, - "dist": { - "shasum": "174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f", - "tarball": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "gitHead": "edc91d348b21dac2ab65ea2fbec2868e2eff5eb6", - "homepage": "https://github.com/sindresorhus/path-is-absolute#readme", - "keywords": [ - "path", - "paths", - "file", - "dir", - "absolute", - "isabsolute", - "is-absolute", - "built-in", - "util", - "utils", - "core", - "ponyfill", - "polyfill", - "shim", - "is", - "detect", - "check" - ], - "license": "MIT", - "maintainers": [ - { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - } - ], - "name": "path-is-absolute", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/path-is-absolute.git" - }, - "scripts": { - "test": "xo && node test.js" - }, - "version": "1.0.1" -} diff --git a/plugins/music_service/squeezelite/node_modules/path-is-absolute/readme.md b/plugins/music_service/squeezelite/node_modules/path-is-absolute/readme.md deleted file mode 100644 index 8dbdf5fcb..000000000 --- a/plugins/music_service/squeezelite/node_modules/path-is-absolute/readme.md +++ /dev/null @@ -1,59 +0,0 @@ -# path-is-absolute [![Build Status](https://travis-ci.org/sindresorhus/path-is-absolute.svg?branch=master)](https://travis-ci.org/sindresorhus/path-is-absolute) - -> Node.js 0.12 [`path.isAbsolute()`](http://nodejs.org/api/path.html#path_path_isabsolute_path) [ponyfill](https://ponyfill.com) - - -## Install - -``` -$ npm install --save path-is-absolute -``` - - -## Usage - -```js -const pathIsAbsolute = require('path-is-absolute'); - -// Running on Linux -pathIsAbsolute('/home/foo'); -//=> true -pathIsAbsolute('C:/Users/foo'); -//=> false - -// Running on Windows -pathIsAbsolute('C:/Users/foo'); -//=> true -pathIsAbsolute('/home/foo'); -//=> false - -// Running on any OS -pathIsAbsolute.posix('/home/foo'); -//=> true -pathIsAbsolute.posix('C:/Users/foo'); -//=> false -pathIsAbsolute.win32('C:/Users/foo'); -//=> true -pathIsAbsolute.win32('/home/foo'); -//=> false -``` - - -## API - -See the [`path.isAbsolute()` docs](http://nodejs.org/api/path.html#path_path_isabsolute_path). - -### pathIsAbsolute(path) - -### pathIsAbsolute.posix(path) - -POSIX specific version. - -### pathIsAbsolute.win32(path) - -Windows specific version. - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/plugins/music_service/squeezelite/node_modules/rimraf/LICENSE b/plugins/music_service/squeezelite/node_modules/rimraf/LICENSE deleted file mode 100644 index 19129e315..000000000 --- a/plugins/music_service/squeezelite/node_modules/rimraf/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/plugins/music_service/squeezelite/node_modules/rimraf/README.md b/plugins/music_service/squeezelite/node_modules/rimraf/README.md deleted file mode 100644 index 423b8cf85..000000000 --- a/plugins/music_service/squeezelite/node_modules/rimraf/README.md +++ /dev/null @@ -1,101 +0,0 @@ -[![Build Status](https://travis-ci.org/isaacs/rimraf.svg?branch=master)](https://travis-ci.org/isaacs/rimraf) [![Dependency Status](https://david-dm.org/isaacs/rimraf.svg)](https://david-dm.org/isaacs/rimraf) [![devDependency Status](https://david-dm.org/isaacs/rimraf/dev-status.svg)](https://david-dm.org/isaacs/rimraf#info=devDependencies) - -The [UNIX command](http://en.wikipedia.org/wiki/Rm_(Unix)) `rm -rf` for node. - -Install with `npm install rimraf`, or just drop rimraf.js somewhere. - -## API - -`rimraf(f, [opts], callback)` - -The first parameter will be interpreted as a globbing pattern for files. If you -want to disable globbing you can do so with `opts.disableGlob` (defaults to -`false`). This might be handy, for instance, if you have filenames that contain -globbing wildcard characters. - -The callback will be called with an error if there is one. Certain -errors are handled for you: - -* Windows: `EBUSY` and `ENOTEMPTY` - rimraf will back off a maximum of - `opts.maxBusyTries` times before giving up, adding 100ms of wait - between each attempt. The default `maxBusyTries` is 3. -* `ENOENT` - If the file doesn't exist, rimraf will return - successfully, since your desired outcome is already the case. -* `EMFILE` - Since `readdir` requires opening a file descriptor, it's - possible to hit `EMFILE` if too many file descriptors are in use. - In the sync case, there's nothing to be done for this. But in the - async case, rimraf will gradually back off with timeouts up to - `opts.emfileWait` ms, which defaults to 1000. - -## options - -* unlink, chmod, stat, lstat, rmdir, readdir, - unlinkSync, chmodSync, statSync, lstatSync, rmdirSync, readdirSync - - In order to use a custom file system library, you can override - specific fs functions on the options object. - - If any of these functions are present on the options object, then - the supplied function will be used instead of the default fs - method. - - Sync methods are only relevant for `rimraf.sync()`, of course. - - For example: - - ```javascript - var myCustomFS = require('some-custom-fs') - - rimraf('some-thing', myCustomFS, callback) - ``` - -* maxBusyTries - - If an `EBUSY`, `ENOTEMPTY`, or `EPERM` error code is encountered - on Windows systems, then rimraf will retry with a linear backoff - wait of 100ms longer on each try. The default maxBusyTries is 3. - - Only relevant for async usage. - -* emfileWait - - If an `EMFILE` error is encountered, then rimraf will retry - repeatedly with a linear backoff of 1ms longer on each try, until - the timeout counter hits this max. The default limit is 1000. - - If you repeatedly encounter `EMFILE` errors, then consider using - [graceful-fs](http://npm.im/graceful-fs) in your program. - - Only relevant for async usage. - -* glob - - Set to `false` to disable [glob](http://npm.im/glob) pattern - matching. - - Set to an object to pass options to the glob module. The default - glob options are `{ nosort: true, silent: true }`. - - Glob version 6 is used in this module. - - Relevant for both sync and async usage. - -* disableGlob - - Set to any non-falsey value to disable globbing entirely. - (Equivalent to setting `glob: false`.) - -## rimraf.sync - -It can remove stuff synchronously, too. But that's not so good. Use -the async API. It's better. - -## CLI - -If installed with `npm install rimraf -g` it can be used as a global -command `rimraf [ ...]` which is useful for cross platform support. - -## mkdirp - -If you need to create a directory recursively, check out -[mkdirp](https://github.com/substack/node-mkdirp). diff --git a/plugins/music_service/squeezelite/node_modules/rimraf/bin.js b/plugins/music_service/squeezelite/node_modules/rimraf/bin.js deleted file mode 100755 index 0d1e17be7..000000000 --- a/plugins/music_service/squeezelite/node_modules/rimraf/bin.js +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/env node - -var rimraf = require('./') - -var help = false -var dashdash = false -var noglob = false -var args = process.argv.slice(2).filter(function(arg) { - if (dashdash) - return !!arg - else if (arg === '--') - dashdash = true - else if (arg === '--no-glob' || arg === '-G') - noglob = true - else if (arg === '--glob' || arg === '-g') - noglob = false - else if (arg.match(/^(-+|\/)(h(elp)?|\?)$/)) - help = true - else - return !!arg -}) - -if (help || args.length === 0) { - // If they didn't ask for help, then this is not a "success" - var log = help ? console.log : console.error - log('Usage: rimraf [ ...]') - log('') - log(' Deletes all files and folders at "path" recursively.') - log('') - log('Options:') - log('') - log(' -h, --help Display this usage info') - log(' -G, --no-glob Do not expand glob patterns in arguments') - log(' -g, --glob Expand glob patterns in arguments (default)') - process.exit(help ? 0 : 1) -} else - go(0) - -function go (n) { - if (n >= args.length) - return - var options = {} - if (noglob) - options = { glob: false } - rimraf(args[n], options, function (er) { - if (er) - throw er - go(n+1) - }) -} diff --git a/plugins/music_service/squeezelite/node_modules/rimraf/package.json b/plugins/music_service/squeezelite/node_modules/rimraf/package.json deleted file mode 100644 index 961747d75..000000000 --- a/plugins/music_service/squeezelite/node_modules/rimraf/package.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "_args": [ - [ - { - "raw": "rimraf@^2.5.4", - "scope": null, - "escapedName": "rimraf", - "name": "rimraf", - "rawSpec": "^2.5.4", - "spec": ">=2.5.4 <3.0.0", - "type": "range" - }, - "/home/volumio/volumio-plugins/plugins/music_service/squeezelite" - ] - ], - "_from": "rimraf@>=2.5.4 <3.0.0", - "_id": "rimraf@2.6.2", - "_inCache": true, - "_location": "/rimraf", - "_nodeVersion": "8.4.0", - "_npmOperationalInternal": { - "host": "s3://npm-registry-packages", - "tmp": "tmp/rimraf-2.6.2.tgz_1505148366963_0.392012212658301" - }, - "_npmUser": { - "name": "isaacs", - "email": "i@izs.me" - }, - "_npmVersion": "5.4.1", - "_phantomChildren": {}, - "_requested": { - "raw": "rimraf@^2.5.4", - "scope": null, - "escapedName": "rimraf", - "name": "rimraf", - "rawSpec": "^2.5.4", - "spec": ">=2.5.4 <3.0.0", - "type": "range" - }, - "_requiredBy": [ - "/", - "/fs-extra", - "/v-conf/fs-extra" - ], - "_resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", - "_shasum": "2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36", - "_shrinkwrap": null, - "_spec": "rimraf@^2.5.4", - "_where": "/home/volumio/volumio-plugins/plugins/music_service/squeezelite", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bin": { - "rimraf": "./bin.js" - }, - "bugs": { - "url": "https://github.com/isaacs/rimraf/issues" - }, - "dependencies": { - "glob": "^7.0.5" - }, - "description": "A deep deletion module for node (like `rm -rf`)", - "devDependencies": { - "mkdirp": "^0.5.1", - "tap": "^10.1.2" - }, - "directories": {}, - "dist": { - "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", - "shasum": "2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36", - "tarball": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz" - }, - "files": [ - "LICENSE", - "README.md", - "bin.js", - "rimraf.js" - ], - "gitHead": "79b933fb362b2c51bedfa448be848e1d7ed32d7e", - "homepage": "https://github.com/isaacs/rimraf#readme", - "license": "ISC", - "main": "rimraf.js", - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "name": "rimraf", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/rimraf.git" - }, - "scripts": { - "test": "tap test/*.js" - }, - "version": "2.6.2" -} diff --git a/plugins/music_service/squeezelite/node_modules/rimraf/rimraf.js b/plugins/music_service/squeezelite/node_modules/rimraf/rimraf.js deleted file mode 100644 index e80dd1069..000000000 --- a/plugins/music_service/squeezelite/node_modules/rimraf/rimraf.js +++ /dev/null @@ -1,364 +0,0 @@ -module.exports = rimraf -rimraf.sync = rimrafSync - -var assert = require("assert") -var path = require("path") -var fs = require("fs") -var glob = require("glob") -var _0666 = parseInt('666', 8) - -var defaultGlobOpts = { - nosort: true, - silent: true -} - -// for EMFILE handling -var timeout = 0 - -var isWindows = (process.platform === "win32") - -function defaults (options) { - var methods = [ - 'unlink', - 'chmod', - 'stat', - 'lstat', - 'rmdir', - 'readdir' - ] - methods.forEach(function(m) { - options[m] = options[m] || fs[m] - m = m + 'Sync' - options[m] = options[m] || fs[m] - }) - - options.maxBusyTries = options.maxBusyTries || 3 - options.emfileWait = options.emfileWait || 1000 - if (options.glob === false) { - options.disableGlob = true - } - options.disableGlob = options.disableGlob || false - options.glob = options.glob || defaultGlobOpts -} - -function rimraf (p, options, cb) { - if (typeof options === 'function') { - cb = options - options = {} - } - - assert(p, 'rimraf: missing path') - assert.equal(typeof p, 'string', 'rimraf: path should be a string') - assert.equal(typeof cb, 'function', 'rimraf: callback function required') - assert(options, 'rimraf: invalid options argument provided') - assert.equal(typeof options, 'object', 'rimraf: options should be object') - - defaults(options) - - var busyTries = 0 - var errState = null - var n = 0 - - if (options.disableGlob || !glob.hasMagic(p)) - return afterGlob(null, [p]) - - options.lstat(p, function (er, stat) { - if (!er) - return afterGlob(null, [p]) - - glob(p, options.glob, afterGlob) - }) - - function next (er) { - errState = errState || er - if (--n === 0) - cb(errState) - } - - function afterGlob (er, results) { - if (er) - return cb(er) - - n = results.length - if (n === 0) - return cb() - - results.forEach(function (p) { - rimraf_(p, options, function CB (er) { - if (er) { - if ((er.code === "EBUSY" || er.code === "ENOTEMPTY" || er.code === "EPERM") && - busyTries < options.maxBusyTries) { - busyTries ++ - var time = busyTries * 100 - // try again, with the same exact callback as this one. - return setTimeout(function () { - rimraf_(p, options, CB) - }, time) - } - - // this one won't happen if graceful-fs is used. - if (er.code === "EMFILE" && timeout < options.emfileWait) { - return setTimeout(function () { - rimraf_(p, options, CB) - }, timeout ++) - } - - // already gone - if (er.code === "ENOENT") er = null - } - - timeout = 0 - next(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, options, cb) { - assert(p) - assert(options) - assert(typeof cb === 'function') - - // sunos lets the root user unlink directories, which is... weird. - // so we have to lstat here and make sure it's not a dir. - options.lstat(p, function (er, st) { - if (er && er.code === "ENOENT") - return cb(null) - - // Windows can EPERM on stat. Life is suffering. - if (er && er.code === "EPERM" && isWindows) - fixWinEPERM(p, options, er, cb) - - if (st && st.isDirectory()) - return rmdir(p, options, er, cb) - - options.unlink(p, function (er) { - if (er) { - if (er.code === "ENOENT") - return cb(null) - if (er.code === "EPERM") - return (isWindows) - ? fixWinEPERM(p, options, er, cb) - : rmdir(p, options, er, cb) - if (er.code === "EISDIR") - return rmdir(p, options, er, cb) - } - return cb(er) - }) - }) -} - -function fixWinEPERM (p, options, er, cb) { - assert(p) - assert(options) - assert(typeof cb === 'function') - if (er) - assert(er instanceof Error) - - options.chmod(p, _0666, function (er2) { - if (er2) - cb(er2.code === "ENOENT" ? null : er) - else - options.stat(p, function(er3, stats) { - if (er3) - cb(er3.code === "ENOENT" ? null : er) - else if (stats.isDirectory()) - rmdir(p, options, er, cb) - else - options.unlink(p, cb) - }) - }) -} - -function fixWinEPERMSync (p, options, er) { - assert(p) - assert(options) - if (er) - assert(er instanceof Error) - - try { - options.chmodSync(p, _0666) - } catch (er2) { - if (er2.code === "ENOENT") - return - else - throw er - } - - try { - var stats = options.statSync(p) - } catch (er3) { - if (er3.code === "ENOENT") - return - else - throw er - } - - if (stats.isDirectory()) - rmdirSync(p, options, er) - else - options.unlinkSync(p) -} - -function rmdir (p, options, originalEr, cb) { - assert(p) - assert(options) - if (originalEr) - assert(originalEr instanceof Error) - assert(typeof cb === 'function') - - // 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. - options.rmdir(p, function (er) { - if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")) - rmkids(p, options, cb) - else if (er && er.code === "ENOTDIR") - cb(originalEr) - else - cb(er) - }) -} - -function rmkids(p, options, cb) { - assert(p) - assert(options) - assert(typeof cb === 'function') - - options.readdir(p, function (er, files) { - if (er) - return cb(er) - var n = files.length - if (n === 0) - return options.rmdir(p, cb) - var errState - files.forEach(function (f) { - rimraf(path.join(p, f), options, function (er) { - if (errState) - return - if (er) - return cb(errState = er) - if (--n === 0) - options.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, options) { - options = options || {} - defaults(options) - - assert(p, 'rimraf: missing path') - assert.equal(typeof p, 'string', 'rimraf: path should be a string') - assert(options, 'rimraf: missing options') - assert.equal(typeof options, 'object', 'rimraf: options should be object') - - var results - - if (options.disableGlob || !glob.hasMagic(p)) { - results = [p] - } else { - try { - options.lstatSync(p) - results = [p] - } catch (er) { - results = glob.sync(p, options.glob) - } - } - - if (!results.length) - return - - for (var i = 0; i < results.length; i++) { - var p = results[i] - - try { - var st = options.lstatSync(p) - } catch (er) { - if (er.code === "ENOENT") - return - - // Windows can EPERM on stat. Life is suffering. - if (er.code === "EPERM" && isWindows) - fixWinEPERMSync(p, options, er) - } - - try { - // sunos lets the root user unlink directories, which is... weird. - if (st && st.isDirectory()) - rmdirSync(p, options, null) - else - options.unlinkSync(p) - } catch (er) { - if (er.code === "ENOENT") - return - if (er.code === "EPERM") - return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er) - if (er.code !== "EISDIR") - throw er - - rmdirSync(p, options, er) - } - } -} - -function rmdirSync (p, options, originalEr) { - assert(p) - assert(options) - if (originalEr) - assert(originalEr instanceof Error) - - try { - options.rmdirSync(p) - } catch (er) { - if (er.code === "ENOENT") - return - if (er.code === "ENOTDIR") - throw originalEr - if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM") - rmkidsSync(p, options) - } -} - -function rmkidsSync (p, options) { - assert(p) - assert(options) - options.readdirSync(p).forEach(function (f) { - rimrafSync(path.join(p, f), options) - }) - - // We only end up here once we got ENOTEMPTY at least once, and - // at this point, we are guaranteed to have removed all the kids. - // So, we know that it won't be ENOENT or ENOTDIR or anything else. - // try really hard to delete stuff on windows, because it has a - // PROFOUNDLY annoying habit of not closing handles promptly when - // files are deleted, resulting in spurious ENOTEMPTY errors. - var retries = isWindows ? 100 : 1 - var i = 0 - do { - var threw = true - try { - var ret = options.rmdirSync(p, options) - threw = false - return ret - } finally { - if (++i < retries && threw) - continue - } - } while (true) -} diff --git a/plugins/music_service/squeezelite/node_modules/v-conf/.npmignore b/plugins/music_service/squeezelite/node_modules/v-conf/.npmignore deleted file mode 100644 index 7a1537ba0..000000000 --- a/plugins/music_service/squeezelite/node_modules/v-conf/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -.idea -node_modules diff --git a/plugins/music_service/squeezelite/node_modules/v-conf/README.md b/plugins/music_service/squeezelite/node_modules/v-conf/README.md deleted file mode 100644 index d28b8154b..000000000 --- a/plugins/music_service/squeezelite/node_modules/v-conf/README.md +++ /dev/null @@ -1,163 +0,0 @@ -# v-conf -An easy to use library for managing configuration parameters. V-conf was born inside the [Volumio](http://volumio.org 'The volumio project website') project -and then has been migrated to a separate library. - -The idea behind v-conf is to provide an easy way to manage configuration parameters. Main functionalities are: - -* Optionally store data on file -* Configuration is automatically saved after a configurable amount of time -* Data write is reduced is automatic save has not been done yet -* Configuration parameters can be organized in a hierarchical structure in order to group them - -##Contacts - - - -##Installation - -To install it include the library in your package.json as follows (replacing VERSION with latest version number) - - { - "name": "test", - "version": "1", - "dependencies": { - "v-conf": "VERSION" - } - } - -and then run - - npm install - -In your package.json pick latest version if you don't need a specific one. The example refers to version 0.0.2. - -If you want to install the library manually run the following command on the root of your project - - npm install v-conf - -or install v-conf globally - - npm install -g v-conf - -##Usage - -###Initialization - -V-conf needs to be instantiated somewhere in your code. - - var config=new (require('v-conf'))(); - -Then you can decide wether creating your data structure manually or load from disk. A configuration value can be added as follows: - - config.addConfigValue('my.configuration.value','boolean',false); - -Instead a configuration file can be loaded by executing - - config.loadFile(__dirname+'/testConfig.json'); - -If you load the configuration from file you automatically activate the autosave option. This option saves the updated configuration after -a configured amount of time. This allows grouping write option thus saving your SD card (in case you run the code on a device like a -Raspberry PI) - -###Key structure - -As shown by the addConfigValue example above the configuration values are organized in a tree structure. This allows grouping of data. -The method addConfigValue automatically creates the missing structures for you. - -The following code - - config.addConfigValue('groupa.configuration','boolean',false); - config.addConfigValue('groupb.configuration','boolean',true); - -creates an internal representation like the following - - { - "groupa": - { - "configuration":{ - "type":"boolean", - "value":false - } - }, - "groupb": - { - "configuration":{ - "type":"boolean", - "value":true - } - } - } - -###Data types - -Supported types are: boolean, string, number - -###Methods - -####addConfigValue(key,type,value) - -Adds a configuration key to the structure. - -* key: the key for the configuration values you're about to add -* type: one of the supported data types -* value: the current value - -Example: - - config.addConfigValue('groupa.configuration','boolean',false); - -####set(key,value) - -Updates the value of the key. Does nothing if the key doesn't exists. - -* key: the key of an existing configuration values -* value: the value to set - -Example: - - config.set('groupa.configuration',false); - -####get(key) - -Retrieves the current value for the specified key. - -* key: the key of an existing configuration values - -Returns the value associated to the key or undefined - -Example: - - var values=config.get('groupa.configuration'); - -####delete(key) - -Deletes the configuration parameter specified by the key. - -* key: the key of an existing configuration values - -Example: - - config.delete('groupa.configuration'); - -####has(key) - -This method checks the existence of a key - -* key: the key to check - -Returns eturns true or false depending on the existence of a key in the configuration file - -Example: - - var exists=config.has('groupa.configuration'); - -####getKeys(key) - -Lists all the children keys of the specified one. - -* key: the key of an existing configuration values - -Example: - - var keys=config.getKeys('groupa.configuration'); - diff --git a/plugins/music_service/squeezelite/node_modules/v-conf/configTest.js b/plugins/music_service/squeezelite/node_modules/v-conf/configTest.js deleted file mode 100644 index a76163b6a..000000000 --- a/plugins/music_service/squeezelite/node_modules/v-conf/configTest.js +++ /dev/null @@ -1,91 +0,0 @@ -/** - * Created by massi on 27/07/15. - */ -var config=new (require(__dirname+'/index.js'))(); -var configB=new (require(__dirname+'/index.js'))(); - - -config.loadFile(__dirname+'/testConfig.json'); - -console.log(config.get("callback.b")); -config.set("callback.b","ACCITUA"); -config.save(); -configB.loadFile(__dirname+'/testConfig.json'); -console.log("THIS SHOULD BE DIFFERENT FROM BBB "+config.get("callback.b")); -console.log("THIS SHOULD BE DIFFERENT FROM BBB "+configB.get("callback.b")); - - - -console.log("KEYS: "+config.getKeys()); -console.log("KEYS: "+config.getKeys('keys')); - -var keys=config.getKeys('keys.fifth'); -console.log("KEYS: "+keys); - -for( var i in keys) - console.log(keys[i]); - -console.log("VALUE "+config.get('debug')); -console.log("VALUE "+config.get('env')); -console.log("VALUE "+config.get('structured.a')); -console.log("VALUE "+config.get('structured.b')); - -config.set('debug',true); -config.set('env',"PRODUCTION"); -config.set('structured.a',500); -config.set('structured.b',1000); - -console.log("VALUE "+config.get('debug')); -console.log("VALUE "+config.get('env')); -console.log("VALUE "+config.get('structured.a')); -console.log("VALUE "+config.get('structured.b')); - - - -console.log("VALUE "+config.get('music_services.dirble.enabled')); -config.addConfigValue('music_services.dirble.enabled','boolean',false); -console.log("VALUE "+config.get('music_services.dirble.enabled')); - - -console.log("THIS VALUE SHALL BE FALSE: "+config.has('not.existing.key')); -config.delete('delete.fifth.sub-key-1'); -console.log("VALUE "+config.get('delete.fifth.sub-key-2')); - -config.print(); - - - - - -config.registerCallback('callback.a',function(value) -{ - console.log("This is callabck A #1. New value is "+value); -}); - -config.registerCallback('callback.b',function(value) -{ - console.log("This is callabck B. New value is "+value); -}); - - -config.set('callback.a','New value'); - -config.registerCallback('callback.a',function(value) -{ - console.log("This is callabck A #2. New value is "+value); -}); -config.set('callback.a','Asganau'); - -config.delete('callback.a'); -config.addConfigValue('callback.a','string',"PIPPO"); -config.set('callback.a','AAAA'); -config.print(); - -config.registerCallback('callback.a',function(value) -{ - console.log("You should see only this callback. Value: "+value); -}); -config.set('callback.a','########'); -config.print(); - -config.set('callback.b','BBB'); \ No newline at end of file diff --git a/plugins/music_service/squeezelite/node_modules/v-conf/index.js b/plugins/music_service/squeezelite/node_modules/v-conf/index.js deleted file mode 100644 index 26b068dd7..000000000 --- a/plugins/music_service/squeezelite/node_modules/v-conf/index.js +++ /dev/null @@ -1,260 +0,0 @@ -/** - * Created by Massimiliano Fanciulli on 27/07/15. - * If you need any information write me at fanciulli@gmail.com - */ -var fs=require('fs-extra'); -var Multimap = require('multimap'); - -module.exports=Config; - -function Config() -{ - var self=this; - - self.autosave=true; - self.autosaveDelay=1000; - self.saved=true; - self.data={}; - - self.callbacks=new Multimap(); -} - - -/** - * - * @param file - */ -Config.prototype.loadFile=function(file) -{ - var self=this; - - self.filePath=file; - - try - { - self.data=fs.readJsonSync(file); - } - catch(ex) - { - self.data={}; - console.log('Error reading configuration. Defaulting to empty configuration'); - } - -} - -/** - * - * @param key - * @returns {{}|*} - */ -Config.prototype.findProp=function(key) -{ - var self=this; - - if(key==undefined) - return self.data; - else - { - var splitted=key.split('.'); - var currentProp=self.data; - - while (splitted.length > 0) { - var k = splitted.shift(); - - if(currentProp && currentProp[k]!=undefined) - currentProp=currentProp[k]; - else - { - currentProp=null; - break; - } - } - - return currentProp; - } -} - -/** - * This method returns true or false depending on the existence of a key in the configuration file - * @param key Key to check - * @returns {boolean} True if key exists, false otherwise - */ -Config.prototype.has=function(key) -{ - var self=this; - - return self.findProp(key)!=null; -} - - -Config.prototype.get=function(key) -{ - var self=this; - var prop=self.findProp(key); - - if(prop!=undefined) - return self.forceToType(prop.type,prop.value); -} - -Config.prototype.set=function(key,value) -{ - var self=this; - var prop=self.findProp(key); - - if(prop!=undefined) - { - prop.value=self.forceToType(prop.type,value); - self.scheduleSave(); - } - - self.callbacks.forEach(function (callback, ckey) { - if(key==ckey) - { - callback(value); - } - }); - -} - -Config.prototype.scheduleSave=function() -{ - var self=this; - - if(self.filePath!=undefined) - { - self.saved=false; - - setTimeout(function() - { - self.save(); - },self.autosaveDelay); - } - -} - -Config.prototype.save=function() -{ - var self=this; - - if(self.saved==false) - { - self.saved=true; - fs.writeJsonSync(self.filePath,self.data); - } -} - -Config.prototype.addConfigValue=function(key,type,value) -{ - var self=this; - - var splitted=key.split('.'); - var currentProp=self.data; - - while (splitted.length > 0) { - var k = splitted.shift(); - - if(currentProp && currentProp[k]!=undefined) - currentProp=currentProp[k]; - else - { - currentProp[k]={}; - currentProp=currentProp[k]; - } - } - - var prop=self.findProp(key); - self.assertSupportedType(type); - prop['type']=type; - - - prop['value']=self.forceToType(type,value); - - self.scheduleSave(); -} - -Config.prototype.assertSupportedType=function(type) -{ - if(type != 'string' && type!='boolean' && type!='number' && type!='array') - { - throw Error('Type '+type+' is not supported'); - } -} - -Config.prototype.forceToType=function(type,value) -{ - if(type=='string') - { - return ''+value; - } - else if(type=='boolean') - { - return Boolean(value); - } - else if(type=='number') - { - var i = Number(value); - if(Number.isNaN(i)) - throw Error('The value '+value+' is not a number'); - else return i; - } - else return value; - -} - -Config.prototype.print=function() -{ - var self=this; - - console.log(JSON.stringify(self.data)); -} - -/** - * This method searches for the key and deletes it - * @param key - */ -Config.prototype.delete=function(key) -{ - var self=this; - - if(self.has(key)) - { - var splitted=key.split('.'); - - if(splitted.length==1) - delete self.data[key]; - else - { - var parentKey=self.data; - for(var i=0;i< splitted.length;i++) - { - var k = splitted.shift(); - parentKey=parentKey[k]; - } - - var nextKey=splitted.shift(); - delete parentKey[nextKey]; - } - - self.scheduleSave(); - } - - self.callbacks.delete(key); -} - -Config.prototype.getKeys=function(parentKey) -{ - var self=this; - - var parent=self.findProp(parentKey); - - if(parent!=undefined && parent!=null) - return Object.keys(parent); - else return Object.keys(self.data); -} - -Config.prototype.registerCallback=function(key,callback) -{ - var self=this; - - self.callbacks.set(key,callback); -} diff --git a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/.npmignore b/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/.npmignore deleted file mode 100644 index 68eefb7b7..000000000 --- a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/.npmignore +++ /dev/null @@ -1,8 +0,0 @@ -.nyc_output/ -coverage/ -test/ -.travis.yml -appveyor.yml -lib/**/__tests__/ -test/readme.md -test.js diff --git a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/CHANGELOG.md b/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/CHANGELOG.md deleted file mode 100644 index 72ff4ad35..000000000 --- a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/CHANGELOG.md +++ /dev/null @@ -1,257 +0,0 @@ -0.23.1 / 2015-08-07 -------------------- -- Better handling of errors for `move()` when moving across devices. https://github.com/jprichardson/node-fs-extra/pull/170 -- `ensureSymlink()` and `ensureLink()` should not throw errors if link exists. https://github.com/jprichardson/node-fs-extra/pull/169 - -0.23.0 / 2015-08-06 -------------------- -- added `ensureLink{Sync}()` and `ensureSymlink{Sync}()`. See: https://github.com/jprichardson/node-fs-extra/pull/165 - -0.22.1 / 2015-07-09 -------------------- -- Prevent calling `hasMillisResSync()` on module load. See: https://github.com/jprichardson/node-fs-extra/issues/149. -Fixes regression that was introduced in `0.21.0`. - -0.22.0 / 2015-07-09 -------------------- -- preserve permissions / ownership in `copy()`. See: https://github.com/jprichardson/node-fs-extra/issues/54 - -0.21.0 / 2015-07-04 -------------------- -- add option to preserve timestamps in `copy()` and `copySync()`. See: https://github.com/jprichardson/node-fs-extra/pull/141 -- updated `graceful-fs@3.x` to `4.x`. This brings in features from `amazing-graceful-fs` (much cleaner code / less hacks) - -0.20.1 / 2015-06-23 -------------------- -- fixed regression caused by latest jsonfile update: See: https://github.com/jprichardson/node-jsonfile/issues/26 - -0.20.0 / 2015-06-19 -------------------- -- removed `jsonfile` aliases with `File` in the name, they weren't documented and probably weren't in use e.g. -this package had both `fs.readJsonFile` and `fs.readJson` that were aliases to each other, now use `fs.readJson`. -- preliminary walker created. Intentionally not documented. If you use it, it will almost certainly change and break your code. -- started moving tests inline -- upgraded to `jsonfile@2.1.0`, can now pass JSON revivers/replacers to `readJson()`, `writeJson()`, `outputJson()` - -0.19.0 / 2015-06-08 -------------------- -- `fs.copy()` had support for Node v0.8, dropped support - -0.18.4 / 2015-05-22 -------------------- -- fixed license field according to this: https://github.com/jprichardson/node-fs-extra/pull/136 and https://github.com/npm/npm/releases/tag/v2.10.0 - -0.18.3 / 2015-05-08 -------------------- -- bugfix: handle `EEXIST` when clobbering on some Linux systems. https://github.com/jprichardson/node-fs-extra/pull/134 - -0.18.2 / 2015-04-17 -------------------- -- bugfix: allow `F_OK` (https://github.com/jprichardson/node-fs-extra/issues/120) - -0.18.1 / 2015-04-15 -------------------- -- improved windows support for `move()` a bit. https://github.com/jprichardson/node-fs-extra/commit/92838980f25dc2ee4ec46b43ee14d3c4a1d30c1b -- fixed a lot of tests for Windows (appveyor) - -0.18.0 / 2015-03-31 -------------------- -- added `emptyDir()` and `emptyDirSync()` - -0.17.0 / 2015-03-28 -------------------- -- `copySync` added `clobber` option (before always would clobber, now if `clobber` is `false` it throws an error if the destination exists). -**Only works with files at the moment.** -- `createOutputStream()` added. See: https://github.com/jprichardson/node-fs-extra/pull/118 - -0.16.5 / 2015-03-08 -------------------- -- fixed `fs.move` when `clobber` is `true` and destination is a directory, it should clobber. https://github.com/jprichardson/node-fs-extra/issues/114 - -0.16.4 / 2015-03-01 -------------------- -- `fs.mkdirs` fix infinite loop on Windows. See: See https://github.com/substack/node-mkdirp/pull/74 and https://github.com/substack/node-mkdirp/issues/66 - -0.16.3 / 2015-01-28 -------------------- -- reverted https://github.com/jprichardson/node-fs-extra/commit/1ee77c8a805eba5b99382a2591ff99667847c9c9 - - -0.16.2 / 2015-01-28 -------------------- -- fixed `fs.copy` for Node v0.8 (support is temporary and will be removed in the near future) - -0.16.1 / 2015-01-28 -------------------- -- if `setImmediate` is not available, fall back to `process.nextTick` - -0.16.0 / 2015-01-28 -------------------- -- bugfix `fs.move()` into itself. Closes #104 -- bugfix `fs.move()` moving directory across device. Closes #108 -- added coveralls support -- bugfix: nasty multiple callback `fs.copy()` bug. Closes #98 -- misc fs.copy code cleanups - -0.15.0 / 2015-01-21 -------------------- -- dropped `ncp`, imported code in -- because of previous, now supports `io.js` -- `graceful-fs` is now a dependency - -0.14.0 / 2015-01-05 -------------------- -- changed `copy`/`copySync` from `fs.copy(src, dest, [filters], callback)` to `fs.copy(src, dest, [options], callback)` https://github.com/jprichardson/node-fs-extra/pull/100 -- removed mockfs tests for mkdirp (this may be temporary, but was getting in the way of other tests) - -0.13.0 / 2014-12-10 -------------------- -- removed `touch` and `touchSync` methods (they didn't handle permissions like UNIX touch) -- updated `"ncp": "^0.6.0"` to `"ncp": "^1.0.1"` -- imported `mkdirp` => `minimist` and `mkdirp` are no longer dependences, should now appease people who wanted `mkdirp` to be `--use_strict` safe. See [#59](https://github.com/jprichardson/node-fs-extra/issues/59) - -0.12.0 / 2014-09-22 -------------------- -- copy symlinks in `copySync()` [#85](https://github.com/jprichardson/node-fs-extra/pull/85) - -0.11.1 / 2014-09-02 -------------------- -- bugfix `copySync()` preserve file permissions [#80](https://github.com/jprichardson/node-fs-extra/pull/80) - -0.11.0 / 2014-08-11 -------------------- -- upgraded `"ncp": "^0.5.1"` to `"ncp": "^0.6.0"` -- upgrade `jsonfile": "^1.2.0"` to `jsonfile": "^2.0.0"` => on write, json files now have `\n` at end. Also adds `options.throws` to `readJsonSync()` -see https://github.com/jprichardson/node-jsonfile#readfilesyncfilename-options for more details. - -0.10.0 / 2014-06-29 ------------------- -* bugfix: upgaded `"jsonfile": "~1.1.0"` to `"jsonfile": "^1.2.0"`, bumped minor because of `jsonfile` dep change -from `~` to `^`. #67 - -0.9.1 / 2014-05-22 ------------------- -* removed Node.js `0.8.x` support, `0.9.0` was published moments ago and should have been done there - -0.9.0 / 2014-05-22 ------------------- -* upgraded `ncp` from `~0.4.2` to `^0.5.1`, #58 -* upgraded `rimraf` from `~2.2.6` to `^2.2.8` -* upgraded `mkdirp` from `0.3.x` to `^0.5.0` -* added methods `ensureFile()`, `ensureFileSync()` -* added methods `ensureDir()`, `ensureDirSync()` #31 -* added `move()` method. From: https://github.com/andrewrk/node-mv - - -0.8.1 / 2013-10-24 ------------------- -* copy failed to return an error to the callback if a file doesn't exist (ulikoehler #38, #39) - -0.8.0 / 2013-10-14 ------------------- -* `filter` implemented on `copy()` and `copySync()`. (Srirangan / #36) - -0.7.1 / 2013-10-12 ------------------- -* `copySync()` implemented (Srirangan / #33) -* updated to the latest `jsonfile` version `1.1.0` which gives `options` params for the JSON methods. Closes #32 - -0.7.0 / 2013-10-07 ------------------- -* update readme conventions -* `copy()` now works if destination directory does not exist. Closes #29 - -0.6.4 / 2013-09-05 ------------------- -* changed `homepage` field in package.json to remove NPM warning - -0.6.3 / 2013-06-28 ------------------- -* changed JSON spacing default from `4` to `2` to follow Node conventions -* updated `jsonfile` dep -* updated `rimraf` dep - -0.6.2 / 2013-06-28 ------------------- -* added .npmignore, #25 - -0.6.1 / 2013-05-14 ------------------- -* modified for `strict` mode, closes #24 -* added `outputJson()/outputJsonSync()`, closes #23 - -0.6.0 / 2013-03-18 ------------------- -* removed node 0.6 support -* added node 0.10 support -* upgraded to latest `ncp` and `rimraf`. -* optional `graceful-fs` support. Closes #17 - - -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/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/LICENSE b/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/LICENSE deleted file mode 100644 index 91612c654..000000000 --- a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -(The MIT License) - -Copyright (c) 2011-2015 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/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/README.md b/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/README.md deleted file mode 100644 index 73c34be92..000000000 --- a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/README.md +++ /dev/null @@ -1,518 +0,0 @@ -Node.js: fs-extra -================= - -[![build status](https://secure.travis-ci.org/jprichardson/node-fs-extra.svg)](http://travis-ci.org/jprichardson/node-fs-extra) -[![windows Build status](https://img.shields.io/appveyor/ci/jprichardson/node-fs-extra/master.svg?label=windows%20build)](https://ci.appveyor.com/project/jprichardson/node-fs-extra/branch/master) -[![downloads per month](http://img.shields.io/npm/dm/fs-extra.svg)](https://www.npmjs.org/package/fs-extra) -[![Coverage Status](https://img.shields.io/coveralls/jprichardson/node-fs-extra.svg)](https://coveralls.io/r/jprichardson/node-fs-extra) - - -`fs-extra` adds 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 --save fs-extra - - - -Usage ------ - -`fs-extra` is a drop in replacement for native `fs`. All methods in `fs` are unmodified and attached to `fs-extra`. - -You don't ever need to include the original `fs` module again: - -```js -var fs = require('fs') // this is no longer necessary -``` - -you can now do this: - -```js -var fs = require('fs-extra') -``` - -or if you prefer to make it clear that you're using `fs-extra` and not `fs`, you may want -to name your `fs` variable `fse` like so: - -```js -var fse = require('fs-extra') -``` - -you can also keep both, but it's redundant: - -```js -var fs = require('fs') -var fse = require('fs-extra') -``` - - -Methods -------- -- [copy](#copy) -- [copySync](#copy) -- [createOutputStream](#createoutputstreamfile-options) -- [emptyDir](#emptydirdir-callback) -- [emptyDirSync](#emptydirdir-callback) -- [ensureFile](#ensurefilefile-callback) -- [ensureFileSync](#ensurefilefile-callback) -- [ensureDir](#ensuredirdir-callback) -- [ensureDirSync](#ensuredirdir-callback) -- [ensureLink](#ensurelinksrcpath-dstpath-callback) -- [ensureLinkSync](#ensurelinksrcpath-dstpath-callback) -- [ensureSymlink](#ensuresymlinksrcpath-dstpath-type-callback) -- [ensureSymlinkSync](#ensuresymlinksrcpath-dstpath-type-callback) -- [mkdirs](#mkdirsdir-callback) -- [mkdirsSync](#mkdirsdir-callback) -- [move](#movesrc-dest-options-callback) -- [outputFile](#outputfilefile-data-callback) -- [outputFileSync](#outputfilefile-data-callback) -- [outputJson](#outputjsonfile-data-callback) -- [outputJsonSync](#outputjsonfile-data-callback) -- [readJson](#readjsonfile-options-callback) -- [readJsonSync](#readjsonfile-options-callback) -- [remove](#removedir-callback) -- [removeSync](#removedir-callback) -- [writeJson](#writejsonfile-object-options-callback) -- [writeJsonSync](#writejsonfile-object-options-callback) - - -**NOTE:** You can still use the native Node.js methods. They are copied over to `fs-extra`. - - -### copy() - -**copy(src, dest, [options], callback)** - - -Copy a file or directory. The directory can have contents. Like `cp -r`. - -Options: -clobber (boolean): overwrite existing file or directory -preserveTimestamps (boolean): will set last modification and access times to the ones of the original source files, default is `false`. - -Sync: `copySync()` - - -Examples: - -```js -var fs = require('fs-extra') - -fs.copy('/tmp/myfile', '/tmp/mynewfile', function (err) { - if (err) return console.error(err) - console.log("success!") -}) // copies file - -fs.copy('/tmp/mydir', '/tmp/mynewdir', function (err) { - if (err) return console.error(err) - console.log('success!') -}) // copies directory, even if it has subdirectories or files -``` - - -### createOutputStream(file, [options]) - -Exactly like `createWriteStream`, but if the directory does not exist, it's created. - -Examples: - -```js -var fs = require('fs-extra') - -// if /tmp/some does not exist, it is created -var ws = fs.createOutputStream('/tmp/some/file.txt') -ws.write('hello\n') -``` - -Note on naming: you'll notice that fs-extra has some methods like `fs.outputJson`, `fs.outputFile`, etc that use the -word `output` to denote that if the containing directory does not exist, it should be created. If you can think of a -better succinct nomenclature for these methods, please open an issue for discussion. Thanks. - - -### emptyDir(dir, [callback]) - -Ensures that a directory is empty. If the directory does not exist, it is created. The directory itself is not deleted. - -Alias: `emptydir()` - -Sync: `emptyDirSync()`, `emptydirSync()` - -Example: - -```js -var fs = require('fs-extra') - -// assume this directory has a lot of files and folders -fs.emptyDir('/tmp/some/dir', function (err) { - if (!err) console.log('success!') -}) -``` - - -### ensureFile(file, callback) - -Ensures that the file exists. 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**. - -Alias: `createFile()` - -Sync: `createFileSync()`,`ensureFileSync()` - - -Example: - -```js -var fs = require('fs-extra') - -var file = '/tmp/this/path/does/not/exist/file.txt' -fs.ensureFile(file, function (err) { - console.log(err) // => null - // file has now been created, including the directory it is to be placed in -}) -``` - - -### ensureDir(dir, callback) - -Ensures that the directory exists. If the directory structure does not exist, it is created. - -Sync: `ensureDirSync()` - - -Example: - -```js -var fs = require('fs-extra') - -var dir = '/tmp/this/path/does/not/exist' -fs.ensureDir(dir, function (err) { - console.log(err) // => null - // dir has now been created, including the directory it is to be placed in -}) -``` - - -### ensureLink(srcpath, dstpath, callback) - -Ensures that the link exists. If the directory structure does not exist, it is created. - -Sync: `ensureLinkSync()` - - -Example: - -```js -var fs = require('fs-extra') - -var srcpath = '/tmp/file.txt' -var dstpath = '/tmp/this/path/does/not/exist/file.txt' -fs.ensureLink(srcpath, dstpath, function (err) { - console.log(err) // => null - // link has now been created, including the directory it is to be placed in -}) -``` - - -### ensureSymlink(srcpath, dstpath, [type], callback) - -Ensures that the symlink exists. If the directory structure does not exist, it is created. - -Sync: `ensureSymlinkSync()` - - -Example: - -```js -var fs = require('fs-extra') - -var srcpath = '/tmp/file.txt' -var dstpath = '/tmp/this/path/does/not/exist/file.txt' -fs.ensureSymlink(srcpath, dstpath, function (err) { - console.log(err) // => null - // symlink has now been created, including the directory it is to be placed in -}) -``` - - -### 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: - -```js -var fs = require('fs-extra') - -fs.mkdirs('/tmp/some/long/path/that/prob/doesnt/exist', function (err) { - if (err) return console.error(err) - console.log("success!") -}) - -fs.mkdirsSync('/tmp/another/path') -``` - - -### move(src, dest, [options], callback) - -Moves a file or directory, even across devices. - -Options: -clobber (boolean): overwrite existing file or directory -limit (number): number of concurrent moves, see ncp for more information - -Example: - -```js -var fs = require('fs-extra') - -fs.move('/tmp/somefile', '/tmp/does/not/exist/yet/somefile', function (err) { - if (err) return console.error(err) - console.log("success!") -}) -``` - - -### outputFile(file, data, callback) - -Almost the same as `writeFile` (i.e. it [overwrites](http://pages.citebite.com/v2o5n8l2f5reb)), except that if the parent directory does not exist, it's created. - -Sync: `outputFileSync()` - - -Example: - -```js -var fs = require('fs-extra') -var 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! - }) -}) -``` - - - -### outputJson(file, data, [options], callback) - -Almost the same as `writeJson`, except that if the directory does not exist, it's created. -`options` are what you'd pass to [`jsonFile.writeFile()`](https://github.com/jprichardson/node-jsonfile#writefilefilename-options-callback). - -Alias: `outputJSON()` - -Sync: `outputJsonSync()`, `outputJSONSync()` - - -Example: - -```js -var fs = require('fs-extra') -var file = '/tmp/this/path/does/not/exist/file.txt' - -fs.outputJson(file, {name: 'JP'}, function (err) { - console.log(err) // => null - - fs.readJson(file, function(err, data) { - console.log(data.name) // => JP - }) -}) -``` - - - -### readJson(file, [options], callback) - -Reads a JSON file and then parses it into an object. `options` are the same -that you'd pass to [`jsonFile.readFile`](https://github.com/jprichardson/node-jsonfile#readfilefilename-options-callback). - -Alias: `readJSON()` - -Sync: `readJsonSync()`, `readJSONSync()` - - -Example: - -```js -var fs = require('fs-extra') - -fs.readJson('./package.json', function (err, packageObj) { - console.log(packageObj.version) // => 0.1.3 -}) -``` - -`readJsonSync()` can take a `throws` option set to `false` and it won't throw if the JSON is invalid. Example: - -```js -var fs = require('fs-extra') -var file = path.join('/tmp/some-invalid.json') -var data = '{not valid JSON' -fs.writeFileSync(file, data) - -var obj = fs.readJsonSync(file, {throws: false}) -console.log(obj) // => null -``` - - -### remove(dir, callback) - -Removes a file or directory. The directory can have contents. Like `rm -rf`. - -Alias: `delete()` - -Sync: `removeSync()` / `deleteSync()` - - -Examples: - -```js -var fs = require('fs-extra') - -fs.remove('/tmp/myfile', function (err) { - if (err) return console.error(err) - - console.log('success!') -}) - -fs.removeSync('/home/jprichardson') //I just deleted my entire HOME directory. -``` - - - -### writeJson(file, object, [options], callback) - -Writes an object to a JSON file. `options` are the same that -you'd pass to [`jsonFile.writeFile()`](https://github.com/jprichardson/node-jsonfile#writefilefilename-options-callback). - -Alias: `writeJSON()` - -Sync: `writeJsonSync()`, `writeJSONSync()` - -Example: - -```js -var fs = require('fs-extra') -fs.writeJson('./package.json', {name: 'fs-extra'}, function (err) { - console.log(err) -}) -``` - - -Third Party ------------ - -### Promises - -Use [Bluebird](https://github.com/petkaantonov/bluebird). See https://github.com/petkaantonov/bluebird/blob/master/API.md#promisification. `fs-extra` is -explicitly listed as supported. - -```js -var Promise = require('bluebird') -var fs = Promise.promisifyAll(require('fs-extra')) -``` - -Or you can use the package [`fs-extra-promise`](https://github.com/overlookmotel/fs-extra-promise) that marries the two together. - - -### TypeScript - -If you like TypeScript, you can use `fs-extra` with it: https://github.com/borisyankov/DefinitelyTyped/tree/master/fs-extra - - -### File / Directory Watching - -If you want to watch for changes to files or directories, then you should use [chokidar](https://github.com/paulmillr/chokidar). - - -### Misc. - -- [mfs](https://github.com/cadorn/mfs) - Monitor your fs-extra calls. - - - -Hacking on fs-extra -------------------- - -Wanna hack on `fs-extra`? Great! Your help is needed! [fs-extra is one of the most depended upon Node.js packages](http://nodei.co/npm/fs-extra.png?downloads=true&downloadRank=true&stars=true). This project -uses [JavaScript Standard Style](https://github.com/feross/standard) - if the name or style choices bother you, -you're gonna have to get over it :) If `standard` is good enough for `npm`, it's good enough for `fs-extra`. - -[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard) - -What's needed? -- First, take a look at existing issues. Those are probably going to be where the priority lies. -- More tests for edge cases. Specifically on different platforms. There can never be enough tests. -- Really really help with the Windows tests. See appveyor outputs for more info. -- Improve test coverage. See coveralls output for more info. -- A directory walker. Probably this one: https://github.com/thlorenz/readdirp imported into `fs-extra`. -- After the directory walker is integrated, any function that needs to traverse directories like -`copy`, `remove`, or `mkdirs` should be built on top of it. -- After the aforementioned functions are built on the directory walker, `fs-extra` should then explicitly -support wildcards. - -Note: If you make any big changes, **you should definitely post an issue for discussion first.** - - -Naming ------- - -I put a lot of thought into the naming of these functions. 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. A directory is just a hierarchical grouping of directories and files. Consider that for a moment. 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)`. - - -Credit ------- - -`fs-extra` wouldn't be possible without using the modules from the following authors: - -- [Isaac Shlueter](https://github.com/isaacs) -- [Charlie McConnel](https://github.com/avianflu) -- [James Halliday](https://github.com/substack) -- [Andrew Kelley](https://github.com/andrewrk) - - - - -License -------- - -Licensed under MIT - -Copyright (c) 2011-2015 [JP Richardson](https://github.com/jprichardson) - -[1]: http://nodejs.org/docs/latest/api/fs.html - - -[jsonfile]: https://github.com/jprichardson/node-jsonfile diff --git a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/copy-sync/copy-file-sync.js b/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/copy-sync/copy-file-sync.js deleted file mode 100644 index 2dc31ef3b..000000000 --- a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/copy-sync/copy-file-sync.js +++ /dev/null @@ -1,34 +0,0 @@ -var fs = require('graceful-fs') - -var BUF_LENGTH = 64 * 1024 -var _buff = new Buffer(BUF_LENGTH) - -function copyFileSync (srcFile, destFile, options) { - var clobber = options.clobber - var preserveTimestamps = options.preserveTimestamps - - if (fs.existsSync(destFile) && !clobber) { - throw Error('EEXIST') - } - - var fdr = fs.openSync(srcFile, 'r') - var stat = fs.fstatSync(fdr) - var fdw = fs.openSync(destFile, 'w', stat.mode) - var bytesRead = 1 - var pos = 0 - - while (bytesRead > 0) { - bytesRead = fs.readSync(fdr, _buff, 0, BUF_LENGTH, pos) - fs.writeSync(fdw, _buff, 0, bytesRead) - pos += bytesRead - } - - if (preserveTimestamps) { - fs.futimesSync(fdw, stat.atime, stat.mtime) - } - - fs.closeSync(fdr) - fs.closeSync(fdw) -} - -module.exports = copyFileSync diff --git a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/copy-sync/copy-sync.js b/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/copy-sync/copy-sync.js deleted file mode 100644 index a68694434..000000000 --- a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/copy-sync/copy-sync.js +++ /dev/null @@ -1,47 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') -var copyFileSync = require('./copy-file-sync') -var mkdir = require('../mkdirs') - -function copySync (src, dest, options) { - if (typeof options === 'function' || options instanceof RegExp) { - options = {filter: options} - } - - options = options || {} - options.recursive = !!options.recursive - - // default to true for now - options.clobber = 'clobber' in options ? !!options.clobber : true - options.preserveTimestamps = 'preserveTimestamps' in options ? !!options.preserveTimestamps : true - - options.filter = options.filter || function () { return true } - - var stats = options.recursive ? fs.lstatSync(src) : fs.statSync(src) - var destFolder = path.dirname(dest) - var destFolderExists = fs.existsSync(destFolder) - var performCopy = false - - if (stats.isFile()) { - if (options.filter instanceof RegExp) performCopy = options.filter.test(src) - else if (typeof options.filter === 'function') performCopy = options.filter(src) - - if (performCopy) { - if (!destFolderExists) mkdir.mkdirsSync(destFolder) - copyFileSync(src, dest, {clobber: options.clobber, preserveTimestamps: options.preserveTimestamps}) - } - } else if (stats.isDirectory()) { - if (!fs.existsSync(dest)) mkdir.mkdirsSync(dest) - var contents = fs.readdirSync(src) - contents.forEach(function (content) { - var opts = options - opts.recursive = true - copySync(path.join(src, content), path.join(dest, content), opts) - }) - } else if (options.recursive && stats.isSymbolicLink()) { - var srcPath = fs.readlinkSync(src) - fs.symlinkSync(srcPath, dest) - } -} - -module.exports = copySync diff --git a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/copy-sync/index.js b/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/copy-sync/index.js deleted file mode 100644 index ebc7e0b91..000000000 --- a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/copy-sync/index.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - copySync: require('./copy-sync') -} diff --git a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/copy/copy.js b/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/copy/copy.js deleted file mode 100644 index 437aedf9e..000000000 --- a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/copy/copy.js +++ /dev/null @@ -1,37 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') -var ncp = require('./ncp') -var mkdir = require('../mkdirs') - -function copy (src, dest, options, callback) { - if (typeof options === 'function' && !callback) { - callback = options - options = {} - } else if (typeof options === 'function' || options instanceof RegExp) { - options = {filter: options} - } - callback = callback || function () {} - - fs.lstat(src, function (err, stats) { - if (err) return callback(err) - - var dir = null - if (stats.isDirectory()) { - var parts = dest.split(path.sep) - parts.pop() - dir = parts.join(path.sep) - } else { - dir = path.dirname(dest) - } - - fs.exists(dir, function (dirExists) { - if (dirExists) return ncp(src, dest, options, callback) - mkdir.mkdirs(dir, function (err) { - if (err) return callback(err) - ncp(src, dest, options, callback) - }) - }) - }) -} - -module.exports = copy diff --git a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/copy/index.js b/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/copy/index.js deleted file mode 100644 index 3e0901616..000000000 --- a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/copy/index.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - copy: require('./copy') -} diff --git a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/copy/ncp.js b/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/copy/ncp.js deleted file mode 100644 index 308869908..000000000 --- a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/copy/ncp.js +++ /dev/null @@ -1,243 +0,0 @@ -// imported from ncp (this is temporary, will rewrite) - -var fs = require('graceful-fs') -var path = require('path') -var utimes = require('../util/utimes') - -function ncp (source, dest, options, callback) { - if (!callback) { - callback = options - options = {} - } - - var basePath = process.cwd() - var currentPath = path.resolve(basePath, source) - var targetPath = path.resolve(basePath, dest) - - var filter = options.filter - var transform = options.transform - var clobber = options.clobber !== false - var dereference = options.dereference - var preserveTimestamps = options.preserveTimestamps === true - - var errs = null - - var started = 0 - var finished = 0 - var running = 0 - // this is pretty useless now that we're using graceful-fs - // consider removing - var limit = options.limit || 512 - - startCopy(currentPath) - - function startCopy (source) { - started++ - if (filter) { - if (filter instanceof RegExp) { - if (!filter.test(source)) { - return doneOne(true) - } - } else if (typeof filter === 'function') { - if (!filter(source)) { - return doneOne(true) - } - } - } - return getStats(source) - } - - function getStats (source) { - var stat = dereference ? fs.stat : fs.lstat - if (running >= limit) { - return setImmediate(function () { - getStats(source) - }) - } - running++ - stat(source, function (err, stats) { - if (err) return onError(err) - - // We need to get the mode from the stats object and preserve it. - var item = { - name: source, - mode: stats.mode, - mtime: stats.mtime, // modified time - atime: stats.atime, // access time - stats: stats // temporary - } - - 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) { - copyFile(file, target) - } else { - if (clobber) { - rmFile(target, function () { - copyFile(file, target) - }) - } else { - doneOne() - } - } - }) - } - - function copyFile (file, target) { - var readStream = fs.createReadStream(file.name) - var writeStream = fs.createWriteStream(target, { mode: file.mode }) - - readStream.on('error', onError) - writeStream.on('error', onError) - - if (transform) { - transform(readStream, writeStream, file) - } else { - writeStream.on('open', function () { - readStream.pipe(writeStream) - }) - } - - writeStream.once('finish', function () { - fs.chmod(target, file.mode, function (err) { - if (err) return onError(err) - if (preserveTimestamps) { - utimes.utimesMillis(target, file.atime, file.mtime, function (err) { - if (err) return onError(err) - return doneOne() - }) - } else { - doneOne() - } - }) - }) - } - - 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) - // despite setting mode in fs.mkdir, doesn't seem to work - // so we set it here. - fs.chmod(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(path.join(dir, item)) - }) - return doneOne() - }) - } - - 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) { - if (dereference) { - resolvedPath = path.resolve(basePath, resolvedPath) - } - isWritable(target, function (writable) { - if (writable) { - return makeLink(resolvedPath, target) - } - fs.readlink(target, function (err, targetDest) { - if (err) return onError(err) - - if (dereference) { - targetDest = path.resolve(basePath, targetDest) - } - if (targetDest === resolvedPath) { - return doneOne() - } - return rmFile(target, function () { - makeLink(resolvedPath, target) - }) - }) - }) - } - - function makeLink (linkPath, target) { - fs.symlink(linkPath, target, function (err) { - if (err) return onError(err) - return doneOne() - }) - } - - function isWritable (path, done) { - fs.lstat(path, function (err) { - 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 = [] - } - if (typeof errs.write === 'undefined') { - errs.push(err) - } else { - errs.write(err.stack + '\n\n') - } - return doneOne() - } - - function doneOne (skipped) { - if (!skipped) running-- - finished++ - if ((started === finished) && (running === 0)) { - if (callback !== undefined) { - return errs ? callback(errs) : callback(null) - } - } - } -} - -module.exports = ncp diff --git a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/empty/index.js b/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/empty/index.js deleted file mode 100644 index 23172bdca..000000000 --- a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/empty/index.js +++ /dev/null @@ -1,46 +0,0 @@ -var fs = require('fs') -var path = require('path') -var mkdir = require('../mkdirs') -var remove = require('../remove') - -function emptyDir (dir, callback) { - fs.readdir(dir, function (err, items) { - if (err) return mkdir.mkdirs(dir, callback) - - items = items.map(function (item) { - return path.join(dir, item) - }) - - deleteItem() - - function deleteItem () { - var item = items.pop() - if (!item) return callback() - remove.remove(item, function (err) { - if (err) return callback(err) - deleteItem() - }) - } - }) -} - -function emptyDirSync (dir) { - var items - try { - items = fs.readdirSync(dir) - } catch (err) { - return mkdir.mkdirsSync(dir) - } - - items.forEach(function (item) { - item = path.join(dir, item) - remove.removeSync(item) - }) -} - -module.exports = { - emptyDirSync: emptyDirSync, - emptydirSync: emptyDirSync, - emptyDir: emptyDir, - emptydir: emptyDir -} diff --git a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/ensure/file.js b/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/ensure/file.js deleted file mode 100644 index 1c9c2de04..000000000 --- a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/ensure/file.js +++ /dev/null @@ -1,43 +0,0 @@ -var path = require('path') -var fs = require('graceful-fs') -var mkdir = require('../mkdirs') - -function createFile (file, callback) { - function makeFile () { - fs.writeFile(file, '', function (err) { - if (err) return callback(err) - callback() - }) - } - - fs.exists(file, function (fileExists) { - if (fileExists) return callback() - var dir = path.dirname(file) - fs.exists(dir, function (dirExists) { - if (dirExists) return makeFile() - mkdir.mkdirs(dir, function (err) { - if (err) return callback(err) - makeFile() - }) - }) - }) -} - -function createFileSync (file) { - if (fs.existsSync(file)) return - - var dir = path.dirname(file) - if (!fs.existsSync(dir)) { - mkdir.mkdirsSync(dir) - } - - fs.writeFileSync(file, '') -} - -module.exports = { - createFile: createFile, - createFileSync: createFileSync, - // alias - ensureFile: createFile, - ensureFileSync: createFileSync -} diff --git a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/ensure/index.js b/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/ensure/index.js deleted file mode 100644 index 26e8705a2..000000000 --- a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/ensure/index.js +++ /dev/null @@ -1,21 +0,0 @@ -var file = require('./file') -var link = require('./link') -var symlink = require('./symlink') - -module.exports = { - // file - createFile: file.createFile, - createFileSync: file.createFileSync, - ensureFile: file.createFile, - ensureFileSync: file.createFileSync, - // link - createLink: link.createLink, - createLinkSync: link.createLinkSync, - ensureLink: link.createLink, - ensureLinkSync: link.createLinkSync, - // symlink - createSymlink: symlink.createSymlink, - createSymlinkSync: symlink.createSymlinkSync, - ensureSymlink: symlink.createSymlink, - ensureSymlinkSync: symlink.createSymlinkSync -} diff --git a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/ensure/link.js b/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/ensure/link.js deleted file mode 100644 index c5fe85da4..000000000 --- a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/ensure/link.js +++ /dev/null @@ -1,58 +0,0 @@ -var path = require('path') -var fs = require('graceful-fs') -var mkdir = require('../mkdirs') - -function createLink (srcpath, dstpath, callback) { - function makeLink (srcpath, dstpath) { - fs.link(srcpath, dstpath, function (err) { - if (err) return callback(err) - callback(null) - }) - } - - fs.exists(dstpath, function (destinationExists) { - if (destinationExists) return callback(null) - fs.lstat(srcpath, function (err, stat) { - if (err) { - err.message = err.message.replace('lstat', 'ensureLink') - return callback(err) - } - var dir = path.dirname(dstpath) - fs.exists(dir, function (dirExists) { - if (dirExists) return makeLink(srcpath, dstpath) - mkdir.mkdirs(dir, function (err) { - if (err) return callback(err) - makeLink(srcpath, dstpath) - }) - }) - }) - }) -} - -function createLinkSync (srcpath, dstpath, callback) { - - var destinationExists = fs.existsSync(dstpath) - if (destinationExists) return undefined - - try { - fs.lstatSync(srcpath) - } catch (err) { - err.message = err.message.replace('lstat', 'ensureLink') - throw err - } - - var dir = path.dirname(dstpath) - var dirExists = fs.existsSync(dir) - if (dirExists) return fs.linkSync(srcpath, dstpath) - mkdir.mkdirsSync(dir) - - return fs.linkSync(srcpath, dstpath) -} - -module.exports = { - createLink: createLink, - createLinkSync: createLinkSync, - // alias - ensureLink: createLink, - ensureLinkSync: createLinkSync -} diff --git a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/ensure/symlink-paths.js b/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/ensure/symlink-paths.js deleted file mode 100644 index cc27d040c..000000000 --- a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/ensure/symlink-paths.js +++ /dev/null @@ -1,97 +0,0 @@ -var path = require('path') -// path.isAbsolute shim for Node.js 0.10 support -path.isAbsolute = (path.isAbsolute) ? path.isAbsolute : require('path-is-absolute') -var fs = require('graceful-fs') - -/** - * Function that returns two types of paths, one relative to symlink, and one - * relative to the current working directory. Checks if path is absolute or - * relative. If the path is relative, this function checks if the path is - * relative to symlink or relative to current working directory. This is an - * initiative to find a smarter `srcpath` to supply when building symlinks. - * This allows you to determine which path to use out of one of three possible - * types of source paths. The first is an absolute path. This is detected by - * `path.isAbsolute()`. When an absolute path is provided, it is checked to - * see if it exists. If it does it's used, if not an error is returned - * (callback)/ thrown (sync). The other two options for `srcpath` are a - * relative url. By default Node's `fs.symlink` works by creating a symlink - * using `dstpath` and expects the `srcpath` to be relative to the newly - * created symlink. If you provide a `srcpath` that does not exist on the file - * system it results in a broken symlink. To minimize this, the function - * checks to see if the 'relative to symlink' source file exists, and if it - * does it will use it. If it does not, it checks if there's a file that - * exists that is relative to the current working directory, if does its used. - * This preserves the expectations of the original fs.symlink spec and adds - * the ability to pass in `relative to current working direcotry` paths. - */ - -function symlinkPaths (srcpath, dstpath, callback) { - if (path.isAbsolute(srcpath)) { - return fs.lstat(srcpath, function (err, stat) { - if (err) { - err.message = err.message.replace('lstat', 'ensureSymlink') - return callback(err) - } - return callback(null, { - 'toCwd': srcpath, - 'toDst': srcpath - }) - }) - } else { - var dstdir = path.dirname(dstpath) - var relativeToDst = path.join(dstdir, srcpath) - return fs.exists(relativeToDst, function (exists) { - if (exists) { - return callback(null, { - 'toCwd': relativeToDst, - 'toDst': srcpath - }) - } else { - return fs.lstat(srcpath, function (err, stat) { - if (err) { - err.message = err.message.replace('lstat', 'ensureSymlink') - return callback(err) - } - return callback(null, { - 'toCwd': srcpath, - 'toDst': path.relative(dstdir, srcpath) - }) - }) - } - }) - } -} - -function symlinkPathsSync (srcpath, dstpath) { - var exists - if (path.isAbsolute(srcpath)) { - exists = fs.existsSync(srcpath) - if (!exists) throw new Error('absolute srcpath does not exist') - return { - 'toCwd': srcpath, - 'toDst': srcpath - } - } else { - var dstdir = path.dirname(dstpath) - var relativeToDst = path.join(dstdir, srcpath) - exists = fs.existsSync(relativeToDst) - if (exists) { - return { - 'toCwd': relativeToDst, - 'toDst': srcpath - } - } else { - exists = fs.existsSync(srcpath) - if (!exists) throw new Error('relative srcpath does not exist') - return { - 'toCwd': srcpath, - 'toDst': path.relative(dstdir, srcpath) - } - } - } -} - -module.exports = { - 'symlinkPaths': symlinkPaths, - 'symlinkPathsSync': symlinkPathsSync -} diff --git a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/ensure/symlink-type.js b/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/ensure/symlink-type.js deleted file mode 100644 index 8bca23dd1..000000000 --- a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/ensure/symlink-type.js +++ /dev/null @@ -1,27 +0,0 @@ -var fs = require('graceful-fs') - -function symlinkType (srcpath, type, callback) { - callback = (typeof type === 'function') ? type : callback - type = (typeof type === 'function') ? false : type - if (type) return callback(null, type) - fs.lstat(srcpath, function (err, stats) { - if (err) return callback(null, 'file') - type = (stats && stats.isDirectory()) ? 'dir' : 'file' - callback(null, type) - }) -} - -function symlinkTypeSync (srcpath, type) { - if (type) return type - try { - var stats = fs.lstatSync(srcpath) - } catch(e) { - return 'file' - } - return (stats && stats.isDirectory()) ? 'dir' : 'file' -} - -module.exports = { - symlinkType: symlinkType, - symlinkTypeSync: symlinkTypeSync -} diff --git a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/ensure/symlink.js b/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/ensure/symlink.js deleted file mode 100644 index 62447906e..000000000 --- a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/ensure/symlink.js +++ /dev/null @@ -1,62 +0,0 @@ -var path = require('path') -var fs = require('graceful-fs') -var _mkdirs = require('../mkdirs') -var mkdirs = _mkdirs.mkdirs -var mkdirsSync = _mkdirs.mkdirsSync - -var _symlinkPaths = require('./symlink-paths') -var symlinkPaths = _symlinkPaths.symlinkPaths -var symlinkPathsSync = _symlinkPaths.symlinkPathsSync - -var _symlinkType = require('./symlink-type') -var symlinkType = _symlinkType.symlinkType -var symlinkTypeSync = _symlinkType.symlinkTypeSync - -function createSymlink (srcpath, dstpath, type, callback) { - callback = (typeof type === 'function') ? type : callback - type = (typeof type === 'function') ? false : type - - fs.exists(dstpath, function (destinationExists) { - if (destinationExists) return callback(null) - symlinkPaths(srcpath, dstpath, function (err, relative) { - if (err) return callback(err) - srcpath = relative.toDst - symlinkType(relative.toCwd, type, function (err, type) { - if (err) return callback(err) - var dir = path.dirname(dstpath) - fs.exists(dir, function (dirExists) { - if (dirExists) return fs.symlink(srcpath, dstpath, type, callback) - mkdirs(dir, function (err) { - if (err) return callback(err) - fs.symlink(srcpath, dstpath, type, callback) - }) - }) - }) - }) - }) -} - -function createSymlinkSync (srcpath, dstpath, type, callback) { - callback = (typeof type === 'function') ? type : callback - type = (typeof type === 'function') ? false : type - - var destinationExists = fs.existsSync(dstpath) - if (destinationExists) return undefined - - var relative = symlinkPathsSync(srcpath, dstpath) - srcpath = relative.toDst - type = symlinkTypeSync(relative.toCwd, type) - var dir = path.dirname(dstpath) - var exists = fs.existsSync(dir) - if (exists) return fs.symlinkSync(srcpath, dstpath, type) - mkdirsSync(dir) - return fs.symlinkSync(srcpath, dstpath, type) -} - -module.exports = { - createSymlink: createSymlink, - createSymlinkSync: createSymlinkSync, - // alias - ensureSymlink: createSymlink, - ensureSymlinkSync: createSymlinkSync -} diff --git a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/index.js b/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/index.js deleted file mode 100644 index 873df87ac..000000000 --- a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/index.js +++ /dev/null @@ -1,37 +0,0 @@ -var assign = require('./util/assign') - -var fse = {} -var gfs = require('graceful-fs') - -// attach fs methods to fse -Object.keys(gfs).forEach(function (key) { - fse[key] = gfs[key] -}) - -var fs = fse - -assign(fs, require('./copy')) -assign(fs, require('./copy-sync')) -assign(fs, require('./mkdirs')) -assign(fs, require('./remove')) -assign(fs, require('./json')) -assign(fs, require('./move')) -assign(fs, require('./streams')) -assign(fs, require('./empty')) -assign(fs, require('./ensure')) -assign(fs, require('./output')) - -module.exports = fs - -// maintain backwards compatibility for awhile -var jsonfile = {} -Object.defineProperty(jsonfile, 'spaces', { - get: function () { - return fs.spaces // found in ./json - }, - set: function (val) { - fs.spaces = val - } -}) - -module.exports.jsonfile = jsonfile // so users of fs-extra can modify jsonFile.spaces diff --git a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/json/index.js b/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/json/index.js deleted file mode 100644 index 27d8661b8..000000000 --- a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/json/index.js +++ /dev/null @@ -1,19 +0,0 @@ -var jsonFile = require('jsonfile') - -module.exports = { - outputJsonSync: require('./output-json-sync'), - outputJson: require('./output-json'), - // aliases - outputJSONSync: require('./output-json-sync'), - outputJSON: require('./output-json'), - // jsonfile exports - readJson: jsonFile.readFile, - readJSON: jsonFile.readFile, - readJsonSync: jsonFile.readFileSync, - readJSONSync: jsonFile.readFileSync, - writeJson: jsonFile.writeFile, - writeJSON: jsonFile.writeFile, - writeJsonSync: jsonFile.writeFileSync, - writeJSONSync: jsonFile.writeFileSync, - spaces: 2 // default in fs-extra -} diff --git a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/json/output-json-sync.js b/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/json/output-json-sync.js deleted file mode 100644 index 00827633a..000000000 --- a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/json/output-json-sync.js +++ /dev/null @@ -1,16 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') -var jsonFile = require('jsonfile') -var mkdir = require('../mkdirs') - -function outputJsonSync (file, data, options) { - var dir = path.dirname(file) - - if (!fs.existsSync(dir)) { - mkdir.mkdirsSync(dir) - } - - jsonFile.writeFileSync(file, data, options) -} - -module.exports = outputJsonSync diff --git a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/json/output-json.js b/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/json/output-json.js deleted file mode 100644 index 914e8b2fc..000000000 --- a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/json/output-json.js +++ /dev/null @@ -1,24 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') -var jsonFile = require('jsonfile') -var mkdir = require('../mkdirs') - -function outputJson (file, data, options, callback) { - if (typeof options === 'function') { - callback = options - options = {} - } - - var dir = path.dirname(file) - - fs.exists(dir, function (itDoes) { - if (itDoes) return jsonFile.writeFile(file, data, options, callback) - - mkdir.mkdirs(dir, function (err) { - if (err) return callback(err) - jsonFile.writeFile(file, data, options, callback) - }) - }) -} - -module.exports = outputJson diff --git a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/mkdirs/index.js b/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/mkdirs/index.js deleted file mode 100644 index 2611217c7..000000000 --- a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/mkdirs/index.js +++ /dev/null @@ -1,9 +0,0 @@ -module.exports = { - mkdirs: require('./mkdirs'), - mkdirsSync: require('./mkdirs-sync'), - // alias - mkdirp: require('./mkdirs'), - mkdirpSync: require('./mkdirs-sync'), - ensureDir: require('./mkdirs'), - ensureDirSync: require('./mkdirs-sync') -} diff --git a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/mkdirs/mkdirs-sync.js b/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/mkdirs/mkdirs-sync.js deleted file mode 100644 index 2dc4f231b..000000000 --- a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/mkdirs/mkdirs-sync.js +++ /dev/null @@ -1,49 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var o777 = parseInt('0777', 8) - -function mkdirsSync (p, opts, made) { - if (!opts || typeof opts !== 'object') { - opts = { mode: opts } - } - - var mode = opts.mode - var xfs = opts.fs || fs - - if (mode === undefined) { - mode = o777 & (~process.umask()) - } - if (!made) made = null - - p = path.resolve(p) - - try { - xfs.mkdirSync(p, mode) - made = made || p - } catch (err0) { - switch (err0.code) { - case 'ENOENT' : - made = mkdirsSync(path.dirname(p), opts, made) - mkdirsSync(p, opts, 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 = xfs.statSync(p) - } catch (err1) { - throw err0 - } - if (!stat.isDirectory()) throw err0 - break - } - } - - return made -} - -module.exports = mkdirsSync diff --git a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/mkdirs/mkdirs.js b/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/mkdirs/mkdirs.js deleted file mode 100644 index 5bc91d8ee..000000000 --- a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/mkdirs/mkdirs.js +++ /dev/null @@ -1,54 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var o777 = parseInt('0777', 8) - -function mkdirs (p, opts, callback, made) { - if (typeof opts === 'function') { - callback = opts - opts = {} - } else if (!opts || typeof opts !== 'object') { - opts = { mode: opts } - } - - var mode = opts.mode - var xfs = opts.fs || fs - - if (mode === undefined) { - mode = o777 & (~process.umask()) - } - if (!made) made = null - - callback = callback || Function() - p = path.resolve(p) - - xfs.mkdir(p, mode, function (er) { - if (!er) { - made = made || p - return callback(null, made) - } - switch (er.code) { - case 'ENOENT': - if (path.dirname(p) === p) return callback(er) - mkdirs(path.dirname(p), opts, function (er, made) { - if (er) callback(er, made) - else mkdirs(p, opts, callback, 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: - xfs.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()) callback(er, made) - else callback(null, made) - }) - break - } - }) -} - -module.exports = mkdirs diff --git a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/move/index.js b/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/move/index.js deleted file mode 100644 index f28152f1a..000000000 --- a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/move/index.js +++ /dev/null @@ -1,161 +0,0 @@ -// most of this code was written by Andrew Kelley -// licensed under the BSD license: see -// https://github.com/andrewrk/node-mv/blob/master/package.json - -// this needs a cleanup - -var fs = require('graceful-fs') -var ncp = require('../copy/ncp') -var path = require('path') -var rimraf = require('rimraf') -var mkdirp = require('../mkdirs').mkdirs - -function mv (source, dest, options, callback) { - if (typeof options === 'function') { - callback = options - options = {} - } - - var shouldMkdirp = ('mkdirp' in options) ? options.mkdirp : true - var clobber = ('clobber' in options) ? options.clobber : false - - var limit = options.limit || 16 - - if (shouldMkdirp) { - mkdirs() - } else { - doRename() - } - - function mkdirs () { - mkdirp(path.dirname(dest), function (err) { - if (err) return callback(err) - doRename() - }) - } - - function doRename () { - if (clobber) { - fs.rename(source, dest, function (err) { - if (!err) return callback() - - if (err.code === 'ENOTEMPTY' || err.code === 'EEXIST') { - rimraf(dest, function (err) { - if (err) return callback(err) - options.clobber = false // just clobbered it, no need to do it again - mv(source, dest, options, callback) - }) - return - } - - // weird Windows shit - if (err.code === 'EPERM') { - setTimeout(function () { - rimraf(dest, function (err) { - if (err) return callback(err) - options.clobber = false - mv(source, dest, options, callback) - }) - }, 200) - return - } - - if (err.code !== 'EXDEV') return callback(err) - moveAcrossDevice(source, dest, clobber, limit, callback) - }) - } else { - fs.link(source, dest, function (err) { - if (err) { - if (err.code === 'EXDEV' || err.code === 'EISDIR' || err.code === 'EPERM') { - moveAcrossDevice(source, dest, clobber, limit, callback) - return - } - callback(err) - return - } - fs.unlink(source, callback) - }) - } - } -} - -function moveAcrossDevice (source, dest, clobber, limit, callback) { - fs.stat(source, function (err, stat) { - if (err) { - callback(err) - return - } - - if (stat.isDirectory()) { - moveDirAcrossDevice(source, dest, clobber, limit, callback) - } else { - moveFileAcrossDevice(source, dest, clobber, limit, callback) - } - }) -} - -function moveFileAcrossDevice (source, dest, clobber, limit, callback) { - var outFlags = clobber ? 'w' : 'wx' - var ins = fs.createReadStream(source) - var outs = fs.createWriteStream(dest, {flags: outFlags}) - - ins.on('error', function (err) { - ins.destroy() - outs.destroy() - outs.removeListener('close', onClose) - - // may want to create a directory but `out` line above - // creates an empty file for us: See #108 - // don't care about error here - fs.unlink(dest, function () { - // note: `err` here is from the input stream errror - if (err.code === 'EISDIR' || err.code === 'EPERM') { - moveDirAcrossDevice(source, dest, clobber, limit, callback) - } else { - callback(err) - } - }) - }) - - outs.on('error', function (err) { - ins.destroy() - outs.destroy() - outs.removeListener('close', onClose) - callback(err) - }) - - outs.once('close', onClose) - ins.pipe(outs) - - function onClose () { - fs.unlink(source, callback) - } -} - -function moveDirAcrossDevice (source, dest, clobber, limit, callback) { - var options = { - stopOnErr: true, - clobber: false, - limit: limit - } - - function startNcp () { - ncp(source, dest, options, function (errList) { - if (errList) return callback(errList[0]) - rimraf(source, callback) - }) - } - - if (clobber) { - rimraf(dest, function (err) { - if (err) return callback(err) - startNcp() - }) - } else { - startNcp() - } -} - -module.exports = { - move: mv -} diff --git a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/output/index.js b/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/output/index.js deleted file mode 100644 index e8f45f3ff..000000000 --- a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/output/index.js +++ /dev/null @@ -1,35 +0,0 @@ -var path = require('path') -var fs = require('graceful-fs') -var mkdir = require('../mkdirs') - -function outputFile (file, data, encoding, callback) { - if (typeof encoding === 'function') { - callback = encoding - encoding = 'utf8' - } - - var dir = path.dirname(file) - fs.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 (fs.existsSync(dir)) { - return fs.writeFileSync.apply(fs, arguments) - } - mkdir.mkdirsSync(dir) - fs.writeFileSync.apply(fs, arguments) -} - -module.exports = { - outputFile: outputFile, - outputFileSync: outputFileSync -} diff --git a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/remove/index.js b/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/remove/index.js deleted file mode 100644 index fce48a50f..000000000 --- a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/remove/index.js +++ /dev/null @@ -1,17 +0,0 @@ -var rimraf = require('rimraf') - -function removeSync (dir) { - return rimraf.sync(dir) -} - -function remove (dir, callback) { - return callback ? rimraf(dir, callback) : rimraf(dir, Function()) -} - -module.exports = { - remove: remove, - removeSync: removeSync, - // alias - delete: remove, - deleteSync: removeSync -} diff --git a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/streams/create-output-stream.js b/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/streams/create-output-stream.js deleted file mode 100644 index e6db2dd80..000000000 --- a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/streams/create-output-stream.js +++ /dev/null @@ -1,43 +0,0 @@ -var path = require('path') -var fs = require('fs') -var mkdir = require('../mkdirs') -var WriteStream = fs.WriteStream - -function createOutputStream (file, options) { - var dirExists = false - var dir = path.dirname(file) - options = options || {} - - // if fd is set with an actual number, file is created, hence directory is too - if (options.fd) { - return fs.createWriteStream(file, options) - } else { - // this hacks the WriteStream constructor from calling open() - options.fd = -1 - } - - var ws = new WriteStream(file, options) - - var oldOpen = ws.open - ws.open = function () { - ws.fd = null // set actual fd - if (dirExists) return oldOpen.call(ws) - - // this only runs once on first write - mkdir.mkdirs(dir, function (err) { - if (err) { - ws.destroy() - ws.emit('error', err) - return - } - dirExists = true - oldOpen.call(ws) - }) - } - - ws.open() - - return ws -} - -module.exports = createOutputStream diff --git a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/streams/index.js b/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/streams/index.js deleted file mode 100644 index 33be56e88..000000000 --- a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/streams/index.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - createOutputStream: require('./create-output-stream') -} diff --git a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/util/assign.js b/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/util/assign.js deleted file mode 100644 index 8e41f9a09..000000000 --- a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/util/assign.js +++ /dev/null @@ -1,14 +0,0 @@ -// simple mutable assign -function assign () { - var args = [].slice.call(arguments).filter(function (i) { return i }) - var dest = args.shift() - args.forEach(function (src) { - Object.keys(src).forEach(function (key) { - dest[key] = src[key] - }) - }) - - return dest -} - -module.exports = assign diff --git a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/util/utimes.js b/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/util/utimes.js deleted file mode 100644 index c99b010b4..000000000 --- a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/util/utimes.js +++ /dev/null @@ -1,69 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') -var os = require('os') - -// HFS, ext{2,3}, FAT do not, Node.js v0.10 does not -function hasMillisResSync () { - var tmpfile = path.join('millis-test-sync' + Date.now().toString() + Math.random().toString().slice(2)) - tmpfile = path.join(os.tmpdir(), tmpfile) - - // 550 millis past UNIX epoch - var d = new Date(1435410243862) - fs.writeFileSync(tmpfile, 'https://github.com/jprichardson/node-fs-extra/pull/141') - var fd = fs.openSync(tmpfile, 'r+') - fs.futimesSync(fd, d, d) - fs.closeSync(fd) - return fs.statSync(tmpfile).mtime > 1435410243000 -} - -function hasMillisRes (callback) { - var tmpfile = path.join('millis-test' + Date.now().toString() + Math.random().toString().slice(2)) - tmpfile = path.join(os.tmpdir(), tmpfile) - - // 550 millis past UNIX epoch - var d = new Date(1435410243862) - fs.writeFile(tmpfile, 'https://github.com/jprichardson/node-fs-extra/pull/141', function (err) { - if (err) return callback(err) - fs.open(tmpfile, 'r+', function (err, fd) { - if (err) return callback(err) - fs.futimes(fd, d, d, function (err) { - if (err) return callback(err) - fs.close(fd, function (err) { - if (err) return callback(err) - fs.stat(tmpfile, function (err, stats) { - if (err) return callback(err) - callback(null, stats.mtime > 1435410243000) - }) - }) - }) - }) - }) -} - -function timeRemoveMillis (timestamp) { - if (typeof timestamp === 'number') { - return Math.floor(timestamp / 1000) * 1000 - } else if (timestamp instanceof Date) { - return new Date(Math.floor(timestamp.getTime() / 1000) * 1000) - } else { - throw new Error('fs-extra: timeRemoveMillis() unknown parameter type') - } -} - -function utimesMillis (path, atime, mtime, callback) { - // if (!HAS_MILLIS_RES) return fs.utimes(path, atime, mtime, callback) - fs.open(path, 'r+', function (err, fd) { - if (err) return callback(err) - fs.futimes(fd, atime, mtime, function (err) { - if (err) return callback(err) - fs.close(fd, callback) - }) - }) -} - -module.exports = { - hasMillisRes: hasMillisRes, - hasMillisResSync: hasMillisResSync, - timeRemoveMillis: timeRemoveMillis, - utimesMillis: utimesMillis -} diff --git a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/walk/index.js b/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/walk/index.js deleted file mode 100644 index 3a52a01d5..000000000 --- a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/walk/index.js +++ /dev/null @@ -1,7 +0,0 @@ -var Walker = require('./walker') - -function walk (path, filter) { - return new Walker(path, filter)// .start() -} - -module.exports = walk diff --git a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/walk/walker.js b/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/walk/walker.js deleted file mode 100644 index eaf14ad57..000000000 --- a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/lib/walk/walker.js +++ /dev/null @@ -1,62 +0,0 @@ -var fs = require('fs') -var path = require('path') -var Readable = require('stream').Readable -var util = require('util') -var assign = require('../util/assign') - -function Walker (dir, filter, streamOptions) { - Readable.call(this, assign({ objectMode: true }, streamOptions)) - this.path = path.resolve(dir) - this.filter = filter - this.pending = 0 - this.start() -} -util.inherits(Walker, Readable) - -Walker.prototype.start = function () { - this.visit(this.path) - return this -} - -Walker.prototype.visit = function (item) { - this.pending++ - var self = this - - fs.lstat(item, function (err, stat) { - if (err) { - self.emit('error', err, {path: item, stat: stat}) - return self.finishItem() - } - - if (self.filter && !self.filter({path: item, stat: stat})) return self.finishItem() - - if (!stat.isDirectory()) { - self.push({ path: item, stat: stat }) - return self.finishItem() - } - - fs.readdir(item, function (err, items) { - if (err) { - self.emit('error', err, {path: item, stat: stat}) - return self.finishItem() - } - - self.push({path: item, stat: stat}) - items.forEach(function (part) { - self.visit(path.join(item, part)) - }) - self.finishItem() - }) - }) - return this -} - -Walker.prototype.finishItem = function () { - this.pending -= 1 - if (this.pending === 0) this.push(null) - return this -} - -Walker.prototype._read = function () { } - -module.exports = Walker diff --git a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/package.json b/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/package.json deleted file mode 100644 index aa1867aba..000000000 --- a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/fs-extra/package.json +++ /dev/null @@ -1,120 +0,0 @@ -{ - "_args": [ - [ - { - "raw": "fs-extra@0.23.1", - "scope": null, - "escapedName": "fs-extra", - "name": "fs-extra", - "rawSpec": "0.23.1", - "spec": "0.23.1", - "type": "version" - }, - "/home/volumio/volumio-plugins/plugins/music_service/squeezelite/node_modules/v-conf" - ] - ], - "_from": "fs-extra@0.23.1", - "_id": "fs-extra@0.23.1", - "_inCache": true, - "_location": "/v-conf/fs-extra", - "_nodeVersion": "2.1.0", - "_npmUser": { - "name": "jprichardson", - "email": "jprichardson@gmail.com" - }, - "_npmVersion": "2.10.1", - "_phantomChildren": {}, - "_requested": { - "raw": "fs-extra@0.23.1", - "scope": null, - "escapedName": "fs-extra", - "name": "fs-extra", - "rawSpec": "0.23.1", - "spec": "0.23.1", - "type": "version" - }, - "_requiredBy": [ - "/v-conf" - ], - "_resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.23.1.tgz", - "_shasum": "6611dba6adf2ab8dc9c69fab37cddf8818157e3d", - "_shrinkwrap": null, - "_spec": "fs-extra@0.23.1", - "_where": "/home/volumio/volumio-plugins/plugins/music_service/squeezelite/node_modules/v-conf", - "author": { - "name": "JP Richardson", - "email": "jprichardson@gmail.com" - }, - "bugs": { - "url": "https://github.com/jprichardson/node-fs-extra/issues" - }, - "dependencies": { - "graceful-fs": "^4.1.2", - "jsonfile": "^2.1.0", - "path-is-absolute": "^1.0.0", - "rimraf": "^2.2.8" - }, - "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.", - "devDependencies": { - "coveralls": "^2.11.2", - "istanbul": "^0.3.5", - "minimist": "^1.1.1", - "mocha": "^2.1.0", - "read-dir-files": "^0.1.1", - "secure-random": "^1.1.1", - "semver": "^4.3.6", - "standard": "4.x" - }, - "directories": {}, - "dist": { - "shasum": "6611dba6adf2ab8dc9c69fab37cddf8818157e3d", - "tarball": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.23.1.tgz" - }, - "gitHead": "ddc130ea23a1a4aaf8f6aec8a90229a42edfe535", - "homepage": "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", - "move" - ], - "license": "MIT", - "main": "./lib/index", - "maintainers": [ - { - "name": "jprichardson", - "email": "jprichardson@gmail.com" - } - ], - "name": "fs-extra", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/jprichardson/node-fs-extra.git" - }, - "scripts": { - "coverage": "istanbul cover test.js", - "coveralls": "npm run coverage && coveralls < coverage/lcov.info", - "test": "standard && node test.js", - "test-find": "find ./lib/**/__tests__ -name *.test.js | xargs mocha" - }, - "version": "0.23.1" -} diff --git a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/multimap/.jshintrc b/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/multimap/.jshintrc deleted file mode 100644 index 93da3d468..000000000 --- a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/multimap/.jshintrc +++ /dev/null @@ -1,41 +0,0 @@ -{ - "passfail" : false, - "maxerr" : 20, - "browser" : false, - "node" : true, - "debug" : false, - "devel" : true, - "es5" : false, - "strict" : false, - "globalstrict" : false, - "asi" : false, - "laxbreak" : false, - "bitwise" : false, - "boss" : true, - "curly" : false, - "eqeqeq" : false, - "eqnull" : false, - "evil" : true, - "expr" : true, - "forin" : false, - "immed" : true, - "latedef" : false, - "loopfunc" : true, - "noarg" : true, - "regexp" : true, - "regexdash" : false, - "scripturl" : true, - "shadow" : true, - "supernew" : false, - "undef" : false, - "newcap" : false, - "proto" : true, - "noempty" : true, - "nonew" : false, - "nomen" : false, - "onevar" : false, - "plusplus" : false, - "sub" : false, - "trailing" : false, - "white" : false -} \ No newline at end of file diff --git a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/multimap/.npmignore b/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/multimap/.npmignore deleted file mode 100644 index 37e0121c3..000000000 --- a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/multimap/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -.DS_Store -node_modules -*.log diff --git a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/multimap/.travis.yml b/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/multimap/.travis.yml deleted file mode 100644 index ee21a4a07..000000000 --- a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/multimap/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: node_js -node_js: - - "0.10" - - "0.11" - -script: npm run test \ No newline at end of file diff --git a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/multimap/README.md b/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/multimap/README.md deleted file mode 100644 index ba8ef67ac..000000000 --- a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/multimap/README.md +++ /dev/null @@ -1,130 +0,0 @@ -# Multimap - Map which Allow Multiple Values for the same Key - -[![NPM version](https://badge.fury.io/js/multimap.svg)](http://badge.fury.io/js/multimap) -[![Build Status](https://travis-ci.org/villadora/multi-map.png?branch=master)](https://travis-ci.org/villadora/multi-map) - -## Install - -```bash -npm install multimap --save -``` - -## Usage - - -If you'd like to use native version when it exists and fallback to polyfill if it doesn't, but without implementing `Map` on global scope, do: - -```javascript -var Multimap = require('multimap'); -var m = new Multimap(); -``` - -If the global es6 `Map` exists or `Multimap.Map` is set, `Multimap` will use the `Map` as inner store, that means Object can be used as key. - -```javascript -var Multimap = require('multimap'); - -// if harmony is on -/* nothing need to do */ -// or if you are using es6-shim -Multimap.Map = ShimMap; - -var m = new Multimap(); -var key = {}; -m.set(key, 'one'); - -``` - -Otherwise, an object will be used, all the keys will be transformed into string. - - -### In Modern Browser - -Just download the `index.js` as `Multimap.js`. - -``` - - -``` - -Or use as an AMD loader: - -``` -require(['./Multimap.js'], function (Multimap) { - var map = new Multimap([['a', 1], ['b', 2], ['c', 3]]); - map = map.set('b', 20); - map.get('b'); // [2, 20] -}); -``` - -* Browsers should support `Object.defineProperty` and `Array.prototype.forEach`. - - -## API - -Following shows how to use `Multimap`: - -```javascript -var Multimap = require('multimap'); - -var map = new Multimap([['a', 'one'], ['b', 1], ['a', 'two'], ['b', 2]]); - -map.size; // 4 - -map.get('a'); // ['one', 'two'] -map.get('b'); // [1, 2] - -map.has('a'); // true -map.has('foo'); // false - -map.has('a', 'one'); // true -map.has('b', 3); // false - -map.set('a', 'three'); -map.size; // 5 -map.get('a'); // ['one', 'two', 'three'] - -map.set('b', 3, 4); -map.size; // 7 - -map.delete('a', 'three'); // true -map.delete('x'); // false -map.delete('a', 'four'); // false -map.delete('b'); // true - -map.size; // 2 - -map.set('b', 1, 2); -map.size; // 4 - - -map.forEach(function (value, key) { - // iterates { 'one', 'a' }, { 'two', 'a' }, { 1, b }, { 2, 'b' } -}); - -map.forEachEntry(function (entry, key) { - // iterates {['one', 'two'], 'a' }, {[1, 2], 'b' } -}); - - -var keys = map.keys(); // iterator with ['a', 'b'] -keys.next().value; // 'a' -var values = map.values(); // iterator ['one', 'two', 1, 2] - -map.clear(); // undefined -map.size; // 0 -``` - - - - -## License - -(The MIT License) - -Copyright (c) 2013, Villa.Gao ; -All rights reserved. diff --git a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/multimap/index.js b/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/multimap/index.js deleted file mode 100644 index a6820f905..000000000 --- a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/multimap/index.js +++ /dev/null @@ -1,206 +0,0 @@ -"use strict"; - -/* global module, define */ - -function mapEach(map, operation){ - var keys = map.keys(); - var next; - while(!(next = keys.next()).done) { - operation(map.get(next.value), next.value, map); - } -} - -var Multimap = (function() { - var mapCtor; - if (typeof Map !== 'undefined') { - mapCtor = Map; - } - - function Multimap(iterable) { - var self = this; - - self._map = mapCtor; - - if (Multimap.Map) { - self._map = Multimap.Map; - } - - self._ = self._map ? new self._map() : {}; - - if (iterable) { - iterable.forEach(function(i) { - self.set(i[0], i[1]); - }); - } - } - - /** - * @param {Object} key - * @return {Array} An array of values, undefined if no such a key; - */ - Multimap.prototype.get = function(key) { - return this._map ? this._.get(key) : this._[key]; - }; - - /** - * @param {Object} key - * @param {Object} val... - */ - Multimap.prototype.set = function(key, val) { - var args = Array.prototype.slice.call(arguments); - - key = args.shift(); - - var entry = this.get(key); - if (!entry) { - entry = []; - if (this._map) - this._.set(key, entry); - else - this._[key] = entry; - } - - Array.prototype.push.apply(entry, args); - return this; - }; - - /** - * @param {Object} key - * @param {Object=} val - * @return {boolean} true if any thing changed - */ - Multimap.prototype.delete = function(key, val) { - if (!this.has(key)) - return false; - - if (arguments.length == 1) { - this._map ? (this._.delete(key)) : (delete this._[key]); - return true; - } else { - var entry = this.get(key); - var idx = entry.indexOf(val); - if (idx != -1) { - entry.splice(idx, 1); - return true; - } - } - - return false; - }; - - /** - * @param {Object} key - * @param {Object=} val - * @return {boolean} whether the map contains 'key' or 'key=>val' pair - */ - Multimap.prototype.has = function(key, val) { - var hasKey = this._map ? this._.has(key) : this._.hasOwnProperty(key); - - if (arguments.length == 1 || !hasKey) - return hasKey; - - var entry = this.get(key) || []; - return entry.indexOf(val) != -1; - }; - - - /** - * @return {Array} all the keys in the map - */ - Multimap.prototype.keys = function() { - if (this._map) - return makeIterator(this._.keys()); - - return makeIterator(Object.keys(this._)); - }; - - /** - * @return {Array} all the values in the map - */ - Multimap.prototype.values = function() { - var vals = []; - this.forEachEntry(function(entry) { - Array.prototype.push.apply(vals, entry); - }); - - return makeIterator(vals); - }; - - /** - * - */ - Multimap.prototype.forEachEntry = function(iter) { - mapEach(this, iter); - }; - - Multimap.prototype.forEach = function(iter) { - var self = this; - self.forEachEntry(function(entry, key) { - entry.forEach(function(item) { - iter(item, key, self); - }); - }); - }; - - - Multimap.prototype.clear = function() { - if (this._map) { - this._.clear(); - } else { - this._ = {}; - } - }; - - Object.defineProperty( - Multimap.prototype, - "size", { - configurable: false, - enumerable: true, - get: function() { - var total = 0; - - mapEach(this, function(value){ - total += value.length; - }); - - return total; - } - }); - - var safariNext; - - try{ - safariNext = new Function('iterator', 'makeIterator', 'var keysArray = []; for(var key of iterator){keysArray.push(key);} return makeIterator(keysArray).next;'); - }catch(error){ - // for of not implemented; - } - - function makeIterator(iterator){ - if(Array.isArray(iterator)){ - var nextIndex = 0; - - return { - next: function(){ - return nextIndex < iterator.length ? - {value: iterator[nextIndex++], done: false} : - {done: true}; - } - }; - } - - // Only an issue in safari - if(!iterator.next && safariNext){ - iterator.next = safariNext(iterator, makeIterator); - } - - return iterator; - } - - return Multimap; -})(); - - -if(typeof exports === 'object' && module && module.exports) - module.exports = Multimap; -else if(typeof define === 'function' && define.amd) - define(function() { return Multimap; }); diff --git a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/multimap/package.json b/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/multimap/package.json deleted file mode 100644 index 27240bfa7..000000000 --- a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/multimap/package.json +++ /dev/null @@ -1,94 +0,0 @@ -{ - "_args": [ - [ - { - "raw": "multimap@1.0.1", - "scope": null, - "escapedName": "multimap", - "name": "multimap", - "rawSpec": "1.0.1", - "spec": "1.0.1", - "type": "version" - }, - "/home/volumio/volumio-plugins/plugins/music_service/squeezelite/node_modules/v-conf" - ] - ], - "_from": "multimap@1.0.1", - "_id": "multimap@1.0.1", - "_inCache": true, - "_location": "/v-conf/multimap", - "_nodeVersion": "2.3.4", - "_npmUser": { - "name": "korynunn", - "email": "knunn187@gmail.com" - }, - "_npmVersion": "2.12.1", - "_phantomChildren": {}, - "_requested": { - "raw": "multimap@1.0.1", - "scope": null, - "escapedName": "multimap", - "name": "multimap", - "rawSpec": "1.0.1", - "spec": "1.0.1", - "type": "version" - }, - "_requiredBy": [ - "/v-conf" - ], - "_resolved": "https://registry.npmjs.org/multimap/-/multimap-1.0.1.tgz", - "_shasum": "ff671441fd95f254ed75466a2f3121c04ed2cf5f", - "_shrinkwrap": null, - "_spec": "multimap@1.0.1", - "_where": "/home/volumio/volumio-plugins/plugins/music_service/squeezelite/node_modules/v-conf", - "author": { - "name": "villa.gao", - "email": "jky239@gmail.com" - }, - "bugs": { - "url": "https://github.com/villadora/multi-map/issues" - }, - "dependencies": {}, - "description": "multi-map which allow multiple values for the same key", - "devDependencies": { - "chai": "~1.7.2", - "es6-shim": "^0.13.0", - "jshint": "~2.1.9" - }, - "directories": {}, - "dist": { - "shasum": "ff671441fd95f254ed75466a2f3121c04ed2cf5f", - "tarball": "https://registry.npmjs.org/multimap/-/multimap-1.0.1.tgz" - }, - "gitHead": "2976c4cfb2db987952070538eca0d63ee16bb7ba", - "homepage": "https://github.com/villadora/multi-map#readme", - "keywords": [ - "keys", - "map", - "multiple" - ], - "license": "MIT", - "main": "index.js", - "maintainers": [ - { - "name": "korynunn", - "email": "knunn187@gmail.com" - }, - { - "name": "villadora", - "email": "jky239@gmail.com" - } - ], - "name": "multimap", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git://github.com/villadora/multi-map.git" - }, - "scripts": { - "lint": "jshint *.js test/*.js", - "test": "npm run lint; node test/index.js;node test/es6map.js" - }, - "version": "1.0.1" -} diff --git a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/multimap/test/es6map.js b/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/multimap/test/es6map.js deleted file mode 100644 index c7c0c2311..000000000 --- a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/multimap/test/es6map.js +++ /dev/null @@ -1,86 +0,0 @@ -"use strict"; - -var assert = require('chai').assert; -require('es6-shim'); - -var Multimap = require('..'); - -var map = new Multimap([ - ['a', 'one'], - ['b', 1], - ['a', 'two'], - ['b', 2] -]); - -assert.equal(map.size, 4); - -assert.equal(map.get('a').length, 2); -assert.equal(map.get('a')[0], 'one'); // ['one', 'two'] -assert.equal(map.get('a')[1], 'two'); // ['one', 'two'] - -assert.equal(map.get('b').length, 2); -assert.equal(map.get('b')[0], 1); // [1, 2] -assert.equal(map.get('b')[1], 2); // [1, 2] - - -assert(map.has('a'), "map contains key 'a'"); -assert(!map.has('foo'), "map does not contain key 'foo'"); - -assert(map.has('a', 'one'), "map contains entry 'a'=>'one'"); -assert(!map.has('b', 3), "map does not contain entry 'b'=>3"); - -map.set('a', 'three'); - -assert.equal(map.size, 5); -assert.equal(map.get('a').length, 3); // ['one', 'two', 'three'] - -map.set('b', 3, 4); -assert.equal(map.size, 7); - -assert(map.delete('a', 'three'), "delete 'a'=>'three'"); -assert.equal(map.size, 6); -assert(!map.delete('x'), "empty 'x' for delete"); -assert(!map.delete('a', 'four'), "no such entry 'a'=>'four'"); -assert(map.delete('b'), "delete all 'b'"); - -assert.equal(map.size, 2); - -map.set('b', 1, 2); -assert.equal(map.size, 4); // 4 - -var cnt = 0; -map.forEach(function(value, key) { - // iterates { 'a', 'one' }, { 'a', 'two' }, { 'b', 1 }, { 'b', 2 } - cnt++; - assert(key == 'a' || key == 'b', "key must be either 'a' or 'b'"); -}); - -assert.equal(cnt, 4); - -cnt = 0; -map.forEachEntry(function(entry, key) { - // iterates { 'a', ['one', 'two'] }, { 'b', [1, 2] } - cnt++; - assert(key == 'a' || key == 'b', "key must be either 'a' or 'b'"); - assert.equal(entry.length, 2); -}); - -assert.equal(cnt, 2); - - - -var keys = map.keys(); // ['a', 'b'] -assert.equal(keys.next().value, 'a'); -assert.equal(keys.next().value, 'b'); -assert(keys.next().done); - -var values = map.values(); // ['one', 'two', 1, 2] -assert.equal(values.next().value, 'one'); -assert.equal(values.next().value, 'two'); -assert.equal(values.next().value, 1); -assert.equal(values.next().value, 2); -assert(values.next().done); - -map.clear(); - -assert.equal(map.size, 0); diff --git a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/multimap/test/index.js b/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/multimap/test/index.js deleted file mode 100644 index 6bfa10565..000000000 --- a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/multimap/test/index.js +++ /dev/null @@ -1,84 +0,0 @@ -"use strict"; - -var assert = require('chai').assert; -var Multimap = require('..'); - -var map = new Multimap([ - ['a', 'one'], - ['b', 1], - ['a', 'two'], - ['b', 2] -]); - -assert.equal(map.size, 4); - -assert.equal(map.get('a').length, 2); -assert.equal(map.get('a')[0], 'one'); // ['one', 'two'] -assert.equal(map.get('a')[1], 'two'); // ['one', 'two'] - -assert.equal(map.get('b').length, 2); -assert.equal(map.get('b')[0], 1); // [1, 2] -assert.equal(map.get('b')[1], 2); // [1, 2] - - -assert(map.has('a'), "map contains key 'a'"); -assert(!map.has('foo'), "map does not contain key 'foo'"); - -assert(map.has('a', 'one'), "map contains entry 'a'=>'one'"); -assert(!map.has('b', 3), "map does not contain entry 'b'=>3"); - -map.set('a', 'three'); - -assert.equal(map.size, 5); -assert.equal(map.get('a').length, 3); // ['one', 'two', 'three'] - -map.set('b', 3, 4); -assert.equal(map.size, 7); - -assert(map.delete('a', 'three'), "delete 'a'=>'three'"); -assert.equal(map.size, 6); -assert(!map.delete('x'), "empty 'x' for delete"); -assert(!map.delete('a', 'four'), "no such entry 'a'=>'four'"); -assert(map.delete('b'), "delete all 'b'"); - -assert.equal(map.size, 2); - -map.set('b', 1, 2); -assert.equal(map.size, 4); // 4 - -var cnt = 0; -map.forEach(function(value, key) { - // iterates { 'a', 'one' }, { 'a', 'two' }, { 'b', 1 }, { 'b', 2 } - cnt++; - assert(key == 'a' || key == 'b', "key must be either 'a' or 'b'"); -}); - -assert.equal(cnt, 4); - -cnt = 0; -map.forEachEntry(function(entry, key) { - // iterates { 'a', ['one', 'two'] }, { 'b', [1, 2] } - cnt++; - assert(key == 'a' || key == 'b', "key must be either 'a' or 'b'"); - assert.equal(entry.length, 2); -}); - -assert.equal(cnt, 2); - - -var keys = map.keys(); // ['a', 'b'] -assert.equal(keys.next().value, 'a'); -assert.equal(keys.next().value, 'b'); -assert(keys.next().done); - -var values = map.values(); // ['one', 'two', 1, 2] -assert.equal(values.next().value, 'one'); -assert.equal(values.next().value, 'two'); -assert.equal(values.next().value, 1); -assert.equal(values.next().value, 2); -assert(values.next().done); - - -map.clear(); - -assert.equal(map.size, 0); diff --git a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/multimap/test/test.html b/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/multimap/test/test.html deleted file mode 100644 index 899d9de89..000000000 --- a/plugins/music_service/squeezelite/node_modules/v-conf/node_modules/multimap/test/test.html +++ /dev/null @@ -1,92 +0,0 @@ - - - MultiMap Tests - - - - - - - diff --git a/plugins/music_service/squeezelite/node_modules/v-conf/package.json b/plugins/music_service/squeezelite/node_modules/v-conf/package.json deleted file mode 100644 index 332c5ee27..000000000 --- a/plugins/music_service/squeezelite/node_modules/v-conf/package.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "_args": [ - [ - { - "raw": "v-conf@^0.10.0", - "scope": null, - "escapedName": "v-conf", - "name": "v-conf", - "rawSpec": "^0.10.0", - "spec": ">=0.10.0 <0.11.0", - "type": "range" - }, - "/home/volumio/volumio-plugins/plugins/music_service/squeezelite" - ] - ], - "_from": "v-conf@>=0.10.0 <0.11.0", - "_id": "v-conf@0.10.0", - "_inCache": true, - "_location": "/v-conf", - "_nodeVersion": "0.12.2", - "_npmOperationalInternal": { - "host": "packages-6-west.internal.npmjs.com", - "tmp": "tmp/v-conf-0.10.0.tgz_1455732273866_0.7313767410814762" - }, - "_npmUser": { - "name": "fanciulli", - "email": "fanciulli@gmail.com" - }, - "_npmVersion": "2.7.4", - "_phantomChildren": { - "graceful-fs": "4.1.11", - "jsonfile": "2.4.0", - "path-is-absolute": "1.0.1", - "rimraf": "2.6.2" - }, - "_requested": { - "raw": "v-conf@^0.10.0", - "scope": null, - "escapedName": "v-conf", - "name": "v-conf", - "rawSpec": "^0.10.0", - "spec": ">=0.10.0 <0.11.0", - "type": "range" - }, - "_requiredBy": [ - "/" - ], - "_resolved": "https://registry.npmjs.org/v-conf/-/v-conf-0.10.0.tgz", - "_shasum": "ef401b8e7fea1eab6140f3444b8e1b5c6e4b6faa", - "_shrinkwrap": null, - "_spec": "v-conf@^0.10.0", - "_where": "/home/volumio/volumio-plugins/plugins/music_service/squeezelite", - "author": { - "name": "Massimiliano Fanciulli" - }, - "bugs": { - "url": "https://github.com/fanciulli/v-conf/issues" - }, - "dependencies": { - "fs-extra": "0.23.1", - "multimap": "1.0.1" - }, - "description": "A useful library for handling configuration parameters", - "devDependencies": {}, - "directories": {}, - "dist": { - "shasum": "ef401b8e7fea1eab6140f3444b8e1b5c6e4b6faa", - "tarball": "https://registry.npmjs.org/v-conf/-/v-conf-0.10.0.tgz" - }, - "gitHead": "e5b30a70f972153b572d9d0aa3c26bba63e754bf", - "homepage": "https://github.com/fanciulli/v-conf", - "keywords": [ - "json", - "configuration", - "conf" - ], - "license": "ISC", - "main": "index.js", - "maintainers": [ - { - "name": "fanciulli", - "email": "fanciulli@gmail.com" - } - ], - "name": "v-conf", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/fanciulli/v-conf.git" - }, - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "version": "0.10.0" -} diff --git a/plugins/music_service/squeezelite/node_modules/v-conf/testConfig.json b/plugins/music_service/squeezelite/node_modules/v-conf/testConfig.json deleted file mode 100644 index 323af1781..000000000 --- a/plugins/music_service/squeezelite/node_modules/v-conf/testConfig.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "callback": { - "b": { - "type": "string", - "value": "BBB" - }, - "a": { - "type": "string", - "value": "########" - } - }, - "debug": { - "type": "boolean", - "value": true - }, - "env": { - "type": "string", - "value": "PRODUCTION" - }, - "structured": { - "a": { - "type": "number", - "value": 500 - }, - "b": { - "type": "number", - "value": 1000 - } - }, - "keys": { - "first": { - "type": "number", - "value": 1 - }, - "second": { - "type": "number", - "value": 2 - }, - "third": { - "type": "boolean", - "value": true - }, - "fourth": { - "type": "boolean", - "value": false - }, - "fifth": { - "sub-key-1": { - "type": "boolean", - "value": true - }, - "sub-key-2": { - "type": "boolean", - "value": false - } - } - }, - "music_services": { - "dirble": { - "enabled": { - "type": "boolean", - "value": false - } - } - }, - "delete": { - "fifth": { - "sub-key-2": { - "type": "boolean", - "value": false - } - } - } -} diff --git a/plugins/music_service/squeezelite/node_modules/wireless-tools/.npmignore b/plugins/music_service/squeezelite/node_modules/wireless-tools/.npmignore deleted file mode 100644 index 123ae94d0..000000000 --- a/plugins/music_service/squeezelite/node_modules/wireless-tools/.npmignore +++ /dev/null @@ -1,27 +0,0 @@ -# Logs -logs -*.log - -# Runtime data -pids -*.pid -*.seed - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage - -# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (http://nodejs.org/api/addons.html) -build/Release - -# Dependency directory -# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git -node_modules diff --git a/plugins/music_service/squeezelite/node_modules/wireless-tools/.travis.yml b/plugins/music_service/squeezelite/node_modules/wireless-tools/.travis.yml deleted file mode 100644 index 679f3533b..000000000 --- a/plugins/music_service/squeezelite/node_modules/wireless-tools/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: node_js -node_js: stable -sudo: false - -after_success: - - npm run codeclimate diff --git a/plugins/music_service/squeezelite/node_modules/wireless-tools/LICENSE b/plugins/music_service/squeezelite/node_modules/wireless-tools/LICENSE deleted file mode 100644 index 21c8e4637..000000000 --- a/plugins/music_service/squeezelite/node_modules/wireless-tools/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Christopher M. Baker - -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/plugins/music_service/squeezelite/node_modules/wireless-tools/README.md b/plugins/music_service/squeezelite/node_modules/wireless-tools/README.md deleted file mode 100644 index 2c2624752..000000000 --- a/plugins/music_service/squeezelite/node_modules/wireless-tools/README.md +++ /dev/null @@ -1,738 +0,0 @@ -# Wireless tools for Node.js -[![npm version](https://badge.fury.io/js/wireless-tools.svg)](http://badge.fury.io/js/wireless-tools) -[![release version](https://img.shields.io/badge/version-0.19.0-blue.svg)](https://github.com/bakerface/wireless-tools) -[![build status](https://travis-ci.org/bakerface/wireless-tools.svg?branch=master)](https://travis-ci.org/bakerface/wireless-tools) -[![code climate](https://codeclimate.com/github/bakerface/wireless-tools/badges/gpa.svg)](https://codeclimate.com/github/bakerface/wireless-tools) -[![test coverage](https://codeclimate.com/github/bakerface/wireless-tools/badges/coverage.svg)](https://codeclimate.com/github/bakerface/wireless-tools/coverage) -[![github issues](https://img.shields.io/github/issues/bakerface/wireless-tools.svg)](https://github.com/bakerface/wireless-tools/issues) -[![dependencies](https://david-dm.org/bakerface/wireless-tools.svg)](https://david-dm.org/bakerface/wireless-tools) -[![dev dependencies](https://david-dm.org/bakerface/wireless-tools/dev-status.svg)](https://david-dm.org/bakerface/wireless-tools#info=devDependencies) -[![downloads](http://img.shields.io/npm/dm/wireless-tools.svg)](https://www.npmjs.com/package/wireless-tools) - -## Table of Contents -- [hostapd](#hostapd) - configure an access point - - [hostapd.enable(options, callback)](#hostapdenableoptions-callback) - host an access point - - [hostapd.disable(interface, callback)](#hostapddisableinterface-callback) - stop hosting an access point -- [ifconfig](#ifconfig) - configure network interfaces - - [ifconfig.status(callback)](#ifconfigstatuscallback) - status of all network interfaces - - [ifconfig.status(interface, callback)](#ifconfigstatusinterface-callback) - status of a network interface - - [ifconfig.down(interface, callback)](#ifconfigdowninterface-callback) - take down a network interface - - [ifconfig.up(options, callback)](#ifconfigupoptions-callback) - bring up a network interface -- [iwconfig](#iwconfig) - configure wireless network interfaces - - [iwconfig.status(callback)](#iwconfigstatuscallback) - status of all wireless network interfaces - - [iwconfig.status(interface, callback)](#iwconfigstatusinterface-callback) - status of a wireless network interface -- [iwlist](#iwlist) - query wireless network interfaces - - [iwlist.scan(options, callback)](#iwlistscaninterface-callback) - scan for wireless networks -- [udhcpc](#udhcpc) - configure a dhcp client - - [udhcpc.enable(options, callback)](#udhcpcenableoptions-callback) - start a dhcp client - - [udhcpc.disable(interface, callback)](#udhcpcdisableinterface-callback) - stop a dhcp client -- [udhcpd](#udhcpd) - configure a dhcp server - - [udhcpd.enable(options, callback)](#udhcpdenableoptions-callback) - start a dhcp server - - [udhcpd.disable(interface, callback)](#udhcpddisableinterface-callback) - stop a dhcp server -- [wpa_cli](#wpa_cli) - send commands to wpa_supplicant using wpa_cli - - [wpa_cli.status(interface, callback)](#wpa_clistatusinterface-callback) - get status of wpa - - [wpa_cli.bssid(interface, ap, ssid, callback)](#wpa_clibssidinterface-ap-ssid-callback) - set preferred bssid for ssid - - [wpa_cli.reassociate(interface, callback)](#wpa_clireassociateinterface-callback) - tell wpa_supplicant to reassociate to an access points - - [wpa_cli.set(interface, variable, value, callback)](#wpa_clisetinterface-variable-value-callback) - set variable to value - - [wpa_cli.add_network(interface, callback)](#wpa_cliadd_networkinterface-callback) - add network - - [wpa_cli.set_network(interface, id, variable, value, callback)](#wpa_cliset_networkinterface-id-variable-value-callback) - set network variables - - [wpa_cli.enable_network(interface, id, callback)](#wpa_clienable_networkinterface-id-callback) - enable network - - [wpa_cli.disable_network(interface, id, callback)](#wpa_clidisable_networkinterface-id-callback) - disable network - - [wpa_cli.remove_network(interface, id, callback)](#wpa_cliremove_networkinterface-id-callback) - remove network - - [wpa_cli.select_network(interface, id, callback)](#wpa_cliselect_networkinterface-id-callback) - select network - - [wpa_cli.scan(interface, callback)](#wpa_cliscaninterface-callback) - new BSS scan - - [wpa_cli.scan_results(interface, callback)](#wpa_cliscan_resultsinterface-callback) - results of latest BSS scan - - [wpa_cli.save_config(interface, callback)](#wpa_clisave_configinterface-callback) - saves the current configuration -- [wpa_supplicant](#wpa_supplicant) - configure a wireless network connection - - [wpa_supplicant.enable(options, callback)](#wpa_supplicantenableoptions-callback) - connect to a wireless network - - [wpa_supplicant.disable(interface, callback)](#wpa_supplicantdisableinterface-callback) - disconnect from a wireless network - - [wpa_supplicant.manual(options, callback)](#wpa_supplicantmanualoptions-callback) - start wpa_supplicant in a way it can receive commands from wpa_cli -- [iw](#iw) - get and set parameters using `iw`, the interface for nl80211 interfaces - - [iw.scan(options, callback)](#iwscaninterface-callback) - scan for wireless networks - -# hostapd -The **hostapd** command is used to configure wireless access points. - -## hostapd.enable(options, callback) -The **hostapd enable** command is used to host an access point on a specific wireless interface. - -``` javascript -var hostapd = require('wireless-tools/hostapd'); - -var options = { - channel: 6, - driver: 'rtl871xdrv', - hw_mode: 'g', - interface: 'wlan0', - ssid: 'RaspberryPi', - wpa: 2, - wpa_passphrase: 'raspberry' -}; - -hostapd.enable(options, function(err) { - // the access point was created -}); -``` - -## hostapd.disable(interface, callback) -The **hostapd disable** command is used to stop hosting an access point on a specific wireless interface. - -``` javascript -var hostapd = require('wireless-tools/hostapd'); - -hostapd.disable('wlan0', function(err) { - // no longer hosting the access point -}); -``` - -# ifconfig -The **ifconfig** command is used to configure network interfaces. - -## ifconfig.status(callback) -The **ifconfig status** command is used to query the status of all configured interfaces. - -``` javascript -var ifconfig = require('wireless-tools/ifconfig'); - -ifconfig.status(function(err, status) { - console.log(status); -}); - -// => -[ - { - interface: 'eth0', - link: 'ethernet', - address: 'b8:27:eb:da:52:ad', - ipv4_address: '192.168.1.2', - ipv4_broadcast: '192.168.1.255', - ipv4_subnet_mask: '255.255.255.0', - up: true, - broadcast: true, - running: true, - multicast: true - }, - { - interface: 'lo', - link: 'local', - ipv4_address: '127.0.0.1', - ipv4_subnet_mask: '255.0.0.0', - up: true, - running: true, - loopback: true - }, - { - interface: 'wlan0', - link: 'ethernet', - address: '00:0b:81:95:12:21', - ipv4_address: '192.168.10.1', - ipv4_broadcast: '192.168.10.255', - ipv4_subnet_mask: '255.255.255.0', - up: true, - broadcast: true, - multicast: true - } -] -``` - -## ifconfig.status(interface, callback) -The **ifconfig interface status** command is used to query the status of a specific interface. - -``` javascript -var ifconfig = require('wireless-tools/ifconfig'); - -ifconfig.status('eth0', function(err, status) { - console.log(status); -}); - -// => -{ - interface: 'eth0', - link: 'ethernet', - address: 'b8:27:eb:da:52:ad', - ipv4_address: '192.168.1.2', - ipv4_broadcast: '192.168.1.255', - ipv4_subnet_mask: '255.255.255.0', - up: true, - broadcast: true, - running: true, - multicast: true -} -``` - -## ifconfig.down(interface, callback) -The **ifconfig down** command is used to take down an interface that is up. - -``` javascript -var ifconfig = require('wireless-tools/ifconfig'); - -ifconfig.down('wlan0', function(err) { - // the interface is down -}); -``` - -## ifconfig.up(options, callback) -The **ifconfig up** command is used to bring up an interface with the specified configuration. - -``` javascript -var ifconfig = require('wireless-tools/ifconfig'); - -var options = { - interface: 'wlan0', - ipv4_address: '192.168.10.1', - ipv4_broadcast: '192.168.10.255', - ipv4_subnet_mask: '255.255.255.0' -}; - -ifconfig.up(options, function(err) { - // the interface is up -}); -``` - -# iwconfig -The **iwconfig** command is used to configure wireless network interfaces. - -## iwconfig.status(callback) -The **iwconfig status** command is used to query the status of all configured wireless interfaces. - -``` javascript -var iwconfig = require('wireless-tools/iwconfig'); - -iwconfig.status(function(err, status) { - console.log(status); -}); - -// => -[ - { - interface: 'wlan0', - access_point: '00:0b:81:95:12:21', - frequency: 2.437, - ieee: '802.11bg', - mode: 'master', - noise: 0, - quality: 77, - sensitivity: 0, - signal: 50, - ssid: 'RaspberryPi' - }, - { - interface: 'wlan1', - frequency: 2.412, - mode: 'auto', - noise: 0, - quality: 0, - sensitivity: 0, - signal: 0, - unassociated: true - } -] -``` - -## iwconfig.status(interface, callback) -The **iwconfig interface status** command is used to query the status of a specific wireless interface. - -``` javascript -var iwconfig = require('wireless-tools/iwconfig'); - -iwconfig.status('wlan0', function(err, status) { - console.log(status); -}); - -// => -{ - interface: 'wlan0', - access_point: '00:0b:81:95:12:21', - frequency: 2.437, - ieee: '802.11bg', - mode: 'master', - noise: 0, - quality: 77, - sensitivity: 0, - signal: 50, - ssid: 'RaspberryPi' -} -``` - -# iwlist -The **iwlist** command is used to get detailed information from a wireless interface. - -## iwlist.scan(interface, callback) -The **iwlist scan** command is used to scan for wireless networks visible to a wireless interface. For convenience, the networks are sorted by signal strength. - -``` javascript -var iwlist = require('wireless-tools/iwlist'); - -iwlist.scan('wlan0', function(err, networks) { - console.log(networks); -}); - -iwlist.scan({ iface : 'wlan0', show_hidden : true }, function(err, networks) { - console.log(networks); -}); - -// => -[ - { - address: '00:0b:81:ab:14:22', - ssid: 'BlueberryPi', - mode: 'master', - frequency: 2.437, - channel: 6, - security: 'wpa', - quality: 48, - signal: 87 - }, - { - address: '00:0b:81:95:12:21', - ssid: 'RaspberryPi', - mode: 'master', - frequency: 2.437, - channel: 6, - security: 'wpa2', - quality: 58, - signal: 83 - }, - { - address: '00:0b:81:cd:f2:04', - ssid: 'BlackberryPi', - mode: 'master', - frequency: 2.437, - channel: 6, - security: 'wep', - quality: 48, - signal: 80 - }, - { - address: '00:0b:81:fd:42:14', - ssid: 'CranberryPi', - mode: 'master', - frequency: 2.437, - channel: 6, - security: 'open', - quality: 32, - signal: 71 - } -] - -[ - { - address: '00:0b:81:ab:14:22', - ssid: 'BlueberryPi', - mode: 'master', - frequency: 2.437, - channel: 6, - security: 'wpa', - quality: 48, - signal: 87 - }, - { - address: '00:0b:81:95:12:21', - ssid: 'RaspberryPi', - mode: 'master', - frequency: 2.437, - channel: 6, - security: 'wpa2', - quality: 58, - signal: 83 - }, - { - address: '00:0b:81:cd:f2:04', - ssid: 'BlackberryPi', - mode: 'master', - frequency: 2.437, - channel: 6, - security: 'wep', - quality: 48, - signal: 80 - }, - { - address: '00:0b:81:fd:42:14', - ssid: 'CranberryPi', - mode: 'master', - frequency: 2.437, - channel: 6, - security: 'open', - quality: 32, - signal: 71 - }, - { - address: '2c:c5:d3:02:ae:4c', - channel: 100, - frequency: 5.5, - mode: 'master', - quality: 66, - signal: -44, - security: 'wpa2' - } -] -``` - -# udhcpc -The **udhcpc** command is used to configure a dhcp client for a network interface. - -## udhcpc.enable(options, callback) -The **udhcpc enable** command is used to start a dhcp client on a specific network interface. - -``` javascript -var udhcpc = require('wireless-tools/udhcpc'); - -var options = { - interface: 'wlan0' -}; - -udhcpc.enable(options, function(err) { - // the dhcp client was started -}); -``` - -## udhcpc.disable(interface, callback) -The **udhcpc disable** command is used to stop a dhcp client on a specific network interface. - -``` javascript -var udhcpc = require('wireless-tools/udhcpc'); - -udhcpc.disable('wlan0', function(err) { - // the dhcp client was stopped -}); -``` - -# udhcpd -The **udhcpd** command is used to configure a dhcp server for a network interface. - -## udhcpd.enable(options, callback) -The **udhcpd enable** command is used to start a dhcp server on a specific network interface. - -``` javascript -var udhcpd = require('wireless-tools/udhcpd'); - -var options = { - interface: 'wlan0', - start: '192.168.10.100', - end: '192.168.10.200', - option: { - router: '192.168.10.1', - subnet: '255.255.255.0', - dns: [ '4.4.4.4', '8.8.8.8' ] - } -}; - -udhcpd.enable(options, function(err) { - // the dhcp server was started -}); -``` - -## udhcpd.disable(interface, callback) -The **udhcpd disable** command is used to stop a dhcp server on a specific network interface. - -``` javascript -var udhcpd = require('wireless-tools/udhcpd'); - -udhcpd.disable('wlan0', function(err) { - // the dhcp server was stopped -}); -``` - -# wpa_cli -The **wpa_cli** command is used to setup what wpa_supplicant must do to connect to a wireless network connection for a network interface. - -Most of wpa_cli commands return either 'OK' or 'FAIL' (and the exit status is -always 0). Because of this, all 'FAIL' responses will return and callback with an error. - -Responses containing an 'OK' result only means than wpa_supplicant had received -the command. You must poll wpa_supplicant (or other commands like iwconfig) to be sure that the command was actually applied by wpa_supplicant. - -## wpa_cli.status(interface, callback) -The **wpa_cli status** command is used to get the current status of wpa_supplicant on a specific network interface. - -``` javascript -var wpa_cli = require('wireless-tools/wpa_cli'); - -wpa_cli.status('wlan0', function(err, status) { - console.dir(status); -}); -``` - -``` javascript -// => -{ - bssid: '2c:f5:d3:02:ea:d9', - frequency: 2412, - mode: 'station', - key_mgmt: 'wpa2-psk', - ssid: 'Fake-Wifi', - pairwise_cipher: 'CCMP', - group_cipher: 'CCMP', - p2p_device_address: 'e4:28:9c:a8:53:72', - wpa_state: 'COMPLETED', - ip: '10.34.141.168', - mac: 'e4:28:9c:a8:53:72', - uuid: 'e1cda789-8c88-53e8-ffff-31c304580c1e', - id: 0 -} -``` -## wpa_cli.bssid(interface, ap, ssid, callback) -The **wpa_cli bssid** command is used to set the preferred access points for an specific ssid on a specific network interface. - -``` javascript -var wpa_cli = require('wireless-tools/wpa_cli'); - -wpa_cli.bssid('wlan0', '2c:f5:d3:02:ea:dd', 'Fake-Wifi', function(err, data){ - // this is correct usage - console.dir(data); -}); -``` -## wpa_cli.reassociate(interface, callback) -The **wpa_cli reassociate** command is used to instruct wpa_supplicant to reassociate to access points for an SSID on a specific network interface. - -``` javascript -var wpa_cli = require('wireless-tools/wpa_cli'); - -wpa_cli.bssid('wlan0', 'Fake-Wifi', '2c:f5:d3:02:ea:dd', function(err, data){ - // our usage is wrong so an error is triggered - if (err) { - console.dir(err); - // attempt to reassociate - wpa_cli.reassociate('wlan0', function(err, data) { - console.dir(data); - }); - } -}); -``` -## wpa_cli.set(interface, variable, value, callback) -The **wpa_cli set** command is used to set wpa_supplicant parameters to a value on a specific network interface. - -## wpa_cli.add_network(interface, callback) -The **wpa_cli add_network** command is used to create a new network entry on a specific network interface. -It will return on success the id of the new network - -## wpa_cli.set_network(interface, id, variable, value, callback) -The **wpa_cli set_network** command is used to set variables for a network on a specific network interface. - -## wpa_cli.enable_network(interface, id, callback) -The **wpa_cli enable_network** command is used to enable a network on a specific network interface. - -## wpa_cli.disable_network(interface, id, callback) -The **wpa_cli disable_network** command is used to disable a network on a specific network interface. - -## wpa_cli.remove_network(interface, id, callback) -The **wpa_cli remove_network** command is used to remove a network on a specific network interface. - -## wpa_cli.select_network(interface, id, callback) -The **wpa_cli select_network** command is used to select a specific network on a specific network interface and -disable all others. - -``` javascript -var wpa_cli = require('wireless-tools/wpa_cli'); - -wpa_cli.select_network('wlan0', 0, function(err, data){ - if (err) { - // most likely the set values for the specified id are wrong - console.dir(err); - } else { - // successfully connected to the new network - console.dir(data); - } -}); -``` -## wpa_cli.scan(interface, callback) -The **wpa_cli scan** is used to request a new BSS scan on a specific network interface. - -## wpa_cli.scan_results(interface, callback) -The **wpa_cli scan_results** is used to return the results of the latest BSS scan - that was run on a specific network interface. - -``` javascript -var wpa_cli = require('wireless-tools/wpa_cli'); - -wpa_cli.scan('wlan0', function(err, data){ - wpa_cli.scan_results('wlan0', function(err, data) { - // returns the results of the BSS scan once it completes - console.dir(data); - } -}); -``` - -``` javascript -=> -[ - { - bssid: '2c:f5:d3:02:ea:d9', - frequency: 2472, - signalLevel: -31, - flags: '[WPA-PSK-CCMP+TKIP][WPA2-PSK-CCMP+TKIP][ESS]', - ssid: 'FakeWifi' - }, - { - bssid: '2c:f5:d3:02:ea:d9', - frequency: 2472, - signalLevel: -31, - flags: '[WPA-PSK-CCMP+TKIP][WPA2-PSK-CCMP+TKIP][ESS]', - ssid: 'FakeWifi2' - } -] -``` - -## wpa_cli.save_config(interface, callback) -The **wpa_cli save_config** command is used to save the current wpa_cli configuration for the specific network interface. - -``` javascript -var wpa_cli = require('wireless-tools/wpa_cli'); - -wpa_cli.save_config('wlan0', function(err, data){ - // current wpa_cli configuration is saved -}); -``` - -# wpa_supplicant -The **wpa_supplicant** command is used to configure a wireless network connection for a network interface. - -## wpa_supplicant.enable(options, callback) -The **wpa_supplicant enable** command is used to join a wireless network on a specific network interface. - -``` javascript -var wpa_supplicant = require('wireless-tools/wpa_supplicant'); - -var options = { - interface: 'wlan0', - ssid: 'RaspberryPi', - passphrase: 'raspberry', - driver: 'wext' -}; - -wpa_supplicant.enable(options, function(err) { - // connected to the wireless network -}); -``` - -## wpa_supplicant.disable(interface, callback) -The **wpa_supplicant disable** command is used to disconnect from a wireless network on a specific network interface. - -``` javascript -var wpa_supplicant = require('wireless-tools/wpa_supplicant'); - -wpa_supplicant.disable('wlan0', function(err) { - // disconnected from wireless network -}); -``` - -## wpa_supplicant.manual(options, callback) -The **wpa_supplicant manual** command is used to launch wpa_supplicant on a specific network interface. - -``` javascript -var wpa_supplicant = require('wireless-tools/wpa_supplicant'); - -var options = { - interface: 'wlan0', - drivers: [ 'nl80211', 'wext' ] -}; - -wpa_supplicant.manual(options, function(err) { - // wpa_supplicant launched on wlan0 interface (can be setup using wpa_cli) -}); -``` - -# iw -The **iw** command is used to get and set detailed information from an nl80211 wireless interface. - -## iw.scan(interface, callback) -The **iw scan** command is used to scan for wireless networks visible to a wireless interface. For convenience, the networks are sorted by signal strength. - -``` javascript -var iw = require('wireless-tools/iw'); - -iw.scan('wlan0', function(err, networks) { - console.log(networks); -}); - -iw.scan({ iface : 'wlan0', show_hidden : true }, function(err, networks) { - console.log(networks); -}); - -// => -[ - { - address: '00:0b:81:ab:14:22', - frequency: 2422, - signal: -80, - lastSeenMs: 0, - ssid: 'BlueberryPi', - channel: 3, - security: 'wpa' - }, - { - address: '00:0b:81:95:12:21', - frequency: 5825, - signal: -83, - lastSeenMs: 2031, - ssid: 'RaspberryPi', - channel: 165, - security: 'wpa2' - }, - { - address: '00:0b:81:cd:f2:04', - frequency: 2437, - signal: -88, - lastSeenMs: 0, - ssid: 'BlackberryPi', - channel: 6, - security: 'wep' - }, - { - address: '00:0b:81:fd:42:14', - frequency: 2412, - signal: -92, - lastSeenMs: 0, - ssid: 'CranberryPi', - channel: 1, - security: 'open' - } -] - -[ - { - address: '00:0b:81:ab:14:22', - frequency: 2422, - signal: -80, - lastSeenMs: 0, - ssid: 'BlueberryPi', - channel: 3, - security: 'wpa' - }, - { - address: '00:0b:81:95:12:21', - frequency: 5825, - signal: -83, - lastSeenMs: 2031, - ssid: 'RaspberryPi', - channel: 165, - security: 'wpa2' - }, - { - address: '00:0b:81:cd:f2:04', - frequency: 2437, - signal: -88, - lastSeenMs: 0, - ssid: 'BlackberryPi', - channel: 6, - security: 'wep' - }, - { - address: '00:0b:81:fd:42:14', - frequency: 2412, - signal: -92, - lastSeenMs: 0, - ssid: 'CranberryPi', - channel: 1, - security: 'open' - }, - { - address: '00:0b:81:fd:42:01', - frequency: 2412, - signal: -94, - lastSeenMs: 1069, - channel: 1, - security: 'open' - } -] -``` diff --git a/plugins/music_service/squeezelite/node_modules/wireless-tools/bump-version b/plugins/music_service/squeezelite/node_modules/wireless-tools/bump-version deleted file mode 100755 index a2e3a47d0..000000000 --- a/plugins/music_service/squeezelite/node_modules/wireless-tools/bump-version +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -sed -i '' 's/"version": ".*"/"version": "'$1'"/g' package.json -sed -i '' 's/version-.*-blue.svg/version-'$1'-blue.svg/g' README.md diff --git a/plugins/music_service/squeezelite/node_modules/wireless-tools/hostapd.js b/plugins/music_service/squeezelite/node_modules/wireless-tools/hostapd.js deleted file mode 100644 index 08879db37..000000000 --- a/plugins/music_service/squeezelite/node_modules/wireless-tools/hostapd.js +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (c) 2015 Christopher M. Baker - * - * 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. - * - */ - -var child_process = require('child_process'); - -/** - * The **hostpad** command is used to configure wireless access points. - * - * @static - * @category hostapd - * - */ -var hostapd = module.exports = { - exec: child_process.exec, - disable: disable, - enable: enable -}; - -/** - * The **hostpad disable** command is used to stop hosting an access point - * on a specific wireless interface. - * - * @static - * @category hostapd - * @param {string} interface The network interface of the access point. - * @param {function} callback The callback function. - * @returns {process} The child process. - * @example - * - * var hostapd = require('wireless-tools/hostapd'); - * - * hostapd.disable('wlan0', function(err) { - * // no longer hosting the access point - * }); - * - */ -function disable(interface, callback) { - var file = interface + '-hostapd.conf'; - - return this.exec('kill `pgrep -f "^hostapd -B ' + file + '"` || true', - callback); -} - -/** - * The **hostpad enable** command is used to host an access point - * on a specific wireless interface. - * - * @static - * @category hostapd - * @param {object} options The access point configuration. - * @param {function} callback The callback function. - * @returns {process} The child process. - * @example - * - * var hostapd = require('wireless-tools/hostapd'); - * - * var options = { - * channel: 6, - * driver: 'rtl871xdrv', - * hw_mode: 'g', - * interface: 'wlan0', - * ssid: 'RaspberryPi', - * wpa: 2, - * wpa_passphrase: 'raspberry' - * }; - * - * hostapd.enable(options, function(err) { - * // the access point was created - * }); - * - */ -function enable(options, callback) { - var file = options.interface + '-hostapd.conf'; - - var commands = [ - 'cat <' + file + ' && hostapd -B ' + file + ' && rm -f ' + file - ]; - - Object.getOwnPropertyNames(options).forEach(function(key) { - commands.push(key + '=' + options[key]); - }); - - return this.exec(commands.join('\n'), callback); -} diff --git a/plugins/music_service/squeezelite/node_modules/wireless-tools/ifconfig.js b/plugins/music_service/squeezelite/node_modules/wireless-tools/ifconfig.js deleted file mode 100644 index 08f9fa7c1..000000000 --- a/plugins/music_service/squeezelite/node_modules/wireless-tools/ifconfig.js +++ /dev/null @@ -1,249 +0,0 @@ -/* - * Copyright (c) 2015 Christopher M. Baker - * - * 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. - * - */ - -var child_process = require('child_process'); - -/** - * The **ifconfig** command is used to configure network interfaces. - * - * @static - * @category ifconfig - * - */ -var ifconfig = module.exports = { - exec: child_process.exec, - status: status, - down: down, - up: up -}; - -/** - * Parses the status for a single network interface. - * - * @private - * @static - * @category ifconfig - * @param {string} block The section of stdout for the interface. - * @returns {object} The parsed network interface status. - * - */ -function parse_status_block(block) { - var match; - - var parsed = { - interface: block.match(/^([^\s]+)/)[1] - }; - - if ((match = block.match(/Link encap:\s*([^\s]+)/))) { - parsed.link = match[1].toLowerCase(); - } - - if ((match = block.match(/HWaddr\s+([^\s]+)/))) { - parsed.address = match[1].toLowerCase(); - } - - if ((match = block.match(/inet6\s+addr:\s*([^\s]+)/))) { - parsed.ipv6_address = match[1]; - } - - if ((match = block.match(/inet\s+addr:\s*([^\s]+)/))) { - parsed.ipv4_address = match[1]; - } - - if ((match = block.match(/Bcast:\s*([^\s]+)/))) { - parsed.ipv4_broadcast = match[1]; - } - - if ((match = block.match(/Mask:\s*([^\s]+)/))) { - parsed.ipv4_subnet_mask = match[1]; - } - - if ((match = block.match(/UP/))) { - parsed.up = true; - } - - if ((match = block.match(/BROADCAST/))) { - parsed.broadcast = true; - } - - if ((match = block.match(/RUNNING/))) { - parsed.running = true; - } - - if ((match = block.match(/MULTICAST/))) { - parsed.multicast = true; - } - - if ((match = block.match(/LOOPBACK/))) { - parsed.loopback = true; - } - - return parsed; -} - -/** - * Parses the status for all network interfaces. - * - * @private - * @static - * @category ifconfig - * @param {function} callback The callback function. - * - */ -function parse_status(callback) { - return function(error, stdout, stderr) { - if (error) callback(error); - else callback(error, - stdout.trim().split('\n\n').map(parse_status_block)); - }; -} - -/** - * Parses the status for a single network interface. - * - * @private - * @static - * @category ifconfig - * @param {function} callback The callback function. - * - */ -function parse_status_interface(callback) { - return function(error, stdout, stderr) { - if (error) callback(error); - else callback(error, parse_status_block(stdout.trim())); - }; -} - -/** - * The **ifconfig status** command is used to query the status of all - * configured interfaces. - * - * @static - * @category ifconfig - * @param {string} [interface] The network interface. - * @param {function} callback The callback function. - * @example - * - * var ifconfig = require('wireless-tools/ifconfig'); - * - * ifconfig.status(function(err, status) { - * console.log(status); - * }); - * - * // => - * [ - * { - * interface: 'eth0', - * link: 'ethernet', - * address: 'b8:27:eb:da:52:ad', - * ipv4_address: '192.168.1.2', - * ipv4_broadcast: '192.168.1.255', - * ipv4_subnet_mask: '255.255.255.0', - * up: true, - * broadcast: true, - * running: true, - * multicast: true - * }, - * { - * interface: 'lo', - * link: 'local', - * ipv4_address: '127.0.0.1', - * ipv4_subnet_mask: '255.0.0.0', - * up: true, - * running: true, - * loopback: true - * }, - * { - * interface: 'wlan0', - * link: 'ethernet', - * address: '00:0b:81:95:12:21', - * ipv4_address: '192.168.10.1', - * ipv4_broadcast: '192.168.10.255', - * ipv4_subnet_mask: '255.255.255.0', - * up: true, - * broadcast: true, - * multicast: true - * } - * ] - * - */ -function status(interface, callback) { - if (callback) { - this.exec('ifconfig ' + interface, parse_status_interface(callback)); - } - else { - this.exec('ifconfig -a', parse_status(interface)); - } -} - -/** - * The **ifconfig down** command is used to take down an interface that is up. - * - * @static - * @category ifconfig - * @param {string} interface The network interface. - * @param {function} callback The callback function. - * @returns {process} The child process. - * @example - * - * var ifconfig = require('wireless-tools/ifconfig'); - * - * ifconfig.down('wlan0', function(err) { - * // the interface is down - * }); - * - */ -function down(interface, callback) { - return this.exec('ifconfig ' + interface + ' down', callback); -} - -/** - * The **ifconfig up** command is used to bring up an interface with the - * specified configuration. - * - * @static - * @category ifconfig - * @param {object} options The interface configuration. - * @param {function} callback The callback function. - * @returns {process} The child process. - * @example - * - * var options = { - * interface: 'wlan0', - * ipv4_address: '192.168.10.1', - * ipv4_broadcast: '192.168.10.255', - * ipv4_subnet_mask: '255.255.255.0' - * }; - * - * ifconfig.up(options, function(err) { - * // the interface is up - * }); - * - */ -function up(options, callback) { - return this.exec('ifconfig ' + options.interface + - ' ' + options.ipv4_address + - ' netmask ' + options.ipv4_subnet_mask + - ' broadcast ' + options.ipv4_broadcast + - ' up', callback); -} diff --git a/plugins/music_service/squeezelite/node_modules/wireless-tools/iw.js b/plugins/music_service/squeezelite/node_modules/wireless-tools/iw.js deleted file mode 100644 index 000a825ba..000000000 --- a/plugins/music_service/squeezelite/node_modules/wireless-tools/iw.js +++ /dev/null @@ -1,192 +0,0 @@ -/* - * Copyright (c) 2015 Christopher M. Baker - * - * 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. - * - */ - -var child_process = require('child_process'); - -/** - * The **iw** command is used to control nl80211 radios. - * - * @static - * @category iw - * - */ -var iw = module.exports = { - exec: child_process.exec, - scan: scan -}; - -/** - * Returns a truthy if the network has an ssid; falsy otherwise. - * - * @private - * @static - * @category iw - * @param {object} network The scanned network object. - * @returns {string} The ssid. - * - */ -function has_ssid(network) { - return network.ssid; -} - -/** - * Returns a truthy if the network has any key; falsy otherwise. - * - * @private - * @static - * @category iw - * @param {object} network The scanned network object. - * @returns {boolean} True if any key. - * - */ -function has_keys(network) { - return Object.keys(network).length !== 0; -} - - - -/** - * A comparison function to sort networks ordered by signal strength. - * - * @private - * @static - * @category iw - * @param {object} a A scanned network object. - * @param {object} b Another scanned network object. - * @returns {number} The comparison value. - * - */ -function by_signal(a, b) { - return b.signal - a.signal; -} - -/** - * Parses a scanned wireless network cell. - * - * @private - * @static - * @category iw - * @param {string} cell The section of stdout for the cell. - * @returns {object} The scanned network object. - * - */ -function parse_cell(cell) { - var parsed = { }; - var match; - - if ((match = cell.match(/BSS ([0-9A-Fa-f:-]{17})\(on/))) { - parsed.address = match[1].toLowerCase(); - } - - if ((match = cell.match(/freq: ([0-9]+)/))) { - parsed.frequency = parseInt(match[1], 10); - } - - if ((match = cell.match(/signal: (-?[0-9.]+) dBm/))) { - parsed.signal = parseFloat(match[1]); - } - - if ((match = cell.match(/last seen: ([0-9]+) ms ago/))) { - parsed.lastSeenMs = parseInt(match[1], 10); - } - - if ((match = cell.match(/SSID: \\x00/))) { - delete parsed.ssid; - } - else if ((match = cell.match(/SSID: ([^\n]*)/))) { - parsed.ssid = match[1]; - } - - if ((match = cell.match(/DS Parameter set: channel ([0-9]+)/))) { - parsed.channel = parseInt(match[1], 10); - } - else if ((match = cell.match(/\* primary channel: ([0-9]+)/))) { - parsed.channel = parseInt(match[1], 10); - } - - if ((match = cell.match(/RSN:[\s*]+Version: 1/))) { - parsed.security = 'wpa2'; - } - else if ((match = cell.match(/WPA:[\s*]+Version: 1/))) { - parsed.security = 'wpa'; - } - else if ((match = cell.match(/capability: ESS Privacy/))) { - parsed.security = 'wep'; - } - else if ((match = cell.match(/capability: ESS/))) { - parsed.security = 'open'; - } - return parsed; -} - -/** - * Parses all scanned wireless network cells. - * - * @private - * @static - * @category iw - * @param {function} callback The callback function. - * - */ -function parse_scan(show_hidden, callback) { - return function(error, stdout, stderr) { - if (error) callback(error); - else - if (show_hidden) { - callback(error, stdout - .split(/(^|\n)(?=BSS )/) - .map(parse_cell) - .filter(has_keys) - .sort(by_signal)); - } else { - callback(error, stdout - .split(/(^|\n)(?=BSS )/) - .map(parse_cell) - .filter(has_ssid) - .sort(by_signal)); - } - }; -} - -/** - * The **iw scan** command is used to scan for wireless networks - * visible to a wireless interface. For convenience, the networks are - * sorted by signal strength. - * - * @static - * @category iw - * @param {string} interface The wireless network interface. - * @param {function} callback The callback function. - */ -function scan(options, callback) { - var interface, show_hidden - if (typeof options === 'string') { - var interface = options; - var show_hidden = false; - } else { - var interface = options.iface; - var show_hidden = options.show_hidden || false; - } - - this.exec('iw dev ' + interface + ' scan', parse_scan(show_hidden, callback)); -} diff --git a/plugins/music_service/squeezelite/node_modules/wireless-tools/iwconfig.js b/plugins/music_service/squeezelite/node_modules/wireless-tools/iwconfig.js deleted file mode 100644 index fb2f5fd8b..000000000 --- a/plugins/music_service/squeezelite/node_modules/wireless-tools/iwconfig.js +++ /dev/null @@ -1,185 +0,0 @@ -/* - * Copyright (c) 2015 Christopher M. Baker - * - * 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. - * - */ - -var child_process = require('child_process'); - -/** - * The **iwconfig** command is used to configure wireless network interfaces. - * - * @private - * @category iwconfig - * - */ -var iwconfig = module.exports = { - exec: child_process.exec, - status: status -}; - -/** - * Parses the status for a single wireless network interface. - * - * @private - * @static - * @category iwconfig - * @param {string} block The section of stdout for the interface. - * @returns {object} The parsed wireless network interface status. - * - */ -function parse_status_block(block) { - var match; - - // Skip out of the block is invalid - if (!block) return; - - var parsed = { - interface: block.match(/^([^\s]+)/)[1] - }; - - if ((match = block.match(/Access Point:\s*([A-Fa-f0-9:]{17})/))) { - parsed.access_point = match[1].toLowerCase(); - } - - if ((match = block.match(/Frequency[:|=]\s*([0-9\.]+)/))) { - parsed.frequency = parseFloat(match[1]); - } - - if ((match = block.match(/IEEE\s*([^\s]+)/))) { - parsed.ieee = match[1].toLowerCase(); - } - - if ((match = block.match(/Mode[:|=]\s*([^\s]+)/))) { - parsed.mode = match[1].toLowerCase(); - } - - if ((match = block.match(/Noise level[:|=]\s*(-?[0-9]+)/))) { - parsed.noise = parseInt(match[1], 10); - } - - if ((match = block.match(/Link Quality[:|=]\s*([0-9]+)/))) { - parsed.quality = parseInt(match[1], 10); - } - - if ((match = block.match(/Sensitivity[:|=]\s*([0-9]+)/))) { - parsed.sensitivity = parseInt(match[1], 10); - } - - if ((match = block.match(/Signal level[:|=]\s*(-?[0-9]+)/))) { - parsed.signal = parseInt(match[1], 10); - } - - if ((match = block.match(/ESSID[:|=]\s*"([^"]+)"/))) { - parsed.ssid = match[1]; - } - - if ((match = block.match(/unassociated/))) { - parsed.unassociated = true; - } - - return parsed; -} - -/** - * Parses the status for all wireless network interfaces. - * - * @private - * @static - * @category iwconfig - * @param {function} callback The callback function. - * - */ -function parse_status(callback) { - return function(error, stdout, stderr) { - if (error) callback(error); - else callback(error, - stdout.trim().split('\n\n').map(parse_status_block).filter(function(i) { return !! i })); - }; -} - -/** - * Parses the status for a single wireless network interface. - * - * @private - * @static - * @category iwconfig - * @param {function} callback The callback function. - * - */ -function parse_status_interface(callback) { - return function(error, stdout, stderr) { - if (error) callback(error); - else callback(error, parse_status_block(stdout.trim())); - }; -} - -/** - * Parses the status for a single wireless network interface. - * - * @private - * @static - * @category iwconfig - * @param {string} [interface] The wireless network interface. - * @param {function} callback The callback function. - * @example - * - * var iwconfig = require('wireless-tools/iwconfig'); - * - * iwconfig.status(function(err, status) { - * console.log(status); - * }); - * - * // => - * [ - * { - * interface: 'wlan0', - * access_point: '00:0b:81:95:12:21', - * frequency: 2.437, - * ieee: '802.11bg', - * mode: 'master', - * noise: 0, - * quality: 77, - * sensitivity: 0, - * signal: 50, - * ssid: 'RaspberryPi' - * }, - * { - * interface: 'wlan1', - * frequency: 2.412, - * mode: 'auto', - * noise: 0, - * quality: 0, - * sensitivity: 0, - * signal: 0, - * unassociated: true - * } - * ] - * - */ -function status(interface, callback) { - if (callback) { - return this.exec('iwconfig ' + interface, - parse_status_interface(callback)); - } - else { - return this.exec('iwconfig', parse_status(interface)); - } -} diff --git a/plugins/music_service/squeezelite/node_modules/wireless-tools/iwlist.js b/plugins/music_service/squeezelite/node_modules/wireless-tools/iwlist.js deleted file mode 100644 index 206506b49..000000000 --- a/plugins/music_service/squeezelite/node_modules/wireless-tools/iwlist.js +++ /dev/null @@ -1,310 +0,0 @@ -/* - * Copyright (c) 2015 Christopher M. Baker - * - * 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. - * - */ - -var child_process = require('child_process'); - -/** - * The **iwlist** command is used to get detailed information from a - * wireless interface. - * - * @static - * @category iwlist - * - */ -var iwlist = module.exports = { - exec: child_process.exec, - scan: scan -}; - -/** - * Returns a truthy if the network has an ssid; falsy otherwise. - * - * @private - * @static - * @category iwlist - * @param {object} network The scanned network object. - * @returns {string} The ssid. - * - */ -function has_ssid(network) { - return network.ssid; -} - -/** - * Returns a truthy if the network has any key; falsy otherwise. - * - * @private - * @static - * @category iwlist - * @param {object} network The scanned network object. - * @returns {boolean} True if any key. - * - */ -function has_keys(network) { - return Object.keys(network).length !== 0; -} - - - -/** - * A comparison function to sort networks ordered by signal strength. - * - * @private - * @static - * @category iwlist - * @param {object} a A scanned network object. - * @param {object} b Another scanned network object. - * @returns {number} The comparison value. - * - */ -function by_signal(a, b) { - return b.signal - a.signal; -} - -/** - * Parses a scanned wireless network cell. - * - * @private - * @static - * @category iwlist - * @param {string} cell The section of stdout for the cell. - * @returns {object} The scanned network object. - * - */ -function parse_cell(cell) { - var parsed = { }; - var match; - - if ((match = cell.match(/Address\s*[:|=]\s*([A-Fa-f0-9:]{17})/))) { - parsed.address = match[1].toLowerCase(); - } - - if ((match = cell.match(/Channel\s*([0-9]+)/))) { - parsed.channel = parseInt(match[1], 10); - } - - if ((match = cell.match(/Frequency\s*[:|=]\s*([0-9\.]+)\s*GHz/))) { - parsed.frequency = parseFloat(match[1]); - } - - if ((match = cell.match(/Mode\s*[:|=]\s*([^\s]+)/))) { - parsed.mode = match[1].toLowerCase(); - } - - if ((match = cell.match(/Quality\s*[:|=]\s*([0-9]+)/))) { - parsed.quality = parseInt(match[1], 10); - } - - if ((match = cell.match(/Signal level\s*[:|=]\s*(-?[0-9]+)/))) { - parsed.signal = parseInt(match[1], 10); - } - - if ((match = cell.match(/Noise level\s*[:|=]\s*(-?[0-9]+)/))) { - parsed.noise = parseInt(match[1], 10); - } - - if ((match = cell.match(/ESSID\s*[:|=]\s*"([^"]+)"/))) { - parsed.ssid = match[1]; - } - - if ((match = cell.match(/WPA2\s+Version/))) { - parsed.security = 'wpa2'; - } - else if ((match = cell.match(/WPA\s+Version/))) { - parsed.security = 'wpa'; - } - else if ((match = cell.match(/Encryption key\s*[:|=]\s*on/))) { - parsed.security = 'wep'; - } - else if ((match = cell.match(/Encryption key\s*[:|=]\s*off/))) { - parsed.security = 'open'; - } - - return parsed; -} - -/** - * Parses all scanned wireless network cells. - * - * @private - * @static - * @category iwlist - * @param {function} callback The callback function. - * - */ -function parse_scan(show_hidden, callback) { - return function(error, stdout, stderr) { - if (error) callback(error); - else - if (show_hidden) { - callback(error, stdout - .split(/Cell [0-9]+ -/) - .map(parse_cell) - .filter(has_keys) - .sort(by_signal)); - } else { - callback(error, stdout - .split(/Cell [0-9]+ -/) - .map(parse_cell) - .filter(has_ssid) - .sort(by_signal)); - } - }; -} - -/** - * The **iwlist scan** command is used to scan for wireless networks - * visible to a wireless interface. For convenience, the networks are - * sorted by signal strength. - * - * @static - * @category iwlist - * @param {string} interface The wireless network interface. - * @param {function} callback The callback function. - * @example - * - * var iwlist = require('wireless-tools/iwlist'); - * - * iwlist.scan('wlan0', function(err, networks) { - * console.log(networks); - * }); - * - * iwlist.scan({ iface : 'wlan0', show_hidden: true }, function(err, networks) { - * console.log(networks); - * }); - * - * // => - * [ - * { - * address: '00:0b:81:ab:14:22', - * ssid: 'BlueberryPi', - * mode: 'master', - * frequency: 2.437, - * channel: 6, - * security: 'wpa', - * quality: 48, - * signal: 87 - * }, - * { - * address: '00:0b:81:95:12:21', - * ssid: 'RaspberryPi', - * mode: 'master', - * frequency: 2.437, - * channel: 6, - * security: 'wpa2', - * quality: 58, - * signal: 83 - * }, - * { - * address: '00:0b:81:cd:f2:04', - * ssid: 'BlackberryPi', - * mode: 'master', - * frequency: 2.437, - * channel: 6, - * security: 'wep', - * quality: 48, - * signal: 80 - * }, - * { - * address: '00:0b:81:fd:42:14', - * ssid: 'CranberryPi', - * mode: 'master', - * frequency: 2.437, - * channel: 6, - * security: 'open', - * quality: 32, - * signal: 71 - * } - * ] - * - * [ - * { - * address: '00:0b:81:ab:14:22', - * ssid: 'BlueberryPi', - * mode: 'master', - * frequency: 2.437, - * channel: 6, - * security: 'wpa', - * quality: 48, - * signal: 87 - * }, - * { - * address: '00:0b:81:95:12:21', - * ssid: 'RaspberryPi', - * mode: 'master', - * frequency: 2.437, - * channel: 6, - * security: 'wpa2', - * quality: 58, - * signal: 83 - * }, - * { - * address: '00:0b:81:cd:f2:04', - * ssid: 'BlackberryPi', - * mode: 'master', - * frequency: 2.437, - * channel: 6, - * security: 'wep', - * quality: 48, - * signal: 80 - * }, - * { - * address: '00:0b:81:fd:42:14', - * ssid: 'CranberryPi', - * mode: 'master', - * frequency: 2.437, - * channel: 6, - * security: 'open', - * quality: 32, - * signal: 71 - * }, - * { - * address: '2c:c5:d3:02:ae:4c', - * channel: 100, - * frequency: 5.5, - * mode: 'master', - * quality: 66, - * signal: -44, - * security: 'wpa2' - * } - * ] - * - */ -function scan(options, callback) { - var interface, show_hidden - if (typeof options === 'string') { - var interface = options; - var show_hidden = false; - } else { - var interface = options.iface; - var show_hidden = options.show_hidden || false; - } - - var extra_params = ''; - - if (options.ssid) { - extra_params = ' essid ' + options.ssid; - } - - this.exec('iwlist ' + interface + ' scan' + extra_params, parse_scan(show_hidden, callback)); -} diff --git a/plugins/music_service/squeezelite/node_modules/wireless-tools/package.json b/plugins/music_service/squeezelite/node_modules/wireless-tools/package.json deleted file mode 100644 index 9693a6261..000000000 --- a/plugins/music_service/squeezelite/node_modules/wireless-tools/package.json +++ /dev/null @@ -1,118 +0,0 @@ -{ - "_args": [ - [ - { - "raw": "wireless-tools@^0.19.0", - "scope": null, - "escapedName": "wireless-tools", - "name": "wireless-tools", - "rawSpec": "^0.19.0", - "spec": ">=0.19.0 <0.20.0", - "type": "range" - }, - "/home/volumio/volumio-plugins/plugins/music_service/squeezelite" - ] - ], - "_from": "wireless-tools@>=0.19.0 <0.20.0", - "_id": "wireless-tools@0.19.0", - "_inCache": true, - "_location": "/wireless-tools", - "_nodeVersion": "7.4.0", - "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/wireless-tools-0.19.0.tgz_1484746881608_0.2779587283730507" - }, - "_npmUser": { - "name": "bakerface", - "email": "mail.chris.baker@gmail.com" - }, - "_npmVersion": "4.0.5", - "_phantomChildren": {}, - "_requested": { - "raw": "wireless-tools@^0.19.0", - "scope": null, - "escapedName": "wireless-tools", - "name": "wireless-tools", - "rawSpec": "^0.19.0", - "spec": ">=0.19.0 <0.20.0", - "type": "range" - }, - "_requiredBy": [ - "/" - ], - "_resolved": "https://registry.npmjs.org/wireless-tools/-/wireless-tools-0.19.0.tgz", - "_shasum": "67fb73cd371f2d9ba3b9ef253400a31f8c784b11", - "_shrinkwrap": null, - "_spec": "wireless-tools@^0.19.0", - "_where": "/home/volumio/volumio-plugins/plugins/music_service/squeezelite", - "author": { - "name": "Christopher M. Baker" - }, - "bugs": { - "url": "https://github.com/bakerface/wireless-tools/issues" - }, - "contributors": [ - { - "name": "Athom", - "email": "support@athom.com", - "url": "https://www.athom.com/en/" - }, - { - "name": "Wink", - "email": "support@wink.com", - "url": "https://www.wink.com/" - } - ], - "dependencies": {}, - "description": "Wireless tools for Node.js", - "devDependencies": { - "codeclimate-test-reporter": "^0.3.1", - "istanbul": "^0.4.3", - "mocha": "^2.5.3", - "should": "^9.0.2", - "xo": "^0.16.0" - }, - "directories": {}, - "dist": { - "shasum": "67fb73cd371f2d9ba3b9ef253400a31f8c784b11", - "tarball": "https://registry.npmjs.org/wireless-tools/-/wireless-tools-0.19.0.tgz" - }, - "gitHead": "ba836eedc521f097097704204e0ccb1a388fe4f5", - "homepage": "https://github.com/bakerface/wireless-tools", - "keywords": [ - "wireless", - "tools", - "hostapd", - "ifconfig", - "iwconfig", - "iwlist", - "iw", - "udhcpc", - "udhcpd", - "wpa_supplicant" - ], - "license": "MIT", - "main": "wireless-tools.js", - "maintainers": [ - { - "name": "bakerface", - "email": "mail.chris.baker@gmail.com" - } - ], - "name": "wireless-tools", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/bakerface/wireless-tools.git" - }, - "scripts": { - "codeclimate": "codeclimate-test-reporter < coverage/lcov.info", - "posttest": "istanbul check-coverage --statements 100 --functions 100 --branches 100 --lines 100", - "test": "istanbul cover node_modules/.bin/_mocha" - }, - "version": "0.19.0", - "xo": { - "space": true - } -} diff --git a/plugins/music_service/squeezelite/node_modules/wireless-tools/test/hostapd.js b/plugins/music_service/squeezelite/node_modules/wireless-tools/test/hostapd.js deleted file mode 100644 index 6f5d4ec29..000000000 --- a/plugins/music_service/squeezelite/node_modules/wireless-tools/test/hostapd.js +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright (c) 2015 Christopher M. Baker - * - * 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. - * - */ - -var should = require('should'); -var hostapd = require('../hostapd'); - -describe('hostapd', function() { - describe('hostapd.disable(options, callback)', function() { - it('should stop the daemons', function(done) { - hostapd.exec = function(command, callback) { - should(command).eql( - 'kill `pgrep -f "^hostapd -B wlan0-hostapd.conf"` || true'); - callback(null, '', ''); - }; - - hostapd.disable('wlan0', function(err) { - should(err).not.be.ok; - done(); - }); - }) - - it('should handle errors', function(done) { - hostapd.exec = function(command, callback) { - callback('error'); - }; - - hostapd.disable('wlan0', function(err) { - should(err).eql('error'); - done(); - }); - }) - }) - - describe('hostapd.enable(options, callback)', function() { - it('should start the daemon', function(done) { - hostapd.exec = function(command, callback) { - should(command).eql('cat <wlan0-hostapd.conf' + - ' && hostapd -B wlan0-hostapd.conf' + - ' && rm -f wlan0-hostapd.conf\n' + - 'channel=6\n' + - 'driver=rtl871xdrv\n' + - 'hw_mode=g\n' + - 'interface=wlan0\n' + - 'ssid=RaspberryPi\n' + - 'wpa=2\n' + - 'wpa_passphrase=raspberry'); - - callback(null, '', ''); - }; - - var options = { - channel: 6, - driver: 'rtl871xdrv', - hw_mode: 'g', - interface: 'wlan0', - ssid: 'RaspberryPi', - wpa: 2, - wpa_passphrase: 'raspberry' - }; - - hostapd.enable(options, function(err) { - should(err).not.be.ok; - done(); - }); - }) - - it('should handle errors', function(done) { - hostapd.exec = function(command, callback) { - callback('error'); - }; - - var options = { - channel: 6, - driver: 'rtl871xdrv', - hw_mode: 'g', - interface: 'wlan0', - ssid: 'RaspberryPi', - wpa: 2, - wpa_passphrase: 'raspberry' - }; - - hostapd.enable(options, function(err) { - should(err).eql('error'); - done(); - }); - }) - }) -}) diff --git a/plugins/music_service/squeezelite/node_modules/wireless-tools/test/ifconfig.js b/plugins/music_service/squeezelite/node_modules/wireless-tools/test/ifconfig.js deleted file mode 100644 index 4c61cc0a5..000000000 --- a/plugins/music_service/squeezelite/node_modules/wireless-tools/test/ifconfig.js +++ /dev/null @@ -1,201 +0,0 @@ -/* - * Copyright (c) 2015 Christopher M. Baker - * - * 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. - * - */ - -var should = require('should'); -var ifconfig = require('../ifconfig'); - -var IFCONFIG_STATUS_LINUX = [ - 'eth0 Link encap:Ethernet HWaddr DE:AD:BE:EF:C0:DE', - ' inet addr:192.168.1.2 Bcast:192.168.1.255 Mask:255.255.255.0', - ' UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1', - ' RX packets:114919 errors:0 dropped:10 overruns:0 frame:0', - ' TX packets:117935 errors:0 dropped:0 overruns:0 carrier:0', - ' collisions:0 txqueuelen:1000', - ' RX bytes:28178397 (26.8 MiB) TX bytes:23423409 (22.3 MiB)', - '', - 'lo Link encap:Local Loopbacks', - ' inet addr:127.0.0.1 Mask:255.0.0.0', - ' UP LOOPBACK RUNNING MTU:65536 Metric:1', - ' RX packets:0 errors:0 dropped:0 overruns:0 frame:0', - ' TX packets:0 errors:0 dropped:0 overruns:0 carrier:0', - ' collisions:0 txqueuelen:0', - ' RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)' -].join('\n'); - -var IFCONFIG_STATUS_INTERFACE_LINUX = [ - 'wlan0 HWaddr DE:AD:BE:EF:C0:DE', - ' inet6 addr:fe80::21c:c0ff:feae:b5e6/64 Scope:Link', - ' MTU:1500 Metric:1', - ' RX packets:0 errors:0 dropped:0 overruns:0 frame:0', - ' TX packets:0 errors:0 dropped:0 overruns:0 carrier:0', - ' collisions:0 txqueuelen:1000', - ' RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)' -].join('\n'); - - - -describe('ifconfig', function() { - describe('ifconfig.status(callback)', function() { - it('should get the status for each interface', function(done) { - ifconfig.exec = function(command, callback) { - should(command).eql('ifconfig -a'); - callback(null, IFCONFIG_STATUS_LINUX, ''); - }; - - ifconfig.status(function(err, status) { - should(status).eql([ - { - interface: 'eth0', - link: 'ethernet', - address: 'de:ad:be:ef:c0:de', - ipv4_address: '192.168.1.2', - ipv4_broadcast: '192.168.1.255', - ipv4_subnet_mask: '255.255.255.0', - up: true, - broadcast: true, - running: true, - multicast: true - }, - { - interface: 'lo', - link: 'local', - ipv4_address: '127.0.0.1', - ipv4_subnet_mask: '255.0.0.0', - up: true, - loopback: true, - running: true - } - ]); - - done(); - }); - }) - - it('should handle errors', function(done) { - ifconfig.exec = function(command, callback) { - callback('error'); - }; - - ifconfig.status(function(err, status) { - should(err).eql('error'); - done(); - }); - }) - }) - - describe('ifconfig.status(interface, callback)', function() { - it('should get the status for the specified interface', function(done) { - ifconfig.exec = function(command, callback) { - should(command).eql('ifconfig wlan0'); - callback(null, IFCONFIG_STATUS_INTERFACE_LINUX, ''); - }; - - ifconfig.status('wlan0', function(err, status) { - should(status).eql({ - interface: 'wlan0', - address: 'de:ad:be:ef:c0:de', - ipv6_address: 'fe80::21c:c0ff:feae:b5e6/64' - }); - - done(); - }); - }) - - it('should handle errors', function(done) { - ifconfig.exec = function(command, callback) { - callback('error'); - }; - - ifconfig.status('wlan0', function(err, status) { - should(err).eql('error'); - done(); - }); - }) - }) - - describe('ifconfig.down(interface, callback)', function() { - it('should take down the interface', function(done) { - ifconfig.exec = function(command, callback) { - should(command).eql('ifconfig wlan0 down'); - callback(null, '', ''); - }; - - ifconfig.down('wlan0', function(err) { - should(err).not.be.ok; - done(); - }); - }) - - it('should handle errors', function(done) { - ifconfig.exec = function(command, callback) { - callback('error'); - }; - - ifconfig.down('wlan0', function(err) { - should(err).eql('error'); - done(); - }); - }) - }) - - describe('ifconfig.up(options, callback)', function() { - it('should bring up the interface', function(done) { - ifconfig.exec = function(command, callback) { - should(command).eql('ifconfig wlan0 192.168.10.1' + - ' netmask 255.255.255.0 broadcast 192.168.10.255 up'); - - callback(null, '', ''); - }; - - var options = { - interface: 'wlan0', - ipv4_address: '192.168.10.1', - ipv4_broadcast: '192.168.10.255', - ipv4_subnet_mask: '255.255.255.0' - }; - - ifconfig.up(options, function(err) { - should(err).not.be.ok; - done(); - }); - }) - - it('should handle errors', function(done) { - ifconfig.exec = function(command, callback) { - callback('error'); - }; - - var options = { - interface: 'wlan0', - ipv4_address: '192.168.10.1', - ipv4_broadcast: '192.168.10.255', - ipv4_subnet_mask: '255.255.255.0' - }; - - ifconfig.down(options, function(err) { - should(err).eql('error'); - done(); - }); - }) - }) -}) diff --git a/plugins/music_service/squeezelite/node_modules/wireless-tools/test/iw.js b/plugins/music_service/squeezelite/node_modules/wireless-tools/test/iw.js deleted file mode 100644 index 77c62c2e5..000000000 --- a/plugins/music_service/squeezelite/node_modules/wireless-tools/test/iw.js +++ /dev/null @@ -1,860 +0,0 @@ -/* - * Copyright (c) 2015 Christopher M. Baker - * - * 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. - * - */ - -var should = require('should'); -var iw = require('../iw'); - -var IW_SCAN_LINUX = "BSS 14:91:82:c7:76:b9(on wlan0)\n" + -" TSF: 337644127 usec (0d, 00:05:37)\n" + -" freq: 2412\n" + -" beacon interval: 100 TUs\n" + -" capability: ESS Privacy ShortSlotTime (0x0411)\n" + -" signal: -87.00 dBm\n" + -" last seen: 0 ms ago\n" + -" Information elements from Probe Response frame:\n" + -" SSID: creamcorn\n" + -" Supported rates: 1.0* 2.0* 5.5* 11.0* 22.0 6.0 9.0 12.0 \n" + -" DS Parameter set: channel 1\n" + -" TIM: DTIM Count 0 DTIM Period 2 Bitmap Control 0x0 Bitmap[0] 0x0\n" + -" ERP: \n" + -" Extended supported rates: 18.0 24.0 36.0 48.0 54.0 \n" + -" RSN: * Version: 1\n" + -" * Group cipher: CCMP\n" + -" * Pairwise ciphers: CCMP\n" + -" * Authentication suites: PSK\n" + -" * Capabilities: 16-PTKSA-RC 1-GTKSA-RC (0x000c)\n" + -" HT capabilities:\n" + -" Capabilities: 0x6f\n" + -" RX LDPC\n" + -" HT20/HT40\n" + -" SM Power Save disabled\n" + -" RX HT20 SGI\n" + -" RX HT40 SGI\n" + -" No RX STBC\n" + -" Max AMSDU length: 3839 bytes\n" + -" No DSSS/CCK HT40\n" + -" Maximum RX AMPDU length 65535 bytes (exponent: 0x003)\n" + -" Minimum RX AMPDU time spacing: 4 usec (0x05)\n" + -" HT TX/RX MCS rate indexes supported: 0-23, 32\n" + -" HT operation:\n" + -" * primary channel: 1\n" + -" * secondary channel offset: no secondary\n" + -" * STA channel width: 20 MHz\n" + -" * RIFS: 0\n" + -" * HT protection: nonmember\n" + -" * non-GF present: 0\n" + -" * OBSS non-GF present: 1\n" + -" * dual beacon: 0\n" + -" * dual CTS protection: 0\n" + -" * STBC beacon: 0\n" + -" * L-SIG TXOP Prot: 0\n" + -" * PCO active: 0\n" + -" * PCO phase: 0\n" + -" Extended capabilities: 6\n" + -" VHT capabilities:\n" + -" VHT Capabilities (0x33801831):\n" + -" Max MPDU length: 7991\n" + -" Supported Channel Width: neither 160 nor 80+80\n" + -" RX LDPC\n" + -" short GI (80 MHz)\n" + -" SU Beamformer\n" + -" SU Beamformee\n" + -" RX antenna pattern consistency\n" + -" TX antenna pattern consistency\n" + -" VHT RX MCS set:\n" + -" 1 streams: MCS 0-9\n" + -" 2 streams: MCS 0-9\n" + -" 3 streams: MCS 0-9\n" + -" 4 streams: not supported\n" + -" 5 streams: not supported\n" + -" 6 streams: not supported\n" + -" 7 streams: not supported\n" + -" 8 streams: not supported\n" + -" VHT RX highest supported: 0 Mbps\n" + -" VHT TX MCS set:\n" + -" 1 streams: MCS 0-9\n" + -" 2 streams: MCS 0-9\n" + -" 3 streams: MCS 0-9\n" + -" 4 streams: not supported\n" + -" 5 streams: not supported\n" + -" 6 streams: not supported\n" + -" 7 streams: not supported\n" + -" 8 streams: not supported\n" + -" VHT TX highest supported: 0 Mbps\n" + -" VHT operation:\n" + -" * channel width: 0 (20 or 40 MHz)\n" + -" * center freq segment 1: 0\n" + -" * center freq segment 2: 0\n" + -" * VHT basic MCS set: 0xfffc\n" + -" WMM: * Parameter version 1\n" + -" * BE: CW 15-1023, AIFSN 3, TXOP 2048 usec\n" + -" * BK: CW 15-1023, AIFSN 7\n" + -" * VI: CW 7-15, AIFSN 2, TXOP 3008 usec\n" + -" * VO: CW 3-7, AIFSN 2, TXOP 1504 usec\n" + -"BSS f4:0f:1b:b5:5b:4d(on wlan0)\n" + -" TSF: 337645123 usec (0d, 00:05:37)\n" + -" freq: 5260\n" + -" beacon interval: 102 TUs\n" + -" capability: ESS Privacy RadioMeasure (0x1011)\n" + -" signal: -59.00 dBm\n" + -" last seen: 4530 ms ago\n" + -" Information elements from Probe Response frame:\n" + -" SSID: Wink-Visitor\n" + -" Supported rates: 6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 \n" + -" Country: US Environment: Indoor/Outdoor\n" + -" Channels [36 - 48] @ 17 dBm\n" + -" Channels [52 - 64] @ 24 dBm\n" + -" Channels [100 - 116] @ 24 dBm\n" + -" Channels [132 - 140] @ 24 dBm\n" + -" Channels [149 - 165] @ 30 dBm\n" + -" BSS Load:\n" + -" * station count: 14\n" + -" * channel utilisation: 16/255\n" + -" * available admission capacity: 23437 [*32us]\n" + -" HT capabilities:\n" + -" Capabilities: 0x19ac\n" + -" HT20\n" + -" SM Power Save disabled\n" + -" RX HT20 SGI\n" + -" TX STBC\n" + -" RX STBC 1-stream\n" + -" Max AMSDU length: 7935 bytes\n" + -" DSSS/CCK HT40\n" + -" Maximum RX AMPDU length 65535 bytes (exponent: 0x003)\n" + -" Minimum RX AMPDU time spacing: 8 usec (0x06)\n" + -" HT RX MCS rate indexes supported: 0-23\n" + -" HT TX MCS rate indexes are undefined\n" + -" HT operation:\n" + -" * primary channel: 52\n" + -" * secondary channel offset: no secondary\n" + -" * STA channel width: 20 MHz\n" + -" * RIFS: 1\n" + -" * HT protection: no\n" + -" * non-GF present: 1\n" + -" * OBSS non-GF present: 0\n" + -" * dual beacon: 0\n" + -" * dual CTS protection: 0\n" + -" * STBC beacon: 0\n" + -" * L-SIG TXOP Prot: 0\n" + -" * PCO active: 0\n" + -" * PCO phase: 0\n" + -" Extended capabilities: Proxy ARP Service, WNM-Notification, 6\n" + -" VHT capabilities:\n" + -" VHT Capabilities (0x0f8379b2):\n" + -" Max MPDU length: 11454\n" + -" Supported Channel Width: neither 160 nor 80+80\n" + -" RX LDPC\n" + -" short GI (80 MHz)\n" + -" TX STBC\n" + -" SU Beamformer\n" + -" SU Beamformee\n" + -" VHT RX MCS set:\n" + -" 1 streams: MCS 0-9\n" + -" 2 streams: MCS 0-9\n" + -" 3 streams: MCS 0-9\n" + -" 4 streams: not supported\n" + -" 5 streams: not supported\n" + -" 6 streams: not supported\n" + -" 7 streams: not supported\n" + -" 8 streams: not supported\n" + -" VHT RX highest supported: 0 Mbps\n" + -" VHT TX MCS set:\n" + -" 1 streams: MCS 0-9\n" + -" 2 streams: MCS 0-9\n" + -" 3 streams: MCS 0-9\n" + -" 4 streams: not supported\n" + -" 5 streams: not supported\n" + -" 6 streams: not supported\n" + -" 7 streams: not supported\n" + -" 8 streams: not supported\n" + -" VHT TX highest supported: 0 Mbps\n" + -" VHT operation:\n" + -" * channel width: 0 (20 or 40 MHz)\n" + -" * center freq segment 1: 0\n" + -" * center freq segment 2: 0\n" + -" * VHT basic MCS set: 0x0000\n" + -" WPA: * Version: 1\n" + -" * Group cipher: CCMP\n" + -" * Pairwise ciphers: CCMP\n" + -" * Authentication suites: PSK\n" + -" * Capabilities: 1-PTKSA-RC 1-GTKSA-RC (0x0000)\n" + -" WMM: * Parameter version 1\n" + -" * u-APSD\n" + -" * BE: CW 15-1023, AIFSN 3\n" + -" * BK: CW 15-1023, AIFSN 7\n" + -" * VI: CW 7-15, AIFSN 2, TXOP 3008 usec\n" + -" * VO: CW 3-7, AIFSN 2, TXOP 1504 usec\n" + -"BSS f4:0f:1b:b5:5b:4e(on wlan0)\n" + -" TSF: 337645151 usec (0d, 00:05:37)\n" + -" freq: 5260\n" + -" beacon interval: 102 TUs\n" + -" capability: ESS RadioMeasure (0x1001)\n" + -" signal: -59.00 dBm\n" + -" last seen: 4530 ms ago\n" + -" Information elements from Probe Response frame:\n" + -" SSID: Flex-Visitor\n" + -" Supported rates: 6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 \n" + -" Country: US Environment: Indoor/Outdoor\n" + -" Channels [36 - 48] @ 17 dBm\n" + -" Channels [52 - 64] @ 24 dBm\n" + -" Channels [100 - 116] @ 24 dBm\n" + -" Channels [132 - 140] @ 24 dBm\n" + -" Channels [149 - 165] @ 30 dBm\n" + -" BSS Load:\n" + -" * station count: 14\n" + -" * channel utilisation: 16/255\n" + -" * available admission capacity: 23437 [*32us]\n" + -" HT capabilities:\n" + -" Capabilities: 0x19ac\n" + -" HT20\n" + -" SM Power Save disabled\n" + -" RX HT20 SGI\n" + -" TX STBC\n" + -" RX STBC 1-stream\n" + -" Max AMSDU length: 7935 bytes\n" + -" DSSS/CCK HT40\n" + -" Maximum RX AMPDU length 65535 bytes (exponent: 0x003)\n" + -" Minimum RX AMPDU time spacing: 8 usec (0x06)\n" + -" HT RX MCS rate indexes supported: 0-23\n" + -" HT TX MCS rate indexes are undefined\n" + -" HT operation:\n" + -" * primary channel: 52\n" + -" * secondary channel offset: no secondary\n" + -" * STA channel width: 20 MHz\n" + -" * RIFS: 1\n" + -" * HT protection: no\n" + -" * non-GF present: 1\n" + -" * OBSS non-GF present: 0\n" + -" * dual beacon: 0\n" + -" * dual CTS protection: 0\n" + -" * STBC beacon: 0\n" + -" * L-SIG TXOP Prot: 0\n" + -" * PCO active: 0\n" + -" * PCO phase: 0\n" + -" Extended capabilities: Proxy ARP Service, WNM-Notification, 6\n" + -" VHT capabilities:\n" + -" VHT Capabilities (0x0f8379b2):\n" + -" Max MPDU length: 11454\n" + -" Supported Channel Width: neither 160 nor 80+80\n" + -" RX LDPC\n" + -" short GI (80 MHz)\n" + -" TX STBC\n" + -" SU Beamformer\n" + -" SU Beamformee\n" + -" VHT RX MCS set:\n" + -" 1 streams: MCS 0-9\n" + -" 2 streams: MCS 0-9\n" + -" 3 streams: MCS 0-9\n" + -" 4 streams: not supported\n" + -" 5 streams: not supported\n" + -" 6 streams: not supported\n" + -" 7 streams: not supported\n" + -" 8 streams: not supported\n" + -" VHT RX highest supported: 0 Mbps\n" + -" VHT TX MCS set:\n" + -" 1 streams: MCS 0-9\n" + -" 2 streams: MCS 0-9\n" + -" 3 streams: MCS 0-9\n" + -" 4 streams: not supported\n" + -" 5 streams: not supported\n" + -" 6 streams: not supported\n" + -" 7 streams: not supported\n" + -" 8 streams: not supported\n" + -" VHT TX highest supported: 0 Mbps\n" + -" VHT operation:\n" + -" * channel width: 0 (20 or 40 MHz)\n" + -" * center freq segment 1: 0\n" + -" * center freq segment 2: 0\n" + -" * VHT basic MCS set: 0x0000\n" + -" WMM: * Parameter version 1\n" + -" * u-APSD\n" + -" * BE: CW 15-1023, AIFSN 3\n" + -" * BK: CW 15-1023, AIFSN 7\n" + -" * VI: CW 7-15, AIFSN 2, TXOP 3008 usec\n" + -" * VO: CW 3-7, AIFSN 2, TXOP 1504 usec\n" + -"BSS 6c:70:9f:e7:d8:b3(on wlan0)\n" + -" TSF: 337644811 usec (0d, 00:05:37)\n" + -" freq: 5180\n" + -" beacon interval: 100 TUs\n" + -" capability: ESS Privacy SpectrumMgmt RadioMeasure (0x1111)\n" + -" signal: -77.00 dBm\n" + -" last seen: 2110 ms ago\n" + -" Information elements from Probe Response frame:\n" + -" SSID: QA Lab 5GHz\n" + -" Supported rates: 6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 \n" + -" Country: US Environment: Indoor/Outdoor\n" + -" Channels [36 - 36] @ 17 dBm\n" + -" Channels [40 - 40] @ 17 dBm\n" + -" Channels [44 - 44] @ 17 dBm\n" + -" Channels [48 - 48] @ 17 dBm\n" + -" Channels [52 - 52] @ 24 dBm\n" + -" Channels [56 - 56] @ 24 dBm\n" + -" Channels [60 - 60] @ 24 dBm\n" + -" Channels [64 - 64] @ 24 dBm\n" + -" Channels [100 - 100] @ 24 dBm\n" + -" Channels [104 - 104] @ 24 dBm\n" + -" Channels [108 - 108] @ 24 dBm\n" + -" Channels [112 - 112] @ 24 dBm\n" + -" Channels [116 - 116] @ 24 dBm\n" + -" Channels [132 - 132] @ 24 dBm\n" + -" Channels [136 - 136] @ 24 dBm\n" + -" Channels [140 - 140] @ 24 dBm\n" + -" Channels [144 - 144] @ 24 dBm\n" + -" Channels [149 - 149] @ 30 dBm\n" + -" Channels [153 - 153] @ 30 dBm\n" + -" Channels [157 - 157] @ 30 dBm\n" + -" Channels [161 - 161] @ 30 dBm\n" + -" Channels [165 - 165] @ 30 dBm\n" + -" Power constraint: 0 dB\n" + -" TPC report: TX power: 17 dBm\n" + -" RSN: * Version: 1\n" + -" * Group cipher: CCMP\n" + -" * Pairwise ciphers: CCMP\n" + -" * Authentication suites: PSK\n" + -" * Capabilities: 1-PTKSA-RC 1-GTKSA-RC (0x0000)\n" + -" HT capabilities:\n" + -" Capabilities: 0x9ef\n" + -" RX LDPC\n" + -" HT20/HT40\n" + -" SM Power Save disabled\n" + -" RX HT20 SGI\n" + -" RX HT40 SGI\n" + -" TX STBC\n" + -" RX STBC 1-stream\n" + -" Max AMSDU length: 7935 bytes\n" + -" No DSSS/CCK HT40\n" + -" Maximum RX AMPDU length 65535 bytes (exponent: 0x003)\n" + -" Minimum RX AMPDU time spacing: 4 usec (0x05)\n" + -" HT RX MCS rate indexes supported: 0-23\n" + -" HT TX MCS rate indexes are undefined\n" + -" HT operation:\n" + -" * primary channel: 36\n" + -" * secondary channel offset: above\n" + -" * STA channel width: any\n" + -" * RIFS: 1\n" + -" * HT protection: no\n" + -" * non-GF present: 0\n" + -" * OBSS non-GF present: 0\n" + -" * dual beacon: 0\n" + -" * dual CTS protection: 0\n" + -" * STBC beacon: 0\n" + -" * L-SIG TXOP Prot: 0\n" + -" * PCO active: 0\n" + -" * PCO phase: 0\n" + -" Extended capabilities: 6\n" + -" VHT capabilities:\n" + -" VHT Capabilities (0x0f8259b2):\n" + -" Max MPDU length: 11454\n" + -" Supported Channel Width: neither 160 nor 80+80\n" + -" RX LDPC\n" + -" short GI (80 MHz)\n" + -" TX STBC\n" + -" SU Beamformer\n" + -" SU Beamformee\n" + -" VHT RX MCS set:\n" + -" 1 streams: MCS 0-9\n" + -" 2 streams: MCS 0-9\n" + -" 3 streams: MCS 0-9\n" + -" 4 streams: not supported\n" + -" 5 streams: not supported\n" + -" 6 streams: not supported\n" + -" 7 streams: not supported\n" + -" 8 streams: not supported\n" + -" VHT RX highest supported: 0 Mbps\n" + -" VHT TX MCS set:\n" + -" 1 streams: MCS 0-9\n" + -" 2 streams: MCS 0-9\n" + -" 3 streams: MCS 0-9\n" + -" 4 streams: not supported\n" + -" 5 streams: not supported\n" + -" 6 streams: not supported\n" + -" 7 streams: not supported\n" + -" 8 streams: not supported\n" + -" VHT TX highest supported: 0 Mbps\n" + -" VHT operation:\n" + -" * channel width: 1 (80 MHz)\n" + -" * center freq segment 1: 42\n" + -" * center freq segment 2: 0\n" + -" * VHT basic MCS set: 0x0000\n" + -" WMM: * Parameter version 1\n" + -" * u-APSD\n" + -" * BE: CW 15-1023, AIFSN 3\n" + -" * BK: CW 15-1023, AIFSN 7\n" + -" * VI: CW 7-15, AIFSN 2, TXOP 3008 usec\n" + -" * VO: CW 3-7, AIFSN 2, TXOP 1504 usec\n" + -"BSS 2c:30:33:ec:4b:24(on wlan0)\n" + -" TSF: 337644493 usec (0d, 00:05:37)\n" + -" freq: 2437\n" + -" beacon interval: 31 TUs\n" + -" capability: ESS Privacy ShortPreamble SpectrumMgmt ShortSlotTime RadioMeasure (0x1531)\n" + -" signal: -68.00 dBm\n" + -" last seen: 0 ms ago\n" + -" Information elements from Probe Response frame:\n" + -" SSID: NETGEAR03\n" + -" Supported rates: 1.0* 2.0* 5.5 11.0 18.0 24.0 36.0 54.0 \n" + -" DS Parameter set: channel 6\n" + -" Country: US Environment: Indoor/Outdoor\n" + -" Channels [1 - 11] @ 30 dBm\n" + -" Power constraint: 0 dB\n" + -" TPC report: TX power: 25 dBm\n" + -" ERP: \n" + -" ERP D4.0: \n" + -" RSN: * Version: 1\n" + -" * Group cipher: CCMP\n" + -" * Pairwise ciphers: CCMP\n" + -" * Authentication suites: PSK\n" + -" * Capabilities: 16-PTKSA-RC 1-GTKSA-RC (0x000c)\n" + -" Extended supported rates: 6.0 9.0 12.0 48.0 \n" + -" BSS Load:\n" + -" * station count: 1\n" + -" * channel utilisation: 166/255\n" + -" * available admission capacity: 0 [*32us]\n" + -" HT capabilities:\n" + -" Capabilities: 0x19b0\n" + -" HT20\n" + -" Static SM Power Save\n" + -" RX Greenfield\n" + -" RX HT20 SGI\n" + -" TX STBC\n" + -" RX STBC 1-stream\n" + -" Max AMSDU length: 7935 bytes\n" + -" DSSS/CCK HT40\n" + -" Maximum RX AMPDU length 65535 bytes (exponent: 0x003)\n" + -" Minimum RX AMPDU time spacing: 8 usec (0x06)\n" + -" HT RX MCS rate indexes supported: 0-15\n" + -" HT TX MCS rate indexes are undefined\n" + -" HT operation:\n" + -" * primary channel: 6\n" + -" * secondary channel offset: no secondary\n" + -" * STA channel width: 20 MHz\n" + -" * RIFS: 1\n" + -" * HT protection: no\n" + -" * non-GF present: 1\n" + -" * OBSS non-GF present: 0\n" + -" * dual beacon: 0\n" + -" * dual CTS protection: 0\n" + -" * STBC beacon: 0\n" + -" * L-SIG TXOP Prot: 0\n" + -" * PCO active: 0\n" + -" * PCO phase: 0\n" + -" Extended capabilities: Extended Channel Switching, BSS Transition, 6\n" + -" WPS: * Version: 1.0\n" + -" * Wi-Fi Protected Setup State: 2 (Configured)\n" + -" * Response Type: 3 (AP)\n" + -" * UUID: 00000000-0000-0000-0000-000000000000\n" + -" * Manufacturer: NETGEAR, Inc.\n" + -" * Model: VMB3010\n" + -" * Model Number: VMB3010\n" + -" * Serial Number: 01\n" + -" * Primary Device Type: 6-0050f204-1\n" + -" * Device name: NTGRBS\n" + -" * Config methods: Label, PBC\n" + -" * RF Bands: 0x1\n" + -" WMM: * Parameter version 1\n" + -" * u-APSD\n" + -" * BE: CW 15-1023, AIFSN 3\n" + -" * BK: CW 15-1023, AIFSN 7\n" + -" * VI: CW 7-15, AIFSN 2, TXOP 6016 usec\n" + -" * VO: CW 3-7, AIFSN 2, TXOP 3264 usec\n" + -"BSS 7c:0e:ce:b7:d7:90(on wlan0)\n" + -" TSF: 239785397355 usec (2d, 18:36:25)\n" + -" freq: 2412\n" + -" beacon interval: 102 TUs\n" + -" capability: ESS Privacy ShortPreamble ShortSlotTime RadioMeasure (0x1431)\n" + -" signal: -77.00 dBm\n" + -" last seen: 10 ms ago\n" + -" Information elements from Probe Response frame:\n" + -" SSID: Flex-Skynet\n" + -" Supported rates: 1.0* 2.0* 5.5* 6.0 9.0 11.0* 12.0 18.0 \n" + -" DS Parameter set: channel 1\n" + -" Country: US Environment: Indoor/Outdoor\n" + -" Channels [1 - 11] @ 30 dBm\n" + -" BSS Load:\n" + -" * station count: 2\n" + -" * channel utilisation: 201/255\n" + -" * available admission capacity: 23437 [*32us]\n" + -" ERP: \n" + -" HT capabilities:\n" + -" Capabilities: 0x19ac\n" + -" HT20\n" + -" SM Power Save disabled\n" + -" RX HT20 SGI\n" + -" TX STBC\n" + -" RX STBC 1-stream\n" + -" Max AMSDU length: 7935 bytes\n" + -" DSSS/CCK HT40\n" + -" Maximum RX AMPDU length 65535 bytes (exponent: 0x003)\n" + -" Minimum RX AMPDU time spacing: 8 usec (0x06)\n" + -" HT RX MCS rate indexes supported: 0-23\n" + -" HT TX MCS rate indexes are undefined\n" + -" RSN: * Version: 1\n" + -" * Group cipher: CCMP\n" + -" * Pairwise ciphers: CCMP\n" + -" * Authentication suites: IEEE 802.1X\n" + -" * Capabilities: 4-PTKSA-RC 4-GTKSA-RC (0x0028)\n" + -" Extended supported rates: 24.0 36.0 48.0 54.0 \n" + -" HT operation:\n" + -" * primary channel: 1\n" + -" * secondary channel offset: no secondary\n" + -" * STA channel width: 20 MHz\n" + -" * RIFS: 0\n" + -" * HT protection: nonmember\n" + -" * non-GF present: 1\n" + -" * OBSS non-GF present: 0\n" + -" * dual beacon: 0\n" + -" * dual CTS protection: 0\n" + -" * STBC beacon: 0\n" + -" * L-SIG TXOP Prot: 0\n" + -" * PCO active: 0\n" + -" * PCO phase: 0\n" + -" Extended capabilities: Proxy ARP Service, WNM-Notification\n" + -" WMM: * Parameter version 1\n" + -" * u-APSD\n" + -" * BE: CW 15-1023, AIFSN 3\n" + -" * BK: CW 15-1023, AIFSN 7\n" + -" * VI: CW 7-15, AIFSN 2, TXOP 3008 usec\n" + -" * VO: CW 3-7, AIFSN 2, TXOP 1504 usec\n" + -"BSS cc:46:d6:3c:91:04(on wlan0)\n" + -" TSF: 337644462 usec (0d, 00:05:37)\n" + -" freq: 2412\n" + -" beacon interval: 102 TUs\n" + -" capability: ESS ShortPreamble ShortSlotTime RadioMeasure (0x1421)\n" + -" signal: -90.00 dBm\n" + -" last seen: 0 ms ago\n" + -" SSID: \\x00\n" + -" Supported rates: 1.0* 2.0* 5.5* 6.0 9.0 11.0* 12.0 18.0 \n" + -" DS Parameter set: channel 1\n" + -" TIM: DTIM Count 0 DTIM Period 1 Bitmap Control 0x0 Bitmap[0] 0x0\n" + -" Country: US Environment: Indoor/Outdoor\n" + -" Channels [1 - 11] @ 30 dBm\n" + -" BSS Load:\n" + -" * station count: 1\n" + -" * channel utilisation: 190/255\n" + -" * available admission capacity: 23437 [*32us]\n" + -" ERP: \n" + -" HT capabilities:\n" + -" Capabilities: 0x19ac\n" + -" HT20\n" + -" SM Power Save disabled\n" + -" RX HT20 SGI\n" + -" TX STBC\n" + -" RX STBC 1-stream\n" + -" Max AMSDU length: 7935 bytes\n" + -" DSSS/CCK HT40\n" + -" Maximum RX AMPDU length 65535 bytes (exponent: 0x003)\n" + -" Minimum RX AMPDU time spacing: 8 usec (0x06)\n" + -" HT RX MCS rate indexes supported: 0-23\n" + -" HT TX MCS rate indexes are undefined\n" + -" Extended supported rates: 24.0 36.0 48.0 54.0 \n" + -" HT operation:\n" + -" * primary channel: 1\n" + -" * secondary channel offset: no secondary\n" + -" * STA channel width: 20 MHz\n" + -" * RIFS: 0\n" + -" * HT protection: nonmember\n" + -" * non-GF present: 1\n" + -" * OBSS non-GF present: 0\n" + -" * dual beacon: 0\n" + -" * dual CTS protection: 0\n" + -" * STBC beacon: 0\n" + -" * L-SIG TXOP Prot: 0\n" + -" * PCO active: 0\n" + -" * PCO phase: 0\n" + -" Extended capabilities: Proxy ARP Service, WNM-Notification\n" + -" WMM: * Parameter version 1\n" + -" * u-APSD\n" + -" * BE: CW 15-1023, AIFSN 3\n" + -" * BK: CW 15-1023, AIFSN 7\n" + -" * VI: CW 7-15, AIFSN 2, TXOP 3008 usec\n" + -" * VO: CW 3-7, AIFSN 2, TXOP 1504 usec\n" + -"BSS 14:91:82:bd:15:61(on wlan0)\n" + -" TSF: 337644716 usec (0d, 00:05:37)\n" + -" freq: 2457\n" + -" beacon interval: 100 TUs\n" + -" capability: ESS Privacy ShortSlotTime (0x0411)\n" + -" signal: -88.00 dBm\n" + -" last seen: 1070 ms ago\n" + -" Information elements from Probe Response frame:\n" + -" SSID: beast10\n" + -" Supported rates: 1.0* 2.0* 5.5* 11.0* 22.0 6.0 9.0 12.0 \n" + -" DS Parameter set: channel 10\n" + -" TIM: DTIM Count 1 DTIM Period 2 Bitmap Control 0x0 Bitmap[0] 0x0\n" + -" ERP: \n" + -" Extended supported rates: 18.0 24.0 36.0 48.0 54.0 \n" + -" Extended capabilities: 6\n" + -" VHT capabilities:\n" + -" VHT Capabilities (0x33801831):\n" + -" Max MPDU length: 7991\n" + -" Supported Channel Width: neither 160 nor 80+80\n" + -" RX LDPC\n" + -" short GI (80 MHz)\n" + -" SU Beamformer\n" + -" SU Beamformee\n" + -" RX antenna pattern consistency\n" + -" TX antenna pattern consistency\n" + -" VHT RX MCS set:\n" + -" 1 streams: MCS 0-9\n" + -" 2 streams: MCS 0-9\n" + -" 3 streams: MCS 0-9\n" + -" 4 streams: not supported\n" + -" 5 streams: not supported\n" + -" 6 streams: not supported\n" + -" 7 streams: not supported\n" + -" 8 streams: not supported\n" + -" VHT RX highest supported: 0 Mbps\n" + -" VHT TX MCS set:\n" + -" 1 streams: MCS 0-9\n" + -" 2 streams: MCS 0-9\n" + -" 3 streams: MCS 0-9\n" + -" 4 streams: not supported\n" + -" 5 streams: not supported\n" + -" 6 streams: not supported\n" + -" 7 streams: not supported\n" + -" 8 streams: not supported\n" + -" VHT TX highest supported: 0 Mbps\n" + -" VHT operation:\n" + -" * channel width: 0 (20 or 40 MHz)\n" + -" * center freq segment 1: 0\n" + -" * center freq segment 2: 0\n" + -" * VHT basic MCS set: 0xfffc\n" + -" WMM: * Parameter version 1\n" + -" * BE: CW 15-1023, AIFSN 3, TXOP 2048 usec\n" + -" * BK: CW 15-1023, AIFSN 7\n" + -" * VI: CW 7-15, AIFSN 2, TXOP 3008 usec\n" + -" * VO: CW 3-7, AIFSN 2, TXOP 1504 usec\n" - -describe('iw', function() { - describe('iw.scan(interface, callback)', function() { - it('should scan the specified interface', function(done) { - iw.exec = function(command, callback) { - should(command).eql('iw dev wlan0 scan'); - callback(null, IW_SCAN_LINUX, ''); - }; - - iw.scan('wlan0', function(err, status) { - should(status).eql([ - { frequency: 5260, - address: "f4:0f:1b:b5:5b:4d", - signal: -59, - lastSeenMs: 4530, - ssid: 'Wink-Visitor', - channel: 52, - security: 'wpa' }, - { frequency: 5260, - address: "f4:0f:1b:b5:5b:4e", - signal: -59, - lastSeenMs: 4530, - ssid: 'Flex-Visitor', - channel: 52, - security: 'open' }, - { frequency: 2437, - address: "2c:30:33:ec:4b:24", - signal: -68, - lastSeenMs: 0, - ssid: 'NETGEAR03', - channel: 6, - security: 'wpa2' }, - { frequency: 5180, - address: "6c:70:9f:e7:d8:b3", - signal: -77, - lastSeenMs: 2110, - ssid: 'QA Lab 5GHz', - channel: 36, - security: 'wpa2' }, - { frequency: 2412, - address: "7c:0e:ce:b7:d7:90", - signal: -77, - lastSeenMs: 10, - ssid: 'Flex-Skynet', - channel: 1, - security: 'wpa2' }, - { frequency: 2412, - address: "14:91:82:c7:76:b9", - signal: -87, - lastSeenMs: 0, - ssid: 'creamcorn', - channel: 1, - security: 'wpa2' }, - { frequency: 2457, - address: "14:91:82:bd:15:61", - signal: -88, - lastSeenMs: 1070, - ssid: 'beast10', - channel: 10, - security: 'wep' }, - ]); - done(); - }); - }) - - it('should scan the specified interface and show hidden ssid networks', function(done) { - iw.exec = function(command, callback) { - should(command).eql('iw dev wlan0 scan'); - callback(null, IW_SCAN_LINUX, ''); - }; - - var options = { - iface: 'wlan0', - show_hidden: true - }; - - iw.scan(options, function(err, status) { - should(status).eql([ - { frequency: 5260, - address: "f4:0f:1b:b5:5b:4d", - signal: -59, - lastSeenMs: 4530, - ssid: 'Wink-Visitor', - channel: 52, - security: 'wpa' }, - { frequency: 5260, - address: "f4:0f:1b:b5:5b:4e", - signal: -59, - lastSeenMs: 4530, - ssid: 'Flex-Visitor', - channel: 52, - security: 'open' }, - { frequency: 2437, - address: "2c:30:33:ec:4b:24", - signal: -68, - lastSeenMs: 0, - ssid: 'NETGEAR03', - channel: 6, - security: 'wpa2' }, - { frequency: 5180, - address: "6c:70:9f:e7:d8:b3", - signal: -77, - lastSeenMs: 2110, - ssid: 'QA Lab 5GHz', - channel: 36, - security: 'wpa2' }, - { frequency: 2412, - address: "7c:0e:ce:b7:d7:90", - signal: -77, - lastSeenMs: 10, - ssid: 'Flex-Skynet', - channel: 1, - security: 'wpa2' }, - { frequency: 2412, - address: "14:91:82:c7:76:b9", - signal: -87, - lastSeenMs: 0, - ssid: 'creamcorn', - channel: 1, - security: 'wpa2' }, - { frequency: 2457, - address: "14:91:82:bd:15:61", - signal: -88, - lastSeenMs: 1070, - ssid: 'beast10', - channel: 10, - security: 'wep' }, - { frequency: 2412, - address: "cc:46:d6:3c:91:04", - signal: -90, - lastSeenMs: 0, - channel: 1, - security: 'open' }, - ]); - done(); - }); - }) - - it('should scan the specified interface and not show hidden ssid networks', function(done) { - iw.exec = function(command, callback) { - should(command).eql('iw dev wlan0 scan'); - callback(null, IW_SCAN_LINUX, ''); - }; - - var options = { - iface: 'wlan0' - }; - - iw.scan(options, function(err, status) { - should(status).eql([ - { frequency: 5260, - address: "f4:0f:1b:b5:5b:4d", - signal: -59, - lastSeenMs: 4530, - ssid: 'Wink-Visitor', - channel: 52, - security: 'wpa' }, - { frequency: 5260, - address: "f4:0f:1b:b5:5b:4e", - signal: -59, - lastSeenMs: 4530, - ssid: 'Flex-Visitor', - channel: 52, - security: 'open' }, - { frequency: 2437, - address: "2c:30:33:ec:4b:24", - signal: -68, - lastSeenMs: 0, - ssid: 'NETGEAR03', - channel: 6, - security: 'wpa2' }, - { frequency: 5180, - address: "6c:70:9f:e7:d8:b3", - signal: -77, - lastSeenMs: 2110, - ssid: 'QA Lab 5GHz', - channel: 36, - security: 'wpa2' }, - { frequency: 2412, - address: "7c:0e:ce:b7:d7:90", - signal: -77, - lastSeenMs: 10, - ssid: 'Flex-Skynet', - channel: 1, - security: 'wpa2' }, - { frequency: 2412, - address: "14:91:82:c7:76:b9", - signal: -87, - lastSeenMs: 0, - ssid: 'creamcorn', - channel: 1, - security: 'wpa2' }, - { frequency: 2457, - address: "14:91:82:bd:15:61", - signal: -88, - lastSeenMs: 1070, - ssid: 'beast10', - channel: 10, - security: 'wep' }, - ]); - done(); - }); - }) - - it('should handle errors', function(done) { - iw.exec = function(command, callback) { - callback('error'); - }; - - iw.scan('wlan0', function(err, status) { - should(err).eql('error'); - done(); - }); - }) - }) -}) diff --git a/plugins/music_service/squeezelite/node_modules/wireless-tools/test/iwconfig.js b/plugins/music_service/squeezelite/node_modules/wireless-tools/test/iwconfig.js deleted file mode 100644 index c78f3eaf4..000000000 --- a/plugins/music_service/squeezelite/node_modules/wireless-tools/test/iwconfig.js +++ /dev/null @@ -1,201 +0,0 @@ -/* - * Copyright (c) 2015 Christopher M. Baker - * - * 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. - * - */ - -var should = require('should'); -var iwconfig = require('../iwconfig'); - -var IWCONFIG_STATUS_LINUX = [ - 'wlan0 IEEE 802.11bg ESSID:"RaspberryPi" Nickname:""', - ' Mode:Master Frequency:2.437 GHz Access Point: 00:0B:81:95:12:21', - ' Bit Rate:54 Mb/s Sensitivity:0/0', - ' Retry:off RTS thr:off Fragment thr:off', - ' Power Management:off', - ' Link Quality=18/100 Signal level=11/100 Noise level=0/100', - ' Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0', - ' Tx excessive retries:0 Invalid misc:0 Missed beacon:0', - '', - '', - '', - 'wlan1 unassociated Nickname:""', - ' Mode:Auto Frequency=2.412 GHz Access Point: Not-Associated', - ' Sensitivity:0/0', - ' Retry:off RTS thr:off Fragment thr:off', - ' Power Management:off', - ' Link Quality:0 Signal level:0 Noise level:0', - ' Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0', - ' Tx excessive retries:0 Invalid misc:0 Missed beacon:0', - '', - 'lo no wireless extensions.', - '' -].join('\n'); - -var IWCONFIG_STATUS_INTERFACE_LINUX = [ - 'wlan0 IEEE 802.11bg ESSID:"RaspberryPi" Nickname:""', - ' Mode:Master Frequency:2.437 GHz Access Point: 00:0B:81:95:12:21', - ' Bit Rate:54 Mb/s Sensitivity:0/0', - ' Retry:off RTS thr:off Fragment thr:off', - ' Power Management:off', - ' Link Quality=18/100 Signal level=11/100 Noise level=0/100', - ' Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0', - ' Tx excessive retries:0 Invalid misc:0 Missed beacon:0', - '' -].join('\n'); - -var IWCONFIG_STATUS_INTERFACE_LINUX2 = [ - 'wlan0 IEEE 802.11abgn ESSID:"FAKE-Wifi"', - ' Mode:Managed Frequency:2.412 GHz Access Point: 00:0B:81:95:12:21', - ' Bit Rate=36 Mb/s Tx-Power=22 dBm', - ' Retry short limit:7 RTS thr:off Fragment thr:off', - ' Encryption key:off', - ' Power Management:on', - ' Link Quality=63/70 Signal level=-47 dBm', - ' Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0', - ' Tx excessive retries:0 Invalid misc:0 Missed beacon:0', - '' -].join('\n'); - -describe('iwconfig', function() { - describe('iwconfig.status(callback)', function() { - it('should get the status for each interface', function(done) { - iwconfig.exec = function(command, callback) { - should(command).eql('iwconfig'); - callback(null, IWCONFIG_STATUS_LINUX, ''); - }; - - iwconfig.status(function(err, status) { - should(status).eql([ - { - interface: 'wlan0', - ssid: 'RaspberryPi', - access_point: '00:0b:81:95:12:21', - ieee: '802.11bg', - mode: 'master', - frequency: 2.437, - sensitivity: 0, - quality: 18, - signal: 11, - noise: 0 - }, - { - interface: 'wlan1', - unassociated: true, - mode: 'auto', - frequency: 2.412, - sensitivity: 0, - quality: 0, - signal: 0, - noise: 0 - }, - { - interface: 'lo' - } - ]); - - done(); - }); - }) - - it('should handle errors', function(done) { - iwconfig.exec = function(command, callback) { - callback('error'); - }; - - iwconfig.status(function(err, status) { - should(err).eql('error'); - done(); - }); - }) - }) - - describe('iwconfig.status(interface, callback)', function() { - it('should get the status for the specified interface', function(done) { - iwconfig.exec = function(command, callback) { - should(command).eql('iwconfig wlan0'); - callback(null, IWCONFIG_STATUS_INTERFACE_LINUX, ''); - }; - - iwconfig.status('wlan0', function(err, status) { - should(status).eql({ - interface: 'wlan0', - ssid: 'RaspberryPi', - access_point: '00:0b:81:95:12:21', - ieee: '802.11bg', - mode: 'master', - frequency: 2.437, - sensitivity: 0, - quality: 18, - signal: 11, - noise: 0 - }); - - done(); - }); - }) - - it('should handle errors', function(done) { - iwconfig.exec = function(command, callback) { - callback('error'); - }; - - iwconfig.status('wlan0', function(err, status) { - should(err).eql('error'); - done(); - }); - }) - }) - - describe('iwconfig.status(interface, callback)', function() { - it('should get the status for the specified interface', function(done) { - iwconfig.exec = function(command, callback) { - should(command).eql('iwconfig wlan0'); - callback(null, IWCONFIG_STATUS_INTERFACE_LINUX2, ''); - }; - - iwconfig.status('wlan0', function(err, status) { - should(status).eql({ - interface: 'wlan0', - ssid: 'FAKE-Wifi', - access_point: '00:0b:81:95:12:21', - ieee: '802.11abgn', - mode: 'managed', - frequency: 2.412, - quality: 63, - signal: -47 - }); - - done(); - }); - }) - - it('should handle errors', function(done) { - iwconfig.exec = function(command, callback) { - callback('error'); - }; - - iwconfig.status('wlan0', function(err, status) { - should(err).eql('error'); - done(); - }); - }) - }) -}) diff --git a/plugins/music_service/squeezelite/node_modules/wireless-tools/test/iwlist.js b/plugins/music_service/squeezelite/node_modules/wireless-tools/test/iwlist.js deleted file mode 100644 index b333104d4..000000000 --- a/plugins/music_service/squeezelite/node_modules/wireless-tools/test/iwlist.js +++ /dev/null @@ -1,368 +0,0 @@ -/* - * Copyright (c) 2015 Christopher M. Baker - * - * 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. - * - */ - -var should = require('should'); -var iwlist = require('../iwlist'); - -var IWLIST_SCAN_LINUX = [ -'Cell 01 - Address: 00:0B:81:95:12:21', -' ESSID:"RaspberryPi"', -' Protocol:IEEE 802.11bgn', -' Mode:Master', -' Frequency:2.437 GHz (Channel 6)', -' Encryption key:on', -' Bit Rates:144 Mb/s', -' Extra:rsn_ie=00000000000000000000000000000000000000000000', -' IE: IEEE 802.11i/WPA2 Version 1', -' Group Cipher : CCMP', -' Pairwise Ciphers (1) : CCMP', -' Authentication Suites (1) : PSK', -' IE: Unknown: 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', -' Quality=58/100 Signal level=83/100', -'Cell 02 - Address: 00:0B:81:AB:14:22', -' ESSID:"BlueberryPi"', -' Protocol:IEEE 802.11bgn', -' Mode:Master', -' Frequency:2.437 GHz (Channel 6)', -' Encryption key:on', -' Bit Rates:144 Mb/s', -' IE: WPA Version 1', -' Group Cipher : TKIP', -' Pairwise Ciphers (2) : CCMP TKIP', -' Authentication Suites (1) : PSK', -' Extra:rsn_ie=0000000000000000000000000000000000000000000000000000', -' Quality=48/100 Signal level=87/100', -'Cell 03 - Address: 00:0B:81:CD:F2:04', -' ESSID:"BlackberryPi"', -' Protocol:IEEE 802.11bgn', -' Mode:Master', -' Frequency:2.437 GHz (Channel 6)', -' Encryption key:on', -' Bit Rates:144 Mb/s', -' IE: Unknown: 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', -' Extra:rsn_ie=0000000000000000000000000000000000000000000000000000', -' Quality=48/100 Signal level=80/100', -'Cell 04 - Address: 00:0B:81:FD:42:14', -' ESSID:"CranberryPi"', -' Protocol:IEEE 802.11bgn', -' Mode:Master', -' Frequency:2.437 GHz (Channel 6)', -' Encryption key:off', -' Bit Rates:144 Mb/s', -' IE: Unknown: 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', -' Quality:4/5 Signal level:-60 dBm Noise level:-92 dBm', -'Cell 05 - Address: 2C:C5:D3:02:AE:4C', -' Channel:100', -' Frequency:5.5 GHz (Channel 100)', -' Quality=65/70 Signal level=-45 dBm', -' Encryption key:on', -' ESSID:""', -' Bit Rates:24 Mb/s; 36 Mb/s; 48 Mb/s; 54 Mb/s', -' Mode:Master', -' Extra:tsf=0000003d2a54d03b', -' Extra: Last beacon: 3360ms ago', -' IE: Unknown: DD180050F20201018E0003A4000027A4000042435E0062322F00', -' IE: Unknown: 2D1AAD091BF8FE000000000000000000001000000000000000000000', -' IE: Unknown: 3D1664000000000000000000000000000000000000000000', -' IE: IEEE 802.11i/WPA2 Version 1', -' Group Cipher : CCMP', -' Pairwise Ciphers (1) : CCMP', -' Authentication Suites (1) : PSK' -].join('\n'); - -var IWLIST_SCAN_LINUX_ACTIVE_SCAN = [ -'Cell 01 - Address: 00:0B:81:95:12:21', -' ESSID:"RaspberryPi"', -' Protocol:IEEE 802.11bgn', -' Mode:Master', -' Frequency:2.437 GHz (Channel 6)', -' Encryption key:on', -' Bit Rates:144 Mb/s', -' Extra:rsn_ie=00000000000000000000000000000000000000000000', -' IE: IEEE 802.11i/WPA2 Version 1', -' Group Cipher : CCMP', -' Pairwise Ciphers (1) : CCMP', -' Authentication Suites (1) : PSK', -' IE: Unknown: 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', -' Quality=58/100 Signal level=83/100', -'Cell 02 - Address: 00:0B:81:AB:14:22', -' ESSID:"BlueberryPi"', -' Protocol:IEEE 802.11bgn', -' Mode:Master', -' Frequency:2.437 GHz (Channel 6)', -' Encryption key:on', -' Bit Rates:144 Mb/s', -' IE: WPA Version 1', -' Group Cipher : TKIP', -' Pairwise Ciphers (2) : CCMP TKIP', -' Authentication Suites (1) : PSK', -' Extra:rsn_ie=0000000000000000000000000000000000000000000000000000', -' Quality=48/100 Signal level=87/100', -'Cell 03 - Address: 00:0B:81:CD:F2:04', -' ESSID:"BlackberryPi"', -' Protocol:IEEE 802.11bgn', -' Mode:Master', -' Frequency:2.437 GHz (Channel 6)', -' Encryption key:on', -' Bit Rates:144 Mb/s', -' IE: Unknown: 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', -' Extra:rsn_ie=0000000000000000000000000000000000000000000000000000', -' Quality=48/100 Signal level=80/100', -'Cell 04 - Address: 00:0B:81:FD:42:14', -' ESSID:"CranberryPi"', -' Protocol:IEEE 802.11bgn', -' Mode:Master', -' Frequency:2.437 GHz (Channel 6)', -' Encryption key:off', -' Bit Rates:144 Mb/s', -' IE: Unknown: 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', -' Quality=32/100 Signal level=71/100', -'Cell 05 - Address: 2C:C5:D3:02:AE:4C', -' Channel:100', -' Frequency:5.5 GHz (Channel 100)', -' Quality=65/70 Signal level=-45 dBm', -' Encryption key:on', -' ESSID:"hidden-ssid"', -' Bit Rates:24 Mb/s; 36 Mb/s; 48 Mb/s; 54 Mb/s', -' Mode:Master', -' Extra:tsf=0000003d2a54d03b', -' Extra: Last beacon: 3360ms ago', -' IE: Unknown: DD180050F20201018E0003A4000027A4000042435E0062322F00', -' IE: Unknown: 2D1AAD091BF8FE000000000000000000001000000000000000000000', -' IE: Unknown: 3D1664000000000000000000000000000000000000000000', -' IE: IEEE 802.11i/WPA2 Version 1', -' Group Cipher : CCMP', -' Pairwise Ciphers (1) : CCMP', -' Authentication Suites (1) : PSK' -].join('\n'); - -describe('iwlist', function() { - describe('iwlist.scan(interface, callback)', function() { - it('should scan the specified interface', function(done) { - iwlist.exec = function(command, callback) { - should(command).eql('iwlist wlan0 scan'); - callback(null, IWLIST_SCAN_LINUX, ''); - }; - - iwlist.scan('wlan0', function(err, status) { - should(status).eql([ - { - address: '00:0b:81:ab:14:22', - ssid: 'BlueberryPi', - mode: 'master', - frequency: 2.437, - channel: 6, - security: 'wpa', - quality: 48, - signal: 87 - }, - { - address: '00:0b:81:95:12:21', - ssid: 'RaspberryPi', - mode: 'master', - frequency: 2.437, - channel: 6, - security: 'wpa2', - quality: 58, - signal: 83 - }, - { - address: '00:0b:81:cd:f2:04', - ssid: 'BlackberryPi', - mode: 'master', - frequency: 2.437, - channel: 6, - security: 'wep', - quality: 48, - signal: 80 - }, - { - address: '00:0b:81:fd:42:14', - ssid: 'CranberryPi', - mode: 'master', - frequency: 2.437, - channel: 6, - security: 'open', - quality: 4, - signal: -60, - noise: -92 - } - ]); - - done(); - }); - }) - - it('should scan the specified interface and show hidden ssid networks', function(done) { - iwlist.exec = function(command, callback) { - should(command).eql('iwlist wlan0 scan'); - callback(null, IWLIST_SCAN_LINUX, ''); - }; - - var options = { - iface: 'wlan0', - show_hidden: true - }; - - iwlist.scan(options, function(err, status) { - should(status).eql( - [ - { - address: '00:0b:81:ab:14:22', - channel: 6, - frequency: 2.437, - mode: 'master', - quality: 48, - signal: 87, - ssid: 'BlueberryPi', - security: 'wpa' - }, - { - address: '00:0b:81:95:12:21', - channel: 6, - frequency: 2.437, - mode: 'master', - quality: 58, - signal: 83, - ssid: 'RaspberryPi', - security: 'wpa2' - }, - { - address: '00:0b:81:cd:f2:04', - channel: 6, - frequency: 2.437, - mode: 'master', - quality: 48, - signal: 80, - ssid: 'BlackberryPi', - security: 'wep' - }, - { - address: '2c:c5:d3:02:ae:4c', - channel: 100, - frequency: 5.5, - mode: 'master', - quality: 65, - signal: -45, - security: 'wpa2' - }, - { - address: '00:0b:81:fd:42:14', - channel: 6, - frequency: 2.437, - mode: 'master', - quality: 4, - signal: -60, - noise: -92, - ssid: 'CranberryPi', - security: 'open' - } - ]); - - done(); - }); - }) - - it('should scan the specified interface looking for hidden ssid', function(done) { - iwlist.exec = function(command, callback) { - should(command).eql('iwlist wlan0 scan essid hidden-ssid'); - callback(null, IWLIST_SCAN_LINUX_ACTIVE_SCAN, ''); - }; - - var options = { - iface: 'wlan0', - show_hidden: false, - ssid: 'hidden-ssid' - }; - - iwlist.scan(options, function(err, status) { - should(status).eql( - [ - { - address: '00:0b:81:ab:14:22', - channel: 6, - frequency: 2.437, - mode: 'master', - quality: 48, - signal: 87, - ssid: 'BlueberryPi', - security: 'wpa' - }, - { - address: '00:0b:81:95:12:21', - channel: 6, - frequency: 2.437, - mode: 'master', - quality: 58, - signal: 83, - ssid: 'RaspberryPi', - security: 'wpa2' - }, - { - address: '00:0b:81:cd:f2:04', - channel: 6, - frequency: 2.437, - mode: 'master', - quality: 48, - signal: 80, - ssid: 'BlackberryPi', - security: 'wep' - }, - { - address: '00:0b:81:fd:42:14', - channel: 6, - frequency: 2.437, - mode: 'master', - quality: 32, - signal: 71, - ssid: 'CranberryPi', - security: 'open' - }, - { - address: '2c:c5:d3:02:ae:4c', - channel: 100, - frequency: 5.5, - mode: 'master', - quality: 65, - signal: -45, - ssid: 'hidden-ssid', - security: 'wpa2' - } - ]); - - done(); - }); - }) - - it('should handle errors', function(done) { - iwlist.exec = function(command, callback) { - callback('error'); - }; - - iwlist.scan('wlan0', function(err, status) { - should(err).eql('error'); - done(); - }); - }) - }) -}) diff --git a/plugins/music_service/squeezelite/node_modules/wireless-tools/test/udhcpc.js b/plugins/music_service/squeezelite/node_modules/wireless-tools/test/udhcpc.js deleted file mode 100644 index 437050da9..000000000 --- a/plugins/music_service/squeezelite/node_modules/wireless-tools/test/udhcpc.js +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (c) 2015 Christopher M. Baker - * - * 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. - * - */ - -var should = require('should'); -var udhcpc = require('../udhcpc'); - -describe('udhcpc', function() { - describe('udhcpc.disable(options, callback)', function() { - it('should stop the daemons', function(done) { - udhcpc.exec = function(command, callback) { - should(command).eql( - 'kill `pgrep -f "^udhcpc -i wlan0"` || true'); - - callback(null, '', ''); - }; - - udhcpc.disable('wlan0', function(err) { - should(err).not.be.ok; - done(); - }); - }) - - it('should handle errors', function(done) { - udhcpc.exec = function(command, callback) { - callback('error'); - }; - - udhcpc.disable('wlan0', function(err) { - should(err).eql('error'); - done(); - }); - }) - }) - - describe('udhcpc.enable(options, callback)', function() { - it('should start the daemon', function(done) { - udhcpc.exec = function(command, callback) { - should(command).eql('udhcpc -i wlan0 -n'); - callback(null, '', ''); - }; - - var options = { - interface: 'wlan0' - }; - - udhcpc.enable(options, function(err) { - should(err).not.be.ok; - done(); - }); - }) - - it('should handle errors', function(done) { - udhcpc.exec = function(command, callback) { - callback('error'); - }; - - var options = { - interface: 'wlan0' - }; - - udhcpc.enable(options, function(err) { - should(err).eql('error'); - done(); - }); - }) - }) -}) diff --git a/plugins/music_service/squeezelite/node_modules/wireless-tools/test/udhcpd.js b/plugins/music_service/squeezelite/node_modules/wireless-tools/test/udhcpd.js deleted file mode 100644 index 795f588c5..000000000 --- a/plugins/music_service/squeezelite/node_modules/wireless-tools/test/udhcpd.js +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright (c) 2015 Christopher M. Baker - * - * 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. - * - */ - -var should = require('should'); -var udhcpd = require('../udhcpd'); - -describe('udhcpd', function() { - describe('udhcpd.disable(options, callback)', function() { - it('should stop the daemons', function(done) { - udhcpd.exec = function(command, callback) { - should(command).eql( - 'kill `pgrep -f "^udhcpd wlan0-udhcpd.conf"` || true'); - - callback(null, '', ''); - }; - - udhcpd.disable('wlan0', function(err) { - should(err).not.be.ok; - done(); - }); - }) - - it('should handle errors', function(done) { - udhcpd.exec = function(command, callback) { - callback('error'); - }; - - udhcpd.disable('wlan0', function(err) { - should(err).eql('error'); - done(); - }); - }) - }) - - describe('udhcpd.enable(options, callback)', function() { - it('should start the daemon', function(done) { - udhcpd.exec = function(command, callback) { - should(command).eql('cat <wlan0-udhcpd.conf' + - ' && udhcpd wlan0-udhcpd.conf' + - ' && rm -f wlan0-udhcpd.conf\n' + - 'interface wlan0\n' + - 'start 192.168.10.100\n' + - 'end 192.168.10.200\n' + - 'option router 192.168.10.1\n' + - 'option subnet 255.255.255.0\n' + - 'option dns 4.4.4.4\n' + - 'option dns 8.8.8.8'); - - callback(null, '', ''); - }; - - var options = { - interface: 'wlan0', - start: '192.168.10.100', - end: '192.168.10.200', - option: { - router: '192.168.10.1', - subnet: '255.255.255.0', - dns: [ '4.4.4.4', '8.8.8.8' ] - } - }; - - udhcpd.enable(options, function(err) { - should(err).not.be.ok; - done(); - }); - }) - - it('should handle errors', function(done) { - udhcpd.exec = function(command, callback) { - callback('error'); - }; - - var options = { - interface: 'wlan0', - start: '192.168.10.100', - end: '192.168.10.200', - option: { - router: '192.168.10.1', - subnet: '255.255.255.0', - dns: [ '4.4.4.4', '8.8.8.8' ] - } - }; - - udhcpd.enable(options, function(err) { - should(err).eql('error'); - done(); - }); - }) - }) -}) diff --git a/plugins/music_service/squeezelite/node_modules/wireless-tools/test/wpa_cli.js b/plugins/music_service/squeezelite/node_modules/wireless-tools/test/wpa_cli.js deleted file mode 100644 index fe004dcbe..000000000 --- a/plugins/music_service/squeezelite/node_modules/wireless-tools/test/wpa_cli.js +++ /dev/null @@ -1,660 +0,0 @@ -/* - * Copyright (c) 2015 Christopher M. Baker - * - * 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. - * - */ - -var should = require('should'); -var wpa_cli = require('../wpa_cli'); - -var WPA_CLI_STATUS_SILENCE = ''; - -var WPA_CLI_STATUS_COMPLETED = [ - 'bssid=2c:f5:d3:02:ea:d9', - 'freq=2412', - 'ssid=Fake-Wifi', - 'id=0', - 'mode=station', - 'pairwise_cipher=CCMP', - 'group_cipher=CCMP', - 'key_mgmt=WPA2-PSK', - 'wpa_state=COMPLETED', - 'ip_address=10.34.141.168', - 'p2p_device_address=e4:28:9c:a8:53:72', - 'address=e4:28:9c:a8:53:72', - 'uuid=e1cda789-8c88-53e8-ffff-31c304580c1e' -].join('\n'); - -var WPA_CLI_STATUS_4WAY_HANDSHAKE = [ - 'bssid=2c:f5:d3:02:ea:d9', - 'freq=2412', - 'ssid=Fake-Wifi', - 'id=0', - 'mode=station', - 'pairwise_cipher=CCMP', - 'group_cipher=CCMP', - 'key_mgmt=WPA2-PSK', - 'wpa_state=4WAY_HANDSHAKE', - 'ip_address=10.34.141.168', - 'p2p_device_address=e4:28:9c:a8:53:72', - 'address=e4:28:9c:a8:53:72', - 'uuid=e1cda789-8c88-53e8-ffff-31c304580c1e' -].join('\n'); - -var WPA_CLI_STATUS_SCANNING = [ - 'wpa_state=SCANNING', - 'ip_address=10.34.141.168', - 'p2p_device_address=e4:28:9c:a8:53:72', - 'address=e4:28:9c:a8:53:72', - 'uuid=e1cda789-8c88-53e8-ffff-31c304580c1e' -].join('\n'); - -var WPA_CLI_SCAN_RESULTS = [ - 'bssid / frequency / signal level / flags / ssid', - '2c:f5:d3:02:ea:d9 2472 -31 [WPA-PSK-CCMP+TKIP][WPA2-PSK-CCMP+TKIP][ESS] FakeWifi', - '2c:f5:d3:02:ea:d9 2472 -31 [WPA-PSK-CCMP+TKIP][WPA2-PSK-CCMP+TKIP][ESS] FakeWifi2' -].join('\n'); - -var WPA_CLI_SCAN_NORESULTS = [ - '' -].join('\n'); - -var WPA_CLI_COMMAND_OK = 'OK\n'; -var WPA_CLI_COMMAND_FAIL = 'FAIL\n'; -var WPA_CLI_COMMAND_ID = '0\n'; - -describe('wpa_cli', function() { - describe('wpa_cli.status(iface, callback)', function() { - before(function() { - this.OUTPUT = ''; - var self = this; - - wpa_cli.exec = function(command, callback) { - should(command).eql('wpa_cli -i wlan0 status'); - callback(null, self.OUTPUT); - }; - }); - - it('status SILENCE', function (done) { - this.OUTPUT = WPA_CLI_STATUS_SILENCE; - - wpa_cli.status('wlan0', function(err, status) { - should(status).eql({ }); - done(); - }); - }); - - it('status COMPLETED', function(done) { - this.OUTPUT = WPA_CLI_STATUS_COMPLETED; - wpa_cli.status('wlan0', function(err, status) { - should(status).eql({ - bssid: '2c:f5:d3:02:ea:d9', - frequency: 2412, - mode: 'station', - key_mgmt: 'wpa2-psk', - ssid: 'Fake-Wifi', - pairwise_cipher: 'CCMP', - group_cipher: 'CCMP', - p2p_device_address: 'e4:28:9c:a8:53:72', - wpa_state: 'COMPLETED', - ip: '10.34.141.168', - mac: 'e4:28:9c:a8:53:72', - uuid: 'e1cda789-8c88-53e8-ffff-31c304580c1e', - id: 0 - }); - - done(); - }); - }); - - it('status 4WAY_HANDSHAKE', function(done) { - this.OUTPUT = WPA_CLI_STATUS_4WAY_HANDSHAKE; - wpa_cli.status('wlan0', function(err, status) { - should(status).eql({ - bssid: '2c:f5:d3:02:ea:d9', - frequency: 2412, - mode: 'station', - key_mgmt: 'wpa2-psk', - ssid: 'Fake-Wifi', - pairwise_cipher: 'CCMP', - group_cipher: 'CCMP', - p2p_device_address: 'e4:28:9c:a8:53:72', - wpa_state: '4WAY_HANDSHAKE', - ip: '10.34.141.168', - mac: 'e4:28:9c:a8:53:72', - uuid: 'e1cda789-8c88-53e8-ffff-31c304580c1e', - id: 0 - }); - - done(); - }); - }); - - it('status SCANNING', function(done) { - this.OUTPUT = WPA_CLI_STATUS_SCANNING; - wpa_cli.status('wlan0', function(err, status) { - should(status).eql({ - p2p_device_address: 'e4:28:9c:a8:53:72', - wpa_state: 'SCANNING', - ip: '10.34.141.168', - mac: 'e4:28:9c:a8:53:72', - uuid: 'e1cda789-8c88-53e8-ffff-31c304580c1e' }); - }); - - done(); - }); - - it('should handle errors', function(done) { - wpa_cli.exec = function(command, callback) { - callback('error'); - }; - - wpa_cli.status('wlan0', function(err, status) { - should(err).eql('error'); - done(); - }); - }); - }); - - describe('wpa_cli.bssid(iface, ap, ssid, callback)', function(){ - it('OK result', function(done) { - wpa_cli.exec = function(command, callback) { - should(command).eql('wpa_cli -i wlan0 bssid Fake-Wifi 2c:f5:d3:02:ea:89'); - callback(null, WPA_CLI_COMMAND_OK); - }; - - wpa_cli.bssid('wlan0', '2c:f5:d3:02:ea:89', 'Fake-Wifi', function(err, status) { - should(status).eql({ - result: 'OK' - }); - - done(); - }); - }); - - it('FAIL result', function(done) { - wpa_cli.exec = function(command, callback) { - should(command).eql('wpa_cli -i wlan0 bssid 2c:f5:d3:02:ea:89 Fake-Wifi'); - callback(null, WPA_CLI_COMMAND_FAIL); - }; - - wpa_cli.bssid('wlan0', 'Fake-Wifi', '2c:f5:d3:02:ea:89', function(err, status) { - should(err.message).eql('FAIL'); - done(); - }); - }); - - it('Handle errors', function(done) { - wpa_cli.exec = function(command, callback) { - callback('error'); - }; - - wpa_cli.bssid('wlan0', '2c:f5:d3:02:ea:89', 'Fake-Wifi', function(err, status) { - should(err).eql('error'); - done(); - }); - }); - }); - - describe('wpa_cli.reassociate(iface, callback)', function(){ - it('OK result', function(done) { - wpa_cli.exec = function(command, callback) { - should(command).eql('wpa_cli -i wlan0 reassociate'); - callback(null, WPA_CLI_COMMAND_OK); - }; - - wpa_cli.reassociate('wlan0', function(err, status) { - should(status).eql({ - result: 'OK' - }); - - done(); - }); - }); - - it('FAIL result', function(done) { - wpa_cli.exec = function(command, callback) { - should(command).eql('wpa_cli -i wlan0 reassociate'); - callback(null, WPA_CLI_COMMAND_FAIL); - }; - - wpa_cli.reassociate('wlan0', function(err, status) { - should(err.message).eql('FAIL'); - done(); - }); - }); - - it('should handle errors', function(done) { - wpa_cli.exec = function(command, callback) { - callback('error'); - }; - - wpa_cli.reassociate('wlan0', function(err, status) { - should(err).eql('error'); - done(); - }); - }); - }); - - describe('wpa_cli.set(iface, variable, value, callback)', function(){ - it('OK result', function(done) { - wpa_cli.exec = function(command, callback) { - should(command).eql('wpa_cli -i wlan0 set ap_scan 1'); - callback(null, WPA_CLI_COMMAND_OK); - }; - - wpa_cli.set('wlan0','ap_scan', 1, function(err, status) { - should(status).eql({ - result: 'OK' - }); - - done(); - }); - }); - - it('FAIL result', function(done) { - wpa_cli.exec = function(command, callback) { - should(command).eql('wpa_cli -i wlan0 set ap_scan 1'); - callback(null, WPA_CLI_COMMAND_FAIL); - }; - - wpa_cli.set('wlan0','ap_scan', 1, function(err, status) { - should(err.message).eql('FAIL'); - done(); - }); - }); - - it('should handle errors', function(done) { - wpa_cli.exec = function(command, callback) { - callback('error'); - }; - - wpa_cli.set('wlan0','ap_scan', 1, function(err, status) { - should(err).eql('error'); - done(); - }); - }); - }); - - describe('wpa_cli.add_network(iface, callback)', function(){ - it('OK result', function(done) { - wpa_cli.exec = function(command, callback) { - should(command).eql('wpa_cli -i wlan0 add_network'); - callback(null, WPA_CLI_COMMAND_ID); - }; - - wpa_cli.add_network('wlan0', function(err, status) { - should(status).eql({ - result: '0' - }); - - done(); - }); - }); - - it('FAIL result', function(done) { - wpa_cli.exec = function(command, callback) { - should(command).eql('wpa_cli -i wlan0 add_network'); - callback(null, WPA_CLI_COMMAND_FAIL); - }; - - wpa_cli.add_network('wlan0', function(err, status) { - should(err.message).eql('FAIL'); - done(); - }); - }); - - it('should handle errors', function(done) { - wpa_cli.exec = function(command, callback) { - callback('error'); - }; - - wpa_cli.add_network('wlan0', function(err, status) { - should(err).eql('error'); - done(); - }); - }); - }); - - describe('wpa_cli.set_network(iface, id, variable, value, callback)', function(){ - it('OK result', function(done) { - wpa_cli.exec = function(command, callback) { - should(command).eql('wpa_cli -i wlan0 set_network 0 scan_ssid 1'); - callback(null, WPA_CLI_COMMAND_OK); - }; - - wpa_cli.set_network('wlan0', 0, 'scan_ssid', 1, function(err, status) { - should(status).eql({ - result: 'OK' - }); - - done(); - }); - }); - - it('FAIL result', function(done) { - wpa_cli.exec = function(command, callback) { - should(command).eql('wpa_cli -i wlan0 set_network 0 fake_variable 1'); - callback(null, WPA_CLI_COMMAND_FAIL); - }; - - wpa_cli.set_network('wlan0', 0, 'fake_variable', 1, function(err, status) { - should(err.message).eql('FAIL'); - done(); - }); - }); - - it('should handle errors', function(done) { - wpa_cli.exec = function(command, callback) { - callback('error'); - }; - - wpa_cli.set_network('wlan0', 0, 'fake_variable', 1, function(err, status) { - should(err).eql('error'); - done(); - }); - }); - }); - - describe('wpa_cli.enable_network(iface, id, callback)', function(){ - it('OK result', function(done) { - wpa_cli.exec = function(command, callback) { - should(command).eql('wpa_cli -i wlan0 enable_network 0'); - callback(null, WPA_CLI_COMMAND_OK); - }; - - wpa_cli.enable_network('wlan0', 0, function(err, status) { - should(status).eql({ - result: 'OK' - }); - - done(); - }); - }); - - it('FAIL result', function(done) { - wpa_cli.exec = function(command, callback) { - should(command).eql('wpa_cli -i wlan0 enable_network 28'); - callback(null, WPA_CLI_COMMAND_FAIL); - }; - - wpa_cli.enable_network('wlan0', 28, function(err, status) { - should(err.message).eql('FAIL'); - done(); - }); - }); - - it('should handle errors', function(done) { - wpa_cli.exec = function(command, callback) { - callback('error'); - }; - - wpa_cli.enable_network('wlan0', 28, function(err, status) { - should(err).eql('error'); - done(); - }); - }); - }); - - describe('wpa_cli.disable_network(iface, id, callback)', function(){ - it('OK result', function(done) { - wpa_cli.exec = function(command, callback) { - should(command).eql('wpa_cli -i wlan0 disable_network 0'); - callback(null, WPA_CLI_COMMAND_OK); - }; - - wpa_cli.disable_network('wlan0', 0, function(err, status) { - should(status).eql({ - result: 'OK' - }); - - done(); - }); - }); - - it('FAIL result', function(done) { - wpa_cli.exec = function(command, callback) { - should(command).eql('wpa_cli -i wlan0 disable_network 28'); - callback(null, WPA_CLI_COMMAND_FAIL); - }; - - wpa_cli.disable_network('wlan0', 28, function(err, status) { - should(err.message).eql('FAIL'); - done(); - }); - }); - - it('should handle errors', function(done) { - wpa_cli.exec = function(command, callback) { - callback('error'); - }; - - wpa_cli.disable_network('wlan0', 28, function(err, status) { - should(err).eql('error'); - done(); - }); - }); - }); - - describe('wpa_cli.remove_network(iface, id, callback)', function(){ - it('OK result', function(done) { - wpa_cli.exec = function(command, callback) { - should(command).eql('wpa_cli -i wlan0 remove_network 0'); - callback(null, WPA_CLI_COMMAND_OK); - }; - - wpa_cli.remove_network('wlan0', 0, function(err, status) { - should(status).eql({ - result: 'OK' - }); - - done(); - }); - }); - - it('FAIL result', function(done) { - wpa_cli.exec = function(command, callback) { - should(command).eql('wpa_cli -i wlan0 remove_network 28'); - callback(null, WPA_CLI_COMMAND_FAIL); - }; - - wpa_cli.remove_network('wlan0', 28, function(err, status) { - should(err.message).eql('FAIL'); - done(); - }); - }); - - it('should handle errors', function(done) { - wpa_cli.exec = function(command, callback) { - callback('error'); - }; - - wpa_cli.remove_network('wlan0', 28, function(err, status) { - should(err).eql('error'); - done(); - }); - }); - }); - - describe('wpa_cli.select_network(iface, id, callback)', function(){ - it('OK result', function(done) { - wpa_cli.exec = function(command, callback) { - should(command).eql('wpa_cli -i wlan0 select_network 0'); - callback(null, WPA_CLI_COMMAND_OK); - }; - - wpa_cli.select_network('wlan0', 0, function(err, status) { - should(status).eql({ - result: 'OK' - }); - - done(); - }); - }); - - it('FAIL result', function(done) { - wpa_cli.exec = function(command, callback) { - should(command).eql('wpa_cli -i wlan0 select_network 28'); - callback(null, WPA_CLI_COMMAND_FAIL); - }; - - wpa_cli.select_network('wlan0', 28, function(err, status) { - should(err.message).eql('FAIL'); - done(); - }); - }); - - it('should handle errors', function(done) { - wpa_cli.exec = function(command, callback) { - callback('error'); - }; - - wpa_cli.select_network('wlan0', 28, function(err, status) { - should(err).eql('error'); - done(); - }); - }); - }); - - describe('wpa_cli.scan(iface, callback)', function(){ - it('OK result', function(done) { - wpa_cli.exec = function(command, callback) { - should(command).eql('wpa_cli -i wlan0 scan'); - callback(null, WPA_CLI_COMMAND_OK); - }; - - wpa_cli.scan('wlan0', function(err, scan) { - should(scan).eql({ - result: 'OK' - }); - - done(); - }); - }); - - it('should handle errors', function(done) { - wpa_cli.exec = function(command, callback) { - callback('error'); - }; - - wpa_cli.scan('wlan0', function(err, scan) { - should(err).eql('error'); - done(); - }); - }); - }); - - describe('wpa_cli.scan_results(iface, callback)', function(){ - before(function() { - this.OUTPUT = ''; - var self = this; - - wpa_cli.exec = function(command, callback) { - should(command).eql('wpa_cli -i wlan0 scan_results'); - callback(null, self.OUTPUT); - }; - }); - - it('scan_results NORESULTS', function (done) { - this.OUTPUT = WPA_CLI_SCAN_NORESULTS; - - wpa_cli.scan_results('wlan0', function(err, results) { - should(results).eql([]); - done(); - }); - }); - - it('scan_results COMPLETED', function(done) { - this.OUTPUT = WPA_CLI_SCAN_RESULTS; - wpa_cli.scan_results('wlan0', function(err, results) { - should(results).eql([ - { - bssid: '2c:f5:d3:02:ea:d9', - frequency: 2472, - signalLevel: -31, - flags: '[WPA-PSK-CCMP+TKIP][WPA2-PSK-CCMP+TKIP][ESS]', - ssid: 'FakeWifi' - }, - { - bssid: '2c:f5:d3:02:ea:d9', - frequency: 2472, - signalLevel: -31, - flags: '[WPA-PSK-CCMP+TKIP][WPA2-PSK-CCMP+TKIP][ESS]', - ssid: 'FakeWifi2' - } - ]); - - done(); - }); - }); - - it('should handle errors', function(done) { - wpa_cli.exec = function(command, callback) { - callback('error'); - }; - - wpa_cli.scan_results('wlan0', function(err, results) { - should(err).eql('error'); - done(); - }); - }); - }); - - describe('wpa_cli.save_config(iface, callback)', function(){ - it('OK result', function(done) { - wpa_cli.exec = function(command, callback) { - should(command).eql('wpa_cli -i wlan0 save_config'); - callback(null, WPA_CLI_COMMAND_OK); - }; - - wpa_cli.save_config('wlan0', function(err, status) { - should(status).eql({ - result: 'OK' - }); - - done(); - }); - }); - - it('FAIL result', function(done) { - wpa_cli.exec = function(command, callback) { - should(command).eql('wpa_cli -i wlan0 save_config'); - callback(null, WPA_CLI_COMMAND_FAIL); - }; - - wpa_cli.save_config('wlan0', function(err, status) { - should(err.message).eql('FAIL'); - - done(); - }); - }); - - it('should handle errors', function(done) { - wpa_cli.exec = function(command, callback) { - callback('error'); - }; - - wpa_cli.scan('wlan0', function(err, status) { - should(err).eql('error'); - done(); - }); - }); - }); -}); \ No newline at end of file diff --git a/plugins/music_service/squeezelite/node_modules/wireless-tools/test/wpa_supplicant.js b/plugins/music_service/squeezelite/node_modules/wireless-tools/test/wpa_supplicant.js deleted file mode 100644 index 1c7325d18..000000000 --- a/plugins/music_service/squeezelite/node_modules/wireless-tools/test/wpa_supplicant.js +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright (c) 2015 Christopher M. Baker - * - * 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. - * - */ - -var should = require('should'); -var wpa_supplicant = require('../wpa_supplicant'); - -describe('wpa_supplicant', function() { - describe('wpa_supplicant.disable(options, callback)', function() { - it('should stop the daemons', function(done) { - wpa_supplicant.exec = function(command, callback) { - should(command).eql( - 'kill `pgrep -f "wpa_supplicant -i wlan0 .*"` || true'); - - callback(null, '', ''); - }; - - wpa_supplicant.disable('wlan0', function(err) { - should(err).not.be.ok; - done(); - }); - }) - - it('should handle errors', function(done) { - wpa_supplicant.exec = function(command, callback) { - callback('error'); - }; - - wpa_supplicant.disable('wlan0', function(err) { - should(err).eql('error'); - done(); - }); - }) - }) - - describe('wpa_supplicant.enable(options, callback)', function() { - it('should start the daemon', function(done) { - wpa_supplicant.exec = function(command, callback) { - should(command).eql('wpa_passphrase "RaspberryPi" "raspberry"' + - ' > wlan0-wpa_supplicant.conf &&' + - ' wpa_supplicant -i wlan0 -B -D wext -c wlan0-wpa_supplicant.conf' + - ' && rm -f wlan0-wpa_supplicant.conf'); - - callback(null, '', ''); - }; - - var options = { - interface: 'wlan0', - ssid: 'RaspberryPi', - passphrase: 'raspberry', - driver: 'wext' - }; - - wpa_supplicant.enable(options, function(err) { - should(err).not.be.ok; - done(); - }); - }) - - it('should handle errors', function(done) { - wpa_supplicant.exec = function(command, callback) { - callback('error'); - }; - - var options = { - interface: 'wlan0', - ssid: 'RaspberryPi', - passphrase: 'raspberry', - driver: 'wext' - }; - - wpa_supplicant.enable(options, function(err) { - should(err).eql('error'); - done(); - }); - }) - }) - - describe('wpa_supplicant.manual(options, callback)', function() { - it('should start the daemon', function(done) { - wpa_supplicant.exec = function(command, callback) { - should(command).eql([ - 'wpa_supplicant -i wlan0 -s -B -P /run/wpa_supplicant/wlan0.pid', - '-D nl80211,wext -C /run/wpa_supplicant' - ].join(' ')); - - callback(null, '', ''); - }; - - var options = { - interface: 'wlan0', - drivers: [ 'nl80211', 'wext' ] - }; - - wpa_supplicant.manual(options, function(err) { - should(err).not.be.ok; - done(); - }); - }) - - it('should handle errors', function(done) { - wpa_supplicant.exec = function(command, callback) { - callback('error'); - }; - - var options = { - interface: 'wlan0', - drivers: [ 'nl80211', 'wext' ] - }; - - wpa_supplicant.manual(options, function(err) { - should(err).eql('error'); - done(); - }); - }) - }) -}) diff --git a/plugins/music_service/squeezelite/node_modules/wireless-tools/udhcpc.js b/plugins/music_service/squeezelite/node_modules/wireless-tools/udhcpc.js deleted file mode 100644 index 32cc5c55f..000000000 --- a/plugins/music_service/squeezelite/node_modules/wireless-tools/udhcpc.js +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (c) 2015 Christopher M. Baker - * - * 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. - * - */ - -var child_process = require('child_process'); - -/** - * The **udhcpc** command is used to configure a dhcp client for a - * network interface. - * - * @static - * @category udhcpc - * - */ -var udhcpc = module.exports = { - exec: child_process.exec, - disable: disable, - enable: enable -}; - -/** - * The **udhcpc disable** command is used to stop a dhcp client on a - * specific network interface. - * - * @static - * @category udhcpc - * @param {string} interface The network interface. - * @param {function} callback The callback function. - * @returns {process} The child process. - * @example - * - * var udhcpc = require('wireless-tools/udhcpc'); - * - * udhcpc.disable('wlan0', function(err) { - * // the dhcp client was stopped - * }); - * - */ -function disable(interface, callback) { - var command = 'kill `pgrep -f "^udhcpc -i ' + interface + '"` || true'; - return this.exec(command, callback); -} - -/** - * The **udhcpc enable** command is used to start a dhcp client on a - * specific network interface. - * - * @static - * @category udhcpc - * @param {object} options The dhcp client configuration. - * @param {function} callback The callback function. - * @returns {process} The child process. - * @example - * - * var udhcpc = require('wireless-tools/udhcpc'); - * - * var options = { - * interface: 'wlan0' - * }; - * - * udhcpc.enable(options, function(err) { - * // the dhcp client was started - * }); - * - */ -function enable(options, callback) { - var command = 'udhcpc -i ' + options.interface + ' -n'; - return this.exec(command, callback); -} diff --git a/plugins/music_service/squeezelite/node_modules/wireless-tools/udhcpd.js b/plugins/music_service/squeezelite/node_modules/wireless-tools/udhcpd.js deleted file mode 100644 index 006cedfe1..000000000 --- a/plugins/music_service/squeezelite/node_modules/wireless-tools/udhcpd.js +++ /dev/null @@ -1,146 +0,0 @@ -/* - * Copyright (c) 2015 Christopher M. Baker - * - * 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. - * - */ - -var child_process = require('child_process'); - -/** - * The **udhcpd** command is used to configure a dhcp server for a - * network interface. - * - * @static - * @category udhcpd - * - */ -var udhcpd = module.exports = { - exec: child_process.exec, - disable: disable, - enable: enable -}; - -/** - * Recursively expand `options` into `lines` with a `prefix`. - * - * @private - * @static - * @category udhcpd - * @param {object} options The dhcp server configuration. - * @param {array} lines The lines of the configuration file. - * @param {array) prefix The key prefix. - * - */ -function expand_r(options, lines, prefix) { - Object.getOwnPropertyNames(options).forEach(function(key) { - var full = prefix.concat(key); - var value = options[key]; - - if (Array.isArray(value)) { - value.forEach(function(val) { - lines.push(full.concat(val).join(' ')); - }); - } - else if (typeof(value) == 'object') { - expand_r(value, lines, full); - } - else { - lines.push(full.concat(value).join(' ')); - } - }); -} - -/** - * Convert dhcp server configuration options to a configuration file. - * - * @private - * @static - * @category udhcpd - * @param {object} options The dhcp server configuration. - * @returns {array} The lines of the configuration file. - * - */ -function expand(options) { - var lines = []; - expand_r(options, lines, []); - return lines; -} - -/** - * The **udhcpd enable** command is used to start a dhcp server on a - * specific network interface. - * - * @static - * @category udhcpd - * @param {object} options The dhcp server configuration. - * @param {function} callback The callback function. - * @returns {process} The child process. - * @example - * - * var udhcpd = require('wireless-tools/udhcpd'); - * - * var options = { - * interface: 'wlan0', - * start: '192.168.10.100', - * end: '192.168.10.200', - * option: { - * router: '192.168.10.1', - * subnet: '255.255.255.0', - * dns: [ '4.4.4.4', '8.8.8.8' ] - * } - * }; - * - * udhcpd.enable(options, function(err) { - * // the dhcp server was started - * }); - * - */ -function enable(options, callback) { - var file = options.interface + '-udhcpd.conf'; - - var commands = [].concat( - 'cat <' + file + ' && udhcpd ' + file + ' && rm -f ' + file, - expand(options)); - - return this.exec(commands.join('\n'), callback); -} - -/** - * The **udhcpd disable** command is used to stop a dhcp server on a - * specific network interface. - * - * @static - * @category udhcpd - * @param {string} interface The network interface. - * @param {function} callback The callback function. - * @returns {process} The child process. - * @example - * - * var udhcpd = require('wireless-tools/udhcpd'); - * - * udhcpd.disable('wlan0', function(err) { - * // the dhcp server was stopped - * }); - * - */ -function disable(interface, callback) { - var file = interface + '-udhcpd.conf'; - return this.exec('kill `pgrep -f "^udhcpd ' + file + '"` || true', callback); -} diff --git a/plugins/music_service/squeezelite/node_modules/wireless-tools/wireless-tools.js b/plugins/music_service/squeezelite/node_modules/wireless-tools/wireless-tools.js deleted file mode 100644 index de003480f..000000000 --- a/plugins/music_service/squeezelite/node_modules/wireless-tools/wireless-tools.js +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2015 Christopher M. Baker - * - * 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. - * - */ - -var wireless_tools = module.exports = { - hostapd: require('./hostapd'), - ifconfig: require('./ifconfig'), - iwconfig: require('./iwconfig'), - iwlist: require('./iwlist'), - iw: require('./iw'), - udhcpc: require('./udhcpc'), - udhcpd: require('./udhcpd'), - wpa: require('./wpa_cli'), - wpa_supplicant: require('./wpa_supplicant') -}; diff --git a/plugins/music_service/squeezelite/node_modules/wireless-tools/wpa_cli.js b/plugins/music_service/squeezelite/node_modules/wireless-tools/wpa_cli.js deleted file mode 100644 index f4fa8fbda..000000000 --- a/plugins/music_service/squeezelite/node_modules/wireless-tools/wpa_cli.js +++ /dev/null @@ -1,416 +0,0 @@ -/* - * Copyright (c) 2015 Christopher M. Baker - * - * 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. - * - */ - -var child_process = require('child_process'); - -/** - * The **wpa_cli** command is used to configure wpa network interfaces. - * - * @private - * @category wpa_cli - * - */ -var wpa_cli = module.exports = { - exec: child_process.exec, - status: status, - bssid: bssid, - reassociate: reassociate, - set: set, - add_network: add_network, - set_network: set_network, - enable_network: enable_network, - disable_network: disable_network, - remove_network: remove_network, - select_network: select_network, - scan: scan, - scan_results: scan_results, - save_config: save_config -}; - -/** - * Parses the status for a wpa network interface. - * - * @private - * @static - * @category wpa_cli - * @param {string} block The section of stdout for the interface. - * @returns {object} The parsed wpa status. - * - */ -function parse_status_block(block) { - var match; - - var parsed = {}; - if ((match = block.match(/bssid=([A-Fa-f0-9:]{17})/))) { - parsed.bssid = match[1].toLowerCase(); - } - - if ((match = block.match(/freq=([0-9]+)/))) { - parsed.frequency = parseInt(match[1], 10); - } - - if ((match = block.match(/mode=([^\s]+)/))) { - parsed.mode = match[1]; - } - - if ((match = block.match(/key_mgmt=([^\s]+)/))) { - parsed.key_mgmt = match[1].toLowerCase(); - } - - if ((match = block.match(/[^b]ssid=([^\n]+)/))) { - parsed.ssid = match[1]; - } - - if ((match = block.match(/[^b]pairwise_cipher=([^\n]+)/))) { - parsed.pairwise_cipher = match[1]; - } - - if ((match = block.match(/[^b]group_cipher=([^\n]+)/))) { - parsed.group_cipher = match[1]; - } - - if ((match = block.match(/p2p_device_address=([A-Fa-f0-9:]{17})/))) { - parsed.p2p_device_address = match[1]; - } - - if ((match = block.match(/wpa_state=([^\s]+)/))) { - parsed.wpa_state = match[1]; - } - - if ((match = block.match(/ip_address=([^\n]+)/))) { - parsed.ip = match[1]; - } - - if ((match = block.match(/[^_]address=([A-Fa-f0-9:]{17})/))) { - parsed.mac = match[1].toLowerCase(); - } - - if ((match = block.match(/uuid=([^\n]+)/))) { - parsed.uuid = match[1]; - } - - if ((match = block.match(/[^s]id=([0-9]+)/))) { - parsed.id = parseInt(match[1], 10); - } - - return parsed; -} - -/** - * Parses the result for a wpa command over an interface. - * - * @private - * @static - * @category wpa_cli - * @param {string} block The section of stdout for the command. - * @returns {object} The parsed wpa command result. - * - */ -function parse_command_block(block) { - var match; - - var parsed = { - result: block.match(/^([^\s]+)/)[1] - }; - - return parsed; -} - -/** - * Parses the status for a wpa wireless network interface. - * - * @private - * @static - * @category wpa_cli - * @param {function} callback The callback function. - * - */ -function parse_status_interface(callback) { - return function(error, stdout, stderr) { - if (error) { - callback(error); - } else { - callback(error, parse_status_block(stdout.trim())); - } - }; -} - -/** - * Parses the result for a wpa command over an interface. - * - * @private - * @static - * @category wpa_cli - * @param {function} callback The callback function. - * - */ -function parse_command_interface(callback) { - return function(error, stdout, stderr) { - if (error) { - callback(error); - } else { - var output = parse_command_block(stdout.trim()); - if (output.result === 'FAIL') { - callback(new Error(output.result)); - } else { - callback(error, parse_command_block(stdout.trim())); - } - } - }; -} - -/** - * Parses the results of a scan_result request. - * - * @private - * @static - * @category wpa_cli - * @param {string} block The section of stdout for the interface. - * @returns {object} The parsed scan results. - */ -function parse_scan_results(block) { - var match; - var results = []; - var lines; - - lines = block.split('\n').map(function(item) { return item + "\n"; }); - lines.forEach(function(entry){ - var parsed = {}; - if ((match = entry.match(/([A-Fa-f0-9:]{17})\t/))) { - parsed.bssid = match[1].toLowerCase(); - } - - if ((match = entry.match(/\t([\d]+)\t+/))) { - parsed.frequency = parseInt(match[1], 10); - } - - if ((match = entry.match(/([-][0-9]+)\t/))) { - parsed.signalLevel = parseInt(match[1], 10); - } - - if ((match = entry.match(/\t(\[.+\])\t/))) { - parsed.flags = match[1]; - } - - if ((match = entry.match(/\t([^\t]{1,32}(?=\n))/))) { - parsed.ssid = match[1]; - } - - if(!(Object.keys(parsed).length === 0 && parsed.constructor === Object)){ - results.push(parsed); - } - }); - - return results; -} - -/** - * Parses the status for a scan_results request. - * - * @private - * @static - * @category wpa_cli - * @param {function} callback The callback function. - * - */ -function parse_scan_results_interface(callback) { - return function(error, stdout, stderr) { - if (error) { - callback(error); - } else { - callback(error, parse_scan_results(stdout.trim())); - } - }; -} - - -/** - * Parses the status for wpa network interface. - * - * @private - * @static - * @category wpa - * @param {string} [interface] The wireless network interface. - * @param {function} callback The callback function. - * @example - * - * var wpa_cli = require('wireless-tools/wpa_cli'); - * - * wpa_cli.status('wlan0', function(err, status) { - * console.dir(status); - * wpa_cli.bssid('wlan0', '2c:f5:d3:02:ea:dd', 'Fake-Wifi', function(err, data){ - * console.dir(data); - * wpa_cli.bssid('wlan0', 'Fake-Wifi', '2c:f5:d3:02:ea:dd', function(err, data){ - * if (err) { - * console.dir(err); - * wpa_cli.reassociate('wlan0', function(err, data) { - * console.dir(data); - * }); - * } - * }); - * }); - * }); - * - * - * - * // => - * { - * bssid: '2c:f5:d3:02:ea:d9', - * frequency: 2412, - * mode: 'station', - * key_mgmt: 'wpa2-psk', - * ssid: 'Fake-Wifi', - * pairwise_cipher: 'CCMP', - * group_cipher: 'CCMP', - * p2p_device_address: 'e4:28:9c:a8:53:72', - * wpa_state: 'COMPLETED', - * ip: '10.34.141.168', - * mac: 'e4:28:9c:a8:53:72', - * uuid: 'e1cda789-8c88-53e8-ffff-31c304580c1e', - * id: 0 - * } - * - * OK - * - * FAIL - * - * OK - * - */ -function status(interface, callback) { - var command = [ 'wpa_cli -i', interface, 'status'].join(' '); - return this.exec(command, parse_status_interface(callback)); -} - -function bssid(interface, ap, ssid, callback) { - var command = ['wpa_cli -i', interface, 'bssid', ssid, ap].join(' '); - return this.exec(command, parse_command_interface(callback)); -} - -function reassociate(interface, callback) { - var command = ['wpa_cli -i', - interface, - 'reassociate'].join(' '); - - return this.exec(command, parse_command_interface(callback)); -} - -/* others commands not tested - //ap_scan 1 - // set_network 0 0 scan_ssid 1 - - - // set: set, - // add_network: add_network, - // set_network: set_network, - // enable_network: enable_network -*/ - -function set(interface, variable, value, callback) { - var command = ['wpa_cli -i', - interface, - 'set', - variable, - value ].join(' '); - - return this.exec(command, parse_command_interface(callback)); -} - -function add_network(interface, callback) { - var command = ['wpa_cli -i', - interface, - 'add_network' ].join(' '); - - return this.exec(command, parse_command_interface(callback)); -} - -function set_network(interface, id, variable, value, callback) { - var command = ['wpa_cli -i', - interface, - 'set_network', - id, - variable, - value ].join(' '); - - return this.exec(command, parse_command_interface(callback)); -} - -function enable_network(interface, id, callback) { - var command = ['wpa_cli -i', - interface, - 'enable_network', - id ].join(' '); - - return this.exec(command, parse_command_interface(callback)); -} - -function disable_network(interface, id, callback) { - var command = ['wpa_cli -i', - interface, - 'disable_network', - id ].join(' '); - - return this.exec(command, parse_command_interface(callback)); -} - -function remove_network(interface, id, callback) { - var command = ['wpa_cli -i', - interface, - 'remove_network', - id ].join(' '); - - return this.exec(command, parse_command_interface(callback)); -} - -function select_network(interface, id, callback) { - var command = ['wpa_cli -i', - interface, - 'select_network', - id ].join(' '); - - return this.exec(command, parse_command_interface(callback)); -} - -function scan(interface, callback) { - var command = ['wpa_cli -i', - interface, - 'scan'].join(' '); - - return this.exec(command, parse_command_interface(callback)); -} - -function scan_results(interface, callback) { - var command = ['wpa_cli -i', - interface, - 'scan_results'].join(' '); - - return this.exec(command, parse_scan_results_interface(callback)); -} - -function save_config(interface, callback) { - var command = ['wpa_cli -i', - interface, - 'save_config'].join(' '); - - return this.exec(command, parse_command_interface(callback)); -} \ No newline at end of file diff --git a/plugins/music_service/squeezelite/node_modules/wireless-tools/wpa_supplicant.js b/plugins/music_service/squeezelite/node_modules/wireless-tools/wpa_supplicant.js deleted file mode 100644 index 6316d025e..000000000 --- a/plugins/music_service/squeezelite/node_modules/wireless-tools/wpa_supplicant.js +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright (c) 2015 Christopher M. Baker - * - * 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. - * - */ - -var child_process = require('child_process'); - -/** - * The **wpa_supplicant** command is used to configure a wireless - * network connection for a network interface. - * - * @static - * @category wpa_supplicant - * - */ -var wpa_supplicant = module.exports = { - exec: child_process.exec, - disable: disable, - enable: enable, - manual: manual -}; - -/** - * The **wpa_supplicant disable** command is used to disconnect from - * a wireless network on a specific network interface. - * - * @static - * @category wpa_supplicant - * @param {string} interface The network interface. - * @param {function} callback The callback function. - * @returns {process} The child process. - * @example - * - * var wpa_supplicant = require('wireless-tools/wpa_supplicant'); - * - * wpa_supplicant.disable('wlan0', function(err) { - * // disconnected from wireless network - * }); - * - */ -function disable(interface, callback) { - var command = 'kill `pgrep -f "wpa_supplicant -i ' + - interface + ' .*"` || true'; - - return this.exec(command, callback); -} - -/** - * The **wpa_supplicant enable** command is used to join a wireless network - * on a specific network interface. - * - * @static - * @category wpa_supplicant - * @param {object} options The wireless network configuration. - * @param {function} callback The callback function. - * @returns {process} The child process. - * @example - * - * var wpa_supplicant = require('wireless-tools/wpa_supplicant'); - * - * var options = { - * interface: 'wlan0', - * ssid: 'RaspberryPi', - * passphrase: 'raspberry', - * driver: 'wext' - * }; - * - * wpa_supplicant.enable(options, function(err) { - * // connected to the wireless network - * }); - * - */ -function enable(options, callback) { - var file = options.interface + '-wpa_supplicant.conf'; - - var command = 'wpa_passphrase "' + options.ssid + '" "' + options.passphrase - + '" > ' + file + ' && wpa_supplicant -i ' + options.interface + ' -B -D ' - + options.driver + ' -c ' + file + ' && rm -f ' + file; - - return this.exec(command, callback); -} - -/** - * launchs wpa manually (as if it were launched by ifup if interface wpa setup - * was done in /network/interfaces) - * /sbin/wpa_supplicant -s -B -P /run/wpa_supplicant.wlan0.pid -i wlan0 -D nl80211,wext -C /run/wpa_supplicant - * options = { - * interface: 'wlan0', - * drivers: [ 'nl80211', 'wext' ] - * } - */ -function manual(options, callback) { - var command = [ - 'wpa_supplicant', - '-i', options.interface, - '-s -B -P /run/wpa_supplicant/' + options.interface + '.pid', - '-D', options.drivers.join(','), - '-C /run/wpa_supplicant' - ].join(' '); - - return this.exec(command, callback); -} - - diff --git a/plugins/music_service/squeezelite/node_modules/wrappy/LICENSE b/plugins/music_service/squeezelite/node_modules/wrappy/LICENSE deleted file mode 100644 index 19129e315..000000000 --- a/plugins/music_service/squeezelite/node_modules/wrappy/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/plugins/music_service/squeezelite/node_modules/wrappy/README.md b/plugins/music_service/squeezelite/node_modules/wrappy/README.md deleted file mode 100644 index 98eab2522..000000000 --- a/plugins/music_service/squeezelite/node_modules/wrappy/README.md +++ /dev/null @@ -1,36 +0,0 @@ -# wrappy - -Callback wrapping utility - -## USAGE - -```javascript -var wrappy = require("wrappy") - -// var wrapper = wrappy(wrapperFunction) - -// make sure a cb is called only once -// See also: http://npm.im/once for this specific use case -var once = wrappy(function (cb) { - var called = false - return function () { - if (called) return - called = true - return cb.apply(this, arguments) - } -}) - -function printBoo () { - console.log('boo') -} -// has some rando property -printBoo.iAmBooPrinter = true - -var onlyPrintOnce = once(printBoo) - -onlyPrintOnce() // prints 'boo' -onlyPrintOnce() // does nothing - -// random property is retained! -assert.equal(onlyPrintOnce.iAmBooPrinter, true) -``` diff --git a/plugins/music_service/squeezelite/node_modules/wrappy/package.json b/plugins/music_service/squeezelite/node_modules/wrappy/package.json deleted file mode 100644 index 7f03edd80..000000000 --- a/plugins/music_service/squeezelite/node_modules/wrappy/package.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "_args": [ - [ - { - "raw": "wrappy@^1.0.2", - "scope": null, - "escapedName": "wrappy", - "name": "wrappy", - "rawSpec": "^1.0.2", - "spec": ">=1.0.2 <2.0.0", - "type": "range" - }, - "/home/volumio/volumio-plugins/plugins/music_service/squeezelite" - ] - ], - "_from": "wrappy@>=1.0.2 <2.0.0", - "_id": "wrappy@1.0.2", - "_inCache": true, - "_location": "/wrappy", - "_nodeVersion": "5.10.1", - "_npmOperationalInternal": { - "host": "packages-16-east.internal.npmjs.com", - "tmp": "tmp/wrappy-1.0.2.tgz_1463527848281_0.037129373755306005" - }, - "_npmUser": { - "name": "zkat", - "email": "kat@sykosomatic.org" - }, - "_npmVersion": "3.9.1", - "_phantomChildren": {}, - "_requested": { - "raw": "wrappy@^1.0.2", - "scope": null, - "escapedName": "wrappy", - "name": "wrappy", - "rawSpec": "^1.0.2", - "spec": ">=1.0.2 <2.0.0", - "type": "range" - }, - "_requiredBy": [ - "/", - "/inflight", - "/once" - ], - "_resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "_shasum": "b5243d8f3ec1aa35f1364605bc0d1036e30ab69f", - "_shrinkwrap": null, - "_spec": "wrappy@^1.0.2", - "_where": "/home/volumio/volumio-plugins/plugins/music_service/squeezelite", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/npm/wrappy/issues" - }, - "dependencies": {}, - "description": "Callback wrapping utility", - "devDependencies": { - "tap": "^2.3.1" - }, - "directories": { - "test": "test" - }, - "dist": { - "shasum": "b5243d8f3ec1aa35f1364605bc0d1036e30ab69f", - "tarball": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" - }, - "files": [ - "wrappy.js" - ], - "gitHead": "71d91b6dc5bdeac37e218c2cf03f9ab55b60d214", - "homepage": "https://github.com/npm/wrappy", - "license": "ISC", - "main": "wrappy.js", - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - }, - { - "name": "zkat", - "email": "kat@sykosomatic.org" - } - ], - "name": "wrappy", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/npm/wrappy.git" - }, - "scripts": { - "test": "tap --coverage test/*.js" - }, - "version": "1.0.2" -} diff --git a/plugins/music_service/squeezelite/node_modules/wrappy/wrappy.js b/plugins/music_service/squeezelite/node_modules/wrappy/wrappy.js deleted file mode 100644 index bb7e7d6fc..000000000 --- a/plugins/music_service/squeezelite/node_modules/wrappy/wrappy.js +++ /dev/null @@ -1,33 +0,0 @@ -// Returns a wrapper function that returns a wrapped callback -// The wrapper function should do some stuff, and return a -// presumably different callback function. -// This makes sure that own properties are retained, so that -// decorations and such are not lost along the way. -module.exports = wrappy -function wrappy (fn, cb) { - if (fn && cb) return wrappy(fn)(cb) - - if (typeof fn !== 'function') - throw new TypeError('need wrapper function') - - Object.keys(fn).forEach(function (k) { - wrapper[k] = fn[k] - }) - - return wrapper - - function wrapper() { - var args = new Array(arguments.length) - for (var i = 0; i < args.length; i++) { - args[i] = arguments[i] - } - var ret = fn.apply(this, args) - var cb = args[args.length-1] - if (typeof ret === 'function' && ret !== cb) { - Object.keys(cb).forEach(function (k) { - ret[k] = cb[k] - }) - } - return ret - } -} diff --git a/plugins/music_service/squeezelite/package.json b/plugins/music_service/squeezelite/package.json index 5ffb31b5a..75be95b1c 100644 --- a/plugins/music_service/squeezelite/package.json +++ b/plugins/music_service/squeezelite/package.json @@ -1,6 +1,6 @@ { "name": "squeezelite", - "version": "1.0.9", + "version": "1.1.1", "description": "Installs the Squeezelite player you can use in combination with the Logitech Media Server", "main": "index.js", "scripts": { @@ -15,23 +15,23 @@ }, "dependencies": { "balanced-match": "^0.4.2", - "brace-expansion": "^1.1.6", + "brace-expansion": "^1.1.11", "concat-map": "^0.0.1", "fs-extra": "^0.28.0", "fs.realpath": "^1.0.0", - "glob": "^7.1.0", - "graceful-fs": "^4.1.9", - "inflight": "^1.0.5", + "glob": "^7.1.2", + "graceful-fs": "^4.1.11", + "inflight": "^1.0.6", "inherits": "^2.0.3", "ip": "^1.1.5", - "jsonfile": "^2.3.1", + "jsonfile": "^2.4.0", "kew": "^0.7.0", - "klaw": "^1.3.0", - "minimatch": "^3.0.3", - "multimap": "^1.0.1", + "klaw": "^1.3.1", + "minimatch": "^3.0.4", + "multimap": "^1.0.2", "once": "^1.4.0", "path-is-absolute": "^1.0.1", - "rimraf": "^2.5.4", + "rimraf": "^2.6.2", "v-conf": "^0.10.0", "wireless-tools": "^0.19.0", "wrappy": "^1.0.2" diff --git a/plugins/music_service/squeezelite/uninstall.sh b/plugins/music_service/squeezelite/uninstall.sh index 6b3761071..ca74a7563 100644 --- a/plugins/music_service/squeezelite/uninstall.sh +++ b/plugins/music_service/squeezelite/uninstall.sh @@ -8,7 +8,8 @@ if [ ! -f $INSTALLING ]; then # Uninstall Squeezelite rm /opt/squeezelite - rm /etc/systemd/system/squeezelite.service + unlink /etc/systemd/system/squeezelite.service + systemctl daemon-reload rm $INSTALLING diff --git a/plugins/music_service/squeezelite/unit/squeezelite.unit-template b/plugins/music_service/squeezelite/unit/squeezelite.unit-template index e66a2c8b8..ea4112e48 100644 --- a/plugins/music_service/squeezelite/unit/squeezelite.unit-template +++ b/plugins/music_service/squeezelite/unit/squeezelite.unit-template @@ -5,7 +5,7 @@ Requires=avahi-daemon.service network.target sound.target After=network.target avahi-daemon.service sound.target [Service] -ExecStart=/opt/squeezelite ${NAME} ${OUTPUT_DEVICE} ${ALSA_PARAMS} ${EXTRA_PARAMS} +ExecStart=/opt/squeezelite ${NAME} ${OUTPUT_DEVICE} ${SOUNDCARD_TIMEOUT} ${ALSA_PARAMS} ${EXTRA_PARAMS} Restart=always [Install]