MCPcopy Create free account
hub / github.com/microsoft/SandDance / expression

Function expression

docs/app/js/sanddance-app.js:146373–146378  ·  view source on GitHub ↗
(ctx, args, code)

Source from the content-addressed store, hash-verified

146371 return canonicalType(type) === "collect";
146372}
146373function expression(ctx, args, code) {
146374 // wrap code in return statement if expression does not terminate
146375 if (code[code.length - 1] !== ";") code = "return(" + code + ");";
146376 const fn = Function(...args.concat(code));
146377 return ctx && ctx.functions ? fn.bind(ctx.functions) : fn;
146378} // generate code for comparing a single field
146379function _compare(u, v, lt, gt) {
146380 return "((u = ".concat(u, ") < (v = ").concat(v, ") || u == null) && v != null ? ").concat(lt, "\n : (u > v || v == null) && u != null ? ").concat(gt, "\n : ((v = v instanceof Date ? +v : v), (u = u instanceof Date ? +u : u)) !== u && v === v ? ").concat(lt, "\n : v !== v && u === u ? ").concat(gt, " : ");
146381}

Callers 1

sanddance-app.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected