Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add comments to resource files #26

Merged
merged 1 commit into from
Nov 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/areaCodeList.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// The AREA_CODE_LIST is used in validation of NANP phone numbers. If a number is passed to `isValidPhoneNumber` that is not found in this array, `false` will be returned.
// If a new area code is added to this array, it must also be added to the AREA_CODES object in phoneCodes.js.
// If a new area code is added and covers a region that has multiple timezones, it will need to be added to the STATES_WITH_MULTIPLE_TIMEZONES object in timezones.js.
// If a new area code is added and covers a region that has portions that do and portions that do not adhere to daylight savings time, it will need to be added to the AREA_CODES_WITH_MULTIPLE_DAYLIGHT_SAVINGS object in daylightSavings.js.
export const AREA_CODE_LIST = [
'201',
'202',
Expand Down
2 changes: 2 additions & 0 deletions src/compliance.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Compliance settings are used to define quiet hours for the US (using TCPA) and Canada (using CRTC).
export const TCPA_QUIET_HOURS = {
start: 8,
end: 21,
Expand All @@ -14,6 +15,7 @@ export const CRTC_QUIET_HOURS = {
},
};

// The strings of CRTC_STATES must match the `name` field found within AREA_CODES object in phoneCodes.js.
export const CRTC_STATES = [
'Alberta',
'British Columbia',
Expand Down
1 change: 0 additions & 1 deletion src/phoneCodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,6 @@ export const AREA_CODES = {
region: CANADA,
},
// Other North American Numbering Plan (NANP) Numbers
// These will return "United States, Canada" as the region, which is incorrect, but they follow the same standard.
684: { region: { name: 'American Samoa', code: 'AS', flag: '🇦🇸' } },
264: { region: { name: 'Anguilla', code: 'AI', flag: '🇦🇮' } },
268: { region: { name: 'Antigua and Barbuda', code: 'AG', flag: '🇦🇬' } },
Expand Down
2 changes: 2 additions & 0 deletions src/phoneFormats.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// For each region, provide a pretty format. Some regions may have multiple formats, in which case an array can be used. Each "x" will be replaced with a digit when the number of digits matches the number of "x"s in the format.
// If no format is found with a correct matching length, a sanitized e164 is returned as a fall-back.
export const PHONE_FORMATS = {
1: '(xxx) xxx-xxxx', // United States
7: '+x xxx xxx-xx-xx', // Russia
Expand Down
3 changes: 3 additions & 0 deletions src/timezones.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Default timezone for each state, region or province.
// While some region may have multiple timezones, we set the most common one here as a default. See STATES_WITH_MULTIPLE_TIMEZONES below for references to exceptions within these regions.
// Time calculations are only provided for US and Canada.
export const STATE_TIMEZONES = {
Alabama: '-06:00',
Alaska: '-09:00',
Expand Down