prettier/src/utils/load-toml.js

13 lines
261 B
JavaScript

"use strict";
const parse = require("@iarna/toml/parse-string");
module.exports = function(filePath, content) {
try {
return parse(content);
} catch (error) {
error.message = `TOML Error in ${filePath}:\n${error.message}`;
throw error;
}
};