DKL9 GitList
Repositories
DKL9 home
rtensor
Code
Commits
Branches
Tags
Search
Tree:
117473e
Branches
Tags
master
rtensor
rtensor_common.js
Refactor towards a working QuickJS version
dkl9
commited
117473e
at 2023-196 12:46:40
rtensor_common.js
Blame
History
Raw
"use strict"; // operator text export const OPS = [ "+", "-", "*", "/", "^", "\\", "==", "-/", ",", "<", "=>", "=", "..", ]; // stringify a vecalc value for presentation export function fts(v) { if (v == null) { return "nonexistent"; } else if (v.constructor === Array) { switch (v.length) { case 0: return "[ ]"; default: return "[" + v.map(x => fts(x)).join(", ") + "]"; } } else if (v.constructor.name === "MathsFunc" || v.constructor === Function) { return "function"; } else if (v.constructor === null) { return "null"; } else { return v.toString(); } }