#291: Fixes & improvements to parameter hunter#292
Closed
james-nash wants to merge 6 commits intopattern-lab:devfrom
Closed
#291: Fixes & improvements to parameter hunter#292james-nash wants to merge 6 commits intopattern-lab:devfrom
james-nash wants to merge 6 commits intopattern-lab:devfrom
Conversation
added 6 commits
March 11, 2016 17:20
Contributor
|
@james-nash @bmuenzenmeyer |
Merged
Member
|
Closing this PR per #293 (comment) Appreciate the teamwork! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses #291
Summary of changes:
core/lib/parameter_hunter.jsparamToJson()now uses. Hopefully the in-source comments explain their details sufficiently well:extractNextKeyOrValue(): Extracts the next unquoted / single-quoted / double-quoted textdoubleQuoteKeyOrValIfNeeded(): Converts text to its double-quoted equivalentextractNextKeyValPair(): Extracts the next complete parameter (i.e. key:value pair)paramToJson(): Completely re-written. It now acts more parser-like, trying to find key, colon, value and comma in that order. If one of them is missing, it skips ahead until it finds a comma (or the end of the string), so that subsequent parameters can still be found.findparameters(): Minor change to remove the curly braces from the param string before it is passed toparamToJson().test/parameter_hunter_tests.jsparameter hunter parses parameters with values containing a closing parenthesisparameter hunter parses parameters that follow a non-quoted valueparameter hunter parses parameters whose keys contain escaped quotesparameter hunter skips malformed parametersI also included this unrelated change by accident (sorry):
.gitignorenpm-debug.log, which gets generated when you run withdebugenabled in the config file.