// Hacky fix to make node 6 tests pass
if (parseInt(process.versions.node, 10) < 8) {
  require("@babel/register");
}

const {Asset} = require('../../../../../../src/Bundler');

class TextAsset extends Asset {
  constructor(name, pkg, options) {
    super(name, pkg, options);
    this.type = 'js';
  }

  generate() {
    return {
      js: 'module.exports=' + JSON.stringify(this.contents)
    };
  }
}

module.exports = TextAsset;
