Comparing version 1.0.0 to 1.0.1
@@ -94,2 +94,3 @@ declare const MIME_FULL: { | ||
'xproc+xml': string; | ||
'xslt+xml': string; | ||
'xv+xml': string; | ||
@@ -96,0 +97,0 @@ adpcm: string; |
"use strict"; | ||
/* CONSTS */ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.MIME_SHORT = exports.MIME_FULL = void 0; | ||
var MIME_FULL = { | ||
@@ -32,3 +33,3 @@ /* APPLICATION */ | ||
'dssc+xml': 'xdssc', | ||
'ecmascript': 'ecma', | ||
'ecmascript': 'es', | ||
'font-tdpfr': 'pfr', | ||
@@ -103,2 +104,3 @@ 'geo+json': 'geojson', | ||
'xproc+xml': 'xpl', | ||
'xslt+xml': 'xsl', | ||
'xv+xml': 'mxml', | ||
@@ -105,0 +107,0 @@ /* AUDIO */ |
{ | ||
"name": "mime2ext", | ||
"description": "Convert a mime type to a file extension. It works only with popular mime types and its super lightweight.", | ||
"version": "1.0.0", | ||
"description": "Convert a mime type to a file extension. It works only with popular mime types and it's super lightweight.", | ||
"version": "1.0.1", | ||
"main": "dist/index.js", | ||
@@ -51,2 +51,3 @@ "types": "dist/index.d.ts", | ||
"ava-spec": "^1.1.1", | ||
"mime": "^3.0.0", | ||
"nyc": "^15.0.0", | ||
@@ -53,0 +54,0 @@ "rimraf": "^3.0.2", |
# Mime2Ext | ||
Convert a mime type to a file extension. It works only with popular mime types and its super lightweight. | ||
Convert a mime type to a file extension. It works only with popular mime types and it's super lightweight. | ||
@@ -5,0 +5,0 @@ This library is designed to only support the ~250 popular mime types listed [here](https://github.com/broofa/node-mime/blob/master/types/standard.js), while being ~98% smaller than [mime-types](https://www.npmjs.com/package/mime-types) and ~65% smaller than even [mime](https://www.npmjs.com/package/mime)'s lite version. |
@@ -32,3 +32,3 @@ | ||
'dssc+xml': 'xdssc', | ||
'ecmascript': 'ecma', | ||
'ecmascript': 'es', | ||
'font-tdpfr': 'pfr', | ||
@@ -103,2 +103,3 @@ 'geo+json': 'geojson', | ||
'xproc+xml': 'xpl', | ||
'xslt+xml': 'xsl', | ||
'xv+xml': 'mxml', | ||
@@ -105,0 +106,0 @@ /* AUDIO */ |
@@ -23,3 +23,3 @@ | ||
'application/dssc+xml': 'xdssc', | ||
'application/ecmascript': 'ecma', | ||
'application/ecmascript': 'es', | ||
'application/emma+xml': 'emma', | ||
@@ -139,3 +139,3 @@ 'application/epub+zip': 'epub', | ||
'application/xproc+xml': 'xpl', | ||
'application/xslt+xml': 'xslt', | ||
'application/xslt+xml': 'xsl', | ||
'application/xspf+xml': 'xspf', | ||
@@ -142,0 +142,0 @@ 'application/xv+xml': 'mxml', |
@@ -5,2 +5,3 @@ | ||
import {describe} from 'ava-spec'; | ||
import mime from 'mime'; | ||
import {default as mime2ext} from '../dist'; | ||
@@ -13,2 +14,12 @@ import {TESTS} from './fixtures'; | ||
it ( 'returns the same extensions as mime', t => { | ||
for ( const test in TESTS ) { | ||
t.is ( mime2ext ( test ), mime.getExtension ( test ) ); | ||
} | ||
}); | ||
it ( 'supports popular mime types', t => { | ||
@@ -15,0 +26,0 @@ |
24489
784
8
13