mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2025-01-01 01:13:17 +01:00
14 lines
491 B
JavaScript
14 lines
491 B
JavaScript
|
import diffStyles from 'mapbox-gl-style-spec/lib/diff'
|
||
|
|
||
|
export function diffMessages(beforeStyle, afterStyle) {
|
||
|
const changes = diffStyles(beforeStyle, afterStyle)
|
||
|
return changes.map(cmd => cmd.command + ' ' + cmd.args.join(' '))
|
||
|
}
|
||
|
|
||
|
export function undoMessages(beforeStyle, afterStyle) {
|
||
|
return diffMessages(beforeStyle, afterStyle).map(m => 'Undo ' + m)
|
||
|
}
|
||
|
export function redoMessages(beforeStyle, afterStyle) {
|
||
|
return diffMessages(beforeStyle, afterStyle).map(m => 'Redo ' + m)
|
||
|
}
|