Skip to content

Commit 8570e0e

Browse files
committed
🐛 Fix \ss in regex constructors
1 parent dfab65e commit 8570e0e

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

app/components/List.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ class CpacList extends PureComponent {
372372
entry, classes, isDefault, level, onChange, parents, schema
373373
} = this.props;
374374

375-
const regex = new RegExp(`^\s*{entry[0]}`);
375+
const regex = new RegExp(`^\\s*${entry[0]}`);
376376
const label = formatLabel(entry[0]);
377377
const chain = [...parents, entry[0]];
378378
const name = chain.join(".");

app/containers/pipeline/parts/PipelinePart.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ class PipelinePart extends PureComponent {
149149
</Accordion>
150150
)
151151
case false:
152-
const regex = new RegExp(`^\s*{entry[0]}`);
152+
const regex = new RegExp(`^\\s*${entry[0]}`);
153153
const label = formatLabel(entry[0]);
154154
const name = [...parents.slice(0, level), entry[0]].join(".");
155155
switch (typeof(entry[1])) {

c-pac/pipeline.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import yaml from 'js-yaml';
22
import yamlTemplate, { raw, loadYaml } from './resources/pipeline/yaml';
33

44
const defaultPipelineUrl = 'https://raw.githubusercontent.com/FCP-INDI/C-PAC/main/CPAC/resources/configs/pipeline_config_default.yml';
5-
const versionRe = new RegExp('(?<=\# Version:? \s*).*');
5+
const versionRe = /(?<=\# Version:? \s*).*/;
66

77
function setVersion(rawTemplate) {
88
let version = versionRe.exec(rawTemplate);

0 commit comments

Comments
 (0)