okai 0.0.39 → 0.0.40

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.
Files changed (2) hide show
  1. package/dist/ts-parser.js +34 -6
  2. package/package.json +1 -1
package/dist/ts-parser.js CHANGED
@@ -340,12 +340,14 @@ export class TypeScriptParser {
340
340
  this.classes = [];
341
341
  this.interfaces = [];
342
342
  this.enums = [];
343
- this.parseConfigType(sourceCode);
344
- this.parseDefaultExport(sourceCode);
345
- this.parseReferences(sourceCode);
346
- this.parseInterfaces(sourceCode);
347
- this.parseClasses(sourceCode);
348
- this.parseEnums(sourceCode);
343
+ const src = removeMultilineComments(sourceCode);
344
+ // const src = sourceCode
345
+ this.parseConfigType(src);
346
+ this.parseDefaultExport(src);
347
+ this.parseReferences(src);
348
+ this.parseInterfaces(src);
349
+ this.parseClasses(src);
350
+ this.parseEnums(src);
349
351
  return {
350
352
  config: this.config,
351
353
  defaultExport: this.defaultExport,
@@ -523,3 +525,29 @@ function parseGenericType(typeStr) {
523
525
  function isNullableType(type) {
524
526
  return type === 'null' || type === 'undefined';
525
527
  }
528
+ // Removes /*: Merge with User DTO... */ comments from the source code
529
+ export function removeMultilineComments(src) {
530
+ let result = '';
531
+ let inComment = false;
532
+ let i = 0;
533
+ while (i < src.length) {
534
+ // Check for comment start
535
+ if (src[i] === '/' && src[i + 1] === '*' && src[i + 2] === ':') {
536
+ inComment = true;
537
+ i += 2;
538
+ continue;
539
+ }
540
+ // Check for comment end
541
+ if (inComment && (src[i] === '*' && src[i + 1] === '/')) {
542
+ inComment = false;
543
+ i += 2;
544
+ continue;
545
+ }
546
+ // Only append characters when not in a comment
547
+ if (!inComment) {
548
+ result += src[i];
549
+ }
550
+ i++;
551
+ }
552
+ return result;
553
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "okai",
3
3
  "type": "module",
4
- "version": "0.0.39",
4
+ "version": "0.0.40",
5
5
  "bin": "./dist/okai.js",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.js",