lingui-string-validation
Check a string is a valid jsLingui string or not (compare with jsLingui minimal format key).
Dependencies
- lodash
- Sorry for that, it will be removed in next version
Usage
- Install
yarn add lodash lingui-string-validation
- Usage
/** * -1: bad key * 0: bad text * 1: valid text * 2: empty text */ // const lingui-string-validation = require('lingui-string-validation').default const linguiKey = '<0>This is a text with <1>{variable}</1><2>visit counts: {0}</2></0>'const badKey = 'This is a bad {key' // -1 // 1 // 1 // 0 // 0 // 0 // 0 // 2