formate change

This commit is contained in:
Zhaoxuan Chen 2025-08-05 18:53:00 +08:00
parent d947ed5c53
commit 2f28e17c8b
5 changed files with 2863 additions and 2115 deletions

View file

@ -6,7 +6,7 @@
"author": "Alicia Sykes <alicia@omg.lol> (https://aliciasykes.com)",
"scripts": {
"start": "node server",
"dev": "NODE_OPTIONS=--openssl-legacy-provider vue-cli-service serve",
"dev": "cross-env NODE_OPTIONS=--openssl-legacy-provider vue-cli-service serve --no-eslint",
"build": "NODE_OPTIONS=--openssl-legacy-provider vue-cli-service build",
"lint": "vue-cli-service lint",
"pm2-start": "npx pm2 start server.js",
@ -59,6 +59,7 @@
"@vue/eslint-config-standard": "^4.0.0",
"babel-eslint": "^10.0.1",
"copy-webpack-plugin": "6.4.0",
"cross-env": "^10.0.0",
"eslint": "^6.8.0",
"eslint-config-airbnb": "^18.0.1",
"eslint-plugin-vue": "^7.9.0",

View file

@ -37,7 +37,7 @@ export default {
},
daysForNew() {
return parseInt(Number(this.options.daysForNew)) || false;
}
},
},
methods: {
fetchData() {
@ -47,10 +47,10 @@ export default {
}
},
processData(data) {
let today = new Date();
const today = new Date();
this.data = data.sort((a, b) => new Date(a.date) < new Date(b.date));
if (this.daysForNew) {
let threshold = this.daysForNew * 1000 * 60 * 60 * 24;
const threshold = this.daysForNew * 1000 * 60 * 60 * 24;
this.data = this.data.map((item) => {
item.isNew = (today - new Date(item.date) < threshold);
return item;

View file

@ -3,6 +3,10 @@
/* Tile filtering utility */
import ErrorHandler from '@/utils/ErrorHandler';
// 预编译正则表达式,避免每次调用时重新编译
// write regular expression first, avoidance of repetition.
const SPECIAL_CHARS_REGEX = /[^\w\s\p{Alpha}]/giu;
/**
* Extracts the site name from domain
* @param {string} url The URL to process
@ -24,7 +28,7 @@ const getDomainFromUrl = (url) => {
*/
const filterHelper = (compareStr, searchStr) => {
if (!compareStr) return false;
const process = (input) => input?.toString().toLowerCase().replace(/[^\w\s\p{Alpha}]/giu, '');
const process = (input) => input?.toString().toLowerCase().replace(SPECIAL_CHARS_REGEX, '');
return process(searchStr).split(/\s/).every(word => process(compareStr).includes(word));
};

View file

@ -11,7 +11,7 @@ pageInfo:
# Optional app settings and configuration
appConfig:
theme: colorful
theme: callisto
# Main content - An array of sections, each containing an array of items
sections:
@ -19,7 +19,7 @@ sections:
icon: fas fa-rocket
items:
- title: Dashy Live
description: Development a project management links for Dashy
description: Developmental project management links for Dashy
icon: https://i.ibb.co/qWWpD0v/astro-dab-128.png
url: https://live.dashy.to/
target: newtab

4959
yarn.lock

File diff suppressed because it is too large Load diff