Skip to content

Commit 05e39bb

Browse files
committed
feat: Adding new options (options.allowDots)
Adding new option/feature, options.allowDots that is used for skipping the sanitization of data that has .(dot). This can be useful for nested document quering for mongoDb: https://docs.mongodb.com/manual/tutorial/query-embedded-documents/ Creating new tests that include the new option Updating the documentation (README.md) file for the new option Adressing issue: #36
1 parent 287075b commit 05e39bb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,11 @@ function middleware(options) {
101101
req[k] = sanitize(
102102
req[k],
103103
options,
104-
options?.allowDots ? TEST_REGEX_WITHOUT_DOT : TEST_REGEX
104+
options
105+
? options.allowDots
106+
? TEST_REGEX_WITHOUT_DOT
107+
: TEST_REGEX
108+
: null
105109
);
106110
}
107111
});

0 commit comments

Comments
 (0)