🐊Putout plugin adds ability apply to '.starts.with()'
npm install @putout/plugin-apply-starts-with[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-apply-starts-with.svg?style=flat&longCache=true
[NPMURL]: https://npmjs.org/package/@putout/plugin-apply-starts-with "npm"
> The startsWith() method determines whether a string begins with the characters of a specified string, returning true or false as appropriate.
>
> (c) MDN
🐊Putout plugin adds ability to apply .startsWith().
Checkout in 🐊Putout Editor.
```
npm i @putout/plugin-apply-starts-with
`json`
{
"rules": {
"apply-starts-with": "on"
}
}
`js
function x(a = '') {
if (!a.indexOf('1'))
return false;
}
function x1({a = ''}) {
return !a.indexOf('1');
}
function x2() {
const {a = ''} = z;
return !a.indexOf('1');
}
`
`js
function x(a = '') {
return a.startsWith('1');
}
function x1({a = ''}) {
return a.startsWith('1');
}
function x2() {
const {a = ''} = z;
return a.startsWith('1');
}
``
MIT