From c572d49b3df26c0860b9b61d7374fef6139be5b1 Mon Sep 17 00:00:00 2001 From: Geoffrey Hendrey Date: Tue, 1 Oct 2024 11:35:31 -0700 Subject: [PATCH] Support open txt (#83) * in CliCoreBase * bump version 0.1.37 --- package.json | 2 +- src/CliCoreBase.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 19ad570b..2b380b80 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "stated-js", - "version": "0.1.36", + "version": "0.1.37", "license": "Apache-2.0", "description": "JSONata embedded in JSON", "main": "./dist/src/index.js", diff --git a/src/CliCoreBase.ts b/src/CliCoreBase.ts index c8c46177..093bef49 100644 --- a/src/CliCoreBase.ts +++ b/src/CliCoreBase.ts @@ -93,7 +93,9 @@ export class CliCoreBase { if (fileExtension === 'yaml' || fileExtension === 'yml') { return yaml.load(fileContent); - } else { + }else if (fileExtension === 'text' || fileExtension === 'txt') { + return fileContent; + }else { return JSON.parse(fileContent); } }