@metabrainz/xgettext-js 4.0.0 → 5.0.0

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.
Files changed (2) hide show
  1. package/package.json +8 -4
  2. package/xgettext.js +6 -5
package/package.json CHANGED
@@ -1,9 +1,13 @@
1
1
  {
2
2
  "name": "@metabrainz/xgettext-js",
3
- "version": "4.0.0",
3
+ "version": "5.0.0",
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
  ],
@@ -30,9 +34,9 @@
30
34
  "node": ">=10"
31
35
  },
32
36
  "dependencies": {
33
- "estree-walker": "^0.6.1",
34
- "hermes-parser": "0.26.0",
35
- "lodash": "^4.17.15"
37
+ "estree-walker": "3.0.3",
38
+ "hermes-parser": "0.32.0",
39
+ "lodash": "4.17.21"
36
40
  },
37
41
  "devDependencies": {
38
42
  "chai": "^4.2.0",
package/xgettext.js CHANGED
@@ -1,6 +1,7 @@
1
- var _ = require( 'lodash' ),
2
- parser = require( 'hermes-parser' ),
3
- walk = require( 'estree-walker' ).walk;
1
+ /* eslint-disable wpcalypso/import-docblock */
2
+ import _ from 'lodash';
3
+ import parser from 'hermes-parser';
4
+ import { walk } from 'estree-walker';
4
5
 
5
6
  /**
6
7
  * XGettext will parse a given input string for any instances of i18n function
@@ -11,7 +12,7 @@ var _ = require( 'lodash' ),
11
12
  * XGettext.defaultOptions for available options and a
12
13
  * description for each
13
14
  */
14
- var XGettext = module.exports = function( options ) {
15
+ export default function XGettext( options ) {
15
16
  if ( 'object' !== typeof options ) {
16
17
  options = {};
17
18
  }
@@ -20,7 +21,7 @@ var XGettext = module.exports = function( options ) {
20
21
  this.options.keywords = this._normalizeKeywords( this.options.keywords );
21
22
  this.options.keywordFunctions = Object.keys( this.options.keywords );
22
23
  this.options.parseOptions = _.extend( { locations: true }, this.options.parseOptions );
23
- };
24
+ }
24
25
 
25
26
  XGettext.defaultOptions = {
26
27
  /**