Checks whether a property is on required array.
@param property - the property to check.
@param requiredArray - the required array
@returns {boolean}
778845
function isPropertyRequired(property, requiredArray) {
  var found = false;
  requiredArray = requiredArray || [];
  requiredArray.forEach(function(requiredProperty) {
      if (requiredProperty === property) {
        found = true;
      }
  });
  return found;
}
1347581
function validateComma(node, property) {
            const items = node[property],
                arrayLiteral = (node.type === "ArrayExpression" || node.type === "ArrayPattern");

            if (items.length > 1 || arrayLiteral) {

                // seed as opening [
                let previousItemToken = sourceCode.getFirstToken(node);

                items.forEach(item => {
                    const commaToken = item ? sourceCode.getTokenBefore(item) : previousItemToken,
                        currentItemToken = item ? sourceCode.getFirstToken(item) : sourceCode.getTokenAfter(commaToken),
                        reportItem = item || currentItemToken;

                    /*
                     * This works by comparing three token locations:
                     * - previousItemToken is the last token of the previous item
                     * - commaToken is the location of the comma before the current item
                     * - currentItemToken is the first token of the current item
                     *
                     * These values get switched around if item is undefined.
                     * previousItemToken will refer to the last token not belonging
                     * to the current item, which could be a comma or an opening
                     * square bracket. currentItemToken could be a comma.
                     *
                     * All comparisons are done based on these tokens directly, so
                     * they are always valid regardless of an undefined item.
                     */
                    if (astUtils.isCommaToken(commaToken)) {
                        validateCommaItemSpacing(previousItemToken, commaToken,
                            currentItemToken, reportItem);
                    }

                    if (item) {
                        const tokenAfterItem = sourceCode.getTokenAfter(item, astUtils.isNotClosingParenToken);

                        previousItemToken = tokenAfterItem
                            ? sourceCode.getTokenBefore(tokenAfterItem)
                            : sourceCode.ast.tokens[sourceCode.ast.tokens.length - 1];
                    }
                });

                /*
                 * Special case for array literals that have empty last items, such
                 * as [ 1, 2, ]. These arrays only have two items show up in the
                 * AST, so we need to look at the token to verify that there's no
                 * dangling comma.
                 */
                if (arrayLiteral) {

                    const lastToken = sourceCode.getLastToken(node),
                        nextToLastToken = sourceCode.getTokenBefore(lastToken);

                    if (astUtils.isCommaToken(nextToLastToken)) {
                        validateCommaItemSpacing(
                            sourceCode.getTokenBefore(nextToLastToken),
                            nextToLastToken,
                            lastToken,
                            lastToken
                        );
                    }
                }
            }
        }
317848
protected function has($property, ...$properties)
    {
        if (is_array($property)) {
            $properties = $property;
        } else {
            $properties[] = $property;
        }

        foreach ($properties as $property) {
            $property = $this->translateProperty($property);
            if (!isset($this->{$property})) {
                return false;
            }
        }

        return true;
    }
605213
public boolean hasMessageOf(String property) {
        assertArgumentNotNull("property", property);
        final UserMessageItem item = getPropertyItem(property);
        return item != null && !item.getMessageList().isEmpty();
    }
130955
function hasAllRequired( rule, element ) {
		if ( rule.nothingRequired )
			return true;

		var i, req, reqs, existing;

		if ( ( reqs = rule.requiredClasses ) ) {
			existing = element.classes;
			for ( i = 0; i < reqs.length; ++i ) {
				req = reqs[ i ];
				if ( typeof req == 'string' ) {
					if ( CKEDITOR.tools.indexOf( existing, req ) == -1 )
						return false;
				}
				// This means regexp.
				else {
					if ( !CKEDITOR.tools.checkIfAnyArrayItemMatches( existing, req ) )
						return false;
				}
			}
		}

		return hasAllRequiredInHash( element.styles, rule.requiredStyles ) &&
			hasAllRequiredInHash( element.attributes, rule.requiredAttributes );
	}
