@mapbox/mapbox-gl-style-spec 14.27.0 → 14.28.0-rc.1

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.
package/dist/index.d.ts CHANGED
@@ -1629,7 +1629,6 @@ declare const _exports: {
1629
1629
  type: string;
1630
1630
  value: string;
1631
1631
  "supported-layer-types": string[];
1632
- experimental: boolean;
1633
1632
  doc: string;
1634
1633
  };
1635
1634
  };
@@ -7956,7 +7955,6 @@ declare const _exports: {
7956
7955
  };
7957
7956
  "line-border-width": {
7958
7957
  type: string;
7959
- private: boolean;
7960
7958
  doc: string;
7961
7959
  default: number;
7962
7960
  minimum: number;
@@ -7981,7 +7979,6 @@ declare const _exports: {
7981
7979
  };
7982
7980
  "line-border-color": {
7983
7981
  type: string;
7984
- private: boolean;
7985
7982
  doc: string;
7986
7983
  default: string;
7987
7984
  "use-theme": boolean;
@@ -8004,6 +8001,38 @@ declare const _exports: {
8004
8001
  };
8005
8002
  "property-type": string;
8006
8003
  };
8004
+ "line-border-gradient": {
8005
+ type: string;
8006
+ experimental: boolean;
8007
+ doc: string;
8008
+ example: (string | number | string[])[];
8009
+ "use-theme": boolean;
8010
+ transition: boolean;
8011
+ requires: ({
8012
+ "!": string;
8013
+ source?: undefined;
8014
+ has?: undefined;
8015
+ } | {
8016
+ source: string;
8017
+ has: {
8018
+ lineMetrics: boolean;
8019
+ };
8020
+ "!"?: undefined;
8021
+ })[];
8022
+ "sdk-support": {
8023
+ "basic functionality": {
8024
+ js: string;
8025
+ android: string;
8026
+ ios: string;
8027
+ };
8028
+ "data-driven styling": {};
8029
+ };
8030
+ expression: {
8031
+ interpolated: boolean;
8032
+ parameters: string[];
8033
+ };
8034
+ "property-type": string;
8035
+ };
8007
8036
  "line-occlusion-opacity": {
8008
8037
  type: string;
8009
8038
  default: number;
@@ -11095,9 +11124,6 @@ type FillLayerSpecification = {
11095
11124
  "fill-tunnel-structure-color-transition"?: TransitionSpecification;
11096
11125
  "fill-tunnel-structure-color-use-theme"?: PropertyValueSpecification<string>;
11097
11126
  };
11098
- /**
11099
- * @experimental This property is experimental and subject to change in future versions.
11100
- */
11101
11127
  "appearances"?: Array<AppearanceSpecification>;
11102
11128
  };
11103
11129
  /**
@@ -11178,6 +11204,11 @@ type LineLayerSpecification = {
11178
11204
  "line-border-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>;
11179
11205
  "line-border-color-transition"?: TransitionSpecification;
11180
11206
  "line-border-color-use-theme"?: PropertyValueSpecification<string>;
11207
+ /**
11208
+ * @experimental This property is experimental and subject to change in future versions.
11209
+ */
11210
+ "line-border-gradient"?: ColorSpecification | ExpressionSpecification;
11211
+ "line-border-gradient-use-theme"?: PropertyValueSpecification<string>;
11181
11212
  "line-occlusion-opacity"?: PropertyValueSpecification<number>;
11182
11213
  "line-occlusion-opacity-transition"?: TransitionSpecification;
11183
11214
  /**
@@ -11189,9 +11220,6 @@ type LineLayerSpecification = {
11189
11220
  */
11190
11221
  "line-blend-additive-clamp"?: PropertyValueSpecification<number>;
11191
11222
  };
11192
- /**
11193
- * @experimental This property is experimental and subject to change in future versions.
11194
- */
11195
11223
  "appearances"?: Array<AppearanceSpecification>;
11196
11224
  };
11197
11225
  /**
@@ -11320,9 +11348,6 @@ type SymbolLayerSpecification = {
11320
11348
  "symbol-z-offset"?: DataDrivenPropertyValueSpecification<number>;
11321
11349
  "symbol-z-offset-transition"?: TransitionSpecification;
11322
11350
  };
11323
- /**
11324
- * @experimental This property is experimental and subject to change in future versions.
11325
- */
11326
11351
  "appearances"?: Array<AppearanceSpecification>;
11327
11352
  };
