Skip to content

Commit 30f1c4e

Browse files
committed
Merge branch 'feat/url-defanger' into chore/all-my-stuffs
# Conflicts: # package.json # pnpm-lock.yaml # src/tools/index.ts
2 parents 8519694 + 0106d1b commit 30f1c4e

File tree

5 files changed

+210
-6
lines changed

5 files changed

+210
-6
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@
163163
"exif-be-gone": "^1.5.1",
164164
"event-cron-parser": "^1.0.34",
165165
"fflate": "^0.8.2",
166+
"fanger": "^0.3.1",
166167
"figlet": "^1.7.0",
167168
"exifreader": "^4.20.0",
168169
"figue": "^1.2.0",

pnpm-lock.yaml

Lines changed: 146 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/tools/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ import { tool as pgpKeygen } from './pgp-keygen';
133133
import { tool as portNumbers } from './port-numbers';
134134
import { tool as rsaEncryption } from './rsa-encryption';
135135
import { tool as urlCleaner } from './url-cleaner';
136+
import { tool as urlFanger } from './url-fanger';
136137
import { tool as pdfSignatureChecker } from './pdf-signature-checker';
137138
import { tool as numeronymGenerator } from './numeronym-generator';
138139
import { tool as macAddressGenerator } from './mac-address-generator';
@@ -338,6 +339,7 @@ export const toolsByCategory: ToolCategory[] = [
338339
htmlEntities,
339340
urlParser,
340341
urlCleaner,
342+
urlFanger,
341343
deviceInformation,
342344
basicAuthGenerator,
343345
htpasswdGenerator,

src/tools/url-fanger/index.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { EyeOff } from '@vicons/tabler';
2+
import { defineTool } from '../tool';
3+
4+
export const tool = defineTool({
5+
name: 'Url Fanger',
6+
path: '/url-fanger',
7+
description: 'Defang/Refang an URL or email address',
8+
keywords: ['url', 'fanger', 'fange', 'defang', 'refang'],
9+
component: () => import('./url-fanger.vue'),
10+
icon: EyeOff,
11+
createdAt: new Date('2024-03-09'),
12+
});

src/tools/url-fanger/url-fanger.vue

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<script setup lang="ts">
2+
import { defang, refang } from 'fanger';
3+
import TextareaCopyable from '@/components/TextareaCopyable.vue';
4+
5+
const textInput = ref('');
6+
const defangOutput = computed(() => defang(textInput.value));
7+
8+
const fangedInput = ref('');
9+
const refangOutput = computed(() => refang(fangedInput.value));
10+
</script>
11+
12+
<template>
13+
<c-card title="Refang string">
14+
<c-input-text
15+
v-model:value="fangedInput"
16+
multiline
17+
placeholder="Put your string here..."
18+
rows="5"
19+
label="String to refang"
20+
raw-text
21+
mb-5
22+
/>
23+
24+
<TextareaCopyable
25+
label="String fanged"
26+
:value="refangOutput"
27+
placeholder="The refang encoding of your string will be here"
28+
mb-5
29+
/>
30+
</c-card>
31+
32+
<c-card title="Defang string">
33+
<c-input-text
34+
v-model:value="textInput"
35+
multiline
36+
placeholder="Your fanged string..."
37+
rows="5"
38+
label="Fanged string to decode"
39+
mb-5
40+
/>
41+
42+
<TextareaCopyable
43+
v-model:value="defangOutput"
44+
label="Defanged string"
45+
placeholder="The defanged string will be here"
46+
mb-5
47+
/>
48+
</c-card>
49+
</template>

0 commit comments

Comments
 (0)