Skip to content
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

Option to output a generated validation function as a single-line JSON string #3

Closed
OldSneerJaw opened this issue Mar 1, 2018 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@OldSneerJaw
Copy link
Owner

OldSneerJaw commented Mar 1, 2018

Add a commandline option to the make-validation-function script that, instead of outputting the result as a multi-line JavaScript block, escapes all line ending, backslash and double quote characters so that the output is encased in a single-line JSON-compatible string written to the target file.

For example:

./make-validation-function --json-string /path/to/my-doc-definitions.js /path/to/my-new-validation-function.txt

or

./make-validation-function -j /path/to/my-doc-definitions.js /path/to/my-new-validation-function.txt
@OldSneerJaw OldSneerJaw added the enhancement New feature or request label Mar 1, 2018
@OldSneerJaw OldSneerJaw self-assigned this Mar 6, 2018
@OldSneerJaw OldSneerJaw changed the title Option to output a generated validation function as a single-line string Option to output a generated validation function as a single-line JSON string Mar 6, 2018
OldSneerJaw added a commit that referenced this issue Mar 6, 2018
Specified as either `--json-string` or `-j`, this command line option has the `make-validation-function` script output the validation function in a double-quoted string that is suitable for use as the value of a design document's `validate_doc_update` property.
@OldSneerJaw
Copy link
Owner Author

Addressed by e759b49.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant