Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (List.isList(v.token)) {
return [v.token, v.scopesets];
} else {
let t = transit.objectToMap(v.token);
t.set("type", typeMap.indexOf(v.token.type));
return [t, v.scopesets];
}
}
});
let SymbolHandler = transit.makeWriteHandler({
tag: () => "symb",
rep: (v) => [v.name]
});
let writer = transit.writer("json", {
handlers: transit.map([
List, ListHandler,
Map, MapHandler,
Syntax, SyntaxHandler,
SymbolClass, SymbolHandler
])
});
function makeReader(bindings) {
return transit.reader("json", {
arrayBuilder: {
init: () => List().asMutable(),
add: (ret, val) => ret.push(val),
finalize: (ret) => ret.asImmutable(),
fromArray: (arr) => List(arr)
},
mapBuilder: {