-
-
Notifications
You must be signed in to change notification settings - Fork 190
Export parseQuery (#76) #77
Conversation
- Add `exports.parseQuery` in `lib/index.js` - Separate `test/parseQuery.test.js` from `test/getOptions.test.js` - Add `parseQuery` in `README.md`
jhnns
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome 👍
There are only three small nitpicks, sorry :). After that, we're good to go.
test/getOptions.test.js
Outdated
| test.expected | ||
| ); | ||
| }); | ||
| describe("when loaderContext.query is a string that has length", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd write ... is a string with length > 0
README.md
Outdated
| Parses a passed string (e.g. `loaderContext.resourceQuery`) as a query string, and returns an object. | ||
|
|
||
| ``` javascript | ||
| var params = loaderUtils.parseQuery(this.resourceQuery); // resource: `file?param1=foo` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use const in the README if the value is not changed
README.md
Outdated
|
|
||
| ``` javascript | ||
| var params = loaderUtils.parseQuery(this.resourceQuery); // resource: `file?param1=foo` | ||
| if (params.param1 === 'foo') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use double quotes
|
I did not change other |
|
Oh, that would be great. Didn't realize we already have this inconsistency 😁 |
|
Ok, I replaced those with |
|
Published as |
|
Thank you 😄 |
exports.parseQueryinlib/index.jstest/parseQuery.test.jsfromtest/getOptions.test.jsparseQueryinREADME.md