diff --git a/package.json b/package.json index 9c2fad27..bb058d24 100644 --- a/package.json +++ b/package.json @@ -266,6 +266,7 @@ "potrace": "^2.1.8", "qrcode": "^1.5.1", "rtf-stream-parser": "^3.8.0", + "slashes": "^3.0.12", "sql-formatter": "^13.0.0", "sshpk": "^1.18.0", "turndown": "^7.1.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 01502d3c..1f555bfd 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -554,6 +554,9 @@ dependencies: silly-password-generator: specifier: ^1.0.28 version: 1.0.28 + slashes: + specifier: ^3.0.12 + version: 3.0.12 sql-formatter: specifier: ^13.0.0 version: 13.0.0 @@ -9667,6 +9670,7 @@ packages: /glob@7.2.3: resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} + deprecated: Glob versions prior to v9 are no longer supported dependencies: fs.realpath: 1.0.0 inflight: 1.0.6 @@ -10933,7 +10937,6 @@ packages: /jsesc@2.5.2: resolution: {integrity: sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==} engines: {node: '>=4'} - hasBin: true /jsesc@3.0.2: resolution: {integrity: sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==} @@ -13777,6 +13780,10 @@ packages: resolution: {integrity: sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==} engines: {node: '>=12'} + /slashes@3.0.12: + resolution: {integrity: sha512-Q9VME8WyGkc7pJf6QEkj3wE+2CnvZMI+XJhwdTPR8Z/kWQRXi7boAWLDibRPyHRTUTPx5FaU7MsyrjI3yLB4HA==} + dev: false + /snake-case@2.1.0: resolution: {integrity: sha512-FMR5YoPFwOLuh4rRz92dywJjyKYZNLpMn1R5ujVpIYkbA9p01fq8RMg0FkO4M+Yobt4MjHeLTJVm5xFFBHSV2Q==} dependencies: @@ -16226,6 +16233,7 @@ packages: /yamljs@0.3.0: resolution: {integrity: sha512-C/FsVVhht4iPQYXOInoxUM/1ELSf9EsgKH34FofQOp6hwCPrW4vG4w5++TED3xRUo8gD7l0P1J1dLlDYzODsTQ==} + hasBin: true dependencies: argparse: 1.0.10 glob: 7.2.3 diff --git a/src/tools/index.ts b/src/tools/index.ts index fbce61d8..75bb0421 100644 --- a/src/tools/index.ts +++ b/src/tools/index.ts @@ -118,6 +118,7 @@ import { tool as fileType } from './file-type'; import { tool as htmlCleaner } from './html-cleaner'; import { tool as imageToAsciiArt } from './image-to-ascii-art'; import { tool as ipv6SubnetCalculator } from './ipv6-subnet-calculator'; +import { tool as jsonEscaper } from './json-escaper'; import { tool as pdfSignatureChecker } from './pdf-signature-checker'; import { tool as numeronymGenerator } from './numeronym-generator'; import { tool as macAddressGenerator } from './mac-address-generator'; @@ -335,6 +336,7 @@ export const toolsByCategory: ToolCategory[] = [ phpArrayToJson, torrentToMagnet, unicodeSearch, + jsonEscaper, ], }, { diff --git a/src/tools/json-escaper/index.ts b/src/tools/json-escaper/index.ts new file mode 100644 index 00000000..70ea3a7a --- /dev/null +++ b/src/tools/json-escaper/index.ts @@ -0,0 +1,12 @@ +import { Braces } from '@vicons/tabler'; +import { defineTool } from '../tool'; + +export const tool = defineTool({ + name: 'Json Escaper/Unescaper', + path: '/json-escaper', + description: 'Escape and unescape JSON string', + keywords: ['json', 'string', 'escape', 'unescape'], + component: () => import('./json-escaper.vue'), + icon: Braces, + createdAt: new Date('2024-03-09'), +}); diff --git a/src/tools/json-escaper/json-escaper.vue b/src/tools/json-escaper/json-escaper.vue new file mode 100644 index 00000000..18d53a3c --- /dev/null +++ b/src/tools/json-escaper/json-escaper.vue @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + +