⚝
One Hat Cyber Team
⚝
Your IP:
172.22.0.1
Server IP:
151.80.20.34
Server:
Linux 794f04d97d5e 5.15.0-143-generic #153-Ubuntu SMP Fri Jun 13 19:10:45 UTC 2025 x86_64
Server Software:
Apache/2.4.62 (Debian)
PHP Version:
8.2.28
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
nodejs
/
@isaacs
/
import-jsx
/
Edit File: index.js
'use strict'; const path = require('path'); const resolveFrom = require('resolve-from'); const callerPath = require('caller-path'); const cache = require('./cache'); const {version} = require('./package.json'); const importJsx = (moduleId, options) => { if (typeof moduleId !== 'string') { throw new TypeError('Expected a string'); } options = { pragma: 'h', pragmaFrag: 'Fragment', cache: true, ...options }; const modulePath = resolveFrom(path.dirname(callerPath()), moduleId); if (!options.cache) { delete require.cache[modulePath]; } // If they used .jsx, and there's already a .jsx, then hook there // Otherwise, hook node's default .js const ext = path.extname(modulePath); const hookExt = require.extensions[ext] ? ext : '.js'; const oldExtension = require.extensions[hookExt]; require.extensions[hookExt] = module => { const oldCompile = module._compile; module._compile = source => { const result = cache({ modulePath, options, source, version }); module._compile = oldCompile; module._compile(result, modulePath); }; require.extensions[hookExt] = oldExtension; oldExtension(module, modulePath); }; const m = require(modulePath); require.extensions[hookExt] = oldExtension; if (!options.cache) { delete require.cache[modulePath]; } return m; }; module.exports = importJsx; module.exports.default = importJsx; module.exports.create = options => { return moduleId => importJsx(moduleId, options); };
Simpan