skewer-format 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,9 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.skewerToJSON = exports.parser = exports.lexer = void 0;
4
- var lexer_1 = require("./src/lexer");
5
- Object.defineProperty(exports, "lexer", { enumerable: true, get: function () { return lexer_1.lexer; } });
6
- var parser_1 = require("./src/parser");
7
- Object.defineProperty(exports, "parser", { enumerable: true, get: function () { return parser_1.parser; } });
8
- var methods_1 = require("./src/methods");
9
- Object.defineProperty(exports, "skewerToJSON", { enumerable: true, get: function () { return methods_1.skewerToJSON; } });
1
+ export { lexer } from "./src/lexer";
2
+ export { parser } from "./src/parser";
3
+ export { skewerToJSON } from "./src/methods";
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
package/dist/src/lexer.js CHANGED
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.lexer = lexer;
4
- function lexer(input) {
1
+ export function lexer(input) {
5
2
  const tokens = [];
6
3
  const lines = input
7
4
  .split("\n")
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.skewerToJSON = skewerToJSON;
4
- const lexer_1 = require("./lexer");
5
- const parser_1 = require("./parser");
6
- function skewerToJSON(input) {
7
- return (0, parser_1.parser)((0, lexer_1.lexer)(input));
1
+ import { lexer } from "./lexer";
2
+ import { parser } from "./parser";
3
+ export function skewerToJSON(input) {
4
+ return parser(lexer(input));
8
5
  }
@@ -1,9 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.parser = parser;
4
- const lexer_js_1 = require("./lexer.js");
5
- function parser(tokens) {
6
- var _a;
1
+ import { lexer } from "./lexer.js";
2
+ export function parser(tokens) {
7
3
  const resultArr = [];
8
4
  let question = {
9
5
  options: [],
@@ -68,7 +64,7 @@ function parser(tokens) {
68
64
  if (token.type == "OPTION_KEY") {
69
65
  const optionValueToken = tokens[i + 2];
70
66
  if (optionValueToken && optionValueToken.type === "OPTION_VALUE") {
71
- (_a = question.options) === null || _a === void 0 ? void 0 : _a.push({
67
+ question.options?.push({
72
68
  key: token.value,
73
69
  value: optionValueToken.value,
74
70
  });
@@ -136,6 +132,6 @@ ANSWER: B
136
132
  EXPLANATION: Serif fonts are often chosen for their historical significance and readability, making them a popular choice for body text in web design to ensure clarity and ease of reading.
137
133
 
138
134
  ---`;
139
- const lex_out = (0, lexer_js_1.lexer)(input);
135
+ const lex_out = lexer(input);
140
136
  // console.log(lex_out);
141
137
  console.log(parser(lex_out));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skewer-format",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "New format to store quiz in text format",
5
5
  "license": "MIT",
6
6
  "author": "sassykumar <sasikumarstu@gamil.com>",