+ * The representation is used to verify nested used properties.
+ * @param {ASTNode} node
+ * @return {string | undefined}
+ */
+ function getLeftMostTypeName(node) {
+ if (node.name) return node.name;
+ if (node.left) return getLeftMostTypeName(node.left);
+ }
+
+ function getRightMostTypeName(node) {
+ if (node.name) return node.name;
+ if (node.right) return getRightMostTypeName(node.right);
+ }
+
+ /**
+ * Returns true if the node is either a interface or type alias declaration
+ * @param {ASTNode} node
+ * @return {boolean}
+ */
+ function filterInterfaceOrTypeAlias(node) {
+ return (
+ astUtil.isTSInterfaceDeclaration(node) || astUtil.isTSTypeAliasDeclaration(node)
+ );
+ }
+
+ /**
+ * Returns true if the interface or type alias declaration node name matches the type-name str
+ * @param {ASTNode} node
+ * @param {string} typeName
+ * @return {boolean}
+ */
+ function filterInterfaceOrAliasByName(node, typeName) {
+ return (
+ node.id
+ && node.id.name === typeName
+ ) || (
+ node.declaration
+ && node.declaration.id
+ && node.declaration.id.name === typeName
+ );
+ }
+
+ class DeclarePropTypesForTSTypeAnnotation {
+ constructor(propTypes, declaredPropTypes, rootNode) {
+ this.propTypes = propTypes;
+ this.declaredPropTypes = declaredPropTypes;
+ this.foundDeclaredPropertiesList = [];
+ this.referenceNameMap = new Set();
+ this.sourceCode = getSourceCode(context);
+ this.shouldIgnorePropTypes = false;
+ this.rootNode = rootNode;
+ this.visitTSNode(this.propTypes);
+ this.endAndStructDeclaredPropTypes();
+ }
+
+ /**
+ * The node will be distribute to different function.
+ * @param {ASTNode} node
+ */
+ visitTSNode(node) {
+ if (!node) return;
+ if (astUtil.isTSTypeAnnotation(node)) {
+ const typeAnnotation = node.typeAnnotation;
+ this.visitTSNode(typeAnnotation);
+ } else if (astUtil.isTSTypeReference(node)) {
+ this.searchDeclarationByName(node);
+ } else if (astUtil.isTSInterfaceHeritage(node)) {
+ this.searchDeclarationByName(node);
+ } else if (astUtil.isTSTypeLiteral(node)) {
+ // Check node is an object literal
+ if (Array.isArray(node.members)) {
+ this.foundDeclaredPropertiesList = this.foundDeclaredPropertiesList.concat(node.members);
+ }
+ } else if (astUtil.isTSIntersectionType(node)) {
+ this.convertIntersectionTypeToPropTypes(node);
+ } else if (astUtil.isTSParenthesizedType(node)) {
+ const typeAnnotation = node.typeAnnotation;
+ this.visitTSNode(typeAnnotation);
+ } else if (astUtil.isTSTypeParameterInstantiation(node)) {
+ if (Array.isArray(node.params)) {
+ node.params.forEach((x) => this.visitTSNode(x));
+ }
+ } else {
+ this.shouldIgnorePropTypes = true;
+ }
+ }
+
+ /**
+ * Search TSInterfaceDeclaration or TSTypeAliasDeclaration,
+ * by using TSTypeReference and TSInterfaceHeritage name.
+ * @param {ASTNode} node
+ */
+ searchDeclarationByName(node) {
+ let typeName;
+ if (astUtil.isTSTypeReference(node)) {
+ typeName = node.typeName.name;
+ const leftMostName = getLeftMostTypeName(node.typeName);
+ const shouldTraverseTypeParams = genericReactTypesImport.has(leftMostName);
+ const nodeTypeArguments = propsUtil.getTypeArguments(node);
+ if (shouldTraverseTypeParams && nodeTypeArguments && nodeTypeArguments.length !== 0) {
+ // All react Generic types are derived from:
+ // type PropsWithChildren = P & { children?: ReactNode | undefined }
+ // So we should construct an optional children prop
+ this.shouldSpecifyOptionalChildrenProps = true;
+
+ const rightMostName = getRightMostTypeName(node.typeName);
+ if (
+ leftMostName === 'React'
+ && (
+ rightMostName === 'HTMLAttributes'
+ || rightMostName === 'HTMLElement'
+ || rightMostName === 'HTMLProps'
+ )
+ ) {
+ this.shouldSpecifyClassNameProp = true;
+ }
+
+ const importedName = localToImportedMap[rightMostName];
+ const idx = genericTypeParamIndexWherePropsArePresent[
+ leftMostName !== rightMostName ? rightMostName : importedName
+ ];
+ const nextNode = nodeTypeArguments.params[idx];
+ this.visitTSNode(nextNode);
+ return;
+ }
+ } else if (astUtil.isTSInterfaceHeritage(node)) {
+ if (!node.expression && node.id) {
+ typeName = node.id.name;
+ } else {
+ typeName = node.expression.name;
+ }
+ }
+ if (!typeName) {
+ this.shouldIgnorePropTypes = true;
+ return;
+ }
+ if (typeName === 'ReturnType') {
+ this.convertReturnTypeToPropTypes(node, this.rootNode);
+ return;
+ }
+ // Prevent recursive inheritance will cause maximum callstack.
+ if (this.referenceNameMap.has(typeName)) {
+ this.shouldIgnorePropTypes = true;
+ return;
+ }
+ // Add typeName to Set and consider it as traversed.
+ this.referenceNameMap.add(typeName);
+
+ /**
+ * From line 577 to line 581, and line 588 to line 590 are trying to handle typescript-eslint-parser
+ * Need to be deprecated after remove typescript-eslint-parser support.
+ */
+ const candidateTypes = this.sourceCode.ast.body.filter((item) => astUtil.isTSTypeDeclaration(item));
+
+ const declarations = flatMap(
+ candidateTypes,
+ (type) => (
+ type.declarations
+ || (
+ type.declaration
+ && type.declaration.declarations
+ )
+ || type.declaration
+ )
+ );
+
+ // we tried to find either an interface or a type with the TypeReference name
+ const typeDeclaration = declarations.filter((dec) => dec.id.name === typeName);
+
+ const interfaceDeclarations = this.sourceCode.ast.body
+ .filter(filterInterfaceOrTypeAlias)
+ .filter((item) => filterInterfaceOrAliasByName(item, typeName))
+ .map((item) => (item.declaration || item));
+
+ if (typeDeclaration.length !== 0) {
+ typeDeclaration.map((t) => t.init || t.typeAnnotation).forEach(this.visitTSNode, this);
+ } else if (interfaceDeclarations.length !== 0) {
+ interfaceDeclarations.forEach(this.traverseDeclaredInterfaceOrTypeAlias, this);
+ } else {
+ this.shouldIgnorePropTypes = true;
+ }
+ }
+
+ /**
+ * Traverse TSInterfaceDeclaration and TSTypeAliasDeclaration
+ * which retrieve from function searchDeclarationByName;
+ * @param {ASTNode} node
+ */
+ traverseDeclaredInterfaceOrTypeAlias(node) {
+ if (astUtil.isTSInterfaceDeclaration(node)) {
+ // Handle TSInterfaceDeclaration interface Props { name: string, id: number}, should put in properties list directly;
+ this.foundDeclaredPropertiesList = this.foundDeclaredPropertiesList.concat(node.body.body);
+ }
+ // Handle TSTypeAliasDeclaration type Props = {name:string}
+ if (astUtil.isTSTypeAliasDeclaration(node)) {
+ const typeAnnotation = node.typeAnnotation;
+ this.visitTSNode(typeAnnotation);
+ }
+ if (Array.isArray(node.extends)) {
+ node.extends.forEach((x) => this.visitTSNode(x));
+ // This line is trying to handle typescript-eslint-parser
+ // typescript-eslint-parser extension is name as heritage
+ } else if (Array.isArray(node.heritage)) {
+ node.heritage.forEach((x) => this.visitTSNode(x));
+ }
+ }
+
+ convertIntersectionTypeToPropTypes(node) {
+ if (!node) return;
+ if (Array.isArray(node.types)) {
+ node.types.forEach((x) => this.visitTSNode(x));
+ } else {
+ this.shouldIgnorePropTypes = true;
+ }
+ }
+
+ convertReturnTypeToPropTypes(node, rootNode) {
+ // ReturnType should always have one parameter
+ const nodeTypeArguments = propsUtil.getTypeArguments(node);
+ if (nodeTypeArguments) {
+ if (nodeTypeArguments.params.length === 1) {
+ let returnType = nodeTypeArguments.params[0];
+ // This line is trying to handle typescript-eslint-parser
+ // typescript-eslint-parser TSTypeQuery is wrapped by TSTypeReference
+ if (astUtil.isTSTypeReference(returnType)) {
+ returnType = returnType.typeName;
+ }
+ // Handle ReturnType
+ if (astUtil.isTSTypeQuery(returnType)) {
+ const returnTypeFunction = flatMap(this.sourceCode.ast.body
+ .filter((item) => item.type === 'VariableDeclaration'
+ && item.declarations.find((dec) => dec.id.name === returnType.exprName.name)
+ ), (type) => type.declarations).map((dec) => dec.init);
+
+ if (Array.isArray(returnTypeFunction)) {
+ if (returnTypeFunction.length === 0) {
+ // Cannot find identifier in current scope. It might be an exported type.
+ this.shouldIgnorePropTypes = true;
+ return;
+ }
+ returnTypeFunction.forEach((func) => {
+ if (isFunctionType(func)) {
+ let res = func.body;
+ if (res.type === 'BlockStatement') {
+ res = astUtil.findReturnStatement(func);
+ if (res) {
+ res = res.argument;
+ }
+ }
+ switch (res.type) {
+ case 'ObjectExpression':
+ iterateProperties(context, res.properties, (key, value, propNode) => {
+ if (propNode && astUtil.isCallExpression(propNode.argument)) {
+ const propNodeTypeArguments = propsUtil.getTypeArguments(propNode.argument);
+ if (propNodeTypeArguments) {
+ this.visitTSNode(propNodeTypeArguments);
+ } else {
+ // Ignore this CallExpression return value since it doesn't have any typeParameters to let us know it's types.
+ this.shouldIgnorePropTypes = true;
+ return;
+ }
+ }
+ if (!value) {
+ this.shouldIgnorePropTypes = true;
+ return;
+ }
+ const types = buildReactDeclarationTypes(value, key, rootNode);
+ types.fullName = key;
+ types.name = key;
+ types.node = propNode;
+ types.isRequired = propsUtil.isRequiredPropType(value);
+ this.declaredPropTypes[key] = types;
+ });
+ break;
+ case 'CallExpression':
+ if (propsUtil.getTypeArguments(res)) {
+ this.visitTSNode(propsUtil.getTypeArguments(res));
+ } else {
+ // Ignore this CallExpression return value since it doesn't have any typeParameters to let us know it's types.
+ this.shouldIgnorePropTypes = true;
+ }
+ break;
+ default:
+ }
+ }
+ });
+ return;
+ }
+ }
+ // Handle ReturnType<()=>returnType>
+ if (astUtil.isTSFunctionType(returnType)) {
+ if (astUtil.isTSTypeAnnotation(returnType.returnType)) {
+ this.visitTSNode(returnType.returnType);
+ return;
+ }
+ // This line is trying to handle typescript-eslint-parser
+ // typescript-eslint-parser TSFunction name returnType as typeAnnotation
+ if (astUtil.isTSTypeAnnotation(returnType.typeAnnotation)) {
+ this.visitTSNode(returnType.typeAnnotation);
+ return;
+ }
+ }
+ }
+ }
+ this.shouldIgnorePropTypes = true;
+ }
+
+ endAndStructDeclaredPropTypes() {
+ if (this.shouldSpecifyOptionalChildrenProps) {
+ this.declaredPropTypes.children = {
+ fullName: 'children',
+ name: 'children',
+ isRequired: false,
+ };
+ }
+ if (this.shouldSpecifyClassNameProp) {
+ this.declaredPropTypes.className = {
+ fullName: 'className',
+ name: 'className',
+ isRequired: false,
+ };
+ }
+
+ this.foundDeclaredPropertiesList.forEach((tsInterfaceBody) => {
+ if (tsInterfaceBody && (tsInterfaceBody.type === 'TSPropertySignature' || tsInterfaceBody.type === 'TSMethodSignature')) {
+ let accessor = 'name';
+ if (tsInterfaceBody.key.type === 'Literal') {
+ if (typeof tsInterfaceBody.key.value === 'number') {
+ accessor = 'raw';
+ } else {
+ accessor = 'value';
+ }
+ }
+ this.declaredPropTypes[tsInterfaceBody.key[accessor]] = {
+ fullName: tsInterfaceBody.key[accessor],
+ name: tsInterfaceBody.key[accessor],
+ node: tsInterfaceBody,
+ isRequired: !tsInterfaceBody.optional,
+ };
+ }
+ });
+ }
+ }
+
+ /**
+ * Mark a prop type as declared
+ * @param {ASTNode} node The AST node being checked.
+ * @param {ASTNode} propTypes The AST node containing the proptypes
+ * @param {ASTNode} rootNode
+ */
+ function markPropTypesAsDeclared(node, propTypes, rootNode) {
+ let componentNode = node;
+ while (componentNode && !components.get(componentNode)) {
+ componentNode = componentNode.parent;
+ }
+ const component = components.get(componentNode);
+ let declaredPropTypes = (component && component.declaredPropTypes) || {};
+ let ignorePropsValidation = (component && component.ignorePropsValidation) || false;
+ switch (propTypes && propTypes.type) {
+ case 'ObjectTypeAnnotation':
+ ignorePropsValidation = declarePropTypesForObjectTypeAnnotation(propTypes, declaredPropTypes);
+ break;
+ case 'ObjectExpression':
+ iterateProperties(context, propTypes.properties, (key, value, propNode) => {
+ if (!value) {
+ ignorePropsValidation = true;
+ return;
+ }
+ const types = buildReactDeclarationTypes(value, key, rootNode);
+ types.fullName = key;
+ types.name = key;
+ types.node = propNode;
+ types.isRequired = propsUtil.isRequiredPropType(value);
+ declaredPropTypes[key] = types;
+ });
+ break;
+ case 'MemberExpression': {
+ let curDeclaredPropTypes = declaredPropTypes;
+ // Walk the list of properties, until we reach the assignment
+ // ie: ClassX.propTypes.a.b.c = ...
+ while (
+ propTypes
+ && propTypes.parent
+ && propTypes.parent.type !== 'AssignmentExpression'
+ && propTypes.property
+ && curDeclaredPropTypes
+ ) {
+ const propName = propTypes.property.name;
+ if (propName in curDeclaredPropTypes) {
+ curDeclaredPropTypes = curDeclaredPropTypes[propName].children;
+ propTypes = propTypes.parent;
+ } else {
+ // This will crash at runtime because we haven't seen this key before
+ // stop this and do not declare it
+ propTypes = null;
+ }
+ }
+ if (propTypes && propTypes.parent && propTypes.property) {
+ if (!(propTypes === propTypes.parent.left && propTypes.parent.left.object)) {
+ ignorePropsValidation = true;
+ break;
+ }
+ const parentProp = getText(context, propTypes.parent.left.object).replace(/^.*\.propTypes\./, '');
+ const types = buildReactDeclarationTypes(
+ propTypes.parent.right,
+ parentProp,
+ rootNode
+ );
+
+ types.name = propTypes.property.name;
+ types.fullName = [parentProp, propTypes.property.name].join('.');
+ types.node = propTypes.parent;
+ types.isRequired = propsUtil.isRequiredPropType(propTypes.parent.right);
+ curDeclaredPropTypes[propTypes.property.name] = types;
+ } else {
+ let isUsedInPropTypes = false;
+ let n = propTypes;
+ while (n) {
+ if (((n.type === 'AssignmentExpression') && propsUtil.isPropTypesDeclaration(n.left))
+ || ((n.type === 'ClassProperty' || n.type === 'PropertyDefinition' || n.type === 'Property') && propsUtil.isPropTypesDeclaration(n))) {
+ // Found a propType used inside of another propType. This is not considered usage, we'll still validate
+ // this component.
+ isUsedInPropTypes = true;
+ break;
+ }
+ n = n.parent;
+ }
+ if (!isUsedInPropTypes) {
+ ignorePropsValidation = true;
+ }
+ }
+ break;
+ }
+ case 'Identifier': {
+ const firstMatchingVariable = variableUtil.getVariableFromContext(context, node, propTypes.name);
+ if (firstMatchingVariable) {
+ const defInScope = firstMatchingVariable.defs[firstMatchingVariable.defs.length - 1];
+ markPropTypesAsDeclared(node, defInScope.node && defInScope.node.init, rootNode);
+ return;
+ }
+ ignorePropsValidation = true;
+ break;
+ }
+ case 'CallExpression': {
+ if (
+ propWrapperUtil.isPropWrapperFunction(
+ context,
+ getText(context, propTypes.callee)
+ )
+ && propTypes.arguments && propTypes.arguments[0]
+ ) {
+ markPropTypesAsDeclared(node, propTypes.arguments[0], rootNode);
+ return;
+ }
+ break;
+ }
+ case 'IntersectionTypeAnnotation':
+ ignorePropsValidation = declarePropTypesForIntersectionTypeAnnotation(propTypes, declaredPropTypes);
+ break;
+ case 'GenericTypeAnnotation':
+ if (propTypes.id.name === '$ReadOnly') {
+ const propTypeArguments = propsUtil.getTypeArguments(propTypes);
+ ignorePropsValidation = declarePropTypesForObjectTypeAnnotation(
+ propTypeArguments.params[0],
+ declaredPropTypes
+ );
+ } else {
+ ignorePropsValidation = true;
+ }
+ break;
+ case 'TSTypeReference':
+ case 'TSTypeAnnotation': {
+ const tsTypeAnnotation = new DeclarePropTypesForTSTypeAnnotation(propTypes, declaredPropTypes, rootNode);
+ ignorePropsValidation = tsTypeAnnotation.shouldIgnorePropTypes;
+ declaredPropTypes = tsTypeAnnotation.declaredPropTypes;
+ }
+ break;
+ case null:
+ break;
+ default:
+ ignorePropsValidation = true;
+ break;
+ }
+
+ components.set(node, {
+ declaredPropTypes,
+ ignorePropsValidation,
+ });
+ }
+
+ /**
+ * @param {ASTNode} node We expect either an ArrowFunctionExpression,
+ * FunctionDeclaration, or FunctionExpression
+ * @param {ASTNode} rootNode
+ */
+ function markAnnotatedFunctionArgumentsAsDeclared(node, rootNode) {
+ if (!node.params || !node.params.length) {
+ return;
+ }
+
+ let propTypesArguments = null;
+ if (node.parent) {
+ propTypesArguments = propsUtil.getTypeArguments(node.parent);
+ }
+
+ if (
+ node.parent
+ && node.parent.callee
+ && propTypesArguments
+ && propTypesArguments.params
+ && (
+ node.parent.callee.name === 'forwardRef' || (
+ node.parent.callee.object
+ && node.parent.callee.property
+ && node.parent.callee.object.name === 'React'
+ && node.parent.callee.property.name === 'forwardRef'
+ )
+ )
+ ) {
+ const declaredPropTypes = {};
+ const obj = new DeclarePropTypesForTSTypeAnnotation(propTypesArguments.params[1], declaredPropTypes, rootNode);
+ components.set(node, {
+ declaredPropTypes: obj.declaredPropTypes,
+ ignorePropsValidation: obj.shouldIgnorePropTypes,
+ });
+ return;
+ }
+
+ const siblingIdentifier = node.parent && node.parent.id;
+ const siblingHasTypeAnnotation = siblingIdentifier && siblingIdentifier.typeAnnotation;
+ const isNodeAnnotated = annotations.isAnnotatedFunctionPropsDeclaration(node, context);
+
+ if (!isNodeAnnotated && !siblingHasTypeAnnotation) {
+ return;
+ }
+
+ // https://github.com/jsx-eslint/eslint-plugin-react/issues/2784
+ if (isInsideClassBody(node) && !astUtil.isFunction(node)) {
+ return;
+ }
+
+ // Should ignore function that not return JSXElement
+ if (!utils.isReturningJSXOrNull(node) || startWithCapitalizedLetter(node)) {
+ return;
+ }
+
+ if (isNodeAnnotated) {
+ const param = node.params[0];
+ if (param.typeAnnotation && param.typeAnnotation.typeAnnotation && param.typeAnnotation.typeAnnotation.type === 'UnionTypeAnnotation') {
+ param.typeAnnotation.typeAnnotation.types.forEach((annotation) => {
+ if (annotation.type === 'GenericTypeAnnotation') {
+ markPropTypesAsDeclared(node, resolveTypeAnnotation(annotation), rootNode);
+ } else {
+ markPropTypesAsDeclared(node, annotation, rootNode);
+ }
+ });
+ } else {
+ markPropTypesAsDeclared(node, resolveTypeAnnotation(param), rootNode);
+ }
+ } else {
+ // implements what's discussed here: https://github.com/jsx-eslint/eslint-plugin-react/issues/2777#issuecomment-683944481
+ const annotation = siblingIdentifier.typeAnnotation.typeAnnotation;
+
+ if (
+ annotation
+ && annotation.type !== 'TSTypeReference'
+ && propsUtil.getTypeArguments(annotation) == null
+ ) {
+ return;
+ }
+
+ if (!isValidReactGenericTypeAnnotation(annotation)) return;
+
+ markPropTypesAsDeclared(node, resolveTypeAnnotation(siblingIdentifier), rootNode);
+ }
+ }
+
+ /**
+ * Resolve the type annotation for a given class declaration node.
+ *
+ * @param {ASTNode} node The annotation or a node containing the type annotation.
+ * @returns {ASTNode} The resolved type annotation for the node.
+ */
+ function resolveSuperParameterPropsType(node) {
+ let propsParameterPosition;
+ const parameters = propsUtil.getSuperTypeArguments(node);
+
+ try {
+ // Flow <=0.52 had 3 required TypedParameters of which the second one is the Props.
+ // Flow >=0.53 has 2 optional TypedParameters of which the first one is the Props.
+ propsParameterPosition = testFlowVersion(context, '>= 0.53.0') ? 0 : 1;
+ } catch (e) {
+ // In case there is no flow version defined, we can safely assume that when there are 3 Props we are dealing with version <= 0.52
+ propsParameterPosition = parameters.params.length <= 2 ? 0 : 1;
+ }
+
+ let annotation = parameters.params[propsParameterPosition];
+ while (annotation && (annotation.type === 'TypeAnnotation' || annotation.type === 'NullableTypeAnnotation')) {
+ annotation = annotation.typeAnnotation;
+ }
+
+ if (annotation && annotation.type === 'GenericTypeAnnotation' && getInTypeScope(annotation.id.name)) {
+ return getInTypeScope(annotation.id.name);
+ }
+ return annotation;
+ }
+
+ /**
+ * Checks if we are declaring a `props` class property with a flow type annotation.
+ * @param {ASTNode} node The AST node being checked.
+ * @returns {boolean} True if the node is a type annotated props declaration, false if not.
+ */
+ function isAnnotatedClassPropsDeclaration(node) {
+ if (node && (node.type === 'ClassProperty' || node.type === 'PropertyDefinition')) {
+ const tokens = getFirstTokens(context, node, 2);
+ if (
+ node.typeAnnotation && (
+ tokens[0].value === 'props'
+ || (tokens[1] && tokens[1].value === 'props')
+ )
+ ) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ return {
+ ClassExpression(node) {
+ // TypeParameterDeclaration need to be added to typeScope in order to handle ClassExpressions.
+ // This visitor is executed before TypeParameterDeclaration are scoped, therefore we postpone
+ // processing class expressions until when the program exists.
+ classExpressions.push(node);
+ },
+
+ ClassDeclaration(node) {
+ if (isSuperTypeParameterPropsDeclaration(node)) {
+ markPropTypesAsDeclared(node, resolveSuperParameterPropsType(node), node);
+ }
+ },
+
+ 'ClassProperty, PropertyDefinition'(node) {
+ if (isAnnotatedClassPropsDeclaration(node)) {
+ markPropTypesAsDeclared(node, resolveTypeAnnotation(node), node);
+ } else if (propsUtil.isPropTypesDeclaration(node)) {
+ markPropTypesAsDeclared(node, node.value, node);
+ }
+ },
+
+ ObjectExpression(node) {
+ // Search for the proptypes declaration
+ node.properties.forEach((property) => {
+ if (!propsUtil.isPropTypesDeclaration(property)) {
+ return;
+ }
+ markPropTypesAsDeclared(node, property.value, node);
+ });
+ },
+
+ FunctionExpression(node) {
+ if (node.parent.type !== 'MethodDefinition') {
+ markAnnotatedFunctionArgumentsAsDeclared(node, node);
+ }
+ },
+
+ ImportDeclaration(node) {
+ // parse `import ... from 'react`
+ if (node.source.value === 'react') {
+ node.specifiers.forEach((specifier) => {
+ if (
+ // handles import * as X from 'react'
+ specifier.type === 'ImportNamespaceSpecifier'
+ // handles import React from 'react'
+ || specifier.type === 'ImportDefaultSpecifier'
+ ) {
+ genericReactTypesImport.add(specifier.local.name);
+ }
+
+ // handles import { FC } from 'react' or import { FC as X } from 'react'
+ if (specifier.type === 'ImportSpecifier' && allowedGenericTypes.has(specifier.imported.name)) {
+ genericReactTypesImport.add(specifier.local.name);
+ localToImportedMap[specifier.local.name] = specifier.imported.name;
+ }
+ });
+ }
+ },
+
+ FunctionDeclaration: markAnnotatedFunctionArgumentsAsDeclared,
+
+ ArrowFunctionExpression: markAnnotatedFunctionArgumentsAsDeclared,
+
+ MemberExpression(node) {
+ if (propsUtil.isPropTypesDeclaration(node)) {
+ const component = utils.getRelatedComponent(node);
+ if (!component) {
+ return;
+ }
+ try {
+ markPropTypesAsDeclared(component.node, node.parent.right || node.parent, node);
+ } catch (e) {
+ if (e.constructor !== RangeError) { throw e; }
+ }
+ }
+ },
+
+ MethodDefinition(node) {
+ if (!node.static || node.kind !== 'get' || !propsUtil.isPropTypesDeclaration(node)) {
+ return;
+ }
+
+ let i = node.value.body.body.length - 1;
+ for (; i >= 0; i--) {
+ if (node.value.body.body[i].type === 'ReturnStatement') {
+ break;
+ }
+ }
+
+ if (i >= 0) {
+ markPropTypesAsDeclared(node, node.value.body.body[i].argument, node);
+ }
+ },
+
+ TypeAlias(node) {
+ setInTypeScope(node.id.name, node.right);
+ },
+
+ TypeParameterDeclaration(node) {
+ const identifier = node.params[0];
+
+ if (identifier.typeAnnotation) {
+ setInTypeScope(identifier.name, identifier.typeAnnotation.typeAnnotation);
+ }
+ },
+
+ Program() {
+ stack = [{}];
+ },
+
+ BlockStatement() {
+ stack.push(Object.create(typeScope()));
+ },
+
+ 'BlockStatement:exit'() {
+ stack.pop();
+ },
+
+ 'Program:exit'() {
+ classExpressions.forEach((node) => {
+ if (isSuperTypeParameterPropsDeclaration(node)) {
+ markPropTypesAsDeclared(node, resolveSuperParameterPropsType(node), node);
+ }
+ });
+ },
+ };
+};
diff --git a/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/propTypesSort.d.ts b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/propTypesSort.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..01c2d4006281551b4a22ae9eb3a7c7062734bb28
--- /dev/null
+++ b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/propTypesSort.d.ts
@@ -0,0 +1,40 @@
+/**
+ * Fixes sort order of prop types.
+ *
+ * @param {Context} context the second element to compare.
+ * @param {Fixer} fixer the first element to compare.
+ * @param {Array} declarations The context of the two nodes.
+ * @param {boolean=} ignoreCase whether or not to ignore case when comparing the two elements.
+ * @param {boolean=} requiredFirst whether or not to sort required elements first.
+ * @param {boolean=} callbacksLast whether or not to sort callbacks after everything else.
+ * @param {boolean=} noSortAlphabetically whether or not to disable alphabetical sorting of the elements.
+ * @param {boolean=} sortShapeProp whether or not to sort propTypes defined in PropTypes.shape.
+ * @param {boolean=} checkTypes whether or not sorting of prop type definitions are checked.
+ * @returns {Object|*|{range, text}} the sort order of the two elements.
+ */
+export function fixPropTypesSort(context: Context, fixer: Fixer, declarations: any[], ignoreCase?: boolean | undefined, requiredFirst?: boolean | undefined, callbacksLast?: boolean | undefined, noSortAlphabetically?: boolean | undefined, sortShapeProp?: boolean | undefined, checkTypes?: boolean | undefined): any | any | {
+ range;
+ text;
+};
+/**
+ * Checks if the proptype is a callback by checking if it starts with 'on'.
+ *
+ * @param {string} propName the name of the proptype to check.
+ * @returns {boolean} true if the proptype is a callback.
+ */
+export function isCallbackPropName(propName: string): boolean;
+/**
+ * Checks if the prop is required or not.
+ *
+ * @param {ASTNode} node the prop to check.
+ * @returns {boolean} true if the prop is required.
+ */
+export function isRequiredProp(node: ASTNode): boolean;
+/**
+ * Checks if the prop is PropTypes.shape.
+ *
+ * @param {ASTNode} node the prop to check.
+ * @returns {boolean} true if the prop is PropTypes.shape.
+ */
+export function isShapeProp(node: ASTNode): boolean;
+//# sourceMappingURL=propTypesSort.d.ts.map
\ No newline at end of file
diff --git a/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/propTypesSort.d.ts.map b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/propTypesSort.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..e9c8efbc3ed073421a433c34d7f48772aff0bd3f
--- /dev/null
+++ b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/propTypesSort.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"propTypesSort.d.ts","sourceRoot":"","sources":["propTypesSort.js"],"names":[],"mappings":"AA4HA;;;;;;;;;;;;;GAaG;AACH,0CAXW,OAAO,SACP,KAAK,oCAEL,OAAO,8BACP,OAAO,8BACP,OAAO,qCACP,OAAO,8BACP,OAAO,2BACP,OAAO,eACL,YAAS;IAAC,KAAK,CAAC;IAAC,IAAI,CAAA;CAAC,CAyFlC;AA7LD;;;;;GAKG;AACH,6CAHW,MAAM,GACJ,OAAO,CAInB;AAlBD;;;;;GAKG;AACH,qCAHW,OAAO,GACL,OAAO,CAInB;AAYD;;;;;GAKG;AACH,kCAHW,OAAO,GACL,OAAO,CASnB"}
\ No newline at end of file
diff --git a/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/propTypesSort.js b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/propTypesSort.js
new file mode 100644
index 0000000000000000000000000000000000000000..4b42904c63ad1d7d854a76b20855c56244a860c4
--- /dev/null
+++ b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/propTypesSort.js
@@ -0,0 +1,233 @@
+/**
+ * @fileoverview Common propTypes sorting functionality.
+ */
+
+'use strict';
+
+const toSorted = require('array.prototype.tosorted');
+
+const astUtil = require('./ast');
+const eslintUtil = require('./eslint');
+
+const getSourceCode = eslintUtil.getSourceCode;
+const getText = eslintUtil.getText;
+
+/**
+ * Returns the value name of a node.
+ *
+ * @param {ASTNode} node the node to check.
+ * @returns {string} The name of the node.
+ */
+function getValueName(node) {
+ return node.type === 'Property'
+ && node.value.property
+ && node.value.property.name;
+}
+
+/**
+ * Checks if the prop is required or not.
+ *
+ * @param {ASTNode} node the prop to check.
+ * @returns {boolean} true if the prop is required.
+ */
+function isRequiredProp(node) {
+ return getValueName(node) === 'isRequired';
+}
+
+/**
+ * Checks if the proptype is a callback by checking if it starts with 'on'.
+ *
+ * @param {string} propName the name of the proptype to check.
+ * @returns {boolean} true if the proptype is a callback.
+ */
+function isCallbackPropName(propName) {
+ return /^on[A-Z]/.test(propName);
+}
+
+/**
+ * Checks if the prop is PropTypes.shape.
+ *
+ * @param {ASTNode} node the prop to check.
+ * @returns {boolean} true if the prop is PropTypes.shape.
+ */
+function isShapeProp(node) {
+ return !!(
+ node
+ && node.callee
+ && node.callee.property
+ && node.callee.property.name === 'shape'
+ );
+}
+
+/**
+ * Returns the properties of a PropTypes.shape.
+ *
+ * @param {ASTNode} node the prop to check.
+ * @returns {Array} the properties of the PropTypes.shape node.
+ */
+function getShapeProperties(node) {
+ return node.arguments
+ && node.arguments[0]
+ && node.arguments[0].properties;
+}
+
+/**
+ * Compares two elements.
+ *
+ * @param {ASTNode} a the first element to compare.
+ * @param {ASTNode} b the second element to compare.
+ * @param {Context} context The context of the two nodes.
+ * @param {boolean=} ignoreCase whether or not to ignore case when comparing the two elements.
+ * @param {boolean=} requiredFirst whether or not to sort required elements first.
+ * @param {boolean=} callbacksLast whether or not to sort callbacks after everything else.
+ * @param {boolean=} noSortAlphabetically whether or not to disable alphabetical sorting of the elements.
+ * @returns {number} the sort order of the two elements.
+ */
+function sorter(a, b, context, ignoreCase, requiredFirst, callbacksLast, noSortAlphabetically) {
+ const aKey = String(astUtil.getKeyValue(context, a));
+ const bKey = String(astUtil.getKeyValue(context, b));
+
+ if (requiredFirst) {
+ if (isRequiredProp(a) && !isRequiredProp(b)) {
+ return -1;
+ }
+ if (!isRequiredProp(a) && isRequiredProp(b)) {
+ return 1;
+ }
+ }
+
+ if (callbacksLast) {
+ if (isCallbackPropName(aKey) && !isCallbackPropName(bKey)) {
+ return 1;
+ }
+ if (!isCallbackPropName(aKey) && isCallbackPropName(bKey)) {
+ return -1;
+ }
+ }
+
+ if (!noSortAlphabetically) {
+ if (ignoreCase) {
+ return aKey.localeCompare(bKey);
+ }
+
+ if (aKey < bKey) {
+ return -1;
+ }
+ if (aKey > bKey) {
+ return 1;
+ }
+ }
+ return 0;
+}
+
+const commentnodeMap = new WeakMap(); // all nodes reference WeakMap for start and end range
+
+/**
+ * Fixes sort order of prop types.
+ *
+ * @param {Context} context the second element to compare.
+ * @param {Fixer} fixer the first element to compare.
+ * @param {Array} declarations The context of the two nodes.
+ * @param {boolean=} ignoreCase whether or not to ignore case when comparing the two elements.
+ * @param {boolean=} requiredFirst whether or not to sort required elements first.
+ * @param {boolean=} callbacksLast whether or not to sort callbacks after everything else.
+ * @param {boolean=} noSortAlphabetically whether or not to disable alphabetical sorting of the elements.
+ * @param {boolean=} sortShapeProp whether or not to sort propTypes defined in PropTypes.shape.
+ * @param {boolean=} checkTypes whether or not sorting of prop type definitions are checked.
+ * @returns {Object|*|{range, text}} the sort order of the two elements.
+ */
+function fixPropTypesSort(
+ context,
+ fixer,
+ declarations,
+ ignoreCase,
+ requiredFirst,
+ callbacksLast,
+ noSortAlphabetically,
+ sortShapeProp,
+ checkTypes
+) {
+ function sortInSource(allNodes, source) {
+ const originalSource = source;
+ const sourceCode = getSourceCode(context);
+ for (let i = 0; i < allNodes.length; i++) {
+ const node = allNodes[i];
+ let commentAfter = [];
+ let commentBefore = [];
+ let newStart = 0;
+ let newEnd = 0;
+ try {
+ commentBefore = sourceCode.getCommentsBefore(node);
+ commentAfter = sourceCode.getCommentsAfter(node);
+ } catch (e) { /**/ }
+
+ if (commentAfter.length === 0 || commentBefore.length === 0) {
+ newStart = node.range[0];
+ newEnd = node.range[1];
+ }
+
+ const firstCommentBefore = commentBefore[0];
+ if (commentBefore.length >= 1) {
+ newStart = firstCommentBefore.range[0];
+ }
+ const lastCommentAfter = commentAfter[commentAfter.length - 1];
+ if (commentAfter.length >= 1) {
+ newEnd = lastCommentAfter.range[1];
+ }
+ commentnodeMap.set(node, { start: newStart, end: newEnd, hasComment: true });
+ }
+ const nodeGroups = allNodes.reduce((acc, curr) => {
+ if (curr.type === 'ExperimentalSpreadProperty' || curr.type === 'SpreadElement') {
+ acc.push([]);
+ } else {
+ acc[acc.length - 1].push(curr);
+ }
+ return acc;
+ }, [[]]);
+
+ nodeGroups.forEach((nodes) => {
+ const sortedAttributes = toSorted(
+ nodes,
+ (a, b) => sorter(a, b, context, ignoreCase, requiredFirst, callbacksLast, noSortAlphabetically)
+ );
+
+ const sourceCodeText = getText(context);
+ let separator = '';
+ source = nodes.reduceRight((acc, attr, index) => {
+ const sortedAttr = sortedAttributes[index];
+ const commentNode = commentnodeMap.get(sortedAttr);
+ let sortedAttrText = sourceCodeText.slice(commentNode.start, commentNode.end);
+ const sortedAttrTextLastChar = sortedAttrText[sortedAttrText.length - 1];
+ if (!separator && [';', ','].some((allowedSep) => sortedAttrTextLastChar === allowedSep)) {
+ separator = sortedAttrTextLastChar;
+ }
+ if (sortShapeProp && isShapeProp(sortedAttr.value)) {
+ const shape = getShapeProperties(sortedAttr.value);
+ if (shape) {
+ const attrSource = sortInSource(
+ shape,
+ originalSource
+ );
+ sortedAttrText = attrSource.slice(sortedAttr.range[0], sortedAttr.range[1]);
+ }
+ }
+ const sortedAttrTextVal = checkTypes && !sortedAttrText.endsWith(separator) ? `${sortedAttrText}${separator}` : sortedAttrText;
+ return `${acc.slice(0, commentnodeMap.get(attr).start)}${sortedAttrTextVal}${acc.slice(commentnodeMap.get(attr).end)}`;
+ }, source);
+ });
+ return source;
+ }
+
+ const source = sortInSource(declarations, getText(context));
+
+ const rangeStart = commentnodeMap.get(declarations[0]).start;
+ const rangeEnd = commentnodeMap.get(declarations[declarations.length - 1]).end;
+ return fixer.replaceTextRange([rangeStart, rangeEnd], source.slice(rangeStart, rangeEnd));
+}
+
+module.exports = {
+ fixPropTypesSort,
+ isCallbackPropName,
+ isRequiredProp,
+ isShapeProp,
+};
diff --git a/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/propWrapper.d.ts b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/propWrapper.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..74e8cca7ffa877ef47aac67aaec612d430a961ac
--- /dev/null
+++ b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/propWrapper.d.ts
@@ -0,0 +1,6 @@
+export function formatPropWrapperFunctions(propWrapperFunctions: any): string;
+export function getExactPropWrapperFunctions(context: any): Set;
+export function getPropWrapperFunctions(context: any): Set;
+export function isExactPropWrapperFunction(context: any, name: any): any;
+export function isPropWrapperFunction(context: any, name: any): any;
+//# sourceMappingURL=propWrapper.d.ts.map
\ No newline at end of file
diff --git a/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/propWrapper.d.ts.map b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/propWrapper.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..adf81d91e5cd5c7c172b1c476e0afecc37806080
--- /dev/null
+++ b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/propWrapper.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"propWrapper.d.ts","sourceRoot":"","sources":["propWrapper.js"],"names":[],"mappings":"AA0CA,8EAUC;AArBD,qEAIC;AAhBD,gEAEC;AAgBD,yEAGC;AAjBD,oEAMC"}
\ No newline at end of file
diff --git a/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/propWrapper.js b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/propWrapper.js
new file mode 100644
index 0000000000000000000000000000000000000000..66dac8803d1123db917fec53e5c86d4b34e8479e
--- /dev/null
+++ b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/propWrapper.js
@@ -0,0 +1,61 @@
+/**
+ * @fileoverview Utility functions for propWrapperFunctions setting
+ */
+
+'use strict';
+
+const filter = require('es-iterator-helpers/Iterator.prototype.filter');
+const some = require('es-iterator-helpers/Iterator.prototype.some');
+
+function searchPropWrapperFunctions(name, propWrapperFunctions) {
+ const splitName = name.split('.');
+ return some(propWrapperFunctions.values(), (func) => {
+ if (splitName.length === 2 && func.object === splitName[0] && func.property === splitName[1]) {
+ return true;
+ }
+ return name === func || func.property === name;
+ });
+}
+
+function getPropWrapperFunctions(context) {
+ return new Set(context.settings.propWrapperFunctions || []);
+}
+
+function isPropWrapperFunction(context, name) {
+ if (typeof name !== 'string') {
+ return false;
+ }
+ const propWrapperFunctions = getPropWrapperFunctions(context);
+ return searchPropWrapperFunctions(name, propWrapperFunctions);
+}
+
+function getExactPropWrapperFunctions(context) {
+ const propWrapperFunctions = getPropWrapperFunctions(context);
+ const exactPropWrappers = filter(propWrapperFunctions.values(), (func) => func.exact === true);
+ return new Set(exactPropWrappers);
+}
+
+function isExactPropWrapperFunction(context, name) {
+ const exactPropWrappers = getExactPropWrapperFunctions(context);
+ return searchPropWrapperFunctions(name, exactPropWrappers);
+}
+
+function formatPropWrapperFunctions(propWrapperFunctions) {
+ return Array.from(propWrapperFunctions, (func) => {
+ if (func.object && func.property) {
+ return `'${func.object}.${func.property}'`;
+ }
+ if (func.property) {
+ return `'${func.property}'`;
+ }
+ return `'${func}'`;
+ }).join(', ');
+}
+
+module.exports = {
+ formatPropWrapperFunctions,
+ getExactPropWrapperFunctions,
+ getPropWrapperFunctions,
+ isExactPropWrapperFunction,
+ isPropWrapperFunction,
+};
diff --git a/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/props.d.ts b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/props.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..40bea76d4e62fc0276fceace45b04a0418b20755
--- /dev/null
+++ b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/props.d.ts
@@ -0,0 +1,55 @@
+/**
+ * Checks if the Identifier node passed in looks like a propTypes declaration.
+ * @param {ASTNode} node The node to check. Must be an Identifier node.
+ * @returns {boolean} `true` if the node is a propTypes declaration, `false` if not
+ */
+export function isPropTypesDeclaration(node: ASTNode): boolean;
+/**
+ * Checks if the node passed in looks like a contextTypes declaration.
+ * @param {ASTNode} node The node to check.
+ * @returns {boolean} `true` if the node is a contextTypes declaration, `false` if not
+ */
+export function isContextTypesDeclaration(node: ASTNode): boolean;
+/**
+ * Checks if the node passed in looks like a contextType declaration.
+ * @param {ASTNode} node The node to check.
+ * @returns {boolean} `true` if the node is a contextType declaration, `false` if not
+ */
+export function isContextTypeDeclaration(node: ASTNode): boolean;
+/**
+ * Checks if the node passed in looks like a childContextTypes declaration.
+ * @param {ASTNode} node The node to check.
+ * @returns {boolean} `true` if the node is a childContextTypes declaration, `false` if not
+ */
+export function isChildContextTypesDeclaration(node: ASTNode): boolean;
+/**
+ * Checks if the Identifier node passed in looks like a defaultProps declaration.
+ * @param {ASTNode} node The node to check. Must be an Identifier node.
+ * @returns {boolean} `true` if the node is a defaultProps declaration, `false` if not
+ */
+export function isDefaultPropsDeclaration(node: ASTNode): boolean;
+/**
+ * Checks if we are declaring a display name
+ * @param {ASTNode} node The AST node being checked.
+ * @returns {boolean} True if we are declaring a display name, false if not.
+ */
+export function isDisplayNameDeclaration(node: ASTNode): boolean;
+/**
+ * Checks if the PropTypes MemberExpression node passed in declares a required propType.
+ * @param {ASTNode} propTypeExpression node to check. Must be a `PropTypes` MemberExpression.
+ * @returns {boolean} `true` if this PropType is required, `false` if not.
+ */
+export function isRequiredPropType(propTypeExpression: ASTNode): boolean;
+/**
+ * Returns the type arguments of a node or type parameters if type arguments are not available.
+ * @param {ASTNode} node The node to get the type arguments from.
+ * @returns {ASTNode} The type arguments or type parameters of the node.
+ */
+export function getTypeArguments(node: ASTNode): ASTNode;
+/**
+ * Returns the super type arguments of a node or super type parameters if type arguments are not available.
+ * @param {ASTNode} node The node to get the super type arguments from.
+ * @returns {ASTNode} The super type arguments or parameters of the node.
+ */
+export function getSuperTypeArguments(node: ASTNode): ASTNode;
+//# sourceMappingURL=props.d.ts.map
\ No newline at end of file
diff --git a/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/props.d.ts.map b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/props.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..cc23fd7eeecc17ff577df07a82090831243b9dd1
--- /dev/null
+++ b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/props.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["props.js"],"names":[],"mappings":"AAQA;;;;GAIG;AACH,6CAHW,OAAO,GACL,OAAO,CAUnB;AAED;;;;GAIG;AACH,gDAHW,OAAO,GACL,OAAO,CAUnB;AAED;;;;GAIG;AACH,+CAHW,OAAO,GACL,OAAO,CAInB;AAED;;;;GAIG;AACH,qDAHW,OAAO,GACL,OAAO,CAInB;AAED;;;;GAIG;AACH,gDAHW,OAAO,GACL,OAAO,CAKnB;AAED;;;;GAIG;AACH,+CAHW,OAAO,GACL,OAAO,CAcnB;AAED;;;;GAIG;AACH,uDAHW,OAAO,GACL,OAAO,CAKnB;AAED;;;;GAIG;AACH,uCAHW,OAAO,GACL,OAAO,CAOnB;AAED;;;;GAIG;AACH,4CAHW,OAAO,GACL,OAAO,CAOnB"}
\ No newline at end of file
diff --git a/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/props.js b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/props.js
new file mode 100644
index 0000000000000000000000000000000000000000..ac4ed8703bc7be88616051226aeb9c0eaf3a20e6
--- /dev/null
+++ b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/props.js
@@ -0,0 +1,130 @@
+/**
+ * @fileoverview Utility functions for props
+ */
+
+'use strict';
+
+const astUtil = require('./ast');
+
+/**
+ * Checks if the Identifier node passed in looks like a propTypes declaration.
+ * @param {ASTNode} node The node to check. Must be an Identifier node.
+ * @returns {boolean} `true` if the node is a propTypes declaration, `false` if not
+ */
+function isPropTypesDeclaration(node) {
+ if (node && (node.type === 'ClassProperty' || node.type === 'PropertyDefinition')) {
+ // Flow support
+ if (node.typeAnnotation && node.key.name === 'props') {
+ return true;
+ }
+ }
+ return astUtil.getPropertyName(node) === 'propTypes';
+}
+
+/**
+ * Checks if the node passed in looks like a contextTypes declaration.
+ * @param {ASTNode} node The node to check.
+ * @returns {boolean} `true` if the node is a contextTypes declaration, `false` if not
+ */
+function isContextTypesDeclaration(node) {
+ if (node && (node.type === 'ClassProperty' || node.type === 'PropertyDefinition')) {
+ // Flow support
+ if (node.typeAnnotation && node.key.name === 'context') {
+ return true;
+ }
+ }
+ return astUtil.getPropertyName(node) === 'contextTypes';
+}
+
+/**
+ * Checks if the node passed in looks like a contextType declaration.
+ * @param {ASTNode} node The node to check.
+ * @returns {boolean} `true` if the node is a contextType declaration, `false` if not
+ */
+function isContextTypeDeclaration(node) {
+ return astUtil.getPropertyName(node) === 'contextType';
+}
+
+/**
+ * Checks if the node passed in looks like a childContextTypes declaration.
+ * @param {ASTNode} node The node to check.
+ * @returns {boolean} `true` if the node is a childContextTypes declaration, `false` if not
+ */
+function isChildContextTypesDeclaration(node) {
+ return astUtil.getPropertyName(node) === 'childContextTypes';
+}
+
+/**
+ * Checks if the Identifier node passed in looks like a defaultProps declaration.
+ * @param {ASTNode} node The node to check. Must be an Identifier node.
+ * @returns {boolean} `true` if the node is a defaultProps declaration, `false` if not
+ */
+function isDefaultPropsDeclaration(node) {
+ const propName = astUtil.getPropertyName(node);
+ return (propName === 'defaultProps' || propName === 'getDefaultProps');
+}
+
+/**
+ * Checks if we are declaring a display name
+ * @param {ASTNode} node The AST node being checked.
+ * @returns {boolean} True if we are declaring a display name, false if not.
+ */
+function isDisplayNameDeclaration(node) {
+ switch (node.type) {
+ case 'ClassProperty':
+ case 'PropertyDefinition':
+ return node.key && node.key.name === 'displayName';
+ case 'Identifier':
+ return node.name === 'displayName';
+ case 'Literal':
+ return node.value === 'displayName';
+ default:
+ return false;
+ }
+}
+
+/**
+ * Checks if the PropTypes MemberExpression node passed in declares a required propType.
+ * @param {ASTNode} propTypeExpression node to check. Must be a `PropTypes` MemberExpression.
+ * @returns {boolean} `true` if this PropType is required, `false` if not.
+ */
+function isRequiredPropType(propTypeExpression) {
+ return propTypeExpression.type === 'MemberExpression'
+ && propTypeExpression.property.name === 'isRequired';
+}
+
+/**
+ * Returns the type arguments of a node or type parameters if type arguments are not available.
+ * @param {ASTNode} node The node to get the type arguments from.
+ * @returns {ASTNode} The type arguments or type parameters of the node.
+ */
+function getTypeArguments(node) {
+ if ('typeArguments' in node) {
+ return node.typeArguments;
+ }
+ return node.typeParameters;
+}
+
+/**
+ * Returns the super type arguments of a node or super type parameters if type arguments are not available.
+ * @param {ASTNode} node The node to get the super type arguments from.
+ * @returns {ASTNode} The super type arguments or parameters of the node.
+ */
+function getSuperTypeArguments(node) {
+ if ('superTypeArguments' in node) {
+ return node.superTypeArguments;
+ }
+ return node.superTypeParameters;
+}
+
+module.exports = {
+ isPropTypesDeclaration,
+ isContextTypesDeclaration,
+ isContextTypeDeclaration,
+ isChildContextTypesDeclaration,
+ isDefaultPropsDeclaration,
+ isDisplayNameDeclaration,
+ isRequiredPropType,
+ getTypeArguments,
+ getSuperTypeArguments,
+};
diff --git a/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/report.d.ts b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/report.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..306332c3cb4431b7642f79262028678e2db4e17a
--- /dev/null
+++ b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/report.d.ts
@@ -0,0 +1,3 @@
+declare function _exports(context: any, message: any, messageId: any, data: any): void;
+export = _exports;
+//# sourceMappingURL=report.d.ts.map
\ No newline at end of file
diff --git a/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/report.d.ts.map b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/report.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..01007c159f22c06bec55df3b2048434528aa4e01
--- /dev/null
+++ b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/report.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["report.js"],"names":[],"mappings":"AAIiB,uFAOhB"}
\ No newline at end of file
diff --git a/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/report.js b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/report.js
new file mode 100644
index 0000000000000000000000000000000000000000..9c10a13501e99cf28abe2c2c812960aae646efc9
--- /dev/null
+++ b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/report.js
@@ -0,0 +1,12 @@
+'use strict';
+
+const getMessageData = require('./message');
+
+module.exports = function report(context, message, messageId, data) {
+ context.report(
+ Object.assign(
+ getMessageData(messageId, message),
+ data
+ )
+ );
+};
diff --git a/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/usedPropTypes.d.ts b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/usedPropTypes.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..9e3c1a98cc70e0eadb2111abba0b8225df679fa7
--- /dev/null
+++ b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/usedPropTypes.d.ts
@@ -0,0 +1,15 @@
+declare function _exports(context: any, components: any, utils: any): {
+ VariableDeclarator(node: any): void;
+ FunctionDeclaration: (node: ASTNode) => void;
+ ArrowFunctionExpression: (node: ASTNode) => void;
+ FunctionExpression: (node: ASTNode) => void;
+ 'FunctionDeclaration:exit': () => void;
+ 'ArrowFunctionExpression:exit': () => void;
+ 'FunctionExpression:exit': () => void;
+ JSXSpreadAttribute(node: any): void;
+ 'MemberExpression, OptionalMemberExpression'(node: any): void;
+ ObjectPattern(node: any): void;
+ 'Program:exit'(): void;
+};
+export = _exports;
+//# sourceMappingURL=usedPropTypes.d.ts.map
\ No newline at end of file
diff --git a/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/usedPropTypes.d.ts.map b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/usedPropTypes.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..eea2ef9a0fbee6f6969cd3642b209a6e23fa9593
--- /dev/null
+++ b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/usedPropTypes.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"usedPropTypes.d.ts","sourceRoot":"","sources":["usedPropTypes.js"],"names":[],"mappings":"AAiTiB;;gCA2JJ,OAAO;oCAAP,OAAO;+BAAP,OAAO;;;;;;;;EA2HnB"}
\ No newline at end of file
diff --git a/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/usedPropTypes.js b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/usedPropTypes.js
new file mode 100644
index 0000000000000000000000000000000000000000..41eb307d6bd5d7533b4d453f074ec63d9675cbb0
--- /dev/null
+++ b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/usedPropTypes.js
@@ -0,0 +1,584 @@
+/**
+ * @fileoverview Common used propTypes detection functionality.
+ */
+
+'use strict';
+
+const values = require('object.values');
+
+const astUtil = require('./ast');
+const componentUtil = require('./componentUtil');
+const testReactVersion = require('./version').testReactVersion;
+const ast = require('./ast');
+const eslintUtil = require('./eslint');
+
+const getScope = eslintUtil.getScope;
+const getSourceCode = eslintUtil.getSourceCode;
+
+// ------------------------------------------------------------------------------
+// Constants
+// ------------------------------------------------------------------------------
+
+const LIFE_CYCLE_METHODS = ['componentWillReceiveProps', 'shouldComponentUpdate', 'componentWillUpdate', 'componentDidUpdate'];
+const ASYNC_SAFE_LIFE_CYCLE_METHODS = ['getDerivedStateFromProps', 'getSnapshotBeforeUpdate', 'UNSAFE_componentWillReceiveProps', 'UNSAFE_componentWillUpdate'];
+
+function createPropVariables() {
+ /** @type {Map} Maps the variable to its definition. `props.a.b` is stored as `['a', 'b']` */
+ let propVariables = new Map();
+ let hasBeenWritten = false;
+ const stack = [{ propVariables, hasBeenWritten }];
+ return {
+ pushScope() {
+ // popVariables is not copied until first write.
+ stack.push({ propVariables, hasBeenWritten: false });
+ },
+ popScope() {
+ stack.pop();
+ propVariables = stack[stack.length - 1].propVariables;
+ hasBeenWritten = stack[stack.length - 1].hasBeenWritten;
+ },
+ /**
+ * Add a variable name to the current scope
+ * @param {string} name
+ * @param {string[]} allNames Example: `props.a.b` should be formatted as `['a', 'b']`
+ * @returns {Map}
+ */
+ set(name, allNames) {
+ if (!hasBeenWritten) {
+ // copy on write
+ propVariables = new Map(propVariables);
+ Object.assign(stack[stack.length - 1], { propVariables, hasBeenWritten: true });
+ stack[stack.length - 1].hasBeenWritten = true;
+ }
+ return propVariables.set(name, allNames);
+ },
+ /**
+ * Get the definition of a variable.
+ * @param {string} name
+ * @returns {string[]} Example: `props.a.b` is represented by `['a', 'b']`
+ */
+ get(name) {
+ return propVariables.get(name);
+ },
+ };
+}
+
+/**
+ * Checks if the string is one of `props`, `nextProps`, or `prevProps`
+ * @param {string} name The AST node being checked.
+ * @returns {boolean} True if the prop name matches
+ */
+function isCommonVariableNameForProps(name) {
+ return name === 'props' || name === 'nextProps' || name === 'prevProps';
+}
+
+/**
+ * Checks if the component must be validated
+ * @param {Object} component The component to process
+ * @returns {boolean} True if the component must be validated, false if not.
+ */
+function mustBeValidated(component) {
+ return !!(component && !component.ignorePropsValidation);
+}
+
+/**
+ * Check if we are in a lifecycle method
+ * @param {object} context
+ * @param {ASTNode} node The AST node being checked.
+ * @param {boolean} checkAsyncSafeLifeCycles
+ * @return {boolean} true if we are in a class constructor, false if not
+ */
+function inLifeCycleMethod(context, node, checkAsyncSafeLifeCycles) {
+ let scope = getScope(context, node);
+ while (scope) {
+ if (scope.block && scope.block.parent && scope.block.parent.key) {
+ const name = scope.block.parent.key.name;
+
+ if (LIFE_CYCLE_METHODS.indexOf(name) >= 0) {
+ return true;
+ }
+ if (checkAsyncSafeLifeCycles && ASYNC_SAFE_LIFE_CYCLE_METHODS.indexOf(name) >= 0) {
+ return true;
+ }
+ }
+ scope = scope.upper;
+ }
+ return false;
+}
+
+/**
+ * Returns true if the given node is a React Component lifecycle method
+ * @param {ASTNode} node The AST node being checked.
+ * @param {boolean} checkAsyncSafeLifeCycles
+ * @return {boolean} True if the node is a lifecycle method
+ */
+function isNodeALifeCycleMethod(node, checkAsyncSafeLifeCycles) {
+ if (node.key) {
+ if (node.kind === 'constructor') {
+ return true;
+ }
+
+ const nodeKeyName = node.key.name;
+
+ if (typeof nodeKeyName !== 'string') {
+ return false;
+ }
+
+ if (LIFE_CYCLE_METHODS.indexOf(nodeKeyName) >= 0) {
+ return true;
+ }
+ if (checkAsyncSafeLifeCycles && ASYNC_SAFE_LIFE_CYCLE_METHODS.indexOf(nodeKeyName) >= 0) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+/**
+ * Returns true if the given node is inside a React Component lifecycle
+ * method.
+ * @param {ASTNode} node The AST node being checked.
+ * @param {boolean} checkAsyncSafeLifeCycles
+ * @return {boolean} True if the node is inside a lifecycle method
+ */
+function isInLifeCycleMethod(node, checkAsyncSafeLifeCycles) {
+ if (
+ (node.type === 'MethodDefinition' || node.type === 'Property')
+ && isNodeALifeCycleMethod(node, checkAsyncSafeLifeCycles)
+ ) {
+ return true;
+ }
+
+ if (node.parent) {
+ return isInLifeCycleMethod(node.parent, checkAsyncSafeLifeCycles);
+ }
+
+ return false;
+}
+
+/**
+ * Check if a function node is a setState updater
+ * @param {ASTNode} node a function node
+ * @return {boolean}
+ */
+function isSetStateUpdater(node) {
+ const unwrappedParentCalleeNode = astUtil.isCallExpression(node.parent)
+ && ast.unwrapTSAsExpression(node.parent.callee);
+
+ return unwrappedParentCalleeNode
+ && unwrappedParentCalleeNode.property
+ && unwrappedParentCalleeNode.property.name === 'setState'
+ // Make sure we are in the updater not the callback
+ && node.parent.arguments[0] === node;
+}
+
+function isPropArgumentInSetStateUpdater(context, node, name) {
+ if (typeof name !== 'string') {
+ return;
+ }
+ let scope = getScope(context, node);
+ while (scope) {
+ const unwrappedParentCalleeNode = scope.block
+ && astUtil.isCallExpression(scope.block.parent)
+ && ast.unwrapTSAsExpression(scope.block.parent.callee);
+ if (
+ unwrappedParentCalleeNode
+ && unwrappedParentCalleeNode.property
+ && unwrappedParentCalleeNode.property.name === 'setState'
+ // Make sure we are in the updater not the callback
+ && scope.block.parent.arguments[0].range[0] === scope.block.range[0]
+ && scope.block.parent.arguments[0].params
+ && scope.block.parent.arguments[0].params.length > 1
+ ) {
+ return scope.block.parent.arguments[0].params[1].name === name;
+ }
+ scope = scope.upper;
+ }
+ return false;
+}
+
+/**
+ * @param {Context} context
+ * @param {ASTNode} node
+ * @returns {boolean}
+ */
+function isInClassComponent(context, node) {
+ return !!(componentUtil.getParentES6Component(context, node) || componentUtil.getParentES5Component(context, node));
+}
+
+/**
+ * Checks if the node is `this.props`
+ * @param {ASTNode|undefined} node
+ * @returns {boolean}
+ */
+function isThisDotProps(node) {
+ return !!node
+ && node.type === 'MemberExpression'
+ && ast.unwrapTSAsExpression(node.object).type === 'ThisExpression'
+ && node.property.name === 'props';
+}
+
+/**
+ * Checks if the prop has spread operator.
+ * @param {object} context
+ * @param {ASTNode} node The AST node being marked.
+ * @returns {boolean} True if the prop has spread operator, false if not.
+ */
+function hasSpreadOperator(context, node) {
+ const tokens = getSourceCode(context).getTokens(node);
+ return tokens.length && tokens[0].value === '...';
+}
+
+/**
+ * Checks if the node is a propTypes usage of the form `this.props.*`, `props.*`, `prevProps.*`, or `nextProps.*`.
+ * @param {Context} context
+ * @param {ASTNode} node
+ * @param {Object} utils
+ * @param {boolean} checkAsyncSafeLifeCycles
+ * @returns {boolean}
+ */
+function isPropTypesUsageByMemberExpression(context, node, utils, checkAsyncSafeLifeCycles) {
+ const unwrappedObjectNode = ast.unwrapTSAsExpression(node.object);
+
+ if (isInClassComponent(context, node)) {
+ // this.props.*
+ if (isThisDotProps(unwrappedObjectNode)) {
+ return true;
+ }
+ // props.* or prevProps.* or nextProps.*
+ if (
+ isCommonVariableNameForProps(unwrappedObjectNode.name)
+ && (inLifeCycleMethod(context, node, checkAsyncSafeLifeCycles) || astUtil.inConstructor(context, node))
+ ) {
+ return true;
+ }
+ // this.setState((_, props) => props.*))
+ if (isPropArgumentInSetStateUpdater(context, node, unwrappedObjectNode.name)) {
+ return true;
+ }
+ return false;
+ }
+ // props.* in function component
+ return unwrappedObjectNode.name === 'props' && !ast.isAssignmentLHS(node);
+}
+
+/**
+ * Retrieve the name of a property node
+ * @param {Context} context
+ * @param {ASTNode} node The AST node with the property.
+ * @param {Object} utils
+ * @param {boolean} checkAsyncSafeLifeCycles
+ * @return {string|undefined} the name of the property or undefined if not found
+ */
+function getPropertyName(context, node, utils, checkAsyncSafeLifeCycles) {
+ const property = node.property;
+ if (property) {
+ switch (property.type) {
+ case 'Identifier':
+ if (node.computed) {
+ return '__COMPUTED_PROP__';
+ }
+ return property.name;
+ case 'MemberExpression':
+ return;
+ case 'Literal':
+ // Accept computed properties that are literal strings
+ if (typeof property.value === 'string') {
+ return property.value;
+ }
+ // Accept number as well but only accept props[123]
+ if (typeof property.value === 'number') {
+ if (isPropTypesUsageByMemberExpression(context, node, utils, checkAsyncSafeLifeCycles)) {
+ return property.raw;
+ }
+ }
+ // falls through
+ default:
+ if (node.computed) {
+ return '__COMPUTED_PROP__';
+ }
+ break;
+ }
+ }
+}
+
+module.exports = function usedPropTypesInstructions(context, components, utils) {
+ const checkAsyncSafeLifeCycles = testReactVersion(context, '>= 16.3.0');
+
+ const propVariables = createPropVariables();
+ const pushScope = propVariables.pushScope;
+ const popScope = propVariables.popScope;
+
+ /**
+ * Mark a prop type as used
+ * @param {ASTNode} node The AST node being marked.
+ * @param {string[]} [parentNames]
+ */
+ function markPropTypesAsUsed(node, parentNames) {
+ parentNames = parentNames || [];
+ let type;
+ let name;
+ let allNames;
+ let properties;
+ switch (node.type) {
+ case 'OptionalMemberExpression':
+ case 'MemberExpression':
+ name = getPropertyName(context, node, utils, checkAsyncSafeLifeCycles);
+ if (name) {
+ allNames = parentNames.concat(name);
+ if (
+ // Match props.foo.bar, don't match bar[props.foo]
+ node.parent.type === 'MemberExpression'
+ && node.parent.object === node
+ ) {
+ markPropTypesAsUsed(node.parent, allNames);
+ }
+ // Handle the destructuring part of `const {foo} = props.a.b`
+ if (
+ node.parent.type === 'VariableDeclarator'
+ && node.parent.id.type === 'ObjectPattern'
+ ) {
+ node.parent.id.parent = node.parent; // patch for bug in eslint@4 in which ObjectPattern has no parent
+ markPropTypesAsUsed(node.parent.id, allNames);
+ }
+
+ // const a = props.a
+ if (
+ node.parent.type === 'VariableDeclarator'
+ && node.parent.id.type === 'Identifier'
+ ) {
+ propVariables.set(node.parent.id.name, allNames);
+ }
+ // Do not mark computed props as used.
+ type = name !== '__COMPUTED_PROP__' ? 'direct' : null;
+ }
+ break;
+ case 'ArrowFunctionExpression':
+ case 'FunctionDeclaration':
+ case 'FunctionExpression': {
+ if (node.params.length === 0) {
+ break;
+ }
+ type = 'destructuring';
+ const propParam = isSetStateUpdater(node) ? node.params[1] : node.params[0];
+ properties = propParam.type === 'AssignmentPattern'
+ ? propParam.left.properties
+ : propParam.properties;
+ break;
+ }
+ case 'ObjectPattern':
+ type = 'destructuring';
+ properties = node.properties;
+ break;
+ case 'TSEmptyBodyFunctionExpression':
+ break;
+ default:
+ throw new Error(`${node.type} ASTNodes are not handled by markPropTypesAsUsed`);
+ }
+
+ const component = components.get(utils.getParentComponent(node));
+ const usedPropTypes = (component && component.usedPropTypes) || [];
+ let ignoreUnusedPropTypesValidation = (component && component.ignoreUnusedPropTypesValidation) || false;
+
+ switch (type) {
+ case 'direct': {
+ // Ignore Object methods
+ if (name in Object.prototype) {
+ break;
+ }
+
+ const reportedNode = node.property;
+ usedPropTypes.push({
+ name,
+ allNames,
+ node: reportedNode,
+ });
+ break;
+ }
+ case 'destructuring': {
+ for (let k = 0, l = (properties || []).length; k < l; k++) {
+ if (hasSpreadOperator(context, properties[k]) || properties[k].computed) {
+ ignoreUnusedPropTypesValidation = true;
+ break;
+ }
+ const propName = ast.getKeyValue(context, properties[k]);
+
+ if (!propName || properties[k].type !== 'Property') {
+ break;
+ }
+
+ usedPropTypes.push({
+ allNames: parentNames.concat([propName]),
+ name: propName,
+ node: properties[k],
+ });
+
+ if (properties[k].value.type === 'ObjectPattern') {
+ markPropTypesAsUsed(properties[k].value, parentNames.concat([propName]));
+ } else if (properties[k].value.type === 'Identifier') {
+ propVariables.set(properties[k].value.name, parentNames.concat(propName));
+ }
+ }
+ break;
+ }
+ default:
+ break;
+ }
+
+ components.set(component ? component.node : node, {
+ usedPropTypes,
+ ignoreUnusedPropTypesValidation,
+ });
+ }
+
+ /**
+ * @param {ASTNode} node We expect either an ArrowFunctionExpression,
+ * FunctionDeclaration, or FunctionExpression
+ */
+ function markDestructuredFunctionArgumentsAsUsed(node) {
+ const param = node.params && isSetStateUpdater(node) ? node.params[1] : node.params[0];
+
+ const destructuring = param && (
+ param.type === 'ObjectPattern'
+ || ((param.type === 'AssignmentPattern') && (param.left.type === 'ObjectPattern'))
+ );
+
+ if (destructuring && (components.get(node) || components.get(node.parent))) {
+ markPropTypesAsUsed(node);
+ }
+ }
+
+ function handleSetStateUpdater(node) {
+ if (!node.params || node.params.length < 2 || !isSetStateUpdater(node)) {
+ return;
+ }
+ markPropTypesAsUsed(node);
+ }
+
+ /**
+ * Handle both stateless functions and setState updater functions.
+ * @param {ASTNode} node We expect either an ArrowFunctionExpression,
+ * FunctionDeclaration, or FunctionExpression
+ */
+ function handleFunctionLikeExpressions(node) {
+ pushScope();
+ handleSetStateUpdater(node);
+ markDestructuredFunctionArgumentsAsUsed(node);
+ }
+
+ function handleCustomValidators(component) {
+ const propTypes = component.declaredPropTypes;
+ if (!propTypes) {
+ return;
+ }
+
+ Object.keys(propTypes).forEach((key) => {
+ const node = propTypes[key].node;
+
+ if (node && node.value && astUtil.isFunctionLikeExpression(node.value)) {
+ markPropTypesAsUsed(node.value);
+ }
+ });
+ }
+
+ return {
+ VariableDeclarator(node) {
+ const unwrappedInitNode = ast.unwrapTSAsExpression(node.init);
+
+ // let props = this.props
+ if (isThisDotProps(unwrappedInitNode) && isInClassComponent(context, node) && node.id.type === 'Identifier') {
+ propVariables.set(node.id.name, []);
+ }
+
+ // Only handles destructuring
+ if (node.id.type !== 'ObjectPattern' || !unwrappedInitNode) {
+ return;
+ }
+
+ // let {props: {firstname}} = this
+ const propsProperty = node.id.properties.find((property) => (
+ property.key
+ && (property.key.name === 'props' || property.key.value === 'props')
+ ));
+
+ if (unwrappedInitNode.type === 'ThisExpression' && propsProperty && propsProperty.value.type === 'ObjectPattern') {
+ markPropTypesAsUsed(propsProperty.value);
+ return;
+ }
+
+ // let {props} = this
+ if (unwrappedInitNode.type === 'ThisExpression' && propsProperty && propsProperty.value.name === 'props') {
+ propVariables.set('props', []);
+ return;
+ }
+
+ // let {firstname} = props
+ if (
+ isCommonVariableNameForProps(unwrappedInitNode.name)
+ && (utils.getParentStatelessComponent(node) || isInLifeCycleMethod(node, checkAsyncSafeLifeCycles))
+ ) {
+ markPropTypesAsUsed(node.id);
+ return;
+ }
+
+ // let {firstname} = this.props
+ if (isThisDotProps(unwrappedInitNode) && isInClassComponent(context, node)) {
+ markPropTypesAsUsed(node.id);
+ return;
+ }
+
+ // let {firstname} = thing, where thing is defined by const thing = this.props.**.*
+ if (propVariables.get(unwrappedInitNode.name)) {
+ markPropTypesAsUsed(node.id, propVariables.get(unwrappedInitNode.name));
+ }
+ },
+
+ FunctionDeclaration: handleFunctionLikeExpressions,
+
+ ArrowFunctionExpression: handleFunctionLikeExpressions,
+
+ FunctionExpression: handleFunctionLikeExpressions,
+
+ 'FunctionDeclaration:exit': popScope,
+
+ 'ArrowFunctionExpression:exit': popScope,
+
+ 'FunctionExpression:exit': popScope,
+
+ JSXSpreadAttribute(node) {
+ const component = components.get(utils.getParentComponent(node));
+ components.set(component ? component.node : node, {
+ ignoreUnusedPropTypesValidation: node.argument.type !== 'ObjectExpression',
+ });
+ },
+
+ 'MemberExpression, OptionalMemberExpression'(node) {
+ if (isPropTypesUsageByMemberExpression(context, node, utils, checkAsyncSafeLifeCycles)) {
+ markPropTypesAsUsed(node);
+ return;
+ }
+
+ const propVariable = propVariables.get(ast.unwrapTSAsExpression(node.object).name);
+ if (propVariable) {
+ markPropTypesAsUsed(node, propVariable);
+ }
+ },
+
+ ObjectPattern(node) {
+ // If the object pattern is a destructured props object in a lifecycle
+ // method -- mark it for used props.
+ if (isNodeALifeCycleMethod(node.parent.parent, checkAsyncSafeLifeCycles) && node.properties.length > 0) {
+ markPropTypesAsUsed(node.parent);
+ }
+ },
+
+ 'Program:exit'() {
+ values(components.list())
+ .filter((component) => mustBeValidated(component))
+ .forEach((component) => {
+ handleCustomValidators(component);
+ });
+ },
+ };
+};
diff --git a/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/variable.d.ts b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/variable.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..de070fe91fca826218b1a81c26cf555713a1b5e6
--- /dev/null
+++ b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/variable.d.ts
@@ -0,0 +1,38 @@
+/**
+ * Search a particular variable in a list
+ * @param {Array} variables The variables list.
+ * @param {string} name The name of the variable to search.
+ * @returns {boolean} True if the variable was found, false if not.
+ */
+export function findVariable(variables: any[], name: string): boolean;
+/**
+ * Find a variable by name in the current scope.
+ * @param {Object} context The current rule context.
+ * @param {ASTNode} node The node to check. Must be an Identifier node.
+ * @param {string} name Name of the variable to look for.
+ * @returns {ASTNode|null} Return null if the variable could not be found, ASTNode otherwise.
+ */
+export function findVariableByName(context: any, node: ASTNode, name: string): ASTNode | null;
+/**
+ * Find and return a particular variable in a list
+ * @param {Array} variables The variables list.
+ * @param {string} name The name of the variable to search.
+ * @returns {Object} Variable if the variable was found, null if not.
+ */
+export function getVariable(variables: any[], name: string): any;
+/**
+ * Searches for a variable in the given scope.
+ *
+ * @param {Object} context The current rule context.
+ * @param {ASTNode} node The node to start looking from.
+ * @param {string} name The name of the variable to search.
+ * @returns {Object | undefined} Variable if the variable was found, undefined if not.
+ */
+export function getVariableFromContext(context: any, node: ASTNode, name: string): any | undefined;
+/**
+ * Returns the latest definition of the variable.
+ * @param {Object} variable
+ * @returns {Object | undefined} The latest variable definition or undefined.
+ */
+export function getLatestVariableDefinition(variable: any): any | undefined;
+//# sourceMappingURL=variable.d.ts.map
\ No newline at end of file
diff --git a/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/variable.d.ts.map b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/variable.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..5187e71363c4bb4d530e9ebdfa14e7dde94f2cfa
--- /dev/null
+++ b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/variable.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"variable.d.ts","sourceRoot":"","sources":["variable.js"],"names":[],"mappings":"AASA;;;;;GAKG;AACH,qDAHW,MAAM,GACJ,OAAO,CAInB;AA0CD;;;;;;GAMG;AACH,uDAJW,OAAO,QACN,MAAM,GACL,OAAO,GAAC,IAAI,CAkBxB;AA/DD;;;;;GAKG;AACH,oDAHW,MAAM,OAKhB;AAED;;;;;;;GAOG;AACH,2DAJW,OAAO,QACP,MAAM,GACJ,MAAS,SAAS,CAsB9B;AA2BD;;;;GAIG;AACH,4DAFa,MAAS,SAAS,CAI9B"}
\ No newline at end of file
diff --git a/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/variable.js b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/variable.js
new file mode 100644
index 0000000000000000000000000000000000000000..a92a20930f24844a39ca2b07b2e5e868f59c215a
--- /dev/null
+++ b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/variable.js
@@ -0,0 +1,100 @@
+/**
+ * @fileoverview Utility functions for React components detection
+ * @author Yannick Croissant
+ */
+
+'use strict';
+
+const getScope = require('./eslint').getScope;
+
+/**
+ * Search a particular variable in a list
+ * @param {Array} variables The variables list.
+ * @param {string} name The name of the variable to search.
+ * @returns {boolean} True if the variable was found, false if not.
+ */
+function findVariable(variables, name) {
+ return variables.some((variable) => variable.name === name);
+}
+
+/**
+ * Find and return a particular variable in a list
+ * @param {Array} variables The variables list.
+ * @param {string} name The name of the variable to search.
+ * @returns {Object} Variable if the variable was found, null if not.
+ */
+function getVariable(variables, name) {
+ return variables.find((variable) => variable.name === name);
+}
+
+/**
+ * Searches for a variable in the given scope.
+ *
+ * @param {Object} context The current rule context.
+ * @param {ASTNode} node The node to start looking from.
+ * @param {string} name The name of the variable to search.
+ * @returns {Object | undefined} Variable if the variable was found, undefined if not.
+ */
+function getVariableFromContext(context, node, name) {
+ let scope = getScope(context, node);
+
+ while (scope) {
+ let variable = getVariable(scope.variables, name);
+
+ if (!variable && scope.childScopes.length) {
+ variable = getVariable(scope.childScopes[0].variables, name);
+
+ if (!variable && scope.childScopes[0].childScopes.length) {
+ variable = getVariable(scope.childScopes[0].childScopes[0].variables, name);
+ }
+ }
+
+ if (variable) {
+ return variable;
+ }
+ scope = scope.upper;
+ }
+ return undefined;
+}
+
+/**
+ * Find a variable by name in the current scope.
+ * @param {Object} context The current rule context.
+ * @param {ASTNode} node The node to check. Must be an Identifier node.
+ * @param {string} name Name of the variable to look for.
+ * @returns {ASTNode|null} Return null if the variable could not be found, ASTNode otherwise.
+ */
+function findVariableByName(context, node, name) {
+ const variable = getVariableFromContext(context, node, name);
+
+ if (!variable || !variable.defs[0] || !variable.defs[0].node) {
+ return null;
+ }
+
+ if (variable.defs[0].node.type === 'TypeAlias') {
+ return variable.defs[0].node.right;
+ }
+
+ if (variable.defs[0].type === 'ImportBinding') {
+ return variable.defs[0].node;
+ }
+
+ return variable.defs[0].node.init;
+}
+
+/**
+ * Returns the latest definition of the variable.
+ * @param {Object} variable
+ * @returns {Object | undefined} The latest variable definition or undefined.
+ */
+function getLatestVariableDefinition(variable) {
+ return variable.defs[variable.defs.length - 1];
+}
+
+module.exports = {
+ findVariable,
+ findVariableByName,
+ getVariable,
+ getVariableFromContext,
+ getLatestVariableDefinition,
+};
diff --git a/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/version.d.ts b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/version.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..e423fc38d766a8c8ac2180519fb07ba844f285f8
--- /dev/null
+++ b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/version.d.ts
@@ -0,0 +1,6 @@
+export function testReactVersion(context: any, semverRange: any): boolean;
+export function testFlowVersion(context: any, semverRange: any): boolean;
+export function resetWarningFlag(): void;
+export function resetDetectedVersion(): void;
+export function resetDefaultVersion(): void;
+//# sourceMappingURL=version.d.ts.map
\ No newline at end of file
diff --git a/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/version.d.ts.map b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/version.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..e9d69637bc0629745cbe07ca50cf907f6dc36771
--- /dev/null
+++ b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/version.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["version.js"],"names":[],"mappings":"AAmLA,0EAEC;AAED,yEAEC;AAvKD,yCAEC;AAID,6CAEC;AA6BD,4CAEC"}
\ No newline at end of file
diff --git a/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/version.js b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/version.js
new file mode 100644
index 0000000000000000000000000000000000000000..c9dc683b7d149c5a3a941bdcbd32f657facdfbf6
--- /dev/null
+++ b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/lib/util/version.js
@@ -0,0 +1,194 @@
+/**
+ * @fileoverview Utility functions for React and Flow version configuration
+ * @author Yannick Croissant
+ */
+
+'use strict';
+
+const fs = require('fs');
+const path = require('path');
+
+const resolve = require('resolve');
+const semver = require('semver');
+const error = require('./error');
+
+const ULTIMATE_LATEST_SEMVER = '999.999.999';
+
+let warnedForMissingVersion = false;
+
+function resetWarningFlag() {
+ warnedForMissingVersion = false;
+}
+
+let cachedDetectedReactVersion;
+
+function resetDetectedVersion() {
+ cachedDetectedReactVersion = undefined;
+}
+
+function resolveBasedir(contextOrFilename) {
+ if (contextOrFilename) {
+ const filename = typeof contextOrFilename === 'string' ? contextOrFilename : contextOrFilename.getFilename();
+ const dirname = path.dirname(filename);
+ try {
+ if (fs.statSync(filename).isFile()) {
+ // dirname must be dir here
+ return dirname;
+ }
+ } catch (err) {
+ // https://github.com/eslint/eslint/issues/11989
+ if (err.code === 'ENOTDIR') {
+ // virtual filename could be recursive
+ return resolveBasedir(dirname);
+ }
+ }
+ }
+ return process.cwd();
+}
+
+function convertConfVerToSemver(confVer) {
+ const fullSemverString = /^[0-9]+\.[0-9]+$/.test(confVer) ? `${confVer}.0` : confVer;
+ return semver.coerce(fullSemverString.split('.').map((part) => Number(part)).join('.'));
+}
+
+let defaultVersion = ULTIMATE_LATEST_SEMVER;
+
+function resetDefaultVersion() {
+ defaultVersion = ULTIMATE_LATEST_SEMVER;
+}
+
+function readDefaultReactVersionFromContext(context) {
+ // .eslintrc shared settings (https://eslint.org/docs/user-guide/configuring#adding-shared-settings)
+ if (context.settings && context.settings.react && context.settings.react.defaultVersion) {
+ let settingsDefaultVersion = context.settings.react.defaultVersion;
+ if (typeof settingsDefaultVersion !== 'string') {
+ error(`Warning: default React version specified in eslint-pluigin-react-settings must be a string; got "${typeof settingsDefaultVersion}"`);
+ }
+ settingsDefaultVersion = String(settingsDefaultVersion);
+ const result = convertConfVerToSemver(settingsDefaultVersion);
+ if (result) {
+ defaultVersion = result.version;
+ } else {
+ error(`Warning: React version specified in eslint-plugin-react-settings must be a valid semver version, or "detect"; got “${settingsDefaultVersion}”. Falling back to latest version as default.`);
+ }
+ } else {
+ defaultVersion = ULTIMATE_LATEST_SEMVER;
+ }
+}
+
+// TODO, semver-major: remove context fallback
+function detectReactVersion(context) {
+ if (cachedDetectedReactVersion) {
+ return cachedDetectedReactVersion;
+ }
+
+ const basedir = resolveBasedir(context);
+
+ try {
+ const reactPath = resolve.sync('react', { basedir });
+ const react = require(reactPath); // eslint-disable-line global-require, import/no-dynamic-require
+ cachedDetectedReactVersion = react.version;
+ return cachedDetectedReactVersion;
+ } catch (e) {
+ if (e.code === 'MODULE_NOT_FOUND') {
+ if (!warnedForMissingVersion) {
+ let sentence2 = 'Assuming latest React version for linting.';
+ if (defaultVersion !== ULTIMATE_LATEST_SEMVER) {
+ sentence2 = `Assuming default React version for linting: "${defaultVersion}".`;
+ }
+ error(`Warning: React version was set to "detect" in eslint-plugin-react settings, but the "react" package is not installed. ${sentence2}`);
+ warnedForMissingVersion = true;
+ }
+ cachedDetectedReactVersion = defaultVersion;
+ return cachedDetectedReactVersion;
+ }
+ throw e;
+ }
+}
+
+function getReactVersionFromContext(context) {
+ readDefaultReactVersionFromContext(context);
+ let confVer = defaultVersion;
+ // .eslintrc shared settings (https://eslint.org/docs/user-guide/configuring#adding-shared-settings)
+ if (context.settings && context.settings.react && context.settings.react.version) {
+ let settingsVersion = context.settings.react.version;
+ if (settingsVersion === 'detect') {
+ settingsVersion = detectReactVersion(context);
+ }
+ if (typeof settingsVersion !== 'string') {
+ error(`Warning: React version specified in eslint-plugin-react-settings must be a string; got “${typeof settingsVersion}”`);
+ }
+ confVer = String(settingsVersion);
+ } else if (!warnedForMissingVersion) {
+ error('Warning: React version not specified in eslint-plugin-react settings. See https://github.com/jsx-eslint/eslint-plugin-react#configuration .');
+ warnedForMissingVersion = true;
+ }
+
+ const result = convertConfVerToSemver(confVer);
+ if (!result) {
+ error(`Warning: React version specified in eslint-plugin-react-settings must be a valid semver version, or "detect"; got “${confVer}”`);
+ }
+ return result ? result.version : defaultVersion;
+}
+
+// TODO, semver-major: remove context fallback
+function detectFlowVersion(context) {
+ const basedir = resolveBasedir(context);
+
+ try {
+ const flowPackageJsonPath = resolve.sync('flow-bin/package.json', { basedir });
+ const flowPackageJson = require(flowPackageJsonPath); // eslint-disable-line global-require, import/no-dynamic-require
+ return flowPackageJson.version;
+ } catch (e) {
+ if (e.code === 'MODULE_NOT_FOUND') {
+ error('Warning: Flow version was set to "detect" in eslint-plugin-react settings, '
+ + 'but the "flow-bin" package is not installed. Assuming latest Flow version for linting.');
+ return ULTIMATE_LATEST_SEMVER;
+ }
+ throw e;
+ }
+}
+
+function getFlowVersionFromContext(context) {
+ let confVer = defaultVersion;
+ // .eslintrc shared settings (https://eslint.org/docs/user-guide/configuring#adding-shared-settings)
+ if (context.settings.react && context.settings.react.flowVersion) {
+ let flowVersion = context.settings.react.flowVersion;
+ if (flowVersion === 'detect') {
+ flowVersion = detectFlowVersion(context);
+ }
+ if (typeof flowVersion !== 'string') {
+ error('Warning: Flow version specified in eslint-plugin-react-settings must be a string; '
+ + `got “${typeof flowVersion}”`);
+ }
+ confVer = String(flowVersion);
+ } else {
+ throw 'Could not retrieve flowVersion from settings'; // eslint-disable-line no-throw-literal
+ }
+
+ const result = convertConfVerToSemver(confVer);
+ if (!result) {
+ error(`Warning: Flow version specified in eslint-plugin-react-settings must be a valid semver version, or "detect"; got “${confVer}”`);
+ }
+ return result ? result.version : defaultVersion;
+}
+
+function test(semverRange, confVer) {
+ return semver.satisfies(confVer, semverRange);
+}
+
+function testReactVersion(context, semverRange) {
+ return test(semverRange, getReactVersionFromContext(context));
+}
+
+function testFlowVersion(context, semverRange) {
+ return test(semverRange, getFlowVersionFromContext(context));
+}
+
+module.exports = {
+ testReactVersion,
+ testFlowVersion,
+ resetWarningFlag,
+ resetDetectedVersion,
+ resetDefaultVersion,
+};
diff --git a/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/node_modules/.bin/semver b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/node_modules/.bin/semver
new file mode 100644
index 0000000000000000000000000000000000000000..16e6872b5778b5c43af2cefec45471c090be89b9
--- /dev/null
+++ b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/node_modules/.bin/semver
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a3ed56435cbd4b3f07a80c4a343edd86d787f89bf2cee0105bdf68cb653ba2a0
+size 4717
diff --git a/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/node_modules/doctrine/CHANGELOG.md b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/node_modules/doctrine/CHANGELOG.md
new file mode 100644
index 0000000000000000000000000000000000000000..57140d0fbda7d4eba4e217cf56ea46b495796524
--- /dev/null
+++ b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/node_modules/doctrine/CHANGELOG.md
@@ -0,0 +1,94 @@
+v2.1.0 - January 6, 2018
+
+* 827f314 Update: support node ranges (fixes #89) (#190) (Teddy Katz)
+
+v2.0.2 - November 25, 2017
+
+* 5049ee3 Fix: Remove redundant LICENSE/README names from files (#203) (Kevin Partington)
+
+v2.0.1 - November 10, 2017
+
+* 009f33d Fix: Making sure union type stringification respects compact flag (#199) (Mitermayer Reis)
+* 19da935 Use native String.prototype.trim instead of a custom implementation. (#201) (Rouven Weßling)
+* e3a011b chore: add mocha.opts to restore custom mocha config (Jason Kurian)
+* d888200 chore: adds nyc and a newer version of mocha to accurately report coverage (Jason Kurian)
+* 6b210a8 fix: support type expression for @this tag (fixes #181) (#182) (Frédéric Junod)
+* 1c4a4c7 fix: Allow array indexes in names (#193) (Tom MacWright)
+* 9aed54d Fix incorrect behavior when arrow functions are used as default values (#189) (Gaurab Paul)
+* 9efb6ca Upgrade: Use Array.isArray instead of isarray package (#195) (medanat)
+
+v2.0.0 - November 15, 2016
+
+* 7d7c5f1 Breaking: Re-license to Apache 2 (fixes #176) (#178) (Nicholas C. Zakas)
+* 5496132 Docs: Update license copyright (Nicholas C. Zakas)
+
+v1.5.0 - October 13, 2016
+
+* e33c6bb Update: Add support for BooleanLiteralType (#173) (Erik Arvidsson)
+
+v1.4.0 - September 13, 2016
+
+* d7426e5 Update: add ability to parse optional properties in typedefs (refs #5) (#174) (ikokostya)
+
+v1.3.0 - August 22, 2016
+
+* 12c7ad9 Update: Add support for numeric and string literal types (fixes #156) (#172) (Andrew Walter)
+
+v1.2.3 - August 16, 2016
+
+* b96a884 Build: Add CI release script (Nicholas C. Zakas)
+* 8d9b3c7 Upgrade: Upgrade esutils to v2.0.2 (fixes #170) (#171) (Emeegeemee)
+
+v1.2.2 - May 19, 2016
+
+* ebe0b08 Fix: Support case insensitive tags (fixes #163) (#164) (alberto)
+* 8e6d81e Chore: Remove copyright and license from headers (Nicholas C. Zakas)
+* 79035c6 Chore: Include jQuery Foundation copyright (Nicholas C. Zakas)
+* 06910a7 Fix: Preserve whitespace in default param string values (fixes #157) (Kai Cataldo)
+
+v1.2.1 - March 29, 2016
+
+* 1f54014 Fix: allow hyphens in names (fixes #116) (Kai Cataldo)
+* bbee469 Docs: Add issue template (Nicholas C. Zakas)
+
+v1.2.0 - February 19, 2016
+
+* 18136c5 Build: Cleanup build system (Nicholas C. Zakas)
+* b082f85 Update: Add support for slash in namepaths (fixes #100) (Ryan Duffy)
+* def53a2 Docs: Fix typo in option lineNumbers (Daniel Tschinder)
+* e2cbbc5 Update: Bump isarray to v1.0.0 (Shinnosuke Watanabe)
+* ae07aa8 Fix: Allow whitespace in optional param with default value (fixes #141) (chris)
+
+v1.1.0 - January 6, 2016
+
+* Build: Switch to Makefile.js (Nicholas C. Zakas)
+* New: support name expression for @this tag (fixes #143) (Tim Schaub)
+* Build: Update ESLint settings (Nicholas C. Zakas)
+
+v1.0.0 - December 21, 2015
+
+* New: parse caption tags in examples into separate property. (fixes #131) (Tom MacWright)
+
+v0.7.2 - November 27, 2015
+
+* Fix: Line numbers for some tags (fixes #138) Fixing issue where input was not consumed via advance() but was skipped when parsing tags resulting in sometimes incorrect reported lineNumber. (TEHEK)
+* Build: Add missing linefix package (Nicholas C. Zakas)
+
+v0.7.1 - November 13, 2015
+
+* Update: Begin switch to Makefile.js (Nicholas C. Zakas)
+* Fix: permit return tag without type (fixes #136) (Tom MacWright)
+* Fix: package.json homepage field (Bogdan Chadkin)
+* Fix: Parse array default syntax. Fixes #133 (Tom MacWright)
+* Fix: Last tag always has \n in the description (fixes #87) (Burak Yigit Kaya)
+* Docs: Add changelog (Nicholas C. Zakas)
+
+v0.7.0 - September 21, 2015
+
+* Docs: Update README with new info (fixes #127) (Nicholas C. Zakas)
+* Fix: Parsing fix for param with arrays and properties (fixes #111) (Gyandeep Singh)
+* Build: Add travis build (fixes #123) (Gyandeep Singh)
+* Fix: Parsing of parameter name without a type (fixes #120) (Gyandeep Singh)
+* New: added preserveWhitespace option (Aleks Totic)
+* New: Add "files" entry to only deploy select files (Rob Loach)
+* New: Add support and tests for typedefs. Refs #5 (Tom MacWright)
diff --git a/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/node_modules/doctrine/LICENSE b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/node_modules/doctrine/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..3e8ba72f69be5744b50a6347ec62253112c066b8
--- /dev/null
+++ b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/node_modules/doctrine/LICENSE
@@ -0,0 +1,177 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
diff --git a/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/node_modules/doctrine/LICENSE.closure-compiler b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/node_modules/doctrine/LICENSE.closure-compiler
new file mode 100644
index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7
--- /dev/null
+++ b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/node_modules/doctrine/LICENSE.closure-compiler
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/node_modules/doctrine/LICENSE.esprima b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/node_modules/doctrine/LICENSE.esprima
new file mode 100644
index 0000000000000000000000000000000000000000..3e580c355a96e5ab8c4fb2ea4ada2d62287de41f
--- /dev/null
+++ b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/node_modules/doctrine/LICENSE.esprima
@@ -0,0 +1,19 @@
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/node_modules/doctrine/README.md b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/node_modules/doctrine/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..26fad18b90d5c8b39864af4e7fd7e54958cd51fe
--- /dev/null
+++ b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/node_modules/doctrine/README.md
@@ -0,0 +1,165 @@
+[![NPM version][npm-image]][npm-url]
+[![build status][travis-image]][travis-url]
+[![Test coverage][coveralls-image]][coveralls-url]
+[![Downloads][downloads-image]][downloads-url]
+[](https://gitter.im/eslint/doctrine?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
+
+# Doctrine
+
+Doctrine is a [JSDoc](http://usejsdoc.org) parser that parses documentation comments from JavaScript (you need to pass in the comment, not a whole JavaScript file).
+
+## Installation
+
+You can install Doctrine using [npm](https://npmjs.com):
+
+```
+$ npm install doctrine --save-dev
+```
+
+Doctrine can also be used in web browsers using [Browserify](http://browserify.org).
+
+## Usage
+
+Require doctrine inside of your JavaScript:
+
+```js
+var doctrine = require("doctrine");
+```
+
+### parse()
+
+The primary method is `parse()`, which accepts two arguments: the JSDoc comment to parse and an optional options object. The available options are:
+
+* `unwrap` - set to `true` to delete the leading `/**`, any `*` that begins a line, and the trailing `*/` from the source text. Default: `false`.
+* `tags` - an array of tags to return. When specified, Doctrine returns only tags in this array. For example, if `tags` is `["param"]`, then only `@param` tags will be returned. Default: `null`.
+* `recoverable` - set to `true` to keep parsing even when syntax errors occur. Default: `false`.
+* `sloppy` - set to `true` to allow optional parameters to be specified in brackets (`@param {string} [foo]`). Default: `false`.
+* `lineNumbers` - set to `true` to add `lineNumber` to each node, specifying the line on which the node is found in the source. Default: `false`.
+* `range` - set to `true` to add `range` to each node, specifying the start and end index of the node in the original comment. Default: `false`.
+
+Here's a simple example:
+
+```js
+var ast = doctrine.parse(
+ [
+ "/**",
+ " * This function comment is parsed by doctrine",
+ " * @param {{ok:String}} userName",
+ "*/"
+ ].join('\n'), { unwrap: true });
+```
+
+This example returns the following AST:
+
+ {
+ "description": "This function comment is parsed by doctrine",
+ "tags": [
+ {
+ "title": "param",
+ "description": null,
+ "type": {
+ "type": "RecordType",
+ "fields": [
+ {
+ "type": "FieldType",
+ "key": "ok",
+ "value": {
+ "type": "NameExpression",
+ "name": "String"
+ }
+ }
+ ]
+ },
+ "name": "userName"
+ }
+ ]
+ }
+
+See the [demo page](http://eslint.org/doctrine/demo/) more detail.
+
+## Team
+
+These folks keep the project moving and are resources for help:
+
+* Nicholas C. Zakas ([@nzakas](https://github.com/nzakas)) - project lead
+* Yusuke Suzuki ([@constellation](https://github.com/constellation)) - reviewer
+
+## Contributing
+
+Issues and pull requests will be triaged and responded to as quickly as possible. We operate under the [ESLint Contributor Guidelines](http://eslint.org/docs/developer-guide/contributing), so please be sure to read them before contributing. If you're not sure where to dig in, check out the [issues](https://github.com/eslint/doctrine/issues).
+
+## Frequently Asked Questions
+
+### Can I pass a whole JavaScript file to Doctrine?
+
+No. Doctrine can only parse JSDoc comments, so you'll need to pass just the JSDoc comment to Doctrine in order to work.
+
+
+### License
+
+#### doctrine
+
+Copyright JS Foundation and other contributors, https://js.foundation
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+#### esprima
+
+some of functions is derived from esprima
+
+Copyright (C) 2012, 2011 [Ariya Hidayat](http://ariya.ofilabs.com/about)
+ (twitter: [@ariyahidayat](http://twitter.com/ariyahidayat)) and other contributors.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+#### closure-compiler
+
+some of extensions is derived from closure-compiler
+
+Apache License
+Version 2.0, January 2004
+http://www.apache.org/licenses/
+
+
+### Where to ask for help?
+
+Join our [Chatroom](https://gitter.im/eslint/doctrine)
+
+[npm-image]: https://img.shields.io/npm/v/doctrine.svg?style=flat-square
+[npm-url]: https://www.npmjs.com/package/doctrine
+[travis-image]: https://img.shields.io/travis/eslint/doctrine/master.svg?style=flat-square
+[travis-url]: https://travis-ci.org/eslint/doctrine
+[coveralls-image]: https://img.shields.io/coveralls/eslint/doctrine/master.svg?style=flat-square
+[coveralls-url]: https://coveralls.io/r/eslint/doctrine?branch=master
+[downloads-image]: http://img.shields.io/npm/dm/doctrine.svg?style=flat-square
+[downloads-url]: https://www.npmjs.com/package/doctrine
diff --git a/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/node_modules/doctrine/lib/doctrine.js b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/node_modules/doctrine/lib/doctrine.js
new file mode 100644
index 0000000000000000000000000000000000000000..1665afe9ef3ec1704a2cc6d63a27869116f4992c
--- /dev/null
+++ b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/node_modules/doctrine/lib/doctrine.js
@@ -0,0 +1,899 @@
+/*
+ * @fileoverview Main Doctrine object
+ * @author Yusuke Suzuki
+ * @author Dan Tao
+ * @author Andrew Eisenberg
+ */
+
+(function () {
+ 'use strict';
+
+ var typed,
+ utility,
+ jsdoc,
+ esutils,
+ hasOwnProperty;
+
+ esutils = require('esutils');
+ typed = require('./typed');
+ utility = require('./utility');
+
+ function sliceSource(source, index, last) {
+ return source.slice(index, last);
+ }
+
+ hasOwnProperty = (function () {
+ var func = Object.prototype.hasOwnProperty;
+ return function hasOwnProperty(obj, name) {
+ return func.call(obj, name);
+ };
+ }());
+
+ function shallowCopy(obj) {
+ var ret = {}, key;
+ for (key in obj) {
+ if (obj.hasOwnProperty(key)) {
+ ret[key] = obj[key];
+ }
+ }
+ return ret;
+ }
+
+ function isASCIIAlphanumeric(ch) {
+ return (ch >= 0x61 /* 'a' */ && ch <= 0x7A /* 'z' */) ||
+ (ch >= 0x41 /* 'A' */ && ch <= 0x5A /* 'Z' */) ||
+ (ch >= 0x30 /* '0' */ && ch <= 0x39 /* '9' */);
+ }
+
+ function isParamTitle(title) {
+ return title === 'param' || title === 'argument' || title === 'arg';
+ }
+
+ function isReturnTitle(title) {
+ return title === 'return' || title === 'returns';
+ }
+
+ function isProperty(title) {
+ return title === 'property' || title === 'prop';
+ }
+
+ function isNameParameterRequired(title) {
+ return isParamTitle(title) || isProperty(title) ||
+ title === 'alias' || title === 'this' || title === 'mixes' || title === 'requires';
+ }
+
+ function isAllowedName(title) {
+ return isNameParameterRequired(title) || title === 'const' || title === 'constant';
+ }
+
+ function isAllowedNested(title) {
+ return isProperty(title) || isParamTitle(title);
+ }
+
+ function isAllowedOptional(title) {
+ return isProperty(title) || isParamTitle(title);
+ }
+
+ function isTypeParameterRequired(title) {
+ return isParamTitle(title) || isReturnTitle(title) ||
+ title === 'define' || title === 'enum' ||
+ title === 'implements' || title === 'this' ||
+ title === 'type' || title === 'typedef' || isProperty(title);
+ }
+
+ // Consider deprecation instead using 'isTypeParameterRequired' and 'Rules' declaration to pick when a type is optional/required
+ // This would require changes to 'parseType'
+ function isAllowedType(title) {
+ return isTypeParameterRequired(title) || title === 'throws' || title === 'const' || title === 'constant' ||
+ title === 'namespace' || title === 'member' || title === 'var' || title === 'module' ||
+ title === 'constructor' || title === 'class' || title === 'extends' || title === 'augments' ||
+ title === 'public' || title === 'private' || title === 'protected';
+ }
+
+ // A regex character class that contains all whitespace except linebreak characters (\r, \n, \u2028, \u2029)
+ var WHITESPACE = '[ \\f\\t\\v\\u00a0\\u1680\\u180e\\u2000-\\u200a\\u202f\\u205f\\u3000\\ufeff]';
+
+ var STAR_MATCHER = '(' + WHITESPACE + '*(?:\\*' + WHITESPACE + '?)?)(.+|[\r\n\u2028\u2029])';
+
+ function unwrapComment(doc) {
+ // JSDoc comment is following form
+ // /**
+ // * .......
+ // */
+
+ return doc.
+ // remove /**
+ replace(/^\/\*\*?/, '').
+ // remove */
+ replace(/\*\/$/, '').
+ // remove ' * ' at the beginning of a line
+ replace(new RegExp(STAR_MATCHER, 'g'), '$2').
+ // remove trailing whitespace
+ replace(/\s*$/, '');
+ }
+
+ /**
+ * Converts an index in an "unwrapped" JSDoc comment to the corresponding index in the original "wrapped" version
+ * @param {string} originalSource The original wrapped comment
+ * @param {number} unwrappedIndex The index of a character in the unwrapped string
+ * @returns {number} The index of the corresponding character in the original wrapped string
+ */
+ function convertUnwrappedCommentIndex(originalSource, unwrappedIndex) {
+ var replacedSource = originalSource.replace(/^\/\*\*?/, '');
+ var numSkippedChars = 0;
+ var matcher = new RegExp(STAR_MATCHER, 'g');
+ var match;
+
+ while ((match = matcher.exec(replacedSource))) {
+ numSkippedChars += match[1].length;
+
+ if (match.index + match[0].length > unwrappedIndex + numSkippedChars) {
+ return unwrappedIndex + numSkippedChars + originalSource.length - replacedSource.length;
+ }
+ }
+
+ return originalSource.replace(/\*\/$/, '').replace(/\s*$/, '').length;
+ }
+
+ // JSDoc Tag Parser
+
+ (function (exports) {
+ var Rules,
+ index,
+ lineNumber,
+ length,
+ source,
+ originalSource,
+ recoverable,
+ sloppy,
+ strict;
+
+ function advance() {
+ var ch = source.charCodeAt(index);
+ index += 1;
+ if (esutils.code.isLineTerminator(ch) && !(ch === 0x0D /* '\r' */ && source.charCodeAt(index) === 0x0A /* '\n' */)) {
+ lineNumber += 1;
+ }
+ return String.fromCharCode(ch);
+ }
+
+ function scanTitle() {
+ var title = '';
+ // waste '@'
+ advance();
+
+ while (index < length && isASCIIAlphanumeric(source.charCodeAt(index))) {
+ title += advance();
+ }
+
+ return title;
+ }
+
+ function seekContent() {
+ var ch, waiting, last = index;
+
+ waiting = false;
+ while (last < length) {
+ ch = source.charCodeAt(last);
+ if (esutils.code.isLineTerminator(ch) && !(ch === 0x0D /* '\r' */ && source.charCodeAt(last + 1) === 0x0A /* '\n' */)) {
+ waiting = true;
+ } else if (waiting) {
+ if (ch === 0x40 /* '@' */) {
+ break;
+ }
+ if (!esutils.code.isWhiteSpace(ch)) {
+ waiting = false;
+ }
+ }
+ last += 1;
+ }
+ return last;
+ }
+
+ // type expression may have nest brace, such as,
+ // { { ok: string } }
+ //
+ // therefore, scanning type expression with balancing braces.
+ function parseType(title, last, addRange) {
+ var ch, brace, type, startIndex, direct = false;
+
+
+ // search '{'
+ while (index < last) {
+ ch = source.charCodeAt(index);
+ if (esutils.code.isWhiteSpace(ch)) {
+ advance();
+ } else if (ch === 0x7B /* '{' */) {
+ advance();
+ break;
+ } else {
+ // this is direct pattern
+ direct = true;
+ break;
+ }
+ }
+
+
+ if (direct) {
+ return null;
+ }
+
+ // type expression { is found
+ brace = 1;
+ type = '';
+ while (index < last) {
+ ch = source.charCodeAt(index);
+ if (esutils.code.isLineTerminator(ch)) {
+ advance();
+ } else {
+ if (ch === 0x7D /* '}' */) {
+ brace -= 1;
+ if (brace === 0) {
+ advance();
+ break;
+ }
+ } else if (ch === 0x7B /* '{' */) {
+ brace += 1;
+ }
+ if (type === '') {
+ startIndex = index;
+ }
+ type += advance();
+ }
+ }
+
+ if (brace !== 0) {
+ // braces is not balanced
+ return utility.throwError('Braces are not balanced');
+ }
+
+ if (isAllowedOptional(title)) {
+ return typed.parseParamType(type, {startIndex: convertIndex(startIndex), range: addRange});
+ }
+
+ return typed.parseType(type, {startIndex: convertIndex(startIndex), range: addRange});
+ }
+
+ function scanIdentifier(last) {
+ var identifier;
+ if (!esutils.code.isIdentifierStartES5(source.charCodeAt(index)) && !source[index].match(/[0-9]/)) {
+ return null;
+ }
+ identifier = advance();
+ while (index < last && esutils.code.isIdentifierPartES5(source.charCodeAt(index))) {
+ identifier += advance();
+ }
+ return identifier;
+ }
+
+ function skipWhiteSpace(last) {
+ while (index < last && (esutils.code.isWhiteSpace(source.charCodeAt(index)) || esutils.code.isLineTerminator(source.charCodeAt(index)))) {
+ advance();
+ }
+ }
+
+ function parseName(last, allowBrackets, allowNestedParams) {
+ var name = '',
+ useBrackets,
+ insideString;
+
+
+ skipWhiteSpace(last);
+
+ if (index >= last) {
+ return null;
+ }
+
+ if (source.charCodeAt(index) === 0x5B /* '[' */) {
+ if (allowBrackets) {
+ useBrackets = true;
+ name = advance();
+ } else {
+ return null;
+ }
+ }
+
+ name += scanIdentifier(last);
+
+ if (allowNestedParams) {
+ if (source.charCodeAt(index) === 0x3A /* ':' */ && (
+ name === 'module' ||
+ name === 'external' ||
+ name === 'event')) {
+ name += advance();
+ name += scanIdentifier(last);
+
+ }
+ if(source.charCodeAt(index) === 0x5B /* '[' */ && source.charCodeAt(index + 1) === 0x5D /* ']' */){
+ name += advance();
+ name += advance();
+ }
+ while (source.charCodeAt(index) === 0x2E /* '.' */ ||
+ source.charCodeAt(index) === 0x2F /* '/' */ ||
+ source.charCodeAt(index) === 0x23 /* '#' */ ||
+ source.charCodeAt(index) === 0x2D /* '-' */ ||
+ source.charCodeAt(index) === 0x7E /* '~' */) {
+ name += advance();
+ name += scanIdentifier(last);
+ }
+ }
+
+ if (useBrackets) {
+ skipWhiteSpace(last);
+ // do we have a default value for this?
+ if (source.charCodeAt(index) === 0x3D /* '=' */) {
+ // consume the '='' symbol
+ name += advance();
+ skipWhiteSpace(last);
+
+ var ch;
+ var bracketDepth = 1;
+
+ // scan in the default value
+ while (index < last) {
+ ch = source.charCodeAt(index);
+
+ if (esutils.code.isWhiteSpace(ch)) {
+ if (!insideString) {
+ skipWhiteSpace(last);
+ ch = source.charCodeAt(index);
+ }
+ }
+
+ if (ch === 0x27 /* ''' */) {
+ if (!insideString) {
+ insideString = '\'';
+ } else {
+ if (insideString === '\'') {
+ insideString = '';
+ }
+ }
+ }
+
+ if (ch === 0x22 /* '"' */) {
+ if (!insideString) {
+ insideString = '"';
+ } else {
+ if (insideString === '"') {
+ insideString = '';
+ }
+ }
+ }
+
+ if (ch === 0x5B /* '[' */) {
+ bracketDepth++;
+ } else if (ch === 0x5D /* ']' */ &&
+ --bracketDepth === 0) {
+ break;
+ }
+
+ name += advance();
+ }
+ }
+
+ skipWhiteSpace(last);
+
+ if (index >= last || source.charCodeAt(index) !== 0x5D /* ']' */) {
+ // we never found a closing ']'
+ return null;
+ }
+
+ // collect the last ']'
+ name += advance();
+ }
+
+ return name;
+ }
+
+ function skipToTag() {
+ while (index < length && source.charCodeAt(index) !== 0x40 /* '@' */) {
+ advance();
+ }
+ if (index >= length) {
+ return false;
+ }
+ utility.assert(source.charCodeAt(index) === 0x40 /* '@' */);
+ return true;
+ }
+
+ function convertIndex(rangeIndex) {
+ if (source === originalSource) {
+ return rangeIndex;
+ }
+ return convertUnwrappedCommentIndex(originalSource, rangeIndex);
+ }
+
+ function TagParser(options, title) {
+ this._options = options;
+ this._title = title.toLowerCase();
+ this._tag = {
+ title: title,
+ description: null
+ };
+ if (this._options.lineNumbers) {
+ this._tag.lineNumber = lineNumber;
+ }
+ this._first = index - title.length - 1;
+ this._last = 0;
+ // space to save special information for title parsers.
+ this._extra = { };
+ }
+
+ // addError(err, ...)
+ TagParser.prototype.addError = function addError(errorText) {
+ var args = Array.prototype.slice.call(arguments, 1),
+ msg = errorText.replace(
+ /%(\d)/g,
+ function (whole, index) {
+ utility.assert(index < args.length, 'Message reference must be in range');
+ return args[index];
+ }
+ );
+
+ if (!this._tag.errors) {
+ this._tag.errors = [];
+ }
+ if (strict) {
+ utility.throwError(msg);
+ }
+ this._tag.errors.push(msg);
+ return recoverable;
+ };
+
+ TagParser.prototype.parseType = function () {
+ // type required titles
+ if (isTypeParameterRequired(this._title)) {
+ try {
+ this._tag.type = parseType(this._title, this._last, this._options.range);
+ if (!this._tag.type) {
+ if (!isParamTitle(this._title) && !isReturnTitle(this._title)) {
+ if (!this.addError('Missing or invalid tag type')) {
+ return false;
+ }
+ }
+ }
+ } catch (error) {
+ this._tag.type = null;
+ if (!this.addError(error.message)) {
+ return false;
+ }
+ }
+ } else if (isAllowedType(this._title)) {
+ // optional types
+ try {
+ this._tag.type = parseType(this._title, this._last, this._options.range);
+ } catch (e) {
+ //For optional types, lets drop the thrown error when we hit the end of the file
+ }
+ }
+ return true;
+ };
+
+ TagParser.prototype._parseNamePath = function (optional) {
+ var name;
+ name = parseName(this._last, sloppy && isAllowedOptional(this._title), true);
+ if (!name) {
+ if (!optional) {
+ if (!this.addError('Missing or invalid tag name')) {
+ return false;
+ }
+ }
+ }
+ this._tag.name = name;
+ return true;
+ };
+
+ TagParser.prototype.parseNamePath = function () {
+ return this._parseNamePath(false);
+ };
+
+ TagParser.prototype.parseNamePathOptional = function () {
+ return this._parseNamePath(true);
+ };
+
+
+ TagParser.prototype.parseName = function () {
+ var assign, name;
+
+ // param, property requires name
+ if (isAllowedName(this._title)) {
+ this._tag.name = parseName(this._last, sloppy && isAllowedOptional(this._title), isAllowedNested(this._title));
+ if (!this._tag.name) {
+ if (!isNameParameterRequired(this._title)) {
+ return true;
+ }
+
+ // it's possible the name has already been parsed but interpreted as a type
+ // it's also possible this is a sloppy declaration, in which case it will be
+ // fixed at the end
+ if (isParamTitle(this._title) && this._tag.type && this._tag.type.name) {
+ this._extra.name = this._tag.type;
+ this._tag.name = this._tag.type.name;
+ this._tag.type = null;
+ } else {
+ if (!this.addError('Missing or invalid tag name')) {
+ return false;
+ }
+ }
+ } else {
+ name = this._tag.name;
+ if (name.charAt(0) === '[' && name.charAt(name.length - 1) === ']') {
+ // extract the default value if there is one
+ // example: @param {string} [somebody=John Doe] description
+ assign = name.substring(1, name.length - 1).split('=');
+ if (assign.length > 1) {
+ this._tag['default'] = assign.slice(1).join('=');
+ }
+ this._tag.name = assign[0];
+
+ // convert to an optional type
+ if (this._tag.type && this._tag.type.type !== 'OptionalType') {
+ this._tag.type = {
+ type: 'OptionalType',
+ expression: this._tag.type
+ };
+ }
+ }
+ }
+ }
+
+
+ return true;
+ };
+
+ TagParser.prototype.parseDescription = function parseDescription() {
+ var description = sliceSource(source, index, this._last).trim();
+ if (description) {
+ if ((/^-\s+/).test(description)) {
+ description = description.substring(2);
+ }
+ this._tag.description = description;
+ }
+ return true;
+ };
+
+ TagParser.prototype.parseCaption = function parseDescription() {
+ var description = sliceSource(source, index, this._last).trim();
+ var captionStartTag = '';
+ var captionEndTag = '';
+ var captionStart = description.indexOf(captionStartTag);
+ var captionEnd = description.indexOf(captionEndTag);
+ if (captionStart >= 0 && captionEnd >= 0) {
+ this._tag.caption = description.substring(
+ captionStart + captionStartTag.length, captionEnd).trim();
+ this._tag.description = description.substring(captionEnd + captionEndTag.length).trim();
+ } else {
+ this._tag.description = description;
+ }
+ return true;
+ };
+
+ TagParser.prototype.parseKind = function parseKind() {
+ var kind, kinds;
+ kinds = {
+ 'class': true,
+ 'constant': true,
+ 'event': true,
+ 'external': true,
+ 'file': true,
+ 'function': true,
+ 'member': true,
+ 'mixin': true,
+ 'module': true,
+ 'namespace': true,
+ 'typedef': true
+ };
+ kind = sliceSource(source, index, this._last).trim();
+ this._tag.kind = kind;
+ if (!hasOwnProperty(kinds, kind)) {
+ if (!this.addError('Invalid kind name \'%0\'', kind)) {
+ return false;
+ }
+ }
+ return true;
+ };
+
+ TagParser.prototype.parseAccess = function parseAccess() {
+ var access;
+ access = sliceSource(source, index, this._last).trim();
+ this._tag.access = access;
+ if (access !== 'private' && access !== 'protected' && access !== 'public') {
+ if (!this.addError('Invalid access name \'%0\'', access)) {
+ return false;
+ }
+ }
+ return true;
+ };
+
+ TagParser.prototype.parseThis = function parseThis() {
+ // this name may be a name expression (e.g. {foo.bar}),
+ // an union (e.g. {foo.bar|foo.baz}) or a name path (e.g. foo.bar)
+ var value = sliceSource(source, index, this._last).trim();
+ if (value && value.charAt(0) === '{') {
+ var gotType = this.parseType();
+ if (gotType && this._tag.type.type === 'NameExpression' || this._tag.type.type === 'UnionType') {
+ this._tag.name = this._tag.type.name;
+ return true;
+ } else {
+ return this.addError('Invalid name for this');
+ }
+ } else {
+ return this.parseNamePath();
+ }
+ };
+
+ TagParser.prototype.parseVariation = function parseVariation() {
+ var variation, text;
+ text = sliceSource(source, index, this._last).trim();
+ variation = parseFloat(text, 10);
+ this._tag.variation = variation;
+ if (isNaN(variation)) {
+ if (!this.addError('Invalid variation \'%0\'', text)) {
+ return false;
+ }
+ }
+ return true;
+ };
+
+ TagParser.prototype.ensureEnd = function () {
+ var shouldBeEmpty = sliceSource(source, index, this._last).trim();
+ if (shouldBeEmpty) {
+ if (!this.addError('Unknown content \'%0\'', shouldBeEmpty)) {
+ return false;
+ }
+ }
+ return true;
+ };
+
+ TagParser.prototype.epilogue = function epilogue() {
+ var description;
+
+ description = this._tag.description;
+ // un-fix potentially sloppy declaration
+ if (isAllowedOptional(this._title) && !this._tag.type && description && description.charAt(0) === '[') {
+ this._tag.type = this._extra.name;
+ if (!this._tag.name) {
+ this._tag.name = undefined;
+ }
+
+ if (!sloppy) {
+ if (!this.addError('Missing or invalid tag name')) {
+ return false;
+ }
+ }
+ }
+
+ return true;
+ };
+
+ Rules = {
+ // http://usejsdoc.org/tags-access.html
+ 'access': ['parseAccess'],
+ // http://usejsdoc.org/tags-alias.html
+ 'alias': ['parseNamePath', 'ensureEnd'],
+ // http://usejsdoc.org/tags-augments.html
+ 'augments': ['parseType', 'parseNamePathOptional', 'ensureEnd'],
+ // http://usejsdoc.org/tags-constructor.html
+ 'constructor': ['parseType', 'parseNamePathOptional', 'ensureEnd'],
+ // Synonym: http://usejsdoc.org/tags-constructor.html
+ 'class': ['parseType', 'parseNamePathOptional', 'ensureEnd'],
+ // Synonym: http://usejsdoc.org/tags-extends.html
+ 'extends': ['parseType', 'parseNamePathOptional', 'ensureEnd'],
+ // http://usejsdoc.org/tags-example.html
+ 'example': ['parseCaption'],
+ // http://usejsdoc.org/tags-deprecated.html
+ 'deprecated': ['parseDescription'],
+ // http://usejsdoc.org/tags-global.html
+ 'global': ['ensureEnd'],
+ // http://usejsdoc.org/tags-inner.html
+ 'inner': ['ensureEnd'],
+ // http://usejsdoc.org/tags-instance.html
+ 'instance': ['ensureEnd'],
+ // http://usejsdoc.org/tags-kind.html
+ 'kind': ['parseKind'],
+ // http://usejsdoc.org/tags-mixes.html
+ 'mixes': ['parseNamePath', 'ensureEnd'],
+ // http://usejsdoc.org/tags-mixin.html
+ 'mixin': ['parseNamePathOptional', 'ensureEnd'],
+ // http://usejsdoc.org/tags-member.html
+ 'member': ['parseType', 'parseNamePathOptional', 'ensureEnd'],
+ // http://usejsdoc.org/tags-method.html
+ 'method': ['parseNamePathOptional', 'ensureEnd'],
+ // http://usejsdoc.org/tags-module.html
+ 'module': ['parseType', 'parseNamePathOptional', 'ensureEnd'],
+ // Synonym: http://usejsdoc.org/tags-method.html
+ 'func': ['parseNamePathOptional', 'ensureEnd'],
+ // Synonym: http://usejsdoc.org/tags-method.html
+ 'function': ['parseNamePathOptional', 'ensureEnd'],
+ // Synonym: http://usejsdoc.org/tags-member.html
+ 'var': ['parseType', 'parseNamePathOptional', 'ensureEnd'],
+ // http://usejsdoc.org/tags-name.html
+ 'name': ['parseNamePath', 'ensureEnd'],
+ // http://usejsdoc.org/tags-namespace.html
+ 'namespace': ['parseType', 'parseNamePathOptional', 'ensureEnd'],
+ // http://usejsdoc.org/tags-private.html
+ 'private': ['parseType', 'parseDescription'],
+ // http://usejsdoc.org/tags-protected.html
+ 'protected': ['parseType', 'parseDescription'],
+ // http://usejsdoc.org/tags-public.html
+ 'public': ['parseType', 'parseDescription'],
+ // http://usejsdoc.org/tags-readonly.html
+ 'readonly': ['ensureEnd'],
+ // http://usejsdoc.org/tags-requires.html
+ 'requires': ['parseNamePath', 'ensureEnd'],
+ // http://usejsdoc.org/tags-since.html
+ 'since': ['parseDescription'],
+ // http://usejsdoc.org/tags-static.html
+ 'static': ['ensureEnd'],
+ // http://usejsdoc.org/tags-summary.html
+ 'summary': ['parseDescription'],
+ // http://usejsdoc.org/tags-this.html
+ 'this': ['parseThis', 'ensureEnd'],
+ // http://usejsdoc.org/tags-todo.html
+ 'todo': ['parseDescription'],
+ // http://usejsdoc.org/tags-typedef.html
+ 'typedef': ['parseType', 'parseNamePathOptional'],
+ // http://usejsdoc.org/tags-variation.html
+ 'variation': ['parseVariation'],
+ // http://usejsdoc.org/tags-version.html
+ 'version': ['parseDescription']
+ };
+
+ TagParser.prototype.parse = function parse() {
+ var i, iz, sequences, method;
+
+
+ // empty title
+ if (!this._title) {
+ if (!this.addError('Missing or invalid title')) {
+ return null;
+ }
+ }
+
+ // Seek to content last index.
+ this._last = seekContent(this._title);
+
+ if (this._options.range) {
+ this._tag.range = [this._first, source.slice(0, this._last).replace(/\s*$/, '').length].map(convertIndex);
+ }
+
+ if (hasOwnProperty(Rules, this._title)) {
+ sequences = Rules[this._title];
+ } else {
+ // default sequences
+ sequences = ['parseType', 'parseName', 'parseDescription', 'epilogue'];
+ }
+
+ for (i = 0, iz = sequences.length; i < iz; ++i) {
+ method = sequences[i];
+ if (!this[method]()) {
+ return null;
+ }
+ }
+
+ return this._tag;
+ };
+
+ function parseTag(options) {
+ var title, parser, tag;
+
+ // skip to tag
+ if (!skipToTag()) {
+ return null;
+ }
+
+ // scan title
+ title = scanTitle();
+
+ // construct tag parser
+ parser = new TagParser(options, title);
+ tag = parser.parse();
+
+ // Seek global index to end of this tag.
+ while (index < parser._last) {
+ advance();
+ }
+
+ return tag;
+ }
+
+ //
+ // Parse JSDoc
+ //
+
+ function scanJSDocDescription(preserveWhitespace) {
+ var description = '', ch, atAllowed;
+
+ atAllowed = true;
+ while (index < length) {
+ ch = source.charCodeAt(index);
+
+ if (atAllowed && ch === 0x40 /* '@' */) {
+ break;
+ }
+
+ if (esutils.code.isLineTerminator(ch)) {
+ atAllowed = true;
+ } else if (atAllowed && !esutils.code.isWhiteSpace(ch)) {
+ atAllowed = false;
+ }
+
+ description += advance();
+ }
+
+ return preserveWhitespace ? description : description.trim();
+ }
+
+ function parse(comment, options) {
+ var tags = [], tag, description, interestingTags, i, iz;
+
+ if (options === undefined) {
+ options = {};
+ }
+
+ if (typeof options.unwrap === 'boolean' && options.unwrap) {
+ source = unwrapComment(comment);
+ } else {
+ source = comment;
+ }
+
+ originalSource = comment;
+
+ // array of relevant tags
+ if (options.tags) {
+ if (Array.isArray(options.tags)) {
+ interestingTags = { };
+ for (i = 0, iz = options.tags.length; i < iz; i++) {
+ if (typeof options.tags[i] === 'string') {
+ interestingTags[options.tags[i]] = true;
+ } else {
+ utility.throwError('Invalid "tags" parameter: ' + options.tags);
+ }
+ }
+ } else {
+ utility.throwError('Invalid "tags" parameter: ' + options.tags);
+ }
+ }
+
+ length = source.length;
+ index = 0;
+ lineNumber = 0;
+ recoverable = options.recoverable;
+ sloppy = options.sloppy;
+ strict = options.strict;
+
+ description = scanJSDocDescription(options.preserveWhitespace);
+
+ while (true) {
+ tag = parseTag(options);
+ if (!tag) {
+ break;
+ }
+ if (!interestingTags || interestingTags.hasOwnProperty(tag.title)) {
+ tags.push(tag);
+ }
+ }
+
+ return {
+ description: description,
+ tags: tags
+ };
+ }
+ exports.parse = parse;
+ }(jsdoc = {}));
+
+ exports.version = utility.VERSION;
+ exports.parse = jsdoc.parse;
+ exports.parseType = typed.parseType;
+ exports.parseParamType = typed.parseParamType;
+ exports.unwrapComment = unwrapComment;
+ exports.Syntax = shallowCopy(typed.Syntax);
+ exports.Error = utility.DoctrineError;
+ exports.type = {
+ Syntax: exports.Syntax,
+ parseType: typed.parseType,
+ parseParamType: typed.parseParamType,
+ stringify: typed.stringify
+ };
+}());
+/* vim: set sw=4 ts=4 et tw=80 : */
diff --git a/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/node_modules/doctrine/lib/typed.js b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/node_modules/doctrine/lib/typed.js
new file mode 100644
index 0000000000000000000000000000000000000000..bdd3c394fc7d1fb57c3beb38f9655fe327c4db0f
--- /dev/null
+++ b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/node_modules/doctrine/lib/typed.js
@@ -0,0 +1,1305 @@
+/*
+ * @fileoverview Type expression parser.
+ * @author Yusuke Suzuki
+ * @author Dan Tao
+ * @author Andrew Eisenberg
+ */
+
+// "typed", the Type Expression Parser for doctrine.
+
+(function () {
+ 'use strict';
+
+ var Syntax,
+ Token,
+ source,
+ length,
+ index,
+ previous,
+ token,
+ value,
+ esutils,
+ utility,
+ rangeOffset,
+ addRange;
+
+ esutils = require('esutils');
+ utility = require('./utility');
+
+ Syntax = {
+ NullableLiteral: 'NullableLiteral',
+ AllLiteral: 'AllLiteral',
+ NullLiteral: 'NullLiteral',
+ UndefinedLiteral: 'UndefinedLiteral',
+ VoidLiteral: 'VoidLiteral',
+ UnionType: 'UnionType',
+ ArrayType: 'ArrayType',
+ RecordType: 'RecordType',
+ FieldType: 'FieldType',
+ FunctionType: 'FunctionType',
+ ParameterType: 'ParameterType',
+ RestType: 'RestType',
+ NonNullableType: 'NonNullableType',
+ OptionalType: 'OptionalType',
+ NullableType: 'NullableType',
+ NameExpression: 'NameExpression',
+ TypeApplication: 'TypeApplication',
+ StringLiteralType: 'StringLiteralType',
+ NumericLiteralType: 'NumericLiteralType',
+ BooleanLiteralType: 'BooleanLiteralType'
+ };
+
+ Token = {
+ ILLEGAL: 0, // ILLEGAL
+ DOT_LT: 1, // .<
+ REST: 2, // ...
+ LT: 3, // <
+ GT: 4, // >
+ LPAREN: 5, // (
+ RPAREN: 6, // )
+ LBRACE: 7, // {
+ RBRACE: 8, // }
+ LBRACK: 9, // [
+ RBRACK: 10, // ]
+ COMMA: 11, // ,
+ COLON: 12, // :
+ STAR: 13, // *
+ PIPE: 14, // |
+ QUESTION: 15, // ?
+ BANG: 16, // !
+ EQUAL: 17, // =
+ NAME: 18, // name token
+ STRING: 19, // string
+ NUMBER: 20, // number
+ EOF: 21
+ };
+
+ function isTypeName(ch) {
+ return '><(){}[],:*|?!='.indexOf(String.fromCharCode(ch)) === -1 && !esutils.code.isWhiteSpace(ch) && !esutils.code.isLineTerminator(ch);
+ }
+
+ function Context(previous, index, token, value) {
+ this._previous = previous;
+ this._index = index;
+ this._token = token;
+ this._value = value;
+ }
+
+ Context.prototype.restore = function () {
+ previous = this._previous;
+ index = this._index;
+ token = this._token;
+ value = this._value;
+ };
+
+ Context.save = function () {
+ return new Context(previous, index, token, value);
+ };
+
+ function maybeAddRange(node, range) {
+ if (addRange) {
+ node.range = [range[0] + rangeOffset, range[1] + rangeOffset];
+ }
+ return node;
+ }
+
+ function advance() {
+ var ch = source.charAt(index);
+ index += 1;
+ return ch;
+ }
+
+ function scanHexEscape(prefix) {
+ var i, len, ch, code = 0;
+
+ len = (prefix === 'u') ? 4 : 2;
+ for (i = 0; i < len; ++i) {
+ if (index < length && esutils.code.isHexDigit(source.charCodeAt(index))) {
+ ch = advance();
+ code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase());
+ } else {
+ return '';
+ }
+ }
+ return String.fromCharCode(code);
+ }
+
+ function scanString() {
+ var str = '', quote, ch, code, unescaped, restore; //TODO review removal octal = false
+ quote = source.charAt(index);
+ ++index;
+
+ while (index < length) {
+ ch = advance();
+
+ if (ch === quote) {
+ quote = '';
+ break;
+ } else if (ch === '\\') {
+ ch = advance();
+ if (!esutils.code.isLineTerminator(ch.charCodeAt(0))) {
+ switch (ch) {
+ case 'n':
+ str += '\n';
+ break;
+ case 'r':
+ str += '\r';
+ break;
+ case 't':
+ str += '\t';
+ break;
+ case 'u':
+ case 'x':
+ restore = index;
+ unescaped = scanHexEscape(ch);
+ if (unescaped) {
+ str += unescaped;
+ } else {
+ index = restore;
+ str += ch;
+ }
+ break;
+ case 'b':
+ str += '\b';
+ break;
+ case 'f':
+ str += '\f';
+ break;
+ case 'v':
+ str += '\v';
+ break;
+
+ default:
+ if (esutils.code.isOctalDigit(ch.charCodeAt(0))) {
+ code = '01234567'.indexOf(ch);
+
+ // \0 is not octal escape sequence
+ // Deprecating unused code. TODO review removal
+ //if (code !== 0) {
+ // octal = true;
+ //}
+
+ if (index < length && esutils.code.isOctalDigit(source.charCodeAt(index))) {
+ //TODO Review Removal octal = true;
+ code = code * 8 + '01234567'.indexOf(advance());
+
+ // 3 digits are only allowed when string starts
+ // with 0, 1, 2, 3
+ if ('0123'.indexOf(ch) >= 0 &&
+ index < length &&
+ esutils.code.isOctalDigit(source.charCodeAt(index))) {
+ code = code * 8 + '01234567'.indexOf(advance());
+ }
+ }
+ str += String.fromCharCode(code);
+ } else {
+ str += ch;
+ }
+ break;
+ }
+ } else {
+ if (ch === '\r' && source.charCodeAt(index) === 0x0A /* '\n' */) {
+ ++index;
+ }
+ }
+ } else if (esutils.code.isLineTerminator(ch.charCodeAt(0))) {
+ break;
+ } else {
+ str += ch;
+ }
+ }
+
+ if (quote !== '') {
+ utility.throwError('unexpected quote');
+ }
+
+ value = str;
+ return Token.STRING;
+ }
+
+ function scanNumber() {
+ var number, ch;
+
+ number = '';
+ ch = source.charCodeAt(index);
+
+ if (ch !== 0x2E /* '.' */) {
+ number = advance();
+ ch = source.charCodeAt(index);
+
+ if (number === '0') {
+ if (ch === 0x78 /* 'x' */ || ch === 0x58 /* 'X' */) {
+ number += advance();
+ while (index < length) {
+ ch = source.charCodeAt(index);
+ if (!esutils.code.isHexDigit(ch)) {
+ break;
+ }
+ number += advance();
+ }
+
+ if (number.length <= 2) {
+ // only 0x
+ utility.throwError('unexpected token');
+ }
+
+ if (index < length) {
+ ch = source.charCodeAt(index);
+ if (esutils.code.isIdentifierStartES5(ch)) {
+ utility.throwError('unexpected token');
+ }
+ }
+ value = parseInt(number, 16);
+ return Token.NUMBER;
+ }
+
+ if (esutils.code.isOctalDigit(ch)) {
+ number += advance();
+ while (index < length) {
+ ch = source.charCodeAt(index);
+ if (!esutils.code.isOctalDigit(ch)) {
+ break;
+ }
+ number += advance();
+ }
+
+ if (index < length) {
+ ch = source.charCodeAt(index);
+ if (esutils.code.isIdentifierStartES5(ch) || esutils.code.isDecimalDigit(ch)) {
+ utility.throwError('unexpected token');
+ }
+ }
+ value = parseInt(number, 8);
+ return Token.NUMBER;
+ }
+
+ if (esutils.code.isDecimalDigit(ch)) {
+ utility.throwError('unexpected token');
+ }
+ }
+
+ while (index < length) {
+ ch = source.charCodeAt(index);
+ if (!esutils.code.isDecimalDigit(ch)) {
+ break;
+ }
+ number += advance();
+ }
+ }
+
+ if (ch === 0x2E /* '.' */) {
+ number += advance();
+ while (index < length) {
+ ch = source.charCodeAt(index);
+ if (!esutils.code.isDecimalDigit(ch)) {
+ break;
+ }
+ number += advance();
+ }
+ }
+
+ if (ch === 0x65 /* 'e' */ || ch === 0x45 /* 'E' */) {
+ number += advance();
+
+ ch = source.charCodeAt(index);
+ if (ch === 0x2B /* '+' */ || ch === 0x2D /* '-' */) {
+ number += advance();
+ }
+
+ ch = source.charCodeAt(index);
+ if (esutils.code.isDecimalDigit(ch)) {
+ number += advance();
+ while (index < length) {
+ ch = source.charCodeAt(index);
+ if (!esutils.code.isDecimalDigit(ch)) {
+ break;
+ }
+ number += advance();
+ }
+ } else {
+ utility.throwError('unexpected token');
+ }
+ }
+
+ if (index < length) {
+ ch = source.charCodeAt(index);
+ if (esutils.code.isIdentifierStartES5(ch)) {
+ utility.throwError('unexpected token');
+ }
+ }
+
+ value = parseFloat(number);
+ return Token.NUMBER;
+ }
+
+
+ function scanTypeName() {
+ var ch, ch2;
+
+ value = advance();
+ while (index < length && isTypeName(source.charCodeAt(index))) {
+ ch = source.charCodeAt(index);
+ if (ch === 0x2E /* '.' */) {
+ if ((index + 1) >= length) {
+ return Token.ILLEGAL;
+ }
+ ch2 = source.charCodeAt(index + 1);
+ if (ch2 === 0x3C /* '<' */) {
+ break;
+ }
+ }
+ value += advance();
+ }
+ return Token.NAME;
+ }
+
+ function next() {
+ var ch;
+
+ previous = index;
+
+ while (index < length && esutils.code.isWhiteSpace(source.charCodeAt(index))) {
+ advance();
+ }
+ if (index >= length) {
+ token = Token.EOF;
+ return token;
+ }
+
+ ch = source.charCodeAt(index);
+ switch (ch) {
+ case 0x27: /* ''' */
+ case 0x22: /* '"' */
+ token = scanString();
+ return token;
+
+ case 0x3A: /* ':' */
+ advance();
+ token = Token.COLON;
+ return token;
+
+ case 0x2C: /* ',' */
+ advance();
+ token = Token.COMMA;
+ return token;
+
+ case 0x28: /* '(' */
+ advance();
+ token = Token.LPAREN;
+ return token;
+
+ case 0x29: /* ')' */
+ advance();
+ token = Token.RPAREN;
+ return token;
+
+ case 0x5B: /* '[' */
+ advance();
+ token = Token.LBRACK;
+ return token;
+
+ case 0x5D: /* ']' */
+ advance();
+ token = Token.RBRACK;
+ return token;
+
+ case 0x7B: /* '{' */
+ advance();
+ token = Token.LBRACE;
+ return token;
+
+ case 0x7D: /* '}' */
+ advance();
+ token = Token.RBRACE;
+ return token;
+
+ case 0x2E: /* '.' */
+ if (index + 1 < length) {
+ ch = source.charCodeAt(index + 1);
+ if (ch === 0x3C /* '<' */) {
+ advance(); // '.'
+ advance(); // '<'
+ token = Token.DOT_LT;
+ return token;
+ }
+
+ if (ch === 0x2E /* '.' */ && index + 2 < length && source.charCodeAt(index + 2) === 0x2E /* '.' */) {
+ advance(); // '.'
+ advance(); // '.'
+ advance(); // '.'
+ token = Token.REST;
+ return token;
+ }
+
+ if (esutils.code.isDecimalDigit(ch)) {
+ token = scanNumber();
+ return token;
+ }
+ }
+ token = Token.ILLEGAL;
+ return token;
+
+ case 0x3C: /* '<' */
+ advance();
+ token = Token.LT;
+ return token;
+
+ case 0x3E: /* '>' */
+ advance();
+ token = Token.GT;
+ return token;
+
+ case 0x2A: /* '*' */
+ advance();
+ token = Token.STAR;
+ return token;
+
+ case 0x7C: /* '|' */
+ advance();
+ token = Token.PIPE;
+ return token;
+
+ case 0x3F: /* '?' */
+ advance();
+ token = Token.QUESTION;
+ return token;
+
+ case 0x21: /* '!' */
+ advance();
+ token = Token.BANG;
+ return token;
+
+ case 0x3D: /* '=' */
+ advance();
+ token = Token.EQUAL;
+ return token;
+
+ case 0x2D: /* '-' */
+ token = scanNumber();
+ return token;
+
+ default:
+ if (esutils.code.isDecimalDigit(ch)) {
+ token = scanNumber();
+ return token;
+ }
+
+ // type string permits following case,
+ //
+ // namespace.module.MyClass
+ //
+ // this reduced 1 token TK_NAME
+ utility.assert(isTypeName(ch));
+ token = scanTypeName();
+ return token;
+ }
+ }
+
+ function consume(target, text) {
+ utility.assert(token === target, text || 'consumed token not matched');
+ next();
+ }
+
+ function expect(target, message) {
+ if (token !== target) {
+ utility.throwError(message || 'unexpected token');
+ }
+ next();
+ }
+
+ // UnionType := '(' TypeUnionList ')'
+ //
+ // TypeUnionList :=
+ // <>
+ // | NonemptyTypeUnionList
+ //
+ // NonemptyTypeUnionList :=
+ // TypeExpression
+ // | TypeExpression '|' NonemptyTypeUnionList
+ function parseUnionType() {
+ var elements, startIndex = index - 1;
+ consume(Token.LPAREN, 'UnionType should start with (');
+ elements = [];
+ if (token !== Token.RPAREN) {
+ while (true) {
+ elements.push(parseTypeExpression());
+ if (token === Token.RPAREN) {
+ break;
+ }
+ expect(Token.PIPE);
+ }
+ }
+ consume(Token.RPAREN, 'UnionType should end with )');
+ return maybeAddRange({
+ type: Syntax.UnionType,
+ elements: elements
+ }, [startIndex, previous]);
+ }
+
+ // ArrayType := '[' ElementTypeList ']'
+ //
+ // ElementTypeList :=
+ // <>
+ // | TypeExpression
+ // | '...' TypeExpression
+ // | TypeExpression ',' ElementTypeList
+ function parseArrayType() {
+ var elements, startIndex = index - 1, restStartIndex;
+ consume(Token.LBRACK, 'ArrayType should start with [');
+ elements = [];
+ while (token !== Token.RBRACK) {
+ if (token === Token.REST) {
+ restStartIndex = index - 3;
+ consume(Token.REST);
+ elements.push(maybeAddRange({
+ type: Syntax.RestType,
+ expression: parseTypeExpression()
+ }, [restStartIndex, previous]));
+ break;
+ } else {
+ elements.push(parseTypeExpression());
+ }
+ if (token !== Token.RBRACK) {
+ expect(Token.COMMA);
+ }
+ }
+ expect(Token.RBRACK);
+ return maybeAddRange({
+ type: Syntax.ArrayType,
+ elements: elements
+ }, [startIndex, previous]);
+ }
+
+ function parseFieldName() {
+ var v = value;
+ if (token === Token.NAME || token === Token.STRING) {
+ next();
+ return v;
+ }
+
+ if (token === Token.NUMBER) {
+ consume(Token.NUMBER);
+ return String(v);
+ }
+
+ utility.throwError('unexpected token');
+ }
+
+ // FieldType :=
+ // FieldName
+ // | FieldName ':' TypeExpression
+ //
+ // FieldName :=
+ // NameExpression
+ // | StringLiteral
+ // | NumberLiteral
+ // | ReservedIdentifier
+ function parseFieldType() {
+ var key, rangeStart = previous;
+
+ key = parseFieldName();
+ if (token === Token.COLON) {
+ consume(Token.COLON);
+ return maybeAddRange({
+ type: Syntax.FieldType,
+ key: key,
+ value: parseTypeExpression()
+ }, [rangeStart, previous]);
+ }
+ return maybeAddRange({
+ type: Syntax.FieldType,
+ key: key,
+ value: null
+ }, [rangeStart, previous]);
+ }
+
+ // RecordType := '{' FieldTypeList '}'
+ //
+ // FieldTypeList :=
+ // <>
+ // | FieldType
+ // | FieldType ',' FieldTypeList
+ function parseRecordType() {
+ var fields, rangeStart = index - 1, rangeEnd;
+
+ consume(Token.LBRACE, 'RecordType should start with {');
+ fields = [];
+ if (token === Token.COMMA) {
+ consume(Token.COMMA);
+ } else {
+ while (token !== Token.RBRACE) {
+ fields.push(parseFieldType());
+ if (token !== Token.RBRACE) {
+ expect(Token.COMMA);
+ }
+ }
+ }
+ rangeEnd = index;
+ expect(Token.RBRACE);
+ return maybeAddRange({
+ type: Syntax.RecordType,
+ fields: fields
+ }, [rangeStart, rangeEnd]);
+ }
+
+ // NameExpression :=
+ // Identifier
+ // | TagIdentifier ':' Identifier
+ //
+ // Tag identifier is one of "module", "external" or "event"
+ // Identifier is the same as Token.NAME, including any dots, something like
+ // namespace.module.MyClass
+ function parseNameExpression() {
+ var name = value, rangeStart = index - name.length;
+ expect(Token.NAME);
+
+ if (token === Token.COLON && (
+ name === 'module' ||
+ name === 'external' ||
+ name === 'event')) {
+ consume(Token.COLON);
+ name += ':' + value;
+ expect(Token.NAME);
+ }
+
+ return maybeAddRange({
+ type: Syntax.NameExpression,
+ name: name
+ }, [rangeStart, previous]);
+ }
+
+ // TypeExpressionList :=
+ // TopLevelTypeExpression
+ // | TopLevelTypeExpression ',' TypeExpressionList
+ function parseTypeExpressionList() {
+ var elements = [];
+
+ elements.push(parseTop());
+ while (token === Token.COMMA) {
+ consume(Token.COMMA);
+ elements.push(parseTop());
+ }
+ return elements;
+ }
+
+ // TypeName :=
+ // NameExpression
+ // | NameExpression TypeApplication
+ //
+ // TypeApplication :=
+ // '.<' TypeExpressionList '>'
+ // | '<' TypeExpressionList '>' // this is extension of doctrine
+ function parseTypeName() {
+ var expr, applications, startIndex = index - value.length;
+
+ expr = parseNameExpression();
+ if (token === Token.DOT_LT || token === Token.LT) {
+ next();
+ applications = parseTypeExpressionList();
+ expect(Token.GT);
+ return maybeAddRange({
+ type: Syntax.TypeApplication,
+ expression: expr,
+ applications: applications
+ }, [startIndex, previous]);
+ }
+ return expr;
+ }
+
+ // ResultType :=
+ // <>
+ // | ':' void
+ // | ':' TypeExpression
+ //
+ // BNF is above
+ // but, we remove <> pattern, so token is always TypeToken::COLON
+ function parseResultType() {
+ consume(Token.COLON, 'ResultType should start with :');
+ if (token === Token.NAME && value === 'void') {
+ consume(Token.NAME);
+ return {
+ type: Syntax.VoidLiteral
+ };
+ }
+ return parseTypeExpression();
+ }
+
+ // ParametersType :=
+ // RestParameterType
+ // | NonRestParametersType
+ // | NonRestParametersType ',' RestParameterType
+ //
+ // RestParameterType :=
+ // '...'
+ // '...' Identifier
+ //
+ // NonRestParametersType :=
+ // ParameterType ',' NonRestParametersType
+ // | ParameterType
+ // | OptionalParametersType
+ //
+ // OptionalParametersType :=
+ // OptionalParameterType
+ // | OptionalParameterType, OptionalParametersType
+ //
+ // OptionalParameterType := ParameterType=
+ //
+ // ParameterType := TypeExpression | Identifier ':' TypeExpression
+ //
+ // Identifier is "new" or "this"
+ function parseParametersType() {
+ var params = [], optionalSequence = false, expr, rest = false, startIndex, restStartIndex = index - 3, nameStartIndex;
+
+ while (token !== Token.RPAREN) {
+ if (token === Token.REST) {
+ // RestParameterType
+ consume(Token.REST);
+ rest = true;
+ }
+
+ startIndex = previous;
+
+ expr = parseTypeExpression();
+ if (expr.type === Syntax.NameExpression && token === Token.COLON) {
+ nameStartIndex = previous - expr.name.length;
+ // Identifier ':' TypeExpression
+ consume(Token.COLON);
+ expr = maybeAddRange({
+ type: Syntax.ParameterType,
+ name: expr.name,
+ expression: parseTypeExpression()
+ }, [nameStartIndex, previous]);
+ }
+ if (token === Token.EQUAL) {
+ consume(Token.EQUAL);
+ expr = maybeAddRange({
+ type: Syntax.OptionalType,
+ expression: expr
+ }, [startIndex, previous]);
+ optionalSequence = true;
+ } else {
+ if (optionalSequence) {
+ utility.throwError('unexpected token');
+ }
+ }
+ if (rest) {
+ expr = maybeAddRange({
+ type: Syntax.RestType,
+ expression: expr
+ }, [restStartIndex, previous]);
+ }
+ params.push(expr);
+ if (token !== Token.RPAREN) {
+ expect(Token.COMMA);
+ }
+ }
+ return params;
+ }
+
+ // FunctionType := 'function' FunctionSignatureType
+ //
+ // FunctionSignatureType :=
+ // | TypeParameters '(' ')' ResultType
+ // | TypeParameters '(' ParametersType ')' ResultType
+ // | TypeParameters '(' 'this' ':' TypeName ')' ResultType
+ // | TypeParameters '(' 'this' ':' TypeName ',' ParametersType ')' ResultType
+ function parseFunctionType() {
+ var isNew, thisBinding, params, result, fnType, startIndex = index - value.length;
+ utility.assert(token === Token.NAME && value === 'function', 'FunctionType should start with \'function\'');
+ consume(Token.NAME);
+
+ // Google Closure Compiler is not implementing TypeParameters.
+ // So we do not. if we don't get '(', we see it as error.
+ expect(Token.LPAREN);
+
+ isNew = false;
+ params = [];
+ thisBinding = null;
+ if (token !== Token.RPAREN) {
+ // ParametersType or 'this'
+ if (token === Token.NAME &&
+ (value === 'this' || value === 'new')) {
+ // 'this' or 'new'
+ // 'new' is Closure Compiler extension
+ isNew = value === 'new';
+ consume(Token.NAME);
+ expect(Token.COLON);
+ thisBinding = parseTypeName();
+ if (token === Token.COMMA) {
+ consume(Token.COMMA);
+ params = parseParametersType();
+ }
+ } else {
+ params = parseParametersType();
+ }
+ }
+
+ expect(Token.RPAREN);
+
+ result = null;
+ if (token === Token.COLON) {
+ result = parseResultType();
+ }
+
+ fnType = maybeAddRange({
+ type: Syntax.FunctionType,
+ params: params,
+ result: result
+ }, [startIndex, previous]);
+ if (thisBinding) {
+ // avoid adding null 'new' and 'this' properties
+ fnType['this'] = thisBinding;
+ if (isNew) {
+ fnType['new'] = true;
+ }
+ }
+ return fnType;
+ }
+
+ // BasicTypeExpression :=
+ // '*'
+ // | 'null'
+ // | 'undefined'
+ // | TypeName
+ // | FunctionType
+ // | UnionType
+ // | RecordType
+ // | ArrayType
+ function parseBasicTypeExpression() {
+ var context, startIndex;
+ switch (token) {
+ case Token.STAR:
+ consume(Token.STAR);
+ return maybeAddRange({
+ type: Syntax.AllLiteral
+ }, [previous - 1, previous]);
+
+ case Token.LPAREN:
+ return parseUnionType();
+
+ case Token.LBRACK:
+ return parseArrayType();
+
+ case Token.LBRACE:
+ return parseRecordType();
+
+ case Token.NAME:
+ startIndex = index - value.length;
+
+ if (value === 'null') {
+ consume(Token.NAME);
+ return maybeAddRange({
+ type: Syntax.NullLiteral
+ }, [startIndex, previous]);
+ }
+
+ if (value === 'undefined') {
+ consume(Token.NAME);
+ return maybeAddRange({
+ type: Syntax.UndefinedLiteral
+ }, [startIndex, previous]);
+ }
+
+ if (value === 'true' || value === 'false') {
+ consume(Token.NAME);
+ return maybeAddRange({
+ type: Syntax.BooleanLiteralType,
+ value: value === 'true'
+ }, [startIndex, previous]);
+ }
+
+ context = Context.save();
+ if (value === 'function') {
+ try {
+ return parseFunctionType();
+ } catch (e) {
+ context.restore();
+ }
+ }
+
+ return parseTypeName();
+
+ case Token.STRING:
+ next();
+ return maybeAddRange({
+ type: Syntax.StringLiteralType,
+ value: value
+ }, [previous - value.length - 2, previous]);
+
+ case Token.NUMBER:
+ next();
+ return maybeAddRange({
+ type: Syntax.NumericLiteralType,
+ value: value
+ }, [previous - String(value).length, previous]);
+
+ default:
+ utility.throwError('unexpected token');
+ }
+ }
+
+ // TypeExpression :=
+ // BasicTypeExpression
+ // | '?' BasicTypeExpression
+ // | '!' BasicTypeExpression
+ // | BasicTypeExpression '?'
+ // | BasicTypeExpression '!'
+ // | '?'
+ // | BasicTypeExpression '[]'
+ function parseTypeExpression() {
+ var expr, rangeStart;
+
+ if (token === Token.QUESTION) {
+ rangeStart = index - 1;
+ consume(Token.QUESTION);
+ if (token === Token.COMMA || token === Token.EQUAL || token === Token.RBRACE ||
+ token === Token.RPAREN || token === Token.PIPE || token === Token.EOF ||
+ token === Token.RBRACK || token === Token.GT) {
+ return maybeAddRange({
+ type: Syntax.NullableLiteral
+ }, [rangeStart, previous]);
+ }
+ return maybeAddRange({
+ type: Syntax.NullableType,
+ expression: parseBasicTypeExpression(),
+ prefix: true
+ }, [rangeStart, previous]);
+ } else if (token === Token.BANG) {
+ rangeStart = index - 1;
+ consume(Token.BANG);
+ return maybeAddRange({
+ type: Syntax.NonNullableType,
+ expression: parseBasicTypeExpression(),
+ prefix: true
+ }, [rangeStart, previous]);
+ } else {
+ rangeStart = previous;
+ }
+
+ expr = parseBasicTypeExpression();
+ if (token === Token.BANG) {
+ consume(Token.BANG);
+ return maybeAddRange({
+ type: Syntax.NonNullableType,
+ expression: expr,
+ prefix: false
+ }, [rangeStart, previous]);
+ }
+
+ if (token === Token.QUESTION) {
+ consume(Token.QUESTION);
+ return maybeAddRange({
+ type: Syntax.NullableType,
+ expression: expr,
+ prefix: false
+ }, [rangeStart, previous]);
+ }
+
+ if (token === Token.LBRACK) {
+ consume(Token.LBRACK);
+ expect(Token.RBRACK, 'expected an array-style type declaration (' + value + '[])');
+ return maybeAddRange({
+ type: Syntax.TypeApplication,
+ expression: maybeAddRange({
+ type: Syntax.NameExpression,
+ name: 'Array'
+ }, [rangeStart, previous]),
+ applications: [expr]
+ }, [rangeStart, previous]);
+ }
+
+ return expr;
+ }
+
+ // TopLevelTypeExpression :=
+ // TypeExpression
+ // | TypeUnionList
+ //
+ // This rule is Google Closure Compiler extension, not ES4
+ // like,
+ // { number | string }
+ // If strict to ES4, we should write it as
+ // { (number|string) }
+ function parseTop() {
+ var expr, elements;
+
+ expr = parseTypeExpression();
+ if (token !== Token.PIPE) {
+ return expr;
+ }
+
+ elements = [expr];
+ consume(Token.PIPE);
+ while (true) {
+ elements.push(parseTypeExpression());
+ if (token !== Token.PIPE) {
+ break;
+ }
+ consume(Token.PIPE);
+ }
+
+ return maybeAddRange({
+ type: Syntax.UnionType,
+ elements: elements
+ }, [0, index]);
+ }
+
+ function parseTopParamType() {
+ var expr;
+
+ if (token === Token.REST) {
+ consume(Token.REST);
+ return maybeAddRange({
+ type: Syntax.RestType,
+ expression: parseTop()
+ }, [0, index]);
+ }
+
+ expr = parseTop();
+ if (token === Token.EQUAL) {
+ consume(Token.EQUAL);
+ return maybeAddRange({
+ type: Syntax.OptionalType,
+ expression: expr
+ }, [0, index]);
+ }
+
+ return expr;
+ }
+
+ function parseType(src, opt) {
+ var expr;
+
+ source = src;
+ length = source.length;
+ index = 0;
+ previous = 0;
+ addRange = opt && opt.range;
+ rangeOffset = opt && opt.startIndex || 0;
+
+ next();
+ expr = parseTop();
+
+ if (opt && opt.midstream) {
+ return {
+ expression: expr,
+ index: previous
+ };
+ }
+
+ if (token !== Token.EOF) {
+ utility.throwError('not reach to EOF');
+ }
+
+ return expr;
+ }
+
+ function parseParamType(src, opt) {
+ var expr;
+
+ source = src;
+ length = source.length;
+ index = 0;
+ previous = 0;
+ addRange = opt && opt.range;
+ rangeOffset = opt && opt.startIndex || 0;
+
+ next();
+ expr = parseTopParamType();
+
+ if (opt && opt.midstream) {
+ return {
+ expression: expr,
+ index: previous
+ };
+ }
+
+ if (token !== Token.EOF) {
+ utility.throwError('not reach to EOF');
+ }
+
+ return expr;
+ }
+
+ function stringifyImpl(node, compact, topLevel) {
+ var result, i, iz;
+
+ switch (node.type) {
+ case Syntax.NullableLiteral:
+ result = '?';
+ break;
+
+ case Syntax.AllLiteral:
+ result = '*';
+ break;
+
+ case Syntax.NullLiteral:
+ result = 'null';
+ break;
+
+ case Syntax.UndefinedLiteral:
+ result = 'undefined';
+ break;
+
+ case Syntax.VoidLiteral:
+ result = 'void';
+ break;
+
+ case Syntax.UnionType:
+ if (!topLevel) {
+ result = '(';
+ } else {
+ result = '';
+ }
+
+ for (i = 0, iz = node.elements.length; i < iz; ++i) {
+ result += stringifyImpl(node.elements[i], compact);
+ if ((i + 1) !== iz) {
+ result += compact ? '|' : ' | ';
+ }
+ }
+
+ if (!topLevel) {
+ result += ')';
+ }
+ break;
+
+ case Syntax.ArrayType:
+ result = '[';
+ for (i = 0, iz = node.elements.length; i < iz; ++i) {
+ result += stringifyImpl(node.elements[i], compact);
+ if ((i + 1) !== iz) {
+ result += compact ? ',' : ', ';
+ }
+ }
+ result += ']';
+ break;
+
+ case Syntax.RecordType:
+ result = '{';
+ for (i = 0, iz = node.fields.length; i < iz; ++i) {
+ result += stringifyImpl(node.fields[i], compact);
+ if ((i + 1) !== iz) {
+ result += compact ? ',' : ', ';
+ }
+ }
+ result += '}';
+ break;
+
+ case Syntax.FieldType:
+ if (node.value) {
+ result = node.key + (compact ? ':' : ': ') + stringifyImpl(node.value, compact);
+ } else {
+ result = node.key;
+ }
+ break;
+
+ case Syntax.FunctionType:
+ result = compact ? 'function(' : 'function (';
+
+ if (node['this']) {
+ if (node['new']) {
+ result += (compact ? 'new:' : 'new: ');
+ } else {
+ result += (compact ? 'this:' : 'this: ');
+ }
+
+ result += stringifyImpl(node['this'], compact);
+
+ if (node.params.length !== 0) {
+ result += compact ? ',' : ', ';
+ }
+ }
+
+ for (i = 0, iz = node.params.length; i < iz; ++i) {
+ result += stringifyImpl(node.params[i], compact);
+ if ((i + 1) !== iz) {
+ result += compact ? ',' : ', ';
+ }
+ }
+
+ result += ')';
+
+ if (node.result) {
+ result += (compact ? ':' : ': ') + stringifyImpl(node.result, compact);
+ }
+ break;
+
+ case Syntax.ParameterType:
+ result = node.name + (compact ? ':' : ': ') + stringifyImpl(node.expression, compact);
+ break;
+
+ case Syntax.RestType:
+ result = '...';
+ if (node.expression) {
+ result += stringifyImpl(node.expression, compact);
+ }
+ break;
+
+ case Syntax.NonNullableType:
+ if (node.prefix) {
+ result = '!' + stringifyImpl(node.expression, compact);
+ } else {
+ result = stringifyImpl(node.expression, compact) + '!';
+ }
+ break;
+
+ case Syntax.OptionalType:
+ result = stringifyImpl(node.expression, compact) + '=';
+ break;
+
+ case Syntax.NullableType:
+ if (node.prefix) {
+ result = '?' + stringifyImpl(node.expression, compact);
+ } else {
+ result = stringifyImpl(node.expression, compact) + '?';
+ }
+ break;
+
+ case Syntax.NameExpression:
+ result = node.name;
+ break;
+
+ case Syntax.TypeApplication:
+ result = stringifyImpl(node.expression, compact) + '.<';
+ for (i = 0, iz = node.applications.length; i < iz; ++i) {
+ result += stringifyImpl(node.applications[i], compact);
+ if ((i + 1) !== iz) {
+ result += compact ? ',' : ', ';
+ }
+ }
+ result += '>';
+ break;
+
+ case Syntax.StringLiteralType:
+ result = '"' + node.value + '"';
+ break;
+
+ case Syntax.NumericLiteralType:
+ result = String(node.value);
+ break;
+
+ case Syntax.BooleanLiteralType:
+ result = String(node.value);
+ break;
+
+ default:
+ utility.throwError('Unknown type ' + node.type);
+ }
+
+ return result;
+ }
+
+ function stringify(node, options) {
+ if (options == null) {
+ options = {};
+ }
+ return stringifyImpl(node, options.compact, options.topLevel);
+ }
+
+ exports.parseType = parseType;
+ exports.parseParamType = parseParamType;
+ exports.stringify = stringify;
+ exports.Syntax = Syntax;
+}());
+/* vim: set sw=4 ts=4 et tw=80 : */
diff --git a/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/node_modules/doctrine/lib/utility.js b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/node_modules/doctrine/lib/utility.js
new file mode 100644
index 0000000000000000000000000000000000000000..381580ebe2534af83524e88d64e1536fddfd38df
--- /dev/null
+++ b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/node_modules/doctrine/lib/utility.js
@@ -0,0 +1,35 @@
+/*
+ * @fileoverview Utilities for Doctrine
+ * @author Yusuke Suzuki
+ */
+
+
+(function () {
+ 'use strict';
+
+ var VERSION;
+
+ VERSION = require('../package.json').version;
+ exports.VERSION = VERSION;
+
+ function DoctrineError(message) {
+ this.name = 'DoctrineError';
+ this.message = message;
+ }
+ DoctrineError.prototype = (function () {
+ var Middle = function () { };
+ Middle.prototype = Error.prototype;
+ return new Middle();
+ }());
+ DoctrineError.prototype.constructor = DoctrineError;
+ exports.DoctrineError = DoctrineError;
+
+ function throwError(message) {
+ throw new DoctrineError(message);
+ }
+ exports.throwError = throwError;
+
+ exports.assert = require('assert');
+}());
+
+/* vim: set sw=4 ts=4 et tw=80 : */
diff --git a/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/node_modules/doctrine/package.json b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/node_modules/doctrine/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..92667d34373924099ac58e2ab5ee9390471ee6eb
--- /dev/null
+++ b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/node_modules/doctrine/package.json
@@ -0,0 +1,57 @@
+{
+ "name": "doctrine",
+ "description": "JSDoc parser",
+ "homepage": "https://github.com/eslint/doctrine",
+ "main": "lib/doctrine.js",
+ "version": "2.1.0",
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "directories": {
+ "lib": "./lib"
+ },
+ "files": [
+ "lib"
+ ],
+ "maintainers": [
+ {
+ "name": "Nicholas C. Zakas",
+ "email": "nicholas+npm@nczconsulting.com",
+ "web": "https://www.nczonline.net"
+ },
+ {
+ "name": "Yusuke Suzuki",
+ "email": "utatane.tea@gmail.com",
+ "web": "https://github.com/Constellation"
+ }
+ ],
+ "repository": "eslint/doctrine",
+ "devDependencies": {
+ "coveralls": "^2.11.2",
+ "dateformat": "^1.0.11",
+ "eslint": "^1.10.3",
+ "eslint-release": "^0.10.0",
+ "linefix": "^0.1.1",
+ "mocha": "^3.4.2",
+ "npm-license": "^0.3.1",
+ "nyc": "^10.3.2",
+ "semver": "^5.0.3",
+ "shelljs": "^0.5.3",
+ "shelljs-nodecli": "^0.1.1",
+ "should": "^5.0.1"
+ },
+ "license": "Apache-2.0",
+ "scripts": {
+ "pretest": "npm run lint",
+ "test": "nyc mocha",
+ "coveralls": "nyc report --reporter=text-lcov | coveralls",
+ "lint": "eslint lib/",
+ "release": "eslint-release",
+ "ci-release": "eslint-ci-release",
+ "alpharelease": "eslint-prerelease alpha",
+ "betarelease": "eslint-prerelease beta"
+ },
+ "dependencies": {
+ "esutils": "^2.0.2"
+ }
+}
diff --git a/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/node_modules/semver/LICENSE b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/node_modules/semver/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..19129e315fe593965a2fdd50ec0d1253bcbd2ece
--- /dev/null
+++ b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/node_modules/semver/LICENSE
@@ -0,0 +1,15 @@
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter and Contributors
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/node_modules/semver/README.md b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/node_modules/semver/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..2293a14fdc3579558dbe9fbc50aa549657948c3e
--- /dev/null
+++ b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/node_modules/semver/README.md
@@ -0,0 +1,443 @@
+semver(1) -- The semantic versioner for npm
+===========================================
+
+## Install
+
+```bash
+npm install semver
+````
+
+## Usage
+
+As a node module:
+
+```js
+const semver = require('semver')
+
+semver.valid('1.2.3') // '1.2.3'
+semver.valid('a.b.c') // null
+semver.clean(' =v1.2.3 ') // '1.2.3'
+semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true
+semver.gt('1.2.3', '9.8.7') // false
+semver.lt('1.2.3', '9.8.7') // true
+semver.minVersion('>=1.0.0') // '1.0.0'
+semver.valid(semver.coerce('v2')) // '2.0.0'
+semver.valid(semver.coerce('42.6.7.9.3-alpha')) // '42.6.7'
+```
+
+As a command-line utility:
+
+```
+$ semver -h
+
+A JavaScript implementation of the https://semver.org/ specification
+Copyright Isaac Z. Schlueter
+
+Usage: semver [options] [ [...]]
+Prints valid versions sorted by SemVer precedence
+
+Options:
+-r --range
+ Print versions that match the specified range.
+
+-i --increment []
+ Increment a version by the specified level. Level can
+ be one of: major, minor, patch, premajor, preminor,
+ prepatch, or prerelease. Default level is 'patch'.
+ Only one version may be specified.
+
+--preid
+ Identifier to be used to prefix premajor, preminor,
+ prepatch or prerelease version increments.
+
+-l --loose
+ Interpret versions and ranges loosely
+
+-p --include-prerelease
+ Always include prerelease versions in range matching
+
+-c --coerce
+ Coerce a string into SemVer if possible
+ (does not imply --loose)
+
+--rtl
+ Coerce version strings right to left
+
+--ltr
+ Coerce version strings left to right (default)
+
+Program exits successfully if any valid version satisfies
+all supplied ranges, and prints all satisfying versions.
+
+If no satisfying versions are found, then exits failure.
+
+Versions are printed in ascending order, so supplying
+multiple versions to the utility will just sort them.
+```
+
+## Versions
+
+A "version" is described by the `v2.0.0` specification found at
+.
+
+A leading `"="` or `"v"` character is stripped off and ignored.
+
+## Ranges
+
+A `version range` is a set of `comparators` which specify versions
+that satisfy the range.
+
+A `comparator` is composed of an `operator` and a `version`. The set
+of primitive `operators` is:
+
+* `<` Less than
+* `<=` Less than or equal to
+* `>` Greater than
+* `>=` Greater than or equal to
+* `=` Equal. If no operator is specified, then equality is assumed,
+ so this operator is optional, but MAY be included.
+
+For example, the comparator `>=1.2.7` would match the versions
+`1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6`
+or `1.1.0`.
+
+Comparators can be joined by whitespace to form a `comparator set`,
+which is satisfied by the **intersection** of all of the comparators
+it includes.
+
+A range is composed of one or more comparator sets, joined by `||`. A
+version matches a range if and only if every comparator in at least
+one of the `||`-separated comparator sets is satisfied by the version.
+
+For example, the range `>=1.2.7 <1.3.0` would match the versions
+`1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`,
+or `1.1.0`.
+
+The range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`,
+`1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`.
+
+### Prerelease Tags
+
+If a version has a prerelease tag (for example, `1.2.3-alpha.3`) then
+it will only be allowed to satisfy comparator sets if at least one
+comparator with the same `[major, minor, patch]` tuple also has a
+prerelease tag.
+
+For example, the range `>1.2.3-alpha.3` would be allowed to match the
+version `1.2.3-alpha.7`, but it would *not* be satisfied by
+`3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater
+than" `1.2.3-alpha.3` according to the SemVer sort rules. The version
+range only accepts prerelease tags on the `1.2.3` version. The
+version `3.4.5` *would* satisfy the range, because it does not have a
+prerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`.
+
+The purpose for this behavior is twofold. First, prerelease versions
+frequently are updated very quickly, and contain many breaking changes
+that are (by the author's design) not yet fit for public consumption.
+Therefore, by default, they are excluded from range matching
+semantics.
+
+Second, a user who has opted into using a prerelease version has
+clearly indicated the intent to use *that specific* set of
+alpha/beta/rc versions. By including a prerelease tag in the range,
+the user is indicating that they are aware of the risk. However, it
+is still not appropriate to assume that they have opted into taking a
+similar risk on the *next* set of prerelease versions.
+
+Note that this behavior can be suppressed (treating all prerelease
+versions as if they were normal versions, for the purpose of range
+matching) by setting the `includePrerelease` flag on the options
+object to any
+[functions](https://github.com/npm/node-semver#functions) that do
+range matching.
+
+#### Prerelease Identifiers
+
+The method `.inc` takes an additional `identifier` string argument that
+will append the value of the string as a prerelease identifier:
+
+```javascript
+semver.inc('1.2.3', 'prerelease', 'beta')
+// '1.2.4-beta.0'
+```
+
+command-line example:
+
+```bash
+$ semver 1.2.3 -i prerelease --preid beta
+1.2.4-beta.0
+```
+
+Which then can be used to increment further:
+
+```bash
+$ semver 1.2.4-beta.0 -i prerelease
+1.2.4-beta.1
+```
+
+### Advanced Range Syntax
+
+Advanced range syntax desugars to primitive comparators in
+deterministic ways.
+
+Advanced ranges may be combined in the same way as primitive
+comparators using white space or `||`.
+
+#### Hyphen Ranges `X.Y.Z - A.B.C`
+
+Specifies an inclusive set.
+
+* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4`
+
+If a partial version is provided as the first version in the inclusive
+range, then the missing pieces are replaced with zeroes.
+
+* `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4`
+
+If a partial version is provided as the second version in the
+inclusive range, then all versions that start with the supplied parts
+of the tuple are accepted, but nothing that would be greater than the
+provided tuple parts.
+
+* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0`
+* `1.2.3 - 2` := `>=1.2.3 <3.0.0`
+
+#### X-Ranges `1.2.x` `1.X` `1.2.*` `*`
+
+Any of `X`, `x`, or `*` may be used to "stand in" for one of the
+numeric values in the `[major, minor, patch]` tuple.
+
+* `*` := `>=0.0.0` (Any version satisfies)
+* `1.x` := `>=1.0.0 <2.0.0` (Matching major version)
+* `1.2.x` := `>=1.2.0 <1.3.0` (Matching major and minor versions)
+
+A partial version range is treated as an X-Range, so the special
+character is in fact optional.
+
+* `""` (empty string) := `*` := `>=0.0.0`
+* `1` := `1.x.x` := `>=1.0.0 <2.0.0`
+* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0`
+
+#### Tilde Ranges `~1.2.3` `~1.2` `~1`
+
+Allows patch-level changes if a minor version is specified on the
+comparator. Allows minor-level changes if not.
+
+* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0`
+* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0` (Same as `1.2.x`)
+* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0` (Same as `1.x`)
+* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0`
+* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0` (Same as `0.2.x`)
+* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0` (Same as `0.x`)
+* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0` Note that prereleases in
+ the `1.2.3` version will be allowed, if they are greater than or
+ equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but
+ `1.2.4-beta.2` would not, because it is a prerelease of a
+ different `[major, minor, patch]` tuple.
+
+#### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4`
+
+Allows changes that do not modify the left-most non-zero element in the
+`[major, minor, patch]` tuple. In other words, this allows patch and
+minor updates for versions `1.0.0` and above, patch updates for
+versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`.
+
+Many authors treat a `0.x` version as if the `x` were the major
+"breaking-change" indicator.
+
+Caret ranges are ideal when an author may make breaking changes
+between `0.2.4` and `0.3.0` releases, which is a common practice.
+However, it presumes that there will *not* be breaking changes between
+`0.2.4` and `0.2.5`. It allows for changes that are presumed to be
+additive (but non-breaking), according to commonly observed practices.
+
+* `^1.2.3` := `>=1.2.3 <2.0.0`
+* `^0.2.3` := `>=0.2.3 <0.3.0`
+* `^0.0.3` := `>=0.0.3 <0.0.4`
+* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0` Note that prereleases in
+ the `1.2.3` version will be allowed, if they are greater than or
+ equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but
+ `1.2.4-beta.2` would not, because it is a prerelease of a
+ different `[major, minor, patch]` tuple.
+* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4` Note that prereleases in the
+ `0.0.3` version *only* will be allowed, if they are greater than or
+ equal to `beta`. So, `0.0.3-pr.2` would be allowed.
+
+When parsing caret ranges, a missing `patch` value desugars to the
+number `0`, but will allow flexibility within that value, even if the
+major and minor versions are both `0`.
+
+* `^1.2.x` := `>=1.2.0 <2.0.0`
+* `^0.0.x` := `>=0.0.0 <0.1.0`
+* `^0.0` := `>=0.0.0 <0.1.0`
+
+A missing `minor` and `patch` values will desugar to zero, but also
+allow flexibility within those values, even if the major version is
+zero.
+
+* `^1.x` := `>=1.0.0 <2.0.0`
+* `^0.x` := `>=0.0.0 <1.0.0`
+
+### Range Grammar
+
+Putting all this together, here is a Backus-Naur grammar for ranges,
+for the benefit of parser authors:
+
+```bnf
+range-set ::= range ( logical-or range ) *
+logical-or ::= ( ' ' ) * '||' ( ' ' ) *
+range ::= hyphen | simple ( ' ' simple ) * | ''
+hyphen ::= partial ' - ' partial
+simple ::= primitive | partial | tilde | caret
+primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial
+partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )?
+xr ::= 'x' | 'X' | '*' | nr
+nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) *
+tilde ::= '~' partial
+caret ::= '^' partial
+qualifier ::= ( '-' pre )? ( '+' build )?
+pre ::= parts
+build ::= parts
+parts ::= part ( '.' part ) *
+part ::= nr | [-0-9A-Za-z]+
+```
+
+## Functions
+
+All methods and classes take a final `options` object argument. All
+options in this object are `false` by default. The options supported
+are:
+
+- `loose` Be more forgiving about not-quite-valid semver strings.
+ (Any resulting output will always be 100% strict compliant, of
+ course.) For backwards compatibility reasons, if the `options`
+ argument is a boolean value instead of an object, it is interpreted
+ to be the `loose` param.
+- `includePrerelease` Set to suppress the [default
+ behavior](https://github.com/npm/node-semver#prerelease-tags) of
+ excluding prerelease tagged versions from ranges unless they are
+ explicitly opted into.
+
+Strict-mode Comparators and Ranges will be strict about the SemVer
+strings that they parse.
+
+* `valid(v)`: Return the parsed version, or null if it's not valid.
+* `inc(v, release)`: Return the version incremented by the release
+ type (`major`, `premajor`, `minor`, `preminor`, `patch`,
+ `prepatch`, or `prerelease`), or null if it's not valid
+ * `premajor` in one call will bump the version up to the next major
+ version and down to a prerelease of that major version.
+ `preminor`, and `prepatch` work the same way.
+ * If called from a non-prerelease version, the `prerelease` will work the
+ same as `prepatch`. It increments the patch version, then makes a
+ prerelease. If the input version is already a prerelease it simply
+ increments it.
+* `prerelease(v)`: Returns an array of prerelease components, or null
+ if none exist. Example: `prerelease('1.2.3-alpha.1') -> ['alpha', 1]`
+* `major(v)`: Return the major version number.
+* `minor(v)`: Return the minor version number.
+* `patch(v)`: Return the patch version number.
+* `intersects(r1, r2, loose)`: Return true if the two supplied ranges
+ or comparators intersect.
+* `parse(v)`: Attempt to parse a string as a semantic version, returning either
+ a `SemVer` object or `null`.
+
+### Comparison
+
+* `gt(v1, v2)`: `v1 > v2`
+* `gte(v1, v2)`: `v1 >= v2`
+* `lt(v1, v2)`: `v1 < v2`
+* `lte(v1, v2)`: `v1 <= v2`
+* `eq(v1, v2)`: `v1 == v2` This is true if they're logically equivalent,
+ even if they're not the exact same string. You already know how to
+ compare strings.
+* `neq(v1, v2)`: `v1 != v2` The opposite of `eq`.
+* `cmp(v1, comparator, v2)`: Pass in a comparison string, and it'll call
+ the corresponding function above. `"==="` and `"!=="` do simple
+ string comparison, but are included for completeness. Throws if an
+ invalid comparison string is provided.
+* `compare(v1, v2)`: Return `0` if `v1 == v2`, or `1` if `v1` is greater, or `-1` if
+ `v2` is greater. Sorts in ascending order if passed to `Array.sort()`.
+* `rcompare(v1, v2)`: The reverse of compare. Sorts an array of versions
+ in descending order when passed to `Array.sort()`.
+* `compareBuild(v1, v2)`: The same as `compare` but considers `build` when two versions
+ are equal. Sorts in ascending order if passed to `Array.sort()`.
+ `v2` is greater. Sorts in ascending order if passed to `Array.sort()`.
+* `diff(v1, v2)`: Returns difference between two versions by the release type
+ (`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`),
+ or null if the versions are the same.
+
+### Comparators
+
+* `intersects(comparator)`: Return true if the comparators intersect
+
+### Ranges
+
+* `validRange(range)`: Return the valid range or null if it's not valid
+* `satisfies(version, range)`: Return true if the version satisfies the
+ range.
+* `maxSatisfying(versions, range)`: Return the highest version in the list
+ that satisfies the range, or `null` if none of them do.
+* `minSatisfying(versions, range)`: Return the lowest version in the list
+ that satisfies the range, or `null` if none of them do.
+* `minVersion(range)`: Return the lowest version that can possibly match
+ the given range.
+* `gtr(version, range)`: Return `true` if version is greater than all the
+ versions possible in the range.
+* `ltr(version, range)`: Return `true` if version is less than all the
+ versions possible in the range.
+* `outside(version, range, hilo)`: Return true if the version is outside
+ the bounds of the range in either the high or low direction. The
+ `hilo` argument must be either the string `'>'` or `'<'`. (This is
+ the function called by `gtr` and `ltr`.)
+* `intersects(range)`: Return true if any of the ranges comparators intersect
+
+Note that, since ranges may be non-contiguous, a version might not be
+greater than a range, less than a range, *or* satisfy a range! For
+example, the range `1.2 <1.2.9 || >2.0.0` would have a hole from `1.2.9`
+until `2.0.0`, so the version `1.2.10` would not be greater than the
+range (because `2.0.1` satisfies, which is higher), nor less than the
+range (since `1.2.8` satisfies, which is lower), and it also does not
+satisfy the range.
+
+If you want to know if a version satisfies or does not satisfy a
+range, use the `satisfies(version, range)` function.
+
+### Coercion
+
+* `coerce(version, options)`: Coerces a string to semver if possible
+
+This aims to provide a very forgiving translation of a non-semver string to
+semver. It looks for the first digit in a string, and consumes all
+remaining characters which satisfy at least a partial semver (e.g., `1`,
+`1.2`, `1.2.3`) up to the max permitted length (256 characters). Longer
+versions are simply truncated (`4.6.3.9.2-alpha2` becomes `4.6.3`). All
+surrounding text is simply ignored (`v3.4 replaces v3.3.1` becomes
+`3.4.0`). Only text which lacks digits will fail coercion (`version one`
+is not valid). The maximum length for any semver component considered for
+coercion is 16 characters; longer components will be ignored
+(`10000000000000000.4.7.4` becomes `4.7.4`). The maximum value for any
+semver component is `Integer.MAX_SAFE_INTEGER || (2**53 - 1)`; higher value
+components are invalid (`9999999999999999.4.7.4` is likely invalid).
+
+If the `options.rtl` flag is set, then `coerce` will return the right-most
+coercible tuple that does not share an ending index with a longer coercible
+tuple. For example, `1.2.3.4` will return `2.3.4` in rtl mode, not
+`4.0.0`. `1.2.3/4` will return `4.0.0`, because the `4` is not a part of
+any other overlapping SemVer tuple.
+
+### Clean
+
+* `clean(version)`: Clean a string to be a valid semver if possible
+
+This will return a cleaned and trimmed semver version. If the provided version is not valid a null will be returned. This does not work for ranges.
+
+ex.
+* `s.clean(' = v 2.1.5foo')`: `null`
+* `s.clean(' = v 2.1.5foo', { loose: true })`: `'2.1.5-foo'`
+* `s.clean(' = v 2.1.5-foo')`: `null`
+* `s.clean(' = v 2.1.5-foo', { loose: true })`: `'2.1.5-foo'`
+* `s.clean('=v2.1.5')`: `'2.1.5'`
+* `s.clean(' =v2.1.5')`: `2.1.5`
+* `s.clean(' 2.1.5 ')`: `'2.1.5'`
+* `s.clean('~1.0.0')`: `null`
diff --git a/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/node_modules/semver/bin/semver.js b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/node_modules/semver/bin/semver.js
new file mode 100644
index 0000000000000000000000000000000000000000..666034a75d8442be9bb2d9c55c3909b55a093cb5
--- /dev/null
+++ b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/node_modules/semver/bin/semver.js
@@ -0,0 +1,174 @@
+#!/usr/bin/env node
+// Standalone semver comparison program.
+// Exits successfully and prints matching version(s) if
+// any supplied version is valid and passes all tests.
+
+var argv = process.argv.slice(2)
+
+var versions = []
+
+var range = []
+
+var inc = null
+
+var version = require('../package.json').version
+
+var loose = false
+
+var includePrerelease = false
+
+var coerce = false
+
+var rtl = false
+
+var identifier
+
+var semver = require('../semver')
+
+var reverse = false
+
+var options = {}
+
+main()
+
+function main () {
+ if (!argv.length) return help()
+ while (argv.length) {
+ var a = argv.shift()
+ var indexOfEqualSign = a.indexOf('=')
+ if (indexOfEqualSign !== -1) {
+ a = a.slice(0, indexOfEqualSign)
+ argv.unshift(a.slice(indexOfEqualSign + 1))
+ }
+ switch (a) {
+ case '-rv': case '-rev': case '--rev': case '--reverse':
+ reverse = true
+ break
+ case '-l': case '--loose':
+ loose = true
+ break
+ case '-p': case '--include-prerelease':
+ includePrerelease = true
+ break
+ case '-v': case '--version':
+ versions.push(argv.shift())
+ break
+ case '-i': case '--inc': case '--increment':
+ switch (argv[0]) {
+ case 'major': case 'minor': case 'patch': case 'prerelease':
+ case 'premajor': case 'preminor': case 'prepatch':
+ inc = argv.shift()
+ break
+ default:
+ inc = 'patch'
+ break
+ }
+ break
+ case '--preid':
+ identifier = argv.shift()
+ break
+ case '-r': case '--range':
+ range.push(argv.shift())
+ break
+ case '-c': case '--coerce':
+ coerce = true
+ break
+ case '--rtl':
+ rtl = true
+ break
+ case '--ltr':
+ rtl = false
+ break
+ case '-h': case '--help': case '-?':
+ return help()
+ default:
+ versions.push(a)
+ break
+ }
+ }
+
+ var options = { loose: loose, includePrerelease: includePrerelease, rtl: rtl }
+
+ versions = versions.map(function (v) {
+ return coerce ? (semver.coerce(v, options) || { version: v }).version : v
+ }).filter(function (v) {
+ return semver.valid(v)
+ })
+ if (!versions.length) return fail()
+ if (inc && (versions.length !== 1 || range.length)) { return failInc() }
+
+ for (var i = 0, l = range.length; i < l; i++) {
+ versions = versions.filter(function (v) {
+ return semver.satisfies(v, range[i], options)
+ })
+ if (!versions.length) return fail()
+ }
+ return success(versions)
+}
+
+function failInc () {
+ console.error('--inc can only be used on a single version with no range')
+ fail()
+}
+
+function fail () { process.exit(1) }
+
+function success () {
+ var compare = reverse ? 'rcompare' : 'compare'
+ versions.sort(function (a, b) {
+ return semver[compare](a, b, options)
+ }).map(function (v) {
+ return semver.clean(v, options)
+ }).map(function (v) {
+ return inc ? semver.inc(v, inc, options, identifier) : v
+ }).forEach(function (v, i, _) { console.log(v) })
+}
+
+function help () {
+ console.log(['SemVer ' + version,
+ '',
+ 'A JavaScript implementation of the https://semver.org/ specification',
+ 'Copyright Isaac Z. Schlueter',
+ '',
+ 'Usage: semver [options] [ [...]]',
+ 'Prints valid versions sorted by SemVer precedence',
+ '',
+ 'Options:',
+ '-r --range ',
+ ' Print versions that match the specified range.',
+ '',
+ '-i --increment []',
+ ' Increment a version by the specified level. Level can',
+ ' be one of: major, minor, patch, premajor, preminor,',
+ " prepatch, or prerelease. Default level is 'patch'.",
+ ' Only one version may be specified.',
+ '',
+ '--preid ',
+ ' Identifier to be used to prefix premajor, preminor,',
+ ' prepatch or prerelease version increments.',
+ '',
+ '-l --loose',
+ ' Interpret versions and ranges loosely',
+ '',
+ '-p --include-prerelease',
+ ' Always include prerelease versions in range matching',
+ '',
+ '-c --coerce',
+ ' Coerce a string into SemVer if possible',
+ ' (does not imply --loose)',
+ '',
+ '--rtl',
+ ' Coerce version strings right to left',
+ '',
+ '--ltr',
+ ' Coerce version strings left to right (default)',
+ '',
+ 'Program exits successfully if any valid version satisfies',
+ 'all supplied ranges, and prints all satisfying versions.',
+ '',
+ 'If no satisfying versions are found, then exits failure.',
+ '',
+ 'Versions are printed in ascending order, so supplying',
+ 'multiple versions to the utility will just sort them.'
+ ].join('\n'))
+}
diff --git a/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/node_modules/semver/package.json b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/node_modules/semver/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..6b970a629ffe81d300d6b0469fa9b1992ca24c8e
--- /dev/null
+++ b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/node_modules/semver/package.json
@@ -0,0 +1,38 @@
+{
+ "name": "semver",
+ "version": "6.3.1",
+ "description": "The semantic version parser used by npm.",
+ "main": "semver.js",
+ "scripts": {
+ "test": "tap test/ --100 --timeout=30",
+ "lint": "echo linting disabled",
+ "postlint": "template-oss-check",
+ "template-oss-apply": "template-oss-apply --force",
+ "lintfix": "npm run lint -- --fix",
+ "snap": "tap test/ --100 --timeout=30",
+ "posttest": "npm run lint"
+ },
+ "devDependencies": {
+ "@npmcli/template-oss": "4.17.0",
+ "tap": "^12.7.0"
+ },
+ "license": "ISC",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/npm/node-semver.git"
+ },
+ "bin": {
+ "semver": "./bin/semver.js"
+ },
+ "files": [
+ "bin",
+ "range.bnf",
+ "semver.js"
+ ],
+ "author": "GitHub Inc.",
+ "templateOSS": {
+ "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
+ "content": "./scripts/template-oss",
+ "version": "4.17.0"
+ }
+}
diff --git a/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/node_modules/semver/range.bnf b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/node_modules/semver/range.bnf
new file mode 100644
index 0000000000000000000000000000000000000000..d4c6ae0d76c9ac0c10c93062e5ff9cec277b07cd
--- /dev/null
+++ b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/node_modules/semver/range.bnf
@@ -0,0 +1,16 @@
+range-set ::= range ( logical-or range ) *
+logical-or ::= ( ' ' ) * '||' ( ' ' ) *
+range ::= hyphen | simple ( ' ' simple ) * | ''
+hyphen ::= partial ' - ' partial
+simple ::= primitive | partial | tilde | caret
+primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial
+partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )?
+xr ::= 'x' | 'X' | '*' | nr
+nr ::= '0' | [1-9] ( [0-9] ) *
+tilde ::= '~' partial
+caret ::= '^' partial
+qualifier ::= ( '-' pre )? ( '+' build )?
+pre ::= parts
+build ::= parts
+parts ::= part ( '.' part ) *
+part ::= nr | [-0-9A-Za-z]+
diff --git a/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/node_modules/semver/semver.js b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/node_modules/semver/semver.js
new file mode 100644
index 0000000000000000000000000000000000000000..39319c13cac27d65d88d34dac95470a6494a0dae
--- /dev/null
+++ b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-plugin-react/node_modules/semver/semver.js
@@ -0,0 +1,1643 @@
+exports = module.exports = SemVer
+
+var debug
+/* istanbul ignore next */
+if (typeof process === 'object' &&
+ process.env &&
+ process.env.NODE_DEBUG &&
+ /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
+ debug = function () {
+ var args = Array.prototype.slice.call(arguments, 0)
+ args.unshift('SEMVER')
+ console.log.apply(console, args)
+ }
+} else {
+ debug = function () {}
+}
+
+// Note: this is the semver.org version of the spec that it implements
+// Not necessarily the package version of this code.
+exports.SEMVER_SPEC_VERSION = '2.0.0'
+
+var MAX_LENGTH = 256
+var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
+ /* istanbul ignore next */ 9007199254740991
+
+// Max safe segment length for coercion.
+var MAX_SAFE_COMPONENT_LENGTH = 16
+
+var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6
+
+// The actual regexps go on exports.re
+var re = exports.re = []
+var safeRe = exports.safeRe = []
+var src = exports.src = []
+var t = exports.tokens = {}
+var R = 0
+
+function tok (n) {
+ t[n] = R++
+}
+
+var LETTERDASHNUMBER = '[a-zA-Z0-9-]'
+
+// Replace some greedy regex tokens to prevent regex dos issues. These regex are
+// used internally via the safeRe object since all inputs in this library get
+// normalized first to trim and collapse all extra whitespace. The original
+// regexes are exported for userland consumption and lower level usage. A
+// future breaking change could export the safer regex only with a note that
+// all input should have extra whitespace removed.
+var safeRegexReplacements = [
+ ['\\s', 1],
+ ['\\d', MAX_LENGTH],
+ [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH],
+]
+
+function makeSafeRe (value) {
+ for (var i = 0; i < safeRegexReplacements.length; i++) {
+ var token = safeRegexReplacements[i][0]
+ var max = safeRegexReplacements[i][1]
+ value = value
+ .split(token + '*').join(token + '{0,' + max + '}')
+ .split(token + '+').join(token + '{1,' + max + '}')
+ }
+ return value
+}
+
+// The following Regular Expressions can be used for tokenizing,
+// validating, and parsing SemVer version strings.
+
+// ## Numeric Identifier
+// A single `0`, or a non-zero digit followed by zero or more digits.
+
+tok('NUMERICIDENTIFIER')
+src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*'
+tok('NUMERICIDENTIFIERLOOSE')
+src[t.NUMERICIDENTIFIERLOOSE] = '\\d+'
+
+// ## Non-numeric Identifier
+// Zero or more digits, followed by a letter or hyphen, and then zero or
+// more letters, digits, or hyphens.
+
+tok('NONNUMERICIDENTIFIER')
+src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-]' + LETTERDASHNUMBER + '*'
+
+// ## Main Version
+// Three dot-separated numeric identifiers.
+
+tok('MAINVERSION')
+src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
+ '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
+ '(' + src[t.NUMERICIDENTIFIER] + ')'
+
+tok('MAINVERSIONLOOSE')
+src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
+ '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
+ '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')'
+
+// ## Pre-release Version Identifier
+// A numeric identifier, or a non-numeric identifier.
+
+tok('PRERELEASEIDENTIFIER')
+src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] +
+ '|' + src[t.NONNUMERICIDENTIFIER] + ')'
+
+tok('PRERELEASEIDENTIFIERLOOSE')
+src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] +
+ '|' + src[t.NONNUMERICIDENTIFIER] + ')'
+
+// ## Pre-release Version
+// Hyphen, followed by one or more dot-separated pre-release version
+// identifiers.
+
+tok('PRERELEASE')
+src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] +
+ '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))'
+
+tok('PRERELEASELOOSE')
+src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] +
+ '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))'
+
+// ## Build Metadata Identifier
+// Any combination of digits, letters, or hyphens.
+
+tok('BUILDIDENTIFIER')
+src[t.BUILDIDENTIFIER] = LETTERDASHNUMBER + '+'
+
+// ## Build Metadata
+// Plus sign, followed by one or more period-separated build metadata
+// identifiers.
+
+tok('BUILD')
+src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] +
+ '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))'
+
+// ## Full Version String
+// A main version, followed optionally by a pre-release version and
+// build metadata.
+
+// Note that the only major, minor, patch, and pre-release sections of
+// the version string are capturing groups. The build metadata is not a
+// capturing group, because it should not ever be used in version
+// comparison.
+
+tok('FULL')
+tok('FULLPLAIN')
+src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] +
+ src[t.PRERELEASE] + '?' +
+ src[t.BUILD] + '?'
+
+src[t.FULL] = '^' + src[t.FULLPLAIN] + '$'
+
+// like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
+// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
+// common in the npm registry.
+tok('LOOSEPLAIN')
+src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] +
+ src[t.PRERELEASELOOSE] + '?' +
+ src[t.BUILD] + '?'
+
+tok('LOOSE')
+src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$'
+
+tok('GTLT')
+src[t.GTLT] = '((?:<|>)?=?)'
+
+// Something like "2.*" or "1.2.x".
+// Note that "x.x" is a valid xRange identifer, meaning "any version"
+// Only the first item is strictly required.
+tok('XRANGEIDENTIFIERLOOSE')
+src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
+tok('XRANGEIDENTIFIER')
+src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*'
+
+tok('XRANGEPLAIN')
+src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' +
+ '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
+ '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
+ '(?:' + src[t.PRERELEASE] + ')?' +
+ src[t.BUILD] + '?' +
+ ')?)?'
+
+tok('XRANGEPLAINLOOSE')
+src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
+ '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
+ '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
+ '(?:' + src[t.PRERELEASELOOSE] + ')?' +
+ src[t.BUILD] + '?' +
+ ')?)?'
+
+tok('XRANGE')
+src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$'
+tok('XRANGELOOSE')
+src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$'
+
+// Coercion.
+// Extract anything that could conceivably be a part of a valid semver
+tok('COERCE')
+src[t.COERCE] = '(^|[^\\d])' +
+ '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
+ '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
+ '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
+ '(?:$|[^\\d])'
+tok('COERCERTL')
+re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g')
+safeRe[t.COERCERTL] = new RegExp(makeSafeRe(src[t.COERCE]), 'g')
+
+// Tilde ranges.
+// Meaning is "reasonably at or greater than"
+tok('LONETILDE')
+src[t.LONETILDE] = '(?:~>?)'
+
+tok('TILDETRIM')
+src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+'
+re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g')
+safeRe[t.TILDETRIM] = new RegExp(makeSafeRe(src[t.TILDETRIM]), 'g')
+var tildeTrimReplace = '$1~'
+
+tok('TILDE')
+src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$'
+tok('TILDELOOSE')
+src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$'
+
+// Caret ranges.
+// Meaning is "at least and backwards compatible with"
+tok('LONECARET')
+src[t.LONECARET] = '(?:\\^)'
+
+tok('CARETTRIM')
+src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+'
+re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g')
+safeRe[t.CARETTRIM] = new RegExp(makeSafeRe(src[t.CARETTRIM]), 'g')
+var caretTrimReplace = '$1^'
+
+tok('CARET')
+src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$'
+tok('CARETLOOSE')
+src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$'
+
+// A simple gt/lt/eq thing, or just "" to indicate "any version"
+tok('COMPARATORLOOSE')
+src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$'
+tok('COMPARATOR')
+src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$'
+
+// An expression to strip any whitespace between the gtlt and the thing
+// it modifies, so that `> 1.2.3` ==> `>1.2.3`
+tok('COMPARATORTRIM')
+src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] +
+ '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')'
+
+// this one has to use the /g flag
+re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g')
+safeRe[t.COMPARATORTRIM] = new RegExp(makeSafeRe(src[t.COMPARATORTRIM]), 'g')
+var comparatorTrimReplace = '$1$2$3'
+
+// Something like `1.2.3 - 1.2.4`
+// Note that these all use the loose form, because they'll be
+// checked against either the strict or loose comparator form
+// later.
+tok('HYPHENRANGE')
+src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' +
+ '\\s+-\\s+' +
+ '(' + src[t.XRANGEPLAIN] + ')' +
+ '\\s*$'
+
+tok('HYPHENRANGELOOSE')
+src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' +
+ '\\s+-\\s+' +
+ '(' + src[t.XRANGEPLAINLOOSE] + ')' +
+ '\\s*$'
+
+// Star ranges basically just allow anything at all.
+tok('STAR')
+src[t.STAR] = '(<|>)?=?\\s*\\*'
+
+// Compile to actual regexp objects.
+// All are flag-free, unless they were created above with a flag.
+for (var i = 0; i < R; i++) {
+ debug(i, src[i])
+ if (!re[i]) {
+ re[i] = new RegExp(src[i])
+
+ // Replace all greedy whitespace to prevent regex dos issues. These regex are
+ // used internally via the safeRe object since all inputs in this library get
+ // normalized first to trim and collapse all extra whitespace. The original
+ // regexes are exported for userland consumption and lower level usage. A
+ // future breaking change could export the safer regex only with a note that
+ // all input should have extra whitespace removed.
+ safeRe[i] = new RegExp(makeSafeRe(src[i]))
+ }
+}
+
+exports.parse = parse
+function parse (version, options) {
+ if (!options || typeof options !== 'object') {
+ options = {
+ loose: !!options,
+ includePrerelease: false
+ }
+ }
+
+ if (version instanceof SemVer) {
+ return version
+ }
+
+ if (typeof version !== 'string') {
+ return null
+ }
+
+ if (version.length > MAX_LENGTH) {
+ return null
+ }
+
+ var r = options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL]
+ if (!r.test(version)) {
+ return null
+ }
+
+ try {
+ return new SemVer(version, options)
+ } catch (er) {
+ return null
+ }
+}
+
+exports.valid = valid
+function valid (version, options) {
+ var v = parse(version, options)
+ return v ? v.version : null
+}
+
+exports.clean = clean
+function clean (version, options) {
+ var s = parse(version.trim().replace(/^[=v]+/, ''), options)
+ return s ? s.version : null
+}
+
+exports.SemVer = SemVer
+
+function SemVer (version, options) {
+ if (!options || typeof options !== 'object') {
+ options = {
+ loose: !!options,
+ includePrerelease: false
+ }
+ }
+ if (version instanceof SemVer) {
+ if (version.loose === options.loose) {
+ return version
+ } else {
+ version = version.version
+ }
+ } else if (typeof version !== 'string') {
+ throw new TypeError('Invalid Version: ' + version)
+ }
+
+ if (version.length > MAX_LENGTH) {
+ throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
+ }
+
+ if (!(this instanceof SemVer)) {
+ return new SemVer(version, options)
+ }
+
+ debug('SemVer', version, options)
+ this.options = options
+ this.loose = !!options.loose
+
+ var m = version.trim().match(options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL])
+
+ if (!m) {
+ throw new TypeError('Invalid Version: ' + version)
+ }
+
+ this.raw = version
+
+ // these are actually numbers
+ this.major = +m[1]
+ this.minor = +m[2]
+ this.patch = +m[3]
+
+ if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
+ throw new TypeError('Invalid major version')
+ }
+
+ if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
+ throw new TypeError('Invalid minor version')
+ }
+
+ if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
+ throw new TypeError('Invalid patch version')
+ }
+
+ // numberify any prerelease numeric ids
+ if (!m[4]) {
+ this.prerelease = []
+ } else {
+ this.prerelease = m[4].split('.').map(function (id) {
+ if (/^[0-9]+$/.test(id)) {
+ var num = +id
+ if (num >= 0 && num < MAX_SAFE_INTEGER) {
+ return num
+ }
+ }
+ return id
+ })
+ }
+
+ this.build = m[5] ? m[5].split('.') : []
+ this.format()
+}
+
+SemVer.prototype.format = function () {
+ this.version = this.major + '.' + this.minor + '.' + this.patch
+ if (this.prerelease.length) {
+ this.version += '-' + this.prerelease.join('.')
+ }
+ return this.version
+}
+
+SemVer.prototype.toString = function () {
+ return this.version
+}
+
+SemVer.prototype.compare = function (other) {
+ debug('SemVer.compare', this.version, this.options, other)
+ if (!(other instanceof SemVer)) {
+ other = new SemVer(other, this.options)
+ }
+
+ return this.compareMain(other) || this.comparePre(other)
+}
+
+SemVer.prototype.compareMain = function (other) {
+ if (!(other instanceof SemVer)) {
+ other = new SemVer(other, this.options)
+ }
+
+ return compareIdentifiers(this.major, other.major) ||
+ compareIdentifiers(this.minor, other.minor) ||
+ compareIdentifiers(this.patch, other.patch)
+}
+
+SemVer.prototype.comparePre = function (other) {
+ if (!(other instanceof SemVer)) {
+ other = new SemVer(other, this.options)
+ }
+
+ // NOT having a prerelease is > having one
+ if (this.prerelease.length && !other.prerelease.length) {
+ return -1
+ } else if (!this.prerelease.length && other.prerelease.length) {
+ return 1
+ } else if (!this.prerelease.length && !other.prerelease.length) {
+ return 0
+ }
+
+ var i = 0
+ do {
+ var a = this.prerelease[i]
+ var b = other.prerelease[i]
+ debug('prerelease compare', i, a, b)
+ if (a === undefined && b === undefined) {
+ return 0
+ } else if (b === undefined) {
+ return 1
+ } else if (a === undefined) {
+ return -1
+ } else if (a === b) {
+ continue
+ } else {
+ return compareIdentifiers(a, b)
+ }
+ } while (++i)
+}
+
+SemVer.prototype.compareBuild = function (other) {
+ if (!(other instanceof SemVer)) {
+ other = new SemVer(other, this.options)
+ }
+
+ var i = 0
+ do {
+ var a = this.build[i]
+ var b = other.build[i]
+ debug('prerelease compare', i, a, b)
+ if (a === undefined && b === undefined) {
+ return 0
+ } else if (b === undefined) {
+ return 1
+ } else if (a === undefined) {
+ return -1
+ } else if (a === b) {
+ continue
+ } else {
+ return compareIdentifiers(a, b)
+ }
+ } while (++i)
+}
+
+// preminor will bump the version up to the next minor release, and immediately
+// down to pre-release. premajor and prepatch work the same way.
+SemVer.prototype.inc = function (release, identifier) {
+ switch (release) {
+ case 'premajor':
+ this.prerelease.length = 0
+ this.patch = 0
+ this.minor = 0
+ this.major++
+ this.inc('pre', identifier)
+ break
+ case 'preminor':
+ this.prerelease.length = 0
+ this.patch = 0
+ this.minor++
+ this.inc('pre', identifier)
+ break
+ case 'prepatch':
+ // If this is already a prerelease, it will bump to the next version
+ // drop any prereleases that might already exist, since they are not
+ // relevant at this point.
+ this.prerelease.length = 0
+ this.inc('patch', identifier)
+ this.inc('pre', identifier)
+ break
+ // If the input is a non-prerelease version, this acts the same as
+ // prepatch.
+ case 'prerelease':
+ if (this.prerelease.length === 0) {
+ this.inc('patch', identifier)
+ }
+ this.inc('pre', identifier)
+ break
+
+ case 'major':
+ // If this is a pre-major version, bump up to the same major version.
+ // Otherwise increment major.
+ // 1.0.0-5 bumps to 1.0.0
+ // 1.1.0 bumps to 2.0.0
+ if (this.minor !== 0 ||
+ this.patch !== 0 ||
+ this.prerelease.length === 0) {
+ this.major++
+ }
+ this.minor = 0
+ this.patch = 0
+ this.prerelease = []
+ break
+ case 'minor':
+ // If this is a pre-minor version, bump up to the same minor version.
+ // Otherwise increment minor.
+ // 1.2.0-5 bumps to 1.2.0
+ // 1.2.1 bumps to 1.3.0
+ if (this.patch !== 0 || this.prerelease.length === 0) {
+ this.minor++
+ }
+ this.patch = 0
+ this.prerelease = []
+ break
+ case 'patch':
+ // If this is not a pre-release version, it will increment the patch.
+ // If it is a pre-release it will bump up to the same patch version.
+ // 1.2.0-5 patches to 1.2.0
+ // 1.2.0 patches to 1.2.1
+ if (this.prerelease.length === 0) {
+ this.patch++
+ }
+ this.prerelease = []
+ break
+ // This probably shouldn't be used publicly.
+ // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
+ case 'pre':
+ if (this.prerelease.length === 0) {
+ this.prerelease = [0]
+ } else {
+ var i = this.prerelease.length
+ while (--i >= 0) {
+ if (typeof this.prerelease[i] === 'number') {
+ this.prerelease[i]++
+ i = -2
+ }
+ }
+ if (i === -1) {
+ // didn't increment anything
+ this.prerelease.push(0)
+ }
+ }
+ if (identifier) {
+ // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
+ // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
+ if (this.prerelease[0] === identifier) {
+ if (isNaN(this.prerelease[1])) {
+ this.prerelease = [identifier, 0]
+ }
+ } else {
+ this.prerelease = [identifier, 0]
+ }
+ }
+ break
+
+ default:
+ throw new Error('invalid increment argument: ' + release)
+ }
+ this.format()
+ this.raw = this.version
+ return this
+}
+
+exports.inc = inc
+function inc (version, release, loose, identifier) {
+ if (typeof (loose) === 'string') {
+ identifier = loose
+ loose = undefined
+ }
+
+ try {
+ return new SemVer(version, loose).inc(release, identifier).version
+ } catch (er) {
+ return null
+ }
+}
+
+exports.diff = diff
+function diff (version1, version2) {
+ if (eq(version1, version2)) {
+ return null
+ } else {
+ var v1 = parse(version1)
+ var v2 = parse(version2)
+ var prefix = ''
+ if (v1.prerelease.length || v2.prerelease.length) {
+ prefix = 'pre'
+ var defaultResult = 'prerelease'
+ }
+ for (var key in v1) {
+ if (key === 'major' || key === 'minor' || key === 'patch') {
+ if (v1[key] !== v2[key]) {
+ return prefix + key
+ }
+ }
+ }
+ return defaultResult // may be undefined
+ }
+}
+
+exports.compareIdentifiers = compareIdentifiers
+
+var numeric = /^[0-9]+$/
+function compareIdentifiers (a, b) {
+ var anum = numeric.test(a)
+ var bnum = numeric.test(b)
+
+ if (anum && bnum) {
+ a = +a
+ b = +b
+ }
+
+ return a === b ? 0
+ : (anum && !bnum) ? -1
+ : (bnum && !anum) ? 1
+ : a < b ? -1
+ : 1
+}
+
+exports.rcompareIdentifiers = rcompareIdentifiers
+function rcompareIdentifiers (a, b) {
+ return compareIdentifiers(b, a)
+}
+
+exports.major = major
+function major (a, loose) {
+ return new SemVer(a, loose).major
+}
+
+exports.minor = minor
+function minor (a, loose) {
+ return new SemVer(a, loose).minor
+}
+
+exports.patch = patch
+function patch (a, loose) {
+ return new SemVer(a, loose).patch
+}
+
+exports.compare = compare
+function compare (a, b, loose) {
+ return new SemVer(a, loose).compare(new SemVer(b, loose))
+}
+
+exports.compareLoose = compareLoose
+function compareLoose (a, b) {
+ return compare(a, b, true)
+}
+
+exports.compareBuild = compareBuild
+function compareBuild (a, b, loose) {
+ var versionA = new SemVer(a, loose)
+ var versionB = new SemVer(b, loose)
+ return versionA.compare(versionB) || versionA.compareBuild(versionB)
+}
+
+exports.rcompare = rcompare
+function rcompare (a, b, loose) {
+ return compare(b, a, loose)
+}
+
+exports.sort = sort
+function sort (list, loose) {
+ return list.sort(function (a, b) {
+ return exports.compareBuild(a, b, loose)
+ })
+}
+
+exports.rsort = rsort
+function rsort (list, loose) {
+ return list.sort(function (a, b) {
+ return exports.compareBuild(b, a, loose)
+ })
+}
+
+exports.gt = gt
+function gt (a, b, loose) {
+ return compare(a, b, loose) > 0
+}
+
+exports.lt = lt
+function lt (a, b, loose) {
+ return compare(a, b, loose) < 0
+}
+
+exports.eq = eq
+function eq (a, b, loose) {
+ return compare(a, b, loose) === 0
+}
+
+exports.neq = neq
+function neq (a, b, loose) {
+ return compare(a, b, loose) !== 0
+}
+
+exports.gte = gte
+function gte (a, b, loose) {
+ return compare(a, b, loose) >= 0
+}
+
+exports.lte = lte
+function lte (a, b, loose) {
+ return compare(a, b, loose) <= 0
+}
+
+exports.cmp = cmp
+function cmp (a, op, b, loose) {
+ switch (op) {
+ case '===':
+ if (typeof a === 'object')
+ a = a.version
+ if (typeof b === 'object')
+ b = b.version
+ return a === b
+
+ case '!==':
+ if (typeof a === 'object')
+ a = a.version
+ if (typeof b === 'object')
+ b = b.version
+ return a !== b
+
+ case '':
+ case '=':
+ case '==':
+ return eq(a, b, loose)
+
+ case '!=':
+ return neq(a, b, loose)
+
+ case '>':
+ return gt(a, b, loose)
+
+ case '>=':
+ return gte(a, b, loose)
+
+ case '<':
+ return lt(a, b, loose)
+
+ case '<=':
+ return lte(a, b, loose)
+
+ default:
+ throw new TypeError('Invalid operator: ' + op)
+ }
+}
+
+exports.Comparator = Comparator
+function Comparator (comp, options) {
+ if (!options || typeof options !== 'object') {
+ options = {
+ loose: !!options,
+ includePrerelease: false
+ }
+ }
+
+ if (comp instanceof Comparator) {
+ if (comp.loose === !!options.loose) {
+ return comp
+ } else {
+ comp = comp.value
+ }
+ }
+
+ if (!(this instanceof Comparator)) {
+ return new Comparator(comp, options)
+ }
+
+ comp = comp.trim().split(/\s+/).join(' ')
+ debug('comparator', comp, options)
+ this.options = options
+ this.loose = !!options.loose
+ this.parse(comp)
+
+ if (this.semver === ANY) {
+ this.value = ''
+ } else {
+ this.value = this.operator + this.semver.version
+ }
+
+ debug('comp', this)
+}
+
+var ANY = {}
+Comparator.prototype.parse = function (comp) {
+ var r = this.options.loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]
+ var m = comp.match(r)
+
+ if (!m) {
+ throw new TypeError('Invalid comparator: ' + comp)
+ }
+
+ this.operator = m[1] !== undefined ? m[1] : ''
+ if (this.operator === '=') {
+ this.operator = ''
+ }
+
+ // if it literally is just '>' or '' then allow anything.
+ if (!m[2]) {
+ this.semver = ANY
+ } else {
+ this.semver = new SemVer(m[2], this.options.loose)
+ }
+}
+
+Comparator.prototype.toString = function () {
+ return this.value
+}
+
+Comparator.prototype.test = function (version) {
+ debug('Comparator.test', version, this.options.loose)
+
+ if (this.semver === ANY || version === ANY) {
+ return true
+ }
+
+ if (typeof version === 'string') {
+ try {
+ version = new SemVer(version, this.options)
+ } catch (er) {
+ return false
+ }
+ }
+
+ return cmp(version, this.operator, this.semver, this.options)
+}
+
+Comparator.prototype.intersects = function (comp, options) {
+ if (!(comp instanceof Comparator)) {
+ throw new TypeError('a Comparator is required')
+ }
+
+ if (!options || typeof options !== 'object') {
+ options = {
+ loose: !!options,
+ includePrerelease: false
+ }
+ }
+
+ var rangeTmp
+
+ if (this.operator === '') {
+ if (this.value === '') {
+ return true
+ }
+ rangeTmp = new Range(comp.value, options)
+ return satisfies(this.value, rangeTmp, options)
+ } else if (comp.operator === '') {
+ if (comp.value === '') {
+ return true
+ }
+ rangeTmp = new Range(this.value, options)
+ return satisfies(comp.semver, rangeTmp, options)
+ }
+
+ var sameDirectionIncreasing =
+ (this.operator === '>=' || this.operator === '>') &&
+ (comp.operator === '>=' || comp.operator === '>')
+ var sameDirectionDecreasing =
+ (this.operator === '<=' || this.operator === '<') &&
+ (comp.operator === '<=' || comp.operator === '<')
+ var sameSemVer = this.semver.version === comp.semver.version
+ var differentDirectionsInclusive =
+ (this.operator === '>=' || this.operator === '<=') &&
+ (comp.operator === '>=' || comp.operator === '<=')
+ var oppositeDirectionsLessThan =
+ cmp(this.semver, '<', comp.semver, options) &&
+ ((this.operator === '>=' || this.operator === '>') &&
+ (comp.operator === '<=' || comp.operator === '<'))
+ var oppositeDirectionsGreaterThan =
+ cmp(this.semver, '>', comp.semver, options) &&
+ ((this.operator === '<=' || this.operator === '<') &&
+ (comp.operator === '>=' || comp.operator === '>'))
+
+ return sameDirectionIncreasing || sameDirectionDecreasing ||
+ (sameSemVer && differentDirectionsInclusive) ||
+ oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
+}
+
+exports.Range = Range
+function Range (range, options) {
+ if (!options || typeof options !== 'object') {
+ options = {
+ loose: !!options,
+ includePrerelease: false
+ }
+ }
+
+ if (range instanceof Range) {
+ if (range.loose === !!options.loose &&
+ range.includePrerelease === !!options.includePrerelease) {
+ return range
+ } else {
+ return new Range(range.raw, options)
+ }
+ }
+
+ if (range instanceof Comparator) {
+ return new Range(range.value, options)
+ }
+
+ if (!(this instanceof Range)) {
+ return new Range(range, options)
+ }
+
+ this.options = options
+ this.loose = !!options.loose
+ this.includePrerelease = !!options.includePrerelease
+
+ // First reduce all whitespace as much as possible so we do not have to rely
+ // on potentially slow regexes like \s*. This is then stored and used for
+ // future error messages as well.
+ this.raw = range
+ .trim()
+ .split(/\s+/)
+ .join(' ')
+
+ // First, split based on boolean or ||
+ this.set = this.raw.split('||').map(function (range) {
+ return this.parseRange(range.trim())
+ }, this).filter(function (c) {
+ // throw out any that are not relevant for whatever reason
+ return c.length
+ })
+
+ if (!this.set.length) {
+ throw new TypeError('Invalid SemVer Range: ' + this.raw)
+ }
+
+ this.format()
+}
+
+Range.prototype.format = function () {
+ this.range = this.set.map(function (comps) {
+ return comps.join(' ').trim()
+ }).join('||').trim()
+ return this.range
+}
+
+Range.prototype.toString = function () {
+ return this.range
+}
+
+Range.prototype.parseRange = function (range) {
+ var loose = this.options.loose
+ // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
+ var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE]
+ range = range.replace(hr, hyphenReplace)
+ debug('hyphen replace', range)
+ // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
+ range = range.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace)
+ debug('comparator trim', range, safeRe[t.COMPARATORTRIM])
+
+ // `~ 1.2.3` => `~1.2.3`
+ range = range.replace(safeRe[t.TILDETRIM], tildeTrimReplace)
+
+ // `^ 1.2.3` => `^1.2.3`
+ range = range.replace(safeRe[t.CARETTRIM], caretTrimReplace)
+
+ // normalize spaces
+ range = range.split(/\s+/).join(' ')
+
+ // At this point, the range is completely trimmed and
+ // ready to be split into comparators.
+
+ var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]
+ var set = range.split(' ').map(function (comp) {
+ return parseComparator(comp, this.options)
+ }, this).join(' ').split(/\s+/)
+ if (this.options.loose) {
+ // in loose mode, throw out any that are not valid comparators
+ set = set.filter(function (comp) {
+ return !!comp.match(compRe)
+ })
+ }
+ set = set.map(function (comp) {
+ return new Comparator(comp, this.options)
+ }, this)
+
+ return set
+}
+
+Range.prototype.intersects = function (range, options) {
+ if (!(range instanceof Range)) {
+ throw new TypeError('a Range is required')
+ }
+
+ return this.set.some(function (thisComparators) {
+ return (
+ isSatisfiable(thisComparators, options) &&
+ range.set.some(function (rangeComparators) {
+ return (
+ isSatisfiable(rangeComparators, options) &&
+ thisComparators.every(function (thisComparator) {
+ return rangeComparators.every(function (rangeComparator) {
+ return thisComparator.intersects(rangeComparator, options)
+ })
+ })
+ )
+ })
+ )
+ })
+}
+
+// take a set of comparators and determine whether there
+// exists a version which can satisfy it
+function isSatisfiable (comparators, options) {
+ var result = true
+ var remainingComparators = comparators.slice()
+ var testComparator = remainingComparators.pop()
+
+ while (result && remainingComparators.length) {
+ result = remainingComparators.every(function (otherComparator) {
+ return testComparator.intersects(otherComparator, options)
+ })
+
+ testComparator = remainingComparators.pop()
+ }
+
+ return result
+}
+
+// Mostly just for testing and legacy API reasons
+exports.toComparators = toComparators
+function toComparators (range, options) {
+ return new Range(range, options).set.map(function (comp) {
+ return comp.map(function (c) {
+ return c.value
+ }).join(' ').trim().split(' ')
+ })
+}
+
+// comprised of xranges, tildes, stars, and gtlt's at this point.
+// already replaced the hyphen ranges
+// turn into a set of JUST comparators.
+function parseComparator (comp, options) {
+ debug('comp', comp, options)
+ comp = replaceCarets(comp, options)
+ debug('caret', comp)
+ comp = replaceTildes(comp, options)
+ debug('tildes', comp)
+ comp = replaceXRanges(comp, options)
+ debug('xrange', comp)
+ comp = replaceStars(comp, options)
+ debug('stars', comp)
+ return comp
+}
+
+function isX (id) {
+ return !id || id.toLowerCase() === 'x' || id === '*'
+}
+
+// ~, ~> --> * (any, kinda silly)
+// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
+// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
+// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
+// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
+// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
+function replaceTildes (comp, options) {
+ return comp.trim().split(/\s+/).map(function (comp) {
+ return replaceTilde(comp, options)
+ }).join(' ')
+}
+
+function replaceTilde (comp, options) {
+ var r = options.loose ? safeRe[t.TILDELOOSE] : safeRe[t.TILDE]
+ return comp.replace(r, function (_, M, m, p, pr) {
+ debug('tilde', comp, _, M, m, p, pr)
+ var ret
+
+ if (isX(M)) {
+ ret = ''
+ } else if (isX(m)) {
+ ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
+ } else if (isX(p)) {
+ // ~1.2 == >=1.2.0 <1.3.0
+ ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
+ } else if (pr) {
+ debug('replaceTilde pr', pr)
+ ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
+ ' <' + M + '.' + (+m + 1) + '.0'
+ } else {
+ // ~1.2.3 == >=1.2.3 <1.3.0
+ ret = '>=' + M + '.' + m + '.' + p +
+ ' <' + M + '.' + (+m + 1) + '.0'
+ }
+
+ debug('tilde return', ret)
+ return ret
+ })
+}
+
+// ^ --> * (any, kinda silly)
+// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
+// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
+// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
+// ^1.2.3 --> >=1.2.3 <2.0.0
+// ^1.2.0 --> >=1.2.0 <2.0.0
+function replaceCarets (comp, options) {
+ return comp.trim().split(/\s+/).map(function (comp) {
+ return replaceCaret(comp, options)
+ }).join(' ')
+}
+
+function replaceCaret (comp, options) {
+ debug('caret', comp, options)
+ var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET]
+ return comp.replace(r, function (_, M, m, p, pr) {
+ debug('caret', comp, _, M, m, p, pr)
+ var ret
+
+ if (isX(M)) {
+ ret = ''
+ } else if (isX(m)) {
+ ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
+ } else if (isX(p)) {
+ if (M === '0') {
+ ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
+ } else {
+ ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
+ }
+ } else if (pr) {
+ debug('replaceCaret pr', pr)
+ if (M === '0') {
+ if (m === '0') {
+ ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
+ ' <' + M + '.' + m + '.' + (+p + 1)
+ } else {
+ ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
+ ' <' + M + '.' + (+m + 1) + '.0'
+ }
+ } else {
+ ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
+ ' <' + (+M + 1) + '.0.0'
+ }
+ } else {
+ debug('no pr')
+ if (M === '0') {
+ if (m === '0') {
+ ret = '>=' + M + '.' + m + '.' + p +
+ ' <' + M + '.' + m + '.' + (+p + 1)
+ } else {
+ ret = '>=' + M + '.' + m + '.' + p +
+ ' <' + M + '.' + (+m + 1) + '.0'
+ }
+ } else {
+ ret = '>=' + M + '.' + m + '.' + p +
+ ' <' + (+M + 1) + '.0.0'
+ }
+ }
+
+ debug('caret return', ret)
+ return ret
+ })
+}
+
+function replaceXRanges (comp, options) {
+ debug('replaceXRanges', comp, options)
+ return comp.split(/\s+/).map(function (comp) {
+ return replaceXRange(comp, options)
+ }).join(' ')
+}
+
+function replaceXRange (comp, options) {
+ comp = comp.trim()
+ var r = options.loose ? safeRe[t.XRANGELOOSE] : safeRe[t.XRANGE]
+ return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
+ debug('xRange', comp, ret, gtlt, M, m, p, pr)
+ var xM = isX(M)
+ var xm = xM || isX(m)
+ var xp = xm || isX(p)
+ var anyX = xp
+
+ if (gtlt === '=' && anyX) {
+ gtlt = ''
+ }
+
+ // if we're including prereleases in the match, then we need
+ // to fix this to -0, the lowest possible prerelease value
+ pr = options.includePrerelease ? '-0' : ''
+
+ if (xM) {
+ if (gtlt === '>' || gtlt === '<') {
+ // nothing is allowed
+ ret = '<0.0.0-0'
+ } else {
+ // nothing is forbidden
+ ret = '*'
+ }
+ } else if (gtlt && anyX) {
+ // we know patch is an x, because we have any x at all.
+ // replace X with 0
+ if (xm) {
+ m = 0
+ }
+ p = 0
+
+ if (gtlt === '>') {
+ // >1 => >=2.0.0
+ // >1.2 => >=1.3.0
+ // >1.2.3 => >= 1.2.4
+ gtlt = '>='
+ if (xm) {
+ M = +M + 1
+ m = 0
+ p = 0
+ } else {
+ m = +m + 1
+ p = 0
+ }
+ } else if (gtlt === '<=') {
+ // <=0.7.x is actually <0.8.0, since any 0.7.x should
+ // pass. Similarly, <=7.x is actually <8.0.0, etc.
+ gtlt = '<'
+ if (xm) {
+ M = +M + 1
+ } else {
+ m = +m + 1
+ }
+ }
+
+ ret = gtlt + M + '.' + m + '.' + p + pr
+ } else if (xm) {
+ ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr
+ } else if (xp) {
+ ret = '>=' + M + '.' + m + '.0' + pr +
+ ' <' + M + '.' + (+m + 1) + '.0' + pr
+ }
+
+ debug('xRange return', ret)
+
+ return ret
+ })
+}
+
+// Because * is AND-ed with everything else in the comparator,
+// and '' means "any version", just remove the *s entirely.
+function replaceStars (comp, options) {
+ debug('replaceStars', comp, options)
+ // Looseness is ignored here. star is always as loose as it gets!
+ return comp.trim().replace(safeRe[t.STAR], '')
+}
+
+// This function is passed to string.replace(re[t.HYPHENRANGE])
+// M, m, patch, prerelease, build
+// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
+// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
+// 1.2 - 3.4 => >=1.2.0 <3.5.0
+function hyphenReplace ($0,
+ from, fM, fm, fp, fpr, fb,
+ to, tM, tm, tp, tpr, tb) {
+ if (isX(fM)) {
+ from = ''
+ } else if (isX(fm)) {
+ from = '>=' + fM + '.0.0'
+ } else if (isX(fp)) {
+ from = '>=' + fM + '.' + fm + '.0'
+ } else {
+ from = '>=' + from
+ }
+
+ if (isX(tM)) {
+ to = ''
+ } else if (isX(tm)) {
+ to = '<' + (+tM + 1) + '.0.0'
+ } else if (isX(tp)) {
+ to = '<' + tM + '.' + (+tm + 1) + '.0'
+ } else if (tpr) {
+ to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
+ } else {
+ to = '<=' + to
+ }
+
+ return (from + ' ' + to).trim()
+}
+
+// if ANY of the sets match ALL of its comparators, then pass
+Range.prototype.test = function (version) {
+ if (!version) {
+ return false
+ }
+
+ if (typeof version === 'string') {
+ try {
+ version = new SemVer(version, this.options)
+ } catch (er) {
+ return false
+ }
+ }
+
+ for (var i = 0; i < this.set.length; i++) {
+ if (testSet(this.set[i], version, this.options)) {
+ return true
+ }
+ }
+ return false
+}
+
+function testSet (set, version, options) {
+ for (var i = 0; i < set.length; i++) {
+ if (!set[i].test(version)) {
+ return false
+ }
+ }
+
+ if (version.prerelease.length && !options.includePrerelease) {
+ // Find the set of versions that are allowed to have prereleases
+ // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
+ // That should allow `1.2.3-pr.2` to pass.
+ // However, `1.2.4-alpha.notready` should NOT be allowed,
+ // even though it's within the range set by the comparators.
+ for (i = 0; i < set.length; i++) {
+ debug(set[i].semver)
+ if (set[i].semver === ANY) {
+ continue
+ }
+
+ if (set[i].semver.prerelease.length > 0) {
+ var allowed = set[i].semver
+ if (allowed.major === version.major &&
+ allowed.minor === version.minor &&
+ allowed.patch === version.patch) {
+ return true
+ }
+ }
+ }
+
+ // Version has a -pre, but it's not one of the ones we like.
+ return false
+ }
+
+ return true
+}
+
+exports.satisfies = satisfies
+function satisfies (version, range, options) {
+ try {
+ range = new Range(range, options)
+ } catch (er) {
+ return false
+ }
+ return range.test(version)
+}
+
+exports.maxSatisfying = maxSatisfying
+function maxSatisfying (versions, range, options) {
+ var max = null
+ var maxSV = null
+ try {
+ var rangeObj = new Range(range, options)
+ } catch (er) {
+ return null
+ }
+ versions.forEach(function (v) {
+ if (rangeObj.test(v)) {
+ // satisfies(v, range, options)
+ if (!max || maxSV.compare(v) === -1) {
+ // compare(max, v, true)
+ max = v
+ maxSV = new SemVer(max, options)
+ }
+ }
+ })
+ return max
+}
+
+exports.minSatisfying = minSatisfying
+function minSatisfying (versions, range, options) {
+ var min = null
+ var minSV = null
+ try {
+ var rangeObj = new Range(range, options)
+ } catch (er) {
+ return null
+ }
+ versions.forEach(function (v) {
+ if (rangeObj.test(v)) {
+ // satisfies(v, range, options)
+ if (!min || minSV.compare(v) === 1) {
+ // compare(min, v, true)
+ min = v
+ minSV = new SemVer(min, options)
+ }
+ }
+ })
+ return min
+}
+
+exports.minVersion = minVersion
+function minVersion (range, loose) {
+ range = new Range(range, loose)
+
+ var minver = new SemVer('0.0.0')
+ if (range.test(minver)) {
+ return minver
+ }
+
+ minver = new SemVer('0.0.0-0')
+ if (range.test(minver)) {
+ return minver
+ }
+
+ minver = null
+ for (var i = 0; i < range.set.length; ++i) {
+ var comparators = range.set[i]
+
+ comparators.forEach(function (comparator) {
+ // Clone to avoid manipulating the comparator's semver object.
+ var compver = new SemVer(comparator.semver.version)
+ switch (comparator.operator) {
+ case '>':
+ if (compver.prerelease.length === 0) {
+ compver.patch++
+ } else {
+ compver.prerelease.push(0)
+ }
+ compver.raw = compver.format()
+ /* fallthrough */
+ case '':
+ case '>=':
+ if (!minver || gt(minver, compver)) {
+ minver = compver
+ }
+ break
+ case '<':
+ case '<=':
+ /* Ignore maximum versions */
+ break
+ /* istanbul ignore next */
+ default:
+ throw new Error('Unexpected operation: ' + comparator.operator)
+ }
+ })
+ }
+
+ if (minver && range.test(minver)) {
+ return minver
+ }
+
+ return null
+}
+
+exports.validRange = validRange
+function validRange (range, options) {
+ try {
+ // Return '*' instead of '' so that truthiness works.
+ // This will throw if it's invalid anyway
+ return new Range(range, options).range || '*'
+ } catch (er) {
+ return null
+ }
+}
+
+// Determine if version is less than all the versions possible in the range
+exports.ltr = ltr
+function ltr (version, range, options) {
+ return outside(version, range, '<', options)
+}
+
+// Determine if version is greater than all the versions possible in the range.
+exports.gtr = gtr
+function gtr (version, range, options) {
+ return outside(version, range, '>', options)
+}
+
+exports.outside = outside
+function outside (version, range, hilo, options) {
+ version = new SemVer(version, options)
+ range = new Range(range, options)
+
+ var gtfn, ltefn, ltfn, comp, ecomp
+ switch (hilo) {
+ case '>':
+ gtfn = gt
+ ltefn = lte
+ ltfn = lt
+ comp = '>'
+ ecomp = '>='
+ break
+ case '<':
+ gtfn = lt
+ ltefn = gte
+ ltfn = gt
+ comp = '<'
+ ecomp = '<='
+ break
+ default:
+ throw new TypeError('Must provide a hilo val of "<" or ">"')
+ }
+
+ // If it satisifes the range it is not outside
+ if (satisfies(version, range, options)) {
+ return false
+ }
+
+ // From now on, variable terms are as if we're in "gtr" mode.
+ // but note that everything is flipped for the "ltr" function.
+
+ for (var i = 0; i < range.set.length; ++i) {
+ var comparators = range.set[i]
+
+ var high = null
+ var low = null
+
+ comparators.forEach(function (comparator) {
+ if (comparator.semver === ANY) {
+ comparator = new Comparator('>=0.0.0')
+ }
+ high = high || comparator
+ low = low || comparator
+ if (gtfn(comparator.semver, high.semver, options)) {
+ high = comparator
+ } else if (ltfn(comparator.semver, low.semver, options)) {
+ low = comparator
+ }
+ })
+
+ // If the edge version comparator has a operator then our version
+ // isn't outside it
+ if (high.operator === comp || high.operator === ecomp) {
+ return false
+ }
+
+ // If the lowest version comparator has an operator and our version
+ // is less than it then it isn't higher than the range
+ if ((!low.operator || low.operator === comp) &&
+ ltefn(version, low.semver)) {
+ return false
+ } else if (low.operator === ecomp && ltfn(version, low.semver)) {
+ return false
+ }
+ }
+ return true
+}
+
+exports.prerelease = prerelease
+function prerelease (version, options) {
+ var parsed = parse(version, options)
+ return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
+}
+
+exports.intersects = intersects
+function intersects (r1, r2, options) {
+ r1 = new Range(r1, options)
+ r2 = new Range(r2, options)
+ return r1.intersects(r2)
+}
+
+exports.coerce = coerce
+function coerce (version, options) {
+ if (version instanceof SemVer) {
+ return version
+ }
+
+ if (typeof version === 'number') {
+ version = String(version)
+ }
+
+ if (typeof version !== 'string') {
+ return null
+ }
+
+ options = options || {}
+
+ var match = null
+ if (!options.rtl) {
+ match = version.match(safeRe[t.COERCE])
+ } else {
+ // Find the right-most coercible string that does not share
+ // a terminus with a more left-ward coercible string.
+ // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
+ //
+ // Walk through the string checking with a /g regexp
+ // Manually set the index so as to pick up overlapping matches.
+ // Stop when we get a match that ends at the string end, since no
+ // coercible string can be more right-ward without the same terminus.
+ var next
+ while ((next = safeRe[t.COERCERTL].exec(version)) &&
+ (!match || match.index + match[0].length !== version.length)
+ ) {
+ if (!match ||
+ next.index + next[0].length !== match.index + match[0].length) {
+ match = next
+ }
+ safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length
+ }
+ // leave it in a clean state
+ safeRe[t.COERCERTL].lastIndex = -1
+ }
+
+ if (match === null) {
+ return null
+ }
+
+ return parse(match[2] +
+ '.' + (match[3] || '0') +
+ '.' + (match[4] || '0'), options)
+}
diff --git a/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-rule-docs/.github/workflows/publish.yml b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-rule-docs/.github/workflows/publish.yml
new file mode 100644
index 0000000000000000000000000000000000000000..7cc23fa61508a4425629fc6a26293b296fd1dc7d
--- /dev/null
+++ b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-rule-docs/.github/workflows/publish.yml
@@ -0,0 +1,31 @@
+name: Publish
+on:
+ workflow_dispatch:
+ push:
+ schedule:
+ - cron: '0 0 * * 0'
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - uses: actions/setup-node@v3
+ with:
+ node-version: 16
+ registry-url: https://registry.npmjs.org/
+ - run: npm ci
+ - run: npm run update-plugins
+ - run: npm test
+ - run: npm version patch --no-git-tag-version
+ - run: npm publish
+ env:
+ NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}
+ - name: Commit changes back
+ shell: bash
+ run: |
+ git config --global user.email "github-actions[bot]@users.noreply.github.com" && \
+ git config --global user.name "github-actions[bot]" && \
+ git add plugins.json README.md && \
+ git diff-index --quiet HEAD || \
+ git commit -m 'New release' && \
+ git push origin master
\ No newline at end of file
diff --git a/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-scope/dist/eslint-scope.cjs b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-scope/dist/eslint-scope.cjs
new file mode 100644
index 0000000000000000000000000000000000000000..291fcdcdc9e92a204e26647ef8b62889cde6d249
--- /dev/null
+++ b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-scope/dist/eslint-scope.cjs
@@ -0,0 +1,2240 @@
+'use strict';
+
+Object.defineProperty(exports, '__esModule', { value: true });
+
+var assert = require('assert');
+var estraverse = require('estraverse');
+var esrecurse = require('esrecurse');
+
+function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
+
+var assert__default = /*#__PURE__*/_interopDefaultLegacy(assert);
+var estraverse__default = /*#__PURE__*/_interopDefaultLegacy(estraverse);
+var esrecurse__default = /*#__PURE__*/_interopDefaultLegacy(esrecurse);
+
+/*
+ Copyright (C) 2015 Yusuke Suzuki
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+const READ = 0x1;
+const WRITE = 0x2;
+const RW = READ | WRITE;
+
+/**
+ * A Reference represents a single occurrence of an identifier in code.
+ * @constructor Reference
+ */
+class Reference {
+ constructor(ident, scope, flag, writeExpr, maybeImplicitGlobal, partial, init) {
+
+ /**
+ * Identifier syntax node.
+ * @member {espreeIdentifier} Reference#identifier
+ */
+ this.identifier = ident;
+
+ /**
+ * Reference to the enclosing Scope.
+ * @member {Scope} Reference#from
+ */
+ this.from = scope;
+
+ /**
+ * Whether the reference comes from a dynamic scope (such as 'eval',
+ * 'with', etc.), and may be trapped by dynamic scopes.
+ * @member {boolean} Reference#tainted
+ */
+ this.tainted = false;
+
+ /**
+ * The variable this reference is resolved with.
+ * @member {Variable} Reference#resolved
+ */
+ this.resolved = null;
+
+ /**
+ * The read-write mode of the reference. (Value is one of {@link
+ * Reference.READ}, {@link Reference.RW}, {@link Reference.WRITE}).
+ * @member {number} Reference#flag
+ * @private
+ */
+ this.flag = flag;
+ if (this.isWrite()) {
+
+ /**
+ * If reference is writeable, this is the tree being written to it.
+ * @member {espreeNode} Reference#writeExpr
+ */
+ this.writeExpr = writeExpr;
+
+ /**
+ * Whether the Reference might refer to a partial value of writeExpr.
+ * @member {boolean} Reference#partial
+ */
+ this.partial = partial;
+
+ /**
+ * Whether the Reference is to write of initialization.
+ * @member {boolean} Reference#init
+ */
+ this.init = init;
+ }
+ this.__maybeImplicitGlobal = maybeImplicitGlobal;
+ }
+
+ /**
+ * Whether the reference is static.
+ * @function Reference#isStatic
+ * @returns {boolean} static
+ */
+ isStatic() {
+ return !this.tainted && this.resolved && this.resolved.scope.isStatic();
+ }
+
+ /**
+ * Whether the reference is writeable.
+ * @function Reference#isWrite
+ * @returns {boolean} write
+ */
+ isWrite() {
+ return !!(this.flag & Reference.WRITE);
+ }
+
+ /**
+ * Whether the reference is readable.
+ * @function Reference#isRead
+ * @returns {boolean} read
+ */
+ isRead() {
+ return !!(this.flag & Reference.READ);
+ }
+
+ /**
+ * Whether the reference is read-only.
+ * @function Reference#isReadOnly
+ * @returns {boolean} read only
+ */
+ isReadOnly() {
+ return this.flag === Reference.READ;
+ }
+
+ /**
+ * Whether the reference is write-only.
+ * @function Reference#isWriteOnly
+ * @returns {boolean} write only
+ */
+ isWriteOnly() {
+ return this.flag === Reference.WRITE;
+ }
+
+ /**
+ * Whether the reference is read-write.
+ * @function Reference#isReadWrite
+ * @returns {boolean} read write
+ */
+ isReadWrite() {
+ return this.flag === Reference.RW;
+ }
+}
+
+/**
+ * @constant Reference.READ
+ * @private
+ */
+Reference.READ = READ;
+
+/**
+ * @constant Reference.WRITE
+ * @private
+ */
+Reference.WRITE = WRITE;
+
+/**
+ * @constant Reference.RW
+ * @private
+ */
+Reference.RW = RW;
+
+/* vim: set sw=4 ts=4 et tw=80 : */
+
+/*
+ Copyright (C) 2015 Yusuke Suzuki
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/**
+ * A Variable represents a locally scoped identifier. These include arguments to
+ * functions.
+ * @constructor Variable
+ */
+class Variable {
+ constructor(name, scope) {
+
+ /**
+ * The variable name, as given in the source code.
+ * @member {string} Variable#name
+ */
+ this.name = name;
+
+ /**
+ * List of defining occurrences of this variable (like in 'var ...'
+ * statements or as parameter), as AST nodes.
+ * @member {espree.Identifier[]} Variable#identifiers
+ */
+ this.identifiers = [];
+
+ /**
+ * List of {@link Reference|references} of this variable (excluding parameter entries)
+ * in its defining scope and all nested scopes. For defining
+ * occurrences only see {@link Variable#defs}.
+ * @member {Reference[]} Variable#references
+ */
+ this.references = [];
+
+ /**
+ * List of defining occurrences of this variable (like in 'var ...'
+ * statements or as parameter), as custom objects.
+ * @member {Definition[]} Variable#defs
+ */
+ this.defs = [];
+
+ this.tainted = false;
+
+ /**
+ * Whether this is a stack variable.
+ * @member {boolean} Variable#stack
+ */
+ this.stack = true;
+
+ /**
+ * Reference to the enclosing Scope.
+ * @member {Scope} Variable#scope
+ */
+ this.scope = scope;
+ }
+}
+
+Variable.CatchClause = "CatchClause";
+Variable.Parameter = "Parameter";
+Variable.FunctionName = "FunctionName";
+Variable.ClassName = "ClassName";
+Variable.Variable = "Variable";
+Variable.ImportBinding = "ImportBinding";
+Variable.ImplicitGlobalVariable = "ImplicitGlobalVariable";
+
+/* vim: set sw=4 ts=4 et tw=80 : */
+
+/*
+ Copyright (C) 2015 Yusuke Suzuki
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/**
+ * @constructor Definition
+ */
+class Definition {
+ constructor(type, name, node, parent, index, kind) {
+
+ /**
+ * @member {string} Definition#type - type of the occurrence (e.g. "Parameter", "Variable", ...).
+ */
+ this.type = type;
+
+ /**
+ * @member {espree.Identifier} Definition#name - the identifier AST node of the occurrence.
+ */
+ this.name = name;
+
+ /**
+ * @member {espree.Node} Definition#node - the enclosing node of the identifier.
+ */
+ this.node = node;
+
+ /**
+ * @member {espree.Node?} Definition#parent - the enclosing statement node of the identifier.
+ */
+ this.parent = parent;
+
+ /**
+ * @member {number?} Definition#index - the index in the declaration statement.
+ */
+ this.index = index;
+
+ /**
+ * @member {string?} Definition#kind - the kind of the declaration statement.
+ */
+ this.kind = kind;
+ }
+}
+
+/**
+ * @constructor ParameterDefinition
+ */
+class ParameterDefinition extends Definition {
+ constructor(name, node, index, rest) {
+ super(Variable.Parameter, name, node, null, index, null);
+
+ /**
+ * Whether the parameter definition is a part of a rest parameter.
+ * @member {boolean} ParameterDefinition#rest
+ */
+ this.rest = rest;
+ }
+}
+
+/* vim: set sw=4 ts=4 et tw=80 : */
+
+/*
+ Copyright (C) 2015 Yusuke Suzuki
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+const { Syntax: Syntax$2 } = estraverse__default["default"];
+
+/**
+ * Test if scope is struct
+ * @param {Scope} scope scope
+ * @param {Block} block block
+ * @param {boolean} isMethodDefinition is method definition
+ * @param {boolean} useDirective use directive
+ * @returns {boolean} is strict scope
+ */
+function isStrictScope(scope, block, isMethodDefinition, useDirective) {
+ let body;
+
+ // When upper scope is exists and strict, inner scope is also strict.
+ if (scope.upper && scope.upper.isStrict) {
+ return true;
+ }
+
+ if (isMethodDefinition) {
+ return true;
+ }
+
+ if (scope.type === "class" || scope.type === "module") {
+ return true;
+ }
+
+ if (scope.type === "block" || scope.type === "switch") {
+ return false;
+ }
+
+ if (scope.type === "function") {
+ if (block.type === Syntax$2.ArrowFunctionExpression && block.body.type !== Syntax$2.BlockStatement) {
+ return false;
+ }
+
+ if (block.type === Syntax$2.Program) {
+ body = block;
+ } else {
+ body = block.body;
+ }
+
+ if (!body) {
+ return false;
+ }
+ } else if (scope.type === "global") {
+ body = block;
+ } else {
+ return false;
+ }
+
+ // Search 'use strict' directive.
+ if (useDirective) {
+ for (let i = 0, iz = body.body.length; i < iz; ++i) {
+ const stmt = body.body[i];
+
+ if (stmt.type !== Syntax$2.DirectiveStatement) {
+ break;
+ }
+ if (stmt.raw === "\"use strict\"" || stmt.raw === "'use strict'") {
+ return true;
+ }
+ }
+ } else {
+ for (let i = 0, iz = body.body.length; i < iz; ++i) {
+ const stmt = body.body[i];
+
+ if (stmt.type !== Syntax$2.ExpressionStatement) {
+ break;
+ }
+ const expr = stmt.expression;
+
+ if (expr.type !== Syntax$2.Literal || typeof expr.value !== "string") {
+ break;
+ }
+ if (expr.raw !== null && expr.raw !== undefined) {
+ if (expr.raw === "\"use strict\"" || expr.raw === "'use strict'") {
+ return true;
+ }
+ } else {
+ if (expr.value === "use strict") {
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+}
+
+/**
+ * Register scope
+ * @param {ScopeManager} scopeManager scope manager
+ * @param {Scope} scope scope
+ * @returns {void}
+ */
+function registerScope(scopeManager, scope) {
+ scopeManager.scopes.push(scope);
+
+ const scopes = scopeManager.__nodeToScope.get(scope.block);
+
+ if (scopes) {
+ scopes.push(scope);
+ } else {
+ scopeManager.__nodeToScope.set(scope.block, [scope]);
+ }
+}
+
+/**
+ * Should be statically
+ * @param {Object} def def
+ * @returns {boolean} should be statically
+ */
+function shouldBeStatically(def) {
+ return (
+ (def.type === Variable.ClassName) ||
+ (def.type === Variable.Variable && def.parent.kind !== "var")
+ );
+}
+
+/**
+ * @constructor Scope
+ */
+class Scope {
+ constructor(scopeManager, type, upperScope, block, isMethodDefinition) {
+
+ /**
+ * One of "global", "module", "function", "function-expression-name", "block", "switch", "catch", "with", "for",
+ * "class", "class-field-initializer", "class-static-block".
+ * @member {string} Scope#type
+ */
+ this.type = type;
+
+ /**
+ * The scoped {@link Variable}s of this scope, as { Variable.name
+ * : Variable }.
+ * @member {Map} Scope#set
+ */
+ this.set = new Map();
+
+ /**
+ * The tainted variables of this scope, as { Variable.name :
+ * boolean }.
+ * @member {Map} Scope#taints */
+ this.taints = new Map();
+
+ /**
+ * Generally, through the lexical scoping of JS you can always know
+ * which variable an identifier in the source code refers to. There are
+ * a few exceptions to this rule. With 'global' and 'with' scopes you
+ * can only decide at runtime which variable a reference refers to.
+ * Moreover, if 'eval()' is used in a scope, it might introduce new
+ * bindings in this or its parent scopes.
+ * All those scopes are considered 'dynamic'.
+ * @member {boolean} Scope#dynamic
+ */
+ this.dynamic = this.type === "global" || this.type === "with";
+
+ /**
+ * A reference to the scope-defining syntax node.
+ * @member {espree.Node} Scope#block
+ */
+ this.block = block;
+
+ /**
+ * The {@link Reference|references} that are not resolved with this scope.
+ * @member {Reference[]} Scope#through
+ */
+ this.through = [];
+
+ /**
+ * The scoped {@link Variable}s of this scope. In the case of a
+ * 'function' scope this includes the automatic argument arguments as
+ * its first element, as well as all further formal arguments.
+ * @member {Variable[]} Scope#variables
+ */
+ this.variables = [];
+
+ /**
+ * Any variable {@link Reference|reference} found in this scope. This
+ * includes occurrences of local variables as well as variables from
+ * parent scopes (including the global scope). For local variables
+ * this also includes defining occurrences (like in a 'var' statement).
+ * In a 'function' scope this does not include the occurrences of the
+ * formal parameter in the parameter list.
+ * @member {Reference[]} Scope#references
+ */
+ this.references = [];
+
+ /**
+ * For 'global' and 'function' scopes, this is a self-reference. For
+ * other scope types this is the variableScope value of the
+ * parent scope.
+ * @member {Scope} Scope#variableScope
+ */
+ this.variableScope =
+ this.type === "global" ||
+ this.type === "module" ||
+ this.type === "function" ||
+ this.type === "class-field-initializer" ||
+ this.type === "class-static-block"
+ ? this
+ : upperScope.variableScope;
+
+ /**
+ * Whether this scope is created by a FunctionExpression.
+ * @member {boolean} Scope#functionExpressionScope
+ */
+ this.functionExpressionScope = false;
+
+ /**
+ * Whether this is a scope that contains an 'eval()' invocation.
+ * @member {boolean} Scope#directCallToEvalScope
+ */
+ this.directCallToEvalScope = false;
+
+ /**
+ * @member {boolean} Scope#thisFound
+ */
+ this.thisFound = false;
+
+ this.__left = [];
+
+ /**
+ * Reference to the parent {@link Scope|scope}.
+ * @member {Scope} Scope#upper
+ */
+ this.upper = upperScope;
+
+ /**
+ * Whether 'use strict' is in effect in this scope.
+ * @member {boolean} Scope#isStrict
+ */
+ this.isStrict = scopeManager.isStrictModeSupported()
+ ? isStrictScope(this, block, isMethodDefinition, scopeManager.__useDirective())
+ : false;
+
+ /**
+ * List of nested {@link Scope}s.
+ * @member {Scope[]} Scope#childScopes
+ */
+ this.childScopes = [];
+ if (this.upper) {
+ this.upper.childScopes.push(this);
+ }
+
+ this.__declaredVariables = scopeManager.__declaredVariables;
+
+ registerScope(scopeManager, this);
+ }
+
+ __shouldStaticallyClose(scopeManager) {
+ return (!this.dynamic || scopeManager.__isOptimistic());
+ }
+
+ __shouldStaticallyCloseForGlobal(ref) {
+
+ // On global scope, let/const/class declarations should be resolved statically.
+ const name = ref.identifier.name;
+
+ if (!this.set.has(name)) {
+ return false;
+ }
+
+ const variable = this.set.get(name);
+ const defs = variable.defs;
+
+ return defs.length > 0 && defs.every(shouldBeStatically);
+ }
+
+ __staticCloseRef(ref) {
+ if (!this.__resolve(ref)) {
+ this.__delegateToUpperScope(ref);
+ }
+ }
+
+ __dynamicCloseRef(ref) {
+
+ // notify all names are through to global
+ let current = this;
+
+ do {
+ current.through.push(ref);
+ current = current.upper;
+ } while (current);
+ }
+
+ __globalCloseRef(ref) {
+
+ // let/const/class declarations should be resolved statically.
+ // others should be resolved dynamically.
+ if (this.__shouldStaticallyCloseForGlobal(ref)) {
+ this.__staticCloseRef(ref);
+ } else {
+ this.__dynamicCloseRef(ref);
+ }
+ }
+
+ __close(scopeManager) {
+ let closeRef;
+
+ if (this.__shouldStaticallyClose(scopeManager)) {
+ closeRef = this.__staticCloseRef;
+ } else if (this.type !== "global") {
+ closeRef = this.__dynamicCloseRef;
+ } else {
+ closeRef = this.__globalCloseRef;
+ }
+
+ // Try Resolving all references in this scope.
+ for (let i = 0, iz = this.__left.length; i < iz; ++i) {
+ const ref = this.__left[i];
+
+ closeRef.call(this, ref);
+ }
+ this.__left = null;
+
+ return this.upper;
+ }
+
+ // To override by function scopes.
+ // References in default parameters isn't resolved to variables which are in their function body.
+ __isValidResolution(ref, variable) { // eslint-disable-line class-methods-use-this, no-unused-vars
+ return true;
+ }
+
+ __resolve(ref) {
+ const name = ref.identifier.name;
+
+ if (!this.set.has(name)) {
+ return false;
+ }
+ const variable = this.set.get(name);
+
+ if (!this.__isValidResolution(ref, variable)) {
+ return false;
+ }
+ variable.references.push(ref);
+ variable.stack = variable.stack && ref.from.variableScope === this.variableScope;
+ if (ref.tainted) {
+ variable.tainted = true;
+ this.taints.set(variable.name, true);
+ }
+ ref.resolved = variable;
+
+ return true;
+ }
+
+ __delegateToUpperScope(ref) {
+ if (this.upper) {
+ this.upper.__left.push(ref);
+ }
+ this.through.push(ref);
+ }
+
+ __addDeclaredVariablesOfNode(variable, node) {
+ if (node === null || node === undefined) {
+ return;
+ }
+
+ let variables = this.__declaredVariables.get(node);
+
+ if (variables === null || variables === undefined) {
+ variables = [];
+ this.__declaredVariables.set(node, variables);
+ }
+ if (variables.indexOf(variable) === -1) {
+ variables.push(variable);
+ }
+ }
+
+ __defineGeneric(name, set, variables, node, def) {
+ let variable;
+
+ variable = set.get(name);
+ if (!variable) {
+ variable = new Variable(name, this);
+ set.set(name, variable);
+ variables.push(variable);
+ }
+
+ if (def) {
+ variable.defs.push(def);
+ this.__addDeclaredVariablesOfNode(variable, def.node);
+ this.__addDeclaredVariablesOfNode(variable, def.parent);
+ }
+ if (node) {
+ variable.identifiers.push(node);
+ }
+ }
+
+ __define(node, def) {
+ if (node && node.type === Syntax$2.Identifier) {
+ this.__defineGeneric(
+ node.name,
+ this.set,
+ this.variables,
+ node,
+ def
+ );
+ }
+ }
+
+ __referencing(node, assign, writeExpr, maybeImplicitGlobal, partial, init) {
+
+ // because Array element may be null
+ if (!node || node.type !== Syntax$2.Identifier) {
+ return;
+ }
+
+ // Specially handle like `this`.
+ if (node.name === "super") {
+ return;
+ }
+
+ const ref = new Reference(node, this, assign || Reference.READ, writeExpr, maybeImplicitGlobal, !!partial, !!init);
+
+ this.references.push(ref);
+ this.__left.push(ref);
+ }
+
+ __detectEval() {
+ let current = this;
+
+ this.directCallToEvalScope = true;
+ do {
+ current.dynamic = true;
+ current = current.upper;
+ } while (current);
+ }
+
+ __detectThis() {
+ this.thisFound = true;
+ }
+
+ __isClosed() {
+ return this.__left === null;
+ }
+
+ /**
+ * returns resolved {Reference}
+ * @function Scope#resolve
+ * @param {Espree.Identifier} ident identifier to be resolved.
+ * @returns {Reference} reference
+ */
+ resolve(ident) {
+ let ref, i, iz;
+
+ assert__default["default"](this.__isClosed(), "Scope should be closed.");
+ assert__default["default"](ident.type === Syntax$2.Identifier, "Target should be identifier.");
+ for (i = 0, iz = this.references.length; i < iz; ++i) {
+ ref = this.references[i];
+ if (ref.identifier === ident) {
+ return ref;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * returns this scope is static
+ * @function Scope#isStatic
+ * @returns {boolean} static
+ */
+ isStatic() {
+ return !this.dynamic;
+ }
+
+ /**
+ * returns this scope has materialized arguments
+ * @function Scope#isArgumentsMaterialized
+ * @returns {boolean} arguemnts materialized
+ */
+ isArgumentsMaterialized() { // eslint-disable-line class-methods-use-this
+ return true;
+ }
+
+ /**
+ * returns this scope has materialized `this` reference
+ * @function Scope#isThisMaterialized
+ * @returns {boolean} this materialized
+ */
+ isThisMaterialized() { // eslint-disable-line class-methods-use-this
+ return true;
+ }
+
+ isUsedName(name) {
+ if (this.set.has(name)) {
+ return true;
+ }
+ for (let i = 0, iz = this.through.length; i < iz; ++i) {
+ if (this.through[i].identifier.name === name) {
+ return true;
+ }
+ }
+ return false;
+ }
+}
+
+class GlobalScope extends Scope {
+ constructor(scopeManager, block) {
+ super(scopeManager, "global", null, block, false);
+ this.implicit = {
+ set: new Map(),
+ variables: [],
+
+ /**
+ * List of {@link Reference}s that are left to be resolved (i.e. which
+ * need to be linked to the variable they refer to).
+ * @member {Reference[]} Scope#implicit#left
+ */
+ left: []
+ };
+ }
+
+ __close(scopeManager) {
+ const implicit = [];
+
+ for (let i = 0, iz = this.__left.length; i < iz; ++i) {
+ const ref = this.__left[i];
+
+ if (ref.__maybeImplicitGlobal && !this.set.has(ref.identifier.name)) {
+ implicit.push(ref.__maybeImplicitGlobal);
+ }
+ }
+
+ // create an implicit global variable from assignment expression
+ for (let i = 0, iz = implicit.length; i < iz; ++i) {
+ const info = implicit[i];
+
+ this.__defineImplicit(info.pattern,
+ new Definition(
+ Variable.ImplicitGlobalVariable,
+ info.pattern,
+ info.node,
+ null,
+ null,
+ null
+ ));
+
+ }
+
+ this.implicit.left = this.__left;
+
+ return super.__close(scopeManager);
+ }
+
+ __defineImplicit(node, def) {
+ if (node && node.type === Syntax$2.Identifier) {
+ this.__defineGeneric(
+ node.name,
+ this.implicit.set,
+ this.implicit.variables,
+ node,
+ def
+ );
+ }
+ }
+}
+
+class ModuleScope extends Scope {
+ constructor(scopeManager, upperScope, block) {
+ super(scopeManager, "module", upperScope, block, false);
+ }
+}
+
+class FunctionExpressionNameScope extends Scope {
+ constructor(scopeManager, upperScope, block) {
+ super(scopeManager, "function-expression-name", upperScope, block, false);
+ this.__define(block.id,
+ new Definition(
+ Variable.FunctionName,
+ block.id,
+ block,
+ null,
+ null,
+ null
+ ));
+ this.functionExpressionScope = true;
+ }
+}
+
+class CatchScope extends Scope {
+ constructor(scopeManager, upperScope, block) {
+ super(scopeManager, "catch", upperScope, block, false);
+ }
+}
+
+class WithScope extends Scope {
+ constructor(scopeManager, upperScope, block) {
+ super(scopeManager, "with", upperScope, block, false);
+ }
+
+ __close(scopeManager) {
+ if (this.__shouldStaticallyClose(scopeManager)) {
+ return super.__close(scopeManager);
+ }
+
+ for (let i = 0, iz = this.__left.length; i < iz; ++i) {
+ const ref = this.__left[i];
+
+ ref.tainted = true;
+ this.__delegateToUpperScope(ref);
+ }
+ this.__left = null;
+
+ return this.upper;
+ }
+}
+
+class BlockScope extends Scope {
+ constructor(scopeManager, upperScope, block) {
+ super(scopeManager, "block", upperScope, block, false);
+ }
+}
+
+class SwitchScope extends Scope {
+ constructor(scopeManager, upperScope, block) {
+ super(scopeManager, "switch", upperScope, block, false);
+ }
+}
+
+class FunctionScope extends Scope {
+ constructor(scopeManager, upperScope, block, isMethodDefinition) {
+ super(scopeManager, "function", upperScope, block, isMethodDefinition);
+
+ // section 9.2.13, FunctionDeclarationInstantiation.
+ // NOTE Arrow functions never have an arguments objects.
+ if (this.block.type !== Syntax$2.ArrowFunctionExpression) {
+ this.__defineArguments();
+ }
+ }
+
+ isArgumentsMaterialized() {
+
+ // TODO(Constellation)
+ // We can more aggressive on this condition like this.
+ //
+ // function t() {
+ // // arguments of t is always hidden.
+ // function arguments() {
+ // }
+ // }
+ if (this.block.type === Syntax$2.ArrowFunctionExpression) {
+ return false;
+ }
+
+ if (!this.isStatic()) {
+ return true;
+ }
+
+ const variable = this.set.get("arguments");
+
+ assert__default["default"](variable, "Always have arguments variable.");
+ return variable.tainted || variable.references.length !== 0;
+ }
+
+ isThisMaterialized() {
+ if (!this.isStatic()) {
+ return true;
+ }
+ return this.thisFound;
+ }
+
+ __defineArguments() {
+ this.__defineGeneric(
+ "arguments",
+ this.set,
+ this.variables,
+ null,
+ null
+ );
+ this.taints.set("arguments", true);
+ }
+
+ // References in default parameters isn't resolved to variables which are in their function body.
+ // const x = 1
+ // function f(a = x) { // This `x` is resolved to the `x` in the outer scope.
+ // const x = 2
+ // console.log(a)
+ // }
+ __isValidResolution(ref, variable) {
+
+ // If `options.nodejsScope` is true, `this.block` becomes a Program node.
+ if (this.block.type === "Program") {
+ return true;
+ }
+
+ const bodyStart = this.block.body.range[0];
+
+ // It's invalid resolution in the following case:
+ return !(
+ variable.scope === this &&
+ ref.identifier.range[0] < bodyStart && // the reference is in the parameter part.
+ variable.defs.every(d => d.name.range[0] >= bodyStart) // the variable is in the body.
+ );
+ }
+}
+
+class ForScope extends Scope {
+ constructor(scopeManager, upperScope, block) {
+ super(scopeManager, "for", upperScope, block, false);
+ }
+}
+
+class ClassScope extends Scope {
+ constructor(scopeManager, upperScope, block) {
+ super(scopeManager, "class", upperScope, block, false);
+ }
+}
+
+class ClassFieldInitializerScope extends Scope {
+ constructor(scopeManager, upperScope, block) {
+ super(scopeManager, "class-field-initializer", upperScope, block, true);
+ }
+}
+
+class ClassStaticBlockScope extends Scope {
+ constructor(scopeManager, upperScope, block) {
+ super(scopeManager, "class-static-block", upperScope, block, true);
+ }
+}
+
+/* vim: set sw=4 ts=4 et tw=80 : */
+
+/*
+ Copyright (C) 2015 Yusuke Suzuki
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/**
+ * @constructor ScopeManager
+ */
+class ScopeManager {
+ constructor(options) {
+ this.scopes = [];
+ this.globalScope = null;
+ this.__nodeToScope = new WeakMap();
+ this.__currentScope = null;
+ this.__options = options;
+ this.__declaredVariables = new WeakMap();
+ }
+
+ __useDirective() {
+ return this.__options.directive;
+ }
+
+ __isOptimistic() {
+ return this.__options.optimistic;
+ }
+
+ __ignoreEval() {
+ return this.__options.ignoreEval;
+ }
+
+ isGlobalReturn() {
+ return this.__options.nodejsScope || this.__options.sourceType === "commonjs";
+ }
+
+ isModule() {
+ return this.__options.sourceType === "module";
+ }
+
+ isImpliedStrict() {
+ return this.__options.impliedStrict;
+ }
+
+ isStrictModeSupported() {
+ return this.__options.ecmaVersion >= 5;
+ }
+
+ // Returns appropriate scope for this node.
+ __get(node) {
+ return this.__nodeToScope.get(node);
+ }
+
+ /**
+ * Get variables that are declared by the node.
+ *
+ * "are declared by the node" means the node is same as `Variable.defs[].node` or `Variable.defs[].parent`.
+ * If the node declares nothing, this method returns an empty array.
+ * CAUTION: This API is experimental. See https://github.com/estools/escope/pull/69 for more details.
+ * @param {Espree.Node} node a node to get.
+ * @returns {Variable[]} variables that declared by the node.
+ */
+ getDeclaredVariables(node) {
+ return this.__declaredVariables.get(node) || [];
+ }
+
+ /**
+ * acquire scope from node.
+ * @function ScopeManager#acquire
+ * @param {Espree.Node} node node for the acquired scope.
+ * @param {?boolean} [inner=false] look up the most inner scope, default value is false.
+ * @returns {Scope?} Scope from node
+ */
+ acquire(node, inner) {
+
+ /**
+ * predicate
+ * @param {Scope} testScope scope to test
+ * @returns {boolean} predicate
+ */
+ function predicate(testScope) {
+ if (testScope.type === "function" && testScope.functionExpressionScope) {
+ return false;
+ }
+ return true;
+ }
+
+ const scopes = this.__get(node);
+
+ if (!scopes || scopes.length === 0) {
+ return null;
+ }
+
+ // Heuristic selection from all scopes.
+ // If you would like to get all scopes, please use ScopeManager#acquireAll.
+ if (scopes.length === 1) {
+ return scopes[0];
+ }
+
+ if (inner) {
+ for (let i = scopes.length - 1; i >= 0; --i) {
+ const scope = scopes[i];
+
+ if (predicate(scope)) {
+ return scope;
+ }
+ }
+ } else {
+ for (let i = 0, iz = scopes.length; i < iz; ++i) {
+ const scope = scopes[i];
+
+ if (predicate(scope)) {
+ return scope;
+ }
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * acquire all scopes from node.
+ * @function ScopeManager#acquireAll
+ * @param {Espree.Node} node node for the acquired scope.
+ * @returns {Scopes?} Scope array
+ */
+ acquireAll(node) {
+ return this.__get(node);
+ }
+
+ /**
+ * release the node.
+ * @function ScopeManager#release
+ * @param {Espree.Node} node releasing node.
+ * @param {?boolean} [inner=false] look up the most inner scope, default value is false.
+ * @returns {Scope?} upper scope for the node.
+ */
+ release(node, inner) {
+ const scopes = this.__get(node);
+
+ if (scopes && scopes.length) {
+ const scope = scopes[0].upper;
+
+ if (!scope) {
+ return null;
+ }
+ return this.acquire(scope.block, inner);
+ }
+ return null;
+ }
+
+ attach() { } // eslint-disable-line class-methods-use-this
+
+ detach() { } // eslint-disable-line class-methods-use-this
+
+ __nestScope(scope) {
+ if (scope instanceof GlobalScope) {
+ assert__default["default"](this.__currentScope === null);
+ this.globalScope = scope;
+ }
+ this.__currentScope = scope;
+ return scope;
+ }
+
+ __nestGlobalScope(node) {
+ return this.__nestScope(new GlobalScope(this, node));
+ }
+
+ __nestBlockScope(node) {
+ return this.__nestScope(new BlockScope(this, this.__currentScope, node));
+ }
+
+ __nestFunctionScope(node, isMethodDefinition) {
+ return this.__nestScope(new FunctionScope(this, this.__currentScope, node, isMethodDefinition));
+ }
+
+ __nestForScope(node) {
+ return this.__nestScope(new ForScope(this, this.__currentScope, node));
+ }
+
+ __nestCatchScope(node) {
+ return this.__nestScope(new CatchScope(this, this.__currentScope, node));
+ }
+
+ __nestWithScope(node) {
+ return this.__nestScope(new WithScope(this, this.__currentScope, node));
+ }
+
+ __nestClassScope(node) {
+ return this.__nestScope(new ClassScope(this, this.__currentScope, node));
+ }
+
+ __nestClassFieldInitializerScope(node) {
+ return this.__nestScope(new ClassFieldInitializerScope(this, this.__currentScope, node));
+ }
+
+ __nestClassStaticBlockScope(node) {
+ return this.__nestScope(new ClassStaticBlockScope(this, this.__currentScope, node));
+ }
+
+ __nestSwitchScope(node) {
+ return this.__nestScope(new SwitchScope(this, this.__currentScope, node));
+ }
+
+ __nestModuleScope(node) {
+ return this.__nestScope(new ModuleScope(this, this.__currentScope, node));
+ }
+
+ __nestFunctionExpressionNameScope(node) {
+ return this.__nestScope(new FunctionExpressionNameScope(this, this.__currentScope, node));
+ }
+
+ __isES6() {
+ return this.__options.ecmaVersion >= 6;
+ }
+}
+
+/* vim: set sw=4 ts=4 et tw=80 : */
+
+/*
+ Copyright (C) 2015 Yusuke Suzuki
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+const { Syntax: Syntax$1 } = estraverse__default["default"];
+
+/**
+ * Get last array element
+ * @param {Array} xs array
+ * @returns {any} Last elment
+ */
+function getLast(xs) {
+ return xs[xs.length - 1] || null;
+}
+
+class PatternVisitor extends esrecurse__default["default"].Visitor {
+ static isPattern(node) {
+ const nodeType = node.type;
+
+ return (
+ nodeType === Syntax$1.Identifier ||
+ nodeType === Syntax$1.ObjectPattern ||
+ nodeType === Syntax$1.ArrayPattern ||
+ nodeType === Syntax$1.SpreadElement ||
+ nodeType === Syntax$1.RestElement ||
+ nodeType === Syntax$1.AssignmentPattern
+ );
+ }
+
+ constructor(options, rootPattern, callback) {
+ super(null, options);
+ this.rootPattern = rootPattern;
+ this.callback = callback;
+ this.assignments = [];
+ this.rightHandNodes = [];
+ this.restElements = [];
+ }
+
+ Identifier(pattern) {
+ const lastRestElement = getLast(this.restElements);
+
+ this.callback(pattern, {
+ topLevel: pattern === this.rootPattern,
+ rest: lastRestElement !== null && lastRestElement !== undefined && lastRestElement.argument === pattern,
+ assignments: this.assignments
+ });
+ }
+
+ Property(property) {
+
+ // Computed property's key is a right hand node.
+ if (property.computed) {
+ this.rightHandNodes.push(property.key);
+ }
+
+ // If it's shorthand, its key is same as its value.
+ // If it's shorthand and has its default value, its key is same as its value.left (the value is AssignmentPattern).
+ // If it's not shorthand, the name of new variable is its value's.
+ this.visit(property.value);
+ }
+
+ ArrayPattern(pattern) {
+ for (let i = 0, iz = pattern.elements.length; i < iz; ++i) {
+ const element = pattern.elements[i];
+
+ this.visit(element);
+ }
+ }
+
+ AssignmentPattern(pattern) {
+ this.assignments.push(pattern);
+ this.visit(pattern.left);
+ this.rightHandNodes.push(pattern.right);
+ this.assignments.pop();
+ }
+
+ RestElement(pattern) {
+ this.restElements.push(pattern);
+ this.visit(pattern.argument);
+ this.restElements.pop();
+ }
+
+ MemberExpression(node) {
+
+ // Computed property's key is a right hand node.
+ if (node.computed) {
+ this.rightHandNodes.push(node.property);
+ }
+
+ // the object is only read, write to its property.
+ this.rightHandNodes.push(node.object);
+ }
+
+ //
+ // ForInStatement.left and AssignmentExpression.left are LeftHandSideExpression.
+ // By spec, LeftHandSideExpression is Pattern or MemberExpression.
+ // (see also: https://github.com/estree/estree/pull/20#issuecomment-74584758)
+ // But espree 2.0 parses to ArrayExpression, ObjectExpression, etc...
+ //
+
+ SpreadElement(node) {
+ this.visit(node.argument);
+ }
+
+ ArrayExpression(node) {
+ node.elements.forEach(this.visit, this);
+ }
+
+ AssignmentExpression(node) {
+ this.assignments.push(node);
+ this.visit(node.left);
+ this.rightHandNodes.push(node.right);
+ this.assignments.pop();
+ }
+
+ CallExpression(node) {
+
+ // arguments are right hand nodes.
+ node.arguments.forEach(a => {
+ this.rightHandNodes.push(a);
+ });
+ this.visit(node.callee);
+ }
+}
+
+/* vim: set sw=4 ts=4 et tw=80 : */
+
+/*
+ Copyright (C) 2015 Yusuke Suzuki
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+const { Syntax } = estraverse__default["default"];
+
+/**
+ * Traverse identifier in pattern
+ * @param {Object} options options
+ * @param {pattern} rootPattern root pattern
+ * @param {Refencer} referencer referencer
+ * @param {callback} callback callback
+ * @returns {void}
+ */
+function traverseIdentifierInPattern(options, rootPattern, referencer, callback) {
+
+ // Call the callback at left hand identifier nodes, and Collect right hand nodes.
+ const visitor = new PatternVisitor(options, rootPattern, callback);
+
+ visitor.visit(rootPattern);
+
+ // Process the right hand nodes recursively.
+ if (referencer !== null && referencer !== undefined) {
+ visitor.rightHandNodes.forEach(referencer.visit, referencer);
+ }
+}
+
+// Importing ImportDeclaration.
+// http://people.mozilla.org/~jorendorff/es6-draft.html#sec-moduledeclarationinstantiation
+// https://github.com/estree/estree/blob/master/es6.md#importdeclaration
+// FIXME: Now, we don't create module environment, because the context is
+// implementation dependent.
+
+class Importer extends esrecurse__default["default"].Visitor {
+ constructor(declaration, referencer) {
+ super(null, referencer.options);
+ this.declaration = declaration;
+ this.referencer = referencer;
+ }
+
+ visitImport(id, specifier) {
+ this.referencer.visitPattern(id, pattern => {
+ this.referencer.currentScope().__define(pattern,
+ new Definition(
+ Variable.ImportBinding,
+ pattern,
+ specifier,
+ this.declaration,
+ null,
+ null
+ ));
+ });
+ }
+
+ ImportNamespaceSpecifier(node) {
+ const local = (node.local || node.id);
+
+ if (local) {
+ this.visitImport(local, node);
+ }
+ }
+
+ ImportDefaultSpecifier(node) {
+ const local = (node.local || node.id);
+
+ this.visitImport(local, node);
+ }
+
+ ImportSpecifier(node) {
+ const local = (node.local || node.id);
+
+ if (node.name) {
+ this.visitImport(node.name, node);
+ } else {
+ this.visitImport(local, node);
+ }
+ }
+}
+
+// Referencing variables and creating bindings.
+class Referencer extends esrecurse__default["default"].Visitor {
+ constructor(options, scopeManager) {
+ super(null, options);
+ this.options = options;
+ this.scopeManager = scopeManager;
+ this.parent = null;
+ this.isInnerMethodDefinition = false;
+ }
+
+ currentScope() {
+ return this.scopeManager.__currentScope;
+ }
+
+ close(node) {
+ while (this.currentScope() && node === this.currentScope().block) {
+ this.scopeManager.__currentScope = this.currentScope().__close(this.scopeManager);
+ }
+ }
+
+ pushInnerMethodDefinition(isInnerMethodDefinition) {
+ const previous = this.isInnerMethodDefinition;
+
+ this.isInnerMethodDefinition = isInnerMethodDefinition;
+ return previous;
+ }
+
+ popInnerMethodDefinition(isInnerMethodDefinition) {
+ this.isInnerMethodDefinition = isInnerMethodDefinition;
+ }
+
+ referencingDefaultValue(pattern, assignments, maybeImplicitGlobal, init) {
+ const scope = this.currentScope();
+
+ assignments.forEach(assignment => {
+ scope.__referencing(
+ pattern,
+ Reference.WRITE,
+ assignment.right,
+ maybeImplicitGlobal,
+ pattern !== assignment.left,
+ init
+ );
+ });
+ }
+
+ visitPattern(node, options, callback) {
+ let visitPatternOptions = options;
+ let visitPatternCallback = callback;
+
+ if (typeof options === "function") {
+ visitPatternCallback = options;
+ visitPatternOptions = { processRightHandNodes: false };
+ }
+
+ traverseIdentifierInPattern(
+ this.options,
+ node,
+ visitPatternOptions.processRightHandNodes ? this : null,
+ visitPatternCallback
+ );
+ }
+
+ visitFunction(node) {
+ let i, iz;
+
+ // FunctionDeclaration name is defined in upper scope
+ // NOTE: Not referring variableScope. It is intended.
+ // Since
+ // in ES5, FunctionDeclaration should be in FunctionBody.
+ // in ES6, FunctionDeclaration should be block scoped.
+
+ if (node.type === Syntax.FunctionDeclaration) {
+
+ // id is defined in upper scope
+ this.currentScope().__define(node.id,
+ new Definition(
+ Variable.FunctionName,
+ node.id,
+ node,
+ null,
+ null,
+ null
+ ));
+ }
+
+ // FunctionExpression with name creates its special scope;
+ // FunctionExpressionNameScope.
+ if (node.type === Syntax.FunctionExpression && node.id) {
+ this.scopeManager.__nestFunctionExpressionNameScope(node);
+ }
+
+ // Consider this function is in the MethodDefinition.
+ this.scopeManager.__nestFunctionScope(node, this.isInnerMethodDefinition);
+
+ const that = this;
+
+ /**
+ * Visit pattern callback
+ * @param {pattern} pattern pattern
+ * @param {Object} info info
+ * @returns {void}
+ */
+ function visitPatternCallback(pattern, info) {
+ that.currentScope().__define(pattern,
+ new ParameterDefinition(
+ pattern,
+ node,
+ i,
+ info.rest
+ ));
+
+ that.referencingDefaultValue(pattern, info.assignments, null, true);
+ }
+
+ // Process parameter declarations.
+ for (i = 0, iz = node.params.length; i < iz; ++i) {
+ this.visitPattern(node.params[i], { processRightHandNodes: true }, visitPatternCallback);
+ }
+
+ // if there's a rest argument, add that
+ if (node.rest) {
+ this.visitPattern({
+ type: "RestElement",
+ argument: node.rest
+ }, pattern => {
+ this.currentScope().__define(pattern,
+ new ParameterDefinition(
+ pattern,
+ node,
+ node.params.length,
+ true
+ ));
+ });
+ }
+
+ // In TypeScript there are a number of function-like constructs which have no body,
+ // so check it exists before traversing
+ if (node.body) {
+
+ // Skip BlockStatement to prevent creating BlockStatement scope.
+ if (node.body.type === Syntax.BlockStatement) {
+ this.visitChildren(node.body);
+ } else {
+ this.visit(node.body);
+ }
+ }
+
+ this.close(node);
+ }
+
+ visitClass(node) {
+ if (node.type === Syntax.ClassDeclaration) {
+ this.currentScope().__define(node.id,
+ new Definition(
+ Variable.ClassName,
+ node.id,
+ node,
+ null,
+ null,
+ null
+ ));
+ }
+
+ this.visit(node.superClass);
+
+ this.scopeManager.__nestClassScope(node);
+
+ if (node.id) {
+ this.currentScope().__define(node.id,
+ new Definition(
+ Variable.ClassName,
+ node.id,
+ node
+ ));
+ }
+ this.visit(node.body);
+
+ this.close(node);
+ }
+
+ visitProperty(node) {
+ let previous;
+
+ if (node.computed) {
+ this.visit(node.key);
+ }
+
+ const isMethodDefinition = node.type === Syntax.MethodDefinition;
+
+ if (isMethodDefinition) {
+ previous = this.pushInnerMethodDefinition(true);
+ }
+ this.visit(node.value);
+ if (isMethodDefinition) {
+ this.popInnerMethodDefinition(previous);
+ }
+ }
+
+ visitForIn(node) {
+ if (node.left.type === Syntax.VariableDeclaration && node.left.kind !== "var") {
+ this.scopeManager.__nestForScope(node);
+ }
+
+ if (node.left.type === Syntax.VariableDeclaration) {
+ this.visit(node.left);
+ this.visitPattern(node.left.declarations[0].id, pattern => {
+ this.currentScope().__referencing(pattern, Reference.WRITE, node.right, null, true, true);
+ });
+ } else {
+ this.visitPattern(node.left, { processRightHandNodes: true }, (pattern, info) => {
+ let maybeImplicitGlobal = null;
+
+ if (!this.currentScope().isStrict) {
+ maybeImplicitGlobal = {
+ pattern,
+ node
+ };
+ }
+ this.referencingDefaultValue(pattern, info.assignments, maybeImplicitGlobal, false);
+ this.currentScope().__referencing(pattern, Reference.WRITE, node.right, maybeImplicitGlobal, true, false);
+ });
+ }
+ this.visit(node.right);
+ this.visit(node.body);
+
+ this.close(node);
+ }
+
+ visitVariableDeclaration(variableTargetScope, type, node, index) {
+
+ const decl = node.declarations[index];
+ const init = decl.init;
+
+ this.visitPattern(decl.id, { processRightHandNodes: true }, (pattern, info) => {
+ variableTargetScope.__define(
+ pattern,
+ new Definition(
+ type,
+ pattern,
+ decl,
+ node,
+ index,
+ node.kind
+ )
+ );
+
+ this.referencingDefaultValue(pattern, info.assignments, null, true);
+ if (init) {
+ this.currentScope().__referencing(pattern, Reference.WRITE, init, null, !info.topLevel, true);
+ }
+ });
+ }
+
+ AssignmentExpression(node) {
+ if (PatternVisitor.isPattern(node.left)) {
+ if (node.operator === "=") {
+ this.visitPattern(node.left, { processRightHandNodes: true }, (pattern, info) => {
+ let maybeImplicitGlobal = null;
+
+ if (!this.currentScope().isStrict) {
+ maybeImplicitGlobal = {
+ pattern,
+ node
+ };
+ }
+ this.referencingDefaultValue(pattern, info.assignments, maybeImplicitGlobal, false);
+ this.currentScope().__referencing(pattern, Reference.WRITE, node.right, maybeImplicitGlobal, !info.topLevel, false);
+ });
+ } else {
+ this.currentScope().__referencing(node.left, Reference.RW, node.right);
+ }
+ } else {
+ this.visit(node.left);
+ }
+ this.visit(node.right);
+ }
+
+ CatchClause(node) {
+ this.scopeManager.__nestCatchScope(node);
+
+ this.visitPattern(node.param, { processRightHandNodes: true }, (pattern, info) => {
+ this.currentScope().__define(pattern,
+ new Definition(
+ Variable.CatchClause,
+ node.param,
+ node,
+ null,
+ null,
+ null
+ ));
+ this.referencingDefaultValue(pattern, info.assignments, null, true);
+ });
+ this.visit(node.body);
+
+ this.close(node);
+ }
+
+ Program(node) {
+ this.scopeManager.__nestGlobalScope(node);
+
+ if (this.scopeManager.isGlobalReturn()) {
+
+ // Force strictness of GlobalScope to false when using node.js scope.
+ this.currentScope().isStrict = false;
+ this.scopeManager.__nestFunctionScope(node, false);
+ }
+
+ if (this.scopeManager.__isES6() && this.scopeManager.isModule()) {
+ this.scopeManager.__nestModuleScope(node);
+ }
+
+ if (this.scopeManager.isStrictModeSupported() && this.scopeManager.isImpliedStrict()) {
+ this.currentScope().isStrict = true;
+ }
+
+ this.visitChildren(node);
+ this.close(node);
+ }
+
+ Identifier(node) {
+ this.currentScope().__referencing(node);
+ }
+
+ // eslint-disable-next-line class-methods-use-this
+ PrivateIdentifier() {
+
+ // Do nothing.
+ }
+
+ UpdateExpression(node) {
+ if (PatternVisitor.isPattern(node.argument)) {
+ this.currentScope().__referencing(node.argument, Reference.RW, null);
+ } else {
+ this.visitChildren(node);
+ }
+ }
+
+ MemberExpression(node) {
+ this.visit(node.object);
+ if (node.computed) {
+ this.visit(node.property);
+ }
+ }
+
+ Property(node) {
+ this.visitProperty(node);
+ }
+
+ PropertyDefinition(node) {
+ const { computed, key, value } = node;
+
+ if (computed) {
+ this.visit(key);
+ }
+ if (value) {
+ this.scopeManager.__nestClassFieldInitializerScope(value);
+ this.visit(value);
+ this.close(value);
+ }
+ }
+
+ StaticBlock(node) {
+ this.scopeManager.__nestClassStaticBlockScope(node);
+
+ this.visitChildren(node);
+
+ this.close(node);
+ }
+
+ MethodDefinition(node) {
+ this.visitProperty(node);
+ }
+
+ BreakStatement() {} // eslint-disable-line class-methods-use-this
+
+ ContinueStatement() {} // eslint-disable-line class-methods-use-this
+
+ LabeledStatement(node) {
+ this.visit(node.body);
+ }
+
+ ForStatement(node) {
+
+ // Create ForStatement declaration.
+ // NOTE: In ES6, ForStatement dynamically generates
+ // per iteration environment. However, escope is
+ // a static analyzer, we only generate one scope for ForStatement.
+ if (node.init && node.init.type === Syntax.VariableDeclaration && node.init.kind !== "var") {
+ this.scopeManager.__nestForScope(node);
+ }
+
+ this.visitChildren(node);
+
+ this.close(node);
+ }
+
+ ClassExpression(node) {
+ this.visitClass(node);
+ }
+
+ ClassDeclaration(node) {
+ this.visitClass(node);
+ }
+
+ CallExpression(node) {
+
+ // Check this is direct call to eval
+ if (!this.scopeManager.__ignoreEval() && node.callee.type === Syntax.Identifier && node.callee.name === "eval") {
+
+ // NOTE: This should be `variableScope`. Since direct eval call always creates Lexical environment and
+ // let / const should be enclosed into it. Only VariableDeclaration affects on the caller's environment.
+ this.currentScope().variableScope.__detectEval();
+ }
+ this.visitChildren(node);
+ }
+
+ BlockStatement(node) {
+ if (this.scopeManager.__isES6()) {
+ this.scopeManager.__nestBlockScope(node);
+ }
+
+ this.visitChildren(node);
+
+ this.close(node);
+ }
+
+ ThisExpression() {
+ this.currentScope().variableScope.__detectThis();
+ }
+
+ WithStatement(node) {
+ this.visit(node.object);
+
+ // Then nest scope for WithStatement.
+ this.scopeManager.__nestWithScope(node);
+
+ this.visit(node.body);
+
+ this.close(node);
+ }
+
+ VariableDeclaration(node) {
+ const variableTargetScope = (node.kind === "var") ? this.currentScope().variableScope : this.currentScope();
+
+ for (let i = 0, iz = node.declarations.length; i < iz; ++i) {
+ const decl = node.declarations[i];
+
+ this.visitVariableDeclaration(variableTargetScope, Variable.Variable, node, i);
+ if (decl.init) {
+ this.visit(decl.init);
+ }
+ }
+ }
+
+ // sec 13.11.8
+ SwitchStatement(node) {
+ this.visit(node.discriminant);
+
+ if (this.scopeManager.__isES6()) {
+ this.scopeManager.__nestSwitchScope(node);
+ }
+
+ for (let i = 0, iz = node.cases.length; i < iz; ++i) {
+ this.visit(node.cases[i]);
+ }
+
+ this.close(node);
+ }
+
+ FunctionDeclaration(node) {
+ this.visitFunction(node);
+ }
+
+ FunctionExpression(node) {
+ this.visitFunction(node);
+ }
+
+ ForOfStatement(node) {
+ this.visitForIn(node);
+ }
+
+ ForInStatement(node) {
+ this.visitForIn(node);
+ }
+
+ ArrowFunctionExpression(node) {
+ this.visitFunction(node);
+ }
+
+ ImportDeclaration(node) {
+ assert__default["default"](this.scopeManager.__isES6() && this.scopeManager.isModule(), "ImportDeclaration should appear when the mode is ES6 and in the module context.");
+
+ const importer = new Importer(node, this);
+
+ importer.visit(node);
+ }
+
+ visitExportDeclaration(node) {
+ if (node.source) {
+ return;
+ }
+ if (node.declaration) {
+ this.visit(node.declaration);
+ return;
+ }
+
+ this.visitChildren(node);
+ }
+
+ // TODO: ExportDeclaration doesn't exist. for bc?
+ ExportDeclaration(node) {
+ this.visitExportDeclaration(node);
+ }
+
+ ExportAllDeclaration(node) {
+ this.visitExportDeclaration(node);
+ }
+
+ ExportDefaultDeclaration(node) {
+ this.visitExportDeclaration(node);
+ }
+
+ ExportNamedDeclaration(node) {
+ this.visitExportDeclaration(node);
+ }
+
+ ExportSpecifier(node) {
+
+ // TODO: `node.id` doesn't exist. for bc?
+ const local = (node.id || node.local);
+
+ this.visit(local);
+ }
+
+ MetaProperty() { // eslint-disable-line class-methods-use-this
+
+ // do nothing.
+ }
+}
+
+/* vim: set sw=4 ts=4 et tw=80 : */
+
+const version = "7.2.2";
+
+/*
+ Copyright (C) 2012-2014 Yusuke Suzuki
+ Copyright (C) 2013 Alex Seville
+ Copyright (C) 2014 Thiago de Arruda
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/**
+ * Set the default options
+ * @returns {Object} options
+ */
+function defaultOptions() {
+ return {
+ optimistic: false,
+ directive: false,
+ nodejsScope: false,
+ impliedStrict: false,
+ sourceType: "script", // one of ['script', 'module', 'commonjs']
+ ecmaVersion: 5,
+ childVisitorKeys: null,
+ fallback: "iteration"
+ };
+}
+
+/**
+ * Preform deep update on option object
+ * @param {Object} target Options
+ * @param {Object} override Updates
+ * @returns {Object} Updated options
+ */
+function updateDeeply(target, override) {
+
+ /**
+ * Is hash object
+ * @param {Object} value Test value
+ * @returns {boolean} Result
+ */
+ function isHashObject(value) {
+ return typeof value === "object" && value instanceof Object && !(value instanceof Array) && !(value instanceof RegExp);
+ }
+
+ for (const key in override) {
+ if (Object.prototype.hasOwnProperty.call(override, key)) {
+ const val = override[key];
+
+ if (isHashObject(val)) {
+ if (isHashObject(target[key])) {
+ updateDeeply(target[key], val);
+ } else {
+ target[key] = updateDeeply({}, val);
+ }
+ } else {
+ target[key] = val;
+ }
+ }
+ }
+ return target;
+}
+
+/**
+ * Main interface function. Takes an Espree syntax tree and returns the
+ * analyzed scopes.
+ * @function analyze
+ * @param {espree.Tree} tree Abstract Syntax Tree
+ * @param {Object} providedOptions Options that tailor the scope analysis
+ * @param {boolean} [providedOptions.optimistic=false] the optimistic flag
+ * @param {boolean} [providedOptions.directive=false] the directive flag
+ * @param {boolean} [providedOptions.ignoreEval=false] whether to check 'eval()' calls
+ * @param {boolean} [providedOptions.nodejsScope=false] whether the whole
+ * script is executed under node.js environment. When enabled, escope adds
+ * a function scope immediately following the global scope.
+ * @param {boolean} [providedOptions.impliedStrict=false] implied strict mode
+ * (if ecmaVersion >= 5).
+ * @param {string} [providedOptions.sourceType='script'] the source type of the script. one of 'script', 'module', and 'commonjs'
+ * @param {number} [providedOptions.ecmaVersion=5] which ECMAScript version is considered
+ * @param {Object} [providedOptions.childVisitorKeys=null] Additional known visitor keys. See [esrecurse](https://github.com/estools/esrecurse)'s the `childVisitorKeys` option.
+ * @param {string} [providedOptions.fallback='iteration'] A kind of the fallback in order to encounter with unknown node. See [esrecurse](https://github.com/estools/esrecurse)'s the `fallback` option.
+ * @returns {ScopeManager} ScopeManager
+ */
+function analyze(tree, providedOptions) {
+ const options = updateDeeply(defaultOptions(), providedOptions);
+ const scopeManager = new ScopeManager(options);
+ const referencer = new Referencer(options, scopeManager);
+
+ referencer.visit(tree);
+
+ assert__default["default"](scopeManager.__currentScope === null, "currentScope should be null.");
+
+ return scopeManager;
+}
+
+/* vim: set sw=4 ts=4 et tw=80 : */
+
+exports.Definition = Definition;
+exports.PatternVisitor = PatternVisitor;
+exports.Reference = Reference;
+exports.Referencer = Referencer;
+exports.Scope = Scope;
+exports.ScopeManager = ScopeManager;
+exports.Variable = Variable;
+exports.analyze = analyze;
+exports.version = version;
+//# sourceMappingURL=eslint-scope.cjs.map
diff --git a/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-scope/lib/definition.js b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-scope/lib/definition.js
new file mode 100644
index 0000000000000000000000000000000000000000..9744ef48b8f096b85f0d1924ffe3ade0febb2307
--- /dev/null
+++ b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-scope/lib/definition.js
@@ -0,0 +1,85 @@
+/*
+ Copyright (C) 2015 Yusuke Suzuki
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+import Variable from "./variable.js";
+
+/**
+ * @constructor Definition
+ */
+class Definition {
+ constructor(type, name, node, parent, index, kind) {
+
+ /**
+ * @member {string} Definition#type - type of the occurrence (e.g. "Parameter", "Variable", ...).
+ */
+ this.type = type;
+
+ /**
+ * @member {espree.Identifier} Definition#name - the identifier AST node of the occurrence.
+ */
+ this.name = name;
+
+ /**
+ * @member {espree.Node} Definition#node - the enclosing node of the identifier.
+ */
+ this.node = node;
+
+ /**
+ * @member {espree.Node?} Definition#parent - the enclosing statement node of the identifier.
+ */
+ this.parent = parent;
+
+ /**
+ * @member {number?} Definition#index - the index in the declaration statement.
+ */
+ this.index = index;
+
+ /**
+ * @member {string?} Definition#kind - the kind of the declaration statement.
+ */
+ this.kind = kind;
+ }
+}
+
+/**
+ * @constructor ParameterDefinition
+ */
+class ParameterDefinition extends Definition {
+ constructor(name, node, index, rest) {
+ super(Variable.Parameter, name, node, null, index, null);
+
+ /**
+ * Whether the parameter definition is a part of a rest parameter.
+ * @member {boolean} ParameterDefinition#rest
+ */
+ this.rest = rest;
+ }
+}
+
+export {
+ ParameterDefinition,
+ Definition
+};
+
+/* vim: set sw=4 ts=4 et tw=80 : */
diff --git a/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-scope/lib/index.js b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-scope/lib/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..cd0678d2e66ddaee5e348b61b99d700f294bbc01
--- /dev/null
+++ b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-scope/lib/index.js
@@ -0,0 +1,172 @@
+/*
+ Copyright (C) 2012-2014 Yusuke Suzuki
+ Copyright (C) 2013 Alex Seville
+ Copyright (C) 2014 Thiago de Arruda
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/**
+ * Escope (escope) is an ECMAScript
+ * scope analyzer extracted from the esmangle project.
+ *
+ * escope finds lexical scopes in a source program, i.e. areas of that
+ * program where different occurrences of the same identifier refer to the same
+ * variable. With each scope the contained variables are collected, and each
+ * identifier reference in code is linked to its corresponding variable (if
+ * possible).
+ *
+ * escope works on a syntax tree of the parsed source code which has
+ * to adhere to the
+ * Mozilla Parser API. E.g. espree is a parser
+ * that produces such syntax trees.
+ *
+ * The main interface is the {@link analyze} function.
+ * @module escope
+ */
+/* eslint no-underscore-dangle: ["error", { "allow": ["__currentScope"] }] */
+
+import assert from "assert";
+
+import ScopeManager from "./scope-manager.js";
+import Referencer from "./referencer.js";
+import Reference from "./reference.js";
+import Variable from "./variable.js";
+
+import eslintScopeVersion from "./version.js";
+
+/**
+ * Set the default options
+ * @returns {Object} options
+ */
+function defaultOptions() {
+ return {
+ optimistic: false,
+ directive: false,
+ nodejsScope: false,
+ impliedStrict: false,
+ sourceType: "script", // one of ['script', 'module', 'commonjs']
+ ecmaVersion: 5,
+ childVisitorKeys: null,
+ fallback: "iteration"
+ };
+}
+
+/**
+ * Preform deep update on option object
+ * @param {Object} target Options
+ * @param {Object} override Updates
+ * @returns {Object} Updated options
+ */
+function updateDeeply(target, override) {
+
+ /**
+ * Is hash object
+ * @param {Object} value Test value
+ * @returns {boolean} Result
+ */
+ function isHashObject(value) {
+ return typeof value === "object" && value instanceof Object && !(value instanceof Array) && !(value instanceof RegExp);
+ }
+
+ for (const key in override) {
+ if (Object.prototype.hasOwnProperty.call(override, key)) {
+ const val = override[key];
+
+ if (isHashObject(val)) {
+ if (isHashObject(target[key])) {
+ updateDeeply(target[key], val);
+ } else {
+ target[key] = updateDeeply({}, val);
+ }
+ } else {
+ target[key] = val;
+ }
+ }
+ }
+ return target;
+}
+
+/**
+ * Main interface function. Takes an Espree syntax tree and returns the
+ * analyzed scopes.
+ * @function analyze
+ * @param {espree.Tree} tree Abstract Syntax Tree
+ * @param {Object} providedOptions Options that tailor the scope analysis
+ * @param {boolean} [providedOptions.optimistic=false] the optimistic flag
+ * @param {boolean} [providedOptions.directive=false] the directive flag
+ * @param {boolean} [providedOptions.ignoreEval=false] whether to check 'eval()' calls
+ * @param {boolean} [providedOptions.nodejsScope=false] whether the whole
+ * script is executed under node.js environment. When enabled, escope adds
+ * a function scope immediately following the global scope.
+ * @param {boolean} [providedOptions.impliedStrict=false] implied strict mode
+ * (if ecmaVersion >= 5).
+ * @param {string} [providedOptions.sourceType='script'] the source type of the script. one of 'script', 'module', and 'commonjs'
+ * @param {number} [providedOptions.ecmaVersion=5] which ECMAScript version is considered
+ * @param {Object} [providedOptions.childVisitorKeys=null] Additional known visitor keys. See [esrecurse](https://github.com/estools/esrecurse)'s the `childVisitorKeys` option.
+ * @param {string} [providedOptions.fallback='iteration'] A kind of the fallback in order to encounter with unknown node. See [esrecurse](https://github.com/estools/esrecurse)'s the `fallback` option.
+ * @returns {ScopeManager} ScopeManager
+ */
+function analyze(tree, providedOptions) {
+ const options = updateDeeply(defaultOptions(), providedOptions);
+ const scopeManager = new ScopeManager(options);
+ const referencer = new Referencer(options, scopeManager);
+
+ referencer.visit(tree);
+
+ assert(scopeManager.__currentScope === null, "currentScope should be null.");
+
+ return scopeManager;
+}
+
+export {
+
+ /** @name module:escope.version */
+ eslintScopeVersion as version,
+
+ /** @name module:escope.Reference */
+ Reference,
+
+ /** @name module:escope.Variable */
+ Variable,
+
+ /** @name module:escope.ScopeManager */
+ ScopeManager,
+
+ /** @name module:escope.Referencer */
+ Referencer,
+
+ analyze
+};
+
+/** @name module:escope.Definition */
+export { Definition } from "./definition.js";
+
+/** @name module:escope.PatternVisitor */
+export { default as PatternVisitor } from "./pattern-visitor.js";
+
+/** @name module:escope.Scope */
+export { Scope } from "./scope.js";
+
+/* vim: set sw=4 ts=4 et tw=80 : */
diff --git a/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-scope/lib/pattern-visitor.js b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-scope/lib/pattern-visitor.js
new file mode 100644
index 0000000000000000000000000000000000000000..a9ff48e5071e94902c9779d7b05efd798e11a1a7
--- /dev/null
+++ b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-scope/lib/pattern-visitor.js
@@ -0,0 +1,153 @@
+/*
+ Copyright (C) 2015 Yusuke Suzuki
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/* eslint-disable no-undefined */
+
+import estraverse from "estraverse";
+import esrecurse from "esrecurse";
+
+const { Syntax } = estraverse;
+
+/**
+ * Get last array element
+ * @param {Array} xs array
+ * @returns {any} Last elment
+ */
+function getLast(xs) {
+ return xs[xs.length - 1] || null;
+}
+
+class PatternVisitor extends esrecurse.Visitor {
+ static isPattern(node) {
+ const nodeType = node.type;
+
+ return (
+ nodeType === Syntax.Identifier ||
+ nodeType === Syntax.ObjectPattern ||
+ nodeType === Syntax.ArrayPattern ||
+ nodeType === Syntax.SpreadElement ||
+ nodeType === Syntax.RestElement ||
+ nodeType === Syntax.AssignmentPattern
+ );
+ }
+
+ constructor(options, rootPattern, callback) {
+ super(null, options);
+ this.rootPattern = rootPattern;
+ this.callback = callback;
+ this.assignments = [];
+ this.rightHandNodes = [];
+ this.restElements = [];
+ }
+
+ Identifier(pattern) {
+ const lastRestElement = getLast(this.restElements);
+
+ this.callback(pattern, {
+ topLevel: pattern === this.rootPattern,
+ rest: lastRestElement !== null && lastRestElement !== undefined && lastRestElement.argument === pattern,
+ assignments: this.assignments
+ });
+ }
+
+ Property(property) {
+
+ // Computed property's key is a right hand node.
+ if (property.computed) {
+ this.rightHandNodes.push(property.key);
+ }
+
+ // If it's shorthand, its key is same as its value.
+ // If it's shorthand and has its default value, its key is same as its value.left (the value is AssignmentPattern).
+ // If it's not shorthand, the name of new variable is its value's.
+ this.visit(property.value);
+ }
+
+ ArrayPattern(pattern) {
+ for (let i = 0, iz = pattern.elements.length; i < iz; ++i) {
+ const element = pattern.elements[i];
+
+ this.visit(element);
+ }
+ }
+
+ AssignmentPattern(pattern) {
+ this.assignments.push(pattern);
+ this.visit(pattern.left);
+ this.rightHandNodes.push(pattern.right);
+ this.assignments.pop();
+ }
+
+ RestElement(pattern) {
+ this.restElements.push(pattern);
+ this.visit(pattern.argument);
+ this.restElements.pop();
+ }
+
+ MemberExpression(node) {
+
+ // Computed property's key is a right hand node.
+ if (node.computed) {
+ this.rightHandNodes.push(node.property);
+ }
+
+ // the object is only read, write to its property.
+ this.rightHandNodes.push(node.object);
+ }
+
+ //
+ // ForInStatement.left and AssignmentExpression.left are LeftHandSideExpression.
+ // By spec, LeftHandSideExpression is Pattern or MemberExpression.
+ // (see also: https://github.com/estree/estree/pull/20#issuecomment-74584758)
+ // But espree 2.0 parses to ArrayExpression, ObjectExpression, etc...
+ //
+
+ SpreadElement(node) {
+ this.visit(node.argument);
+ }
+
+ ArrayExpression(node) {
+ node.elements.forEach(this.visit, this);
+ }
+
+ AssignmentExpression(node) {
+ this.assignments.push(node);
+ this.visit(node.left);
+ this.rightHandNodes.push(node.right);
+ this.assignments.pop();
+ }
+
+ CallExpression(node) {
+
+ // arguments are right hand nodes.
+ node.arguments.forEach(a => {
+ this.rightHandNodes.push(a);
+ });
+ this.visit(node.callee);
+ }
+}
+
+export default PatternVisitor;
+
+/* vim: set sw=4 ts=4 et tw=80 : */
diff --git a/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-scope/lib/reference.js b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-scope/lib/reference.js
new file mode 100644
index 0000000000000000000000000000000000000000..e657d628649cc9ea13bc7f8b6c6195e12c0f4344
--- /dev/null
+++ b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-scope/lib/reference.js
@@ -0,0 +1,166 @@
+/*
+ Copyright (C) 2015 Yusuke Suzuki
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+const READ = 0x1;
+const WRITE = 0x2;
+const RW = READ | WRITE;
+
+/**
+ * A Reference represents a single occurrence of an identifier in code.
+ * @constructor Reference
+ */
+class Reference {
+ constructor(ident, scope, flag, writeExpr, maybeImplicitGlobal, partial, init) {
+
+ /**
+ * Identifier syntax node.
+ * @member {espreeIdentifier} Reference#identifier
+ */
+ this.identifier = ident;
+
+ /**
+ * Reference to the enclosing Scope.
+ * @member {Scope} Reference#from
+ */
+ this.from = scope;
+
+ /**
+ * Whether the reference comes from a dynamic scope (such as 'eval',
+ * 'with', etc.), and may be trapped by dynamic scopes.
+ * @member {boolean} Reference#tainted
+ */
+ this.tainted = false;
+
+ /**
+ * The variable this reference is resolved with.
+ * @member {Variable} Reference#resolved
+ */
+ this.resolved = null;
+
+ /**
+ * The read-write mode of the reference. (Value is one of {@link
+ * Reference.READ}, {@link Reference.RW}, {@link Reference.WRITE}).
+ * @member {number} Reference#flag
+ * @private
+ */
+ this.flag = flag;
+ if (this.isWrite()) {
+
+ /**
+ * If reference is writeable, this is the tree being written to it.
+ * @member {espreeNode} Reference#writeExpr
+ */
+ this.writeExpr = writeExpr;
+
+ /**
+ * Whether the Reference might refer to a partial value of writeExpr.
+ * @member {boolean} Reference#partial
+ */
+ this.partial = partial;
+
+ /**
+ * Whether the Reference is to write of initialization.
+ * @member {boolean} Reference#init
+ */
+ this.init = init;
+ }
+ this.__maybeImplicitGlobal = maybeImplicitGlobal;
+ }
+
+ /**
+ * Whether the reference is static.
+ * @function Reference#isStatic
+ * @returns {boolean} static
+ */
+ isStatic() {
+ return !this.tainted && this.resolved && this.resolved.scope.isStatic();
+ }
+
+ /**
+ * Whether the reference is writeable.
+ * @function Reference#isWrite
+ * @returns {boolean} write
+ */
+ isWrite() {
+ return !!(this.flag & Reference.WRITE);
+ }
+
+ /**
+ * Whether the reference is readable.
+ * @function Reference#isRead
+ * @returns {boolean} read
+ */
+ isRead() {
+ return !!(this.flag & Reference.READ);
+ }
+
+ /**
+ * Whether the reference is read-only.
+ * @function Reference#isReadOnly
+ * @returns {boolean} read only
+ */
+ isReadOnly() {
+ return this.flag === Reference.READ;
+ }
+
+ /**
+ * Whether the reference is write-only.
+ * @function Reference#isWriteOnly
+ * @returns {boolean} write only
+ */
+ isWriteOnly() {
+ return this.flag === Reference.WRITE;
+ }
+
+ /**
+ * Whether the reference is read-write.
+ * @function Reference#isReadWrite
+ * @returns {boolean} read write
+ */
+ isReadWrite() {
+ return this.flag === Reference.RW;
+ }
+}
+
+/**
+ * @constant Reference.READ
+ * @private
+ */
+Reference.READ = READ;
+
+/**
+ * @constant Reference.WRITE
+ * @private
+ */
+Reference.WRITE = WRITE;
+
+/**
+ * @constant Reference.RW
+ * @private
+ */
+Reference.RW = RW;
+
+export default Reference;
+
+/* vim: set sw=4 ts=4 et tw=80 : */
diff --git a/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-scope/lib/referencer.js b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-scope/lib/referencer.js
new file mode 100644
index 0000000000000000000000000000000000000000..6a5da5214c2cbac2917c817f01eb0036c68e2be1
--- /dev/null
+++ b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-scope/lib/referencer.js
@@ -0,0 +1,654 @@
+/*
+ Copyright (C) 2015 Yusuke Suzuki
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/* eslint-disable no-underscore-dangle */
+/* eslint-disable no-undefined */
+
+import estraverse from "estraverse";
+import esrecurse from "esrecurse";
+import Reference from "./reference.js";
+import Variable from "./variable.js";
+import PatternVisitor from "./pattern-visitor.js";
+import { Definition, ParameterDefinition } from "./definition.js";
+import assert from "assert";
+
+const { Syntax } = estraverse;
+
+/**
+ * Traverse identifier in pattern
+ * @param {Object} options options
+ * @param {pattern} rootPattern root pattern
+ * @param {Refencer} referencer referencer
+ * @param {callback} callback callback
+ * @returns {void}
+ */
+function traverseIdentifierInPattern(options, rootPattern, referencer, callback) {
+
+ // Call the callback at left hand identifier nodes, and Collect right hand nodes.
+ const visitor = new PatternVisitor(options, rootPattern, callback);
+
+ visitor.visit(rootPattern);
+
+ // Process the right hand nodes recursively.
+ if (referencer !== null && referencer !== undefined) {
+ visitor.rightHandNodes.forEach(referencer.visit, referencer);
+ }
+}
+
+// Importing ImportDeclaration.
+// http://people.mozilla.org/~jorendorff/es6-draft.html#sec-moduledeclarationinstantiation
+// https://github.com/estree/estree/blob/master/es6.md#importdeclaration
+// FIXME: Now, we don't create module environment, because the context is
+// implementation dependent.
+
+class Importer extends esrecurse.Visitor {
+ constructor(declaration, referencer) {
+ super(null, referencer.options);
+ this.declaration = declaration;
+ this.referencer = referencer;
+ }
+
+ visitImport(id, specifier) {
+ this.referencer.visitPattern(id, pattern => {
+ this.referencer.currentScope().__define(pattern,
+ new Definition(
+ Variable.ImportBinding,
+ pattern,
+ specifier,
+ this.declaration,
+ null,
+ null
+ ));
+ });
+ }
+
+ ImportNamespaceSpecifier(node) {
+ const local = (node.local || node.id);
+
+ if (local) {
+ this.visitImport(local, node);
+ }
+ }
+
+ ImportDefaultSpecifier(node) {
+ const local = (node.local || node.id);
+
+ this.visitImport(local, node);
+ }
+
+ ImportSpecifier(node) {
+ const local = (node.local || node.id);
+
+ if (node.name) {
+ this.visitImport(node.name, node);
+ } else {
+ this.visitImport(local, node);
+ }
+ }
+}
+
+// Referencing variables and creating bindings.
+class Referencer extends esrecurse.Visitor {
+ constructor(options, scopeManager) {
+ super(null, options);
+ this.options = options;
+ this.scopeManager = scopeManager;
+ this.parent = null;
+ this.isInnerMethodDefinition = false;
+ }
+
+ currentScope() {
+ return this.scopeManager.__currentScope;
+ }
+
+ close(node) {
+ while (this.currentScope() && node === this.currentScope().block) {
+ this.scopeManager.__currentScope = this.currentScope().__close(this.scopeManager);
+ }
+ }
+
+ pushInnerMethodDefinition(isInnerMethodDefinition) {
+ const previous = this.isInnerMethodDefinition;
+
+ this.isInnerMethodDefinition = isInnerMethodDefinition;
+ return previous;
+ }
+
+ popInnerMethodDefinition(isInnerMethodDefinition) {
+ this.isInnerMethodDefinition = isInnerMethodDefinition;
+ }
+
+ referencingDefaultValue(pattern, assignments, maybeImplicitGlobal, init) {
+ const scope = this.currentScope();
+
+ assignments.forEach(assignment => {
+ scope.__referencing(
+ pattern,
+ Reference.WRITE,
+ assignment.right,
+ maybeImplicitGlobal,
+ pattern !== assignment.left,
+ init
+ );
+ });
+ }
+
+ visitPattern(node, options, callback) {
+ let visitPatternOptions = options;
+ let visitPatternCallback = callback;
+
+ if (typeof options === "function") {
+ visitPatternCallback = options;
+ visitPatternOptions = { processRightHandNodes: false };
+ }
+
+ traverseIdentifierInPattern(
+ this.options,
+ node,
+ visitPatternOptions.processRightHandNodes ? this : null,
+ visitPatternCallback
+ );
+ }
+
+ visitFunction(node) {
+ let i, iz;
+
+ // FunctionDeclaration name is defined in upper scope
+ // NOTE: Not referring variableScope. It is intended.
+ // Since
+ // in ES5, FunctionDeclaration should be in FunctionBody.
+ // in ES6, FunctionDeclaration should be block scoped.
+
+ if (node.type === Syntax.FunctionDeclaration) {
+
+ // id is defined in upper scope
+ this.currentScope().__define(node.id,
+ new Definition(
+ Variable.FunctionName,
+ node.id,
+ node,
+ null,
+ null,
+ null
+ ));
+ }
+
+ // FunctionExpression with name creates its special scope;
+ // FunctionExpressionNameScope.
+ if (node.type === Syntax.FunctionExpression && node.id) {
+ this.scopeManager.__nestFunctionExpressionNameScope(node);
+ }
+
+ // Consider this function is in the MethodDefinition.
+ this.scopeManager.__nestFunctionScope(node, this.isInnerMethodDefinition);
+
+ const that = this;
+
+ /**
+ * Visit pattern callback
+ * @param {pattern} pattern pattern
+ * @param {Object} info info
+ * @returns {void}
+ */
+ function visitPatternCallback(pattern, info) {
+ that.currentScope().__define(pattern,
+ new ParameterDefinition(
+ pattern,
+ node,
+ i,
+ info.rest
+ ));
+
+ that.referencingDefaultValue(pattern, info.assignments, null, true);
+ }
+
+ // Process parameter declarations.
+ for (i = 0, iz = node.params.length; i < iz; ++i) {
+ this.visitPattern(node.params[i], { processRightHandNodes: true }, visitPatternCallback);
+ }
+
+ // if there's a rest argument, add that
+ if (node.rest) {
+ this.visitPattern({
+ type: "RestElement",
+ argument: node.rest
+ }, pattern => {
+ this.currentScope().__define(pattern,
+ new ParameterDefinition(
+ pattern,
+ node,
+ node.params.length,
+ true
+ ));
+ });
+ }
+
+ // In TypeScript there are a number of function-like constructs which have no body,
+ // so check it exists before traversing
+ if (node.body) {
+
+ // Skip BlockStatement to prevent creating BlockStatement scope.
+ if (node.body.type === Syntax.BlockStatement) {
+ this.visitChildren(node.body);
+ } else {
+ this.visit(node.body);
+ }
+ }
+
+ this.close(node);
+ }
+
+ visitClass(node) {
+ if (node.type === Syntax.ClassDeclaration) {
+ this.currentScope().__define(node.id,
+ new Definition(
+ Variable.ClassName,
+ node.id,
+ node,
+ null,
+ null,
+ null
+ ));
+ }
+
+ this.visit(node.superClass);
+
+ this.scopeManager.__nestClassScope(node);
+
+ if (node.id) {
+ this.currentScope().__define(node.id,
+ new Definition(
+ Variable.ClassName,
+ node.id,
+ node
+ ));
+ }
+ this.visit(node.body);
+
+ this.close(node);
+ }
+
+ visitProperty(node) {
+ let previous;
+
+ if (node.computed) {
+ this.visit(node.key);
+ }
+
+ const isMethodDefinition = node.type === Syntax.MethodDefinition;
+
+ if (isMethodDefinition) {
+ previous = this.pushInnerMethodDefinition(true);
+ }
+ this.visit(node.value);
+ if (isMethodDefinition) {
+ this.popInnerMethodDefinition(previous);
+ }
+ }
+
+ visitForIn(node) {
+ if (node.left.type === Syntax.VariableDeclaration && node.left.kind !== "var") {
+ this.scopeManager.__nestForScope(node);
+ }
+
+ if (node.left.type === Syntax.VariableDeclaration) {
+ this.visit(node.left);
+ this.visitPattern(node.left.declarations[0].id, pattern => {
+ this.currentScope().__referencing(pattern, Reference.WRITE, node.right, null, true, true);
+ });
+ } else {
+ this.visitPattern(node.left, { processRightHandNodes: true }, (pattern, info) => {
+ let maybeImplicitGlobal = null;
+
+ if (!this.currentScope().isStrict) {
+ maybeImplicitGlobal = {
+ pattern,
+ node
+ };
+ }
+ this.referencingDefaultValue(pattern, info.assignments, maybeImplicitGlobal, false);
+ this.currentScope().__referencing(pattern, Reference.WRITE, node.right, maybeImplicitGlobal, true, false);
+ });
+ }
+ this.visit(node.right);
+ this.visit(node.body);
+
+ this.close(node);
+ }
+
+ visitVariableDeclaration(variableTargetScope, type, node, index) {
+
+ const decl = node.declarations[index];
+ const init = decl.init;
+
+ this.visitPattern(decl.id, { processRightHandNodes: true }, (pattern, info) => {
+ variableTargetScope.__define(
+ pattern,
+ new Definition(
+ type,
+ pattern,
+ decl,
+ node,
+ index,
+ node.kind
+ )
+ );
+
+ this.referencingDefaultValue(pattern, info.assignments, null, true);
+ if (init) {
+ this.currentScope().__referencing(pattern, Reference.WRITE, init, null, !info.topLevel, true);
+ }
+ });
+ }
+
+ AssignmentExpression(node) {
+ if (PatternVisitor.isPattern(node.left)) {
+ if (node.operator === "=") {
+ this.visitPattern(node.left, { processRightHandNodes: true }, (pattern, info) => {
+ let maybeImplicitGlobal = null;
+
+ if (!this.currentScope().isStrict) {
+ maybeImplicitGlobal = {
+ pattern,
+ node
+ };
+ }
+ this.referencingDefaultValue(pattern, info.assignments, maybeImplicitGlobal, false);
+ this.currentScope().__referencing(pattern, Reference.WRITE, node.right, maybeImplicitGlobal, !info.topLevel, false);
+ });
+ } else {
+ this.currentScope().__referencing(node.left, Reference.RW, node.right);
+ }
+ } else {
+ this.visit(node.left);
+ }
+ this.visit(node.right);
+ }
+
+ CatchClause(node) {
+ this.scopeManager.__nestCatchScope(node);
+
+ this.visitPattern(node.param, { processRightHandNodes: true }, (pattern, info) => {
+ this.currentScope().__define(pattern,
+ new Definition(
+ Variable.CatchClause,
+ node.param,
+ node,
+ null,
+ null,
+ null
+ ));
+ this.referencingDefaultValue(pattern, info.assignments, null, true);
+ });
+ this.visit(node.body);
+
+ this.close(node);
+ }
+
+ Program(node) {
+ this.scopeManager.__nestGlobalScope(node);
+
+ if (this.scopeManager.isGlobalReturn()) {
+
+ // Force strictness of GlobalScope to false when using node.js scope.
+ this.currentScope().isStrict = false;
+ this.scopeManager.__nestFunctionScope(node, false);
+ }
+
+ if (this.scopeManager.__isES6() && this.scopeManager.isModule()) {
+ this.scopeManager.__nestModuleScope(node);
+ }
+
+ if (this.scopeManager.isStrictModeSupported() && this.scopeManager.isImpliedStrict()) {
+ this.currentScope().isStrict = true;
+ }
+
+ this.visitChildren(node);
+ this.close(node);
+ }
+
+ Identifier(node) {
+ this.currentScope().__referencing(node);
+ }
+
+ // eslint-disable-next-line class-methods-use-this
+ PrivateIdentifier() {
+
+ // Do nothing.
+ }
+
+ UpdateExpression(node) {
+ if (PatternVisitor.isPattern(node.argument)) {
+ this.currentScope().__referencing(node.argument, Reference.RW, null);
+ } else {
+ this.visitChildren(node);
+ }
+ }
+
+ MemberExpression(node) {
+ this.visit(node.object);
+ if (node.computed) {
+ this.visit(node.property);
+ }
+ }
+
+ Property(node) {
+ this.visitProperty(node);
+ }
+
+ PropertyDefinition(node) {
+ const { computed, key, value } = node;
+
+ if (computed) {
+ this.visit(key);
+ }
+ if (value) {
+ this.scopeManager.__nestClassFieldInitializerScope(value);
+ this.visit(value);
+ this.close(value);
+ }
+ }
+
+ StaticBlock(node) {
+ this.scopeManager.__nestClassStaticBlockScope(node);
+
+ this.visitChildren(node);
+
+ this.close(node);
+ }
+
+ MethodDefinition(node) {
+ this.visitProperty(node);
+ }
+
+ BreakStatement() {} // eslint-disable-line class-methods-use-this
+
+ ContinueStatement() {} // eslint-disable-line class-methods-use-this
+
+ LabeledStatement(node) {
+ this.visit(node.body);
+ }
+
+ ForStatement(node) {
+
+ // Create ForStatement declaration.
+ // NOTE: In ES6, ForStatement dynamically generates
+ // per iteration environment. However, escope is
+ // a static analyzer, we only generate one scope for ForStatement.
+ if (node.init && node.init.type === Syntax.VariableDeclaration && node.init.kind !== "var") {
+ this.scopeManager.__nestForScope(node);
+ }
+
+ this.visitChildren(node);
+
+ this.close(node);
+ }
+
+ ClassExpression(node) {
+ this.visitClass(node);
+ }
+
+ ClassDeclaration(node) {
+ this.visitClass(node);
+ }
+
+ CallExpression(node) {
+
+ // Check this is direct call to eval
+ if (!this.scopeManager.__ignoreEval() && node.callee.type === Syntax.Identifier && node.callee.name === "eval") {
+
+ // NOTE: This should be `variableScope`. Since direct eval call always creates Lexical environment and
+ // let / const should be enclosed into it. Only VariableDeclaration affects on the caller's environment.
+ this.currentScope().variableScope.__detectEval();
+ }
+ this.visitChildren(node);
+ }
+
+ BlockStatement(node) {
+ if (this.scopeManager.__isES6()) {
+ this.scopeManager.__nestBlockScope(node);
+ }
+
+ this.visitChildren(node);
+
+ this.close(node);
+ }
+
+ ThisExpression() {
+ this.currentScope().variableScope.__detectThis();
+ }
+
+ WithStatement(node) {
+ this.visit(node.object);
+
+ // Then nest scope for WithStatement.
+ this.scopeManager.__nestWithScope(node);
+
+ this.visit(node.body);
+
+ this.close(node);
+ }
+
+ VariableDeclaration(node) {
+ const variableTargetScope = (node.kind === "var") ? this.currentScope().variableScope : this.currentScope();
+
+ for (let i = 0, iz = node.declarations.length; i < iz; ++i) {
+ const decl = node.declarations[i];
+
+ this.visitVariableDeclaration(variableTargetScope, Variable.Variable, node, i);
+ if (decl.init) {
+ this.visit(decl.init);
+ }
+ }
+ }
+
+ // sec 13.11.8
+ SwitchStatement(node) {
+ this.visit(node.discriminant);
+
+ if (this.scopeManager.__isES6()) {
+ this.scopeManager.__nestSwitchScope(node);
+ }
+
+ for (let i = 0, iz = node.cases.length; i < iz; ++i) {
+ this.visit(node.cases[i]);
+ }
+
+ this.close(node);
+ }
+
+ FunctionDeclaration(node) {
+ this.visitFunction(node);
+ }
+
+ FunctionExpression(node) {
+ this.visitFunction(node);
+ }
+
+ ForOfStatement(node) {
+ this.visitForIn(node);
+ }
+
+ ForInStatement(node) {
+ this.visitForIn(node);
+ }
+
+ ArrowFunctionExpression(node) {
+ this.visitFunction(node);
+ }
+
+ ImportDeclaration(node) {
+ assert(this.scopeManager.__isES6() && this.scopeManager.isModule(), "ImportDeclaration should appear when the mode is ES6 and in the module context.");
+
+ const importer = new Importer(node, this);
+
+ importer.visit(node);
+ }
+
+ visitExportDeclaration(node) {
+ if (node.source) {
+ return;
+ }
+ if (node.declaration) {
+ this.visit(node.declaration);
+ return;
+ }
+
+ this.visitChildren(node);
+ }
+
+ // TODO: ExportDeclaration doesn't exist. for bc?
+ ExportDeclaration(node) {
+ this.visitExportDeclaration(node);
+ }
+
+ ExportAllDeclaration(node) {
+ this.visitExportDeclaration(node);
+ }
+
+ ExportDefaultDeclaration(node) {
+ this.visitExportDeclaration(node);
+ }
+
+ ExportNamedDeclaration(node) {
+ this.visitExportDeclaration(node);
+ }
+
+ ExportSpecifier(node) {
+
+ // TODO: `node.id` doesn't exist. for bc?
+ const local = (node.id || node.local);
+
+ this.visit(local);
+ }
+
+ MetaProperty() { // eslint-disable-line class-methods-use-this
+
+ // do nothing.
+ }
+}
+
+export default Referencer;
+
+/* vim: set sw=4 ts=4 et tw=80 : */
diff --git a/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-scope/lib/scope-manager.js b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-scope/lib/scope-manager.js
new file mode 100644
index 0000000000000000000000000000000000000000..d2270f1f9a13fd9ec92d1456d740e1071048b3ec
--- /dev/null
+++ b/novas/novacore-zephyr/groq-code-cli/node_modules/eslint-scope/lib/scope-manager.js
@@ -0,0 +1,255 @@
+/*
+ Copyright (C) 2015 Yusuke Suzuki
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL