MCPcopy Index your code

hub / github.com/facebook/jscodeshift / functions

Functions135 in github.com/facebook/jscodeshift

↓ 41 callersFunctioncreateTempFileWith
(content, filename, extension)
utils/testUtils.js:23
↓ 35 callersFunctionreadFile
(path)
bin/__tests__/jscodeshift-test.js:25
↓ 24 callersMethodforEach
* Executes callback for each node/path in the collection. * * @param {function} callback * @return {Collection} The collection itself
src/Collection.js:73
↓ 24 callersFunctionrun
(args, stdin, cwd)
bin/__tests__/jscodeshift-test.js:29
↓ 22 callersMethodmap
* Executes the callback for every path in the collection and returns a new * collection from the return values (which must be paths). * * The
src/Collection.js:117
↓ 21 callersMethodnodes
* Returns an array of AST nodes in this collection. * * @return {Array}
src/Collection.js:158
↓ 20 callersFunctioncreateTransformWith
(content, ext='.js')
utils/testUtils.js:37
↓ 19 callersMethodtoSource
(options)
src/Collection.js:173
↓ 16 callersMethodget
* Proxies to NodePath#get of the first path. * * @param {string|number} ...fields
src/Collection.js:210
↓ 15 callersMethodfilter
* Returns a new collection containing the nodes for which the callback * returns true. * * @param {function} callback * @return {Collectio
src/Collection.js:63
↓ 11 callersFunctiondone
()
src/Runner.js:101
↓ 11 callersMethodgetTypes
* Returns the type(s) of the collection. This is only used for unit tests, * I don't think other consumers would need it. * * @return {Array<
src/Collection.js:227
↓ 10 callersFunctioncore
* Main entry point to the tool. The function accepts multiple different kinds * of arguments as a convenience. In particular the function accepts eit
src/core.js:42
↓ 10 callersMethodevery
* Tests whether all paths pass the test implemented by the provided callback. * * @param {function} callback * @return {boolean}
src/Collection.js:98
↓ 9 callersFunctionexpression
(template/*, ...nodes*/)
src/template.js:131
↓ 7 callersFunctionupdateStatus
(status, file, msg)
src/Worker.js:108
↓ 6 callersFunctioncallback
()
src/argsParser.js:95
↓ 6 callersFunctiongetModuleToTransform
()
src/__tests__/testUtils-test.js:20
↓ 6 callersMethodsome
* Tests whether at-least one path passes the test implemented by the provided callback. * * @param {function} callback * @return {boolean}
src/Collection.js:86
↓ 5 callersMethodat
* Returns a new collection containing only the element at position index. * * In case of a negative index, the element is taken from the end:
src/Collection.js:195
↓ 5 callersFunctiongetFileContent
(filePath)
utils/testUtils.js:46
↓ 5 callersMethodpaths
()
src/Collection.js:162
↓ 5 callersFunctionsplice
(arr, element, replacement)
src/template.js:16
↓ 4 callersFunctionmatchNode
* Checks whether needle is a strict subset of haystack. * * @param {*} haystack Value to test. * @param {*} needle Test function or value to look f
src/matchNode.js:21
↓ 4 callersFunctiontransform
(transformFile)
src/Runner.js:218
↓ 3 callersFunctiondefineInlineTest
(module, options, input, expectedOutput, testName)
src/testUtils.js:142
↓ 3 callersFunctionfromPaths
* Creates a new collection from an array of node paths. * * If type is passed, it will create a typed collection if such a collection * exists. The
src/Collection.js:315
↓ 3 callersFunctiongetHelpText
(options)
src/argsParser.js:48
↓ 3 callersFunctiongetTransformForParser
(parser)
src/__tests__/Worker-test.js:55
↓ 3 callersFunctionisOption
(value)
src/argsParser.js:121
↓ 3 callersFunctionregister
(methodName, type)
src/__tests__/Collection-test.js:177
↓ 3 callersFunctionthrowError
* Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root d
src/argsParser.js:8
↓ 3 callersFunctiontoArray
(value)
src/collections/Node.js:123
↓ 2 callersFunction_toTypeArray
(value)
src/Collection.js:271
↓ 2 callersFunctionapplyTransform
(module, options, input, testOptions = {})
src/testUtils.js:15
↓ 2 callersFunctiondefineTest
* Handles some boilerplate around defining a simple jest/Jasmine test for a * jscodeshift transform.
src/testUtils.js:129
↓ 2 callersFunctionenrichCore
* The ast-types library * @external astTypes * @see {@link https://github.com/benjamn/ast-types}
src/core.js:154
↓ 2 callersFunctionextensionForParser
(parser)
src/testUtils.js:72
↓ 2 callersFunctionfromAST
* Returns a collection from a node, node path, array of nodes or array of node * paths. * * @ignore * @param {Node|NodePath|Array} source * @retu
src/core.js:56
↓ 2 callersFunctiongetSourceFile
()
src/__tests__/Worker-test.js:66
↓ 2 callersFunctionisNode
(value)
src/matchNode.js:36
↓ 2 callersFunctionlineBreak
(str)
src/Runner.js:25
↓ 2 callersFunctionnext
()
src/Runner.js:237
↓ 2 callersFunctionparse
()
src/__tests__/argsParser-test.js:66
↓ 2 callersFunctionrun
(data)
src/Worker.js:140
↓ 2 callersFunctionrun
(paths, options)
bin/jscodeshift.js:168
↓ 2 callersFunctionrunInlineTest
(module, options, input, expectedOutput, testOptions)
src/testUtils.js:58
↓ 2 callersFunctionsetup
(tr, babel)
src/Worker.js:54
↓ 2 callersFunctionstatement
(/*template, ...nodes*/)
src/template.js:127
↓ 2 callersFunctiontypeFilter
(type)
src/__tests__/Collection-test.js:160
↓ 1 callersFunction_getSupertypeNames
(type)
src/Collection.js:283
↓ 1 callersFunction_inferTypes
* Given a set of paths, this infers the common types of all paths. * @private * @param {Array} paths An array of paths. * @return {Type} type An AS
src/Collection.js:248
↓ 1 callersFunctioncleanLocation
(node)
src/template.js:20
↓ 1 callersFunctiondefineSnapshotTest
(module, options, input, testName)
src/testUtils.js:152
↓ 1 callersFunctiondefineSnapshotTestFromFixture
* Handles file-loading boilerplates, using same defaults as defineTest
src/testUtils.js:165
↓ 1 callersFunctiondirFiles
(dir, callback, acc)
src/Runner.js:97
↓ 1 callersFunctionensureStatement
(node)
src/template.js:27
↓ 1 callersFunctionfree
()
src/Worker.js:104
↓ 1 callersFunctionfromSource
(source, options)
src/core.js:75
↓ 1 callersFunctiongetAllFiles
(paths, filter)
src/Runner.js:138
↓ 1 callersFunctiongetUniqueVarName
()
src/template.js:105
↓ 1 callersFunctiongetVistor
(varNames, nodes)
src/template.js:35
↓ 1 callersFunctionhasConflictingRegistration
(methodName, type)
src/Collection.js:428
↓ 1 callersFunctioninstallTypedMethod
(methodName)
src/Collection.js:400
↓ 1 callersMethodisOfType
* Returns true if this collection has the type 'type'. * * @param {Type} type * @return {boolean}
src/Collection.js:237
↓ 1 callersFunctionplugin
()
src/__tests__/core-test.js:67
↓ 1 callersFunctionprepareJscodeshift
(options)
src/Worker.js:48
↓ 1 callersFunctionprepareOptions
(options)
src/argsParser.js:90
↓ 1 callersFunctionrenameFileTo
(oldPath, newFilename, extension = '')
utils/testUtils.js:15
↓ 1 callersFunctionreplaceNodes
(src, varNames, nodes, parser)
src/template.js:98
↓ 1 callersFunctionreport
({file, msg})
src/Runner.js:65
↓ 1 callersFunctionreport
(file, msg)
src/Worker.js:113
↓ 1 callersFunctionrunSnapshotTest
(module, options, input)
src/testUtils.js:45
↓ 1 callersFunctionrunTest
* Utility function to run a jscodeshift script within a unit test. This makes * several assumptions about the environment: * * - `dirName` contains
src/testUtils.js:101
↓ 1 callersFunctionshowFileStats
(fileStats)
src/Runner.js:79
↓ 1 callersFunctionshowStats
(stats)
src/Runner.js:89
↓ 1 callersFunctionstatements
(template/*, ...nodes*/)
src/template.js:111
↓ 1 callersFunctiontest
(testCases)
src/utils/__tests__/intersection-test.js:12
↓ 1 callersFunctiontest
(testCases)
src/utils/__tests__/union-test.js:12
↓ 1 callersFunctiontest
(testCases)
src/__tests__/argsParser-test.js:59
↓ 1 callersFunctiontrimStackTrace
(trace)
src/Worker.js:124
↓ 1 callersFunctionvalidateOptions
(parsedOptions, options)
src/argsParser.js:71
FunctionaddIgnoreFromFile
* Adds ignore patterns by reading files * @param {String|Array<String>} input - the paths to the ignore config files
src/ignoreFiles.js:43
FunctionaddIgnoreFromInput
* Adds ignore patterns directly from function input * @param {String|Array<String>} input - the ignore patterns
src/ignoreFiles.js:31
FunctionaddIgnorePattern
* Add glob patterns to ignore matched files and folders. * Creates glob patterns to approximate gitignore patterns. * @param {String} val - the glob
src/ignoreFiles.js:14
Functionaddition
(a, b)
src/__testfixtures__/test-async-transform.output.js:1
Functionaddition
(a, b)
src/__testfixtures__/test-sync-transform.output.js:1
FunctionasyncExpression
(template/*, ...nodes*/)
src/template.js:152
Methodbar
()
sample/__testfixtures__/reverse-identifiers.input.js:7
FunctionconcatAll
(arrays)
src/Runner.js:69
Methodconstructor
* @param {Array} paths An array of AST paths * @param {Collection} parent A parent collection * @param {Array} types An array of types all the p
src/Collection.js:40
FunctionegasseMteg
()
sample/__testfixtures__/typescript/reverse-identifiers.output.ts:7
Functionempty
()
src/Worker.js:117
Functionerror
(msg, verbose)
src/Runner.js:60
FunctionformatOption
(option)
src/argsParser.js:16
FunctionfromNodes
* Creates a new collection from an array of nodes. This is a convenience * method which converts the nodes to node paths first and calls * * Col
src/Collection.js:336
MethodgetAST
()
src/Collection.js:166
FunctiongetMessage
()
sample/__testfixtures__/typescript/reverse-identifiers.input.ts:7
FunctionidentifierMethod
()
src/__tests__/Collection-test.js:119
Methodlength
* Returns the number of elements in this collection. * * @return {number}
src/Collection.js:149
next →1–100 of 135, ranked by callers