MCPcopy Create free account
hub / github.com/GoogleChrome/samples / __xAdapter

Function __xAdapter

sqlite-wasm-cos/sqlite3-node.mjs:9345–9360  ·  view source on GitHub ↗
(func, argc, typeName, adapter, modeName, xcvPart)

Source from the content-addressed store, hash-verified

9343 (B) typeName is not a string or (C) argc is not one of (1, 2).
9344 */
9345 const __xAdapter = function(func, argc, typeName, adapter, modeName, xcvPart){
9346 if('string'===typeof typeName){
9347 if(1===argc) return xcvPart.get(typeName);
9348 else if(2===argc){
9349 if(!adapter){
9350 xcvPart.delete(typeName);
9351 return func;
9352 }else if(!(adapter instanceof Function)){
9353 toss(modeName,"requires a function argument.");
9354 }
9355 xcvPart.set(typeName, adapter);
9356 return func;
9357 }
9358 }
9359 toss("Invalid arguments to",modeName);
9360 };
9361
9362 /**
9363 Gets, sets, or removes a result value adapter for use with

Callers 1

sqlite3InitModuleFunction · 0.70

Calls 3

setMethod · 0.80
tossFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected