src/serializers/basic-query.js
function hydrateAndValue(value, prop, SchemaType, hydrateChild) {
	// The `SchemaType` is the type of value on `instances` of
	// the schema. `Instances` values are different from `Set` values.
	if (SchemaType) {
		// If there's a `SetType`, we will use that
		var SetType = SchemaType[setTypeSymbol];
		if (SetType) {
			/// If it exposes a hydrate, this means it can use the current hydrator to
			// hydrate its children.
			// I'm not sure why it's not taking the `unknown` hydrator instead.
			if (SetType.hydrate) {
				return SetType.hydrate(value, comparisonsConverter.hydrate);
			}
			// If the SetType implemented `union`, `intersection`, `difference`
			// We can create instances of it directly.
			else if (set.hasComparisons(SetType)) {
				// Todo ... canReflect.new
				return new SetType(value);
			}
			// If the SetType did not implement the comparison methods,
			// it's probably just a "Value" comparison type. We will hydrate
			// as a comparison converter, but create an instance of this `"Value"`
			// comparison type within the comparison converter.
			else {
				// inner types
				return comparisonsConverter.hydrate(value, function(value) {
					return new SetType(value);
				});
			}

		} else {
			// There is a `SchemaType`, but it doesn't have a `SetType`.
			// Can we create the SetType from the `SchemaType`?
			if (makeEnum.canMakeEnumSetType(SchemaType)) {
				if (!setTypeMap.has(SchemaType)) {
					setTypeMap.set(SchemaType, makeEnum.makeEnumSetType(SchemaType));
				}
				SetType = setTypeMap.get(SchemaType);
				return new SetType(value);
			}
			// It could also have a `ComparisonSetType` which are the values
			// within the Maybe type.
			else if (makeMaybe.canMakeMaybeSetType(SchemaType)) {
				if (!setTypeMap.has(SchemaType)) {
					setTypeMap.set(SchemaType, makeMaybe.makeMaybeSetTypes(SchemaType));
				}
				SetType = setTypeMap.get(SchemaType).Maybe;
				return SetType.hydrate(value, comparisonsConverter.hydrate);
			}
			// We can't create the `SetType`, so lets hydrate with the default behavior.
			else {
				return comparisonsConverter.hydrate(value, hydrateChild);
			}
		}
	} else {
		// HERE {$gt: 1} -> new is.GreaterThan(1)
		return comparisonsConverter.hydrate(value, hydrateChild);
	}
}
function hydrateAndValue(value, prop, SchemaType, hydrateChild) {
	// The `SchemaType` is the type of value on `instances` of
	// the schema. `Instances` values are different from `Set` values.
	if (SchemaType) {
		// If there's a `SetType`, we will use that
		var SetType = SchemaType[setTypeSymbol];
		if (SetType) {
			/// If it exposes a hydrate, this means it can use the current hydrator to
			// hydrate its children.
			// I'm not sure why it's not taking the `unknown` hydrator instead.
			if (SetType.hydrate) {
				return SetType.hydrate(value, comparisonsConverter.hydrate);
			}
			// If the SetType implemented `union`, `intersection`, `difference`
			// We can create instances of it directly.
			else if (set.hasComparisons(SetType)) {
				// Todo ... canReflect.new
				return new SetType(value);
			}
			// If the SetType did not implement the comparison methods,
			// it's probably just a "Value" comparison type. We will hydrate
			// as a comparison converter, but create an instance of this `"Value"`
			// comparison type within the comparison converter.
			else {
				// inner types
				return comparisonsConverter.hydrate(value, function(value) {
					return new SetType(value);
				});
			}

		} else {
			// There is a `SchemaType`, but it doesn't have a `SetType`.
			// Can we create the SetType from the `SchemaType`?
			if (makeEnum.canMakeEnumSetType(SchemaType)) {
				if (!setTypeMap.has(SchemaType)) {
					setTypeMap.set(SchemaType, makeEnum.makeEnumSetType(SchemaType));
				}
				SetType = setTypeMap.get(SchemaType);
				return new SetType(value);
			}
			// It could also have a `ComparisonSetType` which are the values
			// within the Maybe type.
			else if (makeMaybe.canMakeMaybeSetType(SchemaType)) {
				if (!setTypeMap.has(SchemaType)) {
					setTypeMap.set(SchemaType, makeMaybe.makeMaybeSetTypes(SchemaType));
				}
				SetType = setTypeMap.get(SchemaType).Maybe;
				return SetType.hydrate(value, comparisonsConverter.hydrate);
			}
			// We can't create the `SetType`, so lets hydrate with the default behavior.
			else {
				return comparisonsConverter.hydrate(value, hydrateChild);
			}
		}
	} else {
		// HERE {$gt: 1} -> new is.GreaterThan(1)
		return comparisonsConverter.hydrate(value, hydrateChild);
	}
}
function hydrateAndValue ( value , prop , SchemaType , hydrateChild ) { // The `SchemaType` is the type of value on `instances` of // the schema. `Instances` values are different from `Set` values. if ( SchemaType ) { // If there's a `SetType`, we will use that var SetType = SchemaType [ setTypeSymbol ] ; if ( SetType ) { /// If it exposes a hydrate, this means it can use the current hydrator to // hydrate its children. // I'm not sure why it's not taking the `unknown` hydrator instead. if ( SetType . hydrate ) { return SetType . hydrate ( value , comparisonsConverter . hydrate ) ; } // If the SetType implemented `union`, `intersection`, `difference` // We can create instances of it directly. else if ( set . hasComparisons ( SetType ) ) { // Todo ... canReflect.new return new SetType ( value ) ; } // If the SetType did not implement the comparison methods, // it's probably just a "Value" comparison type. We will hydrate // as a comparison converter, but create an instance of this `"Value"` // comparison type within the comparison converter. else { // inner types return comparisonsConverter . hydrate ( value , function ( value ) { return new SetType ( value ) ; } ) ; } } else { // There is a `SchemaType`, but it doesn't have a `SetType`. // Can we create the SetType from the `SchemaType`? if ( makeEnum . canMakeEnumSetType ( SchemaType ) ) { if ( ! setTypeMap . has ( SchemaType ) ) { setTypeMap . set ( SchemaType , makeEnum . makeEnumSetType ( SchemaType ) ) ; } SetType = setTypeMap . get ( SchemaType ) ; return new SetType ( value ) ; } // It could also have a `ComparisonSetType` which are the values // within the Maybe type. else if ( makeMaybe . canMakeMaybeSetType ( SchemaType ) ) { if ( ! setTypeMap . has ( SchemaType ) ) { setTypeMap . set ( SchemaType , makeMaybe . makeMaybeSetTypes ( SchemaType ) ) ; } SetType = setTypeMap . get ( SchemaType ) . Maybe ; return SetType . hydrate ( value , comparisonsConverter . hydrate ) ; } // We can't create the `SetType`, so lets hydrate with the default behavior. else { return comparisonsConverter . hydrate ( value , hydrateChild ) ; } } } else { // HERE {$gt: 1} -> new is.GreaterThan(1) return comparisonsConverter . hydrate ( value , hydrateChild ) ; } }
This is used to hydrate a value directly within a `filter`'s And.
This is used to hydrate a value directly within a filter s And .