@putout/operate
Advanced tools
@@ -14,2 +14,3 @@ 'use strict'; | ||
const {setLiteralValue} = require('./set-literal-value'); | ||
const {getPathAfterRequires} = require('./get-path-after-requires'); | ||
@@ -143,2 +144,3 @@ const { | ||
module.exports.getPathAfterRequires = getPathAfterRequires; | ||
module.exports.getPathAfterImports = (body) => { | ||
@@ -145,0 +147,0 @@ const n = body.length; |
{ | ||
"name": "@putout/operate", | ||
"version": "12.6.0", | ||
"version": "12.7.0", | ||
"type": "commonjs", | ||
@@ -5,0 +5,0 @@ "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)", |
@@ -146,2 +146,11 @@ # Operate [![NPM version][NPMIMGURL]][NPMURL] [![Coverage Status][CoverageIMGURL]][CoverageURL] | ||
### `getPathAfterRequires(body)` | ||
Get next `path` after latest `require`: | ||
```js | ||
const programPath = path.scope.getProgramParent().path; | ||
const afterRequirePath = getPathAfterRequires(programPath.get('body')); | ||
``` | ||
### `getPathAfterImports(body)` | ||
@@ -148,0 +157,0 @@ |
24956
4.72%16
6.67%525
6.06%255
3.66%