@stackbit/sdk
Advanced tools
Comparing version 0.2.10 to 0.2.11
@@ -288,8 +288,10 @@ "use strict"; | ||
var _a; | ||
// do not define filePath for singleton pages | ||
if (model.file) { | ||
return; | ||
let filePath; | ||
if (model.filePath) { | ||
filePath = model.filePath; | ||
} | ||
let filePath = model === null || model === void 0 ? void 0 : model.filePath; | ||
if (!filePath) { | ||
else if (model.file) { | ||
filePath = model.file; | ||
} | ||
else { | ||
const urlPath = model.urlPath; | ||
@@ -311,8 +313,10 @@ if (urlPath === '/') { | ||
var _a; | ||
// do not define filePath for singleton files | ||
if (model.file) { | ||
return; | ||
let filePath; | ||
if (model.filePath) { | ||
filePath = model.filePath; | ||
} | ||
let filePath = model === null || model === void 0 ? void 0 : model.filePath; | ||
if (!filePath) { | ||
else if (model.file) { | ||
filePath = model.file; | ||
} | ||
else { | ||
const folder = lodash_1.default.trim(lodash_1.default.get(model, 'folder'), '/'); | ||
@@ -319,0 +323,0 @@ filePath = lodash_1.default.trim(`${folder}/{slug}.json`, '/'); |
{ | ||
"name": "@stackbit/sdk", | ||
"version": "0.2.10", | ||
"version": "0.2.11", | ||
"description": "Stackbit SDK", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -355,8 +355,8 @@ import path from 'path'; | ||
function updatePageFilePath(model: PageModel, config: Config) { | ||
// do not define filePath for singleton pages | ||
if (model.file) { | ||
return; | ||
} | ||
let filePath = model?.filePath; | ||
if (!filePath) { | ||
let filePath; | ||
if (model.filePath) { | ||
filePath = model.filePath; | ||
} else if (model.file) { | ||
filePath = model.file; | ||
} else { | ||
const urlPath = model.urlPath; | ||
@@ -376,8 +376,8 @@ if (urlPath === '/') { | ||
function updateDataFilePath(model: DataModel, config: Config) { | ||
// do not define filePath for singleton files | ||
if (model.file) { | ||
return; | ||
} | ||
let filePath = model?.filePath; | ||
if (!filePath) { | ||
let filePath; | ||
if (model.filePath) { | ||
filePath = model.filePath; | ||
} else if (model.file) { | ||
filePath = model.file; | ||
} else { | ||
const folder = _.trim(_.get(model, 'folder'), '/'); | ||
@@ -384,0 +384,0 @@ filePath = _.trim(`${folder}/{slug}.json`, '/'); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12743
719454