Socket
Socket
Sign inDemoInstall

hermes-transform

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hermes-transform - npm Package Compare versions

Comparing version 0.8.0 to 0.9.0

dist/generated/TransformModifySignatures.js.flow

116

dist/detachedNode.js

@@ -6,4 +6,7 @@ "use strict";

});
exports.asDetachedNode = void 0;
exports.deepCloneNode = deepCloneNode;
exports.detachedProps = detachedProps;
exports.getOriginalNode = getOriginalNode;
exports.isDetachedNode = isDetachedNode;
exports.setParentPointersInDirectChildren = setParentPointersInDirectChildren;

@@ -26,22 +29,89 @@ exports.shallowCloneNode = shallowCloneNode;

*/
// used by the node type function codegen
function detachedProps(parent, props) {
// $FlowExpectedError[incompatible-return]
return { ...props,
const DETACHED_MARKER = Symbol.for('hermes-transform - Detached AST Node');
const ORIGINAL_NODE = Symbol.for('hermes-transform - Original Node');
function isDetachedNode(node) {
// $FlowExpectedError[invalid-in-lhs] flow doesn't support symbols as keys
return DETACHED_MARKER in node;
}
function getOriginalNode(node) {
// $FlowExpectedError[prop-missing]
return node[ORIGINAL_NODE];
}
const asDetachedNode = (node, {
useDeepClone
} = {
useDeepClone: false
}) => {
if (node == null) {
return null;
}
if (isDetachedNode(node)) {
return node;
}
return useDeepClone ? deepCloneNode(node, {}) : shallowCloneNode(node, {});
}; // used by the node type function codegen
exports.asDetachedNode = asDetachedNode;
function detachedProps(parent, props, config = { ...null
}) {
// $FlowExpectedError[incompatible-type]
const detachedNode = { ...props,
...((config == null ? void 0 : config.preserveLocation) !== true ? {
// if this is [0,0] AND the file has a docblock then prettier will insert newlines between
// certain detached nodes. Because of "intended" formatting behaviour (https://github.com/prettier/prettier/issues/12078)
// this can cause us to output weirdly formatted code that should have been collapsed.
//
// prettier works backwards from the position you give it to find newlines or non whitespace
// tokens and uses this to determine if newlines should be inserted between nodes.
// By placing the range at [1, 1] we can ensure a token is always found before a newline
// and therefore no newlines will be placed between nodes.
//
// NOTE: we will still run into the bug if there is weird code like a docblock with whitespace
// characters before it. However we assume this isn't going to happen because any file
// already formatted by prettier will have that whitespace removed.
// We considered a more complex solution involving traversing the AST and manually updating
// detached node ranges after mutations are applied - however this is a lot heavier and will
// probably never be needed.
range: [1, 1],
loc: {
start: {
line: 1,
column: 0
},
end: {
line: 1,
column: 0
}
}
} : {}),
// if not provided, then we purposely don't set this here
// and will rely on the tooling to update it as appropriate.
// nothing should be reading from this before it's set anyway.
parent: parent,
range: [0, 0],
loc: {
start: {
line: 1,
column: 0
},
end: {
line: 1,
column: 0
}
}
};
parent: parent
}; // mark the node as detached
Object.defineProperty(detachedNode, DETACHED_MARKER, {
configurable: false,
enumerable: false,
value: true,
writable: false
});
if (config.originalNode) {
Object.defineProperty(detachedNode, ORIGINAL_NODE, {
configurable: false,
enumerable: false,
value: config.originalNode,
writable: false
});
}
return detachedNode;
}

@@ -53,4 +123,10 @@ /**

function shallowCloneNode(node, newProps = {}) {
return detachedProps(null, Object.assign({}, node, newProps));
function shallowCloneNode(node, newProps, config = { ...null
}) {
var _config$preserveLocat, _config$originalNode;
return detachedProps(null, Object.assign({}, node, newProps), {
preserveLocation: (_config$preserveLocat = config.preserveLocation) != null ? _config$preserveLocat : true,
originalNode: (_config$originalNode = config.originalNode) != null ? _config$originalNode : node
});
}

@@ -62,3 +138,3 @@ /**

function deepCloneNode(node, newProps = {}) {
function deepCloneNode(node, newProps) {
const clone = Object.assign(JSON.parse(JSON.stringify(node, (key, value) => {

@@ -65,0 +141,0 @@ // null out parent pointers

1479

dist/generated/node-types.js

@@ -38,3 +38,2 @@ /**

ClassBody: true,
ClassDeclaration: true,
ClassExpression: true,

@@ -187,3 +186,2 @@ ClassImplements: true,

exports.ClassBody = ClassBody;
exports.ClassDeclaration = ClassDeclaration;
exports.ClassExpression = ClassExpression;

@@ -330,6 +328,5 @@ exports.ClassImplements = ClassImplements;

function AnyTypeAnnotation({
parent
} = {}) {
return (0, _detachedNode.detachedProps)(parent, {
function AnyTypeAnnotation(props = { ...null
}) {
return (0, _detachedNode.detachedProps)(props.parent, {
type: 'AnyTypeAnnotation'

@@ -339,9 +336,7 @@ });

function ArrayExpression({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function ArrayExpression(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'ArrayExpression',
...props
elements: props.elements.map(n => (0, _detachedNode.asDetachedNode)(n)),
trailingComma: props.trailingComma
});

@@ -352,9 +347,7 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function ArrayPattern({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function ArrayPattern(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'ArrayPattern',
...props
elements: props.elements.map(n => (0, _detachedNode.asDetachedNode)(n)),
typeAnnotation: (0, _detachedNode.asDetachedNode)(props.typeAnnotation)
});

@@ -365,9 +358,6 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function ArrayTypeAnnotation({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function ArrayTypeAnnotation(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'ArrayTypeAnnotation',
...props
elementType: (0, _detachedNode.asDetachedNode)(props.elementType)
});

@@ -378,9 +368,8 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function AssignmentExpression({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function AssignmentExpression(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'AssignmentExpression',
...props
operator: props.operator,
left: (0, _detachedNode.asDetachedNode)(props.left),
right: (0, _detachedNode.asDetachedNode)(props.right)
});

@@ -391,9 +380,7 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function AssignmentPattern({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function AssignmentPattern(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'AssignmentPattern',
...props
left: (0, _detachedNode.asDetachedNode)(props.left),
right: (0, _detachedNode.asDetachedNode)(props.right)
});

@@ -404,9 +391,6 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function AwaitExpression({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function AwaitExpression(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'AwaitExpression',
...props
argument: (0, _detachedNode.asDetachedNode)(props.argument)
});

@@ -417,9 +401,6 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function BigIntLiteralTypeAnnotation({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function BigIntLiteralTypeAnnotation(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'BigIntLiteralTypeAnnotation',
...props
raw: props.raw
});

@@ -430,9 +411,8 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function BinaryExpression({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function BinaryExpression(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'BinaryExpression',
...props
left: (0, _detachedNode.asDetachedNode)(props.left),
right: (0, _detachedNode.asDetachedNode)(props.right),
operator: props.operator
});

@@ -443,9 +423,6 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function BlockStatement({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function BlockStatement(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'BlockStatement',
...props
body: props.body.map(n => (0, _detachedNode.asDetachedNode)(n))
});

@@ -456,9 +433,7 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function BooleanLiteralTypeAnnotation({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function BooleanLiteralTypeAnnotation(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'BooleanLiteralTypeAnnotation',
...props
value: props.value,
raw: props.raw
});

@@ -469,6 +444,5 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function BooleanTypeAnnotation({
parent
} = {}) {
return (0, _detachedNode.detachedProps)(parent, {
function BooleanTypeAnnotation(props = { ...null
}) {
return (0, _detachedNode.detachedProps)(props.parent, {
type: 'BooleanTypeAnnotation'

@@ -478,9 +452,6 @@ });

function BreakStatement({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function BreakStatement(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'BreakStatement',
...props
label: (0, _detachedNode.asDetachedNode)(props.label)
});

@@ -491,9 +462,8 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function CallExpression({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function CallExpression(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'CallExpression',
...props
callee: (0, _detachedNode.asDetachedNode)(props.callee),
typeArguments: (0, _detachedNode.asDetachedNode)(props.typeArguments),
arguments: props.arguments.map(n => (0, _detachedNode.asDetachedNode)(n))
});

@@ -504,9 +474,7 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function CatchClause({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function CatchClause(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'CatchClause',
...props
param: (0, _detachedNode.asDetachedNode)(props.param),
body: (0, _detachedNode.asDetachedNode)(props.body)
});

@@ -517,9 +485,6 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function ChainExpression({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function ChainExpression(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'ChainExpression',
...props
expression: (0, _detachedNode.asDetachedNode)(props.expression)
});

@@ -530,9 +495,6 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function ClassBody({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function ClassBody(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'ClassBody',
...props
body: props.body.map(n => (0, _detachedNode.asDetachedNode)(n))
});

@@ -543,21 +505,12 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function ClassDeclaration({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
type: 'ClassDeclaration',
...props
});
(0, _detachedNode.setParentPointersInDirectChildren)(node);
return node;
}
function ClassExpression({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function ClassExpression(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'ClassExpression',
...props
id: (0, _detachedNode.asDetachedNode)(props.id),
typeParameters: (0, _detachedNode.asDetachedNode)(props.typeParameters),
superClass: (0, _detachedNode.asDetachedNode)(props.superClass),
superTypeParameters: (0, _detachedNode.asDetachedNode)(props.superTypeParameters),
implements: props.implements.map(n => (0, _detachedNode.asDetachedNode)(n)),
decorators: props.decorators.map(n => (0, _detachedNode.asDetachedNode)(n)),
body: (0, _detachedNode.asDetachedNode)(props.body)
});

@@ -568,9 +521,7 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function ClassImplements({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function ClassImplements(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'ClassImplements',
...props
id: (0, _detachedNode.asDetachedNode)(props.id),
typeParameters: (0, _detachedNode.asDetachedNode)(props.typeParameters)
});

@@ -581,9 +532,8 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function ConditionalExpression({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function ConditionalExpression(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'ConditionalExpression',
...props
test: (0, _detachedNode.asDetachedNode)(props.test),
alternate: (0, _detachedNode.asDetachedNode)(props.alternate),
consequent: (0, _detachedNode.asDetachedNode)(props.consequent)
});

@@ -594,9 +544,6 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function ContinueStatement({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function ContinueStatement(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'ContinueStatement',
...props
label: (0, _detachedNode.asDetachedNode)(props.label)
});

@@ -607,6 +554,5 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function DebuggerStatement({
parent
} = {}) {
return (0, _detachedNode.detachedProps)(parent, {
function DebuggerStatement(props = { ...null
}) {
return (0, _detachedNode.detachedProps)(props.parent, {
type: 'DebuggerStatement'

@@ -616,9 +562,11 @@ });

function DeclareClass({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function DeclareClass(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'DeclareClass',
...props
id: (0, _detachedNode.asDetachedNode)(props.id),
typeParameters: (0, _detachedNode.asDetachedNode)(props.typeParameters),
extends: props.extends.map(n => (0, _detachedNode.asDetachedNode)(n)),
implements: props.implements.map(n => (0, _detachedNode.asDetachedNode)(n)),
mixins: props.mixins.map(n => (0, _detachedNode.asDetachedNode)(n)),
body: (0, _detachedNode.asDetachedNode)(props.body)
});

@@ -629,9 +577,6 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function DeclaredPredicate({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function DeclaredPredicate(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'DeclaredPredicate',
...props
value: (0, _detachedNode.asDetachedNode)(props.value)
});

@@ -642,9 +587,6 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function DeclareExportAllDeclaration({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function DeclareExportAllDeclaration(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'DeclareExportAllDeclaration',
...props
source: (0, _detachedNode.asDetachedNode)(props.source)
});

@@ -655,9 +597,9 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function DeclareExportDeclaration({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function DeclareExportDeclaration(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'DeclareExportDeclaration',
...props
declaration: (0, _detachedNode.asDetachedNode)(props.declaration),
specifiers: props.specifiers.map(n => (0, _detachedNode.asDetachedNode)(n)),
source: (0, _detachedNode.asDetachedNode)(props.source),
default: props.default
});

@@ -668,9 +610,7 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function DeclareFunction({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function DeclareFunction(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'DeclareFunction',
...props
id: (0, _detachedNode.asDetachedNode)(props.id),
predicate: (0, _detachedNode.asDetachedNode)(props.predicate)
});

@@ -681,9 +621,9 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function DeclareInterface({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function DeclareInterface(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'DeclareInterface',
...props
id: (0, _detachedNode.asDetachedNode)(props.id),
typeParameters: (0, _detachedNode.asDetachedNode)(props.typeParameters),
extends: props.extends.map(n => (0, _detachedNode.asDetachedNode)(n)),
body: (0, _detachedNode.asDetachedNode)(props.body)
});

@@ -694,9 +634,8 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function DeclareModule({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function DeclareModule(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'DeclareModule',
...props
id: (0, _detachedNode.asDetachedNode)(props.id),
body: (0, _detachedNode.asDetachedNode)(props.body),
kind: props.kind
});

@@ -707,9 +646,6 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function DeclareModuleExports({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function DeclareModuleExports(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'DeclareModuleExports',
...props
typeAnnotation: (0, _detachedNode.asDetachedNode)(props.typeAnnotation)
});

@@ -720,9 +656,9 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function DeclareOpaqueType({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function DeclareOpaqueType(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'DeclareOpaqueType',
...props
id: (0, _detachedNode.asDetachedNode)(props.id),
typeParameters: (0, _detachedNode.asDetachedNode)(props.typeParameters),
impltype: (0, _detachedNode.asDetachedNode)(props.impltype),
supertype: (0, _detachedNode.asDetachedNode)(props.supertype)
});

@@ -733,9 +669,8 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function DeclareTypeAlias({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function DeclareTypeAlias(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'DeclareTypeAlias',
...props
id: (0, _detachedNode.asDetachedNode)(props.id),
typeParameters: (0, _detachedNode.asDetachedNode)(props.typeParameters),
right: (0, _detachedNode.asDetachedNode)(props.right)
});

@@ -746,9 +681,6 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function DeclareVariable({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function DeclareVariable(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'DeclareVariable',
...props
id: (0, _detachedNode.asDetachedNode)(props.id)
});

@@ -759,9 +691,7 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function DoWhileStatement({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function DoWhileStatement(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'DoWhileStatement',
...props
body: (0, _detachedNode.asDetachedNode)(props.body),
test: (0, _detachedNode.asDetachedNode)(props.test)
});

@@ -772,6 +702,5 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function EmptyStatement({
parent
} = {}) {
return (0, _detachedNode.detachedProps)(parent, {
function EmptyStatement(props = { ...null
}) {
return (0, _detachedNode.detachedProps)(props.parent, {
type: 'EmptyStatement'

@@ -781,6 +710,5 @@ });

function EmptyTypeAnnotation({
parent
} = {}) {
return (0, _detachedNode.detachedProps)(parent, {
function EmptyTypeAnnotation(props = { ...null
}) {
return (0, _detachedNode.detachedProps)(props.parent, {
type: 'EmptyTypeAnnotation'

@@ -790,9 +718,8 @@ });

function EnumBooleanBody({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function EnumBooleanBody(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'EnumBooleanBody',
...props
members: props.members.map(n => (0, _detachedNode.asDetachedNode)(n)),
explicitType: props.explicitType,
hasUnknownMembers: props.hasUnknownMembers
});

@@ -803,9 +730,7 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function EnumBooleanMember({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function EnumBooleanMember(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'EnumBooleanMember',
...props
id: (0, _detachedNode.asDetachedNode)(props.id),
init: (0, _detachedNode.asDetachedNode)(props.init)
});

@@ -816,9 +741,7 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function EnumDeclaration({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function EnumDeclaration(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'EnumDeclaration',
...props
id: (0, _detachedNode.asDetachedNode)(props.id),
body: (0, _detachedNode.asDetachedNode)(props.body)
});

@@ -829,9 +752,6 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function EnumDefaultedMember({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function EnumDefaultedMember(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'EnumDefaultedMember',
...props
id: (0, _detachedNode.asDetachedNode)(props.id)
});

@@ -842,9 +762,8 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function EnumNumberBody({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function EnumNumberBody(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'EnumNumberBody',
...props
members: props.members.map(n => (0, _detachedNode.asDetachedNode)(n)),
explicitType: props.explicitType,
hasUnknownMembers: props.hasUnknownMembers
});

@@ -855,9 +774,7 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function EnumNumberMember({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function EnumNumberMember(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'EnumNumberMember',
...props
id: (0, _detachedNode.asDetachedNode)(props.id),
init: (0, _detachedNode.asDetachedNode)(props.init)
});

@@ -868,9 +785,8 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function EnumStringBody({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function EnumStringBody(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'EnumStringBody',
...props
members: props.members.map(n => (0, _detachedNode.asDetachedNode)(n)),
explicitType: props.explicitType,
hasUnknownMembers: props.hasUnknownMembers
});

@@ -881,9 +797,7 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function EnumStringMember({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function EnumStringMember(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'EnumStringMember',
...props
id: (0, _detachedNode.asDetachedNode)(props.id),
init: (0, _detachedNode.asDetachedNode)(props.init)
});

@@ -894,9 +808,7 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function EnumSymbolBody({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function EnumSymbolBody(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'EnumSymbolBody',
...props
members: props.members.map(n => (0, _detachedNode.asDetachedNode)(n)),
hasUnknownMembers: props.hasUnknownMembers
});

@@ -907,6 +819,5 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function ExistsTypeAnnotation({
parent
} = {}) {
return (0, _detachedNode.detachedProps)(parent, {
function ExistsTypeAnnotation(props = { ...null
}) {
return (0, _detachedNode.detachedProps)(props.parent, {
type: 'ExistsTypeAnnotation'

@@ -916,9 +827,8 @@ });

function ExportAllDeclaration({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function ExportAllDeclaration(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'ExportAllDeclaration',
...props
exported: (0, _detachedNode.asDetachedNode)(props.exported),
source: (0, _detachedNode.asDetachedNode)(props.source),
exportKind: props.exportKind
});

@@ -929,9 +839,6 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function ExportDefaultDeclaration({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function ExportDefaultDeclaration(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'ExportDefaultDeclaration',
...props
declaration: (0, _detachedNode.asDetachedNode)(props.declaration)
});

@@ -942,9 +849,9 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function ExportNamedDeclaration({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function ExportNamedDeclaration(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'ExportNamedDeclaration',
...props
declaration: (0, _detachedNode.asDetachedNode)(props.declaration),
specifiers: props.specifiers.map(n => (0, _detachedNode.asDetachedNode)(n)),
source: (0, _detachedNode.asDetachedNode)(props.source),
exportKind: props.exportKind
});

@@ -955,9 +862,7 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function ExportSpecifier({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function ExportSpecifier(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'ExportSpecifier',
...props
exported: (0, _detachedNode.asDetachedNode)(props.exported),
local: (0, _detachedNode.asDetachedNode)(props.local)
});

@@ -968,9 +873,7 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function ExpressionStatement({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function ExpressionStatement(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'ExpressionStatement',
...props
expression: (0, _detachedNode.asDetachedNode)(props.expression),
directive: props.directive
});

@@ -981,9 +884,8 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function ForInStatement({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function ForInStatement(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'ForInStatement',
...props
left: (0, _detachedNode.asDetachedNode)(props.left),
right: (0, _detachedNode.asDetachedNode)(props.right),
body: (0, _detachedNode.asDetachedNode)(props.body)
});

@@ -994,9 +896,9 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function ForOfStatement({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function ForOfStatement(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'ForOfStatement',
...props
left: (0, _detachedNode.asDetachedNode)(props.left),
right: (0, _detachedNode.asDetachedNode)(props.right),
body: (0, _detachedNode.asDetachedNode)(props.body),
await: props.await
});

@@ -1007,9 +909,9 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function ForStatement({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function ForStatement(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'ForStatement',
...props
init: (0, _detachedNode.asDetachedNode)(props.init),
test: (0, _detachedNode.asDetachedNode)(props.test),
update: (0, _detachedNode.asDetachedNode)(props.update),
body: (0, _detachedNode.asDetachedNode)(props.body)
});

@@ -1020,9 +922,13 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function FunctionDeclaration({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function FunctionDeclaration(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'FunctionDeclaration',
...props
id: (0, _detachedNode.asDetachedNode)(props.id),
params: props.params.map(n => (0, _detachedNode.asDetachedNode)(n)),
body: (0, _detachedNode.asDetachedNode)(props.body),
typeParameters: (0, _detachedNode.asDetachedNode)(props.typeParameters),
returnType: (0, _detachedNode.asDetachedNode)(props.returnType),
predicate: (0, _detachedNode.asDetachedNode)(props.predicate),
generator: props.generator,
async: props.async
});

@@ -1033,9 +939,13 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function FunctionExpression({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function FunctionExpression(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'FunctionExpression',
...props
id: (0, _detachedNode.asDetachedNode)(props.id),
params: props.params.map(n => (0, _detachedNode.asDetachedNode)(n)),
body: (0, _detachedNode.asDetachedNode)(props.body),
typeParameters: (0, _detachedNode.asDetachedNode)(props.typeParameters),
returnType: (0, _detachedNode.asDetachedNode)(props.returnType),
predicate: (0, _detachedNode.asDetachedNode)(props.predicate),
generator: props.generator,
async: props.async
});

@@ -1046,9 +956,10 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function FunctionTypeAnnotation({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function FunctionTypeAnnotation(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'FunctionTypeAnnotation',
...props
params: props.params.map(n => (0, _detachedNode.asDetachedNode)(n)),
this: (0, _detachedNode.asDetachedNode)(props.this),
returnType: (0, _detachedNode.asDetachedNode)(props.returnType),
rest: (0, _detachedNode.asDetachedNode)(props.rest),
typeParameters: (0, _detachedNode.asDetachedNode)(props.typeParameters)
});

@@ -1059,9 +970,8 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function FunctionTypeParam({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function FunctionTypeParam(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'FunctionTypeParam',
...props
name: (0, _detachedNode.asDetachedNode)(props.name),
typeAnnotation: (0, _detachedNode.asDetachedNode)(props.typeAnnotation),
optional: props.optional
});

@@ -1072,9 +982,7 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function GenericTypeAnnotation({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function GenericTypeAnnotation(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'GenericTypeAnnotation',
...props
id: (0, _detachedNode.asDetachedNode)(props.id),
typeParameters: (0, _detachedNode.asDetachedNode)(props.typeParameters)
});

@@ -1085,9 +993,8 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function IfStatement({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function IfStatement(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'IfStatement',
...props
test: (0, _detachedNode.asDetachedNode)(props.test),
consequent: (0, _detachedNode.asDetachedNode)(props.consequent),
alternate: (0, _detachedNode.asDetachedNode)(props.alternate)
});

@@ -1098,9 +1005,7 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function ImportAttribute({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function ImportAttribute(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'ImportAttribute',
...props
key: (0, _detachedNode.asDetachedNode)(props.key),
value: (0, _detachedNode.asDetachedNode)(props.value)
});

@@ -1111,9 +1016,11 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function ImportDeclaration({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function ImportDeclaration(props) {
var _props$assertions;
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'ImportDeclaration',
...props
specifiers: props.specifiers.map(n => (0, _detachedNode.asDetachedNode)(n)),
source: (0, _detachedNode.asDetachedNode)(props.source),
assertions: (_props$assertions = props.assertions) == null ? void 0 : _props$assertions.map(n => (0, _detachedNode.asDetachedNode)(n)),
importKind: props.importKind
});

@@ -1124,9 +1031,6 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function ImportDefaultSpecifier({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function ImportDefaultSpecifier(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'ImportDefaultSpecifier',
...props
local: (0, _detachedNode.asDetachedNode)(props.local)
});

@@ -1137,9 +1041,7 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function ImportExpression({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function ImportExpression(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'ImportExpression',
...props
source: (0, _detachedNode.asDetachedNode)(props.source),
attributes: (0, _detachedNode.asDetachedNode)(props.attributes)
});

@@ -1150,9 +1052,6 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function ImportNamespaceSpecifier({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function ImportNamespaceSpecifier(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'ImportNamespaceSpecifier',
...props
local: (0, _detachedNode.asDetachedNode)(props.local)
});

@@ -1163,9 +1062,8 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function ImportSpecifier({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function ImportSpecifier(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'ImportSpecifier',
...props
imported: (0, _detachedNode.asDetachedNode)(props.imported),
local: (0, _detachedNode.asDetachedNode)(props.local),
importKind: props.importKind
});

@@ -1176,9 +1074,7 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function IndexedAccessType({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function IndexedAccessType(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'IndexedAccessType',
...props
objectType: (0, _detachedNode.asDetachedNode)(props.objectType),
indexType: (0, _detachedNode.asDetachedNode)(props.indexType)
});

@@ -1189,6 +1085,5 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function InferredPredicate({
parent
} = {}) {
return (0, _detachedNode.detachedProps)(parent, {
function InferredPredicate(props = { ...null
}) {
return (0, _detachedNode.detachedProps)(props.parent, {
type: 'InferredPredicate'

@@ -1198,9 +1093,9 @@ });

function InterfaceDeclaration({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function InterfaceDeclaration(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'InterfaceDeclaration',
...props
id: (0, _detachedNode.asDetachedNode)(props.id),
typeParameters: (0, _detachedNode.asDetachedNode)(props.typeParameters),
extends: props.extends.map(n => (0, _detachedNode.asDetachedNode)(n)),
body: (0, _detachedNode.asDetachedNode)(props.body)
});

@@ -1211,9 +1106,7 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function InterfaceExtends({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function InterfaceExtends(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'InterfaceExtends',
...props
id: (0, _detachedNode.asDetachedNode)(props.id),
typeParameters: (0, _detachedNode.asDetachedNode)(props.typeParameters)
});

@@ -1224,9 +1117,7 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function InterfaceTypeAnnotation({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function InterfaceTypeAnnotation(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'InterfaceTypeAnnotation',
...props
extends: props.extends.map(n => (0, _detachedNode.asDetachedNode)(n)),
body: (0, _detachedNode.asDetachedNode)(props.body)
});

@@ -1237,9 +1128,6 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function IntersectionTypeAnnotation({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function IntersectionTypeAnnotation(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'IntersectionTypeAnnotation',
...props
types: props.types.map(n => (0, _detachedNode.asDetachedNode)(n))
});

@@ -1250,9 +1138,7 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function JSXAttribute({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function JSXAttribute(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'JSXAttribute',
...props
name: (0, _detachedNode.asDetachedNode)(props.name),
value: (0, _detachedNode.asDetachedNode)(props.value)
});

@@ -1263,9 +1149,6 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function JSXClosingElement({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function JSXClosingElement(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'JSXClosingElement',
...props
name: (0, _detachedNode.asDetachedNode)(props.name)
});

@@ -1276,6 +1159,5 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function JSXClosingFragment({
parent
} = {}) {
return (0, _detachedNode.detachedProps)(parent, {
function JSXClosingFragment(props = { ...null
}) {
return (0, _detachedNode.detachedProps)(props.parent, {
type: 'JSXClosingFragment'

@@ -1285,9 +1167,8 @@ });

function JSXElement({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function JSXElement(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'JSXElement',
...props
openingElement: (0, _detachedNode.asDetachedNode)(props.openingElement),
children: props.children.map(n => (0, _detachedNode.asDetachedNode)(n)),
closingElement: (0, _detachedNode.asDetachedNode)(props.closingElement)
});

@@ -1298,6 +1179,5 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function JSXEmptyExpression({
parent
} = {}) {
return (0, _detachedNode.detachedProps)(parent, {
function JSXEmptyExpression(props = { ...null
}) {
return (0, _detachedNode.detachedProps)(props.parent, {
type: 'JSXEmptyExpression'

@@ -1307,9 +1187,6 @@ });

function JSXExpressionContainer({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function JSXExpressionContainer(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'JSXExpressionContainer',
...props
expression: (0, _detachedNode.asDetachedNode)(props.expression)
});

@@ -1320,9 +1197,8 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function JSXFragment({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function JSXFragment(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'JSXFragment',
...props
openingFragment: (0, _detachedNode.asDetachedNode)(props.openingFragment),
children: props.children.map(n => (0, _detachedNode.asDetachedNode)(n)),
closingFragment: (0, _detachedNode.asDetachedNode)(props.closingFragment)
});

@@ -1333,9 +1209,6 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function JSXIdentifier({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function JSXIdentifier(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'JSXIdentifier',
...props
name: props.name
});

@@ -1346,9 +1219,7 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function JSXMemberExpression({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function JSXMemberExpression(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'JSXMemberExpression',
...props
object: (0, _detachedNode.asDetachedNode)(props.object),
property: (0, _detachedNode.asDetachedNode)(props.property)
});

@@ -1359,9 +1230,7 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function JSXNamespacedName({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function JSXNamespacedName(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'JSXNamespacedName',
...props
namespace: (0, _detachedNode.asDetachedNode)(props.namespace),
name: (0, _detachedNode.asDetachedNode)(props.name)
});

@@ -1372,9 +1241,8 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function JSXOpeningElement({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function JSXOpeningElement(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'JSXOpeningElement',
...props
name: (0, _detachedNode.asDetachedNode)(props.name),
attributes: props.attributes.map(n => (0, _detachedNode.asDetachedNode)(n)),
selfClosing: props.selfClosing
});

@@ -1385,6 +1253,5 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function JSXOpeningFragment({
parent
} = {}) {
return (0, _detachedNode.detachedProps)(parent, {
function JSXOpeningFragment(props = { ...null
}) {
return (0, _detachedNode.detachedProps)(props.parent, {
type: 'JSXOpeningFragment'

@@ -1394,9 +1261,6 @@ });

function JSXSpreadAttribute({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function JSXSpreadAttribute(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'JSXSpreadAttribute',
...props
argument: (0, _detachedNode.asDetachedNode)(props.argument)
});

@@ -1407,9 +1271,6 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function JSXSpreadChild({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function JSXSpreadChild(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'JSXSpreadChild',
...props
expression: (0, _detachedNode.asDetachedNode)(props.expression)
});

@@ -1420,9 +1281,7 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function JSXText({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function JSXText(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'JSXText',
...props
value: props.value,
raw: props.raw
});

@@ -1433,9 +1292,7 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function LabeledStatement({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function LabeledStatement(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'LabeledStatement',
...props
label: (0, _detachedNode.asDetachedNode)(props.label),
body: (0, _detachedNode.asDetachedNode)(props.body)
});

@@ -1446,9 +1303,8 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function LogicalExpression({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function LogicalExpression(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'LogicalExpression',
...props
left: (0, _detachedNode.asDetachedNode)(props.left),
right: (0, _detachedNode.asDetachedNode)(props.right),
operator: props.operator
});

@@ -1459,9 +1315,8 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function MemberExpression({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function MemberExpression(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'MemberExpression',
...props
object: (0, _detachedNode.asDetachedNode)(props.object),
property: (0, _detachedNode.asDetachedNode)(props.property),
computed: props.computed
});

@@ -1472,9 +1327,7 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function MetaProperty({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function MetaProperty(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'MetaProperty',
...props
meta: (0, _detachedNode.asDetachedNode)(props.meta),
property: (0, _detachedNode.asDetachedNode)(props.property)
});

@@ -1485,9 +1338,10 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function MethodDefinition({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function MethodDefinition(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'MethodDefinition',
...props
key: (0, _detachedNode.asDetachedNode)(props.key),
value: (0, _detachedNode.asDetachedNode)(props.value),
kind: props.kind,
computed: props.computed,
static: props.static
});

@@ -1498,6 +1352,5 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function MixedTypeAnnotation({
parent
} = {}) {
return (0, _detachedNode.detachedProps)(parent, {
function MixedTypeAnnotation(props = { ...null
}) {
return (0, _detachedNode.detachedProps)(props.parent, {
type: 'MixedTypeAnnotation'

@@ -1507,9 +1360,8 @@ });

function NewExpression({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function NewExpression(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'NewExpression',
...props
callee: (0, _detachedNode.asDetachedNode)(props.callee),
typeArguments: (0, _detachedNode.asDetachedNode)(props.typeArguments),
arguments: props.arguments.map(n => (0, _detachedNode.asDetachedNode)(n))
});

@@ -1520,9 +1372,6 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function NullableTypeAnnotation({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function NullableTypeAnnotation(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'NullableTypeAnnotation',
...props
typeAnnotation: (0, _detachedNode.asDetachedNode)(props.typeAnnotation)
});

@@ -1533,6 +1382,5 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function NullLiteralTypeAnnotation({
parent
} = {}) {
return (0, _detachedNode.detachedProps)(parent, {
function NullLiteralTypeAnnotation(props = { ...null
}) {
return (0, _detachedNode.detachedProps)(props.parent, {
type: 'NullLiteralTypeAnnotation'

@@ -1542,9 +1390,7 @@ });

function NumberLiteralTypeAnnotation({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function NumberLiteralTypeAnnotation(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'NumberLiteralTypeAnnotation',
...props
value: props.value,
raw: props.raw
});

@@ -1555,6 +1401,5 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function NumberTypeAnnotation({
parent
} = {}) {
return (0, _detachedNode.detachedProps)(parent, {
function NumberTypeAnnotation(props = { ...null
}) {
return (0, _detachedNode.detachedProps)(props.parent, {
type: 'NumberTypeAnnotation'

@@ -1564,9 +1409,6 @@ });

function ObjectExpression({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function ObjectExpression(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'ObjectExpression',
...props
properties: props.properties.map(n => (0, _detachedNode.asDetachedNode)(n))
});

@@ -1577,9 +1419,7 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function ObjectPattern({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function ObjectPattern(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'ObjectPattern',
...props
properties: props.properties.map(n => (0, _detachedNode.asDetachedNode)(n)),
typeAnnotation: (0, _detachedNode.asDetachedNode)(props.typeAnnotation)
});

@@ -1590,9 +1430,11 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function ObjectTypeAnnotation({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function ObjectTypeAnnotation(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'ObjectTypeAnnotation',
...props
properties: props.properties.map(n => (0, _detachedNode.asDetachedNode)(n)),
indexers: props.indexers.map(n => (0, _detachedNode.asDetachedNode)(n)),
callProperties: props.callProperties.map(n => (0, _detachedNode.asDetachedNode)(n)),
internalSlots: props.internalSlots.map(n => (0, _detachedNode.asDetachedNode)(n)),
inexact: props.inexact,
exact: props.exact
});

@@ -1603,9 +1445,7 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function ObjectTypeCallProperty({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function ObjectTypeCallProperty(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'ObjectTypeCallProperty',
...props
value: (0, _detachedNode.asDetachedNode)(props.value),
static: props.static
});

@@ -1616,9 +1456,10 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function ObjectTypeIndexer({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function ObjectTypeIndexer(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'ObjectTypeIndexer',
...props
id: (0, _detachedNode.asDetachedNode)(props.id),
key: (0, _detachedNode.asDetachedNode)(props.key),
value: (0, _detachedNode.asDetachedNode)(props.value),
static: props.static,
variance: (0, _detachedNode.asDetachedNode)(props.variance)
});

@@ -1629,9 +1470,10 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function ObjectTypeInternalSlot({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function ObjectTypeInternalSlot(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'ObjectTypeInternalSlot',
...props
id: (0, _detachedNode.asDetachedNode)(props.id),
value: (0, _detachedNode.asDetachedNode)(props.value),
optional: props.optional,
static: props.static,
method: props.method
});

@@ -1642,9 +1484,13 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function ObjectTypeProperty({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function ObjectTypeProperty(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'ObjectTypeProperty',
...props
key: (0, _detachedNode.asDetachedNode)(props.key),
value: (0, _detachedNode.asDetachedNode)(props.value),
method: props.method,
optional: props.optional,
static: props.static,
proto: props.proto,
variance: (0, _detachedNode.asDetachedNode)(props.variance),
kind: props.kind
});

@@ -1655,9 +1501,6 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function ObjectTypeSpreadProperty({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function ObjectTypeSpreadProperty(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'ObjectTypeSpreadProperty',
...props
argument: (0, _detachedNode.asDetachedNode)(props.argument)
});

@@ -1668,9 +1511,9 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function OpaqueType({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function OpaqueType(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'OpaqueType',
...props
id: (0, _detachedNode.asDetachedNode)(props.id),
typeParameters: (0, _detachedNode.asDetachedNode)(props.typeParameters),
impltype: (0, _detachedNode.asDetachedNode)(props.impltype),
supertype: (0, _detachedNode.asDetachedNode)(props.supertype)
});

@@ -1681,9 +1524,8 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function OptionalIndexedAccessType({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function OptionalIndexedAccessType(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'OptionalIndexedAccessType',
...props
objectType: (0, _detachedNode.asDetachedNode)(props.objectType),
indexType: (0, _detachedNode.asDetachedNode)(props.indexType),
optional: props.optional
});

@@ -1694,9 +1536,6 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function PrivateIdentifier({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function PrivateIdentifier(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'PrivateIdentifier',
...props
name: props.name
});

@@ -1707,9 +1546,11 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function Property({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function Property(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'Property',
...props
key: (0, _detachedNode.asDetachedNode)(props.key),
value: (0, _detachedNode.asDetachedNode)(props.value),
kind: props.kind,
computed: props.computed,
method: props.method,
shorthand: props.shorthand
});

@@ -1720,9 +1561,13 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function PropertyDefinition({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function PropertyDefinition(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'PropertyDefinition',
...props
key: (0, _detachedNode.asDetachedNode)(props.key),
value: (0, _detachedNode.asDetachedNode)(props.value),
computed: props.computed,
static: props.static,
declare: props.declare,
optional: props.optional,
variance: (0, _detachedNode.asDetachedNode)(props.variance),
typeAnnotation: (0, _detachedNode.asDetachedNode)(props.typeAnnotation)
});

@@ -1733,9 +1578,7 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function QualifiedTypeIdentifier({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function QualifiedTypeIdentifier(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'QualifiedTypeIdentifier',
...props
qualification: (0, _detachedNode.asDetachedNode)(props.qualification),
id: (0, _detachedNode.asDetachedNode)(props.id)
});

@@ -1746,9 +1589,6 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function RestElement({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function RestElement(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'RestElement',
...props
argument: (0, _detachedNode.asDetachedNode)(props.argument)
});

@@ -1759,9 +1599,6 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function ReturnStatement({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function ReturnStatement(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'ReturnStatement',
...props
argument: (0, _detachedNode.asDetachedNode)(props.argument)
});

@@ -1772,9 +1609,6 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function SequenceExpression({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function SequenceExpression(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'SequenceExpression',
...props
expressions: props.expressions.map(n => (0, _detachedNode.asDetachedNode)(n))
});

@@ -1785,9 +1619,6 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function SpreadElement({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function SpreadElement(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'SpreadElement',
...props
argument: (0, _detachedNode.asDetachedNode)(props.argument)
});

@@ -1798,9 +1629,7 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function StringLiteralTypeAnnotation({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function StringLiteralTypeAnnotation(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'StringLiteralTypeAnnotation',
...props
value: props.value,
raw: props.raw
});

@@ -1811,6 +1640,5 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function StringTypeAnnotation({
parent
} = {}) {
return (0, _detachedNode.detachedProps)(parent, {
function StringTypeAnnotation(props = { ...null
}) {
return (0, _detachedNode.detachedProps)(props.parent, {
type: 'StringTypeAnnotation'

@@ -1820,6 +1648,5 @@ });

function Super({
parent
} = {}) {
return (0, _detachedNode.detachedProps)(parent, {
function Super(props = { ...null
}) {
return (0, _detachedNode.detachedProps)(props.parent, {
type: 'Super'

@@ -1829,9 +1656,7 @@ });

function SwitchCase({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function SwitchCase(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'SwitchCase',
...props
test: (0, _detachedNode.asDetachedNode)(props.test),
consequent: props.consequent.map(n => (0, _detachedNode.asDetachedNode)(n))
});

@@ -1842,9 +1667,7 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function SwitchStatement({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function SwitchStatement(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'SwitchStatement',
...props
discriminant: (0, _detachedNode.asDetachedNode)(props.discriminant),
cases: props.cases.map(n => (0, _detachedNode.asDetachedNode)(n))
});

@@ -1855,6 +1678,5 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function SymbolTypeAnnotation({
parent
} = {}) {
return (0, _detachedNode.detachedProps)(parent, {
function SymbolTypeAnnotation(props = { ...null
}) {
return (0, _detachedNode.detachedProps)(props.parent, {
type: 'SymbolTypeAnnotation'

@@ -1864,9 +1686,7 @@ });

function TaggedTemplateExpression({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function TaggedTemplateExpression(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'TaggedTemplateExpression',
...props
tag: (0, _detachedNode.asDetachedNode)(props.tag),
quasi: (0, _detachedNode.asDetachedNode)(props.quasi)
});

@@ -1877,9 +1697,7 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function TemplateLiteral({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function TemplateLiteral(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'TemplateLiteral',
...props
quasis: props.quasis.map(n => (0, _detachedNode.asDetachedNode)(n)),
expressions: props.expressions.map(n => (0, _detachedNode.asDetachedNode)(n))
});

@@ -1890,6 +1708,5 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function ThisExpression({
parent
} = {}) {
return (0, _detachedNode.detachedProps)(parent, {
function ThisExpression(props = { ...null
}) {
return (0, _detachedNode.detachedProps)(props.parent, {
type: 'ThisExpression'

@@ -1899,6 +1716,5 @@ });

function ThisTypeAnnotation({
parent
} = {}) {
return (0, _detachedNode.detachedProps)(parent, {
function ThisTypeAnnotation(props = { ...null
}) {
return (0, _detachedNode.detachedProps)(props.parent, {
type: 'ThisTypeAnnotation'

@@ -1908,9 +1724,6 @@ });

function ThrowStatement({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function ThrowStatement(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'ThrowStatement',
...props
argument: (0, _detachedNode.asDetachedNode)(props.argument)
});

@@ -1921,9 +1734,8 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function TryStatement({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function TryStatement(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'TryStatement',
...props
block: (0, _detachedNode.asDetachedNode)(props.block),
handler: (0, _detachedNode.asDetachedNode)(props.handler),
finalizer: (0, _detachedNode.asDetachedNode)(props.finalizer)
});

@@ -1934,9 +1746,6 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function TupleTypeAnnotation({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function TupleTypeAnnotation(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'TupleTypeAnnotation',
...props
types: props.types.map(n => (0, _detachedNode.asDetachedNode)(n))
});

@@ -1947,9 +1756,8 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function TypeAlias({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function TypeAlias(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'TypeAlias',
...props
id: (0, _detachedNode.asDetachedNode)(props.id),
typeParameters: (0, _detachedNode.asDetachedNode)(props.typeParameters),
right: (0, _detachedNode.asDetachedNode)(props.right)
});

@@ -1960,9 +1768,6 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function TypeAnnotation({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function TypeAnnotation(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'TypeAnnotation',
...props
typeAnnotation: (0, _detachedNode.asDetachedNode)(props.typeAnnotation)
});

@@ -1973,9 +1778,7 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function TypeCastExpression({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function TypeCastExpression(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'TypeCastExpression',
...props
expression: (0, _detachedNode.asDetachedNode)(props.expression),
typeAnnotation: (0, _detachedNode.asDetachedNode)(props.typeAnnotation)
});

@@ -1986,9 +1789,6 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function TypeofTypeAnnotation({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function TypeofTypeAnnotation(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'TypeofTypeAnnotation',
...props
argument: (0, _detachedNode.asDetachedNode)(props.argument)
});

@@ -1999,9 +1799,9 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function TypeParameter({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function TypeParameter(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'TypeParameter',
...props
name: props.name,
bound: (0, _detachedNode.asDetachedNode)(props.bound),
variance: (0, _detachedNode.asDetachedNode)(props.variance),
default: (0, _detachedNode.asDetachedNode)(props.default)
});

@@ -2012,9 +1812,6 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function TypeParameterDeclaration({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function TypeParameterDeclaration(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'TypeParameterDeclaration',
...props
params: props.params.map(n => (0, _detachedNode.asDetachedNode)(n))
});

@@ -2025,9 +1822,6 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function TypeParameterInstantiation({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function TypeParameterInstantiation(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'TypeParameterInstantiation',
...props
params: props.params.map(n => (0, _detachedNode.asDetachedNode)(n))
});

@@ -2038,9 +1832,8 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function UnaryExpression({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function UnaryExpression(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'UnaryExpression',
...props
operator: props.operator,
argument: (0, _detachedNode.asDetachedNode)(props.argument),
prefix: props.prefix
});

@@ -2051,9 +1844,6 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function UnionTypeAnnotation({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function UnionTypeAnnotation(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'UnionTypeAnnotation',
...props
types: props.types.map(n => (0, _detachedNode.asDetachedNode)(n))
});

@@ -2064,9 +1854,8 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function UpdateExpression({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function UpdateExpression(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'UpdateExpression',
...props
operator: props.operator,
argument: (0, _detachedNode.asDetachedNode)(props.argument),
prefix: props.prefix
});

@@ -2077,9 +1866,7 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function VariableDeclaration({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function VariableDeclaration(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'VariableDeclaration',
...props
kind: props.kind,
declarations: props.declarations.map(n => (0, _detachedNode.asDetachedNode)(n))
});

@@ -2090,9 +1877,7 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function VariableDeclarator({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function VariableDeclarator(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'VariableDeclarator',
...props
init: (0, _detachedNode.asDetachedNode)(props.init),
id: (0, _detachedNode.asDetachedNode)(props.id)
});

@@ -2103,9 +1888,6 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function Variance({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function Variance(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'Variance',
...props
kind: props.kind
});

@@ -2116,6 +1898,5 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function VoidTypeAnnotation({
parent
} = {}) {
return (0, _detachedNode.detachedProps)(parent, {
function VoidTypeAnnotation(props = { ...null
}) {
return (0, _detachedNode.detachedProps)(props.parent, {
type: 'VoidTypeAnnotation'

@@ -2125,9 +1906,7 @@ });

function WhileStatement({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function WhileStatement(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'WhileStatement',
...props
body: (0, _detachedNode.asDetachedNode)(props.body),
test: (0, _detachedNode.asDetachedNode)(props.test)
});

@@ -2138,9 +1917,7 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function WithStatement({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function WithStatement(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'WithStatement',
...props
object: (0, _detachedNode.asDetachedNode)(props.object),
body: (0, _detachedNode.asDetachedNode)(props.body)
});

@@ -2151,9 +1928,7 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function YieldExpression({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function YieldExpression(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'YieldExpression',
...props
argument: (0, _detachedNode.asDetachedNode)(props.argument),
delegate: props.delegate
});

@@ -2160,0 +1935,0 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

@@ -10,2 +10,3 @@ "use strict";

exports.BooleanLiteral = BooleanLiteral;
exports.ClassDeclaration = ClassDeclaration;
exports.Identifier = Identifier;

@@ -36,7 +37,4 @@ exports.LineComment = LineComment;

*/
function ArrowFunctionExpression({
parent,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function ArrowFunctionExpression(props) {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'ArrowFunctionExpression',

@@ -46,6 +44,28 @@ id: null,

expression: props.body.type !== 'BlockStatement',
...props
params: props.params.map(n => (0, _detachedNode.asDetachedNode)(n)),
body: (0, _detachedNode.asDetachedNode)(props.body),
typeParameters: (0, _detachedNode.asDetachedNode)(props.typeParameters),
returnType: (0, _detachedNode.asDetachedNode)(props.returnType),
predicate: (0, _detachedNode.asDetachedNode)(props.predicate),
async: props.async
});
(0, _detachedNode.setParentPointersInDirectChildren)(node);
return node;
}
function ClassDeclaration(props) {
var _props$decorators, _props$implements;
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'ClassDeclaration',
id: (0, _detachedNode.asDetachedNode)(props.id),
typeParameters: (0, _detachedNode.asDetachedNode)(props.typeParameters),
superClass: (0, _detachedNode.asDetachedNode)(props.superClass),
superTypeParameters: (0, _detachedNode.asDetachedNode)(props.superTypeParameters),
decorators: ((_props$decorators = props.decorators) != null ? _props$decorators : []).map(n => (0, _detachedNode.asDetachedNode)(n)),
implements: ((_props$implements = props.implements) != null ? _props$implements : []).map(n => (0, _detachedNode.asDetachedNode)(n)),
body: (0, _detachedNode.asDetachedNode)(props.body)
});
(0, _detachedNode.setParentPointersInDirectChildren)(node);
return node;
} // pattern/flags are on a subobject in the estree spec, but are flat on the hermes types

