@last-rev/adapter-contentful
Advanced tools
Comparing version 3.0.2-alpha.1 to 3.0.2-alpha.2
@@ -26,2 +26,5 @@ "use strict"; | ||
var traverse = function (obj) { | ||
if (helpers_1.isBadContentfulObject(obj)) { | ||
return null; | ||
} | ||
if (lodash_1.default.isArray(obj)) { | ||
@@ -28,0 +31,0 @@ return lodash_1.default.map(obj, traverse); |
@@ -0,1 +1,2 @@ | ||
export declare const isBadContentfulObject: (obj: unknown) => boolean; | ||
export declare const isContentfulObject: (obj: unknown) => boolean; | ||
@@ -7,3 +8,3 @@ export declare const isEntry: (obj: unknown) => boolean; | ||
export declare const extractSlug: (obj: unknown) => string | null; | ||
export declare const isLink: (obj: any, contentTypeId: any) => boolean; | ||
export declare const isLink: (obj: unknown, contentTypeId: string) => boolean; | ||
//# sourceMappingURL=helpers.d.ts.map |
@@ -6,4 +6,7 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isLink = exports.extractSlug = exports.extractId = exports.extractContentTypeId = exports.isAsset = exports.isEntry = exports.isContentfulObject = void 0; | ||
exports.isLink = exports.extractSlug = exports.extractId = exports.extractContentTypeId = exports.isAsset = exports.isEntry = exports.isContentfulObject = exports.isBadContentfulObject = void 0; | ||
var lodash_1 = __importDefault(require("lodash")); | ||
exports.isBadContentfulObject = function (obj) { | ||
return typeof obj === 'object' && lodash_1.default.has(obj, 'sys') && !lodash_1.default.has(obj, 'fields'); | ||
}; | ||
exports.isContentfulObject = function (obj) { | ||
@@ -10,0 +13,0 @@ return typeof obj === 'object' && lodash_1.default.has(obj, 'sys') && lodash_1.default.has(obj, 'fields'); |
@@ -1,2 +0,2 @@ | ||
export { isEntry, isAsset, isContentfulObject, extractContentTypeId, isLink, extractId, extractSlug } from './helpers'; | ||
export { isEntry, isAsset, isContentfulObject, extractContentTypeId, isLink, extractId, extractSlug, isBadContentfulObject } from './helpers'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -11,1 +11,2 @@ "use strict"; | ||
Object.defineProperty(exports, "extractSlug", { enumerable: true, get: function () { return helpers_1.extractSlug; } }); | ||
Object.defineProperty(exports, "isBadContentfulObject", { enumerable: true, get: function () { return helpers_1.isBadContentfulObject; } }); |
{ | ||
"name": "@last-rev/adapter-contentful", | ||
"version": "3.0.2-alpha.1", | ||
"version": "3.0.2-alpha.2", | ||
"description": "Transforms data from contentful's structure to one which is expected by LastRev components", | ||
@@ -48,3 +48,3 @@ "main": "dist/index.js", | ||
}, | ||
"gitHead": "2bbcd979720506b1506f6b861b5578af17761d51" | ||
"gitHead": "7786fc990184fd5a726341ba96ca677b62edb72c" | ||
} |
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
71600
1646