@terrazzo/parser 0.0.4 → 0.0.5

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/logger.js CHANGED
@@ -54,7 +54,9 @@ export default class Logger {
54
54
  return;
55
55
  }
56
56
  if (entry.node) {
57
- throw new TokensJSONError(message, entry.node);
57
+ const e = new TokensJSONError(message);
58
+ e.node = entry.node; // set node on instance, but don’t print to console in constructor
59
+ throw e;
58
60
  } else {
59
61
  throw new Error(message);
60
62
  }
@@ -111,9 +113,8 @@ export class TokensJSONError extends Error {
111
113
  /** Erring JSON node */
112
114
  node;
113
115
 
114
- constructor(message, node) {
116
+ constructor(message) {
115
117
  super(message);
116
118
  this.name = 'TokensJSONError';
117
- this.node = node;
118
119
  }
119
120
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@terrazzo/parser",
3
3
  "description": "Parser/validator for the Design Tokens Community Group (DTCG) standard.",
4
- "version": "0.0.4",
4
+ "version": "0.0.5",
5
5
  "author": {
6
6
  "name": "Drew Powers",
7
7
  "email": "drew@pow.rs"
package/parse/index.js CHANGED
@@ -311,7 +311,7 @@ export function resolveAlias(alias, { tokens, logger, source, node, scanned = []
311
311
  if (!isAlias(token.$value)) {
312
312
  return id;
313
313
  }
314
- return resolveAlias(alias, { tokens, logger, node, source, scanned: [...scanned, id] });
314
+ return resolveAlias(token.$value, { tokens, logger, node, source, scanned: [...scanned, id] });
315
315
  }
316
316
 
317
317
  /** Resolve aliases, update values, and mutate `token` to add `aliasOf` / `partialAliasOf` */