import { TestOptions } from "../test" ; param query param source param opts returns export function reshapeInput ( query , source , opts ) { if ( typeof query !== "string" ) { throw new TypeError ( "Expecting query to be a string" ) ; } if ( typeof source !== "string" ) { throw new TypeError ( "Expecting source to be a string" ) ; } let reshapedQuery = query . normalize ( "NFD" ) . replace ( /[\u0300-\u036f]/g , "" ) ; let reshapedSource = source . normalize ( "NFD" ) . replace ( /[\u0300-\u036f]/g , "" ) ; if ( ! opts . caseSensitive ) { reshapedQuery = reshapedQuery . toLowerCase ( ) ; reshapedSource = reshapedSource . toLowerCase ( ) ; } return [ reshapedQuery , reshapedSource ] ; }