File tree Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -134,7 +134,7 @@ export class CommitFormatter {
134134 options = dateFormatOrOptions ;
135135 }
136136
137- return Strings . interpolateLazy ( template , new CommitFormatter ( commit , options ) ) ;
137+ return Strings . interpolate ( template , new CommitFormatter ( commit , options ) ) ;
138138 }
139139
140140 static toHoverAnnotation ( commit : GitCommit , dateFormat : string = 'MMMM Do, YYYY h:MMa' ) : string | string [ ] {
Original file line number Diff line number Diff line change 11'use strict' ;
2- import { Objects } from './object' ;
32const _escapeRegExp = require ( 'lodash.escaperegexp' ) ;
43
54export namespace Strings {
@@ -37,13 +36,11 @@ export namespace Strings {
3736 return tokens ;
3837 }
3938
40- export function interpolate ( template : string , tokens : { [ key : string ] : any } ) : string {
41- return new Function ( ...Object . keys ( tokens ) , `return \`${ template } \`;` ) ( ...Objects . values ( tokens ) ) ;
42- }
39+ export function interpolate ( template : string , context : object ) : string {
40+ if ( ! template ) return template ;
4341
44- export function interpolateLazy ( template : string , context : object ) : string {
45- template = template . replace ( TokenSanitizeRegex , '$${c.$1}' ) ;
46- return new Function ( 'c' , `return \`${ template } \`;` ) ( context ) ;
42+ template = template . replace ( TokenSanitizeRegex , '$${this.$1}' ) ;
43+ return new Function ( `return \`${ template } \`;` ) . call ( context ) ;
4744 }
4845
4946 export function padLeft ( s : string , padTo : number , padding : string = '\u00a0' ) {
You can’t perform that action at this time.
0 commit comments