Skip to content

Commit

Permalink
Update distributed-map.ts
Browse files Browse the repository at this point in the history
Regex is incorrect. Switching to basic regex. Fixing regex to properly escape special characters
  • Loading branch information
piurafunk committed Apr 8, 2024
1 parent bf2cf51 commit 29a9a14
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export class DistributedMap extends MapBase implements INextable {
errors.push('label must be 40 characters or less');
}

let labelRegex = new RegExp('[\s\?\*\<\>\{\}\\[\\]\:\;\,\\\|\^\~\$\#\%\&\`\"]|[\u0000-\u001f]|[\u007f-\u009f]', 'gi');
let labelRegex = /[\s\?\*\<\>\{\}\\[\]\:\;\,\|\^\~\$\#\%\&\`\"]|[\u0000-\u001f]|[\u007f-\u009f]/gi
if (labelRegex.test(this.label)) {
errors.push('label cannot contain any whitespace or special characters');
}
Expand Down

0 comments on commit 29a9a14

Please sign in to comment.