MCPcopy Create free account
hub / github.com/WebReflection/hypersimple / invokeAtDistance

Function invokeAtDistance

index.js:1507–1519  ·  view source on GitHub ↗
(value, callback)

Source from the content-addressed store, hash-verified

1505
1506
1507 var invokeAtDistance = function invokeAtDistance(value, callback) {
1508 callback(value.placeholder);
1509
1510 if ('text' in value) {
1511 Promise.resolve(value.text).then(String).then(callback);
1512 } else if ('any' in value) {
1513 Promise.resolve(value.any).then(callback);
1514 } else if ('html' in value) {
1515 Promise.resolve(value.html).then(asHTML).then(callback);
1516 } else {
1517 Promise.resolve(Intent.invoke(value, callback)).then(callback);
1518 }
1519 }; // quick and dirty way to check for Promise/ish values
1520
1521
1522 var isPromise_ish = function isPromise_ish(value) {

Callers 2

anyContentFunction · 0.85
textContentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected