Skip to content

Commit

Permalink
types
Browse files Browse the repository at this point in the history
  • Loading branch information
staylor committed Nov 8, 2023
1 parent 44f4997 commit 4f2060f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export class Helmet extends Component<PropsWithChildren<HelmetProps>> {

const { children: nestedChildren, ...childProps } = child.props;
// convert React props to HTML attributes
const newChildProps = Object.keys(childProps).reduce((obj: any, key: string) => {
const newChildProps = Object.keys(childProps).reduce((obj: any, key) => {
obj[HTML_TAG_MAP[key] || key] = childProps[key];
return obj;
}, {});
Expand Down
10 changes: 5 additions & 5 deletions src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ const generateTitleAsString = (
)}</${type}>`;
};

const generateTagsAsString = (type: string, tags: HTMLElement[], encode: boolean) =>
tags.reduce((str: string, t: any) => {
const tag = t as Attributes;
const generateTagsAsString = (type: string, tags: HTMLElement[], encode = true) =>
tags.reduce((str, t) => {
const tag = t as unknown as Attributes;
const attributeHtml = Object.keys(tag)
.filter(
attribute =>
Expand Down Expand Up @@ -120,7 +120,7 @@ const generateTagsAsReactComponent = (type: string, tags: any[]) =>
return React.createElement(type, mappedTag);
});

const getMethodsForTag = (type: string, tags: any, encode: boolean) => {
const getMethodsForTag = (type: string, tags: any, encode = true) => {
switch (type) {
case TAG_NAMES.TITLE:
return {
Expand All @@ -141,7 +141,7 @@ const getMethodsForTag = (type: string, tags: any, encode: boolean) => {
}
};

const getPriorityMethods = ({ metaTags, linkTags, scriptTags, encode }: any) => {
const getPriorityMethods = ({ metaTags, linkTags, scriptTags, encode }: MappedServerState) => {
const meta = prioritizer(metaTags, SEO_PRIORITY_TAGS.meta);
const link = prioritizer(linkTags, SEO_PRIORITY_TAGS.link);
const script = prioritizer(scriptTags, SEO_PRIORITY_TAGS.script);
Expand Down

0 comments on commit 4f2060f

Please sign in to comment.