MCPcopy
hub / github.com/socketio/socket.io / enable

Function enable

packages/socket.io/client-dist/socket.io.js:2667–2689  ·  view source on GitHub ↗

* Enables a debug mode by namespaces. This can include modes * separated by a colon and wildcards. * * @param {String} namespaces * @api public

(namespaces)

Source from the content-addressed store, hash-verified

2665 * @api public
2666 */
2667 function enable(namespaces) {
2668 createDebug.save(namespaces);
2669 createDebug.namespaces = namespaces;
2670 createDebug.names = [];
2671 createDebug.skips = [];
2672 var split = (typeof namespaces === 'string' ? namespaces : '').trim().replace(/\s+/g, ',').split(',').filter(Boolean);
2673 var _iterator = _createForOfIteratorHelper(split),
2674 _step;
2675 try {
2676 for (_iterator.s(); !(_step = _iterator.n()).done;) {
2677 var ns = _step.value;
2678 if (ns[0] === '-') {
2679 createDebug.skips.push(ns.slice(1));
2680 } else {
2681 createDebug.names.push(ns);
2682 }
2683 }
2684 } catch (err) {
2685 _iterator.e(err);
2686 } finally {
2687 _iterator.f();
2688 }
2689 }
2690
2691 /**
2692 * Checks if the given string matches a namespace template, honoring

Callers

nothing calls this directly

Calls 5

eMethod · 0.80
saveMethod · 0.45
sMethod · 0.45
nMethod · 0.45

Tested by

no test coverage detected