@kontur.candy/generator 5.115.1-enhanced-server-filters.1 → 5.115.1-enhanced-server-filters.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.
Files changed (2) hide show
  1. package/dist/index.js +22 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -47494,6 +47494,26 @@ class ModelPathImpl {
47494
47494
  // @ts-expect-error
47495
47495
  return result.toPath();
47496
47496
  }
47497
+ applyCommonInstancesFromAnotherPath(modelPath) {
47498
+ const anotherTokens = modelPath.getPathPartsAsArray();
47499
+ const updatedTokens = this.tokens.reduce((acc, token, index) => {
47500
+ const anotherToken = anotherTokens[index];
47501
+ const nextTokenInfo = acc.matching && (PathTokens.isMultiToken(token) && PathTokens.isInstanceToken(anotherToken) || PathTokens.isSimpleToken(token) && PathTokens.isSimpleToken(anotherToken) && token === anotherToken) ? {
47502
+ nextToken: anotherToken,
47503
+ matching: true
47504
+ } : {
47505
+ nextToken: token,
47506
+ matching: false
47507
+ };
47508
+ acc.matching = nextTokenInfo.matching;
47509
+ acc.tokens[index] = nextTokenInfo.nextToken;
47510
+ return acc;
47511
+ }, {
47512
+ tokens: Array.from(this.tokens),
47513
+ matching: true
47514
+ }).tokens;
47515
+ return new ModelPathImpl(updatedTokens, this.absolute);
47516
+ }
47497
47517
  pathPartToString(pathPart) {
47498
47518
  if (typeof pathPart === "string") {
47499
47519
  return pathPart;
@@ -105349,8 +105369,8 @@ class KCLangCalculationsBuildContext {
105349
105369
  getFirstAcceptedParent(schemaNode) {
105350
105370
  let parentNode = schemaNode === null || schemaNode === void 0 ? void 0 : schemaNode.parent;
105351
105371
  while (parentNode != undefined) {
105352
- if (parentNode instanceof _common_SchemaRng_FormSchemaRng__WEBPACK_IMPORTED_MODULE_28__.FormSchemaRngElement) {
105353
- if (parentNode.isOptional() && !parentNode.multiple) {
105372
+ if (parentNode instanceof _common_SchemaRng_FormSchemaRng__WEBPACK_IMPORTED_MODULE_28__.FormSchemaRngElement && !parentNode.multiple) {
105373
+ if (parentNode.isOptional()) {
105354
105374
  return parentNode;
105355
105375
  }
105356
105376
  parentNode = parentNode.parent;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kontur.candy/generator",
3
- "version": "5.115.1-enhanced-server-filters.1",
3
+ "version": "5.115.1-enhanced-server-filters.2",
4
4
  "description": "Candy forms generator",
5
5
  "author": "SKBKontur Candy Team",
6
6
  "private": false,