index.sjs 241 B

1234567
  1. function isObj(x) {
  2. var type = typeof x;
  3. return x !== null && (type === 'object' || type === 'function');
  4. }
  5. module.exports = function (option, valueKey) {
  6. return isObj(option) && option[valueKey] != null ? option[valueKey] : option;
  7. };