mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-10-27 10:03:48 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cf5e4d9056 | ||
|
|
992f96b48a | ||
|
|
fcf4cfe64d | ||
|
|
f54223fb0a |
@@ -2,6 +2,15 @@
|
|||||||
|
|
||||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||||
|
|
||||||
|
### [2.10.3](https://github.com/CorentinTh/it-tools/compare/v2.10.2...v2.10.3) (2022-08-14)
|
||||||
|
|
||||||
|
|
||||||
|
### Refactors
|
||||||
|
|
||||||
|
* **share:** new share banner ([fcf4cfe](https://github.com/CorentinTh/it-tools/commit/fcf4cfe64d4c1c3814137c8ff23b83a1ca0d502d))
|
||||||
|
* **share:** updated twitter meta tags ([992f96b](https://github.com/CorentinTh/it-tools/commit/992f96b48a89e2793ccf75fb9e28b2ec7b7f62b6))
|
||||||
|
* **validation:** simplified validation management with helpers ([f54223f](https://github.com/CorentinTh/it-tools/commit/f54223fb0aaedbd101b5d3dc4176053533bb936a))
|
||||||
|
|
||||||
### [2.10.2](https://github.com/CorentinTh/it-tools/compare/v2.10.1...v2.10.2) (2022-08-04)
|
### [2.10.2](https://github.com/CorentinTh/it-tools/compare/v2.10.1...v2.10.2) (2022-08-04)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
12
index.html
12
index.html
@@ -31,17 +31,21 @@
|
|||||||
property="og:description"
|
property="og:description"
|
||||||
content="Collection of handy online tools for developers, with great UX. IT Tools is a free and open-source collection of handy online tools for developers & people working in IT."
|
content="Collection of handy online tools for developers, with great UX. IT Tools is a free and open-source collection of handy online tools for developers & people working in IT."
|
||||||
/>
|
/>
|
||||||
<meta property="og:image" content="/banner.png" />
|
<meta property="og:image" content="https://it-tools.tech/banner.png" />
|
||||||
|
|
||||||
<meta name="twitter:card" content="summary_large_image" />
|
<meta name="twitter:card" content="summary_large_image" />
|
||||||
<meta property="twitter:domain" content="it-tools.tech" />
|
<meta name="twitter:domain" content="it-tools.tech" />
|
||||||
<meta property="twitter:url" content="https://it-tools.tech/" />
|
<meta name="twitter:url" content="https://it-tools.tech/" />
|
||||||
|
<meta name="twitter:site" content="@ittoolsdottech" />
|
||||||
|
<meta name="twitter:creator" content="@cthmsst" />
|
||||||
|
|
||||||
<meta name="twitter:title" content="IT Tools - Handy online tools for developers" />
|
<meta name="twitter:title" content="IT Tools - Handy online tools for developers" />
|
||||||
<meta
|
<meta
|
||||||
name="twitter:description"
|
name="twitter:description"
|
||||||
content="Collection of handy online tools for developers, with great UX. IT Tools is a free and open-source collection of handy online tools for developers & people working in IT."
|
content="Collection of handy online tools for developers, with great UX. IT Tools is a free and open-source collection of handy online tools for developers & people working in IT."
|
||||||
/>
|
/>
|
||||||
<meta name="twitter:image" content="/banner.png" />
|
<meta name="twitter:image" content="https://it-tools.tech/banner.png" />
|
||||||
|
<meta name="twitter:image:alt" content="IT Tools - Handy online tools for developers" />
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
|
|||||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "it-tools",
|
"name": "it-tools",
|
||||||
"version": "2.10.2",
|
"version": "2.10.3",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "it-tools",
|
"name": "it-tools",
|
||||||
"version": "2.10.2",
|
"version": "2.10.3",
|
||||||
"license": "GNU GPLv3",
|
"license": "GNU GPLv3",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@it-tools/bip39": "^0.0.4",
|
"@it-tools/bip39": "^0.0.4",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "it-tools",
|
"name": "it-tools",
|
||||||
"version": "2.10.2",
|
"version": "2.10.3",
|
||||||
"description": "Collection of handy online tools for developers, with great UX. ",
|
"description": "Collection of handy online tools for developers, with great UX. ",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"productivity",
|
"productivity",
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 71 KiB After Width: | Height: | Size: 155 KiB |
@@ -60,6 +60,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useCopy } from '@/composable/copy';
|
import { useCopy } from '@/composable/copy';
|
||||||
import { useValidation } from '@/composable/validation';
|
import { useValidation } from '@/composable/validation';
|
||||||
|
import { isNotThrowing } from '@/utils/boolean';
|
||||||
import { withDefaultOnError } from '@/utils/defaults';
|
import { withDefaultOnError } from '@/utils/defaults';
|
||||||
import {
|
import {
|
||||||
chineseSimplifiedWordList,
|
chineseSimplifiedWordList,
|
||||||
@@ -98,11 +99,7 @@ const passphraseInput = ref('');
|
|||||||
const language = ref<keyof typeof languages>('English');
|
const language = ref<keyof typeof languages>('English');
|
||||||
const passphrase = computed({
|
const passphrase = computed({
|
||||||
get() {
|
get() {
|
||||||
try {
|
return withDefaultOnError(() => entropyToMnemonic(entropy.value, languages[language.value]), passphraseInput.value);
|
||||||
return entropyToMnemonic(entropy.value, languages[language.value]);
|
|
||||||
} catch (_) {
|
|
||||||
return passphraseInput.value;
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
set(value: string) {
|
set(value: string) {
|
||||||
passphraseInput.value = value;
|
passphraseInput.value = value;
|
||||||
@@ -128,14 +125,7 @@ const mnemonicValidation = useValidation({
|
|||||||
source: passphrase,
|
source: passphrase,
|
||||||
rules: [
|
rules: [
|
||||||
{
|
{
|
||||||
validator: (value) => {
|
validator: (value) => isNotThrowing(() => mnemonicToEntropy(value, languages[language.value])),
|
||||||
try {
|
|
||||||
mnemonicToEntropy(value, languages[language.value]);
|
|
||||||
return true;
|
|
||||||
} catch (_) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
message: 'Invalid mnemonic',
|
message: 'Invalid mnemonic',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -60,6 +60,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useCopy } from '@/composable/copy';
|
import { useCopy } from '@/composable/copy';
|
||||||
import { useValidation } from '@/composable/validation';
|
import { useValidation } from '@/composable/validation';
|
||||||
|
import { isNotThrowing } from '@/utils/boolean';
|
||||||
import { withDefaultOnError } from '@/utils/defaults';
|
import { withDefaultOnError } from '@/utils/defaults';
|
||||||
import { computed, ref } from 'vue';
|
import { computed, ref } from 'vue';
|
||||||
|
|
||||||
@@ -70,14 +71,7 @@ const encodedValidation = useValidation({
|
|||||||
source: encodeInput,
|
source: encodeInput,
|
||||||
rules: [
|
rules: [
|
||||||
{
|
{
|
||||||
validator: (value) => {
|
validator: (value) => isNotThrowing(() => encodeURIComponent(value)),
|
||||||
try {
|
|
||||||
encodeURIComponent(value);
|
|
||||||
return true;
|
|
||||||
} catch (_) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
message: 'Impossible to parse this string',
|
message: 'Impossible to parse this string',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@@ -92,14 +86,7 @@ const decodeValidation = useValidation({
|
|||||||
source: encodeInput,
|
source: encodeInput,
|
||||||
rules: [
|
rules: [
|
||||||
{
|
{
|
||||||
validator: (value) => {
|
validator: (value) => isNotThrowing(() => decodeURIComponent(value)),
|
||||||
try {
|
|
||||||
decodeURIComponent(value);
|
|
||||||
return true;
|
|
||||||
} catch (_) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
message: 'Impossible to parse this string',
|
message: 'Impossible to parse this string',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -27,10 +27,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, ref } from 'vue';
|
|
||||||
import { SubdirectoryArrowRightRound } from '@vicons/material';
|
|
||||||
import { useValidation } from '@/composable/validation';
|
import { useValidation } from '@/composable/validation';
|
||||||
|
import { isNotThrowing } from '@/utils/boolean';
|
||||||
import { withDefaultOnError } from '@/utils/defaults';
|
import { withDefaultOnError } from '@/utils/defaults';
|
||||||
|
import { SubdirectoryArrowRightRound } from '@vicons/material';
|
||||||
|
import { computed, ref } from 'vue';
|
||||||
import InputCopyable from '../../components/InputCopyable.vue';
|
import InputCopyable from '../../components/InputCopyable.vue';
|
||||||
|
|
||||||
const urlToParse = ref('https://me:pwd@it-tools.tech:3000/url-parser?key1=value&key2=value2#the-hash');
|
const urlToParse = ref('https://me:pwd@it-tools.tech:3000/url-parser?key1=value&key2=value2#the-hash');
|
||||||
@@ -40,14 +41,7 @@ const validation = useValidation({
|
|||||||
source: urlToParse,
|
source: urlToParse,
|
||||||
rules: [
|
rules: [
|
||||||
{
|
{
|
||||||
validator: (value) => {
|
validator: (value) => isNotThrowing(() => new URL(value)),
|
||||||
try {
|
|
||||||
new URL(value);
|
|
||||||
return true;
|
|
||||||
} catch (_) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
message: 'Invalid url',
|
message: 'Invalid url',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|||||||
15
src/utils/boolean.test.ts
Normal file
15
src/utils/boolean.test.ts
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
import { describe, expect, it } from 'vitest';
|
||||||
|
import { isNotThrowing } from './boolean';
|
||||||
|
|
||||||
|
describe('boolean utils', () => {
|
||||||
|
describe('isNotThrowing', () => {
|
||||||
|
it('should return if the call throws or false otherwise', () => {
|
||||||
|
expect(isNotThrowing(() => {})).to.eql(true);
|
||||||
|
expect(
|
||||||
|
isNotThrowing(() => {
|
||||||
|
throw new Error();
|
||||||
|
}),
|
||||||
|
).to.eql(false);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
10
src/utils/boolean.ts
Normal file
10
src/utils/boolean.ts
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
export { isNotThrowing };
|
||||||
|
|
||||||
|
function isNotThrowing(cb: () => unknown): boolean {
|
||||||
|
try {
|
||||||
|
cb();
|
||||||
|
return true;
|
||||||
|
} catch (_) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user