openaire-library/utils/HelperFunctions.class.ts

16 lines
458 B
TypeScript
Raw Normal View History

export class HelperFunctions {
//Use this class function to create queryParams Objects in format {key1:value1} or {key1:value1,key2:value2,key3:value3,...} for multiple parameters
constructor() {}
public static scroll() {
if (typeof document !== 'undefined') {
//this.element.nativeElement.scrollIntoView();
window.scrollTo(0, 0);
}
}
public static isTiny(url: string) {
return (url.indexOf('tinyurl.com') !== -1);
}
}