Skip to content

Instantly share code, notes, and snippets.

@danosier
Created May 21, 2025 15:56
Show Gist options
  • Save danosier/e62e3263714b335f1ad7df61533a2fbf to your computer and use it in GitHub Desktop.
Save danosier/e62e3263714b335f1ad7df61533a2fbf to your computer and use it in GitHub Desktop.
declare global {
interface String {
toUpperCase<T extends string>(this: T): Uppercase<T>;
toLowerCase<T extends string>(this: T): Lowercase<T>;
}
}
const x = 'foo';
const y = x.toUpperCase();
const z = y.toLowerCase();
if(x === z) {
console.log('x and z are equal');
}
console.log({ x, y, z });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment