intl-messageformat-parser
Advanced tools
Comparing version
// /home/longlho/.cache/bazel/_bazel_longlho/576c18efaac10246ec115c72af79fca6/sandbox/linux-sandbox/2766/execroot/formatjs/node_modules/@bazel/typescript/internal/ts_project_options_validator.js checked attributes for //packages/intl-messageformat-parser:dist-base | ||
// /home/longlho/.cache/bazel/_bazel_longlho/576c18efaac10246ec115c72af79fca6/sandbox/linux-sandbox/185/execroot/formatjs/node_modules/@bazel/typescript/internal/ts_project_options_validator.js checked attributes for //packages/intl-messageformat-parser:dist-base | ||
// composite: false | ||
@@ -4,0 +4,0 @@ // declaration: true |
// /home/longlho/.cache/bazel/_bazel_longlho/576c18efaac10246ec115c72af79fca6/sandbox/linux-sandbox/2767/execroot/formatjs/node_modules/@bazel/typescript/internal/ts_project_options_validator.js checked attributes for //packages/intl-messageformat-parser:dist-esm | ||
// /home/longlho/.cache/bazel/_bazel_longlho/576c18efaac10246ec115c72af79fca6/sandbox/linux-sandbox/187/execroot/formatjs/node_modules/@bazel/typescript/internal/ts_project_options_validator.js checked attributes for //packages/intl-messageformat-parser:dist-esm | ||
// composite: false | ||
@@ -4,0 +4,0 @@ // declaration: true |
13
dummy.js
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.parse = void 0; | ||
__exportStar(require("./src/types"), exports); | ||
var tslib_1 = require("tslib"); | ||
tslib_1.__exportStar(require("./src/types"), exports); | ||
function parse() { | ||
@@ -16,0 +7,0 @@ throw new Error("You're trying to format an uncompiled message with react-intl without parser, please import from 'react-int' instead"); |
28
index.js
"use strict"; | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.parse = void 0; | ||
var tslib_1 = require("tslib"); | ||
var parser_1 = require("./src/parser"); | ||
var normalize_1 = require("./src/normalize"); | ||
__exportStar(require("./src/types"), exports); | ||
__exportStar(require("./src/parser"), exports); | ||
tslib_1.__exportStar(require("./src/types"), exports); | ||
tslib_1.__exportStar(require("./src/parser"), exports); | ||
function parse(input, opts) { | ||
opts = __assign({ normalizeHashtagInPlural: true, shouldParseSkeleton: true }, (opts || {})); | ||
opts = tslib_1.__assign({ normalizeHashtagInPlural: true, shouldParseSkeleton: true }, (opts || {})); | ||
var els = parser_1.pegParse(input, opts); | ||
@@ -32,0 +12,0 @@ if (opts.normalizeHashtagInPlural) { |
@@ -1,12 +0,2 @@ | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
import { __assign } from "tslib"; | ||
import { pegParse } from './src/parser'; | ||
@@ -13,0 +3,0 @@ import { normalizeHashtagInPlural } from './src/normalize'; |
@@ -1,8 +0,2 @@ | ||
var __spreadArrays = (this && this.__spreadArrays) || function () { | ||
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; | ||
for (var r = Array(s), k = 0, i = 0; i < il; i++) | ||
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) | ||
r[k] = a[j]; | ||
return r; | ||
}; | ||
import { __spreadArrays } from "tslib"; | ||
import { isPluralElement, isLiteralElement, isSelectElement, } from './types'; | ||
@@ -9,0 +3,0 @@ import { pegParse } from './parser'; |
@@ -6,9 +6,3 @@ /* | ||
*/ | ||
var __spreadArrays = (this && this.__spreadArrays) || function () { | ||
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; | ||
for (var r = Array(s), k = 0, i = 0; i < il; i++) | ||
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) | ||
r[k] = a[j]; | ||
return r; | ||
}; | ||
import { __spreadArrays } from "tslib"; | ||
import { isLiteralElement, isTagElement, isSelectElement, isArgumentElement, isDateElement, isTimeElement, isNumberElement, isPluralElement, TYPE, isPoundElement, } from './types'; | ||
@@ -15,0 +9,0 @@ export function printAST(ast) { |
@@ -1,12 +0,2 @@ | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
import { __assign } from "tslib"; | ||
/** | ||
@@ -13,0 +3,0 @@ * https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table |
{ | ||
"name": "intl-messageformat-parser", | ||
"version": "6.0.7", | ||
"version": "6.0.8", | ||
"description": "Parses ICU Message strings into an AST via JavaScript.", | ||
@@ -38,3 +38,4 @@ "main": "index.js", | ||
"dependencies": { | ||
"@formatjs/ecma402-abstract": "^1.2.2" | ||
"@formatjs/ecma402-abstract": "^1.2.3", | ||
"tslib": "^2.0.1" | ||
}, | ||
@@ -41,0 +42,0 @@ "homepage": "https://github.com/formatjs/formatjs", |
"use strict"; | ||
var __spreadArrays = (this && this.__spreadArrays) || function () { | ||
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; | ||
for (var r = Array(s), k = 0, i = 0; i < il; i++) | ||
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) | ||
r[k] = a[j]; | ||
return r; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.normalizeHashtagInPlural = void 0; | ||
var tslib_1 = require("tslib"); | ||
var types_1 = require("./types"); | ||
@@ -45,3 +39,3 @@ var parser_1 = require("./parser"); | ||
var newEls = parser_1.pegParse(newValue); | ||
(_a = opt.value).splice.apply(_a, __spreadArrays([matchingLiteralElIndex, 1], newEls)); | ||
(_a = opt.value).splice.apply(_a, tslib_1.__spreadArrays([matchingLiteralElIndex, 1], newEls)); | ||
} | ||
@@ -48,0 +42,0 @@ normalizeHashtagInPlural(opt.value); |
@@ -7,11 +7,5 @@ "use strict"; | ||
*/ | ||
var __spreadArrays = (this && this.__spreadArrays) || function () { | ||
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; | ||
for (var r = Array(s), k = 0, i = 0; i < il; i++) | ||
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) | ||
r[k] = a[j]; | ||
return r; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.printDateTimeSkeleton = exports.doPrintAST = exports.printAST = void 0; | ||
var tslib_1 = require("tslib"); | ||
var types_1 = require("./types"); | ||
@@ -103,3 +97,3 @@ function printAST(ast) { | ||
type, | ||
__spreadArrays([ | ||
tslib_1.__spreadArrays([ | ||
el.offset ? "offset:" + el.offset : '' | ||
@@ -106,0 +100,0 @@ ], Object.keys(el.options).map(function (id) { return id + "{" + doPrintAST(el.options[id].value, true) + "}"; })).filter(Boolean) |
"use strict"; | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.parseNumberSkeleton = exports.parseDateTimeSkeleton = void 0; | ||
var tslib_1 = require("tslib"); | ||
/** | ||
@@ -245,6 +235,6 @@ * https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table | ||
case 'scientific': | ||
result = __assign(__assign(__assign({}, result), { notation: 'scientific' }), token.options.reduce(function (all, opt) { return (__assign(__assign({}, all), parseNotationOptions(opt))); }, {})); | ||
result = tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, result), { notation: 'scientific' }), token.options.reduce(function (all, opt) { return (tslib_1.__assign(tslib_1.__assign({}, all), parseNotationOptions(opt))); }, {})); | ||
continue; | ||
case 'engineering': | ||
result = __assign(__assign(__assign({}, result), { notation: 'engineering' }), token.options.reduce(function (all, opt) { return (__assign(__assign({}, all), parseNotationOptions(opt))); }, {})); | ||
result = tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, result), { notation: 'engineering' }), token.options.reduce(function (all, opt) { return (tslib_1.__assign(tslib_1.__assign({}, all), parseNotationOptions(opt))); }, {})); | ||
continue; | ||
@@ -299,3 +289,3 @@ case 'notation-simple': | ||
if (token.options.length) { | ||
result = __assign(__assign({}, result), parseSignificantPrecision(token.options[0])); | ||
result = tslib_1.__assign(tslib_1.__assign({}, result), parseSignificantPrecision(token.options[0])); | ||
} | ||
@@ -305,3 +295,3 @@ continue; | ||
if (SIGNIFICANT_PRECISION_REGEX.test(token.stem)) { | ||
result = __assign(__assign({}, result), parseSignificantPrecision(token.stem)); | ||
result = tslib_1.__assign(tslib_1.__assign({}, result), parseSignificantPrecision(token.stem)); | ||
continue; | ||
@@ -311,3 +301,3 @@ } | ||
if (signOpts) { | ||
result = __assign(__assign({}, result), signOpts); | ||
result = tslib_1.__assign(tslib_1.__assign({}, result), signOpts); | ||
} | ||
@@ -314,0 +304,0 @@ } |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
300361
-1.69%2
100%7862
-1.61%+ Added