diff options
Diffstat (limited to 'src/hooks')
-rw-r--r-- | src/hooks/ignoreCaseRegex.ts | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/hooks/ignoreCaseRegex.ts b/src/hooks/ignoreCaseRegex.ts index 3a1ab63..a9ddb31 100644 --- a/src/hooks/ignoreCaseRegex.ts +++ b/src/hooks/ignoreCaseRegex.ts @@ -3,7 +3,7 @@ import _ from 'lodash'; const ignoreCaseRegex = async (context: HookContext): Promise<HookContext> => { context.params.query = _.mapValues(context.params.query, data => { - return '$regex' in data ? _.set(data, '$options', 'i') : data; + return _.has(data, '$regex') ? _.set(data, '$options', 'i') : data; }); return context; }; |