File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -99,5 +99,6 @@ export function stripWhitespace(str) {
9999 * @return {String }
100100 */
101101export function removeComments ( str ) {
102- return ( str || '' ) . replace ( / < ! - - ( [ \s \S ] * ?) - - > / g, '' ) ;
102+ if ( ! str ) return '' ;
103+ return str . replace ( / < ! - - [ \s \S ] * ?(?: - - > ) / g, '' ) ;
103104}
Original file line number Diff line number Diff line change @@ -11,10 +11,11 @@ export default class MemoryCache {
1111 * @param {String } translations[key] - Translation string
1212 */
1313 update ( localeCode , translations ) {
14- if ( ! this . translationsByLocale [ localeCode ] ) {
15- this . translationsByLocale [ localeCode ] = { } ;
16- }
17- Object . assign ( this . translationsByLocale [ localeCode ] , translations ) ;
14+ const prevTranslations = this . translationsByLocale [ localeCode ] || { } ;
15+ this . translationsByLocale [ localeCode ] = {
16+ ...prevTranslations ,
17+ ...translations ,
18+ } ;
1819 }
1920
2021 /**
You can’t perform that action at this time.
0 commit comments