Performs the following codemod:
- if (module.hot) {
- // any code inside the if statement
- }
To run, execute the following command:
const isNbaBasketball = matches({ | |
type: 'basketball', | |
ballColor: 'orange', | |
ballMaker: /spalding/i, | |
'league.type': 'NBA' | |
}) | |
↓ ↓ ↓ ↓ ↓ ↓ | |
const isNbaBasketball = arg => { |
┬─┬ ノʕ•ᴥ•ノʔ |
ʕノ•ᴥ•ʔノ ︵ ┻━┻ |
/@ | |
__ __ /\/ | |
/==\ / \_/\/ | |
/======\ \/\__ \__ | |
/==/\ /\==\ /\_|__ \ | |
/==/ || \=\ / / / /_/ | |
/=/ /\ || /\ \=\/ / | |
/===/ / \||/ \ \===\ | |
/===/ /_________________ \===\ |
Performs the following codemod:
- if (module.hot) {
- // any code inside the if statement
- }
To run, execute the following command:
Benchmarking the code change in gatsbyjs/gatsby#7909
Example results on my machine:
// Model Name: MacBook Pro
// Model Identifier: MacBookPro14,3
// Processor Name: Intel Core i7
// Processor Speed: 2.8 GHz
// Number of Processors: 1
var person = { | |
name: "Ben", | |
print: function() { | |
var self = this; | |
console.log(this.name); | |
(function() { | |
console.log(this.name); | |
console.log(self.name); |
jscodeshift codemod that converts object shorthand syntax
// from this
const person = {
name: function() {
return this.firstName + " " + this.lastName;
}
};
I hereby claim:
To claim this, I am signing this object: