@dotdev/headless-core-node
Advanced tools
Comparing version 1.0.13 to 1.0.14
@@ -45,17 +45,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
const sanityRedirects = data | ||
.filter(item => item.source && item.destination && item.type) | ||
.map(item => ({ | ||
source: item.source, | ||
destination: item.destination, | ||
type: parseInt(item.type), | ||
.filter(({ node }) => node.source && node.destination && node.type) | ||
.map(({ node }) => ({ | ||
source: node.source, | ||
destination: node.destination, | ||
type: parseInt(node.type), | ||
})); | ||
const finalRedirects = [...defaultRedirects, ...sanityRedirects].filter((v, i, a) => a.findIndex(t => t.source === v.source) === i); | ||
finalRedirects.map(item => createRedirect({ fromPath: item.source, toPath: item.destination, statusCode: item.type })); | ||
yield jsonfile.writeFileSync(file, Object.assign(Object.assign({}, firebase), { hosting: [ | ||
...firebase.hosting.filter(site => !site.public.includes("app/public")), | ||
Object.assign(Object.assign({}, firebase.hosting.filter(site => site.public.includes("app/public"))[0]), { redirects: finalRedirects }), | ||
] }), { spaces: 2 }); | ||
const newConfig = Object.assign(Object.assign({}, firebase.hosting.filter(site => site.public.includes("app/public"))[0]), { redirects: finalRedirects }); | ||
yield jsonfile.writeFileSync(file, Object.assign(Object.assign({}, firebase), { hosting: [...firebase.hosting.filter(site => !site.public.includes("app/public")), newConfig] }), { spaces: 2 }); | ||
if (gatsbyFile) | ||
yield jsonfile.writeFileSync(gatsbyFile, { | ||
hosting: Object.assign(Object.assign({}, firebase.hosting.filter(site => site.public.includes("app/public"))[0]), { redirects: finalRedirects }), | ||
hosting: Object.assign({}, newConfig), | ||
}, { spaces: 2 }); | ||
@@ -62,0 +60,0 @@ } |
{ | ||
"name": "@dotdev/headless-core-node", | ||
"description": "Node package for Headless Core", | ||
"version": "1.0.13", | ||
"version": "1.0.14", | ||
"author": "DotDev <info@dotdev.com.au>", | ||
@@ -6,0 +6,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
16414
152