-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(name): bump name to domain-glossary namespace
- Loading branch information
1 parent
34ec02e
commit 656200e
Showing
13 changed files
with
64 additions
and
64 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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import { DomainLiteral } from 'domain-objects'; | ||
|
||
export interface UniPhone { | ||
export interface Phone { | ||
id?: number; | ||
number: string; | ||
} | ||
export class UniPhone extends DomainLiteral<UniPhone> implements UniPhone {} | ||
export class Phone extends DomainLiteral<Phone> implements Phone {} |
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
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 |
---|---|---|
@@ -1,17 +1,17 @@ | ||
import { UnexpectedCodePathError } from '@ehmpathy/error-fns'; | ||
import { phone } from 'phone'; | ||
|
||
import { UniPhoneNumber } from './UniPhoneNumber'; | ||
import { PhoneNumber } from './PhoneNumber'; | ||
|
||
/** | ||
* casts a phone number into the universal format, E.164 | ||
*/ | ||
export const asUniPhoneNumber = (input: string): UniPhoneNumber => { | ||
export const asPhoneNumber = (input: string): PhoneNumber => { | ||
const { phoneNumber: normalizedPhoneNumber } = phone(input); | ||
if (!normalizedPhoneNumber) | ||
throw new UnexpectedCodePathError( | ||
'input was not a valid phone number. can not be cast to uni-phone-number', | ||
'input was not a valid phone number. can not be cast to domain-glossary-phone-number', | ||
{ input }, | ||
); | ||
return normalizedPhoneNumber as UniPhoneNumber; | ||
return normalizedPhoneNumber as PhoneNumber; | ||
}; |
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
export * from './UniPhoneNumber'; | ||
export * from './isUniPhoneNumber'; | ||
export * from './asUniPhoneNumber'; | ||
export * from './PhoneNumber'; | ||
export * from './isPhoneNumber'; | ||
export * from './UniPhone'; | ||
export * from './asUniPhoneInHumanWords'; | ||
export * from './asPhoneNumber'; | ||
export * from './isPhoneNumber'; | ||
export * from './Phone'; | ||
export * from './asPhoneInHumanWords'; | ||
export * from './asPartialPhoneInHumanWords'; |
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