How to use the devtools-protocol/json/js_protocol.json.domains function in devtools-protocol

To help you get started, we’ve selected a few devtools-protocol examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github paulirish / covfefe-coverage / coverage.js View on Github external
function spreadArguments(method, args) {
    const domainStr = method.split('.')[0];
    const eventStr = method.split('.')[1];

    const paramsArr = [];
    if (Object.keys(args).length > 0) {
      const domain = js_protocol.domains.find(d => d.domain === domainStr);
      const parameters = domain.events.find(c => c.name === eventStr).parameters;
      parameters.forEach(param => {
        paramsArr.push(args[param.name]);
      });
    }
    return paramsArr;
  }
}

devtools-protocol

The Chrome DevTools Protocol JSON

BSD-3-Clause
Latest version published 6 days ago

Package Health Score

84 / 100
Full package analysis

Popular devtools-protocol functions

Similar packages