pmcf 4.1.1 → 4.1.2

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmcf",
3
- "version": "4.1.1",
3
+ "version": "4.1.2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -55,11 +55,11 @@
55
55
  "dependencies": {
56
56
  "ip-utilties": "^2.0.2",
57
57
  "npm-pkgbuild": "^19.1.4",
58
- "pacc": "^7.2.0",
58
+ "pacc": "^8.0.0",
59
59
  "package-directory": "^8.1.0"
60
60
  },
61
61
  "devDependencies": {
62
- "@types/node": "^25.0.5",
62
+ "@types/node": "^25.0.6",
63
63
  "ava": "^6.4.1",
64
64
  "c8": "^10.1.3",
65
65
  "documentation": "^14.0.3",
package/src/base.mjs CHANGED
@@ -481,7 +481,11 @@ export class Base {
481
481
  * @returns {any}
482
482
  */
483
483
  expression(expression, options) {
484
- return parse(expression, { root: this, globals: this.globals, ...options });
484
+ return parse(expression, {
485
+ root: this,
486
+ getGlobal: x => this.getGlobal(x),
487
+ ...options
488
+ });
485
489
  }
486
490
 
487
491
  /**
@@ -558,13 +562,8 @@ export class Base {
558
562
  return this.name?.indexOf("*") >= 0 || this.owner?.isTemplate || false;
559
563
  }
560
564
 
561
- get globals() {
562
- return Object.assign(
563
- {},
564
- this.properties,
565
- ...[...this.owners()].map(o => o.properties),
566
- globals
567
- );
565
+ getGlobal(a) {
566
+ return globals[a] ?? this.property(a);
568
567
  }
569
568
 
570
569
  get properties() {
@@ -598,7 +597,7 @@ export class Base {
598
597
  return expand(object, {
599
598
  stopClass: Base,
600
599
  root: this,
601
- globals: this.globals
600
+ getGlobal: x => this.getGlobal(x)
602
601
  });
603
602
  }
604
603
 
package/types/base.d.mts CHANGED
@@ -124,7 +124,7 @@ export class Base {
124
124
  set tags(value: Set<any>);
125
125
  get tags(): Set<any>;
126
126
  get isTemplate(): any;
127
- get globals(): any;
127
+ getGlobal(a: any): any;
128
128
  get properties(): any;
129
129
  property(name: any): any;
130
130
  /**