I was adding a property to string.
Object.defineProperty(String.prototype, "capitalize", {
value: function () {
return this.charAt(0).toUpperCase() + this.slice(1);
},
enumerable: false,
});
by doing something like this,
Now, When I use it
const abc = 'abc'.capitalize()
typescript throws an error
Property 'capitalize' does not exist on type 'string'.