https://github.com/tntsuperman/nativizer
https://github.com/tntsuperman/nativizer
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/tntsuperman/nativizer
- Owner: TNTSuperMan
- Created: 2024-12-16T06:05:31.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-12-16T06:08:45.000Z (6 months ago)
- Last Synced: 2025-01-23T13:52:16.861Z (4 months ago)
- Language: TypeScript
- Size: 32.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# nativizer
normal function to native function.
## Usage
```js
const nativefn = nativize(()=>console.log("Hey!"))
console.log(nativefn.toString()) //function () { [native code] }
```
## Warn
If the first and subsequent arguments of the nativized function are not specified, the first argument of the original function is undefined.
It is possible to resolve this by specifying strictLen, but if the first argument is left undefined in the nativized function and no further arguments are specified, the first argument of the original function will not be specified.