Browse Source

removed level of indirection

pull/1002/head
Stephen Hess 7 years ago
parent
commit
0548192b6e
  1. 12
      helper/geojsonify_place_details.js

12
helper/geojsonify_place_details.js

@ -57,9 +57,9 @@ function checkCategoryParam(params) {
* @param {object} src * @param {object} src
* @param {object} dst * @param {object} dst
*/ */
function addDetails(params, src, dst) { // function addDetails(params, src, dst) {
copyProperties(params, src, DETAILS_PROPS, dst); // copyProperties(params, src, DETAILS_PROPS, dst);
} // }
/** /**
* Copy specified properties from source to dest. * Copy specified properties from source to dest.
@ -70,8 +70,8 @@ function addDetails(params, src, dst) {
* @param {[]} props * @param {[]} props
* @param {object} dst * @param {object} dst
*/ */
function copyProperties( params, source, props, dst ) { function copyProperties( params, source, dst ) {
props.forEach( function ( prop ) { DETAILS_PROPS.forEach( function ( prop ) {
// if condition isn't met, just return without setting the property // if condition isn't met, just return without setting the property
if (_.isFunction(prop.condition) && !prop.condition(params)) { if (_.isFunction(prop.condition) && !prop.condition(params)) {
@ -137,4 +137,4 @@ function getArrayValue(property) {
return [property]; return [property];
} }
module.exports = addDetails; module.exports = copyProperties;

Loading…
Cancel
Save