Skip to content

Instantly share code, notes, and snippets.

@hash-bang
Created February 5, 2016 00:05
Show Gist options
  • Save hash-bang/91218c9e554dd7a0577e to your computer and use it in GitHub Desktop.
Save hash-bang/91218c9e554dd7a0577e to your computer and use it in GitHub Desktop.
Simple script to scan a directory recursively for potentially altered Lodash v4 functions
#!/bin/bash
# Scans a project recursively for depreciated lodash functions
#
# Usage: lodash-depreciated [other grep options]
#
# Lodash changelog - https://github.com/lodash/lodash/wiki/Changelog#v400
grep \
--color=auto -r \
--exclude-dir=node_modules --exclude-dir=bower_components --exclude-dir=.git --exclude-dir=build --exclude-dir=data \
-P '(_|\s)\.(findWhere|first|indexBy|invoke|padLeft|padRight|pairs|pluck|rest|restParam|sortByAll|sortByOrder|support|trimLeft|trimRight|trunc|where)' \
"$@" .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment