@putout/operate
Advanced tools
Comparing version 10.1.0 to 10.2.0
@@ -6,3 +6,2 @@ 'use strict'; | ||
const {getBinding, getBindingPath} = require('./get-binding'); | ||
const {isSimple} = require('./is-simple'); | ||
@@ -17,4 +16,8 @@ const {extract} = require('./extract'); | ||
const {getProperty, getProperties} = require('./properties'); | ||
const { | ||
getProperty, | ||
getProperties, | ||
traverseProperties, | ||
} = require('./properties'); | ||
const { | ||
ExpressionStatement, | ||
@@ -39,4 +42,2 @@ toStatement, | ||
module.exports.getExportDefault = getExportDefault; | ||
module.exports.getProperty = getProperty; | ||
module.exports.getProperties = getProperties; | ||
module.exports.toExpression = toExpression; | ||
@@ -48,2 +49,6 @@ module.exports.isSimple = isSimple; | ||
module.exports.getProperty = getProperty; | ||
module.exports.getProperties = getProperties; | ||
module.exports.traverseProperties = traverseProperties; | ||
function toExpression(el) { | ||
@@ -50,0 +55,0 @@ const {type} = el; |
{ | ||
"name": "@putout/operate", | ||
"version": "10.1.0", | ||
"version": "10.2.0", | ||
"type": "commonjs", | ||
@@ -5,0 +5,0 @@ "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)", |
@@ -62,7 +62,7 @@ # Operate [![NPM version][NPMIMGURL]][NPMURL] [![Coverage Status][CoverageIMGURL]][CoverageURL] | ||
### `setLiteralValue(path | node)` | ||
### `setLiteralValue(path: Path | Node, value: string)` | ||
Set `raw` and `value` of a literal. | ||
### `isSimple(path | node)` | ||
### `isSimple(path: Path | Node)` | ||
@@ -233,4 +233,13 @@ Check if path is: | ||
### `traverseProperties(path: Path | Node, name: string)` | ||
Traverse list of properties from `ObjectExpression`. | ||
```js | ||
const object = template.ast('x({"a": "b"})'); | ||
const [propertyPath] = traverseProperties(object, 'a'); | ||
``` | ||
## License | ||
MIT |
21782
15
432
244