@becollective/utils 1.5.1 → 1.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle.js +18 -1
- package/index.js +2 -0
- package/package.json +1 -1
package/bundle.js
CHANGED
|
@@ -172,6 +172,22 @@ var getTimeInfo = function getTimeInfo(opportunityUser) {
|
|
|
172
172
|
return fields;
|
|
173
173
|
};
|
|
174
174
|
|
|
175
|
+
/**
|
|
176
|
+
*
|
|
177
|
+
* @param {Array} locationList
|
|
178
|
+
*/
|
|
179
|
+
var getHomeLocalityFromLocationList = function getHomeLocalityFromLocationList(locationList) {
|
|
180
|
+
var homeLocation = Array.isArray(locationList) && locationList.find(function (location) {
|
|
181
|
+
return location.name === 'Home';
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
if (homeLocation && homeLocation.locality && homeLocation.locality.long) {
|
|
185
|
+
return homeLocation.locality.long;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
return null;
|
|
189
|
+
};
|
|
190
|
+
|
|
175
191
|
var util = {
|
|
176
192
|
getAge: getAge,
|
|
177
193
|
getCurrencyFromCurrencyCode: getCurrencyFromCurrencyCode,
|
|
@@ -182,6 +198,7 @@ var util = {
|
|
|
182
198
|
datesByThemselves: datesByThemselves
|
|
183
199
|
},
|
|
184
200
|
readableOpportunityType: readableOpportunityType,
|
|
185
|
-
getTimeInfo: getTimeInfo
|
|
201
|
+
getTimeInfo: getTimeInfo,
|
|
202
|
+
getHomeLocalityFromLocationList: getHomeLocalityFromLocationList
|
|
186
203
|
};
|
|
187
204
|
module.exports = util;
|
package/index.js
CHANGED
|
@@ -3,6 +3,7 @@ import { isUnderSixteen, getAge, datesByThemselves } from './src/date-time';
|
|
|
3
3
|
import { getCurrencyFromCurrencyCode, makeMoneyString } from './src/money';
|
|
4
4
|
import { readableOpportunityType } from './src/opportunity';
|
|
5
5
|
import { getTimeInfo } from './src/opportunityUser';
|
|
6
|
+
import { getHomeLocalityFromLocationList } from './src/locality';
|
|
6
7
|
|
|
7
8
|
const util = {
|
|
8
9
|
getAge,
|
|
@@ -15,6 +16,7 @@ const util = {
|
|
|
15
16
|
},
|
|
16
17
|
readableOpportunityType,
|
|
17
18
|
getTimeInfo,
|
|
19
|
+
getHomeLocalityFromLocationList,
|
|
18
20
|
};
|
|
19
21
|
|
|
20
22
|
module.exports = util;
|