Skip to content

Commit

Permalink
feat: pull constants into separate file
Browse files Browse the repository at this point in the history
  • Loading branch information
ericdeansanchez committed Nov 18, 2020
1 parent 7e98689 commit bb4b36d
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/constants.js
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,
};

0 comments on commit bb4b36d

Please sign in to comment.