12.0.0 β’ Published 6 months ago
@putout/operator-add-args v12.0.0
@putout/operator-add-args 
πPutout operator adds ability to add argument that was not defined before.
Install
npm i putout @putout/operator-add-argsAPI
If you want to create πPutout plugin that will add args according to your needs just:
const {operator} = require('putout');
const {addArgs} = operator;
module.exports = addArgs({
comparePlaces: ['{comparePlaces}', 'test("__a", (__args) => __body)'],
t: ['{comparePlaces}', [
'test("__a", (__args) => __body)',
'test.only("__a", (__args) => __body)',
]],
maybe: ['{maybe}', [
'module.exports.__a = (__args) => __body',
]],
});If you have a file index.spec.js:
-test('', () => {
+test('', ({comparePlaces}) => {
comparePlaces();
});Plugin supports options, so you can pass it in .putout.json:
{
"rules": {
"tape/add-args": ["on", {
"args": {
"comparePlaces": ["{comparePlaces}", "test('__a', (__args) => __body)"]
}
}]
}
}License
MIT
10.0.0
10 months ago
10.0.1
10 months ago
12.0.0
6 months ago
9.1.0
10 months ago
11.0.0
8 months ago
11.0.1
8 months ago
9.0.0
1 year ago
8.0.1
2 years ago
8.0.0
2 years ago
5.1.0
2 years ago
5.0.0
2 years ago
6.0.1
2 years ago
6.0.0
2 years ago
6.0.3
2 years ago
6.0.2
2 years ago
7.0.0
2 years ago
7.1.0
2 years ago
7.0.1
2 years ago
4.4.1
2 years ago
4.4.3
2 years ago
4.4.2
2 years ago
4.4.0
3 years ago
4.1.0
3 years ago
4.0.0
3 years ago
4.3.0
3 years ago
4.2.0
3 years ago
3.1.0
4 years ago
3.0.1
4 years ago
3.0.0
4 years ago
2.0.1
4 years ago
2.0.0
4 years ago
1.1.0
4 years ago
1.0.1
4 years ago
1.0.0
4 years ago