i18next-print-keys
Advanced tools
Comparing version 1.0.1 to 1.0.2
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const ignore = ['defaultValue', 'interpolation', 'lng', 'lngs', 'ns']; | ||
exports.default = { | ||
@@ -7,4 +8,5 @@ name: 'printKeys', | ||
process(_, key, options) { | ||
return Object.keys(options).length | ||
? key + ' ' + JSON.stringify(options) | ||
const optionKeys = Object.keys(options).filter((key) => !ignore.includes(key)); | ||
return optionKeys.length | ||
? key + ' ' + JSON.stringify(options, optionKeys) | ||
: key.toString(); | ||
@@ -11,0 +13,0 @@ }, |
{ | ||
"name": "i18next-print-keys", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "i18next preprocessor to print translation keys including interpolated values.", | ||
@@ -5,0 +5,0 @@ "author": "Widen", |
import { PostProcessorModule } from 'i18next' | ||
const ignore = ['defaultValue', 'interpolation', 'lng', 'lngs', 'ns'] | ||
export default { | ||
@@ -7,6 +9,13 @@ name: 'printKeys', | ||
process(_, key, options) { | ||
return Object.keys(options).length | ||
? key + ' ' + JSON.stringify(options) | ||
// Filter out internal i18next options when printing keys. The resulting | ||
// array is passed to JSON.stringify which instructs it which keys should | ||
// be printed. | ||
const optionKeys = Object.keys(options).filter( | ||
(key) => !ignore.includes(key) | ||
) | ||
return optionKeys.length | ||
? key + ' ' + JSON.stringify(options, optionKeys) | ||
: key.toString() | ||
}, | ||
} as PostProcessorModule |
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
5319
33