This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * It creates a function that has the same properties as the class it is called on. | |
| * @see {@link 'https://docs.python.org/3/reference/datamodel.html#object.__call__'} | |
| * @param cls - The object to be called. | |
| * @returns A function that is callable. | |
| */ | |
| function ObjectCallable(cls) { | |
| let func = () => func.__call__(this, arguments); | |
| for (let key in cls) func[key] = cls[key]; |