Skip to content
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.
/ js-client Public archive

Commit

Permalink
adding is statement
Browse files Browse the repository at this point in the history
  • Loading branch information
gerald-wicks-unvoid committed Jun 8, 2022
1 parent 93152ae commit f95eaec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/value-objects/regex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ export const toRegex = (raw: RawRegex): Regex => {
const flags = takeRightWhile(raw, char => char !== '/').join('');
let source = '';

if (raw !== undefined && raw.length) {
source = raw.length > 0 ? raw.substr(1, raw.length - (flags.length + 2)) : '';
if (raw && raw.length) {
source = raw.substr(1, raw.length - (flags.length + 2));
}

return new RegExp(source, flags);
Expand Down

0 comments on commit f95eaec

Please sign in to comment.