// AddArray adds an implementation of MarshalerJSONArray to be encoded.
481809
func (s *StreamEncoder) AddArray(v MarshalerJSONArray) {
	s.Encoder.writeByte('[')
	v.MarshalJSONArray(s.Encoder)
	s.Encoder.writeByte(']')
	s.Encoder.writeByte(s.delimiter)
}
781044
func (enc *Encoder) AddInterface(value interface{}) {
	switch vt := value.(type) {
	case string:
		enc.AddString(vt)
	case bool:
		enc.AddBool(vt)
	case MarshalerJSONArray:
		enc.AddArray(vt)
	case MarshalerJSONObject:
		enc.AddObject(vt)
	case int:
		enc.AddInt(vt)
	case int64:
		enc.AddInt(int(vt))
	case int32:
		enc.AddInt(int(vt))
	case int8:
		enc.AddInt(int(vt))
	case uint64:
		enc.AddUint64(vt)
	case uint32:
		enc.AddInt(int(vt))
	case uint16:
		enc.AddInt(int(vt))
	case uint8:
		enc.AddInt(int(vt))
	case float64:
		enc.AddFloat(vt)
	case float32:
		enc.AddFloat32(vt)
	default:
		if vt != nil {
			enc.err = InvalidMarshalError(fmt.Sprintf(invalidMarshalErrorMsg, vt))
			return
		}
		return
	}
}
786064
func (d *Drain) ProxyArray(ps ProxySet) []Proxy {
	v, err := ps.ProxyArray()
	d.put(err)
	return v
}
528405
func ToArray(value interface{}) (values []string) {
	switch value := value.(type) {
	case []string:
		values = []string{}
		for _, v := range value {
			if v != "" {
				values = append(values, v)
			}
		}
	case []interface{}:
		for _, v := range value {
			values = append(values, fmt.Sprint(v))
		}
	default:
		if value := fmt.Sprint(value); value != "" {
			values = []string{value}
		}
	}
	return
}
1249487
func (s _Set_I32_Zapper) MarshalLogArray(enc zapcore.ArrayEncoder) (err error) {
	for v := range s {
		enc.AppendInt32(v)
	}
	return err
}
1227031
func (af *aggFunction) MarshalJSON() ([]byte, error) {
	buffer := bytes.NewBufferString(fmt.Sprintf("\"%s\"", af))
	return buffer.Bytes(), nil
}
1018283
func (enc *Encoder) AddObjectKey(key string, v MarshalerJSONObject) {
	enc.ObjectKey(key, v)
}
785957
func (mmap MarshalMap) StringArray(key string) ([]string, error) {
	val, exists := mmap.Value(key)
	if !exists {
		return nil, fmt.Errorf(`"%s" is not set`, key)
	}

	return castToStringArray(key, val)
}
772351
func (j *Json) StringArray() ([]string, error) {
	arr, err := j.Array()
	if err != nil {
		return nil, err
	}
	retArr := make([]string, 0, len(arr))
	for _, a := range arr {
		if a == nil {
			retArr = append(retArr, "")
			continue
		}
		s, ok := a.(string)
		if !ok {
			return nil, err
		}
		retArr = append(retArr, s)
	}
	return retArr, nil
}
741488
func appendArray(b []byte, rv reflect.Value, n int) ([]byte, string, error) {
	var del string
	var err error

	b = append(b, '{')

	if b, del, err = appendArrayElement(b, rv.Index(0)); err != nil {
		return b, del, err
	}

	for i := 1; i < n; i++ {
		b = append(b, del...)
		if b, del, err = appendArrayElement(b, rv.Index(i)); err != nil {
			return b, del, err
		}
	}

	return append(b, '}'), del, nil
}
689484
func (d *Decoder) array() ([]interface{}, error) {
	// the '[' token already scanned
	d.pos++

	var (
		c     byte
		v     interface{}
		err   error
		array = make([]interface{}, 0)
	)

	// look ahead for ] - if the array is empty.
	if c = d.skipSpaces(); c == ']' {
		d.pos++
		goto out
	}

scan:
	if v, err = d.any(); err != nil {
		goto out
	}

	array = append(array, v)

	// next token must be ',' or ']'
	if c = d.skipSpaces(); c == ',' {
		d.pos++
		goto scan
	} else if c == ']' {
		d.pos++
	} else {
		err = d.error(c, "after array element")
	}

out:
	return array, err
}
217949
func (sd *structDef) buildArray() {
	sd.buildOneLine(convertToGoType(sd.T.Type.(string), ""))
}
1318653
func (em *eventMetadata) writeArray(name string, inType inType, outType outType, tags uint32) {
	em.writeFieldInner(name, inType|inTypeArray, outType, tags, 0)
}
1025630
func NewArrayBuffer(b []byte) *Object {
	slice := InternalObject(b)
	offset := slice.Get("$offset").Int()
	length := slice.Get("$length").Int()
	return slice.Get("$array").Get("buffer").Call("slice", offset, offset+length)
}
591294
func (g *Generator) Add(obj interface{}) {
	t := reflect.TypeOf(obj)
	if t.Kind() == reflect.Ptr {
		t = t.Elem()
	}
	g.addType(t)
	g.marshalers[t] = true
}
769369
func (b *TodoJSONBuilder) AddAll() *TodoJSONBuilder {
	b._properties["ID"] = b.ID
	b._properties["Text"] = b.Text
	b._properties["Done"] = b.Done
	b._properties["UpdatedAt"] = b.UpdatedAt
	b._properties["CreatedAt"] = b.CreatedAt
	return b
}
694944
func (m marshalerRegistry) add(mime string, marshaler Marshaler) error {
	if len(mime) == 0 {
		return errors.New("empty MIME type")
	}

	m.mimeMap[mime] = marshaler

	return nil
}