Skip to content

Instantly share code, notes, and snippets.

@coreylight
Created April 21, 2017 16:53
Show Gist options
  • Save coreylight/9571ce0e699c654c9b0f9b76fc887917 to your computer and use it in GitHub Desktop.
Save coreylight/9571ce0e699c654c9b0f9b76fc887917 to your computer and use it in GitHub Desktop.
Serverless Plugin Post Block 3
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