draply-dev 1.0.5 → 1.0.6

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/bin/cli.js +9 -0
  2. package/package.json +1 -1
package/bin/cli.js CHANGED
@@ -222,6 +222,15 @@ Return ONLY the patch blocks.`;
222
222
  if (newContent.includes(patch.search)) {
223
223
  newContent = newContent.replace(patch.search, patch.replace);
224
224
  applied++;
225
+ } else {
226
+ // Fallback to whitespace-agnostic matching
227
+ const escapeRegExp = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
228
+ const looseRegexStr = escapeRegExp(patch.search.trim()).replace(/\\s+/g, '\\s+');
229
+ const looseRegex = new RegExp(looseRegexStr);
230
+ if (looseRegex.test(newContent)) {
231
+ newContent = newContent.replace(looseRegex, patch.replace);
232
+ applied++;
233
+ }
225
234
  }
226
235
  }
227
236
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "draply-dev",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "Visual overlay for any frontend project — move, resize, restyle live in the browser, save to CSS",
5
5
  "author": "Arman",
6
6
  "type": "commonjs",