Skip to content

Commit

Permalink
fix strapi
Browse files Browse the repository at this point in the history
  • Loading branch information
ionutpasca committed Jul 30, 2024
1 parent c65c4c6 commit e12f7a1
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 16 deletions.
2 changes: 1 addition & 1 deletion dist/strapi.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/strapi.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const l = (t) => {
return null;
if (Array.isArray(t))
return {
data: t.map(f)
data: t.map(n)
};
let a = { ...t };
return t.attributes && (a = {
Expand Down
2 changes: 1 addition & 1 deletion dist/strapi/index.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@teleporthq/cms-mappers",
"version": "1.0.11",
"version": "1.0.12",
"main": "dist/index.js",
"module": "dist/contentful.mjs",
"types": "dist/contentful/index.d.ts",
Expand Down
13 changes: 1 addition & 12 deletions src/strapi/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,6 @@ type Pagination = {
hasPrevPage?: boolean
}

type Meta = {
pagination?: Pagination
}

type ContentData = {
id?: string
attributes?: Record<string, unknown>
data?: ContentData | ContentData[]
meta?: Meta
}

type NormalizedContent = {
meta: {
pagination?: Pagination
Expand Down Expand Up @@ -81,7 +70,7 @@ export const normalizeContent = (input: any): any => {

if (Array.isArray(input)) {
return {
data: input.map(normalize),
data: input.map(normalizeContent),
}
}

Expand Down

0 comments on commit e12f7a1

Please sign in to comment.