Skip to content

Commit

Permalink
fix: minor compilation fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
vkalta committed Mar 27, 2023
2 parents 6fdcb12 + e7f9cd5 commit 3913be7
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 19 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ jobs:
node-version: "16.x"
- run: npm install

- name: get-npm-version
id: package-version
uses: martinbeentjes/npm-get-version-action@master
- name: get-package-details
id: package
uses: codex-team/[email protected]
- name: install npm packall
run: npm install npm-pack-all

Expand Down Expand Up @@ -45,6 +45,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing its ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./datasync-filesystem-sdk-${{ steps.package-version.outputs.current-version }}.tgz
asset_name: datasync-filesystem-sdk-${{ steps.package-version.outputs.current-version }}.tgz
asset_path: ./${{ steps.package.outputs.name }}-${{ steps.package.outputs.version }}.tgz
asset_name: ${{ steps.package.outputs.name }}-${{ steps.package.outputs.version }}.tgz
asset_content_type: application/tgz
2 changes: 1 addition & 1 deletion docs/scripts/prettify/lang-css.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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.6",
"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
12 changes: 7 additions & 5 deletions src/stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1279,7 +1279,7 @@ export class Stack {
if (this.q.only) {
const only = this.q.only.toString().replace(/\./g, '/')
data = mask(data, only)
} else if (this.q.except) {
} else if (this.q.except.length) {
const bukcet = this.q.except.toString().replace(/\./g, '/')
const except = mask(data, bukcet)
data = difference(data, except)
Expand Down Expand Up @@ -1441,15 +1441,17 @@ export class Stack {

for (let i = 0, j = currentInclude.length; i < j; i++) {
const includePath = currentInclude[i]

// tslint:disable-next-line: forin
for (const path in entryReferences) {
const subStrArr = includePath.split('.');
if ((subStrArr.length && subStrArr[0] === path) || includePath === path) {
if (path.length > includePath.length) {
continue;
}
const subStr = includePath.slice(0, path.length);
if (subStr === path && (includePath[path.length] === '.' || includePath === subStr)) {
let subPath
// Its the complete path!! Hurrah!
if (path.length !== includePath.length) {
subPath = subStrArr[0]
subPath = subStr
pendingPath.push(includePath.slice(path.length + 1))
} else {
subPath = includePath
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 3913be7

Please sign in to comment.