Returns whether the payload is a plain JavaScript object (excluding special classes or objects with other prototypes)

@param {*} payload
@returns {payload is {[key: string]: any}}
328107
function isPlainObject(payload) {
    if (getType(payload) !== 'Object')
        return false;
    return (payload.constructor === Object && Object.getPrototypeOf(payload) === Object.prototype);
}
387738
function updateState(data) {
  if (isObject(data)) {
    return {
      type: UpdateState,
      payload: data
    }
  } else {
    console.error('action updateState params must be a object')
  }
}
53682
function isString(value) {
    return typeof value == 'string' ||
      value && typeof value == 'object' && toString.call(value) == stringClass || false;
  }
752875
function objectHasType (node) {
      const typeProperty = node.properties
        .find(p =>
          utils.getStaticPropertyName(p.key) === 'type' &&
          (
            p.value.type !== 'ArrayExpression' ||
            p.value.elements.length > 0
          )
        )
      return Boolean(typeProperty)
    }
57963
function isJson(str) {
        try {
            var obj = JSON.parse(str);
            return this.isObject(obj);
        } catch (e) {/* ignore */}

        return false;
    }
1176302
function(payload) {
        if(!payload) {
          return {};
        }

        var data = payload[this.primaryRecordKey];
        if (data) {
          if (Ember.isArray(data)) {
            this.extractArrayData(data, payload);
          } else {
            this.extractSingleData(data, payload);
          }
          delete payload[this.primaryRecordKey];
        }
        if (payload.meta) {
          this.extractMeta(payload.meta);
          delete payload.meta;
        }
        if (payload.links) {
          // FIXME Need to handle top level links, like pagination
          delete payload.links;
        }
        if (payload[this.sideloadedRecordsKey]) {
          this.extractSideloaded(payload[this.sideloadedRecordsKey]);
          delete payload[this.sideloadedRecordsKey];
        }

        return payload;
      }
25077
function(obj) {
        try {
            if(isString(obj)) {
                var jsonStart = obj.trim().charAt(0);
                if(jsonStart === '{' || jsonStart === '[') {
                    return JSON.parse(obj);
                }
            }
            return false;
        } catch(e) {
            return false;
        }
    }
1281130
function _coerceObjectType(obj, objHint){
  if(objHint){
    switch(objHint){
      case 'string':
        //Response that comes back is application/octet-stream, which we will return raw
        return obj;
      case 'buffer':
        return Buffer.from(obj, 'utf8');
      case 'number':
        var num = Number(obj);
        if(isNaN(num)){
          throw new TypeError("'number was requested as a type, but result is NaN!");
        }
        return num;
      case 'array':
        try{
          var pObj = JSON.parse(obj);
          if(pObj[0] == undefined){
            //Is an object, not an array, so we will construct an array of just this object
            return new Array(pObj);
          }
          return pObj;
        }catch(ex){
          //If it fails, then it is likely a single string, lets coerce it to an array
          return new Array(obj);
        }
      case 'boolean':
        //Today's javascript fun-fact: 'false' is truthy!
        if(obj == 'false'){
          return false;
        }
        return Boolean(obj);
      case 'object':
         try{
          var pObj = JSON.parse(obj);
          return pObj;
        }catch(ex){
          //If it fails, then just throw back the object
          return obj;
        }
        break;
    }
  }else{
    return _bestGuessObject(obj);
  }
}
486644
def format_payload(self, api_version, data):
        
        # Check if payload is for API v1 or API v2.
        if (api_version in (1, 2)):
            # Check if string type.
            if type(data) == str:
                # Convert to dictionary.
                logger.debug('Converting string to dict:\n%s' % data)
                # Remove possible starting question mark & ending ampersands.
                data = data.lstrip('?')
                data = data.rstrip('&')
                # Convert to dictionary.
                data = parse_qs(data)
                logger.debug('Converted:\n%s' % str(data))
        elif api_version in ('am', 'was', 'am2'):
            if type(data) == etree._Element:
                logger.debug('Converting lxml.builder.E to string')
                data = etree.tostring(data)
                logger.debug('Converted:\n%s' % data)
        return data
582646
function isPrimitiveType (obj) {
  return ( typeof obj === 'boolean' ||
       typeof obj === 'number' ||
       typeof obj === 'string' ||
       obj === null ||
       util.isDate(obj) ||
       util.isArray(obj));
}
725990
def _convert(self, payload):
        
        if not isinstance(payload, six.string_types):
            payload = json.dumps(payload, cls=DefaultJSONEncoder, sort_keys=True)
        return str(payload)
558022
function typeOf(obj) {
        if (obj === undefined) {
            return 'undefined';
        }

        if (obj === null) {
            return 'null';
        }

        var t = Object.prototype.toString.call(obj).match(/\s([a-z|A-Z]+)/)[1].toLowerCase(),
            m;

        if (t !== 'object') {
            return t;
        }

        m = obj.constructor.toString().match(/^function\s*([$A-Z_][0-9A-Z_$]*)/i);
        if (m === null) {
            return 'object';
        }

        return m[1];
    }
68152
function isPlainObject(obj) {
    return (
        typeof obj === 'object' &&
        obj !== null &&
        obj.constructor === Object &&
        Object.prototype.toString.call(obj) === '[object Object]'
    );
}
1281810
function(obj) {
        if (obj === undefined) return "undefined";
        if (obj === null) return "null"
        switch (Object.prototype.toString.call(obj)) {
            case "[object Boolean]": return "boolean"
            case "[object Number]": return "number"
            case "[object String]": return "string"
            case "[object RegExp]": return "regexp"
            case "[object Date]": return "date"
            case "[object Array]": return "array"
            default: return typeof obj
        }
    }
513489
function (obj) {
            return vQ.isArray(obj) || !vQ.isFunction(obj) &&
                ( obj.length === 0 || typeof obj.length === 'number' && obj.length > 0 && ( obj.length - 1 ) in obj );
        }
776508
function parseAction ({ action, payload={}, error=false }) {
  switch (typeof action) {
    // If it's an action creator, create the action
    case 'function': return action(payload)
    // If it's an action object return the action
    case 'object': return action
    // Otherwise, create a "default" action object with the given type
    case 'string': return { type: action, payload, error }
    default: throw new Error('Invalid action definition (must be function, object or string).')
  }
}
1071355
function isJSON(body) {
  if (!body) return false;
  if ('string' == typeof body) return false;
  if ('function' == typeof body.pipe) return false;
  if (Buffer.isBuffer(body)) return false;
  return true;
}