UNPKG

455 BJavaScriptView Raw
1const Asset = require('../Asset');
2const toml = require('@iarna/toml');
3const serializeObject = require('../utils/serializeObject');
4
5class TOMLAsset extends Asset {
6 constructor(name, options) {
7 super(name, options);
8 this.type = 'js';
9 }
10
11 parse(code) {
12 return toml.parse(code);
13 }
14
15 generate() {
16 return serializeObject(
17 this.ast,
18 this.options.minify && !this.options.scopeHoist
19 );
20 }
21}
22
23module.exports = TOMLAsset;