本文整理匯總了TypeScript中utils/nameFormatter.NameFormatter類的典型用法代碼示例。如果您正苦於以下問題:TypeScript NameFormatter類的具體用法?TypeScript NameFormatter怎麽用?TypeScript NameFormatter使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了NameFormatter類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: constructor
constructor (title?: string, firstName?: string, lastName?: string, address?: Address, email?: string, businessName?: string) {
super(PartyType.SOLE_TRADER_OR_SELF_EMPLOYED.value, NameFormatter.fullName(firstName, lastName, title), address, email)
this.businessName = businessName
this.title = title
this.firstName = firstName
this.lastName = lastName
}
示例2: deserialize
deserialize (input: any): SoleTrader {
if (input) {
Object.assign(this, new TheirDetails().deserialize(input))
this.businessName = input.businessName
this.type = PartyType.SOLE_TRADER_OR_SELF_EMPLOYED.value
this.title = input.title
if (input.firstName && input.lastName) {
this.firstName = input.firstName
this.lastName = input.lastName
this.name = NameFormatter.fullName(input.firstName, input.lastName, input.title)
}
}
return this
}
示例3: deserialize
deserialize (input: any): Individual {
if (input) {
Object.assign(this, new TheirDetails().deserialize(input))
if (input.dateOfBirth) {
this.dateOfBirth = input.dateOfBirth
}
this.title = input.title
if (input.firstName && input.lastName) {
this.firstName = input.firstName
this.lastName = input.lastName
this.name = NameFormatter.fullName(input.firstName, input.lastName, input.title)
}
this.type = PartyType.INDIVIDUAL.value
}
return this
}
示例4: it
it('should format name from title, first and last name', () => {
expect(NameFormatter.fullName('Coffee', 'McCoffee', 'Mr.')).to.eq('Mr. Coffee McCoffee')
})
示例5: constructor
constructor (title?: string, firstName?: string, lastName?: string, address?: Address, email?: string) {
super(PartyType.INDIVIDUAL.value, NameFormatter.fullName(firstName, lastName, title), address, email)
this.title = title
this.firstName = firstName
this.lastName = lastName
}