Created
April 21, 2017 16:53
-
-
Save coreylight/9571ce0e699c654c9b0f9b76fc887917 to your computer and use it in GitHub Desktop.
Serverless Plugin Post Block 3
This file contains hidden or 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 shift = require('jscodeshift'); | |
const code = 'The string literal of the code to transform (from above)'; | |
const searchObject = { | |
left: { | |
type: 'MemberExpression', | |
object: { | |
type: 'Identifier', | |
name: 'exports' | |
}, | |
property: { | |
type: 'Identifier', | |
name: 'handler' | |
} | |
} | |
}; | |
const found = shift(code).find(shift.AssignmentExpression, searchObject); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment