Skip to content

Commit

Permalink
Remove lodash from library (#12)
Browse files Browse the repository at this point in the history
* Remove lodash from library

* Edit changelog

* Normalize version
  • Loading branch information
volodymyr-leskiv authored Oct 24, 2024
1 parent 65f466e commit 2c87c48
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

[Yola Changes](https://github.com/yola/jsxgettext/releases)

## 0.9.1-yola1

* Remove `lodash` from library

[#12]: https://github.com/yola/jsxgettext/pull/12

## 0.9.0-yola2

* Update `acorn` & Fix `JSXText` visitor [#9][]
Expand Down
10 changes: 7 additions & 3 deletions lib/parsers/json.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
var lodash = require('lodash');
var jsontrans = require('gulp-static-i18n/lib/translators/json');
var Dotted = jsontrans.Dotted;
var pushDotKeys = jsontrans.pushDotKeys;
Expand Down Expand Up @@ -41,12 +40,17 @@ function getParser(options) {
}

var isKeyMarkedForExtraction = jsontrans.getKeyFilter(keys, ignored);
return lodash.partial(extractStrings, isKeyMarkedForExtraction);
return extractStrings.bind(null, isKeyMarkedForExtraction);
}

var jsonParser = function(sources, options) {
var parse = getParser(options);
var strings = lodash.mapValues(sources, parse);

var strings = Object.keys(sources).reduce(function(result, key) {
result[key] = parse(sources[key]);
return result;
}, {});

options.stringsExtracted = true;
return [strings, options];
};
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"Marcus (https://github.com/mphasize)"
],
"name": "@yola/jsxgettext",
"version": "0.9.0-yola2",
"version": "0.9.1-yola1",
"license": "MPL-2.0",
"description": "Extracts gettext strings from JavaScript, EJS, Jade, Jinja and Handlebars files.",
"keywords": [
Expand Down Expand Up @@ -54,8 +54,7 @@
"escape-string-regexp": "^1.0.4",
"gettext-parser": "^1.1.2",
"gulp-static-i18n": "0.1.0",
"jade": "^1.11.0",
"lodash": "^3.5.0"
"jade": "^1.11.0"
},
"devDependencies": {
"i18n-abide": "0.0.17",
Expand Down

0 comments on commit 2c87c48

Please sign in to comment.