-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
address CR concerns, small refactors
- Loading branch information
1 parent
3c13082
commit b1e1278
Showing
5 changed files
with
48 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { FidesOptionOverrides, OverrideOptions } from "./consent-types"; | ||
|
||
// Regex to validate a location string, which must: | ||
// 1) Start with a 2-3 character country code (e.g. "US") | ||
// 2) Optionally end with a 2-3 character region code (e.g. "CA") | ||
// 3) Separated by a dash (e.g. "US-CA") | ||
export const VALID_ISO_3166_LOCATION_REGEX = /^\w{2,3}(-\w{2,3})?$/; | ||
|
||
export const FIDES_OVERRIDE_OPTIONS_VALIDATOR_MAP: { | ||
fidesOption: keyof FidesOptionOverrides; | ||
fidesOptionType: "string" | "boolean"; | ||
fidesOverrideKey: keyof OverrideOptions; | ||
validationRegex: RegExp; | ||
}[] = [ | ||
{ | ||
fidesOption: "fidesEmbed", | ||
fidesOptionType: "boolean", | ||
fidesOverrideKey: "fides_embed", | ||
validationRegex: /^(true|false)$/, | ||
}, | ||
{ | ||
fidesOption: "fidesDisableSaveApi", | ||
fidesOptionType: "boolean", | ||
fidesOverrideKey: "fides_disable_save_api", | ||
validationRegex: /^(true|false)$/, | ||
}, | ||
{ | ||
fidesOption: "fidesString", | ||
fidesOptionType: "string", | ||
fidesOverrideKey: "fides_string", | ||
validationRegex: /(.*)/, | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters