@mapbox/mapbox-gl-style-spec 14.2.0-beta.1 → 14.3.0-beta.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/diff.js CHANGED
@@ -148,20 +148,10 @@ export const operations: {[_: string]: string} = {
148
148
  */
149
149
  removeImport: 'removeImport',
150
150
 
151
- /*
152
- * { command: 'setImportUrl', args: [importId, styleUrl] }
153
- */
154
- setImportUrl: 'setImportUrl',
155
-
156
- /*
157
- * { command: 'setImportData', args: [importId, stylesheet] }
158
- */
159
- setImportData: 'setImportData',
160
-
161
- /*
162
- * { command: 'setImportConfig', args: [importId, config] }
151
+ /**
152
+ * { command: 'updateImport', args: [importId, importSpecification | styleUrl] }
163
153
  */
164
- setImportConfig: 'setImportConfig'
154
+ updateImport: 'updateImport'
165
155
  };
166
156
 
167
157
  function addSource(sourceId: string, after: Sources, commands: Array<Command>) {
@@ -424,20 +414,7 @@ export function diffImports(before: Array<ImportSpecification> = [], after: Arra
424
414
  const beforeImport = beforeIndex[afterImport.id];
425
415
  if (!beforeImport || isEqual(beforeImport, afterImport)) continue;
426
416
 
427
- if (!isEqual(beforeImport.config, afterImport.config)) {
428
- commands.push({command: operations.setImportConfig, args: [afterImport.id, afterImport.config]});
429
- }
430
-
431
- if (!isEqual(beforeImport.url, afterImport.url)) {
432
- commands.push({command: operations.setImportUrl, args: [afterImport.id, afterImport.url]});
433
- }
434
-
435
- const beforeData = beforeImport && beforeImport.data;
436
- const afterData = afterImport.data;
437
-
438
- if (!isEqual(beforeData, afterData)) {
439
- commands.push({command: operations.setImportData, args: [afterImport.id, afterData]});
440
- }
417
+ commands.push({command: operations.updateImport, args: [afterImport.id, afterImport]});
441
418
  }
442
419
  }
443
420