File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -203,7 +203,7 @@ export class Util {
203203 }
204204 }
205205 }
206- return this . dataFactory . literal ( literal , activeTag . datatype || activeTag . language ) ;
206+ return this . dataFactory . literal ( literal , activeTag . datatype || activeTag . language ?. toLowerCase ( ) ) ;
207207 }
208208
209209 /**
Original file line number Diff line number Diff line change @@ -509,6 +509,14 @@ describe('Util', () => {
509509 . toEqualRdfTerm ( DF . literal ( 'abc' , 'en-us' ) ) ;
510510 } ) ;
511511
512+ it ( 'should create case-insensitive language literals' , async ( ) => {
513+ const activeTag : any = {
514+ language : 'EN-US' ,
515+ } ;
516+ return expect ( util . createLiteral ( 'abc' , activeTag ) )
517+ . toEqualRdfTerm ( DF . literal ( 'abc' , 'en-us' ) ) ;
518+ } ) ;
519+
512520 it ( 'should give preference to datatype literals over language literals' , async ( ) => {
513521 const activeTag : any = {
514522 datatype : DF . namedNode ( 'http://example.org/datatype' ) ,
You can’t perform that action at this time.
0 commit comments