// Length returns a new Number object that may be used to inspect
// number of submatches.
//
// Example:
//  m := NewMatch(t, submatches, names)
//  m.Length().Equal(len(submatches))
966042
func (m *Match) Length() *Number {
	return &Number{m.chain, float64(len(m.submatches))}
}
1054071
func Length() (l int, err error) {
	if localStorage == nil || localStorage == js.Undefined {
		return 0, ErrLocalStorageNotSupported
	}
	defer func() {
		if r := recover(); r != nil {
			var ok bool
			err, ok = r.(error)
			if !ok {
				err = fmt.Errorf("could not use local storage: %v", r)
			}
			l = 0
		}
	}()

	length := localStorage.Get("length")
	return length.Int(), nil
}
635694
func (a Tags) Size() int {
	var total int
	for i := range a {
		total += a[i].Size()
	}
	return total
}
361006
func (f *MaxStreamDataFrame) Length(version protocol.VersionNumber) protocol.ByteCount {
	return 1 + utils.VarIntLen(uint64(f.StreamID)) + utils.VarIntLen(uint64(f.ByteOffset))
}
9805
func (g *MultiLineString) Length() float64 {
	return length2(g.flatCoords, 0, g.ends, g.stride)
}
106493
func (g *MultiPolygon) Length() float64 {
	return length3(g.flatCoords, 0, g.endss, g.stride)
}
749403
func (self line) size() (w, h int) {
	return AbsInt(self.P2.X - self.P1.X), AbsInt(self.P2.Y - self.P1.Y)
}
551600
func (m *Time) Size() (n int) {
	if m == nil || m.Time.IsZero() {
		return 0
	}
	return m.ProtoTime().Size()
}
74988
func (arguments Arguments) LengthNonIndexed() int {
	out := 0
	for _, arg := range arguments {
		if !arg.Indexed {
			out++
		}
	}
	return out
}
179447
func (d *document) Length(path string) int {
	n, err := valueAt(d.root, splitPath(path, d.separator))
	if err != nil {
		return -1
	}
	// Check if object or array.
	o, ok := isObject(n)
	if ok {
		return len(o)
	}
	a, ok := isArray(n)
	if ok {
		return len(a)
	}
	return 1
}
741666
func StringLength(str string, params ...string) bool {

	if len(params) == 2 {
		strLength := utf8.RuneCountInString(str)
		min, _ := ToInt(params[0])
		max, _ := ToInt(params[1])
		return strLength >= int(min) && strLength <= int(max)
	}

	return false
}
1296128
func (f *StopSendingFrame) Length(_ protocol.VersionNumber) protocol.ByteCount {
	return 1 + utils.VarIntLen(uint64(f.StreamID)) + 2
}
602852
func (a Algorithm) Size() int {
	h, ok := algorithms[a]
	if !ok {
		return 0
	}
	return h.Size()
}
1081394
func (s *SeriesCollection) Length() int {
	switch {
	case s.Points != nil:
		return len(s.Points)
	case s.Keys != nil:
		return len(s.Keys)
	case s.SeriesKeys != nil:
		return len(s.SeriesKeys)
	case s.Names != nil:
		return len(s.Names)
	case s.Tags != nil:
		return len(s.Tags)
	case s.Types != nil:
		return len(s.Types)
	case s.SeriesIDs != nil:
		return len(s.SeriesIDs)
	default:
		return 0
	}
}
1089671
func length(item interface{}) (int, error) {
	v, isNil := indirect(reflect.ValueOf(item))
	if isNil {
		return 0, fmt.Errorf("len of nil pointer")
	}
	switch v.Kind() {
	case reflect.Array, reflect.Chan, reflect.Map, reflect.Slice, reflect.String:
		return v.Len(), nil
	}
	return 0, fmt.Errorf("len of type %s", v.Type())
}
498280
func (bez *T) Length(t float64) float64 {
	return Length(&bez.P0, &bez.P1, &bez.P2, &bez.P3, t)
}
419956
func (q *MatchQuery) PrefixLength(length int) *MatchQuery {
	q.options["prefix_length"] = length
	return q
}