intl-messageformat
Advanced tools
Comparing version 3.1.3 to 3.1.4
@@ -6,2 +6,10 @@ # Change Log | ||
## [3.1.4](https://github.com/formatjs/intl-messageformat/compare/intl-messageformat@3.1.3...intl-messageformat@3.1.4) (2019-05-31) | ||
**Note:** Version bump only for package intl-messageformat | ||
## [3.1.3](https://github.com/formatjs/intl-messageformat/compare/intl-messageformat@3.1.2...intl-messageformat@3.1.3) (2019-05-28) | ||
@@ -8,0 +16,0 @@ |
@@ -1634,2 +1634,3 @@ (function (global, factory) { | ||
}; | ||
// -- MessageFormat -------------------------------------------------------- | ||
function resolveLocale(locales) { | ||
@@ -1636,0 +1637,0 @@ if (typeof locales === 'string') { |
import { Formats } from './compiler'; | ||
import parser, { MessageFormatPattern } from 'intl-messageformat-parser'; | ||
export interface LocaleData { | ||
locale: string; | ||
parentLocale?: string; | ||
[k: string]: any; | ||
} | ||
interface IntlMessageFormat { | ||
export interface IntlMessageFormat { | ||
new (message: string | MessageFormatPattern, locales?: string | string[], overrideFormats?: Partial<Formats>): IntlMessageFormat; | ||
(message: string | MessageFormatPattern, locales?: string | string[], overrideFormats?: Partial<Formats>): IntlMessageFormat; | ||
format(values?: Record<string, string | number | boolean | null | undefined>): string; | ||
@@ -13,11 +10,7 @@ resolvedOptions(): { | ||
}; | ||
} | ||
declare let IntlMessageFormat: { | ||
new (message: string | MessageFormatPattern, locales?: string | string[], overrideFormats?: Partial<Formats>): IntlMessageFormat; | ||
(message: string | MessageFormatPattern, locales?: string | string[], overrideFormats?: Partial<Formats>): IntlMessageFormat; | ||
defaultLocale: string; | ||
formats: Formats; | ||
__parse: typeof parser['parse']; | ||
}; | ||
declare const MessageFormat: typeof IntlMessageFormat; | ||
} | ||
declare const MessageFormat: IntlMessageFormat; | ||
export default MessageFormat; |
@@ -33,2 +33,3 @@ /* | ||
import parser from 'intl-messageformat-parser'; | ||
// -- MessageFormat -------------------------------------------------------- | ||
function resolveLocale(locales) { | ||
@@ -103,3 +104,2 @@ if (typeof locales === 'string') { | ||
}(Error)); | ||
var IntlMessageFormat; | ||
var MessageFormat = (function (message, locales, overrideFormats) { | ||
@@ -106,0 +106,0 @@ if (locales === void 0) { locales = MessageFormat.defaultLocale; } |
{ | ||
"name": "intl-messageformat", | ||
"version": "3.1.3", | ||
"version": "3.1.4", | ||
"description": "Formats ICU Message strings with number, date, plural, and select placeholders to create localized messages.", | ||
@@ -39,3 +39,3 @@ "keywords": [ | ||
"benchmark": "ts-node --project tests/tsconfig.json tests/benchmark", | ||
"build": "npm run clean && tsc -p src && npm run prettier && npm run rollup", | ||
"build": "npm run clean && tsc -p src && npm run rollup", | ||
"rollup": "rollup -c rollup.config.js", | ||
@@ -45,3 +45,2 @@ "clean": "rimraf dist lib tests/*.js tests/*.d.ts", | ||
"prepublishOnly": "npm run build", | ||
"prettier": "prettier --write '{src,tests,scripts}/**/*.ts' 'rollup.config.js'", | ||
"test": "TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\"}' mocha -r ts-node/register -r source-map-support/register -r chai/register-expect tests/index.ts --reporter spec", | ||
@@ -56,7 +55,3 @@ "karma:local": "karma start karma.conf.js", | ||
"license": "BSD-3-Clause", | ||
"prettier": { | ||
"parser": "typescript", | ||
"singleQuote": true | ||
}, | ||
"gitHead": "caf647be47c191d9fdcf48be4cdb214ed846a917" | ||
"gitHead": "bbad0e2e238bf2727bf618eaa8490d945f5725d7" | ||
} |
@@ -14,8 +14,2 @@ /* | ||
export interface LocaleData { | ||
locale: string; | ||
parentLocale?: string; | ||
[k: string]: any; | ||
} | ||
function resolveLocale(locales: string | string[]): string { | ||
@@ -112,10 +106,3 @@ if (typeof locales === 'string') { | ||
interface IntlMessageFormat { | ||
format( | ||
values?: Record<string, string | number | boolean | null | undefined> | ||
): string; | ||
resolvedOptions(): { locale: string }; | ||
} | ||
let IntlMessageFormat: { | ||
export interface IntlMessageFormat { | ||
new ( | ||
@@ -131,8 +118,12 @@ message: string | MessageFormatPattern, | ||
): IntlMessageFormat; | ||
format( | ||
values?: Record<string, string | number | boolean | null | undefined> | ||
): string; | ||
resolvedOptions(): { locale: string }; | ||
defaultLocale: string; | ||
formats: Formats; | ||
__parse: typeof parser['parse']; | ||
}; | ||
} | ||
const MessageFormat: typeof IntlMessageFormat = (( | ||
const MessageFormat: IntlMessageFormat = (( | ||
message: string | MessageFormatPattern, | ||
@@ -139,0 +130,0 @@ locales: string | string[] = MessageFormat.defaultLocale, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
411421
2788