mirror of
https://github.com/fooflington/selfdefined.git
synced 2025-06-13 22:15:25 +00:00
update
This commit is contained in:
30
node_modules/gray-matter/lib/engine.js
generated
vendored
Normal file
30
node_modules/gray-matter/lib/engine.js
generated
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = function(name, options) {
|
||||
let engine = options.engines[name] || options.engines[aliase(name)];
|
||||
if (typeof engine === 'undefined') {
|
||||
throw new Error('gray-matter engine "' + name + '" is not registered');
|
||||
}
|
||||
if (typeof engine === 'function') {
|
||||
engine = { parse: engine };
|
||||
}
|
||||
return engine;
|
||||
};
|
||||
|
||||
function aliase(name) {
|
||||
switch (name.toLowerCase()) {
|
||||
case 'js':
|
||||
case 'javascript':
|
||||
return 'javascript';
|
||||
case 'coffee':
|
||||
case 'coffeescript':
|
||||
case 'cson':
|
||||
return 'coffee';
|
||||
case 'yaml':
|
||||
case 'yml':
|
||||
return 'yaml';
|
||||
default: {
|
||||
return name;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user