11328
11353
  /**
@@ -11376,9 +11401,6 @@ type CircleLayerSpecification = {
11376
11401
  "circle-emissive-strength"?: PropertyValueSpecification<number>;
11377
11402
  "circle-emissive-strength-transition"?: TransitionSpecification;
11378
11403
  };
11379
- /**
11380
- * @experimental This property is experimental and subject to change in future versions.
11381
- */
11382
11404
  "appearances"?: Array<AppearanceSpecification>;
11383
11405
  };
11384
11406
  /**
@@ -11413,9 +11435,6 @@ type HeatmapLayerSpecification = {
11413
11435
  "heatmap-opacity"?: PropertyValueSpecification<number>;
11414
11436
  "heatmap-opacity-transition"?: TransitionSpecification;
11415
11437
  };
11416
- /**
11417
- * @experimental This property is experimental and subject to change in future versions.
11418
- */
11419
11438
  "appearances"?: Array<AppearanceSpecification>;
11420
11439
  };
11421
11440
  /**
@@ -11539,9 +11558,6 @@ type FillExtrusionLayerSpecification = {
11539
11558
  "fill-extrusion-line-width-transition"?: TransitionSpecification;
11540
11559
  "fill-extrusion-cast-shadows"?: boolean;
11541
11560
  };
11542
- /**
11543
- * @experimental This property is experimental and subject to change in future versions.
11544
- */
11545
11561
  "appearances"?: Array<AppearanceSpecification>;
11546
11562
  };
11547
11563
  /**
@@ -11611,9 +11627,6 @@ type BuildingLayerSpecification = {
11611
11627
  "building-flood-light-ground-attenuation"?: PropertyValueSpecification<number>;
11612
11628
  "building-flood-light-ground-attenuation-transition"?: TransitionSpecification;
11613
11629
  };
11614
- /**
11615
- * @experimental This property is experimental and subject to change in future versions.
11616
- */
11617
11630
  "appearances"?: Array<AppearanceSpecification>;
11618
11631
  };
11619
11632
  /**
@@ -11674,9 +11687,6 @@ type RasterLayerSpecification = {
11674
11687
  */
11675
11688
  "raster-elevation-reference"?: "sea" | "ground" | ExpressionSpecification;
11676
11689
  };
11677
- /**
11678
- * @experimental This property is experimental and subject to change in future versions.
11679
- */
11680
11690
  "appearances"?: Array<AppearanceSpecification>;
11681
11691
  };
11682
11692
  /**
@@ -11714,9 +11724,6 @@ type RasterParticleLayerSpecification = {
11714
11724
  "raster-particle-elevation"?: PropertyValueSpecification<number>;
11715
11725
  "raster-particle-elevation-transition"?: TransitionSpecification;
11716
11726
  };
11717
- /**
11718
- * @experimental This property is experimental and subject to change in future versions.
11719
- */
11720
11727
  "appearances"?: Array<AppearanceSpecification>;
11721
11728
  };
11722
11729
  /**
@@ -11757,9 +11764,6 @@ type HillshadeLayerSpecification = {
11757
11764
  "hillshade-emissive-strength"?: PropertyValueSpecification<number>;
11758
11765
  "hillshade-emissive-strength-transition"?: TransitionSpecification;
11759
11766
  };
11760
- /**
11761
- * @experimental This property is experimental and subject to change in future versions.
11762
- */
11763
11767
  "appearances"?: Array<AppearanceSpecification>;
11764
11768
  };
11765
11769
  /**
@@ -11821,9 +11825,6 @@ type ModelLayerSpecification = {
11821
11825
  */
11822
11826
  "model-line-cutout-mode"?: "enabled" | "disabled" | "enabled-above-cutout" | ExpressionSpecification;
11823
11827
  };
11824
- /**
11825
- * @experimental This property is experimental and subject to change in future versions.
11826
- */
11827
11828
  "appearances"?: Array<AppearanceSpecification>;
11828
11829
  };
11829
11830
  /**
@@ -11861,9 +11862,6 @@ type BackgroundLayerSpecification = {
11861
11862
  "background-emissive-strength"?: PropertyValueSpecification<number>;
11862
11863
  "background-emissive-strength-transition"?: TransitionSpecification;
11863
11864
  };
11864
- /**
11865
- * @experimental This property is experimental and subject to change in future versions.
11866
- */
11867
11865
  "appearances"?: Array<AppearanceSpecification>;
11868
11866
  };
