Skip to content

Latest commit

 

History

History
47 lines (35 loc) · 1.05 KB

File metadata and controls

47 lines (35 loc) · 1.05 KB

get-properties

Transform this.getProperties('someProp') to getProperties(this, 'someProp') and ensure import of

import { getProperties } from "@ember/object";

Usage

npx lil-codemods run get-properties path/of/files/ or/some**/*glob.js

# or

yarn global add lil-codemods
lil-codemods run get-properties path/of/files/ or/some**/*glob.js

Input / Output


basic

Input (basic.input.js):

function hello() {
  const { whyNot } = this.getProperties("whyNot");
  const { okay: ok } = this.getProperties("okay");
}

Output (basic.output.js):

import { getProperties } from "@ember/object";
function hello() {
  const { whyNot } = getProperties(this, "whyNot");
  const { okay: ok } = getProperties(this, "okay");
}