@dr.pogodin/react-helmet
Advanced tools
@@ -72,4 +72,8 @@ "use strict"; | ||
| } | ||
| oldTags.forEach(tag => tag.parentNode?.removeChild(tag)); | ||
| newTags.forEach(tag => headElement.appendChild(tag)); | ||
| oldTags.forEach(tag => { | ||
| tag.parentNode?.removeChild(tag); | ||
| }); | ||
| newTags.forEach(tag => { | ||
| headElement.appendChild(tag); | ||
| }); | ||
@@ -76,0 +80,0 @@ // TODO: Do we really need this return value anywhere? Especially `oldTags` |
@@ -18,2 +18,3 @@ "use strict"; | ||
| TAG_PROPERTIES["SRC"] = "src"; | ||
| TAG_PROPERTIES["TARGET"] = "target"; | ||
| return TAG_PROPERTIES; | ||
@@ -30,2 +31,3 @@ }({}); | ||
| TAG_NAMES["BODY"] = "body"; | ||
| TAG_NAMES["FRAGMENT"] = "Symbol(react.fragment)"; | ||
| TAG_NAMES["HEAD"] = "head"; | ||
@@ -39,3 +41,2 @@ TAG_NAMES["HTML"] = "html"; | ||
| TAG_NAMES["TITLE"] = "title"; | ||
| TAG_NAMES["FRAGMENT"] = "Symbol(react.fragment)"; | ||
| return TAG_NAMES; | ||
@@ -42,0 +43,0 @@ }({}); |
@@ -8,4 +8,4 @@ "use strict"; | ||
| var _react = require("react"); | ||
| var _Provider = require("./Provider"); | ||
| var _constants = require("./constants"); | ||
| var _Provider = require("./Provider"); | ||
| var _utils = require("./utils"); | ||
@@ -12,0 +12,0 @@ function assertChildType(childType, nestedChildren) { |
@@ -26,4 +26,4 @@ "use strict"; | ||
| var _Helmet = _interopRequireDefault(require("./Helmet")); | ||
| var _MetaTags = _interopRequireDefault(require("./MetaTags")); | ||
| var _Provider = _interopRequireDefault(require("./Provider")); | ||
| var _MetaTags = _interopRequireDefault(require("./MetaTags")); | ||
| //# sourceMappingURL=index.js.map |
@@ -8,6 +8,6 @@ "use strict"; | ||
| var _react = require("react"); | ||
| var _client = require("./client"); | ||
| var _constants = require("./constants"); | ||
| var _server = require("./server"); | ||
| var _constants = require("./constants"); | ||
| var _utils = require("./utils"); | ||
| var _client = require("./client"); | ||
| var _jsxRuntime = require("react/jsx-runtime"); | ||
@@ -14,0 +14,0 @@ const Context = exports.Context = /*#__PURE__*/(0, _react.createContext)(undefined); |
@@ -74,3 +74,3 @@ "use strict"; | ||
| const res = props[i][1].base; | ||
| if (res?.href) return res; | ||
| if (res?.href || res?.target) return res; | ||
| } | ||
@@ -151,3 +151,5 @@ return undefined; | ||
| // so approved tags are accumulated from last to first | ||
| .forEach(tag => approvedTags.push(tag)); | ||
| .forEach(tag => { | ||
| approvedTags.push(tag); | ||
| }); | ||
@@ -154,0 +156,0 @@ // Update seen tags with tags from this instance |
@@ -66,4 +66,8 @@ import { HELMET_ATTRIBUTE, HTML_TAG_MAP, TAG_NAMES, TAG_PROPERTIES } from './constants'; | ||
| } | ||
| oldTags.forEach(tag => tag.parentNode?.removeChild(tag)); | ||
| newTags.forEach(tag => headElement.appendChild(tag)); | ||
| oldTags.forEach(tag => { | ||
| tag.parentNode?.removeChild(tag); | ||
| }); | ||
| newTags.forEach(tag => { | ||
| headElement.appendChild(tag); | ||
| }); | ||
@@ -70,0 +74,0 @@ // TODO: Do we really need this return value anywhere? Especially `oldTags` |
@@ -12,2 +12,3 @@ export let TAG_PROPERTIES = /*#__PURE__*/function (TAG_PROPERTIES) { | ||
| TAG_PROPERTIES["SRC"] = "src"; | ||
| TAG_PROPERTIES["TARGET"] = "target"; | ||
| return TAG_PROPERTIES; | ||
@@ -24,2 +25,3 @@ }({}); | ||
| TAG_NAMES["BODY"] = "body"; | ||
| TAG_NAMES["FRAGMENT"] = "Symbol(react.fragment)"; | ||
| TAG_NAMES["HEAD"] = "head"; | ||
@@ -33,3 +35,2 @@ TAG_NAMES["HTML"] = "html"; | ||
| TAG_NAMES["TITLE"] = "title"; | ||
| TAG_NAMES["FRAGMENT"] = "Symbol(react.fragment)"; | ||
| return TAG_NAMES; | ||
@@ -36,0 +37,0 @@ }({}); |
| import { Children, use, useEffect, useId } from 'react'; | ||
| import { Context } from './Provider'; | ||
| import { REACT_TAG_MAP, TAG_NAMES, VALID_TAG_NAMES } from './constants'; | ||
| import { Context } from './Provider'; | ||
| import { cloneProps, mergeProps, pushToPropArray } from './utils'; | ||
@@ -5,0 +5,0 @@ function assertChildType(childType, nestedChildren) { |
| export { default as Helmet } from './Helmet'; | ||
| export { default as MetaTags } from './MetaTags'; | ||
| export { default as HelmetProvider } from './Provider'; | ||
| export { default as MetaTags } from './MetaTags'; | ||
| //# sourceMappingURL=index.js.map |
| import { createContext, useRef } from 'react'; | ||
| import { commitTagChanges } from './client'; | ||
| import { IS_DOM_ENVIRONMENT } from './constants'; | ||
| import { newServerState } from './server'; | ||
| import { IS_DOM_ENVIRONMENT } from './constants'; | ||
| import { calcAggregatedState } from './utils'; | ||
| import { commitTagChanges } from './client'; | ||
| import { jsx as _jsx } from "react/jsx-runtime"; | ||
@@ -7,0 +7,0 @@ export const Context = /*#__PURE__*/createContext(undefined); |
| import { createElement } from 'react'; | ||
| import { HELMET_ATTRIBUTE, TAG_NAMES, REACT_TAG_MAP, TAG_PROPERTIES, HTML_TAG_MAP } from './constants'; | ||
| import { HELMET_ATTRIBUTE, HTML_TAG_MAP, REACT_TAG_MAP, TAG_NAMES, TAG_PROPERTIES } from './constants'; | ||
| import { calcAggregatedState, flattenArray, propToAttr } from './utils'; | ||
@@ -4,0 +4,0 @@ import { jsx as _jsx } from "react/jsx-runtime"; |
@@ -1,2 +0,2 @@ | ||
| import { HTML_TAG_MAP, TAG_NAMES, TAG_PROPERTIES, SEO_PRIORITY_TAGS } from './constants'; | ||
| import { HTML_TAG_MAP, SEO_PRIORITY_TAGS, TAG_NAMES, TAG_PROPERTIES } from './constants'; | ||
@@ -58,3 +58,3 @@ // eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
| const res = props[i][1].base; | ||
| if (res?.href) return res; | ||
| if (res?.href || res?.target) return res; | ||
| } | ||
@@ -135,3 +135,5 @@ return undefined; | ||
| // so approved tags are accumulated from last to first | ||
| .forEach(tag => approvedTags.push(tag)); | ||
| .forEach(tag => { | ||
| approvedTags.push(tag); | ||
| }); | ||
@@ -138,0 +140,0 @@ // Update seen tags with tags from this instance |
@@ -11,3 +11,4 @@ export declare enum TAG_PROPERTIES { | ||
| REL = "rel", | ||
| SRC = "src" | ||
| SRC = "src", | ||
| TARGET = "target" | ||
| } | ||
@@ -22,2 +23,3 @@ export declare enum ATTRIBUTE_NAMES { | ||
| BODY = "body", | ||
| FRAGMENT = "Symbol(react.fragment)", | ||
| HEAD = "head", | ||
@@ -30,4 +32,3 @@ HTML = "html", | ||
| STYLE = "style", | ||
| TITLE = "title", | ||
| FRAGMENT = "Symbol(react.fragment)" | ||
| TITLE = "title" | ||
| } | ||
@@ -34,0 +35,0 @@ export declare const SEO_PRIORITY_TAGS: { |
| export type * from './types'; | ||
| export { default as Helmet } from './Helmet'; | ||
| export { default as MetaTags } from './MetaTags'; | ||
| export { default as HelmetProvider } from './Provider'; | ||
| export { default as MetaTags } from './MetaTags'; |
@@ -1,2 +0,2 @@ | ||
| import type { BaseHTMLAttributes, HtmlHTMLAttributes, HTMLAttributes, LinkHTMLAttributes, MetaHTMLAttributes, ReactNode, ScriptHTMLAttributes, StyleHTMLAttributes } from 'react'; | ||
| import type { BaseHTMLAttributes, HTMLAttributes, HtmlHTMLAttributes, LinkHTMLAttributes, MetaHTMLAttributes, ReactNode, ScriptHTMLAttributes, StyleHTMLAttributes } from 'react'; | ||
| export type BaseProps = BaseHTMLAttributes<HTMLBaseElement>; | ||
@@ -34,4 +34,4 @@ export type BodyProps = HTMLAttributes<HTMLBodyElement>; | ||
| export type HelmetDatum<T = ReactNode> = { | ||
| toComponent(): T; | ||
| toString(): string; | ||
| toComponent(): T; | ||
| }; | ||
@@ -89,3 +89,3 @@ export type HelmetHTMLBodyDatum = HelmetDatum<HTMLAttributes<HTMLBodyElement>>; | ||
| */ | ||
| export type HelmetProps = HelmetPropArrays & HelmetPropObjects & HelmetPropBooleans & { | ||
| export type HelmetProps = HelmetPropArrays & HelmetPropBooleans & HelmetPropObjects & { | ||
| base?: BaseProps; | ||
@@ -92,0 +92,0 @@ children?: ReactNode; |
| import type { AggregatedState, BaseProps, HelmetPropArrays, HelmetPropObjects, HelmetProps, PropArrayItem, RegisteredHelmetPropsArray } from './types'; | ||
| type PropList = Record<string, any>; | ||
| type AttributeList = string[]; | ||
| type MatchProps = Record<string, string | AttributeList>; | ||
| type MatchProps = Record<string, AttributeList | string>; | ||
| export declare function getTitleFromPropsList(props: RegisteredHelmetPropsArray): string | undefined; | ||
@@ -19,3 +19,3 @@ /** | ||
| export declare function getTagsFromPropsList<T extends keyof HelmetPropArrays>(tagName: T, primaryAttributes: Array<keyof PropArrayItem<T>>, propsArray: RegisteredHelmetPropsArray): HelmetPropArrays[T]; | ||
| export declare function flattenArray(possibleArray: string[] | string): string; | ||
| export declare function flattenArray(possibleArray: string | string[]): string; | ||
| export declare function prioritizer<T extends keyof HelmetPropArrays>(propsArray: HelmetPropArrays[T], propsToMatch: MatchProps): { | ||
@@ -22,0 +22,0 @@ default: Array<PropArrayItem<T>>; |
| import { | ||
| type FunctionComponent, | ||
| type ReactNode, | ||
| StrictMode, | ||
| act, | ||
| StrictMode, | ||
| } from 'react'; | ||
| import { createRoot, type Root } from 'react-dom/client'; | ||
| import { type Root, createRoot } from 'react-dom/client'; | ||
@@ -10,0 +10,0 @@ import Provider from '../src/Provider'; |
+11
-11
| { | ||
| "name": "@dr.pogodin/react-helmet", | ||
| "version": "3.0.5", | ||
| "version": "3.0.6", | ||
| "description": "Thread-safe Helmet for React 19+ and friends", | ||
@@ -18,3 +18,3 @@ "main": "./build/common/index.js", | ||
| "build:types": "rimraf build/types && tsc --project tsconfig.types.json", | ||
| "lint": "eslint", | ||
| "lint": "eslint --cache", | ||
| "test": "npm run lint && npm run typecheck && npm run jest", | ||
@@ -41,17 +41,17 @@ "typecheck": "tsc", | ||
| "dependencies": { | ||
| "@babel/runtime": "^7.28.4" | ||
| "@babel/runtime": "^7.28.6" | ||
| }, | ||
| "devDependencies": { | ||
| "@babel/cli": "^7.28.3", | ||
| "@babel/plugin-transform-runtime": "^7.28.5", | ||
| "@babel/preset-env": "^7.28.5", | ||
| "@babel/cli": "^7.28.6", | ||
| "@babel/plugin-transform-runtime": "^7.29.0", | ||
| "@babel/preset-env": "^7.29.0", | ||
| "@babel/preset-react": "^7.28.5", | ||
| "@babel/preset-typescript": "^7.28.5", | ||
| "@dr.pogodin/eslint-configs": "^0.1.2", | ||
| "@dr.pogodin/eslint-configs": "^0.2.6", | ||
| "@jest/globals": "^30.2.0", | ||
| "@testing-library/jest-dom": "6.9.1", | ||
| "@testing-library/react": "16.3.0", | ||
| "@testing-library/react": "16.3.2", | ||
| "@tsconfig/recommended": "^1.0.13", | ||
| "@types/jest": "^30.0.0", | ||
| "@types/react": "^19.2.7", | ||
| "@types/react": "^19.2.10", | ||
| "@types/react-dom": "^19.2.3", | ||
@@ -61,4 +61,4 @@ "jest": "^30.2.0", | ||
| "raf": "^3.4.1", | ||
| "react": "^19.2.2", | ||
| "react-dom": "^19.2.2", | ||
| "react": "^19.2.4", | ||
| "react-dom": "^19.2.4", | ||
| "rimraf": "6.1.2" | ||
@@ -65,0 +65,0 @@ }, |
+1
-0
@@ -22,2 +22,3 @@ # React Helmet | ||
| ### [Contributors](https://github.com/birdofpreyru/react-helmet/graphs/contributors) | ||
| [<img width=36 src="https://avatars.githubusercontent.com/u/5297725?v=4&s=36" />](https://github.com/vegerot) | ||
| [<img width=36 src="https://avatars.githubusercontent.com/u/20144632?s=36" />](https://github.com/birdofpreyru) | ||
@@ -24,0 +25,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
311678
0.22%2726
0.55%507
0.2%Updated