mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2024-12-29 07:50:28 +01:00
13 lines
491 B
JavaScript
13 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)
|
|
}
|