11869
11867
  /**
@@ -11902,9 +11900,6 @@ type SkyLayerSpecification = {
11902
11900
  "sky-opacity"?: PropertyValueSpecification<number>;
11903
11901
  "sky-opacity-transition"?: TransitionSpecification;
11904
11902
  };
11905
- /**
11906
- * @experimental This property is experimental and subject to change in future versions.
11907
- */
11908
11903
  "appearances"?: Array<AppearanceSpecification>;
11909
11904
  };
11910
11905
  /**
@@ -11925,9 +11920,6 @@ type SlotLayerSpecification = {
11925
11920
  "minzoom"?: never;
11926
11921
  "maxzoom"?: never;
11927
11922
  "filter"?: never;
11928
- /**
11929
- * @experimental This property is experimental and subject to change in future versions.
11930
- */
11931
11923
  "appearances"?: Array<AppearanceSpecification>;
11932
11924
  "layout"?: never;
11933
11925
  "paint"?: never;
@@ -11947,9 +11939,6 @@ type ClipLayerSpecification = {
11947
11939
  "clip-layer-scope"?: Array<string> | ExpressionSpecification;
11948
11940
  "visibility"?: "visible" | "none" | ExpressionSpecification;
11949
11941
  };
11950
- /**
11951
- * @experimental This property is experimental and subject to change in future versions.
11952
- */
11953
11942
  "appearances"?: Array<AppearanceSpecification>;
11954
11943
  "paint"?: never;
11955
11944
  };
package/dist/index.es.js CHANGED
@@ -1675,8 +1675,7 @@ var layer = {
1675
1675
  "supported-layer-types": [
1676
1676
  "symbol"
1677
1677
  ],
1678
- experimental: true,
1679
- doc: "Conditional styling applied to symbol layer features based on dynamic conditions. If multiple conditions are true, only the first matching appearance will be applied. Only properties marked with 'Works with appearances' are supported."
1678
+ doc: "Conditional styling applied to symbol layer features based on dynamic conditions. If multiple conditions are true, only the first matching appearance will be applied. Only properties marked with 'Works with appearances' are supported. Known issue: at the moment having both `appearances` and `text-variable-anchor` in the same layer doesn't work correctly."
1680
1679
  }
1681
1680
  };
1682
1681
  var appearance = {
@@ -3913,7 +3912,7 @@ var layout_symbol = {
3913
3912
  ]
3914
3913
  }
3915
3914
  ],
