Helper function to calculate num owners introduced
This commit is contained in:
parent
249c2526ed
commit
75edd7262e
|
@ -6,3 +6,9 @@ export const FIELD_DAILY_LIMIT: string = 'limit'
|
||||||
|
|
||||||
export const getOwnerNameBy = (index: number) => `owner${index}Name`
|
export const getOwnerNameBy = (index: number) => `owner${index}Name`
|
||||||
export const getOwnerAddressBy = (index: number) => `owner${index}Address`
|
export const getOwnerAddressBy = (index: number) => `owner${index}Address`
|
||||||
|
|
||||||
|
export const getNumOwnersFrom = (values: Object) => {
|
||||||
|
const accounts = Object.keys(values).sort().filter(key => /^owner\d+Name$/.test(key))
|
||||||
|
|
||||||
|
return accounts.length
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue