Skip to content

Commit

Permalink
Test publish an alpha version
Browse files Browse the repository at this point in the history
  • Loading branch information
kavitharaju committed Jul 29, 2024
1 parent 18e7db5 commit e4daf0a
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 8 deletions.
5 changes: 1 addition & 4 deletions js-usfm-parser/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ npm install usfm-grammar
Here's how you can use USFM Grammar in your JavaScript/TypeScript projects:

```javascript
import { USFMParser } from 'usfm-grammar';
const { USFMParser } = require('usfm-grammar');

(async () => {
await USFMParser.init();
const usfmParser = new USFMParser();

// Convert USFM to USJ
Expand All @@ -33,8 +32,6 @@ import { USFMParser } from 'usfm-grammar';

## API Documentation

### `USFMParser.init()`
Initializes the USFMParser. This function must be called before creating instances of `USFMParser`.

### `USFMParser.usfmToUsj(usfmString: string): Object`
Converts a USFM string to a USJ object.
Expand Down
2 changes: 1 addition & 1 deletion js-usfm-parser/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "usfm-grammar",
"version": "3.0.0-alpha.1",
"version": "3.0.0-alpha.2",
"description": "Parser using tree-sitter-usfm3, to convert usfm to usj format.",
"main": "src/index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion js-usfm-parser/src/index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
const USFMParser = require("./usfmParser");
const {USFMParser} = require("./usfmParser");
exports.USFMParser = USFMParser;
4 changes: 3 additions & 1 deletion js-usfm-parser/src/usfmParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ class USFMParser {
let errorString = this.errors.map((err) => err.join(":")).join("\n\t");
message += `Could be due to an error in the USFM\n\t${errorString}`;
}
throw err;
else {
message = err.message;
}
return {error: message};
}

Expand Down
2 changes: 1 addition & 1 deletion js-usfm-parser/test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const {USFMParser} = require("./src/usfmParser");
const {USFMParser} = require("./src/index");

(async () => {
const usfmParser = new USFMParser()
Expand Down

0 comments on commit e4daf0a

Please sign in to comment.