Created
November 17, 2019 15:36
-
-
Save MiKolka7/7d98694edd57715e7b5cf80a0c4d40f2 to your computer and use it in GitHub Desktop.
package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs') | |
const pathVuex = './node_modules/vuex/types/index.d.ts' | |
const pathVue = './node_modules/vuex/types/vue.d.ts' | |
function exitIfErr(err) { | |
if (err) { | |
process.exit(1) | |
} | |
} | |
fs.readFile(pathVuex, 'utf8', (err, data) => { | |
exitIfErr(err) | |
const res = data | |
.replace(/(\(type: string, payload\?: any, options\?)/g, '// $1') | |
.replace(/(<P extends Payload>\(payloadWithType: P)/g, '// $1') | |
fs.writeFile(pathVuex, res, exitIfErr) | |
}) | |
fs.readFile(pathVue, 'utf8', (err, data) => { | |
exitIfErr(err) | |
const res = data.replace(/(\$store: Store<any>;)/g, '// $1') | |
fs.writeFile(pathVue, res, exitIfErr) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment