Performs the following codemod:
- if (module.hot) {
- // any code inside the if statement
- }To run, execute the following command:
| import * as ClusterCron from '@effect/cluster/ClusterCron' | |
| import * as ClusterWorkflowEngine from '@effect/cluster/ClusterWorkflowEngine' | |
| import * as RunnerAddress from '@effect/cluster/RunnerAddress' | |
| import * as NodeClusterRunnerSocket from '@effect/platform-node/NodeClusterRunnerSocket' | |
| import * as NodeRuntime from '@effect/platform-node/NodeRuntime' | |
| import { TracerLayer } from '@my-app/open-telemetry/Tracer' | |
| import { SqlClientLayer } from '@my-app/sql/SqlClient' | |
| import * as Config from 'effect/Config' | |
| import * as Cron from 'effect/Cron' | |
| import * as Effect from 'effect/Effect' |
| 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: