Comparing version 1.5.2 to 1.6.0
{ | ||
"name": "xdim", | ||
"version": "1.5.2", | ||
"version": "1.6.0", | ||
"description": "Multi-Dimensional Functions. Create, Query, and Transform Multi-Dimensional Data.", | ||
"main": "src/xdim.js", | ||
"types": "src/xdim.d.ts", | ||
"files": [ | ||
"src/xdim.js", | ||
"src/xdim.d.ts", | ||
"src/prepared-select-funcs.js", | ||
@@ -13,4 +15,6 @@ "src/prepared-update-funcs.js" | ||
"build": "node scripts/build.js", | ||
"format": "npx prettier --arrow-parens=avoid --print-width=160 --trailing-comma=none --write */*.js", | ||
"test": "npm run build && for f in tests/*.js; do node $f; done" | ||
"format": "npx prettier --arrow-parens=avoid --print-width=160 --trailing-comma=none --write */*.js */*.ts", | ||
"perf": "node tests/perf.js", | ||
"test": "npm run test:ts && npm run perf", | ||
"test:ts": "npm run build && for f in tests/*.ts; do npx ts-node $f; done" | ||
}, | ||
@@ -41,8 +45,8 @@ "repository": { | ||
"homepage": "https://github.com/DanielJDufour/xdim#readme", | ||
"devDependencies": { | ||
"flug": "^2.0.0" | ||
}, | ||
"dependencies": { | ||
"iter-fun": "^0.2.0" | ||
}, | ||
"devDependencies": { | ||
"flug": "^2.3.1" | ||
} | ||
} |
@@ -258,3 +258,3 @@ # xdim | ||
row: 768, | ||
width: 1024 | ||
column: 1024 | ||
} | ||
@@ -261,0 +261,0 @@ }); |
@@ -417,3 +417,7 @@ const layoutCache = {}; | ||
} else if (it.type === "Matrix") { | ||
return it.parts.reduce((total, part) => total * sizes[part.dim], 1); | ||
return it.parts.reduce((total, part) => { | ||
console.log("part.dim:", part.dim); | ||
if (!(part.dim in sizes)) throw new Error(`[xdim] could not find "${part.dim}" in sizes: { ${Object.keys(sizes).join(", ")} }`); | ||
return total * sizes[part.dim]; | ||
}, 1); | ||
} | ||
@@ -420,0 +424,0 @@ }); |
50165
7
700