How to use isobject - 8 common examples

To help you get started, we’ve selected a few isobject examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github lsm / alfa / src / store.js View on Github external
return function checkOutputAndSet(key, value, maps) {
      if (isobject(key)) {
        Object.keys(key).forEach(function(_key) {
          checkOutputAndSet(_key, key[_key], maps)
        })
        return
      }

      if (Array.isArray(outputs) && outputs.indexOf(key) === -1) {
        // Throw exception if the output key is not allowed.
        throw new Error(
          `Output key "${key}" is not allowed. You need to define it as an output when calling inject/subscribe.`
        )
      }

      if (maps && maps[key]) {
        key = maps[key]
      }
github jonschlinkert / is-plain-object / index.js View on Github external
function isObjectObject(o) {
  return isObject(o) === true
    && Object.prototype.toString.call(o) === '[object Object]';
}
github wtgtybhertgeghgtwtg / env-and-files / src / loadConfigSync.js View on Github external
export default function loadConfigSync(
  configMap: CMap,
): Config {
  assert(isobject(configMap), '"configMap" must be a ConfigMap object.');
  const errors = [];
  const result = objectMap(configMap, (group, groupName) => {
    assert(
      isobject(group),
      `"configMap.${groupName}" must be a ConfigGroup object.`,
    );
    return objectMap(group, (prop, propName) => {
      const {error, value} = loadPropertySync(prop, propName, groupName);
      if (error) {
        errors.push(error);
      }
      return value;
    });
  });
  if (errors.length > 0) {
    throw new ConfigError(errors);
github robinweser / fela / packages / fela-plugin-extend / src / index.js View on Github external
objectEach(style, (value, property) => {
    if (isPlainObject(value)) {
      style[property] = removeUndefined(value)
    } else if (Array.isArray(value)) {
      style[property] = value.filter(val => !isUndefinedValue(val))
    } else if (isUndefinedValue(value)) {
      delete style[property]
    }
  })
github actions / typescript-action / node_modules / is-plain-object / index.js View on Github external
function isObjectObject(o) {
  return isObject(o) === true
    && Object.prototype.toString.call(o) === '[object Object]';
}
github robinweser / fela / packages / fela-plugin-fallback-value / src / index.js View on Github external
function resolveFallbackValues(style: Object): Object {
  for (const property in style) {
    const value = style[property]

    if (Array.isArray(value)) {
      style[property] = resolveArrayValue(property, value)
    } else if (isPlainObject(value) && property !== 'fontFace') {
      style[property] = resolveFallbackValues(value)
    }
  }

  return style
}
github rpominov / react-demo / src / stringify.js View on Github external
function handleObject(x, next, seen, indent) {
  if (isObject(x)) {
    const keys = Object.keys(x)
    if (keys.length === 0) {
      return '{}'
    }
    seen.push(x)
    const joint = indent === '' ? ', ' : `,${indent}`
    const lastIndent = indent === '' ? '' : indent.replace(/\s\s$/, '')
    const body = keys.map(key => `${key}: ${next(x[key])}`).join(joint)
    const result = `{${indent}${body}${lastIndent}}`
    seen.pop()
    return result
  }
  return null
}
github robinweser / fela / packages / fela-plugin-embedded / src / index.js View on Github external
},
          []
        ).join(',')
      } else {
        style.fontFamily = renderFontFace(value, renderer)
      }
      delete style.fontFace
    } else if (property === 'animationName' && typeof value === 'object') {
      if (Array.isArray(value)) {
        style[property] = value
          .map(frame => renderer.renderKeyframe(() => frame), props)
          .join(',')
      } else {
        style[property] = renderer.renderKeyframe(() => value, props)
      }
    } else if (isPlainObject(value)) {
      embedded(value, type, renderer, props)
    }
  }

  return style
}

isobject

Returns true if the value is an object and not an array or null.

MIT
Latest version published 5 years ago

Package Health Score

71 / 100
Full package analysis

Popular isobject functions