inputformat-to-jstransformer
Advanced tools
Comparing version 1.1.10 to 1.2.0
@@ -31,4 +31,11 @@ { | ||
"bracket": [ | ||
"jstransformer-bracket-template", | ||
"jstransformer-consolidate" | ||
], | ||
"bracket-template": [ | ||
"jstransformer-bracket-template" | ||
], | ||
"brkt": [ | ||
"jstransformer-bracket-template" | ||
], | ||
"browserify": [ | ||
@@ -81,4 +88,3 @@ "jstransformer-browserify" | ||
"jstransformer-jscss", | ||
"jstransformer-jscss-lite", | ||
"jstransformer-myth" | ||
"jstransformer-jscss-lite" | ||
], | ||
@@ -161,2 +167,5 @@ "css-beautify": [ | ||
], | ||
"gray-matter": [ | ||
"jstransformer-gray-matter" | ||
], | ||
"haml": [ | ||
@@ -188,3 +197,2 @@ "jstransformer-consolidate", | ||
"hbs": [ | ||
"jstransformer-gray-matter", | ||
"jstransformer-handlebars", | ||
@@ -212,5 +220,5 @@ "jstransformer-mini-handlebars" | ||
"jstransformer-bliss", | ||
"jstransformer-gray-matter", | ||
"jstransformer-html-minifier", | ||
"jstransformer-html2jade", | ||
"jstransformer-jade-jekyll", | ||
"jstransformer-jst", | ||
@@ -239,2 +247,5 @@ "jstransformer-lodash", | ||
], | ||
"i-template": [ | ||
"jstransformer-i-template" | ||
], | ||
"imba": [ | ||
@@ -297,2 +308,5 @@ "jstransformer-imba" | ||
], | ||
"katex": [ | ||
"jstransformer-katex" | ||
], | ||
"lebab": [ | ||
@@ -320,3 +334,2 @@ "jstransformer-lebab" | ||
"jstransformer-consolidate", | ||
"jstransformer-gray-matter", | ||
"jstransformer-lodash" | ||
@@ -332,3 +345,6 @@ ], | ||
"jstransformer-marked", | ||
"jstransformer-marky-markdown", | ||
"jstransformer-mdast", | ||
"jstransformer-megamark", | ||
"jstransformer-pfm", | ||
"jstransformer-remark", | ||
@@ -342,4 +358,8 @@ "jstransformer-remarkable", | ||
], | ||
"markdown-yml": [ | ||
"jstransformer-markdown-yml" | ||
], | ||
"marked": [ | ||
"jstransformer-marked" | ||
"jstransformer-marked", | ||
"jstransformer-pfm" | ||
], | ||
@@ -350,2 +370,5 @@ "marko": [ | ||
], | ||
"marky-markdown": [ | ||
"jstransformer-marky-markdown" | ||
], | ||
"md": [ | ||
@@ -356,4 +379,7 @@ "jstransformer-commonmark", | ||
"jstransformer-marked", | ||
"jstransformer-marky-markdown", | ||
"jstransformer-mdast", | ||
"jstransformer-megamark", | ||
"jstransformer-mmd", | ||
"jstransformer-pfm", | ||
"jstransformer-remark", | ||
@@ -364,2 +390,5 @@ "jstransformer-remarkable", | ||
], | ||
"mdast": [ | ||
"jstransformer-mdast" | ||
], | ||
"megamark": [ | ||
@@ -392,3 +421,2 @@ "jstransformer-megamark" | ||
"jstransformer-consolidate", | ||
"jstransformer-gray-matter", | ||
"jstransformer-mustache" | ||
@@ -449,2 +477,5 @@ ], | ||
], | ||
"purify-css": [ | ||
"jstransformer-purifycss" | ||
], | ||
"purifycss": [ | ||
@@ -567,5 +598,2 @@ "jstransformer-purifycss" | ||
], | ||
"txt": [ | ||
"jstransformer-gray-matter" | ||
], | ||
"typescript": [ | ||
@@ -572,0 +600,0 @@ "jstransformer-typescript" |
# Changelog | ||
## v1.2.0: 2016-12-26 | ||
- Added ignore packages to adapt for broken JSTransformers | ||
## v1.1.10: 2016-12-19 | ||
@@ -4,0 +8,0 @@ |
20
index.js
@@ -1,5 +0,5 @@ | ||
'use strict'; | ||
'use strict' | ||
var dictionary = require('./dictionary.json'); | ||
var requireOne = require('require-one'); | ||
var requireOne = require('require-one') | ||
var dictionary = require('./dictionary.json') | ||
@@ -11,14 +11,14 @@ /** | ||
*/ | ||
module.exports = function inputFormatToJsTransformer (inputFormat) { | ||
module.exports = function (inputFormat) { | ||
if (inputFormat in dictionary) { | ||
// Attempt to load one of the packages from the dictionary. | ||
try { | ||
return requireOne(dictionary[inputFormat]); | ||
} catch (e) { | ||
return false; | ||
return requireOne(dictionary[inputFormat]) | ||
} catch (err) { | ||
return false | ||
} | ||
} | ||
return false; | ||
}; | ||
return false | ||
} | ||
module.exports.dictionary = dictionary; | ||
module.exports.dictionary = dictionary |
@@ -6,3 +6,3 @@ { | ||
"name": "inputformat-to-jstransformer", | ||
"version": "1.1.10", | ||
"version": "1.2.0", | ||
"description": "Load a JSTransformer from the provided inputFormat.", | ||
@@ -21,5 +21,5 @@ "keywords": [ | ||
"npm": "^4.0.5", | ||
"semistandard": "^9.2.1", | ||
"sort-json": "^1.4.0", | ||
"testit": "^2.1.2" | ||
"testit": "^2.1.2", | ||
"xo": "^0.17.1" | ||
}, | ||
@@ -29,6 +29,6 @@ "scripts": { | ||
"test": "node test", | ||
"posttest": "semistandard" | ||
"posttest": "xo --space --no-semicolon" | ||
}, | ||
"engines": { | ||
"node": ">=6" | ||
"node": ">=7" | ||
}, | ||
@@ -35,0 +35,0 @@ "repository": { |
16295
642