@@ -5,8 +5,8 @@ import {concatMap, map} from 'rxjs/operators';
55import { of } from 'rxjs/internal/observable/of' ;
66import { Metatag } from './metatag' ;
77import { MetaEntity } from './meta.entity' ;
8+ import * as iconvLte from 'iconv-lite' ;
89
9- const iconvLte = require ( "iconv-lite" ) ;
1010export type Charset = string ;
1111export type IntermediateResult = Charset | null ;
1212export enum Errors {
@@ -30,14 +30,14 @@ export class UrlMetadataParser {
3030 [ 'bocu-1' , [ 0xFB , 0xEE , 0x28 ] ] ,
3131 [ 'gb-18030' , [ 0x84 , 0x31 , 0x95 , 0x33 ] ] ,
3232 ] . map ( ( [ c , bytes ] : [ string , number [ ] ] ) => {
33- return ( [ c , Buffer . from ( bytes ) ] as [ Charset , Buffer ] )
33+ return ( [ c , Buffer . from ( bytes ) ] as [ Charset , Buffer ] ) ;
3434 } ) ) ;
3535
3636 const startsWith = ( bom ) => {
37- return buf . slice ( 0 , bom . length ) . equals ( bom )
37+ return buf . slice ( 0 , bom . length ) . equals ( bom ) ;
3838 } ;
3939
40- for ( let [ charset , bom ] of boms ) {
40+ for ( const [ charset , bom ] of boms ) {
4141 if ( startsWith ( bom ) ) {
4242 return of ( charset . toUpperCase ( ) ) ;
4343 }
@@ -59,9 +59,9 @@ export class UrlMetadataParser {
5959 }
6060 return body . match ( / < m e t a [ ^ > ] + > / g) . map ( val => new Metatag ( val ) ) ;
6161 } )
62- )
62+ ) ;
6363 } ) ,
6464 map ( ( tags : Metatag [ ] ) => new MetaEntity ( tags ) )
65- )
65+ ) ;
6666 }
6767}
0 commit comments