update deps (#11820)
* update deps * fix * wip * wip * wip * Update docker-compose.yml.example * Delete reviewer-lottery.yml * Update RepositoryModule.ts * wip * wip * clean up * update deps * wip * wip
This commit is contained in:
@@ -77,7 +77,6 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { } from 'vue';
|
||||
import getPasswordStrength from 'syuilo-password-strength';
|
||||
import { toUnicode } from 'punycode/';
|
||||
import MkButton from './MkButton.vue';
|
||||
import MkInput from './MkInput.vue';
|
||||
@@ -132,6 +131,30 @@ const shouldDisableSubmitting = $computed((): boolean => {
|
||||
passwordRetypeState !== 'match';
|
||||
});
|
||||
|
||||
function getPasswordStrength(source: string): number {
|
||||
let strength = 0;
|
||||
let power = 0.018;
|
||||
|
||||
// 英数字
|
||||
if (/[a-zA-Z]/.test(source) && /[0-9]/.test(source)) {
|
||||
power += 0.020;
|
||||
}
|
||||
|
||||
// 大文字と小文字が混ざってたら
|
||||
if (/[a-z]/.test(source) && /[A-Z]/.test(source)) {
|
||||
power += 0.015;
|
||||
}
|
||||
|
||||
// 記号が混ざってたら
|
||||
if (/[!\x22\#$%&@'()*+,-./_]/.test(source)) {
|
||||
power += 0.02;
|
||||
}
|
||||
|
||||
strength = power * source.length;
|
||||
|
||||
return Math.max(0, Math.min(1, strength));
|
||||
}
|
||||
|
||||
function onChangeUsername(): void {
|
||||
if (username === '') {
|
||||
usernameState = null;
|
||||
|
@@ -143,7 +143,6 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { defineAsyncComponent, computed, onMounted, onUnmounted, nextTick, watch } from 'vue';
|
||||
import calcAge from 's-age';
|
||||
import * as Misskey from 'misskey-js';
|
||||
import MkNote from '@/components/MkNote.vue';
|
||||
import MkFollowButton from '@/components/MkFollowButton.vue';
|
||||
@@ -167,6 +166,21 @@ import MkNotes from '@/components/MkNotes.vue';
|
||||
import { api } from '@/os';
|
||||
import { isFfVisibleForMe } from '@/scripts/isFfVisibleForMe';
|
||||
|
||||
function calcAge(birthdate: string): number {
|
||||
const date = new Date(birthdate);
|
||||
const now = new Date();
|
||||
|
||||
let yearDiff = now.getFullYear() - date.getFullYear();
|
||||
const monthDiff = now.getMonth() - date.getMonth();
|
||||
const pastDate = now.getDate() < date.getDate();
|
||||
|
||||
if (monthDiff < 0 || (monthDiff === 0 && pastDate)) {
|
||||
yearDiff--;
|
||||
}
|
||||
|
||||
return yearDiff;
|
||||
}
|
||||
|
||||
const XPhotos = defineAsyncComponent(() => import('./index.photos.vue'));
|
||||
const XActivity = defineAsyncComponent(() => import('./index.activity.vue'));
|
||||
|
||||
|
Reference in New Issue
Block a user