@wrongstack/plugins 0.148.0 → 0.155.0

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/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import { execFileSync, execSync } from 'child_process';
2
2
  import { watch, existsSync, readdirSync, readFileSync } from 'fs';
3
3
  import * as path from 'path';
4
4
  import { isAbsolute, join } from 'path';
5
- import { expectDefined } from '@wrongstack/core';
5
+ import { expectDefined, deepMerge as deepMerge$1 } from '@wrongstack/core';
6
6
  import { lookup } from 'dns/promises';
7
7
  import { isIPv4, isIPv6 } from 'net';
8
8
 
@@ -1773,32 +1773,7 @@ function validateJsonSchema(data, schema) {
1773
1773
  return { valid: errors.length === 0, errors };
1774
1774
  }
1775
1775
  function deepMerge(base, patch, conflictResolution = "prefer-patch") {
1776
- if (typeof base !== "object" || base === null || typeof patch !== "object" || patch === null) {
1777
- return conflictResolution === "prefer-patch" ? patch : base;
1778
- }
1779
- if (Array.isArray(base) && Array.isArray(patch)) {
1780
- return conflictResolution === "prefer-patch" ? patch : base;
1781
- }
1782
- const result = {};
1783
- const baseObj = base;
1784
- const patchObj = patch;
1785
- const allKeys = /* @__PURE__ */ new Set([...Object.keys(baseObj), ...Object.keys(patchObj)]);
1786
- for (const key of allKeys) {
1787
- const baseVal = baseObj[key];
1788
- const patchVal = patchObj[key];
1789
- if (key in baseObj && key in patchObj) {
1790
- if (typeof baseVal === "object" && baseVal !== null && typeof patchVal === "object" && patchVal !== null && !Array.isArray(baseVal) && !Array.isArray(patchVal)) {
1791
- result[key] = deepMerge(baseVal, patchVal, conflictResolution);
1792
- } else {
1793
- result[key] = conflictResolution === "prefer-patch" ? patchVal : baseVal;
1794
- }
1795
- } else if (key in baseObj) {
1796
- result[key] = baseVal;
1797
- } else {
1798
- result[key] = patchVal;
1799
- }
1800
- }
1801
- return result;
1776
+ return deepMerge$1(base, patch, { conflictResolution });
1802
1777
  }
1803
1778
  var plugin7 = {
1804
1779
  name: "json-path",
package/dist/json-path.js CHANGED
@@ -1,4 +1,4 @@
1
- import { expectDefined } from '@wrongstack/core';
1
+ import { expectDefined, deepMerge as deepMerge$1 } from '@wrongstack/core';
2
2
 
3
3
  // src/json-path/index.ts
4
4
  var API_VERSION = "^0.1.10";
@@ -142,32 +142,7 @@ function validateJsonSchema(data, schema) {
142
142
  return { valid: errors.length === 0, errors };
143
143
  }
144
144
  function deepMerge(base, patch, conflictResolution = "prefer-patch") {
145
- if (typeof base !== "object" || base === null || typeof patch !== "object" || patch === null) {
146
- return conflictResolution === "prefer-patch" ? patch : base;
147
- }
148
- if (Array.isArray(base) && Array.isArray(patch)) {
149
- return conflictResolution === "prefer-patch" ? patch : base;
150
- }
151
- const result = {};
152
- const baseObj = base;
153
- const patchObj = patch;
154
- const allKeys = /* @__PURE__ */ new Set([...Object.keys(baseObj), ...Object.keys(patchObj)]);
155
- for (const key of allKeys) {
156
- const baseVal = baseObj[key];
157
- const patchVal = patchObj[key];
158
- if (key in baseObj && key in patchObj) {
159
- if (typeof baseVal === "object" && baseVal !== null && typeof patchVal === "object" && patchVal !== null && !Array.isArray(baseVal) && !Array.isArray(patchVal)) {
160
- result[key] = deepMerge(baseVal, patchVal, conflictResolution);
161
- } else {
162
- result[key] = conflictResolution === "prefer-patch" ? patchVal : baseVal;
163
- }
164
- } else if (key in baseObj) {
165
- result[key] = baseVal;
166
- } else {
167
- result[key] = patchVal;
168
- }
169
- }
170
- return result;
145
+ return deepMerge$1(base, patch, { conflictResolution });
171
146
  }
172
147
  var plugin = {
173
148
  name: "json-path",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wrongstack/plugins",
3
- "version": "0.148.0",
3
+ "version": "0.155.0",
4
4
  "description": "Official WrongStack plugin collection — auto-doc, git-autocommit, shell-check, cost-tracker, file-watcher, web-search, json-path, cron, template-engine, semver-bump",
5
5
  "license": "MIT",
6
6
  "author": "ECOSTACK TECHNOLOGY OÜ",
@@ -63,7 +63,7 @@
63
63
  "vitest": "^4.1.8"
64
64
  },
65
65
  "dependencies": {
66
- "@wrongstack/core": "0.148.0"
66
+ "@wrongstack/core": "0.155.0"
67
67
  },
68
68
  "scripts": {
69
69
  "build": "tsup",