Can determine if a microformat key with value exists in $mf. Returns true if so.

@param array     $mfs
@param $propname
@param $propvalue
@param bool      $flatten
@return mixed
@see findMicroformatsByCallable()
15061
public static function find_microformats_by_property( array $mfs, $propname, $propvalue, $flatten = true ) {
		return find_microformats_by_callable(
			$mfs,
			function ( $mf ) use ( $propname, $propvalue ) {
				if ( ! hasProp( $mf, $propname ) ) {
					return false; }

				if ( in_array( $propvalue, $mf['properties'][ $propname ], true ) ) {
					return true; }

				return false;
			},
			$flatten
		);
	}
1135615
function propHasDefault (prop) {
      const propDefaultNode = prop.value.properties
        .find(p => p.key && p.key.name === 'default')

      return Boolean(propDefaultNode)
    }
1277164
public static function parse_html_value( $mf, $property ) {
		if ( ! array_key_exists( $property, $mf['properties'] ) ) {
			return null;
		}
		$textcontent = false;
		$htmlcontent = false;
		$content     = $mf['properties'][ $property ][0];
		if ( is_string( $content ) ) {
			$textcontent = $content;
		} elseif ( ! is_string( $content ) && is_array( $content ) && array_key_exists( 'value', $content ) ) {
			if ( array_key_exists( 'html', $content ) ) {
				$htmlcontent = trim( wp_kses_post( $content['html'] ) );
				$textcontent = trim( str_replace( '&#xD;', "\r", $content['value'] ) );
			} else {
				$textcontent = trim( $content['value'] );
			}
		}
		$data = array(
			'text' => $textcontent,
		);
		if ( $htmlcontent && $textcontent !== $htmlcontent ) {
			$data['html'] = $htmlcontent;
		}
		return $data;
	}
675091
function has ($propName)
  {
    return $this->defines ($propName) ? exists ($this->get ($propName)) : false;
  }
1217876
public function getFormValue(string $name, $default = null, string $separator = null)
    {
        if ($name === 'storage_key') {
            return $this->getStorageKey();
        }
        if ($name === 'storage_timestamp') {
            return $this->getTimestamp();
        }

        return $this->getNestedProperty($name, $default, $separator);
    }
1099967
protected function checkModuleArgument($paramValue)
    {
        if (!preg_match('#^([a-z0-9]+):([\+-]?[0-9]+|up|down)$#i', $paramValue, $matches)) {
            throw new \InvalidArgumentException(
                'Arguments must be in format moduleName:[+|-]position where position is an integer or up or down.'
            );
        }

        $this->moduleQuery->clear();
        $module = $this->moduleQuery->findOneByCode($matches[1]);
        if ($module === null) {
            throw new \RuntimeException(sprintf('%s module does not exists. Try to refresh first.', $matches[1]));
        }

        $this->modulesList[] = $matches[1];
        $this->positionsList[] = $matches[2];
    }
1235688
public function resolveReverseProperty(Model $source, $propName)
    {
        if (!is_string($propName)) {
            throw new InvalidOperationException('Property name must be string');
        }
        $entity = $this->getObjectMap()->resolveEntity(get_class($source));
        if (null === $entity) {
            $msg = 'Source model not defined';
            throw new \InvalidArgumentException($msg);
        }
        $association = $entity->resolveAssociation($propName);

        if (null === $association) {
            return null;
        }
        $isFirst = $propName === $association->getFirst()->getRelationName();
        if (!$isFirst) {
            return $association->getFirst()->getRelationName();
        }

        if (!$association instanceof AssociationMonomorphic) {
            throw new InvalidOperationException('');
        }
        return $association->getLast()->getRelationName();
    }
995237
private function flattenKey($storageName, $key)
    {
        $finalKey = $storageName . '-';

        if (is_string($key)) {
            return $finalKey . $key;
        }

        if (! is_array($key)) {
            throw new \InvalidArgumentException('The key should be a string or a flat array.');
        }

        foreach ($key as $property => $value) {
            $finalKey .= sprintf('%s:%s-', $property, $value);
        }

        return $finalKey;
    }
1288169
function formatProp(obj) {
		
		var out      = {};
		var props    = _.get(obj, 'propSet');
		var moRef    = _.has(obj, 'obj') ? util.moRef(obj.obj) : util.moRef(obj);
		out.id       = moRef.id;
		out.type     = moRef.type;

		// loop through the propSet
		if (Array.isArray(props)) {
			_.forEach(props, function(prop) {
				out[prop.name] = formatValue(prop.val);
			});
		}
		else if (_.has(props, 'name')) {
			out[props.name] = formatValue(props.val);
		}

		return out;
	}
