index.js 494 B

1234567891011121314151617181920212223
  1. /*
  2. MIT License http://www.opensource.org/licenses/mit-license.php
  3. Author David Schissler @dschissler
  4. */
  5. var po2json = require('po2json');
  6. module.exports = function(source) {
  7. this.cacheable();
  8. var options = this.getOptions();
  9. if (options === null) {
  10. options = {};
  11. }
  12. // default option
  13. if (!('stringify' in options)) {
  14. options.stringify = true;
  15. }
  16. jsonData = po2json.parse(source, options);
  17. return jsonData;
  18. }