MCPcopy Index your code
hub / github.com/nodejs/node / hasProtocol

Function hasProtocol

lib/internal/streams/iter/utils.js:199–206  ·  view source on GitHub ↗

* Check if a value implements a Symbol-keyed protocol (has a function * at the given symbol key). * @param {unknown} value * @param {symbol} symbol * @returns {boolean}

(value, symbol)

Source from the content-addressed store, hash-verified

197 * @returns {boolean}
198 */
199function hasProtocol(value, symbol) {
200 return (
201 value !== null &&
202 typeof value === 'object' &&
203 symbol in value &&
204 typeof value[symbol] === 'function'
205 );
206}
207
208/**
209 * Check if a value is PullOptions (object without transform or write property).

Callers 5

isShareableFunction · 0.85
isSyncShareableFunction · 0.85
isBroadcastableFunction · 0.85
normalizeSyncValueFunction · 0.85
normalizeAsyncValueFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…