diff -Nru node-negotiator-0.6.1/debian/changelog node-negotiator-0.6.2/debian/changelog --- node-negotiator-0.6.1/debian/changelog 2017-09-04 16:11:11.000000000 +0000 +++ node-negotiator-0.6.2/debian/changelog 2019-10-08 19:04:46.000000000 +0000 @@ -1,3 +1,21 @@ +node-negotiator (0.6.2-1) unstable; urgency=medium + + * Team upload + * Bump debhelper compatibility level to 12 + * Declare compliance with policy 4.4.1 + * Change section to javascript + * Change priority to optional + * Add debian/gbp.conf + * Add upstream/metadata + * Update VCS fields to salsa + * Fix debian/copyright + * New upstream version 0.6.2 + * Update debian/copyright + * Add "Rules-Requires-Root: no" + * Switch test and install to pkg-js-tools + + -- Xavier Guimard Tue, 08 Oct 2019 21:04:46 +0200 + node-negotiator (0.6.1-1) unstable; urgency=medium * Team upload diff -Nru node-negotiator-0.6.1/debian/compat node-negotiator-0.6.2/debian/compat --- node-negotiator-0.6.1/debian/compat 2017-09-04 16:11:11.000000000 +0000 +++ node-negotiator-0.6.2/debian/compat 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -9 diff -Nru node-negotiator-0.6.1/debian/control node-negotiator-0.6.2/debian/control --- node-negotiator-0.6.1/debian/control 2017-09-04 16:11:11.000000000 +0000 +++ node-negotiator-0.6.2/debian/control 2019-10-08 19:03:43.000000000 +0000 @@ -1,23 +1,23 @@ Source: node-negotiator -Section: web -Priority: extra Maintainer: Debian Javascript Maintainers Uploaders: Jérémy Lal +Section: javascript +Testsuite: autopkgtest-pkg-nodejs +Priority: optional Build-Depends: - debhelper (>= 9~) - , dh-buildinfo + debhelper-compat (= 12) , nodejs - , mocha -Standards-Version: 4.1.0 + , mocha + , pkg-js-tools (>= 0.9.12~) +Standards-Version: 4.4.1 +Vcs-Browser: https://salsa.debian.org/js-team/node-negotiator +Vcs-Git: https://salsa.debian.org/js-team/node-negotiator.git Homepage: https://github.com/federomero/negotiator -XS-Testsuite: autopkgtest -Vcs-Git: https://anonscm.debian.org/git/pkg-javascript/node-negotiator.git -Vcs-Browser: https://anonscm.debian.org/cgit/pkg-javascript/node-negotiator.git +Rules-Requires-Root: no Package: node-negotiator Architecture: all -Depends: - ${misc:Depends} +Depends: ${misc:Depends} , nodejs Description: HTTP content negotiator for Node.js node-negotiator parses HTTP Accept headers to return preferred @@ -25,4 +25,3 @@ available choices. . Node.js is an event-based server-side javascript engine. - diff -Nru node-negotiator-0.6.1/debian/copyright node-negotiator-0.6.2/debian/copyright --- node-negotiator-0.6.1/debian/copyright 2017-09-04 16:11:11.000000000 +0000 +++ node-negotiator-0.6.2/debian/copyright 2019-10-08 19:03:08.000000000 +0000 @@ -1,9 +1,16 @@ -Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: negotiator Files: * -Copyright: 2012-2013 Federico Romero , - Isaac Z. Schlueter +Copyright: 2012-2014, Federico Romero , + 2012-2014, Isaac Z. Schlueter + 2014-2015, Douglas Christopher Wilson +License: Expat + +Files: debian/* +Copyright: 2013-2014, Jérémy Lal + 2019, Xavier Guimard License: Expat License: Expat @@ -26,4 +33,3 @@ 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 -Nru node-negotiator-0.6.1/debian/gbp.conf node-negotiator-0.6.2/debian/gbp.conf --- node-negotiator-0.6.1/debian/gbp.conf 1970-01-01 00:00:00.000000000 +0000 +++ node-negotiator-0.6.2/debian/gbp.conf 2019-10-08 18:56:10.000000000 +0000 @@ -0,0 +1,5 @@ +[DEFAULT] +pristine-tar = True + +[import-orig] +filter = [ '.gitignore', '.travis.yml', '.git*' ] diff -Nru node-negotiator-0.6.1/debian/install node-negotiator-0.6.2/debian/install --- node-negotiator-0.6.1/debian/install 2017-09-04 16:11:11.000000000 +0000 +++ node-negotiator-0.6.2/debian/install 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -lib usr/lib/nodejs/negotiator -index.js usr/lib/nodejs/negotiator -package.json usr/lib/nodejs/negotiator diff -Nru node-negotiator-0.6.1/debian/rules node-negotiator-0.6.2/debian/rules --- node-negotiator-0.6.1/debian/rules 2017-09-04 16:11:11.000000000 +0000 +++ node-negotiator-0.6.2/debian/rules 2019-10-08 18:59:05.000000000 +0000 @@ -5,7 +5,4 @@ #export DH_VERBOSE=1 %: - dh $@ - -override_dh_auto_test: - mocha --reporter spec --check-leaks --bail test/ + dh $@ --with nodejs diff -Nru node-negotiator-0.6.1/debian/tests/control node-negotiator-0.6.2/debian/tests/control --- node-negotiator-0.6.1/debian/tests/control 2017-09-04 16:11:11.000000000 +0000 +++ node-negotiator-0.6.2/debian/tests/control 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -Tests: require -Depends: node-negotiator - -Test-Command: mocha --reporter spec --check-leaks --bail test/ -Depends: @, mocha diff -Nru node-negotiator-0.6.1/debian/tests/pkg-js/test node-negotiator-0.6.2/debian/tests/pkg-js/test --- node-negotiator-0.6.1/debian/tests/pkg-js/test 1970-01-01 00:00:00.000000000 +0000 +++ node-negotiator-0.6.2/debian/tests/pkg-js/test 2019-10-08 18:59:11.000000000 +0000 @@ -0,0 +1 @@ +mocha --reporter spec --check-leaks --bail test/ diff -Nru node-negotiator-0.6.1/debian/tests/require node-negotiator-0.6.2/debian/tests/require --- node-negotiator-0.6.1/debian/tests/require 2017-09-04 16:11:11.000000000 +0000 +++ node-negotiator-0.6.2/debian/tests/require 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -#!/bin/sh -set -e -nodejs -e "require('negotiator');" diff -Nru node-negotiator-0.6.1/debian/upstream/metadata node-negotiator-0.6.2/debian/upstream/metadata --- node-negotiator-0.6.1/debian/upstream/metadata 1970-01-01 00:00:00.000000000 +0000 +++ node-negotiator-0.6.2/debian/upstream/metadata 2019-10-08 18:56:10.000000000 +0000 @@ -0,0 +1,5 @@ +--- +Archive: GitHub +Bug-Database: https://github.com/federomero/negotiator/issues +Repository: https://github.com/federomero/negotiator.git +Repository-Browse: https://github.com/federomero/negotiator diff -Nru node-negotiator-0.6.1/.editorconfig node-negotiator-0.6.2/.editorconfig --- node-negotiator-0.6.1/.editorconfig 1970-01-01 00:00:00.000000000 +0000 +++ node-negotiator-0.6.2/.editorconfig 2019-04-30 00:17:49.000000000 +0000 @@ -0,0 +1,11 @@ +# http://editorconfig.org +root = true + +[*] +charset = utf-8 +insert_final_newline = true +trim_trailing_whitespace = true + +[{*.js,*.json,*.yml}] +indent_size = 2 +indent_style = space diff -Nru node-negotiator-0.6.1/.eslintignore node-negotiator-0.6.2/.eslintignore --- node-negotiator-0.6.1/.eslintignore 1970-01-01 00:00:00.000000000 +0000 +++ node-negotiator-0.6.2/.eslintignore 2019-04-30 00:17:49.000000000 +0000 @@ -0,0 +1,3 @@ +.nyc_output +coverage +node_modules diff -Nru node-negotiator-0.6.1/.eslintrc.yml node-negotiator-0.6.2/.eslintrc.yml --- node-negotiator-0.6.1/.eslintrc.yml 1970-01-01 00:00:00.000000000 +0000 +++ node-negotiator-0.6.2/.eslintrc.yml 2019-04-30 00:17:49.000000000 +0000 @@ -0,0 +1,7 @@ +root: true +rules: + eol-last: error + indent: ["error", 2, { "SwitchCase": 1 }] + no-mixed-spaces-and-tabs: error + no-param-reassign: error + no-trailing-spaces: error diff -Nru node-negotiator-0.6.1/.gitignore node-negotiator-0.6.2/.gitignore --- node-negotiator-0.6.1/.gitignore 2016-05-03 04:44:06.000000000 +0000 +++ node-negotiator-0.6.2/.gitignore 2019-04-30 00:17:49.000000000 +0000 @@ -1,23 +1,4 @@ -# OS X -.DS_Store* -Icon? -._* - -# Windows -Thumbs.db -ehthumbs.db -Desktop.ini - -# Linux -.directory -*~ - - -# npm -node_modules -*.log -*.gz - - -# Coveralls +.nyc_output coverage +node_modules +package-lock.json diff -Nru node-negotiator-0.6.1/HISTORY.md node-negotiator-0.6.2/HISTORY.md --- node-negotiator-0.6.1/HISTORY.md 2016-05-03 04:44:06.000000000 +0000 +++ node-negotiator-0.6.2/HISTORY.md 2019-04-30 00:17:49.000000000 +0000 @@ -1,3 +1,8 @@ +0.6.2 / 2019-04-29 +================== + + * Fix sorting charset, encoding, and language with extra parameters + 0.6.1 / 2016-05-02 ================== diff -Nru node-negotiator-0.6.1/lib/charset.js node-negotiator-0.6.2/lib/charset.js --- node-negotiator-0.6.1/lib/charset.js 2016-05-03 04:44:06.000000000 +0000 +++ node-negotiator-0.6.2/lib/charset.js 2019-04-30 00:17:49.000000000 +0000 @@ -58,8 +58,8 @@ var q = 1; if (match[2]) { var params = match[2].split(';') - for (var i = 0; i < params.length; i ++) { - var p = params[i].trim().split('='); + for (var j = 0; j < params.length; j++) { + var p = params[j].trim().split('='); if (p[0] === 'q') { q = parseFloat(p[1]); break; diff -Nru node-negotiator-0.6.1/lib/encoding.js node-negotiator-0.6.2/lib/encoding.js --- node-negotiator-0.6.1/lib/encoding.js 2016-05-03 04:44:06.000000000 +0000 +++ node-negotiator-0.6.2/lib/encoding.js 2019-04-30 00:17:49.000000000 +0000 @@ -74,8 +74,8 @@ var q = 1; if (match[2]) { var params = match[2].split(';'); - for (var i = 0; i < params.length; i ++) { - var p = params[i].trim().split('='); + for (var j = 0; j < params.length; j++) { + var p = params[j].trim().split('='); if (p[0] === 'q') { q = parseFloat(p[1]); break; diff -Nru node-negotiator-0.6.1/lib/language.js node-negotiator-0.6.2/lib/language.js --- node-negotiator-0.6.1/lib/language.js 2016-05-03 04:44:06.000000000 +0000 +++ node-negotiator-0.6.2/lib/language.js 2019-04-30 00:17:49.000000000 +0000 @@ -32,10 +32,10 @@ var accepts = accept.split(','); for (var i = 0, j = 0; i < accepts.length; i++) { - var langauge = parseLanguage(accepts[i].trim(), i); + var language = parseLanguage(accepts[i].trim(), i); - if (langauge) { - accepts[j++] = langauge; + if (language) { + accepts[j++] = language; } } @@ -55,16 +55,16 @@ if (!match) return null; var prefix = match[1], - suffix = match[2], - full = prefix; + suffix = match[2], + full = prefix; if (suffix) full += "-" + suffix; var q = 1; if (match[3]) { var params = match[3].split(';') - for (var i = 0; i < params.length; i ++) { - var p = params[i].split('='); + for (var j = 0; j < params.length; j++) { + var p = params[j].split('='); if (p[0] === 'q') q = parseFloat(p[1]); } } diff -Nru node-negotiator-0.6.1/package.json node-negotiator-0.6.2/package.json --- node-negotiator-0.6.1/package.json 2016-05-03 04:44:06.000000000 +0000 +++ node-negotiator-0.6.2/package.json 2019-04-30 00:17:49.000000000 +0000 @@ -1,7 +1,7 @@ { "name": "negotiator", "description": "HTTP content negotiation", - "version": "0.6.1", + "version": "0.6.2", "contributors": [ "Douglas Christopher Wilson ", "Federico Romero ", @@ -18,8 +18,10 @@ ], "repository": "jshttp/negotiator", "devDependencies": { - "istanbul": "0.4.3", - "mocha": "~1.21.5" + "eslint": "5.16.0", + "eslint-plugin-markdown": "1.0.0", + "mocha": "6.1.4", + "nyc": "14.0.0" }, "files": [ "lib/", @@ -32,8 +34,9 @@ "node": ">= 0.6" }, "scripts": { + "lint": "eslint --plugin markdown --ext js,md .", "test": "mocha --reporter spec --check-leaks --bail test/", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", - "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" + "test-cov": "nyc --reporter=html --reporter=text npm test", + "test-travis": "nyc --reporter=text npm test" } } diff -Nru node-negotiator-0.6.1/test/charset.js node-negotiator-0.6.2/test/charset.js --- node-negotiator-0.6.1/test/charset.js 2016-05-03 04:44:06.000000000 +0000 +++ node-negotiator-0.6.2/test/charset.js 2019-04-30 00:17:49.000000000 +0000 @@ -200,6 +200,12 @@ }) }) + whenAcceptCharset('UTF-8;foo=bar;q=1, ISO-8859-1;q=1', function () { + it('should return client-preferred charsets', function () { + assert.deepEqual(this.negotiator.charsets(), ['UTF-8', 'ISO-8859-1']) + }) + }) + whenAcceptCharset('UTF-8;q=0.9, ISO-8859-1;q=0.8, UTF-8;q=0.7', function () { it.skip('should use highest perferred order on duplicate', function () { assert.deepEqual(this.negotiator.charsets(), ['UTF-8', 'ISO-8859-1']) diff -Nru node-negotiator-0.6.1/test/encoding.js node-negotiator-0.6.2/test/encoding.js --- node-negotiator-0.6.1/test/encoding.js 2016-05-03 04:44:06.000000000 +0000 +++ node-negotiator-0.6.2/test/encoding.js 2019-04-30 00:17:49.000000000 +0000 @@ -281,6 +281,12 @@ }) }) + whenAcceptEncoding('gzip;foo=bar;q=1, deflate;q=1', function () { + it('should return client-preferred encodings', function () { + assert.deepEqual(this.negotiator.encodings(), ['gzip', 'deflate', 'identity']) + }) + }) + whenAcceptEncoding('gzip;q=0.8, identity;q=0.5, *;q=0.3', function () { it('should return client-preferred encodings', function () { assert.deepEqual(this.negotiator.encodings(), ['gzip', 'identity', '*']) diff -Nru node-negotiator-0.6.1/test/language.js node-negotiator-0.6.2/test/language.js --- node-negotiator-0.6.1/test/language.js 2016-05-03 04:44:06.000000000 +0000 +++ node-negotiator-0.6.2/test/language.js 2019-04-30 00:17:49.000000000 +0000 @@ -283,6 +283,12 @@ }) }) + whenAcceptLanguage('en-US;foo=bar;q=1, en-GB;q=1', function () { + it('should return en-US, en-GB', function () { + assert.deepEqual(this.negotiator.languages(), ['en-US', 'en-GB']) + }) + }) + whenAcceptLanguage('nl;q=0.5, fr, de, en, it, es, pt, no, se, fi, ro', function () { it('should use prefer fr over nl', function () { assert.deepEqual(this.negotiator.languages(), ['fr', 'de', 'en', 'it', 'es', 'pt', 'no', 'se', 'fi', 'ro', 'nl']) @@ -391,7 +397,7 @@ whenAcceptLanguage('nl;q=0.5, fr, de, en, it, es, pt, no, se, fi, ro', function () { it('should return preferred languages', function () { assert.deepEqual(this.negotiator.languages(['fr', 'de', 'en', 'it', 'es', 'pt', 'no', 'se', 'fi', 'ro', 'nl']), - ['fr', 'de', 'en', 'it', 'es', 'pt', 'no', 'se', 'fi', 'ro', 'nl']) + ['fr', 'de', 'en', 'it', 'es', 'pt', 'no', 'se', 'fi', 'ro', 'nl']) }) }) }) diff -Nru node-negotiator-0.6.1/.travis.yml node-negotiator-0.6.2/.travis.yml --- node-negotiator-0.6.1/.travis.yml 2016-05-03 04:44:06.000000000 +0000 +++ node-negotiator-0.6.2/.travis.yml 2019-04-30 00:17:49.000000000 +0000 @@ -7,17 +7,100 @@ - "1.8" - "2.5" - "3.3" - - "4.4" - - "5.11" - - "6.0" + - "4.9" + - "5.12" + - "6.16" + - "7.10" + - "8.15" + - "9.11" + - "10.15" + - "11.10" + - "12.1" sudo: false +dist: trusty +env: + global: + # Suppress Node.js 0.6 compile warnings + - "CXXCOM='$CXX -o $TARGET -c $CXXFLAGS $CCFLAGS -Wno-unused-local-typedefs -Wno-maybe-uninitialized -Wno-narrowing -Wno-strict-overflow $_CCCOMCOM $SOURCES'" +cache: + directories: + - node_modules before_install: + - | + # Setup utility functions + function node_version_lt () { + [[ "$(v "$TRAVIS_NODE_VERSION")" -lt "$(v "${1}")" ]] + } + function npm_module_installed () { + npm -lsp ls | grep -Fq "$(pwd)/node_modules/${1}:${1}@" + } + function npm_remove_module_re () { + node -e ' + fs = require("fs"); + p = JSON.parse(fs.readFileSync("package.json", "utf8")); + r = RegExp(process.argv[1]); + for (k in p.devDependencies) { + if (r.test(k)) delete p.devDependencies[k]; + } + fs.writeFileSync("package.json", JSON.stringify(p, null, 2) + "\n"); + ' "$@" + } + function npm_use_module () { + node -e ' + fs = require("fs"); + p = JSON.parse(fs.readFileSync("package.json", "utf8")); + p.devDependencies[process.argv[1]] = process.argv[2]; + fs.writeFileSync("package.json", JSON.stringify(p, null, 2) + "\n"); + ' "$@" + } + function v () { + tr '.' '\n' <<< "${1}" \ + | awk '{ printf "%03d", $0 }' \ + | sed 's/^0*//' + } + # Configure npm + - | + # Skip updating shrinkwrap / lock + npm config set shrinkwrap false # Setup Node.js version-specific dependencies - - "test $TRAVIS_NODE_VERSION != '0.6' || npm rm --save-dev istanbul" - - "test $TRAVIS_NODE_VERSION != '0.8' || npm rm --save-dev istanbul" + - | + # Configure eslint for linting + if node_version_lt '6.0'; then npm_remove_module_re '^eslint(-|$)' + fi + - | + # Configure mocha for testing + if node_version_lt '0.8' ; then npm_use_module 'mocha' '1.21.5' + elif node_version_lt '0.10'; then npm_use_module 'mocha' '2.5.3' + elif node_version_lt '4.0' ; then npm_use_module 'mocha' '3.5.3' + elif node_version_lt '6.0' ; then npm_use_module 'mocha' '5.2.0' + fi + - | + # Configure nyc for testing + if node_version_lt '0.10'; then npm_remove_module_re '^nyc$' + elif node_version_lt '4.0' ; then npm_use_module 'nyc' '10.3.2' + elif node_version_lt '6.0' ; then npm_use_module 'nyc' '11.9.0' + fi + # Update Node.js modules + - | + # Prune & rebuild node_modules + if [[ -d node_modules ]]; then + npm prune + npm rebuild + fi script: - # Run test script, depending on istanbul install - - "test ! -z $(npm -ps ls istanbul) || npm test" - - "test -z $(npm -ps ls istanbul) || npm run-script test-travis" + - | + # Run test script, depending on istanbul install + if npm_module_installed 'istanbul'; then npm run-script test-travis + else npm test + fi + - | + # Run linting, depending on eslint install + if npm_module_installed 'eslint'; then npm run-script lint + fi after_script: - - "test -e ./coverage/lcov.info && npm install coveralls@2 && cat ./coverage/lcov.info | coveralls" + - | + # Upload coverage to coveralls if exists + if [[ -d .nyc_output ]]; then + npm install --save-dev coveralls@2 + nyc report --reporter=text-lcov | coveralls + fi