@bitjourney/react-intl-dts
Advanced tools
Comparing version 0.4.0 to 0.5.0
@@ -59,3 +59,3 @@ "use strict"; | ||
expect(config).toEqual({ | ||
'i18n-dts': { | ||
'react-intl-dts': { | ||
model: './en.json', | ||
@@ -62,0 +62,0 @@ outputDir: './typings', |
@@ -6,8 +6,12 @@ "use strict"; | ||
exports.dts = (keys) => { | ||
const declareType = 'type MessageKey =' + keys.map(key => `"${key.key}"`).join('|') + ';\n\n'; | ||
const disableCommentsForLint = '/* eslint-disable */\n/* tslint:disable */\n\n\n'; | ||
const declareType = 'type MessageKey =\n' + | ||
keys.map(key => ` | "${key.key}"`).join('\n') + | ||
';\n\n'; | ||
const origPath = path_1.join(__dirname, '../../assets/react-intl.d.ts'); | ||
const orig = fs_1.readFileSync(origPath, { encoding: 'utf-8' }); | ||
return (declareType + | ||
return (disableCommentsForLint + | ||
declareType + | ||
orig.replace(/^\s*id: string;/m, ' id: MessageKey;')); | ||
}; | ||
//# sourceMappingURL=ast.js.map |
@@ -0,1 +1,4 @@ | ||
- 0.5.0 2019/04/08 | ||
- Insert comments to disable Lint into type definition file. [#5](https://github.com/bitjourney/react-intl-dts/pull/5) | ||
- Add new lines to each literal types. [#4](https://github.com/bitjourney/react-intl-dts/pull/4) | ||
- 0.4.0 2019/04/04 | ||
@@ -2,0 +5,0 @@ - Move to `@bitjourney/react-intl-dts` scoped package |
{ | ||
"name": "@bitjourney/react-intl-dts", | ||
"version": "0.4.0", | ||
"version": "0.5.0", | ||
"description": "A tiny d.ts file generator for react-intl", | ||
@@ -5,0 +5,0 @@ "bin": { |
@@ -1,2 +0,2 @@ | ||
# @bitjourney/react-intl-dts [![npm version](https://badge.fury.io/js/@bitjourney/react-intl-dts.svg)](https://badge.fury.io/js/@bitjourney/react-intl-dts) | ||
# @bitjourney/react-intl-dts [![npm version](https://badge.fury.io/js/%40bitjourney%2Freact-intl-dts.svg)](https://badge.fury.io/js/%40bitjourney%2Freact-intl-dts) | ||
@@ -3,0 +3,0 @@ react-intl-dts is based on [i18n-dts](https://github.com/quipper/i18n-dts). Thank you! |
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
828239
46
1463