Skip to content

Commit e64cafd

Browse files
committed
Merge remote-tracking branch 'origin/main' into feat/torrent-to-magnet
2 parents 099ecc8 + 318fb6e commit e64cafd

File tree

11 files changed

+233
-32
lines changed

11 files changed

+233
-32
lines changed

components.d.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ declare module '@vue/runtime-core' {
7272
DockerRunToDockerComposeConverter: typeof import('./src/tools/docker-run-to-docker-compose-converter/docker-run-to-docker-compose-converter.vue')['default']
7373
DynamicValues: typeof import('./src/tools/benchmark-builder/dynamic-values.vue')['default']
7474
Editor: typeof import('./src/tools/html-wysiwyg-editor/editor/editor.vue')['default']
75+
EmailNormalizer: typeof import('./src/tools/email-normalizer/email-normalizer.vue')['default']
7576
EmojiCard: typeof import('./src/tools/emoji-picker/emoji-card.vue')['default']
7677
EmojiGrid: typeof import('./src/tools/emoji-picker/emoji-grid.vue')['default']
7778
EmojiPicker: typeof import('./src/tools/emoji-picker/emoji-picker.vue')['default']
@@ -110,6 +111,7 @@ declare module '@vue/runtime-core' {
110111
JsonMinify: typeof import('./src/tools/json-minify/json-minify.vue')['default']
111112
JsonToCsv: typeof import('./src/tools/json-to-csv/json-to-csv.vue')['default']
112113
JsonToToml: typeof import('./src/tools/json-to-toml/json-to-toml.vue')['default']
114+
JsonToXml: typeof import('./src/tools/json-to-xml/json-to-xml.vue')['default']
113115
JsonToYaml: typeof import('./src/tools/json-to-yaml-converter/json-to-yaml.vue')['default']
114116
JsonViewer: typeof import('./src/tools/json-viewer/json-viewer.vue')['default']
115117
JwtParser: typeof import('./src/tools/jwt-parser/jwt-parser.vue')['default']
@@ -130,26 +132,22 @@ declare module '@vue/runtime-core' {
130132
NCode: typeof import('naive-ui')['NCode']
131133
NCollapseTransition: typeof import('naive-ui')['NCollapseTransition']
132134
NConfigProvider: typeof import('naive-ui')['NConfigProvider']
133-
NDivider: typeof import('naive-ui')['NDivider']
134135
NEllipsis: typeof import('naive-ui')['NEllipsis']
136+
NForm: typeof import('naive-ui')['NForm']
135137
NFormItem: typeof import('naive-ui')['NFormItem']
136-
NGi: typeof import('naive-ui')['NGi']
137-
NGrid: typeof import('naive-ui')['NGrid']
138138
NH1: typeof import('naive-ui')['NH1']
139139
NH3: typeof import('naive-ui')['NH3']
140140
NIcon: typeof import('naive-ui')['NIcon']
141141
NInputNumber: typeof import('naive-ui')['NInputNumber']
142-
NLabel: typeof import('naive-ui')['NLabel']
143142
NLayout: typeof import('naive-ui')['NLayout']
144143
NLayoutSider: typeof import('naive-ui')['NLayoutSider']
145144
NMenu: typeof import('naive-ui')['NMenu']
146145
NP: typeof import('naive-ui')['NP']
147146
NRadio: typeof import('naive-ui')['NRadio']
148147
NRadioGroup: typeof import('naive-ui')['NRadioGroup']
149148
NScrollbar: typeof import('naive-ui')['NScrollbar']
150-
NSpace: typeof import('naive-ui')['NSpace']
151-
NSpin: typeof import('naive-ui')['NSpin']
152-
NStatistic: typeof import('naive-ui')['NStatistic']
149+
NSlider: typeof import('naive-ui')['NSlider']
150+
NSwitch: typeof import('naive-ui')['NSwitch']
153151
NumeronymGenerator: typeof import('./src/tools/numeronym-generator/numeronym-generator.vue')['default']
154152
OtpCodeGeneratorAndValidator: typeof import('./src/tools/otp-code-generator-and-validator/otp-code-generator-and-validator.vue')['default']
155153
PasswordStrengthAnalyser: typeof import('./src/tools/password-strength-analyser/password-strength-analyser.vue')['default']
@@ -192,6 +190,7 @@ declare module '@vue/runtime-core' {
192190
UuidGenerator: typeof import('./src/tools/uuid-generator/uuid-generator.vue')['default']
193191
WifiQrCodeGenerator: typeof import('./src/tools/wifi-qr-code-generator/wifi-qr-code-generator.vue')['default']
194192
XmlFormatter: typeof import('./src/tools/xml-formatter/xml-formatter.vue')['default']
193+
XmlToJson: typeof import('./src/tools/xml-to-json/xml-to-json.vue')['default']
195194
YamlToJson: typeof import('./src/tools/yaml-to-json-converter/yaml-to-json.vue')['default']
196195
YamlToToml: typeof import('./src/tools/yaml-to-toml/yaml-to-toml.vue')['default']
197196
YamlViewer: typeof import('./src/tools/yaml-viewer/yaml-viewer.vue')['default']

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
"crypto-js": "^4.1.1",
5858
"date-fns": "^2.29.3",
5959
"dompurify": "^3.0.6",
60+
"email-normalizer": "^1.0.0",
6061
"emojilib": "^3.0.10",
6162
"figlet": "^1.7.0",
6263
"figue": "^1.2.0",
@@ -93,6 +94,7 @@
9394
"vue-router": "^4.1.6",
9495
"vue-tsc": "^1.8.1",
9596
"xml-formatter": "^3.3.2",
97+
"xml-js": "^1.6.11",
9698
"yaml": "^2.2.1"
9799
},
98100
"devDependencies": {

pnpm-lock.yaml

Lines changed: 47 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
<script setup lang="ts">
2+
import { normalizeEmail } from 'email-normalizer';
3+
import { withDefaultOnError } from '@/utils/defaults';
4+
import { useCopy } from '@/composable/copy';
5+
6+
const emails = ref('');
7+
const normalizedEmails = computed(() => {
8+
if (!emails.value) {
9+
return '';
10+
}
11+
12+
return emails.value
13+
.split('\n')
14+
.map((email) => {
15+
return withDefaultOnError(() => normalizeEmail({ email }), `Unable to parse email: ${email}`);
16+
})
17+
.join('\n');
18+
});
19+
20+
const { copy } = useCopy({ source: normalizedEmails, text: 'Normalized emails copied to the clipboard', createToast: true });
21+
</script>
22+
23+
<template>
24+
<div>
25+
<div class="mb-2">
26+
Raw emails to normalize:
27+
</div>
28+
<c-input-text
29+
v-model:value="emails"
30+
placeholder="Put your emails here (one per line)..."
31+
rows="3"
32+
multiline
33+
autocomplete="off"
34+
autocorrect="off"
35+
autocapitalize="off"
36+
spellcheck="false"
37+
autofocus
38+
monospace
39+
/>
40+
41+
<div class="mb-2 mt-4">
42+
Normalized emails:
43+
</div>
44+
<c-input-text
45+
:value="normalizedEmails"
46+
placeholder="Normalized emails will appear here..."
47+
rows="3"
48+
autocomplete="off"
49+
autocorrect="off"
50+
autocapitalize="off"
51+
spellcheck="false"
52+
multiline
53+
readonly
54+
monospace
55+
/>
56+
<div class="mt-4 flex justify-center gap-2">
57+
<c-button @click="emails = ''">
58+
Clear emails
59+
</c-button>
60+
<c-button :disabled="!normalizedEmails" @click="copy()">
61+
Copy normalized emails
62+
</c-button>
63+
</div>
64+
</div>
65+
</template>

src/tools/email-normalizer/index.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { Mail } from '@vicons/tabler';
2+
import { defineTool } from '../tool';
3+
4+
export const tool = defineTool({
5+
name: 'Email normalizer',
6+
path: '/email-normalizer',
7+
description: 'Normalize email addresses to a standard format for easier comparison. Useful for deduplication and data cleaning.',
8+
keywords: ['email', 'normalizer'],
9+
component: () => import('./email-normalizer.vue'),
10+
icon: Mail,
11+
createdAt: new Date('2024-08-15'),
12+
});

src/tools/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
import { tool as base64FileConverter } from './base64-file-converter';
22
import { tool as base64StringConverter } from './base64-string-converter';
33
import { tool as basicAuthGenerator } from './basic-auth-generator';
4+
import { tool as emailNormalizer } from './email-normalizer';
45

56
import { tool as asciiTextDrawer } from './ascii-text-drawer';
67

78
import { tool as textToUnicode } from './text-to-unicode';
89
import { tool as safelinkDecoder } from './safelink-decoder';
10+
import { tool as xmlToJson } from './xml-to-json';
11+
import { tool as jsonToXml } from './json-to-xml';
912
import { tool as torrentToMagnet } from './torrent-to-magnet';
1013
import { tool as pdfSignatureChecker } from './pdf-signature-checker';
1114
import { tool as numeronymGenerator } from './numeronym-generator';
@@ -108,6 +111,8 @@ export const toolsByCategory: ToolCategory[] = [
108111
listConverter,
109112
tomlToJson,
110113
tomlToYaml,
114+
xmlToJson,
115+
jsonToXml,
111116
],
112117
},
113118
{
@@ -150,6 +155,7 @@ export const toolsByCategory: ToolCategory[] = [
150155
dockerRunToDockerComposeConverter,
151156
xmlFormatter,
152157
yamlViewer,
158+
emailNormalizer,
153159
],
154160
},
155161
{

src/tools/json-to-xml/index.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { Braces } from '@vicons/tabler';
2+
import { defineTool } from '../tool';
3+
4+
export const tool = defineTool({
5+
name: 'JSON to XML',
6+
path: '/json-to-xml',
7+
description: 'Convert JSON to XML',
8+
keywords: ['json', 'xml'],
9+
component: () => import('./json-to-xml.vue'),
10+
icon: Braces,
11+
createdAt: new Date('2024-08-09'),
12+
});

0 commit comments

Comments
 (0)