Commit ce948688 authored by Utkarsh Gupta's avatar Utkarsh Gupta

New upstream version 2.1.21

parent 1a88ec9a
.DS_Store*
*.log
*.gz
.nyc_output
coverage
node_modules
npm-debug.log
package-lock.json
coverage
......@@ -5,35 +5,86 @@ node_js:
- "0.10"
- "0.12"
- "1.8"
- "2.2"
- "2.5"
- "3.3"
- "4.9"
- "5.12"
- "6.14"
- "7.10"
- "8.11"
- "8.12"
- "9.11"
- "10.9"
- "10.12"
sudo: false
dist: percise
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:
# Skip updating shrinkwrap / lock
- "npm config set shrinkwrap false"
# 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"
- "test $(echo $TRAVIS_NODE_VERSION | cut -d. -f1) -ge 4 || npm rm --save-dev $(grep -E '\"eslint\\S*\"' package.json | cut -d'\"' -f2)"
- |
# mocha for testing
# - use 1.x for Node.js < 0.8
# - use 2.x for Node.js < 0.10
# - use 3.x for Node.js < 6
if [[ "$(cut -d. -f1 <<< "$TRAVIS_NODE_VERSION")" -eq 0 && "$(cut -d. -f2 <<< "$TRAVIS_NODE_VERSION")" -lt 8 ]]; then
npm install --save-dev mocha@1.21.5
elif [[ "$(cut -d. -f1 <<< "$TRAVIS_NODE_VERSION")" -eq 0 && "$(cut -d. -f2 <<< "$TRAVIS_NODE_VERSION")" -lt 10 ]]; then
npm install --save-dev mocha@2.5.3
elif [[ "$(cut -d. -f1 <<< "$TRAVIS_NODE_VERSION")" -lt 6 ]]; then
npm install --save-dev mocha@3.5.3
fi
- |
# nyc for coverage
# - remove for Node.js < 0.10
# - use 10.x for Node.js < 4
# - use 11.x for Node.js < 6
if [[ "$(cut -d. -f1 <<< "$TRAVIS_NODE_VERSION")" -eq 0 && "$(cut -d. -f2 <<< "$TRAVIS_NODE_VERSION")" -lt 10 ]]; then
npm rm --save-dev nyc
elif [[ "$(cut -d. -f1 <<< "$TRAVIS_NODE_VERSION")" -lt 4 ]]; then
npm install --save-dev nyc@10.3.2
elif [[ "$(cut -d. -f1 <<< "$TRAVIS_NODE_VERSION")" -lt 6 ]]; then
npm install --save-dev nyc@11.9.0
fi
- |
# eslint for linting
# - remove on Node.js < 6
if [[ "$(cut -d. -f1 <<< "$TRAVIS_NODE_VERSION")" -lt 6 ]]; then
node -pe 'Object.keys(require("./package").devDependencies).join("\n")' | \
grep -E '^eslint(-|$)' | \
xargs npm rm --save-dev
fi
# Update Node.js modules
- "test ! -d node_modules || npm prune"
- "test ! -d node_modules || npm rebuild"
- |
# 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"
- "test -z $(npm -ps ls eslint ) || npm run-script lint"
- |
# Run test script, depending on istanbul install
if [[ -z "$(npm -ps ls istanbul)" ]]; then
npm test
else
npm run-script test-travis
fi
- |
# Run linting, if eslint exists
if [[ -n "$(npm -ps ls 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
2.1.21 / 2018-10-19
===================
* deps: mime-db@~1.37.0
- Add extensions to HEIC image types
- Add new upstream MIME types
2.1.20 / 2018-08-26
===================
......
# mime-types
[![NPM Version][npm-image]][npm-url]
[![NPM Downloads][downloads-image]][downloads-url]
[![NPM Version][npm-version-image]][npm-url]
[![NPM Downloads][npm-downloads-image]][npm-url]
[![Node.js Version][node-version-image]][node-version-url]
[![Build Status][travis-image]][travis-url]
[![Test Coverage][coveralls-image]][coveralls-url]
......@@ -96,13 +96,12 @@ A map of extensions by content-type.
[MIT](LICENSE)
[npm-image]: https://img.shields.io/npm/v/mime-types.svg
[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/mime-types/master
[coveralls-url]: https://coveralls.io/r/jshttp/mime-types?branch=master
[node-version-image]: https://badgen.net/npm/node/mime-types
[node-version-url]: https://nodejs.org/en/download
[npm-downloads-image]: https://badgen.net/npm/dm/mime-types
[npm-url]: https://npmjs.org/package/mime-types
[node-version-image]: https://img.shields.io/node/v/mime-types.svg
[node-version-url]: https://nodejs.org/en/download/
[travis-image]: https://img.shields.io/travis/jshttp/mime-types/master.svg
[npm-version-image]: https://badgen.net/npm/v/mime-types
[travis-image]: https://badgen.net/travis/jshttp/mime-types/master
[travis-url]: https://travis-ci.org/jshttp/mime-types
[coveralls-image]: https://img.shields.io/coveralls/jshttp/mime-types/master.svg
[coveralls-url]: https://coveralls.io/r/jshttp/mime-types
[downloads-image]: https://img.shields.io/npm/dm/mime-types.svg
[downloads-url]: https://npmjs.org/package/mime-types
{
"name": "mime-types",
"description": "The ultimate javascript content-type utility.",
"version": "2.1.20",
"version": "2.1.21",
"contributors": [
"Douglas Christopher Wilson <doug@somethingdoug.com>",
"Jeremiah Senkpiel <fishrock123@rocketmail.com> (https://searchbeam.jit.su)",
......@@ -14,17 +14,17 @@
],
"repository": "jshttp/mime-types",
"dependencies": {
"mime-db": "~1.36.0"
"mime-db": "~1.37.0"
},
"devDependencies": {
"eslint": "4.19.1",
"eslint-config-standard": "11.0.0",
"eslint-plugin-import": "2.13.0",
"eslint-plugin-node": "6.0.1",
"eslint-plugin-promise": "3.8.0",
"eslint-plugin-standard": "3.1.0",
"istanbul": "0.4.5",
"mocha": "1.21.5"
"eslint": "5.7.0",
"eslint-config-standard": "12.0.0",
"eslint-plugin-import": "2.14.0",
"eslint-plugin-node": "7.0.1",
"eslint-plugin-promise": "4.0.1",
"eslint-plugin-standard": "4.0.0",
"mocha": "5.2.0",
"nyc": "13.1.0"
},
"files": [
"HISTORY.md",
......@@ -37,7 +37,7 @@
"scripts": {
"lint": "eslint .",
"test": "mocha --reporter spec test/test.js",
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot test/test.js",
"test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot test/test.js"
"test-cov": "nyc --reporter=html --reporter=text npm test",
"test-travis": "nyc --reporter=text npm test"
}
}
......@@ -5,31 +5,31 @@ var mimeTypes = require('..')
describe('mimeTypes', function () {
describe('.charset(type)', function () {
it('should return "UTF-8" for "application/json"', function () {
assert.equal(mimeTypes.charset('application/json'), 'UTF-8')
assert.strictEqual(mimeTypes.charset('application/json'), 'UTF-8')
})
it('should return "UTF-8" for "application/json; foo=bar"', function () {
assert.equal(mimeTypes.charset('application/json; foo=bar'), 'UTF-8')
assert.strictEqual(mimeTypes.charset('application/json; foo=bar'), 'UTF-8')
})
it('should return "UTF-8" for "application/javascript"', function () {
assert.equal(mimeTypes.charset('application/javascript'), 'UTF-8')
assert.strictEqual(mimeTypes.charset('application/javascript'), 'UTF-8')
})
it('should return "UTF-8" for "application/JavaScript"', function () {
assert.equal(mimeTypes.charset('application/JavaScript'), 'UTF-8')
assert.strictEqual(mimeTypes.charset('application/JavaScript'), 'UTF-8')
})
it('should return "UTF-8" for "text/html"', function () {
assert.equal(mimeTypes.charset('text/html'), 'UTF-8')
assert.strictEqual(mimeTypes.charset('text/html'), 'UTF-8')
})
it('should return "UTF-8" for "TEXT/HTML"', function () {
assert.equal(mimeTypes.charset('TEXT/HTML'), 'UTF-8')
assert.strictEqual(mimeTypes.charset('TEXT/HTML'), 'UTF-8')
})
it('should return "UTF-8" for any text/*', function () {
assert.equal(mimeTypes.charset('text/x-bogus'), 'UTF-8')
assert.strictEqual(mimeTypes.charset('text/x-bogus'), 'UTF-8')
})
it('should return false for unknown types', function () {
......@@ -50,19 +50,19 @@ describe('mimeTypes', function () {
describe('.contentType(extension)', function () {
it('should return content-type for "html"', function () {
assert.equal(mimeTypes.contentType('html'), 'text/html; charset=utf-8')
assert.strictEqual(mimeTypes.contentType('html'), 'text/html; charset=utf-8')
})
it('should return content-type for ".html"', function () {
assert.equal(mimeTypes.contentType('.html'), 'text/html; charset=utf-8')
assert.strictEqual(mimeTypes.contentType('.html'), 'text/html; charset=utf-8')
})
it('should return content-type for "jade"', function () {
assert.equal(mimeTypes.contentType('jade'), 'text/jade; charset=utf-8')
assert.strictEqual(mimeTypes.contentType('jade'), 'text/jade; charset=utf-8')
})
it('should return content-type for "json"', function () {
assert.equal(mimeTypes.contentType('json'), 'application/json; charset=utf-8')
assert.strictEqual(mimeTypes.contentType('json'), 'application/json; charset=utf-8')
})
it('should return false for unknown extensions', function () {
......@@ -79,35 +79,35 @@ describe('mimeTypes', function () {
describe('.contentType(type)', function () {
it('should attach charset to "application/json"', function () {
assert.equal(mimeTypes.contentType('application/json'), 'application/json; charset=utf-8')
assert.strictEqual(mimeTypes.contentType('application/json'), 'application/json; charset=utf-8')
})
it('should attach charset to "application/json; foo=bar"', function () {
assert.equal(mimeTypes.contentType('application/json; foo=bar'), 'application/json; foo=bar; charset=utf-8')
assert.strictEqual(mimeTypes.contentType('application/json; foo=bar'), 'application/json; foo=bar; charset=utf-8')
})
it('should attach charset to "TEXT/HTML"', function () {
assert.equal(mimeTypes.contentType('TEXT/HTML'), 'TEXT/HTML; charset=utf-8')
assert.strictEqual(mimeTypes.contentType('TEXT/HTML'), 'TEXT/HTML; charset=utf-8')
})
it('should attach charset to "text/html"', function () {
assert.equal(mimeTypes.contentType('text/html'), 'text/html; charset=utf-8')
assert.strictEqual(mimeTypes.contentType('text/html'), 'text/html; charset=utf-8')
})
it('should not alter "text/html; charset=iso-8859-1"', function () {
assert.equal(mimeTypes.contentType('text/html; charset=iso-8859-1'), 'text/html; charset=iso-8859-1')
assert.strictEqual(mimeTypes.contentType('text/html; charset=iso-8859-1'), 'text/html; charset=iso-8859-1')
})
it('should return type for unknown types', function () {
assert.equal(mimeTypes.contentType('application/x-bogus'), 'application/x-bogus')
assert.strictEqual(mimeTypes.contentType('application/x-bogus'), 'application/x-bogus')
})
})
describe('.extension(type)', function () {
it('should return extension for mime type', function () {
assert.equal(mimeTypes.extension('text/html'), 'html')
assert.equal(mimeTypes.extension(' text/html'), 'html')
assert.equal(mimeTypes.extension('text/html '), 'html')
assert.strictEqual(mimeTypes.extension('text/html'), 'html')
assert.strictEqual(mimeTypes.extension(' text/html'), 'html')
assert.strictEqual(mimeTypes.extension('text/html '), 'html')
})
it('should return false for unknown type', function () {
......@@ -126,47 +126,47 @@ describe('mimeTypes', function () {
})
it('should return extension for mime type with parameters', function () {
assert.equal(mimeTypes.extension('text/html;charset=UTF-8'), 'html')
assert.equal(mimeTypes.extension('text/HTML; charset=UTF-8'), 'html')
assert.equal(mimeTypes.extension('text/html; charset=UTF-8'), 'html')
assert.equal(mimeTypes.extension('text/html; charset=UTF-8 '), 'html')
assert.equal(mimeTypes.extension('text/html ; charset=UTF-8'), 'html')
assert.strictEqual(mimeTypes.extension('text/html;charset=UTF-8'), 'html')
assert.strictEqual(mimeTypes.extension('text/HTML; charset=UTF-8'), 'html')
assert.strictEqual(mimeTypes.extension('text/html; charset=UTF-8'), 'html')
assert.strictEqual(mimeTypes.extension('text/html; charset=UTF-8 '), 'html')
assert.strictEqual(mimeTypes.extension('text/html ; charset=UTF-8'), 'html')
})
})
describe('.lookup(extension)', function () {
it('should return mime type for ".html"', function () {
assert.equal(mimeTypes.lookup('.html'), 'text/html')
assert.strictEqual(mimeTypes.lookup('.html'), 'text/html')
})
it('should return mime type for ".js"', function () {
assert.equal(mimeTypes.lookup('.js'), 'application/javascript')
assert.strictEqual(mimeTypes.lookup('.js'), 'application/javascript')
})
it('should return mime type for ".json"', function () {
assert.equal(mimeTypes.lookup('.json'), 'application/json')
assert.strictEqual(mimeTypes.lookup('.json'), 'application/json')
})
it('should return mime type for ".rtf"', function () {
assert.equal(mimeTypes.lookup('.rtf'), 'application/rtf')
assert.strictEqual(mimeTypes.lookup('.rtf'), 'application/rtf')
})
it('should return mime type for ".txt"', function () {
assert.equal(mimeTypes.lookup('.txt'), 'text/plain')
assert.strictEqual(mimeTypes.lookup('.txt'), 'text/plain')
})
it('should return mime type for ".xml"', function () {
assert.equal(mimeTypes.lookup('.xml'), 'application/xml')
assert.strictEqual(mimeTypes.lookup('.xml'), 'application/xml')
})
it('should work without the leading dot', function () {
assert.equal(mimeTypes.lookup('html'), 'text/html')
assert.equal(mimeTypes.lookup('xml'), 'application/xml')
assert.strictEqual(mimeTypes.lookup('html'), 'text/html')
assert.strictEqual(mimeTypes.lookup('xml'), 'application/xml')
})
it('should be case insensitive', function () {
assert.equal(mimeTypes.lookup('HTML'), 'text/html')
assert.equal(mimeTypes.lookup('.Xml'), 'application/xml')
assert.strictEqual(mimeTypes.lookup('HTML'), 'text/html')
assert.strictEqual(mimeTypes.lookup('.Xml'), 'application/xml')
})
it('should return false for unknown extension', function () {
......@@ -184,22 +184,22 @@ describe('mimeTypes', function () {
describe('.lookup(path)', function () {
it('should return mime type for file name', function () {
assert.equal(mimeTypes.lookup('page.html'), 'text/html')
assert.strictEqual(mimeTypes.lookup('page.html'), 'text/html')
})
it('should return mime type for relative path', function () {
assert.equal(mimeTypes.lookup('path/to/page.html'), 'text/html')
assert.equal(mimeTypes.lookup('path\\to\\page.html'), 'text/html')
assert.strictEqual(mimeTypes.lookup('path/to/page.html'), 'text/html')
assert.strictEqual(mimeTypes.lookup('path\\to\\page.html'), 'text/html')
})
it('should return mime type for absolute path', function () {
assert.equal(mimeTypes.lookup('/path/to/page.html'), 'text/html')
assert.equal(mimeTypes.lookup('C:\\path\\to\\page.html'), 'text/html')
assert.strictEqual(mimeTypes.lookup('/path/to/page.html'), 'text/html')
assert.strictEqual(mimeTypes.lookup('C:\\path\\to\\page.html'), 'text/html')
})
it('should be case insensitive', function () {
assert.equal(mimeTypes.lookup('/path/to/PAGE.HTML'), 'text/html')
assert.equal(mimeTypes.lookup('C:\\path\\to\\PAGE.HTML'), 'text/html')
assert.strictEqual(mimeTypes.lookup('/path/to/PAGE.HTML'), 'text/html')
assert.strictEqual(mimeTypes.lookup('C:\\path\\to\\PAGE.HTML'), 'text/html')
})
it('should return false for unknown extension', function () {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment