@metreeca/blue - v0.12.0
    Preparing search index...

    Function property

    • Creates a member carrying a stated number of values.

      Reads the cardinality off the minCount and maxCount the constraints state, for the bounds the four named factories leave uncovered; a bound left unstated leaves that end unbounded. The bounds are carried by the range of the built property alone, not restated beside its other constraints.

      Type Parameters

      • R extends Lazy<Shape>

        The shape the values are drawn from

      • const C extends PropertyBounds = {}

        The stated constraints and cardinality bounds

      Parameters

      • range: R

        The shape the values are drawn from, possibly deferred to break definition cycles

      • Optionalconstraints: C

        Optional member constraints and bounds

      Returns NoInfer<{ inferred from <C> }> & PropertyConstraints<string> & {
          kind: "property";
          range: Range<R, { inferred L }, { inferred U }>;
      }

      An immutable member admitting the stated number of values of range

      • Readonlykind: "property"

        Discriminator identifying this as a member carrying values.

        Inheritance — cannot be overridden.

      • Readonlyrange: Range<R, { inferred L }, { inferred U }>

        Value set the property carries.

        States the shape every value is drawn from and how many of them a resource may carry. A path resolved through the property yields a Range of the same form, so the range a property states and the one a path reaches are read alike.

        Inheritance — child may only narrow the inherited range, bound by bound and shape by shape.

      TypeError Where a bound is stated as a negative number, or the bounds cross, admitting no value at all

      const Product = resource({
      tags: property(string(), { minCount: 2, maxCount: 5 })
      });