@metabrainz/xgettext-js 4.0.0 → 5.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +10 -10
- package/xgettext.js +5 -5
package/package.json
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metabrainz/xgettext-js",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.1",
|
|
4
4
|
"author": "Andrew Duthie <andrew@andrewduthie.com>",
|
|
5
5
|
"description": "xgettext string extractor tool capable of parsing JavaScript files",
|
|
6
|
+
"type": "module",
|
|
6
7
|
"main": "xgettext.js",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": "./xgettext.js"
|
|
10
|
+
},
|
|
7
11
|
"files": [
|
|
8
12
|
"xgettext.js"
|
|
9
13
|
],
|
|
@@ -22,24 +26,20 @@
|
|
|
22
26
|
"url": "git+https://github.com/metabrainz/xgettext-js.git"
|
|
23
27
|
},
|
|
24
28
|
"scripts": {
|
|
25
|
-
"
|
|
26
|
-
"test": "npm run lint && mocha",
|
|
29
|
+
"test": "mocha",
|
|
27
30
|
"test-watch": "mocha --watch"
|
|
28
31
|
},
|
|
29
32
|
"engines": {
|
|
30
33
|
"node": ">=10"
|
|
31
34
|
},
|
|
32
35
|
"dependencies": {
|
|
33
|
-
"estree-walker": "
|
|
34
|
-
"hermes-parser": "0.
|
|
35
|
-
"lodash": "
|
|
36
|
+
"estree-walker": "3.0.3",
|
|
37
|
+
"hermes-parser": "0.32.0",
|
|
38
|
+
"lodash": "4.17.23"
|
|
36
39
|
},
|
|
37
40
|
"devDependencies": {
|
|
38
41
|
"chai": "^4.2.0",
|
|
39
|
-
"
|
|
40
|
-
"eslint-config-wpcalypso": "^4.0.1",
|
|
41
|
-
"eslint-plugin-wpcalypso": "^4.1.0",
|
|
42
|
-
"mocha": "^6.2.0"
|
|
42
|
+
"mocha": "^11.7.0"
|
|
43
43
|
},
|
|
44
44
|
"packageManager": "yarn@4.2.2"
|
|
45
45
|
}
|
package/xgettext.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import _ from 'lodash';
|
|
2
|
+
import parser from 'hermes-parser';
|
|
3
|
+
import { walk } from 'estree-walker';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* XGettext will parse a given input string for any instances of i18n function
|
|
@@ -11,7 +11,7 @@ var _ = require( 'lodash' ),
|
|
|
11
11
|
* XGettext.defaultOptions for available options and a
|
|
12
12
|
* description for each
|
|
13
13
|
*/
|
|
14
|
-
|
|
14
|
+
export default function XGettext( options ) {
|
|
15
15
|
if ( 'object' !== typeof options ) {
|
|
16
16
|
options = {};
|
|
17
17
|
}
|
|
@@ -20,7 +20,7 @@ var XGettext = module.exports = function( options ) {
|
|
|
20
20
|
this.options.keywords = this._normalizeKeywords( this.options.keywords );
|
|
21
21
|
this.options.keywordFunctions = Object.keys( this.options.keywords );
|
|
22
22
|
this.options.parseOptions = _.extend( { locations: true }, this.options.parseOptions );
|
|
23
|
-
}
|
|
23
|
+
}
|
|
24
24
|
|
|
25
25
|
XGettext.defaultOptions = {
|
|
26
26
|
/**
|