mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-04-25 22:00:41 -04:00
fix(curriculum): allow comma separated declarations (#59347)
Co-authored-by: Ilenia <26656284+ilenia-magoni@users.noreply.github.com>
This commit is contained in:
@@ -124,7 +124,7 @@ You should use the correct story format for the first story: `"Once upon a time,
|
||||
```js
|
||||
const _initialValues = {}
|
||||
for (const name of ['adjective', 'noun', 'noun2', 'place', 'verb', 'adjective2']) {
|
||||
const match = code.match(new RegExp(String.raw`${name}\s*=\s*('|"|${'`'})(?<${name}>.*)\1;?\s*`));
|
||||
const match = code.match(new RegExp(String.raw`${name}\s*=\s*('|"|${'`'})(?<${name}>.*?)\1(?:,|;|\s|$)`, 'm'));
|
||||
_initialValues[name] = match ? match.groups[name] : null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user