How to use node method in fast-check-monorepo

Best JavaScript code snippet using fast-check-monorepo

index.js

Source:index.js Github

copy

Full Screen

1"use strict";2Object.defineProperty(exports, "__esModule", {3 value: true4});5exports.isArrayExpression = isArrayExpression;6exports.isAssignmentExpression = isAssignmentExpression;7exports.isBinaryExpression = isBinaryExpression;8exports.isInterpreterDirective = isInterpreterDirective;9exports.isDirective = isDirective;10exports.isDirectiveLiteral = isDirectiveLiteral;11exports.isBlockStatement = isBlockStatement;12exports.isBreakStatement = isBreakStatement;13exports.isCallExpression = isCallExpression;14exports.isCatchClause = isCatchClause;15exports.isConditionalExpression = isConditionalExpression;16exports.isContinueStatement = isContinueStatement;17exports.isDebuggerStatement = isDebuggerStatement;18exports.isDoWhileStatement = isDoWhileStatement;19exports.isEmptyStatement = isEmptyStatement;20exports.isExpressionStatement = isExpressionStatement;21exports.isFile = isFile;22exports.isForInStatement = isForInStatement;23exports.isForStatement = isForStatement;24exports.isFunctionDeclaration = isFunctionDeclaration;25exports.isFunctionExpression = isFunctionExpression;26exports.isIdentifier = isIdentifier;27exports.isIfStatement = isIfStatement;28exports.isLabeledStatement = isLabeledStatement;29exports.isStringLiteral = isStringLiteral;30exports.isNumericLiteral = isNumericLiteral;31exports.isNullLiteral = isNullLiteral;32exports.isBooleanLiteral = isBooleanLiteral;33exports.isRegExpLiteral = isRegExpLiteral;34exports.isLogicalExpression = isLogicalExpression;35exports.isMemberExpression = isMemberExpression;36exports.isNewExpression = isNewExpression;37exports.isProgram = isProgram;38exports.isObjectExpression = isObjectExpression;39exports.isObjectMethod = isObjectMethod;40exports.isObjectProperty = isObjectProperty;41exports.isRestElement = isRestElement;42exports.isReturnStatement = isReturnStatement;43exports.isSequenceExpression = isSequenceExpression;44exports.isParenthesizedExpression = isParenthesizedExpression;45exports.isSwitchCase = isSwitchCase;46exports.isSwitchStatement = isSwitchStatement;47exports.isThisExpression = isThisExpression;48exports.isThrowStatement = isThrowStatement;49exports.isTryStatement = isTryStatement;50exports.isUnaryExpression = isUnaryExpression;51exports.isUpdateExpression = isUpdateExpression;52exports.isVariableDeclaration = isVariableDeclaration;53exports.isVariableDeclarator = isVariableDeclarator;54exports.isWhileStatement = isWhileStatement;55exports.isWithStatement = isWithStatement;56exports.isAssignmentPattern = isAssignmentPattern;57exports.isArrayPattern = isArrayPattern;58exports.isArrowFunctionExpression = isArrowFunctionExpression;59exports.isClassBody = isClassBody;60exports.isClassExpression = isClassExpression;61exports.isClassDeclaration = isClassDeclaration;62exports.isExportAllDeclaration = isExportAllDeclaration;63exports.isExportDefaultDeclaration = isExportDefaultDeclaration;64exports.isExportNamedDeclaration = isExportNamedDeclaration;65exports.isExportSpecifier = isExportSpecifier;66exports.isForOfStatement = isForOfStatement;67exports.isImportDeclaration = isImportDeclaration;68exports.isImportDefaultSpecifier = isImportDefaultSpecifier;69exports.isImportNamespaceSpecifier = isImportNamespaceSpecifier;70exports.isImportSpecifier = isImportSpecifier;71exports.isMetaProperty = isMetaProperty;72exports.isClassMethod = isClassMethod;73exports.isObjectPattern = isObjectPattern;74exports.isSpreadElement = isSpreadElement;75exports.isSuper = isSuper;76exports.isTaggedTemplateExpression = isTaggedTemplateExpression;77exports.isTemplateElement = isTemplateElement;78exports.isTemplateLiteral = isTemplateLiteral;79exports.isYieldExpression = isYieldExpression;80exports.isAwaitExpression = isAwaitExpression;81exports.isImport = isImport;82exports.isBigIntLiteral = isBigIntLiteral;83exports.isExportNamespaceSpecifier = isExportNamespaceSpecifier;84exports.isOptionalMemberExpression = isOptionalMemberExpression;85exports.isOptionalCallExpression = isOptionalCallExpression;86exports.isClassProperty = isClassProperty;87exports.isClassPrivateProperty = isClassPrivateProperty;88exports.isClassPrivateMethod = isClassPrivateMethod;89exports.isPrivateName = isPrivateName;90exports.isAnyTypeAnnotation = isAnyTypeAnnotation;91exports.isArrayTypeAnnotation = isArrayTypeAnnotation;92exports.isBooleanTypeAnnotation = isBooleanTypeAnnotation;93exports.isBooleanLiteralTypeAnnotation = isBooleanLiteralTypeAnnotation;94exports.isNullLiteralTypeAnnotation = isNullLiteralTypeAnnotation;95exports.isClassImplements = isClassImplements;96exports.isDeclareClass = isDeclareClass;97exports.isDeclareFunction = isDeclareFunction;98exports.isDeclareInterface = isDeclareInterface;99exports.isDeclareModule = isDeclareModule;100exports.isDeclareModuleExports = isDeclareModuleExports;101exports.isDeclareTypeAlias = isDeclareTypeAlias;102exports.isDeclareOpaqueType = isDeclareOpaqueType;103exports.isDeclareVariable = isDeclareVariable;104exports.isDeclareExportDeclaration = isDeclareExportDeclaration;105exports.isDeclareExportAllDeclaration = isDeclareExportAllDeclaration;106exports.isDeclaredPredicate = isDeclaredPredicate;107exports.isExistsTypeAnnotation = isExistsTypeAnnotation;108exports.isFunctionTypeAnnotation = isFunctionTypeAnnotation;109exports.isFunctionTypeParam = isFunctionTypeParam;110exports.isGenericTypeAnnotation = isGenericTypeAnnotation;111exports.isInferredPredicate = isInferredPredicate;112exports.isInterfaceExtends = isInterfaceExtends;113exports.isInterfaceDeclaration = isInterfaceDeclaration;114exports.isInterfaceTypeAnnotation = isInterfaceTypeAnnotation;115exports.isIntersectionTypeAnnotation = isIntersectionTypeAnnotation;116exports.isMixedTypeAnnotation = isMixedTypeAnnotation;117exports.isEmptyTypeAnnotation = isEmptyTypeAnnotation;118exports.isNullableTypeAnnotation = isNullableTypeAnnotation;119exports.isNumberLiteralTypeAnnotation = isNumberLiteralTypeAnnotation;120exports.isNumberTypeAnnotation = isNumberTypeAnnotation;121exports.isObjectTypeAnnotation = isObjectTypeAnnotation;122exports.isObjectTypeInternalSlot = isObjectTypeInternalSlot;123exports.isObjectTypeCallProperty = isObjectTypeCallProperty;124exports.isObjectTypeIndexer = isObjectTypeIndexer;125exports.isObjectTypeProperty = isObjectTypeProperty;126exports.isObjectTypeSpreadProperty = isObjectTypeSpreadProperty;127exports.isOpaqueType = isOpaqueType;128exports.isQualifiedTypeIdentifier = isQualifiedTypeIdentifier;129exports.isStringLiteralTypeAnnotation = isStringLiteralTypeAnnotation;130exports.isStringTypeAnnotation = isStringTypeAnnotation;131exports.isSymbolTypeAnnotation = isSymbolTypeAnnotation;132exports.isThisTypeAnnotation = isThisTypeAnnotation;133exports.isTupleTypeAnnotation = isTupleTypeAnnotation;134exports.isTypeofTypeAnnotation = isTypeofTypeAnnotation;135exports.isTypeAlias = isTypeAlias;136exports.isTypeAnnotation = isTypeAnnotation;137exports.isTypeCastExpression = isTypeCastExpression;138exports.isTypeParameter = isTypeParameter;139exports.isTypeParameterDeclaration = isTypeParameterDeclaration;140exports.isTypeParameterInstantiation = isTypeParameterInstantiation;141exports.isUnionTypeAnnotation = isUnionTypeAnnotation;142exports.isVariance = isVariance;143exports.isVoidTypeAnnotation = isVoidTypeAnnotation;144exports.isEnumDeclaration = isEnumDeclaration;145exports.isEnumBooleanBody = isEnumBooleanBody;146exports.isEnumNumberBody = isEnumNumberBody;147exports.isEnumStringBody = isEnumStringBody;148exports.isEnumSymbolBody = isEnumSymbolBody;149exports.isEnumBooleanMember = isEnumBooleanMember;150exports.isEnumNumberMember = isEnumNumberMember;151exports.isEnumStringMember = isEnumStringMember;152exports.isEnumDefaultedMember = isEnumDefaultedMember;153exports.isIndexedAccessType = isIndexedAccessType;154exports.isOptionalIndexedAccessType = isOptionalIndexedAccessType;155exports.isJSXAttribute = isJSXAttribute;156exports.isJSXClosingElement = isJSXClosingElement;157exports.isJSXElement = isJSXElement;158exports.isJSXEmptyExpression = isJSXEmptyExpression;159exports.isJSXExpressionContainer = isJSXExpressionContainer;160exports.isJSXSpreadChild = isJSXSpreadChild;161exports.isJSXIdentifier = isJSXIdentifier;162exports.isJSXMemberExpression = isJSXMemberExpression;163exports.isJSXNamespacedName = isJSXNamespacedName;164exports.isJSXOpeningElement = isJSXOpeningElement;165exports.isJSXSpreadAttribute = isJSXSpreadAttribute;166exports.isJSXText = isJSXText;167exports.isJSXFragment = isJSXFragment;168exports.isJSXOpeningFragment = isJSXOpeningFragment;169exports.isJSXClosingFragment = isJSXClosingFragment;170exports.isNoop = isNoop;171exports.isPlaceholder = isPlaceholder;172exports.isV8IntrinsicIdentifier = isV8IntrinsicIdentifier;173exports.isArgumentPlaceholder = isArgumentPlaceholder;174exports.isBindExpression = isBindExpression;175exports.isImportAttribute = isImportAttribute;176exports.isDecorator = isDecorator;177exports.isDoExpression = isDoExpression;178exports.isExportDefaultSpecifier = isExportDefaultSpecifier;179exports.isRecordExpression = isRecordExpression;180exports.isTupleExpression = isTupleExpression;181exports.isDecimalLiteral = isDecimalLiteral;182exports.isStaticBlock = isStaticBlock;183exports.isModuleExpression = isModuleExpression;184exports.isTopicReference = isTopicReference;185exports.isPipelineTopicExpression = isPipelineTopicExpression;186exports.isPipelineBareFunction = isPipelineBareFunction;187exports.isPipelinePrimaryTopicReference = isPipelinePrimaryTopicReference;188exports.isTSParameterProperty = isTSParameterProperty;189exports.isTSDeclareFunction = isTSDeclareFunction;190exports.isTSDeclareMethod = isTSDeclareMethod;191exports.isTSQualifiedName = isTSQualifiedName;192exports.isTSCallSignatureDeclaration = isTSCallSignatureDeclaration;193exports.isTSConstructSignatureDeclaration = isTSConstructSignatureDeclaration;194exports.isTSPropertySignature = isTSPropertySignature;195exports.isTSMethodSignature = isTSMethodSignature;196exports.isTSIndexSignature = isTSIndexSignature;197exports.isTSAnyKeyword = isTSAnyKeyword;198exports.isTSBooleanKeyword = isTSBooleanKeyword;199exports.isTSBigIntKeyword = isTSBigIntKeyword;200exports.isTSIntrinsicKeyword = isTSIntrinsicKeyword;201exports.isTSNeverKeyword = isTSNeverKeyword;202exports.isTSNullKeyword = isTSNullKeyword;203exports.isTSNumberKeyword = isTSNumberKeyword;204exports.isTSObjectKeyword = isTSObjectKeyword;205exports.isTSStringKeyword = isTSStringKeyword;206exports.isTSSymbolKeyword = isTSSymbolKeyword;207exports.isTSUndefinedKeyword = isTSUndefinedKeyword;208exports.isTSUnknownKeyword = isTSUnknownKeyword;209exports.isTSVoidKeyword = isTSVoidKeyword;210exports.isTSThisType = isTSThisType;211exports.isTSFunctionType = isTSFunctionType;212exports.isTSConstructorType = isTSConstructorType;213exports.isTSTypeReference = isTSTypeReference;214exports.isTSTypePredicate = isTSTypePredicate;215exports.isTSTypeQuery = isTSTypeQuery;216exports.isTSTypeLiteral = isTSTypeLiteral;217exports.isTSArrayType = isTSArrayType;218exports.isTSTupleType = isTSTupleType;219exports.isTSOptionalType = isTSOptionalType;220exports.isTSRestType = isTSRestType;221exports.isTSNamedTupleMember = isTSNamedTupleMember;222exports.isTSUnionType = isTSUnionType;223exports.isTSIntersectionType = isTSIntersectionType;224exports.isTSConditionalType = isTSConditionalType;225exports.isTSInferType = isTSInferType;226exports.isTSParenthesizedType = isTSParenthesizedType;227exports.isTSTypeOperator = isTSTypeOperator;228exports.isTSIndexedAccessType = isTSIndexedAccessType;229exports.isTSMappedType = isTSMappedType;230exports.isTSLiteralType = isTSLiteralType;231exports.isTSExpressionWithTypeArguments = isTSExpressionWithTypeArguments;232exports.isTSInterfaceDeclaration = isTSInterfaceDeclaration;233exports.isTSInterfaceBody = isTSInterfaceBody;234exports.isTSTypeAliasDeclaration = isTSTypeAliasDeclaration;235exports.isTSAsExpression = isTSAsExpression;236exports.isTSTypeAssertion = isTSTypeAssertion;237exports.isTSEnumDeclaration = isTSEnumDeclaration;238exports.isTSEnumMember = isTSEnumMember;239exports.isTSModuleDeclaration = isTSModuleDeclaration;240exports.isTSModuleBlock = isTSModuleBlock;241exports.isTSImportType = isTSImportType;242exports.isTSImportEqualsDeclaration = isTSImportEqualsDeclaration;243exports.isTSExternalModuleReference = isTSExternalModuleReference;244exports.isTSNonNullExpression = isTSNonNullExpression;245exports.isTSExportAssignment = isTSExportAssignment;246exports.isTSNamespaceExportDeclaration = isTSNamespaceExportDeclaration;247exports.isTSTypeAnnotation = isTSTypeAnnotation;248exports.isTSTypeParameterInstantiation = isTSTypeParameterInstantiation;249exports.isTSTypeParameterDeclaration = isTSTypeParameterDeclaration;250exports.isTSTypeParameter = isTSTypeParameter;251exports.isExpression = isExpression;252exports.isBinary = isBinary;253exports.isScopable = isScopable;254exports.isBlockParent = isBlockParent;255exports.isBlock = isBlock;256exports.isStatement = isStatement;257exports.isTerminatorless = isTerminatorless;258exports.isCompletionStatement = isCompletionStatement;259exports.isConditional = isConditional;260exports.isLoop = isLoop;261exports.isWhile = isWhile;262exports.isExpressionWrapper = isExpressionWrapper;263exports.isFor = isFor;264exports.isForXStatement = isForXStatement;265exports.isFunction = isFunction;266exports.isFunctionParent = isFunctionParent;267exports.isPureish = isPureish;268exports.isDeclaration = isDeclaration;269exports.isPatternLike = isPatternLike;270exports.isLVal = isLVal;271exports.isTSEntityName = isTSEntityName;272exports.isLiteral = isLiteral;273exports.isImmutable = isImmutable;274exports.isUserWhitespacable = isUserWhitespacable;275exports.isMethod = isMethod;276exports.isObjectMember = isObjectMember;277exports.isProperty = isProperty;278exports.isUnaryLike = isUnaryLike;279exports.isPattern = isPattern;280exports.isClass = isClass;281exports.isModuleDeclaration = isModuleDeclaration;282exports.isExportDeclaration = isExportDeclaration;283exports.isModuleSpecifier = isModuleSpecifier;284exports.isPrivate = isPrivate;285exports.isFlow = isFlow;286exports.isFlowType = isFlowType;287exports.isFlowBaseAnnotation = isFlowBaseAnnotation;288exports.isFlowDeclaration = isFlowDeclaration;289exports.isFlowPredicate = isFlowPredicate;290exports.isEnumBody = isEnumBody;291exports.isEnumMember = isEnumMember;292exports.isJSX = isJSX;293exports.isTSTypeElement = isTSTypeElement;294exports.isTSType = isTSType;295exports.isTSBaseType = isTSBaseType;296exports.isNumberLiteral = isNumberLiteral;297exports.isRegexLiteral = isRegexLiteral;298exports.isRestProperty = isRestProperty;299exports.isSpreadProperty = isSpreadProperty;300var _shallowEqual = require("../../utils/shallowEqual");301function isArrayExpression(node, opts) {302 if (!node) return false;303 const nodeType = node.type;304 if (nodeType === "ArrayExpression") {305 if (typeof opts === "undefined") {306 return true;307 } else {308 return (0, _shallowEqual.default)(node, opts);309 }310 }311 return false;312}313function isAssignmentExpression(node, opts) {314 if (!node) return false;315 const nodeType = node.type;316 if (nodeType === "AssignmentExpression") {317 if (typeof opts === "undefined") {318 return true;319 } else {320 return (0, _shallowEqual.default)(node, opts);321 }322 }323 return false;324}325function isBinaryExpression(node, opts) {326 if (!node) return false;327 const nodeType = node.type;328 if (nodeType === "BinaryExpression") {329 if (typeof opts === "undefined") {330 return true;331 } else {332 return (0, _shallowEqual.default)(node, opts);333 }334 }335 return false;336}337function isInterpreterDirective(node, opts) {338 if (!node) return false;339 const nodeType = node.type;340 if (nodeType === "InterpreterDirective") {341 if (typeof opts === "undefined") {342 return true;343 } else {344 return (0, _shallowEqual.default)(node, opts);345 }346 }347 return false;348}349function isDirective(node, opts) {350 if (!node) return false;351 const nodeType = node.type;352 if (nodeType === "Directive") {353 if (typeof opts === "undefined") {354 return true;355 } else {356 return (0, _shallowEqual.default)(node, opts);357 }358 }359 return false;360}361function isDirectiveLiteral(node, opts) {362 if (!node) return false;363 const nodeType = node.type;364 if (nodeType === "DirectiveLiteral") {365 if (typeof opts === "undefined") {366 return true;367 } else {368 return (0, _shallowEqual.default)(node, opts);369 }370 }371 return false;372}373function isBlockStatement(node, opts) {374 if (!node) return false;375 const nodeType = node.type;376 if (nodeType === "BlockStatement") {377 if (typeof opts === "undefined") {378 return true;379 } else {380 return (0, _shallowEqual.default)(node, opts);381 }382 }383 return false;384}385function isBreakStatement(node, opts) {386 if (!node) return false;387 const nodeType = node.type;388 if (nodeType === "BreakStatement") {389 if (typeof opts === "undefined") {390 return true;391 } else {392 return (0, _shallowEqual.default)(node, opts);393 }394 }395 return false;396}397function isCallExpression(node, opts) {398 if (!node) return false;399 const nodeType = node.type;400 if (nodeType === "CallExpression") {401 if (typeof opts === "undefined") {402 return true;403 } else {404 return (0, _shallowEqual.default)(node, opts);405 }406 }407 return false;408}409function isCatchClause(node, opts) {410 if (!node) return false;411 const nodeType = node.type;412 if (nodeType === "CatchClause") {413 if (typeof opts === "undefined") {414 return true;415 } else {416 return (0, _shallowEqual.default)(node, opts);417 }418 }419 return false;420}421function isConditionalExpression(node, opts) {422 if (!node) return false;423 const nodeType = node.type;424 if (nodeType === "ConditionalExpression") {425 if (typeof opts === "undefined") {426 return true;427 } else {428 return (0, _shallowEqual.default)(node, opts);429 }430 }431 return false;432}433function isContinueStatement(node, opts) {434 if (!node) return false;435 const nodeType = node.type;436 if (nodeType === "ContinueStatement") {437 if (typeof opts === "undefined") {438 return true;439 } else {440 return (0, _shallowEqual.default)(node, opts);441 }442 }443 return false;444}445function isDebuggerStatement(node, opts) {446 if (!node) return false;447 const nodeType = node.type;448 if (nodeType === "DebuggerStatement") {449 if (typeof opts === "undefined") {450 return true;451 } else {452 return (0, _shallowEqual.default)(node, opts);453 }454 }455 return false;456}457function isDoWhileStatement(node, opts) {458 if (!node) return false;459 const nodeType = node.type;460 if (nodeType === "DoWhileStatement") {461 if (typeof opts === "undefined") {462 return true;463 } else {464 return (0, _shallowEqual.default)(node, opts);465 }466 }467 return false;468}469function isEmptyStatement(node, opts) {470 if (!node) return false;471 const nodeType = node.type;472 if (nodeType === "EmptyStatement") {473 if (typeof opts === "undefined") {474 return true;475 } else {476 return (0, _shallowEqual.default)(node, opts);477 }478 }479 return false;480}481function isExpressionStatement(node, opts) {482 if (!node) return false;483 const nodeType = node.type;484 if (nodeType === "ExpressionStatement") {485 if (typeof opts === "undefined") {486 return true;487 } else {488 return (0, _shallowEqual.default)(node, opts);489 }490 }491 return false;492}493function isFile(node, opts) {494 if (!node) return false;495 const nodeType = node.type;496 if (nodeType === "File") {497 if (typeof opts === "undefined") {498 return true;499 } else {500 return (0, _shallowEqual.default)(node, opts);501 }502 }503 return false;504}505function isForInStatement(node, opts) {506 if (!node) return false;507 const nodeType = node.type;508 if (nodeType === "ForInStatement") {509 if (typeof opts === "undefined") {510 return true;511 } else {512 return (0, _shallowEqual.default)(node, opts);513 }514 }515 return false;516}517function isForStatement(node, opts) {518 if (!node) return false;519 const nodeType = node.type;520 if (nodeType === "ForStatement") {521 if (typeof opts === "undefined") {522 return true;523 } else {524 return (0, _shallowEqual.default)(node, opts);525 }526 }527 return false;528}529function isFunctionDeclaration(node, opts) {530 if (!node) return false;531 const nodeType = node.type;532 if (nodeType === "FunctionDeclaration") {533 if (typeof opts === "undefined") {534 return true;535 } else {536 return (0, _shallowEqual.default)(node, opts);537 }538 }539 return false;540}541function isFunctionExpression(node, opts) {542 if (!node) return false;543 const nodeType = node.type;544 if (nodeType === "FunctionExpression") {545 if (typeof opts === "undefined") {546 return true;547 } else {548 return (0, _shallowEqual.default)(node, opts);549 }550 }551 return false;552}553function isIdentifier(node, opts) {554 if (!node) return false;555 const nodeType = node.type;556 if (nodeType === "Identifier") {557 if (typeof opts === "undefined") {558 return true;559 } else {560 return (0, _shallowEqual.default)(node, opts);561 }562 }563 return false;564}565function isIfStatement(node, opts) {566 if (!node) return false;567 const nodeType = node.type;568 if (nodeType === "IfStatement") {569 if (typeof opts === "undefined") {570 return true;571 } else {572 return (0, _shallowEqual.default)(node, opts);573 }574 }575 return false;576}577function isLabeledStatement(node, opts) {578 if (!node) return false;579 const nodeType = node.type;580 if (nodeType === "LabeledStatement") {581 if (typeof opts === "undefined") {582 return true;583 } else {584 return (0, _shallowEqual.default)(node, opts);585 }586 }587 return false;588}589function isStringLiteral(node, opts) {590 if (!node) return false;591 const nodeType = node.type;592 if (nodeType === "StringLiteral") {593 if (typeof opts === "undefined") {594 return true;595 } else {596 return (0, _shallowEqual.default)(node, opts);597 }598 }599 return false;600}601function isNumericLiteral(node, opts) {602 if (!node) return false;603 const nodeType = node.type;604 if (nodeType === "NumericLiteral") {605 if (typeof opts === "undefined") {606 return true;607 } else {608 return (0, _shallowEqual.default)(node, opts);609 }610 }611 return false;612}613function isNullLiteral(node, opts) {614 if (!node) return false;615 const nodeType = node.type;616 if (nodeType === "NullLiteral") {617 if (typeof opts === "undefined") {618 return true;619 } else {620 return (0, _shallowEqual.default)(node, opts);621 }622 }623 return false;624}625function isBooleanLiteral(node, opts) {626 if (!node) return false;627 const nodeType = node.type;628 if (nodeType === "BooleanLiteral") {629 if (typeof opts === "undefined") {630 return true;631 } else {632 return (0, _shallowEqual.default)(node, opts);633 }634 }635 return false;636}637function isRegExpLiteral(node, opts) {638 if (!node) return false;639 const nodeType = node.type;640 if (nodeType === "RegExpLiteral") {641 if (typeof opts === "undefined") {642 return true;643 } else {644 return (0, _shallowEqual.default)(node, opts);645 }646 }647 return false;648}649function isLogicalExpression(node, opts) {650 if (!node) return false;651 const nodeType = node.type;652 if (nodeType === "LogicalExpression") {653 if (typeof opts === "undefined") {654 return true;655 } else {656 return (0, _shallowEqual.default)(node, opts);657 }658 }659 return false;660}661function isMemberExpression(node, opts) {662 if (!node) return false;663 const nodeType = node.type;664 if (nodeType === "MemberExpression") {665 if (typeof opts === "undefined") {666 return true;667 } else {668 return (0, _shallowEqual.default)(node, opts);669 }670 }671 return false;672}673function isNewExpression(node, opts) {674 if (!node) return false;675 const nodeType = node.type;676 if (nodeType === "NewExpression") {677 if (typeof opts === "undefined") {678 return true;679 } else {680 return (0, _shallowEqual.default)(node, opts);681 }682 }683 return false;684}685function isProgram(node, opts) {686 if (!node) return false;687 const nodeType = node.type;688 if (nodeType === "Program") {689 if (typeof opts === "undefined") {690 return true;691 } else {692 return (0, _shallowEqual.default)(node, opts);693 }694 }695 return false;696}697function isObjectExpression(node, opts) {698 if (!node) return false;699 const nodeType = node.type;700 if (nodeType === "ObjectExpression") {701 if (typeof opts === "undefined") {702 return true;703 } else {704 return (0, _shallowEqual.default)(node, opts);705 }706 }707 return false;708}709function isObjectMethod(node, opts) {710 if (!node) return false;711 const nodeType = node.type;712 if (nodeType === "ObjectMethod") {713 if (typeof opts === "undefined") {714 return true;715 } else {716 return (0, _shallowEqual.default)(node, opts);717 }718 }719 return false;720}721function isObjectProperty(node, opts) {722 if (!node) return false;723 const nodeType = node.type;724 if (nodeType === "ObjectProperty") {725 if (typeof opts === "undefined") {726 return true;727 } else {728 return (0, _shallowEqual.default)(node, opts);729 }730 }731 return false;732}733function isRestElement(node, opts) {734 if (!node) return false;735 const nodeType = node.type;736 if (nodeType === "RestElement") {737 if (typeof opts === "undefined") {738 return true;739 } else {740 return (0, _shallowEqual.default)(node, opts);741 }742 }743 return false;744}745function isReturnStatement(node, opts) {746 if (!node) return false;747 const nodeType = node.type;748 if (nodeType === "ReturnStatement") {749 if (typeof opts === "undefined") {750 return true;751 } else {752 return (0, _shallowEqual.default)(node, opts);753 }754 }755 return false;756}757function isSequenceExpression(node, opts) {758 if (!node) return false;759 const nodeType = node.type;760 if (nodeType === "SequenceExpression") {761 if (typeof opts === "undefined") {762 return true;763 } else {764 return (0, _shallowEqual.default)(node, opts);765 }766 }767 return false;768}769function isParenthesizedExpression(node, opts) {770 if (!node) return false;771 const nodeType = node.type;772 if (nodeType === "ParenthesizedExpression") {773 if (typeof opts === "undefined") {774 return true;775 } else {776 return (0, _shallowEqual.default)(node, opts);777 }778 }779 return false;780}781function isSwitchCase(node, opts) {782 if (!node) return false;783 const nodeType = node.type;784 if (nodeType === "SwitchCase") {785 if (typeof opts === "undefined") {786 return true;787 } else {788 return (0, _shallowEqual.default)(node, opts);789 }790 }791 return false;792}793function isSwitchStatement(node, opts) {794 if (!node) return false;795 const nodeType = node.type;796 if (nodeType === "SwitchStatement") {797 if (typeof opts === "undefined") {798 return true;799 } else {800 return (0, _shallowEqual.default)(node, opts);801 }802 }803 return false;804}805function isThisExpression(node, opts) {806 if (!node) return false;807 const nodeType = node.type;808 if (nodeType === "ThisExpression") {809 if (typeof opts === "undefined") {810 return true;811 } else {812 return (0, _shallowEqual.default)(node, opts);813 }814 }815 return false;816}817function isThrowStatement(node, opts) {818 if (!node) return false;819 const nodeType = node.type;820 if (nodeType === "ThrowStatement") {821 if (typeof opts === "undefined") {822 return true;823 } else {824 return (0, _shallowEqual.default)(node, opts);825 }826 }827 return false;828}829function isTryStatement(node, opts) {830 if (!node) return false;831 const nodeType = node.type;832 if (nodeType === "TryStatement") {833 if (typeof opts === "undefined") {834 return true;835 } else {836 return (0, _shallowEqual.default)(node, opts);837 }838 }839 return false;840}841function isUnaryExpression(node, opts) {842 if (!node) return false;843 const nodeType = node.type;844 if (nodeType === "UnaryExpression") {845 if (typeof opts === "undefined") {846 return true;847 } else {848 return (0, _shallowEqual.default)(node, opts);849 }850 }851 return false;852}853function isUpdateExpression(node, opts) {854 if (!node) return false;855 const nodeType = node.type;856 if (nodeType === "UpdateExpression") {857 if (typeof opts === "undefined") {858 return true;859 } else {860 return (0, _shallowEqual.default)(node, opts);861 }862 }863 return false;864}865function isVariableDeclaration(node, opts) {866 if (!node) return false;867 const nodeType = node.type;868 if (nodeType === "VariableDeclaration") {869 if (typeof opts === "undefined") {870 return true;871 } else {872 return (0, _shallowEqual.default)(node, opts);873 }874 }875 return false;876}877function isVariableDeclarator(node, opts) {878 if (!node) return false;879 const nodeType = node.type;880 if (nodeType === "VariableDeclarator") {881 if (typeof opts === "undefined") {882 return true;883 } else {884 return (0, _shallowEqual.default)(node, opts);885 }886 }887 return false;888}889function isWhileStatement(node, opts) {890 if (!node) return false;891 const nodeType = node.type;892 if (nodeType === "WhileStatement") {893 if (typeof opts === "undefined") {894 return true;895 } else {896 return (0, _shallowEqual.default)(node, opts);897 }898 }899 return false;900}901function isWithStatement(node, opts) {902 if (!node) return false;903 const nodeType = node.type;904 if (nodeType === "WithStatement") {905 if (typeof opts === "undefined") {906 return true;907 } else {908 return (0, _shallowEqual.default)(node, opts);909 }910 }911 return false;912}913function isAssignmentPattern(node, opts) {914 if (!node) return false;915 const nodeType = node.type;916 if (nodeType === "AssignmentPattern") {917 if (typeof opts === "undefined") {918 return true;919 } else {920 return (0, _shallowEqual.default)(node, opts);921 }922 }923 return false;924}925function isArrayPattern(node, opts) {926 if (!node) return false;927 const nodeType = node.type;928 if (nodeType === "ArrayPattern") {929 if (typeof opts === "undefined") {930 return true;931 } else {932 return (0, _shallowEqual.default)(node, opts);933 }934 }935 return false;936}937function isArrowFunctionExpression(node, opts) {938 if (!node) return false;939 const nodeType = node.type;940 if (nodeType === "ArrowFunctionExpression") {941 if (typeof opts === "undefined") {942 return true;943 } else {944 return (0, _shallowEqual.default)(node, opts);945 }946 }947 return false;948}949function isClassBody(node, opts) {950 if (!node) return false;951 const nodeType = node.type;952 if (nodeType === "ClassBody") {953 if (typeof opts === "undefined") {954 return true;955 } else {956 return (0, _shallowEqual.default)(node, opts);957 }958 }959 return false;960}961function isClassExpression(node, opts) {962 if (!node) return false;963 const nodeType = node.type;964 if (nodeType === "ClassExpression") {965 if (typeof opts === "undefined") {966 return true;967 } else {968 return (0, _shallowEqual.default)(node, opts);969 }970 }971 return false;972}973function isClassDeclaration(node, opts) {974 if (!node) return false;975 const nodeType = node.type;976 if (nodeType === "ClassDeclaration") {977 if (typeof opts === "undefined") {978 return true;979 } else {980 return (0, _shallowEqual.default)(node, opts);981 }982 }983 return false;984}985function isExportAllDeclaration(node, opts) {986 if (!node) return false;987 const nodeType = node.type;988 if (nodeType === "ExportAllDeclaration") {989 if (typeof opts === "undefined") {990 return true;991 } else {992 return (0, _shallowEqual.default)(node, opts);993 }994 }995 return false;996}997function isExportDefaultDeclaration(node, opts) {998 if (!node) return false;999 const nodeType = node.type;1000 if (nodeType === "ExportDefaultDeclaration") {1001 if (typeof opts === "undefined") {1002 return true;1003 } else {1004 return (0, _shallowEqual.default)(node, opts);1005 }1006 }1007 return false;1008}1009function isExportNamedDeclaration(node, opts) {1010 if (!node) return false;1011 const nodeType = node.type;1012 if (nodeType === "ExportNamedDeclaration") {1013 if (typeof opts === "undefined") {1014 return true;1015 } else {1016 return (0, _shallowEqual.default)(node, opts);1017 }1018 }1019 return false;1020}1021function isExportSpecifier(node, opts) {1022 if (!node) return false;1023 const nodeType = node.type;1024 if (nodeType === "ExportSpecifier") {1025 if (typeof opts === "undefined") {1026 return true;1027 } else {1028 return (0, _shallowEqual.default)(node, opts);1029 }1030 }1031 return false;1032}1033function isForOfStatement(node, opts) {1034 if (!node) return false;1035 const nodeType = node.type;1036 if (nodeType === "ForOfStatement") {1037 if (typeof opts === "undefined") {1038 return true;1039 } else {1040 return (0, _shallowEqual.default)(node, opts);1041 }1042 }1043 return false;1044}1045function isImportDeclaration(node, opts) {1046 if (!node) return false;1047 const nodeType = node.type;1048 if (nodeType === "ImportDeclaration") {1049 if (typeof opts === "undefined") {1050 return true;1051 } else {1052 return (0, _shallowEqual.default)(node, opts);1053 }1054 }1055 return false;1056}1057function isImportDefaultSpecifier(node, opts) {1058 if (!node) return false;1059 const nodeType = node.type;1060 if (nodeType === "ImportDefaultSpecifier") {1061 if (typeof opts === "undefined") {1062 return true;1063 } else {1064 return (0, _shallowEqual.default)(node, opts);1065 }1066 }1067 return false;1068}1069function isImportNamespaceSpecifier(node, opts) {1070 if (!node) return false;1071 const nodeType = node.type;1072 if (nodeType === "ImportNamespaceSpecifier") {1073 if (typeof opts === "undefined") {1074 return true;1075 } else {1076 return (0, _shallowEqual.default)(node, opts);1077 }1078 }1079 return false;1080}1081function isImportSpecifier(node, opts) {1082 if (!node) return false;1083 const nodeType = node.type;1084 if (nodeType === "ImportSpecifier") {1085 if (typeof opts === "undefined") {1086 return true;1087 } else {1088 return (0, _shallowEqual.default)(node, opts);1089 }1090 }1091 return false;1092}1093function isMetaProperty(node, opts) {1094 if (!node) return false;1095 const nodeType = node.type;1096 if (nodeType === "MetaProperty") {1097 if (typeof opts === "undefined") {1098 return true;1099 } else {1100 return (0, _shallowEqual.default)(node, opts);1101 }1102 }1103 return false;1104}1105function isClassMethod(node, opts) {1106 if (!node) return false;1107 const nodeType = node.type;1108 if (nodeType === "ClassMethod") {1109 if (typeof opts === "undefined") {1110 return true;1111 } else {1112 return (0, _shallowEqual.default)(node, opts);1113 }1114 }1115 return false;1116}1117function isObjectPattern(node, opts) {1118 if (!node) return false;1119 const nodeType = node.type;1120 if (nodeType === "ObjectPattern") {1121 if (typeof opts === "undefined") {1122 return true;1123 } else {1124 return (0, _shallowEqual.default)(node, opts);1125 }1126 }1127 return false;1128}1129function isSpreadElement(node, opts) {1130 if (!node) return false;1131 const nodeType = node.type;1132 if (nodeType === "SpreadElement") {1133 if (typeof opts === "undefined") {1134 return true;1135 } else {1136 return (0, _shallowEqual.default)(node, opts);1137 }1138 }1139 return false;1140}1141function isSuper(node, opts) {1142 if (!node) return false;1143 const nodeType = node.type;1144 if (nodeType === "Super") {1145 if (typeof opts === "undefined") {1146 return true;1147 } else {1148 return (0, _shallowEqual.default)(node, opts);1149 }1150 }1151 return false;1152}1153function isTaggedTemplateExpression(node, opts) {1154 if (!node) return false;1155 const nodeType = node.type;1156 if (nodeType === "TaggedTemplateExpression") {1157 if (typeof opts === "undefined") {1158 return true;1159 } else {1160 return (0, _shallowEqual.default)(node, opts);1161 }1162 }1163 return false;1164}1165function isTemplateElement(node, opts) {1166 if (!node) return false;1167 const nodeType = node.type;1168 if (nodeType === "TemplateElement") {1169 if (typeof opts === "undefined") {1170 return true;1171 } else {1172 return (0, _shallowEqual.default)(node, opts);1173 }1174 }1175 return false;1176}1177function isTemplateLiteral(node, opts) {1178 if (!node) return false;1179 const nodeType = node.type;1180 if (nodeType === "TemplateLiteral") {1181 if (typeof opts === "undefined") {1182 return true;1183 } else {1184 return (0, _shallowEqual.default)(node, opts);1185 }1186 }1187 return false;1188}1189function isYieldExpression(node, opts) {1190 if (!node) return false;1191 const nodeType = node.type;1192 if (nodeType === "YieldExpression") {1193 if (typeof opts === "undefined") {1194 return true;1195 } else {1196 return (0, _shallowEqual.default)(node, opts);1197 }1198 }1199 return false;1200}1201function isAwaitExpression(node, opts) {1202 if (!node) return false;1203 const nodeType = node.type;1204 if (nodeType === "AwaitExpression") {1205 if (typeof opts === "undefined") {1206 return true;1207 } else {1208 return (0, _shallowEqual.default)(node, opts);1209 }1210 }1211 return false;1212}1213function isImport(node, opts) {1214 if (!node) return false;1215 const nodeType = node.type;1216 if (nodeType === "Import") {1217 if (typeof opts === "undefined") {1218 return true;1219 } else {1220 return (0, _shallowEqual.default)(node, opts);1221 }1222 }1223 return false;1224}1225function isBigIntLiteral(node, opts) {1226 if (!node) return false;1227 const nodeType = node.type;1228 if (nodeType === "BigIntLiteral") {1229 if (typeof opts === "undefined") {1230 return true;1231 } else {1232 return (0, _shallowEqual.default)(node, opts);1233 }1234 }1235 return false;1236}1237function isExportNamespaceSpecifier(node, opts) {1238 if (!node) return false;1239 const nodeType = node.type;1240 if (nodeType === "ExportNamespaceSpecifier") {1241 if (typeof opts === "undefined") {1242 return true;1243 } else {1244 return (0, _shallowEqual.default)(node, opts);1245 }1246 }1247 return false;1248}1249function isOptionalMemberExpression(node, opts) {1250 if (!node) return false;1251 const nodeType = node.type;1252 if (nodeType === "OptionalMemberExpression") {1253 if (typeof opts === "undefined") {1254 return true;1255 } else {1256 return (0, _shallowEqual.default)(node, opts);1257 }1258 }1259 return false;1260}1261function isOptionalCallExpression(node, opts) {1262 if (!node) return false;1263 const nodeType = node.type;1264 if (nodeType === "OptionalCallExpression") {1265 if (typeof opts === "undefined") {1266 return true;1267 } else {1268 return (0, _shallowEqual.default)(node, opts);1269 }1270 }1271 return false;1272}1273function isClassProperty(node, opts) {1274 if (!node) return false;1275 const nodeType = node.type;1276 if (nodeType === "ClassProperty") {1277 if (typeof opts === "undefined") {1278 return true;1279 } else {1280 return (0, _shallowEqual.default)(node, opts);1281 }1282 }1283 return false;1284}1285function isClassPrivateProperty(node, opts) {1286 if (!node) return false;1287 const nodeType = node.type;1288 if (nodeType === "ClassPrivateProperty") {1289 if (typeof opts === "undefined") {1290 return true;1291 } else {1292 return (0, _shallowEqual.default)(node, opts);1293 }1294 }1295 return false;1296}1297function isClassPrivateMethod(node, opts) {1298 if (!node) return false;1299 const nodeType = node.type;1300 if (nodeType === "ClassPrivateMethod") {1301 if (typeof opts === "undefined") {1302 return true;1303 } else {1304 return (0, _shallowEqual.default)(node, opts);1305 }1306 }1307 return false;1308}1309function isPrivateName(node, opts) {1310 if (!node) return false;1311 const nodeType = node.type;1312 if (nodeType === "PrivateName") {1313 if (typeof opts === "undefined") {1314 return true;1315 } else {1316 return (0, _shallowEqual.default)(node, opts);1317 }1318 }1319 return false;1320}1321function isAnyTypeAnnotation(node, opts) {1322 if (!node) return false;1323 const nodeType = node.type;1324 if (nodeType === "AnyTypeAnnotation") {1325 if (typeof opts === "undefined") {1326 return true;1327 } else {1328 return (0, _shallowEqual.default)(node, opts);1329 }1330 }1331 return false;1332}1333function isArrayTypeAnnotation(node, opts) {1334 if (!node) return false;1335 const nodeType = node.type;1336 if (nodeType === "ArrayTypeAnnotation") {1337 if (typeof opts === "undefined") {1338 return true;1339 } else {1340 return (0, _shallowEqual.default)(node, opts);1341 }1342 }1343 return false;1344}1345function isBooleanTypeAnnotation(node, opts) {1346 if (!node) return false;1347 const nodeType = node.type;1348 if (nodeType === "BooleanTypeAnnotation") {1349 if (typeof opts === "undefined") {1350 return true;1351 } else {1352 return (0, _shallowEqual.default)(node, opts);1353 }1354 }1355 return false;1356}1357function isBooleanLiteralTypeAnnotation(node, opts) {1358 if (!node) return false;1359 const nodeType = node.type;1360 if (nodeType === "BooleanLiteralTypeAnnotation") {1361 if (typeof opts === "undefined") {1362 return true;1363 } else {1364 return (0, _shallowEqual.default)(node, opts);1365 }1366 }1367 return false;1368}1369function isNullLiteralTypeAnnotation(node, opts) {1370 if (!node) return false;1371 const nodeType = node.type;1372 if (nodeType === "NullLiteralTypeAnnotation") {1373 if (typeof opts === "undefined") {1374 return true;1375 } else {1376 return (0, _shallowEqual.default)(node, opts);1377 }1378 }1379 return false;1380}1381function isClassImplements(node, opts) {1382 if (!node) return false;1383 const nodeType = node.type;1384 if (nodeType === "ClassImplements") {1385 if (typeof opts === "undefined") {1386 return true;1387 } else {1388 return (0, _shallowEqual.default)(node, opts);1389 }1390 }1391 return false;1392}1393function isDeclareClass(node, opts) {1394 if (!node) return false;1395 const nodeType = node.type;1396 if (nodeType === "DeclareClass") {1397 if (typeof opts === "undefined") {1398 return true;1399 } else {1400 return (0, _shallowEqual.default)(node, opts);1401 }1402 }1403 return false;1404}1405function isDeclareFunction(node, opts) {1406 if (!node) return false;1407 const nodeType = node.type;1408 if (nodeType === "DeclareFunction") {1409 if (typeof opts === "undefined") {1410 return true;1411 } else {1412 return (0, _shallowEqual.default)(node, opts);1413 }1414 }1415 return false;1416}1417function isDeclareInterface(node, opts) {1418 if (!node) return false;1419 const nodeType = node.type;1420 if (nodeType === "DeclareInterface") {1421 if (typeof opts === "undefined") {1422 return true;1423 } else {1424 return (0, _shallowEqual.default)(node, opts);1425 }1426 }1427 return false;1428}1429function isDeclareModule(node, opts) {1430 if (!node) return false;1431 const nodeType = node.type;1432 if (nodeType === "DeclareModule") {1433 if (typeof opts === "undefined") {1434 return true;1435 } else {1436 return (0, _shallowEqual.default)(node, opts);1437 }1438 }1439 return false;1440}1441function isDeclareModuleExports(node, opts) {1442 if (!node) return false;1443 const nodeType = node.type;1444 if (nodeType === "DeclareModuleExports") {1445 if (typeof opts === "undefined") {1446 return true;1447 } else {1448 return (0, _shallowEqual.default)(node, opts);1449 }1450 }1451 return false;1452}1453function isDeclareTypeAlias(node, opts) {1454 if (!node) return false;1455 const nodeType = node.type;1456 if (nodeType === "DeclareTypeAlias") {1457 if (typeof opts === "undefined") {1458 return true;1459 } else {1460 return (0, _shallowEqual.default)(node, opts);1461 }1462 }1463 return false;1464}1465function isDeclareOpaqueType(node, opts) {1466 if (!node) return false;1467 const nodeType = node.type;1468 if (nodeType === "DeclareOpaqueType") {1469 if (typeof opts === "undefined") {1470 return true;1471 } else {1472 return (0, _shallowEqual.default)(node, opts);1473 }1474 }1475 return false;1476}1477function isDeclareVariable(node, opts) {1478 if (!node) return false;1479 const nodeType = node.type;1480 if (nodeType === "DeclareVariable") {1481 if (typeof opts === "undefined") {1482 return true;1483 } else {1484 return (0, _shallowEqual.default)(node, opts);1485 }1486 }1487 return false;1488}1489function isDeclareExportDeclaration(node, opts) {1490 if (!node) return false;1491 const nodeType = node.type;1492 if (nodeType === "DeclareExportDeclaration") {1493 if (typeof opts === "undefined") {1494 return true;1495 } else {1496 return (0, _shallowEqual.default)(node, opts);1497 }1498 }1499 return false;1500}1501function isDeclareExportAllDeclaration(node, opts) {1502 if (!node) return false;1503 const nodeType = node.type;1504 if (nodeType === "DeclareExportAllDeclaration") {1505 if (typeof opts === "undefined") {1506 return true;1507 } else {1508 return (0, _shallowEqual.default)(node, opts);1509 }1510 }1511 return false;1512}1513function isDeclaredPredicate(node, opts) {1514 if (!node) return false;1515 const nodeType = node.type;1516 if (nodeType === "DeclaredPredicate") {1517 if (typeof opts === "undefined") {1518 return true;1519 } else {1520 return (0, _shallowEqual.default)(node, opts);1521 }1522 }1523 return false;1524}1525function isExistsTypeAnnotation(node, opts) {1526 if (!node) return false;1527 const nodeType = node.type;1528 if (nodeType === "ExistsTypeAnnotation") {1529 if (typeof opts === "undefined") {1530 return true;1531 } else {1532 return (0, _shallowEqual.default)(node, opts);1533 }1534 }1535 return false;1536}1537function isFunctionTypeAnnotation(node, opts) {1538 if (!node) return false;1539 const nodeType = node.type;1540 if (nodeType === "FunctionTypeAnnotation") {1541 if (typeof opts === "undefined") {1542 return true;1543 } else {1544 return (0, _shallowEqual.default)(node, opts);1545 }1546 }1547 return false;1548}1549function isFunctionTypeParam(node, opts) {1550 if (!node) return false;1551 const nodeType = node.type;1552 if (nodeType === "FunctionTypeParam") {1553 if (typeof opts === "undefined") {1554 return true;1555 } else {1556 return (0, _shallowEqual.default)(node, opts);1557 }1558 }1559 return false;1560}1561function isGenericTypeAnnotation(node, opts) {1562 if (!node) return false;1563 const nodeType = node.type;1564 if (nodeType === "GenericTypeAnnotation") {1565 if (typeof opts === "undefined") {1566 return true;1567 } else {1568 return (0, _shallowEqual.default)(node, opts);1569 }1570 }1571 return false;1572}1573function isInferredPredicate(node, opts) {1574 if (!node) return false;1575 const nodeType = node.type;1576 if (nodeType === "InferredPredicate") {1577 if (typeof opts === "undefined") {1578 return true;1579 } else {1580 return (0, _shallowEqual.default)(node, opts);1581 }1582 }1583 return false;1584}1585function isInterfaceExtends(node, opts) {1586 if (!node) return false;1587 const nodeType = node.type;1588 if (nodeType === "InterfaceExtends") {1589 if (typeof opts === "undefined") {1590 return true;1591 } else {1592 return (0, _shallowEqual.default)(node, opts);1593 }1594 }1595 return false;1596}1597function isInterfaceDeclaration(node, opts) {1598 if (!node) return false;1599 const nodeType = node.type;1600 if (nodeType === "InterfaceDeclaration") {1601 if (typeof opts === "undefined") {1602 return true;1603 } else {1604 return (0, _shallowEqual.default)(node, opts);1605 }1606 }1607 return false;1608}1609function isInterfaceTypeAnnotation(node, opts) {1610 if (!node) return false;1611 const nodeType = node.type;1612 if (nodeType === "InterfaceTypeAnnotation") {1613 if (typeof opts === "undefined") {1614 return true;1615 } else {1616 return (0, _shallowEqual.default)(node, opts);1617 }1618 }1619 return false;1620}1621function isIntersectionTypeAnnotation(node, opts) {1622 if (!node) return false;1623 const nodeType = node.type;1624 if (nodeType === "IntersectionTypeAnnotation") {1625 if (typeof opts === "undefined") {1626 return true;1627 } else {1628 return (0, _shallowEqual.default)(node, opts);1629 }1630 }1631 return false;1632}1633function isMixedTypeAnnotation(node, opts) {1634 if (!node) return false;1635 const nodeType = node.type;1636 if (nodeType === "MixedTypeAnnotation") {1637 if (typeof opts === "undefined") {1638 return true;1639 } else {1640 return (0, _shallowEqual.default)(node, opts);1641 }1642 }1643 return false;1644}1645function isEmptyTypeAnnotation(node, opts) {1646 if (!node) return false;1647 const nodeType = node.type;1648 if (nodeType === "EmptyTypeAnnotation") {1649 if (typeof opts === "undefined") {1650 return true;1651 } else {1652 return (0, _shallowEqual.default)(node, opts);1653 }1654 }1655 return false;1656}1657function isNullableTypeAnnotation(node, opts) {1658 if (!node) return false;1659 const nodeType = node.type;1660 if (nodeType === "NullableTypeAnnotation") {1661 if (typeof opts === "undefined") {1662 return true;1663 } else {1664 return (0, _shallowEqual.default)(node, opts);1665 }1666 }1667 return false;1668}1669function isNumberLiteralTypeAnnotation(node, opts) {1670 if (!node) return false;1671 const nodeType = node.type;1672 if (nodeType === "NumberLiteralTypeAnnotation") {1673 if (typeof opts === "undefined") {1674 return true;1675 } else {1676 return (0, _shallowEqual.default)(node, opts);1677 }1678 }1679 return false;1680}1681function isNumberTypeAnnotation(node, opts) {1682 if (!node) return false;1683 const nodeType = node.type;1684 if (nodeType === "NumberTypeAnnotation") {1685 if (typeof opts === "undefined") {1686 return true;1687 } else {1688 return (0, _shallowEqual.default)(node, opts);1689 }1690 }1691 return false;1692}1693function isObjectTypeAnnotation(node, opts) {1694 if (!node) return false;1695 const nodeType = node.type;1696 if (nodeType === "ObjectTypeAnnotation") {1697 if (typeof opts === "undefined") {1698 return true;1699 } else {1700 return (0, _shallowEqual.default)(node, opts);1701 }1702 }1703 return false;1704}1705function isObjectTypeInternalSlot(node, opts) {1706 if (!node) return false;1707 const nodeType = node.type;1708 if (nodeType === "ObjectTypeInternalSlot") {1709 if (typeof opts === "undefined") {1710 return true;1711 } else {1712 return (0, _shallowEqual.default)(node, opts);1713 }1714 }1715 return false;1716}1717function isObjectTypeCallProperty(node, opts) {1718 if (!node) return false;1719 const nodeType = node.type;1720 if (nodeType === "ObjectTypeCallProperty") {1721 if (typeof opts === "undefined") {1722 return true;1723 } else {1724 return (0, _shallowEqual.default)(node, opts);1725 }1726 }1727 return false;1728}1729function isObjectTypeIndexer(node, opts) {1730 if (!node) return false;1731 const nodeType = node.type;1732 if (nodeType === "ObjectTypeIndexer") {1733 if (typeof opts === "undefined") {1734 return true;1735 } else {1736 return (0, _shallowEqual.default)(node, opts);1737 }1738 }1739 return false;1740}1741function isObjectTypeProperty(node, opts) {1742 if (!node) return false;1743 const nodeType = node.type;1744 if (nodeType === "ObjectTypeProperty") {1745 if (typeof opts === "undefined") {1746 return true;1747 } else {1748 return (0, _shallowEqual.default)(node, opts);1749 }1750 }1751 return false;1752}1753function isObjectTypeSpreadProperty(node, opts) {1754 if (!node) return false;1755 const nodeType = node.type;1756 if (nodeType === "ObjectTypeSpreadProperty") {1757 if (typeof opts === "undefined") {1758 return true;1759 } else {1760 return (0, _shallowEqual.default)(node, opts);1761 }1762 }1763 return false;1764}1765function isOpaqueType(node, opts) {1766 if (!node) return false;1767 const nodeType = node.type;1768 if (nodeType === "OpaqueType") {1769 if (typeof opts === "undefined") {1770 return true;1771 } else {1772 return (0, _shallowEqual.default)(node, opts);1773 }1774 }1775 return false;1776}1777function isQualifiedTypeIdentifier(node, opts) {1778 if (!node) return false;1779 const nodeType = node.type;1780 if (nodeType === "QualifiedTypeIdentifier") {1781 if (typeof opts === "undefined") {1782 return true;1783 } else {1784 return (0, _shallowEqual.default)(node, opts);1785 }1786 }1787 return false;1788}1789function isStringLiteralTypeAnnotation(node, opts) {1790 if (!node) return false;1791 const nodeType = node.type;1792 if (nodeType === "StringLiteralTypeAnnotation") {1793 if (typeof opts === "undefined") {1794 return true;1795 } else {1796 return (0, _shallowEqual.default)(node, opts);1797 }1798 }1799 return false;1800}1801function isStringTypeAnnotation(node, opts) {1802 if (!node) return false;1803 const nodeType = node.type;1804 if (nodeType === "StringTypeAnnotation") {1805 if (typeof opts === "undefined") {1806 return true;1807 } else {1808 return (0, _shallowEqual.default)(node, opts);1809 }1810 }1811 return false;1812}1813function isSymbolTypeAnnotation(node, opts) {1814 if (!node) return false;1815 const nodeType = node.type;1816 if (nodeType === "SymbolTypeAnnotation") {1817 if (typeof opts === "undefined") {1818 return true;1819 } else {1820 return (0, _shallowEqual.default)(node, opts);1821 }1822 }1823 return false;1824}1825function isThisTypeAnnotation(node, opts) {1826 if (!node) return false;1827 const nodeType = node.type;1828 if (nodeType === "ThisTypeAnnotation") {1829 if (typeof opts === "undefined") {1830 return true;1831 } else {1832 return (0, _shallowEqual.default)(node, opts);1833 }1834 }1835 return false;1836}1837function isTupleTypeAnnotation(node, opts) {1838 if (!node) return false;1839 const nodeType = node.type;1840 if (nodeType === "TupleTypeAnnotation") {1841 if (typeof opts === "undefined") {1842 return true;1843 } else {1844 return (0, _shallowEqual.default)(node, opts);1845 }1846 }1847 return false;1848}1849function isTypeofTypeAnnotation(node, opts) {1850 if (!node) return false;1851 const nodeType = node.type;1852 if (nodeType === "TypeofTypeAnnotation") {1853 if (typeof opts === "undefined") {1854 return true;1855 } else {1856 return (0, _shallowEqual.default)(node, opts);1857 }1858 }1859 return false;1860}1861function isTypeAlias(node, opts) {1862 if (!node) return false;1863 const nodeType = node.type;1864 if (nodeType === "TypeAlias") {1865 if (typeof opts === "undefined") {1866 return true;1867 } else {1868 return (0, _shallowEqual.default)(node, opts);1869 }1870 }1871 return false;1872}1873function isTypeAnnotation(node, opts) {1874 if (!node) return false;1875 const nodeType = node.type;1876 if (nodeType === "TypeAnnotation") {1877 if (typeof opts === "undefined") {1878 return true;1879 } else {1880 return (0, _shallowEqual.default)(node, opts);1881 }1882 }1883 return false;1884}1885function isTypeCastExpression(node, opts) {1886 if (!node) return false;1887 const nodeType = node.type;1888 if (nodeType === "TypeCastExpression") {1889 if (typeof opts === "undefined") {1890 return true;1891 } else {1892 return (0, _shallowEqual.default)(node, opts);1893 }1894 }1895 return false;1896}1897function isTypeParameter(node, opts) {1898 if (!node) return false;1899 const nodeType = node.type;1900 if (nodeType === "TypeParameter") {1901 if (typeof opts === "undefined") {1902 return true;1903 } else {1904 return (0, _shallowEqual.default)(node, opts);1905 }1906 }1907 return false;1908}1909function isTypeParameterDeclaration(node, opts) {1910 if (!node) return false;1911 const nodeType = node.type;1912 if (nodeType === "TypeParameterDeclaration") {1913 if (typeof opts === "undefined") {1914 return true;1915 } else {1916 return (0, _shallowEqual.default)(node, opts);1917 }1918 }1919 return false;1920}1921function isTypeParameterInstantiation(node, opts) {1922 if (!node) return false;1923 const nodeType = node.type;1924 if (nodeType === "TypeParameterInstantiation") {1925 if (typeof opts === "undefined") {1926 return true;1927 } else {1928 return (0, _shallowEqual.default)(node, opts);1929 }1930 }1931 return false;1932}1933function isUnionTypeAnnotation(node, opts) {1934 if (!node) return false;1935 const nodeType = node.type;1936 if (nodeType === "UnionTypeAnnotation") {1937 if (typeof opts === "undefined") {1938 return true;1939 } else {1940 return (0, _shallowEqual.default)(node, opts);1941 }1942 }1943 return false;1944}1945function isVariance(node, opts) {1946 if (!node) return false;1947 const nodeType = node.type;1948 if (nodeType === "Variance") {1949 if (typeof opts === "undefined") {1950 return true;1951 } else {1952 return (0, _shallowEqual.default)(node, opts);1953 }1954 }1955 return false;1956}1957function isVoidTypeAnnotation(node, opts) {1958 if (!node) return false;1959 const nodeType = node.type;1960 if (nodeType === "VoidTypeAnnotation") {1961 if (typeof opts === "undefined") {1962 return true;1963 } else {1964 return (0, _shallowEqual.default)(node, opts);1965 }1966 }1967 return false;1968}1969function isEnumDeclaration(node, opts) {1970 if (!node) return false;1971 const nodeType = node.type;1972 if (nodeType === "EnumDeclaration") {1973 if (typeof opts === "undefined") {1974 return true;1975 } else {1976 return (0, _shallowEqual.default)(node, opts);1977 }1978 }1979 return false;1980}1981function isEnumBooleanBody(node, opts) {1982 if (!node) return false;1983 const nodeType = node.type;1984 if (nodeType === "EnumBooleanBody") {1985 if (typeof opts === "undefined") {1986 return true;1987 } else {1988 return (0, _shallowEqual.default)(node, opts);1989 }1990 }1991 return false;1992}1993function isEnumNumberBody(node, opts) {1994 if (!node) return false;1995 const nodeType = node.type;1996 if (nodeType === "EnumNumberBody") {1997 if (typeof opts === "undefined") {1998 return true;1999 } else {2000 return (0, _shallowEqual.default)(node, opts);2001 }2002 }2003 return false;2004}2005function isEnumStringBody(node, opts) {2006 if (!node) return false;2007 const nodeType = node.type;2008 if (nodeType === "EnumStringBody") {2009 if (typeof opts === "undefined") {2010 return true;2011 } else {2012 return (0, _shallowEqual.default)(node, opts);2013 }2014 }2015 return false;2016}2017function isEnumSymbolBody(node, opts) {2018 if (!node) return false;2019 const nodeType = node.type;2020 if (nodeType === "EnumSymbolBody") {2021 if (typeof opts === "undefined") {2022 return true;2023 } else {2024 return (0, _shallowEqual.default)(node, opts);2025 }2026 }2027 return false;2028}2029function isEnumBooleanMember(node, opts) {2030 if (!node) return false;2031 const nodeType = node.type;2032 if (nodeType === "EnumBooleanMember") {2033 if (typeof opts === "undefined") {2034 return true;2035 } else {2036 return (0, _shallowEqual.default)(node, opts);2037 }2038 }2039 return false;2040}2041function isEnumNumberMember(node, opts) {2042 if (!node) return false;2043 const nodeType = node.type;2044 if (nodeType === "EnumNumberMember") {2045 if (typeof opts === "undefined") {2046 return true;2047 } else {2048 return (0, _shallowEqual.default)(node, opts);2049 }2050 }2051 return false;2052}2053function isEnumStringMember(node, opts) {2054 if (!node) return false;2055 const nodeType = node.type;2056 if (nodeType === "EnumStringMember") {2057 if (typeof opts === "undefined") {2058 return true;2059 } else {2060 return (0, _shallowEqual.default)(node, opts);2061 }2062 }2063 return false;2064}2065function isEnumDefaultedMember(node, opts) {2066 if (!node) return false;2067 const nodeType = node.type;2068 if (nodeType === "EnumDefaultedMember") {2069 if (typeof opts === "undefined") {2070 return true;2071 } else {2072 return (0, _shallowEqual.default)(node, opts);2073 }2074 }2075 return false;2076}2077function isIndexedAccessType(node, opts) {2078 if (!node) return false;2079 const nodeType = node.type;2080 if (nodeType === "IndexedAccessType") {2081 if (typeof opts === "undefined") {2082 return true;2083 } else {2084 return (0, _shallowEqual.default)(node, opts);2085 }2086 }2087 return false;2088}2089function isOptionalIndexedAccessType(node, opts) {2090 if (!node) return false;2091 const nodeType = node.type;2092 if (nodeType === "OptionalIndexedAccessType") {2093 if (typeof opts === "undefined") {2094 return true;2095 } else {2096 return (0, _shallowEqual.default)(node, opts);2097 }2098 }2099 return false;2100}2101function isJSXAttribute(node, opts) {2102 if (!node) return false;2103 const nodeType = node.type;2104 if (nodeType === "JSXAttribute") {2105 if (typeof opts === "undefined") {2106 return true;2107 } else {2108 return (0, _shallowEqual.default)(node, opts);2109 }2110 }2111 return false;2112}2113function isJSXClosingElement(node, opts) {2114 if (!node) return false;2115 const nodeType = node.type;2116 if (nodeType === "JSXClosingElement") {2117 if (typeof opts === "undefined") {2118 return true;2119 } else {2120 return (0, _shallowEqual.default)(node, opts);2121 }2122 }2123 return false;2124}2125function isJSXElement(node, opts) {2126 if (!node) return false;2127 const nodeType = node.type;2128 if (nodeType === "JSXElement") {2129 if (typeof opts === "undefined") {2130 return true;2131 } else {2132 return (0, _shallowEqual.default)(node, opts);2133 }2134 }2135 return false;2136}2137function isJSXEmptyExpression(node, opts) {2138 if (!node) return false;2139 const nodeType = node.type;2140 if (nodeType === "JSXEmptyExpression") {2141 if (typeof opts === "undefined") {2142 return true;2143 } else {2144 return (0, _shallowEqual.default)(node, opts);2145 }2146 }2147 return false;2148}2149function isJSXExpressionContainer(node, opts) {2150 if (!node) return false;2151 const nodeType = node.type;2152 if (nodeType === "JSXExpressionContainer") {2153 if (typeof opts === "undefined") {2154 return true;2155 } else {2156 return (0, _shallowEqual.default)(node, opts);2157 }2158 }2159 return false;2160}2161function isJSXSpreadChild(node, opts) {2162 if (!node) return false;2163 const nodeType = node.type;2164 if (nodeType === "JSXSpreadChild") {2165 if (typeof opts === "undefined") {2166 return true;2167 } else {2168 return (0, _shallowEqual.default)(node, opts);2169 }2170 }2171 return false;2172}2173function isJSXIdentifier(node, opts) {2174 if (!node) return false;2175 const nodeType = node.type;2176 if (nodeType === "JSXIdentifier") {2177 if (typeof opts === "undefined") {2178 return true;2179 } else {2180 return (0, _shallowEqual.default)(node, opts);2181 }2182 }2183 return false;2184}2185function isJSXMemberExpression(node, opts) {2186 if (!node) return false;2187 const nodeType = node.type;2188 if (nodeType === "JSXMemberExpression") {2189 if (typeof opts === "undefined") {2190 return true;2191 } else {2192 return (0, _shallowEqual.default)(node, opts);2193 }2194 }2195 return false;2196}2197function isJSXNamespacedName(node, opts) {2198 if (!node) return false;2199 const nodeType = node.type;2200 if (nodeType === "JSXNamespacedName") {2201 if (typeof opts === "undefined") {2202 return true;2203 } else {2204 return (0, _shallowEqual.default)(node, opts);2205 }2206 }2207 return false;2208}2209function isJSXOpeningElement(node, opts) {2210 if (!node) return false;2211 const nodeType = node.type;2212 if (nodeType === "JSXOpeningElement") {2213 if (typeof opts === "undefined") {2214 return true;2215 } else {2216 return (0, _shallowEqual.default)(node, opts);2217 }2218 }2219 return false;2220}2221function isJSXSpreadAttribute(node, opts) {2222 if (!node) return false;2223 const nodeType = node.type;2224 if (nodeType === "JSXSpreadAttribute") {2225 if (typeof opts === "undefined") {2226 return true;2227 } else {2228 return (0, _shallowEqual.default)(node, opts);2229 }2230 }2231 return false;2232}2233function isJSXText(node, opts) {2234 if (!node) return false;2235 const nodeType = node.type;2236 if (nodeType === "JSXText") {2237 if (typeof opts === "undefined") {2238 return true;2239 } else {2240 return (0, _shallowEqual.default)(node, opts);2241 }2242 }2243 return false;2244}2245function isJSXFragment(node, opts) {2246 if (!node) return false;2247 const nodeType = node.type;2248 if (nodeType === "JSXFragment") {2249 if (typeof opts === "undefined") {2250 return true;2251 } else {2252 return (0, _shallowEqual.default)(node, opts);2253 }2254 }2255 return false;2256}2257function isJSXOpeningFragment(node, opts) {2258 if (!node) return false;2259 const nodeType = node.type;2260 if (nodeType === "JSXOpeningFragment") {2261 if (typeof opts === "undefined") {2262 return true;2263 } else {2264 return (0, _shallowEqual.default)(node, opts);2265 }2266 }2267 return false;2268}2269function isJSXClosingFragment(node, opts) {2270 if (!node) return false;2271 const nodeType = node.type;2272 if (nodeType === "JSXClosingFragment") {2273 if (typeof opts === "undefined") {2274 return true;2275 } else {2276 return (0, _shallowEqual.default)(node, opts);2277 }2278 }2279 return false;2280}2281function isNoop(node, opts) {2282 if (!node) return false;2283 const nodeType = node.type;2284 if (nodeType === "Noop") {2285 if (typeof opts === "undefined") {2286 return true;2287 } else {2288 return (0, _shallowEqual.default)(node, opts);2289 }2290 }2291 return false;2292}2293function isPlaceholder(node, opts) {2294 if (!node) return false;2295 const nodeType = node.type;2296 if (nodeType === "Placeholder") {2297 if (typeof opts === "undefined") {2298 return true;2299 } else {2300 return (0, _shallowEqual.default)(node, opts);2301 }2302 }2303 return false;2304}2305function isV8IntrinsicIdentifier(node, opts) {2306 if (!node) return false;2307 const nodeType = node.type;2308 if (nodeType === "V8IntrinsicIdentifier") {2309 if (typeof opts === "undefined") {2310 return true;2311 } else {2312 return (0, _shallowEqual.default)(node, opts);2313 }2314 }2315 return false;2316}2317function isArgumentPlaceholder(node, opts) {2318 if (!node) return false;2319 const nodeType = node.type;2320 if (nodeType === "ArgumentPlaceholder") {2321 if (typeof opts === "undefined") {2322 return true;2323 } else {2324 return (0, _shallowEqual.default)(node, opts);2325 }2326 }2327 return false;2328}2329function isBindExpression(node, opts) {2330 if (!node) return false;2331 const nodeType = node.type;2332 if (nodeType === "BindExpression") {2333 if (typeof opts === "undefined") {2334 return true;2335 } else {2336 return (0, _shallowEqual.default)(node, opts);2337 }2338 }2339 return false;2340}2341function isImportAttribute(node, opts) {2342 if (!node) return false;2343 const nodeType = node.type;2344 if (nodeType === "ImportAttribute") {2345 if (typeof opts === "undefined") {2346 return true;2347 } else {2348 return (0, _shallowEqual.default)(node, opts);2349 }2350 }2351 return false;2352}2353function isDecorator(node, opts) {2354 if (!node) return false;2355 const nodeType = node.type;2356 if (nodeType === "Decorator") {2357 if (typeof opts === "undefined") {2358 return true;2359 } else {2360 return (0, _shallowEqual.default)(node, opts);2361 }2362 }2363 return false;2364}2365function isDoExpression(node, opts) {2366 if (!node) return false;2367 const nodeType = node.type;2368 if (nodeType === "DoExpression") {2369 if (typeof opts === "undefined") {2370 return true;2371 } else {2372 return (0, _shallowEqual.default)(node, opts);2373 }2374 }2375 return false;2376}2377function isExportDefaultSpecifier(node, opts) {2378 if (!node) return false;2379 const nodeType = node.type;2380 if (nodeType === "ExportDefaultSpecifier") {2381 if (typeof opts === "undefined") {2382 return true;2383 } else {2384 return (0, _shallowEqual.default)(node, opts);2385 }2386 }2387 return false;2388}2389function isRecordExpression(node, opts) {2390 if (!node) return false;2391 const nodeType = node.type;2392 if (nodeType === "RecordExpression") {2393 if (typeof opts === "undefined") {2394 return true;2395 } else {2396 return (0, _shallowEqual.default)(node, opts);2397 }2398 }2399 return false;2400}2401function isTupleExpression(node, opts) {2402 if (!node) return false;2403 const nodeType = node.type;2404 if (nodeType === "TupleExpression") {2405 if (typeof opts === "undefined") {2406 return true;2407 } else {2408 return (0, _shallowEqual.default)(node, opts);2409 }2410 }2411 return false;2412}2413function isDecimalLiteral(node, opts) {2414 if (!node) return false;2415 const nodeType = node.type;2416 if (nodeType === "DecimalLiteral") {2417 if (typeof opts === "undefined") {2418 return true;2419 } else {2420 return (0, _shallowEqual.default)(node, opts);2421 }2422 }2423 return false;2424}2425function isStaticBlock(node, opts) {2426 if (!node) return false;2427 const nodeType = node.type;2428 if (nodeType === "StaticBlock") {2429 if (typeof opts === "undefined") {2430 return true;2431 } else {2432 return (0, _shallowEqual.default)(node, opts);2433 }2434 }2435 return false;2436}2437function isModuleExpression(node, opts) {2438 if (!node) return false;2439 const nodeType = node.type;2440 if (nodeType === "ModuleExpression") {2441 if (typeof opts === "undefined") {2442 return true;2443 } else {2444 return (0, _shallowEqual.default)(node, opts);2445 }2446 }2447 return false;2448}2449function isTopicReference(node, opts) {2450 if (!node) return false;2451 const nodeType = node.type;2452 if (nodeType === "TopicReference") {2453 if (typeof opts === "undefined") {2454 return true;2455 } else {2456 return (0, _shallowEqual.default)(node, opts);2457 }2458 }2459 return false;2460}2461function isPipelineTopicExpression(node, opts) {2462 if (!node) return false;2463 const nodeType = node.type;2464 if (nodeType === "PipelineTopicExpression") {2465 if (typeof opts === "undefined") {2466 return true;2467 } else {2468 return (0, _shallowEqual.default)(node, opts);2469 }2470 }2471 return false;2472}2473function isPipelineBareFunction(node, opts) {2474 if (!node) return false;2475 const nodeType = node.type;2476 if (nodeType === "PipelineBareFunction") {2477 if (typeof opts === "undefined") {2478 return true;2479 } else {2480 return (0, _shallowEqual.default)(node, opts);2481 }2482 }2483 return false;2484}2485function isPipelinePrimaryTopicReference(node, opts) {2486 if (!node) return false;2487 const nodeType = node.type;2488 if (nodeType === "PipelinePrimaryTopicReference") {2489 if (typeof opts === "undefined") {2490 return true;2491 } else {2492 return (0, _shallowEqual.default)(node, opts);2493 }2494 }2495 return false;2496}2497function isTSParameterProperty(node, opts) {2498 if (!node) return false;2499 const nodeType = node.type;2500 if (nodeType === "TSParameterProperty") {2501 if (typeof opts === "undefined") {2502 return true;2503 } else {2504 return (0, _shallowEqual.default)(node, opts);2505 }2506 }2507 return false;2508}2509function isTSDeclareFunction(node, opts) {2510 if (!node) return false;2511 const nodeType = node.type;2512 if (nodeType === "TSDeclareFunction") {2513 if (typeof opts === "undefined") {2514 return true;2515 } else {2516 return (0, _shallowEqual.default)(node, opts);2517 }2518 }2519 return false;2520}2521function isTSDeclareMethod(node, opts) {2522 if (!node) return false;2523 const nodeType = node.type;2524 if (nodeType === "TSDeclareMethod") {2525 if (typeof opts === "undefined") {2526 return true;2527 } else {2528 return (0, _shallowEqual.default)(node, opts);2529 }2530 }2531 return false;2532}2533function isTSQualifiedName(node, opts) {2534 if (!node) return false;2535 const nodeType = node.type;2536 if (nodeType === "TSQualifiedName") {2537 if (typeof opts === "undefined") {2538 return true;2539 } else {2540 return (0, _shallowEqual.default)(node, opts);2541 }2542 }2543 return false;2544}2545function isTSCallSignatureDeclaration(node, opts) {2546 if (!node) return false;2547 const nodeType = node.type;2548 if (nodeType === "TSCallSignatureDeclaration") {2549 if (typeof opts === "undefined") {2550 return true;2551 } else {2552 return (0, _shallowEqual.default)(node, opts);2553 }2554 }2555 return false;2556}2557function isTSConstructSignatureDeclaration(node, opts) {2558 if (!node) return false;2559 const nodeType = node.type;2560 if (nodeType === "TSConstructSignatureDeclaration") {2561 if (typeof opts === "undefined") {2562 return true;2563 } else {2564 return (0, _shallowEqual.default)(node, opts);2565 }2566 }2567 return false;2568}2569function isTSPropertySignature(node, opts) {2570 if (!node) return false;2571 const nodeType = node.type;2572 if (nodeType === "TSPropertySignature") {2573 if (typeof opts === "undefined") {2574 return true;2575 } else {2576 return (0, _shallowEqual.default)(node, opts);2577 }2578 }2579 return false;2580}2581function isTSMethodSignature(node, opts) {2582 if (!node) return false;2583 const nodeType = node.type;2584 if (nodeType === "TSMethodSignature") {2585 if (typeof opts === "undefined") {2586 return true;2587 } else {2588 return (0, _shallowEqual.default)(node, opts);2589 }2590 }2591 return false;2592}2593function isTSIndexSignature(node, opts) {2594 if (!node) return false;2595 const nodeType = node.type;2596 if (nodeType === "TSIndexSignature") {2597 if (typeof opts === "undefined") {2598 return true;2599 } else {2600 return (0, _shallowEqual.default)(node, opts);2601 }2602 }2603 return false;2604}2605function isTSAnyKeyword(node, opts) {2606 if (!node) return false;2607 const nodeType = node.type;2608 if (nodeType === "TSAnyKeyword") {2609 if (typeof opts === "undefined") {2610 return true;2611 } else {2612 return (0, _shallowEqual.default)(node, opts);2613 }2614 }2615 return false;2616}2617function isTSBooleanKeyword(node, opts) {2618 if (!node) return false;2619 const nodeType = node.type;2620 if (nodeType === "TSBooleanKeyword") {2621 if (typeof opts === "undefined") {2622 return true;2623 } else {2624 return (0, _shallowEqual.default)(node, opts);2625 }2626 }2627 return false;2628}2629function isTSBigIntKeyword(node, opts) {2630 if (!node) return false;2631 const nodeType = node.type;2632 if (nodeType === "TSBigIntKeyword") {2633 if (typeof opts === "undefined") {2634 return true;2635 } else {2636 return (0, _shallowEqual.default)(node, opts);2637 }2638 }2639 return false;2640}2641function isTSIntrinsicKeyword(node, opts) {2642 if (!node) return false;2643 const nodeType = node.type;2644 if (nodeType === "TSIntrinsicKeyword") {2645 if (typeof opts === "undefined") {2646 return true;2647 } else {2648 return (0, _shallowEqual.default)(node, opts);2649 }2650 }2651 return false;2652}2653function isTSNeverKeyword(node, opts) {2654 if (!node) return false;2655 const nodeType = node.type;2656 if (nodeType === "TSNeverKeyword") {2657 if (typeof opts === "undefined") {2658 return true;2659 } else {2660 return (0, _shallowEqual.default)(node, opts);2661 }2662 }2663 return false;2664}2665function isTSNullKeyword(node, opts) {2666 if (!node) return false;2667 const nodeType = node.type;2668 if (nodeType === "TSNullKeyword") {2669 if (typeof opts === "undefined") {2670 return true;2671 } else {2672 return (0, _shallowEqual.default)(node, opts);2673 }2674 }2675 return false;2676}2677function isTSNumberKeyword(node, opts) {2678 if (!node) return false;2679 const nodeType = node.type;2680 if (nodeType === "TSNumberKeyword") {2681 if (typeof opts === "undefined") {2682 return true;2683 } else {2684 return (0, _shallowEqual.default)(node, opts);2685 }2686 }2687 return false;2688}2689function isTSObjectKeyword(node, opts) {2690 if (!node) return false;2691 const nodeType = node.type;2692 if (nodeType === "TSObjectKeyword") {2693 if (typeof opts === "undefined") {2694 return true;2695 } else {2696 return (0, _shallowEqual.default)(node, opts);2697 }2698 }2699 return false;2700}2701function isTSStringKeyword(node, opts) {2702 if (!node) return false;2703 const nodeType = node.type;2704 if (nodeType === "TSStringKeyword") {2705 if (typeof opts === "undefined") {2706 return true;2707 } else {2708 return (0, _shallowEqual.default)(node, opts);2709 }2710 }2711 return false;2712}2713function isTSSymbolKeyword(node, opts) {2714 if (!node) return false;2715 const nodeType = node.type;2716 if (nodeType === "TSSymbolKeyword") {2717 if (typeof opts === "undefined") {2718 return true;2719 } else {2720 return (0, _shallowEqual.default)(node, opts);2721 }2722 }2723 return false;2724}2725function isTSUndefinedKeyword(node, opts) {2726 if (!node) return false;2727 const nodeType = node.type;2728 if (nodeType === "TSUndefinedKeyword") {2729 if (typeof opts === "undefined") {2730 return true;2731 } else {2732 return (0, _shallowEqual.default)(node, opts);2733 }2734 }2735 return false;2736}2737function isTSUnknownKeyword(node, opts) {2738 if (!node) return false;2739 const nodeType = node.type;2740 if (nodeType === "TSUnknownKeyword") {2741 if (typeof opts === "undefined") {2742 return true;2743 } else {2744 return (0, _shallowEqual.default)(node, opts);2745 }2746 }2747 return false;2748}2749function isTSVoidKeyword(node, opts) {2750 if (!node) return false;2751 const nodeType = node.type;2752 if (nodeType === "TSVoidKeyword") {2753 if (typeof opts === "undefined") {2754 return true;2755 } else {2756 return (0, _shallowEqual.default)(node, opts);2757 }2758 }2759 return false;2760}2761function isTSThisType(node, opts) {2762 if (!node) return false;2763 const nodeType = node.type;2764 if (nodeType === "TSThisType") {2765 if (typeof opts === "undefined") {2766 return true;2767 } else {2768 return (0, _shallowEqual.default)(node, opts);2769 }2770 }2771 return false;2772}2773function isTSFunctionType(node, opts) {2774 if (!node) return false;2775 const nodeType = node.type;2776 if (nodeType === "TSFunctionType") {2777 if (typeof opts === "undefined") {2778 return true;2779 } else {2780 return (0, _shallowEqual.default)(node, opts);2781 }2782 }2783 return false;2784}2785function isTSConstructorType(node, opts) {2786 if (!node) return false;2787 const nodeType = node.type;2788 if (nodeType === "TSConstructorType") {2789 if (typeof opts === "undefined") {2790 return true;2791 } else {2792 return (0, _shallowEqual.default)(node, opts);2793 }2794 }2795 return false;2796}2797function isTSTypeReference(node, opts) {2798 if (!node) return false;2799 const nodeType = node.type;2800 if (nodeType === "TSTypeReference") {2801 if (typeof opts === "undefined") {2802 return true;2803 } else {2804 return (0, _shallowEqual.default)(node, opts);2805 }2806 }2807 return false;2808}2809function isTSTypePredicate(node, opts) {2810 if (!node) return false;2811 const nodeType = node.type;2812 if (nodeType === "TSTypePredicate") {2813 if (typeof opts === "undefined") {2814 return true;2815 } else {2816 return (0, _shallowEqual.default)(node, opts);2817 }2818 }2819 return false;2820}2821function isTSTypeQuery(node, opts) {2822 if (!node) return false;2823 const nodeType = node.type;2824 if (nodeType === "TSTypeQuery") {2825 if (typeof opts === "undefined") {2826 return true;2827 } else {2828 return (0, _shallowEqual.default)(node, opts);2829 }2830 }2831 return false;2832}2833function isTSTypeLiteral(node, opts) {2834 if (!node) return false;2835 const nodeType = node.type;2836 if (nodeType === "TSTypeLiteral") {2837 if (typeof opts === "undefined") {2838 return true;2839 } else {2840 return (0, _shallowEqual.default)(node, opts);2841 }2842 }2843 return false;2844}2845function isTSArrayType(node, opts) {2846 if (!node) return false;2847 const nodeType = node.type;2848 if (nodeType === "TSArrayType") {2849 if (typeof opts === "undefined") {2850 return true;2851 } else {2852 return (0, _shallowEqual.default)(node, opts);2853 }2854 }2855 return false;2856}2857function isTSTupleType(node, opts) {2858 if (!node) return false;2859 const nodeType = node.type;2860 if (nodeType === "TSTupleType") {2861 if (typeof opts === "undefined") {2862 return true;2863 } else {2864 return (0, _shallowEqual.default)(node, opts);2865 }2866 }2867 return false;2868}2869function isTSOptionalType(node, opts) {2870 if (!node) return false;2871 const nodeType = node.type;2872 if (nodeType === "TSOptionalType") {2873 if (typeof opts === "undefined") {2874 return true;2875 } else {2876 return (0, _shallowEqual.default)(node, opts);2877 }2878 }2879 return false;2880}2881function isTSRestType(node, opts) {2882 if (!node) return false;2883 const nodeType = node.type;2884 if (nodeType === "TSRestType") {2885 if (typeof opts === "undefined") {2886 return true;2887 } else {2888 return (0, _shallowEqual.default)(node, opts);2889 }2890 }2891 return false;2892}2893function isTSNamedTupleMember(node, opts) {2894 if (!node) return false;2895 const nodeType = node.type;2896 if (nodeType === "TSNamedTupleMember") {2897 if (typeof opts === "undefined") {2898 return true;2899 } else {2900 return (0, _shallowEqual.default)(node, opts);2901 }2902 }2903 return false;2904}2905function isTSUnionType(node, opts) {2906 if (!node) return false;2907 const nodeType = node.type;2908 if (nodeType === "TSUnionType") {2909 if (typeof opts === "undefined") {2910 return true;2911 } else {2912 return (0, _shallowEqual.default)(node, opts);2913 }2914 }2915 return false;2916}2917function isTSIntersectionType(node, opts) {2918 if (!node) return false;2919 const nodeType = node.type;2920 if (nodeType === "TSIntersectionType") {2921 if (typeof opts === "undefined") {2922 return true;2923 } else {2924 return (0, _shallowEqual.default)(node, opts);2925 }2926 }2927 return false;2928}2929function isTSConditionalType(node, opts) {2930 if (!node) return false;2931 const nodeType = node.type;2932 if (nodeType === "TSConditionalType") {2933 if (typeof opts === "undefined") {2934 return true;2935 } else {2936 return (0, _shallowEqual.default)(node, opts);2937 }2938 }2939 return false;2940}2941function isTSInferType(node, opts) {2942 if (!node) return false;2943 const nodeType = node.type;2944 if (nodeType === "TSInferType") {2945 if (typeof opts === "undefined") {2946 return true;2947 } else {2948 return (0, _shallowEqual.default)(node, opts);2949 }2950 }2951 return false;2952}2953function isTSParenthesizedType(node, opts) {2954 if (!node) return false;2955 const nodeType = node.type;2956 if (nodeType === "TSParenthesizedType") {2957 if (typeof opts === "undefined") {2958 return true;2959 } else {2960 return (0, _shallowEqual.default)(node, opts);2961 }2962 }2963 return false;2964}2965function isTSTypeOperator(node, opts) {2966 if (!node) return false;2967 const nodeType = node.type;2968 if (nodeType === "TSTypeOperator") {2969 if (typeof opts === "undefined") {2970 return true;2971 } else {2972 return (0, _shallowEqual.default)(node, opts);2973 }2974 }2975 return false;2976}2977function isTSIndexedAccessType(node, opts) {2978 if (!node) return false;2979 const nodeType = node.type;2980 if (nodeType === "TSIndexedAccessType") {2981 if (typeof opts === "undefined") {2982 return true;2983 } else {2984 return (0, _shallowEqual.default)(node, opts);2985 }2986 }2987 return false;2988}2989function isTSMappedType(node, opts) {2990 if (!node) return false;2991 const nodeType = node.type;2992 if (nodeType === "TSMappedType") {2993 if (typeof opts === "undefined") {2994 return true;2995 } else {2996 return (0, _shallowEqual.default)(node, opts);2997 }2998 }2999 return false;3000}3001function isTSLiteralType(node, opts) {3002 if (!node) return false;3003 const nodeType = node.type;3004 if (nodeType === "TSLiteralType") {3005 if (typeof opts === "undefined") {3006 return true;3007 } else {3008 return (0, _shallowEqual.default)(node, opts);3009 }3010 }3011 return false;3012}3013function isTSExpressionWithTypeArguments(node, opts) {3014 if (!node) return false;3015 const nodeType = node.type;3016 if (nodeType === "TSExpressionWithTypeArguments") {3017 if (typeof opts === "undefined") {3018 return true;3019 } else {3020 return (0, _shallowEqual.default)(node, opts);3021 }3022 }3023 return false;3024}3025function isTSInterfaceDeclaration(node, opts) {3026 if (!node) return false;3027 const nodeType = node.type;3028 if (nodeType === "TSInterfaceDeclaration") {3029 if (typeof opts === "undefined") {3030 return true;3031 } else {3032 return (0, _shallowEqual.default)(node, opts);3033 }3034 }3035 return false;3036}3037function isTSInterfaceBody(node, opts) {3038 if (!node) return false;3039 const nodeType = node.type;3040 if (nodeType === "TSInterfaceBody") {3041 if (typeof opts === "undefined") {3042 return true;3043 } else {3044 return (0, _shallowEqual.default)(node, opts);3045 }3046 }3047 return false;3048}3049function isTSTypeAliasDeclaration(node, opts) {3050 if (!node) return false;3051 const nodeType = node.type;3052 if (nodeType === "TSTypeAliasDeclaration") {3053 if (typeof opts === "undefined") {3054 return true;3055 } else {3056 return (0, _shallowEqual.default)(node, opts);3057 }3058 }3059 return false;3060}3061function isTSAsExpression(node, opts) {3062 if (!node) return false;3063 const nodeType = node.type;3064 if (nodeType === "TSAsExpression") {3065 if (typeof opts === "undefined") {3066 return true;3067 } else {3068 return (0, _shallowEqual.default)(node, opts);3069 }3070 }3071 return false;3072}3073function isTSTypeAssertion(node, opts) {3074 if (!node) return false;3075 const nodeType = node.type;3076 if (nodeType === "TSTypeAssertion") {3077 if (typeof opts === "undefined") {3078 return true;3079 } else {3080 return (0, _shallowEqual.default)(node, opts);3081 }3082 }3083 return false;3084}3085function isTSEnumDeclaration(node, opts) {3086 if (!node) return false;3087 const nodeType = node.type;3088 if (nodeType === "TSEnumDeclaration") {3089 if (typeof opts === "undefined") {3090 return true;3091 } else {3092 return (0, _shallowEqual.default)(node, opts);3093 }3094 }3095 return false;3096}3097function isTSEnumMember(node, opts) {3098 if (!node) return false;3099 const nodeType = node.type;3100 if (nodeType === "TSEnumMember") {3101 if (typeof opts === "undefined") {3102 return true;3103 } else {3104 return (0, _shallowEqual.default)(node, opts);3105 }3106 }3107 return false;3108}3109function isTSModuleDeclaration(node, opts) {3110 if (!node) return false;3111 const nodeType = node.type;3112 if (nodeType === "TSModuleDeclaration") {3113 if (typeof opts === "undefined") {3114 return true;3115 } else {3116 return (0, _shallowEqual.default)(node, opts);3117 }3118 }3119 return false;3120}3121function isTSModuleBlock(node, opts) {3122 if (!node) return false;3123 const nodeType = node.type;3124 if (nodeType === "TSModuleBlock") {3125 if (typeof opts === "undefined") {3126 return true;3127 } else {3128 return (0, _shallowEqual.default)(node, opts);3129 }3130 }3131 return false;3132}3133function isTSImportType(node, opts) {3134 if (!node) return false;3135 const nodeType = node.type;3136 if (nodeType === "TSImportType") {3137 if (typeof opts === "undefined") {3138 return true;3139 } else {3140 return (0, _shallowEqual.default)(node, opts);3141 }3142 }3143 return false;3144}3145function isTSImportEqualsDeclaration(node, opts) {3146 if (!node) return false;3147 const nodeType = node.type;3148 if (nodeType === "TSImportEqualsDeclaration") {3149 if (typeof opts === "undefined") {3150 return true;3151 } else {3152 return (0, _shallowEqual.default)(node, opts);3153 }3154 }3155 return false;3156}3157function isTSExternalModuleReference(node, opts) {3158 if (!node) return false;3159 const nodeType = node.type;3160 if (nodeType === "TSExternalModuleReference") {3161 if (typeof opts === "undefined") {3162 return true;3163 } else {3164 return (0, _shallowEqual.default)(node, opts);3165 }3166 }3167 return false;3168}3169function isTSNonNullExpression(node, opts) {3170 if (!node) return false;3171 const nodeType = node.type;3172 if (nodeType === "TSNonNullExpression") {3173 if (typeof opts === "undefined") {3174 return true;3175 } else {3176 return (0, _shallowEqual.default)(node, opts);3177 }3178 }3179 return false;3180}3181function isTSExportAssignment(node, opts) {3182 if (!node) return false;3183 const nodeType = node.type;3184 if (nodeType === "TSExportAssignment") {3185 if (typeof opts === "undefined") {3186 return true;3187 } else {3188 return (0, _shallowEqual.default)(node, opts);3189 }3190 }3191 return false;3192}3193function isTSNamespaceExportDeclaration(node, opts) {3194 if (!node) return false;3195 const nodeType = node.type;3196 if (nodeType === "TSNamespaceExportDeclaration") {3197 if (typeof opts === "undefined") {3198 return true;3199 } else {3200 return (0, _shallowEqual.default)(node, opts);3201 }3202 }3203 return false;3204}3205function isTSTypeAnnotation(node, opts) {3206 if (!node) return false;3207 const nodeType = node.type;3208 if (nodeType === "TSTypeAnnotation") {3209 if (typeof opts === "undefined") {3210 return true;3211 } else {3212 return (0, _shallowEqual.default)(node, opts);3213 }3214 }3215 return false;3216}3217function isTSTypeParameterInstantiation(node, opts) {3218 if (!node) return false;3219 const nodeType = node.type;3220 if (nodeType === "TSTypeParameterInstantiation") {3221 if (typeof opts === "undefined") {3222 return true;3223 } else {3224 return (0, _shallowEqual.default)(node, opts);3225 }3226 }3227 return false;3228}3229function isTSTypeParameterDeclaration(node, opts) {3230 if (!node) return false;3231 const nodeType = node.type;3232 if (nodeType === "TSTypeParameterDeclaration") {3233 if (typeof opts === "undefined") {3234 return true;3235 } else {3236 return (0, _shallowEqual.default)(node, opts);3237 }3238 }3239 return false;3240}3241function isTSTypeParameter(node, opts) {3242 if (!node) return false;3243 const nodeType = node.type;3244 if (nodeType === "TSTypeParameter") {3245 if (typeof opts === "undefined") {3246 return true;3247 } else {3248 return (0, _shallowEqual.default)(node, opts);3249 }3250 }3251 return false;3252}3253function isExpression(node, opts) {3254 if (!node) return false;3255 const nodeType = node.type;3256 if ("ArrayExpression" === nodeType || "AssignmentExpression" === nodeType || "BinaryExpression" === nodeType || "CallExpression" === nodeType || "ConditionalExpression" === nodeType || "FunctionExpression" === nodeType || "Identifier" === nodeType || "StringLiteral" === nodeType || "NumericLiteral" === nodeType || "NullLiteral" === nodeType || "BooleanLiteral" === nodeType || "RegExpLiteral" === nodeType || "LogicalExpression" === nodeType || "MemberExpression" === nodeType || "NewExpression" === nodeType || "ObjectExpression" === nodeType || "SequenceExpression" === nodeType || "ParenthesizedExpression" === nodeType || "ThisExpression" === nodeType || "UnaryExpression" === nodeType || "UpdateExpression" === nodeType || "ArrowFunctionExpression" === nodeType || "ClassExpression" === nodeType || "MetaProperty" === nodeType || "Super" === nodeType || "TaggedTemplateExpression" === nodeType || "TemplateLiteral" === nodeType || "YieldExpression" === nodeType || "AwaitExpression" === nodeType || "Import" === nodeType || "BigIntLiteral" === nodeType || "OptionalMemberExpression" === nodeType || "OptionalCallExpression" === nodeType || "TypeCastExpression" === nodeType || "JSXElement" === nodeType || "JSXFragment" === nodeType || "BindExpression" === nodeType || "DoExpression" === nodeType || "RecordExpression" === nodeType || "TupleExpression" === nodeType || "DecimalLiteral" === nodeType || "ModuleExpression" === nodeType || "TopicReference" === nodeType || "PipelineTopicExpression" === nodeType || "PipelineBareFunction" === nodeType || "PipelinePrimaryTopicReference" === nodeType || "TSAsExpression" === nodeType || "TSTypeAssertion" === nodeType || "TSNonNullExpression" === nodeType || nodeType === "Placeholder" && ("Expression" === node.expectedNode || "Identifier" === node.expectedNode || "StringLiteral" === node.expectedNode)) {3257 if (typeof opts === "undefined") {3258 return true;3259 } else {3260 return (0, _shallowEqual.default)(node, opts);3261 }3262 }3263 return false;3264}3265function isBinary(node, opts) {3266 if (!node) return false;3267 const nodeType = node.type;3268 if ("BinaryExpression" === nodeType || "LogicalExpression" === nodeType) {3269 if (typeof opts === "undefined") {3270 return true;3271 } else {3272 return (0, _shallowEqual.default)(node, opts);3273 }3274 }3275 return false;3276}3277function isScopable(node, opts) {3278 if (!node) return false;3279 const nodeType = node.type;3280 if ("BlockStatement" === nodeType || "CatchClause" === nodeType || "DoWhileStatement" === nodeType || "ForInStatement" === nodeType || "ForStatement" === nodeType || "FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "Program" === nodeType || "ObjectMethod" === nodeType || "SwitchStatement" === nodeType || "WhileStatement" === nodeType || "ArrowFunctionExpression" === nodeType || "ClassExpression" === nodeType || "ClassDeclaration" === nodeType || "ForOfStatement" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType || "StaticBlock" === nodeType || "TSModuleBlock" === nodeType || nodeType === "Placeholder" && "BlockStatement" === node.expectedNode) {3281 if (typeof opts === "undefined") {3282 return true;3283 } else {3284 return (0, _shallowEqual.default)(node, opts);3285 }3286 }3287 return false;3288}3289function isBlockParent(node, opts) {3290 if (!node) return false;3291 const nodeType = node.type;3292 if ("BlockStatement" === nodeType || "CatchClause" === nodeType || "DoWhileStatement" === nodeType || "ForInStatement" === nodeType || "ForStatement" === nodeType || "FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "Program" === nodeType || "ObjectMethod" === nodeType || "SwitchStatement" === nodeType || "WhileStatement" === nodeType || "ArrowFunctionExpression" === nodeType || "ForOfStatement" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType || "StaticBlock" === nodeType || "TSModuleBlock" === nodeType || nodeType === "Placeholder" && "BlockStatement" === node.expectedNode) {3293 if (typeof opts === "undefined") {3294 return true;3295 } else {3296 return (0, _shallowEqual.default)(node, opts);3297 }3298 }3299 return false;3300}3301function isBlock(node, opts) {3302 if (!node) return false;3303 const nodeType = node.type;3304 if ("BlockStatement" === nodeType || "Program" === nodeType || "TSModuleBlock" === nodeType || nodeType === "Placeholder" && "BlockStatement" === node.expectedNode) {3305 if (typeof opts === "undefined") {3306 return true;3307 } else {3308 return (0, _shallowEqual.default)(node, opts);3309 }3310 }3311 return false;3312}3313function isStatement(node, opts) {3314 if (!node) return false;3315 const nodeType = node.type;3316 if ("BlockStatement" === nodeType || "BreakStatement" === nodeType || "ContinueStatement" === nodeType || "DebuggerStatement" === nodeType || "DoWhileStatement" === nodeType || "EmptyStatement" === nodeType || "ExpressionStatement" === nodeType || "ForInStatement" === nodeType || "ForStatement" === nodeType || "FunctionDeclaration" === nodeType || "IfStatement" === nodeType || "LabeledStatement" === nodeType || "ReturnStatement" === nodeType || "SwitchStatement" === nodeType || "ThrowStatement" === nodeType || "TryStatement" === nodeType || "VariableDeclaration" === nodeType || "WhileStatement" === nodeType || "WithStatement" === nodeType || "ClassDeclaration" === nodeType || "ExportAllDeclaration" === nodeType || "ExportDefaultDeclaration" === nodeType || "ExportNamedDeclaration" === nodeType || "ForOfStatement" === nodeType || "ImportDeclaration" === nodeType || "DeclareClass" === nodeType || "DeclareFunction" === nodeType || "DeclareInterface" === nodeType || "DeclareModule" === nodeType || "DeclareModuleExports" === nodeType || "DeclareTypeAlias" === nodeType || "DeclareOpaqueType" === nodeType || "DeclareVariable" === nodeType || "DeclareExportDeclaration" === nodeType || "DeclareExportAllDeclaration" === nodeType || "InterfaceDeclaration" === nodeType || "OpaqueType" === nodeType || "TypeAlias" === nodeType || "EnumDeclaration" === nodeType || "TSDeclareFunction" === nodeType || "TSInterfaceDeclaration" === nodeType || "TSTypeAliasDeclaration" === nodeType || "TSEnumDeclaration" === nodeType || "TSModuleDeclaration" === nodeType || "TSImportEqualsDeclaration" === nodeType || "TSExportAssignment" === nodeType || "TSNamespaceExportDeclaration" === nodeType || nodeType === "Placeholder" && ("Statement" === node.expectedNode || "Declaration" === node.expectedNode || "BlockStatement" === node.expectedNode)) {3317 if (typeof opts === "undefined") {3318 return true;3319 } else {3320 return (0, _shallowEqual.default)(node, opts);3321 }3322 }3323 return false;3324}3325function isTerminatorless(node, opts) {3326 if (!node) return false;3327 const nodeType = node.type;3328 if ("BreakStatement" === nodeType || "ContinueStatement" === nodeType || "ReturnStatement" === nodeType || "ThrowStatement" === nodeType || "YieldExpression" === nodeType || "AwaitExpression" === nodeType) {3329 if (typeof opts === "undefined") {3330 return true;3331 } else {3332 return (0, _shallowEqual.default)(node, opts);3333 }3334 }3335 return false;3336}3337function isCompletionStatement(node, opts) {3338 if (!node) return false;3339 const nodeType = node.type;3340 if ("BreakStatement" === nodeType || "ContinueStatement" === nodeType || "ReturnStatement" === nodeType || "ThrowStatement" === nodeType) {3341 if (typeof opts === "undefined") {3342 return true;3343 } else {3344 return (0, _shallowEqual.default)(node, opts);3345 }3346 }3347 return false;3348}3349function isConditional(node, opts) {3350 if (!node) return false;3351 const nodeType = node.type;3352 if ("ConditionalExpression" === nodeType || "IfStatement" === nodeType) {3353 if (typeof opts === "undefined") {3354 return true;3355 } else {3356 return (0, _shallowEqual.default)(node, opts);3357 }3358 }3359 return false;3360}3361function isLoop(node, opts) {3362 if (!node) return false;3363 const nodeType = node.type;3364 if ("DoWhileStatement" === nodeType || "ForInStatement" === nodeType || "ForStatement" === nodeType || "WhileStatement" === nodeType || "ForOfStatement" === nodeType) {3365 if (typeof opts === "undefined") {3366 return true;3367 } else {3368 return (0, _shallowEqual.default)(node, opts);3369 }3370 }3371 return false;3372}3373function isWhile(node, opts) {3374 if (!node) return false;3375 const nodeType = node.type;3376 if ("DoWhileStatement" === nodeType || "WhileStatement" === nodeType) {3377 if (typeof opts === "undefined") {3378 return true;3379 } else {3380 return (0, _shallowEqual.default)(node, opts);3381 }3382 }3383 return false;3384}3385function isExpressionWrapper(node, opts) {3386 if (!node) return false;3387 const nodeType = node.type;3388 if ("ExpressionStatement" === nodeType || "ParenthesizedExpression" === nodeType || "TypeCastExpression" === nodeType) {3389 if (typeof opts === "undefined") {3390 return true;3391 } else {3392 return (0, _shallowEqual.default)(node, opts);3393 }3394 }3395 return false;3396}3397function isFor(node, opts) {3398 if (!node) return false;3399 const nodeType = node.type;3400 if ("ForInStatement" === nodeType || "ForStatement" === nodeType || "ForOfStatement" === nodeType) {3401 if (typeof opts === "undefined") {3402 return true;3403 } else {3404 return (0, _shallowEqual.default)(node, opts);3405 }3406 }3407 return false;3408}3409function isForXStatement(node, opts) {3410 if (!node) return false;3411 const nodeType = node.type;3412 if ("ForInStatement" === nodeType || "ForOfStatement" === nodeType) {3413 if (typeof opts === "undefined") {3414 return true;3415 } else {3416 return (0, _shallowEqual.default)(node, opts);3417 }3418 }3419 return false;3420}3421function isFunction(node, opts) {3422 if (!node) return false;3423 const nodeType = node.type;3424 if ("FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "ObjectMethod" === nodeType || "ArrowFunctionExpression" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType) {3425 if (typeof opts === "undefined") {3426 return true;3427 } else {3428 return (0, _shallowEqual.default)(node, opts);3429 }3430 }3431 return false;3432}3433function isFunctionParent(node, opts) {3434 if (!node) return false;3435 const nodeType = node.type;3436 if ("FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "ObjectMethod" === nodeType || "ArrowFunctionExpression" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType) {3437 if (typeof opts === "undefined") {3438 return true;3439 } else {3440 return (0, _shallowEqual.default)(node, opts);3441 }3442 }3443 return false;3444}3445function isPureish(node, opts) {3446 if (!node) return false;3447 const nodeType = node.type;3448 if ("FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "StringLiteral" === nodeType || "NumericLiteral" === nodeType || "NullLiteral" === nodeType || "BooleanLiteral" === nodeType || "RegExpLiteral" === nodeType || "ArrowFunctionExpression" === nodeType || "BigIntLiteral" === nodeType || "DecimalLiteral" === nodeType || nodeType === "Placeholder" && "StringLiteral" === node.expectedNode) {3449 if (typeof opts === "undefined") {3450 return true;3451 } else {3452 return (0, _shallowEqual.default)(node, opts);3453 }3454 }3455 return false;3456}3457function isDeclaration(node, opts) {3458 if (!node) return false;3459 const nodeType = node.type;3460 if ("FunctionDeclaration" === nodeType || "VariableDeclaration" === nodeType || "ClassDeclaration" === nodeType || "ExportAllDeclaration" === nodeType || "ExportDefaultDeclaration" === nodeType || "ExportNamedDeclaration" === nodeType || "ImportDeclaration" === nodeType || "DeclareClass" === nodeType || "DeclareFunction" === nodeType || "DeclareInterface" === nodeType || "DeclareModule" === nodeType || "DeclareModuleExports" === nodeType || "DeclareTypeAlias" === nodeType || "DeclareOpaqueType" === nodeType || "DeclareVariable" === nodeType || "DeclareExportDeclaration" === nodeType || "DeclareExportAllDeclaration" === nodeType || "InterfaceDeclaration" === nodeType || "OpaqueType" === nodeType || "TypeAlias" === nodeType || "EnumDeclaration" === nodeType || "TSDeclareFunction" === nodeType || "TSInterfaceDeclaration" === nodeType || "TSTypeAliasDeclaration" === nodeType || "TSEnumDeclaration" === nodeType || "TSModuleDeclaration" === nodeType || nodeType === "Placeholder" && "Declaration" === node.expectedNode) {3461 if (typeof opts === "undefined") {3462 return true;3463 } else {3464 return (0, _shallowEqual.default)(node, opts);3465 }3466 }3467 return false;3468}3469function isPatternLike(node, opts) {3470 if (!node) return false;3471 const nodeType = node.type;3472 if ("Identifier" === nodeType || "RestElement" === nodeType || "AssignmentPattern" === nodeType || "ArrayPattern" === nodeType || "ObjectPattern" === nodeType || nodeType === "Placeholder" && ("Pattern" === node.expectedNode || "Identifier" === node.expectedNode)) {3473 if (typeof opts === "undefined") {3474 return true;3475 } else {3476 return (0, _shallowEqual.default)(node, opts);3477 }3478 }3479 return false;3480}3481function isLVal(node, opts) {3482 if (!node) return false;3483 const nodeType = node.type;3484 if ("Identifier" === nodeType || "MemberExpression" === nodeType || "RestElement" === nodeType || "AssignmentPattern" === nodeType || "ArrayPattern" === nodeType || "ObjectPattern" === nodeType || "TSParameterProperty" === nodeType || nodeType === "Placeholder" && ("Pattern" === node.expectedNode || "Identifier" === node.expectedNode)) {3485 if (typeof opts === "undefined") {3486 return true;3487 } else {3488 return (0, _shallowEqual.default)(node, opts);3489 }3490 }3491 return false;3492}3493function isTSEntityName(node, opts) {3494 if (!node) return false;3495 const nodeType = node.type;3496 if ("Identifier" === nodeType || "TSQualifiedName" === nodeType || nodeType === "Placeholder" && "Identifier" === node.expectedNode) {3497 if (typeof opts === "undefined") {3498 return true;3499 } else {3500 return (0, _shallowEqual.default)(node, opts);3501 }3502 }3503 return false;3504}3505function isLiteral(node, opts) {3506 if (!node) return false;3507 const nodeType = node.type;3508 if ("StringLiteral" === nodeType || "NumericLiteral" === nodeType || "NullLiteral" === nodeType || "BooleanLiteral" === nodeType || "RegExpLiteral" === nodeType || "TemplateLiteral" === nodeType || "BigIntLiteral" === nodeType || "DecimalLiteral" === nodeType || nodeType === "Placeholder" && "StringLiteral" === node.expectedNode) {3509 if (typeof opts === "undefined") {3510 return true;3511 } else {3512 return (0, _shallowEqual.default)(node, opts);3513 }3514 }3515 return false;3516}3517function isImmutable(node, opts) {3518 if (!node) return false;3519 const nodeType = node.type;3520 if ("StringLiteral" === nodeType || "NumericLiteral" === nodeType || "NullLiteral" === nodeType || "BooleanLiteral" === nodeType || "BigIntLiteral" === nodeType || "JSXAttribute" === nodeType || "JSXClosingElement" === nodeType || "JSXElement" === nodeType || "JSXExpressionContainer" === nodeType || "JSXSpreadChild" === nodeType || "JSXOpeningElement" === nodeType || "JSXText" === nodeType || "JSXFragment" === nodeType || "JSXOpeningFragment" === nodeType || "JSXClosingFragment" === nodeType || "DecimalLiteral" === nodeType || nodeType === "Placeholder" && "StringLiteral" === node.expectedNode) {3521 if (typeof opts === "undefined") {3522 return true;3523 } else {3524 return (0, _shallowEqual.default)(node, opts);3525 }3526 }3527 return false;3528}3529function isUserWhitespacable(node, opts) {3530 if (!node) return false;3531 const nodeType = node.type;3532 if ("ObjectMethod" === nodeType || "ObjectProperty" === nodeType || "ObjectTypeInternalSlot" === nodeType || "ObjectTypeCallProperty" === nodeType || "ObjectTypeIndexer" === nodeType || "ObjectTypeProperty" === nodeType || "ObjectTypeSpreadProperty" === nodeType) {3533 if (typeof opts === "undefined") {3534 return true;3535 } else {3536 return (0, _shallowEqual.default)(node, opts);3537 }3538 }3539 return false;3540}3541function isMethod(node, opts) {3542 if (!node) return false;3543 const nodeType = node.type;3544 if ("ObjectMethod" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType) {3545 if (typeof opts === "undefined") {3546 return true;3547 } else {3548 return (0, _shallowEqual.default)(node, opts);3549 }3550 }3551 return false;3552}3553function isObjectMember(node, opts) {3554 if (!node) return false;3555 const nodeType = node.type;3556 if ("ObjectMethod" === nodeType || "ObjectProperty" === nodeType) {3557 if (typeof opts === "undefined") {3558 return true;3559 } else {3560 return (0, _shallowEqual.default)(node, opts);3561 }3562 }3563 return false;3564}3565function isProperty(node, opts) {3566 if (!node) return false;3567 const nodeType = node.type;3568 if ("ObjectProperty" === nodeType || "ClassProperty" === nodeType || "ClassPrivateProperty" === nodeType) {3569 if (typeof opts === "undefined") {3570 return true;3571 } else {3572 return (0, _shallowEqual.default)(node, opts);3573 }3574 }3575 return false;3576}3577function isUnaryLike(node, opts) {3578 if (!node) return false;3579 const nodeType = node.type;3580 if ("UnaryExpression" === nodeType || "SpreadElement" === nodeType) {3581 if (typeof opts === "undefined") {3582 return true;3583 } else {3584 return (0, _shallowEqual.default)(node, opts);3585 }3586 }3587 return false;3588}3589function isPattern(node, opts) {3590 if (!node) return false;3591 const nodeType = node.type;3592 if ("AssignmentPattern" === nodeType || "ArrayPattern" === nodeType || "ObjectPattern" === nodeType || nodeType === "Placeholder" && "Pattern" === node.expectedNode) {3593 if (typeof opts === "undefined") {3594 return true;3595 } else {3596 return (0, _shallowEqual.default)(node, opts);3597 }3598 }3599 return false;3600}3601function isClass(node, opts) {3602 if (!node) return false;3603 const nodeType = node.type;3604 if ("ClassExpression" === nodeType || "ClassDeclaration" === nodeType) {3605 if (typeof opts === "undefined") {3606 return true;3607 } else {3608 return (0, _shallowEqual.default)(node, opts);3609 }3610 }3611 return false;3612}3613function isModuleDeclaration(node, opts) {3614 if (!node) return false;3615 const nodeType = node.type;3616 if ("ExportAllDeclaration" === nodeType || "ExportDefaultDeclaration" === nodeType || "ExportNamedDeclaration" === nodeType || "ImportDeclaration" === nodeType) {3617 if (typeof opts === "undefined") {3618 return true;3619 } else {3620 return (0, _shallowEqual.default)(node, opts);3621 }3622 }3623 return false;3624}3625function isExportDeclaration(node, opts) {3626 if (!node) return false;3627 const nodeType = node.type;3628 if ("ExportAllDeclaration" === nodeType || "ExportDefaultDeclaration" === nodeType || "ExportNamedDeclaration" === nodeType) {3629 if (typeof opts === "undefined") {3630 return true;3631 } else {3632 return (0, _shallowEqual.default)(node, opts);3633 }3634 }3635 return false;3636}3637function isModuleSpecifier(node, opts) {3638 if (!node) return false;3639 const nodeType = node.type;3640 if ("ExportSpecifier" === nodeType || "ImportDefaultSpecifier" === nodeType || "ImportNamespaceSpecifier" === nodeType || "ImportSpecifier" === nodeType || "ExportNamespaceSpecifier" === nodeType || "ExportDefaultSpecifier" === nodeType) {3641 if (typeof opts === "undefined") {3642 return true;3643 } else {3644 return (0, _shallowEqual.default)(node, opts);3645 }3646 }3647 return false;3648}3649function isPrivate(node, opts) {3650 if (!node) return false;3651 const nodeType = node.type;3652 if ("ClassPrivateProperty" === nodeType || "ClassPrivateMethod" === nodeType || "PrivateName" === nodeType) {3653 if (typeof opts === "undefined") {3654 return true;3655 } else {3656 return (0, _shallowEqual.default)(node, opts);3657 }3658 }3659 return false;3660}3661function isFlow(node, opts) {3662 if (!node) return false;3663 const nodeType = node.type;3664 if ("AnyTypeAnnotation" === nodeType || "ArrayTypeAnnotation" === nodeType || "BooleanTypeAnnotation" === nodeType || "BooleanLiteralTypeAnnotation" === nodeType || "NullLiteralTypeAnnotation" === nodeType || "ClassImplements" === nodeType || "DeclareClass" === nodeType || "DeclareFunction" === nodeType || "DeclareInterface" === nodeType || "DeclareModule" === nodeType || "DeclareModuleExports" === nodeType || "DeclareTypeAlias" === nodeType || "DeclareOpaqueType" === nodeType || "DeclareVariable" === nodeType || "DeclareExportDeclaration" === nodeType || "DeclareExportAllDeclaration" === nodeType || "DeclaredPredicate" === nodeType || "ExistsTypeAnnotation" === nodeType || "FunctionTypeAnnotation" === nodeType || "FunctionTypeParam" === nodeType || "GenericTypeAnnotation" === nodeType || "InferredPredicate" === nodeType || "InterfaceExtends" === nodeType || "InterfaceDeclaration" === nodeType || "InterfaceTypeAnnotation" === nodeType || "IntersectionTypeAnnotation" === nodeType || "MixedTypeAnnotation" === nodeType || "EmptyTypeAnnotation" === nodeType || "NullableTypeAnnotation" === nodeType || "NumberLiteralTypeAnnotation" === nodeType || "NumberTypeAnnotation" === nodeType || "ObjectTypeAnnotation" === nodeType || "ObjectTypeInternalSlot" === nodeType || "ObjectTypeCallProperty" === nodeType || "ObjectTypeIndexer" === nodeType || "ObjectTypeProperty" === nodeType || "ObjectTypeSpreadProperty" === nodeType || "OpaqueType" === nodeType || "QualifiedTypeIdentifier" === nodeType || "StringLiteralTypeAnnotation" === nodeType || "StringTypeAnnotation" === nodeType || "SymbolTypeAnnotation" === nodeType || "ThisTypeAnnotation" === nodeType || "TupleTypeAnnotation" === nodeType || "TypeofTypeAnnotation" === nodeType || "TypeAlias" === nodeType || "TypeAnnotation" === nodeType || "TypeCastExpression" === nodeType || "TypeParameter" === nodeType || "TypeParameterDeclaration" === nodeType || "TypeParameterInstantiation" === nodeType || "UnionTypeAnnotation" === nodeType || "Variance" === nodeType || "VoidTypeAnnotation" === nodeType || "IndexedAccessType" === nodeType || "OptionalIndexedAccessType" === nodeType) {3665 if (typeof opts === "undefined") {3666 return true;3667 } else {3668 return (0, _shallowEqual.default)(node, opts);3669 }3670 }3671 return false;3672}3673function isFlowType(node, opts) {3674 if (!node) return false;3675 const nodeType = node.type;3676 if ("AnyTypeAnnotation" === nodeType || "ArrayTypeAnnotation" === nodeType || "BooleanTypeAnnotation" === nodeType || "BooleanLiteralTypeAnnotation" === nodeType || "NullLiteralTypeAnnotation" === nodeType || "ExistsTypeAnnotation" === nodeType || "FunctionTypeAnnotation" === nodeType || "GenericTypeAnnotation" === nodeType || "InterfaceTypeAnnotation" === nodeType || "IntersectionTypeAnnotation" === nodeType || "MixedTypeAnnotation" === nodeType || "EmptyTypeAnnotation" === nodeType || "NullableTypeAnnotation" === nodeType || "NumberLiteralTypeAnnotation" === nodeType || "NumberTypeAnnotation" === nodeType || "ObjectTypeAnnotation" === nodeType || "StringLiteralTypeAnnotation" === nodeType || "StringTypeAnnotation" === nodeType || "SymbolTypeAnnotation" === nodeType || "ThisTypeAnnotation" === nodeType || "TupleTypeAnnotation" === nodeType || "TypeofTypeAnnotation" === nodeType || "UnionTypeAnnotation" === nodeType || "VoidTypeAnnotation" === nodeType || "IndexedAccessType" === nodeType || "OptionalIndexedAccessType" === nodeType) {3677 if (typeof opts === "undefined") {3678 return true;3679 } else {3680 return (0, _shallowEqual.default)(node, opts);3681 }3682 }3683 return false;3684}3685function isFlowBaseAnnotation(node, opts) {3686 if (!node) return false;3687 const nodeType = node.type;3688 if ("AnyTypeAnnotation" === nodeType || "BooleanTypeAnnotation" === nodeType || "NullLiteralTypeAnnotation" === nodeType || "MixedTypeAnnotation" === nodeType || "EmptyTypeAnnotation" === nodeType || "NumberTypeAnnotation" === nodeType || "StringTypeAnnotation" === nodeType || "SymbolTypeAnnotation" === nodeType || "ThisTypeAnnotation" === nodeType || "VoidTypeAnnotation" === nodeType) {3689 if (typeof opts === "undefined") {3690 return true;3691 } else {3692 return (0, _shallowEqual.default)(node, opts);3693 }3694 }3695 return false;3696}3697function isFlowDeclaration(node, opts) {3698 if (!node) return false;3699 const nodeType = node.type;3700 if ("DeclareClass" === nodeType || "DeclareFunction" === nodeType || "DeclareInterface" === nodeType || "DeclareModule" === nodeType || "DeclareModuleExports" === nodeType || "DeclareTypeAlias" === nodeType || "DeclareOpaqueType" === nodeType || "DeclareVariable" === nodeType || "DeclareExportDeclaration" === nodeType || "DeclareExportAllDeclaration" === nodeType || "InterfaceDeclaration" === nodeType || "OpaqueType" === nodeType || "TypeAlias" === nodeType) {3701 if (typeof opts === "undefined") {3702 return true;3703 } else {3704 return (0, _shallowEqual.default)(node, opts);3705 }3706 }3707 return false;3708}3709function isFlowPredicate(node, opts) {3710 if (!node) return false;3711 const nodeType = node.type;3712 if ("DeclaredPredicate" === nodeType || "InferredPredicate" === nodeType) {3713 if (typeof opts === "undefined") {3714 return true;3715 } else {3716 return (0, _shallowEqual.default)(node, opts);3717 }3718 }3719 return false;3720}3721function isEnumBody(node, opts) {3722 if (!node) return false;3723 const nodeType = node.type;3724 if ("EnumBooleanBody" === nodeType || "EnumNumberBody" === nodeType || "EnumStringBody" === nodeType || "EnumSymbolBody" === nodeType) {3725 if (typeof opts === "undefined") {3726 return true;3727 } else {3728 return (0, _shallowEqual.default)(node, opts);3729 }3730 }3731 return false;3732}3733function isEnumMember(node, opts) {3734 if (!node) return false;3735 const nodeType = node.type;3736 if ("EnumBooleanMember" === nodeType || "EnumNumberMember" === nodeType || "EnumStringMember" === nodeType || "EnumDefaultedMember" === nodeType) {3737 if (typeof opts === "undefined") {3738 return true;3739 } else {3740 return (0, _shallowEqual.default)(node, opts);3741 }3742 }3743 return false;3744}3745function isJSX(node, opts) {3746 if (!node) return false;3747 const nodeType = node.type;3748 if ("JSXAttribute" === nodeType || "JSXClosingElement" === nodeType || "JSXElement" === nodeType || "JSXEmptyExpression" === nodeType || "JSXExpressionContainer" === nodeType || "JSXSpreadChild" === nodeType || "JSXIdentifier" === nodeType || "JSXMemberExpression" === nodeType || "JSXNamespacedName" === nodeType || "JSXOpeningElement" === nodeType || "JSXSpreadAttribute" === nodeType || "JSXText" === nodeType || "JSXFragment" === nodeType || "JSXOpeningFragment" === nodeType || "JSXClosingFragment" === nodeType) {3749 if (typeof opts === "undefined") {3750 return true;3751 } else {3752 return (0, _shallowEqual.default)(node, opts);3753 }3754 }3755 return false;3756}3757function isTSTypeElement(node, opts) {3758 if (!node) return false;3759 const nodeType = node.type;3760 if ("TSCallSignatureDeclaration" === nodeType || "TSConstructSignatureDeclaration" === nodeType || "TSPropertySignature" === nodeType || "TSMethodSignature" === nodeType || "TSIndexSignature" === nodeType) {3761 if (typeof opts === "undefined") {3762 return true;3763 } else {3764 return (0, _shallowEqual.default)(node, opts);3765 }3766 }3767 return false;3768}3769function isTSType(node, opts) {3770 if (!node) return false;3771 const nodeType = node.type;3772 if ("TSAnyKeyword" === nodeType || "TSBooleanKeyword" === nodeType || "TSBigIntKeyword" === nodeType || "TSIntrinsicKeyword" === nodeType || "TSNeverKeyword" === nodeType || "TSNullKeyword" === nodeType || "TSNumberKeyword" === nodeType || "TSObjectKeyword" === nodeType || "TSStringKeyword" === nodeType || "TSSymbolKeyword" === nodeType || "TSUndefinedKeyword" === nodeType || "TSUnknownKeyword" === nodeType || "TSVoidKeyword" === nodeType || "TSThisType" === nodeType || "TSFunctionType" === nodeType || "TSConstructorType" === nodeType || "TSTypeReference" === nodeType || "TSTypePredicate" === nodeType || "TSTypeQuery" === nodeType || "TSTypeLiteral" === nodeType || "TSArrayType" === nodeType || "TSTupleType" === nodeType || "TSOptionalType" === nodeType || "TSRestType" === nodeType || "TSUnionType" === nodeType || "TSIntersectionType" === nodeType || "TSConditionalType" === nodeType || "TSInferType" === nodeType || "TSParenthesizedType" === nodeType || "TSTypeOperator" === nodeType || "TSIndexedAccessType" === nodeType || "TSMappedType" === nodeType || "TSLiteralType" === nodeType || "TSExpressionWithTypeArguments" === nodeType || "TSImportType" === nodeType) {3773 if (typeof opts === "undefined") {3774 return true;3775 } else {3776 return (0, _shallowEqual.default)(node, opts);3777 }3778 }3779 return false;3780}3781function isTSBaseType(node, opts) {3782 if (!node) return false;3783 const nodeType = node.type;3784 if ("TSAnyKeyword" === nodeType || "TSBooleanKeyword" === nodeType || "TSBigIntKeyword" === nodeType || "TSIntrinsicKeyword" === nodeType || "TSNeverKeyword" === nodeType || "TSNullKeyword" === nodeType || "TSNumberKeyword" === nodeType || "TSObjectKeyword" === nodeType || "TSStringKeyword" === nodeType || "TSSymbolKeyword" === nodeType || "TSUndefinedKeyword" === nodeType || "TSUnknownKeyword" === nodeType || "TSVoidKeyword" === nodeType || "TSThisType" === nodeType || "TSLiteralType" === nodeType) {3785 if (typeof opts === "undefined") {3786 return true;3787 } else {3788 return (0, _shallowEqual.default)(node, opts);3789 }3790 }3791 return false;3792}3793function isNumberLiteral(node, opts) {3794 console.trace("The node type NumberLiteral has been renamed to NumericLiteral");3795 if (!node) return false;3796 const nodeType = node.type;3797 if (nodeType === "NumberLiteral") {3798 if (typeof opts === "undefined") {3799 return true;3800 } else {3801 return (0, _shallowEqual.default)(node, opts);3802 }3803 }3804 return false;3805}3806function isRegexLiteral(node, opts) {3807 console.trace("The node type RegexLiteral has been renamed to RegExpLiteral");3808 if (!node) return false;3809 const nodeType = node.type;3810 if (nodeType === "RegexLiteral") {3811 if (typeof opts === "undefined") {3812 return true;3813 } else {3814 return (0, _shallowEqual.default)(node, opts);3815 }3816 }3817 return false;3818}3819function isRestProperty(node, opts) {3820 console.trace("The node type RestProperty has been renamed to RestElement");3821 if (!node) return false;3822 const nodeType = node.type;3823 if (nodeType === "RestProperty") {3824 if (typeof opts === "undefined") {3825 return true;3826 } else {3827 return (0, _shallowEqual.default)(node, opts);3828 }3829 }3830 return false;3831}3832function isSpreadProperty(node, opts) {3833 console.trace("The node type SpreadProperty has been renamed to SpreadElement");3834 if (!node) return false;3835 const nodeType = node.type;3836 if (nodeType === "SpreadProperty") {3837 if (typeof opts === "undefined") {3838 return true;3839 } else {3840 return (0, _shallowEqual.default)(node, opts);3841 }3842 }3843 return false;...

Full Screen

Full Screen

dom.js

Source:dom.js Github

copy

Full Screen

1define([2 'summernote/base/core/func',3 'summernote/base/core/list',4 'summernote/base/core/agent'5], function (func, list, agent) {6 var NBSP_CHAR = String.fromCharCode(160);7 var ZERO_WIDTH_NBSP_CHAR = '\ufeff';8 /**9 * @class core.dom10 *11 * Dom functions12 *13 * @singleton14 * @alternateClassName dom15 */16 var dom = (function () {17 /**18 * @method isEditable19 *20 * returns whether node is `note-editable` or not.21 *22 * @param {Node} node23 * @return {Boolean}24 */25 var isEditable = function (node) {26 return node && $(node).hasClass('note-editable');27 };28 /**29 * @method isControlSizing30 *31 * returns whether node is `note-control-sizing` or not.32 *33 * @param {Node} node34 * @return {Boolean}35 */36 var isControlSizing = function (node) {37 return node && $(node).hasClass('note-control-sizing');38 };39 /**40 * @method makePredByNodeName41 *42 * returns predicate which judge whether nodeName is same43 *44 * @param {String} nodeName45 * @return {Function}46 */47 var makePredByNodeName = function (nodeName) {48 nodeName = nodeName.toUpperCase();49 return function (node) {50 return node && node.nodeName.toUpperCase() === nodeName;51 };52 };53 /**54 * @method isText55 *56 *57 *58 * @param {Node} node59 * @return {Boolean} true if node's type is text(3)60 */61 var isText = function (node) {62 return node && node.nodeType === 3;63 };64 /**65 * @method isElement66 *67 *68 *69 * @param {Node} node70 * @return {Boolean} true if node's type is element(1)71 */72 var isElement = function (node) {73 return node && node.nodeType === 1;74 };75 /**76 * ex) br, col, embed, hr, img, input, ...77 * @see http://www.w3.org/html/wg/drafts/html/master/syntax.html#void-elements78 */79 var isVoid = function (node) {80 return node && /^BR|^IMG|^HR|^IFRAME|^BUTTON/.test(node.nodeName.toUpperCase());81 };82 var isPara = function (node) {83 if (isEditable(node)) {84 return false;85 }86 // Chrome(v31.0), FF(v25.0.1) use DIV for paragraph87 return node && /^DIV|^P|^LI|^H[1-7]/.test(node.nodeName.toUpperCase());88 };89 var isHeading = function (node) {90 return node && /^H[1-7]/.test(node.nodeName.toUpperCase());91 };92 var isPre = makePredByNodeName('PRE');93 var isLi = makePredByNodeName('LI');94 var isPurePara = function (node) {95 return isPara(node) && !isLi(node);96 };97 var isTable = makePredByNodeName('TABLE');98 var isData = makePredByNodeName('DATA');99 var isInline = function (node) {100 return !isBodyContainer(node) &&101 !isList(node) &&102 !isHr(node) &&103 !isPara(node) &&104 !isTable(node) &&105 !isBlockquote(node) &&106 !isData(node);107 };108 var isList = function (node) {109 return node && /^UL|^OL/.test(node.nodeName.toUpperCase());110 };111 var isHr = makePredByNodeName('HR');112 var isCell = function (node) {113 return node && /^TD|^TH/.test(node.nodeName.toUpperCase());114 };115 var isBlockquote = makePredByNodeName('BLOCKQUOTE');116 var isBodyContainer = function (node) {117 return isCell(node) || isBlockquote(node) || isEditable(node);118 };119 var isAnchor = makePredByNodeName('A');120 var isParaInline = function (node) {121 return isInline(node) && !!ancestor(node, isPara);122 };123 var isBodyInline = function (node) {124 return isInline(node) && !ancestor(node, isPara);125 };126 var isBody = makePredByNodeName('BODY');127 /**128 * returns whether nodeB is closest sibling of nodeA129 *130 * @param {Node} nodeA131 * @param {Node} nodeB132 * @return {Boolean}133 */134 var isClosestSibling = function (nodeA, nodeB) {135 return nodeA.nextSibling === nodeB ||136 nodeA.previousSibling === nodeB;137 };138 /**139 * returns array of closest siblings with node140 *141 * @param {Node} node142 * @param {function} [pred] - predicate function143 * @return {Node[]}144 */145 var withClosestSiblings = function (node, pred) {146 pred = pred || func.ok;147 var siblings = [];148 if (node.previousSibling && pred(node.previousSibling)) {149 siblings.push(node.previousSibling);150 }151 siblings.push(node);152 if (node.nextSibling && pred(node.nextSibling)) {153 siblings.push(node.nextSibling);154 }155 return siblings;156 };157 /**158 * blank HTML for cursor position159 * - [workaround] old IE only works with &nbsp;160 * - [workaround] IE11 and other browser works with bogus br161 */162 var blankHTML = agent.isMSIE && agent.browserVersion < 11 ? '&nbsp;' : '<br>';163 /**164 * @method nodeLength165 *166 * returns #text's text size or element's childNodes size167 *168 * @param {Node} node169 */170 var nodeLength = function (node) {171 if (isText(node)) {172 return node.nodeValue.length;173 }174 175 if (node) {176 return node.childNodes.length;177 }178 179 return 0;180 181 };182 /**183 * returns whether node is empty or not.184 *185 * @param {Node} node186 * @return {Boolean}187 */188 var isEmpty = function (node) {189 var len = nodeLength(node);190 if (len === 0) {191 return true;192 } else if (!isText(node) && len === 1 && node.innerHTML === blankHTML) {193 // ex) <p><br></p>, <span><br></span>194 return true;195 } else if (list.all(node.childNodes, isText) && node.innerHTML === '') {196 // ex) <p></p>, <span></span>197 return true;198 }199 return false;200 };201 /**202 * padding blankHTML if node is empty (for cursor position)203 */204 var paddingBlankHTML = function (node) {205 if (!isVoid(node) && !nodeLength(node)) {206 node.innerHTML = blankHTML;207 }208 };209 /**210 * find nearest ancestor predicate hit211 *212 * @param {Node} node213 * @param {Function} pred - predicate function214 */215 var ancestor = function (node, pred) {216 while (node) {217 if (pred(node)) { return node; }218 if (isEditable(node)) { break; }219 node = node.parentNode;220 }221 return null;222 };223 /**224 * find nearest ancestor only single child blood line and predicate hit225 *226 * @param {Node} node227 * @param {Function} pred - predicate function228 */229 var singleChildAncestor = function (node, pred) {230 node = node.parentNode;231 while (node) {232 if (nodeLength(node) !== 1) { break; }233 if (pred(node)) { return node; }234 if (isEditable(node)) { break; }235 node = node.parentNode;236 }237 return null;238 };239 /**240 * returns new array of ancestor nodes (until predicate hit).241 *242 * @param {Node} node243 * @param {Function} [optional] pred - predicate function244 */245 var listAncestor = function (node, pred) {246 pred = pred || func.fail;247 var ancestors = [];248 ancestor(node, function (el) {249 if (!isEditable(el)) {250 ancestors.push(el);251 }252 return pred(el);253 });254 return ancestors;255 };256 /**257 * find farthest ancestor predicate hit258 */259 var lastAncestor = function (node, pred) {260 var ancestors = listAncestor(node);261 return list.last(ancestors.filter(pred));262 };263 /**264 * returns common ancestor node between two nodes.265 *266 * @param {Node} nodeA267 * @param {Node} nodeB268 */269 var commonAncestor = function (nodeA, nodeB) {270 var ancestors = listAncestor(nodeA);271 for (var n = nodeB; n; n = n.parentNode) {272 if ($.inArray(n, ancestors) > -1) { return n; }273 }274 return null; // difference document area275 };276 /**277 * listing all previous siblings (until predicate hit).278 *279 * @param {Node} node280 * @param {Function} [optional] pred - predicate function281 */282 var listPrev = function (node, pred) {283 pred = pred || func.fail;284 var nodes = [];285 while (node) {286 if (pred(node)) { break; }287 nodes.push(node);288 node = node.previousSibling;289 }290 return nodes;291 };292 /**293 * listing next siblings (until predicate hit).294 *295 * @param {Node} node296 * @param {Function} [pred] - predicate function297 */298 var listNext = function (node, pred) {299 pred = pred || func.fail;300 var nodes = [];301 while (node) {302 if (pred(node)) { break; }303 nodes.push(node);304 node = node.nextSibling;305 }306 return nodes;307 };308 /**309 * listing descendant nodes310 *311 * @param {Node} node312 * @param {Function} [pred] - predicate function313 */314 var listDescendant = function (node, pred) {315 var descendants = [];316 pred = pred || func.ok;317 // start DFS(depth first search) with node318 (function fnWalk(current) {319 if (node !== current && pred(current)) {320 descendants.push(current);321 }322 for (var idx = 0, len = current.childNodes.length; idx < len; idx++) {323 fnWalk(current.childNodes[idx]);324 }325 })(node);326 return descendants;327 };328 /**329 * wrap node with new tag.330 *331 * @param {Node} node332 * @param {Node} tagName of wrapper333 * @return {Node} - wrapper334 */335 var wrap = function (node, wrapperName) {336 var parent = node.parentNode;337 var wrapper = $('<' + wrapperName + '>')[0];338 parent.insertBefore(wrapper, node);339 wrapper.appendChild(node);340 return wrapper;341 };342 /**343 * insert node after preceding344 *345 * @param {Node} node346 * @param {Node} preceding - predicate function347 */348 var insertAfter = function (node, preceding) {349 var next = preceding.nextSibling, parent = preceding.parentNode;350 if (next) {351 parent.insertBefore(node, next);352 } else {353 parent.appendChild(node);354 }355 return node;356 };357 /**358 * append elements.359 *360 * @param {Node} node361 * @param {Collection} aChild362 */363 var appendChildNodes = function (node, aChild) {364 $.each(aChild, function (idx, child) {365 node.appendChild(child);366 });367 return node;368 };369 /**370 * returns whether boundaryPoint is left edge or not.371 *372 * @param {BoundaryPoint} point373 * @return {Boolean}374 */375 var isLeftEdgePoint = function (point) {376 return point.offset === 0;377 };378 /**379 * returns whether boundaryPoint is right edge or not.380 *381 * @param {BoundaryPoint} point382 * @return {Boolean}383 */384 var isRightEdgePoint = function (point) {385 return point.offset === nodeLength(point.node);386 };387 /**388 * returns whether boundaryPoint is edge or not.389 *390 * @param {BoundaryPoint} point391 * @return {Boolean}392 */393 var isEdgePoint = function (point) {394 return isLeftEdgePoint(point) || isRightEdgePoint(point);395 };396 /**397 * returns whether node is left edge of ancestor or not.398 *399 * @param {Node} node400 * @param {Node} ancestor401 * @return {Boolean}402 */403 var isLeftEdgeOf = function (node, ancestor) {404 while (node && node !== ancestor) {405 if (position(node) !== 0) {406 return false;407 }408 node = node.parentNode;409 }410 return true;411 };412 /**413 * returns whether node is right edge of ancestor or not.414 *415 * @param {Node} node416 * @param {Node} ancestor417 * @return {Boolean}418 */419 var isRightEdgeOf = function (node, ancestor) {420 if (!ancestor) {421 return false;422 }423 while (node && node !== ancestor) {424 if (position(node) !== nodeLength(node.parentNode) - 1) {425 return false;426 }427 node = node.parentNode;428 }429 return true;430 };431 /**432 * returns whether point is left edge of ancestor or not.433 * @param {BoundaryPoint} point434 * @param {Node} ancestor435 * @return {Boolean}436 */437 var isLeftEdgePointOf = function (point, ancestor) {438 return isLeftEdgePoint(point) && isLeftEdgeOf(point.node, ancestor);439 };440 /**441 * returns whether point is right edge of ancestor or not.442 * @param {BoundaryPoint} point443 * @param {Node} ancestor444 * @return {Boolean}445 */446 var isRightEdgePointOf = function (point, ancestor) {447 return isRightEdgePoint(point) && isRightEdgeOf(point.node, ancestor);448 };449 /**450 * returns offset from parent.451 *452 * @param {Node} node453 */454 var position = function (node) {455 var offset = 0;456 while ((node = node.previousSibling)) {457 offset += 1;458 }459 return offset;460 };461 var hasChildren = function (node) {462 return !!(node && node.childNodes && node.childNodes.length);463 };464 /**465 * returns previous boundaryPoint466 *467 * @param {BoundaryPoint} point468 * @param {Boolean} isSkipInnerOffset469 * @return {BoundaryPoint}470 */471 var prevPoint = function (point, isSkipInnerOffset) {472 var node, offset;473 if (point.offset === 0) {474 if (isEditable(point.node)) {475 return null;476 }477 node = point.node.parentNode;478 offset = position(point.node);479 } else if (hasChildren(point.node)) {480 node = point.node.childNodes[point.offset - 1];481 offset = nodeLength(node);482 } else {483 node = point.node;484 offset = isSkipInnerOffset ? 0 : point.offset - 1;485 }486 return {487 node: node,488 offset: offset489 };490 };491 /**492 * returns next boundaryPoint493 *494 * @param {BoundaryPoint} point495 * @param {Boolean} isSkipInnerOffset496 * @return {BoundaryPoint}497 */498 var nextPoint = function (point, isSkipInnerOffset) {499 var node, offset;500 if (nodeLength(point.node) === point.offset) {501 if (isEditable(point.node)) {502 return null;503 }504 node = point.node.parentNode;505 offset = position(point.node) + 1;506 } else if (hasChildren(point.node)) {507 node = point.node.childNodes[point.offset];508 offset = 0;509 } else {510 node = point.node;511 offset = isSkipInnerOffset ? nodeLength(point.node) : point.offset + 1;512 }513 return {514 node: node,515 offset: offset516 };517 };518 /**519 * returns whether pointA and pointB is same or not.520 *521 * @param {BoundaryPoint} pointA522 * @param {BoundaryPoint} pointB523 * @return {Boolean}524 */525 var isSamePoint = function (pointA, pointB) {526 return pointA.node === pointB.node && pointA.offset === pointB.offset;527 };528 /**529 * returns whether point is visible (can set cursor) or not.530 *531 * @param {BoundaryPoint} point532 * @return {Boolean}533 */534 var isVisiblePoint = function (point) {535 if (isText(point.node) || !hasChildren(point.node) || isEmpty(point.node)) {536 return true;537 }538 var leftNode = point.node.childNodes[point.offset - 1];539 var rightNode = point.node.childNodes[point.offset];540 if ((!leftNode || isVoid(leftNode)) && (!rightNode || isVoid(rightNode))) {541 return true;542 }543 return false;544 };545 /**546 * @method prevPointUtil547 *548 * @param {BoundaryPoint} point549 * @param {Function} pred550 * @return {BoundaryPoint}551 */552 var prevPointUntil = function (point, pred) {553 while (point) {554 if (pred(point)) {555 return point;556 }557 point = prevPoint(point);558 }559 return null;560 };561 /**562 * @method nextPointUntil563 *564 * @param {BoundaryPoint} point565 * @param {Function} pred566 * @return {BoundaryPoint}567 */568 var nextPointUntil = function (point, pred) {569 while (point) {570 if (pred(point)) {571 return point;572 }573 point = nextPoint(point);574 }575 return null;576 };577 /**578 * returns whether point has character or not.579 *580 * @param {Point} point581 * @return {Boolean}582 */583 var isCharPoint = function (point) {584 if (!isText(point.node)) {585 return false;586 }587 var ch = point.node.nodeValue.charAt(point.offset - 1);588 return ch && (ch !== ' ' && ch !== NBSP_CHAR);589 };590 /**591 * @method walkPoint592 *593 * @param {BoundaryPoint} startPoint594 * @param {BoundaryPoint} endPoint595 * @param {Function} handler596 * @param {Boolean} isSkipInnerOffset597 */598 var walkPoint = function (startPoint, endPoint, handler, isSkipInnerOffset) {599 var point = startPoint;600 while (point) {601 handler(point);602 if (isSamePoint(point, endPoint)) {603 break;604 }605 var isSkipOffset = isSkipInnerOffset &&606 startPoint.node !== point.node &&607 endPoint.node !== point.node;608 point = nextPoint(point, isSkipOffset);609 }610 };611 /**612 * @method makeOffsetPath613 *614 * return offsetPath(array of offset) from ancestor615 *616 * @param {Node} ancestor - ancestor node617 * @param {Node} node618 */619 var makeOffsetPath = function (ancestor, node) {620 var ancestors = listAncestor(node, func.eq(ancestor));621 return ancestors.map(position).reverse();622 };623 /**624 * @method fromOffsetPath625 *626 * return element from offsetPath(array of offset)627 *628 * @param {Node} ancestor - ancestor node629 * @param {array} offsets - offsetPath630 */631 var fromOffsetPath = function (ancestor, offsets) {632 var current = ancestor;633 for (var i = 0, len = offsets.length; i < len; i++) {634 if (current.childNodes.length <= offsets[i]) {635 current = current.childNodes[current.childNodes.length - 1];636 } else {637 current = current.childNodes[offsets[i]];638 }639 }640 return current;641 };642 /**643 * @method splitNode644 *645 * split element or #text646 *647 * @param {BoundaryPoint} point648 * @param {Object} [options]649 * @param {Boolean} [options.isSkipPaddingBlankHTML] - default: false650 * @param {Boolean} [options.isNotSplitEdgePoint] - default: false651 * @return {Node} right node of boundaryPoint652 */653 var splitNode = function (point, options) {654 var isSkipPaddingBlankHTML = options && options.isSkipPaddingBlankHTML;655 var isNotSplitEdgePoint = options && options.isNotSplitEdgePoint;656 // edge case657 if (isEdgePoint(point) && (isText(point.node) || isNotSplitEdgePoint)) {658 if (isLeftEdgePoint(point)) {659 return point.node;660 } else if (isRightEdgePoint(point)) {661 return point.node.nextSibling;662 }663 }664 // split #text665 if (isText(point.node)) {666 return point.node.splitText(point.offset);667 } else {668 var childNode = point.node.childNodes[point.offset];669 var clone = insertAfter(point.node.cloneNode(false), point.node);670 appendChildNodes(clone, listNext(childNode));671 if (!isSkipPaddingBlankHTML) {672 paddingBlankHTML(point.node);673 paddingBlankHTML(clone);674 }675 return clone;676 }677 };678 /**679 * @method splitTree680 *681 * split tree by point682 *683 * @param {Node} root - split root684 * @param {BoundaryPoint} point685 * @param {Object} [options]686 * @param {Boolean} [options.isSkipPaddingBlankHTML] - default: false687 * @param {Boolean} [options.isNotSplitEdgePoint] - default: false688 * @return {Node} right node of boundaryPoint689 */690 var splitTree = function (root, point, options) {691 // ex) [#text, <span>, <p>]692 var ancestors = listAncestor(point.node, func.eq(root));693 if (!ancestors.length) {694 return null;695 } else if (ancestors.length === 1) {696 return splitNode(point, options);697 }698 return ancestors.reduce(function (node, parent) {699 if (node === point.node) {700 node = splitNode(point, options);701 }702 return splitNode({703 node: parent,704 offset: node ? dom.position(node) : nodeLength(parent)705 }, options);706 });707 };708 /**709 * split point710 *711 * @param {Point} point712 * @param {Boolean} isInline713 * @return {Object}714 */715 var splitPoint = function (point, isInline) {716 // find splitRoot, container717 // - inline: splitRoot is a child of paragraph718 // - block: splitRoot is a child of bodyContainer719 var pred = isInline ? isPara : isBodyContainer;720 var ancestors = listAncestor(point.node, pred);721 var topAncestor = list.last(ancestors) || point.node;722 var splitRoot, container;723 if (pred(topAncestor)) {724 splitRoot = ancestors[ancestors.length - 2];725 container = topAncestor;726 } else {727 splitRoot = topAncestor;728 container = splitRoot.parentNode;729 }730 // if splitRoot is exists, split with splitTree731 var pivot = splitRoot && splitTree(splitRoot, point, {732 isSkipPaddingBlankHTML: isInline,733 isNotSplitEdgePoint: isInline734 });735 // if container is point.node, find pivot with point.offset736 if (!pivot && container === point.node) {737 pivot = point.node.childNodes[point.offset];738 }739 return {740 rightNode: pivot,741 container: container742 };743 };744 var create = function (nodeName) {745 return document.createElement(nodeName);746 };747 var createText = function (text) {748 return document.createTextNode(text);749 };750 /**751 * @method remove752 *753 * remove node, (isRemoveChild: remove child or not)754 *755 * @param {Node} node756 * @param {Boolean} isRemoveChild757 */758 var remove = function (node, isRemoveChild) {759 if (!node || !node.parentNode) { return; }760 if (node.removeNode) { return node.removeNode(isRemoveChild); }761 var parent = node.parentNode;762 if (!isRemoveChild) {763 var nodes = [];764 var i, len;765 for (i = 0, len = node.childNodes.length; i < len; i++) {766 nodes.push(node.childNodes[i]);767 }768 for (i = 0, len = nodes.length; i < len; i++) {769 parent.insertBefore(nodes[i], node);770 }771 }772 parent.removeChild(node);773 };774 /**775 * @method removeWhile776 *777 * @param {Node} node778 * @param {Function} pred779 */780 var removeWhile = function (node, pred) {781 while (node) {782 if (isEditable(node) || !pred(node)) {783 break;784 }785 var parent = node.parentNode;786 remove(node);787 node = parent;788 }789 };790 /**791 * @method replace792 *793 * replace node with provided nodeName794 *795 * @param {Node} node796 * @param {String} nodeName797 * @return {Node} - new node798 */799 var replace = function (node, nodeName) {800 if (node.nodeName.toUpperCase() === nodeName.toUpperCase()) {801 return node;802 }803 var newNode = create(nodeName);804 if (node.style.cssText) {805 newNode.style.cssText = node.style.cssText;806 }807 appendChildNodes(newNode, list.from(node.childNodes));808 insertAfter(newNode, node);809 remove(node);810 return newNode;811 };812 var isTextarea = makePredByNodeName('TEXTAREA');813 /**814 * @param {jQuery} $node815 * @param {Boolean} [stripLinebreaks] - default: false816 */817 var value = function ($node, stripLinebreaks) {818 var val = isTextarea($node[0]) ? $node.val() : $node.html();819 if (stripLinebreaks) {820 return val.replace(/[\n\r]/g, '');821 }822 return val;823 };824 /**825 * @method html826 *827 * get the HTML contents of node828 *829 * @param {jQuery} $node830 * @param {Boolean} [isNewlineOnBlock]831 */832 var html = function ($node, isNewlineOnBlock) {833 var markup = value($node);834 if (isNewlineOnBlock) {835 var regexTag = /<(\/?)(\b(?!!)[^>\s]*)(.*?)(\s*\/?>)/g;836 markup = markup.replace(regexTag, function (match, endSlash, name) {837 name = name.toUpperCase();838 var isEndOfInlineContainer = /^DIV|^TD|^TH|^P|^LI|^H[1-7]/.test(name) &&839 !!endSlash;840 var isBlockNode = /^BLOCKQUOTE|^TABLE|^TBODY|^TR|^HR|^UL|^OL/.test(name);841 return match + ((isEndOfInlineContainer || isBlockNode) ? '\n' : '');842 });843 markup = $.trim(markup);844 }845 return markup;846 };847 var posFromPlaceholder = function (placeholder) {848 var $placeholder = $(placeholder);849 var pos = $placeholder.offset();850 var height = $placeholder.outerHeight(true); // include margin851 return {852 left: pos.left,853 top: pos.top + height854 };855 };856 var attachEvents = function ($node, events) {857 Object.keys(events).forEach(function (key) {858 $node.on(key, events[key]);859 });860 };861 var detachEvents = function ($node, events) {862 Object.keys(events).forEach(function (key) {863 $node.off(key, events[key]);864 });865 };866 return {867 /** @property {String} NBSP_CHAR */868 NBSP_CHAR: NBSP_CHAR,869 /** @property {String} ZERO_WIDTH_NBSP_CHAR */870 ZERO_WIDTH_NBSP_CHAR: ZERO_WIDTH_NBSP_CHAR,871 /** @property {String} blank */872 blank: blankHTML,873 /** @property {String} emptyPara */874 emptyPara: '<p>' + blankHTML + '</p>',875 makePredByNodeName: makePredByNodeName,876 isEditable: isEditable,877 isControlSizing: isControlSizing,878 isText: isText,879 isElement: isElement,880 isVoid: isVoid,881 isPara: isPara,882 isPurePara: isPurePara,883 isHeading: isHeading,884 isInline: isInline,885 isBlock: func.not(isInline),886 isBodyInline: isBodyInline,887 isBody: isBody,888 isParaInline: isParaInline,889 isPre: isPre,890 isList: isList,891 isTable: isTable,892 isData: isData,893 isCell: isCell,894 isBlockquote: isBlockquote,895 isBodyContainer: isBodyContainer,896 isAnchor: isAnchor,897 isDiv: makePredByNodeName('DIV'),898 isLi: isLi,899 isBR: makePredByNodeName('BR'),900 isSpan: makePredByNodeName('SPAN'),901 isB: makePredByNodeName('B'),902 isU: makePredByNodeName('U'),903 isS: makePredByNodeName('S'),904 isI: makePredByNodeName('I'),905 isImg: makePredByNodeName('IMG'),906 isTextarea: isTextarea,907 isEmpty: isEmpty,908 isEmptyAnchor: func.and(isAnchor, isEmpty),909 isClosestSibling: isClosestSibling,910 withClosestSiblings: withClosestSiblings,911 nodeLength: nodeLength,912 isLeftEdgePoint: isLeftEdgePoint,913 isRightEdgePoint: isRightEdgePoint,914 isEdgePoint: isEdgePoint,915 isLeftEdgeOf: isLeftEdgeOf,916 isRightEdgeOf: isRightEdgeOf,917 isLeftEdgePointOf: isLeftEdgePointOf,918 isRightEdgePointOf: isRightEdgePointOf,919 prevPoint: prevPoint,920 nextPoint: nextPoint,921 isSamePoint: isSamePoint,922 isVisiblePoint: isVisiblePoint,923 prevPointUntil: prevPointUntil,924 nextPointUntil: nextPointUntil,925 isCharPoint: isCharPoint,926 walkPoint: walkPoint,927 ancestor: ancestor,928 singleChildAncestor: singleChildAncestor,929 listAncestor: listAncestor,930 lastAncestor: lastAncestor,931 listNext: listNext,932 listPrev: listPrev,933 listDescendant: listDescendant,934 commonAncestor: commonAncestor,935 wrap: wrap,936 insertAfter: insertAfter,937 appendChildNodes: appendChildNodes,938 position: position,939 hasChildren: hasChildren,940 makeOffsetPath: makeOffsetPath,941 fromOffsetPath: fromOffsetPath,942 splitTree: splitTree,943 splitPoint: splitPoint,944 create: create,945 createText: createText,946 remove: remove,947 removeWhile: removeWhile,948 replace: replace,949 html: html,950 value: value,951 posFromPlaceholder: posFromPlaceholder,952 attachEvents: attachEvents,953 detachEvents: detachEvents954 };955 })();956 return dom;...

Full Screen

Full Screen

NodeMaterialLoader.js

Source:NodeMaterialLoader.js Github

copy

Full Screen

1/**2 * @author sunag / http://www.sunag.com.br/3 */4THREE.NodeMaterialLoader = function ( manager, library ) {5 this.manager = ( manager !== undefined ) ? manager : THREE.DefaultLoadingManager;6 this.nodes = {};7 this.materials = {};8 this.passes = {};9 this.names = {};10 this.library = library || {};11};12THREE.NodeMaterialLoaderUtils = {13 replaceUUIDObject: function ( object, uuid, value, recursive ) {14 recursive = recursive !== undefined ? recursive : true;15 if ( typeof uuid === "object" ) uuid = uuid.uuid;16 if ( typeof object === "object" ) {17 var keys = Object.keys( object );18 for ( var i = 0; i < keys.length; i ++ ) {19 var key = keys[ i ];20 if ( recursive ) {21 object[ key ] = this.replaceUUIDObject( object[ key ], uuid, value );22 }23 if ( key === uuid ) {24 object[ uuid ] = object[ key ];25 delete object[ key ];26 }27 }28 }29 return object === uuid ? value : object;30 },31 replaceUUID: function ( json, uuid, value ) {32 this.replaceUUIDObject( json, uuid, value, false );33 this.replaceUUIDObject( json.nodes, uuid, value );34 this.replaceUUIDObject( json.materials, uuid, value );35 this.replaceUUIDObject( json.passes, uuid, value );36 this.replaceUUIDObject( json.library, uuid, value, false );37 return json;38 }39};40Object.assign( THREE.NodeMaterialLoader.prototype, {41 load: function ( url, onLoad, onProgress, onError ) {42 var scope = this;43 var loader = new THREE.FileLoader( scope.manager );44 loader.load( url, function ( text ) {45 onLoad( scope.parse( JSON.parse( text ) ) );46 }, onProgress, onError );47 return this;48 },49 getObjectByName: function ( uuid ) {50 return this.names[ uuid ];51 },52 getObjectById: function ( uuid ) {53 return this.library[ uuid ] || this.nodes[ uuid ] || this.names[ uuid ];54 },55 getNode: function ( uuid ) {56 var object = this.getObjectById( uuid );57 if ( ! object ) {58 console.warn( "Node \"" + uuid + "\" not found." );59 }60 return object;61 },62 parse: function ( json ) {63 var uuid, node, object, prop, i;64 for ( uuid in json.nodes ) {65 node = json.nodes[ uuid ];66 object = new THREE[ node.type ]();67 if ( node.name ) {68 object.name = node.name;69 this.names[ object.name ] = object;70 } else {71 // ignore "uniform" shader input ( for optimization )72 object.readonly = true;73 }74 if ( node.readonly !== undefined ) object.readonly = node.readonly;75 this.nodes[ uuid ] = object;76 }77 for ( uuid in json.materials ) {78 node = json.materials[ uuid ];79 object = new THREE[ node.type ]();80 if ( node.name ) {81 object.name = node.name;82 this.names[ object.name ] = object;83 }84 this.materials[ uuid ] = object;85 }86 for ( uuid in json.passes ) {87 node = json.passes[ uuid ];88 object = new THREE[ node.type ]();89 if ( node.name ) {90 object.name = node.name;91 this.names[ object.name ] = object;92 }93 this.passes[ uuid ] = object;94 }95 if ( json.material ) this.material = this.materials[ uuid ];96 if ( json.pass ) this.pass = this.passes[ uuid ];97 for ( uuid in json.nodes ) {98 node = json.nodes[ uuid ];99 object = this.nodes[ uuid ];100 switch ( node.type ) {101 case "FloatNode":102 object.number = node.number;103 break;104 case "ColorNode":105 object.value.copy( node );106 break;107 case "Vector2Node":108 object.x = node.x;109 object.y = node.y;110 break;111 case "Vector3Node":112 object.x = node.x;113 object.y = node.y;114 object.z = node.z;115 break;116 case "Vector4Node":117 object.x = node.x;118 object.y = node.y;119 object.z = node.z;120 object.w = node.w;121 break;122 case "Matrix3Node":123 case "Matrix4Node":124 object.value.fromArray( node.elements );125 break;126 case "OperatorNode":127 object.a = this.getNode( node.a );128 object.b = this.getNode( node.b );129 object.op = node.op;130 break;131 case "Math1Node":132 object.a = this.getNode( node.a );133 object.method = node.method;134 break;135 case "Math2Node":136 object.a = this.getNode( node.a );137 object.b = this.getNode( node.b );138 object.method = node.method;139 break;140 case "Math3Node":141 object.a = this.getNode( node.a );142 object.b = this.getNode( node.b );143 object.c = this.getNode( node.c );144 object.method = node.method;145 break;146 case "UVNode":147 case "ColorsNode":148 object.index = node.index;149 break;150 case "LuminanceNode":151 object.rgb = this.getNode( node.rgb );152 break;153 case "PositionNode":154 case "NormalNode":155 case "ReflectNode":156 case "LightNode":157 object.scope = node.scope;158 break;159 case "SwitchNode":160 object.node = this.getNode( node.node );161 object.components = node.components;162 break;163 case "JoinNode":164 for ( prop in node.inputs ) {165 object[ prop ] = this.getNode( node.inputs[ prop ] );166 }167 break;168 case "CameraNode":169 object.setScope( node.scope );170 if ( node.camera ) object.setCamera( this.getNode( node.camera ) );171 switch ( node.scope ) {172 case THREE.CameraNode.DEPTH:173 object.near.number = node.near;174 object.far.number = node.far;175 break;176 }177 break;178 case "ColorAdjustmentNode":179 object.rgb = this.getNode( node.rgb );180 object.adjustment = this.getNode( node.adjustment );181 object.method = node.method;182 break;183 case "UVTransformNode":184 object.uv = this.getNode( node.uv );185 object.transform = this.getNode( node.transform );186 break;187 case "BumpNode":188 object.value = this.getNode( node.value );189 object.coord = this.getNode( node.coord );190 object.scale = this.getNode( node.scale );191 break;192 case "BlurNode":193 object.value = this.getNode( node.value );194 object.coord = this.getNode( node.coord );195 object.scale = this.getNode( node.scale );196 object.value = this.getNode( node.value );197 object.coord = this.getNode( node.coord );198 object.radius = this.getNode( node.radius );199 if ( node.size !== undefined ) object.size = new THREE.Vector2( node.size.x, node.size.y );200 object.blurX = node.blurX;201 object.blurY = node.blurY;202 break;203 case "ResolutionNode":204 object.renderer = this.getNode( node.renderer );205 break;206 case "ScreenUVNode":207 object.resolution = this.getNode( node.resolution );208 break;209 case "VelocityNode":210 if ( node.target ) object.setTarget( this.getNode( node.target ) );211 object.setParams( node.params );212 break;213 case "TimerNode":214 object.scope = node.scope;215 object.scale = node.scale;216 break;217 case "ConstNode":218 object.name = node.name;219 object.type = node.out;220 object.value = node.value;221 object.useDefine = node.useDefine === true;222 break;223 case "AttributeNode":224 case "VarNode":225 object.type = node.out;226 break;227 case "ReflectorNode":228 object.setMirror( this.getNode( node.mirror ) );229 if ( node.offset ) object.offset = this.getNode( node.offset );230 break;231 case "NoiseNode":232 object.coord = this.getNode( node.coord );233 break;234 case "FunctionNode":235 object.isMethod = node.isMethod;236 object.useKeywords = node.useKeywords;237 object.extensions = node.extensions;238 object.keywords = {};239 for ( prop in node.keywords ) {240 object.keywords[ prop ] = this.getNode( node.keywords[ prop ] );241 }242 if ( node.includes ) {243 for ( i = 0; i < node.includes.length; i ++ ) {244 object.includes.push( this.getNode( node.includes[ i ] ) );245 }246 }247 object.eval( node.src, object.includes, object.extensions, object.keywords );248 if ( ! object.isMethod ) object.type = node.out;249 break;250 case "FunctionCallNode":251 for ( prop in node.inputs ) {252 object.inputs[ prop ] = this.getNode( node.inputs[ prop ] );253 }254 object.value = this.getNode( node.value );255 break;256 case "TextureNode":257 case "CubeTextureNode":258 case "ScreenNode":259 if ( node.value ) object.value = this.getNode( node.value );260 object.coord = this.getNode( node.coord );261 if ( node.bias ) object.bias = this.getNode( node.bias );262 if ( object.project !== undefined ) object.project = node.project;263 break;264 case "RoughnessToBlinnExponentNode":265 break;266 case "RawNode":267 object.value = this.getNode( node.value );268 break;269 case "StandardNode":270 case "PhongNode":271 case "SpriteNode":272 object.color = this.getNode( node.color );273 if ( node.alpha ) object.alpha = this.getNode( node.alpha );274 if ( node.specular ) object.specular = this.getNode( node.specular );275 if ( node.shininess ) object.shininess = this.getNode( node.shininess );276 if ( node.roughness ) object.roughness = this.getNode( node.roughness );277 if ( node.metalness ) object.metalness = this.getNode( node.metalness );278 if ( node.reflectivity ) object.reflectivity = this.getNode( node.reflectivity );279 if ( node.clearCoat ) object.clearCoat = this.getNode( node.clearCoat );280 if ( node.clearCoatRoughness ) object.clearCoatRoughness = this.getNode( node.clearCoatRoughness );281 if ( node.normal ) object.normal = this.getNode( node.normal );282 if ( node.normalScale ) object.normalScale = this.getNode( node.normalScale );283 if ( node.emissive ) object.emissive = this.getNode( node.emissive );284 if ( node.ambient ) object.ambient = this.getNode( node.ambient );285 if ( node.shadow ) object.shadow = this.getNode( node.shadow );286 if ( node.light ) object.light = this.getNode( node.light );287 if ( node.ao ) object.ao = this.getNode( node.ao );288 if ( node.environment ) object.environment = this.getNode( node.environment );289 if ( node.environmentAlpha ) object.environmentAlpha = this.getNode( node.environmentAlpha );290 if ( node.transform ) object.transform = this.getNode( node.transform );291 if ( node.spherical === false ) object.spherical = false;292 break;293 default:294 console.warn( node.type, "not supported." );295 }296 }297 for ( uuid in json.materials ) {298 node = json.materials[ uuid ];299 object = this.materials[ uuid ];300 if ( node.name !== undefined ) object.name = node.name;301 if ( node.blending !== undefined ) object.blending = node.blending;302 if ( node.flatShading !== undefined ) object.flatShading = node.flatShading;303 if ( node.side !== undefined ) object.side = node.side;