-
Notifications
You must be signed in to change notification settings - Fork 82
Feat/vchart editor:Add VChartSpec Atom and demo of vchart editor #197
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
Conversation
feat: merge spec of vchart
Feat/vchart editor merge spec
chore: update jest to 0.29
Fix/merge spec 2
…into feat/vchart_editor
test: update test case of bar
…into feat/vchart_editor
fix: fix error of `set`
@@ -52,10 +52,15 @@ | |||
sparse_vector: (sparseVector ?? []) | |||
.map(item => { | |||
// 使用正则表达式解析字符串 | |||
const match = item.match(/\('(.+)', ([\d.]+)\)/); | |||
const match = item.match(/\("(.+?)", ([\d.]+)\)/); |
Check failure
Code scanning / CodeQL
Polynomial regular expression used on uncontrolled data High
regular expression
library input
This
regular expression
library input
if (match) { | ||
return [match[1], parseFloat(match[2])]; | ||
} | ||
const oldMatch = item.match(/\('(.+)', ([\d.]+)\)/); |
Check failure
Code scanning / CodeQL
Polynomial regular expression used on uncontrolled data High
regular expression
library input
This
regular expression
library input
if (isValid(nested[key])) { | ||
merge(nested, { [key]: newValue }); | ||
} else { | ||
nested[key] = newValue; |
Check warning
Code scanning / CodeQL
Prototype-polluting function Medium
here
nested
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 3 months ago
To fix the problem, we need to ensure that the key
variable does not include any properties that can lead to prototype pollution, such as __proto__
or constructor
. We can achieve this by adding a check to skip these properties before performing the assignment.
- Add a check to skip
__proto__
andconstructor
properties in thebaseSet
function. - This change should be made in the
baseSet
function in the filepackages/vmind/src/utils/set.ts
.
-
Copy modified lines R66-R68
@@ -65,2 +65,5 @@ | ||
const key = path[index]; | ||
if (key === "__proto__" || key === "constructor") { | ||
continue; | ||
} | ||
let newValue = value; |
[中文版模板 / Chinese template]
🤔 This is a ...
🔗 Related issue link
🔗 Related PR link
🐞 Bugserver case id
💡 Background and solution
📝 Changelog
☑️ Self-Check before Merge
🚀 Summary
copilot:summary
🔍 Walkthrough
copilot:walkthrough