Note; This is play-code. Not to be used in production. This particular code for instance uses a singleton pattern which means that you will spill values from one usage to the next. To get rid of that you need to implement the class-pattern where you new-up your own instance and dont get spilled data.
Now if you still want to hide the new-ing up of an instance, you can wrap it.
If you name your IIFE class to something like "myutil" and then make the global function "I" return a new instance of myutil using the same provided parameters as the function accepts.
// update all I.prototype to myutil.prototypeconstmyutil=(function(){functionmyutil(obj){this._obj=obj;this._negate=false;}...returnmyutil;}())// Update all Object.defineProperty calls on I.prototype to myutil.prototype...functionI(obj){returnnewmyutil(obj);}
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Note; This is play-code. Not to be used in production. This particular code for instance uses a singleton pattern which means that you will spill values from one usage to the next. To get rid of that you need to implement the class-pattern where you new-up your own instance and dont get spilled data.
For the sake of brevity, here's a class-style variation
Now if you still want to hide the new-ing up of an instance, you can wrap it.
If you name your IIFE class to something like "myutil" and then make the global function "I" return a new instance of myutil using the same provided parameters as the function accepts.