MCPcopy Create free account
hub / github.com/cujojs/poly / has

Function has

object.js:388–405  ·  view source on GitHub ↗
(feature)

Source from the content-addressed store, hash-verified

386 }
387
388 function has (feature) {
389 var ret;
390 var prop = featureMap[feature];
391
392 if (base.isFunction(prop)) {
393 // cache return value, ensure boolean
394 ret = featureMap[feature] = !!prop(refObj);
395 }
396 else if (base.isString(prop)) {
397 ret = featureMap[feature] = prop in refObj;
398 }
399 else {
400 // return cached evaluate result
401 ret = prop;
402 }
403
404 return ret;
405 }
406
407 function noop (it) { return it; }
408

Callers 1

object.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected