From 0eba0d62a5890a559095f2783b1a42fc9c86a0c7 Mon Sep 17 00:00:00 2001 From: "vikram.kalta@contentstack.com" Date: Wed, 25 Jan 2023 13:19:52 +0000 Subject: [PATCH] fix: resolved undefined method issue --- dist/utils.js | 6 +++--- package.json | 2 +- src/utils.ts | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dist/utils.js b/dist/utils.js index 010189f3..035d0f30 100644 --- a/dist/utils.js +++ b/dist/utils.js @@ -76,7 +76,7 @@ exports.getBaseDir = getBaseDir; */ const getEntriesPath = (locale, contentTypeUid) => { // if locale has been read, return data immediately - if (localePaths.hasOwnProperty(locale)) { + if (locale in localePaths) { if (localePaths[locale].hasOwnProperty(contentTypeUid)) { return localePaths[locale][contentTypeUid]; } @@ -102,7 +102,7 @@ exports.getEntriesPath = getEntriesPath; */ const getAssetsPath = (locale) => { // if locale has been read, return data immediately - if (localePaths.hasOwnProperty(locale)) { + if (locale in localePaths) { if (localePaths[locale].hasOwnProperty('_assets')) { // tslint:disable-next-line: no-string-literal return localePaths[locale]['_assets']; @@ -130,7 +130,7 @@ exports.getAssetsPath = getAssetsPath; */ const getContentTypesPath = (locale) => { // if locale has been read, return data immediately - if (localePaths.hasOwnProperty(locale)) { + if (locale in localePaths) { if (localePaths[locale].hasOwnProperty('_content_types')) { // tslint:disable-next-line: no-string-literal return localePaths[locale]['_content_types']; diff --git a/package.json b/package.json index 11d322f9..f2ed4642 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "datasync-filesystem-sdk", - "version": "1.0.5", + "version": "1.0.6", "description": "JavaScript filesystem SDK to query data synced via @contentstack/datasync-content-store-filesystem", "main": "dist/index.js", "scripts": { diff --git a/src/utils.ts b/src/utils.ts index 6700937d..3160d57b 100755 --- a/src/utils.ts +++ b/src/utils.ts @@ -88,7 +88,7 @@ export const getBaseDir = ({baseDir}) => { */ export const getEntriesPath = (locale, contentTypeUid) => { // if locale has been read, return data immediately - if (localePaths.hasOwnProperty(locale)) { + if (locale in localePaths) { if (localePaths[locale].hasOwnProperty(contentTypeUid)) { return localePaths[locale][contentTypeUid] } @@ -115,7 +115,7 @@ export const getEntriesPath = (locale, contentTypeUid) => { */ export const getAssetsPath = (locale) => { // if locale has been read, return data immediately - if (localePaths.hasOwnProperty(locale)) { + if (locale in localePaths) { if (localePaths[locale].hasOwnProperty('_assets')) { // tslint:disable-next-line: no-string-literal return localePaths[locale]['_assets'] @@ -144,7 +144,7 @@ export const getAssetsPath = (locale) => { */ export const getContentTypesPath = (locale) => { // if locale has been read, return data immediately - if (localePaths.hasOwnProperty(locale)) { + if (locale in localePaths) { if (localePaths[locale].hasOwnProperty('_content_types')) { // tslint:disable-next-line: no-string-literal return localePaths[locale]['_content_types']