Skip to content

Commit

Permalink
Rebased to master, removed lodash, added tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bubeck committed Dec 2, 2022
1 parent cb6c6cd commit 46f6f5b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/source_keys.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


const glob = require('glob').sync;
const _ = require('lodash');
const debug = require('debug')('sourcee_keys');
const AppError = require('./app_error');
const parse = require('./parser');
Expand Down Expand Up @@ -66,8 +65,8 @@ ${this.uniques[key].fileName}, line ${this.uniques[key].line}
dumpSourceRef(filename) {
let result = [];

_.forEach(this.uniques, k1 => {
_.forEach(this.keys, k2 => {
Object.values(this.uniques).forEach(k1 => {
Object.values(this.keys).forEach(k2 => {
if (k1.key === k2.key) {
result.push(k2);
}
Expand Down
4 changes: 4 additions & 0 deletions test/js/test_cli_extract.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ describe('CLI extract', function () {
run([ 'extract', '-s', join(__dirname, 'fixtures/empty_src.c'), '-t', 'any-value' ]);
});

it('Should exit without error with sourceref', function () {
run([ 'extract', '-s', join(fixtures, 'src_*.c'), '--dump-sourceref', join(fixtures, 'sourceref'),
'-t', join(fixtures, 'empty_en-GB.yml') ]);
});

it('Should fill empty locales', function () {
run([ 'extract', '-s', join(fixtures, 'src_*.c'), '-t', join(fixtures, 'empty_*.yml') ]);
Expand Down

0 comments on commit 46f6f5b

Please sign in to comment.