🚀 Socket Launch Week 🚀 Day 4: Introducing Historical Analytics.Learn More

@putout/operate

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@putout/operate - npm Package Compare versions

Comparing version

to
12.7.0

@@ -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 @@