done
This commit is contained in:
@@ -41,7 +41,7 @@ const zip = (a, b) => a.map((e, i) => [e, b[i]]);
|
||||
const check_represent = function(r, v) {
|
||||
if (typeof v == "number") return to_int(r) == v;
|
||||
if (typeof v == "boolean") return to_bool(r) == v;
|
||||
if (typeof v == "string") { console.log("checking ", to_array(r).map(to_int), " against ", v); return to_string(r) == v; }
|
||||
if (typeof v == "string") return to_string(r) == v;
|
||||
if (Array.isArray(v)) {
|
||||
let a = to_array(r);
|
||||
return a.length == v.length && zip(a, v).every(([r, v]) => check_represent(r,v));
|
||||
@@ -49,5 +49,5 @@ const check_represent = function(r, v) {
|
||||
throw Error(`Oops, I don’t know how check this: ${v}`);
|
||||
};
|
||||
module.exports = {
|
||||
to_string, to_array, representation_of, check_represent, to_int, to_char
|
||||
representation_of, check_represent
|
||||
};
|
||||
|
Reference in New Issue
Block a user