mirror of
https://github.com/TextPlace/CoreTextPlace.git
synced 2025-05-01 05:01:11 +00:00
fix: 0.3.1
This commit is contained in:
parent
91db478fe9
commit
587e0558e9
4 changed files with 12 additions and 7 deletions
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@textplace/core",
|
"name": "@textplace/core",
|
||||||
"version": "0.3.0",
|
"version": "0.3.1",
|
||||||
"exports": "./mod.ts",
|
"exports": "./mod.ts",
|
||||||
"imports": {
|
"imports": {
|
||||||
"@deno/dnt": "jsr:@deno/dnt@^0.41.3"
|
"@deno/dnt": "jsr:@deno/dnt@^0.41.3"
|
||||||
|
|
|
@ -106,9 +106,9 @@ export function renderFullBoard(data: BoardData): FullBoard {
|
||||||
return {
|
return {
|
||||||
w: lineLength,
|
w: lineLength,
|
||||||
h: totalLineCount,
|
h: totalLineCount,
|
||||||
ch: ([] as string[]).concat(...chLines).flat(),
|
ch: chLines.flat(),
|
||||||
color: ([] as string[]).concat(...colorLines).flat(),
|
color: colorLines.flat(),
|
||||||
bg_color: ([] as string[]).concat(...bgColorLines).flat(),
|
bg_color: bgColorLines.flat(),
|
||||||
width: ([] as number[]).concat(...widthLines).flat(),
|
width: widthLines.flat(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -119,7 +119,7 @@ Deno.test("board", async (t) => {
|
||||||
await t.step("on-demand creation: only changed sections are saved", () => {
|
await t.step("on-demand creation: only changed sections are saved", () => {
|
||||||
assert(board);
|
assert(board);
|
||||||
|
|
||||||
assertEquals(board.sections.length, 2);
|
assertEquals(board.sections[2], undefined);
|
||||||
assertEquals(board.sections[0].length, 2);
|
assertEquals(board.sections[0][2], undefined);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -47,6 +47,11 @@ export function checkFullBoard(board: FullBoard) {
|
||||||
console.error("width: ", widthLine);
|
console.error("width: ", widthLine);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (typeof cCh !== "string") {
|
||||||
|
printSituation();
|
||||||
|
throw new Error("cCh is not string");
|
||||||
|
}
|
||||||
|
|
||||||
if (!isValidColor(cCo) || !isValidColor(cBg)) {
|
if (!isValidColor(cCo) || !isValidColor(cBg)) {
|
||||||
printSituation();
|
printSituation();
|
||||||
throw new Error("cCo or cBg is not valid");
|
throw new Error("cCo or cBg is not valid");
|
||||||
|
|
Loading…
Add table
Reference in a new issue