UNPKG

nehonix-uri-processor

Version:

A powerful URI processor for encoding, decoding, and analyzing URI data securely.

23 lines 1.06 kB
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState } from "react"; import { NehonixShieldProvider, } from ".."; const App = () => { return (_jsxs(NehonixShieldProvider, { children: [" ", _jsx(SecurityDemo, {})] })); }; const SecurityDemo = () => { // const { scanUrl, provideFeedback, getPerformanceMetrics } = // useNehonixShield(); const [result, setResult] = useState(null); const handleAnalyze = async () => { const url = "https://malicious.com/login?obj[__proto__][polluted]=true"; // const analysis = await scanUrl(url, { // ignorePatterns: [MaliciousPatternType.ANOMALY], // }); // setResult(analysis); // provideFeedback(url, analysis, true); // console.log("Metrics:", getPerformanceMetrics()); }; return (_jsxs("div", { children: [_jsx("button", { onClick: handleAnalyze, children: "Analyze URL" }), result && _jsx("pre", { children: JSON.stringify(result, null, 2) })] })); }; export default App; //# sourceMappingURL=react.test.js.map