@availity/api-core
Advanced tools
Comparing version 1.0.0-alpha.12 to 1.0.0-alpha.13
{ | ||
"name": "@availity/api-core", | ||
"version": "1.0.0-alpha.12", | ||
"version": "1.0.0-alpha.13", | ||
"description": "Base API definitions for the Availity REST API", | ||
@@ -17,6 +17,6 @@ "keywords": [ | ||
"peerDependencies": { | ||
"@availity/localstorage-core": "^1.0.0-alpha.12" | ||
"@availity/localstorage-core": "^1.0.0-alpha.13" | ||
}, | ||
"devDependencies": { | ||
"@availity/localstorage-core": "^1.0.0-alpha.12" | ||
"@availity/localstorage-core": "^1.0.0-alpha.13" | ||
}, | ||
@@ -23,0 +23,0 @@ "publishConfig": { |
@@ -24,2 +24,14 @@ import AvApi from '../api'; | ||
} | ||
normalize(providers) { | ||
const cloned = providers.slice(); | ||
cloned.forEach(provider => { | ||
provider.name = provider.businessName | ||
? provider.businessName | ||
: `${provider.lastName}, ${provider.firstName}`; | ||
}); | ||
return cloned; | ||
} | ||
} |
@@ -68,2 +68,5 @@ # Availity API's | ||
##### `normalize(providers)` | ||
Helper method that adds `name` field to the `providers` collection. The name field is computed from other properies of the provider object. | ||
### AvLogMessage | ||
@@ -70,0 +73,0 @@ Create a log message. |
@@ -62,2 +62,24 @@ import AvProviders from '../providers'; | ||
}); | ||
test('normalize() should add name atttribute to collection', () => { | ||
api = new AvProviders({ | ||
http: mockHttp, | ||
promise: Promise, | ||
merge: mockMerge, | ||
config: {}, | ||
}); | ||
const providers = api.normalize([ | ||
{ | ||
businessName: 'a', | ||
}, | ||
{ | ||
lastName: 'b', | ||
firstName: 'c', | ||
}, | ||
]); | ||
expect(providers[0].name).toBe('a'); | ||
expect(providers[1].name).toBe('b, c'); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
66954
2077