2024-01-29 09:26:07 +08:00

24064 lines
712 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

'use strict';
var build = require('./dep-1be34a63.js');
var compilerDom_cjs$2 = {};
/**
* Make a map and return a function for checking if a key
* is in that map.
* IMPORTANT: all calls of this function must be prefixed with
* \/\*#\_\_PURE\_\_\*\/
* So that rollup can tree-shake them if necessary.
*/
function makeMap(str, expectsLowerCase) {
const map = Object.create(null);
const list = str.split(',');
for (let i = 0; i < list.length; i++) {
map[list[i]] = true;
}
return expectsLowerCase ? val => !!map[val.toLowerCase()] : val => !!map[val];
}
/**
* dev only flag -> name mapping
*/
const PatchFlagNames = {
[1 /* TEXT */]: `TEXT`,
[2 /* CLASS */]: `CLASS`,
[4 /* STYLE */]: `STYLE`,
[8 /* PROPS */]: `PROPS`,
[16 /* FULL_PROPS */]: `FULL_PROPS`,
[32 /* HYDRATE_EVENTS */]: `HYDRATE_EVENTS`,
[64 /* STABLE_FRAGMENT */]: `STABLE_FRAGMENT`,
[128 /* KEYED_FRAGMENT */]: `KEYED_FRAGMENT`,
[256 /* UNKEYED_FRAGMENT */]: `UNKEYED_FRAGMENT`,
[512 /* NEED_PATCH */]: `NEED_PATCH`,
[1024 /* DYNAMIC_SLOTS */]: `DYNAMIC_SLOTS`,
[2048 /* DEV_ROOT_FRAGMENT */]: `DEV_ROOT_FRAGMENT`,
[-1 /* HOISTED */]: `HOISTED`,
[-2 /* BAIL */]: `BAIL`
};
/**
* Dev only
*/
const slotFlagsText = {
[1 /* STABLE */]: 'STABLE',
[2 /* DYNAMIC */]: 'DYNAMIC',
[3 /* FORWARDED */]: 'FORWARDED'
};
const GLOBALS_WHITE_LISTED = 'Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,' +
'decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,' +
'Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt';
const isGloballyWhitelisted = /*#__PURE__*/ makeMap(GLOBALS_WHITE_LISTED);
const range = 2;
function generateCodeFrame(source, start = 0, end = source.length) {
// Split the content into individual lines but capture the newline sequence
// that separated each line. This is important because the actual sequence is
// needed to properly take into account the full line length for offset
// comparison
let lines = source.split(/(\r?\n)/);
// Separate the lines and newline sequences into separate arrays for easier referencing
const newlineSequences = lines.filter((_, idx) => idx % 2 === 1);
lines = lines.filter((_, idx) => idx % 2 === 0);
let count = 0;
const res = [];
for (let i = 0; i < lines.length; i++) {
count +=
lines[i].length +
((newlineSequences[i] && newlineSequences[i].length) || 0);
if (count >= start) {
for (let j = i - range; j <= i + range || end > count; j++) {
if (j < 0 || j >= lines.length)
continue;
const line = j + 1;
res.push(`${line}${' '.repeat(Math.max(3 - String(line).length, 0))}| ${lines[j]}`);
const lineLength = lines[j].length;
const newLineSeqLength = (newlineSequences[j] && newlineSequences[j].length) || 0;
if (j === i) {
// push underline
const pad = start - (count - (lineLength + newLineSeqLength));
const length = Math.max(1, end > count ? lineLength - pad : end - start);
res.push(` | ` + ' '.repeat(pad) + '^'.repeat(length));
}
else if (j > i) {
if (end > count) {
const length = Math.max(Math.min(end - count, lineLength), 1);
res.push(` | ` + '^'.repeat(length));
}
count += lineLength + newLineSeqLength;
}
}
break;
}
}
return res.join('\n');
}
/**
* On the client we only need to offer special cases for boolean attributes that
* have different names from their corresponding dom properties:
* - itemscope -> N/A
* - allowfullscreen -> allowFullscreen
* - formnovalidate -> formNoValidate
* - ismap -> isMap
* - nomodule -> noModule
* - novalidate -> noValidate
* - readonly -> readOnly
*/
const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
const isSpecialBooleanAttr = /*#__PURE__*/ makeMap(specialBooleanAttrs);
/**
* The full list is needed during SSR to produce the correct initial markup.
*/
const isBooleanAttr = /*#__PURE__*/ makeMap(specialBooleanAttrs +
`,async,autofocus,autoplay,controls,default,defer,disabled,hidden,` +
`loop,open,required,reversed,scoped,seamless,` +
`checked,muted,multiple,selected`);
/**
* Boolean attributes should be included if the value is truthy or ''.
* e.g. <select multiple> compiles to { multiple: '' }
*/
function includeBooleanAttr(value) {
return !!value || value === '';
}
const unsafeAttrCharRE = /[>/="'\u0009\u000a\u000c\u0020]/;
const attrValidationCache = {};
function isSSRSafeAttrName(name) {
if (attrValidationCache.hasOwnProperty(name)) {
return attrValidationCache[name];
}
const isUnsafe = unsafeAttrCharRE.test(name);
if (isUnsafe) {
console.error(`unsafe attribute name: ${name}`);
}
return (attrValidationCache[name] = !isUnsafe);
}
const propsToAttrMap = {
acceptCharset: 'accept-charset',
className: 'class',
htmlFor: 'for',
httpEquiv: 'http-equiv'
};
/**
* CSS properties that accept plain numbers
*/
const isNoUnitNumericStyleProp = /*#__PURE__*/ makeMap(`animation-iteration-count,border-image-outset,border-image-slice,` +
`border-image-width,box-flex,box-flex-group,box-ordinal-group,column-count,` +
`columns,flex,flex-grow,flex-positive,flex-shrink,flex-negative,flex-order,` +
`grid-row,grid-row-end,grid-row-span,grid-row-start,grid-column,` +
`grid-column-end,grid-column-span,grid-column-start,font-weight,line-clamp,` +
`line-height,opacity,order,orphans,tab-size,widows,z-index,zoom,` +
// SVG
`fill-opacity,flood-opacity,stop-opacity,stroke-dasharray,stroke-dashoffset,` +
`stroke-miterlimit,stroke-opacity,stroke-width`);
/**
* Known attributes, this is used for stringification of runtime static nodes
* so that we don't stringify bindings that cannot be set from HTML.
* Don't also forget to allow `data-*` and `aria-*`!
* Generated from https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes
*/
const isKnownHtmlAttr = /*#__PURE__*/ makeMap(`accept,accept-charset,accesskey,action,align,allow,alt,async,` +
`autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,` +
`border,buffered,capture,challenge,charset,checked,cite,class,code,` +
`codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,` +
`coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,` +
`disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,` +
`formaction,formenctype,formmethod,formnovalidate,formtarget,headers,` +
`height,hidden,high,href,hreflang,http-equiv,icon,id,importance,integrity,` +
`ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,` +
`manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,` +
`open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,` +
`referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,` +
`selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,` +
`start,step,style,summary,tabindex,target,title,translate,type,usemap,` +
`value,width,wrap`);
/**
* Generated from https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute
*/
const isKnownSvgAttr = /*#__PURE__*/ makeMap(`xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,` +
`arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,` +
`baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,` +
`clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,` +
`color-interpolation-filters,color-profile,color-rendering,` +
`contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,` +
`descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,` +
`dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,` +
`fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,` +
`font-family,font-size,font-size-adjust,font-stretch,font-style,` +
`font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,` +
`glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,` +
`gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,` +
`horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,` +
`k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,` +
`lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,` +
`marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,` +
`mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,` +
`name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,` +
`overflow,overline-position,overline-thickness,panose-1,paint-order,path,` +
`pathLength,patternContentUnits,patternTransform,patternUnits,ping,` +
`pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,` +
`preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,` +
`rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,` +
`restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,` +
`specularConstant,specularExponent,speed,spreadMethod,startOffset,` +
`stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,` +
`strikethrough-position,strikethrough-thickness,string,stroke,` +
`stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,` +
`stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,` +
`systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,` +
`text-decoration,text-rendering,textLength,to,transform,transform-origin,` +
`type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,` +
`unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,` +
`v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,` +
`vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,` +
`writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,` +
`xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xml:base,xml:lang,` +
`xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan`);
function normalizeStyle(value) {
if (isArray(value)) {
const res = {};
for (let i = 0; i < value.length; i++) {
const item = value[i];
const normalized = isString(item)
? parseStringStyle(item)
: normalizeStyle(item);
if (normalized) {
for (const key in normalized) {
res[key] = normalized[key];
}
}
}
return res;
}
else if (isString(value)) {
return value;
}
else if (isObject(value)) {
return value;
}
}
const listDelimiterRE = /;(?![^(]*\))/g;
const propertyDelimiterRE = /:(.+)/;
function parseStringStyle(cssText) {
const ret = {};
cssText.split(listDelimiterRE).forEach(item => {
if (item) {
const tmp = item.split(propertyDelimiterRE);
tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
}
});
return ret;
}
function stringifyStyle(styles) {
let ret = '';
if (!styles || isString(styles)) {
return ret;
}
for (const key in styles) {
const value = styles[key];
const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);
if (isString(value) ||
(typeof value === 'number' && isNoUnitNumericStyleProp(normalizedKey))) {
// only render valid values
ret += `${normalizedKey}:${value};`;
}
}
return ret;
}
function normalizeClass(value) {
let res = '';
if (isString(value)) {
res = value;
}
else if (isArray(value)) {
for (let i = 0; i < value.length; i++) {
const normalized = normalizeClass(value[i]);
if (normalized) {
res += normalized + ' ';
}
}
}
else if (isObject(value)) {
for (const name in value) {
if (value[name]) {
res += name + ' ';
}
}
}
return res.trim();
}
function normalizeProps(props) {
if (!props)
return null;
let { class: klass, style } = props;
if (klass && !isString(klass)) {
props.class = normalizeClass(klass);
}
if (style) {
props.style = normalizeStyle(style);
}
return props;
}
// These tag configs are shared between compiler-dom and runtime-dom, so they
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element
const HTML_TAGS = 'html,body,base,head,link,meta,style,title,address,article,aside,footer,' +
'header,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,' +
'figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,' +
'data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,' +
'time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,' +
'canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,' +
'th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,' +
'option,output,progress,select,textarea,details,dialog,menu,' +
'summary,template,blockquote,iframe,tfoot';
// https://developer.mozilla.org/en-US/docs/Web/SVG/Element
const SVG_TAGS = 'svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,' +
'defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,' +
'feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,' +
'feDistanceLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,' +
'feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,' +
'fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,' +
'foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,' +
'mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,' +
'polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,' +
'text,textPath,title,tspan,unknown,use,view';
const VOID_TAGS = 'area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr';
const isHTMLTag = /*#__PURE__*/ makeMap(HTML_TAGS);
const isSVGTag = /*#__PURE__*/ makeMap(SVG_TAGS);
const isVoidTag = /*#__PURE__*/ makeMap(VOID_TAGS);
const escapeRE = /["'&<>]/;
function escapeHtml(string) {
const str = '' + string;
const match = escapeRE.exec(str);
if (!match) {
return str;
}
let html = '';
let escaped;
let index;
let lastIndex = 0;
for (index = match.index; index < str.length; index++) {
switch (str.charCodeAt(index)) {
case 34: // "
escaped = '&quot;';
break;
case 38: // &
escaped = '&amp;';
break;
case 39: // '
escaped = '&#39;';
break;
case 60: // <
escaped = '&lt;';
break;
case 62: // >
escaped = '&gt;';
break;
default:
continue;
}
if (lastIndex !== index) {
html += str.substring(lastIndex, index);
}
lastIndex = index + 1;
html += escaped;
}
return lastIndex !== index ? html + str.substring(lastIndex, index) : html;
}
// https://www.w3.org/TR/html52/syntax.html#comments
const commentStripRE = /^-?>|<!--|-->|--!>|<!-$/g;
function escapeHtmlComment(src) {
return src.replace(commentStripRE, '');
}
function looseCompareArrays(a, b) {
if (a.length !== b.length)
return false;
let equal = true;
for (let i = 0; equal && i < a.length; i++) {
equal = looseEqual(a[i], b[i]);
}
return equal;
}
function looseEqual(a, b) {
if (a === b)
return true;
let aValidType = isDate(a);
let bValidType = isDate(b);
if (aValidType || bValidType) {
return aValidType && bValidType ? a.getTime() === b.getTime() : false;
}
aValidType = isArray(a);
bValidType = isArray(b);
if (aValidType || bValidType) {
return aValidType && bValidType ? looseCompareArrays(a, b) : false;
}
aValidType = isObject(a);
bValidType = isObject(b);
if (aValidType || bValidType) {
/* istanbul ignore if: this if will probably never be called */
if (!aValidType || !bValidType) {
return false;
}
const aKeysCount = Object.keys(a).length;
const bKeysCount = Object.keys(b).length;
if (aKeysCount !== bKeysCount) {
return false;
}
for (const key in a) {
const aHasKey = a.hasOwnProperty(key);
const bHasKey = b.hasOwnProperty(key);
if ((aHasKey && !bHasKey) ||
(!aHasKey && bHasKey) ||
!looseEqual(a[key], b[key])) {
return false;
}
}
}
return String(a) === String(b);
}
function looseIndexOf(arr, val) {
return arr.findIndex(item => looseEqual(item, val));
}
/**
* For converting {{ interpolation }} values to displayed strings.
* @private
*/
const toDisplayString = (val) => {
return val == null
? ''
: isArray(val) ||
(isObject(val) &&
(val.toString === objectToString$1 || !isFunction$1(val.toString)))
? JSON.stringify(val, replacer, 2)
: String(val);
};
const replacer = (_key, val) => {
// can't use isRef here since @vue/shared has no deps
if (val && val.__v_isRef) {
return replacer(_key, val.value);
}
else if (isMap(val)) {
return {
[`Map(${val.size})`]: [...val.entries()].reduce((entries, [key, val]) => {
entries[`${key} =>`] = val;
return entries;
}, {})
};
}
else if (isSet(val)) {
return {
[`Set(${val.size})`]: [...val.values()]
};
}
else if (isObject(val) && !isArray(val) && !isPlainObject$1(val)) {
return String(val);
}
return val;
};
/**
* List of @babel/parser plugins that are used for template expression
* transforms and SFC script transforms. By default we enable proposals slated
* for ES2020. This will need to be updated as the spec moves forward.
* Full list at https://babeljs.io/docs/en/next/babel-parser#plugins
*/
const babelParserDefaultPlugins = [
'bigInt',
'optionalChaining',
'nullishCoalescingOperator'
];
const EMPTY_OBJ = (process.env.NODE_ENV !== 'production')
? Object.freeze({})
: {};
const EMPTY_ARR = (process.env.NODE_ENV !== 'production') ? Object.freeze([]) : [];
const NOOP = () => { };
/**
* Always return false.
*/
const NO = () => false;
const onRE = /^on[^a-z]/;
const isOn = (key) => onRE.test(key);
const isModelListener = (key) => key.startsWith('onUpdate:');
const extend = Object.assign;
const remove = (arr, el) => {
const i = arr.indexOf(el);
if (i > -1) {
arr.splice(i, 1);
}
};
const hasOwnProperty = Object.prototype.hasOwnProperty;
const hasOwn = (val, key) => hasOwnProperty.call(val, key);
const isArray = Array.isArray;
const isMap = (val) => toTypeString(val) === '[object Map]';
const isSet = (val) => toTypeString(val) === '[object Set]';
const isDate = (val) => val instanceof Date;
const isFunction$1 = (val) => typeof val === 'function';
const isString = (val) => typeof val === 'string';
const isSymbol = (val) => typeof val === 'symbol';
const isObject = (val) => val !== null && typeof val === 'object';
const isPromise = (val) => {
return isObject(val) && isFunction$1(val.then) && isFunction$1(val.catch);
};
const objectToString$1 = Object.prototype.toString;
const toTypeString = (value) => objectToString$1.call(value);
const toRawType = (value) => {
// extract "RawType" from strings like "[object RawType]"
return toTypeString(value).slice(8, -1);
};
const isPlainObject$1 = (val) => toTypeString(val) === '[object Object]';
const isIntegerKey = (key) => isString(key) &&
key !== 'NaN' &&
key[0] !== '-' &&
'' + parseInt(key, 10) === key;
const isReservedProp = /*#__PURE__*/ makeMap(
// the leading comma is intentional so empty string "" is also included
',key,ref,' +
'onVnodeBeforeMount,onVnodeMounted,' +
'onVnodeBeforeUpdate,onVnodeUpdated,' +
'onVnodeBeforeUnmount,onVnodeUnmounted');
const cacheStringFunction$1 = (fn) => {
const cache = Object.create(null);
return ((str) => {
const hit = cache[str];
return hit || (cache[str] = fn(str));
});
};
const camelizeRE$1 = /-(\w)/g;
/**
* @private
*/
const camelize$1 = cacheStringFunction$1((str) => {
return str.replace(camelizeRE$1, (_, c) => (c ? c.toUpperCase() : ''));
});
const hyphenateRE = /\B([A-Z])/g;
/**
* @private
*/
const hyphenate = cacheStringFunction$1((str) => str.replace(hyphenateRE, '-$1').toLowerCase());
/**
* @private
*/
const capitalize = cacheStringFunction$1((str) => str.charAt(0).toUpperCase() + str.slice(1));
/**
* @private
*/
const toHandlerKey = cacheStringFunction$1((str) => str ? `on${capitalize(str)}` : ``);
// compare whether a value has changed, accounting for NaN.
const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
const invokeArrayFns = (fns, arg) => {
for (let i = 0; i < fns.length; i++) {
fns[i](arg);
}
};
const def = (obj, key, value) => {
Object.defineProperty(obj, key, {
configurable: true,
enumerable: false,
value
});
};
const toNumber = (val) => {
const n = parseFloat(val);
return isNaN(n) ? val : n;
};
let _globalThis;
const getGlobalThis = () => {
return (_globalThis ||
(_globalThis =
typeof globalThis !== 'undefined'
? globalThis
: typeof self !== 'undefined'
? self
: typeof window !== 'undefined'
? window
: typeof global !== 'undefined'
? global
: {}));
};
var shared_esmBundler = {
__proto__: null,
EMPTY_ARR: EMPTY_ARR,
EMPTY_OBJ: EMPTY_OBJ,
NO: NO,
NOOP: NOOP,
PatchFlagNames: PatchFlagNames,
babelParserDefaultPlugins: babelParserDefaultPlugins,
camelize: camelize$1,
capitalize: capitalize,
def: def,
escapeHtml: escapeHtml,
escapeHtmlComment: escapeHtmlComment,
extend: extend,
generateCodeFrame: generateCodeFrame,
getGlobalThis: getGlobalThis,
hasChanged: hasChanged,
hasOwn: hasOwn,
hyphenate: hyphenate,
includeBooleanAttr: includeBooleanAttr,
invokeArrayFns: invokeArrayFns,
isArray: isArray,
isBooleanAttr: isBooleanAttr,
isDate: isDate,
isFunction: isFunction$1,
isGloballyWhitelisted: isGloballyWhitelisted,
isHTMLTag: isHTMLTag,
isIntegerKey: isIntegerKey,
isKnownHtmlAttr: isKnownHtmlAttr,
isKnownSvgAttr: isKnownSvgAttr,
isMap: isMap,
isModelListener: isModelListener,
isNoUnitNumericStyleProp: isNoUnitNumericStyleProp,
isObject: isObject,
isOn: isOn,
isPlainObject: isPlainObject$1,
isPromise: isPromise,
isReservedProp: isReservedProp,
isSSRSafeAttrName: isSSRSafeAttrName,
isSVGTag: isSVGTag,
isSet: isSet,
isSpecialBooleanAttr: isSpecialBooleanAttr,
isString: isString,
isSymbol: isSymbol,
isVoidTag: isVoidTag,
looseEqual: looseEqual,
looseIndexOf: looseIndexOf,
makeMap: makeMap,
normalizeClass: normalizeClass,
normalizeProps: normalizeProps,
normalizeStyle: normalizeStyle,
objectToString: objectToString$1,
parseStringStyle: parseStringStyle,
propsToAttrMap: propsToAttrMap,
remove: remove,
slotFlagsText: slotFlagsText,
stringifyStyle: stringifyStyle,
toDisplayString: toDisplayString,
toHandlerKey: toHandlerKey,
toNumber: toNumber,
toRawType: toRawType,
toTypeString: toTypeString
};
var lib$1 = {};
var isReactComponent$1 = {};
var buildMatchMemberExpression$1 = {};
var matchesPattern$1 = {};
var generated$4 = {};
var shallowEqual$1 = {};
Object.defineProperty(shallowEqual$1, "__esModule", {
value: true
});
shallowEqual$1.default = shallowEqual;
function shallowEqual(actual, expected) {
const keys = Object.keys(expected);
for (const key of keys) {
if (actual[key] !== expected[key]) {
return false;
}
}
return true;
}
Object.defineProperty(generated$4, "__esModule", {
value: true
});
generated$4.isArrayExpression = isArrayExpression;
generated$4.isAssignmentExpression = isAssignmentExpression;
generated$4.isBinaryExpression = isBinaryExpression;
generated$4.isInterpreterDirective = isInterpreterDirective;
generated$4.isDirective = isDirective;
generated$4.isDirectiveLiteral = isDirectiveLiteral;
generated$4.isBlockStatement = isBlockStatement;
generated$4.isBreakStatement = isBreakStatement;
generated$4.isCallExpression = isCallExpression;
generated$4.isCatchClause = isCatchClause;
generated$4.isConditionalExpression = isConditionalExpression;
generated$4.isContinueStatement = isContinueStatement;
generated$4.isDebuggerStatement = isDebuggerStatement;
generated$4.isDoWhileStatement = isDoWhileStatement;
generated$4.isEmptyStatement = isEmptyStatement;
generated$4.isExpressionStatement = isExpressionStatement;
generated$4.isFile = isFile;
generated$4.isForInStatement = isForInStatement;
generated$4.isForStatement = isForStatement;
generated$4.isFunctionDeclaration = isFunctionDeclaration;
generated$4.isFunctionExpression = isFunctionExpression;
generated$4.isIdentifier = isIdentifier;
generated$4.isIfStatement = isIfStatement;
generated$4.isLabeledStatement = isLabeledStatement;
generated$4.isStringLiteral = isStringLiteral;
generated$4.isNumericLiteral = isNumericLiteral;
generated$4.isNullLiteral = isNullLiteral;
generated$4.isBooleanLiteral = isBooleanLiteral;
generated$4.isRegExpLiteral = isRegExpLiteral;
generated$4.isLogicalExpression = isLogicalExpression;
generated$4.isMemberExpression = isMemberExpression$1;
generated$4.isNewExpression = isNewExpression;
generated$4.isProgram = isProgram;
generated$4.isObjectExpression = isObjectExpression;
generated$4.isObjectMethod = isObjectMethod;
generated$4.isObjectProperty = isObjectProperty;
generated$4.isRestElement = isRestElement;
generated$4.isReturnStatement = isReturnStatement;
generated$4.isSequenceExpression = isSequenceExpression;
generated$4.isParenthesizedExpression = isParenthesizedExpression;
generated$4.isSwitchCase = isSwitchCase;
generated$4.isSwitchStatement = isSwitchStatement;
generated$4.isThisExpression = isThisExpression;
generated$4.isThrowStatement = isThrowStatement;
generated$4.isTryStatement = isTryStatement;
generated$4.isUnaryExpression = isUnaryExpression;
generated$4.isUpdateExpression = isUpdateExpression;
generated$4.isVariableDeclaration = isVariableDeclaration;
generated$4.isVariableDeclarator = isVariableDeclarator;
generated$4.isWhileStatement = isWhileStatement;
generated$4.isWithStatement = isWithStatement;
generated$4.isAssignmentPattern = isAssignmentPattern;
generated$4.isArrayPattern = isArrayPattern;
generated$4.isArrowFunctionExpression = isArrowFunctionExpression;
generated$4.isClassBody = isClassBody;
generated$4.isClassExpression = isClassExpression;
generated$4.isClassDeclaration = isClassDeclaration;
generated$4.isExportAllDeclaration = isExportAllDeclaration;
generated$4.isExportDefaultDeclaration = isExportDefaultDeclaration;
generated$4.isExportNamedDeclaration = isExportNamedDeclaration;
generated$4.isExportSpecifier = isExportSpecifier;
generated$4.isForOfStatement = isForOfStatement;
generated$4.isImportDeclaration = isImportDeclaration;
generated$4.isImportDefaultSpecifier = isImportDefaultSpecifier;
generated$4.isImportNamespaceSpecifier = isImportNamespaceSpecifier;
generated$4.isImportSpecifier = isImportSpecifier;
generated$4.isMetaProperty = isMetaProperty;
generated$4.isClassMethod = isClassMethod;
generated$4.isObjectPattern = isObjectPattern;
generated$4.isSpreadElement = isSpreadElement;
generated$4.isSuper = isSuper;
generated$4.isTaggedTemplateExpression = isTaggedTemplateExpression;
generated$4.isTemplateElement = isTemplateElement;
generated$4.isTemplateLiteral = isTemplateLiteral;
generated$4.isYieldExpression = isYieldExpression;
generated$4.isAwaitExpression = isAwaitExpression;
generated$4.isImport = isImport;
generated$4.isBigIntLiteral = isBigIntLiteral;
generated$4.isExportNamespaceSpecifier = isExportNamespaceSpecifier;
generated$4.isOptionalMemberExpression = isOptionalMemberExpression;
generated$4.isOptionalCallExpression = isOptionalCallExpression;
generated$4.isClassProperty = isClassProperty;
generated$4.isClassPrivateProperty = isClassPrivateProperty;
generated$4.isClassPrivateMethod = isClassPrivateMethod;
generated$4.isPrivateName = isPrivateName;
generated$4.isAnyTypeAnnotation = isAnyTypeAnnotation;
generated$4.isArrayTypeAnnotation = isArrayTypeAnnotation;
generated$4.isBooleanTypeAnnotation = isBooleanTypeAnnotation;
generated$4.isBooleanLiteralTypeAnnotation = isBooleanLiteralTypeAnnotation;
generated$4.isNullLiteralTypeAnnotation = isNullLiteralTypeAnnotation;
generated$4.isClassImplements = isClassImplements;
generated$4.isDeclareClass = isDeclareClass;
generated$4.isDeclareFunction = isDeclareFunction;
generated$4.isDeclareInterface = isDeclareInterface;
generated$4.isDeclareModule = isDeclareModule;
generated$4.isDeclareModuleExports = isDeclareModuleExports;
generated$4.isDeclareTypeAlias = isDeclareTypeAlias;
generated$4.isDeclareOpaqueType = isDeclareOpaqueType;
generated$4.isDeclareVariable = isDeclareVariable;
generated$4.isDeclareExportDeclaration = isDeclareExportDeclaration;
generated$4.isDeclareExportAllDeclaration = isDeclareExportAllDeclaration;
generated$4.isDeclaredPredicate = isDeclaredPredicate;
generated$4.isExistsTypeAnnotation = isExistsTypeAnnotation;
generated$4.isFunctionTypeAnnotation = isFunctionTypeAnnotation;
generated$4.isFunctionTypeParam = isFunctionTypeParam;
generated$4.isGenericTypeAnnotation = isGenericTypeAnnotation;
generated$4.isInferredPredicate = isInferredPredicate;
generated$4.isInterfaceExtends = isInterfaceExtends;
generated$4.isInterfaceDeclaration = isInterfaceDeclaration;
generated$4.isInterfaceTypeAnnotation = isInterfaceTypeAnnotation;
generated$4.isIntersectionTypeAnnotation = isIntersectionTypeAnnotation;
generated$4.isMixedTypeAnnotation = isMixedTypeAnnotation;
generated$4.isEmptyTypeAnnotation = isEmptyTypeAnnotation;
generated$4.isNullableTypeAnnotation = isNullableTypeAnnotation;
generated$4.isNumberLiteralTypeAnnotation = isNumberLiteralTypeAnnotation;
generated$4.isNumberTypeAnnotation = isNumberTypeAnnotation;
generated$4.isObjectTypeAnnotation = isObjectTypeAnnotation;
generated$4.isObjectTypeInternalSlot = isObjectTypeInternalSlot;
generated$4.isObjectTypeCallProperty = isObjectTypeCallProperty;
generated$4.isObjectTypeIndexer = isObjectTypeIndexer;
generated$4.isObjectTypeProperty = isObjectTypeProperty;
generated$4.isObjectTypeSpreadProperty = isObjectTypeSpreadProperty;
generated$4.isOpaqueType = isOpaqueType;
generated$4.isQualifiedTypeIdentifier = isQualifiedTypeIdentifier;
generated$4.isStringLiteralTypeAnnotation = isStringLiteralTypeAnnotation;
generated$4.isStringTypeAnnotation = isStringTypeAnnotation;
generated$4.isSymbolTypeAnnotation = isSymbolTypeAnnotation;
generated$4.isThisTypeAnnotation = isThisTypeAnnotation;
generated$4.isTupleTypeAnnotation = isTupleTypeAnnotation;
generated$4.isTypeofTypeAnnotation = isTypeofTypeAnnotation;
generated$4.isTypeAlias = isTypeAlias;
generated$4.isTypeAnnotation = isTypeAnnotation;
generated$4.isTypeCastExpression = isTypeCastExpression;
generated$4.isTypeParameter = isTypeParameter;
generated$4.isTypeParameterDeclaration = isTypeParameterDeclaration;
generated$4.isTypeParameterInstantiation = isTypeParameterInstantiation;
generated$4.isUnionTypeAnnotation = isUnionTypeAnnotation;
generated$4.isVariance = isVariance;
generated$4.isVoidTypeAnnotation = isVoidTypeAnnotation;
generated$4.isEnumDeclaration = isEnumDeclaration;
generated$4.isEnumBooleanBody = isEnumBooleanBody;
generated$4.isEnumNumberBody = isEnumNumberBody;
generated$4.isEnumStringBody = isEnumStringBody;
generated$4.isEnumSymbolBody = isEnumSymbolBody;
generated$4.isEnumBooleanMember = isEnumBooleanMember;
generated$4.isEnumNumberMember = isEnumNumberMember;
generated$4.isEnumStringMember = isEnumStringMember;
generated$4.isEnumDefaultedMember = isEnumDefaultedMember;
generated$4.isIndexedAccessType = isIndexedAccessType;
generated$4.isOptionalIndexedAccessType = isOptionalIndexedAccessType;
generated$4.isJSXAttribute = isJSXAttribute;
generated$4.isJSXClosingElement = isJSXClosingElement;
generated$4.isJSXElement = isJSXElement;
generated$4.isJSXEmptyExpression = isJSXEmptyExpression;
generated$4.isJSXExpressionContainer = isJSXExpressionContainer;
generated$4.isJSXSpreadChild = isJSXSpreadChild;
generated$4.isJSXIdentifier = isJSXIdentifier;
generated$4.isJSXMemberExpression = isJSXMemberExpression;
generated$4.isJSXNamespacedName = isJSXNamespacedName;
generated$4.isJSXOpeningElement = isJSXOpeningElement;
generated$4.isJSXSpreadAttribute = isJSXSpreadAttribute;
generated$4.isJSXText = isJSXText;
generated$4.isJSXFragment = isJSXFragment;
generated$4.isJSXOpeningFragment = isJSXOpeningFragment;
generated$4.isJSXClosingFragment = isJSXClosingFragment;
generated$4.isNoop = isNoop;
generated$4.isPlaceholder = isPlaceholder;
generated$4.isV8IntrinsicIdentifier = isV8IntrinsicIdentifier;
generated$4.isArgumentPlaceholder = isArgumentPlaceholder;
generated$4.isBindExpression = isBindExpression;
generated$4.isImportAttribute = isImportAttribute;
generated$4.isDecorator = isDecorator;
generated$4.isDoExpression = isDoExpression;
generated$4.isExportDefaultSpecifier = isExportDefaultSpecifier;
generated$4.isRecordExpression = isRecordExpression;
generated$4.isTupleExpression = isTupleExpression;
generated$4.isDecimalLiteral = isDecimalLiteral;
generated$4.isStaticBlock = isStaticBlock;
generated$4.isModuleExpression = isModuleExpression;
generated$4.isTopicReference = isTopicReference;
generated$4.isPipelineTopicExpression = isPipelineTopicExpression;
generated$4.isPipelineBareFunction = isPipelineBareFunction;
generated$4.isPipelinePrimaryTopicReference = isPipelinePrimaryTopicReference;
generated$4.isTSParameterProperty = isTSParameterProperty;
generated$4.isTSDeclareFunction = isTSDeclareFunction;
generated$4.isTSDeclareMethod = isTSDeclareMethod;
generated$4.isTSQualifiedName = isTSQualifiedName;
generated$4.isTSCallSignatureDeclaration = isTSCallSignatureDeclaration;
generated$4.isTSConstructSignatureDeclaration = isTSConstructSignatureDeclaration;
generated$4.isTSPropertySignature = isTSPropertySignature;
generated$4.isTSMethodSignature = isTSMethodSignature;
generated$4.isTSIndexSignature = isTSIndexSignature;
generated$4.isTSAnyKeyword = isTSAnyKeyword;
generated$4.isTSBooleanKeyword = isTSBooleanKeyword;
generated$4.isTSBigIntKeyword = isTSBigIntKeyword;
generated$4.isTSIntrinsicKeyword = isTSIntrinsicKeyword;
generated$4.isTSNeverKeyword = isTSNeverKeyword;
generated$4.isTSNullKeyword = isTSNullKeyword;
generated$4.isTSNumberKeyword = isTSNumberKeyword;
generated$4.isTSObjectKeyword = isTSObjectKeyword;
generated$4.isTSStringKeyword = isTSStringKeyword;
generated$4.isTSSymbolKeyword = isTSSymbolKeyword;
generated$4.isTSUndefinedKeyword = isTSUndefinedKeyword;
generated$4.isTSUnknownKeyword = isTSUnknownKeyword;
generated$4.isTSVoidKeyword = isTSVoidKeyword;
generated$4.isTSThisType = isTSThisType;
generated$4.isTSFunctionType = isTSFunctionType;
generated$4.isTSConstructorType = isTSConstructorType;
generated$4.isTSTypeReference = isTSTypeReference;
generated$4.isTSTypePredicate = isTSTypePredicate;
generated$4.isTSTypeQuery = isTSTypeQuery;
generated$4.isTSTypeLiteral = isTSTypeLiteral;
generated$4.isTSArrayType = isTSArrayType;
generated$4.isTSTupleType = isTSTupleType;
generated$4.isTSOptionalType = isTSOptionalType;
generated$4.isTSRestType = isTSRestType;
generated$4.isTSNamedTupleMember = isTSNamedTupleMember;
generated$4.isTSUnionType = isTSUnionType;
generated$4.isTSIntersectionType = isTSIntersectionType;
generated$4.isTSConditionalType = isTSConditionalType;
generated$4.isTSInferType = isTSInferType;
generated$4.isTSParenthesizedType = isTSParenthesizedType;
generated$4.isTSTypeOperator = isTSTypeOperator;
generated$4.isTSIndexedAccessType = isTSIndexedAccessType;
generated$4.isTSMappedType = isTSMappedType;
generated$4.isTSLiteralType = isTSLiteralType;
generated$4.isTSExpressionWithTypeArguments = isTSExpressionWithTypeArguments;
generated$4.isTSInterfaceDeclaration = isTSInterfaceDeclaration;
generated$4.isTSInterfaceBody = isTSInterfaceBody;
generated$4.isTSTypeAliasDeclaration = isTSTypeAliasDeclaration;
generated$4.isTSAsExpression = isTSAsExpression;
generated$4.isTSTypeAssertion = isTSTypeAssertion;
generated$4.isTSEnumDeclaration = isTSEnumDeclaration;
generated$4.isTSEnumMember = isTSEnumMember;
generated$4.isTSModuleDeclaration = isTSModuleDeclaration;
generated$4.isTSModuleBlock = isTSModuleBlock;
generated$4.isTSImportType = isTSImportType;
generated$4.isTSImportEqualsDeclaration = isTSImportEqualsDeclaration;
generated$4.isTSExternalModuleReference = isTSExternalModuleReference;
generated$4.isTSNonNullExpression = isTSNonNullExpression;
generated$4.isTSExportAssignment = isTSExportAssignment;
generated$4.isTSNamespaceExportDeclaration = isTSNamespaceExportDeclaration;
generated$4.isTSTypeAnnotation = isTSTypeAnnotation;
generated$4.isTSTypeParameterInstantiation = isTSTypeParameterInstantiation;
generated$4.isTSTypeParameterDeclaration = isTSTypeParameterDeclaration;
generated$4.isTSTypeParameter = isTSTypeParameter;
generated$4.isExpression = isExpression;
generated$4.isBinary = isBinary;
generated$4.isScopable = isScopable;
generated$4.isBlockParent = isBlockParent;
generated$4.isBlock = isBlock;
generated$4.isStatement = isStatement;
generated$4.isTerminatorless = isTerminatorless;
generated$4.isCompletionStatement = isCompletionStatement;
generated$4.isConditional = isConditional;
generated$4.isLoop = isLoop;
generated$4.isWhile = isWhile;
generated$4.isExpressionWrapper = isExpressionWrapper;
generated$4.isFor = isFor;
generated$4.isForXStatement = isForXStatement;
generated$4.isFunction = isFunction;
generated$4.isFunctionParent = isFunctionParent;
generated$4.isPureish = isPureish;
generated$4.isDeclaration = isDeclaration;
generated$4.isPatternLike = isPatternLike;
generated$4.isLVal = isLVal;
generated$4.isTSEntityName = isTSEntityName;
generated$4.isLiteral = isLiteral;
generated$4.isImmutable = isImmutable$2;
generated$4.isUserWhitespacable = isUserWhitespacable;
generated$4.isMethod = isMethod;
generated$4.isObjectMember = isObjectMember;
generated$4.isProperty = isProperty;
generated$4.isUnaryLike = isUnaryLike;
generated$4.isPattern = isPattern;
generated$4.isClass = isClass;
generated$4.isModuleDeclaration = isModuleDeclaration;
generated$4.isExportDeclaration = isExportDeclaration;
generated$4.isModuleSpecifier = isModuleSpecifier;
generated$4.isPrivate = isPrivate;
generated$4.isFlow = isFlow;
generated$4.isFlowType = isFlowType;
generated$4.isFlowBaseAnnotation = isFlowBaseAnnotation;
generated$4.isFlowDeclaration = isFlowDeclaration;
generated$4.isFlowPredicate = isFlowPredicate;
generated$4.isEnumBody = isEnumBody;
generated$4.isEnumMember = isEnumMember;
generated$4.isJSX = isJSX;
generated$4.isTSTypeElement = isTSTypeElement;
generated$4.isTSType = isTSType;
generated$4.isTSBaseType = isTSBaseType;
generated$4.isNumberLiteral = isNumberLiteral;
generated$4.isRegexLiteral = isRegexLiteral;
generated$4.isRestProperty = isRestProperty;
generated$4.isSpreadProperty = isSpreadProperty;
var _shallowEqual$1 = shallowEqual$1;
function isArrayExpression(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "ArrayExpression") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isAssignmentExpression(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "AssignmentExpression") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isBinaryExpression(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "BinaryExpression") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isInterpreterDirective(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "InterpreterDirective") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isDirective(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "Directive") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isDirectiveLiteral(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "DirectiveLiteral") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isBlockStatement(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "BlockStatement") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isBreakStatement(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "BreakStatement") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isCallExpression(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "CallExpression") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isCatchClause(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "CatchClause") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isConditionalExpression(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "ConditionalExpression") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isContinueStatement(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "ContinueStatement") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isDebuggerStatement(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "DebuggerStatement") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isDoWhileStatement(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "DoWhileStatement") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isEmptyStatement(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "EmptyStatement") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isExpressionStatement(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "ExpressionStatement") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isFile(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "File") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isForInStatement(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "ForInStatement") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isForStatement(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "ForStatement") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isFunctionDeclaration(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "FunctionDeclaration") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isFunctionExpression(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "FunctionExpression") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isIdentifier(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "Identifier") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isIfStatement(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "IfStatement") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isLabeledStatement(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "LabeledStatement") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isStringLiteral(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "StringLiteral") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isNumericLiteral(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "NumericLiteral") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isNullLiteral(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "NullLiteral") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isBooleanLiteral(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "BooleanLiteral") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isRegExpLiteral(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "RegExpLiteral") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isLogicalExpression(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "LogicalExpression") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isMemberExpression$1(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "MemberExpression") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isNewExpression(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "NewExpression") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isProgram(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "Program") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isObjectExpression(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "ObjectExpression") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isObjectMethod(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "ObjectMethod") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isObjectProperty(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "ObjectProperty") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isRestElement(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "RestElement") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isReturnStatement(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "ReturnStatement") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isSequenceExpression(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "SequenceExpression") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isParenthesizedExpression(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "ParenthesizedExpression") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isSwitchCase(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "SwitchCase") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isSwitchStatement(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "SwitchStatement") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isThisExpression(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "ThisExpression") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isThrowStatement(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "ThrowStatement") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTryStatement(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TryStatement") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isUnaryExpression(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "UnaryExpression") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isUpdateExpression(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "UpdateExpression") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isVariableDeclaration(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "VariableDeclaration") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isVariableDeclarator(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "VariableDeclarator") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isWhileStatement(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "WhileStatement") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isWithStatement(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "WithStatement") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isAssignmentPattern(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "AssignmentPattern") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isArrayPattern(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "ArrayPattern") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isArrowFunctionExpression(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "ArrowFunctionExpression") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isClassBody(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "ClassBody") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isClassExpression(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "ClassExpression") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isClassDeclaration(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "ClassDeclaration") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isExportAllDeclaration(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "ExportAllDeclaration") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isExportDefaultDeclaration(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "ExportDefaultDeclaration") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isExportNamedDeclaration(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "ExportNamedDeclaration") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isExportSpecifier(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "ExportSpecifier") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isForOfStatement(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "ForOfStatement") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isImportDeclaration(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "ImportDeclaration") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isImportDefaultSpecifier(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "ImportDefaultSpecifier") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isImportNamespaceSpecifier(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "ImportNamespaceSpecifier") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isImportSpecifier(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "ImportSpecifier") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isMetaProperty(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "MetaProperty") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isClassMethod(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "ClassMethod") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isObjectPattern(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "ObjectPattern") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isSpreadElement(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "SpreadElement") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isSuper(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "Super") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTaggedTemplateExpression(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TaggedTemplateExpression") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTemplateElement(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TemplateElement") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTemplateLiteral(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TemplateLiteral") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isYieldExpression(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "YieldExpression") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isAwaitExpression(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "AwaitExpression") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isImport(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "Import") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isBigIntLiteral(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "BigIntLiteral") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isExportNamespaceSpecifier(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "ExportNamespaceSpecifier") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isOptionalMemberExpression(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "OptionalMemberExpression") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isOptionalCallExpression(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "OptionalCallExpression") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isClassProperty(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "ClassProperty") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isClassPrivateProperty(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "ClassPrivateProperty") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isClassPrivateMethod(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "ClassPrivateMethod") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isPrivateName(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "PrivateName") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isAnyTypeAnnotation(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "AnyTypeAnnotation") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isArrayTypeAnnotation(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "ArrayTypeAnnotation") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isBooleanTypeAnnotation(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "BooleanTypeAnnotation") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isBooleanLiteralTypeAnnotation(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "BooleanLiteralTypeAnnotation") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isNullLiteralTypeAnnotation(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "NullLiteralTypeAnnotation") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isClassImplements(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "ClassImplements") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isDeclareClass(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "DeclareClass") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isDeclareFunction(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "DeclareFunction") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isDeclareInterface(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "DeclareInterface") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isDeclareModule(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "DeclareModule") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isDeclareModuleExports(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "DeclareModuleExports") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isDeclareTypeAlias(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "DeclareTypeAlias") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isDeclareOpaqueType(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "DeclareOpaqueType") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isDeclareVariable(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "DeclareVariable") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isDeclareExportDeclaration(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "DeclareExportDeclaration") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isDeclareExportAllDeclaration(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "DeclareExportAllDeclaration") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isDeclaredPredicate(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "DeclaredPredicate") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isExistsTypeAnnotation(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "ExistsTypeAnnotation") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isFunctionTypeAnnotation(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "FunctionTypeAnnotation") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isFunctionTypeParam(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "FunctionTypeParam") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isGenericTypeAnnotation(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "GenericTypeAnnotation") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isInferredPredicate(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "InferredPredicate") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isInterfaceExtends(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "InterfaceExtends") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isInterfaceDeclaration(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "InterfaceDeclaration") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isInterfaceTypeAnnotation(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "InterfaceTypeAnnotation") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isIntersectionTypeAnnotation(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "IntersectionTypeAnnotation") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isMixedTypeAnnotation(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "MixedTypeAnnotation") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isEmptyTypeAnnotation(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "EmptyTypeAnnotation") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isNullableTypeAnnotation(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "NullableTypeAnnotation") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isNumberLiteralTypeAnnotation(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "NumberLiteralTypeAnnotation") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isNumberTypeAnnotation(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "NumberTypeAnnotation") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isObjectTypeAnnotation(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "ObjectTypeAnnotation") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isObjectTypeInternalSlot(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "ObjectTypeInternalSlot") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isObjectTypeCallProperty(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "ObjectTypeCallProperty") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isObjectTypeIndexer(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "ObjectTypeIndexer") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isObjectTypeProperty(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "ObjectTypeProperty") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isObjectTypeSpreadProperty(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "ObjectTypeSpreadProperty") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isOpaqueType(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "OpaqueType") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isQualifiedTypeIdentifier(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "QualifiedTypeIdentifier") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isStringLiteralTypeAnnotation(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "StringLiteralTypeAnnotation") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isStringTypeAnnotation(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "StringTypeAnnotation") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isSymbolTypeAnnotation(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "SymbolTypeAnnotation") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isThisTypeAnnotation(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "ThisTypeAnnotation") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTupleTypeAnnotation(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TupleTypeAnnotation") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTypeofTypeAnnotation(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TypeofTypeAnnotation") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTypeAlias(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TypeAlias") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTypeAnnotation(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TypeAnnotation") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTypeCastExpression(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TypeCastExpression") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTypeParameter(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TypeParameter") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTypeParameterDeclaration(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TypeParameterDeclaration") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTypeParameterInstantiation(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TypeParameterInstantiation") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isUnionTypeAnnotation(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "UnionTypeAnnotation") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isVariance(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "Variance") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isVoidTypeAnnotation(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "VoidTypeAnnotation") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isEnumDeclaration(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "EnumDeclaration") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isEnumBooleanBody(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "EnumBooleanBody") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isEnumNumberBody(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "EnumNumberBody") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isEnumStringBody(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "EnumStringBody") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isEnumSymbolBody(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "EnumSymbolBody") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isEnumBooleanMember(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "EnumBooleanMember") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isEnumNumberMember(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "EnumNumberMember") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isEnumStringMember(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "EnumStringMember") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isEnumDefaultedMember(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "EnumDefaultedMember") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isIndexedAccessType(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "IndexedAccessType") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isOptionalIndexedAccessType(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "OptionalIndexedAccessType") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isJSXAttribute(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "JSXAttribute") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isJSXClosingElement(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "JSXClosingElement") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isJSXElement(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "JSXElement") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isJSXEmptyExpression(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "JSXEmptyExpression") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isJSXExpressionContainer(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "JSXExpressionContainer") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isJSXSpreadChild(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "JSXSpreadChild") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isJSXIdentifier(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "JSXIdentifier") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isJSXMemberExpression(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "JSXMemberExpression") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isJSXNamespacedName(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "JSXNamespacedName") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isJSXOpeningElement(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "JSXOpeningElement") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isJSXSpreadAttribute(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "JSXSpreadAttribute") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isJSXText(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "JSXText") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isJSXFragment(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "JSXFragment") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isJSXOpeningFragment(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "JSXOpeningFragment") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isJSXClosingFragment(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "JSXClosingFragment") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isNoop(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "Noop") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isPlaceholder(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "Placeholder") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isV8IntrinsicIdentifier(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "V8IntrinsicIdentifier") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isArgumentPlaceholder(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "ArgumentPlaceholder") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isBindExpression(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "BindExpression") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isImportAttribute(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "ImportAttribute") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isDecorator(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "Decorator") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isDoExpression(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "DoExpression") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isExportDefaultSpecifier(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "ExportDefaultSpecifier") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isRecordExpression(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "RecordExpression") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTupleExpression(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TupleExpression") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isDecimalLiteral(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "DecimalLiteral") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isStaticBlock(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "StaticBlock") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isModuleExpression(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "ModuleExpression") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTopicReference(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TopicReference") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isPipelineTopicExpression(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "PipelineTopicExpression") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isPipelineBareFunction(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "PipelineBareFunction") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isPipelinePrimaryTopicReference(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "PipelinePrimaryTopicReference") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSParameterProperty(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSParameterProperty") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSDeclareFunction(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSDeclareFunction") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSDeclareMethod(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSDeclareMethod") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSQualifiedName(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSQualifiedName") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSCallSignatureDeclaration(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSCallSignatureDeclaration") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSConstructSignatureDeclaration(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSConstructSignatureDeclaration") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSPropertySignature(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSPropertySignature") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSMethodSignature(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSMethodSignature") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSIndexSignature(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSIndexSignature") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSAnyKeyword(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSAnyKeyword") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSBooleanKeyword(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSBooleanKeyword") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSBigIntKeyword(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSBigIntKeyword") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSIntrinsicKeyword(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSIntrinsicKeyword") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSNeverKeyword(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSNeverKeyword") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSNullKeyword(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSNullKeyword") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSNumberKeyword(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSNumberKeyword") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSObjectKeyword(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSObjectKeyword") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSStringKeyword(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSStringKeyword") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSSymbolKeyword(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSSymbolKeyword") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSUndefinedKeyword(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSUndefinedKeyword") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSUnknownKeyword(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSUnknownKeyword") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSVoidKeyword(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSVoidKeyword") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSThisType(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSThisType") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSFunctionType(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSFunctionType") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSConstructorType(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSConstructorType") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSTypeReference(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSTypeReference") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSTypePredicate(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSTypePredicate") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSTypeQuery(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSTypeQuery") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSTypeLiteral(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSTypeLiteral") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSArrayType(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSArrayType") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSTupleType(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSTupleType") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSOptionalType(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSOptionalType") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSRestType(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSRestType") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSNamedTupleMember(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSNamedTupleMember") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSUnionType(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSUnionType") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSIntersectionType(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSIntersectionType") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSConditionalType(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSConditionalType") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSInferType(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSInferType") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSParenthesizedType(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSParenthesizedType") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSTypeOperator(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSTypeOperator") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSIndexedAccessType(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSIndexedAccessType") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSMappedType(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSMappedType") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSLiteralType(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSLiteralType") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSExpressionWithTypeArguments(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSExpressionWithTypeArguments") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSInterfaceDeclaration(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSInterfaceDeclaration") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSInterfaceBody(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSInterfaceBody") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSTypeAliasDeclaration(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSTypeAliasDeclaration") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSAsExpression(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSAsExpression") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSTypeAssertion(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSTypeAssertion") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSEnumDeclaration(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSEnumDeclaration") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSEnumMember(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSEnumMember") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSModuleDeclaration(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSModuleDeclaration") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSModuleBlock(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSModuleBlock") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSImportType(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSImportType") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSImportEqualsDeclaration(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSImportEqualsDeclaration") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSExternalModuleReference(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSExternalModuleReference") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSNonNullExpression(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSNonNullExpression") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSExportAssignment(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSExportAssignment") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSNamespaceExportDeclaration(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSNamespaceExportDeclaration") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSTypeAnnotation(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSTypeAnnotation") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSTypeParameterInstantiation(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSTypeParameterInstantiation") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSTypeParameterDeclaration(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSTypeParameterDeclaration") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSTypeParameter(node, opts) {
if (!node) return false;
const nodeType = node.type;
if (nodeType === "TSTypeParameter") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isExpression(node, opts) {
if (!node) return false;
const nodeType = node.type;
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)) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isBinary(node, opts) {
if (!node) return false;
const nodeType = node.type;
if ("BinaryExpression" === nodeType || "LogicalExpression" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isScopable(node, opts) {
if (!node) return false;
const nodeType = node.type;
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) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isBlockParent(node, opts) {
if (!node) return false;
const nodeType = node.type;
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) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isBlock(node, opts) {
if (!node) return false;
const nodeType = node.type;
if ("BlockStatement" === nodeType || "Program" === nodeType || "TSModuleBlock" === nodeType || nodeType === "Placeholder" && "BlockStatement" === node.expectedNode) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isStatement(node, opts) {
if (!node) return false;
const nodeType = node.type;
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)) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTerminatorless(node, opts) {
if (!node) return false;
const nodeType = node.type;
if ("BreakStatement" === nodeType || "ContinueStatement" === nodeType || "ReturnStatement" === nodeType || "ThrowStatement" === nodeType || "YieldExpression" === nodeType || "AwaitExpression" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isCompletionStatement(node, opts) {
if (!node) return false;
const nodeType = node.type;
if ("BreakStatement" === nodeType || "ContinueStatement" === nodeType || "ReturnStatement" === nodeType || "ThrowStatement" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isConditional(node, opts) {
if (!node) return false;
const nodeType = node.type;
if ("ConditionalExpression" === nodeType || "IfStatement" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isLoop(node, opts) {
if (!node) return false;
const nodeType = node.type;
if ("DoWhileStatement" === nodeType || "ForInStatement" === nodeType || "ForStatement" === nodeType || "WhileStatement" === nodeType || "ForOfStatement" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isWhile(node, opts) {
if (!node) return false;
const nodeType = node.type;
if ("DoWhileStatement" === nodeType || "WhileStatement" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isExpressionWrapper(node, opts) {
if (!node) return false;
const nodeType = node.type;
if ("ExpressionStatement" === nodeType || "ParenthesizedExpression" === nodeType || "TypeCastExpression" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isFor(node, opts) {
if (!node) return false;
const nodeType = node.type;
if ("ForInStatement" === nodeType || "ForStatement" === nodeType || "ForOfStatement" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isForXStatement(node, opts) {
if (!node) return false;
const nodeType = node.type;
if ("ForInStatement" === nodeType || "ForOfStatement" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isFunction(node, opts) {
if (!node) return false;
const nodeType = node.type;
if ("FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "ObjectMethod" === nodeType || "ArrowFunctionExpression" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isFunctionParent(node, opts) {
if (!node) return false;
const nodeType = node.type;
if ("FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "ObjectMethod" === nodeType || "ArrowFunctionExpression" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isPureish(node, opts) {
if (!node) return false;
const nodeType = node.type;
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) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isDeclaration(node, opts) {
if (!node) return false;
const nodeType = node.type;
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) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isPatternLike(node, opts) {
if (!node) return false;
const nodeType = node.type;
if ("Identifier" === nodeType || "RestElement" === nodeType || "AssignmentPattern" === nodeType || "ArrayPattern" === nodeType || "ObjectPattern" === nodeType || nodeType === "Placeholder" && ("Pattern" === node.expectedNode || "Identifier" === node.expectedNode)) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isLVal(node, opts) {
if (!node) return false;
const nodeType = node.type;
if ("Identifier" === nodeType || "MemberExpression" === nodeType || "RestElement" === nodeType || "AssignmentPattern" === nodeType || "ArrayPattern" === nodeType || "ObjectPattern" === nodeType || "TSParameterProperty" === nodeType || nodeType === "Placeholder" && ("Pattern" === node.expectedNode || "Identifier" === node.expectedNode)) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSEntityName(node, opts) {
if (!node) return false;
const nodeType = node.type;
if ("Identifier" === nodeType || "TSQualifiedName" === nodeType || nodeType === "Placeholder" && "Identifier" === node.expectedNode) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isLiteral(node, opts) {
if (!node) return false;
const nodeType = node.type;
if ("StringLiteral" === nodeType || "NumericLiteral" === nodeType || "NullLiteral" === nodeType || "BooleanLiteral" === nodeType || "RegExpLiteral" === nodeType || "TemplateLiteral" === nodeType || "BigIntLiteral" === nodeType || "DecimalLiteral" === nodeType || nodeType === "Placeholder" && "StringLiteral" === node.expectedNode) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isImmutable$2(node, opts) {
if (!node) return false;
const nodeType = node.type;
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) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isUserWhitespacable(node, opts) {
if (!node) return false;
const nodeType = node.type;
if ("ObjectMethod" === nodeType || "ObjectProperty" === nodeType || "ObjectTypeInternalSlot" === nodeType || "ObjectTypeCallProperty" === nodeType || "ObjectTypeIndexer" === nodeType || "ObjectTypeProperty" === nodeType || "ObjectTypeSpreadProperty" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isMethod(node, opts) {
if (!node) return false;
const nodeType = node.type;
if ("ObjectMethod" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isObjectMember(node, opts) {
if (!node) return false;
const nodeType = node.type;
if ("ObjectMethod" === nodeType || "ObjectProperty" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isProperty(node, opts) {
if (!node) return false;
const nodeType = node.type;
if ("ObjectProperty" === nodeType || "ClassProperty" === nodeType || "ClassPrivateProperty" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isUnaryLike(node, opts) {
if (!node) return false;
const nodeType = node.type;
if ("UnaryExpression" === nodeType || "SpreadElement" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isPattern(node, opts) {
if (!node) return false;
const nodeType = node.type;
if ("AssignmentPattern" === nodeType || "ArrayPattern" === nodeType || "ObjectPattern" === nodeType || nodeType === "Placeholder" && "Pattern" === node.expectedNode) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isClass(node, opts) {
if (!node) return false;
const nodeType = node.type;
if ("ClassExpression" === nodeType || "ClassDeclaration" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isModuleDeclaration(node, opts) {
if (!node) return false;
const nodeType = node.type;
if ("ExportAllDeclaration" === nodeType || "ExportDefaultDeclaration" === nodeType || "ExportNamedDeclaration" === nodeType || "ImportDeclaration" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isExportDeclaration(node, opts) {
if (!node) return false;
const nodeType = node.type;
if ("ExportAllDeclaration" === nodeType || "ExportDefaultDeclaration" === nodeType || "ExportNamedDeclaration" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isModuleSpecifier(node, opts) {
if (!node) return false;
const nodeType = node.type;
if ("ExportSpecifier" === nodeType || "ImportDefaultSpecifier" === nodeType || "ImportNamespaceSpecifier" === nodeType || "ImportSpecifier" === nodeType || "ExportNamespaceSpecifier" === nodeType || "ExportDefaultSpecifier" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isPrivate(node, opts) {
if (!node) return false;
const nodeType = node.type;
if ("ClassPrivateProperty" === nodeType || "ClassPrivateMethod" === nodeType || "PrivateName" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isFlow(node, opts) {
if (!node) return false;
const nodeType = node.type;
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) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isFlowType(node, opts) {
if (!node) return false;
const nodeType = node.type;
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) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isFlowBaseAnnotation(node, opts) {
if (!node) return false;
const nodeType = node.type;
if ("AnyTypeAnnotation" === nodeType || "BooleanTypeAnnotation" === nodeType || "NullLiteralTypeAnnotation" === nodeType || "MixedTypeAnnotation" === nodeType || "EmptyTypeAnnotation" === nodeType || "NumberTypeAnnotation" === nodeType || "StringTypeAnnotation" === nodeType || "SymbolTypeAnnotation" === nodeType || "ThisTypeAnnotation" === nodeType || "VoidTypeAnnotation" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isFlowDeclaration(node, opts) {
if (!node) return false;
const nodeType = node.type;
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) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isFlowPredicate(node, opts) {
if (!node) return false;
const nodeType = node.type;
if ("DeclaredPredicate" === nodeType || "InferredPredicate" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isEnumBody(node, opts) {
if (!node) return false;
const nodeType = node.type;
if ("EnumBooleanBody" === nodeType || "EnumNumberBody" === nodeType || "EnumStringBody" === nodeType || "EnumSymbolBody" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isEnumMember(node, opts) {
if (!node) return false;
const nodeType = node.type;
if ("EnumBooleanMember" === nodeType || "EnumNumberMember" === nodeType || "EnumStringMember" === nodeType || "EnumDefaultedMember" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isJSX(node, opts) {
if (!node) return false;
const nodeType = node.type;
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) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSTypeElement(node, opts) {
if (!node) return false;
const nodeType = node.type;
if ("TSCallSignatureDeclaration" === nodeType || "TSConstructSignatureDeclaration" === nodeType || "TSPropertySignature" === nodeType || "TSMethodSignature" === nodeType || "TSIndexSignature" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSType(node, opts) {
if (!node) return false;
const nodeType = node.type;
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) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isTSBaseType(node, opts) {
if (!node) return false;
const nodeType = node.type;
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) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isNumberLiteral(node, opts) {
console.trace("The node type NumberLiteral has been renamed to NumericLiteral");
if (!node) return false;
const nodeType = node.type;
if (nodeType === "NumberLiteral") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isRegexLiteral(node, opts) {
console.trace("The node type RegexLiteral has been renamed to RegExpLiteral");
if (!node) return false;
const nodeType = node.type;
if (nodeType === "RegexLiteral") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isRestProperty(node, opts) {
console.trace("The node type RestProperty has been renamed to RestElement");
if (!node) return false;
const nodeType = node.type;
if (nodeType === "RestProperty") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
function isSpreadProperty(node, opts) {
console.trace("The node type SpreadProperty has been renamed to SpreadElement");
if (!node) return false;
const nodeType = node.type;
if (nodeType === "SpreadProperty") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual$1.default)(node, opts);
}
}
return false;
}
Object.defineProperty(matchesPattern$1, "__esModule", {
value: true
});
matchesPattern$1.default = matchesPattern;
var _generated$o = generated$4;
function matchesPattern(member, match, allowPartial) {
if (!(0, _generated$o.isMemberExpression)(member)) return false;
const parts = Array.isArray(match) ? match : match.split(".");
const nodes = [];
let node;
for (node = member; (0, _generated$o.isMemberExpression)(node); node = node.object) {
nodes.push(node.property);
}
nodes.push(node);
if (nodes.length < parts.length) return false;
if (!allowPartial && nodes.length > parts.length) return false;
for (let i = 0, j = nodes.length - 1; i < parts.length; i++, j--) {
const node = nodes[j];
let value;
if ((0, _generated$o.isIdentifier)(node)) {
value = node.name;
} else if ((0, _generated$o.isStringLiteral)(node)) {
value = node.value;
} else if ((0, _generated$o.isThisExpression)(node)) {
value = "this";
} else {
return false;
}
if (parts[i] !== value) return false;
}
return true;
}
Object.defineProperty(buildMatchMemberExpression$1, "__esModule", {
value: true
});
buildMatchMemberExpression$1.default = buildMatchMemberExpression;
var _matchesPattern = matchesPattern$1;
function buildMatchMemberExpression(match, allowPartial) {
const parts = match.split(".");
return member => (0, _matchesPattern.default)(member, parts, allowPartial);
}
Object.defineProperty(isReactComponent$1, "__esModule", {
value: true
});
isReactComponent$1.default = void 0;
var _buildMatchMemberExpression = buildMatchMemberExpression$1;
const isReactComponent = (0, _buildMatchMemberExpression.default)("React.Component");
var _default$4 = isReactComponent;
isReactComponent$1.default = _default$4;
var isCompatTag$1 = {};
Object.defineProperty(isCompatTag$1, "__esModule", {
value: true
});
isCompatTag$1.default = isCompatTag;
function isCompatTag(tagName) {
return !!tagName && /^[a-z]/.test(tagName);
}
var buildChildren$1 = {};
var cleanJSXElementLiteralChild$1 = {};
var generated$3 = {};
var builder$1 = {};
var definitions = {};
var core = {};
var is$1 = {};
var isType$1 = {};
Object.defineProperty(isType$1, "__esModule", {
value: true
});
isType$1.default = isType;
var _definitions$a = definitions;
function isType(nodeType, targetType) {
if (nodeType === targetType) return true;
if (_definitions$a.ALIAS_KEYS[targetType]) return false;
const aliases = _definitions$a.FLIPPED_ALIAS_KEYS[targetType];
if (aliases) {
if (aliases[0] === nodeType) return true;
for (const alias of aliases) {
if (nodeType === alias) return true;
}
}
return false;
}
var isPlaceholderType$1 = {};
Object.defineProperty(isPlaceholderType$1, "__esModule", {
value: true
});
isPlaceholderType$1.default = isPlaceholderType;
var _definitions$9 = definitions;
function isPlaceholderType(placeholderType, targetType) {
if (placeholderType === targetType) return true;
const aliases = _definitions$9.PLACEHOLDERS_ALIAS[placeholderType];
if (aliases) {
for (const alias of aliases) {
if (targetType === alias) return true;
}
}
return false;
}
Object.defineProperty(is$1, "__esModule", {
value: true
});
is$1.default = is;
var _shallowEqual = shallowEqual$1;
var _isType$1 = isType$1;
var _isPlaceholderType = isPlaceholderType$1;
var _definitions$8 = definitions;
function is(type, node, opts) {
if (!node) return false;
const matches = (0, _isType$1.default)(node.type, type);
if (!matches) {
if (!opts && node.type === "Placeholder" && type in _definitions$8.FLIPPED_ALIAS_KEYS) {
return (0, _isPlaceholderType.default)(node.expectedNode, type);
}
return false;
}
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
var isValidIdentifier$1 = {};
var lib = {};
var identifier$1 = {};
Object.defineProperty(identifier$1, "__esModule", {
value: true
});
identifier$1.isIdentifierStart = isIdentifierStart;
identifier$1.isIdentifierChar = isIdentifierChar;
identifier$1.isIdentifierName = isIdentifierName;
let nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u08a0-\u08b4\u08b6-\u08c7\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\u9ffc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7bf\ua7c2-\ua7ca\ua7f5-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc";
let nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08d3-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf\u1ac0\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1df9\u1dfb-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f";
const nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
const nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
nonASCIIidentifierStartChars = nonASCIIidentifierChars = null;
const astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 157, 310, 10, 21, 11, 7, 153, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 107, 20, 28, 22, 13, 52, 76, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 85, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 230, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 35, 56, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 190, 0, 80, 921, 103, 110, 18, 195, 2749, 1070, 4050, 582, 8634, 568, 8, 30, 114, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8952, 286, 50, 2, 18, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 2357, 44, 11, 6, 17, 0, 370, 43, 1301, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42717, 35, 4148, 12, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938];
const astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 154, 10, 176, 2, 54, 14, 32, 9, 16, 3, 46, 10, 54, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 161, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 19306, 9, 135, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 5319, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 262, 6, 10, 9, 419, 13, 1495, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];
function isInAstralSet(code, set) {
let pos = 0x10000;
for (let i = 0, length = set.length; i < length; i += 2) {
pos += set[i];
if (pos > code) return false;
pos += set[i + 1];
if (pos >= code) return true;
}
return false;
}
function isIdentifierStart(code) {
if (code < 65) return code === 36;
if (code <= 90) return true;
if (code < 97) return code === 95;
if (code <= 122) return true;
if (code <= 0xffff) {
return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code));
}
return isInAstralSet(code, astralIdentifierStartCodes);
}
function isIdentifierChar(code) {
if (code < 48) return code === 36;
if (code < 58) return true;
if (code < 65) return false;
if (code <= 90) return true;
if (code < 97) return code === 95;
if (code <= 122) return true;
if (code <= 0xffff) {
return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));
}
return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes);
}
function isIdentifierName(name) {
let isFirst = true;
for (let i = 0; i < name.length; i++) {
let cp = name.charCodeAt(i);
if ((cp & 0xfc00) === 0xd800 && i + 1 < name.length) {
const trail = name.charCodeAt(++i);
if ((trail & 0xfc00) === 0xdc00) {
cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff);
}
}
if (isFirst) {
isFirst = false;
if (!isIdentifierStart(cp)) {
return false;
}
} else if (!isIdentifierChar(cp)) {
return false;
}
}
return !isFirst;
}
var keyword = {};
Object.defineProperty(keyword, "__esModule", {
value: true
});
keyword.isReservedWord = isReservedWord;
keyword.isStrictReservedWord = isStrictReservedWord;
keyword.isStrictBindOnlyReservedWord = isStrictBindOnlyReservedWord;
keyword.isStrictBindReservedWord = isStrictBindReservedWord;
keyword.isKeyword = isKeyword;
const reservedWords = {
keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"],
strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"],
strictBind: ["eval", "arguments"]
};
const keywords = new Set(reservedWords.keyword);
const reservedWordsStrictSet = new Set(reservedWords.strict);
const reservedWordsStrictBindSet = new Set(reservedWords.strictBind);
function isReservedWord(word, inModule) {
return inModule && word === "await" || word === "enum";
}
function isStrictReservedWord(word, inModule) {
return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);
}
function isStrictBindOnlyReservedWord(word) {
return reservedWordsStrictBindSet.has(word);
}
function isStrictBindReservedWord(word, inModule) {
return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word);
}
function isKeyword(word) {
return keywords.has(word);
}
(function (exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "isIdentifierName", {
enumerable: true,
get: function () {
return _identifier.isIdentifierName;
}
});
Object.defineProperty(exports, "isIdentifierChar", {
enumerable: true,
get: function () {
return _identifier.isIdentifierChar;
}
});
Object.defineProperty(exports, "isIdentifierStart", {
enumerable: true,
get: function () {
return _identifier.isIdentifierStart;
}
});
Object.defineProperty(exports, "isReservedWord", {
enumerable: true,
get: function () {
return _keyword.isReservedWord;
}
});
Object.defineProperty(exports, "isStrictBindOnlyReservedWord", {
enumerable: true,
get: function () {
return _keyword.isStrictBindOnlyReservedWord;
}
});
Object.defineProperty(exports, "isStrictBindReservedWord", {
enumerable: true,
get: function () {
return _keyword.isStrictBindReservedWord;
}
});
Object.defineProperty(exports, "isStrictReservedWord", {
enumerable: true,
get: function () {
return _keyword.isStrictReservedWord;
}
});
Object.defineProperty(exports, "isKeyword", {
enumerable: true,
get: function () {
return _keyword.isKeyword;
}
});
var _identifier = identifier$1;
var _keyword = keyword;
}(lib));
Object.defineProperty(isValidIdentifier$1, "__esModule", {
value: true
});
isValidIdentifier$1.default = isValidIdentifier;
var _helperValidatorIdentifier$2 = lib;
function isValidIdentifier(name, reserved = true) {
if (typeof name !== "string") return false;
if (reserved) {
if ((0, _helperValidatorIdentifier$2.isKeyword)(name) || (0, _helperValidatorIdentifier$2.isStrictReservedWord)(name, true)) {
return false;
}
}
return (0, _helperValidatorIdentifier$2.isIdentifierName)(name);
}
var constants = {};
Object.defineProperty(constants, "__esModule", {
value: true
});
constants.NOT_LOCAL_BINDING = constants.BLOCK_SCOPED_SYMBOL = constants.INHERIT_KEYS = constants.UNARY_OPERATORS = constants.STRING_UNARY_OPERATORS = constants.NUMBER_UNARY_OPERATORS = constants.BOOLEAN_UNARY_OPERATORS = constants.ASSIGNMENT_OPERATORS = constants.BINARY_OPERATORS = constants.NUMBER_BINARY_OPERATORS = constants.BOOLEAN_BINARY_OPERATORS = constants.COMPARISON_BINARY_OPERATORS = constants.EQUALITY_BINARY_OPERATORS = constants.BOOLEAN_NUMBER_BINARY_OPERATORS = constants.UPDATE_OPERATORS = constants.LOGICAL_OPERATORS = constants.COMMENT_KEYS = constants.FOR_INIT_KEYS = constants.FLATTENABLE_KEYS = constants.STATEMENT_OR_BLOCK_KEYS = void 0;
const STATEMENT_OR_BLOCK_KEYS = ["consequent", "body", "alternate"];
constants.STATEMENT_OR_BLOCK_KEYS = STATEMENT_OR_BLOCK_KEYS;
const FLATTENABLE_KEYS = ["body", "expressions"];
constants.FLATTENABLE_KEYS = FLATTENABLE_KEYS;
const FOR_INIT_KEYS = ["left", "init"];
constants.FOR_INIT_KEYS = FOR_INIT_KEYS;
const COMMENT_KEYS = ["leadingComments", "trailingComments", "innerComments"];
constants.COMMENT_KEYS = COMMENT_KEYS;
const LOGICAL_OPERATORS = ["||", "&&", "??"];
constants.LOGICAL_OPERATORS = LOGICAL_OPERATORS;
const UPDATE_OPERATORS = ["++", "--"];
constants.UPDATE_OPERATORS = UPDATE_OPERATORS;
const BOOLEAN_NUMBER_BINARY_OPERATORS = [">", "<", ">=", "<="];
constants.BOOLEAN_NUMBER_BINARY_OPERATORS = BOOLEAN_NUMBER_BINARY_OPERATORS;
const EQUALITY_BINARY_OPERATORS = ["==", "===", "!=", "!=="];
constants.EQUALITY_BINARY_OPERATORS = EQUALITY_BINARY_OPERATORS;
const COMPARISON_BINARY_OPERATORS = [...EQUALITY_BINARY_OPERATORS, "in", "instanceof"];
constants.COMPARISON_BINARY_OPERATORS = COMPARISON_BINARY_OPERATORS;
const BOOLEAN_BINARY_OPERATORS = [...COMPARISON_BINARY_OPERATORS, ...BOOLEAN_NUMBER_BINARY_OPERATORS];
constants.BOOLEAN_BINARY_OPERATORS = BOOLEAN_BINARY_OPERATORS;
const NUMBER_BINARY_OPERATORS = ["-", "/", "%", "*", "**", "&", "|", ">>", ">>>", "<<", "^"];
constants.NUMBER_BINARY_OPERATORS = NUMBER_BINARY_OPERATORS;
const BINARY_OPERATORS = ["+", ...NUMBER_BINARY_OPERATORS, ...BOOLEAN_BINARY_OPERATORS];
constants.BINARY_OPERATORS = BINARY_OPERATORS;
const ASSIGNMENT_OPERATORS = ["=", "+=", ...NUMBER_BINARY_OPERATORS.map(op => op + "="), ...LOGICAL_OPERATORS.map(op => op + "=")];
constants.ASSIGNMENT_OPERATORS = ASSIGNMENT_OPERATORS;
const BOOLEAN_UNARY_OPERATORS = ["delete", "!"];
constants.BOOLEAN_UNARY_OPERATORS = BOOLEAN_UNARY_OPERATORS;
const NUMBER_UNARY_OPERATORS = ["+", "-", "~"];
constants.NUMBER_UNARY_OPERATORS = NUMBER_UNARY_OPERATORS;
const STRING_UNARY_OPERATORS = ["typeof"];
constants.STRING_UNARY_OPERATORS = STRING_UNARY_OPERATORS;
const UNARY_OPERATORS = ["void", "throw", ...BOOLEAN_UNARY_OPERATORS, ...NUMBER_UNARY_OPERATORS, ...STRING_UNARY_OPERATORS];
constants.UNARY_OPERATORS = UNARY_OPERATORS;
const INHERIT_KEYS = {
optional: ["typeAnnotation", "typeParameters", "returnType"],
force: ["start", "loc", "end"]
};
constants.INHERIT_KEYS = INHERIT_KEYS;
const BLOCK_SCOPED_SYMBOL = Symbol.for("var used to be block scoped");
constants.BLOCK_SCOPED_SYMBOL = BLOCK_SCOPED_SYMBOL;
const NOT_LOCAL_BINDING = Symbol.for("should not be considered a local binding");
constants.NOT_LOCAL_BINDING = NOT_LOCAL_BINDING;
var utils = {};
var validate$2 = {};
Object.defineProperty(validate$2, "__esModule", {
value: true
});
validate$2.default = validate$1;
validate$2.validateField = validateField;
validate$2.validateChild = validateChild;
var _definitions$7 = definitions;
function validate$1(node, key, val) {
if (!node) return;
const fields = _definitions$7.NODE_FIELDS[node.type];
if (!fields) return;
const field = fields[key];
validateField(node, key, val, field);
validateChild(node, key, val);
}
function validateField(node, key, val, field) {
if (!(field != null && field.validate)) return;
if (field.optional && val == null) return;
field.validate(node, key, val);
}
function validateChild(node, key, val) {
if (val == null) return;
const validate = _definitions$7.NODE_PARENT_VALIDATIONS[val.type];
if (!validate) return;
validate(node, key, val);
}
Object.defineProperty(utils, "__esModule", {
value: true
});
utils.validate = validate;
utils.typeIs = typeIs;
utils.validateType = validateType;
utils.validateOptional = validateOptional;
utils.validateOptionalType = validateOptionalType;
utils.arrayOf = arrayOf;
utils.arrayOfType = arrayOfType;
utils.validateArrayOfType = validateArrayOfType;
utils.assertEach = assertEach;
utils.assertOneOf = assertOneOf;
utils.assertNodeType = assertNodeType;
utils.assertNodeOrValueType = assertNodeOrValueType;
utils.assertValueType = assertValueType;
utils.assertShape = assertShape;
utils.assertOptionalChainStart = assertOptionalChainStart;
utils.chain = chain;
utils.default = defineType;
utils.NODE_PARENT_VALIDATIONS = utils.DEPRECATED_KEYS = utils.BUILDER_KEYS = utils.NODE_FIELDS = utils.FLIPPED_ALIAS_KEYS = utils.ALIAS_KEYS = utils.VISITOR_KEYS = void 0;
var _is$3 = is$1;
var _validate$1 = validate$2;
const VISITOR_KEYS = {};
utils.VISITOR_KEYS = VISITOR_KEYS;
const ALIAS_KEYS = {};
utils.ALIAS_KEYS = ALIAS_KEYS;
const FLIPPED_ALIAS_KEYS = {};
utils.FLIPPED_ALIAS_KEYS = FLIPPED_ALIAS_KEYS;
const NODE_FIELDS = {};
utils.NODE_FIELDS = NODE_FIELDS;
const BUILDER_KEYS = {};
utils.BUILDER_KEYS = BUILDER_KEYS;
const DEPRECATED_KEYS = {};
utils.DEPRECATED_KEYS = DEPRECATED_KEYS;
const NODE_PARENT_VALIDATIONS = {};
utils.NODE_PARENT_VALIDATIONS = NODE_PARENT_VALIDATIONS;
function getType(val) {
if (Array.isArray(val)) {
return "array";
} else if (val === null) {
return "null";
} else {
return typeof val;
}
}
function validate(validate) {
return {
validate
};
}
function typeIs(typeName) {
return typeof typeName === "string" ? assertNodeType(typeName) : assertNodeType(...typeName);
}
function validateType(typeName) {
return validate(typeIs(typeName));
}
function validateOptional(validate) {
return {
validate,
optional: true
};
}
function validateOptionalType(typeName) {
return {
validate: typeIs(typeName),
optional: true
};
}
function arrayOf(elementType) {
return chain(assertValueType("array"), assertEach(elementType));
}
function arrayOfType(typeName) {
return arrayOf(typeIs(typeName));
}
function validateArrayOfType(typeName) {
return validate(arrayOfType(typeName));
}
function assertEach(callback) {
function validator(node, key, val) {
if (!Array.isArray(val)) return;
for (let i = 0; i < val.length; i++) {
const subkey = `${key}[${i}]`;
const v = val[i];
callback(node, subkey, v);
if (process.env.BABEL_TYPES_8_BREAKING) (0, _validate$1.validateChild)(node, subkey, v);
}
}
validator.each = callback;
return validator;
}
function assertOneOf(...values) {
function validate(node, key, val) {
if (values.indexOf(val) < 0) {
throw new TypeError(`Property ${key} expected value to be one of ${JSON.stringify(values)} but got ${JSON.stringify(val)}`);
}
}
validate.oneOf = values;
return validate;
}
function assertNodeType(...types) {
function validate(node, key, val) {
for (const type of types) {
if ((0, _is$3.default)(type, val)) {
(0, _validate$1.validateChild)(node, key, val);
return;
}
}
throw new TypeError(`Property ${key} of ${node.type} expected node to be of a type ${JSON.stringify(types)} but instead got ${JSON.stringify(val == null ? void 0 : val.type)}`);
}
validate.oneOfNodeTypes = types;
return validate;
}
function assertNodeOrValueType(...types) {
function validate(node, key, val) {
for (const type of types) {
if (getType(val) === type || (0, _is$3.default)(type, val)) {
(0, _validate$1.validateChild)(node, key, val);
return;
}
}
throw new TypeError(`Property ${key} of ${node.type} expected node to be of a type ${JSON.stringify(types)} but instead got ${JSON.stringify(val == null ? void 0 : val.type)}`);
}
validate.oneOfNodeOrValueTypes = types;
return validate;
}
function assertValueType(type) {
function validate(node, key, val) {
const valid = getType(val) === type;
if (!valid) {
throw new TypeError(`Property ${key} expected type of ${type} but got ${getType(val)}`);
}
}
validate.type = type;
return validate;
}
function assertShape(shape) {
function validate(node, key, val) {
const errors = [];
for (const property of Object.keys(shape)) {
try {
(0, _validate$1.validateField)(node, property, val[property], shape[property]);
} catch (error) {
if (error instanceof TypeError) {
errors.push(error.message);
continue;
}
throw error;
}
}
if (errors.length) {
throw new TypeError(`Property ${key} of ${node.type} expected to have the following:\n${errors.join("\n")}`);
}
}
validate.shapeOf = shape;
return validate;
}
function assertOptionalChainStart() {
function validate(node) {
var _current;
let current = node;
while (node) {
const {
type
} = current;
if (type === "OptionalCallExpression") {
if (current.optional) return;
current = current.callee;
continue;
}
if (type === "OptionalMemberExpression") {
if (current.optional) return;
current = current.object;
continue;
}
break;
}
throw new TypeError(`Non-optional ${node.type} must chain from an optional OptionalMemberExpression or OptionalCallExpression. Found chain from ${(_current = current) == null ? void 0 : _current.type}`);
}
return validate;
}
function chain(...fns) {
function validate(...args) {
for (const fn of fns) {
fn(...args);
}
}
validate.chainOf = fns;
if (fns.length >= 2 && "type" in fns[0] && fns[0].type === "array" && !("each" in fns[1])) {
throw new Error(`An assertValueType("array") validator can only be followed by an assertEach(...) validator.`);
}
return validate;
}
const validTypeOpts = ["aliases", "builder", "deprecatedAlias", "fields", "inherits", "visitor", "validate"];
const validFieldKeys = ["default", "optional", "validate"];
function defineType(type, opts = {}) {
const inherits = opts.inherits && store[opts.inherits] || {};
let fields = opts.fields;
if (!fields) {
fields = {};
if (inherits.fields) {
const keys = Object.getOwnPropertyNames(inherits.fields);
for (const key of keys) {
const field = inherits.fields[key];
const def = field.default;
if (Array.isArray(def) ? def.length > 0 : def && typeof def === "object") {
throw new Error("field defaults can only be primitives or empty arrays currently");
}
fields[key] = {
default: Array.isArray(def) ? [] : def,
optional: field.optional,
validate: field.validate
};
}
}
}
const visitor = opts.visitor || inherits.visitor || [];
const aliases = opts.aliases || inherits.aliases || [];
const builder = opts.builder || inherits.builder || opts.visitor || [];
for (const k of Object.keys(opts)) {
if (validTypeOpts.indexOf(k) === -1) {
throw new Error(`Unknown type option "${k}" on ${type}`);
}
}
if (opts.deprecatedAlias) {
DEPRECATED_KEYS[opts.deprecatedAlias] = type;
}
for (const key of visitor.concat(builder)) {
fields[key] = fields[key] || {};
}
for (const key of Object.keys(fields)) {
const field = fields[key];
if (field.default !== undefined && builder.indexOf(key) === -1) {
field.optional = true;
}
if (field.default === undefined) {
field.default = null;
} else if (!field.validate && field.default != null) {
field.validate = assertValueType(getType(field.default));
}
for (const k of Object.keys(field)) {
if (validFieldKeys.indexOf(k) === -1) {
throw new Error(`Unknown field key "${k}" on ${type}.${key}`);
}
}
}
VISITOR_KEYS[type] = opts.visitor = visitor;
BUILDER_KEYS[type] = opts.builder = builder;
NODE_FIELDS[type] = opts.fields = fields;
ALIAS_KEYS[type] = opts.aliases = aliases;
aliases.forEach(alias => {
FLIPPED_ALIAS_KEYS[alias] = FLIPPED_ALIAS_KEYS[alias] || [];
FLIPPED_ALIAS_KEYS[alias].push(type);
});
if (opts.validate) {
NODE_PARENT_VALIDATIONS[type] = opts.validate;
}
store[type] = opts;
}
const store = {};
Object.defineProperty(core, "__esModule", {
value: true
});
core.classMethodOrDeclareMethodCommon = core.classMethodOrPropertyCommon = core.patternLikeCommon = core.functionDeclarationCommon = core.functionTypeAnnotationCommon = core.functionCommon = void 0;
var _is$2 = is$1;
var _isValidIdentifier$3 = isValidIdentifier$1;
var _helperValidatorIdentifier$1 = lib;
var _constants$5 = constants;
var _utils$6 = utils;
(0, _utils$6.default)("ArrayExpression", {
fields: {
elements: {
validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeOrValueType)("null", "Expression", "SpreadElement"))),
default: !process.env.BABEL_TYPES_8_BREAKING ? [] : undefined
}
},
visitor: ["elements"],
aliases: ["Expression"]
});
(0, _utils$6.default)("AssignmentExpression", {
fields: {
operator: {
validate: function () {
if (!process.env.BABEL_TYPES_8_BREAKING) {
return (0, _utils$6.assertValueType)("string");
}
const identifier = (0, _utils$6.assertOneOf)(..._constants$5.ASSIGNMENT_OPERATORS);
const pattern = (0, _utils$6.assertOneOf)("=");
return function (node, key, val) {
const validator = (0, _is$2.default)("Pattern", node.left) ? pattern : identifier;
validator(node, key, val);
};
}()
},
left: {
validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils$6.assertNodeType)("LVal") : (0, _utils$6.assertNodeType)("Identifier", "MemberExpression", "ArrayPattern", "ObjectPattern")
},
right: {
validate: (0, _utils$6.assertNodeType)("Expression")
}
},
builder: ["operator", "left", "right"],
visitor: ["left", "right"],
aliases: ["Expression"]
});
(0, _utils$6.default)("BinaryExpression", {
builder: ["operator", "left", "right"],
fields: {
operator: {
validate: (0, _utils$6.assertOneOf)(..._constants$5.BINARY_OPERATORS)
},
left: {
validate: function () {
const expression = (0, _utils$6.assertNodeType)("Expression");
const inOp = (0, _utils$6.assertNodeType)("Expression", "PrivateName");
const validator = function (node, key, val) {
const validator = node.operator === "in" ? inOp : expression;
validator(node, key, val);
};
validator.oneOfNodeTypes = ["Expression", "PrivateName"];
return validator;
}()
},
right: {
validate: (0, _utils$6.assertNodeType)("Expression")
}
},
visitor: ["left", "right"],
aliases: ["Binary", "Expression"]
});
(0, _utils$6.default)("InterpreterDirective", {
builder: ["value"],
fields: {
value: {
validate: (0, _utils$6.assertValueType)("string")
}
}
});
(0, _utils$6.default)("Directive", {
visitor: ["value"],
fields: {
value: {
validate: (0, _utils$6.assertNodeType)("DirectiveLiteral")
}
}
});
(0, _utils$6.default)("DirectiveLiteral", {
builder: ["value"],
fields: {
value: {
validate: (0, _utils$6.assertValueType)("string")
}
}
});
(0, _utils$6.default)("BlockStatement", {
builder: ["body", "directives"],
visitor: ["directives", "body"],
fields: {
directives: {
validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Directive"))),
default: []
},
body: {
validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Statement")))
}
},
aliases: ["Scopable", "BlockParent", "Block", "Statement"]
});
(0, _utils$6.default)("BreakStatement", {
visitor: ["label"],
fields: {
label: {
validate: (0, _utils$6.assertNodeType)("Identifier"),
optional: true
}
},
aliases: ["Statement", "Terminatorless", "CompletionStatement"]
});
(0, _utils$6.default)("CallExpression", {
visitor: ["callee", "arguments", "typeParameters", "typeArguments"],
builder: ["callee", "arguments"],
aliases: ["Expression"],
fields: Object.assign({
callee: {
validate: (0, _utils$6.assertNodeType)("Expression", "V8IntrinsicIdentifier")
},
arguments: {
validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Expression", "SpreadElement", "JSXNamespacedName", "ArgumentPlaceholder")))
}
}, !process.env.BABEL_TYPES_8_BREAKING ? {
optional: {
validate: (0, _utils$6.assertOneOf)(true, false),
optional: true
}
} : {}, {
typeArguments: {
validate: (0, _utils$6.assertNodeType)("TypeParameterInstantiation"),
optional: true
},
typeParameters: {
validate: (0, _utils$6.assertNodeType)("TSTypeParameterInstantiation"),
optional: true
}
})
});
(0, _utils$6.default)("CatchClause", {
visitor: ["param", "body"],
fields: {
param: {
validate: (0, _utils$6.assertNodeType)("Identifier", "ArrayPattern", "ObjectPattern"),
optional: true
},
body: {
validate: (0, _utils$6.assertNodeType)("BlockStatement")
}
},
aliases: ["Scopable", "BlockParent"]
});
(0, _utils$6.default)("ConditionalExpression", {
visitor: ["test", "consequent", "alternate"],
fields: {
test: {
validate: (0, _utils$6.assertNodeType)("Expression")
},
consequent: {
validate: (0, _utils$6.assertNodeType)("Expression")
},
alternate: {
validate: (0, _utils$6.assertNodeType)("Expression")
}
},
aliases: ["Expression", "Conditional"]
});
(0, _utils$6.default)("ContinueStatement", {
visitor: ["label"],
fields: {
label: {
validate: (0, _utils$6.assertNodeType)("Identifier"),
optional: true
}
},
aliases: ["Statement", "Terminatorless", "CompletionStatement"]
});
(0, _utils$6.default)("DebuggerStatement", {
aliases: ["Statement"]
});
(0, _utils$6.default)("DoWhileStatement", {
visitor: ["test", "body"],
fields: {
test: {
validate: (0, _utils$6.assertNodeType)("Expression")
},
body: {
validate: (0, _utils$6.assertNodeType)("Statement")
}
},
aliases: ["Statement", "BlockParent", "Loop", "While", "Scopable"]
});
(0, _utils$6.default)("EmptyStatement", {
aliases: ["Statement"]
});
(0, _utils$6.default)("ExpressionStatement", {
visitor: ["expression"],
fields: {
expression: {
validate: (0, _utils$6.assertNodeType)("Expression")
}
},
aliases: ["Statement", "ExpressionWrapper"]
});
(0, _utils$6.default)("File", {
builder: ["program", "comments", "tokens"],
visitor: ["program"],
fields: {
program: {
validate: (0, _utils$6.assertNodeType)("Program")
},
comments: {
validate: !process.env.BABEL_TYPES_8_BREAKING ? Object.assign(() => {}, {
each: {
oneOfNodeTypes: ["CommentBlock", "CommentLine"]
}
}) : (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("CommentBlock", "CommentLine")),
optional: true
},
tokens: {
validate: (0, _utils$6.assertEach)(Object.assign(() => {}, {
type: "any"
})),
optional: true
}
}
});
(0, _utils$6.default)("ForInStatement", {
visitor: ["left", "right", "body"],
aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop", "ForXStatement"],
fields: {
left: {
validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils$6.assertNodeType)("VariableDeclaration", "LVal") : (0, _utils$6.assertNodeType)("VariableDeclaration", "Identifier", "MemberExpression", "ArrayPattern", "ObjectPattern")
},
right: {
validate: (0, _utils$6.assertNodeType)("Expression")
},
body: {
validate: (0, _utils$6.assertNodeType)("Statement")
}
}
});
(0, _utils$6.default)("ForStatement", {
visitor: ["init", "test", "update", "body"],
aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop"],
fields: {
init: {
validate: (0, _utils$6.assertNodeType)("VariableDeclaration", "Expression"),
optional: true
},
test: {
validate: (0, _utils$6.assertNodeType)("Expression"),
optional: true
},
update: {
validate: (0, _utils$6.assertNodeType)("Expression"),
optional: true
},
body: {
validate: (0, _utils$6.assertNodeType)("Statement")
}
}
});
const functionCommon = {
params: {
validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Identifier", "Pattern", "RestElement")))
},
generator: {
default: false
},
async: {
default: false
}
};
core.functionCommon = functionCommon;
const functionTypeAnnotationCommon = {
returnType: {
validate: (0, _utils$6.assertNodeType)("TypeAnnotation", "TSTypeAnnotation", "Noop"),
optional: true
},
typeParameters: {
validate: (0, _utils$6.assertNodeType)("TypeParameterDeclaration", "TSTypeParameterDeclaration", "Noop"),
optional: true
}
};
core.functionTypeAnnotationCommon = functionTypeAnnotationCommon;
const functionDeclarationCommon = Object.assign({}, functionCommon, {
declare: {
validate: (0, _utils$6.assertValueType)("boolean"),
optional: true
},
id: {
validate: (0, _utils$6.assertNodeType)("Identifier"),
optional: true
}
});
core.functionDeclarationCommon = functionDeclarationCommon;
(0, _utils$6.default)("FunctionDeclaration", {
builder: ["id", "params", "body", "generator", "async"],
visitor: ["id", "params", "body", "returnType", "typeParameters"],
fields: Object.assign({}, functionDeclarationCommon, functionTypeAnnotationCommon, {
body: {
validate: (0, _utils$6.assertNodeType)("BlockStatement")
}
}),
aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Statement", "Pureish", "Declaration"],
validate: function () {
if (!process.env.BABEL_TYPES_8_BREAKING) return () => {};
const identifier = (0, _utils$6.assertNodeType)("Identifier");
return function (parent, key, node) {
if (!(0, _is$2.default)("ExportDefaultDeclaration", parent)) {
identifier(node, "id", node.id);
}
};
}()
});
(0, _utils$6.default)("FunctionExpression", {
inherits: "FunctionDeclaration",
aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Expression", "Pureish"],
fields: Object.assign({}, functionCommon, functionTypeAnnotationCommon, {
id: {
validate: (0, _utils$6.assertNodeType)("Identifier"),
optional: true
},
body: {
validate: (0, _utils$6.assertNodeType)("BlockStatement")
}
})
});
const patternLikeCommon = {
typeAnnotation: {
validate: (0, _utils$6.assertNodeType)("TypeAnnotation", "TSTypeAnnotation", "Noop"),
optional: true
},
decorators: {
validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Decorator")))
}
};
core.patternLikeCommon = patternLikeCommon;
(0, _utils$6.default)("Identifier", {
builder: ["name"],
visitor: ["typeAnnotation", "decorators"],
aliases: ["Expression", "PatternLike", "LVal", "TSEntityName"],
fields: Object.assign({}, patternLikeCommon, {
name: {
validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("string"), Object.assign(function (node, key, val) {
if (!process.env.BABEL_TYPES_8_BREAKING) return;
if (!(0, _isValidIdentifier$3.default)(val, false)) {
throw new TypeError(`"${val}" is not a valid identifier name`);
}
}, {
type: "string"
}))
},
optional: {
validate: (0, _utils$6.assertValueType)("boolean"),
optional: true
}
}),
validate(parent, key, node) {
if (!process.env.BABEL_TYPES_8_BREAKING) return;
const match = /\.(\w+)$/.exec(key);
if (!match) return;
const [, parentKey] = match;
const nonComp = {
computed: false
};
if (parentKey === "property") {
if ((0, _is$2.default)("MemberExpression", parent, nonComp)) return;
if ((0, _is$2.default)("OptionalMemberExpression", parent, nonComp)) return;
} else if (parentKey === "key") {
if ((0, _is$2.default)("Property", parent, nonComp)) return;
if ((0, _is$2.default)("Method", parent, nonComp)) return;
} else if (parentKey === "exported") {
if ((0, _is$2.default)("ExportSpecifier", parent)) return;
} else if (parentKey === "imported") {
if ((0, _is$2.default)("ImportSpecifier", parent, {
imported: node
})) return;
} else if (parentKey === "meta") {
if ((0, _is$2.default)("MetaProperty", parent, {
meta: node
})) return;
}
if (((0, _helperValidatorIdentifier$1.isKeyword)(node.name) || (0, _helperValidatorIdentifier$1.isReservedWord)(node.name, false)) && node.name !== "this") {
throw new TypeError(`"${node.name}" is not a valid identifier`);
}
}
});
(0, _utils$6.default)("IfStatement", {
visitor: ["test", "consequent", "alternate"],
aliases: ["Statement", "Conditional"],
fields: {
test: {
validate: (0, _utils$6.assertNodeType)("Expression")
},
consequent: {
validate: (0, _utils$6.assertNodeType)("Statement")
},
alternate: {
optional: true,
validate: (0, _utils$6.assertNodeType)("Statement")
}
}
});
(0, _utils$6.default)("LabeledStatement", {
visitor: ["label", "body"],
aliases: ["Statement"],
fields: {
label: {
validate: (0, _utils$6.assertNodeType)("Identifier")
},
body: {
validate: (0, _utils$6.assertNodeType)("Statement")
}
}
});
(0, _utils$6.default)("StringLiteral", {
builder: ["value"],
fields: {
value: {
validate: (0, _utils$6.assertValueType)("string")
}
},
aliases: ["Expression", "Pureish", "Literal", "Immutable"]
});
(0, _utils$6.default)("NumericLiteral", {
builder: ["value"],
deprecatedAlias: "NumberLiteral",
fields: {
value: {
validate: (0, _utils$6.assertValueType)("number")
}
},
aliases: ["Expression", "Pureish", "Literal", "Immutable"]
});
(0, _utils$6.default)("NullLiteral", {
aliases: ["Expression", "Pureish", "Literal", "Immutable"]
});
(0, _utils$6.default)("BooleanLiteral", {
builder: ["value"],
fields: {
value: {
validate: (0, _utils$6.assertValueType)("boolean")
}
},
aliases: ["Expression", "Pureish", "Literal", "Immutable"]
});
(0, _utils$6.default)("RegExpLiteral", {
builder: ["pattern", "flags"],
deprecatedAlias: "RegexLiteral",
aliases: ["Expression", "Pureish", "Literal"],
fields: {
pattern: {
validate: (0, _utils$6.assertValueType)("string")
},
flags: {
validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("string"), Object.assign(function (node, key, val) {
if (!process.env.BABEL_TYPES_8_BREAKING) return;
const invalid = /[^gimsuy]/.exec(val);
if (invalid) {
throw new TypeError(`"${invalid[0]}" is not a valid RegExp flag`);
}
}, {
type: "string"
})),
default: ""
}
}
});
(0, _utils$6.default)("LogicalExpression", {
builder: ["operator", "left", "right"],
visitor: ["left", "right"],
aliases: ["Binary", "Expression"],
fields: {
operator: {
validate: (0, _utils$6.assertOneOf)(..._constants$5.LOGICAL_OPERATORS)
},
left: {
validate: (0, _utils$6.assertNodeType)("Expression")
},
right: {
validate: (0, _utils$6.assertNodeType)("Expression")
}
}
});
(0, _utils$6.default)("MemberExpression", {
builder: ["object", "property", "computed", ...(!process.env.BABEL_TYPES_8_BREAKING ? ["optional"] : [])],
visitor: ["object", "property"],
aliases: ["Expression", "LVal"],
fields: Object.assign({
object: {
validate: (0, _utils$6.assertNodeType)("Expression")
},
property: {
validate: function () {
const normal = (0, _utils$6.assertNodeType)("Identifier", "PrivateName");
const computed = (0, _utils$6.assertNodeType)("Expression");
const validator = function (node, key, val) {
const validator = node.computed ? computed : normal;
validator(node, key, val);
};
validator.oneOfNodeTypes = ["Expression", "Identifier", "PrivateName"];
return validator;
}()
},
computed: {
default: false
}
}, !process.env.BABEL_TYPES_8_BREAKING ? {
optional: {
validate: (0, _utils$6.assertOneOf)(true, false),
optional: true
}
} : {})
});
(0, _utils$6.default)("NewExpression", {
inherits: "CallExpression"
});
(0, _utils$6.default)("Program", {
visitor: ["directives", "body"],
builder: ["body", "directives", "sourceType", "interpreter"],
fields: {
sourceFile: {
validate: (0, _utils$6.assertValueType)("string")
},
sourceType: {
validate: (0, _utils$6.assertOneOf)("script", "module"),
default: "script"
},
interpreter: {
validate: (0, _utils$6.assertNodeType)("InterpreterDirective"),
default: null,
optional: true
},
directives: {
validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Directive"))),
default: []
},
body: {
validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Statement")))
}
},
aliases: ["Scopable", "BlockParent", "Block"]
});
(0, _utils$6.default)("ObjectExpression", {
visitor: ["properties"],
aliases: ["Expression"],
fields: {
properties: {
validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("ObjectMethod", "ObjectProperty", "SpreadElement")))
}
}
});
(0, _utils$6.default)("ObjectMethod", {
builder: ["kind", "key", "params", "body", "computed", "generator", "async"],
fields: Object.assign({}, functionCommon, functionTypeAnnotationCommon, {
kind: Object.assign({
validate: (0, _utils$6.assertOneOf)("method", "get", "set")
}, !process.env.BABEL_TYPES_8_BREAKING ? {
default: "method"
} : {}),
computed: {
default: false
},
key: {
validate: function () {
const normal = (0, _utils$6.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral");
const computed = (0, _utils$6.assertNodeType)("Expression");
const validator = function (node, key, val) {
const validator = node.computed ? computed : normal;
validator(node, key, val);
};
validator.oneOfNodeTypes = ["Expression", "Identifier", "StringLiteral", "NumericLiteral"];
return validator;
}()
},
decorators: {
validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Decorator"))),
optional: true
},
body: {
validate: (0, _utils$6.assertNodeType)("BlockStatement")
}
}),
visitor: ["key", "params", "body", "decorators", "returnType", "typeParameters"],
aliases: ["UserWhitespacable", "Function", "Scopable", "BlockParent", "FunctionParent", "Method", "ObjectMember"]
});
(0, _utils$6.default)("ObjectProperty", {
builder: ["key", "value", "computed", "shorthand", ...(!process.env.BABEL_TYPES_8_BREAKING ? ["decorators"] : [])],
fields: {
computed: {
default: false
},
key: {
validate: function () {
const normal = (0, _utils$6.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral");
const computed = (0, _utils$6.assertNodeType)("Expression");
const validator = function (node, key, val) {
const validator = node.computed ? computed : normal;
validator(node, key, val);
};
validator.oneOfNodeTypes = ["Expression", "Identifier", "StringLiteral", "NumericLiteral"];
return validator;
}()
},
value: {
validate: (0, _utils$6.assertNodeType)("Expression", "PatternLike")
},
shorthand: {
validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("boolean"), Object.assign(function (node, key, val) {
if (!process.env.BABEL_TYPES_8_BREAKING) return;
if (val && node.computed) {
throw new TypeError("Property shorthand of ObjectProperty cannot be true if computed is true");
}
}, {
type: "boolean"
}), function (node, key, val) {
if (!process.env.BABEL_TYPES_8_BREAKING) return;
if (val && !(0, _is$2.default)("Identifier", node.key)) {
throw new TypeError("Property shorthand of ObjectProperty cannot be true if key is not an Identifier");
}
}),
default: false
},
decorators: {
validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Decorator"))),
optional: true
}
},
visitor: ["key", "value", "decorators"],
aliases: ["UserWhitespacable", "Property", "ObjectMember"],
validate: function () {
const pattern = (0, _utils$6.assertNodeType)("Identifier", "Pattern");
const expression = (0, _utils$6.assertNodeType)("Expression");
return function (parent, key, node) {
if (!process.env.BABEL_TYPES_8_BREAKING) return;
const validator = (0, _is$2.default)("ObjectPattern", parent) ? pattern : expression;
validator(node, "value", node.value);
};
}()
});
(0, _utils$6.default)("RestElement", {
visitor: ["argument", "typeAnnotation"],
builder: ["argument"],
aliases: ["LVal", "PatternLike"],
deprecatedAlias: "RestProperty",
fields: Object.assign({}, patternLikeCommon, {
argument: {
validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils$6.assertNodeType)("LVal") : (0, _utils$6.assertNodeType)("Identifier", "Pattern", "MemberExpression")
},
optional: {
validate: (0, _utils$6.assertValueType)("boolean"),
optional: true
}
}),
validate(parent, key) {
if (!process.env.BABEL_TYPES_8_BREAKING) return;
const match = /(\w+)\[(\d+)\]/.exec(key);
if (!match) throw new Error("Internal Babel error: malformed key.");
const [, listKey, index] = match;
if (parent[listKey].length > index + 1) {
throw new TypeError(`RestElement must be last element of ${listKey}`);
}
}
});
(0, _utils$6.default)("ReturnStatement", {
visitor: ["argument"],
aliases: ["Statement", "Terminatorless", "CompletionStatement"],
fields: {
argument: {
validate: (0, _utils$6.assertNodeType)("Expression"),
optional: true
}
}
});
(0, _utils$6.default)("SequenceExpression", {
visitor: ["expressions"],
fields: {
expressions: {
validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Expression")))
}
},
aliases: ["Expression"]
});
(0, _utils$6.default)("ParenthesizedExpression", {
visitor: ["expression"],
aliases: ["Expression", "ExpressionWrapper"],
fields: {
expression: {
validate: (0, _utils$6.assertNodeType)("Expression")
}
}
});
(0, _utils$6.default)("SwitchCase", {
visitor: ["test", "consequent"],
fields: {
test: {
validate: (0, _utils$6.assertNodeType)("Expression"),
optional: true
},
consequent: {
validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Statement")))
}
}
});
(0, _utils$6.default)("SwitchStatement", {
visitor: ["discriminant", "cases"],
aliases: ["Statement", "BlockParent", "Scopable"],
fields: {
discriminant: {
validate: (0, _utils$6.assertNodeType)("Expression")
},
cases: {
validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("SwitchCase")))
}
}
});
(0, _utils$6.default)("ThisExpression", {
aliases: ["Expression"]
});
(0, _utils$6.default)("ThrowStatement", {
visitor: ["argument"],
aliases: ["Statement", "Terminatorless", "CompletionStatement"],
fields: {
argument: {
validate: (0, _utils$6.assertNodeType)("Expression")
}
}
});
(0, _utils$6.default)("TryStatement", {
visitor: ["block", "handler", "finalizer"],
aliases: ["Statement"],
fields: {
block: {
validate: (0, _utils$6.chain)((0, _utils$6.assertNodeType)("BlockStatement"), Object.assign(function (node) {
if (!process.env.BABEL_TYPES_8_BREAKING) return;
if (!node.handler && !node.finalizer) {
throw new TypeError("TryStatement expects either a handler or finalizer, or both");
}
}, {
oneOfNodeTypes: ["BlockStatement"]
}))
},
handler: {
optional: true,
validate: (0, _utils$6.assertNodeType)("CatchClause")
},
finalizer: {
optional: true,
validate: (0, _utils$6.assertNodeType)("BlockStatement")
}
}
});
(0, _utils$6.default)("UnaryExpression", {
builder: ["operator", "argument", "prefix"],
fields: {
prefix: {
default: true
},
argument: {
validate: (0, _utils$6.assertNodeType)("Expression")
},
operator: {
validate: (0, _utils$6.assertOneOf)(..._constants$5.UNARY_OPERATORS)
}
},
visitor: ["argument"],
aliases: ["UnaryLike", "Expression"]
});
(0, _utils$6.default)("UpdateExpression", {
builder: ["operator", "argument", "prefix"],
fields: {
prefix: {
default: false
},
argument: {
validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils$6.assertNodeType)("Expression") : (0, _utils$6.assertNodeType)("Identifier", "MemberExpression")
},
operator: {
validate: (0, _utils$6.assertOneOf)(..._constants$5.UPDATE_OPERATORS)
}
},
visitor: ["argument"],
aliases: ["Expression"]
});
(0, _utils$6.default)("VariableDeclaration", {
builder: ["kind", "declarations"],
visitor: ["declarations"],
aliases: ["Statement", "Declaration"],
fields: {
declare: {
validate: (0, _utils$6.assertValueType)("boolean"),
optional: true
},
kind: {
validate: (0, _utils$6.assertOneOf)("var", "let", "const")
},
declarations: {
validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("VariableDeclarator")))
}
},
validate(parent, key, node) {
if (!process.env.BABEL_TYPES_8_BREAKING) return;
if (!(0, _is$2.default)("ForXStatement", parent, {
left: node
})) return;
if (node.declarations.length !== 1) {
throw new TypeError(`Exactly one VariableDeclarator is required in the VariableDeclaration of a ${parent.type}`);
}
}
});
(0, _utils$6.default)("VariableDeclarator", {
visitor: ["id", "init"],
fields: {
id: {
validate: function () {
if (!process.env.BABEL_TYPES_8_BREAKING) {
return (0, _utils$6.assertNodeType)("LVal");
}
const normal = (0, _utils$6.assertNodeType)("Identifier", "ArrayPattern", "ObjectPattern");
const without = (0, _utils$6.assertNodeType)("Identifier");
return function (node, key, val) {
const validator = node.init ? normal : without;
validator(node, key, val);
};
}()
},
definite: {
optional: true,
validate: (0, _utils$6.assertValueType)("boolean")
},
init: {
optional: true,
validate: (0, _utils$6.assertNodeType)("Expression")
}
}
});
(0, _utils$6.default)("WhileStatement", {
visitor: ["test", "body"],
aliases: ["Statement", "BlockParent", "Loop", "While", "Scopable"],
fields: {
test: {
validate: (0, _utils$6.assertNodeType)("Expression")
},
body: {
validate: (0, _utils$6.assertNodeType)("Statement")
}
}
});
(0, _utils$6.default)("WithStatement", {
visitor: ["object", "body"],
aliases: ["Statement"],
fields: {
object: {
validate: (0, _utils$6.assertNodeType)("Expression")
},
body: {
validate: (0, _utils$6.assertNodeType)("Statement")
}
}
});
(0, _utils$6.default)("AssignmentPattern", {
visitor: ["left", "right", "decorators"],
builder: ["left", "right"],
aliases: ["Pattern", "PatternLike", "LVal"],
fields: Object.assign({}, patternLikeCommon, {
left: {
validate: (0, _utils$6.assertNodeType)("Identifier", "ObjectPattern", "ArrayPattern", "MemberExpression")
},
right: {
validate: (0, _utils$6.assertNodeType)("Expression")
},
decorators: {
validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Decorator"))),
optional: true
}
})
});
(0, _utils$6.default)("ArrayPattern", {
visitor: ["elements", "typeAnnotation"],
builder: ["elements"],
aliases: ["Pattern", "PatternLike", "LVal"],
fields: Object.assign({}, patternLikeCommon, {
elements: {
validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeOrValueType)("null", "PatternLike")))
},
decorators: {
validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Decorator"))),
optional: true
},
optional: {
validate: (0, _utils$6.assertValueType)("boolean"),
optional: true
}
})
});
(0, _utils$6.default)("ArrowFunctionExpression", {
builder: ["params", "body", "async"],
visitor: ["params", "body", "returnType", "typeParameters"],
aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Expression", "Pureish"],
fields: Object.assign({}, functionCommon, functionTypeAnnotationCommon, {
expression: {
validate: (0, _utils$6.assertValueType)("boolean")
},
body: {
validate: (0, _utils$6.assertNodeType)("BlockStatement", "Expression")
}
})
});
(0, _utils$6.default)("ClassBody", {
visitor: ["body"],
fields: {
body: {
validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("ClassMethod", "ClassPrivateMethod", "ClassProperty", "ClassPrivateProperty", "TSDeclareMethod", "TSIndexSignature")))
}
}
});
(0, _utils$6.default)("ClassExpression", {
builder: ["id", "superClass", "body", "decorators"],
visitor: ["id", "body", "superClass", "mixins", "typeParameters", "superTypeParameters", "implements", "decorators"],
aliases: ["Scopable", "Class", "Expression"],
fields: {
id: {
validate: (0, _utils$6.assertNodeType)("Identifier"),
optional: true
},
typeParameters: {
validate: (0, _utils$6.assertNodeType)("TypeParameterDeclaration", "TSTypeParameterDeclaration", "Noop"),
optional: true
},
body: {
validate: (0, _utils$6.assertNodeType)("ClassBody")
},
superClass: {
optional: true,
validate: (0, _utils$6.assertNodeType)("Expression")
},
superTypeParameters: {
validate: (0, _utils$6.assertNodeType)("TypeParameterInstantiation", "TSTypeParameterInstantiation"),
optional: true
},
implements: {
validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("TSExpressionWithTypeArguments", "ClassImplements"))),
optional: true
},
decorators: {
validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Decorator"))),
optional: true
},
mixins: {
validate: (0, _utils$6.assertNodeType)("InterfaceExtends"),
optional: true
}
}
});
(0, _utils$6.default)("ClassDeclaration", {
inherits: "ClassExpression",
aliases: ["Scopable", "Class", "Statement", "Declaration"],
fields: {
id: {
validate: (0, _utils$6.assertNodeType)("Identifier")
},
typeParameters: {
validate: (0, _utils$6.assertNodeType)("TypeParameterDeclaration", "TSTypeParameterDeclaration", "Noop"),
optional: true
},
body: {
validate: (0, _utils$6.assertNodeType)("ClassBody")
},
superClass: {
optional: true,
validate: (0, _utils$6.assertNodeType)("Expression")
},
superTypeParameters: {
validate: (0, _utils$6.assertNodeType)("TypeParameterInstantiation", "TSTypeParameterInstantiation"),
optional: true
},
implements: {
validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("TSExpressionWithTypeArguments", "ClassImplements"))),
optional: true
},
decorators: {
validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Decorator"))),
optional: true
},
mixins: {
validate: (0, _utils$6.assertNodeType)("InterfaceExtends"),
optional: true
},
declare: {
validate: (0, _utils$6.assertValueType)("boolean"),
optional: true
},
abstract: {
validate: (0, _utils$6.assertValueType)("boolean"),
optional: true
}
},
validate: function () {
const identifier = (0, _utils$6.assertNodeType)("Identifier");
return function (parent, key, node) {
if (!process.env.BABEL_TYPES_8_BREAKING) return;
if (!(0, _is$2.default)("ExportDefaultDeclaration", parent)) {
identifier(node, "id", node.id);
}
};
}()
});
(0, _utils$6.default)("ExportAllDeclaration", {
visitor: ["source"],
aliases: ["Statement", "Declaration", "ModuleDeclaration", "ExportDeclaration"],
fields: {
source: {
validate: (0, _utils$6.assertNodeType)("StringLiteral")
},
exportKind: (0, _utils$6.validateOptional)((0, _utils$6.assertOneOf)("type", "value")),
assertions: {
optional: true,
validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("ImportAttribute")))
}
}
});
(0, _utils$6.default)("ExportDefaultDeclaration", {
visitor: ["declaration"],
aliases: ["Statement", "Declaration", "ModuleDeclaration", "ExportDeclaration"],
fields: {
declaration: {
validate: (0, _utils$6.assertNodeType)("FunctionDeclaration", "TSDeclareFunction", "ClassDeclaration", "Expression")
},
exportKind: (0, _utils$6.validateOptional)((0, _utils$6.assertOneOf)("value"))
}
});
(0, _utils$6.default)("ExportNamedDeclaration", {
visitor: ["declaration", "specifiers", "source"],
aliases: ["Statement", "Declaration", "ModuleDeclaration", "ExportDeclaration"],
fields: {
declaration: {
optional: true,
validate: (0, _utils$6.chain)((0, _utils$6.assertNodeType)("Declaration"), Object.assign(function (node, key, val) {
if (!process.env.BABEL_TYPES_8_BREAKING) return;
if (val && node.specifiers.length) {
throw new TypeError("Only declaration or specifiers is allowed on ExportNamedDeclaration");
}
}, {
oneOfNodeTypes: ["Declaration"]
}), function (node, key, val) {
if (!process.env.BABEL_TYPES_8_BREAKING) return;
if (val && node.source) {
throw new TypeError("Cannot export a declaration from a source");
}
})
},
assertions: {
optional: true,
validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("ImportAttribute")))
},
specifiers: {
default: [],
validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)(function () {
const sourced = (0, _utils$6.assertNodeType)("ExportSpecifier", "ExportDefaultSpecifier", "ExportNamespaceSpecifier");
const sourceless = (0, _utils$6.assertNodeType)("ExportSpecifier");
if (!process.env.BABEL_TYPES_8_BREAKING) return sourced;
return function (node, key, val) {
const validator = node.source ? sourced : sourceless;
validator(node, key, val);
};
}()))
},
source: {
validate: (0, _utils$6.assertNodeType)("StringLiteral"),
optional: true
},
exportKind: (0, _utils$6.validateOptional)((0, _utils$6.assertOneOf)("type", "value"))
}
});
(0, _utils$6.default)("ExportSpecifier", {
visitor: ["local", "exported"],
aliases: ["ModuleSpecifier"],
fields: {
local: {
validate: (0, _utils$6.assertNodeType)("Identifier")
},
exported: {
validate: (0, _utils$6.assertNodeType)("Identifier", "StringLiteral")
}
}
});
(0, _utils$6.default)("ForOfStatement", {
visitor: ["left", "right", "body"],
builder: ["left", "right", "body", "await"],
aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop", "ForXStatement"],
fields: {
left: {
validate: function () {
if (!process.env.BABEL_TYPES_8_BREAKING) {
return (0, _utils$6.assertNodeType)("VariableDeclaration", "LVal");
}
const declaration = (0, _utils$6.assertNodeType)("VariableDeclaration");
const lval = (0, _utils$6.assertNodeType)("Identifier", "MemberExpression", "ArrayPattern", "ObjectPattern");
return function (node, key, val) {
if ((0, _is$2.default)("VariableDeclaration", val)) {
declaration(node, key, val);
} else {
lval(node, key, val);
}
};
}()
},
right: {
validate: (0, _utils$6.assertNodeType)("Expression")
},
body: {
validate: (0, _utils$6.assertNodeType)("Statement")
},
await: {
default: false
}
}
});
(0, _utils$6.default)("ImportDeclaration", {
visitor: ["specifiers", "source"],
aliases: ["Statement", "Declaration", "ModuleDeclaration"],
fields: {
assertions: {
optional: true,
validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("ImportAttribute")))
},
specifiers: {
validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("ImportSpecifier", "ImportDefaultSpecifier", "ImportNamespaceSpecifier")))
},
source: {
validate: (0, _utils$6.assertNodeType)("StringLiteral")
},
importKind: {
validate: (0, _utils$6.assertOneOf)("type", "typeof", "value"),
optional: true
}
}
});
(0, _utils$6.default)("ImportDefaultSpecifier", {
visitor: ["local"],
aliases: ["ModuleSpecifier"],
fields: {
local: {
validate: (0, _utils$6.assertNodeType)("Identifier")
}
}
});
(0, _utils$6.default)("ImportNamespaceSpecifier", {
visitor: ["local"],
aliases: ["ModuleSpecifier"],
fields: {
local: {
validate: (0, _utils$6.assertNodeType)("Identifier")
}
}
});
(0, _utils$6.default)("ImportSpecifier", {
visitor: ["local", "imported"],
aliases: ["ModuleSpecifier"],
fields: {
local: {
validate: (0, _utils$6.assertNodeType)("Identifier")
},
imported: {
validate: (0, _utils$6.assertNodeType)("Identifier", "StringLiteral")
},
importKind: {
validate: (0, _utils$6.assertOneOf)("type", "typeof"),
optional: true
}
}
});
(0, _utils$6.default)("MetaProperty", {
visitor: ["meta", "property"],
aliases: ["Expression"],
fields: {
meta: {
validate: (0, _utils$6.chain)((0, _utils$6.assertNodeType)("Identifier"), Object.assign(function (node, key, val) {
if (!process.env.BABEL_TYPES_8_BREAKING) return;
let property;
switch (val.name) {
case "function":
property = "sent";
break;
case "new":
property = "target";
break;
case "import":
property = "meta";
break;
}
if (!(0, _is$2.default)("Identifier", node.property, {
name: property
})) {
throw new TypeError("Unrecognised MetaProperty");
}
}, {
oneOfNodeTypes: ["Identifier"]
}))
},
property: {
validate: (0, _utils$6.assertNodeType)("Identifier")
}
}
});
const classMethodOrPropertyCommon = {
abstract: {
validate: (0, _utils$6.assertValueType)("boolean"),
optional: true
},
accessibility: {
validate: (0, _utils$6.assertOneOf)("public", "private", "protected"),
optional: true
},
static: {
default: false
},
override: {
default: false
},
computed: {
default: false
},
optional: {
validate: (0, _utils$6.assertValueType)("boolean"),
optional: true
},
key: {
validate: (0, _utils$6.chain)(function () {
const normal = (0, _utils$6.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral");
const computed = (0, _utils$6.assertNodeType)("Expression");
return function (node, key, val) {
const validator = node.computed ? computed : normal;
validator(node, key, val);
};
}(), (0, _utils$6.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral", "Expression"))
}
};
core.classMethodOrPropertyCommon = classMethodOrPropertyCommon;
const classMethodOrDeclareMethodCommon = Object.assign({}, functionCommon, classMethodOrPropertyCommon, {
params: {
validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Identifier", "Pattern", "RestElement", "TSParameterProperty")))
},
kind: {
validate: (0, _utils$6.assertOneOf)("get", "set", "method", "constructor"),
default: "method"
},
access: {
validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("string"), (0, _utils$6.assertOneOf)("public", "private", "protected")),
optional: true
},
decorators: {
validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Decorator"))),
optional: true
}
});
core.classMethodOrDeclareMethodCommon = classMethodOrDeclareMethodCommon;
(0, _utils$6.default)("ClassMethod", {
aliases: ["Function", "Scopable", "BlockParent", "FunctionParent", "Method"],
builder: ["kind", "key", "params", "body", "computed", "static", "generator", "async"],
visitor: ["key", "params", "body", "decorators", "returnType", "typeParameters"],
fields: Object.assign({}, classMethodOrDeclareMethodCommon, functionTypeAnnotationCommon, {
body: {
validate: (0, _utils$6.assertNodeType)("BlockStatement")
}
})
});
(0, _utils$6.default)("ObjectPattern", {
visitor: ["properties", "typeAnnotation", "decorators"],
builder: ["properties"],
aliases: ["Pattern", "PatternLike", "LVal"],
fields: Object.assign({}, patternLikeCommon, {
properties: {
validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("RestElement", "ObjectProperty")))
}
})
});
(0, _utils$6.default)("SpreadElement", {
visitor: ["argument"],
aliases: ["UnaryLike"],
deprecatedAlias: "SpreadProperty",
fields: {
argument: {
validate: (0, _utils$6.assertNodeType)("Expression")
}
}
});
(0, _utils$6.default)("Super", {
aliases: ["Expression"]
});
(0, _utils$6.default)("TaggedTemplateExpression", {
visitor: ["tag", "quasi", "typeParameters"],
builder: ["tag", "quasi"],
aliases: ["Expression"],
fields: {
tag: {
validate: (0, _utils$6.assertNodeType)("Expression")
},
quasi: {
validate: (0, _utils$6.assertNodeType)("TemplateLiteral")
},
typeParameters: {
validate: (0, _utils$6.assertNodeType)("TypeParameterInstantiation", "TSTypeParameterInstantiation"),
optional: true
}
}
});
(0, _utils$6.default)("TemplateElement", {
builder: ["value", "tail"],
fields: {
value: {
validate: (0, _utils$6.assertShape)({
raw: {
validate: (0, _utils$6.assertValueType)("string")
},
cooked: {
validate: (0, _utils$6.assertValueType)("string"),
optional: true
}
})
},
tail: {
default: false
}
}
});
(0, _utils$6.default)("TemplateLiteral", {
visitor: ["quasis", "expressions"],
aliases: ["Expression", "Literal"],
fields: {
quasis: {
validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("TemplateElement")))
},
expressions: {
validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Expression", "TSType")), function (node, key, val) {
if (node.quasis.length !== val.length + 1) {
throw new TypeError(`Number of ${node.type} quasis should be exactly one more than the number of expressions.\nExpected ${val.length + 1} quasis but got ${node.quasis.length}`);
}
})
}
}
});
(0, _utils$6.default)("YieldExpression", {
builder: ["argument", "delegate"],
visitor: ["argument"],
aliases: ["Expression", "Terminatorless"],
fields: {
delegate: {
validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("boolean"), Object.assign(function (node, key, val) {
if (!process.env.BABEL_TYPES_8_BREAKING) return;
if (val && !node.argument) {
throw new TypeError("Property delegate of YieldExpression cannot be true if there is no argument");
}
}, {
type: "boolean"
})),
default: false
},
argument: {
optional: true,
validate: (0, _utils$6.assertNodeType)("Expression")
}
}
});
(0, _utils$6.default)("AwaitExpression", {
builder: ["argument"],
visitor: ["argument"],
aliases: ["Expression", "Terminatorless"],
fields: {
argument: {
validate: (0, _utils$6.assertNodeType)("Expression")
}
}
});
(0, _utils$6.default)("Import", {
aliases: ["Expression"]
});
(0, _utils$6.default)("BigIntLiteral", {
builder: ["value"],
fields: {
value: {
validate: (0, _utils$6.assertValueType)("string")
}
},
aliases: ["Expression", "Pureish", "Literal", "Immutable"]
});
(0, _utils$6.default)("ExportNamespaceSpecifier", {
visitor: ["exported"],
aliases: ["ModuleSpecifier"],
fields: {
exported: {
validate: (0, _utils$6.assertNodeType)("Identifier")
}
}
});
(0, _utils$6.default)("OptionalMemberExpression", {
builder: ["object", "property", "computed", "optional"],
visitor: ["object", "property"],
aliases: ["Expression"],
fields: {
object: {
validate: (0, _utils$6.assertNodeType)("Expression")
},
property: {
validate: function () {
const normal = (0, _utils$6.assertNodeType)("Identifier");
const computed = (0, _utils$6.assertNodeType)("Expression");
const validator = function (node, key, val) {
const validator = node.computed ? computed : normal;
validator(node, key, val);
};
validator.oneOfNodeTypes = ["Expression", "Identifier"];
return validator;
}()
},
computed: {
default: false
},
optional: {
validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils$6.assertValueType)("boolean") : (0, _utils$6.chain)((0, _utils$6.assertValueType)("boolean"), (0, _utils$6.assertOptionalChainStart)())
}
}
});
(0, _utils$6.default)("OptionalCallExpression", {
visitor: ["callee", "arguments", "typeParameters", "typeArguments"],
builder: ["callee", "arguments", "optional"],
aliases: ["Expression"],
fields: {
callee: {
validate: (0, _utils$6.assertNodeType)("Expression")
},
arguments: {
validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Expression", "SpreadElement", "JSXNamespacedName", "ArgumentPlaceholder")))
},
optional: {
validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils$6.assertValueType)("boolean") : (0, _utils$6.chain)((0, _utils$6.assertValueType)("boolean"), (0, _utils$6.assertOptionalChainStart)())
},
typeArguments: {
validate: (0, _utils$6.assertNodeType)("TypeParameterInstantiation"),
optional: true
},
typeParameters: {
validate: (0, _utils$6.assertNodeType)("TSTypeParameterInstantiation"),
optional: true
}
}
});
(0, _utils$6.default)("ClassProperty", {
visitor: ["key", "value", "typeAnnotation", "decorators"],
builder: ["key", "value", "typeAnnotation", "decorators", "computed", "static"],
aliases: ["Property"],
fields: Object.assign({}, classMethodOrPropertyCommon, {
value: {
validate: (0, _utils$6.assertNodeType)("Expression"),
optional: true
},
definite: {
validate: (0, _utils$6.assertValueType)("boolean"),
optional: true
},
typeAnnotation: {
validate: (0, _utils$6.assertNodeType)("TypeAnnotation", "TSTypeAnnotation", "Noop"),
optional: true
},
decorators: {
validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Decorator"))),
optional: true
},
readonly: {
validate: (0, _utils$6.assertValueType)("boolean"),
optional: true
},
declare: {
validate: (0, _utils$6.assertValueType)("boolean"),
optional: true
},
variance: {
validate: (0, _utils$6.assertNodeType)("Variance"),
optional: true
}
})
});
(0, _utils$6.default)("ClassPrivateProperty", {
visitor: ["key", "value", "decorators", "typeAnnotation"],
builder: ["key", "value", "decorators", "static"],
aliases: ["Property", "Private"],
fields: {
key: {
validate: (0, _utils$6.assertNodeType)("PrivateName")
},
value: {
validate: (0, _utils$6.assertNodeType)("Expression"),
optional: true
},
typeAnnotation: {
validate: (0, _utils$6.assertNodeType)("TypeAnnotation", "TSTypeAnnotation", "Noop"),
optional: true
},
decorators: {
validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Decorator"))),
optional: true
},
readonly: {
validate: (0, _utils$6.assertValueType)("boolean"),
optional: true
},
definite: {
validate: (0, _utils$6.assertValueType)("boolean"),
optional: true
},
variance: {
validate: (0, _utils$6.assertNodeType)("Variance"),
optional: true
}
}
});
(0, _utils$6.default)("ClassPrivateMethod", {
builder: ["kind", "key", "params", "body", "static"],
visitor: ["key", "params", "body", "decorators", "returnType", "typeParameters"],
aliases: ["Function", "Scopable", "BlockParent", "FunctionParent", "Method", "Private"],
fields: Object.assign({}, classMethodOrDeclareMethodCommon, functionTypeAnnotationCommon, {
key: {
validate: (0, _utils$6.assertNodeType)("PrivateName")
},
body: {
validate: (0, _utils$6.assertNodeType)("BlockStatement")
}
})
});
(0, _utils$6.default)("PrivateName", {
visitor: ["id"],
aliases: ["Private"],
fields: {
id: {
validate: (0, _utils$6.assertNodeType)("Identifier")
}
}
});
var _utils$5 = utils;
const defineInterfaceishType = (name, typeParameterType = "TypeParameterDeclaration") => {
(0, _utils$5.default)(name, {
builder: ["id", "typeParameters", "extends", "body"],
visitor: ["id", "typeParameters", "extends", "mixins", "implements", "body"],
aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
fields: {
id: (0, _utils$5.validateType)("Identifier"),
typeParameters: (0, _utils$5.validateOptionalType)(typeParameterType),
extends: (0, _utils$5.validateOptional)((0, _utils$5.arrayOfType)("InterfaceExtends")),
mixins: (0, _utils$5.validateOptional)((0, _utils$5.arrayOfType)("InterfaceExtends")),
implements: (0, _utils$5.validateOptional)((0, _utils$5.arrayOfType)("ClassImplements")),
body: (0, _utils$5.validateType)("ObjectTypeAnnotation")
}
});
};
(0, _utils$5.default)("AnyTypeAnnotation", {
aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
});
(0, _utils$5.default)("ArrayTypeAnnotation", {
visitor: ["elementType"],
aliases: ["Flow", "FlowType"],
fields: {
elementType: (0, _utils$5.validateType)("FlowType")
}
});
(0, _utils$5.default)("BooleanTypeAnnotation", {
aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
});
(0, _utils$5.default)("BooleanLiteralTypeAnnotation", {
builder: ["value"],
aliases: ["Flow", "FlowType"],
fields: {
value: (0, _utils$5.validate)((0, _utils$5.assertValueType)("boolean"))
}
});
(0, _utils$5.default)("NullLiteralTypeAnnotation", {
aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
});
(0, _utils$5.default)("ClassImplements", {
visitor: ["id", "typeParameters"],
aliases: ["Flow"],
fields: {
id: (0, _utils$5.validateType)("Identifier"),
typeParameters: (0, _utils$5.validateOptionalType)("TypeParameterInstantiation")
}
});
defineInterfaceishType("DeclareClass");
(0, _utils$5.default)("DeclareFunction", {
visitor: ["id"],
aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
fields: {
id: (0, _utils$5.validateType)("Identifier"),
predicate: (0, _utils$5.validateOptionalType)("DeclaredPredicate")
}
});
defineInterfaceishType("DeclareInterface");
(0, _utils$5.default)("DeclareModule", {
builder: ["id", "body", "kind"],
visitor: ["id", "body"],
aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
fields: {
id: (0, _utils$5.validateType)(["Identifier", "StringLiteral"]),
body: (0, _utils$5.validateType)("BlockStatement"),
kind: (0, _utils$5.validateOptional)((0, _utils$5.assertOneOf)("CommonJS", "ES"))
}
});
(0, _utils$5.default)("DeclareModuleExports", {
visitor: ["typeAnnotation"],
aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
fields: {
typeAnnotation: (0, _utils$5.validateType)("TypeAnnotation")
}
});
(0, _utils$5.default)("DeclareTypeAlias", {
visitor: ["id", "typeParameters", "right"],
aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
fields: {
id: (0, _utils$5.validateType)("Identifier"),
typeParameters: (0, _utils$5.validateOptionalType)("TypeParameterDeclaration"),
right: (0, _utils$5.validateType)("FlowType")
}
});
(0, _utils$5.default)("DeclareOpaqueType", {
visitor: ["id", "typeParameters", "supertype"],
aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
fields: {
id: (0, _utils$5.validateType)("Identifier"),
typeParameters: (0, _utils$5.validateOptionalType)("TypeParameterDeclaration"),
supertype: (0, _utils$5.validateOptionalType)("FlowType"),
impltype: (0, _utils$5.validateOptionalType)("FlowType")
}
});
(0, _utils$5.default)("DeclareVariable", {
visitor: ["id"],
aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
fields: {
id: (0, _utils$5.validateType)("Identifier")
}
});
(0, _utils$5.default)("DeclareExportDeclaration", {
visitor: ["declaration", "specifiers", "source"],
aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
fields: {
declaration: (0, _utils$5.validateOptionalType)("Flow"),
specifiers: (0, _utils$5.validateOptional)((0, _utils$5.arrayOfType)(["ExportSpecifier", "ExportNamespaceSpecifier"])),
source: (0, _utils$5.validateOptionalType)("StringLiteral"),
default: (0, _utils$5.validateOptional)((0, _utils$5.assertValueType)("boolean"))
}
});
(0, _utils$5.default)("DeclareExportAllDeclaration", {
visitor: ["source"],
aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
fields: {
source: (0, _utils$5.validateType)("StringLiteral"),
exportKind: (0, _utils$5.validateOptional)((0, _utils$5.assertOneOf)("type", "value"))
}
});
(0, _utils$5.default)("DeclaredPredicate", {
visitor: ["value"],
aliases: ["Flow", "FlowPredicate"],
fields: {
value: (0, _utils$5.validateType)("Flow")
}
});
(0, _utils$5.default)("ExistsTypeAnnotation", {
aliases: ["Flow", "FlowType"]
});
(0, _utils$5.default)("FunctionTypeAnnotation", {
visitor: ["typeParameters", "params", "rest", "returnType"],
aliases: ["Flow", "FlowType"],
fields: {
typeParameters: (0, _utils$5.validateOptionalType)("TypeParameterDeclaration"),
params: (0, _utils$5.validate)((0, _utils$5.arrayOfType)("FunctionTypeParam")),
rest: (0, _utils$5.validateOptionalType)("FunctionTypeParam"),
this: (0, _utils$5.validateOptionalType)("FunctionTypeParam"),
returnType: (0, _utils$5.validateType)("FlowType")
}
});
(0, _utils$5.default)("FunctionTypeParam", {
visitor: ["name", "typeAnnotation"],
aliases: ["Flow"],
fields: {
name: (0, _utils$5.validateOptionalType)("Identifier"),
typeAnnotation: (0, _utils$5.validateType)("FlowType"),
optional: (0, _utils$5.validateOptional)((0, _utils$5.assertValueType)("boolean"))
}
});
(0, _utils$5.default)("GenericTypeAnnotation", {
visitor: ["id", "typeParameters"],
aliases: ["Flow", "FlowType"],
fields: {
id: (0, _utils$5.validateType)(["Identifier", "QualifiedTypeIdentifier"]),
typeParameters: (0, _utils$5.validateOptionalType)("TypeParameterInstantiation")
}
});
(0, _utils$5.default)("InferredPredicate", {
aliases: ["Flow", "FlowPredicate"]
});
(0, _utils$5.default)("InterfaceExtends", {
visitor: ["id", "typeParameters"],
aliases: ["Flow"],
fields: {
id: (0, _utils$5.validateType)(["Identifier", "QualifiedTypeIdentifier"]),
typeParameters: (0, _utils$5.validateOptionalType)("TypeParameterInstantiation")
}
});
defineInterfaceishType("InterfaceDeclaration");
(0, _utils$5.default)("InterfaceTypeAnnotation", {
visitor: ["extends", "body"],
aliases: ["Flow", "FlowType"],
fields: {
extends: (0, _utils$5.validateOptional)((0, _utils$5.arrayOfType)("InterfaceExtends")),
body: (0, _utils$5.validateType)("ObjectTypeAnnotation")
}
});
(0, _utils$5.default)("IntersectionTypeAnnotation", {
visitor: ["types"],
aliases: ["Flow", "FlowType"],
fields: {
types: (0, _utils$5.validate)((0, _utils$5.arrayOfType)("FlowType"))
}
});
(0, _utils$5.default)("MixedTypeAnnotation", {
aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
});
(0, _utils$5.default)("EmptyTypeAnnotation", {
aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
});
(0, _utils$5.default)("NullableTypeAnnotation", {
visitor: ["typeAnnotation"],
aliases: ["Flow", "FlowType"],
fields: {
typeAnnotation: (0, _utils$5.validateType)("FlowType")
}
});
(0, _utils$5.default)("NumberLiteralTypeAnnotation", {
builder: ["value"],
aliases: ["Flow", "FlowType"],
fields: {
value: (0, _utils$5.validate)((0, _utils$5.assertValueType)("number"))
}
});
(0, _utils$5.default)("NumberTypeAnnotation", {
aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
});
(0, _utils$5.default)("ObjectTypeAnnotation", {
visitor: ["properties", "indexers", "callProperties", "internalSlots"],
aliases: ["Flow", "FlowType"],
builder: ["properties", "indexers", "callProperties", "internalSlots", "exact"],
fields: {
properties: (0, _utils$5.validate)((0, _utils$5.arrayOfType)(["ObjectTypeProperty", "ObjectTypeSpreadProperty"])),
indexers: (0, _utils$5.validateOptional)((0, _utils$5.arrayOfType)("ObjectTypeIndexer")),
callProperties: (0, _utils$5.validateOptional)((0, _utils$5.arrayOfType)("ObjectTypeCallProperty")),
internalSlots: (0, _utils$5.validateOptional)((0, _utils$5.arrayOfType)("ObjectTypeInternalSlot")),
exact: {
validate: (0, _utils$5.assertValueType)("boolean"),
default: false
},
inexact: (0, _utils$5.validateOptional)((0, _utils$5.assertValueType)("boolean"))
}
});
(0, _utils$5.default)("ObjectTypeInternalSlot", {
visitor: ["id", "value", "optional", "static", "method"],
aliases: ["Flow", "UserWhitespacable"],
fields: {
id: (0, _utils$5.validateType)("Identifier"),
value: (0, _utils$5.validateType)("FlowType"),
optional: (0, _utils$5.validate)((0, _utils$5.assertValueType)("boolean")),
static: (0, _utils$5.validate)((0, _utils$5.assertValueType)("boolean")),
method: (0, _utils$5.validate)((0, _utils$5.assertValueType)("boolean"))
}
});
(0, _utils$5.default)("ObjectTypeCallProperty", {
visitor: ["value"],
aliases: ["Flow", "UserWhitespacable"],
fields: {
value: (0, _utils$5.validateType)("FlowType"),
static: (0, _utils$5.validate)((0, _utils$5.assertValueType)("boolean"))
}
});
(0, _utils$5.default)("ObjectTypeIndexer", {
visitor: ["id", "key", "value", "variance"],
aliases: ["Flow", "UserWhitespacable"],
fields: {
id: (0, _utils$5.validateOptionalType)("Identifier"),
key: (0, _utils$5.validateType)("FlowType"),
value: (0, _utils$5.validateType)("FlowType"),
static: (0, _utils$5.validate)((0, _utils$5.assertValueType)("boolean")),
variance: (0, _utils$5.validateOptionalType)("Variance")
}
});
(0, _utils$5.default)("ObjectTypeProperty", {
visitor: ["key", "value", "variance"],
aliases: ["Flow", "UserWhitespacable"],
fields: {
key: (0, _utils$5.validateType)(["Identifier", "StringLiteral"]),
value: (0, _utils$5.validateType)("FlowType"),
kind: (0, _utils$5.validate)((0, _utils$5.assertOneOf)("init", "get", "set")),
static: (0, _utils$5.validate)((0, _utils$5.assertValueType)("boolean")),
proto: (0, _utils$5.validate)((0, _utils$5.assertValueType)("boolean")),
optional: (0, _utils$5.validate)((0, _utils$5.assertValueType)("boolean")),
variance: (0, _utils$5.validateOptionalType)("Variance"),
method: (0, _utils$5.validate)((0, _utils$5.assertValueType)("boolean"))
}
});
(0, _utils$5.default)("ObjectTypeSpreadProperty", {
visitor: ["argument"],
aliases: ["Flow", "UserWhitespacable"],
fields: {
argument: (0, _utils$5.validateType)("FlowType")
}
});
(0, _utils$5.default)("OpaqueType", {
visitor: ["id", "typeParameters", "supertype", "impltype"],
aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
fields: {
id: (0, _utils$5.validateType)("Identifier"),
typeParameters: (0, _utils$5.validateOptionalType)("TypeParameterDeclaration"),
supertype: (0, _utils$5.validateOptionalType)("FlowType"),
impltype: (0, _utils$5.validateType)("FlowType")
}
});
(0, _utils$5.default)("QualifiedTypeIdentifier", {
visitor: ["id", "qualification"],
aliases: ["Flow"],
fields: {
id: (0, _utils$5.validateType)("Identifier"),
qualification: (0, _utils$5.validateType)(["Identifier", "QualifiedTypeIdentifier"])
}
});
(0, _utils$5.default)("StringLiteralTypeAnnotation", {
builder: ["value"],
aliases: ["Flow", "FlowType"],
fields: {
value: (0, _utils$5.validate)((0, _utils$5.assertValueType)("string"))
}
});
(0, _utils$5.default)("StringTypeAnnotation", {
aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
});
(0, _utils$5.default)("SymbolTypeAnnotation", {
aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
});
(0, _utils$5.default)("ThisTypeAnnotation", {
aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
});
(0, _utils$5.default)("TupleTypeAnnotation", {
visitor: ["types"],
aliases: ["Flow", "FlowType"],
fields: {
types: (0, _utils$5.validate)((0, _utils$5.arrayOfType)("FlowType"))
}
});
(0, _utils$5.default)("TypeofTypeAnnotation", {
visitor: ["argument"],
aliases: ["Flow", "FlowType"],
fields: {
argument: (0, _utils$5.validateType)("FlowType")
}
});
(0, _utils$5.default)("TypeAlias", {
visitor: ["id", "typeParameters", "right"],
aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
fields: {
id: (0, _utils$5.validateType)("Identifier"),
typeParameters: (0, _utils$5.validateOptionalType)("TypeParameterDeclaration"),
right: (0, _utils$5.validateType)("FlowType")
}
});
(0, _utils$5.default)("TypeAnnotation", {
aliases: ["Flow"],
visitor: ["typeAnnotation"],
fields: {
typeAnnotation: (0, _utils$5.validateType)("FlowType")
}
});
(0, _utils$5.default)("TypeCastExpression", {
visitor: ["expression", "typeAnnotation"],
aliases: ["Flow", "ExpressionWrapper", "Expression"],
fields: {
expression: (0, _utils$5.validateType)("Expression"),
typeAnnotation: (0, _utils$5.validateType)("TypeAnnotation")
}
});
(0, _utils$5.default)("TypeParameter", {
aliases: ["Flow"],
visitor: ["bound", "default", "variance"],
fields: {
name: (0, _utils$5.validate)((0, _utils$5.assertValueType)("string")),
bound: (0, _utils$5.validateOptionalType)("TypeAnnotation"),
default: (0, _utils$5.validateOptionalType)("FlowType"),
variance: (0, _utils$5.validateOptionalType)("Variance")
}
});
(0, _utils$5.default)("TypeParameterDeclaration", {
aliases: ["Flow"],
visitor: ["params"],
fields: {
params: (0, _utils$5.validate)((0, _utils$5.arrayOfType)("TypeParameter"))
}
});
(0, _utils$5.default)("TypeParameterInstantiation", {
aliases: ["Flow"],
visitor: ["params"],
fields: {
params: (0, _utils$5.validate)((0, _utils$5.arrayOfType)("FlowType"))
}
});
(0, _utils$5.default)("UnionTypeAnnotation", {
visitor: ["types"],
aliases: ["Flow", "FlowType"],
fields: {
types: (0, _utils$5.validate)((0, _utils$5.arrayOfType)("FlowType"))
}
});
(0, _utils$5.default)("Variance", {
aliases: ["Flow"],
builder: ["kind"],
fields: {
kind: (0, _utils$5.validate)((0, _utils$5.assertOneOf)("minus", "plus"))
}
});
(0, _utils$5.default)("VoidTypeAnnotation", {
aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
});
(0, _utils$5.default)("EnumDeclaration", {
aliases: ["Statement", "Declaration"],
visitor: ["id", "body"],
fields: {
id: (0, _utils$5.validateType)("Identifier"),
body: (0, _utils$5.validateType)(["EnumBooleanBody", "EnumNumberBody", "EnumStringBody", "EnumSymbolBody"])
}
});
(0, _utils$5.default)("EnumBooleanBody", {
aliases: ["EnumBody"],
visitor: ["members"],
fields: {
explicitType: (0, _utils$5.validate)((0, _utils$5.assertValueType)("boolean")),
members: (0, _utils$5.validateArrayOfType)("EnumBooleanMember"),
hasUnknownMembers: (0, _utils$5.validate)((0, _utils$5.assertValueType)("boolean"))
}
});
(0, _utils$5.default)("EnumNumberBody", {
aliases: ["EnumBody"],
visitor: ["members"],
fields: {
explicitType: (0, _utils$5.validate)((0, _utils$5.assertValueType)("boolean")),
members: (0, _utils$5.validateArrayOfType)("EnumNumberMember"),
hasUnknownMembers: (0, _utils$5.validate)((0, _utils$5.assertValueType)("boolean"))
}
});
(0, _utils$5.default)("EnumStringBody", {
aliases: ["EnumBody"],
visitor: ["members"],
fields: {
explicitType: (0, _utils$5.validate)((0, _utils$5.assertValueType)("boolean")),
members: (0, _utils$5.validateArrayOfType)(["EnumStringMember", "EnumDefaultedMember"]),
hasUnknownMembers: (0, _utils$5.validate)((0, _utils$5.assertValueType)("boolean"))
}
});
(0, _utils$5.default)("EnumSymbolBody", {
aliases: ["EnumBody"],
visitor: ["members"],
fields: {
members: (0, _utils$5.validateArrayOfType)("EnumDefaultedMember"),
hasUnknownMembers: (0, _utils$5.validate)((0, _utils$5.assertValueType)("boolean"))
}
});
(0, _utils$5.default)("EnumBooleanMember", {
aliases: ["EnumMember"],
visitor: ["id"],
fields: {
id: (0, _utils$5.validateType)("Identifier"),
init: (0, _utils$5.validateType)("BooleanLiteral")
}
});
(0, _utils$5.default)("EnumNumberMember", {
aliases: ["EnumMember"],
visitor: ["id", "init"],
fields: {
id: (0, _utils$5.validateType)("Identifier"),
init: (0, _utils$5.validateType)("NumericLiteral")
}
});
(0, _utils$5.default)("EnumStringMember", {
aliases: ["EnumMember"],
visitor: ["id", "init"],
fields: {
id: (0, _utils$5.validateType)("Identifier"),
init: (0, _utils$5.validateType)("StringLiteral")
}
});
(0, _utils$5.default)("EnumDefaultedMember", {
aliases: ["EnumMember"],
visitor: ["id"],
fields: {
id: (0, _utils$5.validateType)("Identifier")
}
});
(0, _utils$5.default)("IndexedAccessType", {
visitor: ["objectType", "indexType"],
aliases: ["Flow", "FlowType"],
fields: {
objectType: (0, _utils$5.validateType)("FlowType"),
indexType: (0, _utils$5.validateType)("FlowType")
}
});
(0, _utils$5.default)("OptionalIndexedAccessType", {
visitor: ["objectType", "indexType"],
aliases: ["Flow", "FlowType"],
fields: {
objectType: (0, _utils$5.validateType)("FlowType"),
indexType: (0, _utils$5.validateType)("FlowType"),
optional: (0, _utils$5.validate)((0, _utils$5.assertValueType)("boolean"))
}
});
var _utils$4 = utils;
(0, _utils$4.default)("JSXAttribute", {
visitor: ["name", "value"],
aliases: ["JSX", "Immutable"],
fields: {
name: {
validate: (0, _utils$4.assertNodeType)("JSXIdentifier", "JSXNamespacedName")
},
value: {
optional: true,
validate: (0, _utils$4.assertNodeType)("JSXElement", "JSXFragment", "StringLiteral", "JSXExpressionContainer")
}
}
});
(0, _utils$4.default)("JSXClosingElement", {
visitor: ["name"],
aliases: ["JSX", "Immutable"],
fields: {
name: {
validate: (0, _utils$4.assertNodeType)("JSXIdentifier", "JSXMemberExpression", "JSXNamespacedName")
}
}
});
(0, _utils$4.default)("JSXElement", {
builder: ["openingElement", "closingElement", "children", "selfClosing"],
visitor: ["openingElement", "children", "closingElement"],
aliases: ["JSX", "Immutable", "Expression"],
fields: {
openingElement: {
validate: (0, _utils$4.assertNodeType)("JSXOpeningElement")
},
closingElement: {
optional: true,
validate: (0, _utils$4.assertNodeType)("JSXClosingElement")
},
children: {
validate: (0, _utils$4.chain)((0, _utils$4.assertValueType)("array"), (0, _utils$4.assertEach)((0, _utils$4.assertNodeType)("JSXText", "JSXExpressionContainer", "JSXSpreadChild", "JSXElement", "JSXFragment")))
},
selfClosing: {
validate: (0, _utils$4.assertValueType)("boolean"),
optional: true
}
}
});
(0, _utils$4.default)("JSXEmptyExpression", {
aliases: ["JSX"]
});
(0, _utils$4.default)("JSXExpressionContainer", {
visitor: ["expression"],
aliases: ["JSX", "Immutable"],
fields: {
expression: {
validate: (0, _utils$4.assertNodeType)("Expression", "JSXEmptyExpression")
}
}
});
(0, _utils$4.default)("JSXSpreadChild", {
visitor: ["expression"],
aliases: ["JSX", "Immutable"],
fields: {
expression: {
validate: (0, _utils$4.assertNodeType)("Expression")
}
}
});
(0, _utils$4.default)("JSXIdentifier", {
builder: ["name"],
aliases: ["JSX"],
fields: {
name: {
validate: (0, _utils$4.assertValueType)("string")
}
}
});
(0, _utils$4.default)("JSXMemberExpression", {
visitor: ["object", "property"],
aliases: ["JSX"],
fields: {
object: {
validate: (0, _utils$4.assertNodeType)("JSXMemberExpression", "JSXIdentifier")
},
property: {
validate: (0, _utils$4.assertNodeType)("JSXIdentifier")
}
}
});
(0, _utils$4.default)("JSXNamespacedName", {
visitor: ["namespace", "name"],
aliases: ["JSX"],
fields: {
namespace: {
validate: (0, _utils$4.assertNodeType)("JSXIdentifier")
},
name: {
validate: (0, _utils$4.assertNodeType)("JSXIdentifier")
}
}
});
(0, _utils$4.default)("JSXOpeningElement", {
builder: ["name", "attributes", "selfClosing"],
visitor: ["name", "attributes"],
aliases: ["JSX", "Immutable"],
fields: {
name: {
validate: (0, _utils$4.assertNodeType)("JSXIdentifier", "JSXMemberExpression", "JSXNamespacedName")
},
selfClosing: {
default: false
},
attributes: {
validate: (0, _utils$4.chain)((0, _utils$4.assertValueType)("array"), (0, _utils$4.assertEach)((0, _utils$4.assertNodeType)("JSXAttribute", "JSXSpreadAttribute")))
},
typeParameters: {
validate: (0, _utils$4.assertNodeType)("TypeParameterInstantiation", "TSTypeParameterInstantiation"),
optional: true
}
}
});
(0, _utils$4.default)("JSXSpreadAttribute", {
visitor: ["argument"],
aliases: ["JSX"],
fields: {
argument: {
validate: (0, _utils$4.assertNodeType)("Expression")
}
}
});
(0, _utils$4.default)("JSXText", {
aliases: ["JSX", "Immutable"],
builder: ["value"],
fields: {
value: {
validate: (0, _utils$4.assertValueType)("string")
}
}
});
(0, _utils$4.default)("JSXFragment", {
builder: ["openingFragment", "closingFragment", "children"],
visitor: ["openingFragment", "children", "closingFragment"],
aliases: ["JSX", "Immutable", "Expression"],
fields: {
openingFragment: {
validate: (0, _utils$4.assertNodeType)("JSXOpeningFragment")
},
closingFragment: {
validate: (0, _utils$4.assertNodeType)("JSXClosingFragment")
},
children: {
validate: (0, _utils$4.chain)((0, _utils$4.assertValueType)("array"), (0, _utils$4.assertEach)((0, _utils$4.assertNodeType)("JSXText", "JSXExpressionContainer", "JSXSpreadChild", "JSXElement", "JSXFragment")))
}
}
});
(0, _utils$4.default)("JSXOpeningFragment", {
aliases: ["JSX", "Immutable"]
});
(0, _utils$4.default)("JSXClosingFragment", {
aliases: ["JSX", "Immutable"]
});
var placeholders = {};
Object.defineProperty(placeholders, "__esModule", {
value: true
});
placeholders.PLACEHOLDERS_FLIPPED_ALIAS = placeholders.PLACEHOLDERS_ALIAS = placeholders.PLACEHOLDERS = void 0;
var _utils$3 = utils;
const PLACEHOLDERS = ["Identifier", "StringLiteral", "Expression", "Statement", "Declaration", "BlockStatement", "ClassBody", "Pattern"];
placeholders.PLACEHOLDERS = PLACEHOLDERS;
const PLACEHOLDERS_ALIAS = {
Declaration: ["Statement"],
Pattern: ["PatternLike", "LVal"]
};
placeholders.PLACEHOLDERS_ALIAS = PLACEHOLDERS_ALIAS;
for (const type of PLACEHOLDERS) {
const alias = _utils$3.ALIAS_KEYS[type];
if (alias != null && alias.length) PLACEHOLDERS_ALIAS[type] = alias;
}
const PLACEHOLDERS_FLIPPED_ALIAS = {};
placeholders.PLACEHOLDERS_FLIPPED_ALIAS = PLACEHOLDERS_FLIPPED_ALIAS;
Object.keys(PLACEHOLDERS_ALIAS).forEach(type => {
PLACEHOLDERS_ALIAS[type].forEach(alias => {
if (!Object.hasOwnProperty.call(PLACEHOLDERS_FLIPPED_ALIAS, alias)) {
PLACEHOLDERS_FLIPPED_ALIAS[alias] = [];
}
PLACEHOLDERS_FLIPPED_ALIAS[alias].push(type);
});
});
var _utils$2 = utils;
var _placeholders = placeholders;
{
(0, _utils$2.default)("Noop", {
visitor: []
});
}
(0, _utils$2.default)("Placeholder", {
visitor: [],
builder: ["expectedNode", "name"],
fields: {
name: {
validate: (0, _utils$2.assertNodeType)("Identifier")
},
expectedNode: {
validate: (0, _utils$2.assertOneOf)(..._placeholders.PLACEHOLDERS)
}
}
});
(0, _utils$2.default)("V8IntrinsicIdentifier", {
builder: ["name"],
fields: {
name: {
validate: (0, _utils$2.assertValueType)("string")
}
}
});
var _utils$1 = utils;
(0, _utils$1.default)("ArgumentPlaceholder", {});
(0, _utils$1.default)("BindExpression", {
visitor: ["object", "callee"],
aliases: ["Expression"],
fields: !process.env.BABEL_TYPES_8_BREAKING ? {
object: {
validate: Object.assign(() => {}, {
oneOfNodeTypes: ["Expression"]
})
},
callee: {
validate: Object.assign(() => {}, {
oneOfNodeTypes: ["Expression"]
})
}
} : {
object: {
validate: (0, _utils$1.assertNodeType)("Expression")
},
callee: {
validate: (0, _utils$1.assertNodeType)("Expression")
}
}
});
(0, _utils$1.default)("ImportAttribute", {
visitor: ["key", "value"],
fields: {
key: {
validate: (0, _utils$1.assertNodeType)("Identifier", "StringLiteral")
},
value: {
validate: (0, _utils$1.assertNodeType)("StringLiteral")
}
}
});
(0, _utils$1.default)("Decorator", {
visitor: ["expression"],
fields: {
expression: {
validate: (0, _utils$1.assertNodeType)("Expression")
}
}
});
(0, _utils$1.default)("DoExpression", {
visitor: ["body"],
builder: ["body", "async"],
aliases: ["Expression"],
fields: {
body: {
validate: (0, _utils$1.assertNodeType)("BlockStatement")
},
async: {
validate: (0, _utils$1.assertValueType)("boolean"),
default: false
}
}
});
(0, _utils$1.default)("ExportDefaultSpecifier", {
visitor: ["exported"],
aliases: ["ModuleSpecifier"],
fields: {
exported: {
validate: (0, _utils$1.assertNodeType)("Identifier")
}
}
});
(0, _utils$1.default)("RecordExpression", {
visitor: ["properties"],
aliases: ["Expression"],
fields: {
properties: {
validate: (0, _utils$1.chain)((0, _utils$1.assertValueType)("array"), (0, _utils$1.assertEach)((0, _utils$1.assertNodeType)("ObjectProperty", "SpreadElement")))
}
}
});
(0, _utils$1.default)("TupleExpression", {
fields: {
elements: {
validate: (0, _utils$1.chain)((0, _utils$1.assertValueType)("array"), (0, _utils$1.assertEach)((0, _utils$1.assertNodeType)("Expression", "SpreadElement"))),
default: []
}
},
visitor: ["elements"],
aliases: ["Expression"]
});
(0, _utils$1.default)("DecimalLiteral", {
builder: ["value"],
fields: {
value: {
validate: (0, _utils$1.assertValueType)("string")
}
},
aliases: ["Expression", "Pureish", "Literal", "Immutable"]
});
(0, _utils$1.default)("StaticBlock", {
visitor: ["body"],
fields: {
body: {
validate: (0, _utils$1.chain)((0, _utils$1.assertValueType)("array"), (0, _utils$1.assertEach)((0, _utils$1.assertNodeType)("Statement")))
}
},
aliases: ["Scopable", "BlockParent"]
});
(0, _utils$1.default)("ModuleExpression", {
visitor: ["body"],
fields: {
body: {
validate: (0, _utils$1.assertNodeType)("Program")
}
},
aliases: ["Expression"]
});
(0, _utils$1.default)("TopicReference", {
aliases: ["Expression"]
});
(0, _utils$1.default)("PipelineTopicExpression", {
builder: ["expression"],
visitor: ["expression"],
fields: {
expression: {
validate: (0, _utils$1.assertNodeType)("Expression")
}
},
aliases: ["Expression"]
});
(0, _utils$1.default)("PipelineBareFunction", {
builder: ["callee"],
visitor: ["callee"],
fields: {
callee: {
validate: (0, _utils$1.assertNodeType)("Expression")
}
},
aliases: ["Expression"]
});
(0, _utils$1.default)("PipelinePrimaryTopicReference", {
aliases: ["Expression"]
});
var _utils = utils;
var _core = core;
var _is$1 = is$1;
const bool = (0, _utils.assertValueType)("boolean");
const tSFunctionTypeAnnotationCommon = {
returnType: {
validate: (0, _utils.assertNodeType)("TSTypeAnnotation", "Noop"),
optional: true
},
typeParameters: {
validate: (0, _utils.assertNodeType)("TSTypeParameterDeclaration", "Noop"),
optional: true
}
};
(0, _utils.default)("TSParameterProperty", {
aliases: ["LVal"],
visitor: ["parameter"],
fields: {
accessibility: {
validate: (0, _utils.assertOneOf)("public", "private", "protected"),
optional: true
},
readonly: {
validate: (0, _utils.assertValueType)("boolean"),
optional: true
},
parameter: {
validate: (0, _utils.assertNodeType)("Identifier", "AssignmentPattern")
},
override: {
validate: (0, _utils.assertValueType)("boolean"),
optional: true
},
decorators: {
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))),
optional: true
}
}
});
(0, _utils.default)("TSDeclareFunction", {
aliases: ["Statement", "Declaration"],
visitor: ["id", "typeParameters", "params", "returnType"],
fields: Object.assign({}, _core.functionDeclarationCommon, tSFunctionTypeAnnotationCommon)
});
(0, _utils.default)("TSDeclareMethod", {
visitor: ["decorators", "key", "typeParameters", "params", "returnType"],
fields: Object.assign({}, _core.classMethodOrDeclareMethodCommon, tSFunctionTypeAnnotationCommon)
});
(0, _utils.default)("TSQualifiedName", {
aliases: ["TSEntityName"],
visitor: ["left", "right"],
fields: {
left: (0, _utils.validateType)("TSEntityName"),
right: (0, _utils.validateType)("Identifier")
}
});
const signatureDeclarationCommon = {
typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterDeclaration"),
parameters: (0, _utils.validateArrayOfType)(["Identifier", "RestElement"]),
typeAnnotation: (0, _utils.validateOptionalType)("TSTypeAnnotation")
};
const callConstructSignatureDeclaration = {
aliases: ["TSTypeElement"],
visitor: ["typeParameters", "parameters", "typeAnnotation"],
fields: signatureDeclarationCommon
};
(0, _utils.default)("TSCallSignatureDeclaration", callConstructSignatureDeclaration);
(0, _utils.default)("TSConstructSignatureDeclaration", callConstructSignatureDeclaration);
const namedTypeElementCommon = {
key: (0, _utils.validateType)("Expression"),
computed: (0, _utils.validate)(bool),
optional: (0, _utils.validateOptional)(bool)
};
(0, _utils.default)("TSPropertySignature", {
aliases: ["TSTypeElement"],
visitor: ["key", "typeAnnotation", "initializer"],
fields: Object.assign({}, namedTypeElementCommon, {
readonly: (0, _utils.validateOptional)(bool),
typeAnnotation: (0, _utils.validateOptionalType)("TSTypeAnnotation"),
initializer: (0, _utils.validateOptionalType)("Expression"),
kind: {
validate: (0, _utils.assertOneOf)("get", "set")
}
})
});
(0, _utils.default)("TSMethodSignature", {
aliases: ["TSTypeElement"],
visitor: ["key", "typeParameters", "parameters", "typeAnnotation"],
fields: Object.assign({}, signatureDeclarationCommon, namedTypeElementCommon, {
kind: {
validate: (0, _utils.assertOneOf)("method", "get", "set")
}
})
});
(0, _utils.default)("TSIndexSignature", {
aliases: ["TSTypeElement"],
visitor: ["parameters", "typeAnnotation"],
fields: {
readonly: (0, _utils.validateOptional)(bool),
static: (0, _utils.validateOptional)(bool),
parameters: (0, _utils.validateArrayOfType)("Identifier"),
typeAnnotation: (0, _utils.validateOptionalType)("TSTypeAnnotation")
}
});
const tsKeywordTypes = ["TSAnyKeyword", "TSBooleanKeyword", "TSBigIntKeyword", "TSIntrinsicKeyword", "TSNeverKeyword", "TSNullKeyword", "TSNumberKeyword", "TSObjectKeyword", "TSStringKeyword", "TSSymbolKeyword", "TSUndefinedKeyword", "TSUnknownKeyword", "TSVoidKeyword"];
for (const type of tsKeywordTypes) {
(0, _utils.default)(type, {
aliases: ["TSType", "TSBaseType"],
visitor: [],
fields: {}
});
}
(0, _utils.default)("TSThisType", {
aliases: ["TSType", "TSBaseType"],
visitor: [],
fields: {}
});
const fnOrCtrBase = {
aliases: ["TSType"],
visitor: ["typeParameters", "parameters", "typeAnnotation"]
};
(0, _utils.default)("TSFunctionType", Object.assign({}, fnOrCtrBase, {
fields: signatureDeclarationCommon
}));
(0, _utils.default)("TSConstructorType", Object.assign({}, fnOrCtrBase, {
fields: Object.assign({}, signatureDeclarationCommon, {
abstract: (0, _utils.validateOptional)(bool)
})
}));
(0, _utils.default)("TSTypeReference", {
aliases: ["TSType"],
visitor: ["typeName", "typeParameters"],
fields: {
typeName: (0, _utils.validateType)("TSEntityName"),
typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterInstantiation")
}
});
(0, _utils.default)("TSTypePredicate", {
aliases: ["TSType"],
visitor: ["parameterName", "typeAnnotation"],
builder: ["parameterName", "typeAnnotation", "asserts"],
fields: {
parameterName: (0, _utils.validateType)(["Identifier", "TSThisType"]),
typeAnnotation: (0, _utils.validateOptionalType)("TSTypeAnnotation"),
asserts: (0, _utils.validateOptional)(bool)
}
});
(0, _utils.default)("TSTypeQuery", {
aliases: ["TSType"],
visitor: ["exprName"],
fields: {
exprName: (0, _utils.validateType)(["TSEntityName", "TSImportType"])
}
});
(0, _utils.default)("TSTypeLiteral", {
aliases: ["TSType"],
visitor: ["members"],
fields: {
members: (0, _utils.validateArrayOfType)("TSTypeElement")
}
});
(0, _utils.default)("TSArrayType", {
aliases: ["TSType"],
visitor: ["elementType"],
fields: {
elementType: (0, _utils.validateType)("TSType")
}
});
(0, _utils.default)("TSTupleType", {
aliases: ["TSType"],
visitor: ["elementTypes"],
fields: {
elementTypes: (0, _utils.validateArrayOfType)(["TSType", "TSNamedTupleMember"])
}
});
(0, _utils.default)("TSOptionalType", {
aliases: ["TSType"],
visitor: ["typeAnnotation"],
fields: {
typeAnnotation: (0, _utils.validateType)("TSType")
}
});
(0, _utils.default)("TSRestType", {
aliases: ["TSType"],
visitor: ["typeAnnotation"],
fields: {
typeAnnotation: (0, _utils.validateType)("TSType")
}
});
(0, _utils.default)("TSNamedTupleMember", {
visitor: ["label", "elementType"],
builder: ["label", "elementType", "optional"],
fields: {
label: (0, _utils.validateType)("Identifier"),
optional: {
validate: bool,
default: false
},
elementType: (0, _utils.validateType)("TSType")
}
});
const unionOrIntersection = {
aliases: ["TSType"],
visitor: ["types"],
fields: {
types: (0, _utils.validateArrayOfType)("TSType")
}
};
(0, _utils.default)("TSUnionType", unionOrIntersection);
(0, _utils.default)("TSIntersectionType", unionOrIntersection);
(0, _utils.default)("TSConditionalType", {
aliases: ["TSType"],
visitor: ["checkType", "extendsType", "trueType", "falseType"],
fields: {
checkType: (0, _utils.validateType)("TSType"),
extendsType: (0, _utils.validateType)("TSType"),
trueType: (0, _utils.validateType)("TSType"),
falseType: (0, _utils.validateType)("TSType")
}
});
(0, _utils.default)("TSInferType", {
aliases: ["TSType"],
visitor: ["typeParameter"],
fields: {
typeParameter: (0, _utils.validateType)("TSTypeParameter")
}
});
(0, _utils.default)("TSParenthesizedType", {
aliases: ["TSType"],
visitor: ["typeAnnotation"],
fields: {
typeAnnotation: (0, _utils.validateType)("TSType")
}
});
(0, _utils.default)("TSTypeOperator", {
aliases: ["TSType"],
visitor: ["typeAnnotation"],
fields: {
operator: (0, _utils.validate)((0, _utils.assertValueType)("string")),
typeAnnotation: (0, _utils.validateType)("TSType")
}
});
(0, _utils.default)("TSIndexedAccessType", {
aliases: ["TSType"],
visitor: ["objectType", "indexType"],
fields: {
objectType: (0, _utils.validateType)("TSType"),
indexType: (0, _utils.validateType)("TSType")
}
});
(0, _utils.default)("TSMappedType", {
aliases: ["TSType"],
visitor: ["typeParameter", "typeAnnotation", "nameType"],
fields: {
readonly: (0, _utils.validateOptional)(bool),
typeParameter: (0, _utils.validateType)("TSTypeParameter"),
optional: (0, _utils.validateOptional)(bool),
typeAnnotation: (0, _utils.validateOptionalType)("TSType"),
nameType: (0, _utils.validateOptionalType)("TSType")
}
});
(0, _utils.default)("TSLiteralType", {
aliases: ["TSType", "TSBaseType"],
visitor: ["literal"],
fields: {
literal: {
validate: function () {
const unaryExpression = (0, _utils.assertNodeType)("NumericLiteral", "BigIntLiteral");
const unaryOperator = (0, _utils.assertOneOf)("-");
const literal = (0, _utils.assertNodeType)("NumericLiteral", "StringLiteral", "BooleanLiteral", "BigIntLiteral");
function validator(parent, key, node) {
if ((0, _is$1.default)("UnaryExpression", node)) {
unaryOperator(node, "operator", node.operator);
unaryExpression(node, "argument", node.argument);
} else {
literal(parent, key, node);
}
}
validator.oneOfNodeTypes = ["NumericLiteral", "StringLiteral", "BooleanLiteral", "BigIntLiteral", "UnaryExpression"];
return validator;
}()
}
}
});
(0, _utils.default)("TSExpressionWithTypeArguments", {
aliases: ["TSType"],
visitor: ["expression", "typeParameters"],
fields: {
expression: (0, _utils.validateType)("TSEntityName"),
typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterInstantiation")
}
});
(0, _utils.default)("TSInterfaceDeclaration", {
aliases: ["Statement", "Declaration"],
visitor: ["id", "typeParameters", "extends", "body"],
fields: {
declare: (0, _utils.validateOptional)(bool),
id: (0, _utils.validateType)("Identifier"),
typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterDeclaration"),
extends: (0, _utils.validateOptional)((0, _utils.arrayOfType)("TSExpressionWithTypeArguments")),
body: (0, _utils.validateType)("TSInterfaceBody")
}
});
(0, _utils.default)("TSInterfaceBody", {
visitor: ["body"],
fields: {
body: (0, _utils.validateArrayOfType)("TSTypeElement")
}
});
(0, _utils.default)("TSTypeAliasDeclaration", {
aliases: ["Statement", "Declaration"],
visitor: ["id", "typeParameters", "typeAnnotation"],
fields: {
declare: (0, _utils.validateOptional)(bool),
id: (0, _utils.validateType)("Identifier"),
typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterDeclaration"),
typeAnnotation: (0, _utils.validateType)("TSType")
}
});
(0, _utils.default)("TSAsExpression", {
aliases: ["Expression"],
visitor: ["expression", "typeAnnotation"],
fields: {
expression: (0, _utils.validateType)("Expression"),
typeAnnotation: (0, _utils.validateType)("TSType")
}
});
(0, _utils.default)("TSTypeAssertion", {
aliases: ["Expression"],
visitor: ["typeAnnotation", "expression"],
fields: {
typeAnnotation: (0, _utils.validateType)("TSType"),
expression: (0, _utils.validateType)("Expression")
}
});
(0, _utils.default)("TSEnumDeclaration", {
aliases: ["Statement", "Declaration"],
visitor: ["id", "members"],
fields: {
declare: (0, _utils.validateOptional)(bool),
const: (0, _utils.validateOptional)(bool),
id: (0, _utils.validateType)("Identifier"),
members: (0, _utils.validateArrayOfType)("TSEnumMember"),
initializer: (0, _utils.validateOptionalType)("Expression")
}
});
(0, _utils.default)("TSEnumMember", {
visitor: ["id", "initializer"],
fields: {
id: (0, _utils.validateType)(["Identifier", "StringLiteral"]),
initializer: (0, _utils.validateOptionalType)("Expression")
}
});
(0, _utils.default)("TSModuleDeclaration", {
aliases: ["Statement", "Declaration"],
visitor: ["id", "body"],
fields: {
declare: (0, _utils.validateOptional)(bool),
global: (0, _utils.validateOptional)(bool),
id: (0, _utils.validateType)(["Identifier", "StringLiteral"]),
body: (0, _utils.validateType)(["TSModuleBlock", "TSModuleDeclaration"])
}
});
(0, _utils.default)("TSModuleBlock", {
aliases: ["Scopable", "Block", "BlockParent"],
visitor: ["body"],
fields: {
body: (0, _utils.validateArrayOfType)("Statement")
}
});
(0, _utils.default)("TSImportType", {
aliases: ["TSType"],
visitor: ["argument", "qualifier", "typeParameters"],
fields: {
argument: (0, _utils.validateType)("StringLiteral"),
qualifier: (0, _utils.validateOptionalType)("TSEntityName"),
typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterInstantiation")
}
});
(0, _utils.default)("TSImportEqualsDeclaration", {
aliases: ["Statement"],
visitor: ["id", "moduleReference"],
fields: {
isExport: (0, _utils.validate)(bool),
id: (0, _utils.validateType)("Identifier"),
moduleReference: (0, _utils.validateType)(["TSEntityName", "TSExternalModuleReference"]),
importKind: {
validate: (0, _utils.assertOneOf)("type", "value"),
optional: true
}
}
});
(0, _utils.default)("TSExternalModuleReference", {
visitor: ["expression"],
fields: {
expression: (0, _utils.validateType)("StringLiteral")
}
});
(0, _utils.default)("TSNonNullExpression", {
aliases: ["Expression"],
visitor: ["expression"],
fields: {
expression: (0, _utils.validateType)("Expression")
}
});
(0, _utils.default)("TSExportAssignment", {
aliases: ["Statement"],
visitor: ["expression"],
fields: {
expression: (0, _utils.validateType)("Expression")
}
});
(0, _utils.default)("TSNamespaceExportDeclaration", {
aliases: ["Statement"],
visitor: ["id"],
fields: {
id: (0, _utils.validateType)("Identifier")
}
});
(0, _utils.default)("TSTypeAnnotation", {
visitor: ["typeAnnotation"],
fields: {
typeAnnotation: {
validate: (0, _utils.assertNodeType)("TSType")
}
}
});
(0, _utils.default)("TSTypeParameterInstantiation", {
visitor: ["params"],
fields: {
params: {
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("TSType")))
}
}
});
(0, _utils.default)("TSTypeParameterDeclaration", {
visitor: ["params"],
fields: {
params: {
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("TSTypeParameter")))
}
}
});
(0, _utils.default)("TSTypeParameter", {
builder: ["constraint", "default", "name"],
visitor: ["constraint", "default"],
fields: {
name: {
validate: (0, _utils.assertValueType)("string")
},
constraint: {
validate: (0, _utils.assertNodeType)("TSType"),
optional: true
},
default: {
validate: (0, _utils.assertNodeType)("TSType"),
optional: true
}
}
});
(function (exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "VISITOR_KEYS", {
enumerable: true,
get: function () {
return _utils.VISITOR_KEYS;
}
});
Object.defineProperty(exports, "ALIAS_KEYS", {
enumerable: true,
get: function () {
return _utils.ALIAS_KEYS;
}
});
Object.defineProperty(exports, "FLIPPED_ALIAS_KEYS", {
enumerable: true,
get: function () {
return _utils.FLIPPED_ALIAS_KEYS;
}
});
Object.defineProperty(exports, "NODE_FIELDS", {
enumerable: true,
get: function () {
return _utils.NODE_FIELDS;
}
});
Object.defineProperty(exports, "BUILDER_KEYS", {
enumerable: true,
get: function () {
return _utils.BUILDER_KEYS;
}
});
Object.defineProperty(exports, "DEPRECATED_KEYS", {
enumerable: true,
get: function () {
return _utils.DEPRECATED_KEYS;
}
});
Object.defineProperty(exports, "NODE_PARENT_VALIDATIONS", {
enumerable: true,
get: function () {
return _utils.NODE_PARENT_VALIDATIONS;
}
});
Object.defineProperty(exports, "PLACEHOLDERS", {
enumerable: true,
get: function () {
return _placeholders.PLACEHOLDERS;
}
});
Object.defineProperty(exports, "PLACEHOLDERS_ALIAS", {
enumerable: true,
get: function () {
return _placeholders.PLACEHOLDERS_ALIAS;
}
});
Object.defineProperty(exports, "PLACEHOLDERS_FLIPPED_ALIAS", {
enumerable: true,
get: function () {
return _placeholders.PLACEHOLDERS_FLIPPED_ALIAS;
}
});
exports.TYPES = void 0;
var _utils = utils;
var _placeholders = placeholders;
const TYPES = Object.keys(_utils.VISITOR_KEYS).concat(Object.keys(_utils.FLIPPED_ALIAS_KEYS)).concat(Object.keys(_utils.DEPRECATED_KEYS));
exports.TYPES = TYPES;
}(definitions));
Object.defineProperty(builder$1, "__esModule", {
value: true
});
builder$1.default = builder;
var _definitions$6 = definitions;
var _validate = validate$2;
function builder(type, ...args) {
const keys = _definitions$6.BUILDER_KEYS[type];
const countArgs = args.length;
if (countArgs > keys.length) {
throw new Error(`${type}: Too many arguments passed. Received ${countArgs} but can receive no more than ${keys.length}`);
}
const node = {
type
};
let i = 0;
keys.forEach(key => {
const field = _definitions$6.NODE_FIELDS[type][key];
let arg;
if (i < countArgs) arg = args[i];
if (arg === undefined) {
arg = Array.isArray(field.default) ? [] : field.default;
}
node[key] = arg;
i++;
});
for (const key of Object.keys(node)) {
(0, _validate.default)(node, key, node[key]);
}
return node;
}
Object.defineProperty(generated$3, "__esModule", {
value: true
});
generated$3.arrayExpression = arrayExpression;
generated$3.assignmentExpression = assignmentExpression;
generated$3.binaryExpression = binaryExpression;
generated$3.interpreterDirective = interpreterDirective;
generated$3.directive = directive;
generated$3.directiveLiteral = directiveLiteral;
generated$3.blockStatement = blockStatement;
generated$3.breakStatement = breakStatement;
generated$3.callExpression = callExpression;
generated$3.catchClause = catchClause;
generated$3.conditionalExpression = conditionalExpression;
generated$3.continueStatement = continueStatement;
generated$3.debuggerStatement = debuggerStatement;
generated$3.doWhileStatement = doWhileStatement;
generated$3.emptyStatement = emptyStatement;
generated$3.expressionStatement = expressionStatement;
generated$3.file = file;
generated$3.forInStatement = forInStatement;
generated$3.forStatement = forStatement;
generated$3.functionDeclaration = functionDeclaration;
generated$3.functionExpression = functionExpression;
generated$3.identifier = identifier;
generated$3.ifStatement = ifStatement;
generated$3.labeledStatement = labeledStatement;
generated$3.stringLiteral = stringLiteral;
generated$3.numericLiteral = numericLiteral;
generated$3.nullLiteral = nullLiteral;
generated$3.booleanLiteral = booleanLiteral;
generated$3.regExpLiteral = regExpLiteral;
generated$3.logicalExpression = logicalExpression;
generated$3.memberExpression = memberExpression;
generated$3.newExpression = newExpression;
generated$3.program = program;
generated$3.objectExpression = objectExpression;
generated$3.objectMethod = objectMethod;
generated$3.objectProperty = objectProperty;
generated$3.restElement = restElement;
generated$3.returnStatement = returnStatement;
generated$3.sequenceExpression = sequenceExpression;
generated$3.parenthesizedExpression = parenthesizedExpression;
generated$3.switchCase = switchCase;
generated$3.switchStatement = switchStatement;
generated$3.thisExpression = thisExpression;
generated$3.throwStatement = throwStatement;
generated$3.tryStatement = tryStatement;
generated$3.unaryExpression = unaryExpression;
generated$3.updateExpression = updateExpression;
generated$3.variableDeclaration = variableDeclaration;
generated$3.variableDeclarator = variableDeclarator;
generated$3.whileStatement = whileStatement;
generated$3.withStatement = withStatement;
generated$3.assignmentPattern = assignmentPattern;
generated$3.arrayPattern = arrayPattern;
generated$3.arrowFunctionExpression = arrowFunctionExpression;
generated$3.classBody = classBody;
generated$3.classExpression = classExpression;
generated$3.classDeclaration = classDeclaration;
generated$3.exportAllDeclaration = exportAllDeclaration;
generated$3.exportDefaultDeclaration = exportDefaultDeclaration;
generated$3.exportNamedDeclaration = exportNamedDeclaration;
generated$3.exportSpecifier = exportSpecifier;
generated$3.forOfStatement = forOfStatement;
generated$3.importDeclaration = importDeclaration;
generated$3.importDefaultSpecifier = importDefaultSpecifier;
generated$3.importNamespaceSpecifier = importNamespaceSpecifier;
generated$3.importSpecifier = importSpecifier;
generated$3.metaProperty = metaProperty;
generated$3.classMethod = classMethod;
generated$3.objectPattern = objectPattern;
generated$3.spreadElement = spreadElement;
generated$3.super = _super;
generated$3.taggedTemplateExpression = taggedTemplateExpression;
generated$3.templateElement = templateElement;
generated$3.templateLiteral = templateLiteral;
generated$3.yieldExpression = yieldExpression;
generated$3.awaitExpression = awaitExpression;
generated$3.import = _import;
generated$3.bigIntLiteral = bigIntLiteral;
generated$3.exportNamespaceSpecifier = exportNamespaceSpecifier;
generated$3.optionalMemberExpression = optionalMemberExpression;
generated$3.optionalCallExpression = optionalCallExpression;
generated$3.classProperty = classProperty;
generated$3.classPrivateProperty = classPrivateProperty;
generated$3.classPrivateMethod = classPrivateMethod;
generated$3.privateName = privateName;
generated$3.anyTypeAnnotation = anyTypeAnnotation;
generated$3.arrayTypeAnnotation = arrayTypeAnnotation;
generated$3.booleanTypeAnnotation = booleanTypeAnnotation;
generated$3.booleanLiteralTypeAnnotation = booleanLiteralTypeAnnotation;
generated$3.nullLiteralTypeAnnotation = nullLiteralTypeAnnotation;
generated$3.classImplements = classImplements;
generated$3.declareClass = declareClass;
generated$3.declareFunction = declareFunction;
generated$3.declareInterface = declareInterface;
generated$3.declareModule = declareModule;
generated$3.declareModuleExports = declareModuleExports;
generated$3.declareTypeAlias = declareTypeAlias;
generated$3.declareOpaqueType = declareOpaqueType;
generated$3.declareVariable = declareVariable;
generated$3.declareExportDeclaration = declareExportDeclaration;
generated$3.declareExportAllDeclaration = declareExportAllDeclaration;
generated$3.declaredPredicate = declaredPredicate;
generated$3.existsTypeAnnotation = existsTypeAnnotation;
generated$3.functionTypeAnnotation = functionTypeAnnotation;
generated$3.functionTypeParam = functionTypeParam;
generated$3.genericTypeAnnotation = genericTypeAnnotation;
generated$3.inferredPredicate = inferredPredicate;
generated$3.interfaceExtends = interfaceExtends;
generated$3.interfaceDeclaration = interfaceDeclaration;
generated$3.interfaceTypeAnnotation = interfaceTypeAnnotation;
generated$3.intersectionTypeAnnotation = intersectionTypeAnnotation;
generated$3.mixedTypeAnnotation = mixedTypeAnnotation;
generated$3.emptyTypeAnnotation = emptyTypeAnnotation;
generated$3.nullableTypeAnnotation = nullableTypeAnnotation;
generated$3.numberLiteralTypeAnnotation = numberLiteralTypeAnnotation;
generated$3.numberTypeAnnotation = numberTypeAnnotation;
generated$3.objectTypeAnnotation = objectTypeAnnotation;
generated$3.objectTypeInternalSlot = objectTypeInternalSlot;
generated$3.objectTypeCallProperty = objectTypeCallProperty;
generated$3.objectTypeIndexer = objectTypeIndexer;
generated$3.objectTypeProperty = objectTypeProperty;
generated$3.objectTypeSpreadProperty = objectTypeSpreadProperty;
generated$3.opaqueType = opaqueType;
generated$3.qualifiedTypeIdentifier = qualifiedTypeIdentifier;
generated$3.stringLiteralTypeAnnotation = stringLiteralTypeAnnotation;
generated$3.stringTypeAnnotation = stringTypeAnnotation;
generated$3.symbolTypeAnnotation = symbolTypeAnnotation;
generated$3.thisTypeAnnotation = thisTypeAnnotation;
generated$3.tupleTypeAnnotation = tupleTypeAnnotation;
generated$3.typeofTypeAnnotation = typeofTypeAnnotation;
generated$3.typeAlias = typeAlias;
generated$3.typeAnnotation = typeAnnotation;
generated$3.typeCastExpression = typeCastExpression;
generated$3.typeParameter = typeParameter;
generated$3.typeParameterDeclaration = typeParameterDeclaration;
generated$3.typeParameterInstantiation = typeParameterInstantiation;
generated$3.unionTypeAnnotation = unionTypeAnnotation;
generated$3.variance = variance;
generated$3.voidTypeAnnotation = voidTypeAnnotation;
generated$3.enumDeclaration = enumDeclaration;
generated$3.enumBooleanBody = enumBooleanBody;
generated$3.enumNumberBody = enumNumberBody;
generated$3.enumStringBody = enumStringBody;
generated$3.enumSymbolBody = enumSymbolBody;
generated$3.enumBooleanMember = enumBooleanMember;
generated$3.enumNumberMember = enumNumberMember;
generated$3.enumStringMember = enumStringMember;
generated$3.enumDefaultedMember = enumDefaultedMember;
generated$3.indexedAccessType = indexedAccessType;
generated$3.optionalIndexedAccessType = optionalIndexedAccessType;
generated$3.jSXAttribute = generated$3.jsxAttribute = jsxAttribute;
generated$3.jSXClosingElement = generated$3.jsxClosingElement = jsxClosingElement;
generated$3.jSXElement = generated$3.jsxElement = jsxElement;
generated$3.jSXEmptyExpression = generated$3.jsxEmptyExpression = jsxEmptyExpression;
generated$3.jSXExpressionContainer = generated$3.jsxExpressionContainer = jsxExpressionContainer;
generated$3.jSXSpreadChild = generated$3.jsxSpreadChild = jsxSpreadChild;
generated$3.jSXIdentifier = generated$3.jsxIdentifier = jsxIdentifier;
generated$3.jSXMemberExpression = generated$3.jsxMemberExpression = jsxMemberExpression;
generated$3.jSXNamespacedName = generated$3.jsxNamespacedName = jsxNamespacedName;
generated$3.jSXOpeningElement = generated$3.jsxOpeningElement = jsxOpeningElement;
generated$3.jSXSpreadAttribute = generated$3.jsxSpreadAttribute = jsxSpreadAttribute;
generated$3.jSXText = generated$3.jsxText = jsxText;
generated$3.jSXFragment = generated$3.jsxFragment = jsxFragment;
generated$3.jSXOpeningFragment = generated$3.jsxOpeningFragment = jsxOpeningFragment;
generated$3.jSXClosingFragment = generated$3.jsxClosingFragment = jsxClosingFragment;
generated$3.noop = noop;
generated$3.placeholder = placeholder;
generated$3.v8IntrinsicIdentifier = v8IntrinsicIdentifier;
generated$3.argumentPlaceholder = argumentPlaceholder;
generated$3.bindExpression = bindExpression;
generated$3.importAttribute = importAttribute;
generated$3.decorator = decorator;
generated$3.doExpression = doExpression;
generated$3.exportDefaultSpecifier = exportDefaultSpecifier;
generated$3.recordExpression = recordExpression;
generated$3.tupleExpression = tupleExpression;
generated$3.decimalLiteral = decimalLiteral;
generated$3.staticBlock = staticBlock;
generated$3.moduleExpression = moduleExpression;
generated$3.topicReference = topicReference;
generated$3.pipelineTopicExpression = pipelineTopicExpression;
generated$3.pipelineBareFunction = pipelineBareFunction;
generated$3.pipelinePrimaryTopicReference = pipelinePrimaryTopicReference;
generated$3.tSParameterProperty = generated$3.tsParameterProperty = tsParameterProperty;
generated$3.tSDeclareFunction = generated$3.tsDeclareFunction = tsDeclareFunction;
generated$3.tSDeclareMethod = generated$3.tsDeclareMethod = tsDeclareMethod;
generated$3.tSQualifiedName = generated$3.tsQualifiedName = tsQualifiedName;
generated$3.tSCallSignatureDeclaration = generated$3.tsCallSignatureDeclaration = tsCallSignatureDeclaration;
generated$3.tSConstructSignatureDeclaration = generated$3.tsConstructSignatureDeclaration = tsConstructSignatureDeclaration;
generated$3.tSPropertySignature = generated$3.tsPropertySignature = tsPropertySignature;
generated$3.tSMethodSignature = generated$3.tsMethodSignature = tsMethodSignature;
generated$3.tSIndexSignature = generated$3.tsIndexSignature = tsIndexSignature;
generated$3.tSAnyKeyword = generated$3.tsAnyKeyword = tsAnyKeyword;
generated$3.tSBooleanKeyword = generated$3.tsBooleanKeyword = tsBooleanKeyword;
generated$3.tSBigIntKeyword = generated$3.tsBigIntKeyword = tsBigIntKeyword;
generated$3.tSIntrinsicKeyword = generated$3.tsIntrinsicKeyword = tsIntrinsicKeyword;
generated$3.tSNeverKeyword = generated$3.tsNeverKeyword = tsNeverKeyword;
generated$3.tSNullKeyword = generated$3.tsNullKeyword = tsNullKeyword;
generated$3.tSNumberKeyword = generated$3.tsNumberKeyword = tsNumberKeyword;
generated$3.tSObjectKeyword = generated$3.tsObjectKeyword = tsObjectKeyword;
generated$3.tSStringKeyword = generated$3.tsStringKeyword = tsStringKeyword;
generated$3.tSSymbolKeyword = generated$3.tsSymbolKeyword = tsSymbolKeyword;
generated$3.tSUndefinedKeyword = generated$3.tsUndefinedKeyword = tsUndefinedKeyword;
generated$3.tSUnknownKeyword = generated$3.tsUnknownKeyword = tsUnknownKeyword;
generated$3.tSVoidKeyword = generated$3.tsVoidKeyword = tsVoidKeyword;
generated$3.tSThisType = generated$3.tsThisType = tsThisType;
generated$3.tSFunctionType = generated$3.tsFunctionType = tsFunctionType;
generated$3.tSConstructorType = generated$3.tsConstructorType = tsConstructorType;
generated$3.tSTypeReference = generated$3.tsTypeReference = tsTypeReference;
generated$3.tSTypePredicate = generated$3.tsTypePredicate = tsTypePredicate;
generated$3.tSTypeQuery = generated$3.tsTypeQuery = tsTypeQuery;
generated$3.tSTypeLiteral = generated$3.tsTypeLiteral = tsTypeLiteral;
generated$3.tSArrayType = generated$3.tsArrayType = tsArrayType;
generated$3.tSTupleType = generated$3.tsTupleType = tsTupleType;
generated$3.tSOptionalType = generated$3.tsOptionalType = tsOptionalType;
generated$3.tSRestType = generated$3.tsRestType = tsRestType;
generated$3.tSNamedTupleMember = generated$3.tsNamedTupleMember = tsNamedTupleMember;
generated$3.tSUnionType = generated$3.tsUnionType = tsUnionType;
generated$3.tSIntersectionType = generated$3.tsIntersectionType = tsIntersectionType;
generated$3.tSConditionalType = generated$3.tsConditionalType = tsConditionalType;
generated$3.tSInferType = generated$3.tsInferType = tsInferType;
generated$3.tSParenthesizedType = generated$3.tsParenthesizedType = tsParenthesizedType;
generated$3.tSTypeOperator = generated$3.tsTypeOperator = tsTypeOperator;
generated$3.tSIndexedAccessType = generated$3.tsIndexedAccessType = tsIndexedAccessType;
generated$3.tSMappedType = generated$3.tsMappedType = tsMappedType;
generated$3.tSLiteralType = generated$3.tsLiteralType = tsLiteralType;
generated$3.tSExpressionWithTypeArguments = generated$3.tsExpressionWithTypeArguments = tsExpressionWithTypeArguments;
generated$3.tSInterfaceDeclaration = generated$3.tsInterfaceDeclaration = tsInterfaceDeclaration;
generated$3.tSInterfaceBody = generated$3.tsInterfaceBody = tsInterfaceBody;
generated$3.tSTypeAliasDeclaration = generated$3.tsTypeAliasDeclaration = tsTypeAliasDeclaration;
generated$3.tSAsExpression = generated$3.tsAsExpression = tsAsExpression;
generated$3.tSTypeAssertion = generated$3.tsTypeAssertion = tsTypeAssertion;
generated$3.tSEnumDeclaration = generated$3.tsEnumDeclaration = tsEnumDeclaration;
generated$3.tSEnumMember = generated$3.tsEnumMember = tsEnumMember;
generated$3.tSModuleDeclaration = generated$3.tsModuleDeclaration = tsModuleDeclaration;
generated$3.tSModuleBlock = generated$3.tsModuleBlock = tsModuleBlock;
generated$3.tSImportType = generated$3.tsImportType = tsImportType;
generated$3.tSImportEqualsDeclaration = generated$3.tsImportEqualsDeclaration = tsImportEqualsDeclaration;
generated$3.tSExternalModuleReference = generated$3.tsExternalModuleReference = tsExternalModuleReference;
generated$3.tSNonNullExpression = generated$3.tsNonNullExpression = tsNonNullExpression;
generated$3.tSExportAssignment = generated$3.tsExportAssignment = tsExportAssignment;
generated$3.tSNamespaceExportDeclaration = generated$3.tsNamespaceExportDeclaration = tsNamespaceExportDeclaration;
generated$3.tSTypeAnnotation = generated$3.tsTypeAnnotation = tsTypeAnnotation;
generated$3.tSTypeParameterInstantiation = generated$3.tsTypeParameterInstantiation = tsTypeParameterInstantiation;
generated$3.tSTypeParameterDeclaration = generated$3.tsTypeParameterDeclaration = tsTypeParameterDeclaration;
generated$3.tSTypeParameter = generated$3.tsTypeParameter = tsTypeParameter;
generated$3.numberLiteral = NumberLiteral;
generated$3.regexLiteral = RegexLiteral;
generated$3.restProperty = RestProperty;
generated$3.spreadProperty = SpreadProperty;
var _builder = builder$1;
function arrayExpression(elements) {
return (0, _builder.default)("ArrayExpression", ...arguments);
}
function assignmentExpression(operator, left, right) {
return (0, _builder.default)("AssignmentExpression", ...arguments);
}
function binaryExpression(operator, left, right) {
return (0, _builder.default)("BinaryExpression", ...arguments);
}
function interpreterDirective(value) {
return (0, _builder.default)("InterpreterDirective", ...arguments);
}
function directive(value) {
return (0, _builder.default)("Directive", ...arguments);
}
function directiveLiteral(value) {
return (0, _builder.default)("DirectiveLiteral", ...arguments);
}
function blockStatement(body, directives) {
return (0, _builder.default)("BlockStatement", ...arguments);
}
function breakStatement(label) {
return (0, _builder.default)("BreakStatement", ...arguments);
}
function callExpression(callee, _arguments) {
return (0, _builder.default)("CallExpression", ...arguments);
}
function catchClause(param, body) {
return (0, _builder.default)("CatchClause", ...arguments);
}
function conditionalExpression(test, consequent, alternate) {
return (0, _builder.default)("ConditionalExpression", ...arguments);
}
function continueStatement(label) {
return (0, _builder.default)("ContinueStatement", ...arguments);
}
function debuggerStatement() {
return (0, _builder.default)("DebuggerStatement", ...arguments);
}
function doWhileStatement(test, body) {
return (0, _builder.default)("DoWhileStatement", ...arguments);
}
function emptyStatement() {
return (0, _builder.default)("EmptyStatement", ...arguments);
}
function expressionStatement(expression) {
return (0, _builder.default)("ExpressionStatement", ...arguments);
}
function file(program, comments, tokens) {
return (0, _builder.default)("File", ...arguments);
}
function forInStatement(left, right, body) {
return (0, _builder.default)("ForInStatement", ...arguments);
}
function forStatement(init, test, update, body) {
return (0, _builder.default)("ForStatement", ...arguments);
}
function functionDeclaration(id, params, body, generator, async) {
return (0, _builder.default)("FunctionDeclaration", ...arguments);
}
function functionExpression(id, params, body, generator, async) {
return (0, _builder.default)("FunctionExpression", ...arguments);
}
function identifier(name) {
return (0, _builder.default)("Identifier", ...arguments);
}
function ifStatement(test, consequent, alternate) {
return (0, _builder.default)("IfStatement", ...arguments);
}
function labeledStatement(label, body) {
return (0, _builder.default)("LabeledStatement", ...arguments);
}
function stringLiteral(value) {
return (0, _builder.default)("StringLiteral", ...arguments);
}
function numericLiteral(value) {
return (0, _builder.default)("NumericLiteral", ...arguments);
}
function nullLiteral() {
return (0, _builder.default)("NullLiteral", ...arguments);
}
function booleanLiteral(value) {
return (0, _builder.default)("BooleanLiteral", ...arguments);
}
function regExpLiteral(pattern, flags) {
return (0, _builder.default)("RegExpLiteral", ...arguments);
}
function logicalExpression(operator, left, right) {
return (0, _builder.default)("LogicalExpression", ...arguments);
}
function memberExpression(object, property, computed, optional) {
return (0, _builder.default)("MemberExpression", ...arguments);
}
function newExpression(callee, _arguments) {
return (0, _builder.default)("NewExpression", ...arguments);
}
function program(body, directives, sourceType, interpreter) {
return (0, _builder.default)("Program", ...arguments);
}
function objectExpression(properties) {
return (0, _builder.default)("ObjectExpression", ...arguments);
}
function objectMethod(kind, key, params, body, computed, generator, async) {
return (0, _builder.default)("ObjectMethod", ...arguments);
}
function objectProperty(key, value, computed, shorthand, decorators) {
return (0, _builder.default)("ObjectProperty", ...arguments);
}
function restElement(argument) {
return (0, _builder.default)("RestElement", ...arguments);
}
function returnStatement(argument) {
return (0, _builder.default)("ReturnStatement", ...arguments);
}
function sequenceExpression(expressions) {
return (0, _builder.default)("SequenceExpression", ...arguments);
}
function parenthesizedExpression(expression) {
return (0, _builder.default)("ParenthesizedExpression", ...arguments);
}
function switchCase(test, consequent) {
return (0, _builder.default)("SwitchCase", ...arguments);
}
function switchStatement(discriminant, cases) {
return (0, _builder.default)("SwitchStatement", ...arguments);
}
function thisExpression() {
return (0, _builder.default)("ThisExpression", ...arguments);
}
function throwStatement(argument) {
return (0, _builder.default)("ThrowStatement", ...arguments);
}
function tryStatement(block, handler, finalizer) {
return (0, _builder.default)("TryStatement", ...arguments);
}
function unaryExpression(operator, argument, prefix) {
return (0, _builder.default)("UnaryExpression", ...arguments);
}
function updateExpression(operator, argument, prefix) {
return (0, _builder.default)("UpdateExpression", ...arguments);
}
function variableDeclaration(kind, declarations) {
return (0, _builder.default)("VariableDeclaration", ...arguments);
}
function variableDeclarator(id, init) {
return (0, _builder.default)("VariableDeclarator", ...arguments);
}
function whileStatement(test, body) {
return (0, _builder.default)("WhileStatement", ...arguments);
}
function withStatement(object, body) {
return (0, _builder.default)("WithStatement", ...arguments);
}
function assignmentPattern(left, right) {
return (0, _builder.default)("AssignmentPattern", ...arguments);
}
function arrayPattern(elements) {
return (0, _builder.default)("ArrayPattern", ...arguments);
}
function arrowFunctionExpression(params, body, async) {
return (0, _builder.default)("ArrowFunctionExpression", ...arguments);
}
function classBody(body) {
return (0, _builder.default)("ClassBody", ...arguments);
}
function classExpression(id, superClass, body, decorators) {
return (0, _builder.default)("ClassExpression", ...arguments);
}
function classDeclaration(id, superClass, body, decorators) {
return (0, _builder.default)("ClassDeclaration", ...arguments);
}
function exportAllDeclaration(source) {
return (0, _builder.default)("ExportAllDeclaration", ...arguments);
}
function exportDefaultDeclaration(declaration) {
return (0, _builder.default)("ExportDefaultDeclaration", ...arguments);
}
function exportNamedDeclaration(declaration, specifiers, source) {
return (0, _builder.default)("ExportNamedDeclaration", ...arguments);
}
function exportSpecifier(local, exported) {
return (0, _builder.default)("ExportSpecifier", ...arguments);
}
function forOfStatement(left, right, body, _await) {
return (0, _builder.default)("ForOfStatement", ...arguments);
}
function importDeclaration(specifiers, source) {
return (0, _builder.default)("ImportDeclaration", ...arguments);
}
function importDefaultSpecifier(local) {
return (0, _builder.default)("ImportDefaultSpecifier", ...arguments);
}
function importNamespaceSpecifier(local) {
return (0, _builder.default)("ImportNamespaceSpecifier", ...arguments);
}
function importSpecifier(local, imported) {
return (0, _builder.default)("ImportSpecifier", ...arguments);
}
function metaProperty(meta, property) {
return (0, _builder.default)("MetaProperty", ...arguments);
}
function classMethod(kind, key, params, body, computed, _static, generator, async) {
return (0, _builder.default)("ClassMethod", ...arguments);
}
function objectPattern(properties) {
return (0, _builder.default)("ObjectPattern", ...arguments);
}
function spreadElement(argument) {
return (0, _builder.default)("SpreadElement", ...arguments);
}
function _super() {
return (0, _builder.default)("Super", ...arguments);
}
function taggedTemplateExpression(tag, quasi) {
return (0, _builder.default)("TaggedTemplateExpression", ...arguments);
}
function templateElement(value, tail) {
return (0, _builder.default)("TemplateElement", ...arguments);
}
function templateLiteral(quasis, expressions) {
return (0, _builder.default)("TemplateLiteral", ...arguments);
}
function yieldExpression(argument, delegate) {
return (0, _builder.default)("YieldExpression", ...arguments);
}
function awaitExpression(argument) {
return (0, _builder.default)("AwaitExpression", ...arguments);
}
function _import() {
return (0, _builder.default)("Import", ...arguments);
}
function bigIntLiteral(value) {
return (0, _builder.default)("BigIntLiteral", ...arguments);
}
function exportNamespaceSpecifier(exported) {
return (0, _builder.default)("ExportNamespaceSpecifier", ...arguments);
}
function optionalMemberExpression(object, property, computed, optional) {
return (0, _builder.default)("OptionalMemberExpression", ...arguments);
}
function optionalCallExpression(callee, _arguments, optional) {
return (0, _builder.default)("OptionalCallExpression", ...arguments);
}
function classProperty(key, value, typeAnnotation, decorators, computed, _static) {
return (0, _builder.default)("ClassProperty", ...arguments);
}
function classPrivateProperty(key, value, decorators, _static) {
return (0, _builder.default)("ClassPrivateProperty", ...arguments);
}
function classPrivateMethod(kind, key, params, body, _static) {
return (0, _builder.default)("ClassPrivateMethod", ...arguments);
}
function privateName(id) {
return (0, _builder.default)("PrivateName", ...arguments);
}
function anyTypeAnnotation() {
return (0, _builder.default)("AnyTypeAnnotation", ...arguments);
}
function arrayTypeAnnotation(elementType) {
return (0, _builder.default)("ArrayTypeAnnotation", ...arguments);
}
function booleanTypeAnnotation() {
return (0, _builder.default)("BooleanTypeAnnotation", ...arguments);
}
function booleanLiteralTypeAnnotation(value) {
return (0, _builder.default)("BooleanLiteralTypeAnnotation", ...arguments);
}
function nullLiteralTypeAnnotation() {
return (0, _builder.default)("NullLiteralTypeAnnotation", ...arguments);
}
function classImplements(id, typeParameters) {
return (0, _builder.default)("ClassImplements", ...arguments);
}
function declareClass(id, typeParameters, _extends, body) {
return (0, _builder.default)("DeclareClass", ...arguments);
}
function declareFunction(id) {
return (0, _builder.default)("DeclareFunction", ...arguments);
}
function declareInterface(id, typeParameters, _extends, body) {
return (0, _builder.default)("DeclareInterface", ...arguments);
}
function declareModule(id, body, kind) {
return (0, _builder.default)("DeclareModule", ...arguments);
}
function declareModuleExports(typeAnnotation) {
return (0, _builder.default)("DeclareModuleExports", ...arguments);
}
function declareTypeAlias(id, typeParameters, right) {
return (0, _builder.default)("DeclareTypeAlias", ...arguments);
}
function declareOpaqueType(id, typeParameters, supertype) {
return (0, _builder.default)("DeclareOpaqueType", ...arguments);
}
function declareVariable(id) {
return (0, _builder.default)("DeclareVariable", ...arguments);
}
function declareExportDeclaration(declaration, specifiers, source) {
return (0, _builder.default)("DeclareExportDeclaration", ...arguments);
}
function declareExportAllDeclaration(source) {
return (0, _builder.default)("DeclareExportAllDeclaration", ...arguments);
}
function declaredPredicate(value) {
return (0, _builder.default)("DeclaredPredicate", ...arguments);
}
function existsTypeAnnotation() {
return (0, _builder.default)("ExistsTypeAnnotation", ...arguments);
}
function functionTypeAnnotation(typeParameters, params, rest, returnType) {
return (0, _builder.default)("FunctionTypeAnnotation", ...arguments);
}
function functionTypeParam(name, typeAnnotation) {
return (0, _builder.default)("FunctionTypeParam", ...arguments);
}
function genericTypeAnnotation(id, typeParameters) {
return (0, _builder.default)("GenericTypeAnnotation", ...arguments);
}
function inferredPredicate() {
return (0, _builder.default)("InferredPredicate", ...arguments);
}
function interfaceExtends(id, typeParameters) {
return (0, _builder.default)("InterfaceExtends", ...arguments);
}
function interfaceDeclaration(id, typeParameters, _extends, body) {
return (0, _builder.default)("InterfaceDeclaration", ...arguments);
}
function interfaceTypeAnnotation(_extends, body) {
return (0, _builder.default)("InterfaceTypeAnnotation", ...arguments);
}
function intersectionTypeAnnotation(types) {
return (0, _builder.default)("IntersectionTypeAnnotation", ...arguments);
}
function mixedTypeAnnotation() {
return (0, _builder.default)("MixedTypeAnnotation", ...arguments);
}
function emptyTypeAnnotation() {
return (0, _builder.default)("EmptyTypeAnnotation", ...arguments);
}
function nullableTypeAnnotation(typeAnnotation) {
return (0, _builder.default)("NullableTypeAnnotation", ...arguments);
}
function numberLiteralTypeAnnotation(value) {
return (0, _builder.default)("NumberLiteralTypeAnnotation", ...arguments);
}
function numberTypeAnnotation() {
return (0, _builder.default)("NumberTypeAnnotation", ...arguments);
}
function objectTypeAnnotation(properties, indexers, callProperties, internalSlots, exact) {
return (0, _builder.default)("ObjectTypeAnnotation", ...arguments);
}
function objectTypeInternalSlot(id, value, optional, _static, method) {
return (0, _builder.default)("ObjectTypeInternalSlot", ...arguments);
}
function objectTypeCallProperty(value) {
return (0, _builder.default)("ObjectTypeCallProperty", ...arguments);
}
function objectTypeIndexer(id, key, value, variance) {
return (0, _builder.default)("ObjectTypeIndexer", ...arguments);
}
function objectTypeProperty(key, value, variance) {
return (0, _builder.default)("ObjectTypeProperty", ...arguments);
}
function objectTypeSpreadProperty(argument) {
return (0, _builder.default)("ObjectTypeSpreadProperty", ...arguments);
}
function opaqueType(id, typeParameters, supertype, impltype) {
return (0, _builder.default)("OpaqueType", ...arguments);
}
function qualifiedTypeIdentifier(id, qualification) {
return (0, _builder.default)("QualifiedTypeIdentifier", ...arguments);
}
function stringLiteralTypeAnnotation(value) {
return (0, _builder.default)("StringLiteralTypeAnnotation", ...arguments);
}
function stringTypeAnnotation() {
return (0, _builder.default)("StringTypeAnnotation", ...arguments);
}
function symbolTypeAnnotation() {
return (0, _builder.default)("SymbolTypeAnnotation", ...arguments);
}
function thisTypeAnnotation() {
return (0, _builder.default)("ThisTypeAnnotation", ...arguments);
}
function tupleTypeAnnotation(types) {
return (0, _builder.default)("TupleTypeAnnotation", ...arguments);
}
function typeofTypeAnnotation(argument) {
return (0, _builder.default)("TypeofTypeAnnotation", ...arguments);
}
function typeAlias(id, typeParameters, right) {
return (0, _builder.default)("TypeAlias", ...arguments);
}
function typeAnnotation(typeAnnotation) {
return (0, _builder.default)("TypeAnnotation", ...arguments);
}
function typeCastExpression(expression, typeAnnotation) {
return (0, _builder.default)("TypeCastExpression", ...arguments);
}
function typeParameter(bound, _default, variance) {
return (0, _builder.default)("TypeParameter", ...arguments);
}
function typeParameterDeclaration(params) {
return (0, _builder.default)("TypeParameterDeclaration", ...arguments);
}
function typeParameterInstantiation(params) {
return (0, _builder.default)("TypeParameterInstantiation", ...arguments);
}
function unionTypeAnnotation(types) {
return (0, _builder.default)("UnionTypeAnnotation", ...arguments);
}
function variance(kind) {
return (0, _builder.default)("Variance", ...arguments);
}
function voidTypeAnnotation() {
return (0, _builder.default)("VoidTypeAnnotation", ...arguments);
}
function enumDeclaration(id, body) {
return (0, _builder.default)("EnumDeclaration", ...arguments);
}
function enumBooleanBody(members) {
return (0, _builder.default)("EnumBooleanBody", ...arguments);
}
function enumNumberBody(members) {
return (0, _builder.default)("EnumNumberBody", ...arguments);
}
function enumStringBody(members) {
return (0, _builder.default)("EnumStringBody", ...arguments);
}
function enumSymbolBody(members) {
return (0, _builder.default)("EnumSymbolBody", ...arguments);
}
function enumBooleanMember(id) {
return (0, _builder.default)("EnumBooleanMember", ...arguments);
}
function enumNumberMember(id, init) {
return (0, _builder.default)("EnumNumberMember", ...arguments);
}
function enumStringMember(id, init) {
return (0, _builder.default)("EnumStringMember", ...arguments);
}
function enumDefaultedMember(id) {
return (0, _builder.default)("EnumDefaultedMember", ...arguments);
}
function indexedAccessType(objectType, indexType) {
return (0, _builder.default)("IndexedAccessType", ...arguments);
}
function optionalIndexedAccessType(objectType, indexType) {
return (0, _builder.default)("OptionalIndexedAccessType", ...arguments);
}
function jsxAttribute(name, value) {
return (0, _builder.default)("JSXAttribute", ...arguments);
}
function jsxClosingElement(name) {
return (0, _builder.default)("JSXClosingElement", ...arguments);
}
function jsxElement(openingElement, closingElement, children, selfClosing) {
return (0, _builder.default)("JSXElement", ...arguments);
}
function jsxEmptyExpression() {
return (0, _builder.default)("JSXEmptyExpression", ...arguments);
}
function jsxExpressionContainer(expression) {
return (0, _builder.default)("JSXExpressionContainer", ...arguments);
}
function jsxSpreadChild(expression) {
return (0, _builder.default)("JSXSpreadChild", ...arguments);
}
function jsxIdentifier(name) {
return (0, _builder.default)("JSXIdentifier", ...arguments);
}
function jsxMemberExpression(object, property) {
return (0, _builder.default)("JSXMemberExpression", ...arguments);
}
function jsxNamespacedName(namespace, name) {
return (0, _builder.default)("JSXNamespacedName", ...arguments);
}
function jsxOpeningElement(name, attributes, selfClosing) {
return (0, _builder.default)("JSXOpeningElement", ...arguments);
}
function jsxSpreadAttribute(argument) {
return (0, _builder.default)("JSXSpreadAttribute", ...arguments);
}
function jsxText(value) {
return (0, _builder.default)("JSXText", ...arguments);
}
function jsxFragment(openingFragment, closingFragment, children) {
return (0, _builder.default)("JSXFragment", ...arguments);
}
function jsxOpeningFragment() {
return (0, _builder.default)("JSXOpeningFragment", ...arguments);
}
function jsxClosingFragment() {
return (0, _builder.default)("JSXClosingFragment", ...arguments);
}
function noop() {
return (0, _builder.default)("Noop", ...arguments);
}
function placeholder(expectedNode, name) {
return (0, _builder.default)("Placeholder", ...arguments);
}
function v8IntrinsicIdentifier(name) {
return (0, _builder.default)("V8IntrinsicIdentifier", ...arguments);
}
function argumentPlaceholder() {
return (0, _builder.default)("ArgumentPlaceholder", ...arguments);
}
function bindExpression(object, callee) {
return (0, _builder.default)("BindExpression", ...arguments);
}
function importAttribute(key, value) {
return (0, _builder.default)("ImportAttribute", ...arguments);
}
function decorator(expression) {
return (0, _builder.default)("Decorator", ...arguments);
}
function doExpression(body, async) {
return (0, _builder.default)("DoExpression", ...arguments);
}
function exportDefaultSpecifier(exported) {
return (0, _builder.default)("ExportDefaultSpecifier", ...arguments);
}
function recordExpression(properties) {
return (0, _builder.default)("RecordExpression", ...arguments);
}
function tupleExpression(elements) {
return (0, _builder.default)("TupleExpression", ...arguments);
}
function decimalLiteral(value) {
return (0, _builder.default)("DecimalLiteral", ...arguments);
}
function staticBlock(body) {
return (0, _builder.default)("StaticBlock", ...arguments);
}
function moduleExpression(body) {
return (0, _builder.default)("ModuleExpression", ...arguments);
}
function topicReference() {
return (0, _builder.default)("TopicReference", ...arguments);
}
function pipelineTopicExpression(expression) {
return (0, _builder.default)("PipelineTopicExpression", ...arguments);
}
function pipelineBareFunction(callee) {
return (0, _builder.default)("PipelineBareFunction", ...arguments);
}
function pipelinePrimaryTopicReference() {
return (0, _builder.default)("PipelinePrimaryTopicReference", ...arguments);
}
function tsParameterProperty(parameter) {
return (0, _builder.default)("TSParameterProperty", ...arguments);
}
function tsDeclareFunction(id, typeParameters, params, returnType) {
return (0, _builder.default)("TSDeclareFunction", ...arguments);
}
function tsDeclareMethod(decorators, key, typeParameters, params, returnType) {
return (0, _builder.default)("TSDeclareMethod", ...arguments);
}
function tsQualifiedName(left, right) {
return (0, _builder.default)("TSQualifiedName", ...arguments);
}
function tsCallSignatureDeclaration(typeParameters, parameters, typeAnnotation) {
return (0, _builder.default)("TSCallSignatureDeclaration", ...arguments);
}
function tsConstructSignatureDeclaration(typeParameters, parameters, typeAnnotation) {
return (0, _builder.default)("TSConstructSignatureDeclaration", ...arguments);
}
function tsPropertySignature(key, typeAnnotation, initializer) {
return (0, _builder.default)("TSPropertySignature", ...arguments);
}
function tsMethodSignature(key, typeParameters, parameters, typeAnnotation) {
return (0, _builder.default)("TSMethodSignature", ...arguments);
}
function tsIndexSignature(parameters, typeAnnotation) {
return (0, _builder.default)("TSIndexSignature", ...arguments);
}
function tsAnyKeyword() {
return (0, _builder.default)("TSAnyKeyword", ...arguments);
}
function tsBooleanKeyword() {
return (0, _builder.default)("TSBooleanKeyword", ...arguments);
}
function tsBigIntKeyword() {
return (0, _builder.default)("TSBigIntKeyword", ...arguments);
}
function tsIntrinsicKeyword() {
return (0, _builder.default)("TSIntrinsicKeyword", ...arguments);
}
function tsNeverKeyword() {
return (0, _builder.default)("TSNeverKeyword", ...arguments);
}
function tsNullKeyword() {
return (0, _builder.default)("TSNullKeyword", ...arguments);
}
function tsNumberKeyword() {
return (0, _builder.default)("TSNumberKeyword", ...arguments);
}
function tsObjectKeyword() {
return (0, _builder.default)("TSObjectKeyword", ...arguments);
}
function tsStringKeyword() {
return (0, _builder.default)("TSStringKeyword", ...arguments);
}
function tsSymbolKeyword() {
return (0, _builder.default)("TSSymbolKeyword", ...arguments);
}
function tsUndefinedKeyword() {
return (0, _builder.default)("TSUndefinedKeyword", ...arguments);
}
function tsUnknownKeyword() {
return (0, _builder.default)("TSUnknownKeyword", ...arguments);
}
function tsVoidKeyword() {
return (0, _builder.default)("TSVoidKeyword", ...arguments);
}
function tsThisType() {
return (0, _builder.default)("TSThisType", ...arguments);
}
function tsFunctionType(typeParameters, parameters, typeAnnotation) {
return (0, _builder.default)("TSFunctionType", ...arguments);
}
function tsConstructorType(typeParameters, parameters, typeAnnotation) {
return (0, _builder.default)("TSConstructorType", ...arguments);
}
function tsTypeReference(typeName, typeParameters) {
return (0, _builder.default)("TSTypeReference", ...arguments);
}
function tsTypePredicate(parameterName, typeAnnotation, asserts) {
return (0, _builder.default)("TSTypePredicate", ...arguments);
}
function tsTypeQuery(exprName) {
return (0, _builder.default)("TSTypeQuery", ...arguments);
}
function tsTypeLiteral(members) {
return (0, _builder.default)("TSTypeLiteral", ...arguments);
}
function tsArrayType(elementType) {
return (0, _builder.default)("TSArrayType", ...arguments);
}
function tsTupleType(elementTypes) {
return (0, _builder.default)("TSTupleType", ...arguments);
}
function tsOptionalType(typeAnnotation) {
return (0, _builder.default)("TSOptionalType", ...arguments);
}
function tsRestType(typeAnnotation) {
return (0, _builder.default)("TSRestType", ...arguments);
}
function tsNamedTupleMember(label, elementType, optional) {
return (0, _builder.default)("TSNamedTupleMember", ...arguments);
}
function tsUnionType(types) {
return (0, _builder.default)("TSUnionType", ...arguments);
}
function tsIntersectionType(types) {
return (0, _builder.default)("TSIntersectionType", ...arguments);
}
function tsConditionalType(checkType, extendsType, trueType, falseType) {
return (0, _builder.default)("TSConditionalType", ...arguments);
}
function tsInferType(typeParameter) {
return (0, _builder.default)("TSInferType", ...arguments);
}
function tsParenthesizedType(typeAnnotation) {
return (0, _builder.default)("TSParenthesizedType", ...arguments);
}
function tsTypeOperator(typeAnnotation) {
return (0, _builder.default)("TSTypeOperator", ...arguments);
}
function tsIndexedAccessType(objectType, indexType) {
return (0, _builder.default)("TSIndexedAccessType", ...arguments);
}
function tsMappedType(typeParameter, typeAnnotation, nameType) {
return (0, _builder.default)("TSMappedType", ...arguments);
}
function tsLiteralType(literal) {
return (0, _builder.default)("TSLiteralType", ...arguments);
}
function tsExpressionWithTypeArguments(expression, typeParameters) {
return (0, _builder.default)("TSExpressionWithTypeArguments", ...arguments);
}
function tsInterfaceDeclaration(id, typeParameters, _extends, body) {
return (0, _builder.default)("TSInterfaceDeclaration", ...arguments);
}
function tsInterfaceBody(body) {
return (0, _builder.default)("TSInterfaceBody", ...arguments);
}
function tsTypeAliasDeclaration(id, typeParameters, typeAnnotation) {
return (0, _builder.default)("TSTypeAliasDeclaration", ...arguments);
}
function tsAsExpression(expression, typeAnnotation) {
return (0, _builder.default)("TSAsExpression", ...arguments);
}
function tsTypeAssertion(typeAnnotation, expression) {
return (0, _builder.default)("TSTypeAssertion", ...arguments);
}
function tsEnumDeclaration(id, members) {
return (0, _builder.default)("TSEnumDeclaration", ...arguments);
}
function tsEnumMember(id, initializer) {
return (0, _builder.default)("TSEnumMember", ...arguments);
}
function tsModuleDeclaration(id, body) {
return (0, _builder.default)("TSModuleDeclaration", ...arguments);
}
function tsModuleBlock(body) {
return (0, _builder.default)("TSModuleBlock", ...arguments);
}
function tsImportType(argument, qualifier, typeParameters) {
return (0, _builder.default)("TSImportType", ...arguments);
}
function tsImportEqualsDeclaration(id, moduleReference) {
return (0, _builder.default)("TSImportEqualsDeclaration", ...arguments);
}
function tsExternalModuleReference(expression) {
return (0, _builder.default)("TSExternalModuleReference", ...arguments);
}
function tsNonNullExpression(expression) {
return (0, _builder.default)("TSNonNullExpression", ...arguments);
}
function tsExportAssignment(expression) {
return (0, _builder.default)("TSExportAssignment", ...arguments);
}
function tsNamespaceExportDeclaration(id) {
return (0, _builder.default)("TSNamespaceExportDeclaration", ...arguments);
}
function tsTypeAnnotation(typeAnnotation) {
return (0, _builder.default)("TSTypeAnnotation", ...arguments);
}
function tsTypeParameterInstantiation(params) {
return (0, _builder.default)("TSTypeParameterInstantiation", ...arguments);
}
function tsTypeParameterDeclaration(params) {
return (0, _builder.default)("TSTypeParameterDeclaration", ...arguments);
}
function tsTypeParameter(constraint, _default, name) {
return (0, _builder.default)("TSTypeParameter", ...arguments);
}
function NumberLiteral(...args) {
console.trace("The node type NumberLiteral has been renamed to NumericLiteral");
return (0, _builder.default)("NumberLiteral", ...args);
}
function RegexLiteral(...args) {
console.trace("The node type RegexLiteral has been renamed to RegExpLiteral");
return (0, _builder.default)("RegexLiteral", ...args);
}
function RestProperty(...args) {
console.trace("The node type RestProperty has been renamed to RestElement");
return (0, _builder.default)("RestProperty", ...args);
}
function SpreadProperty(...args) {
console.trace("The node type SpreadProperty has been renamed to SpreadElement");
return (0, _builder.default)("SpreadProperty", ...args);
}
Object.defineProperty(cleanJSXElementLiteralChild$1, "__esModule", {
value: true
});
cleanJSXElementLiteralChild$1.default = cleanJSXElementLiteralChild;
var _generated$n = generated$3;
function cleanJSXElementLiteralChild(child, args) {
const lines = child.value.split(/\r\n|\n|\r/);
let lastNonEmptyLine = 0;
for (let i = 0; i < lines.length; i++) {
if (lines[i].match(/[^ \t]/)) {
lastNonEmptyLine = i;
}
}
let str = "";
for (let i = 0; i < lines.length; i++) {
const line = lines[i];
const isFirstLine = i === 0;
const isLastLine = i === lines.length - 1;
const isLastNonEmptyLine = i === lastNonEmptyLine;
let trimmedLine = line.replace(/\t/g, " ");
if (!isFirstLine) {
trimmedLine = trimmedLine.replace(/^[ ]+/, "");
}
if (!isLastLine) {
trimmedLine = trimmedLine.replace(/[ ]+$/, "");
}
if (trimmedLine) {
if (!isLastNonEmptyLine) {
trimmedLine += " ";
}
str += trimmedLine;
}
}
if (str) args.push((0, _generated$n.stringLiteral)(str));
}
Object.defineProperty(buildChildren$1, "__esModule", {
value: true
});
buildChildren$1.default = buildChildren;
var _generated$m = generated$4;
var _cleanJSXElementLiteralChild = cleanJSXElementLiteralChild$1;
function buildChildren(node) {
const elements = [];
for (let i = 0; i < node.children.length; i++) {
let child = node.children[i];
if ((0, _generated$m.isJSXText)(child)) {
(0, _cleanJSXElementLiteralChild.default)(child, elements);
continue;
}
if ((0, _generated$m.isJSXExpressionContainer)(child)) child = child.expression;
if ((0, _generated$m.isJSXEmptyExpression)(child)) continue;
elements.push(child);
}
return elements;
}
var assertNode$1 = {};
var isNode$1 = {};
Object.defineProperty(isNode$1, "__esModule", {
value: true
});
isNode$1.default = isNode;
var _definitions$5 = definitions;
function isNode(node) {
return !!(node && _definitions$5.VISITOR_KEYS[node.type]);
}
Object.defineProperty(assertNode$1, "__esModule", {
value: true
});
assertNode$1.default = assertNode;
var _isNode = isNode$1;
function assertNode(node) {
if (!(0, _isNode.default)(node)) {
var _node$type;
const type = (_node$type = node == null ? void 0 : node.type) != null ? _node$type : JSON.stringify(node);
throw new TypeError(`Not a valid node of type "${type}"`);
}
}
var generated$2 = {};
Object.defineProperty(generated$2, "__esModule", {
value: true
});
generated$2.assertArrayExpression = assertArrayExpression;
generated$2.assertAssignmentExpression = assertAssignmentExpression;
generated$2.assertBinaryExpression = assertBinaryExpression;
generated$2.assertInterpreterDirective = assertInterpreterDirective;
generated$2.assertDirective = assertDirective;
generated$2.assertDirectiveLiteral = assertDirectiveLiteral;
generated$2.assertBlockStatement = assertBlockStatement;
generated$2.assertBreakStatement = assertBreakStatement;
generated$2.assertCallExpression = assertCallExpression;
generated$2.assertCatchClause = assertCatchClause;
generated$2.assertConditionalExpression = assertConditionalExpression;
generated$2.assertContinueStatement = assertContinueStatement;
generated$2.assertDebuggerStatement = assertDebuggerStatement;
generated$2.assertDoWhileStatement = assertDoWhileStatement;
generated$2.assertEmptyStatement = assertEmptyStatement;
generated$2.assertExpressionStatement = assertExpressionStatement;
generated$2.assertFile = assertFile;
generated$2.assertForInStatement = assertForInStatement;
generated$2.assertForStatement = assertForStatement;
generated$2.assertFunctionDeclaration = assertFunctionDeclaration;
generated$2.assertFunctionExpression = assertFunctionExpression;
generated$2.assertIdentifier = assertIdentifier;
generated$2.assertIfStatement = assertIfStatement;
generated$2.assertLabeledStatement = assertLabeledStatement;
generated$2.assertStringLiteral = assertStringLiteral;
generated$2.assertNumericLiteral = assertNumericLiteral;
generated$2.assertNullLiteral = assertNullLiteral;
generated$2.assertBooleanLiteral = assertBooleanLiteral;
generated$2.assertRegExpLiteral = assertRegExpLiteral;
generated$2.assertLogicalExpression = assertLogicalExpression;
generated$2.assertMemberExpression = assertMemberExpression;
generated$2.assertNewExpression = assertNewExpression;
generated$2.assertProgram = assertProgram;
generated$2.assertObjectExpression = assertObjectExpression;
generated$2.assertObjectMethod = assertObjectMethod;
generated$2.assertObjectProperty = assertObjectProperty;
generated$2.assertRestElement = assertRestElement;
generated$2.assertReturnStatement = assertReturnStatement;
generated$2.assertSequenceExpression = assertSequenceExpression;
generated$2.assertParenthesizedExpression = assertParenthesizedExpression;
generated$2.assertSwitchCase = assertSwitchCase;
generated$2.assertSwitchStatement = assertSwitchStatement;
generated$2.assertThisExpression = assertThisExpression;
generated$2.assertThrowStatement = assertThrowStatement;
generated$2.assertTryStatement = assertTryStatement;
generated$2.assertUnaryExpression = assertUnaryExpression;
generated$2.assertUpdateExpression = assertUpdateExpression;
generated$2.assertVariableDeclaration = assertVariableDeclaration;
generated$2.assertVariableDeclarator = assertVariableDeclarator;
generated$2.assertWhileStatement = assertWhileStatement;
generated$2.assertWithStatement = assertWithStatement;
generated$2.assertAssignmentPattern = assertAssignmentPattern;
generated$2.assertArrayPattern = assertArrayPattern;
generated$2.assertArrowFunctionExpression = assertArrowFunctionExpression;
generated$2.assertClassBody = assertClassBody;
generated$2.assertClassExpression = assertClassExpression;
generated$2.assertClassDeclaration = assertClassDeclaration;
generated$2.assertExportAllDeclaration = assertExportAllDeclaration;
generated$2.assertExportDefaultDeclaration = assertExportDefaultDeclaration;
generated$2.assertExportNamedDeclaration = assertExportNamedDeclaration;
generated$2.assertExportSpecifier = assertExportSpecifier;
generated$2.assertForOfStatement = assertForOfStatement;
generated$2.assertImportDeclaration = assertImportDeclaration;
generated$2.assertImportDefaultSpecifier = assertImportDefaultSpecifier;
generated$2.assertImportNamespaceSpecifier = assertImportNamespaceSpecifier;
generated$2.assertImportSpecifier = assertImportSpecifier;
generated$2.assertMetaProperty = assertMetaProperty;
generated$2.assertClassMethod = assertClassMethod;
generated$2.assertObjectPattern = assertObjectPattern;
generated$2.assertSpreadElement = assertSpreadElement;
generated$2.assertSuper = assertSuper;
generated$2.assertTaggedTemplateExpression = assertTaggedTemplateExpression;
generated$2.assertTemplateElement = assertTemplateElement;
generated$2.assertTemplateLiteral = assertTemplateLiteral;
generated$2.assertYieldExpression = assertYieldExpression;
generated$2.assertAwaitExpression = assertAwaitExpression;
generated$2.assertImport = assertImport;
generated$2.assertBigIntLiteral = assertBigIntLiteral;
generated$2.assertExportNamespaceSpecifier = assertExportNamespaceSpecifier;
generated$2.assertOptionalMemberExpression = assertOptionalMemberExpression;
generated$2.assertOptionalCallExpression = assertOptionalCallExpression;
generated$2.assertClassProperty = assertClassProperty;
generated$2.assertClassPrivateProperty = assertClassPrivateProperty;
generated$2.assertClassPrivateMethod = assertClassPrivateMethod;
generated$2.assertPrivateName = assertPrivateName;
generated$2.assertAnyTypeAnnotation = assertAnyTypeAnnotation;
generated$2.assertArrayTypeAnnotation = assertArrayTypeAnnotation;
generated$2.assertBooleanTypeAnnotation = assertBooleanTypeAnnotation;
generated$2.assertBooleanLiteralTypeAnnotation = assertBooleanLiteralTypeAnnotation;
generated$2.assertNullLiteralTypeAnnotation = assertNullLiteralTypeAnnotation;
generated$2.assertClassImplements = assertClassImplements;
generated$2.assertDeclareClass = assertDeclareClass;
generated$2.assertDeclareFunction = assertDeclareFunction;
generated$2.assertDeclareInterface = assertDeclareInterface;
generated$2.assertDeclareModule = assertDeclareModule;
generated$2.assertDeclareModuleExports = assertDeclareModuleExports;
generated$2.assertDeclareTypeAlias = assertDeclareTypeAlias;
generated$2.assertDeclareOpaqueType = assertDeclareOpaqueType;
generated$2.assertDeclareVariable = assertDeclareVariable;
generated$2.assertDeclareExportDeclaration = assertDeclareExportDeclaration;
generated$2.assertDeclareExportAllDeclaration = assertDeclareExportAllDeclaration;
generated$2.assertDeclaredPredicate = assertDeclaredPredicate;
generated$2.assertExistsTypeAnnotation = assertExistsTypeAnnotation;
generated$2.assertFunctionTypeAnnotation = assertFunctionTypeAnnotation;
generated$2.assertFunctionTypeParam = assertFunctionTypeParam;
generated$2.assertGenericTypeAnnotation = assertGenericTypeAnnotation;
generated$2.assertInferredPredicate = assertInferredPredicate;
generated$2.assertInterfaceExtends = assertInterfaceExtends;
generated$2.assertInterfaceDeclaration = assertInterfaceDeclaration;
generated$2.assertInterfaceTypeAnnotation = assertInterfaceTypeAnnotation;
generated$2.assertIntersectionTypeAnnotation = assertIntersectionTypeAnnotation;
generated$2.assertMixedTypeAnnotation = assertMixedTypeAnnotation;
generated$2.assertEmptyTypeAnnotation = assertEmptyTypeAnnotation;
generated$2.assertNullableTypeAnnotation = assertNullableTypeAnnotation;
generated$2.assertNumberLiteralTypeAnnotation = assertNumberLiteralTypeAnnotation;
generated$2.assertNumberTypeAnnotation = assertNumberTypeAnnotation;
generated$2.assertObjectTypeAnnotation = assertObjectTypeAnnotation;
generated$2.assertObjectTypeInternalSlot = assertObjectTypeInternalSlot;
generated$2.assertObjectTypeCallProperty = assertObjectTypeCallProperty;
generated$2.assertObjectTypeIndexer = assertObjectTypeIndexer;
generated$2.assertObjectTypeProperty = assertObjectTypeProperty;
generated$2.assertObjectTypeSpreadProperty = assertObjectTypeSpreadProperty;
generated$2.assertOpaqueType = assertOpaqueType;
generated$2.assertQualifiedTypeIdentifier = assertQualifiedTypeIdentifier;
generated$2.assertStringLiteralTypeAnnotation = assertStringLiteralTypeAnnotation;
generated$2.assertStringTypeAnnotation = assertStringTypeAnnotation;
generated$2.assertSymbolTypeAnnotation = assertSymbolTypeAnnotation;
generated$2.assertThisTypeAnnotation = assertThisTypeAnnotation;
generated$2.assertTupleTypeAnnotation = assertTupleTypeAnnotation;
generated$2.assertTypeofTypeAnnotation = assertTypeofTypeAnnotation;
generated$2.assertTypeAlias = assertTypeAlias;
generated$2.assertTypeAnnotation = assertTypeAnnotation;
generated$2.assertTypeCastExpression = assertTypeCastExpression;
generated$2.assertTypeParameter = assertTypeParameter;
generated$2.assertTypeParameterDeclaration = assertTypeParameterDeclaration;
generated$2.assertTypeParameterInstantiation = assertTypeParameterInstantiation;
generated$2.assertUnionTypeAnnotation = assertUnionTypeAnnotation;
generated$2.assertVariance = assertVariance;
generated$2.assertVoidTypeAnnotation = assertVoidTypeAnnotation;
generated$2.assertEnumDeclaration = assertEnumDeclaration;
generated$2.assertEnumBooleanBody = assertEnumBooleanBody;
generated$2.assertEnumNumberBody = assertEnumNumberBody;
generated$2.assertEnumStringBody = assertEnumStringBody;
generated$2.assertEnumSymbolBody = assertEnumSymbolBody;
generated$2.assertEnumBooleanMember = assertEnumBooleanMember;
generated$2.assertEnumNumberMember = assertEnumNumberMember;
generated$2.assertEnumStringMember = assertEnumStringMember;
generated$2.assertEnumDefaultedMember = assertEnumDefaultedMember;
generated$2.assertIndexedAccessType = assertIndexedAccessType;
generated$2.assertOptionalIndexedAccessType = assertOptionalIndexedAccessType;
generated$2.assertJSXAttribute = assertJSXAttribute;
generated$2.assertJSXClosingElement = assertJSXClosingElement;
generated$2.assertJSXElement = assertJSXElement;
generated$2.assertJSXEmptyExpression = assertJSXEmptyExpression;
generated$2.assertJSXExpressionContainer = assertJSXExpressionContainer;
generated$2.assertJSXSpreadChild = assertJSXSpreadChild;
generated$2.assertJSXIdentifier = assertJSXIdentifier;
generated$2.assertJSXMemberExpression = assertJSXMemberExpression;
generated$2.assertJSXNamespacedName = assertJSXNamespacedName;
generated$2.assertJSXOpeningElement = assertJSXOpeningElement;
generated$2.assertJSXSpreadAttribute = assertJSXSpreadAttribute;
generated$2.assertJSXText = assertJSXText;
generated$2.assertJSXFragment = assertJSXFragment;
generated$2.assertJSXOpeningFragment = assertJSXOpeningFragment;
generated$2.assertJSXClosingFragment = assertJSXClosingFragment;
generated$2.assertNoop = assertNoop;
generated$2.assertPlaceholder = assertPlaceholder;
generated$2.assertV8IntrinsicIdentifier = assertV8IntrinsicIdentifier;
generated$2.assertArgumentPlaceholder = assertArgumentPlaceholder;
generated$2.assertBindExpression = assertBindExpression;
generated$2.assertImportAttribute = assertImportAttribute;
generated$2.assertDecorator = assertDecorator;
generated$2.assertDoExpression = assertDoExpression;
generated$2.assertExportDefaultSpecifier = assertExportDefaultSpecifier;
generated$2.assertRecordExpression = assertRecordExpression;
generated$2.assertTupleExpression = assertTupleExpression;
generated$2.assertDecimalLiteral = assertDecimalLiteral;
generated$2.assertStaticBlock = assertStaticBlock;
generated$2.assertModuleExpression = assertModuleExpression;
generated$2.assertTopicReference = assertTopicReference;
generated$2.assertPipelineTopicExpression = assertPipelineTopicExpression;
generated$2.assertPipelineBareFunction = assertPipelineBareFunction;
generated$2.assertPipelinePrimaryTopicReference = assertPipelinePrimaryTopicReference;
generated$2.assertTSParameterProperty = assertTSParameterProperty;
generated$2.assertTSDeclareFunction = assertTSDeclareFunction;
generated$2.assertTSDeclareMethod = assertTSDeclareMethod;
generated$2.assertTSQualifiedName = assertTSQualifiedName;
generated$2.assertTSCallSignatureDeclaration = assertTSCallSignatureDeclaration;
generated$2.assertTSConstructSignatureDeclaration = assertTSConstructSignatureDeclaration;
generated$2.assertTSPropertySignature = assertTSPropertySignature;
generated$2.assertTSMethodSignature = assertTSMethodSignature;
generated$2.assertTSIndexSignature = assertTSIndexSignature;
generated$2.assertTSAnyKeyword = assertTSAnyKeyword;
generated$2.assertTSBooleanKeyword = assertTSBooleanKeyword;
generated$2.assertTSBigIntKeyword = assertTSBigIntKeyword;
generated$2.assertTSIntrinsicKeyword = assertTSIntrinsicKeyword;
generated$2.assertTSNeverKeyword = assertTSNeverKeyword;
generated$2.assertTSNullKeyword = assertTSNullKeyword;
generated$2.assertTSNumberKeyword = assertTSNumberKeyword;
generated$2.assertTSObjectKeyword = assertTSObjectKeyword;
generated$2.assertTSStringKeyword = assertTSStringKeyword;
generated$2.assertTSSymbolKeyword = assertTSSymbolKeyword;
generated$2.assertTSUndefinedKeyword = assertTSUndefinedKeyword;
generated$2.assertTSUnknownKeyword = assertTSUnknownKeyword;
generated$2.assertTSVoidKeyword = assertTSVoidKeyword;
generated$2.assertTSThisType = assertTSThisType;
generated$2.assertTSFunctionType = assertTSFunctionType;
generated$2.assertTSConstructorType = assertTSConstructorType;
generated$2.assertTSTypeReference = assertTSTypeReference;
generated$2.assertTSTypePredicate = assertTSTypePredicate;
generated$2.assertTSTypeQuery = assertTSTypeQuery;
generated$2.assertTSTypeLiteral = assertTSTypeLiteral;
generated$2.assertTSArrayType = assertTSArrayType;
generated$2.assertTSTupleType = assertTSTupleType;
generated$2.assertTSOptionalType = assertTSOptionalType;
generated$2.assertTSRestType = assertTSRestType;
generated$2.assertTSNamedTupleMember = assertTSNamedTupleMember;
generated$2.assertTSUnionType = assertTSUnionType;
generated$2.assertTSIntersectionType = assertTSIntersectionType;
generated$2.assertTSConditionalType = assertTSConditionalType;
generated$2.assertTSInferType = assertTSInferType;
generated$2.assertTSParenthesizedType = assertTSParenthesizedType;
generated$2.assertTSTypeOperator = assertTSTypeOperator;
generated$2.assertTSIndexedAccessType = assertTSIndexedAccessType;
generated$2.assertTSMappedType = assertTSMappedType;
generated$2.assertTSLiteralType = assertTSLiteralType;
generated$2.assertTSExpressionWithTypeArguments = assertTSExpressionWithTypeArguments;
generated$2.assertTSInterfaceDeclaration = assertTSInterfaceDeclaration;
generated$2.assertTSInterfaceBody = assertTSInterfaceBody;
generated$2.assertTSTypeAliasDeclaration = assertTSTypeAliasDeclaration;
generated$2.assertTSAsExpression = assertTSAsExpression;
generated$2.assertTSTypeAssertion = assertTSTypeAssertion;
generated$2.assertTSEnumDeclaration = assertTSEnumDeclaration;
generated$2.assertTSEnumMember = assertTSEnumMember;
generated$2.assertTSModuleDeclaration = assertTSModuleDeclaration;
generated$2.assertTSModuleBlock = assertTSModuleBlock;
generated$2.assertTSImportType = assertTSImportType;
generated$2.assertTSImportEqualsDeclaration = assertTSImportEqualsDeclaration;
generated$2.assertTSExternalModuleReference = assertTSExternalModuleReference;
generated$2.assertTSNonNullExpression = assertTSNonNullExpression;
generated$2.assertTSExportAssignment = assertTSExportAssignment;
generated$2.assertTSNamespaceExportDeclaration = assertTSNamespaceExportDeclaration;
generated$2.assertTSTypeAnnotation = assertTSTypeAnnotation;
generated$2.assertTSTypeParameterInstantiation = assertTSTypeParameterInstantiation;
generated$2.assertTSTypeParameterDeclaration = assertTSTypeParameterDeclaration;
generated$2.assertTSTypeParameter = assertTSTypeParameter;
generated$2.assertExpression = assertExpression;
generated$2.assertBinary = assertBinary;
generated$2.assertScopable = assertScopable;
generated$2.assertBlockParent = assertBlockParent;
generated$2.assertBlock = assertBlock;
generated$2.assertStatement = assertStatement;
generated$2.assertTerminatorless = assertTerminatorless;
generated$2.assertCompletionStatement = assertCompletionStatement;
generated$2.assertConditional = assertConditional;
generated$2.assertLoop = assertLoop;
generated$2.assertWhile = assertWhile;
generated$2.assertExpressionWrapper = assertExpressionWrapper;
generated$2.assertFor = assertFor;
generated$2.assertForXStatement = assertForXStatement;
generated$2.assertFunction = assertFunction;
generated$2.assertFunctionParent = assertFunctionParent;
generated$2.assertPureish = assertPureish;
generated$2.assertDeclaration = assertDeclaration;
generated$2.assertPatternLike = assertPatternLike;
generated$2.assertLVal = assertLVal;
generated$2.assertTSEntityName = assertTSEntityName;
generated$2.assertLiteral = assertLiteral;
generated$2.assertImmutable = assertImmutable;
generated$2.assertUserWhitespacable = assertUserWhitespacable;
generated$2.assertMethod = assertMethod;
generated$2.assertObjectMember = assertObjectMember;
generated$2.assertProperty = assertProperty;
generated$2.assertUnaryLike = assertUnaryLike;
generated$2.assertPattern = assertPattern;
generated$2.assertClass = assertClass;
generated$2.assertModuleDeclaration = assertModuleDeclaration;
generated$2.assertExportDeclaration = assertExportDeclaration;
generated$2.assertModuleSpecifier = assertModuleSpecifier;
generated$2.assertPrivate = assertPrivate;
generated$2.assertFlow = assertFlow;
generated$2.assertFlowType = assertFlowType;
generated$2.assertFlowBaseAnnotation = assertFlowBaseAnnotation;
generated$2.assertFlowDeclaration = assertFlowDeclaration;
generated$2.assertFlowPredicate = assertFlowPredicate;
generated$2.assertEnumBody = assertEnumBody;
generated$2.assertEnumMember = assertEnumMember;
generated$2.assertJSX = assertJSX;
generated$2.assertTSTypeElement = assertTSTypeElement;
generated$2.assertTSType = assertTSType;
generated$2.assertTSBaseType = assertTSBaseType;
generated$2.assertNumberLiteral = assertNumberLiteral;
generated$2.assertRegexLiteral = assertRegexLiteral;
generated$2.assertRestProperty = assertRestProperty;
generated$2.assertSpreadProperty = assertSpreadProperty;
var _is = is$1;
function assert$1(type, node, opts) {
if (!(0, _is.default)(type, node, opts)) {
throw new Error(`Expected type "${type}" with option ${JSON.stringify(opts)}, ` + `but instead got "${node.type}".`);
}
}
function assertArrayExpression(node, opts) {
assert$1("ArrayExpression", node, opts);
}
function assertAssignmentExpression(node, opts) {
assert$1("AssignmentExpression", node, opts);
}
function assertBinaryExpression(node, opts) {
assert$1("BinaryExpression", node, opts);
}
function assertInterpreterDirective(node, opts) {
assert$1("InterpreterDirective", node, opts);
}
function assertDirective(node, opts) {
assert$1("Directive", node, opts);
}
function assertDirectiveLiteral(node, opts) {
assert$1("DirectiveLiteral", node, opts);
}
function assertBlockStatement(node, opts) {
assert$1("BlockStatement", node, opts);
}
function assertBreakStatement(node, opts) {
assert$1("BreakStatement", node, opts);
}
function assertCallExpression(node, opts) {
assert$1("CallExpression", node, opts);
}
function assertCatchClause(node, opts) {
assert$1("CatchClause", node, opts);
}
function assertConditionalExpression(node, opts) {
assert$1("ConditionalExpression", node, opts);
}
function assertContinueStatement(node, opts) {
assert$1("ContinueStatement", node, opts);
}
function assertDebuggerStatement(node, opts) {
assert$1("DebuggerStatement", node, opts);
}
function assertDoWhileStatement(node, opts) {
assert$1("DoWhileStatement", node, opts);
}
function assertEmptyStatement(node, opts) {
assert$1("EmptyStatement", node, opts);
}
function assertExpressionStatement(node, opts) {
assert$1("ExpressionStatement", node, opts);
}
function assertFile(node, opts) {
assert$1("File", node, opts);
}
function assertForInStatement(node, opts) {
assert$1("ForInStatement", node, opts);
}
function assertForStatement(node, opts) {
assert$1("ForStatement", node, opts);
}
function assertFunctionDeclaration(node, opts) {
assert$1("FunctionDeclaration", node, opts);
}
function assertFunctionExpression(node, opts) {
assert$1("FunctionExpression", node, opts);
}
function assertIdentifier(node, opts) {
assert$1("Identifier", node, opts);
}
function assertIfStatement(node, opts) {
assert$1("IfStatement", node, opts);
}
function assertLabeledStatement(node, opts) {
assert$1("LabeledStatement", node, opts);
}
function assertStringLiteral(node, opts) {
assert$1("StringLiteral", node, opts);
}
function assertNumericLiteral(node, opts) {
assert$1("NumericLiteral", node, opts);
}
function assertNullLiteral(node, opts) {
assert$1("NullLiteral", node, opts);
}
function assertBooleanLiteral(node, opts) {
assert$1("BooleanLiteral", node, opts);
}
function assertRegExpLiteral(node, opts) {
assert$1("RegExpLiteral", node, opts);
}
function assertLogicalExpression(node, opts) {
assert$1("LogicalExpression", node, opts);
}
function assertMemberExpression(node, opts) {
assert$1("MemberExpression", node, opts);
}
function assertNewExpression(node, opts) {
assert$1("NewExpression", node, opts);
}
function assertProgram(node, opts) {
assert$1("Program", node, opts);
}
function assertObjectExpression(node, opts) {
assert$1("ObjectExpression", node, opts);
}
function assertObjectMethod(node, opts) {
assert$1("ObjectMethod", node, opts);
}
function assertObjectProperty(node, opts) {
assert$1("ObjectProperty", node, opts);
}
function assertRestElement(node, opts) {
assert$1("RestElement", node, opts);
}
function assertReturnStatement(node, opts) {
assert$1("ReturnStatement", node, opts);
}
function assertSequenceExpression(node, opts) {
assert$1("SequenceExpression", node, opts);
}
function assertParenthesizedExpression(node, opts) {
assert$1("ParenthesizedExpression", node, opts);
}
function assertSwitchCase(node, opts) {
assert$1("SwitchCase", node, opts);
}
function assertSwitchStatement(node, opts) {
assert$1("SwitchStatement", node, opts);
}
function assertThisExpression(node, opts) {
assert$1("ThisExpression", node, opts);
}
function assertThrowStatement(node, opts) {
assert$1("ThrowStatement", node, opts);
}
function assertTryStatement(node, opts) {
assert$1("TryStatement", node, opts);
}
function assertUnaryExpression(node, opts) {
assert$1("UnaryExpression", node, opts);
}
function assertUpdateExpression(node, opts) {
assert$1("UpdateExpression", node, opts);
}
function assertVariableDeclaration(node, opts) {
assert$1("VariableDeclaration", node, opts);
}
function assertVariableDeclarator(node, opts) {
assert$1("VariableDeclarator", node, opts);
}
function assertWhileStatement(node, opts) {
assert$1("WhileStatement", node, opts);
}
function assertWithStatement(node, opts) {
assert$1("WithStatement", node, opts);
}
function assertAssignmentPattern(node, opts) {
assert$1("AssignmentPattern", node, opts);
}
function assertArrayPattern(node, opts) {
assert$1("ArrayPattern", node, opts);
}
function assertArrowFunctionExpression(node, opts) {
assert$1("ArrowFunctionExpression", node, opts);
}
function assertClassBody(node, opts) {
assert$1("ClassBody", node, opts);
}
function assertClassExpression(node, opts) {
assert$1("ClassExpression", node, opts);
}
function assertClassDeclaration(node, opts) {
assert$1("ClassDeclaration", node, opts);
}
function assertExportAllDeclaration(node, opts) {
assert$1("ExportAllDeclaration", node, opts);
}
function assertExportDefaultDeclaration(node, opts) {
assert$1("ExportDefaultDeclaration", node, opts);
}
function assertExportNamedDeclaration(node, opts) {
assert$1("ExportNamedDeclaration", node, opts);
}
function assertExportSpecifier(node, opts) {
assert$1("ExportSpecifier", node, opts);
}
function assertForOfStatement(node, opts) {
assert$1("ForOfStatement", node, opts);
}
function assertImportDeclaration(node, opts) {
assert$1("ImportDeclaration", node, opts);
}
function assertImportDefaultSpecifier(node, opts) {
assert$1("ImportDefaultSpecifier", node, opts);
}
function assertImportNamespaceSpecifier(node, opts) {
assert$1("ImportNamespaceSpecifier", node, opts);
}
function assertImportSpecifier(node, opts) {
assert$1("ImportSpecifier", node, opts);
}
function assertMetaProperty(node, opts) {
assert$1("MetaProperty", node, opts);
}
function assertClassMethod(node, opts) {
assert$1("ClassMethod", node, opts);
}
function assertObjectPattern(node, opts) {
assert$1("ObjectPattern", node, opts);
}
function assertSpreadElement(node, opts) {
assert$1("SpreadElement", node, opts);
}
function assertSuper(node, opts) {
assert$1("Super", node, opts);
}
function assertTaggedTemplateExpression(node, opts) {
assert$1("TaggedTemplateExpression", node, opts);
}
function assertTemplateElement(node, opts) {
assert$1("TemplateElement", node, opts);
}
function assertTemplateLiteral(node, opts) {
assert$1("TemplateLiteral", node, opts);
}
function assertYieldExpression(node, opts) {
assert$1("YieldExpression", node, opts);
}
function assertAwaitExpression(node, opts) {
assert$1("AwaitExpression", node, opts);
}
function assertImport(node, opts) {
assert$1("Import", node, opts);
}
function assertBigIntLiteral(node, opts) {
assert$1("BigIntLiteral", node, opts);
}
function assertExportNamespaceSpecifier(node, opts) {
assert$1("ExportNamespaceSpecifier", node, opts);
}
function assertOptionalMemberExpression(node, opts) {
assert$1("OptionalMemberExpression", node, opts);
}
function assertOptionalCallExpression(node, opts) {
assert$1("OptionalCallExpression", node, opts);
}
function assertClassProperty(node, opts) {
assert$1("ClassProperty", node, opts);
}
function assertClassPrivateProperty(node, opts) {
assert$1("ClassPrivateProperty", node, opts);
}
function assertClassPrivateMethod(node, opts) {
assert$1("ClassPrivateMethod", node, opts);
}
function assertPrivateName(node, opts) {
assert$1("PrivateName", node, opts);
}
function assertAnyTypeAnnotation(node, opts) {
assert$1("AnyTypeAnnotation", node, opts);
}
function assertArrayTypeAnnotation(node, opts) {
assert$1("ArrayTypeAnnotation", node, opts);
}
function assertBooleanTypeAnnotation(node, opts) {
assert$1("BooleanTypeAnnotation", node, opts);
}
function assertBooleanLiteralTypeAnnotation(node, opts) {
assert$1("BooleanLiteralTypeAnnotation", node, opts);
}
function assertNullLiteralTypeAnnotation(node, opts) {
assert$1("NullLiteralTypeAnnotation", node, opts);
}
function assertClassImplements(node, opts) {
assert$1("ClassImplements", node, opts);
}
function assertDeclareClass(node, opts) {
assert$1("DeclareClass", node, opts);
}
function assertDeclareFunction(node, opts) {
assert$1("DeclareFunction", node, opts);
}
function assertDeclareInterface(node, opts) {
assert$1("DeclareInterface", node, opts);
}
function assertDeclareModule(node, opts) {
assert$1("DeclareModule", node, opts);
}
function assertDeclareModuleExports(node, opts) {
assert$1("DeclareModuleExports", node, opts);
}
function assertDeclareTypeAlias(node, opts) {
assert$1("DeclareTypeAlias", node, opts);
}
function assertDeclareOpaqueType(node, opts) {
assert$1("DeclareOpaqueType", node, opts);
}
function assertDeclareVariable(node, opts) {
assert$1("DeclareVariable", node, opts);
}
function assertDeclareExportDeclaration(node, opts) {
assert$1("DeclareExportDeclaration", node, opts);
}
function assertDeclareExportAllDeclaration(node, opts) {
assert$1("DeclareExportAllDeclaration", node, opts);
}
function assertDeclaredPredicate(node, opts) {
assert$1("DeclaredPredicate", node, opts);
}
function assertExistsTypeAnnotation(node, opts) {
assert$1("ExistsTypeAnnotation", node, opts);
}
function assertFunctionTypeAnnotation(node, opts) {
assert$1("FunctionTypeAnnotation", node, opts);
}
function assertFunctionTypeParam(node, opts) {
assert$1("FunctionTypeParam", node, opts);
}
function assertGenericTypeAnnotation(node, opts) {
assert$1("GenericTypeAnnotation", node, opts);
}
function assertInferredPredicate(node, opts) {
assert$1("InferredPredicate", node, opts);
}
function assertInterfaceExtends(node, opts) {
assert$1("InterfaceExtends", node, opts);
}
function assertInterfaceDeclaration(node, opts) {
assert$1("InterfaceDeclaration", node, opts);
}
function assertInterfaceTypeAnnotation(node, opts) {
assert$1("InterfaceTypeAnnotation", node, opts);
}
function assertIntersectionTypeAnnotation(node, opts) {
assert$1("IntersectionTypeAnnotation", node, opts);
}
function assertMixedTypeAnnotation(node, opts) {
assert$1("MixedTypeAnnotation", node, opts);
}
function assertEmptyTypeAnnotation(node, opts) {
assert$1("EmptyTypeAnnotation", node, opts);
}
function assertNullableTypeAnnotation(node, opts) {
assert$1("NullableTypeAnnotation", node, opts);
}
function assertNumberLiteralTypeAnnotation(node, opts) {
assert$1("NumberLiteralTypeAnnotation", node, opts);
}
function assertNumberTypeAnnotation(node, opts) {
assert$1("NumberTypeAnnotation", node, opts);
}
function assertObjectTypeAnnotation(node, opts) {
assert$1("ObjectTypeAnnotation", node, opts);
}
function assertObjectTypeInternalSlot(node, opts) {
assert$1("ObjectTypeInternalSlot", node, opts);
}
function assertObjectTypeCallProperty(node, opts) {
assert$1("ObjectTypeCallProperty", node, opts);
}
function assertObjectTypeIndexer(node, opts) {
assert$1("ObjectTypeIndexer", node, opts);
}
function assertObjectTypeProperty(node, opts) {
assert$1("ObjectTypeProperty", node, opts);
}
function assertObjectTypeSpreadProperty(node, opts) {
assert$1("ObjectTypeSpreadProperty", node, opts);
}
function assertOpaqueType(node, opts) {
assert$1("OpaqueType", node, opts);
}
function assertQualifiedTypeIdentifier(node, opts) {
assert$1("QualifiedTypeIdentifier", node, opts);
}
function assertStringLiteralTypeAnnotation(node, opts) {
assert$1("StringLiteralTypeAnnotation", node, opts);
}
function assertStringTypeAnnotation(node, opts) {
assert$1("StringTypeAnnotation", node, opts);
}
function assertSymbolTypeAnnotation(node, opts) {
assert$1("SymbolTypeAnnotation", node, opts);
}
function assertThisTypeAnnotation(node, opts) {
assert$1("ThisTypeAnnotation", node, opts);
}
function assertTupleTypeAnnotation(node, opts) {
assert$1("TupleTypeAnnotation", node, opts);
}
function assertTypeofTypeAnnotation(node, opts) {
assert$1("TypeofTypeAnnotation", node, opts);
}
function assertTypeAlias(node, opts) {
assert$1("TypeAlias", node, opts);
}
function assertTypeAnnotation(node, opts) {
assert$1("TypeAnnotation", node, opts);
}
function assertTypeCastExpression(node, opts) {
assert$1("TypeCastExpression", node, opts);
}
function assertTypeParameter(node, opts) {
assert$1("TypeParameter", node, opts);
}
function assertTypeParameterDeclaration(node, opts) {
assert$1("TypeParameterDeclaration", node, opts);
}
function assertTypeParameterInstantiation(node, opts) {
assert$1("TypeParameterInstantiation", node, opts);
}
function assertUnionTypeAnnotation(node, opts) {
assert$1("UnionTypeAnnotation", node, opts);
}
function assertVariance(node, opts) {
assert$1("Variance", node, opts);
}
function assertVoidTypeAnnotation(node, opts) {
assert$1("VoidTypeAnnotation", node, opts);
}
function assertEnumDeclaration(node, opts) {
assert$1("EnumDeclaration", node, opts);
}
function assertEnumBooleanBody(node, opts) {
assert$1("EnumBooleanBody", node, opts);
}
function assertEnumNumberBody(node, opts) {
assert$1("EnumNumberBody", node, opts);
}
function assertEnumStringBody(node, opts) {
assert$1("EnumStringBody", node, opts);
}
function assertEnumSymbolBody(node, opts) {
assert$1("EnumSymbolBody", node, opts);
}
function assertEnumBooleanMember(node, opts) {
assert$1("EnumBooleanMember", node, opts);
}
function assertEnumNumberMember(node, opts) {
assert$1("EnumNumberMember", node, opts);
}
function assertEnumStringMember(node, opts) {
assert$1("EnumStringMember", node, opts);
}
function assertEnumDefaultedMember(node, opts) {
assert$1("EnumDefaultedMember", node, opts);
}
function assertIndexedAccessType(node, opts) {
assert$1("IndexedAccessType", node, opts);
}
function assertOptionalIndexedAccessType(node, opts) {
assert$1("OptionalIndexedAccessType", node, opts);
}
function assertJSXAttribute(node, opts) {
assert$1("JSXAttribute", node, opts);
}
function assertJSXClosingElement(node, opts) {
assert$1("JSXClosingElement", node, opts);
}
function assertJSXElement(node, opts) {
assert$1("JSXElement", node, opts);
}
function assertJSXEmptyExpression(node, opts) {
assert$1("JSXEmptyExpression", node, opts);
}
function assertJSXExpressionContainer(node, opts) {
assert$1("JSXExpressionContainer", node, opts);
}
function assertJSXSpreadChild(node, opts) {
assert$1("JSXSpreadChild", node, opts);
}
function assertJSXIdentifier(node, opts) {
assert$1("JSXIdentifier", node, opts);
}
function assertJSXMemberExpression(node, opts) {
assert$1("JSXMemberExpression", node, opts);
}
function assertJSXNamespacedName(node, opts) {
assert$1("JSXNamespacedName", node, opts);
}
function assertJSXOpeningElement(node, opts) {
assert$1("JSXOpeningElement", node, opts);
}
function assertJSXSpreadAttribute(node, opts) {
assert$1("JSXSpreadAttribute", node, opts);
}
function assertJSXText(node, opts) {
assert$1("JSXText", node, opts);
}
function assertJSXFragment(node, opts) {
assert$1("JSXFragment", node, opts);
}
function assertJSXOpeningFragment(node, opts) {
assert$1("JSXOpeningFragment", node, opts);
}
function assertJSXClosingFragment(node, opts) {
assert$1("JSXClosingFragment", node, opts);
}
function assertNoop(node, opts) {
assert$1("Noop", node, opts);
}
function assertPlaceholder(node, opts) {
assert$1("Placeholder", node, opts);
}
function assertV8IntrinsicIdentifier(node, opts) {
assert$1("V8IntrinsicIdentifier", node, opts);
}
function assertArgumentPlaceholder(node, opts) {
assert$1("ArgumentPlaceholder", node, opts);
}
function assertBindExpression(node, opts) {
assert$1("BindExpression", node, opts);
}
function assertImportAttribute(node, opts) {
assert$1("ImportAttribute", node, opts);
}
function assertDecorator(node, opts) {
assert$1("Decorator", node, opts);
}
function assertDoExpression(node, opts) {
assert$1("DoExpression", node, opts);
}
function assertExportDefaultSpecifier(node, opts) {
assert$1("ExportDefaultSpecifier", node, opts);
}
function assertRecordExpression(node, opts) {
assert$1("RecordExpression", node, opts);
}
function assertTupleExpression(node, opts) {
assert$1("TupleExpression", node, opts);
}
function assertDecimalLiteral(node, opts) {
assert$1("DecimalLiteral", node, opts);
}
function assertStaticBlock(node, opts) {
assert$1("StaticBlock", node, opts);
}
function assertModuleExpression(node, opts) {
assert$1("ModuleExpression", node, opts);
}
function assertTopicReference(node, opts) {
assert$1("TopicReference", node, opts);
}
function assertPipelineTopicExpression(node, opts) {
assert$1("PipelineTopicExpression", node, opts);
}
function assertPipelineBareFunction(node, opts) {
assert$1("PipelineBareFunction", node, opts);
}
function assertPipelinePrimaryTopicReference(node, opts) {
assert$1("PipelinePrimaryTopicReference", node, opts);
}
function assertTSParameterProperty(node, opts) {
assert$1("TSParameterProperty", node, opts);
}
function assertTSDeclareFunction(node, opts) {
assert$1("TSDeclareFunction", node, opts);
}
function assertTSDeclareMethod(node, opts) {
assert$1("TSDeclareMethod", node, opts);
}
function assertTSQualifiedName(node, opts) {
assert$1("TSQualifiedName", node, opts);
}
function assertTSCallSignatureDeclaration(node, opts) {
assert$1("TSCallSignatureDeclaration", node, opts);
}
function assertTSConstructSignatureDeclaration(node, opts) {
assert$1("TSConstructSignatureDeclaration", node, opts);
}
function assertTSPropertySignature(node, opts) {
assert$1("TSPropertySignature", node, opts);
}
function assertTSMethodSignature(node, opts) {
assert$1("TSMethodSignature", node, opts);
}
function assertTSIndexSignature(node, opts) {
assert$1("TSIndexSignature", node, opts);
}
function assertTSAnyKeyword(node, opts) {
assert$1("TSAnyKeyword", node, opts);
}
function assertTSBooleanKeyword(node, opts) {
assert$1("TSBooleanKeyword", node, opts);
}
function assertTSBigIntKeyword(node, opts) {
assert$1("TSBigIntKeyword", node, opts);
}
function assertTSIntrinsicKeyword(node, opts) {
assert$1("TSIntrinsicKeyword", node, opts);
}
function assertTSNeverKeyword(node, opts) {
assert$1("TSNeverKeyword", node, opts);
}
function assertTSNullKeyword(node, opts) {
assert$1("TSNullKeyword", node, opts);
}
function assertTSNumberKeyword(node, opts) {
assert$1("TSNumberKeyword", node, opts);
}
function assertTSObjectKeyword(node, opts) {
assert$1("TSObjectKeyword", node, opts);
}
function assertTSStringKeyword(node, opts) {
assert$1("TSStringKeyword", node, opts);
}
function assertTSSymbolKeyword(node, opts) {
assert$1("TSSymbolKeyword", node, opts);
}
function assertTSUndefinedKeyword(node, opts) {
assert$1("TSUndefinedKeyword", node, opts);
}
function assertTSUnknownKeyword(node, opts) {
assert$1("TSUnknownKeyword", node, opts);
}
function assertTSVoidKeyword(node, opts) {
assert$1("TSVoidKeyword", node, opts);
}
function assertTSThisType(node, opts) {
assert$1("TSThisType", node, opts);
}
function assertTSFunctionType(node, opts) {
assert$1("TSFunctionType", node, opts);
}
function assertTSConstructorType(node, opts) {
assert$1("TSConstructorType", node, opts);
}
function assertTSTypeReference(node, opts) {
assert$1("TSTypeReference", node, opts);
}
function assertTSTypePredicate(node, opts) {
assert$1("TSTypePredicate", node, opts);
}
function assertTSTypeQuery(node, opts) {
assert$1("TSTypeQuery", node, opts);
}
function assertTSTypeLiteral(node, opts) {
assert$1("TSTypeLiteral", node, opts);
}
function assertTSArrayType(node, opts) {
assert$1("TSArrayType", node, opts);
}
function assertTSTupleType(node, opts) {
assert$1("TSTupleType", node, opts);
}
function assertTSOptionalType(node, opts) {
assert$1("TSOptionalType", node, opts);
}
function assertTSRestType(node, opts) {
assert$1("TSRestType", node, opts);
}
function assertTSNamedTupleMember(node, opts) {
assert$1("TSNamedTupleMember", node, opts);
}
function assertTSUnionType(node, opts) {
assert$1("TSUnionType", node, opts);
}
function assertTSIntersectionType(node, opts) {
assert$1("TSIntersectionType", node, opts);
}
function assertTSConditionalType(node, opts) {
assert$1("TSConditionalType", node, opts);
}
function assertTSInferType(node, opts) {
assert$1("TSInferType", node, opts);
}
function assertTSParenthesizedType(node, opts) {
assert$1("TSParenthesizedType", node, opts);
}
function assertTSTypeOperator(node, opts) {
assert$1("TSTypeOperator", node, opts);
}
function assertTSIndexedAccessType(node, opts) {
assert$1("TSIndexedAccessType", node, opts);
}
function assertTSMappedType(node, opts) {
assert$1("TSMappedType", node, opts);
}
function assertTSLiteralType(node, opts) {
assert$1("TSLiteralType", node, opts);
}
function assertTSExpressionWithTypeArguments(node, opts) {
assert$1("TSExpressionWithTypeArguments", node, opts);
}
function assertTSInterfaceDeclaration(node, opts) {
assert$1("TSInterfaceDeclaration", node, opts);
}
function assertTSInterfaceBody(node, opts) {
assert$1("TSInterfaceBody", node, opts);
}
function assertTSTypeAliasDeclaration(node, opts) {
assert$1("TSTypeAliasDeclaration", node, opts);
}
function assertTSAsExpression(node, opts) {
assert$1("TSAsExpression", node, opts);
}
function assertTSTypeAssertion(node, opts) {
assert$1("TSTypeAssertion", node, opts);
}
function assertTSEnumDeclaration(node, opts) {
assert$1("TSEnumDeclaration", node, opts);
}
function assertTSEnumMember(node, opts) {
assert$1("TSEnumMember", node, opts);
}
function assertTSModuleDeclaration(node, opts) {
assert$1("TSModuleDeclaration", node, opts);
}
function assertTSModuleBlock(node, opts) {
assert$1("TSModuleBlock", node, opts);
}
function assertTSImportType(node, opts) {
assert$1("TSImportType", node, opts);
}
function assertTSImportEqualsDeclaration(node, opts) {
assert$1("TSImportEqualsDeclaration", node, opts);
}
function assertTSExternalModuleReference(node, opts) {
assert$1("TSExternalModuleReference", node, opts);
}
function assertTSNonNullExpression(node, opts) {
assert$1("TSNonNullExpression", node, opts);
}
function assertTSExportAssignment(node, opts) {
assert$1("TSExportAssignment", node, opts);
}
function assertTSNamespaceExportDeclaration(node, opts) {
assert$1("TSNamespaceExportDeclaration", node, opts);
}
function assertTSTypeAnnotation(node, opts) {
assert$1("TSTypeAnnotation", node, opts);
}
function assertTSTypeParameterInstantiation(node, opts) {
assert$1("TSTypeParameterInstantiation", node, opts);
}
function assertTSTypeParameterDeclaration(node, opts) {
assert$1("TSTypeParameterDeclaration", node, opts);
}
function assertTSTypeParameter(node, opts) {
assert$1("TSTypeParameter", node, opts);
}
function assertExpression(node, opts) {
assert$1("Expression", node, opts);
}
function assertBinary(node, opts) {
assert$1("Binary", node, opts);
}
function assertScopable(node, opts) {
assert$1("Scopable", node, opts);
}
function assertBlockParent(node, opts) {
assert$1("BlockParent", node, opts);
}
function assertBlock(node, opts) {
assert$1("Block", node, opts);
}
function assertStatement(node, opts) {
assert$1("Statement", node, opts);
}
function assertTerminatorless(node, opts) {
assert$1("Terminatorless", node, opts);
}
function assertCompletionStatement(node, opts) {
assert$1("CompletionStatement", node, opts);
}
function assertConditional(node, opts) {
assert$1("Conditional", node, opts);
}
function assertLoop(node, opts) {
assert$1("Loop", node, opts);
}
function assertWhile(node, opts) {
assert$1("While", node, opts);
}
function assertExpressionWrapper(node, opts) {
assert$1("ExpressionWrapper", node, opts);
}
function assertFor(node, opts) {
assert$1("For", node, opts);
}
function assertForXStatement(node, opts) {
assert$1("ForXStatement", node, opts);
}
function assertFunction(node, opts) {
assert$1("Function", node, opts);
}
function assertFunctionParent(node, opts) {
assert$1("FunctionParent", node, opts);
}
function assertPureish(node, opts) {
assert$1("Pureish", node, opts);
}
function assertDeclaration(node, opts) {
assert$1("Declaration", node, opts);
}
function assertPatternLike(node, opts) {
assert$1("PatternLike", node, opts);
}
function assertLVal(node, opts) {
assert$1("LVal", node, opts);
}
function assertTSEntityName(node, opts) {
assert$1("TSEntityName", node, opts);
}
function assertLiteral(node, opts) {
assert$1("Literal", node, opts);
}
function assertImmutable(node, opts) {
assert$1("Immutable", node, opts);
}
function assertUserWhitespacable(node, opts) {
assert$1("UserWhitespacable", node, opts);
}
function assertMethod(node, opts) {
assert$1("Method", node, opts);
}
function assertObjectMember(node, opts) {
assert$1("ObjectMember", node, opts);
}
function assertProperty(node, opts) {
assert$1("Property", node, opts);
}
function assertUnaryLike(node, opts) {
assert$1("UnaryLike", node, opts);
}
function assertPattern(node, opts) {
assert$1("Pattern", node, opts);
}
function assertClass(node, opts) {
assert$1("Class", node, opts);
}
function assertModuleDeclaration(node, opts) {
assert$1("ModuleDeclaration", node, opts);
}
function assertExportDeclaration(node, opts) {
assert$1("ExportDeclaration", node, opts);
}
function assertModuleSpecifier(node, opts) {
assert$1("ModuleSpecifier", node, opts);
}
function assertPrivate(node, opts) {
assert$1("Private", node, opts);
}
function assertFlow(node, opts) {
assert$1("Flow", node, opts);
}
function assertFlowType(node, opts) {
assert$1("FlowType", node, opts);
}
function assertFlowBaseAnnotation(node, opts) {
assert$1("FlowBaseAnnotation", node, opts);
}
function assertFlowDeclaration(node, opts) {
assert$1("FlowDeclaration", node, opts);
}
function assertFlowPredicate(node, opts) {
assert$1("FlowPredicate", node, opts);
}
function assertEnumBody(node, opts) {
assert$1("EnumBody", node, opts);
}
function assertEnumMember(node, opts) {
assert$1("EnumMember", node, opts);
}
function assertJSX(node, opts) {
assert$1("JSX", node, opts);
}
function assertTSTypeElement(node, opts) {
assert$1("TSTypeElement", node, opts);
}
function assertTSType(node, opts) {
assert$1("TSType", node, opts);
}
function assertTSBaseType(node, opts) {
assert$1("TSBaseType", node, opts);
}
function assertNumberLiteral(node, opts) {
console.trace("The node type NumberLiteral has been renamed to NumericLiteral");
assert$1("NumberLiteral", node, opts);
}
function assertRegexLiteral(node, opts) {
console.trace("The node type RegexLiteral has been renamed to RegExpLiteral");
assert$1("RegexLiteral", node, opts);
}
function assertRestProperty(node, opts) {
console.trace("The node type RestProperty has been renamed to RestElement");
assert$1("RestProperty", node, opts);
}
function assertSpreadProperty(node, opts) {
console.trace("The node type SpreadProperty has been renamed to SpreadElement");
assert$1("SpreadProperty", node, opts);
}
var createTypeAnnotationBasedOnTypeof$1 = {};
Object.defineProperty(createTypeAnnotationBasedOnTypeof$1, "__esModule", {
value: true
});
createTypeAnnotationBasedOnTypeof$1.default = createTypeAnnotationBasedOnTypeof;
var _generated$l = generated$3;
function createTypeAnnotationBasedOnTypeof(type) {
if (type === "string") {
return (0, _generated$l.stringTypeAnnotation)();
} else if (type === "number") {
return (0, _generated$l.numberTypeAnnotation)();
} else if (type === "undefined") {
return (0, _generated$l.voidTypeAnnotation)();
} else if (type === "boolean") {
return (0, _generated$l.booleanTypeAnnotation)();
} else if (type === "function") {
return (0, _generated$l.genericTypeAnnotation)((0, _generated$l.identifier)("Function"));
} else if (type === "object") {
return (0, _generated$l.genericTypeAnnotation)((0, _generated$l.identifier)("Object"));
} else if (type === "symbol") {
return (0, _generated$l.genericTypeAnnotation)((0, _generated$l.identifier)("Symbol"));
} else if (type === "bigint") {
return (0, _generated$l.anyTypeAnnotation)();
} else {
throw new Error("Invalid typeof value: " + type);
}
}
var createFlowUnionType$1 = {};
var removeTypeDuplicates$3 = {};
Object.defineProperty(removeTypeDuplicates$3, "__esModule", {
value: true
});
removeTypeDuplicates$3.default = removeTypeDuplicates$2;
var _generated$k = generated$4;
function getQualifiedName(node) {
return (0, _generated$k.isIdentifier)(node) ? node.name : `${node.id.name}.${getQualifiedName(node.qualification)}`;
}
function removeTypeDuplicates$2(nodes) {
const generics = {};
const bases = {};
const typeGroups = [];
const types = [];
for (let i = 0; i < nodes.length; i++) {
const node = nodes[i];
if (!node) continue;
if (types.indexOf(node) >= 0) {
continue;
}
if ((0, _generated$k.isAnyTypeAnnotation)(node)) {
return [node];
}
if ((0, _generated$k.isFlowBaseAnnotation)(node)) {
bases[node.type] = node;
continue;
}
if ((0, _generated$k.isUnionTypeAnnotation)(node)) {
if (typeGroups.indexOf(node.types) < 0) {
nodes = nodes.concat(node.types);
typeGroups.push(node.types);
}
continue;
}
if ((0, _generated$k.isGenericTypeAnnotation)(node)) {
const name = getQualifiedName(node.id);
if (generics[name]) {
let existing = generics[name];
if (existing.typeParameters) {
if (node.typeParameters) {
existing.typeParameters.params = removeTypeDuplicates$2(existing.typeParameters.params.concat(node.typeParameters.params));
}
} else {
existing = node.typeParameters;
}
} else {
generics[name] = node;
}
continue;
}
types.push(node);
}
for (const type of Object.keys(bases)) {
types.push(bases[type]);
}
for (const name of Object.keys(generics)) {
types.push(generics[name]);
}
return types;
}
Object.defineProperty(createFlowUnionType$1, "__esModule", {
value: true
});
createFlowUnionType$1.default = createFlowUnionType;
var _generated$j = generated$3;
var _removeTypeDuplicates$1 = removeTypeDuplicates$3;
function createFlowUnionType(types) {
const flattened = (0, _removeTypeDuplicates$1.default)(types);
if (flattened.length === 1) {
return flattened[0];
} else {
return (0, _generated$j.unionTypeAnnotation)(flattened);
}
}
var createTSUnionType$1 = {};
var removeTypeDuplicates$1 = {};
Object.defineProperty(removeTypeDuplicates$1, "__esModule", {
value: true
});
removeTypeDuplicates$1.default = removeTypeDuplicates;
var _generated$i = generated$4;
function removeTypeDuplicates(nodes) {
const generics = {};
const bases = {};
const typeGroups = [];
const types = [];
for (let i = 0; i < nodes.length; i++) {
const node = nodes[i];
if (!node) continue;
if (types.indexOf(node) >= 0) {
continue;
}
if ((0, _generated$i.isTSAnyKeyword)(node)) {
return [node];
}
if ((0, _generated$i.isTSBaseType)(node)) {
bases[node.type] = node;
continue;
}
if ((0, _generated$i.isTSUnionType)(node)) {
if (typeGroups.indexOf(node.types) < 0) {
nodes = nodes.concat(node.types);
typeGroups.push(node.types);
}
continue;
}
types.push(node);
}
for (const type of Object.keys(bases)) {
types.push(bases[type]);
}
for (const name of Object.keys(generics)) {
types.push(generics[name]);
}
return types;
}
Object.defineProperty(createTSUnionType$1, "__esModule", {
value: true
});
createTSUnionType$1.default = createTSUnionType;
var _generated$h = generated$3;
var _removeTypeDuplicates = removeTypeDuplicates$1;
function createTSUnionType(typeAnnotations) {
const types = typeAnnotations.map(type => type.typeAnnotation);
const flattened = (0, _removeTypeDuplicates.default)(types);
if (flattened.length === 1) {
return flattened[0];
} else {
return (0, _generated$h.tsUnionType)(flattened);
}
}
var uppercase = {};
(function (exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "ArrayExpression", {
enumerable: true,
get: function () {
return _index.arrayExpression;
}
});
Object.defineProperty(exports, "AssignmentExpression", {
enumerable: true,
get: function () {
return _index.assignmentExpression;
}
});
Object.defineProperty(exports, "BinaryExpression", {
enumerable: true,
get: function () {
return _index.binaryExpression;
}
});
Object.defineProperty(exports, "InterpreterDirective", {
enumerable: true,
get: function () {
return _index.interpreterDirective;
}
});
Object.defineProperty(exports, "Directive", {
enumerable: true,
get: function () {
return _index.directive;
}
});
Object.defineProperty(exports, "DirectiveLiteral", {
enumerable: true,
get: function () {
return _index.directiveLiteral;
}
});
Object.defineProperty(exports, "BlockStatement", {
enumerable: true,
get: function () {
return _index.blockStatement;
}
});
Object.defineProperty(exports, "BreakStatement", {
enumerable: true,
get: function () {
return _index.breakStatement;
}
});
Object.defineProperty(exports, "CallExpression", {
enumerable: true,
get: function () {
return _index.callExpression;
}
});
Object.defineProperty(exports, "CatchClause", {
enumerable: true,
get: function () {
return _index.catchClause;
}
});
Object.defineProperty(exports, "ConditionalExpression", {
enumerable: true,
get: function () {
return _index.conditionalExpression;
}
});
Object.defineProperty(exports, "ContinueStatement", {
enumerable: true,
get: function () {
return _index.continueStatement;
}
});
Object.defineProperty(exports, "DebuggerStatement", {
enumerable: true,
get: function () {
return _index.debuggerStatement;
}
});
Object.defineProperty(exports, "DoWhileStatement", {
enumerable: true,
get: function () {
return _index.doWhileStatement;
}
});
Object.defineProperty(exports, "EmptyStatement", {
enumerable: true,
get: function () {
return _index.emptyStatement;
}
});
Object.defineProperty(exports, "ExpressionStatement", {
enumerable: true,
get: function () {
return _index.expressionStatement;
}
});
Object.defineProperty(exports, "File", {
enumerable: true,
get: function () {
return _index.file;
}
});
Object.defineProperty(exports, "ForInStatement", {
enumerable: true,
get: function () {
return _index.forInStatement;
}
});
Object.defineProperty(exports, "ForStatement", {
enumerable: true,
get: function () {
return _index.forStatement;
}
});
Object.defineProperty(exports, "FunctionDeclaration", {
enumerable: true,
get: function () {
return _index.functionDeclaration;
}
});
Object.defineProperty(exports, "FunctionExpression", {
enumerable: true,
get: function () {
return _index.functionExpression;
}
});
Object.defineProperty(exports, "Identifier", {
enumerable: true,
get: function () {
return _index.identifier;
}
});
Object.defineProperty(exports, "IfStatement", {
enumerable: true,
get: function () {
return _index.ifStatement;
}
});
Object.defineProperty(exports, "LabeledStatement", {
enumerable: true,
get: function () {
return _index.labeledStatement;
}
});
Object.defineProperty(exports, "StringLiteral", {
enumerable: true,
get: function () {
return _index.stringLiteral;
}
});
Object.defineProperty(exports, "NumericLiteral", {
enumerable: true,
get: function () {
return _index.numericLiteral;
}
});
Object.defineProperty(exports, "NullLiteral", {
enumerable: true,
get: function () {
return _index.nullLiteral;
}
});
Object.defineProperty(exports, "BooleanLiteral", {
enumerable: true,
get: function () {
return _index.booleanLiteral;
}
});
Object.defineProperty(exports, "RegExpLiteral", {
enumerable: true,
get: function () {
return _index.regExpLiteral;
}
});
Object.defineProperty(exports, "LogicalExpression", {
enumerable: true,
get: function () {
return _index.logicalExpression;
}
});
Object.defineProperty(exports, "MemberExpression", {
enumerable: true,
get: function () {
return _index.memberExpression;
}
});
Object.defineProperty(exports, "NewExpression", {
enumerable: true,
get: function () {
return _index.newExpression;
}
});
Object.defineProperty(exports, "Program", {
enumerable: true,
get: function () {
return _index.program;
}
});
Object.defineProperty(exports, "ObjectExpression", {
enumerable: true,
get: function () {
return _index.objectExpression;
}
});
Object.defineProperty(exports, "ObjectMethod", {
enumerable: true,
get: function () {
return _index.objectMethod;
}
});
Object.defineProperty(exports, "ObjectProperty", {
enumerable: true,
get: function () {
return _index.objectProperty;
}
});
Object.defineProperty(exports, "RestElement", {
enumerable: true,
get: function () {
return _index.restElement;
}
});
Object.defineProperty(exports, "ReturnStatement", {
enumerable: true,
get: function () {
return _index.returnStatement;
}
});
Object.defineProperty(exports, "SequenceExpression", {
enumerable: true,
get: function () {
return _index.sequenceExpression;
}
});
Object.defineProperty(exports, "ParenthesizedExpression", {
enumerable: true,
get: function () {
return _index.parenthesizedExpression;
}
});
Object.defineProperty(exports, "SwitchCase", {
enumerable: true,
get: function () {
return _index.switchCase;
}
});
Object.defineProperty(exports, "SwitchStatement", {
enumerable: true,
get: function () {
return _index.switchStatement;
}
});
Object.defineProperty(exports, "ThisExpression", {
enumerable: true,
get: function () {
return _index.thisExpression;
}
});
Object.defineProperty(exports, "ThrowStatement", {
enumerable: true,
get: function () {
return _index.throwStatement;
}
});
Object.defineProperty(exports, "TryStatement", {
enumerable: true,
get: function () {
return _index.tryStatement;
}
});
Object.defineProperty(exports, "UnaryExpression", {
enumerable: true,
get: function () {
return _index.unaryExpression;
}
});
Object.defineProperty(exports, "UpdateExpression", {
enumerable: true,
get: function () {
return _index.updateExpression;
}
});
Object.defineProperty(exports, "VariableDeclaration", {
enumerable: true,
get: function () {
return _index.variableDeclaration;
}
});
Object.defineProperty(exports, "VariableDeclarator", {
enumerable: true,
get: function () {
return _index.variableDeclarator;
}
});
Object.defineProperty(exports, "WhileStatement", {
enumerable: true,
get: function () {
return _index.whileStatement;
}
});
Object.defineProperty(exports, "WithStatement", {
enumerable: true,
get: function () {
return _index.withStatement;
}
});
Object.defineProperty(exports, "AssignmentPattern", {
enumerable: true,
get: function () {
return _index.assignmentPattern;
}
});
Object.defineProperty(exports, "ArrayPattern", {
enumerable: true,
get: function () {
return _index.arrayPattern;
}
});
Object.defineProperty(exports, "ArrowFunctionExpression", {
enumerable: true,
get: function () {
return _index.arrowFunctionExpression;
}
});
Object.defineProperty(exports, "ClassBody", {
enumerable: true,
get: function () {
return _index.classBody;
}
});
Object.defineProperty(exports, "ClassExpression", {
enumerable: true,
get: function () {
return _index.classExpression;
}
});
Object.defineProperty(exports, "ClassDeclaration", {
enumerable: true,
get: function () {
return _index.classDeclaration;
}
});
Object.defineProperty(exports, "ExportAllDeclaration", {
enumerable: true,
get: function () {
return _index.exportAllDeclaration;
}
});
Object.defineProperty(exports, "ExportDefaultDeclaration", {
enumerable: true,
get: function () {
return _index.exportDefaultDeclaration;
}
});
Object.defineProperty(exports, "ExportNamedDeclaration", {
enumerable: true,
get: function () {
return _index.exportNamedDeclaration;
}
});
Object.defineProperty(exports, "ExportSpecifier", {
enumerable: true,
get: function () {
return _index.exportSpecifier;
}
});
Object.defineProperty(exports, "ForOfStatement", {
enumerable: true,
get: function () {
return _index.forOfStatement;
}
});
Object.defineProperty(exports, "ImportDeclaration", {
enumerable: true,
get: function () {
return _index.importDeclaration;
}
});
Object.defineProperty(exports, "ImportDefaultSpecifier", {
enumerable: true,
get: function () {
return _index.importDefaultSpecifier;
}
});
Object.defineProperty(exports, "ImportNamespaceSpecifier", {
enumerable: true,
get: function () {
return _index.importNamespaceSpecifier;
}
});
Object.defineProperty(exports, "ImportSpecifier", {
enumerable: true,
get: function () {
return _index.importSpecifier;
}
});
Object.defineProperty(exports, "MetaProperty", {
enumerable: true,
get: function () {
return _index.metaProperty;
}
});
Object.defineProperty(exports, "ClassMethod", {
enumerable: true,
get: function () {
return _index.classMethod;
}
});
Object.defineProperty(exports, "ObjectPattern", {
enumerable: true,
get: function () {
return _index.objectPattern;
}
});
Object.defineProperty(exports, "SpreadElement", {
enumerable: true,
get: function () {
return _index.spreadElement;
}
});
Object.defineProperty(exports, "Super", {
enumerable: true,
get: function () {
return _index.super;
}
});
Object.defineProperty(exports, "TaggedTemplateExpression", {
enumerable: true,
get: function () {
return _index.taggedTemplateExpression;
}
});
Object.defineProperty(exports, "TemplateElement", {
enumerable: true,
get: function () {
return _index.templateElement;
}
});
Object.defineProperty(exports, "TemplateLiteral", {
enumerable: true,
get: function () {
return _index.templateLiteral;
}
});
Object.defineProperty(exports, "YieldExpression", {
enumerable: true,
get: function () {
return _index.yieldExpression;
}
});
Object.defineProperty(exports, "AwaitExpression", {
enumerable: true,
get: function () {
return _index.awaitExpression;
}
});
Object.defineProperty(exports, "Import", {
enumerable: true,
get: function () {
return _index.import;
}
});
Object.defineProperty(exports, "BigIntLiteral", {
enumerable: true,
get: function () {
return _index.bigIntLiteral;
}
});
Object.defineProperty(exports, "ExportNamespaceSpecifier", {
enumerable: true,
get: function () {
return _index.exportNamespaceSpecifier;
}
});
Object.defineProperty(exports, "OptionalMemberExpression", {
enumerable: true,
get: function () {
return _index.optionalMemberExpression;
}
});
Object.defineProperty(exports, "OptionalCallExpression", {
enumerable: true,
get: function () {
return _index.optionalCallExpression;
}
});
Object.defineProperty(exports, "ClassProperty", {
enumerable: true,
get: function () {
return _index.classProperty;
}
});
Object.defineProperty(exports, "ClassPrivateProperty", {
enumerable: true,
get: function () {
return _index.classPrivateProperty;
}
});
Object.defineProperty(exports, "ClassPrivateMethod", {
enumerable: true,
get: function () {
return _index.classPrivateMethod;
}
});
Object.defineProperty(exports, "PrivateName", {
enumerable: true,
get: function () {
return _index.privateName;
}
});
Object.defineProperty(exports, "AnyTypeAnnotation", {
enumerable: true,
get: function () {
return _index.anyTypeAnnotation;
}
});
Object.defineProperty(exports, "ArrayTypeAnnotation", {
enumerable: true,
get: function () {
return _index.arrayTypeAnnotation;
}
});
Object.defineProperty(exports, "BooleanTypeAnnotation", {
enumerable: true,
get: function () {
return _index.booleanTypeAnnotation;
}
});
Object.defineProperty(exports, "BooleanLiteralTypeAnnotation", {
enumerable: true,
get: function () {
return _index.booleanLiteralTypeAnnotation;
}
});
Object.defineProperty(exports, "NullLiteralTypeAnnotation", {
enumerable: true,
get: function () {
return _index.nullLiteralTypeAnnotation;
}
});
Object.defineProperty(exports, "ClassImplements", {
enumerable: true,
get: function () {
return _index.classImplements;
}
});
Object.defineProperty(exports, "DeclareClass", {
enumerable: true,
get: function () {
return _index.declareClass;
}
});
Object.defineProperty(exports, "DeclareFunction", {
enumerable: true,
get: function () {
return _index.declareFunction;
}
});
Object.defineProperty(exports, "DeclareInterface", {
enumerable: true,
get: function () {
return _index.declareInterface;
}
});
Object.defineProperty(exports, "DeclareModule", {
enumerable: true,
get: function () {
return _index.declareModule;
}
});
Object.defineProperty(exports, "DeclareModuleExports", {
enumerable: true,
get: function () {
return _index.declareModuleExports;
}
});
Object.defineProperty(exports, "DeclareTypeAlias", {
enumerable: true,
get: function () {
return _index.declareTypeAlias;
}
});
Object.defineProperty(exports, "DeclareOpaqueType", {
enumerable: true,
get: function () {
return _index.declareOpaqueType;
}
});
Object.defineProperty(exports, "DeclareVariable", {
enumerable: true,
get: function () {
return _index.declareVariable;
}
});
Object.defineProperty(exports, "DeclareExportDeclaration", {
enumerable: true,
get: function () {
return _index.declareExportDeclaration;
}
});
Object.defineProperty(exports, "DeclareExportAllDeclaration", {
enumerable: true,
get: function () {
return _index.declareExportAllDeclaration;
}
});
Object.defineProperty(exports, "DeclaredPredicate", {
enumerable: true,
get: function () {
return _index.declaredPredicate;
}
});
Object.defineProperty(exports, "ExistsTypeAnnotation", {
enumerable: true,
get: function () {
return _index.existsTypeAnnotation;
}
});
Object.defineProperty(exports, "FunctionTypeAnnotation", {
enumerable: true,
get: function () {
return _index.functionTypeAnnotation;
}
});
Object.defineProperty(exports, "FunctionTypeParam", {
enumerable: true,
get: function () {
return _index.functionTypeParam;
}
});
Object.defineProperty(exports, "GenericTypeAnnotation", {
enumerable: true,
get: function () {
return _index.genericTypeAnnotation;
}
});
Object.defineProperty(exports, "InferredPredicate", {
enumerable: true,
get: function () {
return _index.inferredPredicate;
}
});
Object.defineProperty(exports, "InterfaceExtends", {
enumerable: true,
get: function () {
return _index.interfaceExtends;
}
});
Object.defineProperty(exports, "InterfaceDeclaration", {
enumerable: true,
get: function () {
return _index.interfaceDeclaration;
}
});
Object.defineProperty(exports, "InterfaceTypeAnnotation", {
enumerable: true,
get: function () {
return _index.interfaceTypeAnnotation;
}
});
Object.defineProperty(exports, "IntersectionTypeAnnotation", {
enumerable: true,
get: function () {
return _index.intersectionTypeAnnotation;
}
});
Object.defineProperty(exports, "MixedTypeAnnotation", {
enumerable: true,
get: function () {
return _index.mixedTypeAnnotation;
}
});
Object.defineProperty(exports, "EmptyTypeAnnotation", {
enumerable: true,
get: function () {
return _index.emptyTypeAnnotation;
}
});
Object.defineProperty(exports, "NullableTypeAnnotation", {
enumerable: true,
get: function () {
return _index.nullableTypeAnnotation;
}
});
Object.defineProperty(exports, "NumberLiteralTypeAnnotation", {
enumerable: true,
get: function () {
return _index.numberLiteralTypeAnnotation;
}
});
Object.defineProperty(exports, "NumberTypeAnnotation", {
enumerable: true,
get: function () {
return _index.numberTypeAnnotation;
}
});
Object.defineProperty(exports, "ObjectTypeAnnotation", {
enumerable: true,
get: function () {
return _index.objectTypeAnnotation;
}
});
Object.defineProperty(exports, "ObjectTypeInternalSlot", {
enumerable: true,
get: function () {
return _index.objectTypeInternalSlot;
}
});
Object.defineProperty(exports, "ObjectTypeCallProperty", {
enumerable: true,
get: function () {
return _index.objectTypeCallProperty;
}
});
Object.defineProperty(exports, "ObjectTypeIndexer", {
enumerable: true,
get: function () {
return _index.objectTypeIndexer;
}
});
Object.defineProperty(exports, "ObjectTypeProperty", {
enumerable: true,
get: function () {
return _index.objectTypeProperty;
}
});
Object.defineProperty(exports, "ObjectTypeSpreadProperty", {
enumerable: true,
get: function () {
return _index.objectTypeSpreadProperty;
}
});
Object.defineProperty(exports, "OpaqueType", {
enumerable: true,
get: function () {
return _index.opaqueType;
}
});
Object.defineProperty(exports, "QualifiedTypeIdentifier", {
enumerable: true,
get: function () {
return _index.qualifiedTypeIdentifier;
}
});
Object.defineProperty(exports, "StringLiteralTypeAnnotation", {
enumerable: true,
get: function () {
return _index.stringLiteralTypeAnnotation;
}
});
Object.defineProperty(exports, "StringTypeAnnotation", {
enumerable: true,
get: function () {
return _index.stringTypeAnnotation;
}
});
Object.defineProperty(exports, "SymbolTypeAnnotation", {
enumerable: true,
get: function () {
return _index.symbolTypeAnnotation;
}
});
Object.defineProperty(exports, "ThisTypeAnnotation", {
enumerable: true,
get: function () {
return _index.thisTypeAnnotation;
}
});
Object.defineProperty(exports, "TupleTypeAnnotation", {
enumerable: true,
get: function () {
return _index.tupleTypeAnnotation;
}
});
Object.defineProperty(exports, "TypeofTypeAnnotation", {
enumerable: true,
get: function () {
return _index.typeofTypeAnnotation;
}
});
Object.defineProperty(exports, "TypeAlias", {
enumerable: true,
get: function () {
return _index.typeAlias;
}
});
Object.defineProperty(exports, "TypeAnnotation", {
enumerable: true,
get: function () {
return _index.typeAnnotation;
}
});
Object.defineProperty(exports, "TypeCastExpression", {
enumerable: true,
get: function () {
return _index.typeCastExpression;
}
});
Object.defineProperty(exports, "TypeParameter", {
enumerable: true,
get: function () {
return _index.typeParameter;
}
});
Object.defineProperty(exports, "TypeParameterDeclaration", {
enumerable: true,
get: function () {
return _index.typeParameterDeclaration;
}
});
Object.defineProperty(exports, "TypeParameterInstantiation", {
enumerable: true,
get: function () {
return _index.typeParameterInstantiation;
}
});
Object.defineProperty(exports, "UnionTypeAnnotation", {
enumerable: true,
get: function () {
return _index.unionTypeAnnotation;
}
});
Object.defineProperty(exports, "Variance", {
enumerable: true,
get: function () {
return _index.variance;
}
});
Object.defineProperty(exports, "VoidTypeAnnotation", {
enumerable: true,
get: function () {
return _index.voidTypeAnnotation;
}
});
Object.defineProperty(exports, "EnumDeclaration", {
enumerable: true,
get: function () {
return _index.enumDeclaration;
}
});
Object.defineProperty(exports, "EnumBooleanBody", {
enumerable: true,
get: function () {
return _index.enumBooleanBody;
}
});
Object.defineProperty(exports, "EnumNumberBody", {
enumerable: true,
get: function () {
return _index.enumNumberBody;
}
});
Object.defineProperty(exports, "EnumStringBody", {
enumerable: true,
get: function () {
return _index.enumStringBody;
}
});
Object.defineProperty(exports, "EnumSymbolBody", {
enumerable: true,
get: function () {
return _index.enumSymbolBody;
}
});
Object.defineProperty(exports, "EnumBooleanMember", {
enumerable: true,
get: function () {
return _index.enumBooleanMember;
}
});
Object.defineProperty(exports, "EnumNumberMember", {
enumerable: true,
get: function () {
return _index.enumNumberMember;
}
});
Object.defineProperty(exports, "EnumStringMember", {
enumerable: true,
get: function () {
return _index.enumStringMember;
}
});
Object.defineProperty(exports, "EnumDefaultedMember", {
enumerable: true,
get: function () {
return _index.enumDefaultedMember;
}
});
Object.defineProperty(exports, "IndexedAccessType", {
enumerable: true,
get: function () {
return _index.indexedAccessType;
}
});
Object.defineProperty(exports, "OptionalIndexedAccessType", {
enumerable: true,
get: function () {
return _index.optionalIndexedAccessType;
}
});
Object.defineProperty(exports, "JSXAttribute", {
enumerable: true,
get: function () {
return _index.jsxAttribute;
}
});
Object.defineProperty(exports, "JSXClosingElement", {
enumerable: true,
get: function () {
return _index.jsxClosingElement;
}
});
Object.defineProperty(exports, "JSXElement", {
enumerable: true,
get: function () {
return _index.jsxElement;
}
});
Object.defineProperty(exports, "JSXEmptyExpression", {
enumerable: true,
get: function () {
return _index.jsxEmptyExpression;
}
});
Object.defineProperty(exports, "JSXExpressionContainer", {
enumerable: true,
get: function () {
return _index.jsxExpressionContainer;
}
});
Object.defineProperty(exports, "JSXSpreadChild", {
enumerable: true,
get: function () {
return _index.jsxSpreadChild;
}
});
Object.defineProperty(exports, "JSXIdentifier", {
enumerable: true,
get: function () {
return _index.jsxIdentifier;
}
});
Object.defineProperty(exports, "JSXMemberExpression", {
enumerable: true,
get: function () {
return _index.jsxMemberExpression;
}
});
Object.defineProperty(exports, "JSXNamespacedName", {
enumerable: true,
get: function () {
return _index.jsxNamespacedName;
}
});
Object.defineProperty(exports, "JSXOpeningElement", {
enumerable: true,
get: function () {
return _index.jsxOpeningElement;
}
});
Object.defineProperty(exports, "JSXSpreadAttribute", {
enumerable: true,
get: function () {
return _index.jsxSpreadAttribute;
}
});
Object.defineProperty(exports, "JSXText", {
enumerable: true,
get: function () {
return _index.jsxText;
}
});
Object.defineProperty(exports, "JSXFragment", {
enumerable: true,
get: function () {
return _index.jsxFragment;
}
});
Object.defineProperty(exports, "JSXOpeningFragment", {
enumerable: true,
get: function () {
return _index.jsxOpeningFragment;
}
});
Object.defineProperty(exports, "JSXClosingFragment", {
enumerable: true,
get: function () {
return _index.jsxClosingFragment;
}
});
Object.defineProperty(exports, "Noop", {
enumerable: true,
get: function () {
return _index.noop;
}
});
Object.defineProperty(exports, "Placeholder", {
enumerable: true,
get: function () {
return _index.placeholder;
}
});
Object.defineProperty(exports, "V8IntrinsicIdentifier", {
enumerable: true,
get: function () {
return _index.v8IntrinsicIdentifier;
}
});
Object.defineProperty(exports, "ArgumentPlaceholder", {
enumerable: true,
get: function () {
return _index.argumentPlaceholder;
}
});
Object.defineProperty(exports, "BindExpression", {
enumerable: true,
get: function () {
return _index.bindExpression;
}
});
Object.defineProperty(exports, "ImportAttribute", {
enumerable: true,
get: function () {
return _index.importAttribute;
}
});
Object.defineProperty(exports, "Decorator", {
enumerable: true,
get: function () {
return _index.decorator;
}
});
Object.defineProperty(exports, "DoExpression", {
enumerable: true,
get: function () {
return _index.doExpression;
}
});
Object.defineProperty(exports, "ExportDefaultSpecifier", {
enumerable: true,
get: function () {
return _index.exportDefaultSpecifier;
}
});
Object.defineProperty(exports, "RecordExpression", {
enumerable: true,
get: function () {
return _index.recordExpression;
}
});
Object.defineProperty(exports, "TupleExpression", {
enumerable: true,
get: function () {
return _index.tupleExpression;
}
});
Object.defineProperty(exports, "DecimalLiteral", {
enumerable: true,
get: function () {
return _index.decimalLiteral;
}
});
Object.defineProperty(exports, "StaticBlock", {
enumerable: true,
get: function () {
return _index.staticBlock;
}
});
Object.defineProperty(exports, "ModuleExpression", {
enumerable: true,
get: function () {
return _index.moduleExpression;
}
});
Object.defineProperty(exports, "TopicReference", {
enumerable: true,
get: function () {
return _index.topicReference;
}
});
Object.defineProperty(exports, "PipelineTopicExpression", {
enumerable: true,
get: function () {
return _index.pipelineTopicExpression;
}
});
Object.defineProperty(exports, "PipelineBareFunction", {
enumerable: true,
get: function () {
return _index.pipelineBareFunction;
}
});
Object.defineProperty(exports, "PipelinePrimaryTopicReference", {
enumerable: true,
get: function () {
return _index.pipelinePrimaryTopicReference;
}
});
Object.defineProperty(exports, "TSParameterProperty", {
enumerable: true,
get: function () {
return _index.tsParameterProperty;
}
});
Object.defineProperty(exports, "TSDeclareFunction", {
enumerable: true,
get: function () {
return _index.tsDeclareFunction;
}
});
Object.defineProperty(exports, "TSDeclareMethod", {
enumerable: true,
get: function () {
return _index.tsDeclareMethod;
}
});
Object.defineProperty(exports, "TSQualifiedName", {
enumerable: true,
get: function () {
return _index.tsQualifiedName;
}
});
Object.defineProperty(exports, "TSCallSignatureDeclaration", {
enumerable: true,
get: function () {
return _index.tsCallSignatureDeclaration;
}
});
Object.defineProperty(exports, "TSConstructSignatureDeclaration", {
enumerable: true,
get: function () {
return _index.tsConstructSignatureDeclaration;
}
});
Object.defineProperty(exports, "TSPropertySignature", {
enumerable: true,
get: function () {
return _index.tsPropertySignature;
}
});
Object.defineProperty(exports, "TSMethodSignature", {
enumerable: true,
get: function () {
return _index.tsMethodSignature;
}
});
Object.defineProperty(exports, "TSIndexSignature", {
enumerable: true,
get: function () {
return _index.tsIndexSignature;
}
});
Object.defineProperty(exports, "TSAnyKeyword", {
enumerable: true,
get: function () {
return _index.tsAnyKeyword;
}
});
Object.defineProperty(exports, "TSBooleanKeyword", {
enumerable: true,
get: function () {
return _index.tsBooleanKeyword;
}
});
Object.defineProperty(exports, "TSBigIntKeyword", {
enumerable: true,
get: function () {
return _index.tsBigIntKeyword;
}
});
Object.defineProperty(exports, "TSIntrinsicKeyword", {
enumerable: true,
get: function () {
return _index.tsIntrinsicKeyword;
}
});
Object.defineProperty(exports, "TSNeverKeyword", {
enumerable: true,
get: function () {
return _index.tsNeverKeyword;
}
});
Object.defineProperty(exports, "TSNullKeyword", {
enumerable: true,
get: function () {
return _index.tsNullKeyword;
}
});
Object.defineProperty(exports, "TSNumberKeyword", {
enumerable: true,
get: function () {
return _index.tsNumberKeyword;
}
});
Object.defineProperty(exports, "TSObjectKeyword", {
enumerable: true,
get: function () {
return _index.tsObjectKeyword;
}
});
Object.defineProperty(exports, "TSStringKeyword", {
enumerable: true,
get: function () {
return _index.tsStringKeyword;
}
});
Object.defineProperty(exports, "TSSymbolKeyword", {
enumerable: true,
get: function () {
return _index.tsSymbolKeyword;
}
});
Object.defineProperty(exports, "TSUndefinedKeyword", {
enumerable: true,
get: function () {
return _index.tsUndefinedKeyword;
}
});
Object.defineProperty(exports, "TSUnknownKeyword", {
enumerable: true,
get: function () {
return _index.tsUnknownKeyword;
}
});
Object.defineProperty(exports, "TSVoidKeyword", {
enumerable: true,
get: function () {
return _index.tsVoidKeyword;
}
});
Object.defineProperty(exports, "TSThisType", {
enumerable: true,
get: function () {
return _index.tsThisType;
}
});
Object.defineProperty(exports, "TSFunctionType", {
enumerable: true,
get: function () {
return _index.tsFunctionType;
}
});
Object.defineProperty(exports, "TSConstructorType", {
enumerable: true,
get: function () {
return _index.tsConstructorType;
}
});
Object.defineProperty(exports, "TSTypeReference", {
enumerable: true,
get: function () {
return _index.tsTypeReference;
}
});
Object.defineProperty(exports, "TSTypePredicate", {
enumerable: true,
get: function () {
return _index.tsTypePredicate;
}
});
Object.defineProperty(exports, "TSTypeQuery", {
enumerable: true,
get: function () {
return _index.tsTypeQuery;
}
});
Object.defineProperty(exports, "TSTypeLiteral", {
enumerable: true,
get: function () {
return _index.tsTypeLiteral;
}
});
Object.defineProperty(exports, "TSArrayType", {
enumerable: true,
get: function () {
return _index.tsArrayType;
}
});
Object.defineProperty(exports, "TSTupleType", {
enumerable: true,
get: function () {
return _index.tsTupleType;
}
});
Object.defineProperty(exports, "TSOptionalType", {
enumerable: true,
get: function () {
return _index.tsOptionalType;
}
});
Object.defineProperty(exports, "TSRestType", {
enumerable: true,
get: function () {
return _index.tsRestType;
}
});
Object.defineProperty(exports, "TSNamedTupleMember", {
enumerable: true,
get: function () {
return _index.tsNamedTupleMember;
}
});
Object.defineProperty(exports, "TSUnionType", {
enumerable: true,
get: function () {
return _index.tsUnionType;
}
});
Object.defineProperty(exports, "TSIntersectionType", {
enumerable: true,
get: function () {
return _index.tsIntersectionType;
}
});
Object.defineProperty(exports, "TSConditionalType", {
enumerable: true,
get: function () {
return _index.tsConditionalType;
}
});
Object.defineProperty(exports, "TSInferType", {
enumerable: true,
get: function () {
return _index.tsInferType;
}
});
Object.defineProperty(exports, "TSParenthesizedType", {
enumerable: true,
get: function () {
return _index.tsParenthesizedType;
}
});
Object.defineProperty(exports, "TSTypeOperator", {
enumerable: true,
get: function () {
return _index.tsTypeOperator;
}
});
Object.defineProperty(exports, "TSIndexedAccessType", {
enumerable: true,
get: function () {
return _index.tsIndexedAccessType;
}
});
Object.defineProperty(exports, "TSMappedType", {
enumerable: true,
get: function () {
return _index.tsMappedType;
}
});
Object.defineProperty(exports, "TSLiteralType", {
enumerable: true,
get: function () {
return _index.tsLiteralType;
}
});
Object.defineProperty(exports, "TSExpressionWithTypeArguments", {
enumerable: true,
get: function () {
return _index.tsExpressionWithTypeArguments;
}
});
Object.defineProperty(exports, "TSInterfaceDeclaration", {
enumerable: true,
get: function () {
return _index.tsInterfaceDeclaration;
}
});
Object.defineProperty(exports, "TSInterfaceBody", {
enumerable: true,
get: function () {
return _index.tsInterfaceBody;
}
});
Object.defineProperty(exports, "TSTypeAliasDeclaration", {
enumerable: true,
get: function () {
return _index.tsTypeAliasDeclaration;
}
});
Object.defineProperty(exports, "TSAsExpression", {
enumerable: true,
get: function () {
return _index.tsAsExpression;
}
});
Object.defineProperty(exports, "TSTypeAssertion", {
enumerable: true,
get: function () {
return _index.tsTypeAssertion;
}
});
Object.defineProperty(exports, "TSEnumDeclaration", {
enumerable: true,
get: function () {
return _index.tsEnumDeclaration;
}
});
Object.defineProperty(exports, "TSEnumMember", {
enumerable: true,
get: function () {
return _index.tsEnumMember;
}
});
Object.defineProperty(exports, "TSModuleDeclaration", {
enumerable: true,
get: function () {
return _index.tsModuleDeclaration;
}
});
Object.defineProperty(exports, "TSModuleBlock", {
enumerable: true,
get: function () {
return _index.tsModuleBlock;
}
});
Object.defineProperty(exports, "TSImportType", {
enumerable: true,
get: function () {
return _index.tsImportType;
}
});
Object.defineProperty(exports, "TSImportEqualsDeclaration", {
enumerable: true,
get: function () {
return _index.tsImportEqualsDeclaration;
}
});
Object.defineProperty(exports, "TSExternalModuleReference", {
enumerable: true,
get: function () {
return _index.tsExternalModuleReference;
}
});
Object.defineProperty(exports, "TSNonNullExpression", {
enumerable: true,
get: function () {
return _index.tsNonNullExpression;
}
});
Object.defineProperty(exports, "TSExportAssignment", {
enumerable: true,
get: function () {
return _index.tsExportAssignment;
}
});
Object.defineProperty(exports, "TSNamespaceExportDeclaration", {
enumerable: true,
get: function () {
return _index.tsNamespaceExportDeclaration;
}
});
Object.defineProperty(exports, "TSTypeAnnotation", {
enumerable: true,
get: function () {
return _index.tsTypeAnnotation;
}
});
Object.defineProperty(exports, "TSTypeParameterInstantiation", {
enumerable: true,
get: function () {
return _index.tsTypeParameterInstantiation;
}
});
Object.defineProperty(exports, "TSTypeParameterDeclaration", {
enumerable: true,
get: function () {
return _index.tsTypeParameterDeclaration;
}
});
Object.defineProperty(exports, "TSTypeParameter", {
enumerable: true,
get: function () {
return _index.tsTypeParameter;
}
});
Object.defineProperty(exports, "NumberLiteral", {
enumerable: true,
get: function () {
return _index.numberLiteral;
}
});
Object.defineProperty(exports, "RegexLiteral", {
enumerable: true,
get: function () {
return _index.regexLiteral;
}
});
Object.defineProperty(exports, "RestProperty", {
enumerable: true,
get: function () {
return _index.restProperty;
}
});
Object.defineProperty(exports, "SpreadProperty", {
enumerable: true,
get: function () {
return _index.spreadProperty;
}
});
var _index = generated$3;
}(uppercase));
var cloneNode$1 = {};
Object.defineProperty(cloneNode$1, "__esModule", {
value: true
});
cloneNode$1.default = cloneNode;
var _definitions$4 = definitions;
var _generated$g = generated$4;
const has = Function.call.bind(Object.prototype.hasOwnProperty);
function cloneIfNode(obj, deep, withoutLoc) {
if (obj && typeof obj.type === "string") {
return cloneNode(obj, deep, withoutLoc);
}
return obj;
}
function cloneIfNodeOrArray(obj, deep, withoutLoc) {
if (Array.isArray(obj)) {
return obj.map(node => cloneIfNode(node, deep, withoutLoc));
}
return cloneIfNode(obj, deep, withoutLoc);
}
function cloneNode(node, deep = true, withoutLoc = false) {
if (!node) return node;
const {
type
} = node;
const newNode = {
type: node.type
};
if ((0, _generated$g.isIdentifier)(node)) {
newNode.name = node.name;
if (has(node, "optional") && typeof node.optional === "boolean") {
newNode.optional = node.optional;
}
if (has(node, "typeAnnotation")) {
newNode.typeAnnotation = deep ? cloneIfNodeOrArray(node.typeAnnotation, true, withoutLoc) : node.typeAnnotation;
}
} else if (!has(_definitions$4.NODE_FIELDS, type)) {
throw new Error(`Unknown node type: "${type}"`);
} else {
for (const field of Object.keys(_definitions$4.NODE_FIELDS[type])) {
if (has(node, field)) {
if (deep) {
newNode[field] = (0, _generated$g.isFile)(node) && field === "comments" ? maybeCloneComments(node.comments, deep, withoutLoc) : cloneIfNodeOrArray(node[field], true, withoutLoc);
} else {
newNode[field] = node[field];
}
}
}
}
if (has(node, "loc")) {
if (withoutLoc) {
newNode.loc = null;
} else {
newNode.loc = node.loc;
}
}
if (has(node, "leadingComments")) {
newNode.leadingComments = maybeCloneComments(node.leadingComments, deep, withoutLoc);
}
if (has(node, "innerComments")) {
newNode.innerComments = maybeCloneComments(node.innerComments, deep, withoutLoc);
}
if (has(node, "trailingComments")) {
newNode.trailingComments = maybeCloneComments(node.trailingComments, deep, withoutLoc);
}
if (has(node, "extra")) {
newNode.extra = Object.assign({}, node.extra);
}
return newNode;
}
function maybeCloneComments(comments, deep, withoutLoc) {
if (!comments || !deep) {
return comments;
}
return comments.map(({
type,
value,
loc
}) => {
if (withoutLoc) {
return {
type,
value,
loc: null
};
}
return {
type,
value,
loc
};
});
}
var clone$1 = {};
Object.defineProperty(clone$1, "__esModule", {
value: true
});
clone$1.default = clone;
var _cloneNode$5 = cloneNode$1;
function clone(node) {
return (0, _cloneNode$5.default)(node, false);
}
var cloneDeep$1 = {};
Object.defineProperty(cloneDeep$1, "__esModule", {
value: true
});
cloneDeep$1.default = cloneDeep;
var _cloneNode$4 = cloneNode$1;
function cloneDeep(node) {
return (0, _cloneNode$4.default)(node);
}
var cloneDeepWithoutLoc$1 = {};
Object.defineProperty(cloneDeepWithoutLoc$1, "__esModule", {
value: true
});
cloneDeepWithoutLoc$1.default = cloneDeepWithoutLoc;
var _cloneNode$3 = cloneNode$1;
function cloneDeepWithoutLoc(node) {
return (0, _cloneNode$3.default)(node, true, true);
}
var cloneWithoutLoc$1 = {};
Object.defineProperty(cloneWithoutLoc$1, "__esModule", {
value: true
});
cloneWithoutLoc$1.default = cloneWithoutLoc;
var _cloneNode$2 = cloneNode$1;
function cloneWithoutLoc(node) {
return (0, _cloneNode$2.default)(node, false, true);
}
var addComment$1 = {};
var addComments$1 = {};
Object.defineProperty(addComments$1, "__esModule", {
value: true
});
addComments$1.default = addComments;
function addComments(node, type, comments) {
if (!comments || !node) return node;
const key = `${type}Comments`;
if (node[key]) {
if (type === "leading") {
node[key] = comments.concat(node[key]);
} else {
node[key] = node[key].concat(comments);
}
} else {
node[key] = comments;
}
return node;
}
Object.defineProperty(addComment$1, "__esModule", {
value: true
});
addComment$1.default = addComment;
var _addComments = addComments$1;
function addComment(node, type, content, line) {
return (0, _addComments.default)(node, type, [{
type: line ? "CommentLine" : "CommentBlock",
value: content
}]);
}
var inheritInnerComments$1 = {};
var inherit$1 = {};
Object.defineProperty(inherit$1, "__esModule", {
value: true
});
inherit$1.default = inherit;
function inherit(key, child, parent) {
if (child && parent) {
child[key] = Array.from(new Set([].concat(child[key], parent[key]).filter(Boolean)));
}
}
Object.defineProperty(inheritInnerComments$1, "__esModule", {
value: true
});
inheritInnerComments$1.default = inheritInnerComments;
var _inherit$2 = inherit$1;
function inheritInnerComments(child, parent) {
(0, _inherit$2.default)("innerComments", child, parent);
}
var inheritLeadingComments$1 = {};
Object.defineProperty(inheritLeadingComments$1, "__esModule", {
value: true
});
inheritLeadingComments$1.default = inheritLeadingComments;
var _inherit$1 = inherit$1;
function inheritLeadingComments(child, parent) {
(0, _inherit$1.default)("leadingComments", child, parent);
}
var inheritsComments$1 = {};
var inheritTrailingComments$1 = {};
Object.defineProperty(inheritTrailingComments$1, "__esModule", {
value: true
});
inheritTrailingComments$1.default = inheritTrailingComments;
var _inherit = inherit$1;
function inheritTrailingComments(child, parent) {
(0, _inherit.default)("trailingComments", child, parent);
}
Object.defineProperty(inheritsComments$1, "__esModule", {
value: true
});
inheritsComments$1.default = inheritsComments;
var _inheritTrailingComments = inheritTrailingComments$1;
var _inheritLeadingComments = inheritLeadingComments$1;
var _inheritInnerComments = inheritInnerComments$1;
function inheritsComments(child, parent) {
(0, _inheritTrailingComments.default)(child, parent);
(0, _inheritLeadingComments.default)(child, parent);
(0, _inheritInnerComments.default)(child, parent);
return child;
}
var removeComments$1 = {};
Object.defineProperty(removeComments$1, "__esModule", {
value: true
});
removeComments$1.default = removeComments;
var _constants$4 = constants;
function removeComments(node) {
_constants$4.COMMENT_KEYS.forEach(key => {
node[key] = null;
});
return node;
}
var generated$1 = {};
Object.defineProperty(generated$1, "__esModule", {
value: true
});
generated$1.TSBASETYPE_TYPES = generated$1.TSTYPE_TYPES = generated$1.TSTYPEELEMENT_TYPES = generated$1.JSX_TYPES = generated$1.ENUMMEMBER_TYPES = generated$1.ENUMBODY_TYPES = generated$1.FLOWPREDICATE_TYPES = generated$1.FLOWDECLARATION_TYPES = generated$1.FLOWBASEANNOTATION_TYPES = generated$1.FLOWTYPE_TYPES = generated$1.FLOW_TYPES = generated$1.PRIVATE_TYPES = generated$1.MODULESPECIFIER_TYPES = generated$1.EXPORTDECLARATION_TYPES = generated$1.MODULEDECLARATION_TYPES = generated$1.CLASS_TYPES = generated$1.PATTERN_TYPES = generated$1.UNARYLIKE_TYPES = generated$1.PROPERTY_TYPES = generated$1.OBJECTMEMBER_TYPES = generated$1.METHOD_TYPES = generated$1.USERWHITESPACABLE_TYPES = generated$1.IMMUTABLE_TYPES = generated$1.LITERAL_TYPES = generated$1.TSENTITYNAME_TYPES = generated$1.LVAL_TYPES = generated$1.PATTERNLIKE_TYPES = generated$1.DECLARATION_TYPES = generated$1.PUREISH_TYPES = generated$1.FUNCTIONPARENT_TYPES = generated$1.FUNCTION_TYPES = generated$1.FORXSTATEMENT_TYPES = generated$1.FOR_TYPES = generated$1.EXPRESSIONWRAPPER_TYPES = generated$1.WHILE_TYPES = generated$1.LOOP_TYPES = generated$1.CONDITIONAL_TYPES = generated$1.COMPLETIONSTATEMENT_TYPES = generated$1.TERMINATORLESS_TYPES = generated$1.STATEMENT_TYPES = generated$1.BLOCK_TYPES = generated$1.BLOCKPARENT_TYPES = generated$1.SCOPABLE_TYPES = generated$1.BINARY_TYPES = generated$1.EXPRESSION_TYPES = void 0;
var _definitions$3 = definitions;
const EXPRESSION_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Expression"];
generated$1.EXPRESSION_TYPES = EXPRESSION_TYPES;
const BINARY_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Binary"];
generated$1.BINARY_TYPES = BINARY_TYPES;
const SCOPABLE_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Scopable"];
generated$1.SCOPABLE_TYPES = SCOPABLE_TYPES;
const BLOCKPARENT_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["BlockParent"];
generated$1.BLOCKPARENT_TYPES = BLOCKPARENT_TYPES;
const BLOCK_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Block"];
generated$1.BLOCK_TYPES = BLOCK_TYPES;
const STATEMENT_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Statement"];
generated$1.STATEMENT_TYPES = STATEMENT_TYPES;
const TERMINATORLESS_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Terminatorless"];
generated$1.TERMINATORLESS_TYPES = TERMINATORLESS_TYPES;
const COMPLETIONSTATEMENT_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["CompletionStatement"];
generated$1.COMPLETIONSTATEMENT_TYPES = COMPLETIONSTATEMENT_TYPES;
const CONDITIONAL_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Conditional"];
generated$1.CONDITIONAL_TYPES = CONDITIONAL_TYPES;
const LOOP_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Loop"];
generated$1.LOOP_TYPES = LOOP_TYPES;
const WHILE_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["While"];
generated$1.WHILE_TYPES = WHILE_TYPES;
const EXPRESSIONWRAPPER_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["ExpressionWrapper"];
generated$1.EXPRESSIONWRAPPER_TYPES = EXPRESSIONWRAPPER_TYPES;
const FOR_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["For"];
generated$1.FOR_TYPES = FOR_TYPES;
const FORXSTATEMENT_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["ForXStatement"];
generated$1.FORXSTATEMENT_TYPES = FORXSTATEMENT_TYPES;
const FUNCTION_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Function"];
generated$1.FUNCTION_TYPES = FUNCTION_TYPES;
const FUNCTIONPARENT_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["FunctionParent"];
generated$1.FUNCTIONPARENT_TYPES = FUNCTIONPARENT_TYPES;
const PUREISH_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Pureish"];
generated$1.PUREISH_TYPES = PUREISH_TYPES;
const DECLARATION_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Declaration"];
generated$1.DECLARATION_TYPES = DECLARATION_TYPES;
const PATTERNLIKE_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["PatternLike"];
generated$1.PATTERNLIKE_TYPES = PATTERNLIKE_TYPES;
const LVAL_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["LVal"];
generated$1.LVAL_TYPES = LVAL_TYPES;
const TSENTITYNAME_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["TSEntityName"];
generated$1.TSENTITYNAME_TYPES = TSENTITYNAME_TYPES;
const LITERAL_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Literal"];
generated$1.LITERAL_TYPES = LITERAL_TYPES;
const IMMUTABLE_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Immutable"];
generated$1.IMMUTABLE_TYPES = IMMUTABLE_TYPES;
const USERWHITESPACABLE_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["UserWhitespacable"];
generated$1.USERWHITESPACABLE_TYPES = USERWHITESPACABLE_TYPES;
const METHOD_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Method"];
generated$1.METHOD_TYPES = METHOD_TYPES;
const OBJECTMEMBER_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["ObjectMember"];
generated$1.OBJECTMEMBER_TYPES = OBJECTMEMBER_TYPES;
const PROPERTY_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Property"];
generated$1.PROPERTY_TYPES = PROPERTY_TYPES;
const UNARYLIKE_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["UnaryLike"];
generated$1.UNARYLIKE_TYPES = UNARYLIKE_TYPES;
const PATTERN_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Pattern"];
generated$1.PATTERN_TYPES = PATTERN_TYPES;
const CLASS_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Class"];
generated$1.CLASS_TYPES = CLASS_TYPES;
const MODULEDECLARATION_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["ModuleDeclaration"];
generated$1.MODULEDECLARATION_TYPES = MODULEDECLARATION_TYPES;
const EXPORTDECLARATION_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["ExportDeclaration"];
generated$1.EXPORTDECLARATION_TYPES = EXPORTDECLARATION_TYPES;
const MODULESPECIFIER_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["ModuleSpecifier"];
generated$1.MODULESPECIFIER_TYPES = MODULESPECIFIER_TYPES;
const PRIVATE_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Private"];
generated$1.PRIVATE_TYPES = PRIVATE_TYPES;
const FLOW_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Flow"];
generated$1.FLOW_TYPES = FLOW_TYPES;
const FLOWTYPE_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["FlowType"];
generated$1.FLOWTYPE_TYPES = FLOWTYPE_TYPES;
const FLOWBASEANNOTATION_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["FlowBaseAnnotation"];
generated$1.FLOWBASEANNOTATION_TYPES = FLOWBASEANNOTATION_TYPES;
const FLOWDECLARATION_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["FlowDeclaration"];
generated$1.FLOWDECLARATION_TYPES = FLOWDECLARATION_TYPES;
const FLOWPREDICATE_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["FlowPredicate"];
generated$1.FLOWPREDICATE_TYPES = FLOWPREDICATE_TYPES;
const ENUMBODY_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["EnumBody"];
generated$1.ENUMBODY_TYPES = ENUMBODY_TYPES;
const ENUMMEMBER_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["EnumMember"];
generated$1.ENUMMEMBER_TYPES = ENUMMEMBER_TYPES;
const JSX_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["JSX"];
generated$1.JSX_TYPES = JSX_TYPES;
const TSTYPEELEMENT_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["TSTypeElement"];
generated$1.TSTYPEELEMENT_TYPES = TSTYPEELEMENT_TYPES;
const TSTYPE_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["TSType"];
generated$1.TSTYPE_TYPES = TSTYPE_TYPES;
const TSBASETYPE_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["TSBaseType"];
generated$1.TSBASETYPE_TYPES = TSBASETYPE_TYPES;
var ensureBlock$1 = {};
var toBlock$1 = {};
Object.defineProperty(toBlock$1, "__esModule", {
value: true
});
toBlock$1.default = toBlock;
var _generated$f = generated$4;
var _generated2$3 = generated$3;
function toBlock(node, parent) {
if ((0, _generated$f.isBlockStatement)(node)) {
return node;
}
let blockNodes = [];
if ((0, _generated$f.isEmptyStatement)(node)) {
blockNodes = [];
} else {
if (!(0, _generated$f.isStatement)(node)) {
if ((0, _generated$f.isFunction)(parent)) {
node = (0, _generated2$3.returnStatement)(node);
} else {
node = (0, _generated2$3.expressionStatement)(node);
}
}
blockNodes = [node];
}
return (0, _generated2$3.blockStatement)(blockNodes);
}
Object.defineProperty(ensureBlock$1, "__esModule", {
value: true
});
ensureBlock$1.default = ensureBlock;
var _toBlock = toBlock$1;
function ensureBlock(node, key = "body") {
return node[key] = (0, _toBlock.default)(node[key], node);
}
var toBindingIdentifierName$1 = {};
var toIdentifier$1 = {};
Object.defineProperty(toIdentifier$1, "__esModule", {
value: true
});
toIdentifier$1.default = toIdentifier;
var _isValidIdentifier$2 = isValidIdentifier$1;
var _helperValidatorIdentifier = lib;
function toIdentifier(input) {
input = input + "";
let name = "";
for (const c of input) {
name += (0, _helperValidatorIdentifier.isIdentifierChar)(c.codePointAt(0)) ? c : "-";
}
name = name.replace(/^[-0-9]+/, "");
name = name.replace(/[-\s]+(.)?/g, function (match, c) {
return c ? c.toUpperCase() : "";
});
if (!(0, _isValidIdentifier$2.default)(name)) {
name = `_${name}`;
}
return name || "_";
}
Object.defineProperty(toBindingIdentifierName$1, "__esModule", {
value: true
});
toBindingIdentifierName$1.default = toBindingIdentifierName;
var _toIdentifier = toIdentifier$1;
function toBindingIdentifierName(name) {
name = (0, _toIdentifier.default)(name);
if (name === "eval" || name === "arguments") name = "_" + name;
return name;
}
var toComputedKey$1 = {};
Object.defineProperty(toComputedKey$1, "__esModule", {
value: true
});
toComputedKey$1.default = toComputedKey;
var _generated$e = generated$4;
var _generated2$2 = generated$3;
function toComputedKey(node, key = node.key || node.property) {
if (!node.computed && (0, _generated$e.isIdentifier)(key)) key = (0, _generated2$2.stringLiteral)(key.name);
return key;
}
var toExpression$1 = {};
Object.defineProperty(toExpression$1, "__esModule", {
value: true
});
toExpression$1.default = void 0;
var _generated$d = generated$4;
var _default$3 = toExpression;
toExpression$1.default = _default$3;
function toExpression(node) {
if ((0, _generated$d.isExpressionStatement)(node)) {
node = node.expression;
}
if ((0, _generated$d.isExpression)(node)) {
return node;
}
if ((0, _generated$d.isClass)(node)) {
node.type = "ClassExpression";
} else if ((0, _generated$d.isFunction)(node)) {
node.type = "FunctionExpression";
}
if (!(0, _generated$d.isExpression)(node)) {
throw new Error(`cannot turn ${node.type} to an expression`);
}
return node;
}
var toKeyAlias$1 = {};
var removePropertiesDeep$1 = {};
var traverseFast$1 = {};
Object.defineProperty(traverseFast$1, "__esModule", {
value: true
});
traverseFast$1.default = traverseFast;
var _definitions$2 = definitions;
function traverseFast(node, enter, opts) {
if (!node) return;
const keys = _definitions$2.VISITOR_KEYS[node.type];
if (!keys) return;
opts = opts || {};
enter(node, opts);
for (const key of keys) {
const subNode = node[key];
if (Array.isArray(subNode)) {
for (const node of subNode) {
traverseFast(node, enter, opts);
}
} else {
traverseFast(subNode, enter, opts);
}
}
}
var removeProperties$1 = {};
Object.defineProperty(removeProperties$1, "__esModule", {
value: true
});
removeProperties$1.default = removeProperties;
var _constants$3 = constants;
const CLEAR_KEYS = ["tokens", "start", "end", "loc", "raw", "rawValue"];
const CLEAR_KEYS_PLUS_COMMENTS = _constants$3.COMMENT_KEYS.concat(["comments"]).concat(CLEAR_KEYS);
function removeProperties(node, opts = {}) {
const map = opts.preserveComments ? CLEAR_KEYS : CLEAR_KEYS_PLUS_COMMENTS;
for (const key of map) {
if (node[key] != null) node[key] = undefined;
}
for (const key of Object.keys(node)) {
if (key[0] === "_" && node[key] != null) node[key] = undefined;
}
const symbols = Object.getOwnPropertySymbols(node);
for (const sym of symbols) {
node[sym] = null;
}
}
Object.defineProperty(removePropertiesDeep$1, "__esModule", {
value: true
});
removePropertiesDeep$1.default = removePropertiesDeep;
var _traverseFast = traverseFast$1;
var _removeProperties = removeProperties$1;
function removePropertiesDeep(tree, opts) {
(0, _traverseFast.default)(tree, _removeProperties.default, opts);
return tree;
}
Object.defineProperty(toKeyAlias$1, "__esModule", {
value: true
});
toKeyAlias$1.default = toKeyAlias;
var _generated$c = generated$4;
var _cloneNode$1 = cloneNode$1;
var _removePropertiesDeep = removePropertiesDeep$1;
function toKeyAlias(node, key = node.key) {
let alias;
if (node.kind === "method") {
return toKeyAlias.increment() + "";
} else if ((0, _generated$c.isIdentifier)(key)) {
alias = key.name;
} else if ((0, _generated$c.isStringLiteral)(key)) {
alias = JSON.stringify(key.value);
} else {
alias = JSON.stringify((0, _removePropertiesDeep.default)((0, _cloneNode$1.default)(key)));
}
if (node.computed) {
alias = `[${alias}]`;
}
if (node.static) {
alias = `static:${alias}`;
}
return alias;
}
toKeyAlias.uid = 0;
toKeyAlias.increment = function () {
if (toKeyAlias.uid >= Number.MAX_SAFE_INTEGER) {
return toKeyAlias.uid = 0;
} else {
return toKeyAlias.uid++;
}
};
var toSequenceExpression$1 = {};
var gatherSequenceExpressions$1 = {};
var getBindingIdentifiers$1 = {};
Object.defineProperty(getBindingIdentifiers$1, "__esModule", {
value: true
});
getBindingIdentifiers$1.default = getBindingIdentifiers;
var _generated$b = generated$4;
function getBindingIdentifiers(node, duplicates, outerOnly) {
let search = [].concat(node);
const ids = Object.create(null);
while (search.length) {
const id = search.shift();
if (!id) continue;
const keys = getBindingIdentifiers.keys[id.type];
if ((0, _generated$b.isIdentifier)(id)) {
if (duplicates) {
const _ids = ids[id.name] = ids[id.name] || [];
_ids.push(id);
} else {
ids[id.name] = id;
}
continue;
}
if ((0, _generated$b.isExportDeclaration)(id) && !(0, _generated$b.isExportAllDeclaration)(id)) {
if ((0, _generated$b.isDeclaration)(id.declaration)) {
search.push(id.declaration);
}
continue;
}
if (outerOnly) {
if ((0, _generated$b.isFunctionDeclaration)(id)) {
search.push(id.id);
continue;
}
if ((0, _generated$b.isFunctionExpression)(id)) {
continue;
}
}
if (keys) {
for (let i = 0; i < keys.length; i++) {
const key = keys[i];
if (id[key]) {
search = search.concat(id[key]);
}
}
}
}
return ids;
}
getBindingIdentifiers.keys = {
DeclareClass: ["id"],
DeclareFunction: ["id"],
DeclareModule: ["id"],
DeclareVariable: ["id"],
DeclareInterface: ["id"],
DeclareTypeAlias: ["id"],
DeclareOpaqueType: ["id"],
InterfaceDeclaration: ["id"],
TypeAlias: ["id"],
OpaqueType: ["id"],
CatchClause: ["param"],
LabeledStatement: ["label"],
UnaryExpression: ["argument"],
AssignmentExpression: ["left"],
ImportSpecifier: ["local"],
ImportNamespaceSpecifier: ["local"],
ImportDefaultSpecifier: ["local"],
ImportDeclaration: ["specifiers"],
ExportSpecifier: ["exported"],
ExportNamespaceSpecifier: ["exported"],
ExportDefaultSpecifier: ["exported"],
FunctionDeclaration: ["id", "params"],
FunctionExpression: ["id", "params"],
ArrowFunctionExpression: ["params"],
ObjectMethod: ["params"],
ClassMethod: ["params"],
ForInStatement: ["left"],
ForOfStatement: ["left"],
ClassDeclaration: ["id"],
ClassExpression: ["id"],
RestElement: ["argument"],
UpdateExpression: ["argument"],
ObjectProperty: ["value"],
AssignmentPattern: ["left"],
ArrayPattern: ["elements"],
ObjectPattern: ["properties"],
VariableDeclaration: ["declarations"],
VariableDeclarator: ["id"]
};
Object.defineProperty(gatherSequenceExpressions$1, "__esModule", {
value: true
});
gatherSequenceExpressions$1.default = gatherSequenceExpressions;
var _getBindingIdentifiers$2 = getBindingIdentifiers$1;
var _generated$a = generated$4;
var _generated2$1 = generated$3;
var _cloneNode = cloneNode$1;
function gatherSequenceExpressions(nodes, scope, declars) {
const exprs = [];
let ensureLastUndefined = true;
for (const node of nodes) {
if (!(0, _generated$a.isEmptyStatement)(node)) {
ensureLastUndefined = false;
}
if ((0, _generated$a.isExpression)(node)) {
exprs.push(node);
} else if ((0, _generated$a.isExpressionStatement)(node)) {
exprs.push(node.expression);
} else if ((0, _generated$a.isVariableDeclaration)(node)) {
if (node.kind !== "var") return;
for (const declar of node.declarations) {
const bindings = (0, _getBindingIdentifiers$2.default)(declar);
for (const key of Object.keys(bindings)) {
declars.push({
kind: node.kind,
id: (0, _cloneNode.default)(bindings[key])
});
}
if (declar.init) {
exprs.push((0, _generated2$1.assignmentExpression)("=", declar.id, declar.init));
}
}
ensureLastUndefined = true;
} else if ((0, _generated$a.isIfStatement)(node)) {
const consequent = node.consequent ? gatherSequenceExpressions([node.consequent], scope, declars) : scope.buildUndefinedNode();
const alternate = node.alternate ? gatherSequenceExpressions([node.alternate], scope, declars) : scope.buildUndefinedNode();
if (!consequent || !alternate) return;
exprs.push((0, _generated2$1.conditionalExpression)(node.test, consequent, alternate));
} else if ((0, _generated$a.isBlockStatement)(node)) {
const body = gatherSequenceExpressions(node.body, scope, declars);
if (!body) return;
exprs.push(body);
} else if ((0, _generated$a.isEmptyStatement)(node)) {
if (nodes.indexOf(node) === 0) {
ensureLastUndefined = true;
}
} else {
return;
}
}
if (ensureLastUndefined) {
exprs.push(scope.buildUndefinedNode());
}
if (exprs.length === 1) {
return exprs[0];
} else {
return (0, _generated2$1.sequenceExpression)(exprs);
}
}
Object.defineProperty(toSequenceExpression$1, "__esModule", {
value: true
});
toSequenceExpression$1.default = toSequenceExpression;
var _gatherSequenceExpressions = gatherSequenceExpressions$1;
function toSequenceExpression(nodes, scope) {
if (!(nodes != null && nodes.length)) return;
const declars = [];
const result = (0, _gatherSequenceExpressions.default)(nodes, scope, declars);
if (!result) return;
for (const declar of declars) {
scope.push(declar);
}
return result;
}
var toStatement$1 = {};
Object.defineProperty(toStatement$1, "__esModule", {
value: true
});
toStatement$1.default = void 0;
var _generated$9 = generated$4;
var _generated2 = generated$3;
var _default$2 = toStatement;
toStatement$1.default = _default$2;
function toStatement(node, ignore) {
if ((0, _generated$9.isStatement)(node)) {
return node;
}
let mustHaveId = false;
let newType;
if ((0, _generated$9.isClass)(node)) {
mustHaveId = true;
newType = "ClassDeclaration";
} else if ((0, _generated$9.isFunction)(node)) {
mustHaveId = true;
newType = "FunctionDeclaration";
} else if ((0, _generated$9.isAssignmentExpression)(node)) {
return (0, _generated2.expressionStatement)(node);
}
if (mustHaveId && !node.id) {
newType = false;
}
if (!newType) {
if (ignore) {
return false;
} else {
throw new Error(`cannot turn ${node.type} to a statement`);
}
}
node.type = newType;
return node;
}
var valueToNode$1 = {};
Object.defineProperty(valueToNode$1, "__esModule", {
value: true
});
valueToNode$1.default = void 0;
var _isValidIdentifier$1 = isValidIdentifier$1;
var _generated$8 = generated$3;
var _default$1 = valueToNode;
valueToNode$1.default = _default$1;
const objectToString = Function.call.bind(Object.prototype.toString);
function isRegExp(value) {
return objectToString(value) === "[object RegExp]";
}
function isPlainObject(value) {
if (typeof value !== "object" || value === null || Object.prototype.toString.call(value) !== "[object Object]") {
return false;
}
const proto = Object.getPrototypeOf(value);
return proto === null || Object.getPrototypeOf(proto) === null;
}
function valueToNode(value) {
if (value === undefined) {
return (0, _generated$8.identifier)("undefined");
}
if (value === true || value === false) {
return (0, _generated$8.booleanLiteral)(value);
}
if (value === null) {
return (0, _generated$8.nullLiteral)();
}
if (typeof value === "string") {
return (0, _generated$8.stringLiteral)(value);
}
if (typeof value === "number") {
let result;
if (Number.isFinite(value)) {
result = (0, _generated$8.numericLiteral)(Math.abs(value));
} else {
let numerator;
if (Number.isNaN(value)) {
numerator = (0, _generated$8.numericLiteral)(0);
} else {
numerator = (0, _generated$8.numericLiteral)(1);
}
result = (0, _generated$8.binaryExpression)("/", numerator, (0, _generated$8.numericLiteral)(0));
}
if (value < 0 || Object.is(value, -0)) {
result = (0, _generated$8.unaryExpression)("-", result);
}
return result;
}
if (isRegExp(value)) {
const pattern = value.source;
const flags = value.toString().match(/\/([a-z]+|)$/)[1];
return (0, _generated$8.regExpLiteral)(pattern, flags);
}
if (Array.isArray(value)) {
return (0, _generated$8.arrayExpression)(value.map(valueToNode));
}
if (isPlainObject(value)) {
const props = [];
for (const key of Object.keys(value)) {
let nodeKey;
if ((0, _isValidIdentifier$1.default)(key)) {
nodeKey = (0, _generated$8.identifier)(key);
} else {
nodeKey = (0, _generated$8.stringLiteral)(key);
}
props.push((0, _generated$8.objectProperty)(nodeKey, valueToNode(value[key])));
}
return (0, _generated$8.objectExpression)(props);
}
throw new Error("don't know how to turn this value into a node");
}
var appendToMemberExpression$1 = {};
Object.defineProperty(appendToMemberExpression$1, "__esModule", {
value: true
});
appendToMemberExpression$1.default = appendToMemberExpression;
var _generated$7 = generated$3;
function appendToMemberExpression(member, append, computed = false) {
member.object = (0, _generated$7.memberExpression)(member.object, member.property, member.computed);
member.property = append;
member.computed = !!computed;
return member;
}
var inherits$1 = {};
Object.defineProperty(inherits$1, "__esModule", {
value: true
});
inherits$1.default = inherits;
var _constants$2 = constants;
var _inheritsComments = inheritsComments$1;
function inherits(child, parent) {
if (!child || !parent) return child;
for (const key of _constants$2.INHERIT_KEYS.optional) {
if (child[key] == null) {
child[key] = parent[key];
}
}
for (const key of Object.keys(parent)) {
if (key[0] === "_" && key !== "__clone") child[key] = parent[key];
}
for (const key of _constants$2.INHERIT_KEYS.force) {
child[key] = parent[key];
}
(0, _inheritsComments.default)(child, parent);
return child;
}
var prependToMemberExpression$1 = {};
Object.defineProperty(prependToMemberExpression$1, "__esModule", {
value: true
});
prependToMemberExpression$1.default = prependToMemberExpression;
var _generated$6 = generated$3;
function prependToMemberExpression(member, prepend) {
member.object = (0, _generated$6.memberExpression)(prepend, member.object);
return member;
}
var getOuterBindingIdentifiers$1 = {};
Object.defineProperty(getOuterBindingIdentifiers$1, "__esModule", {
value: true
});
getOuterBindingIdentifiers$1.default = void 0;
var _getBindingIdentifiers$1 = getBindingIdentifiers$1;
var _default = getOuterBindingIdentifiers;
getOuterBindingIdentifiers$1.default = _default;
function getOuterBindingIdentifiers(node, duplicates) {
return (0, _getBindingIdentifiers$1.default)(node, duplicates, true);
}
var traverse$1 = {};
Object.defineProperty(traverse$1, "__esModule", {
value: true
});
traverse$1.default = traverse;
var _definitions$1 = definitions;
function traverse(node, handlers, state) {
if (typeof handlers === "function") {
handlers = {
enter: handlers
};
}
const {
enter,
exit
} = handlers;
traverseSimpleImpl(node, enter, exit, state, []);
}
function traverseSimpleImpl(node, enter, exit, state, ancestors) {
const keys = _definitions$1.VISITOR_KEYS[node.type];
if (!keys) return;
if (enter) enter(node, ancestors, state);
for (const key of keys) {
const subNode = node[key];
if (Array.isArray(subNode)) {
for (let i = 0; i < subNode.length; i++) {
const child = subNode[i];
if (!child) continue;
ancestors.push({
node,
key,
index: i
});
traverseSimpleImpl(child, enter, exit, state, ancestors);
ancestors.pop();
}
} else if (subNode) {
ancestors.push({
node,
key
});
traverseSimpleImpl(subNode, enter, exit, state, ancestors);
ancestors.pop();
}
}
if (exit) exit(node, ancestors, state);
}
var isBinding$1 = {};
Object.defineProperty(isBinding$1, "__esModule", {
value: true
});
isBinding$1.default = isBinding;
var _getBindingIdentifiers = getBindingIdentifiers$1;
function isBinding(node, parent, grandparent) {
if (grandparent && node.type === "Identifier" && parent.type === "ObjectProperty" && grandparent.type === "ObjectExpression") {
return false;
}
const keys = _getBindingIdentifiers.default.keys[parent.type];
if (keys) {
for (let i = 0; i < keys.length; i++) {
const key = keys[i];
const val = parent[key];
if (Array.isArray(val)) {
if (val.indexOf(node) >= 0) return true;
} else {
if (val === node) return true;
}
}
}
return false;
}
var isBlockScoped$1 = {};
var isLet$1 = {};
Object.defineProperty(isLet$1, "__esModule", {
value: true
});
isLet$1.default = isLet;
var _generated$5 = generated$4;
var _constants$1 = constants;
function isLet(node) {
return (0, _generated$5.isVariableDeclaration)(node) && (node.kind !== "var" || node[_constants$1.BLOCK_SCOPED_SYMBOL]);
}
Object.defineProperty(isBlockScoped$1, "__esModule", {
value: true
});
isBlockScoped$1.default = isBlockScoped;
var _generated$4 = generated$4;
var _isLet = isLet$1;
function isBlockScoped(node) {
return (0, _generated$4.isFunctionDeclaration)(node) || (0, _generated$4.isClassDeclaration)(node) || (0, _isLet.default)(node);
}
var isImmutable$1 = {};
Object.defineProperty(isImmutable$1, "__esModule", {
value: true
});
isImmutable$1.default = isImmutable;
var _isType = isType$1;
var _generated$3 = generated$4;
function isImmutable(node) {
if ((0, _isType.default)(node.type, "Immutable")) return true;
if ((0, _generated$3.isIdentifier)(node)) {
if (node.name === "undefined") {
return true;
} else {
return false;
}
}
return false;
}
var isNodesEquivalent$1 = {};
Object.defineProperty(isNodesEquivalent$1, "__esModule", {
value: true
});
isNodesEquivalent$1.default = isNodesEquivalent;
var _definitions = definitions;
function isNodesEquivalent(a, b) {
if (typeof a !== "object" || typeof b !== "object" || a == null || b == null) {
return a === b;
}
if (a.type !== b.type) {
return false;
}
const fields = Object.keys(_definitions.NODE_FIELDS[a.type] || a.type);
const visitorKeys = _definitions.VISITOR_KEYS[a.type];
for (const field of fields) {
if (typeof a[field] !== typeof b[field]) {
return false;
}
if (a[field] == null && b[field] == null) {
continue;
} else if (a[field] == null || b[field] == null) {
return false;
}
if (Array.isArray(a[field])) {
if (!Array.isArray(b[field])) {
return false;
}
if (a[field].length !== b[field].length) {
return false;
}
for (let i = 0; i < a[field].length; i++) {
if (!isNodesEquivalent(a[field][i], b[field][i])) {
return false;
}
}
continue;
}
if (typeof a[field] === "object" && !(visitorKeys != null && visitorKeys.includes(field))) {
for (const key of Object.keys(a[field])) {
if (a[field][key] !== b[field][key]) {
return false;
}
}
continue;
}
if (!isNodesEquivalent(a[field], b[field])) {
return false;
}
}
return true;
}
var isReferenced$1 = {};
Object.defineProperty(isReferenced$1, "__esModule", {
value: true
});
isReferenced$1.default = isReferenced;
function isReferenced(node, parent, grandparent) {
switch (parent.type) {
case "MemberExpression":
case "JSXMemberExpression":
case "OptionalMemberExpression":
if (parent.property === node) {
return !!parent.computed;
}
return parent.object === node;
case "VariableDeclarator":
return parent.init === node;
case "ArrowFunctionExpression":
return parent.body === node;
case "PrivateName":
return false;
case "ClassMethod":
case "ClassPrivateMethod":
case "ObjectMethod":
if (parent.params.includes(node)) {
return false;
}
case "ObjectProperty":
case "ClassProperty":
case "ClassPrivateProperty":
if (parent.key === node) {
return !!parent.computed;
}
if (parent.value === node) {
return !grandparent || grandparent.type !== "ObjectPattern";
}
return true;
case "ClassDeclaration":
case "ClassExpression":
return parent.superClass === node;
case "AssignmentExpression":
return parent.right === node;
case "AssignmentPattern":
return parent.right === node;
case "LabeledStatement":
return false;
case "CatchClause":
return false;
case "RestElement":
return false;
case "BreakStatement":
case "ContinueStatement":
return false;
case "FunctionDeclaration":
case "FunctionExpression":
return false;
case "ExportNamespaceSpecifier":
case "ExportDefaultSpecifier":
return false;
case "ExportSpecifier":
if (grandparent != null && grandparent.source) {
return false;
}
return parent.local === node;
case "ImportDefaultSpecifier":
case "ImportNamespaceSpecifier":
case "ImportSpecifier":
return false;
case "JSXAttribute":
return false;
case "ObjectPattern":
case "ArrayPattern":
return false;
case "MetaProperty":
return false;
case "ObjectTypeProperty":
return parent.key !== node;
case "TSEnumMember":
return parent.id !== node;
case "TSPropertySignature":
if (parent.key === node) {
return !!parent.computed;
}
return true;
}
return true;
}
var isScope$1 = {};
Object.defineProperty(isScope$1, "__esModule", {
value: true
});
isScope$1.default = isScope;
var _generated$2 = generated$4;
function isScope(node, parent) {
if ((0, _generated$2.isBlockStatement)(node) && ((0, _generated$2.isFunction)(parent) || (0, _generated$2.isCatchClause)(parent))) {
return false;
}
if ((0, _generated$2.isPattern)(node) && ((0, _generated$2.isFunction)(parent) || (0, _generated$2.isCatchClause)(parent))) {
return true;
}
return (0, _generated$2.isScopable)(node);
}
var isSpecifierDefault$1 = {};
Object.defineProperty(isSpecifierDefault$1, "__esModule", {
value: true
});
isSpecifierDefault$1.default = isSpecifierDefault;
var _generated$1 = generated$4;
function isSpecifierDefault(specifier) {
return (0, _generated$1.isImportDefaultSpecifier)(specifier) || (0, _generated$1.isIdentifier)(specifier.imported || specifier.exported, {
name: "default"
});
}
var isValidES3Identifier$1 = {};
Object.defineProperty(isValidES3Identifier$1, "__esModule", {
value: true
});
isValidES3Identifier$1.default = isValidES3Identifier;
var _isValidIdentifier = isValidIdentifier$1;
const RESERVED_WORDS_ES3_ONLY = new Set(["abstract", "boolean", "byte", "char", "double", "enum", "final", "float", "goto", "implements", "int", "interface", "long", "native", "package", "private", "protected", "public", "short", "static", "synchronized", "throws", "transient", "volatile"]);
function isValidES3Identifier(name) {
return (0, _isValidIdentifier.default)(name) && !RESERVED_WORDS_ES3_ONLY.has(name);
}
var isVar$1 = {};
Object.defineProperty(isVar$1, "__esModule", {
value: true
});
isVar$1.default = isVar;
var _generated = generated$4;
var _constants = constants;
function isVar(node) {
return (0, _generated.isVariableDeclaration)(node, {
kind: "var"
}) && !node[_constants.BLOCK_SCOPED_SYMBOL];
}
var generated = {
__proto__: null
};
var require$$65 = /*@__PURE__*/build.getAugmentedNamespace(generated);
(function (exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
var _exportNames = {
react: true,
assertNode: true,
createTypeAnnotationBasedOnTypeof: true,
createUnionTypeAnnotation: true,
createFlowUnionType: true,
createTSUnionType: true,
cloneNode: true,
clone: true,
cloneDeep: true,
cloneDeepWithoutLoc: true,
cloneWithoutLoc: true,
addComment: true,
addComments: true,
inheritInnerComments: true,
inheritLeadingComments: true,
inheritsComments: true,
inheritTrailingComments: true,
removeComments: true,
ensureBlock: true,
toBindingIdentifierName: true,
toBlock: true,
toComputedKey: true,
toExpression: true,
toIdentifier: true,
toKeyAlias: true,
toSequenceExpression: true,
toStatement: true,
valueToNode: true,
appendToMemberExpression: true,
inherits: true,
prependToMemberExpression: true,
removeProperties: true,
removePropertiesDeep: true,
removeTypeDuplicates: true,
getBindingIdentifiers: true,
getOuterBindingIdentifiers: true,
traverse: true,
traverseFast: true,
shallowEqual: true,
is: true,
isBinding: true,
isBlockScoped: true,
isImmutable: true,
isLet: true,
isNode: true,
isNodesEquivalent: true,
isPlaceholderType: true,
isReferenced: true,
isScope: true,
isSpecifierDefault: true,
isType: true,
isValidES3Identifier: true,
isValidIdentifier: true,
isVar: true,
matchesPattern: true,
validate: true,
buildMatchMemberExpression: true
};
Object.defineProperty(exports, "assertNode", {
enumerable: true,
get: function () {
return _assertNode.default;
}
});
Object.defineProperty(exports, "createTypeAnnotationBasedOnTypeof", {
enumerable: true,
get: function () {
return _createTypeAnnotationBasedOnTypeof.default;
}
});
Object.defineProperty(exports, "createUnionTypeAnnotation", {
enumerable: true,
get: function () {
return _createFlowUnionType.default;
}
});
Object.defineProperty(exports, "createFlowUnionType", {
enumerable: true,
get: function () {
return _createFlowUnionType.default;
}
});
Object.defineProperty(exports, "createTSUnionType", {
enumerable: true,
get: function () {
return _createTSUnionType.default;
}
});
Object.defineProperty(exports, "cloneNode", {
enumerable: true,
get: function () {
return _cloneNode.default;
}
});
Object.defineProperty(exports, "clone", {
enumerable: true,
get: function () {
return _clone.default;
}
});
Object.defineProperty(exports, "cloneDeep", {
enumerable: true,
get: function () {
return _cloneDeep.default;
}
});
Object.defineProperty(exports, "cloneDeepWithoutLoc", {
enumerable: true,
get: function () {
return _cloneDeepWithoutLoc.default;
}
});
Object.defineProperty(exports, "cloneWithoutLoc", {
enumerable: true,
get: function () {
return _cloneWithoutLoc.default;
}
});
Object.defineProperty(exports, "addComment", {
enumerable: true,
get: function () {
return _addComment.default;
}
});
Object.defineProperty(exports, "addComments", {
enumerable: true,
get: function () {
return _addComments.default;
}
});
Object.defineProperty(exports, "inheritInnerComments", {
enumerable: true,
get: function () {
return _inheritInnerComments.default;
}
});
Object.defineProperty(exports, "inheritLeadingComments", {
enumerable: true,
get: function () {
return _inheritLeadingComments.default;
}
});
Object.defineProperty(exports, "inheritsComments", {
enumerable: true,
get: function () {
return _inheritsComments.default;
}
});
Object.defineProperty(exports, "inheritTrailingComments", {
enumerable: true,
get: function () {
return _inheritTrailingComments.default;
}
});
Object.defineProperty(exports, "removeComments", {
enumerable: true,
get: function () {
return _removeComments.default;
}
});
Object.defineProperty(exports, "ensureBlock", {
enumerable: true,
get: function () {
return _ensureBlock.default;
}
});
Object.defineProperty(exports, "toBindingIdentifierName", {
enumerable: true,
get: function () {
return _toBindingIdentifierName.default;
}
});
Object.defineProperty(exports, "toBlock", {
enumerable: true,
get: function () {
return _toBlock.default;
}
});
Object.defineProperty(exports, "toComputedKey", {
enumerable: true,
get: function () {
return _toComputedKey.default;
}
});
Object.defineProperty(exports, "toExpression", {
enumerable: true,
get: function () {
return _toExpression.default;
}
});
Object.defineProperty(exports, "toIdentifier", {
enumerable: true,
get: function () {
return _toIdentifier.default;
}
});
Object.defineProperty(exports, "toKeyAlias", {
enumerable: true,
get: function () {
return _toKeyAlias.default;
}
});
Object.defineProperty(exports, "toSequenceExpression", {
enumerable: true,
get: function () {
return _toSequenceExpression.default;
}
});
Object.defineProperty(exports, "toStatement", {
enumerable: true,
get: function () {
return _toStatement.default;
}
});
Object.defineProperty(exports, "valueToNode", {
enumerable: true,
get: function () {
return _valueToNode.default;
}
});
Object.defineProperty(exports, "appendToMemberExpression", {
enumerable: true,
get: function () {
return _appendToMemberExpression.default;
}
});
Object.defineProperty(exports, "inherits", {
enumerable: true,
get: function () {
return _inherits.default;
}
});
Object.defineProperty(exports, "prependToMemberExpression", {
enumerable: true,
get: function () {
return _prependToMemberExpression.default;
}
});
Object.defineProperty(exports, "removeProperties", {
enumerable: true,
get: function () {
return _removeProperties.default;
}
});
Object.defineProperty(exports, "removePropertiesDeep", {
enumerable: true,
get: function () {
return _removePropertiesDeep.default;
}
});
Object.defineProperty(exports, "removeTypeDuplicates", {
enumerable: true,
get: function () {
return _removeTypeDuplicates.default;
}
});
Object.defineProperty(exports, "getBindingIdentifiers", {
enumerable: true,
get: function () {
return _getBindingIdentifiers.default;
}
});
Object.defineProperty(exports, "getOuterBindingIdentifiers", {
enumerable: true,
get: function () {
return _getOuterBindingIdentifiers.default;
}
});
Object.defineProperty(exports, "traverse", {
enumerable: true,
get: function () {
return _traverse.default;
}
});
Object.defineProperty(exports, "traverseFast", {
enumerable: true,
get: function () {
return _traverseFast.default;
}
});
Object.defineProperty(exports, "shallowEqual", {
enumerable: true,
get: function () {
return _shallowEqual.default;
}
});
Object.defineProperty(exports, "is", {
enumerable: true,
get: function () {
return _is.default;
}
});
Object.defineProperty(exports, "isBinding", {
enumerable: true,
get: function () {
return _isBinding.default;
}
});
Object.defineProperty(exports, "isBlockScoped", {
enumerable: true,
get: function () {
return _isBlockScoped.default;
}
});
Object.defineProperty(exports, "isImmutable", {
enumerable: true,
get: function () {
return _isImmutable.default;
}
});
Object.defineProperty(exports, "isLet", {
enumerable: true,
get: function () {
return _isLet.default;
}
});
Object.defineProperty(exports, "isNode", {
enumerable: true,
get: function () {
return _isNode.default;
}
});
Object.defineProperty(exports, "isNodesEquivalent", {
enumerable: true,
get: function () {
return _isNodesEquivalent.default;
}
});
Object.defineProperty(exports, "isPlaceholderType", {
enumerable: true,
get: function () {
return _isPlaceholderType.default;
}
});
Object.defineProperty(exports, "isReferenced", {
enumerable: true,
get: function () {
return _isReferenced.default;
}
});
Object.defineProperty(exports, "isScope", {
enumerable: true,
get: function () {
return _isScope.default;
}
});
Object.defineProperty(exports, "isSpecifierDefault", {
enumerable: true,
get: function () {
return _isSpecifierDefault.default;
}
});
Object.defineProperty(exports, "isType", {
enumerable: true,
get: function () {
return _isType.default;
}
});
Object.defineProperty(exports, "isValidES3Identifier", {
enumerable: true,
get: function () {
return _isValidES3Identifier.default;
}
});
Object.defineProperty(exports, "isValidIdentifier", {
enumerable: true,
get: function () {
return _isValidIdentifier.default;
}
});
Object.defineProperty(exports, "isVar", {
enumerable: true,
get: function () {
return _isVar.default;
}
});
Object.defineProperty(exports, "matchesPattern", {
enumerable: true,
get: function () {
return _matchesPattern.default;
}
});
Object.defineProperty(exports, "validate", {
enumerable: true,
get: function () {
return _validate.default;
}
});
Object.defineProperty(exports, "buildMatchMemberExpression", {
enumerable: true,
get: function () {
return _buildMatchMemberExpression.default;
}
});
exports.react = void 0;
var _isReactComponent = isReactComponent$1;
var _isCompatTag = isCompatTag$1;
var _buildChildren = buildChildren$1;
var _assertNode = assertNode$1;
var _generated = generated$2;
Object.keys(_generated).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
if (key in exports && exports[key] === _generated[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _generated[key];
}
});
});
var _createTypeAnnotationBasedOnTypeof = createTypeAnnotationBasedOnTypeof$1;
var _createFlowUnionType = createFlowUnionType$1;
var _createTSUnionType = createTSUnionType$1;
var _generated2 = generated$3;
Object.keys(_generated2).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
if (key in exports && exports[key] === _generated2[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _generated2[key];
}
});
});
var _uppercase = uppercase;
Object.keys(_uppercase).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
if (key in exports && exports[key] === _uppercase[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _uppercase[key];
}
});
});
var _cloneNode = cloneNode$1;
var _clone = clone$1;
var _cloneDeep = cloneDeep$1;
var _cloneDeepWithoutLoc = cloneDeepWithoutLoc$1;
var _cloneWithoutLoc = cloneWithoutLoc$1;
var _addComment = addComment$1;
var _addComments = addComments$1;
var _inheritInnerComments = inheritInnerComments$1;
var _inheritLeadingComments = inheritLeadingComments$1;
var _inheritsComments = inheritsComments$1;
var _inheritTrailingComments = inheritTrailingComments$1;
var _removeComments = removeComments$1;
var _generated3 = generated$1;
Object.keys(_generated3).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
if (key in exports && exports[key] === _generated3[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _generated3[key];
}
});
});
var _constants = constants;
Object.keys(_constants).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
if (key in exports && exports[key] === _constants[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _constants[key];
}
});
});
var _ensureBlock = ensureBlock$1;
var _toBindingIdentifierName = toBindingIdentifierName$1;
var _toBlock = toBlock$1;
var _toComputedKey = toComputedKey$1;
var _toExpression = toExpression$1;
var _toIdentifier = toIdentifier$1;
var _toKeyAlias = toKeyAlias$1;
var _toSequenceExpression = toSequenceExpression$1;
var _toStatement = toStatement$1;
var _valueToNode = valueToNode$1;
var _definitions = definitions;
Object.keys(_definitions).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
if (key in exports && exports[key] === _definitions[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _definitions[key];
}
});
});
var _appendToMemberExpression = appendToMemberExpression$1;
var _inherits = inherits$1;
var _prependToMemberExpression = prependToMemberExpression$1;
var _removeProperties = removeProperties$1;
var _removePropertiesDeep = removePropertiesDeep$1;
var _removeTypeDuplicates = removeTypeDuplicates$3;
var _getBindingIdentifiers = getBindingIdentifiers$1;
var _getOuterBindingIdentifiers = getOuterBindingIdentifiers$1;
var _traverse = traverse$1;
Object.keys(_traverse).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
if (key in exports && exports[key] === _traverse[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _traverse[key];
}
});
});
var _traverseFast = traverseFast$1;
var _shallowEqual = shallowEqual$1;
var _is = is$1;
var _isBinding = isBinding$1;
var _isBlockScoped = isBlockScoped$1;
var _isImmutable = isImmutable$1;
var _isLet = isLet$1;
var _isNode = isNode$1;
var _isNodesEquivalent = isNodesEquivalent$1;
var _isPlaceholderType = isPlaceholderType$1;
var _isReferenced = isReferenced$1;
var _isScope = isScope$1;
var _isSpecifierDefault = isSpecifierDefault$1;
var _isType = isType$1;
var _isValidES3Identifier = isValidES3Identifier$1;
var _isValidIdentifier = isValidIdentifier$1;
var _isVar = isVar$1;
var _matchesPattern = matchesPattern$1;
var _validate = validate$2;
var _buildMatchMemberExpression = buildMatchMemberExpression$1;
var _generated4 = generated$4;
Object.keys(_generated4).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
if (key in exports && exports[key] === _generated4[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _generated4[key];
}
});
});
var _generated5 = require$$65;
Object.keys(_generated5).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
if (key in exports && exports[key] === _generated5[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _generated5[key];
}
});
});
const react = {
isReactComponent: _isReactComponent.default,
isCompatTag: _isCompatTag.default,
buildChildren: _buildChildren.default
};
exports.react = react;
}(lib$1));
function defaultOnError(error) {
throw error;
}
function defaultOnWarn(msg) {
(process.env.NODE_ENV !== 'production') && console.warn(`[Vue warn] ${msg.message}`);
}
function createCompilerError(code, loc, messages, additionalMessage) {
const msg = (process.env.NODE_ENV !== 'production') || !true
? (messages || errorMessages)[code] + (additionalMessage || ``)
: code;
const error = new SyntaxError(String(msg));
error.code = code;
error.loc = loc;
return error;
}
const errorMessages = {
// parse errors
[0 /* ABRUPT_CLOSING_OF_EMPTY_COMMENT */]: 'Illegal comment.',
[1 /* CDATA_IN_HTML_CONTENT */]: 'CDATA section is allowed only in XML context.',
[2 /* DUPLICATE_ATTRIBUTE */]: 'Duplicate attribute.',
[3 /* END_TAG_WITH_ATTRIBUTES */]: 'End tag cannot have attributes.',
[4 /* END_TAG_WITH_TRAILING_SOLIDUS */]: "Illegal '/' in tags.",
[5 /* EOF_BEFORE_TAG_NAME */]: 'Unexpected EOF in tag.',
[6 /* EOF_IN_CDATA */]: 'Unexpected EOF in CDATA section.',
[7 /* EOF_IN_COMMENT */]: 'Unexpected EOF in comment.',
[8 /* EOF_IN_SCRIPT_HTML_COMMENT_LIKE_TEXT */]: 'Unexpected EOF in script.',
[9 /* EOF_IN_TAG */]: 'Unexpected EOF in tag.',
[10 /* INCORRECTLY_CLOSED_COMMENT */]: 'Incorrectly closed comment.',
[11 /* INCORRECTLY_OPENED_COMMENT */]: 'Incorrectly opened comment.',
[12 /* INVALID_FIRST_CHARACTER_OF_TAG_NAME */]: "Illegal tag name. Use '&lt;' to print '<'.",
[13 /* MISSING_ATTRIBUTE_VALUE */]: 'Attribute value was expected.',
[14 /* MISSING_END_TAG_NAME */]: 'End tag name was expected.',
[15 /* MISSING_WHITESPACE_BETWEEN_ATTRIBUTES */]: 'Whitespace was expected.',
[16 /* NESTED_COMMENT */]: "Unexpected '<!--' in comment.",
[17 /* UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME */]: 'Attribute name cannot contain U+0022 ("), U+0027 (\'), and U+003C (<).',
[18 /* UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE */]: 'Unquoted attribute value cannot contain U+0022 ("), U+0027 (\'), U+003C (<), U+003D (=), and U+0060 (`).',
[19 /* UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME */]: "Attribute name cannot start with '='.",
[21 /* UNEXPECTED_QUESTION_MARK_INSTEAD_OF_TAG_NAME */]: "'<?' is allowed only in XML context.",
[20 /* UNEXPECTED_NULL_CHARACTER */]: `Unexpected null cahracter.`,
[22 /* UNEXPECTED_SOLIDUS_IN_TAG */]: "Illegal '/' in tags.",
// Vue-specific parse errors
[23 /* X_INVALID_END_TAG */]: 'Invalid end tag.',
[24 /* X_MISSING_END_TAG */]: 'Element is missing end tag.',
[25 /* X_MISSING_INTERPOLATION_END */]: 'Interpolation end sign was not found.',
[26 /* X_MISSING_DYNAMIC_DIRECTIVE_ARGUMENT_END */]: 'End bracket for dynamic directive argument was not found. ' +
'Note that dynamic directive argument cannot contain spaces.',
// transform errors
[27 /* X_V_IF_NO_EXPRESSION */]: `v-if/v-else-if is missing expression.`,
[28 /* X_V_IF_SAME_KEY */]: `v-if/else branches must use unique keys.`,
[29 /* X_V_ELSE_NO_ADJACENT_IF */]: `v-else/v-else-if has no adjacent v-if.`,
[30 /* X_V_FOR_NO_EXPRESSION */]: `v-for is missing expression.`,
[31 /* X_V_FOR_MALFORMED_EXPRESSION */]: `v-for has invalid expression.`,
[32 /* X_V_FOR_TEMPLATE_KEY_PLACEMENT */]: `<template v-for> key should be placed on the <template> tag.`,
[33 /* X_V_BIND_NO_EXPRESSION */]: `v-bind is missing expression.`,
[34 /* X_V_ON_NO_EXPRESSION */]: `v-on is missing expression.`,
[35 /* X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET */]: `Unexpected custom directive on <slot> outlet.`,
[36 /* X_V_SLOT_MIXED_SLOT_USAGE */]: `Mixed v-slot usage on both the component and nested <template>.` +
`When there are multiple named slots, all slots should use <template> ` +
`syntax to avoid scope ambiguity.`,
[37 /* X_V_SLOT_DUPLICATE_SLOT_NAMES */]: `Duplicate slot names found. `,
[38 /* X_V_SLOT_EXTRANEOUS_DEFAULT_SLOT_CHILDREN */]: `Extraneous children found when component already has explicitly named ` +
`default slot. These children will be ignored.`,
[39 /* X_V_SLOT_MISPLACED */]: `v-slot can only be used on components or <template> tags.`,
[40 /* X_V_MODEL_NO_EXPRESSION */]: `v-model is missing expression.`,
[41 /* X_V_MODEL_MALFORMED_EXPRESSION */]: `v-model value must be a valid JavaScript member expression.`,
[42 /* X_V_MODEL_ON_SCOPE_VARIABLE */]: `v-model cannot be used on v-for or v-slot scope variables because they are not writable.`,
[43 /* X_INVALID_EXPRESSION */]: `Error parsing JavaScript expression: `,
[44 /* X_KEEP_ALIVE_INVALID_CHILDREN */]: `<KeepAlive> expects exactly one child component.`,
// generic errors
[45 /* X_PREFIX_ID_NOT_SUPPORTED */]: `"prefixIdentifiers" option is not supported in this build of compiler.`,
[46 /* X_MODULE_MODE_NOT_SUPPORTED */]: `ES module mode is not supported in this build of compiler.`,
[47 /* X_CACHE_HANDLER_NOT_SUPPORTED */]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
[48 /* X_SCOPE_ID_NOT_SUPPORTED */]: `"scopeId" option is only supported in module mode.`,
// just to fullfill types
[49 /* __EXTEND_POINT__ */]: ``
};
const FRAGMENT = Symbol((process.env.NODE_ENV !== 'production') ? `Fragment` : ``);
const TELEPORT = Symbol((process.env.NODE_ENV !== 'production') ? `Teleport` : ``);
const SUSPENSE = Symbol((process.env.NODE_ENV !== 'production') ? `Suspense` : ``);
const KEEP_ALIVE = Symbol((process.env.NODE_ENV !== 'production') ? `KeepAlive` : ``);
const BASE_TRANSITION = Symbol((process.env.NODE_ENV !== 'production') ? `BaseTransition` : ``);
const OPEN_BLOCK = Symbol((process.env.NODE_ENV !== 'production') ? `openBlock` : ``);
const CREATE_BLOCK = Symbol((process.env.NODE_ENV !== 'production') ? `createBlock` : ``);
const CREATE_ELEMENT_BLOCK = Symbol((process.env.NODE_ENV !== 'production') ? `createElementBlock` : ``);
const CREATE_VNODE = Symbol((process.env.NODE_ENV !== 'production') ? `createVNode` : ``);
const CREATE_ELEMENT_VNODE = Symbol((process.env.NODE_ENV !== 'production') ? `createElementVNode` : ``);
const CREATE_COMMENT = Symbol((process.env.NODE_ENV !== 'production') ? `createCommentVNode` : ``);
const CREATE_TEXT = Symbol((process.env.NODE_ENV !== 'production') ? `createTextVNode` : ``);
const CREATE_STATIC = Symbol((process.env.NODE_ENV !== 'production') ? `createStaticVNode` : ``);
const RESOLVE_COMPONENT = Symbol((process.env.NODE_ENV !== 'production') ? `resolveComponent` : ``);
const RESOLVE_DYNAMIC_COMPONENT = Symbol((process.env.NODE_ENV !== 'production') ? `resolveDynamicComponent` : ``);
const RESOLVE_DIRECTIVE = Symbol((process.env.NODE_ENV !== 'production') ? `resolveDirective` : ``);
const RESOLVE_FILTER = Symbol((process.env.NODE_ENV !== 'production') ? `resolveFilter` : ``);
const WITH_DIRECTIVES = Symbol((process.env.NODE_ENV !== 'production') ? `withDirectives` : ``);
const RENDER_LIST = Symbol((process.env.NODE_ENV !== 'production') ? `renderList` : ``);
const RENDER_SLOT = Symbol((process.env.NODE_ENV !== 'production') ? `renderSlot` : ``);
const CREATE_SLOTS = Symbol((process.env.NODE_ENV !== 'production') ? `createSlots` : ``);
const TO_DISPLAY_STRING = Symbol((process.env.NODE_ENV !== 'production') ? `toDisplayString` : ``);
const MERGE_PROPS = Symbol((process.env.NODE_ENV !== 'production') ? `mergeProps` : ``);
const NORMALIZE_CLASS = Symbol((process.env.NODE_ENV !== 'production') ? `normalizeClass` : ``);
const NORMALIZE_STYLE = Symbol((process.env.NODE_ENV !== 'production') ? `normalizeStyle` : ``);
const NORMALIZE_PROPS = Symbol((process.env.NODE_ENV !== 'production') ? `normalizeProps` : ``);
const GUARD_REACTIVE_PROPS = Symbol((process.env.NODE_ENV !== 'production') ? `guardReactiveProps` : ``);
const TO_HANDLERS = Symbol((process.env.NODE_ENV !== 'production') ? `toHandlers` : ``);
const CAMELIZE = Symbol((process.env.NODE_ENV !== 'production') ? `camelize` : ``);
const CAPITALIZE = Symbol((process.env.NODE_ENV !== 'production') ? `capitalize` : ``);
const TO_HANDLER_KEY = Symbol((process.env.NODE_ENV !== 'production') ? `toHandlerKey` : ``);
const SET_BLOCK_TRACKING = Symbol((process.env.NODE_ENV !== 'production') ? `setBlockTracking` : ``);
const PUSH_SCOPE_ID = Symbol((process.env.NODE_ENV !== 'production') ? `pushScopeId` : ``);
const POP_SCOPE_ID = Symbol((process.env.NODE_ENV !== 'production') ? `popScopeId` : ``);
const WITH_SCOPE_ID = Symbol((process.env.NODE_ENV !== 'production') ? `withScopeId` : ``);
const WITH_CTX = Symbol((process.env.NODE_ENV !== 'production') ? `withCtx` : ``);
const UNREF = Symbol((process.env.NODE_ENV !== 'production') ? `unref` : ``);
const IS_REF = Symbol((process.env.NODE_ENV !== 'production') ? `isRef` : ``);
const WITH_MEMO = Symbol((process.env.NODE_ENV !== 'production') ? `withMemo` : ``);
const IS_MEMO_SAME = Symbol((process.env.NODE_ENV !== 'production') ? `isMemoSame` : ``);
// Name mapping for runtime helpers that need to be imported from 'vue' in
// generated code. Make sure these are correctly exported in the runtime!
// Using `any` here because TS doesn't allow symbols as index type.
const helperNameMap = {
[FRAGMENT]: `Fragment`,
[TELEPORT]: `Teleport`,
[SUSPENSE]: `Suspense`,
[KEEP_ALIVE]: `KeepAlive`,
[BASE_TRANSITION]: `BaseTransition`,
[OPEN_BLOCK]: `openBlock`,
[CREATE_BLOCK]: `createBlock`,
[CREATE_ELEMENT_BLOCK]: `createElementBlock`,
[CREATE_VNODE]: `createVNode`,
[CREATE_ELEMENT_VNODE]: `createElementVNode`,
[CREATE_COMMENT]: `createCommentVNode`,
[CREATE_TEXT]: `createTextVNode`,
[CREATE_STATIC]: `createStaticVNode`,
[RESOLVE_COMPONENT]: `resolveComponent`,
[RESOLVE_DYNAMIC_COMPONENT]: `resolveDynamicComponent`,
[RESOLVE_DIRECTIVE]: `resolveDirective`,
[RESOLVE_FILTER]: `resolveFilter`,
[WITH_DIRECTIVES]: `withDirectives`,
[RENDER_LIST]: `renderList`,
[RENDER_SLOT]: `renderSlot`,
[CREATE_SLOTS]: `createSlots`,
[TO_DISPLAY_STRING]: `toDisplayString`,
[MERGE_PROPS]: `mergeProps`,
[NORMALIZE_CLASS]: `normalizeClass`,
[NORMALIZE_STYLE]: `normalizeStyle`,
[NORMALIZE_PROPS]: `normalizeProps`,
[GUARD_REACTIVE_PROPS]: `guardReactiveProps`,
[TO_HANDLERS]: `toHandlers`,
[CAMELIZE]: `camelize`,
[CAPITALIZE]: `capitalize`,
[TO_HANDLER_KEY]: `toHandlerKey`,
[SET_BLOCK_TRACKING]: `setBlockTracking`,
[PUSH_SCOPE_ID]: `pushScopeId`,
[POP_SCOPE_ID]: `popScopeId`,
[WITH_SCOPE_ID]: `withScopeId`,
[WITH_CTX]: `withCtx`,
[UNREF]: `unref`,
[IS_REF]: `isRef`,
[WITH_MEMO]: `withMemo`,
[IS_MEMO_SAME]: `isMemoSame`
};
function registerRuntimeHelpers(helpers) {
Object.getOwnPropertySymbols(helpers).forEach(s => {
helperNameMap[s] = helpers[s];
});
}
// AST Utilities ---------------------------------------------------------------
// Some expressions, e.g. sequence and conditional expressions, are never
// associated with template nodes, so their source locations are just a stub.
// Container types like CompoundExpression also don't need a real location.
const locStub = {
source: '',
start: { line: 1, column: 1, offset: 0 },
end: { line: 1, column: 1, offset: 0 }
};
function createRoot(children, loc = locStub) {
return {
type: 0 /* ROOT */,
children,
helpers: [],
components: [],
directives: [],
hoists: [],
imports: [],
cached: 0,
temps: 0,
codegenNode: undefined,
loc
};
}
function createVNodeCall(context, tag, props, children, patchFlag, dynamicProps, directives, isBlock = false, disableTracking = false, isComponent = false, loc = locStub) {
if (context) {
if (isBlock) {
context.helper(OPEN_BLOCK);
context.helper(getVNodeBlockHelper(context.inSSR, isComponent));
}
else {
context.helper(getVNodeHelper(context.inSSR, isComponent));
}
if (directives) {
context.helper(WITH_DIRECTIVES);
}
}
return {
type: 13 /* VNODE_CALL */,
tag,
props,
children,
patchFlag,
dynamicProps,
directives,
isBlock,
disableTracking,
isComponent,
loc
};
}
function createArrayExpression(elements, loc = locStub) {
return {
type: 17 /* JS_ARRAY_EXPRESSION */,
loc,
elements
};
}
function createObjectExpression(properties, loc = locStub) {
return {
type: 15 /* JS_OBJECT_EXPRESSION */,
loc,
properties
};
}
function createObjectProperty(key, value) {
return {
type: 16 /* JS_PROPERTY */,
loc: locStub,
key: isString(key) ? createSimpleExpression(key, true) : key,
value
};
}
function createSimpleExpression(content, isStatic = false, loc = locStub, constType = 0 /* NOT_CONSTANT */) {
return {
type: 4 /* SIMPLE_EXPRESSION */,
loc,
content,
isStatic,
constType: isStatic ? 3 /* CAN_STRINGIFY */ : constType
};
}
function createInterpolation(content, loc) {
return {
type: 5 /* INTERPOLATION */,
loc,
content: isString(content)
? createSimpleExpression(content, false, loc)
: content
};
}
function createCompoundExpression(children, loc = locStub) {
return {
type: 8 /* COMPOUND_EXPRESSION */,
loc,
children
};
}
function createCallExpression(callee, args = [], loc = locStub) {
return {
type: 14 /* JS_CALL_EXPRESSION */,
loc,
callee,
arguments: args
};
}
function createFunctionExpression(params, returns = undefined, newline = false, isSlot = false, loc = locStub) {
return {
type: 18 /* JS_FUNCTION_EXPRESSION */,
params,
returns,
newline,
isSlot,
loc
};
}
function createConditionalExpression(test, consequent, alternate, newline = true) {
return {
type: 19 /* JS_CONDITIONAL_EXPRESSION */,
test,
consequent,
alternate,
newline,
loc: locStub
};
}
function createCacheExpression(index, value, isVNode = false) {
return {
type: 20 /* JS_CACHE_EXPRESSION */,
index,
value,
isVNode,
loc: locStub
};
}
function createBlockStatement(body) {
return {
type: 21 /* JS_BLOCK_STATEMENT */,
body,
loc: locStub
};
}
function createTemplateLiteral(elements) {
return {
type: 22 /* JS_TEMPLATE_LITERAL */,
elements,
loc: locStub
};
}
function createIfStatement(test, consequent, alternate) {
return {
type: 23 /* JS_IF_STATEMENT */,
test,
consequent,
alternate,
loc: locStub
};
}
function createAssignmentExpression(left, right) {
return {
type: 24 /* JS_ASSIGNMENT_EXPRESSION */,
left,
right,
loc: locStub
};
}
function createSequenceExpression(expressions) {
return {
type: 25 /* JS_SEQUENCE_EXPRESSION */,
expressions,
loc: locStub
};
}
function createReturnStatement(returns) {
return {
type: 26 /* JS_RETURN_STATEMENT */,
returns,
loc: locStub
};
}
const isStaticExp = (p) => p.type === 4 /* SIMPLE_EXPRESSION */ && p.isStatic;
const isBuiltInType = (tag, expected) => tag === expected || tag === hyphenate(expected);
function isCoreComponent(tag) {
if (isBuiltInType(tag, 'Teleport')) {
return TELEPORT;
}
else if (isBuiltInType(tag, 'Suspense')) {
return SUSPENSE;
}
else if (isBuiltInType(tag, 'KeepAlive')) {
return KEEP_ALIVE;
}
else if (isBuiltInType(tag, 'BaseTransition')) {
return BASE_TRANSITION;
}
}
const nonIdentifierRE = /^\d|[^\$\w]/;
const isSimpleIdentifier = (name) => !nonIdentifierRE.test(name);
const validFirstIdentCharRE = /[A-Za-z_$\xA0-\uFFFF]/;
const validIdentCharRE = /[\.\?\w$\xA0-\uFFFF]/;
const whitespaceRE = /\s+[.[]\s*|\s*[.[]\s+/g;
/**
* Simple lexer to check if an expression is a member expression. This is
* lax and only checks validity at the root level (i.e. does not validate exps
* inside square brackets), but it's ok since these are only used on template
* expressions and false positives are invalid expressions in the first place.
*/
const isMemberExpression = (path) => {
// remove whitespaces around . or [ first
path = path.trim().replace(whitespaceRE, s => s.trim());
let state = 0 /* inMemberExp */;
let stateStack = [];
let currentOpenBracketCount = 0;
let currentOpenParensCount = 0;
let currentStringType = null;
for (let i = 0; i < path.length; i++) {
const char = path.charAt(i);
switch (state) {
case 0 /* inMemberExp */:
if (char === '[') {
stateStack.push(state);
state = 1 /* inBrackets */;
currentOpenBracketCount++;
}
else if (char === '(') {
stateStack.push(state);
state = 2 /* inParens */;
currentOpenParensCount++;
}
else if (!(i === 0 ? validFirstIdentCharRE : validIdentCharRE).test(char)) {
return false;
}
break;
case 1 /* inBrackets */:
if (char === `'` || char === `"` || char === '`') {
stateStack.push(state);
state = 3 /* inString */;
currentStringType = char;
}
else if (char === `[`) {
currentOpenBracketCount++;
}
else if (char === `]`) {
if (!--currentOpenBracketCount) {
state = stateStack.pop();
}
}
break;
case 2 /* inParens */:
if (char === `'` || char === `"` || char === '`') {
stateStack.push(state);
state = 3 /* inString */;
currentStringType = char;
}
else if (char === `(`) {
currentOpenParensCount++;
}
else if (char === `)`) {
// if the exp ends as a call then it should not be considered valid
if (i === path.length - 1) {
return false;
}
if (!--currentOpenParensCount) {
state = stateStack.pop();
}
}
break;
case 3 /* inString */:
if (char === currentStringType) {
state = stateStack.pop();
currentStringType = null;
}
break;
}
}
return !currentOpenBracketCount && !currentOpenParensCount;
};
function getInnerRange(loc, offset, length) {
const source = loc.source.substr(offset, length);
const newLoc = {
source,
start: advancePositionWithClone(loc.start, loc.source, offset),
end: loc.end
};
if (length != null) {
newLoc.end = advancePositionWithClone(loc.start, loc.source, offset + length);
}
return newLoc;
}
function advancePositionWithClone(pos, source, numberOfCharacters = source.length) {
return advancePositionWithMutation(extend({}, pos), source, numberOfCharacters);
}
// advance by mutation without cloning (for performance reasons), since this
// gets called a lot in the parser
function advancePositionWithMutation(pos, source, numberOfCharacters = source.length) {
let linesCount = 0;
let lastNewLinePos = -1;
for (let i = 0; i < numberOfCharacters; i++) {
if (source.charCodeAt(i) === 10 /* newline char code */) {
linesCount++;
lastNewLinePos = i;
}
}
pos.offset += numberOfCharacters;
pos.line += linesCount;
pos.column =
lastNewLinePos === -1
? pos.column + numberOfCharacters
: numberOfCharacters - lastNewLinePos;
return pos;
}
function assert(condition, msg) {
/* istanbul ignore if */
if (!condition) {
throw new Error(msg || `unexpected compiler condition`);
}
}
function findDir(node, name, allowEmpty = false) {
for (let i = 0; i < node.props.length; i++) {
const p = node.props[i];
if (p.type === 7 /* DIRECTIVE */ &&
(allowEmpty || p.exp) &&
(isString(name) ? p.name === name : name.test(p.name))) {
return p;
}
}
}
function findProp(node, name, dynamicOnly = false, allowEmpty = false) {
for (let i = 0; i < node.props.length; i++) {
const p = node.props[i];
if (p.type === 6 /* ATTRIBUTE */) {
if (dynamicOnly)
continue;
if (p.name === name && (p.value || allowEmpty)) {
return p;
}
}
else if (p.name === 'bind' &&
(p.exp || allowEmpty) &&
isBindKey(p.arg, name)) {
return p;
}
}
}
function isBindKey(arg, name) {
return !!(arg && isStaticExp(arg) && arg.content === name);
}
function hasDynamicKeyVBind(node) {
return node.props.some(p => p.type === 7 /* DIRECTIVE */ &&
p.name === 'bind' &&
(!p.arg || // v-bind="obj"
p.arg.type !== 4 /* SIMPLE_EXPRESSION */ || // v-bind:[_ctx.foo]
!p.arg.isStatic) // v-bind:[foo]
);
}
function isText(node) {
return node.type === 5 /* INTERPOLATION */ || node.type === 2 /* TEXT */;
}
function isVSlot(p) {
return p.type === 7 /* DIRECTIVE */ && p.name === 'slot';
}
function isTemplateNode(node) {
return (node.type === 1 /* ELEMENT */ && node.tagType === 3 /* TEMPLATE */);
}
function isSlotOutlet(node) {
return node.type === 1 /* ELEMENT */ && node.tagType === 2 /* SLOT */;
}
function getVNodeHelper(ssr, isComponent) {
return ssr || isComponent ? CREATE_VNODE : CREATE_ELEMENT_VNODE;
}
function getVNodeBlockHelper(ssr, isComponent) {
return ssr || isComponent ? CREATE_BLOCK : CREATE_ELEMENT_BLOCK;
}
const propsHelperSet = new Set([NORMALIZE_PROPS, GUARD_REACTIVE_PROPS]);
function getUnnormalizedProps(props, callPath = []) {
if (props &&
!isString(props) &&
props.type === 14 /* JS_CALL_EXPRESSION */) {
const callee = props.callee;
if (!isString(callee) && propsHelperSet.has(callee)) {
return getUnnormalizedProps(props.arguments[0], callPath.concat(props));
}
}
return [props, callPath];
}
function injectProp(node, prop, context) {
let propsWithInjection;
const originalProps = node.type === 13 /* VNODE_CALL */ ? node.props : node.arguments[2];
/**
* 1. mergeProps(...)
* 2. toHandlers(...)
* 3. normalizeProps(...)
* 4. normalizeProps(guardReactiveProps(...))
*
* we need to get the real props before normalization
*/
let props = originalProps;
let callPath = [];
let parentCall;
if (props &&
!isString(props) &&
props.type === 14 /* JS_CALL_EXPRESSION */) {
const ret = getUnnormalizedProps(props);
props = ret[0];
callPath = ret[1];
parentCall = callPath[callPath.length - 1];
}
if (props == null || isString(props)) {
propsWithInjection = createObjectExpression([prop]);
}
else if (props.type === 14 /* JS_CALL_EXPRESSION */) {
// merged props... add ours
// only inject key to object literal if it's the first argument so that
// if doesn't override user provided keys
const first = props.arguments[0];
if (!isString(first) && first.type === 15 /* JS_OBJECT_EXPRESSION */) {
first.properties.unshift(prop);
}
else {
if (props.callee === TO_HANDLERS) {
// #2366
propsWithInjection = createCallExpression(context.helper(MERGE_PROPS), [
createObjectExpression([prop]),
props
]);
}
else {
props.arguments.unshift(createObjectExpression([prop]));
}
}
!propsWithInjection && (propsWithInjection = props);
}
else if (props.type === 15 /* JS_OBJECT_EXPRESSION */) {
let alreadyExists = false;
// check existing key to avoid overriding user provided keys
if (prop.key.type === 4 /* SIMPLE_EXPRESSION */) {
const propKeyName = prop.key.content;
alreadyExists = props.properties.some(p => p.key.type === 4 /* SIMPLE_EXPRESSION */ &&
p.key.content === propKeyName);
}
if (!alreadyExists) {
props.properties.unshift(prop);
}
propsWithInjection = props;
}
else {
// single v-bind with expression, return a merged replacement
propsWithInjection = createCallExpression(context.helper(MERGE_PROPS), [
createObjectExpression([prop]),
props
]);
// in the case of nested helper call, e.g. `normalizeProps(guardReactiveProps(props))`,
// it will be rewritten as `normalizeProps(mergeProps({ key: 0 }, props))`,
// the `guardReactiveProps` will no longer be needed
if (parentCall && parentCall.callee === GUARD_REACTIVE_PROPS) {
parentCall = callPath[callPath.length - 2];
}
}
if (node.type === 13 /* VNODE_CALL */) {
if (parentCall) {
parentCall.arguments[0] = propsWithInjection;
}
else {
node.props = propsWithInjection;
}
}
else {
if (parentCall) {
parentCall.arguments[0] = propsWithInjection;
}
else {
node.arguments[2] = propsWithInjection;
}
}
}
function toValidAssetId(name, type) {
// see issue#4422, we need adding identifier on validAssetId if variable `name` has specific character
return `_${type}_${name.replace(/[^\w]/g, (searchValue, replaceValue) => {
return searchValue === '-' ? '_' : name.charCodeAt(replaceValue).toString();
})}`;
}
// Check if a node contains expressions that reference current context scope ids
function hasScopeRef(node, ids) {
if (!node || Object.keys(ids).length === 0) {
return false;
}
switch (node.type) {
case 1 /* ELEMENT */:
for (let i = 0; i < node.props.length; i++) {
const p = node.props[i];
if (p.type === 7 /* DIRECTIVE */ &&
(hasScopeRef(p.arg, ids) || hasScopeRef(p.exp, ids))) {
return true;
}
}
return node.children.some(c => hasScopeRef(c, ids));
case 11 /* FOR */:
if (hasScopeRef(node.source, ids)) {
return true;
}
return node.children.some(c => hasScopeRef(c, ids));
case 9 /* IF */:
return node.branches.some(b => hasScopeRef(b, ids));
case 10 /* IF_BRANCH */:
if (hasScopeRef(node.condition, ids)) {
return true;
}
return node.children.some(c => hasScopeRef(c, ids));
case 4 /* SIMPLE_EXPRESSION */:
return (!node.isStatic &&
isSimpleIdentifier(node.content) &&
!!ids[node.content]);
case 8 /* COMPOUND_EXPRESSION */:
return node.children.some(c => isObject(c) && hasScopeRef(c, ids));
case 5 /* INTERPOLATION */:
case 12 /* TEXT_CALL */:
return hasScopeRef(node.content, ids);
case 2 /* TEXT */:
case 3 /* COMMENT */:
return false;
default:
if ((process.env.NODE_ENV !== 'production')) ;
return false;
}
}
function getMemoedVNodeCall(node) {
if (node.type === 14 /* JS_CALL_EXPRESSION */ && node.callee === WITH_MEMO) {
return node.arguments[1].returns;
}
else {
return node;
}
}
function makeBlock(node, { helper, removeHelper, inSSR }) {
if (!node.isBlock) {
node.isBlock = true;
removeHelper(getVNodeHelper(inSSR, node.isComponent));
helper(OPEN_BLOCK);
helper(getVNodeBlockHelper(inSSR, node.isComponent));
}
}
const deprecationData = {
["COMPILER_IS_ON_ELEMENT" /* COMPILER_IS_ON_ELEMENT */]: {
message: `Platform-native elements with "is" prop will no longer be ` +
`treated as components in Vue 3 unless the "is" value is explicitly ` +
`prefixed with "vue:".`,
link: `https://v3.vuejs.org/guide/migration/custom-elements-interop.html`
},
["COMPILER_V_BIND_SYNC" /* COMPILER_V_BIND_SYNC */]: {
message: key => `.sync modifier for v-bind has been removed. Use v-model with ` +
`argument instead. \`v-bind:${key}.sync\` should be changed to ` +
`\`v-model:${key}\`.`,
link: `https://v3.vuejs.org/guide/migration/v-model.html`
},
["COMPILER_V_BIND_PROP" /* COMPILER_V_BIND_PROP */]: {
message: `.prop modifier for v-bind has been removed and no longer necessary. ` +
`Vue 3 will automatically set a binding as DOM property when appropriate.`
},
["COMPILER_V_BIND_OBJECT_ORDER" /* COMPILER_V_BIND_OBJECT_ORDER */]: {
message: `v-bind="obj" usage is now order sensitive and behaves like JavaScript ` +
`object spread: it will now overwrite an existing non-mergeable attribute ` +
`that appears before v-bind in the case of conflict. ` +
`To retain 2.x behavior, move v-bind to make it the first attribute. ` +
`You can also suppress this warning if the usage is intended.`,
link: `https://v3.vuejs.org/guide/migration/v-bind.html`
},
["COMPILER_V_ON_NATIVE" /* COMPILER_V_ON_NATIVE */]: {
message: `.native modifier for v-on has been removed as is no longer necessary.`,
link: `https://v3.vuejs.org/guide/migration/v-on-native-modifier-removed.html`
},
["COMPILER_V_IF_V_FOR_PRECEDENCE" /* COMPILER_V_IF_V_FOR_PRECEDENCE */]: {
message: `v-if / v-for precedence when used on the same element has changed ` +
`in Vue 3: v-if now takes higher precedence and will no longer have ` +
`access to v-for scope variables. It is best to avoid the ambiguity ` +
`with <template> tags or use a computed property that filters v-for ` +
`data source.`,
link: `https://v3.vuejs.org/guide/migration/v-if-v-for.html`
},
["COMPILER_V_FOR_REF" /* COMPILER_V_FOR_REF */]: {
message: `Ref usage on v-for no longer creates array ref values in Vue 3. ` +
`Consider using function refs or refactor to avoid ref usage altogether.`,
link: `https://v3.vuejs.org/guide/migration/array-refs.html`
},
["COMPILER_NATIVE_TEMPLATE" /* COMPILER_NATIVE_TEMPLATE */]: {
message: `<template> with no special directives will render as a native template ` +
`element instead of its inner content in Vue 3.`
},
["COMPILER_INLINE_TEMPLATE" /* COMPILER_INLINE_TEMPLATE */]: {
message: `"inline-template" has been removed in Vue 3.`,
link: `https://v3.vuejs.org/guide/migration/inline-template-attribute.html`
},
["COMPILER_FILTER" /* COMPILER_FILTERS */]: {
message: `filters have been removed in Vue 3. ` +
`The "|" symbol will be treated as native JavaScript bitwise OR operator. ` +
`Use method calls or computed properties instead.`,
link: `https://v3.vuejs.org/guide/migration/filters.html`
}
};
function getCompatValue(key, context) {
const config = context.options
? context.options.compatConfig
: context.compatConfig;
const value = config && config[key];
if (key === 'MODE') {
return value || 3; // compiler defaults to v3 behavior
}
else {
return value;
}
}
function isCompatEnabled(key, context) {
const mode = getCompatValue('MODE', context);
const value = getCompatValue(key, context);
// in v3 mode, only enable if explicitly set to true
// otherwise enable for any non-false value
return mode === 3 ? value === true : value !== false;
}
function checkCompatEnabled(key, context, loc, ...args) {
const enabled = isCompatEnabled(key, context);
if ((process.env.NODE_ENV !== 'production') && enabled) {
warnDeprecation(key, context, loc, ...args);
}
return enabled;
}
function warnDeprecation(key, context, loc, ...args) {
const val = getCompatValue(key, context);
if (val === 'suppress-warning') {
return;
}
const { message, link } = deprecationData[key];
const msg = `(deprecation ${key}) ${typeof message === 'function' ? message(...args) : message}${link ? `\n Details: ${link}` : ``}`;
const err = new SyntaxError(msg);
err.code = key;
if (loc)
err.loc = loc;
context.onWarn(err);
}
// The default decoder only provides escapes for characters reserved as part of
// the template syntax, and is only used if the custom renderer did not provide
// a platform-specific decoder.
const decodeRE = /&(gt|lt|amp|apos|quot);/g;
const decodeMap = {
gt: '>',
lt: '<',
amp: '&',
apos: "'",
quot: '"'
};
const defaultParserOptions = {
delimiters: [`{{`, `}}`],
getNamespace: () => 0 /* HTML */,
getTextMode: () => 0 /* DATA */,
isVoidTag: NO,
isPreTag: NO,
isCustomElement: NO,
decodeEntities: (rawText) => rawText.replace(decodeRE, (_, p1) => decodeMap[p1]),
onError: defaultOnError,
onWarn: defaultOnWarn,
comments: (process.env.NODE_ENV !== 'production')
};
function baseParse(content, options = {}) {
const context = createParserContext(content, options);
const start = getCursor(context);
return createRoot(parseChildren(context, 0 /* DATA */, []), getSelection(context, start));
}
function createParserContext(content, rawOptions) {
const options = extend({}, defaultParserOptions);
let key;
for (key in rawOptions) {
// @ts-ignore
options[key] =
rawOptions[key] === undefined
? defaultParserOptions[key]
: rawOptions[key];
}
return {
options,
column: 1,
line: 1,
offset: 0,
originalSource: content,
source: content,
inPre: false,
inVPre: false,
onWarn: options.onWarn
};
}
function parseChildren(context, mode, ancestors) {
const parent = last(ancestors);
const ns = parent ? parent.ns : 0 /* HTML */;
const nodes = [];
while (!isEnd(context, mode, ancestors)) {
const s = context.source;
let node = undefined;
if (mode === 0 /* DATA */ || mode === 1 /* RCDATA */) {
if (!context.inVPre && startsWith(s, context.options.delimiters[0])) {
// '{{'
node = parseInterpolation(context, mode);
}
else if (mode === 0 /* DATA */ && s[0] === '<') {
// https://html.spec.whatwg.org/multipage/parsing.html#tag-open-state
if (s.length === 1) {
emitError(context, 5 /* EOF_BEFORE_TAG_NAME */, 1);
}
else if (s[1] === '!') {
// https://html.spec.whatwg.org/multipage/parsing.html#markup-declaration-open-state
if (startsWith(s, '<!--')) {
node = parseComment(context);
}
else if (startsWith(s, '<!DOCTYPE')) {
// Ignore DOCTYPE by a limitation.
node = parseBogusComment(context);
}
else if (startsWith(s, '<![CDATA[')) {
if (ns !== 0 /* HTML */) {
node = parseCDATA(context, ancestors);
}
else {
emitError(context, 1 /* CDATA_IN_HTML_CONTENT */);
node = parseBogusComment(context);
}
}
else {
emitError(context, 11 /* INCORRECTLY_OPENED_COMMENT */);
node = parseBogusComment(context);
}
}
else if (s[1] === '/') {
// https://html.spec.whatwg.org/multipage/parsing.html#end-tag-open-state
if (s.length === 2) {
emitError(context, 5 /* EOF_BEFORE_TAG_NAME */, 2);
}
else if (s[2] === '>') {
emitError(context, 14 /* MISSING_END_TAG_NAME */, 2);
advanceBy(context, 3);
continue;
}
else if (/[a-z]/i.test(s[2])) {
emitError(context, 23 /* X_INVALID_END_TAG */);
parseTag(context, 1 /* End */, parent);
continue;
}
else {
emitError(context, 12 /* INVALID_FIRST_CHARACTER_OF_TAG_NAME */, 2);
node = parseBogusComment(context);
}
}
else if (/[a-z]/i.test(s[1])) {
node = parseElement(context, ancestors);
// 2.x <template> with no directive compat
if (isCompatEnabled("COMPILER_NATIVE_TEMPLATE" /* COMPILER_NATIVE_TEMPLATE */, context) &&
node &&
node.tag === 'template' &&
!node.props.some(p => p.type === 7 /* DIRECTIVE */ &&
isSpecialTemplateDirective(p.name))) {
(process.env.NODE_ENV !== 'production') &&
warnDeprecation("COMPILER_NATIVE_TEMPLATE" /* COMPILER_NATIVE_TEMPLATE */, context, node.loc);
node = node.children;
}
}
else if (s[1] === '?') {
emitError(context, 21 /* UNEXPECTED_QUESTION_MARK_INSTEAD_OF_TAG_NAME */, 1);
node = parseBogusComment(context);
}
else {
emitError(context, 12 /* INVALID_FIRST_CHARACTER_OF_TAG_NAME */, 1);
}
}
}
if (!node) {
node = parseText(context, mode);
}
if (isArray(node)) {
for (let i = 0; i < node.length; i++) {
pushNode(nodes, node[i]);
}
}
else {
pushNode(nodes, node);
}
}
// Whitespace handling strategy like v2
let removedWhitespace = false;
if (mode !== 2 /* RAWTEXT */ && mode !== 1 /* RCDATA */) {
const shouldCondense = context.options.whitespace !== 'preserve';
for (let i = 0; i < nodes.length; i++) {
const node = nodes[i];
if (!context.inPre && node.type === 2 /* TEXT */) {
if (!/[^\t\r\n\f ]/.test(node.content)) {
const prev = nodes[i - 1];
const next = nodes[i + 1];
// Remove if:
// - the whitespace is the first or last node, or:
// - (condense mode) the whitespace is adjacent to a comment, or:
// - (condense mode) the whitespace is between two elements AND contains newline
if (!prev ||
!next ||
(shouldCondense &&
(prev.type === 3 /* COMMENT */ ||
next.type === 3 /* COMMENT */ ||
(prev.type === 1 /* ELEMENT */ &&
next.type === 1 /* ELEMENT */ &&
/[\r\n]/.test(node.content))))) {
removedWhitespace = true;
nodes[i] = null;
}
else {
// Otherwise, the whitespace is condensed into a single space
node.content = ' ';
}
}
else if (shouldCondense) {
// in condense mode, consecutive whitespaces in text are condensed
// down to a single space.
node.content = node.content.replace(/[\t\r\n\f ]+/g, ' ');
}
}
// Remove comment nodes if desired by configuration.
else if (node.type === 3 /* COMMENT */ && !context.options.comments) {
removedWhitespace = true;
nodes[i] = null;
}
}
if (context.inPre && parent && context.options.isPreTag(parent.tag)) {
// remove leading newline per html spec
// https://html.spec.whatwg.org/multipage/grouping-content.html#the-pre-element
const first = nodes[0];
if (first && first.type === 2 /* TEXT */) {
first.content = first.content.replace(/^\r?\n/, '');
}
}
}
return removedWhitespace ? nodes.filter(Boolean) : nodes;
}
function pushNode(nodes, node) {
if (node.type === 2 /* TEXT */) {
const prev = last(nodes);
// Merge if both this and the previous node are text and those are
// consecutive. This happens for cases like "a < b".
if (prev &&
prev.type === 2 /* TEXT */ &&
prev.loc.end.offset === node.loc.start.offset) {
prev.content += node.content;
prev.loc.end = node.loc.end;
prev.loc.source += node.loc.source;
return;
}
}
nodes.push(node);
}
function parseCDATA(context, ancestors) {
advanceBy(context, 9);
const nodes = parseChildren(context, 3 /* CDATA */, ancestors);
if (context.source.length === 0) {
emitError(context, 6 /* EOF_IN_CDATA */);
}
else {
advanceBy(context, 3);
}
return nodes;
}
function parseComment(context) {
const start = getCursor(context);
let content;
// Regular comment.
const match = /--(\!)?>/.exec(context.source);
if (!match) {
content = context.source.slice(4);
advanceBy(context, context.source.length);
emitError(context, 7 /* EOF_IN_COMMENT */);
}
else {
if (match.index <= 3) {
emitError(context, 0 /* ABRUPT_CLOSING_OF_EMPTY_COMMENT */);
}
if (match[1]) {
emitError(context, 10 /* INCORRECTLY_CLOSED_COMMENT */);
}
content = context.source.slice(4, match.index);
// Advancing with reporting nested comments.
const s = context.source.slice(0, match.index);
let prevIndex = 1, nestedIndex = 0;
while ((nestedIndex = s.indexOf('<!--', prevIndex)) !== -1) {
advanceBy(context, nestedIndex - prevIndex + 1);
if (nestedIndex + 4 < s.length) {
emitError(context, 16 /* NESTED_COMMENT */);
}
prevIndex = nestedIndex + 1;
}
advanceBy(context, match.index + match[0].length - prevIndex + 1);
}
return {
type: 3 /* COMMENT */,
content,
loc: getSelection(context, start)
};
}
function parseBogusComment(context) {
const start = getCursor(context);
const contentStart = context.source[1] === '?' ? 1 : 2;
let content;
const closeIndex = context.source.indexOf('>');
if (closeIndex === -1) {
content = context.source.slice(contentStart);
advanceBy(context, context.source.length);
}
else {
content = context.source.slice(contentStart, closeIndex);
advanceBy(context, closeIndex + 1);
}
return {
type: 3 /* COMMENT */,
content,
loc: getSelection(context, start)
};
}
function parseElement(context, ancestors) {
// Start tag.
const wasInPre = context.inPre;
const wasInVPre = context.inVPre;
const parent = last(ancestors);
const element = parseTag(context, 0 /* Start */, parent);
const isPreBoundary = context.inPre && !wasInPre;
const isVPreBoundary = context.inVPre && !wasInVPre;
if (element.isSelfClosing || context.options.isVoidTag(element.tag)) {
// #4030 self-closing <pre> tag
if (isPreBoundary) {
context.inPre = false;
}
if (isVPreBoundary) {
context.inVPre = false;
}
return element;
}
// Children.
ancestors.push(element);
const mode = context.options.getTextMode(element, parent);
const children = parseChildren(context, mode, ancestors);
ancestors.pop();
// 2.x inline-template compat
{
const inlineTemplateProp = element.props.find(p => p.type === 6 /* ATTRIBUTE */ && p.name === 'inline-template');
if (inlineTemplateProp &&
checkCompatEnabled("COMPILER_INLINE_TEMPLATE" /* COMPILER_INLINE_TEMPLATE */, context, inlineTemplateProp.loc)) {
const loc = getSelection(context, element.loc.end);
inlineTemplateProp.value = {
type: 2 /* TEXT */,
content: loc.source,
loc
};
}
}
element.children = children;
// End tag.
if (startsWithEndTagOpen(context.source, element.tag)) {
parseTag(context, 1 /* End */, parent);
}
else {
emitError(context, 24 /* X_MISSING_END_TAG */, 0, element.loc.start);
if (context.source.length === 0 && element.tag.toLowerCase() === 'script') {
const first = children[0];
if (first && startsWith(first.loc.source, '<!--')) {
emitError(context, 8 /* EOF_IN_SCRIPT_HTML_COMMENT_LIKE_TEXT */);
}
}
}
element.loc = getSelection(context, element.loc.start);
if (isPreBoundary) {
context.inPre = false;
}
if (isVPreBoundary) {
context.inVPre = false;
}
return element;
}
const isSpecialTemplateDirective = /*#__PURE__*/ makeMap(`if,else,else-if,for,slot`);
function parseTag(context, type, parent) {
// Tag open.
const start = getCursor(context);
const match = /^<\/?([a-z][^\t\r\n\f />]*)/i.exec(context.source);
const tag = match[1];
const ns = context.options.getNamespace(tag, parent);
advanceBy(context, match[0].length);
advanceSpaces(context);
// save current state in case we need to re-parse attributes with v-pre
const cursor = getCursor(context);
const currentSource = context.source;
// check <pre> tag
if (context.options.isPreTag(tag)) {
context.inPre = true;
}
// Attributes.
let props = parseAttributes(context, type);
// check v-pre
if (type === 0 /* Start */ &&
!context.inVPre &&
props.some(p => p.type === 7 /* DIRECTIVE */ && p.name === 'pre')) {
context.inVPre = true;
// reset context
extend(context, cursor);
context.source = currentSource;
// re-parse attrs and filter out v-pre itself
props = parseAttributes(context, type).filter(p => p.name !== 'v-pre');
}
// Tag close.
let isSelfClosing = false;
if (context.source.length === 0) {
emitError(context, 9 /* EOF_IN_TAG */);
}
else {
isSelfClosing = startsWith(context.source, '/>');
if (type === 1 /* End */ && isSelfClosing) {
emitError(context, 4 /* END_TAG_WITH_TRAILING_SOLIDUS */);
}
advanceBy(context, isSelfClosing ? 2 : 1);
}
if (type === 1 /* End */) {
return;
}
// 2.x deprecation checks
if ((process.env.NODE_ENV !== 'production') &&
isCompatEnabled("COMPILER_V_IF_V_FOR_PRECEDENCE" /* COMPILER_V_IF_V_FOR_PRECEDENCE */, context)) {
let hasIf = false;
let hasFor = false;
for (let i = 0; i < props.length; i++) {
const p = props[i];
if (p.type === 7 /* DIRECTIVE */) {
if (p.name === 'if') {
hasIf = true;
}
else if (p.name === 'for') {
hasFor = true;
}
}
if (hasIf && hasFor) {
warnDeprecation("COMPILER_V_IF_V_FOR_PRECEDENCE" /* COMPILER_V_IF_V_FOR_PRECEDENCE */, context, getSelection(context, start));
}
}
}
let tagType = 0 /* ELEMENT */;
if (!context.inVPre) {
if (tag === 'slot') {
tagType = 2 /* SLOT */;
}
else if (tag === 'template') {
if (props.some(p => p.type === 7 /* DIRECTIVE */ && isSpecialTemplateDirective(p.name))) {
tagType = 3 /* TEMPLATE */;
}
}
else if (isComponent(tag, props, context)) {
tagType = 1 /* COMPONENT */;
}
}
return {
type: 1 /* ELEMENT */,
ns,
tag,
tagType,
props,
isSelfClosing,
children: [],
loc: getSelection(context, start),
codegenNode: undefined // to be created during transform phase
};
}
function isComponent(tag, props, context) {
const options = context.options;
if (options.isCustomElement(tag)) {
return false;
}
if (tag === 'component' ||
/^[A-Z]/.test(tag) ||
isCoreComponent(tag) ||
(options.isBuiltInComponent && options.isBuiltInComponent(tag)) ||
(options.isNativeTag && !options.isNativeTag(tag))) {
return true;
}
// at this point the tag should be a native tag, but check for potential "is"
// casting
for (let i = 0; i < props.length; i++) {
const p = props[i];
if (p.type === 6 /* ATTRIBUTE */) {
if (p.name === 'is' && p.value) {
if (p.value.content.startsWith('vue:')) {
return true;
}
else if (checkCompatEnabled("COMPILER_IS_ON_ELEMENT" /* COMPILER_IS_ON_ELEMENT */, context, p.loc)) {
return true;
}
}
}
else {
// directive
// v-is (TODO Deprecate)
if (p.name === 'is') {
return true;
}
else if (
// :is on plain element - only treat as component in compat mode
p.name === 'bind' &&
isBindKey(p.arg, 'is') &&
true &&
checkCompatEnabled("COMPILER_IS_ON_ELEMENT" /* COMPILER_IS_ON_ELEMENT */, context, p.loc)) {
return true;
}
}
}
}
function parseAttributes(context, type) {
const props = [];
const attributeNames = new Set();
while (context.source.length > 0 &&
!startsWith(context.source, '>') &&
!startsWith(context.source, '/>')) {
if (startsWith(context.source, '/')) {
emitError(context, 22 /* UNEXPECTED_SOLIDUS_IN_TAG */);
advanceBy(context, 1);
advanceSpaces(context);
continue;
}
if (type === 1 /* End */) {
emitError(context, 3 /* END_TAG_WITH_ATTRIBUTES */);
}
const attr = parseAttribute(context, attributeNames);
if (type === 0 /* Start */) {
props.push(attr);
}
if (/^[^\t\r\n\f />]/.test(context.source)) {
emitError(context, 15 /* MISSING_WHITESPACE_BETWEEN_ATTRIBUTES */);
}
advanceSpaces(context);
}
return props;
}
function parseAttribute(context, nameSet) {
// Name.
const start = getCursor(context);
const match = /^[^\t\r\n\f />][^\t\r\n\f />=]*/.exec(context.source);
const name = match[0];
if (nameSet.has(name)) {
emitError(context, 2 /* DUPLICATE_ATTRIBUTE */);
}
nameSet.add(name);
if (name[0] === '=') {
emitError(context, 19 /* UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME */);
}
{
const pattern = /["'<]/g;
let m;
while ((m = pattern.exec(name))) {
emitError(context, 17 /* UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME */, m.index);
}
}
advanceBy(context, name.length);
// Value
let value = undefined;
if (/^[\t\r\n\f ]*=/.test(context.source)) {
advanceSpaces(context);
advanceBy(context, 1);
advanceSpaces(context);
value = parseAttributeValue(context);
if (!value) {
emitError(context, 13 /* MISSING_ATTRIBUTE_VALUE */);
}
}
const loc = getSelection(context, start);
if (!context.inVPre && /^(v-|:|\.|@|#)/.test(name)) {
const match = /(?:^v-([a-z0-9-]+))?(?:(?::|^\.|^@|^#)(\[[^\]]+\]|[^\.]+))?(.+)?$/i.exec(name);
let isPropShorthand = startsWith(name, '.');
let dirName = match[1] ||
(isPropShorthand || startsWith(name, ':')
? 'bind'
: startsWith(name, '@')
? 'on'
: 'slot');
let arg;
if (match[2]) {
const isSlot = dirName === 'slot';
const startOffset = name.lastIndexOf(match[2]);
const loc = getSelection(context, getNewPosition(context, start, startOffset), getNewPosition(context, start, startOffset + match[2].length + ((isSlot && match[3]) || '').length));
let content = match[2];
let isStatic = true;
if (content.startsWith('[')) {
isStatic = false;
if (!content.endsWith(']')) {
emitError(context, 26 /* X_MISSING_DYNAMIC_DIRECTIVE_ARGUMENT_END */);
}
content = content.substr(1, content.length - 2);
}
else if (isSlot) {
// #1241 special case for v-slot: vuetify relies extensively on slot
// names containing dots. v-slot doesn't have any modifiers and Vue 2.x
// supports such usage so we are keeping it consistent with 2.x.
content += match[3] || '';
}
arg = {
type: 4 /* SIMPLE_EXPRESSION */,
content,
isStatic,
constType: isStatic
? 3 /* CAN_STRINGIFY */
: 0 /* NOT_CONSTANT */,
loc
};
}
if (value && value.isQuoted) {
const valueLoc = value.loc;
valueLoc.start.offset++;
valueLoc.start.column++;
valueLoc.end = advancePositionWithClone(valueLoc.start, value.content);
valueLoc.source = valueLoc.source.slice(1, -1);
}
const modifiers = match[3] ? match[3].substr(1).split('.') : [];
if (isPropShorthand)
modifiers.push('prop');
// 2.x compat v-bind:foo.sync -> v-model:foo
if (dirName === 'bind' && arg) {
if (modifiers.includes('sync') &&
checkCompatEnabled("COMPILER_V_BIND_SYNC" /* COMPILER_V_BIND_SYNC */, context, loc, arg.loc.source)) {
dirName = 'model';
modifiers.splice(modifiers.indexOf('sync'), 1);
}
if ((process.env.NODE_ENV !== 'production') && modifiers.includes('prop')) {
checkCompatEnabled("COMPILER_V_BIND_PROP" /* COMPILER_V_BIND_PROP */, context, loc);
}
}
return {
type: 7 /* DIRECTIVE */,
name: dirName,
exp: value && {
type: 4 /* SIMPLE_EXPRESSION */,
content: value.content,
isStatic: false,
// Treat as non-constant by default. This can be potentially set to
// other values by `transformExpression` to make it eligible for hoisting.
constType: 0 /* NOT_CONSTANT */,
loc: value.loc
},
arg,
modifiers,
loc
};
}
return {
type: 6 /* ATTRIBUTE */,
name,
value: value && {
type: 2 /* TEXT */,
content: value.content,
loc: value.loc
},
loc
};
}
function parseAttributeValue(context) {
const start = getCursor(context);
let content;
const quote = context.source[0];
const isQuoted = quote === `"` || quote === `'`;
if (isQuoted) {
// Quoted value.
advanceBy(context, 1);
const endIndex = context.source.indexOf(quote);
if (endIndex === -1) {
content = parseTextData(context, context.source.length, 4 /* ATTRIBUTE_VALUE */);
}
else {
content = parseTextData(context, endIndex, 4 /* ATTRIBUTE_VALUE */);
advanceBy(context, 1);
}
}
else {
// Unquoted
const match = /^[^\t\r\n\f >]+/.exec(context.source);
if (!match) {
return undefined;
}
const unexpectedChars = /["'<=`]/g;
let m;
while ((m = unexpectedChars.exec(match[0]))) {
emitError(context, 18 /* UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE */, m.index);
}
content = parseTextData(context, match[0].length, 4 /* ATTRIBUTE_VALUE */);
}
return { content, isQuoted, loc: getSelection(context, start) };
}
function parseInterpolation(context, mode) {
const [open, close] = context.options.delimiters;
const closeIndex = context.source.indexOf(close, open.length);
if (closeIndex === -1) {
emitError(context, 25 /* X_MISSING_INTERPOLATION_END */);
return undefined;
}
const start = getCursor(context);
advanceBy(context, open.length);
const innerStart = getCursor(context);
const innerEnd = getCursor(context);
const rawContentLength = closeIndex - open.length;
const rawContent = context.source.slice(0, rawContentLength);
const preTrimContent = parseTextData(context, rawContentLength, mode);
const content = preTrimContent.trim();
const startOffset = preTrimContent.indexOf(content);
if (startOffset > 0) {
advancePositionWithMutation(innerStart, rawContent, startOffset);
}
const endOffset = rawContentLength - (preTrimContent.length - content.length - startOffset);
advancePositionWithMutation(innerEnd, rawContent, endOffset);
advanceBy(context, close.length);
return {
type: 5 /* INTERPOLATION */,
content: {
type: 4 /* SIMPLE_EXPRESSION */,
isStatic: false,
// Set `isConstant` to false by default and will decide in transformExpression
constType: 0 /* NOT_CONSTANT */,
content,
loc: getSelection(context, innerStart, innerEnd)
},
loc: getSelection(context, start)
};
}
function parseText(context, mode) {
const endTokens = ['<', context.options.delimiters[0]];
if (mode === 3 /* CDATA */) {
endTokens.push(']]>');
}
let endIndex = context.source.length;
for (let i = 0; i < endTokens.length; i++) {
const index = context.source.indexOf(endTokens[i], 1);
if (index !== -1 && endIndex > index) {
endIndex = index;
}
}
const start = getCursor(context);
const content = parseTextData(context, endIndex, mode);
return {
type: 2 /* TEXT */,
content,
loc: getSelection(context, start)
};
}
/**
* Get text data with a given length from the current location.
* This translates HTML entities in the text data.
*/
function parseTextData(context, length, mode) {
const rawText = context.source.slice(0, length);
advanceBy(context, length);
if (mode === 2 /* RAWTEXT */ ||
mode === 3 /* CDATA */ ||
rawText.indexOf('&') === -1) {
return rawText;
}
else {
// DATA or RCDATA containing "&"". Entity decoding required.
return context.options.decodeEntities(rawText, mode === 4 /* ATTRIBUTE_VALUE */);
}
}
function getCursor(context) {
const { column, line, offset } = context;
return { column, line, offset };
}
function getSelection(context, start, end) {
end = end || getCursor(context);
return {
start,
end,
source: context.originalSource.slice(start.offset, end.offset)
};
}
function last(xs) {
return xs[xs.length - 1];
}
function startsWith(source, searchString) {
return source.startsWith(searchString);
}
function advanceBy(context, numberOfCharacters) {
const { source } = context;
advancePositionWithMutation(context, source, numberOfCharacters);
context.source = source.slice(numberOfCharacters);
}
function advanceSpaces(context) {
const match = /^[\t\r\n\f ]+/.exec(context.source);
if (match) {
advanceBy(context, match[0].length);
}
}
function getNewPosition(context, start, numberOfCharacters) {
return advancePositionWithClone(start, context.originalSource.slice(start.offset, numberOfCharacters), numberOfCharacters);
}
function emitError(context, code, offset, loc = getCursor(context)) {
if (offset) {
loc.offset += offset;
loc.column += offset;
}
context.options.onError(createCompilerError(code, {
start: loc,
end: loc,
source: ''
}));
}
function isEnd(context, mode, ancestors) {
const s = context.source;
switch (mode) {
case 0 /* DATA */:
if (startsWith(s, '</')) {
// TODO: probably bad performance
for (let i = ancestors.length - 1; i >= 0; --i) {
if (startsWithEndTagOpen(s, ancestors[i].tag)) {
return true;
}
}
}
break;
case 1 /* RCDATA */:
case 2 /* RAWTEXT */: {
const parent = last(ancestors);
if (parent && startsWithEndTagOpen(s, parent.tag)) {
return true;
}
break;
}
case 3 /* CDATA */:
if (startsWith(s, ']]>')) {
return true;
}
break;
}
return !s;
}
function startsWithEndTagOpen(source, tag) {
return (startsWith(source, '</') &&
source.substr(2, tag.length).toLowerCase() === tag.toLowerCase() &&
/[\t\r\n\f />]/.test(source[2 + tag.length] || '>'));
}
function hoistStatic(root, context) {
walk(root, context,
// Root node is unfortunately non-hoistable due to potential parent
// fallthrough attributes.
isSingleElementRoot(root, root.children[0]));
}
function isSingleElementRoot(root, child) {
const { children } = root;
return (children.length === 1 &&
child.type === 1 /* ELEMENT */ &&
!isSlotOutlet(child));
}
function walk(node, context, doNotHoistNode = false) {
// Some transforms, e.g. transformAssetUrls from @vue/compiler-sfc, replaces
// static bindings with expressions. These expressions are guaranteed to be
// constant so they are still eligible for hoisting, but they are only
// available at runtime and therefore cannot be evaluated ahead of time.
// This is only a concern for pre-stringification (via transformHoist by
// @vue/compiler-dom), but doing it here allows us to perform only one full
// walk of the AST and allow `stringifyStatic` to stop walking as soon as its
// stringficiation threshold is met.
let canStringify = true;
const { children } = node;
const originalCount = children.length;
let hoistedCount = 0;
for (let i = 0; i < children.length; i++) {
const child = children[i];
// only plain elements & text calls are eligible for hoisting.
if (child.type === 1 /* ELEMENT */ &&
child.tagType === 0 /* ELEMENT */) {
const constantType = doNotHoistNode
? 0 /* NOT_CONSTANT */
: getConstantType(child, context);
if (constantType > 0 /* NOT_CONSTANT */) {
if (constantType < 3 /* CAN_STRINGIFY */) {
canStringify = false;
}
if (constantType >= 2 /* CAN_HOIST */) {
child.codegenNode.patchFlag =
-1 /* HOISTED */ + ((process.env.NODE_ENV !== 'production') ? ` /* HOISTED */` : ``);
child.codegenNode = context.hoist(child.codegenNode);
hoistedCount++;
continue;
}
}
else {
// node may contain dynamic children, but its props may be eligible for
// hoisting.
const codegenNode = child.codegenNode;
if (codegenNode.type === 13 /* VNODE_CALL */) {
const flag = getPatchFlag(codegenNode);
if ((!flag ||
flag === 512 /* NEED_PATCH */ ||
flag === 1 /* TEXT */) &&
getGeneratedPropsConstantType(child, context) >=
2 /* CAN_HOIST */) {
const props = getNodeProps(child);
if (props) {
codegenNode.props = context.hoist(props);
}
}
if (codegenNode.dynamicProps) {
codegenNode.dynamicProps = context.hoist(codegenNode.dynamicProps);
}
}
}
}
else if (child.type === 12 /* TEXT_CALL */) {
const contentType = getConstantType(child.content, context);
if (contentType > 0) {
if (contentType < 3 /* CAN_STRINGIFY */) {
canStringify = false;
}
if (contentType >= 2 /* CAN_HOIST */) {
child.codegenNode = context.hoist(child.codegenNode);
hoistedCount++;
}
}
}
// walk further
if (child.type === 1 /* ELEMENT */) {
const isComponent = child.tagType === 1 /* COMPONENT */;
if (isComponent) {
context.scopes.vSlot++;
}
walk(child, context);
if (isComponent) {
context.scopes.vSlot--;
}
}
else if (child.type === 11 /* FOR */) {
// Do not hoist v-for single child because it has to be a block
walk(child, context, child.children.length === 1);
}
else if (child.type === 9 /* IF */) {
for (let i = 0; i < child.branches.length; i++) {
// Do not hoist v-if single child because it has to be a block
walk(child.branches[i], context, child.branches[i].children.length === 1);
}
}
}
if (canStringify && hoistedCount && context.transformHoist) {
context.transformHoist(children, context, node);
}
// all children were hoisted - the entire children array is hoistable.
if (hoistedCount &&
hoistedCount === originalCount &&
node.type === 1 /* ELEMENT */ &&
node.tagType === 0 /* ELEMENT */ &&
node.codegenNode &&
node.codegenNode.type === 13 /* VNODE_CALL */ &&
isArray(node.codegenNode.children)) {
node.codegenNode.children = context.hoist(createArrayExpression(node.codegenNode.children));
}
}
function getConstantType(node, context) {
const { constantCache } = context;
switch (node.type) {
case 1 /* ELEMENT */:
if (node.tagType !== 0 /* ELEMENT */) {
return 0 /* NOT_CONSTANT */;
}
const cached = constantCache.get(node);
if (cached !== undefined) {
return cached;
}
const codegenNode = node.codegenNode;
if (codegenNode.type !== 13 /* VNODE_CALL */) {
return 0 /* NOT_CONSTANT */;
}
const flag = getPatchFlag(codegenNode);
if (!flag) {
let returnType = 3 /* CAN_STRINGIFY */;
// Element itself has no patch flag. However we still need to check:
// 1. Even for a node with no patch flag, it is possible for it to contain
// non-hoistable expressions that refers to scope variables, e.g. compiler
// injected keys or cached event handlers. Therefore we need to always
// check the codegenNode's props to be sure.
const generatedPropsType = getGeneratedPropsConstantType(node, context);
if (generatedPropsType === 0 /* NOT_CONSTANT */) {
constantCache.set(node, 0 /* NOT_CONSTANT */);
return 0 /* NOT_CONSTANT */;
}
if (generatedPropsType < returnType) {
returnType = generatedPropsType;
}
// 2. its children.
for (let i = 0; i < node.children.length; i++) {
const childType = getConstantType(node.children[i], context);
if (childType === 0 /* NOT_CONSTANT */) {
constantCache.set(node, 0 /* NOT_CONSTANT */);
return 0 /* NOT_CONSTANT */;
}
if (childType < returnType) {
returnType = childType;
}
}
// 3. if the type is not already CAN_SKIP_PATCH which is the lowest non-0
// type, check if any of the props can cause the type to be lowered
// we can skip can_patch because it's guaranteed by the absence of a
// patchFlag.
if (returnType > 1 /* CAN_SKIP_PATCH */) {
for (let i = 0; i < node.props.length; i++) {
const p = node.props[i];
if (p.type === 7 /* DIRECTIVE */ && p.name === 'bind' && p.exp) {
const expType = getConstantType(p.exp, context);
if (expType === 0 /* NOT_CONSTANT */) {
constantCache.set(node, 0 /* NOT_CONSTANT */);
return 0 /* NOT_CONSTANT */;
}
if (expType < returnType) {
returnType = expType;
}
}
}
}
// only svg/foreignObject could be block here, however if they are
// static then they don't need to be blocks since there will be no
// nested updates.
if (codegenNode.isBlock) {
context.removeHelper(OPEN_BLOCK);
context.removeHelper(getVNodeBlockHelper(context.inSSR, codegenNode.isComponent));
codegenNode.isBlock = false;
context.helper(getVNodeHelper(context.inSSR, codegenNode.isComponent));
}
constantCache.set(node, returnType);
return returnType;
}
else {
constantCache.set(node, 0 /* NOT_CONSTANT */);
return 0 /* NOT_CONSTANT */;
}
case 2 /* TEXT */:
case 3 /* COMMENT */:
return 3 /* CAN_STRINGIFY */;
case 9 /* IF */:
case 11 /* FOR */:
case 10 /* IF_BRANCH */:
return 0 /* NOT_CONSTANT */;
case 5 /* INTERPOLATION */:
case 12 /* TEXT_CALL */:
return getConstantType(node.content, context);
case 4 /* SIMPLE_EXPRESSION */:
return node.constType;
case 8 /* COMPOUND_EXPRESSION */:
let returnType = 3 /* CAN_STRINGIFY */;
for (let i = 0; i < node.children.length; i++) {
const child = node.children[i];
if (isString(child) || isSymbol(child)) {
continue;
}
const childType = getConstantType(child, context);
if (childType === 0 /* NOT_CONSTANT */) {
return 0 /* NOT_CONSTANT */;
}
else if (childType < returnType) {
returnType = childType;
}
}
return returnType;
default:
if ((process.env.NODE_ENV !== 'production')) ;
return 0 /* NOT_CONSTANT */;
}
}
const allowHoistedHelperSet = new Set([
NORMALIZE_CLASS,
NORMALIZE_STYLE,
NORMALIZE_PROPS,
GUARD_REACTIVE_PROPS
]);
function getConstantTypeOfHelperCall(value, context) {
if (value.type === 14 /* JS_CALL_EXPRESSION */ &&
!isString(value.callee) &&
allowHoistedHelperSet.has(value.callee)) {
const arg = value.arguments[0];
if (arg.type === 4 /* SIMPLE_EXPRESSION */) {
return getConstantType(arg, context);
}
else if (arg.type === 14 /* JS_CALL_EXPRESSION */) {
// in the case of nested helper call, e.g. `normalizeProps(guardReactiveProps(exp))`
return getConstantTypeOfHelperCall(arg, context);
}
}
return 0 /* NOT_CONSTANT */;
}
function getGeneratedPropsConstantType(node, context) {
let returnType = 3 /* CAN_STRINGIFY */;
const props = getNodeProps(node);
if (props && props.type === 15 /* JS_OBJECT_EXPRESSION */) {
const { properties } = props;
for (let i = 0; i < properties.length; i++) {
const { key, value } = properties[i];
const keyType = getConstantType(key, context);
if (keyType === 0 /* NOT_CONSTANT */) {
return keyType;
}
if (keyType < returnType) {
returnType = keyType;
}
let valueType;
if (value.type === 4 /* SIMPLE_EXPRESSION */) {
valueType = getConstantType(value, context);
}
else if (value.type === 14 /* JS_CALL_EXPRESSION */) {
// some helper calls can be hoisted,
// such as the `normalizeProps` generated by the compiler for pre-normalize class,
// in this case we need to respect the ConstanType of the helper's argments
valueType = getConstantTypeOfHelperCall(value, context);
}
else {
valueType = 0 /* NOT_CONSTANT */;
}
if (valueType === 0 /* NOT_CONSTANT */) {
return valueType;
}
if (valueType < returnType) {
returnType = valueType;
}
}
}
return returnType;
}
function getNodeProps(node) {
const codegenNode = node.codegenNode;
if (codegenNode.type === 13 /* VNODE_CALL */) {
return codegenNode.props;
}
}
function getPatchFlag(node) {
const flag = node.patchFlag;
return flag ? parseInt(flag, 10) : undefined;
}
function createTransformContext(root, { filename = '', prefixIdentifiers = false, hoistStatic = false, cacheHandlers = false, nodeTransforms = [], directiveTransforms = {}, transformHoist = null, isBuiltInComponent = NOOP, isCustomElement = NOOP, expressionPlugins = [], scopeId = null, slotted = true, ssr = false, inSSR = false, ssrCssVars = ``, bindingMetadata = EMPTY_OBJ, inline = false, isTS = false, onError = defaultOnError, onWarn = defaultOnWarn, compatConfig }) {
const nameMatch = filename.replace(/\?.*$/, '').match(/([^/\\]+)\.\w+$/);
const context = {
// options
selfName: nameMatch && capitalize(camelize$1(nameMatch[1])),
prefixIdentifiers,
hoistStatic,
cacheHandlers,
nodeTransforms,
directiveTransforms,
transformHoist,
isBuiltInComponent,
isCustomElement,
expressionPlugins,
scopeId,
slotted,
ssr,
inSSR,
ssrCssVars,
bindingMetadata,
inline,
isTS,
onError,
onWarn,
compatConfig,
// state
root,
helpers: new Map(),
components: new Set(),
directives: new Set(),
hoists: [],
imports: [],
constantCache: new Map(),
temps: 0,
cached: 0,
identifiers: Object.create(null),
scopes: {
vFor: 0,
vSlot: 0,
vPre: 0,
vOnce: 0
},
parent: null,
currentNode: root,
childIndex: 0,
inVOnce: false,
// methods
helper(name) {
const count = context.helpers.get(name) || 0;
context.helpers.set(name, count + 1);
return name;
},
removeHelper(name) {
const count = context.helpers.get(name);
if (count) {
const currentCount = count - 1;
if (!currentCount) {
context.helpers.delete(name);
}
else {
context.helpers.set(name, currentCount);
}
}
},
helperString(name) {
return `_${helperNameMap[context.helper(name)]}`;
},
replaceNode(node) {
/* istanbul ignore if */
if ((process.env.NODE_ENV !== 'production')) {
if (!context.currentNode) {
throw new Error(`Node being replaced is already removed.`);
}
if (!context.parent) {
throw new Error(`Cannot replace root node.`);
}
}
context.parent.children[context.childIndex] = context.currentNode = node;
},
removeNode(node) {
if ((process.env.NODE_ENV !== 'production') && !context.parent) {
throw new Error(`Cannot remove root node.`);
}
const list = context.parent.children;
const removalIndex = node
? list.indexOf(node)
: context.currentNode
? context.childIndex
: -1;
/* istanbul ignore if */
if ((process.env.NODE_ENV !== 'production') && removalIndex < 0) {
throw new Error(`node being removed is not a child of current parent`);
}
if (!node || node === context.currentNode) {
// current node removed
context.currentNode = null;
context.onNodeRemoved();
}
else {
// sibling node removed
if (context.childIndex > removalIndex) {
context.childIndex--;
context.onNodeRemoved();
}
}
context.parent.children.splice(removalIndex, 1);
},
onNodeRemoved: () => { },
addIdentifiers(exp) {
},
removeIdentifiers(exp) {
},
hoist(exp) {
if (isString(exp))
exp = createSimpleExpression(exp);
context.hoists.push(exp);
const identifier = createSimpleExpression(`_hoisted_${context.hoists.length}`, false, exp.loc, 2 /* CAN_HOIST */);
identifier.hoisted = exp;
return identifier;
},
cache(exp, isVNode = false) {
return createCacheExpression(context.cached++, exp, isVNode);
}
};
{
context.filters = new Set();
}
return context;
}
function transform(root, options) {
const context = createTransformContext(root, options);
traverseNode(root, context);
if (options.hoistStatic) {
hoistStatic(root, context);
}
if (!options.ssr) {
createRootCodegen(root, context);
}
// finalize meta information
root.helpers = [...context.helpers.keys()];
root.components = [...context.components];
root.directives = [...context.directives];
root.imports = context.imports;
root.hoists = context.hoists;
root.temps = context.temps;
root.cached = context.cached;
{
root.filters = [...context.filters];
}
}
function createRootCodegen(root, context) {
const { helper } = context;
const { children } = root;
if (children.length === 1) {
const child = children[0];
// if the single child is an element, turn it into a block.
if (isSingleElementRoot(root, child) && child.codegenNode) {
// single element root is never hoisted so codegenNode will never be
// SimpleExpressionNode
const codegenNode = child.codegenNode;
if (codegenNode.type === 13 /* VNODE_CALL */) {
makeBlock(codegenNode, context);
}
root.codegenNode = codegenNode;
}
else {
// - single <slot/>, IfNode, ForNode: already blocks.
// - single text node: always patched.
// root codegen falls through via genNode()
root.codegenNode = child;
}
}
else if (children.length > 1) {
// root has multiple nodes - return a fragment block.
let patchFlag = 64 /* STABLE_FRAGMENT */;
let patchFlagText = PatchFlagNames[64 /* STABLE_FRAGMENT */];
// check if the fragment actually contains a single valid child with
// the rest being comments
if ((process.env.NODE_ENV !== 'production') &&
children.filter(c => c.type !== 3 /* COMMENT */).length === 1) {
patchFlag |= 2048 /* DEV_ROOT_FRAGMENT */;
patchFlagText += `, ${PatchFlagNames[2048 /* DEV_ROOT_FRAGMENT */]}`;
}
root.codegenNode = createVNodeCall(context, helper(FRAGMENT), undefined, root.children, patchFlag + ((process.env.NODE_ENV !== 'production') ? ` /* ${patchFlagText} */` : ``), undefined, undefined, true, undefined, false /* isComponent */);
}
else ;
}
function traverseChildren(parent, context) {
let i = 0;
const nodeRemoved = () => {
i--;
};
for (; i < parent.children.length; i++) {
const child = parent.children[i];
if (isString(child))
continue;
context.parent = parent;
context.childIndex = i;
context.onNodeRemoved = nodeRemoved;
traverseNode(child, context);
}
}
function traverseNode(node, context) {
context.currentNode = node;
// apply transform plugins
const { nodeTransforms } = context;
const exitFns = [];
for (let i = 0; i < nodeTransforms.length; i++) {
const onExit = nodeTransforms[i](node, context);
if (onExit) {
if (isArray(onExit)) {
exitFns.push(...onExit);
}
else {
exitFns.push(onExit);
}
}
if (!context.currentNode) {
// node was removed
return;
}
else {
// node may have been replaced
node = context.currentNode;
}
}
switch (node.type) {
case 3 /* COMMENT */:
if (!context.ssr) {
// inject import for the Comment symbol, which is needed for creating
// comment nodes with `createVNode`
context.helper(CREATE_COMMENT);
}
break;
case 5 /* INTERPOLATION */:
// no need to traverse, but we need to inject toString helper
if (!context.ssr) {
context.helper(TO_DISPLAY_STRING);
}
break;
// for container types, further traverse downwards
case 9 /* IF */:
for (let i = 0; i < node.branches.length; i++) {
traverseNode(node.branches[i], context);
}
break;
case 10 /* IF_BRANCH */:
case 11 /* FOR */:
case 1 /* ELEMENT */:
case 0 /* ROOT */:
traverseChildren(node, context);
break;
}
// exit transforms
context.currentNode = node;
let i = exitFns.length;
while (i--) {
exitFns[i]();
}
}
function createStructuralDirectiveTransform(name, fn) {
const matches = isString(name)
? (n) => n === name
: (n) => name.test(n);
return (node, context) => {
if (node.type === 1 /* ELEMENT */) {
const { props } = node;
// structural directive transforms are not concerned with slots
// as they are handled separately in vSlot.ts
if (node.tagType === 3 /* TEMPLATE */ && props.some(isVSlot)) {
return;
}
const exitFns = [];
for (let i = 0; i < props.length; i++) {
const prop = props[i];
if (prop.type === 7 /* DIRECTIVE */ && matches(prop.name)) {
// structural directives are removed to avoid infinite recursion
// also we remove them *before* applying so that it can further
// traverse itself in case it moves the node around
props.splice(i, 1);
i--;
const onExit = fn(node, prop, context);
if (onExit)
exitFns.push(onExit);
}
}
return exitFns;
}
};
}
const PURE_ANNOTATION = `/*#__PURE__*/`;
function createCodegenContext(ast, { mode = 'function', prefixIdentifiers = mode === 'module', sourceMap = false, filename = `template.vue.html`, scopeId = null, optimizeImports = false, runtimeGlobalName = `Vue`, runtimeModuleName = `vue`, ssr = false, isTS = false, inSSR = false }) {
const context = {
mode,
prefixIdentifiers,
sourceMap,
filename,
scopeId,
optimizeImports,
runtimeGlobalName,
runtimeModuleName,
ssr,
isTS,
inSSR,
source: ast.loc.source,
code: ``,
column: 1,
line: 1,
offset: 0,
indentLevel: 0,
pure: false,
map: undefined,
helper(key) {
return `_${helperNameMap[key]}`;
},
push(code, node) {
context.code += code;
},
indent() {
newline(++context.indentLevel);
},
deindent(withoutNewLine = false) {
if (withoutNewLine) {
--context.indentLevel;
}
else {
newline(--context.indentLevel);
}
},
newline() {
newline(context.indentLevel);
}
};
function newline(n) {
context.push('\n' + ` `.repeat(n));
}
return context;
}
function generate(ast, options = {}) {
const context = createCodegenContext(ast, options);
if (options.onContextCreated)
options.onContextCreated(context);
const { mode, push, prefixIdentifiers, indent, deindent, newline, scopeId, ssr } = context;
const hasHelpers = ast.helpers.length > 0;
const useWithBlock = !prefixIdentifiers && mode !== 'module';
// preambles
// in setup() inline mode, the preamble is generated in a sub context
// and returned separately.
const preambleContext = context;
{
genFunctionPreamble(ast, preambleContext);
}
// enter render function
const functionName = ssr ? `ssrRender` : `render`;
const args = ssr ? ['_ctx', '_push', '_parent', '_attrs'] : ['_ctx', '_cache'];
const signature = args.join(', ');
{
push(`function ${functionName}(${signature}) {`);
}
indent();
if (useWithBlock) {
push(`with (_ctx) {`);
indent();
// function mode const declarations should be inside with block
// also they should be renamed to avoid collision with user properties
if (hasHelpers) {
push(`const { ${ast.helpers
.map(s => `${helperNameMap[s]}: _${helperNameMap[s]}`)
.join(', ')} } = _Vue`);
push(`\n`);
newline();
}
}
// generate asset resolution statements
if (ast.components.length) {
genAssets(ast.components, 'component', context);
if (ast.directives.length || ast.temps > 0) {
newline();
}
}
if (ast.directives.length) {
genAssets(ast.directives, 'directive', context);
if (ast.temps > 0) {
newline();
}
}
if (ast.filters && ast.filters.length) {
newline();
genAssets(ast.filters, 'filter', context);
newline();
}
if (ast.temps > 0) {
push(`let `);
for (let i = 0; i < ast.temps; i++) {
push(`${i > 0 ? `, ` : ``}_temp${i}`);
}
}
if (ast.components.length || ast.directives.length || ast.temps) {
push(`\n`);
newline();
}
// generate the VNode tree expression
if (!ssr) {
push(`return `);
}
if (ast.codegenNode) {
genNode(ast.codegenNode, context);
}
else {
push(`null`);
}
if (useWithBlock) {
deindent();
push(`}`);
}
deindent();
push(`}`);
return {
ast,
code: context.code,
preamble: ``,
// SourceMapGenerator does have toJSON() method but it's not in the types
map: context.map ? context.map.toJSON() : undefined
};
}
function genFunctionPreamble(ast, context) {
const { ssr, prefixIdentifiers, push, newline, runtimeModuleName, runtimeGlobalName } = context;
const VueBinding = runtimeGlobalName;
const aliasHelper = (s) => `${helperNameMap[s]}: _${helperNameMap[s]}`;
// Generate const declaration for helpers
// In prefix mode, we place the const declaration at top so it's done
// only once; But if we not prefixing, we place the declaration inside the
// with block so it doesn't incur the `in` check cost for every helper access.
if (ast.helpers.length > 0) {
{
// "with" mode.
// save Vue in a separate variable to avoid collision
push(`const _Vue = ${VueBinding}\n`);
// in "with" mode, helpers are declared inside the with block to avoid
// has check cost, but hoists are lifted out of the function - we need
// to provide the helper here.
if (ast.hoists.length) {
const staticHelpers = [
CREATE_VNODE,
CREATE_ELEMENT_VNODE,
CREATE_COMMENT,
CREATE_TEXT,
CREATE_STATIC
]
.filter(helper => ast.helpers.includes(helper))
.map(aliasHelper)
.join(', ');
push(`const { ${staticHelpers} } = _Vue\n`);
}
}
}
genHoists(ast.hoists, context);
newline();
push(`return `);
}
function genAssets(assets, type, { helper, push, newline, isTS }) {
const resolver = helper(type === 'filter'
? RESOLVE_FILTER
: type === 'component'
? RESOLVE_COMPONENT
: RESOLVE_DIRECTIVE);
for (let i = 0; i < assets.length; i++) {
let id = assets[i];
// potential component implicit self-reference inferred from SFC filename
const maybeSelfReference = id.endsWith('__self');
if (maybeSelfReference) {
id = id.slice(0, -6);
}
push(`const ${toValidAssetId(id, type)} = ${resolver}(${JSON.stringify(id)}${maybeSelfReference ? `, true` : ``})${isTS ? `!` : ``}`);
if (i < assets.length - 1) {
newline();
}
}
}
function genHoists(hoists, context) {
if (!hoists.length) {
return;
}
context.pure = true;
const { push, newline, helper, scopeId, mode } = context;
newline();
hoists.forEach((exp, i) => {
if (exp) {
push(`const _hoisted_${i + 1} = `);
genNode(exp, context);
newline();
}
});
context.pure = false;
}
function isText$1(n) {
return (isString(n) ||
n.type === 4 /* SIMPLE_EXPRESSION */ ||
n.type === 2 /* TEXT */ ||
n.type === 5 /* INTERPOLATION */ ||
n.type === 8 /* COMPOUND_EXPRESSION */);
}
function genNodeListAsArray(nodes, context) {
const multilines = nodes.length > 3 ||
(((process.env.NODE_ENV !== 'production')) && nodes.some(n => isArray(n) || !isText$1(n)));
context.push(`[`);
multilines && context.indent();
genNodeList(nodes, context, multilines);
multilines && context.deindent();
context.push(`]`);
}
function genNodeList(nodes, context, multilines = false, comma = true) {
const { push, newline } = context;
for (let i = 0; i < nodes.length; i++) {
const node = nodes[i];
if (isString(node)) {
push(node);
}
else if (isArray(node)) {
genNodeListAsArray(node, context);
}
else {
genNode(node, context);
}
if (i < nodes.length - 1) {
if (multilines) {
comma && push(',');
newline();
}
else {
comma && push(', ');
}
}
}
}
function genNode(node, context) {
if (isString(node)) {
context.push(node);
return;
}
if (isSymbol(node)) {
context.push(context.helper(node));
return;
}
switch (node.type) {
case 1 /* ELEMENT */:
case 9 /* IF */:
case 11 /* FOR */:
(process.env.NODE_ENV !== 'production') &&
assert(node.codegenNode != null, `Codegen node is missing for element/if/for node. ` +
`Apply appropriate transforms first.`);
genNode(node.codegenNode, context);
break;
case 2 /* TEXT */:
genText(node, context);
break;
case 4 /* SIMPLE_EXPRESSION */:
genExpression(node, context);
break;
case 5 /* INTERPOLATION */:
genInterpolation(node, context);
break;
case 12 /* TEXT_CALL */:
genNode(node.codegenNode, context);
break;
case 8 /* COMPOUND_EXPRESSION */:
genCompoundExpression(node, context);
break;
case 3 /* COMMENT */:
genComment(node, context);
break;
case 13 /* VNODE_CALL */:
genVNodeCall(node, context);
break;
case 14 /* JS_CALL_EXPRESSION */:
genCallExpression(node, context);
break;
case 15 /* JS_OBJECT_EXPRESSION */:
genObjectExpression(node, context);
break;
case 17 /* JS_ARRAY_EXPRESSION */:
genArrayExpression(node, context);
break;
case 18 /* JS_FUNCTION_EXPRESSION */:
genFunctionExpression(node, context);
break;
case 19 /* JS_CONDITIONAL_EXPRESSION */:
genConditionalExpression(node, context);
break;
case 20 /* JS_CACHE_EXPRESSION */:
genCacheExpression(node, context);
break;
case 21 /* JS_BLOCK_STATEMENT */:
genNodeList(node.body, context, true, false);
break;
// SSR only types
case 22 /* JS_TEMPLATE_LITERAL */:
break;
case 23 /* JS_IF_STATEMENT */:
break;
case 24 /* JS_ASSIGNMENT_EXPRESSION */:
break;
case 25 /* JS_SEQUENCE_EXPRESSION */:
break;
case 26 /* JS_RETURN_STATEMENT */:
break;
/* istanbul ignore next */
case 10 /* IF_BRANCH */:
// noop
break;
default:
if ((process.env.NODE_ENV !== 'production')) {
assert(false, `unhandled codegen node type: ${node.type}`);
// make sure we exhaust all possible types
const exhaustiveCheck = node;
return exhaustiveCheck;
}
}
}
function genText(node, context) {
context.push(JSON.stringify(node.content), node);
}
function genExpression(node, context) {
const { content, isStatic } = node;
context.push(isStatic ? JSON.stringify(content) : content, node);
}
function genInterpolation(node, context) {
const { push, helper, pure } = context;
if (pure)
push(PURE_ANNOTATION);
push(`${helper(TO_DISPLAY_STRING)}(`);
genNode(node.content, context);
push(`)`);
}
function genCompoundExpression(node, context) {
for (let i = 0; i < node.children.length; i++) {
const child = node.children[i];
if (isString(child)) {
context.push(child);
}
else {
genNode(child, context);
}
}
}
function genExpressionAsPropertyKey(node, context) {
const { push } = context;
if (node.type === 8 /* COMPOUND_EXPRESSION */) {
push(`[`);
genCompoundExpression(node, context);
push(`]`);
}
else if (node.isStatic) {
// only quote keys if necessary
const text = isSimpleIdentifier(node.content)
? node.content
: JSON.stringify(node.content);
push(text, node);
}
else {
push(`[${node.content}]`, node);
}
}
function genComment(node, context) {
const { push, helper, pure } = context;
if (pure) {
push(PURE_ANNOTATION);
}
push(`${helper(CREATE_COMMENT)}(${JSON.stringify(node.content)})`, node);
}
function genVNodeCall(node, context) {
const { push, helper, pure } = context;
const { tag, props, children, patchFlag, dynamicProps, directives, isBlock, disableTracking, isComponent } = node;
if (directives) {
push(helper(WITH_DIRECTIVES) + `(`);
}
if (isBlock) {
push(`(${helper(OPEN_BLOCK)}(${disableTracking ? `true` : ``}), `);
}
if (pure) {
push(PURE_ANNOTATION);
}
const callHelper = isBlock
? getVNodeBlockHelper(context.inSSR, isComponent)
: getVNodeHelper(context.inSSR, isComponent);
push(helper(callHelper) + `(`, node);
genNodeList(genNullableArgs([tag, props, children, patchFlag, dynamicProps]), context);
push(`)`);
if (isBlock) {
push(`)`);
}
if (directives) {
push(`, `);
genNode(directives, context);
push(`)`);
}
}
function genNullableArgs(args) {
let i = args.length;
while (i--) {
if (args[i] != null)
break;
}
return args.slice(0, i + 1).map(arg => arg || `null`);
}
// JavaScript
function genCallExpression(node, context) {
const { push, helper, pure } = context;
const callee = isString(node.callee) ? node.callee : helper(node.callee);
if (pure) {
push(PURE_ANNOTATION);
}
push(callee + `(`, node);
genNodeList(node.arguments, context);
push(`)`);
}
function genObjectExpression(node, context) {
const { push, indent, deindent, newline } = context;
const { properties } = node;
if (!properties.length) {
push(`{}`, node);
return;
}
const multilines = properties.length > 1 ||
(((process.env.NODE_ENV !== 'production')) &&
properties.some(p => p.value.type !== 4 /* SIMPLE_EXPRESSION */));
push(multilines ? `{` : `{ `);
multilines && indent();
for (let i = 0; i < properties.length; i++) {
const { key, value } = properties[i];
// key
genExpressionAsPropertyKey(key, context);
push(`: `);
// value
genNode(value, context);
if (i < properties.length - 1) {
// will only reach this if it's multilines
push(`,`);
newline();
}
}
multilines && deindent();
push(multilines ? `}` : ` }`);
}
function genArrayExpression(node, context) {
genNodeListAsArray(node.elements, context);
}
function genFunctionExpression(node, context) {
const { push, indent, deindent } = context;
const { params, returns, body, newline, isSlot } = node;
if (isSlot) {
// wrap slot functions with owner context
push(`_${helperNameMap[WITH_CTX]}(`);
}
push(`(`, node);
if (isArray(params)) {
genNodeList(params, context);
}
else if (params) {
genNode(params, context);
}
push(`) => `);
if (newline || body) {
push(`{`);
indent();
}
if (returns) {
if (newline) {
push(`return `);
}
if (isArray(returns)) {
genNodeListAsArray(returns, context);
}
else {
genNode(returns, context);
}
}
else if (body) {
genNode(body, context);
}
if (newline || body) {
deindent();
push(`}`);
}
if (isSlot) {
if (node.isNonScopedSlot) {
push(`, undefined, true`);
}
push(`)`);
}
}
function genConditionalExpression(node, context) {
const { test, consequent, alternate, newline: needNewline } = node;
const { push, indent, deindent, newline } = context;
if (test.type === 4 /* SIMPLE_EXPRESSION */) {
const needsParens = !isSimpleIdentifier(test.content);
needsParens && push(`(`);
genExpression(test, context);
needsParens && push(`)`);
}
else {
push(`(`);
genNode(test, context);
push(`)`);
}
needNewline && indent();
context.indentLevel++;
needNewline || push(` `);
push(`? `);
genNode(consequent, context);
context.indentLevel--;
needNewline && newline();
needNewline || push(` `);
push(`: `);
const isNested = alternate.type === 19 /* JS_CONDITIONAL_EXPRESSION */;
if (!isNested) {
context.indentLevel++;
}
genNode(alternate, context);
if (!isNested) {
context.indentLevel--;
}
needNewline && deindent(true /* without newline */);
}
function genCacheExpression(node, context) {
const { push, helper, indent, deindent, newline } = context;
push(`_cache[${node.index}] || (`);
if (node.isVNode) {
indent();
push(`${helper(SET_BLOCK_TRACKING)}(-1),`);
newline();
}
push(`_cache[${node.index}] = `);
genNode(node.value, context);
if (node.isVNode) {
push(`,`);
newline();
push(`${helper(SET_BLOCK_TRACKING)}(1),`);
newline();
push(`_cache[${node.index}]`);
deindent();
}
push(`)`);
}
function walkIdentifiers(root, onIdentifier, includeAll = false, parentStack = [], knownIds = Object.create(null)) {
const rootExp = root.type === 'Program' &&
root.body[0].type === 'ExpressionStatement' &&
root.body[0].expression;
build.walk(root, {
enter(node, parent) {
parent && parentStack.push(parent);
if (parent &&
parent.type.startsWith('TS') &&
parent.type !== 'TSAsExpression' &&
parent.type !== 'TSNonNullExpression' &&
parent.type !== 'TSTypeAssertion') {
return this.skip();
}
if (node.type === 'Identifier') {
const isLocal = !!knownIds[node.name];
const isRefed = isReferencedIdentifier(node, parent, parentStack);
if (includeAll || (isRefed && !isLocal)) {
onIdentifier(node, parent, parentStack, isRefed, isLocal);
}
}
else if (node.type === 'ObjectProperty' &&
parent.type === 'ObjectPattern') {
node.inPattern = true;
}
else if (isFunctionType(node)) {
// walk function expressions and add its arguments to known identifiers
// so that we don't prefix them
walkFunctionParams(node, id => markScopeIdentifier(node, id, knownIds));
}
else if (node.type === 'BlockStatement') {
// #3445 record block-level local variables
walkBlockDeclarations(node, id => markScopeIdentifier(node, id, knownIds));
}
},
leave(node, parent) {
parent && parentStack.pop();
if (node !== rootExp && node.scopeIds) {
for (const id of node.scopeIds) {
knownIds[id]--;
if (knownIds[id] === 0) {
delete knownIds[id];
}
}
}
}
});
}
function isReferencedIdentifier(id, parent, parentStack) {
if (!parent) {
return true;
}
// is a special keyword but parsed as identifier
if (id.name === 'arguments') {
return false;
}
if (lib$1.isReferenced(id, parent)) {
return true;
}
// babel's isReferenced check returns false for ids being assigned to, so we
// need to cover those cases here
switch (parent.type) {
case 'AssignmentExpression':
case 'AssignmentPattern':
return true;
case 'ObjectPattern':
case 'ArrayPattern':
return isInDestructureAssignment(parent, parentStack);
}
return false;
}
function isInDestructureAssignment(parent, parentStack) {
if (parent &&
(parent.type === 'ObjectProperty' || parent.type === 'ArrayPattern')) {
let i = parentStack.length;
while (i--) {
const p = parentStack[i];
if (p.type === 'AssignmentExpression') {
return true;
}
else if (p.type !== 'ObjectProperty' && !p.type.endsWith('Pattern')) {
break;
}
}
}
return false;
}
function walkFunctionParams(node, onIdent) {
for (const p of node.params) {
for (const id of extractIdentifiers(p)) {
onIdent(id);
}
}
}
function walkBlockDeclarations(block, onIdent) {
for (const stmt of block.body) {
if (stmt.type === 'VariableDeclaration') {
if (stmt.declare)
continue;
for (const decl of stmt.declarations) {
for (const id of extractIdentifiers(decl.id)) {
onIdent(id);
}
}
}
else if (stmt.type === 'FunctionDeclaration' ||
stmt.type === 'ClassDeclaration') {
if (stmt.declare || !stmt.id)
continue;
onIdent(stmt.id);
}
}
}
function extractIdentifiers(param, nodes = []) {
switch (param.type) {
case 'Identifier':
nodes.push(param);
break;
case 'MemberExpression':
let object = param;
while (object.type === 'MemberExpression') {
object = object.object;
}
nodes.push(object);
break;
case 'ObjectPattern':
for (const prop of param.properties) {
if (prop.type === 'RestElement') {
extractIdentifiers(prop.argument, nodes);
}
else {
extractIdentifiers(prop.value, nodes);
}
}
break;
case 'ArrayPattern':
param.elements.forEach(element => {
if (element)
extractIdentifiers(element, nodes);
});
break;
case 'RestElement':
extractIdentifiers(param.argument, nodes);
break;
case 'AssignmentPattern':
extractIdentifiers(param.left, nodes);
break;
}
return nodes;
}
function markScopeIdentifier(node, child, knownIds) {
const { name } = child;
if (node.scopeIds && node.scopeIds.has(name)) {
return;
}
if (name in knownIds) {
knownIds[name]++;
}
else {
knownIds[name] = 1;
}
(node.scopeIds || (node.scopeIds = new Set())).add(name);
}
const isFunctionType = (node) => {
return /Function(?:Expression|Declaration)$|Method$/.test(node.type);
};
const isStaticProperty = (node) => node &&
(node.type === 'ObjectProperty' || node.type === 'ObjectMethod') &&
!node.computed;
const isStaticPropertyKey = (node, parent) => isStaticProperty(parent) && parent.key === node;
// these keywords should not appear inside expressions, but operators like
// typeof, instanceof and in are allowed
const prohibitedKeywordRE = new RegExp('\\b' +
('do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,' +
'super,throw,while,yield,delete,export,import,return,switch,default,' +
'extends,finally,continue,debugger,function,arguments,typeof,void')
.split(',')
.join('\\b|\\b') +
'\\b');
// strip strings in expressions
const stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g;
/**
* Validate a non-prefixed expression.
* This is only called when using the in-browser runtime compiler since it
* doesn't prefix expressions.
*/
function validateBrowserExpression(node, context, asParams = false, asRawStatements = false) {
const exp = node.content;
// empty expressions are validated per-directive since some directives
// do allow empty expressions.
if (!exp.trim()) {
return;
}
try {
new Function(asRawStatements
? ` ${exp} `
: `return ${asParams ? `(${exp}) => {}` : `(${exp})`}`);
}
catch (e) {
let message = e.message;
const keywordMatch = exp
.replace(stripStringRE, '')
.match(prohibitedKeywordRE);
if (keywordMatch) {
message = `avoid using JavaScript keyword as property name: "${keywordMatch[0]}"`;
}
context.onError(createCompilerError(43 /* X_INVALID_EXPRESSION */, node.loc, undefined, message));
}
}
const transformExpression = (node, context) => {
if (node.type === 5 /* INTERPOLATION */) {
node.content = processExpression(node.content, context);
}
else if (node.type === 1 /* ELEMENT */) {
// handle directives on element
for (let i = 0; i < node.props.length; i++) {
const dir = node.props[i];
// do not process for v-on & v-for since they are special handled
if (dir.type === 7 /* DIRECTIVE */ && dir.name !== 'for') {
const exp = dir.exp;
const arg = dir.arg;
// do not process exp if this is v-on:arg - we need special handling
// for wrapping inline statements.
if (exp &&
exp.type === 4 /* SIMPLE_EXPRESSION */ &&
!(dir.name === 'on' && arg)) {
dir.exp = processExpression(exp, context,
// slot args must be processed as function params
dir.name === 'slot');
}
if (arg && arg.type === 4 /* SIMPLE_EXPRESSION */ && !arg.isStatic) {
dir.arg = processExpression(arg, context);
}
}
}
}
};
// Important: since this function uses Node.js only dependencies, it should
// always be used with a leading !true check so that it can be
// tree-shaken from the browser build.
function processExpression(node, context,
// some expressions like v-slot props & v-for aliases should be parsed as
// function params
asParams = false,
// v-on handler values may contain multiple statements
asRawStatements = false) {
{
if ((process.env.NODE_ENV !== 'production')) {
// simple in-browser validation (same logic in 2.x)
validateBrowserExpression(node, context, asParams, asRawStatements);
}
return node;
}
}
const transformIf = createStructuralDirectiveTransform(/^(if|else|else-if)$/, (node, dir, context) => {
return processIf(node, dir, context, (ifNode, branch, isRoot) => {
// #1587: We need to dynamically increment the key based on the current
// node's sibling nodes, since chained v-if/else branches are
// rendered at the same depth
const siblings = context.parent.children;
let i = siblings.indexOf(ifNode);
let key = 0;
while (i-- >= 0) {
const sibling = siblings[i];
if (sibling && sibling.type === 9 /* IF */) {
key += sibling.branches.length;
}
}
// Exit callback. Complete the codegenNode when all children have been
// transformed.
return () => {
if (isRoot) {
ifNode.codegenNode = createCodegenNodeForBranch(branch, key, context);
}
else {
// attach this branch's codegen node to the v-if root.
const parentCondition = getParentCondition(ifNode.codegenNode);
parentCondition.alternate = createCodegenNodeForBranch(branch, key + ifNode.branches.length - 1, context);
}
};
});
});
// target-agnostic transform used for both Client and SSR
function processIf(node, dir, context, processCodegen) {
if (dir.name !== 'else' &&
(!dir.exp || !dir.exp.content.trim())) {
const loc = dir.exp ? dir.exp.loc : node.loc;
context.onError(createCompilerError(27 /* X_V_IF_NO_EXPRESSION */, dir.loc));
dir.exp = createSimpleExpression(`true`, false, loc);
}
if ((process.env.NODE_ENV !== 'production') && true && dir.exp) {
validateBrowserExpression(dir.exp, context);
}
if (dir.name === 'if') {
const branch = createIfBranch(node, dir);
const ifNode = {
type: 9 /* IF */,
loc: node.loc,
branches: [branch]
};
context.replaceNode(ifNode);
if (processCodegen) {
return processCodegen(ifNode, branch, true);
}
}
else {
// locate the adjacent v-if
const siblings = context.parent.children;
const comments = [];
let i = siblings.indexOf(node);
while (i-- >= -1) {
const sibling = siblings[i];
if ((process.env.NODE_ENV !== 'production') && sibling && sibling.type === 3 /* COMMENT */) {
context.removeNode(sibling);
comments.unshift(sibling);
continue;
}
if (sibling &&
sibling.type === 2 /* TEXT */ &&
!sibling.content.trim().length) {
context.removeNode(sibling);
continue;
}
if (sibling && sibling.type === 9 /* IF */) {
// move the node to the if node's branches
context.removeNode();
const branch = createIfBranch(node, dir);
if ((process.env.NODE_ENV !== 'production') &&
comments.length &&
// #3619 ignore comments if the v-if is direct child of <transition>
!(context.parent &&
context.parent.type === 1 /* ELEMENT */ &&
isBuiltInType(context.parent.tag, 'transition'))) {
branch.children = [...comments, ...branch.children];
}
// check if user is forcing same key on different branches
if ((process.env.NODE_ENV !== 'production') || !true) {
const key = branch.userKey;
if (key) {
sibling.branches.forEach(({ userKey }) => {
if (isSameKey(userKey, key)) {
context.onError(createCompilerError(28 /* X_V_IF_SAME_KEY */, branch.userKey.loc));
}
});
}
}
sibling.branches.push(branch);
const onExit = processCodegen && processCodegen(sibling, branch, false);
// since the branch was removed, it will not be traversed.
// make sure to traverse here.
traverseNode(branch, context);
// call on exit
if (onExit)
onExit();
// make sure to reset currentNode after traversal to indicate this
// node has been removed.
context.currentNode = null;
}
else {
context.onError(createCompilerError(29 /* X_V_ELSE_NO_ADJACENT_IF */, node.loc));
}
break;
}
}
}
function createIfBranch(node, dir) {
return {
type: 10 /* IF_BRANCH */,
loc: node.loc,
condition: dir.name === 'else' ? undefined : dir.exp,
children: node.tagType === 3 /* TEMPLATE */ && !findDir(node, 'for')
? node.children
: [node],
userKey: findProp(node, `key`)
};
}
function createCodegenNodeForBranch(branch, keyIndex, context) {
if (branch.condition) {
return createConditionalExpression(branch.condition, createChildrenCodegenNode(branch, keyIndex, context),
// make sure to pass in asBlock: true so that the comment node call
// closes the current block.
createCallExpression(context.helper(CREATE_COMMENT), [
(process.env.NODE_ENV !== 'production') ? '"v-if"' : '""',
'true'
]));
}
else {
return createChildrenCodegenNode(branch, keyIndex, context);
}
}
function createChildrenCodegenNode(branch, keyIndex, context) {
const { helper } = context;
const keyProperty = createObjectProperty(`key`, createSimpleExpression(`${keyIndex}`, false, locStub, 2 /* CAN_HOIST */));
const { children } = branch;
const firstChild = children[0];
const needFragmentWrapper = children.length !== 1 || firstChild.type !== 1 /* ELEMENT */;
if (needFragmentWrapper) {
if (children.length === 1 && firstChild.type === 11 /* FOR */) {
// optimize away nested fragments when child is a ForNode
const vnodeCall = firstChild.codegenNode;
injectProp(vnodeCall, keyProperty, context);
return vnodeCall;
}
else {
let patchFlag = 64 /* STABLE_FRAGMENT */;
let patchFlagText = PatchFlagNames[64 /* STABLE_FRAGMENT */];
// check if the fragment actually contains a single valid child with
// the rest being comments
if ((process.env.NODE_ENV !== 'production') &&
children.filter(c => c.type !== 3 /* COMMENT */).length === 1) {
patchFlag |= 2048 /* DEV_ROOT_FRAGMENT */;
patchFlagText += `, ${PatchFlagNames[2048 /* DEV_ROOT_FRAGMENT */]}`;
}
return createVNodeCall(context, helper(FRAGMENT), createObjectExpression([keyProperty]), children, patchFlag + ((process.env.NODE_ENV !== 'production') ? ` /* ${patchFlagText} */` : ``), undefined, undefined, true, false, false /* isComponent */, branch.loc);
}
}
else {
const ret = firstChild.codegenNode;
const vnodeCall = getMemoedVNodeCall(ret);
// Change createVNode to createBlock.
if (vnodeCall.type === 13 /* VNODE_CALL */) {
makeBlock(vnodeCall, context);
}
// inject branch key
injectProp(vnodeCall, keyProperty, context);
return ret;
}
}
function isSameKey(a, b) {
if (!a || a.type !== b.type) {
return false;
}
if (a.type === 6 /* ATTRIBUTE */) {
if (a.value.content !== b.value.content) {
return false;
}
}
else {
// directive
const exp = a.exp;
const branchExp = b.exp;
if (exp.type !== branchExp.type) {
return false;
}
if (exp.type !== 4 /* SIMPLE_EXPRESSION */ ||
exp.isStatic !== branchExp.isStatic ||
exp.content !== branchExp.content) {
return false;
}
}
return true;
}
function getParentCondition(node) {
while (true) {
if (node.type === 19 /* JS_CONDITIONAL_EXPRESSION */) {
if (node.alternate.type === 19 /* JS_CONDITIONAL_EXPRESSION */) {
node = node.alternate;
}
else {
return node;
}
}
else if (node.type === 20 /* JS_CACHE_EXPRESSION */) {
node = node.value;
}
}
}
const transformFor = createStructuralDirectiveTransform('for', (node, dir, context) => {
const { helper, removeHelper } = context;
return processFor(node, dir, context, forNode => {
// create the loop render function expression now, and add the
// iterator on exit after all children have been traversed
const renderExp = createCallExpression(helper(RENDER_LIST), [
forNode.source
]);
const memo = findDir(node, 'memo');
const keyProp = findProp(node, `key`);
const keyExp = keyProp &&
(keyProp.type === 6 /* ATTRIBUTE */
? createSimpleExpression(keyProp.value.content, true)
: keyProp.exp);
const keyProperty = keyProp ? createObjectProperty(`key`, keyExp) : null;
const isStableFragment = forNode.source.type === 4 /* SIMPLE_EXPRESSION */ &&
forNode.source.constType > 0 /* NOT_CONSTANT */;
const fragmentFlag = isStableFragment
? 64 /* STABLE_FRAGMENT */
: keyProp
? 128 /* KEYED_FRAGMENT */
: 256 /* UNKEYED_FRAGMENT */;
forNode.codegenNode = createVNodeCall(context, helper(FRAGMENT), undefined, renderExp, fragmentFlag +
((process.env.NODE_ENV !== 'production') ? ` /* ${PatchFlagNames[fragmentFlag]} */` : ``), undefined, undefined, true /* isBlock */, !isStableFragment /* disableTracking */, false /* isComponent */, node.loc);
return () => {
// finish the codegen now that all children have been traversed
let childBlock;
const isTemplate = isTemplateNode(node);
const { children } = forNode;
// check <template v-for> key placement
if (((process.env.NODE_ENV !== 'production') || !true) && isTemplate) {
node.children.some(c => {
if (c.type === 1 /* ELEMENT */) {
const key = findProp(c, 'key');
if (key) {
context.onError(createCompilerError(32 /* X_V_FOR_TEMPLATE_KEY_PLACEMENT */, key.loc));
return true;
}
}
});
}
const needFragmentWrapper = children.length !== 1 || children[0].type !== 1 /* ELEMENT */;
const slotOutlet = isSlotOutlet(node)
? node
: isTemplate &&
node.children.length === 1 &&
isSlotOutlet(node.children[0])
? node.children[0] // api-extractor somehow fails to infer this
: null;
if (slotOutlet) {
// <slot v-for="..."> or <template v-for="..."><slot/></template>
childBlock = slotOutlet.codegenNode;
if (isTemplate && keyProperty) {
// <template v-for="..." :key="..."><slot/></template>
// we need to inject the key to the renderSlot() call.
// the props for renderSlot is passed as the 3rd argument.
injectProp(childBlock, keyProperty, context);
}
}
else if (needFragmentWrapper) {
// <template v-for="..."> with text or multi-elements
// should generate a fragment block for each loop
childBlock = createVNodeCall(context, helper(FRAGMENT), keyProperty ? createObjectExpression([keyProperty]) : undefined, node.children, 64 /* STABLE_FRAGMENT */ +
((process.env.NODE_ENV !== 'production')
? ` /* ${PatchFlagNames[64 /* STABLE_FRAGMENT */]} */`
: ``), undefined, undefined, true, undefined, false /* isComponent */);
}
else {
// Normal element v-for. Directly use the child's codegenNode
// but mark it as a block.
childBlock = children[0]
.codegenNode;
if (isTemplate && keyProperty) {
injectProp(childBlock, keyProperty, context);
}
if (childBlock.isBlock !== !isStableFragment) {
if (childBlock.isBlock) {
// switch from block to vnode
removeHelper(OPEN_BLOCK);
removeHelper(getVNodeBlockHelper(context.inSSR, childBlock.isComponent));
}
else {
// switch from vnode to block
removeHelper(getVNodeHelper(context.inSSR, childBlock.isComponent));
}
}
childBlock.isBlock = !isStableFragment;
if (childBlock.isBlock) {
helper(OPEN_BLOCK);
helper(getVNodeBlockHelper(context.inSSR, childBlock.isComponent));
}
else {
helper(getVNodeHelper(context.inSSR, childBlock.isComponent));
}
}
if (memo) {
const loop = createFunctionExpression(createForLoopParams(forNode.parseResult, [
createSimpleExpression(`_cached`)
]));
loop.body = createBlockStatement([
createCompoundExpression([`const _memo = (`, memo.exp, `)`]),
createCompoundExpression([
`if (_cached`,
...(keyExp ? [` && _cached.key === `, keyExp] : []),
` && ${context.helperString(IS_MEMO_SAME)}(_cached, _memo)) return _cached`
]),
createCompoundExpression([`const _item = `, childBlock]),
createSimpleExpression(`_item.memo = _memo`),
createSimpleExpression(`return _item`)
]);
renderExp.arguments.push(loop, createSimpleExpression(`_cache`), createSimpleExpression(String(context.cached++)));
}
else {
renderExp.arguments.push(createFunctionExpression(createForLoopParams(forNode.parseResult), childBlock, true /* force newline */));
}
};
});
});
// target-agnostic transform used for both Client and SSR
function processFor(node, dir, context, processCodegen) {
if (!dir.exp) {
context.onError(createCompilerError(30 /* X_V_FOR_NO_EXPRESSION */, dir.loc));
return;
}
const parseResult = parseForExpression(
// can only be simple expression because vFor transform is applied
// before expression transform.
dir.exp, context);
if (!parseResult) {
context.onError(createCompilerError(31 /* X_V_FOR_MALFORMED_EXPRESSION */, dir.loc));
return;
}
const { addIdentifiers, removeIdentifiers, scopes } = context;
const { source, value, key, index } = parseResult;
const forNode = {
type: 11 /* FOR */,
loc: dir.loc,
source,
valueAlias: value,
keyAlias: key,
objectIndexAlias: index,
parseResult,
children: isTemplateNode(node) ? node.children : [node]
};
context.replaceNode(forNode);
// bookkeeping
scopes.vFor++;
const onExit = processCodegen && processCodegen(forNode);
return () => {
scopes.vFor--;
if (onExit)
onExit();
};
}
const forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/;
// This regex doesn't cover the case if key or index aliases have destructuring,
// but those do not make sense in the first place, so this works in practice.
const forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/;
const stripParensRE = /^\(|\)$/g;
function parseForExpression(input, context) {
const loc = input.loc;
const exp = input.content;
const inMatch = exp.match(forAliasRE);
if (!inMatch)
return;
const [, LHS, RHS] = inMatch;
const result = {
source: createAliasExpression(loc, RHS.trim(), exp.indexOf(RHS, LHS.length)),
value: undefined,
key: undefined,
index: undefined
};
if ((process.env.NODE_ENV !== 'production') && true) {
validateBrowserExpression(result.source, context);
}
let valueContent = LHS.trim().replace(stripParensRE, '').trim();
const trimmedOffset = LHS.indexOf(valueContent);
const iteratorMatch = valueContent.match(forIteratorRE);
if (iteratorMatch) {
valueContent = valueContent.replace(forIteratorRE, '').trim();
const keyContent = iteratorMatch[1].trim();
let keyOffset;
if (keyContent) {
keyOffset = exp.indexOf(keyContent, trimmedOffset + valueContent.length);
result.key = createAliasExpression(loc, keyContent, keyOffset);
if ((process.env.NODE_ENV !== 'production') && true) {
validateBrowserExpression(result.key, context, true);
}
}
if (iteratorMatch[2]) {
const indexContent = iteratorMatch[2].trim();
if (indexContent) {
result.index = createAliasExpression(loc, indexContent, exp.indexOf(indexContent, result.key
? keyOffset + keyContent.length
: trimmedOffset + valueContent.length));
if ((process.env.NODE_ENV !== 'production') && true) {
validateBrowserExpression(result.index, context, true);
}
}
}
}
if (valueContent) {
result.value = createAliasExpression(loc, valueContent, trimmedOffset);
if ((process.env.NODE_ENV !== 'production') && true) {
validateBrowserExpression(result.value, context, true);
}
}
return result;
}
function createAliasExpression(range, content, offset) {
return createSimpleExpression(content, false, getInnerRange(range, offset, content.length));
}
function createForLoopParams({ value, key, index }, memoArgs = []) {
return createParamsList([value, key, index, ...memoArgs]);
}
function createParamsList(args) {
let i = args.length;
while (i--) {
if (args[i])
break;
}
return args
.slice(0, i + 1)
.map((arg, i) => arg || createSimpleExpression(`_`.repeat(i + 1), false));
}
const defaultFallback = createSimpleExpression(`undefined`, false);
// A NodeTransform that:
// 1. Tracks scope identifiers for scoped slots so that they don't get prefixed
// by transformExpression. This is only applied in non-browser builds with
// { prefixIdentifiers: true }.
// 2. Track v-slot depths so that we know a slot is inside another slot.
// Note the exit callback is executed before buildSlots() on the same node,
// so only nested slots see positive numbers.
const trackSlotScopes = (node, context) => {
if (node.type === 1 /* ELEMENT */ &&
(node.tagType === 1 /* COMPONENT */ ||
node.tagType === 3 /* TEMPLATE */)) {
// We are only checking non-empty v-slot here
// since we only care about slots that introduce scope variables.
const vSlot = findDir(node, 'slot');
if (vSlot) {
context.scopes.vSlot++;
return () => {
context.scopes.vSlot--;
};
}
}
};
// A NodeTransform that tracks scope identifiers for scoped slots with v-for.
// This transform is only applied in non-browser builds with { prefixIdentifiers: true }
const trackVForSlotScopes = (node, context) => {
let vFor;
if (isTemplateNode(node) &&
node.props.some(isVSlot) &&
(vFor = findDir(node, 'for'))) {
const result = (vFor.parseResult = parseForExpression(vFor.exp, context));
if (result) {
const { value, key, index } = result;
const { addIdentifiers, removeIdentifiers } = context;
value && addIdentifiers(value);
key && addIdentifiers(key);
index && addIdentifiers(index);
return () => {
value && removeIdentifiers(value);
key && removeIdentifiers(key);
index && removeIdentifiers(index);
};
}
}
};
const buildClientSlotFn = (props, children, loc) => createFunctionExpression(props, children, false /* newline */, true /* isSlot */, children.length ? children[0].loc : loc);
// Instead of being a DirectiveTransform, v-slot processing is called during
// transformElement to build the slots object for a component.
function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
context.helper(WITH_CTX);
const { children, loc } = node;
const slotsProperties = [];
const dynamicSlots = [];
// If the slot is inside a v-for or another v-slot, force it to be dynamic
// since it likely uses a scope variable.
let hasDynamicSlots = context.scopes.vSlot > 0 || context.scopes.vFor > 0;
// 1. Check for slot with slotProps on component itself.
// <Comp v-slot="{ prop }"/>
const onComponentSlot = findDir(node, 'slot', true);
if (onComponentSlot) {
const { arg, exp } = onComponentSlot;
if (arg && !isStaticExp(arg)) {
hasDynamicSlots = true;
}
slotsProperties.push(createObjectProperty(arg || createSimpleExpression('default', true), buildSlotFn(exp, children, loc)));
}
// 2. Iterate through children and check for template slots
// <template v-slot:foo="{ prop }">
let hasTemplateSlots = false;
let hasNamedDefaultSlot = false;
const implicitDefaultChildren = [];
const seenSlotNames = new Set();
for (let i = 0; i < children.length; i++) {
const slotElement = children[i];
let slotDir;
if (!isTemplateNode(slotElement) ||
!(slotDir = findDir(slotElement, 'slot', true))) {
// not a <template v-slot>, skip.
if (slotElement.type !== 3 /* COMMENT */) {
implicitDefaultChildren.push(slotElement);
}
continue;
}
if (onComponentSlot) {
// already has on-component slot - this is incorrect usage.
context.onError(createCompilerError(36 /* X_V_SLOT_MIXED_SLOT_USAGE */, slotDir.loc));
break;
}
hasTemplateSlots = true;
const { children: slotChildren, loc: slotLoc } = slotElement;
const { arg: slotName = createSimpleExpression(`default`, true), exp: slotProps, loc: dirLoc } = slotDir;
// check if name is dynamic.
let staticSlotName;
if (isStaticExp(slotName)) {
staticSlotName = slotName ? slotName.content : `default`;
}
else {
hasDynamicSlots = true;
}
const slotFunction = buildSlotFn(slotProps, slotChildren, slotLoc);
// check if this slot is conditional (v-if/v-for)
let vIf;
let vElse;
let vFor;
if ((vIf = findDir(slotElement, 'if'))) {
hasDynamicSlots = true;
dynamicSlots.push(createConditionalExpression(vIf.exp, buildDynamicSlot(slotName, slotFunction), defaultFallback));
}
else if ((vElse = findDir(slotElement, /^else(-if)?$/, true /* allowEmpty */))) {
// find adjacent v-if
let j = i;
let prev;
while (j--) {
prev = children[j];
if (prev.type !== 3 /* COMMENT */) {
break;
}
}
if (prev && isTemplateNode(prev) && findDir(prev, 'if')) {
// remove node
children.splice(i, 1);
i--;
// attach this slot to previous conditional
let conditional = dynamicSlots[dynamicSlots.length - 1];
while (conditional.alternate.type === 19 /* JS_CONDITIONAL_EXPRESSION */) {
conditional = conditional.alternate;
}
conditional.alternate = vElse.exp
? createConditionalExpression(vElse.exp, buildDynamicSlot(slotName, slotFunction), defaultFallback)
: buildDynamicSlot(slotName, slotFunction);
}
else {
context.onError(createCompilerError(29 /* X_V_ELSE_NO_ADJACENT_IF */, vElse.loc));
}
}
else if ((vFor = findDir(slotElement, 'for'))) {
hasDynamicSlots = true;
const parseResult = vFor.parseResult ||
parseForExpression(vFor.exp, context);
if (parseResult) {
// Render the dynamic slots as an array and add it to the createSlot()
// args. The runtime knows how to handle it appropriately.
dynamicSlots.push(createCallExpression(context.helper(RENDER_LIST), [
parseResult.source,
createFunctionExpression(createForLoopParams(parseResult), buildDynamicSlot(slotName, slotFunction), true /* force newline */)
]));
}
else {
context.onError(createCompilerError(31 /* X_V_FOR_MALFORMED_EXPRESSION */, vFor.loc));
}
}
else {
// check duplicate static names
if (staticSlotName) {
if (seenSlotNames.has(staticSlotName)) {
context.onError(createCompilerError(37 /* X_V_SLOT_DUPLICATE_SLOT_NAMES */, dirLoc));
continue;
}
seenSlotNames.add(staticSlotName);
if (staticSlotName === 'default') {
hasNamedDefaultSlot = true;
}
}
slotsProperties.push(createObjectProperty(slotName, slotFunction));
}
}
if (!onComponentSlot) {
const buildDefaultSlotProperty = (props, children) => {
const fn = buildSlotFn(props, children, loc);
if (context.compatConfig) {
fn.isNonScopedSlot = true;
}
return createObjectProperty(`default`, fn);
};
if (!hasTemplateSlots) {
// implicit default slot (on component)
slotsProperties.push(buildDefaultSlotProperty(undefined, children));
}
else if (implicitDefaultChildren.length &&
// #3766
// with whitespace: 'preserve', whitespaces between slots will end up in
// implicitDefaultChildren. Ignore if all implicit children are whitespaces.
implicitDefaultChildren.some(node => isNonWhitespaceContent(node))) {
// implicit default slot (mixed with named slots)
if (hasNamedDefaultSlot) {
context.onError(createCompilerError(38 /* X_V_SLOT_EXTRANEOUS_DEFAULT_SLOT_CHILDREN */, implicitDefaultChildren[0].loc));
}
else {
slotsProperties.push(buildDefaultSlotProperty(undefined, implicitDefaultChildren));
}
}
}
const slotFlag = hasDynamicSlots
? 2 /* DYNAMIC */
: hasForwardedSlots(node.children)
? 3 /* FORWARDED */
: 1 /* STABLE */;
let slots = createObjectExpression(slotsProperties.concat(createObjectProperty(`_`,
// 2 = compiled but dynamic = can skip normalization, but must run diff
// 1 = compiled and static = can skip normalization AND diff as optimized
createSimpleExpression(slotFlag + ((process.env.NODE_ENV !== 'production') ? ` /* ${slotFlagsText[slotFlag]} */` : ``), false))), loc);
if (dynamicSlots.length) {
slots = createCallExpression(context.helper(CREATE_SLOTS), [
slots,
createArrayExpression(dynamicSlots)
]);
}
return {
slots,
hasDynamicSlots
};
}
function buildDynamicSlot(name, fn) {
return createObjectExpression([
createObjectProperty(`name`, name),
createObjectProperty(`fn`, fn)
]);
}
function hasForwardedSlots(children) {
for (let i = 0; i < children.length; i++) {
const child = children[i];
switch (child.type) {
case 1 /* ELEMENT */:
if (child.tagType === 2 /* SLOT */ ||
hasForwardedSlots(child.children)) {
return true;
}
break;
case 9 /* IF */:
if (hasForwardedSlots(child.branches))
return true;
break;
case 10 /* IF_BRANCH */:
case 11 /* FOR */:
if (hasForwardedSlots(child.children))
return true;
break;
}
}
return false;
}
function isNonWhitespaceContent(node) {
if (node.type !== 2 /* TEXT */ && node.type !== 12 /* TEXT_CALL */)
return true;
return node.type === 2 /* TEXT */
? !!node.content.trim()
: isNonWhitespaceContent(node.content);
}
// some directive transforms (e.g. v-model) may return a symbol for runtime
// import, which should be used instead of a resolveDirective call.
const directiveImportMap = new WeakMap();
// generate a JavaScript AST for this element's codegen
const transformElement = (node, context) => {
// perform the work on exit, after all child expressions have been
// processed and merged.
return function postTransformElement() {
node = context.currentNode;
if (!(node.type === 1 /* ELEMENT */ &&
(node.tagType === 0 /* ELEMENT */ ||
node.tagType === 1 /* COMPONENT */))) {
return;
}
const { tag, props } = node;
const isComponent = node.tagType === 1 /* COMPONENT */;
// The goal of the transform is to create a codegenNode implementing the
// VNodeCall interface.
let vnodeTag = isComponent
? resolveComponentType(node, context)
: `"${tag}"`;
const isDynamicComponent = isObject(vnodeTag) && vnodeTag.callee === RESOLVE_DYNAMIC_COMPONENT;
let vnodeProps;
let vnodeChildren;
let vnodePatchFlag;
let patchFlag = 0;
let vnodeDynamicProps;
let dynamicPropNames;
let vnodeDirectives;
let shouldUseBlock =
// dynamic component may resolve to plain elements
isDynamicComponent ||
vnodeTag === TELEPORT ||
vnodeTag === SUSPENSE ||
(!isComponent &&
// <svg> and <foreignObject> must be forced into blocks so that block
// updates inside get proper isSVG flag at runtime. (#639, #643)
// This is technically web-specific, but splitting the logic out of core
// leads to too much unnecessary complexity.
(tag === 'svg' ||
tag === 'foreignObject' ||
// #938: elements with dynamic keys should be forced into blocks
findProp(node, 'key', true)));
// props
if (props.length > 0) {
const propsBuildResult = buildProps(node, context);
vnodeProps = propsBuildResult.props;
patchFlag = propsBuildResult.patchFlag;
dynamicPropNames = propsBuildResult.dynamicPropNames;
const directives = propsBuildResult.directives;
vnodeDirectives =
directives && directives.length
? createArrayExpression(directives.map(dir => buildDirectiveArgs(dir, context)))
: undefined;
}
// children
if (node.children.length > 0) {
if (vnodeTag === KEEP_ALIVE) {
// Although a built-in component, we compile KeepAlive with raw children
// instead of slot functions so that it can be used inside Transition
// or other Transition-wrapping HOCs.
// To ensure correct updates with block optimizations, we need to:
// 1. Force keep-alive into a block. This avoids its children being
// collected by a parent block.
shouldUseBlock = true;
// 2. Force keep-alive to always be updated, since it uses raw children.
patchFlag |= 1024 /* DYNAMIC_SLOTS */;
if ((process.env.NODE_ENV !== 'production') && node.children.length > 1) {
context.onError(createCompilerError(44 /* X_KEEP_ALIVE_INVALID_CHILDREN */, {
start: node.children[0].loc.start,
end: node.children[node.children.length - 1].loc.end,
source: ''
}));
}
}
const shouldBuildAsSlots = isComponent &&
// Teleport is not a real component and has dedicated runtime handling
vnodeTag !== TELEPORT &&
// explained above.
vnodeTag !== KEEP_ALIVE;
if (shouldBuildAsSlots) {
const { slots, hasDynamicSlots } = buildSlots(node, context);
vnodeChildren = slots;
if (hasDynamicSlots) {
patchFlag |= 1024 /* DYNAMIC_SLOTS */;
}
}
else if (node.children.length === 1 && vnodeTag !== TELEPORT) {
const child = node.children[0];
const type = child.type;
// check for dynamic text children
const hasDynamicTextChild = type === 5 /* INTERPOLATION */ ||
type === 8 /* COMPOUND_EXPRESSION */;
if (hasDynamicTextChild &&
getConstantType(child, context) === 0 /* NOT_CONSTANT */) {
patchFlag |= 1 /* TEXT */;
}
// pass directly if the only child is a text node
// (plain / interpolation / expression)
if (hasDynamicTextChild || type === 2 /* TEXT */) {
vnodeChildren = child;
}
else {
vnodeChildren = node.children;
}
}
else {
vnodeChildren = node.children;
}
}
// patchFlag & dynamicPropNames
if (patchFlag !== 0) {
if ((process.env.NODE_ENV !== 'production')) {
if (patchFlag < 0) {
// special flags (negative and mutually exclusive)
vnodePatchFlag = patchFlag + ` /* ${PatchFlagNames[patchFlag]} */`;
}
else {
// bitwise flags
const flagNames = Object.keys(PatchFlagNames)
.map(Number)
.filter(n => n > 0 && patchFlag & n)
.map(n => PatchFlagNames[n])
.join(`, `);
vnodePatchFlag = patchFlag + ` /* ${flagNames} */`;
}
}
else {
vnodePatchFlag = String(patchFlag);
}
if (dynamicPropNames && dynamicPropNames.length) {
vnodeDynamicProps = stringifyDynamicPropNames(dynamicPropNames);
}
}
node.codegenNode = createVNodeCall(context, vnodeTag, vnodeProps, vnodeChildren, vnodePatchFlag, vnodeDynamicProps, vnodeDirectives, !!shouldUseBlock, false /* disableTracking */, isComponent, node.loc);
};
};
function resolveComponentType(node, context, ssr = false) {
let { tag } = node;
// 1. dynamic component
const isExplicitDynamic = isComponentTag(tag);
const isProp = findProp(node, 'is');
if (isProp) {
if (isExplicitDynamic ||
(isCompatEnabled("COMPILER_IS_ON_ELEMENT" /* COMPILER_IS_ON_ELEMENT */, context))) {
const exp = isProp.type === 6 /* ATTRIBUTE */
? isProp.value && createSimpleExpression(isProp.value.content, true)
: isProp.exp;
if (exp) {
return createCallExpression(context.helper(RESOLVE_DYNAMIC_COMPONENT), [
exp
]);
}
}
else if (isProp.type === 6 /* ATTRIBUTE */ &&
isProp.value.content.startsWith('vue:')) {
// <button is="vue:xxx">
// if not <component>, only is value that starts with "vue:" will be
// treated as component by the parse phase and reach here, unless it's
// compat mode where all is values are considered components
tag = isProp.value.content.slice(4);
}
}
// 1.5 v-is (TODO: Deprecate)
const isDir = !isExplicitDynamic && findDir(node, 'is');
if (isDir && isDir.exp) {
return createCallExpression(context.helper(RESOLVE_DYNAMIC_COMPONENT), [
isDir.exp
]);
}
// 2. built-in components (Teleport, Transition, KeepAlive, Suspense...)
const builtIn = isCoreComponent(tag) || context.isBuiltInComponent(tag);
if (builtIn) {
// built-ins are simply fallthroughs / have special handling during ssr
// so we don't need to import their runtime equivalents
if (!ssr)
context.helper(builtIn);
return builtIn;
}
// 5. user component (resolve)
context.helper(RESOLVE_COMPONENT);
context.components.add(tag);
return toValidAssetId(tag, `component`);
}
function buildProps(node, context, props = node.props, ssr = false) {
const { tag, loc: elementLoc } = node;
const isComponent = node.tagType === 1 /* COMPONENT */;
let properties = [];
const mergeArgs = [];
const runtimeDirectives = [];
// patchFlag analysis
let patchFlag = 0;
let hasRef = false;
let hasClassBinding = false;
let hasStyleBinding = false;
let hasHydrationEventBinding = false;
let hasDynamicKeys = false;
let hasVnodeHook = false;
const dynamicPropNames = [];
const analyzePatchFlag = ({ key, value }) => {
if (isStaticExp(key)) {
const name = key.content;
const isEventHandler = isOn(name);
if (!isComponent &&
isEventHandler &&
// omit the flag for click handlers because hydration gives click
// dedicated fast path.
name.toLowerCase() !== 'onclick' &&
// omit v-model handlers
name !== 'onUpdate:modelValue' &&
// omit onVnodeXXX hooks
!isReservedProp(name)) {
hasHydrationEventBinding = true;
}
if (isEventHandler && isReservedProp(name)) {
hasVnodeHook = true;
}
if (value.type === 20 /* JS_CACHE_EXPRESSION */ ||
((value.type === 4 /* SIMPLE_EXPRESSION */ ||
value.type === 8 /* COMPOUND_EXPRESSION */) &&
getConstantType(value, context) > 0)) {
// skip if the prop is a cached handler or has constant value
return;
}
if (name === 'ref') {
hasRef = true;
}
else if (name === 'class') {
hasClassBinding = true;
}
else if (name === 'style') {
hasStyleBinding = true;
}
else if (name !== 'key' && !dynamicPropNames.includes(name)) {
dynamicPropNames.push(name);
}
// treat the dynamic class and style binding of the component as dynamic props
if (isComponent &&
(name === 'class' || name === 'style') &&
!dynamicPropNames.includes(name)) {
dynamicPropNames.push(name);
}
}
else {
hasDynamicKeys = true;
}
};
for (let i = 0; i < props.length; i++) {
// static attribute
const prop = props[i];
if (prop.type === 6 /* ATTRIBUTE */) {
const { loc, name, value } = prop;
let isStatic = true;
if (name === 'ref') {
hasRef = true;
}
// skip is on <component>, or is="vue:xxx"
if (name === 'is' &&
(isComponentTag(tag) ||
(value && value.content.startsWith('vue:')) ||
(isCompatEnabled("COMPILER_IS_ON_ELEMENT" /* COMPILER_IS_ON_ELEMENT */, context)))) {
continue;
}
properties.push(createObjectProperty(createSimpleExpression(name, true, getInnerRange(loc, 0, name.length)), createSimpleExpression(value ? value.content : '', isStatic, value ? value.loc : loc)));
}
else {
// directives
const { name, arg, exp, loc } = prop;
const isVBind = name === 'bind';
const isVOn = name === 'on';
// skip v-slot - it is handled by its dedicated transform.
if (name === 'slot') {
if (!isComponent) {
context.onError(createCompilerError(39 /* X_V_SLOT_MISPLACED */, loc));
}
continue;
}
// skip v-once/v-memo - they are handled by dedicated transforms.
if (name === 'once' || name === 'memo') {
continue;
}
// skip v-is and :is on <component>
if (name === 'is' ||
(isVBind &&
isBindKey(arg, 'is') &&
(isComponentTag(tag) ||
(isCompatEnabled("COMPILER_IS_ON_ELEMENT" /* COMPILER_IS_ON_ELEMENT */, context))))) {
continue;
}
// skip v-on in SSR compilation
if (isVOn && ssr) {
continue;
}
// special case for v-bind and v-on with no argument
if (!arg && (isVBind || isVOn)) {
hasDynamicKeys = true;
if (exp) {
if (properties.length) {
mergeArgs.push(createObjectExpression(dedupeProperties(properties), elementLoc));
properties = [];
}
if (isVBind) {
{
// 2.x v-bind object order compat
if ((process.env.NODE_ENV !== 'production')) {
const hasOverridableKeys = mergeArgs.some(arg => {
if (arg.type === 15 /* JS_OBJECT_EXPRESSION */) {
return arg.properties.some(({ key }) => {
if (key.type !== 4 /* SIMPLE_EXPRESSION */ ||
!key.isStatic) {
return true;
}
return (key.content !== 'class' &&
key.content !== 'style' &&
!isOn(key.content));
});
}
else {
// dynamic expression
return true;
}
});
if (hasOverridableKeys) {
checkCompatEnabled("COMPILER_V_BIND_OBJECT_ORDER" /* COMPILER_V_BIND_OBJECT_ORDER */, context, loc);
}
}
if (isCompatEnabled("COMPILER_V_BIND_OBJECT_ORDER" /* COMPILER_V_BIND_OBJECT_ORDER */, context)) {
mergeArgs.unshift(exp);
continue;
}
}
mergeArgs.push(exp);
}
else {
// v-on="obj" -> toHandlers(obj)
mergeArgs.push({
type: 14 /* JS_CALL_EXPRESSION */,
loc,
callee: context.helper(TO_HANDLERS),
arguments: [exp]
});
}
}
else {
context.onError(createCompilerError(isVBind
? 33 /* X_V_BIND_NO_EXPRESSION */
: 34 /* X_V_ON_NO_EXPRESSION */, loc));
}
continue;
}
const directiveTransform = context.directiveTransforms[name];
if (directiveTransform) {
// has built-in directive transform.
const { props, needRuntime } = directiveTransform(prop, node, context);
!ssr && props.forEach(analyzePatchFlag);
properties.push(...props);
if (needRuntime) {
runtimeDirectives.push(prop);
if (isSymbol(needRuntime)) {
directiveImportMap.set(prop, needRuntime);
}
}
}
else {
// no built-in transform, this is a user custom directive.
runtimeDirectives.push(prop);
}
}
if (prop.type === 6 /* ATTRIBUTE */ &&
prop.name === 'ref' &&
context.scopes.vFor > 0 &&
checkCompatEnabled("COMPILER_V_FOR_REF" /* COMPILER_V_FOR_REF */, context, prop.loc)) {
properties.push(createObjectProperty(createSimpleExpression('refInFor', true), createSimpleExpression('true', false)));
}
}
let propsExpression = undefined;
// has v-bind="object" or v-on="object", wrap with mergeProps
if (mergeArgs.length) {
if (properties.length) {
mergeArgs.push(createObjectExpression(dedupeProperties(properties), elementLoc));
}
if (mergeArgs.length > 1) {
propsExpression = createCallExpression(context.helper(MERGE_PROPS), mergeArgs, elementLoc);
}
else {
// single v-bind with nothing else - no need for a mergeProps call
propsExpression = mergeArgs[0];
}
}
else if (properties.length) {
propsExpression = createObjectExpression(dedupeProperties(properties), elementLoc);
}
// patchFlag analysis
if (hasDynamicKeys) {
patchFlag |= 16 /* FULL_PROPS */;
}
else {
if (hasClassBinding && !isComponent) {
patchFlag |= 2 /* CLASS */;
}
if (hasStyleBinding && !isComponent) {
patchFlag |= 4 /* STYLE */;
}
if (dynamicPropNames.length) {
patchFlag |= 8 /* PROPS */;
}
if (hasHydrationEventBinding) {
patchFlag |= 32 /* HYDRATE_EVENTS */;
}
}
if ((patchFlag === 0 || patchFlag === 32 /* HYDRATE_EVENTS */) &&
(hasRef || hasVnodeHook || runtimeDirectives.length > 0)) {
patchFlag |= 512 /* NEED_PATCH */;
}
// pre-normalize props, SSR is skipped for now
if (!context.inSSR && propsExpression) {
switch (propsExpression.type) {
case 15 /* JS_OBJECT_EXPRESSION */:
// means that there is no v-bind,
// but still need to deal with dynamic key binding
let classKeyIndex = -1;
let styleKeyIndex = -1;
let hasDynamicKey = false;
for (let i = 0; i < propsExpression.properties.length; i++) {
const key = propsExpression.properties[i].key;
if (isStaticExp(key)) {
if (key.content === 'class') {
classKeyIndex = i;
}
else if (key.content === 'style') {
styleKeyIndex = i;
}
}
else if (!key.isHandlerKey) {
hasDynamicKey = true;
}
}
const classProp = propsExpression.properties[classKeyIndex];
const styleProp = propsExpression.properties[styleKeyIndex];
// no dynamic key
if (!hasDynamicKey) {
if (classProp && !isStaticExp(classProp.value)) {
classProp.value = createCallExpression(context.helper(NORMALIZE_CLASS), [classProp.value]);
}
if (styleProp &&
!isStaticExp(styleProp.value) &&
// the static style is compiled into an object,
// so use `hasStyleBinding` to ensure that it is a dynamic style binding
(hasStyleBinding ||
// v-bind:style and style both exist,
// v-bind:style with static literal object
styleProp.value.type === 17 /* JS_ARRAY_EXPRESSION */)) {
styleProp.value = createCallExpression(context.helper(NORMALIZE_STYLE), [styleProp.value]);
}
}
else {
// dynamic key binding, wrap with `normalizeProps`
propsExpression = createCallExpression(context.helper(NORMALIZE_PROPS), [propsExpression]);
}
break;
case 14 /* JS_CALL_EXPRESSION */:
// mergeProps call, do nothing
break;
default:
// single v-bind
propsExpression = createCallExpression(context.helper(NORMALIZE_PROPS), [
createCallExpression(context.helper(GUARD_REACTIVE_PROPS), [
propsExpression
])
]);
break;
}
}
return {
props: propsExpression,
directives: runtimeDirectives,
patchFlag,
dynamicPropNames
};
}
// Dedupe props in an object literal.
// Literal duplicated attributes would have been warned during the parse phase,
// however, it's possible to encounter duplicated `onXXX` handlers with different
// modifiers. We also need to merge static and dynamic class / style attributes.
// - onXXX handlers / style: merge into array
// - class: merge into single expression with concatenation
function dedupeProperties(properties) {
const knownProps = new Map();
const deduped = [];
for (let i = 0; i < properties.length; i++) {
const prop = properties[i];
// dynamic keys are always allowed
if (prop.key.type === 8 /* COMPOUND_EXPRESSION */ || !prop.key.isStatic) {
deduped.push(prop);
continue;
}
const name = prop.key.content;
const existing = knownProps.get(name);
if (existing) {
if (name === 'style' || name === 'class' || name.startsWith('on')) {
mergeAsArray(existing, prop);
}
// unexpected duplicate, should have emitted error during parse
}
else {
knownProps.set(name, prop);
deduped.push(prop);
}
}
return deduped;
}
function mergeAsArray(existing, incoming) {
if (existing.value.type === 17 /* JS_ARRAY_EXPRESSION */) {
existing.value.elements.push(incoming.value);
}
else {
existing.value = createArrayExpression([existing.value, incoming.value], existing.loc);
}
}
function buildDirectiveArgs(dir, context) {
const dirArgs = [];
const runtime = directiveImportMap.get(dir);
if (runtime) {
// built-in directive with runtime
dirArgs.push(context.helperString(runtime));
}
else {
{
// inject statement for resolving directive
context.helper(RESOLVE_DIRECTIVE);
context.directives.add(dir.name);
dirArgs.push(toValidAssetId(dir.name, `directive`));
}
}
const { loc } = dir;
if (dir.exp)
dirArgs.push(dir.exp);
if (dir.arg) {
if (!dir.exp) {
dirArgs.push(`void 0`);
}
dirArgs.push(dir.arg);
}
if (Object.keys(dir.modifiers).length) {
if (!dir.arg) {
if (!dir.exp) {
dirArgs.push(`void 0`);
}
dirArgs.push(`void 0`);
}
const trueExpression = createSimpleExpression(`true`, false, loc);
dirArgs.push(createObjectExpression(dir.modifiers.map(modifier => createObjectProperty(modifier, trueExpression)), loc));
}
return createArrayExpression(dirArgs, dir.loc);
}
function stringifyDynamicPropNames(props) {
let propsNamesString = `[`;
for (let i = 0, l = props.length; i < l; i++) {
propsNamesString += JSON.stringify(props[i]);
if (i < l - 1)
propsNamesString += ', ';
}
return propsNamesString + `]`;
}
function isComponentTag(tag) {
return tag[0].toLowerCase() + tag.slice(1) === 'component';
}
(process.env.NODE_ENV !== 'production')
? Object.freeze({})
: {};
(process.env.NODE_ENV !== 'production') ? Object.freeze([]) : [];
const cacheStringFunction = (fn) => {
const cache = Object.create(null);
return ((str) => {
const hit = cache[str];
return hit || (cache[str] = fn(str));
});
};
const camelizeRE = /-(\w)/g;
/**
* @private
*/
const camelize = cacheStringFunction((str) => {
return str.replace(camelizeRE, (_, c) => (c ? c.toUpperCase() : ''));
});
const transformSlotOutlet = (node, context) => {
if (isSlotOutlet(node)) {
const { children, loc } = node;
const { slotName, slotProps } = processSlotOutlet(node, context);
const slotArgs = [
context.prefixIdentifiers ? `_ctx.$slots` : `$slots`,
slotName
];
if (slotProps) {
slotArgs.push(slotProps);
}
if (children.length) {
if (!slotProps) {
slotArgs.push(`{}`);
}
slotArgs.push(createFunctionExpression([], children, false, false, loc));
}
if (context.scopeId && !context.slotted) {
if (!slotProps) {
slotArgs.push(`{}`);
}
if (!children.length) {
slotArgs.push(`undefined`);
}
slotArgs.push(`true`);
}
node.codegenNode = createCallExpression(context.helper(RENDER_SLOT), slotArgs, loc);
}
};
function processSlotOutlet(node, context) {
let slotName = `"default"`;
let slotProps = undefined;
const nonNameProps = [];
for (let i = 0; i < node.props.length; i++) {
const p = node.props[i];
if (p.type === 6 /* ATTRIBUTE */) {
if (p.value) {
if (p.name === 'name') {
slotName = JSON.stringify(p.value.content);
}
else {
p.name = camelize(p.name);
nonNameProps.push(p);
}
}
}
else {
if (p.name === 'bind' && isBindKey(p.arg, 'name')) {
if (p.exp)
slotName = p.exp;
}
else {
if (p.name === 'bind' && p.arg && isStaticExp(p.arg)) {
p.arg.content = camelize(p.arg.content);
}
nonNameProps.push(p);
}
}
}
if (nonNameProps.length > 0) {
const { props, directives } = buildProps(node, context, nonNameProps);
slotProps = props;
if (directives.length) {
context.onError(createCompilerError(35 /* X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET */, directives[0].loc));
}
}
return {
slotName,
slotProps
};
}
const fnExpRE = /^\s*([\w$_]+|\([^)]*?\))\s*=>|^\s*function(?:\s+[\w$]+)?\s*\(/;
const transformOn = (dir, node, context, augmentor) => {
const { loc, modifiers, arg } = dir;
if (!dir.exp && !modifiers.length) {
context.onError(createCompilerError(34 /* X_V_ON_NO_EXPRESSION */, loc));
}
let eventName;
if (arg.type === 4 /* SIMPLE_EXPRESSION */) {
if (arg.isStatic) {
const rawName = arg.content;
// for all event listeners, auto convert it to camelCase. See issue #2249
eventName = createSimpleExpression(toHandlerKey(camelize$1(rawName)), true, arg.loc);
}
else {
// #2388
eventName = createCompoundExpression([
`${context.helperString(TO_HANDLER_KEY)}(`,
arg,
`)`
]);
}
}
else {
// already a compound expression.
eventName = arg;
eventName.children.unshift(`${context.helperString(TO_HANDLER_KEY)}(`);
eventName.children.push(`)`);
}
// handler processing
let exp = dir.exp;
if (exp && !exp.content.trim()) {
exp = undefined;
}
let shouldCache = context.cacheHandlers && !exp && !context.inVOnce;
if (exp) {
const isMemberExp = isMemberExpression(exp.content);
const isInlineStatement = !(isMemberExp || fnExpRE.test(exp.content));
const hasMultipleStatements = exp.content.includes(`;`);
if ((process.env.NODE_ENV !== 'production') && true) {
validateBrowserExpression(exp, context, false, hasMultipleStatements);
}
if (isInlineStatement || (shouldCache && isMemberExp)) {
// wrap inline statement in a function expression
exp = createCompoundExpression([
`${isInlineStatement
? `$event`
: `${``}(...args)`} => ${hasMultipleStatements ? `{` : `(`}`,
exp,
hasMultipleStatements ? `}` : `)`
]);
}
}
let ret = {
props: [
createObjectProperty(eventName, exp || createSimpleExpression(`() => {}`, false, loc))
]
};
// apply extended compiler augmentor
if (augmentor) {
ret = augmentor(ret);
}
if (shouldCache) {
// cache handlers so that it's always the same handler being passed down.
// this avoids unnecessary re-renders when users use inline handlers on
// components.
ret.props[0].value = context.cache(ret.props[0].value);
}
// mark the key as handler for props normalization check
ret.props.forEach(p => (p.key.isHandlerKey = true));
return ret;
};
// v-bind without arg is handled directly in ./transformElements.ts due to it affecting
// codegen for the entire props object. This transform here is only for v-bind
// *with* args.
const transformBind = (dir, _node, context) => {
const { exp, modifiers, loc } = dir;
const arg = dir.arg;
if (arg.type !== 4 /* SIMPLE_EXPRESSION */) {
arg.children.unshift(`(`);
arg.children.push(`) || ""`);
}
else if (!arg.isStatic) {
arg.content = `${arg.content} || ""`;
}
// .sync is replaced by v-model:arg
if (modifiers.includes('camel')) {
if (arg.type === 4 /* SIMPLE_EXPRESSION */) {
if (arg.isStatic) {
arg.content = camelize$1(arg.content);
}
else {
arg.content = `${context.helperString(CAMELIZE)}(${arg.content})`;
}
}
else {
arg.children.unshift(`${context.helperString(CAMELIZE)}(`);
arg.children.push(`)`);
}
}
if (!context.inSSR) {
if (modifiers.includes('prop')) {
injectPrefix(arg, '.');
}
if (modifiers.includes('attr')) {
injectPrefix(arg, '^');
}
}
if (!exp ||
(exp.type === 4 /* SIMPLE_EXPRESSION */ && !exp.content.trim())) {
context.onError(createCompilerError(33 /* X_V_BIND_NO_EXPRESSION */, loc));
return {
props: [createObjectProperty(arg, createSimpleExpression('', true, loc))]
};
}
return {
props: [createObjectProperty(arg, exp)]
};
};
const injectPrefix = (arg, prefix) => {
if (arg.type === 4 /* SIMPLE_EXPRESSION */) {
if (arg.isStatic) {
arg.content = prefix + arg.content;
}
else {
arg.content = `\`${prefix}\${${arg.content}}\``;
}
}
else {
arg.children.unshift(`'${prefix}' + (`);
arg.children.push(`)`);
}
};
// Merge adjacent text nodes and expressions into a single expression
// e.g. <div>abc {{ d }} {{ e }}</div> should have a single expression node as child.
const transformText = (node, context) => {
if (node.type === 0 /* ROOT */ ||
node.type === 1 /* ELEMENT */ ||
node.type === 11 /* FOR */ ||
node.type === 10 /* IF_BRANCH */) {
// perform the transform on node exit so that all expressions have already
// been processed.
return () => {
const children = node.children;
let currentContainer = undefined;
let hasText = false;
for (let i = 0; i < children.length; i++) {
const child = children[i];
if (isText(child)) {
hasText = true;
for (let j = i + 1; j < children.length; j++) {
const next = children[j];
if (isText(next)) {
if (!currentContainer) {
currentContainer = children[i] = {
type: 8 /* COMPOUND_EXPRESSION */,
loc: child.loc,
children: [child]
};
}
// merge adjacent text node into current
currentContainer.children.push(` + `, next);
children.splice(j, 1);
j--;
}
else {
currentContainer = undefined;
break;
}
}
}
}
if (!hasText ||
// if this is a plain element with a single text child, leave it
// as-is since the runtime has dedicated fast path for this by directly
// setting textContent of the element.
// for component root it's always normalized anyway.
(children.length === 1 &&
(node.type === 0 /* ROOT */ ||
(node.type === 1 /* ELEMENT */ &&
node.tagType === 0 /* ELEMENT */ &&
// #3756
// custom directives can potentially add DOM elements arbitrarily,
// we need to avoid setting textContent of the element at runtime
// to avoid accidentally overwriting the DOM elements added
// by the user through custom directives.
!node.props.find(p => p.type === 7 /* DIRECTIVE */ &&
!context.directiveTransforms[p.name]) &&
// in compat mode, <template> tags with no special directives
// will be rendered as a fragment so its children must be
// converted into vnodes.
!(node.tag === 'template'))))) {
return;
}
// pre-convert text nodes into createTextVNode(text) calls to avoid
// runtime normalization.
for (let i = 0; i < children.length; i++) {
const child = children[i];
if (isText(child) || child.type === 8 /* COMPOUND_EXPRESSION */) {
const callArgs = [];
// createTextVNode defaults to single whitespace, so if it is a
// single space the code could be an empty call to save bytes.
if (child.type !== 2 /* TEXT */ || child.content !== ' ') {
callArgs.push(child);
}
// mark dynamic text with flag so it gets patched inside a block
if (!context.ssr &&
getConstantType(child, context) === 0 /* NOT_CONSTANT */) {
callArgs.push(1 /* TEXT */ +
((process.env.NODE_ENV !== 'production') ? ` /* ${PatchFlagNames[1 /* TEXT */]} */` : ``));
}
children[i] = {
type: 12 /* TEXT_CALL */,
content: child,
loc: child.loc,
codegenNode: createCallExpression(context.helper(CREATE_TEXT), callArgs)
};
}
}
};
}
};
const seen = new WeakSet();
const transformOnce = (node, context) => {
if (node.type === 1 /* ELEMENT */ && findDir(node, 'once', true)) {
if (seen.has(node) || context.inVOnce) {
return;
}
seen.add(node);
context.inVOnce = true;
context.helper(SET_BLOCK_TRACKING);
return () => {
context.inVOnce = false;
const cur = context.currentNode;
if (cur.codegenNode) {
cur.codegenNode = context.cache(cur.codegenNode, true /* isVNode */);
}
};
}
};
const transformModel = (dir, node, context) => {
const { exp, arg } = dir;
if (!exp) {
context.onError(createCompilerError(40 /* X_V_MODEL_NO_EXPRESSION */, dir.loc));
return createTransformProps();
}
const rawExp = exp.loc.source;
const expString = exp.type === 4 /* SIMPLE_EXPRESSION */ ? exp.content : rawExp;
const maybeRef = !true /* SETUP_CONST */;
if (!expString.trim() || (!isMemberExpression(expString) && !maybeRef)) {
context.onError(createCompilerError(41 /* X_V_MODEL_MALFORMED_EXPRESSION */, exp.loc));
return createTransformProps();
}
const propName = arg ? arg : createSimpleExpression('modelValue', true);
const eventName = arg
? isStaticExp(arg)
? `onUpdate:${arg.content}`
: createCompoundExpression(['"onUpdate:" + ', arg])
: `onUpdate:modelValue`;
let assignmentExp;
const eventArg = context.isTS ? `($event: any)` : `$event`;
{
assignmentExp = createCompoundExpression([
`${eventArg} => (`,
exp,
` = $event)`
]);
}
const props = [
// modelValue: foo
createObjectProperty(propName, dir.exp),
// "onUpdate:modelValue": $event => (foo = $event)
createObjectProperty(eventName, assignmentExp)
];
// modelModifiers: { foo: true, "bar-baz": true }
if (dir.modifiers.length && node.tagType === 1 /* COMPONENT */) {
const modifiers = dir.modifiers
.map(m => (isSimpleIdentifier(m) ? m : JSON.stringify(m)) + `: true`)
.join(`, `);
const modifiersKey = arg
? isStaticExp(arg)
? `${arg.content}Modifiers`
: createCompoundExpression([arg, ' + "Modifiers"'])
: `modelModifiers`;
props.push(createObjectProperty(modifiersKey, createSimpleExpression(`{ ${modifiers} }`, false, dir.loc, 2 /* CAN_HOIST */)));
}
return createTransformProps(props);
};
function createTransformProps(props = []) {
return { props };
}
const validDivisionCharRE = /[\w).+\-_$\]]/;
const transformFilter = (node, context) => {
if (!isCompatEnabled("COMPILER_FILTER" /* COMPILER_FILTERS */, context)) {
return;
}
if (node.type === 5 /* INTERPOLATION */) {
// filter rewrite is applied before expression transform so only
// simple expressions are possible at this stage
rewriteFilter(node.content, context);
}
if (node.type === 1 /* ELEMENT */) {
node.props.forEach((prop) => {
if (prop.type === 7 /* DIRECTIVE */ &&
prop.name !== 'for' &&
prop.exp) {
rewriteFilter(prop.exp, context);
}
});
}
};
function rewriteFilter(node, context) {
if (node.type === 4 /* SIMPLE_EXPRESSION */) {
parseFilter(node, context);
}
else {
for (let i = 0; i < node.children.length; i++) {
const child = node.children[i];
if (typeof child !== 'object')
continue;
if (child.type === 4 /* SIMPLE_EXPRESSION */) {
parseFilter(child, context);
}
else if (child.type === 8 /* COMPOUND_EXPRESSION */) {
rewriteFilter(node, context);
}
else if (child.type === 5 /* INTERPOLATION */) {
rewriteFilter(child.content, context);
}
}
}
}
function parseFilter(node, context) {
const exp = node.content;
let inSingle = false;
let inDouble = false;
let inTemplateString = false;
let inRegex = false;
let curly = 0;
let square = 0;
let paren = 0;
let lastFilterIndex = 0;
let c, prev, i, expression, filters = [];
for (i = 0; i < exp.length; i++) {
prev = c;
c = exp.charCodeAt(i);
if (inSingle) {
if (c === 0x27 && prev !== 0x5c)
inSingle = false;
}
else if (inDouble) {
if (c === 0x22 && prev !== 0x5c)
inDouble = false;
}
else if (inTemplateString) {
if (c === 0x60 && prev !== 0x5c)
inTemplateString = false;
}
else if (inRegex) {
if (c === 0x2f && prev !== 0x5c)
inRegex = false;
}
else if (c === 0x7c && // pipe
exp.charCodeAt(i + 1) !== 0x7c &&
exp.charCodeAt(i - 1) !== 0x7c &&
!curly &&
!square &&
!paren) {
if (expression === undefined) {
// first filter, end of expression
lastFilterIndex = i + 1;
expression = exp.slice(0, i).trim();
}
else {
pushFilter();
}
}
else {
switch (c) {
case 0x22:
inDouble = true;
break; // "
case 0x27:
inSingle = true;
break; // '
case 0x60:
inTemplateString = true;
break; // `
case 0x28:
paren++;
break; // (
case 0x29:
paren--;
break; // )
case 0x5b:
square++;
break; // [
case 0x5d:
square--;
break; // ]
case 0x7b:
curly++;
break; // {
case 0x7d:
curly--;
break; // }
}
if (c === 0x2f) {
// /
let j = i - 1;
let p;
// find first non-whitespace prev char
for (; j >= 0; j--) {
p = exp.charAt(j);
if (p !== ' ')
break;
}
if (!p || !validDivisionCharRE.test(p)) {
inRegex = true;
}
}
}
}
if (expression === undefined) {
expression = exp.slice(0, i).trim();
}
else if (lastFilterIndex !== 0) {
pushFilter();
}
function pushFilter() {
filters.push(exp.slice(lastFilterIndex, i).trim());
lastFilterIndex = i + 1;
}
if (filters.length) {
(process.env.NODE_ENV !== 'production') &&
warnDeprecation("COMPILER_FILTER" /* COMPILER_FILTERS */, context, node.loc);
for (i = 0; i < filters.length; i++) {
expression = wrapFilter(expression, filters[i], context);
}
node.content = expression;
}
}
function wrapFilter(exp, filter, context) {
context.helper(RESOLVE_FILTER);
const i = filter.indexOf('(');
if (i < 0) {
context.filters.add(filter);
return `${toValidAssetId(filter, 'filter')}(${exp})`;
}
else {
const name = filter.slice(0, i);
const args = filter.slice(i + 1);
context.filters.add(name);
return `${toValidAssetId(name, 'filter')}(${exp}${args !== ')' ? ',' + args : args}`;
}
}
const seen$1 = new WeakSet();
const transformMemo = (node, context) => {
if (node.type === 1 /* ELEMENT */) {
const dir = findDir(node, 'memo');
if (!dir || seen$1.has(node)) {
return;
}
seen$1.add(node);
return () => {
const codegenNode = node.codegenNode ||
context.currentNode.codegenNode;
if (codegenNode && codegenNode.type === 13 /* VNODE_CALL */) {
// non-component sub tree should be turned into a block
if (node.tagType !== 1 /* COMPONENT */) {
makeBlock(codegenNode, context);
}
node.codegenNode = createCallExpression(context.helper(WITH_MEMO), [
dir.exp,
createFunctionExpression(undefined, codegenNode),
`_cache`,
String(context.cached++)
]);
}
};
}
};
function getBaseTransformPreset(prefixIdentifiers) {
return [
[
transformOnce,
transformIf,
transformMemo,
transformFor,
...([transformFilter] ),
...((process.env.NODE_ENV !== 'production')
? [transformExpression]
: []),
transformSlotOutlet,
transformElement,
trackSlotScopes,
transformText
],
{
on: transformOn,
bind: transformBind,
model: transformModel
}
];
}
// we name it `baseCompile` so that higher order compilers like
// @vue/compiler-dom can export `compile` while re-exporting everything else.
function baseCompile(template, options = {}) {
const onError = options.onError || defaultOnError;
const isModuleMode = options.mode === 'module';
/* istanbul ignore if */
{
if (options.prefixIdentifiers === true) {
onError(createCompilerError(45 /* X_PREFIX_ID_NOT_SUPPORTED */));
}
else if (isModuleMode) {
onError(createCompilerError(46 /* X_MODULE_MODE_NOT_SUPPORTED */));
}
}
const prefixIdentifiers = !true ;
if (options.cacheHandlers) {
onError(createCompilerError(47 /* X_CACHE_HANDLER_NOT_SUPPORTED */));
}
if (options.scopeId && !isModuleMode) {
onError(createCompilerError(48 /* X_SCOPE_ID_NOT_SUPPORTED */));
}
const ast = isString(template) ? baseParse(template, options) : template;
const [nodeTransforms, directiveTransforms] = getBaseTransformPreset();
transform(ast, extend({}, options, {
prefixIdentifiers,
nodeTransforms: [
...nodeTransforms,
...(options.nodeTransforms || []) // user transforms
],
directiveTransforms: extend({}, directiveTransforms, options.directiveTransforms || {} // user transforms
)
}));
return generate(ast, extend({}, options, {
prefixIdentifiers
}));
}
const noopDirectiveTransform = () => ({ props: [] });
var compilerCore_esmBundler = {
__proto__: null,
BASE_TRANSITION: BASE_TRANSITION,
CAMELIZE: CAMELIZE,
CAPITALIZE: CAPITALIZE,
CREATE_BLOCK: CREATE_BLOCK,
CREATE_COMMENT: CREATE_COMMENT,
CREATE_ELEMENT_BLOCK: CREATE_ELEMENT_BLOCK,
CREATE_ELEMENT_VNODE: CREATE_ELEMENT_VNODE,
CREATE_SLOTS: CREATE_SLOTS,
CREATE_STATIC: CREATE_STATIC,
CREATE_TEXT: CREATE_TEXT,
CREATE_VNODE: CREATE_VNODE,
FRAGMENT: FRAGMENT,
GUARD_REACTIVE_PROPS: GUARD_REACTIVE_PROPS,
IS_MEMO_SAME: IS_MEMO_SAME,
IS_REF: IS_REF,
KEEP_ALIVE: KEEP_ALIVE,
MERGE_PROPS: MERGE_PROPS,
NORMALIZE_CLASS: NORMALIZE_CLASS,
NORMALIZE_PROPS: NORMALIZE_PROPS,
NORMALIZE_STYLE: NORMALIZE_STYLE,
OPEN_BLOCK: OPEN_BLOCK,
POP_SCOPE_ID: POP_SCOPE_ID,
PUSH_SCOPE_ID: PUSH_SCOPE_ID,
RENDER_LIST: RENDER_LIST,
RENDER_SLOT: RENDER_SLOT,
RESOLVE_COMPONENT: RESOLVE_COMPONENT,
RESOLVE_DIRECTIVE: RESOLVE_DIRECTIVE,
RESOLVE_DYNAMIC_COMPONENT: RESOLVE_DYNAMIC_COMPONENT,
RESOLVE_FILTER: RESOLVE_FILTER,
SET_BLOCK_TRACKING: SET_BLOCK_TRACKING,
SUSPENSE: SUSPENSE,
TELEPORT: TELEPORT,
TO_DISPLAY_STRING: TO_DISPLAY_STRING,
TO_HANDLERS: TO_HANDLERS,
TO_HANDLER_KEY: TO_HANDLER_KEY,
UNREF: UNREF,
WITH_CTX: WITH_CTX,
WITH_DIRECTIVES: WITH_DIRECTIVES,
WITH_MEMO: WITH_MEMO,
WITH_SCOPE_ID: WITH_SCOPE_ID,
advancePositionWithClone: advancePositionWithClone,
advancePositionWithMutation: advancePositionWithMutation,
assert: assert,
baseCompile: baseCompile,
baseParse: baseParse,
buildProps: buildProps,
buildSlots: buildSlots,
checkCompatEnabled: checkCompatEnabled,
createArrayExpression: createArrayExpression,
createAssignmentExpression: createAssignmentExpression,
createBlockStatement: createBlockStatement,
createCacheExpression: createCacheExpression,
createCallExpression: createCallExpression,
createCompilerError: createCompilerError,
createCompoundExpression: createCompoundExpression,
createConditionalExpression: createConditionalExpression,
createForLoopParams: createForLoopParams,
createFunctionExpression: createFunctionExpression,
createIfStatement: createIfStatement,
createInterpolation: createInterpolation,
createObjectExpression: createObjectExpression,
createObjectProperty: createObjectProperty,
createReturnStatement: createReturnStatement,
createRoot: createRoot,
createSequenceExpression: createSequenceExpression,
createSimpleExpression: createSimpleExpression,
createStructuralDirectiveTransform: createStructuralDirectiveTransform,
createTemplateLiteral: createTemplateLiteral,
createTransformContext: createTransformContext,
createVNodeCall: createVNodeCall,
extractIdentifiers: extractIdentifiers,
findDir: findDir,
findProp: findProp,
generate: generate,
getBaseTransformPreset: getBaseTransformPreset,
getInnerRange: getInnerRange,
getMemoedVNodeCall: getMemoedVNodeCall,
getVNodeBlockHelper: getVNodeBlockHelper,
getVNodeHelper: getVNodeHelper,
hasDynamicKeyVBind: hasDynamicKeyVBind,
hasScopeRef: hasScopeRef,
helperNameMap: helperNameMap,
injectProp: injectProp,
isBindKey: isBindKey,
isBuiltInType: isBuiltInType,
isCoreComponent: isCoreComponent,
isFunctionType: isFunctionType,
isInDestructureAssignment: isInDestructureAssignment,
isMemberExpression: isMemberExpression,
isReferencedIdentifier: isReferencedIdentifier,
isSimpleIdentifier: isSimpleIdentifier,
isSlotOutlet: isSlotOutlet,
isStaticExp: isStaticExp,
isStaticProperty: isStaticProperty,
isStaticPropertyKey: isStaticPropertyKey,
isTemplateNode: isTemplateNode,
isText: isText,
isVSlot: isVSlot,
locStub: locStub,
makeBlock: makeBlock,
noopDirectiveTransform: noopDirectiveTransform,
processExpression: processExpression,
processFor: processFor,
processIf: processIf,
processSlotOutlet: processSlotOutlet,
registerRuntimeHelpers: registerRuntimeHelpers,
resolveComponentType: resolveComponentType,
toValidAssetId: toValidAssetId,
trackSlotScopes: trackSlotScopes,
trackVForSlotScopes: trackVForSlotScopes,
transform: transform,
transformBind: transformBind,
transformElement: transformElement,
transformExpression: transformExpression,
transformModel: transformModel,
transformOn: transformOn,
traverseNode: traverseNode,
walkBlockDeclarations: walkBlockDeclarations,
walkFunctionParams: walkFunctionParams,
walkIdentifiers: walkIdentifiers,
warnDeprecation: warnDeprecation,
generateCodeFrame: generateCodeFrame
};
var require$$0 = /*@__PURE__*/build.getAugmentedNamespace(compilerCore_esmBundler);
var require$$1 = /*@__PURE__*/build.getAugmentedNamespace(shared_esmBundler);
(function (exports) {
Object.defineProperty(exports, '__esModule', { value: true });
var compilerCore = require$$0;
var shared = require$$1;
const V_MODEL_RADIO = Symbol(`vModelRadio` );
const V_MODEL_CHECKBOX = Symbol(`vModelCheckbox` );
const V_MODEL_TEXT = Symbol(`vModelText` );
const V_MODEL_SELECT = Symbol(`vModelSelect` );
const V_MODEL_DYNAMIC = Symbol(`vModelDynamic` );
const V_ON_WITH_MODIFIERS = Symbol(`vOnModifiersGuard` );
const V_ON_WITH_KEYS = Symbol(`vOnKeysGuard` );
const V_SHOW = Symbol(`vShow` );
const TRANSITION = Symbol(`Transition` );
const TRANSITION_GROUP = Symbol(`TransitionGroup` );
compilerCore.registerRuntimeHelpers({
[V_MODEL_RADIO]: `vModelRadio`,
[V_MODEL_CHECKBOX]: `vModelCheckbox`,
[V_MODEL_TEXT]: `vModelText`,
[V_MODEL_SELECT]: `vModelSelect`,
[V_MODEL_DYNAMIC]: `vModelDynamic`,
[V_ON_WITH_MODIFIERS]: `withModifiers`,
[V_ON_WITH_KEYS]: `withKeys`,
[V_SHOW]: `vShow`,
[TRANSITION]: `Transition`,
[TRANSITION_GROUP]: `TransitionGroup`
});
var namedCharacterReferences = {
GT: ">",
gt: ">",
LT: "<",
lt: "<",
"ac;": "∾",
"af;": "",
AMP: "&",
amp: "&",
"ap;": "≈",
"DD;": "",
"dd;": "",
deg: "°",
"ee;": "",
"eg;": "⪚",
"el;": "⪙",
ETH: "Ð",
eth: "ð",
"gE;": "≧",
"ge;": "≥",
"Gg;": "⋙",
"gg;": "≫",
"gl;": "≷",
"GT;": ">",
"Gt;": "≫",
"gt;": ">",
"ic;": "",
"ii;": "",
"Im;": "",
"in;": "∈",
"it;": "",
"lE;": "≦",
"le;": "≤",
"lg;": "≶",
"Ll;": "⋘",
"ll;": "≪",
"LT;": "<",
"Lt;": "≪",
"lt;": "<",
"mp;": "∓",
"Mu;": "Μ",
"mu;": "μ",
"ne;": "≠",
"ni;": "∋",
not: "¬",
"Nu;": "Ν",
"nu;": "ν",
"Or;": "⩔",
"or;": "",
"oS;": "Ⓢ",
"Pi;": "Π",
"pi;": "π",
"pm;": "±",
"Pr;": "⪻",
"pr;": "≺",
"Re;": "",
REG: "®",
reg: "®",
"rx;": "℞",
"Sc;": "⪼",
"sc;": "≻",
shy: "­",
uml: "¨",
"wp;": "℘",
"wr;": "≀",
"Xi;": "Ξ",
"xi;": "ξ",
yen: "¥",
"acd;": "∿",
"acE;": "∾̳",
"Acy;": "А",
"acy;": "а",
"Afr;": "𝔄",
"afr;": "𝔞",
"AMP;": "&",
"amp;": "&",
"And;": "⩓",
"and;": "∧",
"ang;": "∠",
"apE;": "⩰",
"ape;": "≊",
"ast;": "*",
Auml: "Ä",
auml: "ä",
"Bcy;": "Б",
"bcy;": "б",
"Bfr;": "𝔅",
"bfr;": "𝔟",
"bne;": "=⃥",
"bot;": "⊥",
"Cap;": "⋒",
"cap;": "∩",
cent: "¢",
"Cfr;": "",
"cfr;": "𝔠",
"Chi;": "Χ",
"chi;": "χ",
"cir;": "○",
COPY: "©",
copy: "©",
"Cup;": "⋓",
"cup;": "",
"Dcy;": "Д",
"dcy;": "д",
"deg;": "°",
"Del;": "∇",
"Dfr;": "𝔇",
"dfr;": "𝔡",
"die;": "¨",
"div;": "÷",
"Dot;": "¨",
"dot;": "˙",
"Ecy;": "Э",
"ecy;": "э",
"Efr;": "𝔈",
"efr;": "𝔢",
"egs;": "⪖",
"ell;": "",
"els;": "⪕",
"ENG;": "Ŋ",
"eng;": "ŋ",
"Eta;": "Η",
"eta;": "η",
"ETH;": "Ð",
"eth;": "ð",
Euml: "Ë",
euml: "ë",
"Fcy;": "Ф",
"fcy;": "ф",
"Ffr;": "𝔉",
"ffr;": "𝔣",
"gap;": "⪆",
"Gcy;": "Г",
"gcy;": "г",
"gEl;": "⪌",
"gel;": "⋛",
"geq;": "≥",
"ges;": "⩾",
"Gfr;": "𝔊",
"gfr;": "𝔤",
"ggg;": "⋙",
"gla;": "⪥",
"glE;": "⪒",
"glj;": "⪤",
"gnE;": "≩",
"gne;": "⪈",
"Hat;": "^",
"Hfr;": "",
"hfr;": "𝔥",
"Icy;": "И",
"icy;": "и",
"iff;": "⇔",
"Ifr;": "",
"ifr;": "𝔦",
"Int;": "∬",
"int;": "∫",
Iuml: "Ï",
iuml: "ï",
"Jcy;": "Й",
"jcy;": "й",
"Jfr;": "𝔍",
"jfr;": "𝔧",
"Kcy;": "К",
"kcy;": "к",
"Kfr;": "𝔎",
"kfr;": "𝔨",
"lap;": "⪅",
"lat;": "⪫",
"Lcy;": "Л",
"lcy;": "л",
"lEg;": "⪋",
"leg;": "⋚",
"leq;": "≤",
"les;": "⩽",
"Lfr;": "𝔏",
"lfr;": "𝔩",
"lgE;": "⪑",
"lnE;": "≨",
"lne;": "⪇",
"loz;": "◊",
"lrm;": "",
"Lsh;": "↰",
"lsh;": "↰",
macr: "¯",
"Map;": "⤅",
"map;": "↦",
"Mcy;": "М",
"mcy;": "м",
"Mfr;": "𝔐",
"mfr;": "𝔪",
"mho;": "℧",
"mid;": "",
"nap;": "≉",
nbsp: " ",
"Ncy;": "Н",
"ncy;": "н",
"Nfr;": "𝔑",
"nfr;": "𝔫",
"ngE;": "≧̸",
"nge;": "≱",
"nGg;": "⋙̸",
"nGt;": "≫⃒",
"ngt;": "≯",
"nis;": "⋼",
"niv;": "∋",
"nlE;": "≦̸",
"nle;": "≰",
"nLl;": "⋘̸",
"nLt;": "≪⃒",
"nlt;": "≮",
"Not;": "⫬",
"not;": "¬",
"npr;": "⊀",
"nsc;": "⊁",
"num;": "#",
"Ocy;": "О",
"ocy;": "о",
"Ofr;": "𝔒",
"ofr;": "𝔬",
"ogt;": "⧁",
"ohm;": "Ω",
"olt;": "⧀",
"ord;": "⩝",
ordf: "ª",
ordm: "º",
"orv;": "⩛",
Ouml: "Ö",
ouml: "ö",
"par;": "∥",
para: "¶",
"Pcy;": "П",
"pcy;": "п",
"Pfr;": "𝔓",
"pfr;": "𝔭",
"Phi;": "Φ",
"phi;": "φ",
"piv;": "ϖ",
"prE;": "⪳",
"pre;": "⪯",
"Psi;": "Ψ",
"psi;": "ψ",
"Qfr;": "𝔔",
"qfr;": "𝔮",
QUOT: "\"",
quot: "\"",
"Rcy;": "Р",
"rcy;": "р",
"REG;": "®",
"reg;": "®",
"Rfr;": "",
"rfr;": "𝔯",
"Rho;": "Ρ",
"rho;": "ρ",
"rlm;": "",
"Rsh;": "↱",
"rsh;": "↱",
"scE;": "⪴",
"sce;": "⪰",
"Scy;": "С",
"scy;": "с",
sect: "§",
"Sfr;": "𝔖",
"sfr;": "𝔰",
"shy;": "­",
"sim;": "",
"smt;": "⪪",
"sol;": "/",
"squ;": "□",
"Sub;": "⋐",
"sub;": "⊂",
"Sum;": "∑",
"sum;": "∑",
"Sup;": "⋑",
"sup;": "⊃",
sup1: "¹",
sup2: "²",
sup3: "³",
"Tab;": "\t",
"Tau;": "Τ",
"tau;": "τ",
"Tcy;": "Т",
"tcy;": "т",
"Tfr;": "𝔗",
"tfr;": "𝔱",
"top;": "",
"Ucy;": "У",
"ucy;": "у",
"Ufr;": "𝔘",
"ufr;": "𝔲",
"uml;": "¨",
Uuml: "Ü",
uuml: "ü",
"Vcy;": "В",
"vcy;": "в",
"Vee;": "",
"vee;": "",
"Vfr;": "𝔙",
"vfr;": "𝔳",
"Wfr;": "𝔚",
"wfr;": "𝔴",
"Xfr;": "𝔛",
"xfr;": "𝔵",
"Ycy;": "Ы",
"ycy;": "ы",
"yen;": "¥",
"Yfr;": "𝔜",
"yfr;": "𝔶",
yuml: "ÿ",
"Zcy;": "З",
"zcy;": "з",
"Zfr;": "",
"zfr;": "𝔷",
"zwj;": "",
Acirc: "Â",
acirc: "â",
acute: "´",
AElig: "Æ",
aelig: "æ",
"andd;": "⩜",
"andv;": "⩚",
"ange;": "⦤",
"Aopf;": "𝔸",
"aopf;": "𝕒",
"apid;": "≋",
"apos;": "'",
Aring: "Å",
aring: "å",
"Ascr;": "𝒜",
"ascr;": "𝒶",
"Auml;": "Ä",
"auml;": "ä",
"Barv;": "⫧",
"bbrk;": "⎵",
"Beta;": "Β",
"beta;": "β",
"beth;": "ℶ",
"bNot;": "⫭",
"bnot;": "⌐",
"Bopf;": "𝔹",
"bopf;": "𝕓",
"boxH;": "═",
"boxh;": "─",
"boxV;": "║",
"boxv;": "│",
"Bscr;": "",
"bscr;": "𝒷",
"bsim;": "∽",
"bsol;": "\\",
"bull;": "•",
"bump;": "≎",
"caps;": "∩︀",
"Cdot;": "Ċ",
"cdot;": "ċ",
cedil: "¸",
"cent;": "¢",
"CHcy;": "Ч",
"chcy;": "ч",
"circ;": "ˆ",
"cirE;": "⧃",
"cire;": "≗",
"comp;": "∁",
"cong;": "≅",
"Copf;": "",
"copf;": "𝕔",
"COPY;": "©",
"copy;": "©",
"Cscr;": "𝒞",
"cscr;": "𝒸",
"csub;": "⫏",
"csup;": "⫐",
"cups;": "",
"Darr;": "↡",
"dArr;": "⇓",
"darr;": "↓",
"dash;": "",
"dHar;": "⥥",
"diam;": "⋄",
"DJcy;": "Ђ",
"djcy;": "ђ",
"Dopf;": "𝔻",
"dopf;": "𝕕",
"Dscr;": "𝒟",
"dscr;": "𝒹",
"DScy;": "Ѕ",
"dscy;": "ѕ",
"dsol;": "⧶",
"dtri;": "▿",
"DZcy;": "Џ",
"dzcy;": "џ",
"ecir;": "≖",
Ecirc: "Ê",
ecirc: "ê",
"Edot;": "Ė",
"eDot;": "≑",
"edot;": "ė",
"emsp;": "",
"ensp;": "",
"Eopf;": "𝔼",
"eopf;": "𝕖",
"epar;": "⋕",
"epsi;": "ε",
"Escr;": "",
"escr;": "",
"Esim;": "⩳",
"esim;": "≂",
"Euml;": "Ë",
"euml;": "ë",
"euro;": "€",
"excl;": "!",
"flat;": "♭",
"fnof;": "ƒ",
"Fopf;": "𝔽",
"fopf;": "𝕗",
"fork;": "⋔",
"Fscr;": "",
"fscr;": "𝒻",
"Gdot;": "Ġ",
"gdot;": "ġ",
"geqq;": "≧",
"gesl;": "⋛︀",
"GJcy;": "Ѓ",
"gjcy;": "ѓ",
"gnap;": "⪊",
"gneq;": "⪈",
"Gopf;": "𝔾",
"gopf;": "𝕘",
"Gscr;": "𝒢",
"gscr;": "",
"gsim;": "≳",
"gtcc;": "⪧",
"gvnE;": "≩︀",
"half;": "½",
"hArr;": "⇔",
"harr;": "↔",
"hbar;": "ℏ",
"Hopf;": "",
"hopf;": "𝕙",
"Hscr;": "",
"hscr;": "𝒽",
Icirc: "Î",
icirc: "î",
"Idot;": "İ",
"IEcy;": "Е",
"iecy;": "е",
iexcl: "¡",
"imof;": "⊷",
"IOcy;": "Ё",
"iocy;": "ё",
"Iopf;": "𝕀",
"iopf;": "𝕚",
"Iota;": "Ι",
"iota;": "ι",
"Iscr;": "",
"iscr;": "𝒾",
"isin;": "∈",
"Iuml;": "Ï",
"iuml;": "ï",
"Jopf;": "𝕁",
"jopf;": "𝕛",
"Jscr;": "𝒥",
"jscr;": "𝒿",
"KHcy;": "Х",
"khcy;": "х",
"KJcy;": "Ќ",
"kjcy;": "ќ",
"Kopf;": "𝕂",
"kopf;": "𝕜",
"Kscr;": "𝒦",
"kscr;": "𝓀",
"Lang;": "⟪",
"lang;": "⟨",
laquo: "«",
"Larr;": "↞",
"lArr;": "⇐",
"larr;": "←",
"late;": "⪭",
"lcub;": "{",
"ldca;": "⤶",
"ldsh;": "↲",
"leqq;": "≦",
"lesg;": "⋚︀",
"lHar;": "⥢",
"LJcy;": "Љ",
"ljcy;": "љ",
"lnap;": "⪉",
"lneq;": "⪇",
"Lopf;": "𝕃",
"lopf;": "𝕝",
"lozf;": "⧫",
"lpar;": "(",
"Lscr;": "",
"lscr;": "𝓁",
"lsim;": "≲",
"lsqb;": "[",
"ltcc;": "⪦",
"ltri;": "◃",
"lvnE;": "≨︀",
"macr;": "¯",
"male;": "♂",
"malt;": "✠",
micro: "µ",
"mlcp;": "⫛",
"mldr;": "…",
"Mopf;": "𝕄",
"mopf;": "𝕞",
"Mscr;": "",
"mscr;": "𝓂",
"nang;": "∠⃒",
"napE;": "⩰̸",
"nbsp;": " ",
"ncap;": "⩃",
"ncup;": "⩂",
"ngeq;": "≱",
"nges;": "⩾̸",
"ngtr;": "≯",
"nGtv;": "≫̸",
"nisd;": "⋺",
"NJcy;": "Њ",
"njcy;": "њ",
"nldr;": "‥",
"nleq;": "≰",
"nles;": "⩽̸",
"nLtv;": "≪̸",
"nmid;": "∤",
"Nopf;": "",
"nopf;": "𝕟",
"npar;": "∦",
"npre;": "⪯̸",
"nsce;": "⪰̸",
"Nscr;": "𝒩",
"nscr;": "𝓃",
"nsim;": "≁",
"nsub;": "⊄",
"nsup;": "⊅",
"ntgl;": "≹",
"ntlg;": "≸",
"nvap;": "≍⃒",
"nvge;": "≥⃒",
"nvgt;": ">⃒",
"nvle;": "≤⃒",
"nvlt;": "<⃒",
"oast;": "⊛",
"ocir;": "⊚",
Ocirc: "Ô",
ocirc: "ô",
"odiv;": "⨸",
"odot;": "⊙",
"ogon;": "˛",
"oint;": "∮",
"omid;": "⦶",
"Oopf;": "𝕆",
"oopf;": "𝕠",
"opar;": "⦷",
"ordf;": "ª",
"ordm;": "º",
"oror;": "⩖",
"Oscr;": "𝒪",
"oscr;": "",
"osol;": "⊘",
"Ouml;": "Ö",
"ouml;": "ö",
"para;": "¶",
"part;": "∂",
"perp;": "⊥",
"phiv;": "ϕ",
"plus;": "+",
"Popf;": "",
"popf;": "𝕡",
pound: "£",
"prap;": "⪷",
"prec;": "≺",
"prnE;": "⪵",
"prod;": "∏",
"prop;": "∝",
"Pscr;": "𝒫",
"pscr;": "𝓅",
"qint;": "⨌",
"Qopf;": "",
"qopf;": "𝕢",
"Qscr;": "𝒬",
"qscr;": "𝓆",
"QUOT;": "\"",
"quot;": "\"",
"race;": "∽̱",
"Rang;": "⟫",
"rang;": "⟩",
raquo: "»",
"Rarr;": "↠",
"rArr;": "⇒",
"rarr;": "→",
"rcub;": "}",
"rdca;": "⤷",
"rdsh;": "↳",
"real;": "",
"rect;": "▭",
"rHar;": "⥤",
"rhov;": "ϱ",
"ring;": "˚",
"Ropf;": "",
"ropf;": "𝕣",
"rpar;": ")",
"Rscr;": "",
"rscr;": "𝓇",
"rsqb;": "]",
"rtri;": "▹",
"scap;": "⪸",
"scnE;": "⪶",
"sdot;": "⋅",
"sect;": "§",
"semi;": ";",
"sext;": "✶",
"SHcy;": "Ш",
"shcy;": "ш",
"sime;": "≃",
"simg;": "⪞",
"siml;": "⪝",
"smid;": "",
"smte;": "⪬",
"solb;": "⧄",
"Sopf;": "𝕊",
"sopf;": "𝕤",
"spar;": "∥",
"Sqrt;": "√",
"squf;": "▪",
"Sscr;": "𝒮",
"sscr;": "𝓈",
"Star;": "⋆",
"star;": "☆",
"subE;": "⫅",
"sube;": "⊆",
"succ;": "≻",
"sung;": "♪",
"sup1;": "¹",
"sup2;": "²",
"sup3;": "³",
"supE;": "⫆",
"supe;": "⊇",
szlig: "ß",
"tbrk;": "⎴",
"tdot;": "⃛",
THORN: "Þ",
thorn: "þ",
times: "×",
"tint;": "∭",
"toea;": "⤨",
"Topf;": "𝕋",
"topf;": "𝕥",
"tosa;": "⤩",
"trie;": "≜",
"Tscr;": "𝒯",
"tscr;": "𝓉",
"TScy;": "Ц",
"tscy;": "ц",
"Uarr;": "↟",
"uArr;": "⇑",
"uarr;": "↑",
Ucirc: "Û",
ucirc: "û",
"uHar;": "⥣",
"Uopf;": "𝕌",
"uopf;": "𝕦",
"Upsi;": "ϒ",
"upsi;": "υ",
"Uscr;": "𝒰",
"uscr;": "𝓊",
"utri;": "▵",
"Uuml;": "Ü",
"uuml;": "ü",
"vArr;": "⇕",
"varr;": "↕",
"Vbar;": "⫫",
"vBar;": "⫨",
"Vert;": "‖",
"vert;": "|",
"Vopf;": "𝕍",
"vopf;": "𝕧",
"Vscr;": "𝒱",
"vscr;": "𝓋",
"Wopf;": "𝕎",
"wopf;": "𝕨",
"Wscr;": "𝒲",
"wscr;": "𝓌",
"xcap;": "⋂",
"xcup;": "",
"xmap;": "⟼",
"xnis;": "⋻",
"Xopf;": "𝕏",
"xopf;": "𝕩",
"Xscr;": "𝒳",
"xscr;": "𝓍",
"xvee;": "",
"YAcy;": "Я",
"yacy;": "я",
"YIcy;": "Ї",
"yicy;": "ї",
"Yopf;": "𝕐",
"yopf;": "𝕪",
"Yscr;": "𝒴",
"yscr;": "𝓎",
"YUcy;": "Ю",
"yucy;": "ю",
"Yuml;": "Ÿ",
"yuml;": "ÿ",
"Zdot;": "Ż",
"zdot;": "ż",
"Zeta;": "Ζ",
"zeta;": "ζ",
"ZHcy;": "Ж",
"zhcy;": "ж",
"Zopf;": "",
"zopf;": "𝕫",
"Zscr;": "𝒵",
"zscr;": "𝓏",
"zwnj;": "",
Aacute: "Á",
aacute: "á",
"Acirc;": "Â",
"acirc;": "â",
"acute;": "´",
"AElig;": "Æ",
"aelig;": "æ",
Agrave: "À",
agrave: "à",
"aleph;": "ℵ",
"Alpha;": "Α",
"alpha;": "α",
"Amacr;": "Ā",
"amacr;": "ā",
"amalg;": "⨿",
"angle;": "∠",
"angrt;": "∟",
"angst;": "Å",
"Aogon;": "Ą",
"aogon;": "ą",
"Aring;": "Å",
"aring;": "å",
"asymp;": "≈",
Atilde: "Ã",
atilde: "ã",
"awint;": "⨑",
"bcong;": "≌",
"bdquo;": "„",
"bepsi;": "϶",
"blank;": "␣",
"blk12;": "▒",
"blk14;": "░",
"blk34;": "▓",
"block;": "█",
"boxDL;": "╗",
"boxDl;": "╖",
"boxdL;": "╕",
"boxdl;": "┐",
"boxDR;": "╔",
"boxDr;": "╓",
"boxdR;": "╒",
"boxdr;": "┌",
"boxHD;": "╦",
"boxHd;": "╤",
"boxhD;": "╥",
"boxhd;": "┬",
"boxHU;": "╩",
"boxHu;": "╧",
"boxhU;": "╨",
"boxhu;": "┴",
"boxUL;": "╝",
"boxUl;": "╜",
"boxuL;": "╛",
"boxul;": "┘",
"boxUR;": "╚",
"boxUr;": "╙",
"boxuR;": "╘",
"boxur;": "└",
"boxVH;": "╬",
"boxVh;": "╫",
"boxvH;": "╪",
"boxvh;": "┼",
"boxVL;": "╣",
"boxVl;": "╢",
"boxvL;": "╡",
"boxvl;": "┤",
"boxVR;": "╠",
"boxVr;": "╟",
"boxvR;": "╞",
"boxvr;": "├",
"Breve;": "˘",
"breve;": "˘",
brvbar: "¦",
"bsemi;": "⁏",
"bsime;": "⋍",
"bsolb;": "⧅",
"bumpE;": "⪮",
"bumpe;": "≏",
"caret;": "",
"caron;": "ˇ",
"ccaps;": "⩍",
Ccedil: "Ç",
ccedil: "ç",
"Ccirc;": "Ĉ",
"ccirc;": "ĉ",
"ccups;": "⩌",
"cedil;": "¸",
"check;": "✓",
"clubs;": "♣",
"Colon;": "∷",
"colon;": ":",
"comma;": ",",
"crarr;": "↵",
"Cross;": "",
"cross;": "✗",
"csube;": "⫑",
"csupe;": "⫒",
"ctdot;": "⋯",
"cuepr;": "⋞",
"cuesc;": "⋟",
"cupor;": "⩅",
curren: "¤",
"cuvee;": "⋎",
"cuwed;": "⋏",
"cwint;": "∱",
"Dashv;": "⫤",
"dashv;": "⊣",
"dblac;": "˝",
"ddarr;": "⇊",
"Delta;": "Δ",
"delta;": "δ",
"dharl;": "⇃",
"dharr;": "⇂",
"diams;": "♦",
"disin;": "⋲",
divide: "÷",
"doteq;": "≐",
"dtdot;": "⋱",
"dtrif;": "▾",
"duarr;": "⇵",
"duhar;": "⥯",
Eacute: "É",
eacute: "é",
"Ecirc;": "Ê",
"ecirc;": "ê",
"eDDot;": "⩷",
"efDot;": "≒",
Egrave: "È",
egrave: "è",
"Emacr;": "Ē",
"emacr;": "ē",
"empty;": "∅",
"Eogon;": "Ę",
"eogon;": "ę",
"eplus;": "⩱",
"epsiv;": "ϵ",
"eqsim;": "≂",
"Equal;": "⩵",
"equiv;": "≡",
"erarr;": "⥱",
"erDot;": "≓",
"esdot;": "≐",
"exist;": "∃",
"fflig;": "ff",
"filig;": "fi",
"fjlig;": "fj",
"fllig;": "fl",
"fltns;": "▱",
"forkv;": "⫙",
frac12: "½",
frac14: "¼",
frac34: "¾",
"frasl;": "",
"frown;": "⌢",
"Gamma;": "Γ",
"gamma;": "γ",
"Gcirc;": "Ĝ",
"gcirc;": "ĝ",
"gescc;": "⪩",
"gimel;": "ℷ",
"gneqq;": "≩",
"gnsim;": "⋧",
"grave;": "`",
"gsime;": "⪎",
"gsiml;": "⪐",
"gtcir;": "⩺",
"gtdot;": "⋗",
"Hacek;": "ˇ",
"harrw;": "↭",
"Hcirc;": "Ĥ",
"hcirc;": "ĥ",
"hoarr;": "⇿",
Iacute: "Í",
iacute: "í",
"Icirc;": "Î",
"icirc;": "î",
"iexcl;": "¡",
Igrave: "Ì",
igrave: "ì",
"iiint;": "∭",
"iiota;": "℩",
"IJlig;": "IJ",
"ijlig;": "ij",
"Imacr;": "Ī",
"imacr;": "ī",
"image;": "",
"imath;": "ı",
"imped;": "Ƶ",
"infin;": "∞",
"Iogon;": "Į",
"iogon;": "į",
"iprod;": "⨼",
iquest: "¿",
"isinE;": "⋹",
"isins;": "⋴",
"isinv;": "∈",
"Iukcy;": "І",
"iukcy;": "і",
"Jcirc;": "Ĵ",
"jcirc;": "ĵ",
"jmath;": "ȷ",
"Jukcy;": "Є",
"jukcy;": "є",
"Kappa;": "Κ",
"kappa;": "κ",
"lAarr;": "⇚",
"langd;": "⦑",
"laquo;": "«",
"larrb;": "⇤",
"lates;": "⪭︀",
"lBarr;": "⤎",
"lbarr;": "⤌",
"lbbrk;": "",
"lbrke;": "⦋",
"lceil;": "⌈",
"ldquo;": "“",
"lescc;": "⪨",
"lhard;": "↽",
"lharu;": "↼",
"lhblk;": "▄",
"llarr;": "⇇",
"lltri;": "◺",
"lneqq;": "≨",
"lnsim;": "⋦",
"loang;": "⟬",
"loarr;": "⇽",
"lobrk;": "⟦",
"lopar;": "⦅",
"lrarr;": "⇆",
"lrhar;": "⇋",
"lrtri;": "⊿",
"lsime;": "⪍",
"lsimg;": "⪏",
"lsquo;": "",
"ltcir;": "⩹",
"ltdot;": "⋖",
"ltrie;": "⊴",
"ltrif;": "◂",
"mdash;": "—",
"mDDot;": "∺",
"micro;": "µ",
middot: "·",
"minus;": "",
"mumap;": "⊸",
"nabla;": "∇",
"napid;": "≋̸",
"napos;": "ʼn",
"natur;": "♮",
"nbump;": "≎̸",
"ncong;": "≇",
"ndash;": "",
"neArr;": "⇗",
"nearr;": "↗",
"nedot;": "≐̸",
"nesim;": "≂̸",
"ngeqq;": "≧̸",
"ngsim;": "≵",
"nhArr;": "⇎",
"nharr;": "↮",
"nhpar;": "⫲",
"nlArr;": "⇍",
"nlarr;": "↚",
"nleqq;": "≦̸",
"nless;": "≮",
"nlsim;": "≴",
"nltri;": "⋪",
"notin;": "∉",
"notni;": "∌",
"npart;": "∂̸",
"nprec;": "⊀",
"nrArr;": "⇏",
"nrarr;": "↛",
"nrtri;": "⋫",
"nsime;": "≄",
"nsmid;": "∤",
"nspar;": "∦",
"nsubE;": "⫅̸",
"nsube;": "⊈",
"nsucc;": "⊁",
"nsupE;": "⫆̸",
"nsupe;": "⊉",
Ntilde: "Ñ",
ntilde: "ñ",
"numsp;": "",
"nvsim;": "∼⃒",
"nwArr;": "⇖",
"nwarr;": "↖",
Oacute: "Ó",
oacute: "ó",
"Ocirc;": "Ô",
"ocirc;": "ô",
"odash;": "⊝",
"OElig;": "Œ",
"oelig;": "œ",
"ofcir;": "⦿",
Ograve: "Ò",
ograve: "ò",
"ohbar;": "⦵",
"olarr;": "↺",
"olcir;": "⦾",
"oline;": "‾",
"Omacr;": "Ō",
"omacr;": "ō",
"Omega;": "Ω",
"omega;": "ω",
"operp;": "⦹",
"oplus;": "⊕",
"orarr;": "↻",
"order;": "",
Oslash: "Ø",
oslash: "ø",
Otilde: "Õ",
otilde: "õ",
"ovbar;": "⌽",
"parsl;": "⫽",
"phone;": "☎",
"plusb;": "⊞",
"pluse;": "⩲",
plusmn: "±",
"pound;": "£",
"prcue;": "≼",
"Prime;": "″",
"prime;": "",
"prnap;": "⪹",
"prsim;": "≾",
"quest;": "?",
"rAarr;": "⇛",
"radic;": "√",
"rangd;": "⦒",
"range;": "⦥",
"raquo;": "»",
"rarrb;": "⇥",
"rarrc;": "⤳",
"rarrw;": "↝",
"ratio;": "",
"RBarr;": "⤐",
"rBarr;": "⤏",
"rbarr;": "⤍",
"rbbrk;": "",
"rbrke;": "⦌",
"rceil;": "⌉",
"rdquo;": "”",
"reals;": "",
"rhard;": "⇁",
"rharu;": "⇀",
"rlarr;": "⇄",
"rlhar;": "⇌",
"rnmid;": "⫮",
"roang;": "⟭",
"roarr;": "⇾",
"robrk;": "⟧",
"ropar;": "⦆",
"rrarr;": "⇉",
"rsquo;": "",
"rtrie;": "⊵",
"rtrif;": "▸",
"sbquo;": "",
"sccue;": "≽",
"Scirc;": "Ŝ",
"scirc;": "ŝ",
"scnap;": "⪺",
"scsim;": "≿",
"sdotb;": "⊡",
"sdote;": "⩦",
"seArr;": "⇘",
"searr;": "↘",
"setmn;": "",
"sharp;": "♯",
"Sigma;": "Σ",
"sigma;": "σ",
"simeq;": "≃",
"simgE;": "⪠",
"simlE;": "⪟",
"simne;": "≆",
"slarr;": "←",
"smile;": "⌣",
"smtes;": "⪬︀",
"sqcap;": "⊓",
"sqcup;": "⊔",
"sqsub;": "⊏",
"sqsup;": "⊐",
"srarr;": "→",
"starf;": "★",
"strns;": "¯",
"subnE;": "⫋",
"subne;": "⊊",
"supnE;": "⫌",
"supne;": "⊋",
"swArr;": "⇙",
"swarr;": "↙",
"szlig;": "ß",
"Theta;": "Θ",
"theta;": "θ",
"thkap;": "≈",
"THORN;": "Þ",
"thorn;": "þ",
"Tilde;": "",
"tilde;": "˜",
"times;": "×",
"TRADE;": "™",
"trade;": "™",
"trisb;": "⧍",
"TSHcy;": "Ћ",
"tshcy;": "ћ",
"twixt;": "≬",
Uacute: "Ú",
uacute: "ú",
"Ubrcy;": "Ў",
"ubrcy;": "ў",
"Ucirc;": "Û",
"ucirc;": "û",
"udarr;": "⇅",
"udhar;": "⥮",
Ugrave: "Ù",
ugrave: "ù",
"uharl;": "↿",
"uharr;": "↾",
"uhblk;": "▀",
"ultri;": "◸",
"Umacr;": "Ū",
"umacr;": "ū",
"Union;": "",
"Uogon;": "Ų",
"uogon;": "ų",
"uplus;": "⊎",
"upsih;": "ϒ",
"UpTee;": "⊥",
"Uring;": "Ů",
"uring;": "ů",
"urtri;": "◹",
"utdot;": "⋰",
"utrif;": "▴",
"uuarr;": "⇈",
"varpi;": "ϖ",
"vBarv;": "⫩",
"VDash;": "⊫",
"Vdash;": "⊩",
"vDash;": "⊨",
"vdash;": "⊢",
"veeeq;": "≚",
"vltri;": "⊲",
"vnsub;": "⊂⃒",
"vnsup;": "⊃⃒",
"vprop;": "∝",
"vrtri;": "⊳",
"Wcirc;": "Ŵ",
"wcirc;": "ŵ",
"Wedge;": "⋀",
"wedge;": "∧",
"xcirc;": "◯",
"xdtri;": "▽",
"xhArr;": "⟺",
"xharr;": "⟷",
"xlArr;": "⟸",
"xlarr;": "⟵",
"xodot;": "⨀",
"xrArr;": "⟹",
"xrarr;": "⟶",
"xutri;": "△",
Yacute: "Ý",
yacute: "ý",
"Ycirc;": "Ŷ",
"ycirc;": "ŷ",
"Aacute;": "Á",
"aacute;": "á",
"Abreve;": "Ă",
"abreve;": "ă",
"Agrave;": "À",
"agrave;": "à",
"andand;": "⩕",
"angmsd;": "∡",
"angsph;": "∢",
"apacir;": "⩯",
"approx;": "≈",
"Assign;": "≔",
"Atilde;": "Ã",
"atilde;": "ã",
"barvee;": "⊽",
"Barwed;": "⌆",
"barwed;": "⌅",
"becaus;": "∵",
"bernou;": "",
"bigcap;": "⋂",
"bigcup;": "",
"bigvee;": "",
"bkarow;": "⤍",
"bottom;": "⊥",
"bowtie;": "⋈",
"boxbox;": "⧉",
"bprime;": "",
"brvbar;": "¦",
"bullet;": "•",
"Bumpeq;": "≎",
"bumpeq;": "≏",
"Cacute;": "Ć",
"cacute;": "ć",
"capand;": "⩄",
"capcap;": "⩋",
"capcup;": "⩇",
"capdot;": "⩀",
"Ccaron;": "Č",
"ccaron;": "č",
"Ccedil;": "Ç",
"ccedil;": "ç",
"circeq;": "≗",
"cirmid;": "⫯",
"Colone;": "⩴",
"colone;": "≔",
"commat;": "@",
"compfn;": "∘",
"Conint;": "∯",
"conint;": "∮",
"coprod;": "∐",
"copysr;": "℗",
"cularr;": "↶",
"CupCap;": "≍",
"cupcap;": "⩆",
"cupcup;": "⩊",
"cupdot;": "⊍",
"curarr;": "↷",
"curren;": "¤",
"cylcty;": "⌭",
"Dagger;": "‡",
"dagger;": "†",
"daleth;": "ℸ",
"Dcaron;": "Ď",
"dcaron;": "ď",
"dfisht;": "⥿",
"divide;": "÷",
"divonx;": "⋇",
"dlcorn;": "⌞",
"dlcrop;": "⌍",
"dollar;": "$",
"DotDot;": "⃜",
"drcorn;": "⌟",
"drcrop;": "⌌",
"Dstrok;": "Đ",
"dstrok;": "đ",
"Eacute;": "É",
"eacute;": "é",
"easter;": "⩮",
"Ecaron;": "Ě",
"ecaron;": "ě",
"ecolon;": "≕",
"Egrave;": "È",
"egrave;": "è",
"egsdot;": "⪘",
"elsdot;": "⪗",
"emptyv;": "∅",
"emsp13;": "",
"emsp14;": "",
"eparsl;": "⧣",
"eqcirc;": "≖",
"equals;": "=",
"equest;": "≟",
"Exists;": "∃",
"female;": "♀",
"ffilig;": "ffi",
"ffllig;": "ffl",
"ForAll;": "∀",
"forall;": "∀",
"frac12;": "½",
"frac13;": "⅓",
"frac14;": "¼",
"frac15;": "⅕",
"frac16;": "⅙",
"frac18;": "⅛",
"frac23;": "⅔",
"frac25;": "⅖",
"frac34;": "¾",
"frac35;": "⅗",
"frac38;": "⅜",
"frac45;": "⅘",
"frac56;": "⅚",
"frac58;": "⅝",
"frac78;": "⅞",
"gacute;": "ǵ",
"Gammad;": "Ϝ",
"gammad;": "ϝ",
"Gbreve;": "Ğ",
"gbreve;": "ğ",
"Gcedil;": "Ģ",
"gesdot;": "⪀",
"gesles;": "⪔",
"gtlPar;": "⦕",
"gtrarr;": "⥸",
"gtrdot;": "⋗",
"gtrsim;": "≳",
"hairsp;": "",
"hamilt;": "",
"HARDcy;": "Ъ",
"hardcy;": "ъ",
"hearts;": "♥",
"hellip;": "…",
"hercon;": "⊹",
"homtht;": "∻",
"horbar;": "―",
"hslash;": "ℏ",
"Hstrok;": "Ħ",
"hstrok;": "ħ",
"hybull;": "",
"hyphen;": "",
"Iacute;": "Í",
"iacute;": "í",
"Igrave;": "Ì",
"igrave;": "ì",
"iiiint;": "⨌",
"iinfin;": "⧜",
"incare;": "℅",
"inodot;": "ı",
"intcal;": "⊺",
"iquest;": "¿",
"isinsv;": "⋳",
"Itilde;": "Ĩ",
"itilde;": "ĩ",
"Jsercy;": "Ј",
"jsercy;": "ј",
"kappav;": "ϰ",
"Kcedil;": "Ķ",
"kcedil;": "ķ",
"kgreen;": "ĸ",
"Lacute;": "Ĺ",
"lacute;": "ĺ",
"lagran;": "",
"Lambda;": "Λ",
"lambda;": "λ",
"langle;": "⟨",
"larrfs;": "⤝",
"larrhk;": "↩",
"larrlp;": "↫",
"larrpl;": "⤹",
"larrtl;": "↢",
"lAtail;": "⤛",
"latail;": "⤙",
"lbrace;": "{",
"lbrack;": "[",
"Lcaron;": "Ľ",
"lcaron;": "ľ",
"Lcedil;": "Ļ",
"lcedil;": "ļ",
"ldquor;": "„",
"lesdot;": "⩿",
"lesges;": "⪓",
"lfisht;": "⥼",
"lfloor;": "⌊",
"lharul;": "⥪",
"llhard;": "⥫",
"Lmidot;": "Ŀ",
"lmidot;": "ŀ",
"lmoust;": "⎰",
"loplus;": "⨭",
"lowast;": "",
"lowbar;": "_",
"lparlt;": "⦓",
"lrhard;": "⥭",
"lsaquo;": "",
"lsquor;": "",
"Lstrok;": "Ł",
"lstrok;": "ł",
"lthree;": "⋋",
"ltimes;": "⋉",
"ltlarr;": "⥶",
"ltrPar;": "⦖",
"mapsto;": "↦",
"marker;": "▮",
"mcomma;": "⨩",
"midast;": "*",
"midcir;": "⫰",
"middot;": "·",
"minusb;": "⊟",
"minusd;": "∸",
"mnplus;": "∓",
"models;": "⊧",
"mstpos;": "∾",
"Nacute;": "Ń",
"nacute;": "ń",
"nbumpe;": "≏̸",
"Ncaron;": "Ň",
"ncaron;": "ň",
"Ncedil;": "Ņ",
"ncedil;": "ņ",
"nearhk;": "⤤",
"nequiv;": "≢",
"nesear;": "⤨",
"nexist;": "∄",
"nltrie;": "⋬",
"notinE;": "⋹̸",
"nparsl;": "⫽⃥",
"nprcue;": "⋠",
"nrarrc;": "⤳̸",
"nrarrw;": "↝̸",
"nrtrie;": "⋭",
"nsccue;": "⋡",
"nsimeq;": "≄",
"Ntilde;": "Ñ",
"ntilde;": "ñ",
"numero;": "№",
"nVDash;": "⊯",
"nVdash;": "⊮",
"nvDash;": "⊭",
"nvdash;": "⊬",
"nvHarr;": "⤄",
"nvlArr;": "⤂",
"nvrArr;": "⤃",
"nwarhk;": "⤣",
"nwnear;": "⤧",
"Oacute;": "Ó",
"oacute;": "ó",
"Odblac;": "Ő",
"odblac;": "ő",
"odsold;": "⦼",
"Ograve;": "Ò",
"ograve;": "ò",
"ominus;": "⊖",
"origof;": "⊶",
"Oslash;": "Ø",
"oslash;": "ø",
"Otilde;": "Õ",
"otilde;": "õ",
"Otimes;": "⨷",
"otimes;": "⊗",
"parsim;": "⫳",
"percnt;": "%",
"period;": ".",
"permil;": "‰",
"phmmat;": "",
"planck;": "ℏ",
"plankv;": "ℏ",
"plusdo;": "∔",
"plusdu;": "⨥",
"plusmn;": "±",
"preceq;": "⪯",
"primes;": "",
"prnsim;": "⋨",
"propto;": "∝",
"prurel;": "⊰",
"puncsp;": "",
"qprime;": "⁗",
"Racute;": "Ŕ",
"racute;": "ŕ",
"rangle;": "⟩",
"rarrap;": "⥵",
"rarrfs;": "⤞",
"rarrhk;": "↪",
"rarrlp;": "↬",
"rarrpl;": "⥅",
"Rarrtl;": "⤖",
"rarrtl;": "↣",
"rAtail;": "⤜",
"ratail;": "⤚",
"rbrace;": "}",
"rbrack;": "]",
"Rcaron;": "Ř",
"rcaron;": "ř",
"Rcedil;": "Ŗ",
"rcedil;": "ŗ",
"rdquor;": "”",
"rfisht;": "⥽",
"rfloor;": "⌋",
"rharul;": "⥬",
"rmoust;": "⎱",
"roplus;": "⨮",
"rpargt;": "⦔",
"rsaquo;": "",
"rsquor;": "",
"rthree;": "⋌",
"rtimes;": "⋊",
"Sacute;": "Ś",
"sacute;": "ś",
"Scaron;": "Š",
"scaron;": "š",
"Scedil;": "Ş",
"scedil;": "ş",
"scnsim;": "⋩",
"searhk;": "⤥",
"seswar;": "⤩",
"sfrown;": "⌢",
"SHCHcy;": "Щ",
"shchcy;": "щ",
"sigmaf;": "ς",
"sigmav;": "ς",
"simdot;": "⩪",
"smashp;": "⨳",
"SOFTcy;": "Ь",
"softcy;": "ь",
"solbar;": "⌿",
"spades;": "♠",
"sqcaps;": "⊓︀",
"sqcups;": "⊔︀",
"sqsube;": "⊑",
"sqsupe;": "⊒",
"Square;": "□",
"square;": "□",
"squarf;": "▪",
"ssetmn;": "",
"ssmile;": "⌣",
"sstarf;": "⋆",
"subdot;": "⪽",
"Subset;": "⋐",
"subset;": "⊂",
"subsim;": "⫇",
"subsub;": "⫕",
"subsup;": "⫓",
"succeq;": "⪰",
"supdot;": "⪾",
"Supset;": "⋑",
"supset;": "⊃",
"supsim;": "⫈",
"supsub;": "⫔",
"supsup;": "⫖",
"swarhk;": "⤦",
"swnwar;": "⤪",
"target;": "⌖",
"Tcaron;": "Ť",
"tcaron;": "ť",
"Tcedil;": "Ţ",
"tcedil;": "ţ",
"telrec;": "⌕",
"there4;": "∴",
"thetav;": "ϑ",
"thinsp;": "",
"thksim;": "",
"timesb;": "⊠",
"timesd;": "⨰",
"topbot;": "⌶",
"topcir;": "⫱",
"tprime;": "‴",
"tridot;": "◬",
"Tstrok;": "Ŧ",
"tstrok;": "ŧ",
"Uacute;": "Ú",
"uacute;": "ú",
"Ubreve;": "Ŭ",
"ubreve;": "ŭ",
"Udblac;": "Ű",
"udblac;": "ű",
"ufisht;": "⥾",
"Ugrave;": "Ù",
"ugrave;": "ù",
"ulcorn;": "⌜",
"ulcrop;": "⌏",
"urcorn;": "⌝",
"urcrop;": "⌎",
"Utilde;": "Ũ",
"utilde;": "ũ",
"vangrt;": "⦜",
"varphi;": "ϕ",
"varrho;": "ϱ",
"Vdashl;": "⫦",
"veebar;": "⊻",
"vellip;": "⋮",
"Verbar;": "‖",
"verbar;": "|",
"vsubnE;": "⫋︀",
"vsubne;": "⊊︀",
"vsupnE;": "⫌︀",
"vsupne;": "⊋︀",
"Vvdash;": "⊪",
"wedbar;": "⩟",
"wedgeq;": "≙",
"weierp;": "℘",
"wreath;": "≀",
"xoplus;": "⨁",
"xotime;": "⨂",
"xsqcup;": "⨆",
"xuplus;": "⨄",
"xwedge;": "⋀",
"Yacute;": "Ý",
"yacute;": "ý",
"Zacute;": "Ź",
"zacute;": "ź",
"Zcaron;": "Ž",
"zcaron;": "ž",
"zeetrf;": "",
"alefsym;": "ℵ",
"angrtvb;": "⊾",
"angzarr;": "⍼",
"asympeq;": "≍",
"backsim;": "∽",
"Because;": "∵",
"because;": "∵",
"bemptyv;": "⦰",
"between;": "≬",
"bigcirc;": "◯",
"bigodot;": "⨀",
"bigstar;": "★",
"bnequiv;": "≡⃥",
"boxplus;": "⊞",
"Cayleys;": "",
"Cconint;": "∰",
"ccupssm;": "⩐",
"Cedilla;": "¸",
"cemptyv;": "⦲",
"cirscir;": "⧂",
"coloneq;": "≔",
"congdot;": "⩭",
"cudarrl;": "⤸",
"cudarrr;": "⤵",
"cularrp;": "⤽",
"curarrm;": "⤼",
"dbkarow;": "⤏",
"ddagger;": "‡",
"ddotseq;": "⩷",
"demptyv;": "⦱",
"Diamond;": "⋄",
"diamond;": "⋄",
"digamma;": "ϝ",
"dotplus;": "∔",
"DownTee;": "",
"dwangle;": "⦦",
"Element;": "∈",
"Epsilon;": "Ε",
"epsilon;": "ε",
"eqcolon;": "≕",
"equivDD;": "⩸",
"gesdoto;": "⪂",
"gtquest;": "⩼",
"gtrless;": "≷",
"harrcir;": "⥈",
"Implies;": "⇒",
"intprod;": "⨼",
"isindot;": "⋵",
"larrbfs;": "⤟",
"larrsim;": "⥳",
"lbrksld;": "⦏",
"lbrkslu;": "⦍",
"ldrdhar;": "⥧",
"LeftTee;": "⊣",
"lesdoto;": "⪁",
"lessdot;": "⋖",
"lessgtr;": "≶",
"lesssim;": "≲",
"lotimes;": "⨴",
"lozenge;": "◊",
"ltquest;": "⩻",
"luruhar;": "⥦",
"maltese;": "✠",
"minusdu;": "⨪",
"napprox;": "≉",
"natural;": "♮",
"nearrow;": "↗",
"NewLine;": "\n",
"nexists;": "∄",
"NoBreak;": "",
"notinva;": "∉",
"notinvb;": "⋷",
"notinvc;": "⋶",
"NotLess;": "≮",
"notniva;": "∌",
"notnivb;": "⋾",
"notnivc;": "⋽",
"npolint;": "⨔",
"npreceq;": "⪯̸",
"nsqsube;": "⋢",
"nsqsupe;": "⋣",
"nsubset;": "⊂⃒",
"nsucceq;": "⪰̸",
"nsupset;": "⊃⃒",
"nvinfin;": "⧞",
"nvltrie;": "⊴⃒",
"nvrtrie;": "⊵⃒",
"nwarrow;": "↖",
"olcross;": "⦻",
"Omicron;": "Ο",
"omicron;": "ο",
"orderof;": "",
"orslope;": "⩗",
"OverBar;": "‾",
"pertenk;": "‱",
"planckh;": "",
"pluscir;": "⨢",
"plussim;": "⨦",
"plustwo;": "⨧",
"precsim;": "≾",
"Product;": "∏",
"quatint;": "⨖",
"questeq;": "≟",
"rarrbfs;": "⤠",
"rarrsim;": "⥴",
"rbrksld;": "⦎",
"rbrkslu;": "⦐",
"rdldhar;": "⥩",
"realine;": "",
"rotimes;": "⨵",
"ruluhar;": "⥨",
"searrow;": "↘",
"simplus;": "⨤",
"simrarr;": "⥲",
"subedot;": "⫃",
"submult;": "⫁",
"subplus;": "⪿",
"subrarr;": "⥹",
"succsim;": "≿",
"supdsub;": "⫘",
"supedot;": "⫄",
"suphsol;": "⟉",
"suphsub;": "⫗",
"suplarr;": "⥻",
"supmult;": "⫂",
"supplus;": "⫀",
"swarrow;": "↙",
"topfork;": "⫚",
"triplus;": "⨹",
"tritime;": "⨻",
"UpArrow;": "↑",
"Uparrow;": "⇑",
"uparrow;": "↑",
"Upsilon;": "Υ",
"upsilon;": "υ",
"uwangle;": "⦧",
"vzigzag;": "⦚",
"zigrarr;": "⇝",
"andslope;": "⩘",
"angmsdaa;": "⦨",
"angmsdab;": "⦩",
"angmsdac;": "⦪",
"angmsdad;": "⦫",
"angmsdae;": "⦬",
"angmsdaf;": "⦭",
"angmsdag;": "⦮",
"angmsdah;": "⦯",
"angrtvbd;": "⦝",
"approxeq;": "≊",
"awconint;": "∳",
"backcong;": "≌",
"barwedge;": "⌅",
"bbrktbrk;": "⎶",
"bigoplus;": "⨁",
"bigsqcup;": "⨆",
"biguplus;": "⨄",
"bigwedge;": "⋀",
"boxminus;": "⊟",
"boxtimes;": "⊠",
"bsolhsub;": "⟈",
"capbrcup;": "⩉",
"circledR;": "®",
"circledS;": "Ⓢ",
"cirfnint;": "⨐",
"clubsuit;": "♣",
"cupbrcap;": "⩈",
"curlyvee;": "⋎",
"cwconint;": "∲",
"DDotrahd;": "⤑",
"doteqdot;": "≑",
"DotEqual;": "≐",
"dotminus;": "∸",
"drbkarow;": "⤐",
"dzigrarr;": "⟿",
"elinters;": "⏧",
"emptyset;": "∅",
"eqvparsl;": "⧥",
"fpartint;": "⨍",
"geqslant;": "⩾",
"gesdotol;": "⪄",
"gnapprox;": "⪊",
"hksearow;": "⤥",
"hkswarow;": "⤦",
"imagline;": "",
"imagpart;": "",
"infintie;": "⧝",
"integers;": "",
"Integral;": "∫",
"intercal;": "⊺",
"intlarhk;": "⨗",
"laemptyv;": "⦴",
"ldrushar;": "⥋",
"leqslant;": "⩽",
"lesdotor;": "⪃",
"LessLess;": "⪡",
"llcorner;": "⌞",
"lnapprox;": "⪉",
"lrcorner;": "⌟",
"lurdshar;": "⥊",
"mapstoup;": "↥",
"multimap;": "⊸",
"naturals;": "",
"ncongdot;": "⩭̸",
"NotEqual;": "≠",
"notindot;": "⋵̸",
"NotTilde;": "≁",
"otimesas;": "⨶",
"parallel;": "∥",
"PartialD;": "∂",
"plusacir;": "⨣",
"pointint;": "⨕",
"Precedes;": "≺",
"precneqq;": "⪵",
"precnsim;": "⋨",
"profalar;": "⌮",
"profline;": "⌒",
"profsurf;": "⌓",
"raemptyv;": "⦳",
"realpart;": "",
"RightTee;": "⊢",
"rppolint;": "⨒",
"rtriltri;": "⧎",
"scpolint;": "⨓",
"setminus;": "",
"shortmid;": "",
"smeparsl;": "⧤",
"sqsubset;": "⊏",
"sqsupset;": "⊐",
"subseteq;": "⊆",
"Succeeds;": "≻",
"succneqq;": "⪶",
"succnsim;": "⋩",
"SuchThat;": "∋",
"Superset;": "⊃",
"supseteq;": "⊇",
"thetasym;": "ϑ",
"thicksim;": "",
"timesbar;": "⨱",
"triangle;": "▵",
"triminus;": "⨺",
"trpezium;": "⏢",
"Uarrocir;": "⥉",
"ulcorner;": "⌜",
"UnderBar;": "_",
"urcorner;": "⌝",
"varkappa;": "ϰ",
"varsigma;": "ς",
"vartheta;": "ϑ",
"backprime;": "",
"backsimeq;": "⋍",
"Backslash;": "",
"bigotimes;": "⨂",
"CenterDot;": "·",
"centerdot;": "·",
"checkmark;": "✓",
"CircleDot;": "⊙",
"complexes;": "",
"Congruent;": "≡",
"Coproduct;": "∐",
"dotsquare;": "⊡",
"DoubleDot;": "¨",
"DownArrow;": "↓",
"Downarrow;": "⇓",
"downarrow;": "↓",
"DownBreve;": "̑",
"gtrapprox;": "⪆",
"gtreqless;": "⋛",
"gvertneqq;": "≩︀",
"heartsuit;": "♥",
"HumpEqual;": "≏",
"LeftArrow;": "←",
"Leftarrow;": "⇐",
"leftarrow;": "←",
"LeftFloor;": "⌊",
"lesseqgtr;": "⋚",
"LessTilde;": "≲",
"lvertneqq;": "≨︀",
"Mellintrf;": "",
"MinusPlus;": "∓",
"ngeqslant;": "⩾̸",
"nleqslant;": "⩽̸",
"NotCupCap;": "≭",
"NotExists;": "∄",
"NotSubset;": "⊂⃒",
"nparallel;": "∦",
"nshortmid;": "∤",
"nsubseteq;": "⊈",
"nsupseteq;": "⊉",
"OverBrace;": "⏞",
"pitchfork;": "⋔",
"PlusMinus;": "±",
"rationals;": "",
"spadesuit;": "♠",
"subseteqq;": "⫅",
"subsetneq;": "⊊",
"supseteqq;": "⫆",
"supsetneq;": "⊋",
"Therefore;": "∴",
"therefore;": "∴",
"ThinSpace;": "",
"triangleq;": "≜",
"TripleDot;": "⃛",
"UnionPlus;": "⊎",
"varpropto;": "∝",
"Bernoullis;": "",
"circledast;": "⊛",
"CirclePlus;": "⊕",
"complement;": "∁",
"curlywedge;": "⋏",
"eqslantgtr;": "⪖",
"EqualTilde;": "≂",
"Fouriertrf;": "",
"gtreqqless;": "⪌",
"ImaginaryI;": "",
"Laplacetrf;": "",
"LeftVector;": "↼",
"lessapprox;": "⪅",
"lesseqqgtr;": "⪋",
"Lleftarrow;": "⇚",
"lmoustache;": "⎰",
"longmapsto;": "⟼",
"mapstodown;": "↧",
"mapstoleft;": "↤",
"nLeftarrow;": "⇍",
"nleftarrow;": "↚",
"NotElement;": "∉",
"NotGreater;": "≯",
"nsubseteqq;": "⫅̸",
"nsupseteqq;": "⫆̸",
"precapprox;": "⪷",
"Proportion;": "∷",
"RightArrow;": "→",
"Rightarrow;": "⇒",
"rightarrow;": "→",
"RightFloor;": "⌋",
"rmoustache;": "⎱",
"sqsubseteq;": "⊑",
"sqsupseteq;": "⊒",
"subsetneqq;": "⫋",
"succapprox;": "⪸",
"supsetneqq;": "⫌",
"ThickSpace;": "",
"TildeEqual;": "≃",
"TildeTilde;": "≈",
"UnderBrace;": "⏟",
"UpArrowBar;": "⤒",
"UpTeeArrow;": "↥",
"upuparrows;": "⇈",
"varepsilon;": "ϵ",
"varnothing;": "∅",
"backepsilon;": "϶",
"blacksquare;": "▪",
"circledcirc;": "⊚",
"circleddash;": "⊝",
"CircleMinus;": "⊖",
"CircleTimes;": "⊗",
"curlyeqprec;": "⋞",
"curlyeqsucc;": "⋟",
"diamondsuit;": "♦",
"eqslantless;": "⪕",
"Equilibrium;": "⇌",
"expectation;": "",
"GreaterLess;": "≷",
"LeftCeiling;": "⌈",
"LessGreater;": "≶",
"MediumSpace;": "",
"NotLessLess;": "≪̸",
"NotPrecedes;": "⊀",
"NotSucceeds;": "⊁",
"NotSuperset;": "⊃⃒",
"nRightarrow;": "⇏",
"nrightarrow;": "↛",
"OverBracket;": "⎴",
"preccurlyeq;": "≼",
"precnapprox;": "⪹",
"quaternions;": "",
"RightVector;": "⇀",
"Rrightarrow;": "⇛",
"RuleDelayed;": "⧴",
"SmallCircle;": "∘",
"SquareUnion;": "⊔",
"straightphi;": "ϕ",
"SubsetEqual;": "⊆",
"succcurlyeq;": "≽",
"succnapprox;": "⪺",
"thickapprox;": "≈",
"UpDownArrow;": "↕",
"Updownarrow;": "⇕",
"updownarrow;": "↕",
"VerticalBar;": "",
"blacklozenge;": "⧫",
"DownArrowBar;": "⤓",
"DownTeeArrow;": "↧",
"ExponentialE;": "",
"exponentiale;": "",
"GreaterEqual;": "≥",
"GreaterTilde;": "≳",
"HilbertSpace;": "",
"HumpDownHump;": "≎",
"Intersection;": "⋂",
"LeftArrowBar;": "⇤",
"LeftTeeArrow;": "↤",
"LeftTriangle;": "⊲",
"LeftUpVector;": "↿",
"NotCongruent;": "≢",
"NotHumpEqual;": "≏̸",
"NotLessEqual;": "≰",
"NotLessTilde;": "≴",
"Proportional;": "∝",
"RightCeiling;": "⌉",
"risingdotseq;": "≓",
"RoundImplies;": "⥰",
"ShortUpArrow;": "↑",
"SquareSubset;": "⊏",
"triangledown;": "▿",
"triangleleft;": "◃",
"UnderBracket;": "⎵",
"varsubsetneq;": "⊊︀",
"varsupsetneq;": "⊋︀",
"VerticalLine;": "|",
"ApplyFunction;": "",
"bigtriangleup;": "△",
"blacktriangle;": "▴",
"DifferentialD;": "",
"divideontimes;": "⋇",
"DoubleLeftTee;": "⫤",
"DoubleUpArrow;": "⇑",
"fallingdotseq;": "≒",
"hookleftarrow;": "↩",
"leftarrowtail;": "↢",
"leftharpoonup;": "↼",
"LeftTeeVector;": "⥚",
"LeftVectorBar;": "⥒",
"LessFullEqual;": "≦",
"LongLeftArrow;": "⟵",
"Longleftarrow;": "⟸",
"longleftarrow;": "⟵",
"looparrowleft;": "↫",
"measuredangle;": "∡",
"NotEqualTilde;": "≂̸",
"NotTildeEqual;": "≄",
"NotTildeTilde;": "≉",
"ntriangleleft;": "⋪",
"Poincareplane;": "",
"PrecedesEqual;": "⪯",
"PrecedesTilde;": "≾",
"RightArrowBar;": "⇥",
"RightTeeArrow;": "↦",
"RightTriangle;": "⊳",
"RightUpVector;": "↾",
"shortparallel;": "∥",
"smallsetminus;": "",
"SucceedsEqual;": "⪰",
"SucceedsTilde;": "≿",
"SupersetEqual;": "⊇",
"triangleright;": "▹",
"UpEquilibrium;": "⥮",
"upharpoonleft;": "↿",
"varsubsetneqq;": "⫋︀",
"varsupsetneqq;": "⫌︀",
"VerticalTilde;": "≀",
"VeryThinSpace;": "",
"curvearrowleft;": "↶",
"DiacriticalDot;": "˙",
"doublebarwedge;": "⌆",
"DoubleRightTee;": "⊨",
"downdownarrows;": "⇊",
"DownLeftVector;": "↽",
"GreaterGreater;": "⪢",
"hookrightarrow;": "↪",
"HorizontalLine;": "─",
"InvisibleComma;": "",
"InvisibleTimes;": "",
"LeftDownVector;": "⇃",
"leftleftarrows;": "⇇",
"LeftRightArrow;": "↔",
"Leftrightarrow;": "⇔",
"leftrightarrow;": "↔",
"leftthreetimes;": "⋋",
"LessSlantEqual;": "⩽",
"LongRightArrow;": "⟶",
"Longrightarrow;": "⟹",
"longrightarrow;": "⟶",
"looparrowright;": "↬",
"LowerLeftArrow;": "↙",
"NestedLessLess;": "≪",
"NotGreaterLess;": "≹",
"NotLessGreater;": "≸",
"NotSubsetEqual;": "⊈",
"NotVerticalBar;": "∤",
"nshortparallel;": "∦",
"ntriangleright;": "⋫",
"OpenCurlyQuote;": "",
"ReverseElement;": "∋",
"rightarrowtail;": "↣",
"rightharpoonup;": "⇀",
"RightTeeVector;": "⥛",
"RightVectorBar;": "⥓",
"ShortDownArrow;": "↓",
"ShortLeftArrow;": "←",
"SquareSuperset;": "⊐",
"TildeFullEqual;": "≅",
"trianglelefteq;": "⊴",
"upharpoonright;": "↾",
"UpperLeftArrow;": "↖",
"ZeroWidthSpace;": "",
"bigtriangledown;": "▽",
"circlearrowleft;": "↺",
"CloseCurlyQuote;": "",
"ContourIntegral;": "∮",
"curvearrowright;": "↷",
"DoubleDownArrow;": "⇓",
"DoubleLeftArrow;": "⇐",
"downharpoonleft;": "⇃",
"DownRightVector;": "⇁",
"leftharpoondown;": "↽",
"leftrightarrows;": "⇆",
"LeftRightVector;": "⥎",
"LeftTriangleBar;": "⧏",
"LeftUpTeeVector;": "⥠",
"LeftUpVectorBar;": "⥘",
"LowerRightArrow;": "↘",
"nLeftrightarrow;": "⇎",
"nleftrightarrow;": "↮",
"NotGreaterEqual;": "≱",
"NotGreaterTilde;": "≵",
"NotHumpDownHump;": "≎̸",
"NotLeftTriangle;": "⋪",
"NotSquareSubset;": "⊏̸",
"ntrianglelefteq;": "⋬",
"OverParenthesis;": "⏜",
"RightDownVector;": "⇂",
"rightleftarrows;": "⇄",
"rightsquigarrow;": "↝",
"rightthreetimes;": "⋌",
"ShortRightArrow;": "→",
"straightepsilon;": "ϵ",
"trianglerighteq;": "⊵",
"UpperRightArrow;": "↗",
"vartriangleleft;": "⊲",
"circlearrowright;": "↻",
"DiacriticalAcute;": "´",
"DiacriticalGrave;": "`",
"DiacriticalTilde;": "˜",
"DoubleRightArrow;": "⇒",
"DownArrowUpArrow;": "⇵",
"downharpoonright;": "⇂",
"EmptySmallSquare;": "◻",
"GreaterEqualLess;": "⋛",
"GreaterFullEqual;": "≧",
"LeftAngleBracket;": "⟨",
"LeftUpDownVector;": "⥑",
"LessEqualGreater;": "⋚",
"NonBreakingSpace;": " ",
"NotPrecedesEqual;": "⪯̸",
"NotRightTriangle;": "⋫",
"NotSucceedsEqual;": "⪰̸",
"NotSucceedsTilde;": "≿̸",
"NotSupersetEqual;": "⊉",
"ntrianglerighteq;": "⋭",
"rightharpoondown;": "⇁",
"rightrightarrows;": "⇉",
"RightTriangleBar;": "⧐",
"RightUpTeeVector;": "⥜",
"RightUpVectorBar;": "⥔",
"twoheadleftarrow;": "↞",
"UnderParenthesis;": "⏝",
"UpArrowDownArrow;": "⇅",
"vartriangleright;": "⊳",
"blacktriangledown;": "▾",
"blacktriangleleft;": "◂",
"DoubleUpDownArrow;": "⇕",
"DoubleVerticalBar;": "∥",
"DownLeftTeeVector;": "⥞",
"DownLeftVectorBar;": "⥖",
"FilledSmallSquare;": "◼",
"GreaterSlantEqual;": "⩾",
"LeftDoubleBracket;": "⟦",
"LeftDownTeeVector;": "⥡",
"LeftDownVectorBar;": "⥙",
"leftrightharpoons;": "⇋",
"LeftTriangleEqual;": "⊴",
"NegativeThinSpace;": "",
"NotGreaterGreater;": "≫̸",
"NotLessSlantEqual;": "⩽̸",
"NotNestedLessLess;": "⪡̸",
"NotReverseElement;": "∌",
"NotSquareSuperset;": "⊐̸",
"NotTildeFullEqual;": "≇",
"RightAngleBracket;": "⟩",
"rightleftharpoons;": "⇌",
"RightUpDownVector;": "⥏",
"SquareSubsetEqual;": "⊑",
"twoheadrightarrow;": "↠",
"VerticalSeparator;": "❘",
"blacktriangleright;": "▸",
"DownRightTeeVector;": "⥟",
"DownRightVectorBar;": "⥗",
"LongLeftRightArrow;": "⟷",
"Longleftrightarrow;": "⟺",
"longleftrightarrow;": "⟷",
"NegativeThickSpace;": "",
"NotLeftTriangleBar;": "⧏̸",
"PrecedesSlantEqual;": "≼",
"ReverseEquilibrium;": "⇋",
"RightDoubleBracket;": "⟧",
"RightDownTeeVector;": "⥝",
"RightDownVectorBar;": "⥕",
"RightTriangleEqual;": "⊵",
"SquareIntersection;": "⊓",
"SucceedsSlantEqual;": "≽",
"DoubleLongLeftArrow;": "⟸",
"DownLeftRightVector;": "⥐",
"LeftArrowRightArrow;": "⇆",
"leftrightsquigarrow;": "↭",
"NegativeMediumSpace;": "",
"NotGreaterFullEqual;": "≧̸",
"NotRightTriangleBar;": "⧐̸",
"RightArrowLeftArrow;": "⇄",
"SquareSupersetEqual;": "⊒",
"CapitalDifferentialD;": "",
"DoubleLeftRightArrow;": "⇔",
"DoubleLongRightArrow;": "⟹",
"EmptyVerySmallSquare;": "▫",
"NestedGreaterGreater;": "≫",
"NotDoubleVerticalBar;": "∦",
"NotGreaterSlantEqual;": "⩾̸",
"NotLeftTriangleEqual;": "⋬",
"NotSquareSubsetEqual;": "⋢",
"OpenCurlyDoubleQuote;": "“",
"ReverseUpEquilibrium;": "⥯",
"CloseCurlyDoubleQuote;": "”",
"DoubleContourIntegral;": "∯",
"FilledVerySmallSquare;": "▪",
"NegativeVeryThinSpace;": "",
"NotPrecedesSlantEqual;": "⋠",
"NotRightTriangleEqual;": "⋭",
"NotSucceedsSlantEqual;": "⋡",
"DiacriticalDoubleAcute;": "˝",
"NotSquareSupersetEqual;": "⋣",
"NotNestedGreaterGreater;": "⪢̸",
"ClockwiseContourIntegral;": "∲",
"DoubleLongLeftRightArrow;": "⟺",
"CounterClockwiseContourIntegral;": "∳"
};
// lazy compute this to make this file tree-shakable for browser
let maxCRNameLength;
const decodeHtml = (rawText, asAttr) => {
let offset = 0;
const end = rawText.length;
let decodedText = '';
function advance(length) {
offset += length;
rawText = rawText.slice(length);
}
while (offset < end) {
const head = /&(?:#x?)?/i.exec(rawText);
if (!head || offset + head.index >= end) {
const remaining = end - offset;
decodedText += rawText.slice(0, remaining);
advance(remaining);
break;
}
// Advance to the "&".
decodedText += rawText.slice(0, head.index);
advance(head.index);
if (head[0] === '&') {
// Named character reference.
let name = '';
let value = undefined;
if (/[0-9a-z]/i.test(rawText[1])) {
if (!maxCRNameLength) {
maxCRNameLength = Object.keys(namedCharacterReferences).reduce((max, name) => Math.max(max, name.length), 0);
}
for (let length = maxCRNameLength; !value && length > 0; --length) {
name = rawText.substr(1, length);
value = namedCharacterReferences[name];
}
if (value) {
const semi = name.endsWith(';');
if (asAttr &&
!semi &&
/[=a-z0-9]/i.test(rawText[name.length + 1] || '')) {
decodedText += '&' + name;
advance(1 + name.length);
}
else {
decodedText += value;
advance(1 + name.length);
}
}
else {
decodedText += '&' + name;
advance(1 + name.length);
}
}
else {
decodedText += '&';
advance(1);
}
}
else {
// Numeric character reference.
const hex = head[0] === '&#x';
const pattern = hex ? /^&#x([0-9a-f]+);?/i : /^&#([0-9]+);?/;
const body = pattern.exec(rawText);
if (!body) {
decodedText += head[0];
advance(head[0].length);
}
else {
// https://html.spec.whatwg.org/multipage/parsing.html#numeric-character-reference-end-state
let cp = Number.parseInt(body[1], hex ? 16 : 10);
if (cp === 0) {
cp = 0xfffd;
}
else if (cp > 0x10ffff) {
cp = 0xfffd;
}
else if (cp >= 0xd800 && cp <= 0xdfff) {
cp = 0xfffd;
}
else if ((cp >= 0xfdd0 && cp <= 0xfdef) || (cp & 0xfffe) === 0xfffe) ;
else if ((cp >= 0x01 && cp <= 0x08) ||
cp === 0x0b ||
(cp >= 0x0d && cp <= 0x1f) ||
(cp >= 0x7f && cp <= 0x9f)) {
cp = CCR_REPLACEMENTS[cp] || cp;
}
decodedText += String.fromCodePoint(cp);
advance(body[0].length);
}
}
}
return decodedText;
};
// https://html.spec.whatwg.org/multipage/parsing.html#numeric-character-reference-end-state
const CCR_REPLACEMENTS = {
0x80: 0x20ac,
0x82: 0x201a,
0x83: 0x0192,
0x84: 0x201e,
0x85: 0x2026,
0x86: 0x2020,
0x87: 0x2021,
0x88: 0x02c6,
0x89: 0x2030,
0x8a: 0x0160,
0x8b: 0x2039,
0x8c: 0x0152,
0x8e: 0x017d,
0x91: 0x2018,
0x92: 0x2019,
0x93: 0x201c,
0x94: 0x201d,
0x95: 0x2022,
0x96: 0x2013,
0x97: 0x2014,
0x98: 0x02dc,
0x99: 0x2122,
0x9a: 0x0161,
0x9b: 0x203a,
0x9c: 0x0153,
0x9e: 0x017e,
0x9f: 0x0178
};
const isRawTextContainer = /*#__PURE__*/ shared.makeMap('style,iframe,script,noscript', true);
const parserOptions = {
isVoidTag: shared.isVoidTag,
isNativeTag: tag => shared.isHTMLTag(tag) || shared.isSVGTag(tag),
isPreTag: tag => tag === 'pre',
decodeEntities: decodeHtml,
isBuiltInComponent: (tag) => {
if (compilerCore.isBuiltInType(tag, `Transition`)) {
return TRANSITION;
}
else if (compilerCore.isBuiltInType(tag, `TransitionGroup`)) {
return TRANSITION_GROUP;
}
},
// https://html.spec.whatwg.org/multipage/parsing.html#tree-construction-dispatcher
getNamespace(tag, parent) {
let ns = parent ? parent.ns : 0 /* HTML */;
if (parent && ns === 2 /* MATH_ML */) {
if (parent.tag === 'annotation-xml') {
if (tag === 'svg') {
return 1 /* SVG */;
}
if (parent.props.some(a => a.type === 6 /* ATTRIBUTE */ &&
a.name === 'encoding' &&
a.value != null &&
(a.value.content === 'text/html' ||
a.value.content === 'application/xhtml+xml'))) {
ns = 0 /* HTML */;
}
}
else if (/^m(?:[ions]|text)$/.test(parent.tag) &&
tag !== 'mglyph' &&
tag !== 'malignmark') {
ns = 0 /* HTML */;
}
}
else if (parent && ns === 1 /* SVG */) {
if (parent.tag === 'foreignObject' ||
parent.tag === 'desc' ||
parent.tag === 'title') {
ns = 0 /* HTML */;
}
}
if (ns === 0 /* HTML */) {
if (tag === 'svg') {
return 1 /* SVG */;
}
if (tag === 'math') {
return 2 /* MATH_ML */;
}
}
return ns;
},
// https://html.spec.whatwg.org/multipage/parsing.html#parsing-html-fragments
getTextMode({ tag, ns }) {
if (ns === 0 /* HTML */) {
if (tag === 'textarea' || tag === 'title') {
return 1 /* RCDATA */;
}
if (isRawTextContainer(tag)) {
return 2 /* RAWTEXT */;
}
}
return 0 /* DATA */;
}
};
// Parse inline CSS strings for static style attributes into an object.
// This is a NodeTransform since it works on the static `style` attribute and
// converts it into a dynamic equivalent:
// style="color: red" -> :style='{ "color": "red" }'
// It is then processed by `transformElement` and included in the generated
// props.
const transformStyle = node => {
if (node.type === 1 /* ELEMENT */) {
node.props.forEach((p, i) => {
if (p.type === 6 /* ATTRIBUTE */ && p.name === 'style' && p.value) {
// replace p with an expression node
node.props[i] = {
type: 7 /* DIRECTIVE */,
name: `bind`,
arg: compilerCore.createSimpleExpression(`style`, true, p.loc),
exp: parseInlineCSS(p.value.content, p.loc),
modifiers: [],
loc: p.loc
};
}
});
}
};
const parseInlineCSS = (cssText, loc) => {
const normalized = shared.parseStringStyle(cssText);
return compilerCore.createSimpleExpression(JSON.stringify(normalized), false, loc, 3 /* CAN_STRINGIFY */);
};
function createDOMCompilerError(code, loc) {
return compilerCore.createCompilerError(code, loc, DOMErrorMessages );
}
const DOMErrorMessages = {
[49 /* X_V_HTML_NO_EXPRESSION */]: `v-html is missing expression.`,
[50 /* X_V_HTML_WITH_CHILDREN */]: `v-html will override element children.`,
[51 /* X_V_TEXT_NO_EXPRESSION */]: `v-text is missing expression.`,
[52 /* X_V_TEXT_WITH_CHILDREN */]: `v-text will override element children.`,
[53 /* X_V_MODEL_ON_INVALID_ELEMENT */]: `v-model can only be used on <input>, <textarea> and <select> elements.`,
[54 /* X_V_MODEL_ARG_ON_ELEMENT */]: `v-model argument is not supported on plain elements.`,
[55 /* X_V_MODEL_ON_FILE_INPUT_ELEMENT */]: `v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.`,
[56 /* X_V_MODEL_UNNECESSARY_VALUE */]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`,
[57 /* X_V_SHOW_NO_EXPRESSION */]: `v-show is missing expression.`,
[58 /* X_TRANSITION_INVALID_CHILDREN */]: `<Transition> expects exactly one child element or component.`,
[59 /* X_IGNORED_SIDE_EFFECT_TAG */]: `Tags with side effect (<script> and <style>) are ignored in client component templates.`
};
const transformVHtml = (dir, node, context) => {
const { exp, loc } = dir;
if (!exp) {
context.onError(createDOMCompilerError(49 /* X_V_HTML_NO_EXPRESSION */, loc));
}
if (node.children.length) {
context.onError(createDOMCompilerError(50 /* X_V_HTML_WITH_CHILDREN */, loc));
node.children.length = 0;
}
return {
props: [
compilerCore.createObjectProperty(compilerCore.createSimpleExpression(`innerHTML`, true, loc), exp || compilerCore.createSimpleExpression('', true))
]
};
};
const transformVText = (dir, node, context) => {
const { exp, loc } = dir;
if (!exp) {
context.onError(createDOMCompilerError(51 /* X_V_TEXT_NO_EXPRESSION */, loc));
}
if (node.children.length) {
context.onError(createDOMCompilerError(52 /* X_V_TEXT_WITH_CHILDREN */, loc));
node.children.length = 0;
}
return {
props: [
compilerCore.createObjectProperty(compilerCore.createSimpleExpression(`textContent`, true), exp
? compilerCore.createCallExpression(context.helperString(compilerCore.TO_DISPLAY_STRING), [exp], loc)
: compilerCore.createSimpleExpression('', true))
]
};
};
const transformModel = (dir, node, context) => {
const baseResult = compilerCore.transformModel(dir, node, context);
// base transform has errors OR component v-model (only need props)
if (!baseResult.props.length || node.tagType === 1 /* COMPONENT */) {
return baseResult;
}
if (dir.arg) {
context.onError(createDOMCompilerError(54 /* X_V_MODEL_ARG_ON_ELEMENT */, dir.arg.loc));
}
function checkDuplicatedValue() {
const value = compilerCore.findProp(node, 'value');
if (value) {
context.onError(createDOMCompilerError(56 /* X_V_MODEL_UNNECESSARY_VALUE */, value.loc));
}
}
const { tag } = node;
const isCustomElement = context.isCustomElement(tag);
if (tag === 'input' ||
tag === 'textarea' ||
tag === 'select' ||
isCustomElement) {
let directiveToUse = V_MODEL_TEXT;
let isInvalidType = false;
if (tag === 'input' || isCustomElement) {
const type = compilerCore.findProp(node, `type`);
if (type) {
if (type.type === 7 /* DIRECTIVE */) {
// :type="foo"
directiveToUse = V_MODEL_DYNAMIC;
}
else if (type.value) {
switch (type.value.content) {
case 'radio':
directiveToUse = V_MODEL_RADIO;
break;
case 'checkbox':
directiveToUse = V_MODEL_CHECKBOX;
break;
case 'file':
isInvalidType = true;
context.onError(createDOMCompilerError(55 /* X_V_MODEL_ON_FILE_INPUT_ELEMENT */, dir.loc));
break;
default:
// text type
checkDuplicatedValue();
break;
}
}
}
else if (compilerCore.hasDynamicKeyVBind(node)) {
// element has bindings with dynamic keys, which can possibly contain
// "type".
directiveToUse = V_MODEL_DYNAMIC;
}
else {
// text type
checkDuplicatedValue();
}
}
else if (tag === 'select') {
directiveToUse = V_MODEL_SELECT;
}
else {
// textarea
checkDuplicatedValue();
}
// inject runtime directive
// by returning the helper symbol via needRuntime
// the import will replaced a resolveDirective call.
if (!isInvalidType) {
baseResult.needRuntime = context.helper(directiveToUse);
}
}
else {
context.onError(createDOMCompilerError(53 /* X_V_MODEL_ON_INVALID_ELEMENT */, dir.loc));
}
// native vmodel doesn't need the `modelValue` props since they are also
// passed to the runtime as `binding.value`. removing it reduces code size.
baseResult.props = baseResult.props.filter(p => !(p.key.type === 4 /* SIMPLE_EXPRESSION */ &&
p.key.content === 'modelValue'));
return baseResult;
};
const isEventOptionModifier = /*#__PURE__*/ shared.makeMap(`passive,once,capture`);
const isNonKeyModifier = /*#__PURE__*/ shared.makeMap(
// event propagation management
`stop,prevent,self,` +
// system modifiers + exact
`ctrl,shift,alt,meta,exact,` +
// mouse
`middle`);
// left & right could be mouse or key modifiers based on event type
const maybeKeyModifier = /*#__PURE__*/ shared.makeMap('left,right');
const isKeyboardEvent = /*#__PURE__*/ shared.makeMap(`onkeyup,onkeydown,onkeypress`, true);
const resolveModifiers = (key, modifiers, context, loc) => {
const keyModifiers = [];
const nonKeyModifiers = [];
const eventOptionModifiers = [];
for (let i = 0; i < modifiers.length; i++) {
const modifier = modifiers[i];
if (modifier === 'native' &&
compilerCore.checkCompatEnabled("COMPILER_V_ON_NATIVE" /* COMPILER_V_ON_NATIVE */, context, loc)) {
eventOptionModifiers.push(modifier);
}
else if (isEventOptionModifier(modifier)) {
// eventOptionModifiers: modifiers for addEventListener() options,
// e.g. .passive & .capture
eventOptionModifiers.push(modifier);
}
else {
// runtimeModifiers: modifiers that needs runtime guards
if (maybeKeyModifier(modifier)) {
if (compilerCore.isStaticExp(key)) {
if (isKeyboardEvent(key.content)) {
keyModifiers.push(modifier);
}
else {
nonKeyModifiers.push(modifier);
}
}
else {
keyModifiers.push(modifier);
nonKeyModifiers.push(modifier);
}
}
else {
if (isNonKeyModifier(modifier)) {
nonKeyModifiers.push(modifier);
}
else {
keyModifiers.push(modifier);
}
}
}
}
return {
keyModifiers,
nonKeyModifiers,
eventOptionModifiers
};
};
const transformClick = (key, event) => {
const isStaticClick = compilerCore.isStaticExp(key) && key.content.toLowerCase() === 'onclick';
return isStaticClick
? compilerCore.createSimpleExpression(event, true)
: key.type !== 4 /* SIMPLE_EXPRESSION */
? compilerCore.createCompoundExpression([
`(`,
key,
`) === "onClick" ? "${event}" : (`,
key,
`)`
])
: key;
};
const transformOn = (dir, node, context) => {
return compilerCore.transformOn(dir, node, context, baseResult => {
const { modifiers } = dir;
if (!modifiers.length)
return baseResult;
let { key, value: handlerExp } = baseResult.props[0];
const { keyModifiers, nonKeyModifiers, eventOptionModifiers } = resolveModifiers(key, modifiers, context, dir.loc);
// normalize click.right and click.middle since they don't actually fire
if (nonKeyModifiers.includes('right')) {
key = transformClick(key, `onContextmenu`);
}
if (nonKeyModifiers.includes('middle')) {
key = transformClick(key, `onMouseup`);
}
if (nonKeyModifiers.length) {
handlerExp = compilerCore.createCallExpression(context.helper(V_ON_WITH_MODIFIERS), [
handlerExp,
JSON.stringify(nonKeyModifiers)
]);
}
if (keyModifiers.length &&
// if event name is dynamic, always wrap with keys guard
(!compilerCore.isStaticExp(key) || isKeyboardEvent(key.content))) {
handlerExp = compilerCore.createCallExpression(context.helper(V_ON_WITH_KEYS), [
handlerExp,
JSON.stringify(keyModifiers)
]);
}
if (eventOptionModifiers.length) {
const modifierPostfix = eventOptionModifiers.map(shared.capitalize).join('');
key = compilerCore.isStaticExp(key)
? compilerCore.createSimpleExpression(`${key.content}${modifierPostfix}`, true)
: compilerCore.createCompoundExpression([`(`, key, `) + "${modifierPostfix}"`]);
}
return {
props: [compilerCore.createObjectProperty(key, handlerExp)]
};
});
};
const transformShow = (dir, node, context) => {
const { exp, loc } = dir;
if (!exp) {
context.onError(createDOMCompilerError(57 /* X_V_SHOW_NO_EXPRESSION */, loc));
}
return {
props: [],
needRuntime: context.helper(V_SHOW)
};
};
const warnTransitionChildren = (node, context) => {
if (node.type === 1 /* ELEMENT */ &&
node.tagType === 1 /* COMPONENT */) {
const component = context.isBuiltInComponent(node.tag);
if (component === TRANSITION) {
return () => {
if (node.children.length && hasMultipleChildren(node)) {
context.onError(createDOMCompilerError(58 /* X_TRANSITION_INVALID_CHILDREN */, {
start: node.children[0].loc.start,
end: node.children[node.children.length - 1].loc.end,
source: ''
}));
}
};
}
}
};
function hasMultipleChildren(node) {
// #1352 filter out potential comment nodes.
const children = (node.children = node.children.filter(c => c.type !== 3 /* COMMENT */));
const child = children[0];
return (children.length !== 1 ||
child.type === 11 /* FOR */ ||
(child.type === 9 /* IF */ && child.branches.some(hasMultipleChildren)));
}
/**
* This module is Node-only.
*/
/**
* Turn eligible hoisted static trees into stringified static nodes, e.g.
*
* ```js
* const _hoisted_1 = createStaticVNode(`<div class="foo">bar</div>`)
* ```
*
* A single static vnode can contain stringified content for **multiple**
* consecutive nodes (element and plain text), called a "chunk".
* `@vue/runtime-dom` will create the content via innerHTML in a hidden
* container element and insert all the nodes in place. The call must also
* provide the number of nodes contained in the chunk so that during hydration
* we can know how many nodes the static vnode should adopt.
*
* The optimization scans a children list that contains hoisted nodes, and
* tries to find the largest chunk of consecutive hoisted nodes before running
* into a non-hoisted node or the end of the list. A chunk is then converted
* into a single static vnode and replaces the hoisted expression of the first
* node in the chunk. Other nodes in the chunk are considered "merged" and
* therefore removed from both the hoist list and the children array.
*
* This optimization is only performed in Node.js.
*/
const stringifyStatic = (children, context, parent) => {
// bail stringification for slot content
if (context.scopes.vSlot > 0) {
return;
}
let nc = 0; // current node count
let ec = 0; // current element with binding count
const currentChunk = [];
const stringifyCurrentChunk = (currentIndex) => {
if (nc >= 20 /* NODE_COUNT */ ||
ec >= 5 /* ELEMENT_WITH_BINDING_COUNT */) {
// combine all currently eligible nodes into a single static vnode call
const staticCall = compilerCore.createCallExpression(context.helper(compilerCore.CREATE_STATIC), [
JSON.stringify(currentChunk.map(node => stringifyNode(node, context)).join('')),
// the 2nd argument indicates the number of DOM nodes this static vnode
// will insert / hydrate
String(currentChunk.length)
]);
// replace the first node's hoisted expression with the static vnode call
replaceHoist(currentChunk[0], staticCall, context);
if (currentChunk.length > 1) {
for (let i = 1; i < currentChunk.length; i++) {
// for the merged nodes, set their hoisted expression to null
replaceHoist(currentChunk[i], null, context);
}
// also remove merged nodes from children
const deleteCount = currentChunk.length - 1;
children.splice(currentIndex - currentChunk.length + 1, deleteCount);
return deleteCount;
}
}
return 0;
};
let i = 0;
for (; i < children.length; i++) {
const child = children[i];
const hoisted = getHoistedNode(child);
if (hoisted) {
// presence of hoisted means child must be a stringifiable node
const node = child;
const result = analyzeNode(node);
if (result) {
// node is stringifiable, record state
nc += result[0];
ec += result[1];
currentChunk.push(node);
continue;
}
}
// we only reach here if we ran into a node that is not stringifiable
// check if currently analyzed nodes meet criteria for stringification.
// adjust iteration index
i -= stringifyCurrentChunk(i);
// reset state
nc = 0;
ec = 0;
currentChunk.length = 0;
}
// in case the last node was also stringifiable
stringifyCurrentChunk(i);
};
const getHoistedNode = (node) => ((node.type === 1 /* ELEMENT */ && node.tagType === 0 /* ELEMENT */) ||
node.type == 12 /* TEXT_CALL */) &&
node.codegenNode &&
node.codegenNode.type === 4 /* SIMPLE_EXPRESSION */ &&
node.codegenNode.hoisted;
const dataAriaRE = /^(data|aria)-/;
const isStringifiableAttr = (name, ns) => {
return ((ns === 0 /* HTML */
? shared.isKnownHtmlAttr(name)
: ns === 1 /* SVG */
? shared.isKnownSvgAttr(name)
: false) || dataAriaRE.test(name));
};
const replaceHoist = (node, replacement, context) => {
const hoistToReplace = node.codegenNode.hoisted;
context.hoists[context.hoists.indexOf(hoistToReplace)] = replacement;
};
const isNonStringifiable = /*#__PURE__*/ shared.makeMap(`caption,thead,tr,th,tbody,td,tfoot,colgroup,col`);
/**
* for a hoisted node, analyze it and return:
* - false: bailed (contains runtime constant)
* - [nc, ec] where
* - nc is the number of nodes inside
* - ec is the number of element with bindings inside
*/
function analyzeNode(node) {
if (node.type === 1 /* ELEMENT */ && isNonStringifiable(node.tag)) {
return false;
}
if (node.type === 12 /* TEXT_CALL */) {
return [1, 0];
}
let nc = 1; // node count
let ec = node.props.length > 0 ? 1 : 0; // element w/ binding count
let bailed = false;
const bail = () => {
bailed = true;
return false;
};
// TODO: check for cases where using innerHTML will result in different
// output compared to imperative node insertions.
// probably only need to check for most common case
// i.e. non-phrasing-content tags inside `<p>`
function walk(node) {
for (let i = 0; i < node.props.length; i++) {
const p = node.props[i];
// bail on non-attr bindings
if (p.type === 6 /* ATTRIBUTE */ &&
!isStringifiableAttr(p.name, node.ns)) {
return bail();
}
if (p.type === 7 /* DIRECTIVE */ && p.name === 'bind') {
// bail on non-attr bindings
if (p.arg &&
(p.arg.type === 8 /* COMPOUND_EXPRESSION */ ||
(p.arg.isStatic && !isStringifiableAttr(p.arg.content, node.ns)))) {
return bail();
}
}
}
for (let i = 0; i < node.children.length; i++) {
nc++;
const child = node.children[i];
if (child.type === 1 /* ELEMENT */) {
if (child.props.length > 0) {
ec++;
}
walk(child);
if (bailed) {
return false;
}
}
}
return true;
}
return walk(node) ? [nc, ec] : false;
}
function stringifyNode(node, context) {
if (shared.isString(node)) {
return node;
}
if (shared.isSymbol(node)) {
return ``;
}
switch (node.type) {
case 1 /* ELEMENT */:
return stringifyElement(node, context);
case 2 /* TEXT */:
return shared.escapeHtml(node.content);
case 3 /* COMMENT */:
return `<!--${shared.escapeHtml(node.content)}-->`;
case 5 /* INTERPOLATION */:
return shared.escapeHtml(shared.toDisplayString(evaluateConstant(node.content)));
case 8 /* COMPOUND_EXPRESSION */:
return shared.escapeHtml(evaluateConstant(node));
case 12 /* TEXT_CALL */:
return stringifyNode(node.content, context);
default:
// static trees will not contain if/for nodes
return '';
}
}
function stringifyElement(node, context) {
let res = `<${node.tag}`;
for (let i = 0; i < node.props.length; i++) {
const p = node.props[i];
if (p.type === 6 /* ATTRIBUTE */) {
res += ` ${p.name}`;
if (p.value) {
res += `="${shared.escapeHtml(p.value.content)}"`;
}
}
else if (p.type === 7 /* DIRECTIVE */ && p.name === 'bind') {
// constant v-bind, e.g. :foo="1"
let evaluated = evaluateConstant(p.exp);
if (evaluated != null) {
const arg = p.arg && p.arg.content;
if (arg === 'class') {
evaluated = shared.normalizeClass(evaluated);
}
else if (arg === 'style') {
evaluated = shared.stringifyStyle(shared.normalizeStyle(evaluated));
}
res += ` ${p.arg.content}="${shared.escapeHtml(evaluated)}"`;
}
}
}
if (context.scopeId) {
res += ` ${context.scopeId}`;
}
res += `>`;
for (let i = 0; i < node.children.length; i++) {
res += stringifyNode(node.children[i], context);
}
if (!shared.isVoidTag(node.tag)) {
res += `</${node.tag}>`;
}
return res;
}
// __UNSAFE__
// Reason: eval.
// It's technically safe to eval because only constant expressions are possible
// here, e.g. `{{ 1 }}` or `{{ 'foo' }}`
// in addition, constant exps bail on presence of parens so you can't even
// run JSFuck in here. But we mark it unsafe for security review purposes.
// (see compiler-core/src/transformExpressions)
function evaluateConstant(exp) {
if (exp.type === 4 /* SIMPLE_EXPRESSION */) {
return new Function(`return ${exp.content}`)();
}
else {
// compound
let res = ``;
exp.children.forEach(c => {
if (shared.isString(c) || shared.isSymbol(c)) {
return;
}
if (c.type === 2 /* TEXT */) {
res += c.content;
}
else if (c.type === 5 /* INTERPOLATION */) {
res += shared.toDisplayString(evaluateConstant(c.content));
}
else {
res += evaluateConstant(c);
}
});
return res;
}
}
const ignoreSideEffectTags = (node, context) => {
if (node.type === 1 /* ELEMENT */ &&
node.tagType === 0 /* ELEMENT */ &&
(node.tag === 'script' || node.tag === 'style')) {
context.onError(createDOMCompilerError(59 /* X_IGNORED_SIDE_EFFECT_TAG */, node.loc));
context.removeNode();
}
};
const DOMNodeTransforms = [
transformStyle,
...([warnTransitionChildren] )
];
const DOMDirectiveTransforms = {
cloak: compilerCore.noopDirectiveTransform,
html: transformVHtml,
text: transformVText,
model: transformModel,
on: transformOn,
show: transformShow
};
function compile(template, options = {}) {
return compilerCore.baseCompile(template, shared.extend({}, parserOptions, options, {
nodeTransforms: [
// ignore <script> and <tag>
// this is not put inside DOMNodeTransforms because that list is used
// by compiler-ssr to generate vnode fallback branches
ignoreSideEffectTags,
...DOMNodeTransforms,
...(options.nodeTransforms || [])
],
directiveTransforms: shared.extend({}, DOMDirectiveTransforms, options.directiveTransforms || {}),
transformHoist: stringifyStatic
}));
}
function parse(template, options = {}) {
return compilerCore.baseParse(template, shared.extend({}, parserOptions, options));
}
Object.keys(compilerCore).forEach(function (k) {
if (k !== 'default') exports[k] = compilerCore[k];
});
exports.DOMDirectiveTransforms = DOMDirectiveTransforms;
exports.DOMNodeTransforms = DOMNodeTransforms;
exports.TRANSITION = TRANSITION;
exports.TRANSITION_GROUP = TRANSITION_GROUP;
exports.V_MODEL_CHECKBOX = V_MODEL_CHECKBOX;
exports.V_MODEL_DYNAMIC = V_MODEL_DYNAMIC;
exports.V_MODEL_RADIO = V_MODEL_RADIO;
exports.V_MODEL_SELECT = V_MODEL_SELECT;
exports.V_MODEL_TEXT = V_MODEL_TEXT;
exports.V_ON_WITH_KEYS = V_ON_WITH_KEYS;
exports.V_ON_WITH_MODIFIERS = V_ON_WITH_MODIFIERS;
exports.V_SHOW = V_SHOW;
exports.compile = compile;
exports.createDOMCompilerError = createDOMCompilerError;
exports.parse = parse;
exports.parserOptions = parserOptions;
exports.transformStyle = transformStyle;
}(compilerDom_cjs$2));
var compilerDom_cjs = /*@__PURE__*/build.getDefaultExportFromCjs(compilerDom_cjs$2);
var compilerDom_cjs$1 = /*#__PURE__*/Object.assign(/*#__PURE__*/Object.create(null), compilerDom_cjs$2, {
'default': compilerDom_cjs
});
exports.compilerDom_cjs = compilerDom_cjs$1;
//# sourceMappingURL=dep-b541373d.js.map