Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- async function searchAndReplace(files: string, from: RegExp, to: string) {
- const replaceInFiles = require('replace-in-file');
- try {
- let options = {
- files: files,
- from: from,
- to: to
- }
- let data = await replaceInFiles(options)
- const changedFiles = data
- .filter(result => result.hasChanged)
- .map(result => result.file)
- console.log(changedFiles)
- } catch (err) {
- throw err
- }
- }
- -----------------
- Error
- lib/index.ts(196,24): error TS7006: Parameter 'result' implicitly has an 'any' type.
- lib/index.ts(197,21): error TS7006: Parameter 'result' implicitly has an 'any' type.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement