MCPcopy Create free account
hub / github.com/DavidWells/analytics / METHODZ

Function METHODZ

packages/analytics-cli/src/commands/docs.js:77–98  ·  view source on GitHub ↗
(content, options, context)

Source from the content-addressed store, hash-verified

75 return updatedContent.replace(/^\s+|\s+$/g, '')
76 },
77 METHODZ(content, options, context) {
78 let updatedContent = ''
79 const opts = options || {}
80 const basePath = path.dirname(context.originalPath)
81 const browserPath = opts.browser || path.join(basePath, 'src/browser.js')
82 const nodePath = opts.node || path.join(basePath, 'src/node.js')
83 const packageJson = fs.readFileSync(path.join(basePath, 'package.json'), 'utf-8')
84 const pkg = JSON.parse(packageJson)
85
86 // TODO parse AST and get available methods
87 const lib = require(path.resolve(pkg.main))
88
89 if (typeof lib === 'function') {
90 const string = lib.toString()
91 // console.log('string', string)
92
93 // const methods = lib()
94 // console.log('methods', methods)
95 }
96 // console.log('lib', lib)
97 return updatedContent
98 }
99 }
100}
101

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected