@marko/compiler 5.37.14 → 5.37.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,7 +6,6 @@
6
6
 
7
7
 
8
8
 
9
-
10
9
  const valueFieldCommon = {
11
10
  value: {
12
11
  validate: (0, _utils.assertValueType)("string")
@@ -81,7 +80,7 @@ const MarkoDefinitions = {
81
80
  visitor: ["body"],
82
81
  fields: {
83
82
  body: {
84
- validate: (0, _utils.arrayOfType)(["Statement"])
83
+ validate: arrayOfType(["Statement"])
85
84
  },
86
85
  static: {
87
86
  validate: (0, _utils.assertValueType)("boolean"),
@@ -166,7 +165,7 @@ const MarkoDefinitions = {
166
165
  optional: true
167
166
  },
168
167
  body: {
169
- validate: (0, _utils.arrayOfType)([
168
+ validate: arrayOfType([
170
169
  "MarkoTag",
171
170
  "MarkoCDATA",
172
171
  "MarkoText",
@@ -195,7 +194,7 @@ const MarkoDefinitions = {
195
194
  validate: (0, _utils.assertNodeType)("Expression")
196
195
  },
197
196
  attributes: {
198
- validate: (0, _utils.arrayOfType)(["MarkoAttribute", "MarkoSpreadAttribute"]),
197
+ validate: arrayOfType(["MarkoAttribute", "MarkoSpreadAttribute"]),
199
198
  default: []
200
199
  },
201
200
  body: {
@@ -230,4 +229,10 @@ const MARKO_ALIAS_TYPES = exports.MARKO_ALIAS_TYPES = Array.from(
230
229
  new Set(
231
230
  MARKO_TYPES.reduce((all, t) => all.concat(MarkoDefinitions[t].aliases), [])
232
231
  )
233
- );
232
+ );
233
+
234
+ // Note this is inline because a change in babel caused a regression with this api.
235
+ // TODO: we should not rely on babels validators or builders.
236
+ function arrayOfType(types) {
237
+ return (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)(...types)));
238
+ }
package/dist/types.d.ts CHANGED
@@ -97,7 +97,7 @@ export interface CallExpression extends BaseNode {
97
97
  type: "CallExpression";
98
98
  callee: Expression | Super | V8IntrinsicIdentifier;
99
99
  arguments: Array<Expression | SpreadElement | ArgumentPlaceholder>;
100
- optional: true | false | null;
100
+ optional: boolean | null;
101
101
  typeArguments: TypeParameterInstantiation | null;
102
102
  typeParameters: TSTypeParameterInstantiation | null;
103
103
  }
@@ -244,14 +244,14 @@ export interface MemberExpression extends BaseNode {
244
244
  object: Expression | Super;
245
245
  property: Expression | Identifier | PrivateName;
246
246
  computed: boolean;
247
- optional: true | false | null;
247
+ optional: boolean | null;
248
248
  }
249
249
 
250
250
  export interface NewExpression extends BaseNode {
251
251
  type: "NewExpression";
252
252
  callee: Expression | Super | V8IntrinsicIdentifier;
253
253
  arguments: Array<Expression | SpreadElement | ArgumentPlaceholder>;
254
- optional: true | false | null;
254
+ optional: boolean | null;
255
255
  typeArguments: TypeParameterInstantiation | null;
256
256
  typeParameters: TSTypeParameterInstantiation | null;
257
257
  }
@@ -1905,7 +1905,7 @@ export function nullLiteral(): NullLiteral;
1905
1905
  export function booleanLiteral(value: boolean): BooleanLiteral;
1906
1906
  export function regExpLiteral(pattern: string, flags?: string): RegExpLiteral;
1907
1907
  export function logicalExpression(operator: "||" | "&&" | "??", left: Expression, right: Expression): LogicalExpression;
1908
- export function memberExpression(object: Expression | Super, property: Expression | Identifier | PrivateName, computed?: boolean, optional?: true | false | null): MemberExpression;
1908
+ export function memberExpression(object: Expression | Super, property: Expression | Identifier | PrivateName, computed?: boolean, optional?: boolean | null): MemberExpression;
1909
1909
  export function newExpression(callee: Expression | Super | V8IntrinsicIdentifier, _arguments: Array<Expression | SpreadElement | ArgumentPlaceholder>): NewExpression;
1910
1910
  export function program(body: Array<Statement>, directives?: Array<Directive>, sourceType?: "script" | "module", interpreter?: InterpreterDirective | null): Program;
1911
1911
  export function objectExpression(properties: Array<ObjectMethod | ObjectProperty | SpreadElement>): ObjectExpression;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marko/compiler",
3
- "version": "5.37.14",
3
+ "version": "5.37.15",
4
4
  "description": "Marko template to JS compiler.",
5
5
  "keywords": [
6
6
  "babel",
@@ -66,7 +66,7 @@
66
66
  "@babel/traverse": "^7.25.3",
67
67
  "@babel/types": "^7.25.2",
68
68
  "@luxass/strip-json-comments": "^1.3.2",
69
- "@marko/babel-utils": "^6.5.6",
69
+ "@marko/babel-utils": "^6.5.7",
70
70
  "complain": "^1.6.0",
71
71
  "he": "^1.2.0",
72
72
  "htmljs-parser": "^5.5.2",
@@ -80,7 +80,7 @@
80
80
  "source-map-support": "^0.5.21"
81
81
  },
82
82
  "devDependencies": {
83
- "@marko/translator-default": "^6.0.15"
83
+ "@marko/translator-default": "^6.0.16"
84
84
  },
85
85
  "publishConfig": {
86
86
  "access": "public"