@appium/logger
Version:
A Universal Logger For The Appium Ecosystem
12 lines (11 loc) • 405 B
text/typescript
/**
* This function is necessary to workaround unexpected memory leaks
* caused by NodeJS string interning
* behavior described in https://bugs.chromium.org/p/v8/issues/detail?id=2869
*
* @param {any} s - The string to unleak
* @return {string} Either the unleaked string or the original object converted to string
*/
export function unleakString(s: any): string {
return ` ${s}`.substring(1);
}