-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: pull constants into separate file
- Loading branch information
1 parent
7e98689
commit bb4b36d
Showing
1 changed file
with
27 additions
and
0 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,27 @@ | ||
// package version used in the ix-lib parameter | ||
export const VERSION = '2.3.2'; | ||
// regex pattern used to determine if a domain is valid | ||
export const DOMAIN_REGEX = /^(?:[a-z\d\-_]{1,62}\.){0,125}(?:[a-z\d](?:\-(?=\-*[a-z\d])|[a-z]|\d){0,62}\.)[a-z\d]{1,63}$/i; | ||
// minimum generated srcset width | ||
export const MIN_SRCSET_WIDTH = 100; | ||
// maximum generated srcset width | ||
export const MAX_SRCSET_WIDTH = 8192; | ||
// default tolerable percent difference between srcset pair widths | ||
export const DEFAULT_SRCSET_WIDTH_TOLERANCE = .08; | ||
|
||
// default quality parameter values mapped by each dpr srcset entry | ||
export const DPR_QUALITIES = { | ||
1: 75, | ||
2: 50, | ||
3: 35, | ||
4: 23, | ||
5: 20 | ||
}; | ||
|
||
export const DEFAULTS = { | ||
domain: null, | ||
useHTTPS: true, | ||
includeLibraryParam: true, | ||
urlPrefix: 'https://', | ||
secureURLToken: null, | ||
}; |