Skip to content

Latest commit

 

History

History
59 lines (42 loc) · 1.47 KB

File metadata and controls

59 lines (42 loc) · 1.47 KB

contains-to-includes

Ember 2.8 introduced a new deprecation to remove the use of contains for `includes, this codemod will change migrate all such occurrences for you.

Usage

npx ember2-x-codemods contains-to-includes path/of/files/ or/some**/*glob.js

# or

yarn global add ember2-x-codemods
ember2-x-codemods contains-to-includes path/of/files/ or/some**/*glob.js

Local Usage

node ./bin/cli.js contains-to-includes path/of/files/ or/some**/*glob.js

Input / Output


array-expression

Input (array-expression.input.js):

[1,2,3].contains(1);

Output (array-expression.output.js):

[1,2,3].includes(1);

variable

Input (variable.input.js):

let arr = [1,2,3];
arr.contains(1);

Output (variable.output.js):

let arr = [1,2,3];
arr.includes(1);