diff --git a/js/grunt/updateCopyrightDates.ts b/js/grunt/updateCopyrightDates.ts index 7eaceeeb..477b9b78 100644 --- a/js/grunt/updateCopyrightDates.ts +++ b/js/grunt/updateCopyrightDates.ts @@ -8,8 +8,21 @@ */ import * as grunt from 'grunt'; +import _ from 'lodash'; import updateCopyrightDate from './updateCopyrightDate'; +const unsupportedExtensions = [ '.json', 'md' ]; + +const filesPredicate = ( file: string ) => { + if ( _.some( unsupportedExtensions, extension => file.endsWith( extension ) ) ) { + return false; + } + if ( file.startsWith( 'js/' ) ) { + return true; + } + return false; +}; + /** * @param repo - The repository name for the files to update * @param predicate - takes a repo-relative path {string} and returns {boolean} if the path should be updated. @@ -19,7 +32,7 @@ export default async function( repo: string, predicate = () => true ): Promise { relativeFiles.push( `${subdir}/${filename}` ); } ); - relativeFiles = relativeFiles.filter( file => file.startsWith( 'js/' ) ).filter( predicate ); + relativeFiles = relativeFiles.filter( filesPredicate ).filter( predicate ); for ( const relativeFile of relativeFiles ) { await updateCopyrightDate( repo, relativeFile );