188488
private function flattenArray(array $arrayToFlatten, $separator = '.', $flattenedKey = '')
    {
        $flattenedArray = [];
        foreach ($arrayToFlatten as $key => $value) {
            $tmpFlattendKey = (!empty($flattenedKey) ? $flattenedKey . $separator : '') . $key;
            // only append next value if is array and is an associative array
            if (is_array($value) && array_keys($value) !== range(0, count($value) - 1)) {
                $flattenedArray = array_merge(
                    $flattenedArray,
                    $this->flattenArray(
                        $value,
                        $separator,
                        $tmpFlattendKey
                    )
                );
            } else {
                $flattenedArray[$tmpFlattendKey] = $value;
            }
        }
        return $flattenedArray;
    }
883106
function ensurePropertyExists ($propName)
  {
    if (!$this->defines ($propName)) {
      throw new ComponentException(
        $this->component,
        sprintf ("Invalid property <kbd>%s</kbd> specified for a %s instance.", $propName, Debug::typeInfoOf ($this))
      );
    }
  }
315129
function getComputed ($propName, $default = null)
  {
    $v = $this->component->getComputedPropValue ($propName);
    return exists ($v) ? $v : $default;
  }
892473
public function getDevicesByProperty($propertyName, $propertyValue, $caseSensitive=true)
    {

        if ($caseSensitive) {
            $caseSensitive = "";
        }
        else {
            $caseSensitive = "i";
        }

        $devices = $this->getDevices();

        $matchedDevices = [];

        foreach ($devices->device as $device) {

            if (preg_match("/{$propertyValue}/{$caseSensitive}", $device->{$propertyName})) {

                $matchedDevices[] = $device;

            }

        }

        return $matchedDevices;

    }
207983
function getSubjectDNProp($propName, $withType = false)
    {
        switch (true) {
            case !empty($this->dn):
                return $this->getDNProp($propName, NULL, $withType);
            case !isset($this->currentCert) || !is_array($this->currentCert):
                break;
            case isset($this->currentCert['tbsCertificate']):
                return $this->getDNProp($propName, $this->currentCert['tbsCertificate']['subject'], $withType);
            case isset($this->currentCert['certificationRequestInfo']):
                return $this->getDNProp($propname, $this->currentCert['certificationRequestInfo']['subject'], $withType);
        }

        return false;
    }
1135014
public function getFormValue(string $name, $default = null, string $separator = null)
    {
        $value = parent::getFormValue($name, null, $separator);

        if ($name === 'avatar') {
            return $this->parseFileProperty($value);
        }

        if (null === $value) {
            if ($name === 'media_order') {
                return implode(',', $this->getMediaOrder());
            }
        }

        return $value ?? $default;
    }
1137818
public function get( $key = null, $single = true ) {
		if ( 'mf2' === $key ) {
			return $this->mf2;
		}
		if ( null === $key ) {
			$vars = get_object_vars( $this );
			unset( $vars['mf2'] );
			$vars = array_filter( $vars );
			foreach ( $vars as $prop => $value ) {
				$vars[ $prop ] = array( $value );
			}
			$properties = array_merge( $vars, $this->mf2 );
			$properties = array_filter( $properties );
			if ( isset( $properties['type'] ) ) {
				$type = $properties['type'];
				unset( $properties['type'] );
			} else {
				$type = array( 'h-entry' );
			}
			$return = array(
				'type'       => $type,
				'properties' => $properties,
			);
			if ( $single ) {
				$return = mf2_to_jf2( $return );
			}
			return $return;
		}
		$properties = array_keys( get_object_vars( $this ) );
		unset( $properties['mf2'] );
		if ( in_array( $key, $properties, true ) ) {
			$return = $this->$key;
		} else {
			if ( ! isset( $this->mf2[ $key ] ) ) {
				return false;
			}
			$return = $this->mf2[ $key ];
		}
		if ( empty( $return ) ) {
			return false;
		}
		if ( is_array( $return ) ) {
			return $single ? $this->single_array( $return ) : $return;
		}
		if ( is_string( $return ) ) {
			return $single ? $return : array( $return );
		}
	}
44195
private function isRestoreProperty($propertyName, $contentPrefix, $systemPrefix)
    {
        // return all localized and non-translatable properties
        // non-translatable properties can be recognized by their missing namespace, therfore the check for the colon
        if (0 === strpos($propertyName, $contentPrefix)
            || 0 === strpos($propertyName, $systemPrefix)
            || false === strpos($propertyName, ':')
        ) {
            return true;
        }

        return false;
    }