How to use the intl-messageformat-parser/package.json.version function in intl-messageformat-parser

To help you get started, we’ve selected a few intl-messageformat-parser examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github fkling / astexplorer / website / src / parsers / icu / intl-messageformat-parser.js View on Github external
'captureLocation',
    'normalizeHashtagInPlural',
  ],
};

const defaultOptions = {
  captureLocation: true,
  normalizeHashtagInPlural: true,
}

export default {
  ...defaultParserInterface,

  id: ID,
  displayName: ID,
  version: pkg.version,
  homepage: pkg.homepage || 'https://github.com/formatjs/formatjs/tree/master/packages/intl-messageformat-parser',
  locationProps: new Set(['location']),

  loadParser(callback) {
    require(['intl-messageformat-parser'], all => {
      Object.keys(all.TYPE).forEach(k => {
        TYPES[k] = all.TYPE[k]
      })
      callback(all)
    });
  },

  parse(parser, code, opts) {
    return parser.parse(code, opts);
  },