Skip to content

Commit

Permalink
fix: resolved conflicts and tested the changes
Browse files Browse the repository at this point in the history
  • Loading branch information
vkalta committed Mar 28, 2023
2 parents 3482173 + 3913be7 commit d0761f3
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

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": "datasync-filesystem-sdk",
"version": "1.0.7",
"version": "1.0.8",
"description": "JavaScript filesystem SDK to query data synced via @contentstack/datasync-content-store-filesystem",
"main": "dist/index.js",
"scripts": {
Expand Down
6 changes: 3 additions & 3 deletions src/fs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ import {

const promisifiedReadFile = promisify(rf)

export const readFile = async (path: string, type: string = 'utf-8') => {
export const readFile = async (path: string) => {
if (existsSync(path)) {
const contents: string = await promisifiedReadFile(path, type)
const contents: Buffer = await promisifiedReadFile(path)

return JSON.parse(contents)
return JSON.parse(contents.toString())
}

return []
Expand Down
2 changes: 1 addition & 1 deletion typings/fs.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
* Copyright (c) Contentstack LLC
* MIT Licensed
*/
export declare const readFile: (path: string, type?: string) => Promise<any>;
export declare const readFile: (path: string) => Promise<any>;
export { existsSync, } from 'fs';
2 changes: 1 addition & 1 deletion typings/utils.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Copyright (c) Contentstack LLC
* MIT Licensed
*/
export declare const difference: (obj: any, baseObj: any) => unknown[];
export declare const difference: (obj: any, baseObj: any) => unknown;
export declare const getBaseDir: ({ baseDir }: {
baseDir: any;
}) => {
Expand Down

0 comments on commit d0761f3

Please sign in to comment.