propertyIsEnumerable static method

bool propertyIsEnumerable(
  1. dynamic value,
  2. dynamic key
)

Implementation

static bool propertyIsEnumerable(dynamic value, dynamic key) {
  key = _normalizeProperty(key);
  if (value is Map) {
    if (!hasOwnProperty(value, key)) return false;
    return getOwnPropertyDescriptor(value, key)?.enumerable ?? true;
  }
  if (value is List) {
    key = _normalizeIndexProperty(key);
    return key is int &&
        key >= 0 &&
        key < value.length &&
        !isArrayHole(value[key]);
  }
  return false;
}