Commit 9459f84f authored by Dan Allen's avatar Dan Allen

rename mime.js to mime-types-with-asciidoc.js to clarify intent

parent ad34d45b
Pipeline #14720495 passed with stages
in 4 minutes and 33 seconds
......@@ -8,7 +8,7 @@ const del = require('del')
const File = require('vinyl')
const git = require('nodegit')
const isMatch = require('matcher').isMatch
const mime = require('./mime')
const mimeTypes = require('./mime-types-with-asciidoc')
const streamToArray = require('stream-to-array')
const vfs = require('vinyl-fs')
const yaml = require('js-yaml')
......@@ -212,7 +212,7 @@ function assignFileProperties (file, url, branch, startPath = '/') {
const extname = path.extname(file.path)
file.src = {
basename: path.basename(file.path),
mediaType: mime.lookup(extname),
mediaType: mimeTypes.lookup(extname),
stem: path.basename(file.path, extname),
extname,
origin: {
......
'use strict'
const mimeTypes = require('mime-types')
mimeTypes.types['adoc'] = 'text/asciidoc'
mimeTypes.extensions['text/asciidoc'] = ['adoc']
module.exports = mimeTypes
'use strict'
const mime = require('mime-types')
mime.types['adoc'] = 'text/asciidoc'
mime.extensions['text/asciidoc'] = ['adoc']
module.exports = mime
......@@ -4,7 +4,7 @@
const { expect } = require('../../../test/test-utils')
const classifyContent = require('../lib/index')
const path = require('path')
const mime = require('../../content-aggregator/lib/mime')
const mimeTypes = require('../../content-aggregator/lib/mime-types-with-asciidoc')
const createFile = (filepath) => {
const basename = path.basename(filepath)
......@@ -12,7 +12,7 @@ const createFile = (filepath) => {
const stem = path.basename(filepath, extname)
return {
path: filepath,
src: { basename, mediaType: mime.lookup(extname), stem, extname },
src: { basename, mediaType: mimeTypes.lookup(extname), stem, extname },
}
}
......
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