728889
public function __isset( $property )
    {
        // Check if property exists as a custom document property
        if ( array_key_exists( $property, $this->properties ) ||
             in_array( $property, self::$specialProperties ) )
        {
            return true;
        }

        // If none of the above checks passed, the request is invalid.
        return false;
    }
420444
private boolean isRequired(Field field) {
        return field.getAnnotation(Require.class) != null
                // Use the field's declaring class for RequireAll; may be a super class
                || (field.getDeclaringClass().getAnnotation(RequireAll.class) != null
                && field.getAnnotation(NotRequired.class) == null);
    }
612363
function validateArray(path, driver, arrayName) {
  const arr = driver[arrayName];
  if (!Array.isArray(arr)) {
    console.error(`${path} missing ${arrayName} array`);
    process.exit(1);
  }
}
327383
public function validateProperties(array $properties): bool
    {
        foreach ($properties as $property => $allowed) {
            $this->validateProperty($property, $allowed);
        }

        return true;
    }
481322
protected function validateProperty(string $property, bool $needed = false)
    {
        if (!property_exists($this, $property)) {
            throw new InvalidArgumentException("Property {$property} does not exist");
        }

        if ($needed && !isset($this->{$property})) {
            throw new LogicException("Property {$property} could not be calculated");
        }

        return $this;
    }
344391
function has(o, property) {
    if (arguments.length !== 2) {
      throw new Error('Expected two arguments to check.has, got only ' + arguments.length);
    }
    return Boolean(o && property &&
      typeof property === 'string' &&
      typeof o[property] !== 'undefined');
  }
676969
function getProperties( property ) {
    var properties = property[ PROPERTY_SYMBOL ];
    if ( !Array.isArray( properties ) ) return null;
    return properties;
}
1073832
function needRecurseArray(arr) {
  for (var i = 0; i < arr.length; i++) {
    var el = arr[i]
    if (typeof el !== 'number' && typeof el !== 'string' && el != null) return true
  }
  return false
}
1015558
private function loadValidatorAttribute(array &$property, AttributeItem $attribute)
    {
        /* @var $element Element */
        $type = $attribute->getType();

        $this->loadValidatorType($property, $type, false);

        // Required properties
        if ($attribute instanceof Attribute) {
            if ($attribute->getUse() === Attribute::USE_REQUIRED) {
                $property['validation'][] = [
                    'NotNull' => null
                ];
            }
        }
    }
271412
function mustBeNonEmptyArray(filter, keyword, field) {
  if (!Array.isArray(filter[field])) {
    return Bluebird.reject(new BadRequestError(`Attribute "${field}" in "${keyword}" must be an array`));
  }

  if (filter[field].length === 0) {
    return Bluebird.reject(new BadRequestError(`Attribute "${field}" in  "${keyword}" cannot be empty`));
  }

  return Bluebird.resolve();
}
360700
public function checkProperty(&$property)
    {
        if (is_string($property)) {
            $property = Placeholder::replaceStringsAndComments($property);
            $property = Placeholder::removeCommentPlaceholders($property, true);
            $property = Placeholder::replaceStringPlaceholders($property, true);

            return true;
        } else {
            throw new \InvalidArgumentException(
                "Invalid type '" . gettype($property). "' for argument 'property' given."
            );
        }
    }
1074653
function isRequired(target, reference, property) {
    // get the class constructor
    const constr = target.constructor;
    logger_1.log(`${constr.name}: checking if ${property} is required...`, "silly");
    // retrieve the current metadata
    const metadata = Reflect.getMetadata(METADATA_required, constr) || {};
    if (metadata.hasOwnProperty(property)) {
        const ret = metadata[property];
        if (typeof ret === "boolean")
            return ret;
        return ret(target, reference);
    }
    return false;
}