-
-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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`
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.parseQuery
inlib/index.js
test/parseQuery.test.js
fromtest/getOptions.test.js
parseQuery
inREADME.md