@uxf/core 11.53.2 → 11.54.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/README.md CHANGED
@@ -188,6 +188,17 @@ const submitHandler: FormEventHandler<HTMLFormElement> = () => {
188
188
  };
189
189
  ```
190
190
 
191
+ ### escapeQuotes
192
+
193
+ Escapes all double quotes (`"`) in a string by replacing them with `\"`.
194
+
195
+ ```ts
196
+ import { escapeQuotes } from "@uxf/core/utils/escape-quotes";
197
+
198
+ escapeQuotes('The "quick" fox');
199
+ // Output: The \"quick\" fox
200
+ ```
201
+
191
202
  ### formatBytes
192
203
 
193
204
  Appends suitable unit to the byte value of data size.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxf/core",
3
- "version": "11.53.2",
3
+ "version": "11.54.0",
4
4
  "description": "UXF Core",
5
5
  "author": "Petr Vejvoda <vejvoda@uxf.cz>",
6
6
  "homepage": "https://gitlab.com/uxf-npm/core#readme",
@@ -0,0 +1 @@
1
+ export declare function escapeQuotes(value: string): string;
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.escapeQuotes = escapeQuotes;
4
+ function escapeQuotes(value) {
5
+ return value.replace(/\x22/g, "\\\x22");
6
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const escape_quotes_1 = require("./escape-quotes");
4
+ test("escapeQuotes", () => {
5
+ expect((0, escape_quotes_1.escapeQuotes)('"Název něčeho"')).toBe('\\"Název něčeho\\"');
6
+ });