@@ -55,9 +75,5 @@ // also the value is supposed to be a RegExp instance

function RegExpLiteral({
pattern,
flags,
parent
}) {
const value = new RegExp(pattern, flags);
return (0, _detachedNode.detachedProps)(parent, {
function RegExpLiteral(props) {
const value = new RegExp(props.pattern, props.flags);
return (0, _detachedNode.detachedProps)(props.parent, {
type: 'Literal',

@@ -67,4 +83,4 @@ value,

regex: {
pattern,
flags
pattern: props.pattern,
flags: props.flags
}

@@ -75,11 +91,10 @@ });

function TemplateElement({
tail,
parent,
...value
}) {
return (0, _detachedNode.detachedProps)(parent, {
function TemplateElement(props) {
return (0, _detachedNode.detachedProps)(props.parent, {
type: 'TemplateElement',
tail,
value
tail: props.tail,
value: {
cooked: props.cooked,
raw: props.raw
}
});

@@ -90,13 +105,10 @@ } // Identifier has a bunch of stuff that usually you don't want to provide - so we have

function Identifier({
parent,
optional = false,
typeAnnotation = null,
...props
}) {
const node = (0, _detachedNode.detachedProps)(parent, {
function Identifier(props) {
var _props$optional;
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'Identifier',
optional,
typeAnnotation,
...props
name: props.name,
optional: (_props$optional = props.optional) != null ? _props$optional : false,
typeAnnotation: (0, _detachedNode.asDetachedNode)(props.typeAnnotation)
});

@@ -110,11 +122,8 @@ (0, _detachedNode.setParentPointersInDirectChildren)(node);

function BigIntLiteral({
parent,
...props
}) {
function BigIntLiteral(props) {
var _props$raw;
const node = (0, _detachedNode.detachedProps)(parent, {
const node = (0, _detachedNode.detachedProps)(props.parent, {
type: 'Literal',
...props,
value: props.value,
raw: (_props$raw = props.raw) != null ? _props$raw : `${props.value}n`,

@@ -127,22 +136,16 @@ bigint: `${props.value}`

function BooleanLiteral({
parent,
value
}) {
return (0, _detachedNode.detachedProps)(parent, {
function BooleanLiteral(props) {
return (0, _detachedNode.detachedProps)(props.parent, {
type: 'Literal',
raw: value ? 'true' : 'false',
value
raw: props.value ? 'true' : 'false',
value: props.value
});
}
function NumericLiteral({
parent,
...props
}) {
function NumericLiteral(props) {
var _props$raw2;
return (0, _detachedNode.detachedProps)(parent, {
return (0, _detachedNode.detachedProps)(props.parent, {
type: 'Literal',
...props,
value: props.value,
raw: (_props$raw2 = props.raw) != null ? _props$raw2 : `${props.value}`

@@ -152,6 +155,5 @@ });

function NullLiteral({
parent
} = {}) {
return (0, _detachedNode.detachedProps)(parent, {
function NullLiteral(props = { ...null
}) {
return (0, _detachedNode.detachedProps)(props.parent, {
type: 'Literal',

@@ -163,31 +165,25 @@ value: null,

function StringLiteral({
parent,
raw: rawIn,
value
}) {
const hasSingleQuote = value.includes('"');
const hasDoubleQuote = value.includes("'");
let raw = rawIn;
function StringLiteral(props) {
const hasSingleQuote = props.value.includes('"');
const hasDoubleQuote = props.value.includes("'");
let raw = props.raw;
if (raw == null) {
if (hasSingleQuote && hasDoubleQuote) {
raw = `'${value.replace(/'/g, "\\'")}'`;
raw = `'${props.value.replace(/'/g, "\\'")}'`;
} else if (hasSingleQuote) {
raw = `"${value}"`;
raw = `"${props.value}"`;
} else {
raw = `'${value}'`;
raw = `'${props.value}'`;
}
}
return (0, _detachedNode.detachedProps)(parent, {
return (0, _detachedNode.detachedProps)(props.parent, {
type: 'Literal',
raw,
value
value: props.value
});
}
function LineComment({
value
}) {
function LineComment(props) {
// $FlowExpectedError[prop-missing]

@@ -197,9 +193,7 @@ // $FlowExpectedError[incompatible-return]

type: 'Line',
value
value: props.value
});
}
function BlockComment({
value
}) {
function BlockComment(props) {
// $FlowExpectedError[prop-missing]

@@ -209,4 +203,4 @@ // $FlowExpectedError[incompatible-return]

type: 'Block',
value
value: props.value
});
}

@@ -14,2 +14,4 @@ "use strict";

exports.getCommentsForNode = getCommentsForNode;
exports.getLeadingCommentsForNode = getLeadingCommentsForNode;
exports.getTrailingCommentsForNode = getTrailingCommentsForNode;
exports.isLeadingComment = isLeadingComment;

@@ -66,9 +68,17 @@ exports.isTrailingComment = isTrailingComment;

function addCommentsToNode(node, comments) {
function addCommentsToNode(node, comments, side = 'trailing') {
var _node$comments;
// $FlowExpectedError - this property is secretly added by prettier.
node.comments = (_node$comments = node.comments) != null ? _node$comments : []; // $FlowExpectedError
// $FlowExpectedError[prop-missing] - this property is secretly added by prettier.
// $FlowExpectedError[cannot-write]
// $FlowExpectedError[incompatible-use]
node.comments = (_node$comments = node.comments) != null ? _node$comments : [];
node.comments.push(...comments);
if (side === 'leading') {
// $FlowExpectedError[incompatible-cast]
node.comments.unshift(...comments);
} else {
// $FlowExpectedError[incompatible-cast]
node.comments.push(...comments);
}
}

@@ -93,2 +103,10 @@

function getLeadingCommentsForNode(node) {
return getCommentsForNode(node).filter(isLeadingComment);
}
function getTrailingCommentsForNode(node) {
return getCommentsForNode(node).filter(isTrailingComment);
}
function addComment(node, comment, placement) {

@@ -95,0 +113,0 @@ switch (placement) {

@@ -125,2 +125,17 @@ /**

}
} // if the very first node in the program is replaced, it will take the docblock with it
// this is bad as it means we'll lose `@format`, ``, licence, etc.
// so this hack just makes sure that we keep the docblock
// note that we do this **BEFORE** the comment mutations in case someone intentionally
// wants to remove the docblock comment for some weird reason
if (ast.docblock != null && ast.body.length > 0) {
const firstNode = ast.body[0];
const docblockComment = ast.docblock.comment;
const leadingComments = (0, _comments.getLeadingCommentsForNode)(firstNode);
if (!leadingComments.includes(docblockComment)) {
(0, _comments.addCommentsToNode)(firstNode, [docblockComment], 'leading');
}
} // remove the comments

@@ -127,0 +142,0 @@ // this is done at the end because it requires a complete traversal of the AST

@@ -89,3 +89,4 @@ "use strict";

insertionParent.parent[insertionParent.key] = blockStatement;
statementToWrap.parent = blockStatement;
return insertionParent.parent;
}

@@ -15,2 +15,4 @@ "use strict";

var _detachedNode = require("../../detachedNode");
var _getVisitorKeys = require("../../getVisitorKeys");

@@ -75,3 +77,6 @@

for (let i = 0; i < parent[key].length; i += 1) {
if (parent[key][i] === target) {
const current = parent[key][i];
const originalNode = (0, _detachedNode.getOriginalNode)(current);
if (current === target || originalNode === target) {
return {

@@ -89,3 +94,3 @@ type: 'array',

throw new _Errors.InvalidReplacementError(`Expected to find the ${target.type} as a direct child of the ${target.type}.`);
throw new _Errors.InvalidReplacementError(`Expected to find the ${target.type} as a direct child of the ${parent.type}.`);
}

@@ -55,6 +55,5 @@ "use strict";

return (0, _detachedNode.shallowCloneNode)(node);
return (0, _detachedNode.shallowCloneNode)(node, {});
},
// $FlowExpectedError[incompatible-exact]
shallowCloneNodeWithOverrides: (node, newProps) => {
shallowCloneNodeWithOverrides: (node, newProps = {}) => {
if (node == null) {

@@ -71,3 +70,10 @@ return null;

return nodes.map(node => (0, _detachedNode.shallowCloneNode)(node));
return nodes.map(node => {
if (node == null) {
// $FlowExpectedError[incompatible-call]
return node;
}
return (0, _detachedNode.shallowCloneNode)(node, {});
});
},

@@ -79,6 +85,5 @@ deepCloneNode: node => {

return (0, _detachedNode.deepCloneNode)(node);
return (0, _detachedNode.deepCloneNode)(node, {});
},
// $FlowExpectedError[incompatible-exact]
deepCloneNodeWithOverrides: (node, newProps) => {
deepCloneNodeWithOverrides: (node, newProps = {}) => {
if (node == null) {

@@ -136,6 +141,10 @@ return null;

insertAfterStatement: (target, nodesToInsert) => {
pushMutation((0, _InsertStatement.createInsertStatementMutation)('after', target, toArray(nodesToInsert)));
pushMutation((0, _InsertStatement.createInsertStatementMutation)('after', target, toArray(nodesToInsert).map(n => (0, _detachedNode.asDetachedNode)(n, {
useDeepClone: true
}))));
},
insertBeforeStatement: (target, nodesToInsert) => {
pushMutation((0, _InsertStatement.createInsertStatementMutation)('before', target, toArray(nodesToInsert)));
pushMutation((0, _InsertStatement.createInsertStatementMutation)('before', target, toArray(nodesToInsert).map(n => (0, _detachedNode.asDetachedNode)(n, {
useDeepClone: true
}))));
}

@@ -153,8 +162,21 @@ };

replaceNode: (target, nodeToReplaceWith, options) => {
pushMutation((0, _ReplaceNode.createReplaceNodeMutation)(target, nodeToReplaceWith, options));
pushMutation((0, _ReplaceNode.createReplaceNodeMutation)(target, (0, _detachedNode.asDetachedNode)(nodeToReplaceWith), options));
},
replaceStatementWithMany: (target, nodesToReplaceWith, options) => {
pushMutation((0, _ReplaceStatementWithMany.createReplaceStatementWithManyMutation)(target, nodesToReplaceWith, options));
pushMutation((0, _ReplaceStatementWithMany.createReplaceStatementWithManyMutation)(target, nodesToReplaceWith.map(n => (0, _detachedNode.asDetachedNode)(n)), options));
}
};
const modifyAPIs = {
modifyNodeInPlace: (node, newProps = {}, options) => {
if (node == null) {
return;
}
const cloned = (0, _detachedNode.shallowCloneNode)(node, newProps, {
preserveLocation: true
}); // $FlowExpectedError[incompatible-call]
replaceAPIs.replaceNode(node, cloned, options);
}
};
return {

@@ -171,2 +193,3 @@ mutations,

...insertAPIs,
...modifyAPIs,
...removeAPIs,

@@ -173,0 +196,0 @@ ...replaceAPIs

{
"name": "hermes-transform",
"version": "0.8.0",
"version": "0.9.0",
"description": "Tools built on top of Hermes-ESTree to enable codebase transformation",

@@ -15,4 +15,4 @@ "main": "dist/index.js",

"flow-enums-runtime": "^0.0.6",
"hermes-eslint": "0.8.0",
"hermes-estree": "0.8.0"
"hermes-eslint": "0.9.0",
"hermes-estree": "0.9.0"
},

@@ -23,4 +23,8 @@ "peerDependencies": {

"files": [
"dist"
"dist",
"LICENCE",
"ESLINT_LICENCE",
"PRETTIER_LICENCE",
"README.md"
]
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc