fix: Move collection index validation logic to a context assert function (#2116)

* Abstract validation logic for readability

* Add index validation in collections.move

* Add tests
This commit is contained in:
Saumya Pandey
2021-05-10 11:00:37 +05:30
committed by GitHub
parent 721e7466e6
commit 985f0da674
4 changed files with 35 additions and 6 deletions

View File

@ -0,0 +1,4 @@
// @flow
export const validateIndexCharacters = (index: string) =>
/^[\x21-\x7E]+$/i.test(index);