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

split parser is keeping quotes #468

Closed
ssube opened this issue Sep 27, 2019 · 0 comments
Closed

split parser is keeping quotes #468

ssube opened this issue Sep 27, 2019 · 0 comments
Assignees
Labels
status/fixed issues that have been fixed and confirmed type/bug
Milestone

Comments

@ssube
Copy link
Owner

ssube commented Sep 27, 2019

Summary

The split parser is retaining quotes in the data, which breaks some controllers, such as math.

Steps to Reproduce

  • login
  • !!math 1+1
  • 2 (correct)

  • !!math 1 + 1
  • error evaluating math: Value expected (char 5) (a different issue)

  • !!math "1 + 1"
  • 1 + 1

Actual Behavior

1 + 1

Expected Behavior

2

Details

{"name":"isolex","hostname":"cerberus","pid":667,"kind":"function","level":20,"params":["[]","[[\"expr\",[\"\\\"1 + 1\\\"\\n\"]]]","math","create","bb5b7048-2548-4d58-82a2-20ab87100ae0","be45dafc-7d4c-4586-968c-127f074ca683"],"query":"INSERT INTO \"command\
"(\"createdAt\", \"updatedAt\", \"labels\", \"data\", \"noun\", \"verb\", \"id\", \"contextId\") VALUES (datetime('now'), datetime('now'), ?, ?, ?, ?, ?, ?)","msg":"orm logged query","time":"2019-09-27T00:33:11.609Z","v":0}

Judging by the params, the expression's quotes are being kept. There used to be a keepQuotes option in https://www.npmjs.com/package/split-string#optionsquotes, but it no longer appears in the documentation.

  • add some test coverage around this
  • fix the strip quotes config option
@ssube ssube closed this as completed in 8f1fe60 Sep 27, 2019
@ssube ssube added status/fixed issues that have been fixed and confirmed and removed status/new labels Sep 27, 2019
@ssube ssube added this to the 1.0 - stable milestone Sep 27, 2019
@ssube ssube self-assigned this Sep 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/fixed issues that have been fixed and confirmed type/bug
Projects
None yet
Development

No branches or pull requests

1 participant