@playcanvas/attribute-parser 1.0.5 → 1.0.7

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/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "engines": {
6
6
  "node": ">=18.0.0"
7
7
  },
8
- "version": "1.0.5",
8
+ "version": "1.0.7",
9
9
  "dependencies": {
10
10
  "@microsoft/tsdoc": "^0.15.0",
11
11
  "@playcanvas/eslint-config": "^1.7.4",
package/src/index.js CHANGED
@@ -2,6 +2,7 @@ import { createSystem, createDefaultMapFromNodeModules, createVirtualTypeScriptE
2
2
  import * as ts from 'typescript';
3
3
 
4
4
  import { ScriptParser } from './parsers/script-parser.js';
5
+ import { isInterface } from './utils/attribute-utils.js';
5
6
  import { createDefaultMapFromCDN, flatMapAnyNodes, getExportedNodes, getType, inheritsFrom, isAliasedClassDeclaration } from './utils/ts-utils.js';
6
7
 
7
8
  const toLowerCamelCase = str => str[0].toLowerCase() + str.substring(1);
@@ -180,9 +181,6 @@ export class JSDocParser {
180
181
  throw new Error(`Source file ${fileName} not found`);
181
182
  }
182
183
 
183
- // Filter out classes that do not inherit from `Script` or are interfaces
184
- const isInterface = node => node.jsDoc.some(jsdoc => jsdoc.tags?.some(tag => tag.tagName.getText() === 'interface'));
185
-
186
184
  const nodes = flatMapAnyNodes(sourceFile, (node) => {
187
185
  if (!ts.isClassDeclaration(node)) {
188
186
  return false;
@@ -86,7 +86,7 @@ export function isAliasedClassDeclaration(node, typeChecker) {
86
86
  return true;
87
87
  }
88
88
  // Try to resolve the original declaration
89
- if (ts.isIdentifier(node.name)) {
89
+ if (node?.name && ts.isIdentifier(node.name)) {
90
90
  const symbol = typeChecker.getSymbolAtLocation(node.name);
91
91
  if (symbol) {
92
92
  const resolvedSymbol = resolveAliasedSymbol(typeChecker, symbol);
@@ -379,7 +379,7 @@ export function parseNumber(input) {
379
379
  }
380
380
 
381
381
  /**
382
- * Parses a string representationn of a numerical array into an array of numbers.
382
+ * Parses a string representation of a numerical array into an array of numbers.
383
383
  *
384
384
  * @param {string} input - The string to parse
385
385
  * @returns {number[]} - The parsed array of numbers
@@ -2,6 +2,9 @@ import * as TWEEN from 'https://cdnjs.cloudflare.com/ajax/libs/tween.js/23.1.2/t
2
2
  import confetti from 'https://esm.sh/canvas-confetti@1.6.0';
3
3
  import { Script } from 'playcanvas';
4
4
 
5
+ /** @enum {number} */
6
+ export const MyEnum = { value: 0 };
7
+
5
8
  class Example extends Script {
6
9
  /**
7
10
  * @attribute