mirror of
https://github.com/CharaChorder/DeviceManager.git
synced 2026-01-10 20:12:48 +00:00
fix: allow trailing linebreak for legacy layouts
This commit is contained in:
@@ -11,7 +11,7 @@ export function csvLayoutToJson(csv: string, device: CharaLayoutFile["device"] =
|
|||||||
layout: [[], [], []],
|
layout: [[], [], []],
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const layer of csv.split("\n")) {
|
for (const layer of csv.trim().split("\n")) {
|
||||||
const [layerId, key, action] = layer.substring(1).split(",").map(Number)
|
const [layerId, key, action] = layer.substring(1).split(",").map(Number)
|
||||||
|
|
||||||
layout.layout[Number(layerId) - 1][Number(key)] = Number(action)
|
layout.layout[Number(layerId) - 1][Number(key)] = Number(action)
|
||||||
|
|||||||
Reference in New Issue
Block a user