MCPcopy Index your code
hub / github.com/messageformat/messageformat / convert

Function convert

packages/convert/index.js:34–43  ·  view source on GitHub ↗
(data, options)

Source from the content-addressed store, hash-verified

32};
33
34const convert = (data, options) => {
35 if (data.length === 1) data = data[0];
36 options = Object.assign({}, defaultOptions, options);
37 options._lc = { [options.defaultLocale]: true };
38 const translations = convertData(data, options.defaultLocale, options);
39 return {
40 locales: Object.keys(options._lc).filter(lc => lc),
41 translations
42 };
43};
44
45module.exports = convert;

Callers 1

index.jsFile · 0.85

Calls 1

convertDataFunction · 0.85

Tested by

no test coverage detected