3916
- doc: "To increase the chance of placing high-priority labels on the map, you can provide an array of `text-anchor` locations: the renderer will attempt to place the label at each location, in order, before moving onto the next label. Use `text-justify: auto` to choose justification based on anchor position. To apply an offset, use the `text-radial-offset` or the two-dimensional `text-offset`.",
3915
+ doc: "To increase the chance of placing high-priority labels on the map, you can provide an array of `text-anchor` locations: the renderer will attempt to place the label at each location, in order, before moving onto the next label. Use `text-justify: auto` to choose justification based on anchor position. To apply an offset, use the `text-radial-offset` or the two-dimensional `text-offset`. Known issue: at the moment having both `appearances` and `text-variable-anchor` in the same layer doesn't work correctly.",
3917
3916
  "sdk-support": {
3918
3917
  "basic functionality": {
3919
3918
  js: "0.54.0",
@@ -8088,7 +8087,6 @@ var paint_line = {
8088
8087
  },
8089
8088
  "line-border-width": {
8090
8089
  type: "number",
8091
- "private": true,
8092
8090
  doc: "The width of the line border. A value of zero means no border.",
8093
8091
  "default": 0,
8094
8092
  minimum: 0,
@@ -8117,7 +8115,6 @@ var paint_line = {
8117
8115
  },
8118
8116
  "line-border-color": {
8119
8117
  type: "color",
8120
- "private": true,
8121
8118
  doc: "The color of the line border. If line-border-width is greater than zero and the alpha value of this color is 0 (default), the color for the border will be selected automatically based on the line color.",
8122
8119
  "default": "rgba(0, 0, 0, 0)",
8123
8120
  "use-theme": true,
@@ -8144,6 +8141,49 @@ var paint_line = {
8144
8141
  },
8145
8142
  "property-type": "data-driven"
8146
8143
  },
8144
+ "line-border-gradient": {
8145
+ type: "color",
8146
+ experimental: true,
8147
+ doc: "A gradient used to color the border of a line feature at various distances along its length. Defined using a `step` or `interpolate` expression which outputs a color for each corresponding `line-progress` input value. `line-progress` is a percentage of the line feature's total length as measured on the webmercator projected coordinate plane (a `number` between `0` and `1`). Takes precedence over `line-border-color`. Has no effect unless `line-border-width` is greater than zero. Can only be used with GeoJSON sources that specify `\"lineMetrics\": true`.",
8148
+ example: [
8149
+ "step",
8150
+ [
8151
+ "line-progress"
8152
+ ],
8153
+ "blue",
8154
+ 0.5,
8155
+ "gray"
8156
+ ],
8157
+ "use-theme": true,
8158
+ transition: false,
8159
+ requires: [
8160
+ {
8161
+ "!": "line-pattern"
8162
+ },
8163
+ {
8164
+ source: "geojson",
8165
+ has: {
8166
+ lineMetrics: true
8167
+ }
8168
+ }
8169
+ ],
8170
+ "sdk-support": {
8171
+ "basic functionality": {
8172
+ js: "3.28.0",
8173
+ android: "11.28.0",
8174
+ ios: "11.28.0"
8175
+ },
8176
+ "data-driven styling": {
8177
+ }
8178
+ },
8179
+ expression: {
8180
+ interpolated: true,
8181
+ parameters: [
8182
+ "line-progress"
8183
+ ]
8184
+ },
8185
+ "property-type": "color-ramp"
8186
+ },
8147
8187
  "line-occlusion-opacity": {
8148
8188
  type: "number",
8149
8189
  "default": 0,
@@ -13190,7 +13230,9 @@ class ResolvedImage {
13190
13230
  return new ImageVariant(this.secondaryId, this.secondaryOptions);
13191
13231
  }
13192
13232
  static from(image) {
13193
- return typeof image === "string" ? ResolvedImage.build({ name: image }) : image;
13233
+ if (typeof image !== "string") return image;
13234
+ const resolved = ResolvedImage.build({ name: image });
13235
+ return resolved;
13194
13236
  }
13195
13237
  static build(primaryId, secondaryId, primaryOptions, secondaryOptions) {
13196
13238
  if (!primaryId || typeof primaryId === "object" && !("name" in primaryId)) return null;
@@ -15534,9 +15576,7 @@ class Config {
15534
15576
  }
15535
15577
  static parse(args, context) {
15536
15578
  let type = context.expectedType;
15537
- if (type === null || type === void 0) {
15538
- type = ValueType;
15539
- }
15579
+ type ?? (type = ValueType);
15540
15580
  if (args.length < 2 || args.length > 3) {
15541
15581
  return context.error(`Invalid number of arguments for 'config' expression.`);
15542
15582
  }
@@ -16493,112 +16533,6 @@ class AtInterpolated {
16493
16533
  }
16494
16534
  }
16495
16535
 
16496
- class In {
16497
- constructor(needle, haystack) {
16498
- this.type = BooleanType;
16499
- this.needle = needle;
16500
- this.haystack = haystack;
16501
- }
16502
- static parse(args, context) {
16503
- if (args.length !== 3) {
16504
- context.error(`Expected 2 arguments, but found ${args.length - 1} instead.`);
16505
- return null;
16506
- }
16507
- const needle = context.parse(args[1], 1, ValueType);
16508
- const haystack = context.parse(args[2], 2, ValueType);
16509
- if (!needle || !haystack) return null;
16510
- if (!isValidType(needle.type, [BooleanType, StringType, NumberType, NullType, ValueType])) {
16511
- context.error(`Expected first argument to be of type boolean, string, number or null, but found ${toString$1(needle.type)} instead`);
16512
- return null;
16513
- }
16514
- return new In(needle, haystack);
16515
- }
16516
- evaluate(ctx) {
16517
- const needle = this.needle.evaluate(ctx);
16518
- const haystack = this.haystack.evaluate(ctx);
16519
- if (haystack == null) return false;
16520
- if (!isValidNativeType(needle, ["boolean", "string", "number", "null"])) {
16521
- throw new RuntimeError(`Expected first argument to be of type boolean, string, number or null, but found ${toString$1(typeOf(needle))} instead.`);
16522
- }
16523
- if (!isValidNativeType(haystack, ["string", "array"])) {
16524
- throw new RuntimeError(`Expected second argument to be of type array or string, but found ${toString$1(typeOf(haystack))} instead.`);
16525
- }
16526
- return haystack.includes(needle);
16527
- }
16528
- eachChild(fn) {
16529
- fn(this.needle);
16530
- fn(this.haystack);
16531
- }
16532
- outputDefined() {
16533
- return true;
16534
- }
16535
- serialize() {
16536
- return ["in", this.needle.serialize(), this.haystack.serialize()];
16537
- }
16538
- }
16539
-
16540
- class IndexOf {
16541
- constructor(needle, haystack, fromIndex) {
16542
- this.type = NumberType;
16543
- this.needle = needle;
16544
- this.haystack = haystack;
16545
- this.fromIndex = fromIndex;
16546
- }
16547
- static parse(args, context) {
16548
- if (args.length <= 2 || args.length >= 5) {
16549
- context.error(`Expected 3 or 4 arguments, but found ${args.length - 1} instead.`);
16550
- return null;
16551
- }
16552
- const needle = context.parse(args[1], 1, ValueType);
16553
- const haystack = context.parse(args[2], 2, ValueType);
16554
- if (!needle || !haystack) return null;
16555
- if (!isValidType(needle.type, [BooleanType, StringType, NumberType, NullType, ValueType])) {
16556
- context.error(`Expected first argument to be of type boolean, string, number or null, but found ${toString$1(needle.type)} instead`);
16557
- return null;
16558
- }
16559
- if (args.length === 4) {
16560
- const fromIndex = context.parse(args[3], 3, NumberType);
16561
- if (!fromIndex) return null;
16562
- return new IndexOf(needle, haystack, fromIndex);
16563
- } else {
16564
- return new IndexOf(needle, haystack);
16565
- }
16566
- }
16567
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
16568
- evaluate(ctx) {
16569
- const needle = this.needle.evaluate(ctx);
16570
- const haystack = this.haystack.evaluate(ctx);
16571
- if (!isValidNativeType(needle, ["boolean", "string", "number", "null"])) {
16572
- throw new RuntimeError(`Expected first argument to be of type boolean, string, number or null, but found ${toString$1(typeOf(needle))} instead.`);
16573
- }
16574
- if (!isValidNativeType(haystack, ["string", "array"])) {
16575
- throw new RuntimeError(`Expected second argument to be of type array or string, but found ${toString$1(typeOf(haystack))} instead.`);
16576
- }
16577
- if (this.fromIndex) {
16578
- const fromIndex = this.fromIndex.evaluate(ctx);
16579
- return haystack.indexOf(needle, fromIndex);
16580
- }
16581
- return haystack.indexOf(needle);
16582
- }
16583
- eachChild(fn) {
16584
- fn(this.needle);
16585
- fn(this.haystack);
16586
- if (this.fromIndex) {
16587
- fn(this.fromIndex);
16588
- }
16589
- }
16590
- outputDefined() {
16591
- return false;
16592
- }
16593
- serialize() {
16594
- if (this.fromIndex != null && this.fromIndex !== void 0) {
16595
- const fromIndex = this.fromIndex.serialize();
16596
- return ["index-of", this.needle.serialize(), this.haystack.serialize(), fromIndex];
16597
- }
16598
- return ["index-of", this.needle.serialize(), this.haystack.serialize()];
16599
- }
16600
- }
16601
-
16602
16536
  class Match {
16603
16537
  constructor(inputType, outputType, input, cases, outputs, otherwise) {
16604
16538
  this.inputType = inputType;
@@ -16821,38 +16755,6 @@ class Slice {
16821
16755
  }
16822
16756
  }
16823
16757
 
16824
- class Split {
16825
- constructor(str, delimiter) {
16826
- this.type = array$1(StringType);
16827
- this.str = str;
16828
- this.delimiter = delimiter;
16829
- }
16830
- static parse(args, context) {
16831
- if (args.length !== 3) {
16832
- return context.error(`Expected 2 arguments, but found ${args.length - 1} instead.`);
16833
- }
16834
- const str = context.parse(args[1], 1, StringType);
16835
- const delimiter = context.parse(args[2], 2, StringType);
16836
- if (!str || !delimiter) return;
16837
- return new Split(str, delimiter);
16838
- }
16839
- evaluate(ctx) {
16840
- const str = this.str.evaluate(ctx);
16841
- const delimiter = this.delimiter.evaluate(ctx);
16842
- return str.split(delimiter);
16843
- }
16844
- eachChild(fn) {
16845
- fn(this.str);
16846
- fn(this.delimiter);
16847
- }
16848
- outputDefined() {
16849
- return false;
16850
- }
16851
- serialize() {
16852
- return ["split", this.str.serialize(), this.delimiter.serialize()];
16853
- }
16854
- }
16855
-
16856
16758
  function isComparableType(op, type) {
16857
16759
  if (op === "==" || op === "!=") {
16858
16760
  return type.kind === "boolean" || type.kind === "string" || type.kind === "number" || type.kind === "null" || type.kind === "value";
@@ -17160,8 +17062,6 @@ const expressions = {
17160
17062
  "collator": CollatorExpression,
17161
17063
  "format": FormatExpression,
17162
17064
  "image": ImageExpression,
17163
- "in": In,
17164
- "index-of": IndexOf,
17165
17065
  "interpolate": Interpolate,
17166
17066
  "interpolate-hcl": Interpolate,
17167
17067
  "interpolate-lab": Interpolate,
@@ -17182,8 +17082,7 @@ const expressions = {
17182
17082
  "var": Var,
17183
17083
  "within": Within,
17184
17084
  "distance": Distance,
17185
- "config": Config,
17186
- "split": Split
17085
+ "config": Config
17187
17086
  };
17188
17087
  function rgba(ctx, [r, g, b, a]) {
17189
17088
  r = r.evaluate(ctx);
@@ -17228,6 +17127,14 @@ function binarySearch(v, a, i, j) {
17228
17127
  function varargs(type) {
17229
17128
  return { type };
17230
17129
  }
17130
+ function assertNeedleHaystack(needle, haystack) {
17131
+ if (!isValidNativeType(needle, ["boolean", "string", "number", "null"])) {
17132
+ throw new RuntimeError(`Expected first argument to be of type boolean, string, number or null, but found ${toString$1(typeOf(needle))} instead.`);
17133
+ }
17134
+ if (!isValidNativeType(haystack, ["string", "array"])) {
17135
+ throw new RuntimeError(`Expected second argument to be of type array or string, but found ${toString$1(typeOf(haystack))} instead.`);
17136
+ }
17137
+ }
17231
17138
  function hashString(str) {
17232
17139
  let hash = 0;
17233
17140
  if (str.length === 0) {
@@ -17777,6 +17684,47 @@ CompoundExpression.register(expressions, {
17777
17684
  // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
17778
17685
  (ctx, args) => args.map((arg) => toString(arg.evaluate(ctx))).join("")
17779
17686
  ],
17687
+ "split": [
17688
+ array$1(StringType),
17689
+ [StringType, StringType],
17690
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-return
17691
+ (ctx, [str, delimiter]) => str.evaluate(ctx).split(delimiter.evaluate(ctx))
17692
+ ],
17693
+ "in": [
17694
+ BooleanType,
17695
+ [ValueType, ValueType],
17696
+ (ctx, [needleExpr, haystackExpr]) => {
17697
+ const needle = needleExpr.evaluate(ctx);
17698
+ const haystack = haystackExpr.evaluate(ctx);
17699
+ if (haystack == null) return false;
17700
+ assertNeedleHaystack(needle, haystack);
17701
+ return haystack.includes(needle);
17702
+ }
17703
+ ],
17704
+ "index-of": {
17705
+ type: NumberType,
17706
+ overloads: [
17707
+ [
17708
+ [ValueType, ValueType],
17709
+ (ctx, [needleExpr, haystackExpr]) => {
17710
+ const needle = needleExpr.evaluate(ctx);
17711
+ const haystack = haystackExpr.evaluate(ctx);
17712
+ assertNeedleHaystack(needle, haystack);
17713
+ return haystack.indexOf(needle);
17714
+ }
17715
+ ],
17716
+ [
17717
+ [ValueType, ValueType, NumberType],
17718
+ (ctx, [needleExpr, haystackExpr, fromIndexExpr]) => {
17719
+ const needle = needleExpr.evaluate(ctx);
17720
+ const haystack = haystackExpr.evaluate(ctx);
17721
+ const fromIndex = fromIndexExpr.evaluate(ctx);
17722
+ assertNeedleHaystack(needle, haystack);
17723
+ return haystack.indexOf(needle, fromIndex);
17724
+ }
17725
+ ]
17726
+ ]
17727
+ },
17780
17728
  "resolved-locale": [
17781
17729
  StringType,
17782
17730
  [CollatorType],
@@ -19517,7 +19465,7 @@ class ParsingError {
19517
19465
  this.error = error;
19518
19466
  this.message = error.message;
19519
19467
  const match = error.message.match(LINE_NUMBER_RE);
19520
- this.line = match ? parseInt(match[1], 10) : 0;
19468
+ this.line = match && match[1] ? parseInt(match[1], 10) : 0;
19521
19469
  }
19522
19470
  }
19523
19471