fuc-new/doc/node_modules/gray-matter/lib/parse.js
hellcat 6adbc04d4b 1
2025-10-03 17:17:08 +08:00

14 lines
389 B
JavaScript

'use strict';
const getEngine = require('./engine');
const defaults = require('./defaults');
module.exports = function(language, str, options) {
const opts = defaults(options);
const engine = getEngine(language, opts);
if (typeof engine.parse !== 'function') {
throw new TypeError('expected "' + language + '.parse" to be a function');
}
return engine.parse(str, opts);
};