🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

hono

Package Overview
Dependencies
Maintainers
1
Versions
442
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hono - npm Package Compare versions

Comparing version
4.12.32
to
4.12.33
+14
-11
dist/cjs/jsx/hooks/index.js

@@ -333,15 +333,18 @@ var __defProp = Object.defineProperty;

}
const [serverSnapshotIsUsed] = useState(!!(buildData[0][4] && getServerSnapshot));
const [state, setState] = useState(
() => serverSnapshotIsUsed ? getServerSnapshot() : getSnapshot()
);
const snapshot = buildData[0][4] && getServerSnapshot ? getServerSnapshot() : getSnapshot();
const [, setVersion] = useState(0);
const latestSnapshot = useRef([snapshot, getSnapshot]);
latestSnapshot.current = [snapshot, getSnapshot];
const unsubscribeRef = useRef(null);
useEffect(() => {
if (serverSnapshotIsUsed) {
setState(getSnapshot());
const update2 = () => setVersion((version) => version + 1);
unsubscribeRef.current?.();
unsubscribeRef.current = subscribe(update2);
const [snapshot2, getSnapshot2] = latestSnapshot.current;
if (!Object.is(snapshot2, getSnapshot2())) {
update2();
}
return subscribe(() => {
setState(getSnapshot());
});
}, []);
return state;
}, [subscribe]);
useEffect(() => () => unsubscribeRef.current?.(), []);
return snapshot;
};

@@ -348,0 +351,0 @@ // Annotate the CommonJS export names for ESM import in node:

@@ -50,2 +50,3 @@ var __defProp = Object.defineProperty;

const validCookieNameRegEx = /^[\w!#$%&'*.^`|~+-]+$/;
const relaxedCookieNameRegEx = /^[!#-:<>-[\]-~]+$/;
const validCookieValueRegEx = /^[ !#-:<-[\]-~]*$/;

@@ -83,3 +84,3 @@ const trimCookieWhitespace = (value) => {

const cookieName = trimCookieWhitespace(pairStr.substring(0, valueStartPos));
if (name && name !== cookieName || !validCookieNameRegEx.test(cookieName) || cookieName in parsedCookie) {
if (name && name !== cookieName || !relaxedCookieNameRegEx.test(cookieName) || cookieName in parsedCookie) {
continue;

@@ -86,0 +87,0 @@ }

@@ -292,15 +292,18 @@ // src/jsx/hooks/index.ts

}
const [serverSnapshotIsUsed] = useState(!!(buildData[0][4] && getServerSnapshot));
const [state, setState] = useState(
() => serverSnapshotIsUsed ? getServerSnapshot() : getSnapshot()
);
const snapshot = buildData[0][4] && getServerSnapshot ? getServerSnapshot() : getSnapshot();
const [, setVersion] = useState(0);
const latestSnapshot = useRef([snapshot, getSnapshot]);
latestSnapshot.current = [snapshot, getSnapshot];
const unsubscribeRef = useRef(null);
useEffect(() => {
if (serverSnapshotIsUsed) {
setState(getSnapshot());
const update2 = () => setVersion((version) => version + 1);
unsubscribeRef.current?.();
unsubscribeRef.current = subscribe(update2);
const [snapshot2, getSnapshot2] = latestSnapshot.current;
if (!Object.is(snapshot2, getSnapshot2())) {
update2();
}
return subscribe(() => {
setState(getSnapshot());
});
}, []);
return state;
}, [subscribe]);
useEffect(() => () => unsubscribeRef.current?.(), []);
return snapshot;
};

@@ -307,0 +310,0 @@ export {

@@ -26,2 +26,3 @@ // src/utils/cookie.ts

var validCookieNameRegEx = /^[\w!#$%&'*.^`|~+-]+$/;
var relaxedCookieNameRegEx = /^[!#-:<>-[\]-~]+$/;
var validCookieValueRegEx = /^[ !#-:<-[\]-~]*$/;

@@ -59,3 +60,3 @@ var trimCookieWhitespace = (value) => {

const cookieName = trimCookieWhitespace(pairStr.substring(0, valueStartPos));
if (name && name !== cookieName || !validCookieNameRegEx.test(cookieName) || cookieName in parsedCookie) {
if (name && name !== cookieName || !relaxedCookieNameRegEx.test(cookieName) || cookieName in parsedCookie) {
continue;

@@ -62,0 +63,0 @@ }

{
"name": "hono",
"version": "4.12.32",
"version": "4.12.33",
"description": "Web framework built on Web Standards",

@@ -670,3 +670,3 @@ "main": "dist/cjs/index.js",

"@hono/eslint-config": "^2.1.1",
"@hono/node-server": "^2.0.2",
"@hono/node-server": "^2.0.12",
"@types/jsdom": "^21.1.7",

@@ -689,3 +689,2 @@ "@types/node": "^24.3.0",

"typescript": "^6.0.3",
"undici": "^6.27.0",
"vite-plugin-fastly-js-compute": "^0.4.2",

@@ -692,0 +691,0 @@ "vitest": "^4.1.9",