MCPcopy Create free account
hub / github.com/npm/cli / getOpts

Function getOpts

smoke-tests/test/fixtures/setup.js:24–30  ·  view source on GitHub ↗
(...a)

Source from the content-addressed store, hash-verified

22const GLOBAL_NODE_MODULES = join(WINDOWS ? '' : 'lib', 'node_modules')
23
24const getOpts = (...a) => {
25 const [opts, args] = a.reduce((acc, arg) => {
26 acc[typeof arg === 'object' ? 0 : 1].push(arg)
27 return acc
28 }, [[], []])
29 return [Object.assign({}, ...opts), args]
30}
31
32const normalizePath = path => path.replace(/[A-Z]:/, '').replace(/\\/g, '/')
33

Callers 2

baseNpmFunction · 0.85
npmLocalFunction · 0.85

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected