Skip to content

Instantly share code, notes, and snippets.

View trevlar's full-sized avatar
😎

Trevor Carlston trevlar

😎
View GitHub Profile
@cletusw
cletusw / angular-injection-to-import.js
Last active May 16, 2019 23:46
Converts the given angular injected parameter into an explicit require statement
/*
* Converts the given angular injected parameter into an explicit require statement
*
* Run this with jscodeshift
* @example
* jscodeshift . --specifier='Auth' --source='application/Auth'
*
* Live demo: https://astexplorer.net/#/gist/5492d2b9850a451d8e8d532bc64f21ce/latest
*
* Converts:
/*
The MIT License (MIT)
Copyright (c) 2014 Ismael Celis
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is