Skip to content

Commit

Permalink
fix: LEAP-509: Optimize regular expression for improved performance (H…
Browse files Browse the repository at this point in the history
…umanSignal#5310)

* fix: LEAP-509: Optimize regular expression for improved performance

* ci: Build frontend

Workflow run: https://github.com/HumanSignal/label-studio/actions/runs/7585393196

* fix regex to match the scope

* ci: Build frontend

Workflow run: https://github.com/HumanSignal/label-studio/actions/runs/7586535924

* Update web/libs/editor/src/utils/data.js

Co-authored-by: hlomzik <[email protected]>

* ci: Build frontend

Workflow run: https://github.com/HumanSignal/label-studio/actions/runs/7611143402

* [submodules] Copy src HumanSignal/label-studio-frontend

Workflow run: https://github.com/HumanSignal/label-studio/actions/runs/7611551866

* [submodules] Copy src HumanSignal/label-studio-frontend

Workflow run: https://github.com/HumanSignal/label-studio/actions/runs/7643711911

* ci: Build frontend

Workflow run: https://github.com/HumanSignal/label-studio/actions/runs/7643735748

* [submodules] Copy src HumanSignal/label-studio-frontend

Workflow run: https://github.com/HumanSignal/label-studio/actions/runs/7646041615

---------

Co-authored-by: robot-ci-heartex <[email protected]>
Co-authored-by: hlomzik <[email protected]>
Co-authored-by: juliosgarbi <[email protected]>
  • Loading branch information
4 people authored Jan 24, 2024
1 parent 9c28615 commit 59fc751
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion web/dist/libs/editor/main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion web/dist/libs/editor/main.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions web/libs/editor/src/utils/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ export const parseCSV = (text, separator = 'auto') => {

const re = new RegExp(
[
'"(""|[^"]+)*"', // quoted text with possible quoted quotes inside it ("not a ""value""")
'"(?:""|[^"])*"', // quoted text with possible quoted quotes inside it ("not a ""value""")
`[^"${separator}]+`, // usual value, no quotes, between separators
`(?=${separator}(${separator}|$))`, // empty value in the middle or at the end of string
`(?=${separator}(?:${separator}|$))`, // empty value in the middle or at the end of string
`^(?=${separator})`, // empty value at the start of the string
].join('|'),
'g',
Expand Down

0 comments on commit 59fc751

Please sign in to comment.