'use strict';

const getProps = (propList, ctx) => {
  // set context
  if (!ctx)
    ctx = undefined;
  const propObj = {};
  propList.forEach(prop => {
    if (ctx[prop] !== undefined) {
      propObj[prop] = ctx[prop];
    }
  });
  return propObj;
};

exports.getProps = getProps;
