static where(property, validator) {
    if (!(validator instanceof Monadidator))
      throw new TypeError('validator must be an instance of Monadidator');

    const _property = show(property);

    return new this((state, ok, err) => {
      const value =
        state.value === null || state.value === undefined
          ? undefined
          : state.value[property];

      const nerr = (_state) => {
        return err({
          ...state,
          map: state.map || _state.map,
          expected: _state.expected.prefix(`where ${_property} is`),
        });
      };

      const nok = (x, _state) => {
        return ok(x, {
          ...state,
          map: state.map || _state.map,
          expected: _state.expected.prefix(`where ${_property} is`),
        });
      };

      return validator.unValidate(
        {
          value,
          path: state.path.concat(property),
          expected: new Empty({path: state.path.concat(property)}),
        },
        nok,
        nerr
      );
    });
  }
/**
   * A function that returns a new validator that fully validates the sub-
   * property given by `property` using the given `validator, and fails
   * otherwise. Yields the validated sub-property.
   *
   * @ignore
   * @category static
   * @function where
   * @memberOf Monadidator
   * @static
   * @param {*} property
   * @param {Monadidator} validator
   * @return {Monadidator}
   */
A function that returns a new validator that fully validates the sub
property given by `property` using the given `validator, and fails
otherwise. Yields the validated sub-property.


A function that returns a new validator that fully validates the sub property given by ` property ` using the given ` validator and fails otherwise . Yields the validated sub - property .
static where(property, validator) {
    if (!(validator instanceof Monadidator))
      throw new TypeError('validator must be an instance of Monadidator');
    const _property = show(property);
    return new this((state, ok, err) => {
      const value =
        state.value === null || state.value === undefined
          ? undefined
          : state.value[property];
      const nerr = (_state) => {
        return err({
          ...state,
          map: state.map || _state.map,
          expected: _state.expected.prefix(`where ${_property} is`),
        });
      };
      const nok = (x, _state) => {
        return ok(x, {
          ...state,
          map: state.map || _state.map,
          expected: _state.expected.prefix(`where ${_property} is`),
        });
      };
      return validator.unValidate(
        {
          value,
          path: state.path.concat(property),
          expected: new Empty({path: state.path.concat(property)}),
        },
        nok,
        nerr
      );
    });
  }
static where ( property , validator ) { if ( ! ( validator instanceof Monadidator ) ) throw new TypeError ( 'validator must be an instance of Monadidator' ) ; const _property = show ( property ) ; return new this ( ( state , ok , err ) => { const value = state . value === null || state . value === undefined ? undefined : state . value [ property ] ; const nerr = ( _state ) => { return err ( { ... state , map : state . map || _state . map , expected : _state . expected . prefix ( ` ${ _property } ` ) , } ) ; } ; const nok = ( x , _state ) => { return ok ( x , { ... state , map : state . map || _state . map , expected : _state . expected . prefix ( ` ${ _property } ` ) , } ) ; } ; return validator . unValidate ( { value , path : state . path . concat ( property ) , expected : new Empty ( { path : state . path . concat ( property ) } ) , } , nok , nerr ) ; } ) ; }
A function that returns a new validator that fully validates the sub
 property given by `property` using the given `validator, and fails
 otherwise.
A function that returns a new validator that fully validates the sub property given by ` property ` using the given ` validator and fails otherwise .