├── .editorconfig ├── .eslintrc.json ├── .gitignore ├── .nvmrc ├── .travis.yml ├── CHANGELOG.md ├── LICENSE.md ├── README.md ├── package-lock.json ├── package.json ├── test └── xgettext.js └── xgettext.js /.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = tab 6 | end_of_line = lf 7 | charset = utf-8 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | 11 | [package.json] 12 | indent_style = space 13 | indent_size = 2 14 | 15 | [*.md] 16 | trim_trailing_whitespace = false 17 | -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "root": true, 3 | "extends": "wpcalypso", 4 | "env": { 5 | "node": true, 6 | "mocha": true 7 | }, 8 | "rules": { 9 | "max-len": [ 2, { "code": 120 } ], 10 | "no-var": 0 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | *.log -------------------------------------------------------------------------------- /.nvmrc: -------------------------------------------------------------------------------- 1 | lts/* 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "lts/*" 4 | - "node" 5 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | v3.0.0 (2018-06-07) 2 | =================== 3 | - Breaking: Support Node v10 or greater (#20). 4 | - Updated: Lodash dependency from ^4.13.1 to ^4.17.15. 5 | - Updated: @babel/parser dependency from ^7.0.0-beta.58 to ^7.5.5. 6 | - Updated: estree-walker dependency from ^0.5.2 to ^0.6.1. 7 | - Updated: devDependencies 8 | 9 | v2.0.0 (2018-06-07) 10 | =================== 11 | - Breaking: Support Node v6 or greater (#16). 12 | - Updated: Switch parser from deprecated babylon to @babel/parser (#14). 13 | 14 | v1.1.0 (2016-10-31) 15 | =================== 16 | - New: `#getMatches()` now returns `column` in the match result (#13, props @anoek) 17 | - General: The project now enforces a Node minimum version of >=4 . This could 18 | be seen as a breaking change justifying a semver major version bump, but there 19 | was no previous expectation on the Node version used aside from that inferred 20 | from the Travis configuration. 21 | 22 | v1.0.0 (2016-08-01) 23 | =================== 24 | - Breaking: Switch to `babylon` as a JavaScript parser. 25 | - There are [slight incompatibilities](https://www.npmjs.com/package/babylon#output) in the AST from the previous parser `acorn`. 26 | - Advantage of `babylon`: Ability to parse JSX and other advanced ES7 features (all with [enabled plugins](https://www.npmjs.com/package/babylon#plugins) in the `parserOptions`). 27 | 28 | v0.3.1 (2016-06-17) 29 | =================== 30 | - Updated: Lodash dependency from ^2.4.1 to ^4.13.1 31 | 32 | v0.3.0 (2016-03-02) 33 | =================== 34 | - Updated: Acorn dependency from 0.6.0 to 3.0.4 35 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | {description} 294 | Copyright (C) {year} {fullname} 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | {signature of Ty Coon}, 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # xgettext-js 2 | 3 | [![Build Status](https://travis-ci.org/Automattic/xgettext-js.svg?branch=master)](https://travis-ci.org/Automattic/xgettext-js) 4 | [![NPM version](https://badge.fury.io/js/xgettext-js.svg)](http://badge.fury.io/js/xgettext-js) 5 | 6 | xgettext-js is a utility for extracting translatable strings, written in and capable of parsing JavaScript files. It is similar to the [GNU xgettext](http://www.gnu.org/savannah-checkouts/gnu/gettext/manual/html_node/xgettext-Invocation.html) program, but returns strings as a JavaScript array. It makes use of [@babel/parser](https://www.npmjs.com/package/@babel/parser) and [estree-walker](https://github.com/Rich-Harris/estree-walker) to parse JavaScript code, which facilitates the use of custom logic for string extraction. Because of this, xgettext-js is quite flexible, allowing you to define your own logic for extracting strings from any number of function keywords. 7 | 8 | ## Installation 9 | 10 | xgettext-js is a [Node.js](http://nodejs.org/) package available through [npm](https://www.npmjs.org/). You must first [install Node.js](http://nodejs.org/download/) if it is not already installed, which will also install the npm package manager. Once installed, use your terminal to execute the following command from your project directory: 11 | 12 | ```bash 13 | $ npm install xgettext-js 14 | ``` 15 | 16 | ## Usage 17 | 18 | An instance of xgettext-js exposes a `getMatches` method which, when passed a JavaScript source string, will return an array of translatable strings. Each item in the array is an object which includes a `string` property, the `line` of the matched string, and any optionally included translator comments as the `comments` property. By default, xgettext-js will search for any occurrence of a `_` function within your JavaScript code and assume that a translatable string exists as the first parameter. Translator comments can exist on the same or previous code line, formatted as `translators: [insert comment here]` by default. 19 | 20 | Below is an example of this simple use case in a Node.js application: 21 | 22 | ```javascript 23 | var XGettext = require( 'xgettext-js' ), 24 | source = '_( "Hello World!" ); /* translators: greeting */', 25 | parser = new XGettext(); 26 | 27 | console.log( parser.getMatches( source ) ); 28 | // Will output: [ { "string": "Hello World!", "comment": "greeting", "line": 1, "column": 0 } ] 29 | ``` 30 | 31 | ## Options 32 | 33 | To override the default behavior, you can pass an options object when creating an instance of xgettext-js, using one or more of the following options: 34 | 35 | - `keywords` : An object which defines keywords to be searched (the key) and a function or number (the value). If passed a function, it is expected to return either a string replacement for the `string` value of the `getMatches` array return value, or a replacement for the object itself. The function is passed a match including up to four keys: `keyword` (the matched keyword), `arguments` (a CallExpression arguments array, [see parser documentation](https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/Parser_API)), `line` (the line of the matched string), and `comment` if one exists. If passed a number, it is expected that the translatable string exists at the corresponding argument position on a 1-based index. 36 | - `commentPrefix`: The comment prefix string to match translator comments to be included with translatable strings. A comment will be matched if it is prefixed by this option. If undesired, setting the value to `undefined` will omit comments from the `getMatches` return value. 37 | 38 | ## License 39 | 40 | Copyright 2016 Automattic 41 | 42 | This package is made available under the GPLv2 or later license 43 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "xgettext-js", 3 | "version": "3.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "@babel/code-frame": { 8 | "version": "7.5.5", 9 | "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz", 10 | "integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==", 11 | "dev": true, 12 | "requires": { 13 | "@babel/highlight": "^7.0.0" 14 | } 15 | }, 16 | "@babel/highlight": { 17 | "version": "7.5.0", 18 | "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.5.0.tgz", 19 | "integrity": "sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ==", 20 | "dev": true, 21 | "requires": { 22 | "chalk": "^2.0.0", 23 | "esutils": "^2.0.2", 24 | "js-tokens": "^4.0.0" 25 | } 26 | }, 27 | "@babel/parser": { 28 | "version": "7.5.5", 29 | "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.5.5.tgz", 30 | "integrity": "sha512-E5BN68cqR7dhKan1SfqgPGhQ178bkVKpXTPEXnFJBrEt8/DKRZlybmy+IgYLTeN7tp1R5Ccmbm2rBk17sHYU3g==" 31 | }, 32 | "acorn": { 33 | "version": "6.2.1", 34 | "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.2.1.tgz", 35 | "integrity": "sha512-JD0xT5FCRDNyjDda3Lrg/IxFscp9q4tiYtxE1/nOzlKCk7hIRuYjhq1kCNkbPjMRMZuFq20HNQn1I9k8Oj0E+Q==", 36 | "dev": true 37 | }, 38 | "acorn-jsx": { 39 | "version": "5.0.1", 40 | "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.0.1.tgz", 41 | "integrity": "sha512-HJ7CfNHrfJLlNTzIEUTj43LNWGkqpRLxm3YjAlcD0ACydk9XynzYsCBHxut+iqt+1aBXkx9UP/w/ZqMr13XIzg==", 42 | "dev": true 43 | }, 44 | "ajv": { 45 | "version": "6.10.2", 46 | "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", 47 | "integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==", 48 | "dev": true, 49 | "requires": { 50 | "fast-deep-equal": "^2.0.1", 51 | "fast-json-stable-stringify": "^2.0.0", 52 | "json-schema-traverse": "^0.4.1", 53 | "uri-js": "^4.2.2" 54 | } 55 | }, 56 | "ansi-colors": { 57 | "version": "3.2.3", 58 | "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz", 59 | "integrity": "sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw==", 60 | "dev": true 61 | }, 62 | "ansi-escapes": { 63 | "version": "3.2.0", 64 | "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", 65 | "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", 66 | "dev": true 67 | }, 68 | "ansi-regex": { 69 | "version": "3.0.0", 70 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", 71 | "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", 72 | "dev": true 73 | }, 74 | "ansi-styles": { 75 | "version": "3.2.1", 76 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", 77 | "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", 78 | "dev": true, 79 | "requires": { 80 | "color-convert": "^1.9.0" 81 | } 82 | }, 83 | "argparse": { 84 | "version": "1.0.10", 85 | "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", 86 | "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", 87 | "dev": true, 88 | "requires": { 89 | "sprintf-js": "~1.0.2" 90 | } 91 | }, 92 | "assertion-error": { 93 | "version": "1.1.0", 94 | "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", 95 | "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", 96 | "dev": true 97 | }, 98 | "astral-regex": { 99 | "version": "1.0.0", 100 | "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", 101 | "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", 102 | "dev": true 103 | }, 104 | "balanced-match": { 105 | "version": "1.0.0", 106 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", 107 | "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", 108 | "dev": true 109 | }, 110 | "brace-expansion": { 111 | "version": "1.1.11", 112 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", 113 | "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", 114 | "dev": true, 115 | "requires": { 116 | "balanced-match": "^1.0.0", 117 | "concat-map": "0.0.1" 118 | } 119 | }, 120 | "browser-stdout": { 121 | "version": "1.3.1", 122 | "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", 123 | "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", 124 | "dev": true 125 | }, 126 | "callsites": { 127 | "version": "3.1.0", 128 | "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", 129 | "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", 130 | "dev": true 131 | }, 132 | "camelcase": { 133 | "version": "5.3.1", 134 | "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", 135 | "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", 136 | "dev": true 137 | }, 138 | "chai": { 139 | "version": "4.2.0", 140 | "resolved": "https://registry.npmjs.org/chai/-/chai-4.2.0.tgz", 141 | "integrity": "sha512-XQU3bhBukrOsQCuwZndwGcCVQHyZi53fQ6Ys1Fym7E4olpIqqZZhhoFJoaKVvV17lWQoXYwgWN2nF5crA8J2jw==", 142 | "dev": true, 143 | "requires": { 144 | "assertion-error": "^1.1.0", 145 | "check-error": "^1.0.2", 146 | "deep-eql": "^3.0.1", 147 | "get-func-name": "^2.0.0", 148 | "pathval": "^1.1.0", 149 | "type-detect": "^4.0.5" 150 | } 151 | }, 152 | "chalk": { 153 | "version": "2.4.2", 154 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", 155 | "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", 156 | "dev": true, 157 | "requires": { 158 | "ansi-styles": "^3.2.1", 159 | "escape-string-regexp": "^1.0.5", 160 | "supports-color": "^5.3.0" 161 | } 162 | }, 163 | "chardet": { 164 | "version": "0.7.0", 165 | "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", 166 | "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", 167 | "dev": true 168 | }, 169 | "check-error": { 170 | "version": "1.0.2", 171 | "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", 172 | "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", 173 | "dev": true 174 | }, 175 | "cli-cursor": { 176 | "version": "2.1.0", 177 | "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", 178 | "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", 179 | "dev": true, 180 | "requires": { 181 | "restore-cursor": "^2.0.0" 182 | } 183 | }, 184 | "cli-width": { 185 | "version": "2.2.0", 186 | "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", 187 | "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", 188 | "dev": true 189 | }, 190 | "cliui": { 191 | "version": "4.1.0", 192 | "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", 193 | "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", 194 | "dev": true, 195 | "requires": { 196 | "string-width": "^2.1.1", 197 | "strip-ansi": "^4.0.0", 198 | "wrap-ansi": "^2.0.0" 199 | }, 200 | "dependencies": { 201 | "strip-ansi": { 202 | "version": "4.0.0", 203 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", 204 | "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", 205 | "dev": true, 206 | "requires": { 207 | "ansi-regex": "^3.0.0" 208 | } 209 | } 210 | } 211 | }, 212 | "code-point-at": { 213 | "version": "1.1.0", 214 | "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", 215 | "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", 216 | "dev": true 217 | }, 218 | "color-convert": { 219 | "version": "1.9.3", 220 | "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", 221 | "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", 222 | "dev": true, 223 | "requires": { 224 | "color-name": "1.1.3" 225 | } 226 | }, 227 | "color-name": { 228 | "version": "1.1.3", 229 | "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", 230 | "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", 231 | "dev": true 232 | }, 233 | "concat-map": { 234 | "version": "0.0.1", 235 | "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", 236 | "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", 237 | "dev": true 238 | }, 239 | "cross-spawn": { 240 | "version": "6.0.5", 241 | "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", 242 | "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", 243 | "dev": true, 244 | "requires": { 245 | "nice-try": "^1.0.4", 246 | "path-key": "^2.0.1", 247 | "semver": "^5.5.0", 248 | "shebang-command": "^1.2.0", 249 | "which": "^1.2.9" 250 | } 251 | }, 252 | "debug": { 253 | "version": "4.1.1", 254 | "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", 255 | "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", 256 | "dev": true, 257 | "requires": { 258 | "ms": "^2.1.1" 259 | } 260 | }, 261 | "decamelize": { 262 | "version": "1.2.0", 263 | "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", 264 | "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", 265 | "dev": true 266 | }, 267 | "deep-eql": { 268 | "version": "3.0.1", 269 | "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", 270 | "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", 271 | "dev": true, 272 | "requires": { 273 | "type-detect": "^4.0.0" 274 | } 275 | }, 276 | "deep-is": { 277 | "version": "0.1.3", 278 | "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", 279 | "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", 280 | "dev": true 281 | }, 282 | "define-properties": { 283 | "version": "1.1.3", 284 | "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", 285 | "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", 286 | "dev": true, 287 | "requires": { 288 | "object-keys": "^1.0.12" 289 | } 290 | }, 291 | "diff": { 292 | "version": "3.5.0", 293 | "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", 294 | "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", 295 | "dev": true 296 | }, 297 | "doctrine": { 298 | "version": "3.0.0", 299 | "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", 300 | "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", 301 | "dev": true, 302 | "requires": { 303 | "esutils": "^2.0.2" 304 | } 305 | }, 306 | "emoji-regex": { 307 | "version": "7.0.3", 308 | "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", 309 | "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", 310 | "dev": true 311 | }, 312 | "end-of-stream": { 313 | "version": "1.4.1", 314 | "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", 315 | "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", 316 | "dev": true, 317 | "requires": { 318 | "once": "^1.4.0" 319 | } 320 | }, 321 | "es-abstract": { 322 | "version": "1.13.0", 323 | "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.13.0.tgz", 324 | "integrity": "sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg==", 325 | "dev": true, 326 | "requires": { 327 | "es-to-primitive": "^1.2.0", 328 | "function-bind": "^1.1.1", 329 | "has": "^1.0.3", 330 | "is-callable": "^1.1.4", 331 | "is-regex": "^1.0.4", 332 | "object-keys": "^1.0.12" 333 | } 334 | }, 335 | "es-to-primitive": { 336 | "version": "1.2.0", 337 | "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.0.tgz", 338 | "integrity": "sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==", 339 | "dev": true, 340 | "requires": { 341 | "is-callable": "^1.1.4", 342 | "is-date-object": "^1.0.1", 343 | "is-symbol": "^1.0.2" 344 | } 345 | }, 346 | "escape-string-regexp": { 347 | "version": "1.0.5", 348 | "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", 349 | "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", 350 | "dev": true 351 | }, 352 | "eslint": { 353 | "version": "5.16.0", 354 | "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.16.0.tgz", 355 | "integrity": "sha512-S3Rz11i7c8AA5JPv7xAH+dOyq/Cu/VXHiHXBPOU1k/JAM5dXqQPt3qcrhpHSorXmrpu2g0gkIBVXAqCpzfoZIg==", 356 | "dev": true, 357 | "requires": { 358 | "@babel/code-frame": "^7.0.0", 359 | "ajv": "^6.9.1", 360 | "chalk": "^2.1.0", 361 | "cross-spawn": "^6.0.5", 362 | "debug": "^4.0.1", 363 | "doctrine": "^3.0.0", 364 | "eslint-scope": "^4.0.3", 365 | "eslint-utils": "^1.3.1", 366 | "eslint-visitor-keys": "^1.0.0", 367 | "espree": "^5.0.1", 368 | "esquery": "^1.0.1", 369 | "esutils": "^2.0.2", 370 | "file-entry-cache": "^5.0.1", 371 | "functional-red-black-tree": "^1.0.1", 372 | "glob": "^7.1.2", 373 | "globals": "^11.7.0", 374 | "ignore": "^4.0.6", 375 | "import-fresh": "^3.0.0", 376 | "imurmurhash": "^0.1.4", 377 | "inquirer": "^6.2.2", 378 | "js-yaml": "^3.13.0", 379 | "json-stable-stringify-without-jsonify": "^1.0.1", 380 | "levn": "^0.3.0", 381 | "lodash": "^4.17.11", 382 | "minimatch": "^3.0.4", 383 | "mkdirp": "^0.5.1", 384 | "natural-compare": "^1.4.0", 385 | "optionator": "^0.8.2", 386 | "path-is-inside": "^1.0.2", 387 | "progress": "^2.0.0", 388 | "regexpp": "^2.0.1", 389 | "semver": "^5.5.1", 390 | "strip-ansi": "^4.0.0", 391 | "strip-json-comments": "^2.0.1", 392 | "table": "^5.2.3", 393 | "text-table": "^0.2.0" 394 | }, 395 | "dependencies": { 396 | "strip-ansi": { 397 | "version": "4.0.0", 398 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", 399 | "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", 400 | "dev": true, 401 | "requires": { 402 | "ansi-regex": "^3.0.0" 403 | } 404 | } 405 | } 406 | }, 407 | "eslint-config-wpcalypso": { 408 | "version": "4.0.1", 409 | "resolved": "https://registry.npmjs.org/eslint-config-wpcalypso/-/eslint-config-wpcalypso-4.0.1.tgz", 410 | "integrity": "sha512-/MdCPOQusYRJI57/GFNi523CW75CUIoqKEY+8XhDtkz0iSeFXl12c2hW2l4ezE0cDbhMUwSslI07YpSPW7nRgA==", 411 | "dev": true 412 | }, 413 | "eslint-plugin-wpcalypso": { 414 | "version": "4.1.0", 415 | "resolved": "https://registry.npmjs.org/eslint-plugin-wpcalypso/-/eslint-plugin-wpcalypso-4.1.0.tgz", 416 | "integrity": "sha512-2gZdaaX5rS7vve5FfIBTANPFXfQstxMppUFR8KzrY5cJPt7hIhpg9lOb4y0hVYNdJkhZxkvEWw8yoJhaUc1OYQ==", 417 | "dev": true 418 | }, 419 | "eslint-scope": { 420 | "version": "4.0.3", 421 | "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", 422 | "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", 423 | "dev": true, 424 | "requires": { 425 | "esrecurse": "^4.1.0", 426 | "estraverse": "^4.1.1" 427 | } 428 | }, 429 | "eslint-utils": { 430 | "version": "1.4.0", 431 | "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.0.tgz", 432 | "integrity": "sha512-7ehnzPaP5IIEh1r1tkjuIrxqhNkzUJa9z3R92tLJdZIVdWaczEhr3EbhGtsMrVxi1KeR8qA7Off6SWc5WNQqyQ==", 433 | "dev": true, 434 | "requires": { 435 | "eslint-visitor-keys": "^1.0.0" 436 | } 437 | }, 438 | "eslint-visitor-keys": { 439 | "version": "1.0.0", 440 | "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", 441 | "integrity": "sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==", 442 | "dev": true 443 | }, 444 | "espree": { 445 | "version": "5.0.1", 446 | "resolved": "https://registry.npmjs.org/espree/-/espree-5.0.1.tgz", 447 | "integrity": "sha512-qWAZcWh4XE/RwzLJejfcofscgMc9CamR6Tn1+XRXNzrvUSSbiAjGOI/fggztjIi7y9VLPqnICMIPiGyr8JaZ0A==", 448 | "dev": true, 449 | "requires": { 450 | "acorn": "^6.0.7", 451 | "acorn-jsx": "^5.0.0", 452 | "eslint-visitor-keys": "^1.0.0" 453 | } 454 | }, 455 | "esprima": { 456 | "version": "4.0.1", 457 | "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", 458 | "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", 459 | "dev": true 460 | }, 461 | "esquery": { 462 | "version": "1.0.1", 463 | "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz", 464 | "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==", 465 | "dev": true, 466 | "requires": { 467 | "estraverse": "^4.0.0" 468 | } 469 | }, 470 | "esrecurse": { 471 | "version": "4.2.1", 472 | "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", 473 | "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", 474 | "dev": true, 475 | "requires": { 476 | "estraverse": "^4.1.0" 477 | } 478 | }, 479 | "estraverse": { 480 | "version": "4.2.0", 481 | "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", 482 | "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", 483 | "dev": true 484 | }, 485 | "estree-walker": { 486 | "version": "0.6.1", 487 | "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.1.tgz", 488 | "integrity": "sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==" 489 | }, 490 | "esutils": { 491 | "version": "2.0.3", 492 | "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", 493 | "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", 494 | "dev": true 495 | }, 496 | "execa": { 497 | "version": "1.0.0", 498 | "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", 499 | "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", 500 | "dev": true, 501 | "requires": { 502 | "cross-spawn": "^6.0.0", 503 | "get-stream": "^4.0.0", 504 | "is-stream": "^1.1.0", 505 | "npm-run-path": "^2.0.0", 506 | "p-finally": "^1.0.0", 507 | "signal-exit": "^3.0.0", 508 | "strip-eof": "^1.0.0" 509 | } 510 | }, 511 | "external-editor": { 512 | "version": "3.1.0", 513 | "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", 514 | "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", 515 | "dev": true, 516 | "requires": { 517 | "chardet": "^0.7.0", 518 | "iconv-lite": "^0.4.24", 519 | "tmp": "^0.0.33" 520 | } 521 | }, 522 | "fast-deep-equal": { 523 | "version": "2.0.1", 524 | "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", 525 | "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", 526 | "dev": true 527 | }, 528 | "fast-json-stable-stringify": { 529 | "version": "2.0.0", 530 | "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", 531 | "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", 532 | "dev": true 533 | }, 534 | "fast-levenshtein": { 535 | "version": "2.0.6", 536 | "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", 537 | "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", 538 | "dev": true 539 | }, 540 | "figures": { 541 | "version": "2.0.0", 542 | "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", 543 | "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", 544 | "dev": true, 545 | "requires": { 546 | "escape-string-regexp": "^1.0.5" 547 | } 548 | }, 549 | "file-entry-cache": { 550 | "version": "5.0.1", 551 | "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", 552 | "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", 553 | "dev": true, 554 | "requires": { 555 | "flat-cache": "^2.0.1" 556 | } 557 | }, 558 | "find-up": { 559 | "version": "3.0.0", 560 | "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", 561 | "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", 562 | "dev": true, 563 | "requires": { 564 | "locate-path": "^3.0.0" 565 | } 566 | }, 567 | "flat": { 568 | "version": "4.1.0", 569 | "resolved": "https://registry.npmjs.org/flat/-/flat-4.1.0.tgz", 570 | "integrity": "sha512-Px/TiLIznH7gEDlPXcUD4KnBusa6kR6ayRUVcnEAbreRIuhkqow/mun59BuRXwoYk7ZQOLW1ZM05ilIvK38hFw==", 571 | "dev": true, 572 | "requires": { 573 | "is-buffer": "~2.0.3" 574 | } 575 | }, 576 | "flat-cache": { 577 | "version": "2.0.1", 578 | "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", 579 | "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", 580 | "dev": true, 581 | "requires": { 582 | "flatted": "^2.0.0", 583 | "rimraf": "2.6.3", 584 | "write": "1.0.3" 585 | } 586 | }, 587 | "flatted": { 588 | "version": "2.0.1", 589 | "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.1.tgz", 590 | "integrity": "sha512-a1hQMktqW9Nmqr5aktAux3JMNqaucxGcjtjWnZLHX7yyPCmlSV3M54nGYbqT8K+0GhF3NBgmJCc3ma+WOgX8Jg==", 591 | "dev": true 592 | }, 593 | "fs.realpath": { 594 | "version": "1.0.0", 595 | "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", 596 | "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", 597 | "dev": true 598 | }, 599 | "function-bind": { 600 | "version": "1.1.1", 601 | "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", 602 | "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", 603 | "dev": true 604 | }, 605 | "functional-red-black-tree": { 606 | "version": "1.0.1", 607 | "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", 608 | "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", 609 | "dev": true 610 | }, 611 | "get-caller-file": { 612 | "version": "2.0.5", 613 | "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", 614 | "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", 615 | "dev": true 616 | }, 617 | "get-func-name": { 618 | "version": "2.0.0", 619 | "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", 620 | "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", 621 | "dev": true 622 | }, 623 | "get-stream": { 624 | "version": "4.1.0", 625 | "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", 626 | "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", 627 | "dev": true, 628 | "requires": { 629 | "pump": "^3.0.0" 630 | } 631 | }, 632 | "glob": { 633 | "version": "7.1.4", 634 | "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", 635 | "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", 636 | "dev": true, 637 | "requires": { 638 | "fs.realpath": "^1.0.0", 639 | "inflight": "^1.0.4", 640 | "inherits": "2", 641 | "minimatch": "^3.0.4", 642 | "once": "^1.3.0", 643 | "path-is-absolute": "^1.0.0" 644 | } 645 | }, 646 | "globals": { 647 | "version": "11.12.0", 648 | "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", 649 | "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", 650 | "dev": true 651 | }, 652 | "growl": { 653 | "version": "1.10.5", 654 | "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", 655 | "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", 656 | "dev": true 657 | }, 658 | "has": { 659 | "version": "1.0.3", 660 | "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", 661 | "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", 662 | "dev": true, 663 | "requires": { 664 | "function-bind": "^1.1.1" 665 | } 666 | }, 667 | "has-flag": { 668 | "version": "3.0.0", 669 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", 670 | "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", 671 | "dev": true 672 | }, 673 | "has-symbols": { 674 | "version": "1.0.0", 675 | "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", 676 | "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", 677 | "dev": true 678 | }, 679 | "he": { 680 | "version": "1.2.0", 681 | "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", 682 | "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", 683 | "dev": true 684 | }, 685 | "iconv-lite": { 686 | "version": "0.4.24", 687 | "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", 688 | "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", 689 | "dev": true, 690 | "requires": { 691 | "safer-buffer": ">= 2.1.2 < 3" 692 | } 693 | }, 694 | "ignore": { 695 | "version": "4.0.6", 696 | "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", 697 | "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", 698 | "dev": true 699 | }, 700 | "import-fresh": { 701 | "version": "3.1.0", 702 | "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.1.0.tgz", 703 | "integrity": "sha512-PpuksHKGt8rXfWEr9m9EHIpgyyaltBy8+eF6GJM0QCAxMgxCfucMF3mjecK2QsJr0amJW7gTqh5/wht0z2UhEQ==", 704 | "dev": true, 705 | "requires": { 706 | "parent-module": "^1.0.0", 707 | "resolve-from": "^4.0.0" 708 | } 709 | }, 710 | "imurmurhash": { 711 | "version": "0.1.4", 712 | "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", 713 | "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", 714 | "dev": true 715 | }, 716 | "inflight": { 717 | "version": "1.0.6", 718 | "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", 719 | "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", 720 | "dev": true, 721 | "requires": { 722 | "once": "^1.3.0", 723 | "wrappy": "1" 724 | } 725 | }, 726 | "inherits": { 727 | "version": "2.0.4", 728 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 729 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", 730 | "dev": true 731 | }, 732 | "inquirer": { 733 | "version": "6.5.0", 734 | "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.5.0.tgz", 735 | "integrity": "sha512-scfHejeG/lVZSpvCXpsB4j/wQNPM5JC8kiElOI0OUTwmc1RTpXr4H32/HOlQHcZiYl2z2VElwuCVDRG8vFmbnA==", 736 | "dev": true, 737 | "requires": { 738 | "ansi-escapes": "^3.2.0", 739 | "chalk": "^2.4.2", 740 | "cli-cursor": "^2.1.0", 741 | "cli-width": "^2.0.0", 742 | "external-editor": "^3.0.3", 743 | "figures": "^2.0.0", 744 | "lodash": "^4.17.12", 745 | "mute-stream": "0.0.7", 746 | "run-async": "^2.2.0", 747 | "rxjs": "^6.4.0", 748 | "string-width": "^2.1.0", 749 | "strip-ansi": "^5.1.0", 750 | "through": "^2.3.6" 751 | } 752 | }, 753 | "invert-kv": { 754 | "version": "2.0.0", 755 | "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", 756 | "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", 757 | "dev": true 758 | }, 759 | "is-buffer": { 760 | "version": "2.0.3", 761 | "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.3.tgz", 762 | "integrity": "sha512-U15Q7MXTuZlrbymiz95PJpZxu8IlipAp4dtS3wOdgPXx3mqBnslrWU14kxfHB+Py/+2PVKSr37dMAgM2A4uArw==", 763 | "dev": true 764 | }, 765 | "is-callable": { 766 | "version": "1.1.4", 767 | "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", 768 | "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==", 769 | "dev": true 770 | }, 771 | "is-date-object": { 772 | "version": "1.0.1", 773 | "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", 774 | "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", 775 | "dev": true 776 | }, 777 | "is-fullwidth-code-point": { 778 | "version": "2.0.0", 779 | "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", 780 | "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", 781 | "dev": true 782 | }, 783 | "is-promise": { 784 | "version": "2.1.0", 785 | "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", 786 | "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", 787 | "dev": true 788 | }, 789 | "is-regex": { 790 | "version": "1.0.4", 791 | "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", 792 | "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", 793 | "dev": true, 794 | "requires": { 795 | "has": "^1.0.1" 796 | } 797 | }, 798 | "is-stream": { 799 | "version": "1.1.0", 800 | "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", 801 | "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", 802 | "dev": true 803 | }, 804 | "is-symbol": { 805 | "version": "1.0.2", 806 | "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz", 807 | "integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==", 808 | "dev": true, 809 | "requires": { 810 | "has-symbols": "^1.0.0" 811 | } 812 | }, 813 | "isexe": { 814 | "version": "2.0.0", 815 | "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", 816 | "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", 817 | "dev": true 818 | }, 819 | "js-tokens": { 820 | "version": "4.0.0", 821 | "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", 822 | "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", 823 | "dev": true 824 | }, 825 | "js-yaml": { 826 | "version": "3.13.1", 827 | "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", 828 | "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", 829 | "dev": true, 830 | "requires": { 831 | "argparse": "^1.0.7", 832 | "esprima": "^4.0.0" 833 | } 834 | }, 835 | "json-schema-traverse": { 836 | "version": "0.4.1", 837 | "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", 838 | "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", 839 | "dev": true 840 | }, 841 | "json-stable-stringify-without-jsonify": { 842 | "version": "1.0.1", 843 | "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", 844 | "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", 845 | "dev": true 846 | }, 847 | "lcid": { 848 | "version": "2.0.0", 849 | "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", 850 | "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", 851 | "dev": true, 852 | "requires": { 853 | "invert-kv": "^2.0.0" 854 | } 855 | }, 856 | "levn": { 857 | "version": "0.3.0", 858 | "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", 859 | "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", 860 | "dev": true, 861 | "requires": { 862 | "prelude-ls": "~1.1.2", 863 | "type-check": "~0.3.2" 864 | } 865 | }, 866 | "locate-path": { 867 | "version": "3.0.0", 868 | "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", 869 | "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", 870 | "dev": true, 871 | "requires": { 872 | "p-locate": "^3.0.0", 873 | "path-exists": "^3.0.0" 874 | } 875 | }, 876 | "lodash": { 877 | "version": "4.17.15", 878 | "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", 879 | "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" 880 | }, 881 | "log-symbols": { 882 | "version": "2.2.0", 883 | "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", 884 | "integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==", 885 | "dev": true, 886 | "requires": { 887 | "chalk": "^2.0.1" 888 | } 889 | }, 890 | "map-age-cleaner": { 891 | "version": "0.1.3", 892 | "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", 893 | "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==", 894 | "dev": true, 895 | "requires": { 896 | "p-defer": "^1.0.0" 897 | } 898 | }, 899 | "mem": { 900 | "version": "4.3.0", 901 | "resolved": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz", 902 | "integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==", 903 | "dev": true, 904 | "requires": { 905 | "map-age-cleaner": "^0.1.1", 906 | "mimic-fn": "^2.0.0", 907 | "p-is-promise": "^2.0.0" 908 | }, 909 | "dependencies": { 910 | "mimic-fn": { 911 | "version": "2.1.0", 912 | "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", 913 | "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", 914 | "dev": true 915 | } 916 | } 917 | }, 918 | "mimic-fn": { 919 | "version": "1.2.0", 920 | "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", 921 | "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", 922 | "dev": true 923 | }, 924 | "minimatch": { 925 | "version": "3.0.4", 926 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", 927 | "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", 928 | "dev": true, 929 | "requires": { 930 | "brace-expansion": "^1.1.7" 931 | } 932 | }, 933 | "minimist": { 934 | "version": "0.0.8", 935 | "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", 936 | "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", 937 | "dev": true 938 | }, 939 | "mkdirp": { 940 | "version": "0.5.1", 941 | "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", 942 | "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", 943 | "dev": true, 944 | "requires": { 945 | "minimist": "0.0.8" 946 | } 947 | }, 948 | "mocha": { 949 | "version": "6.2.0", 950 | "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.2.0.tgz", 951 | "integrity": "sha512-qwfFgY+7EKAAUAdv7VYMZQknI7YJSGesxHyhn6qD52DV8UcSZs5XwCifcZGMVIE4a5fbmhvbotxC0DLQ0oKohQ==", 952 | "dev": true, 953 | "requires": { 954 | "ansi-colors": "3.2.3", 955 | "browser-stdout": "1.3.1", 956 | "debug": "3.2.6", 957 | "diff": "3.5.0", 958 | "escape-string-regexp": "1.0.5", 959 | "find-up": "3.0.0", 960 | "glob": "7.1.3", 961 | "growl": "1.10.5", 962 | "he": "1.2.0", 963 | "js-yaml": "3.13.1", 964 | "log-symbols": "2.2.0", 965 | "minimatch": "3.0.4", 966 | "mkdirp": "0.5.1", 967 | "ms": "2.1.1", 968 | "node-environment-flags": "1.0.5", 969 | "object.assign": "4.1.0", 970 | "strip-json-comments": "2.0.1", 971 | "supports-color": "6.0.0", 972 | "which": "1.3.1", 973 | "wide-align": "1.1.3", 974 | "yargs": "13.2.2", 975 | "yargs-parser": "13.0.0", 976 | "yargs-unparser": "1.5.0" 977 | }, 978 | "dependencies": { 979 | "debug": { 980 | "version": "3.2.6", 981 | "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", 982 | "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", 983 | "dev": true, 984 | "requires": { 985 | "ms": "^2.1.1" 986 | } 987 | }, 988 | "glob": { 989 | "version": "7.1.3", 990 | "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", 991 | "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", 992 | "dev": true, 993 | "requires": { 994 | "fs.realpath": "^1.0.0", 995 | "inflight": "^1.0.4", 996 | "inherits": "2", 997 | "minimatch": "^3.0.4", 998 | "once": "^1.3.0", 999 | "path-is-absolute": "^1.0.0" 1000 | } 1001 | }, 1002 | "ms": { 1003 | "version": "2.1.1", 1004 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", 1005 | "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", 1006 | "dev": true 1007 | }, 1008 | "supports-color": { 1009 | "version": "6.0.0", 1010 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz", 1011 | "integrity": "sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg==", 1012 | "dev": true, 1013 | "requires": { 1014 | "has-flag": "^3.0.0" 1015 | } 1016 | } 1017 | } 1018 | }, 1019 | "ms": { 1020 | "version": "2.1.2", 1021 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", 1022 | "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", 1023 | "dev": true 1024 | }, 1025 | "mute-stream": { 1026 | "version": "0.0.7", 1027 | "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", 1028 | "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", 1029 | "dev": true 1030 | }, 1031 | "natural-compare": { 1032 | "version": "1.4.0", 1033 | "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", 1034 | "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", 1035 | "dev": true 1036 | }, 1037 | "nice-try": { 1038 | "version": "1.0.5", 1039 | "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", 1040 | "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", 1041 | "dev": true 1042 | }, 1043 | "node-environment-flags": { 1044 | "version": "1.0.5", 1045 | "resolved": "https://registry.npmjs.org/node-environment-flags/-/node-environment-flags-1.0.5.tgz", 1046 | "integrity": "sha512-VNYPRfGfmZLx0Ye20jWzHUjyTW/c+6Wq+iLhDzUI4XmhrDd9l/FozXV3F2xOaXjvp0co0+v1YSR3CMP6g+VvLQ==", 1047 | "dev": true, 1048 | "requires": { 1049 | "object.getownpropertydescriptors": "^2.0.3", 1050 | "semver": "^5.7.0" 1051 | } 1052 | }, 1053 | "npm-run-path": { 1054 | "version": "2.0.2", 1055 | "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", 1056 | "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", 1057 | "dev": true, 1058 | "requires": { 1059 | "path-key": "^2.0.0" 1060 | } 1061 | }, 1062 | "number-is-nan": { 1063 | "version": "1.0.1", 1064 | "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", 1065 | "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", 1066 | "dev": true 1067 | }, 1068 | "object-keys": { 1069 | "version": "1.1.1", 1070 | "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", 1071 | "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", 1072 | "dev": true 1073 | }, 1074 | "object.assign": { 1075 | "version": "4.1.0", 1076 | "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", 1077 | "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", 1078 | "dev": true, 1079 | "requires": { 1080 | "define-properties": "^1.1.2", 1081 | "function-bind": "^1.1.1", 1082 | "has-symbols": "^1.0.0", 1083 | "object-keys": "^1.0.11" 1084 | } 1085 | }, 1086 | "object.getownpropertydescriptors": { 1087 | "version": "2.0.3", 1088 | "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz", 1089 | "integrity": "sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY=", 1090 | "dev": true, 1091 | "requires": { 1092 | "define-properties": "^1.1.2", 1093 | "es-abstract": "^1.5.1" 1094 | } 1095 | }, 1096 | "once": { 1097 | "version": "1.4.0", 1098 | "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", 1099 | "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", 1100 | "dev": true, 1101 | "requires": { 1102 | "wrappy": "1" 1103 | } 1104 | }, 1105 | "onetime": { 1106 | "version": "2.0.1", 1107 | "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", 1108 | "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", 1109 | "dev": true, 1110 | "requires": { 1111 | "mimic-fn": "^1.0.0" 1112 | } 1113 | }, 1114 | "optionator": { 1115 | "version": "0.8.2", 1116 | "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", 1117 | "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", 1118 | "dev": true, 1119 | "requires": { 1120 | "deep-is": "~0.1.3", 1121 | "fast-levenshtein": "~2.0.4", 1122 | "levn": "~0.3.0", 1123 | "prelude-ls": "~1.1.2", 1124 | "type-check": "~0.3.2", 1125 | "wordwrap": "~1.0.0" 1126 | } 1127 | }, 1128 | "os-locale": { 1129 | "version": "3.1.0", 1130 | "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", 1131 | "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", 1132 | "dev": true, 1133 | "requires": { 1134 | "execa": "^1.0.0", 1135 | "lcid": "^2.0.0", 1136 | "mem": "^4.0.0" 1137 | } 1138 | }, 1139 | "os-tmpdir": { 1140 | "version": "1.0.2", 1141 | "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", 1142 | "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", 1143 | "dev": true 1144 | }, 1145 | "p-defer": { 1146 | "version": "1.0.0", 1147 | "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", 1148 | "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=", 1149 | "dev": true 1150 | }, 1151 | "p-finally": { 1152 | "version": "1.0.0", 1153 | "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", 1154 | "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", 1155 | "dev": true 1156 | }, 1157 | "p-is-promise": { 1158 | "version": "2.1.0", 1159 | "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.1.0.tgz", 1160 | "integrity": "sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg==", 1161 | "dev": true 1162 | }, 1163 | "p-limit": { 1164 | "version": "2.2.0", 1165 | "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz", 1166 | "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==", 1167 | "dev": true, 1168 | "requires": { 1169 | "p-try": "^2.0.0" 1170 | } 1171 | }, 1172 | "p-locate": { 1173 | "version": "3.0.0", 1174 | "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", 1175 | "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", 1176 | "dev": true, 1177 | "requires": { 1178 | "p-limit": "^2.0.0" 1179 | } 1180 | }, 1181 | "p-try": { 1182 | "version": "2.2.0", 1183 | "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", 1184 | "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", 1185 | "dev": true 1186 | }, 1187 | "parent-module": { 1188 | "version": "1.0.1", 1189 | "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", 1190 | "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", 1191 | "dev": true, 1192 | "requires": { 1193 | "callsites": "^3.0.0" 1194 | } 1195 | }, 1196 | "path-exists": { 1197 | "version": "3.0.0", 1198 | "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", 1199 | "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", 1200 | "dev": true 1201 | }, 1202 | "path-is-absolute": { 1203 | "version": "1.0.1", 1204 | "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", 1205 | "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", 1206 | "dev": true 1207 | }, 1208 | "path-is-inside": { 1209 | "version": "1.0.2", 1210 | "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", 1211 | "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", 1212 | "dev": true 1213 | }, 1214 | "path-key": { 1215 | "version": "2.0.1", 1216 | "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", 1217 | "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", 1218 | "dev": true 1219 | }, 1220 | "pathval": { 1221 | "version": "1.1.0", 1222 | "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.0.tgz", 1223 | "integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA=", 1224 | "dev": true 1225 | }, 1226 | "prelude-ls": { 1227 | "version": "1.1.2", 1228 | "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", 1229 | "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", 1230 | "dev": true 1231 | }, 1232 | "progress": { 1233 | "version": "2.0.3", 1234 | "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", 1235 | "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", 1236 | "dev": true 1237 | }, 1238 | "pump": { 1239 | "version": "3.0.0", 1240 | "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", 1241 | "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", 1242 | "dev": true, 1243 | "requires": { 1244 | "end-of-stream": "^1.1.0", 1245 | "once": "^1.3.1" 1246 | } 1247 | }, 1248 | "punycode": { 1249 | "version": "2.1.1", 1250 | "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", 1251 | "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", 1252 | "dev": true 1253 | }, 1254 | "regexpp": { 1255 | "version": "2.0.1", 1256 | "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", 1257 | "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", 1258 | "dev": true 1259 | }, 1260 | "require-directory": { 1261 | "version": "2.1.1", 1262 | "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", 1263 | "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", 1264 | "dev": true 1265 | }, 1266 | "require-main-filename": { 1267 | "version": "2.0.0", 1268 | "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", 1269 | "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", 1270 | "dev": true 1271 | }, 1272 | "resolve-from": { 1273 | "version": "4.0.0", 1274 | "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", 1275 | "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", 1276 | "dev": true 1277 | }, 1278 | "restore-cursor": { 1279 | "version": "2.0.0", 1280 | "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", 1281 | "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", 1282 | "dev": true, 1283 | "requires": { 1284 | "onetime": "^2.0.0", 1285 | "signal-exit": "^3.0.2" 1286 | } 1287 | }, 1288 | "rimraf": { 1289 | "version": "2.6.3", 1290 | "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", 1291 | "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", 1292 | "dev": true, 1293 | "requires": { 1294 | "glob": "^7.1.3" 1295 | } 1296 | }, 1297 | "run-async": { 1298 | "version": "2.3.0", 1299 | "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", 1300 | "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", 1301 | "dev": true, 1302 | "requires": { 1303 | "is-promise": "^2.1.0" 1304 | } 1305 | }, 1306 | "rxjs": { 1307 | "version": "6.5.2", 1308 | "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.2.tgz", 1309 | "integrity": "sha512-HUb7j3kvb7p7eCUHE3FqjoDsC1xfZQ4AHFWfTKSpZ+sAhhz5X1WX0ZuUqWbzB2QhSLp3DoLUG+hMdEDKqWo2Zg==", 1310 | "dev": true, 1311 | "requires": { 1312 | "tslib": "^1.9.0" 1313 | } 1314 | }, 1315 | "safer-buffer": { 1316 | "version": "2.1.2", 1317 | "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", 1318 | "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", 1319 | "dev": true 1320 | }, 1321 | "semver": { 1322 | "version": "5.7.0", 1323 | "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", 1324 | "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", 1325 | "dev": true 1326 | }, 1327 | "set-blocking": { 1328 | "version": "2.0.0", 1329 | "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", 1330 | "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", 1331 | "dev": true 1332 | }, 1333 | "shebang-command": { 1334 | "version": "1.2.0", 1335 | "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", 1336 | "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", 1337 | "dev": true, 1338 | "requires": { 1339 | "shebang-regex": "^1.0.0" 1340 | } 1341 | }, 1342 | "shebang-regex": { 1343 | "version": "1.0.0", 1344 | "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", 1345 | "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", 1346 | "dev": true 1347 | }, 1348 | "signal-exit": { 1349 | "version": "3.0.2", 1350 | "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", 1351 | "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", 1352 | "dev": true 1353 | }, 1354 | "slice-ansi": { 1355 | "version": "2.1.0", 1356 | "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", 1357 | "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", 1358 | "dev": true, 1359 | "requires": { 1360 | "ansi-styles": "^3.2.0", 1361 | "astral-regex": "^1.0.0", 1362 | "is-fullwidth-code-point": "^2.0.0" 1363 | } 1364 | }, 1365 | "sprintf-js": { 1366 | "version": "1.0.3", 1367 | "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", 1368 | "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", 1369 | "dev": true 1370 | }, 1371 | "string-width": { 1372 | "version": "2.1.1", 1373 | "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", 1374 | "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", 1375 | "dev": true, 1376 | "requires": { 1377 | "is-fullwidth-code-point": "^2.0.0", 1378 | "strip-ansi": "^4.0.0" 1379 | }, 1380 | "dependencies": { 1381 | "strip-ansi": { 1382 | "version": "4.0.0", 1383 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", 1384 | "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", 1385 | "dev": true, 1386 | "requires": { 1387 | "ansi-regex": "^3.0.0" 1388 | } 1389 | } 1390 | } 1391 | }, 1392 | "strip-ansi": { 1393 | "version": "5.2.0", 1394 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", 1395 | "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", 1396 | "dev": true, 1397 | "requires": { 1398 | "ansi-regex": "^4.1.0" 1399 | }, 1400 | "dependencies": { 1401 | "ansi-regex": { 1402 | "version": "4.1.0", 1403 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", 1404 | "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", 1405 | "dev": true 1406 | } 1407 | } 1408 | }, 1409 | "strip-eof": { 1410 | "version": "1.0.0", 1411 | "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", 1412 | "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", 1413 | "dev": true 1414 | }, 1415 | "strip-json-comments": { 1416 | "version": "2.0.1", 1417 | "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", 1418 | "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", 1419 | "dev": true 1420 | }, 1421 | "supports-color": { 1422 | "version": "5.5.0", 1423 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", 1424 | "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", 1425 | "dev": true, 1426 | "requires": { 1427 | "has-flag": "^3.0.0" 1428 | } 1429 | }, 1430 | "table": { 1431 | "version": "5.4.5", 1432 | "resolved": "https://registry.npmjs.org/table/-/table-5.4.5.tgz", 1433 | "integrity": "sha512-oGa2Hl7CQjfoaogtrOHEJroOcYILTx7BZWLGsJIlzoWmB2zmguhNfPJZsWPKYek/MgCxfco54gEi31d1uN2hFA==", 1434 | "dev": true, 1435 | "requires": { 1436 | "ajv": "^6.10.2", 1437 | "lodash": "^4.17.14", 1438 | "slice-ansi": "^2.1.0", 1439 | "string-width": "^3.0.0" 1440 | }, 1441 | "dependencies": { 1442 | "string-width": { 1443 | "version": "3.1.0", 1444 | "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", 1445 | "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", 1446 | "dev": true, 1447 | "requires": { 1448 | "emoji-regex": "^7.0.1", 1449 | "is-fullwidth-code-point": "^2.0.0", 1450 | "strip-ansi": "^5.1.0" 1451 | } 1452 | } 1453 | } 1454 | }, 1455 | "text-table": { 1456 | "version": "0.2.0", 1457 | "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", 1458 | "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", 1459 | "dev": true 1460 | }, 1461 | "through": { 1462 | "version": "2.3.8", 1463 | "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", 1464 | "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", 1465 | "dev": true 1466 | }, 1467 | "tmp": { 1468 | "version": "0.0.33", 1469 | "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", 1470 | "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", 1471 | "dev": true, 1472 | "requires": { 1473 | "os-tmpdir": "~1.0.2" 1474 | } 1475 | }, 1476 | "tslib": { 1477 | "version": "1.10.0", 1478 | "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz", 1479 | "integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==", 1480 | "dev": true 1481 | }, 1482 | "type-check": { 1483 | "version": "0.3.2", 1484 | "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", 1485 | "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", 1486 | "dev": true, 1487 | "requires": { 1488 | "prelude-ls": "~1.1.2" 1489 | } 1490 | }, 1491 | "type-detect": { 1492 | "version": "4.0.8", 1493 | "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", 1494 | "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", 1495 | "dev": true 1496 | }, 1497 | "uri-js": { 1498 | "version": "4.2.2", 1499 | "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", 1500 | "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", 1501 | "dev": true, 1502 | "requires": { 1503 | "punycode": "^2.1.0" 1504 | } 1505 | }, 1506 | "which": { 1507 | "version": "1.3.1", 1508 | "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", 1509 | "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", 1510 | "dev": true, 1511 | "requires": { 1512 | "isexe": "^2.0.0" 1513 | } 1514 | }, 1515 | "which-module": { 1516 | "version": "2.0.0", 1517 | "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", 1518 | "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", 1519 | "dev": true 1520 | }, 1521 | "wide-align": { 1522 | "version": "1.1.3", 1523 | "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", 1524 | "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", 1525 | "dev": true, 1526 | "requires": { 1527 | "string-width": "^1.0.2 || 2" 1528 | } 1529 | }, 1530 | "wordwrap": { 1531 | "version": "1.0.0", 1532 | "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", 1533 | "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", 1534 | "dev": true 1535 | }, 1536 | "wrap-ansi": { 1537 | "version": "2.1.0", 1538 | "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", 1539 | "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", 1540 | "dev": true, 1541 | "requires": { 1542 | "string-width": "^1.0.1", 1543 | "strip-ansi": "^3.0.1" 1544 | }, 1545 | "dependencies": { 1546 | "ansi-regex": { 1547 | "version": "2.1.1", 1548 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", 1549 | "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", 1550 | "dev": true 1551 | }, 1552 | "is-fullwidth-code-point": { 1553 | "version": "1.0.0", 1554 | "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", 1555 | "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", 1556 | "dev": true, 1557 | "requires": { 1558 | "number-is-nan": "^1.0.0" 1559 | } 1560 | }, 1561 | "string-width": { 1562 | "version": "1.0.2", 1563 | "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", 1564 | "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", 1565 | "dev": true, 1566 | "requires": { 1567 | "code-point-at": "^1.0.0", 1568 | "is-fullwidth-code-point": "^1.0.0", 1569 | "strip-ansi": "^3.0.0" 1570 | } 1571 | }, 1572 | "strip-ansi": { 1573 | "version": "3.0.1", 1574 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", 1575 | "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", 1576 | "dev": true, 1577 | "requires": { 1578 | "ansi-regex": "^2.0.0" 1579 | } 1580 | } 1581 | } 1582 | }, 1583 | "wrappy": { 1584 | "version": "1.0.2", 1585 | "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", 1586 | "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", 1587 | "dev": true 1588 | }, 1589 | "write": { 1590 | "version": "1.0.3", 1591 | "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", 1592 | "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", 1593 | "dev": true, 1594 | "requires": { 1595 | "mkdirp": "^0.5.1" 1596 | } 1597 | }, 1598 | "y18n": { 1599 | "version": "4.0.0", 1600 | "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", 1601 | "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", 1602 | "dev": true 1603 | }, 1604 | "yargs": { 1605 | "version": "13.2.2", 1606 | "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.2.2.tgz", 1607 | "integrity": "sha512-WyEoxgyTD3w5XRpAQNYUB9ycVH/PQrToaTXdYXRdOXvEy1l19br+VJsc0vcO8PTGg5ro/l/GY7F/JMEBmI0BxA==", 1608 | "dev": true, 1609 | "requires": { 1610 | "cliui": "^4.0.0", 1611 | "find-up": "^3.0.0", 1612 | "get-caller-file": "^2.0.1", 1613 | "os-locale": "^3.1.0", 1614 | "require-directory": "^2.1.1", 1615 | "require-main-filename": "^2.0.0", 1616 | "set-blocking": "^2.0.0", 1617 | "string-width": "^3.0.0", 1618 | "which-module": "^2.0.0", 1619 | "y18n": "^4.0.0", 1620 | "yargs-parser": "^13.0.0" 1621 | }, 1622 | "dependencies": { 1623 | "string-width": { 1624 | "version": "3.1.0", 1625 | "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", 1626 | "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", 1627 | "dev": true, 1628 | "requires": { 1629 | "emoji-regex": "^7.0.1", 1630 | "is-fullwidth-code-point": "^2.0.0", 1631 | "strip-ansi": "^5.1.0" 1632 | } 1633 | } 1634 | } 1635 | }, 1636 | "yargs-parser": { 1637 | "version": "13.0.0", 1638 | "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.0.0.tgz", 1639 | "integrity": "sha512-w2LXjoL8oRdRQN+hOyppuXs+V/fVAYtpcrRxZuF7Kt/Oc+Jr2uAcVntaUTNT6w5ihoWfFDpNY8CPx1QskxZ/pw==", 1640 | "dev": true, 1641 | "requires": { 1642 | "camelcase": "^5.0.0", 1643 | "decamelize": "^1.2.0" 1644 | } 1645 | }, 1646 | "yargs-unparser": { 1647 | "version": "1.5.0", 1648 | "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.5.0.tgz", 1649 | "integrity": "sha512-HK25qidFTCVuj/D1VfNiEndpLIeJN78aqgR23nL3y4N0U/91cOAzqfHlF8n2BvoNDcZmJKin3ddNSvOxSr8flw==", 1650 | "dev": true, 1651 | "requires": { 1652 | "flat": "^4.1.0", 1653 | "lodash": "^4.17.11", 1654 | "yargs": "^12.0.5" 1655 | }, 1656 | "dependencies": { 1657 | "get-caller-file": { 1658 | "version": "1.0.3", 1659 | "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", 1660 | "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", 1661 | "dev": true 1662 | }, 1663 | "require-main-filename": { 1664 | "version": "1.0.1", 1665 | "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", 1666 | "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", 1667 | "dev": true 1668 | }, 1669 | "yargs": { 1670 | "version": "12.0.5", 1671 | "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz", 1672 | "integrity": "sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==", 1673 | "dev": true, 1674 | "requires": { 1675 | "cliui": "^4.0.0", 1676 | "decamelize": "^1.2.0", 1677 | "find-up": "^3.0.0", 1678 | "get-caller-file": "^1.0.1", 1679 | "os-locale": "^3.0.0", 1680 | "require-directory": "^2.1.1", 1681 | "require-main-filename": "^1.0.1", 1682 | "set-blocking": "^2.0.0", 1683 | "string-width": "^2.0.0", 1684 | "which-module": "^2.0.0", 1685 | "y18n": "^3.2.1 || ^4.0.0", 1686 | "yargs-parser": "^11.1.1" 1687 | } 1688 | }, 1689 | "yargs-parser": { 1690 | "version": "11.1.1", 1691 | "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz", 1692 | "integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==", 1693 | "dev": true, 1694 | "requires": { 1695 | "camelcase": "^5.0.0", 1696 | "decamelize": "^1.2.0" 1697 | } 1698 | } 1699 | } 1700 | } 1701 | } 1702 | } 1703 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "xgettext-js", 3 | "version": "3.0.0", 4 | "author": "Andrew Duthie ", 5 | "description": "xgettext string extractor tool capable of parsing JavaScript files", 6 | "main": "xgettext.js", 7 | "files": [ 8 | "xgettext.js" 9 | ], 10 | "homepage": "https://github.com/automattic/xgettext-js", 11 | "license": "GPL-2.0-or-later", 12 | "keywords": [ 13 | "xgettext", 14 | "gettext", 15 | "i18n", 16 | "l10n", 17 | "internationalization", 18 | "localization" 19 | ], 20 | "repository": { 21 | "type": "git", 22 | "url": "https://github.com/automattic/xgettext-js" 23 | }, 24 | "scripts": { 25 | "lint": "eslint .", 26 | "test": "npm run lint && mocha", 27 | "test-watch": "mocha --watch" 28 | }, 29 | "engines": { 30 | "node": ">=10" 31 | }, 32 | "dependencies": { 33 | "@babel/parser": "^7.5.5", 34 | "estree-walker": "^0.6.1", 35 | "lodash": "^4.17.15" 36 | }, 37 | "devDependencies": { 38 | "chai": "^4.2.0", 39 | "eslint": "^5.16.0", 40 | "eslint-config-wpcalypso": "^4.0.1", 41 | "eslint-plugin-wpcalypso": "^4.1.0", 42 | "mocha": "^6.2.0" 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /test/xgettext.js: -------------------------------------------------------------------------------- 1 | var expect = require( 'chai' ).expect, 2 | XGettext = require( '../xgettext' ); 3 | 4 | it( 'should be instantiable', function() { 5 | var parser = new XGettext(); 6 | expect( parser ).to.be.instanceof( XGettext ); 7 | } ); 8 | 9 | it( 'should return array of translatable strings', function() { 10 | var source = '_( "Hello World!" );', 11 | matches = new XGettext().getMatches( source ); 12 | 13 | expect( matches ).to.deep.equal( [ { string: 'Hello World!', line: 1, column: 0 } ] ); 14 | } ); 15 | 16 | it( 'should return array of translatable strings, including comment on same line', function() { 17 | var source = '_( "Hello World!" ); /* translators: greeting */', 18 | matches = new XGettext().getMatches( source ); 19 | 20 | expect( matches ).to.deep.equal( [ { string: 'Hello World!', comment: 'greeting', line: 1, column: 0 } ] ); 21 | } ); 22 | 23 | it( 'should return array of translatable strings, including comment on previous line', function() { 24 | var source = '/* translators: greeting */\n_( "Hello World!" );', 25 | matches = new XGettext().getMatches( source ); 26 | 27 | expect( matches ).to.deep.equal( [ { string: 'Hello World!', comment: 'greeting', line: 2, column: 0 } ] ); 28 | } ); 29 | 30 | it( 'should enable developer to provide custom keyword logic returning a string', function() { 31 | var source = '_x( "Hello World!", "greeting" );', 32 | parser = new XGettext( { 33 | keywords: { 34 | _x: function( match ) { 35 | if ( 2 === match.arguments.length ) { 36 | return match.arguments[ 1 ].value + '\u0004' + match.arguments[ 0 ].value; 37 | } 38 | 39 | return match.arguments[ 0 ].value; 40 | }, 41 | }, 42 | } ), 43 | matches = parser.getMatches( source ); 44 | 45 | expect( matches ).to.deep.equal( [ { string: 'greeting\u0004Hello World!', line: 1, column: 0 } ] ); 46 | } ); 47 | 48 | it( 'should enable developer to provide custom keyword logic returning an object', function() { 49 | var source = '_( "Hello World!" );', 50 | parser = new XGettext( { 51 | keywords: { 52 | _: function() { 53 | return { isOkay: true }; 54 | }, 55 | }, 56 | } ), 57 | matches = parser.getMatches( source ); 58 | 59 | expect( matches ).to.deep.equal( [ { isOkay: true } ] ); 60 | } ); 61 | 62 | it( 'should enable developer to provide custom translator comment prefix', function() { 63 | var source = '_( "Hello World!" ); /* note: greeting */', 64 | parser = new XGettext( { 65 | commentPrefix: 'note:', 66 | } ), 67 | matches = parser.getMatches( source ); 68 | 69 | expect( matches ).to.deep.equal( [ { string: 'Hello World!', comment: 'greeting', line: 1, column: 0 } ] ); 70 | } ); 71 | 72 | it( 'should accept a number as keyword value to represent argument position', function() { 73 | var source = '_( null, "Hello World!" );', 74 | parser = new XGettext( { 75 | keywords: { 76 | _: 2, 77 | }, 78 | } ), 79 | matches = parser.getMatches( source ); 80 | 81 | expect( matches ).to.deep.equal( [ { string: 'Hello World!', line: 1, column: 0 } ] ); 82 | } ); 83 | 84 | it( 'should match functions that are the last element of a sequence (comma) expression', function() { 85 | var source = '(0, transpilerGeneratedName._)("Hello World!")', 86 | matches = new XGettext().getMatches( source ); 87 | 88 | expect( matches ).to.deep.equal( [ { string: 'Hello World!', line: 1, column: 0 } ] ); 89 | } ); 90 | 91 | it( 'should match functions that are the last element of a recursive sequence (comma) expression', function() { 92 | var source = '(0, (0, transpilerGeneratedName._))("Hello World!")', 93 | matches = new XGettext().getMatches( source ); 94 | 95 | expect( matches ).to.deep.equal( [ { string: 'Hello World!', line: 1, column: 0 } ] ); 96 | } ); 97 | 98 | it( 'should parse ecma6 by default', function() { 99 | var source = 'const i = 0; _("Hello World!");', 100 | matches = new XGettext().getMatches( source ); 101 | 102 | expect( matches ).to.deep.equal( [ { string: 'Hello World!', line: 1, column: 13 } ] ); 103 | } ); 104 | 105 | it( 'should handle jsx', function() { 106 | var source = '<>{ _( "World!" ) }', 107 | matches = new XGettext( { 108 | parseOptions: { 109 | plugins: [ 'jsx' ], 110 | }, 111 | } ).getMatches( source ); 112 | 113 | expect( matches ).to.deep.equal( [ 114 | { string: 'Hello ', line: 1, column: 32 }, 115 | { string: 'World!', line: 1, column: 50 }, 116 | ] ); 117 | } ); 118 | -------------------------------------------------------------------------------- /xgettext.js: -------------------------------------------------------------------------------- 1 | var _ = require( 'lodash' ), 2 | parser = require( '@babel/parser' ), 3 | walk = require( 'estree-walker' ).walk; 4 | 5 | /** 6 | * XGettext will parse a given input string for any instances of i18n function 7 | * calls, returning an array of objects for all translatable strings 8 | * discovered. 9 | * 10 | * @param {Object} options Options to use when p.arsing the input. Refer to 11 | * XGettext.defaultOptions for available options and a 12 | * description for each 13 | */ 14 | var XGettext = module.exports = function( options ) { 15 | if ( 'object' !== typeof options ) { 16 | options = {}; 17 | } 18 | 19 | this.options = _.extend( {}, XGettext.defaultOptions, options ); 20 | this.options.keywords = this._normalizeKeywords( this.options.keywords ); 21 | this.options.keywordFunctions = Object.keys( this.options.keywords ); 22 | this.options.parseOptions = _.extend( { locations: true }, this.options.parseOptions ); 23 | }; 24 | 25 | XGettext.defaultOptions = { 26 | /** 27 | * A key-value pair of keyword function names to be mapped into their 28 | * desired string value. Transform functions are passed a match including 29 | * three keys: `keyword` (the matched keyword), `arguments` (a 30 | * CallExpression arguments array), and `comment` if one exists. It is 31 | * expected that this function will return a string or an array of strings. 32 | * Alternatively, define value as number to return value in that argument 33 | * position on a 1-based index. 34 | * 35 | * @type {Object} 36 | * @see https://github.com/babel/babylon/blob/master/ast/spec.md 37 | */ 38 | keywords: { 39 | _: 1, 40 | }, 41 | 42 | /** 43 | * Optionally match translator comments to be included with translatable 44 | * strings. 45 | * 46 | * If undesired, set as `undefined`. A comment will be matched if it is 47 | * prefixed by this option and occurs either on the same or previous line 48 | * as the matched keyword. 49 | * 50 | * @type {String,undefined} 51 | */ 52 | commentPrefix: 'translators:', 53 | 54 | /** 55 | * Options for the parser. Babylon has some extra ones. 56 | * 57 | * @type {Object} 58 | * @see https://www.npmjs.com/package/@babel/parser 59 | */ 60 | parseOptions: {}, 61 | }; 62 | 63 | /** 64 | * Returns an array of objects for all strings matched by the keywords defined 65 | * in the `keyword` option property. 66 | * 67 | * Each object in the array contains a `string` key where the value is 68 | * determined by the corresponding keyword mapping function. An object may also 69 | * contain a `comment` key if the `commentPrefix` option is provided and a 70 | * comment is associated with the matched keyword. 71 | * 72 | * @param {String} input String from which to find matches 73 | * @return {Array} An array containing objects for each matched 74 | * occurrance of a keyword function 75 | */ 76 | XGettext.prototype.getMatches = function( input ) { 77 | var parsedInput, matches, transformedMatches; 78 | 79 | // Parse input as AST and matching comments 80 | parsedInput = this._parseInput( input ); 81 | 82 | // Find matches (i.e. where keyword functions are used) 83 | matches = this._discoverMatches( parsedInput ); 84 | 85 | // Use configured keyword transforms to parse string value 86 | transformedMatches = _( matches ).map( function( match ) { 87 | return this._transformMatch( match ); 88 | }.bind( this ) ).flatten().value(); 89 | 90 | return transformedMatches; 91 | }; 92 | 93 | /** 94 | * Returns an object containing keyword functions where number values are 95 | * replaced with a function returning the nth argument on a 1-based index. 96 | * 97 | * @private 98 | * @see https://www.gnu.org/software/gettext/manual/html_node/xgettext-Invocation.html 99 | * 100 | * @param {Object} keywords Original keywords object configuration 101 | * @return {Object} An object containing keyword functions where 102 | * number values are replaced with a function 103 | * returning the nth argument on a 1-based index 104 | */ 105 | XGettext.prototype._normalizeKeywords = function( keywords ) { 106 | var normalizedKeywords = {}; 107 | 108 | for ( var fn in keywords ) { 109 | normalizedKeywords[ fn ] = this._normalizeKeyword( keywords[ fn ] ); 110 | } 111 | 112 | return normalizedKeywords; 113 | }; 114 | 115 | /** 116 | * If passed a number, returns a function which returns the nth argument on a 117 | * 1-based index. Otherwise, returns the passed argument. 118 | * 119 | * @param {(Number|Function)} keyword A number or function to be normalized 120 | * @return {Function} A function to be used in place of the 121 | * passed argument 122 | */ 123 | XGettext.prototype._normalizeKeyword = function( keyword ) { 124 | if ( 'number' === typeof keyword ) { 125 | return ( function( argnum ) { 126 | var argumentPosition = argnum - 1; 127 | 128 | return function( match ) { 129 | if ( match.arguments.length > argumentPosition && 130 | typeof match.arguments[ argumentPosition ].value === 'string' ) { 131 | return match.arguments[ argumentPosition ].value; 132 | } 133 | }; 134 | }( keyword ) ); 135 | } 136 | 137 | return keyword; 138 | }; 139 | 140 | /** 141 | * Returns an object containing as AST representation of the input (as `ast`) 142 | * and any matching comments discovered during parsing (as `comments`) 143 | * 144 | * @private 145 | * @param {String} input String from which to find matches 146 | * @return {Array} An object containing as AST representation of the 147 | * input (as `ast`) and any matching comments discovered 148 | * during parsing (as `comments`) 149 | */ 150 | XGettext.prototype._parseInput = function( input ) { 151 | var comments = [], 152 | parseOptions = this.options.parseOptions, 153 | ast; 154 | 155 | ast = parser.parse( input, parseOptions ); 156 | 157 | if ( typeof this.options.commentPrefix !== 'undefined' ) { 158 | // Optionally locate translator comments 159 | var rxCommentMatch = new RegExp( '^\\s*' + this.options.commentPrefix, 'i' ); 160 | ast.comments.forEach( function( comment ) { 161 | var text = comment.value; 162 | var isTranslatorComment = rxCommentMatch.test( text ); 163 | 164 | if ( isTranslatorComment ) { 165 | comments.push( { 166 | value: text.replace( rxCommentMatch, '' ).trim(), 167 | line: comment.loc.start.line, 168 | } ); 169 | } 170 | } ); 171 | } 172 | 173 | return { 174 | comments: comments, 175 | ast: ast.program, 176 | }; 177 | }; 178 | 179 | /** 180 | * Returns an array of objects representing all matched keywords, including the 181 | * matched keyword (as `keyword`), the CallExpression arguments array (as 182 | * `arguments`), and potentially any comment associated with the match (as 183 | * `comment`) 184 | * 185 | * @private 186 | * 187 | * @param {Object} parsedInput Parse results 188 | * @return {Array} An array of objects representing all matched 189 | * keywords 190 | */ 191 | XGettext.prototype._discoverMatches = function( parsedInput ) { 192 | var keywordFunctions = this.options.keywordFunctions, 193 | matches = []; 194 | 195 | walk( parsedInput.ast, { 196 | enter: function( node ) { 197 | if ( node.type !== 'CallExpression' ) { 198 | return; 199 | } 200 | 201 | // Pull the resultingFunction out of (0, resultingFunction)() 202 | var callee = node.callee; 203 | while ( 'SequenceExpression' === callee.type ) { 204 | callee = _.last( callee.expressions ); 205 | } 206 | var functionName = ( callee.property ) ? callee.property.name : callee.name; 207 | 208 | // Validate is named function 209 | if ( ! functionName ) { 210 | return; 211 | } 212 | 213 | // Validate desired function name 214 | if ( keywordFunctions.indexOf( functionName ) === -1 ) { 215 | return; 216 | } 217 | 218 | // Build discovered match 219 | var match = { 220 | arguments: node.arguments, 221 | keyword: functionName, 222 | line: node.loc.start.line, 223 | column: node.loc.start.column, 224 | }; 225 | 226 | // Find translator comment 227 | _.each( parsedInput.comments, function( translatorComment ) { 228 | if ( node.loc.start.line === translatorComment.line || 229 | node.loc.start.line - 1 === translatorComment.line ) { 230 | match.comment = translatorComment.value; 231 | } 232 | } ); 233 | 234 | matches.push( match ); 235 | }, 236 | } ); 237 | 238 | return matches; 239 | }; 240 | 241 | /** 242 | * Returns an object representing a single transformed matched keyword, 243 | * including the transformed keyword string value (as `string`), and 244 | * potentially any comment associated with the match (as `comment`) 245 | * 246 | * @private 247 | * 248 | * @param {Object} match Match object 249 | * @return {Object} An object representing a single transformed matched 250 | * keyword 251 | */ 252 | XGettext.prototype._transformMatch = function( match ) { 253 | var strings = this.options.keywords[ match.keyword ]( match ); 254 | 255 | // If transformed result is object, immediately return 256 | if ( _.isPlainObject( strings ) ) { 257 | return strings; 258 | } 259 | 260 | // Cast strings to single-element array to enable mapping 261 | if ( ! ( strings instanceof Array ) ) { 262 | strings = [ strings ]; 263 | } 264 | 265 | // Remove falsey string values 266 | strings = strings.filter( Boolean ); 267 | 268 | // Transform string back to object with comment 269 | strings = _.map( strings, function( string ) { 270 | var transformed = { string: string, line: match.line, column: match.column }; 271 | 272 | if ( typeof match.comment !== 'undefined' ) { 273 | transformed.comment = match.comment; 274 | } 275 | 276 | return transformed; 277 | } ); 278 | 279 | return strings; 280 | }; 281 | --------------------------------------------------------------------------------