Comparing version 1.0.7 to 1.1.0
{ | ||
"name": "js-gettext", | ||
"version": "1.0.7", | ||
"version": "1.1.0", | ||
"description": "gettext alternative for js", | ||
@@ -9,3 +9,3 @@ "main": "./src/index.js", | ||
"scripts": { | ||
"test": "ava tests", | ||
"test": "jest", | ||
"precommit": "lint-staged" | ||
@@ -17,10 +17,12 @@ }, | ||
"dependencies": { | ||
"commander": "^2.15.1", | ||
"commander": "^4.1.1", | ||
"glob": "^7.1.2" | ||
}, | ||
"devDependencies": { | ||
"ava": "^0.25.0", | ||
"eslint": "^4.19.1", | ||
"husky": "^0.14.3", | ||
"lint-staged": "^7.0.0", | ||
"@types/jest": "^25.1.1", | ||
"eslint": "^6.8.0", | ||
"eslint-plugin-jest": "^23.6.0", | ||
"husky": "^4.2.1", | ||
"jest": "^25.1.0", | ||
"lint-staged": "^10.0.7", | ||
"prettier": "^1.11.1" | ||
@@ -27,0 +29,0 @@ }, |
@@ -0,1 +1,2 @@ | ||
// @ts-check | ||
const {readFileSync, statSync} = require('fs'); | ||
@@ -6,4 +7,9 @@ const glob = require('glob'); | ||
const currentDir = process.cwd(); | ||
const addToken = (tokens, filename, line, token, tokenPlural = '') => { | ||
const key = token; | ||
const relativePath = filename.startsWith(currentDir) | ||
? '.' + filename.substr(currentDir.length) | ||
: filename; | ||
if (!tokens[key]) { | ||
@@ -13,6 +19,6 @@ tokens[key] = { | ||
plural: tokenPlural, | ||
positions: [`${filename}:${line}`], | ||
positions: [`${relativePath}:${line}`], | ||
}; | ||
} else { | ||
tokens[key].positions.push(`${filename}:${line}`); | ||
tokens[key].positions.push(`${relativePath}:${line}`); | ||
const currentPlural = tokens[key].tokenPlural; | ||
@@ -19,0 +25,0 @@ if (tokenPlural) { |
@@ -0,1 +1,2 @@ | ||
// @ts-check | ||
/** | ||
@@ -2,0 +3,0 @@ * JSON formatter |
@@ -0,1 +1,2 @@ | ||
// @ts-check | ||
/** | ||
@@ -2,0 +3,0 @@ * gettext formatter |
#!/usr/bin/env node | ||
// @ts-check | ||
const {writeFileSync} = require('fs'); | ||
@@ -22,4 +23,3 @@ const argv = require('commander'); | ||
argv | ||
.version(require('../package').version) | ||
argv.version(require('../package').version) | ||
.arguments('<input> <output>') | ||
@@ -26,0 +26,0 @@ .option('-f, --format <value>', 'Output format (pot|json)', /^(pot|json)$/, 'pot') |
@@ -0,1 +1,2 @@ | ||
// @ts-check | ||
/** | ||
@@ -2,0 +3,0 @@ * Simple state machine to read up to `limit` string parameters |
@@ -0,1 +1,2 @@ | ||
// @ts-check | ||
/** | ||
@@ -2,0 +3,0 @@ * Creates a RegExp that matches a function call in the beginning of the string, |
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
13
332
14684
7
+ Addedcommander@4.1.1(transitive)
- Removedcommander@2.20.3(transitive)
Updatedcommander@^4.1.1