updated npm modules

This commit is contained in:
2019-05-20 20:43:45 -05:00
parent 2319197b81
commit f166b72b7d
1113 changed files with 8758 additions and 12227 deletions

View File

@@ -2,6 +2,28 @@
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
## [2.4.3](https://github.com/broofa/node-mime/compare/v2.4.2...v2.4.3) (2019-05-15)
## [2.4.2](https://github.com/broofa/node-mime/compare/v2.4.1...v2.4.2) (2019-04-07)
### Bug Fixes
* don't use arrow function introduced in 2.4.1 ([2e00b5c](https://github.com/broofa/node-mime/commit/2e00b5c))
## [2.4.1](https://github.com/broofa/node-mime/compare/v2.4.0...v2.4.1) (2019-04-03)
### Bug Fixes
* update MDN and mime-db types ([3e567a9](https://github.com/broofa/node-mime/commit/3e567a9))
<a name="2.4.0"></a>
# [2.4.0](https://github.com/broofa/node-mime/compare/v2.3.1...v2.4.0) (2018-11-26)

View File

@@ -99,6 +99,9 @@ Module | Size
Both `require('mime')` and `require('mime/lite')` return instances of the MIME
class, documented below.
Note: Inputs to this API are case-insensitive. Outputs (returned values) will
be lowercase.
### new Mime(typeMap, ... more maps)
Most users of this module will not need to create Mime instances directly.

View File

@@ -18,7 +18,7 @@ function Mime() {
}
/**
* Define mimetype -> xtension mappings. Each key is a mime-type that maps
* Define mimetype -> extension mappings. Each key is a mime-type that maps
* to an array of extensions associated with the type. The first extension is
* used as the default extension for the type.
*
@@ -38,7 +38,9 @@ function Mime() {
*/
Mime.prototype.define = function(typeMap, force) {
for (var type in typeMap) {
var extensions = typeMap[type];
var extensions = typeMap[type].map(function(t) {return t.toLowerCase()});
type = type.toLowerCase();
for (var i = 0; i < extensions.length; i++) {
var ext = extensions[i];

View File

@@ -1,26 +1,26 @@
{
"_from": "mime@^2.3.1",
"_id": "mime@2.4.0",
"_from": "mime@^2.4.2",
"_id": "mime@2.4.3",
"_inBundle": false,
"_integrity": "sha512-ikBcWwyqXQSHKtciCcctu9YfPbFYZ4+gbHEmE0Q8jzcTYQg5dHCr3g2wwAZjPoJfQVXZq6KXAjpXOTf5/cjT7w==",
"_integrity": "sha512-QgrPRJfE+riq5TPZMcHZOtm8c6K/yYrMbKIoRfapfiGLxS8OTeIfRhUGW5LU7MlRa52KOAGCfUNruqLrIBvWZw==",
"_location": "/webpack-dev-middleware/mime",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "mime@^2.3.1",
"raw": "mime@^2.4.2",
"name": "mime",
"escapedName": "mime",
"rawSpec": "^2.3.1",
"rawSpec": "^2.4.2",
"saveSpec": null,
"fetchSpec": "^2.3.1"
"fetchSpec": "^2.4.2"
},
"_requiredBy": [
"/webpack-dev-middleware"
],
"_resolved": "https://registry.npmjs.org/mime/-/mime-2.4.0.tgz",
"_shasum": "e051fd881358585f3279df333fe694da0bcffdd6",
"_spec": "mime@^2.3.1",
"_resolved": "https://registry.npmjs.org/mime/-/mime-2.4.3.tgz",
"_shasum": "229687331e86f68924e6cb59e1cdd937f18275fe",
"_spec": "mime@^2.4.2",
"_where": "C:\\xampp\\htdocs\\w4rpservices\\node_modules\\webpack-dev-middleware",
"author": {
"name": "Robert Kieffer",
@@ -39,14 +39,15 @@
"deprecated": false,
"description": "A comprehensive library for mime-type mapping",
"devDependencies": {
"chalk": "1.1.3",
"eslint": "^5.9.0",
"mime-db": "^1.37.0",
"mime-score": "1.0.1",
"mime-types": "2.1.15",
"mocha": "5.2.0",
"runmd": "1.0.1",
"standard-version": "^4.4.0"
"benchmark": "^2.1.4",
"chalk": "2.4.2",
"eslint": "5.16.0",
"mime-db": "1.38.0",
"mime-score": "1.1.2",
"mime-types": "2.1.22",
"mocha": "6.0.2",
"runmd": "1.2.1",
"standard-version": "5.0.2"
},
"engines": {
"node": ">=4.0.0"
@@ -63,10 +64,11 @@
"type": "git"
},
"scripts": {
"benchmark": "node src/benchmark.js",
"md": "runmd --watch --output README.md src/README_js.md",
"prepare": "node src/build.js && runmd --output README.md src/README_js.md",
"release": "standard-version",
"test": "mocha src/test.js"
},
"version": "2.4.0"
"version": "2.4.3"
}

View File

@@ -47,7 +47,7 @@ for (var type in db) {
}
function writeTypesFile(types, path) {
fs.writeFileSync(path, JSON.stringify(types));
fs.writeFileSync(path, 'module.exports = ' + JSON.stringify(types) + ';');
}
// Segregate into standard and non-standard types based on facet per
@@ -67,5 +67,5 @@ Object.keys(db).sort().forEach(function(k) {
}
});
writeTypesFile(standard, path.join(__dirname, '../types', 'standard.json'));
writeTypesFile(other, path.join(__dirname, '../types', 'other.json'));
writeTypesFile(standard, path.join(__dirname, '../types', 'standard.js'));
writeTypesFile(other, path.join(__dirname, '../types', 'other.js'));

View File

@@ -76,6 +76,24 @@ describe('class Mime', function() {
});
});
it ('case-insensitive', function() {
var Mime = require('../Mime');
const mime = new Mime({
'TEXT/UPPER': ['UP'],
'text/lower': ['low'],
});
assert.equal(mime.getType('test.up'), 'text/upper');
assert.equal(mime.getType('test.UP'), 'text/upper');
assert.equal(mime.getType('test.low'), 'text/lower');
assert.equal(mime.getType('test.LOW'), 'text/lower');
assert.equal(mime.getExtension('text/upper'), 'up');
assert.equal(mime.getExtension('text/lower'), 'low');
assert.equal(mime.getExtension('TEXT/UPPER'), 'up');
assert.equal(mime.getExtension('TEXT/LOWER'), 'low');
});
it('getType()', function() {
// Upper/lower case
assert.equal(mime.getType('text.txt'), 'text/plain');
@@ -151,62 +169,43 @@ describe('DB', function() {
it('MDN types', function() {
// MDN types listed at https://goo.gl/lHrFU6
var MDN = {
'aac': 'audio/aac',
'abw': 'application/x-abiword',
'arc': 'application/octet-stream',
'avi': 'video/x-msvideo',
'azw': 'application/vnd.amazon.ebook',
'bin': 'application/octet-stream',
'bz': 'application/x-bzip',
'bz2': 'application/x-bzip2',
'csh': 'application/x-csh',
'css': 'text/css',
'csv': 'text/csv',
'doc': 'application/msword',
'epub': 'application/epub+zip',
'gif': 'image/gif',
'html': 'text/html',
'ico': 'image/x-icon',
'ics': 'text/calendar',
'jar': 'application/java-archive',
'jpg': 'image/jpeg',
'js': 'application/javascript',
'json': 'application/json',
'midi': 'audio/midi',
'mpeg': 'video/mpeg',
'mpkg': 'application/vnd.apple.installer+xml',
'odp': 'application/vnd.oasis.opendocument.presentation',
'ods': 'application/vnd.oasis.opendocument.spreadsheet',
'odt': 'application/vnd.oasis.opendocument.text',
'oga': 'audio/ogg',
'ogv': 'video/ogg',
'ogx': 'application/ogg',
'png': 'image/png',
'pdf': 'application/pdf',
'ppt': 'application/vnd.ms-powerpoint',
'rar': 'application/x-rar-compressed',
'rtf': 'application/rtf',
'sh': 'application/x-sh',
'svg': 'image/svg+xml',
'swf': 'application/x-shockwave-flash',
'tar': 'application/x-tar',
'tiff': 'image/tiff',
'ttf': 'font/ttf',
'vsd': 'application/vnd.visio',
'wav': 'audio/x-wav',
'weba': 'audio/webm',
'webm': 'video/webm',
'webp': 'image/webp',
'woff': 'font/woff',
'woff2': 'font/woff2',
'xhtml': 'application/xhtml+xml',
'xls': 'application/vnd.ms-excel',
'xml': 'application/xml',
'xul': 'application/vnd.mozilla.xul+xml',
'zip': 'application/zip',
aac: 'audio/aac',
bin: 'application/octet-stream',
css: 'text/css',
csv: 'text/csv',
doc: 'application/msword',
docx: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
gif: 'image/gif',
html: 'text/html',
ico: 'image/vnd.microsoft.icon',
jpg: 'image/jpeg',
js: 'application/javascript',
json: 'application/json',
midi: 'audio/midi',
mjs: 'application/javascript',
mp3: 'audio/mpeg',
mpeg: 'video/mpeg',
oga: 'audio/ogg',
ogv: 'video/ogg',
otf: 'font/otf',
png: 'image/png',
pdf: 'application/pdf',
rtf: 'application/rtf',
svg: 'image/svg+xml',
swf: 'application/x-shockwave-flash',
tiff: 'image/tiff',
ttf: 'font/ttf',
txt: 'text/plain',
wav: 'audio/wav',
weba: 'audio/webm',
webm: 'video/webm',
webp: 'image/webp',
woff: 'font/woff',
xls: 'application/vnd.ms-excel',
xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
xml: 'application/xml',
zip: 'application/zip',
'3gp': 'video/3gpp',
'3g2': 'video/3gpp2',
'7z': 'application/x-7z-compressed',
};
for (var ext in MDN) {