remove empty tags

This commit is contained in:
lesion 2022-08-25 17:03:17 +02:00
parent 0377942842
commit fc1d145698
2 changed files with 61 additions and 60 deletions

View file

@ -10,13 +10,14 @@ export function load() {
db.exec('CREATE INDEX IF NOT EXISTS cosette_updated_at_index ON cosette (updatedAt)')
db.exec('CREATE TABLE IF NOT EXISTS chan (uuid TEXT PRIMARY KEY, cosetta_uuid REFERENCES cosette(uuid), message TEXT, updatedAt DATETIME DEFAULT CURRENT_TIMESTAMP)')
}
// TODO: da gestire in qualche modo all'avvio
// load()
export function add(cosetta) {
const q = db.prepare('INSERT INTO cosette (uuid, name, description, tags, images) VALUES(:uuid, :name, :description, :tags, :images)')
cosetta.uuid = v4()
cosetta.tags = JSON.stringify(cosetta.tags.split(',').map(t => t.toLowerCase().trim()))
cosetta.tags = JSON.stringify(
cosetta.tags.split(',')
.map(t => t.toLowerCase().trim())
.filter(t => t)) // tolgo i vuoti
cosetta.images = JSON.stringify(cosetta.images)
q.run(cosetta)
return cosetta

114
yarn.lock
View file

@ -310,9 +310,9 @@
integrity sha512-UHkDFCfSGTuXq08oQltXxSZmH1TXyWsL+4QhZDWvvLl6mEJQqk3u7/wq1LjhrrAXYIllaTtRSzUXl4Olkf2J8A==
"@iconify/json@^2.1.96":
version "2.1.96"
resolved "https://registry.yarnpkg.com/@iconify/json/-/json-2.1.96.tgz#65e6e40fbe53bfbc3ca438d24e33d100bf8062a3"
integrity sha512-wmc5KRqvKAlAr0bQz3P1UnUCXC9hYu1o89GZFR5Mr5NiUhhNHdbZyosOPnDHXduOa9lTM/ve8/Vo1vR55hCF5A==
version "2.1.97"
resolved "https://registry.yarnpkg.com/@iconify/json/-/json-2.1.97.tgz#9a628fce944f7449bbf7af16ddcf2eb5dd1cef35"
integrity sha512-oS04S/mAT9/d5sTMy3vH3180eoQJbNBiGxykliOApAaJ71+GEmV9hAa1TvdkmXTiv8ymdQCpcvFD8Fy53zDFcg==
dependencies:
"@iconify/types" "*"
pathe "^0.3.0"
@ -494,12 +494,12 @@
unimport "^0.6.7"
untyped "^0.4.5"
"@nuxt/kit@npm:@nuxt/kit-edge@3.0.0-rc.8-27686415.9f1ecd1":
version "3.0.0-rc.8-27686415.9f1ecd1"
resolved "https://registry.yarnpkg.com/@nuxt/kit-edge/-/kit-edge-3.0.0-rc.8-27686415.9f1ecd1.tgz#e603328d6656394473ac6b3761ead998c7c78d65"
integrity sha512-TX95GebMd3eln6N2/ms9vqKNdAUssJzzwoGZE6Ob0j5r8lR54fAqHZ69PTTIVZrrP+XzlyZMfRnMzEwVMVg7Pw==
"@nuxt/kit@npm:@nuxt/kit-edge@3.0.0-rc.8-27689472.403e0e6":
version "3.0.0-rc.8-27689472.403e0e6"
resolved "https://registry.yarnpkg.com/@nuxt/kit-edge/-/kit-edge-3.0.0-rc.8-27689472.403e0e6.tgz#5d3838f7685c178206579fef8ca87b8fd5fe0843"
integrity sha512-guP1uS670tK7RDzgxj/FKqZkkksooND/0PCLMbMUZs5ueXe5E7BKmEYFBc4XIw+11Dx4S8HRkVRKGDb5o+abug==
dependencies:
"@nuxt/schema" "npm:@nuxt/schema-edge@3.0.0-rc.8-27686415.9f1ecd1"
"@nuxt/schema" "npm:@nuxt/schema-edge@3.0.0-rc.8-27689472.403e0e6"
c12 "^0.2.9"
consola "^2.15.3"
defu "^6.1.0"
@ -548,10 +548,10 @@
ufo "^0.8.5"
unimport "^0.6.7"
"@nuxt/schema@npm:@nuxt/schema-edge@3.0.0-rc.8-27686415.9f1ecd1":
version "3.0.0-rc.8-27686415.9f1ecd1"
resolved "https://registry.yarnpkg.com/@nuxt/schema-edge/-/schema-edge-3.0.0-rc.8-27686415.9f1ecd1.tgz#4973852645f50a11faa6772641f42308f05a58d1"
integrity sha512-gxV1QJKTy9j//8TY1/tz6uNu6AjJFIi0e5cFxZRBezKsh1o7JBVt7ewtOqwy12nxSHKMKio7zh8hUHC/Eay63Q==
"@nuxt/schema@npm:@nuxt/schema-edge@3.0.0-rc.8-27689472.403e0e6":
version "3.0.0-rc.8-27689472.403e0e6"
resolved "https://registry.yarnpkg.com/@nuxt/schema-edge/-/schema-edge-3.0.0-rc.8-27689472.403e0e6.tgz#4930c3e2205496ab4dd322eaf8d8b39568ccfb77"
integrity sha512-gtecVWUYmwL+TSf02Yo2G23LnBw8LXE7X0k7kfrzNk1Egd2h5Ac49S211BZ1A4s1w/dWD/N3LiLBeUJkiiVywg==
dependencies:
c12 "^0.2.9"
create-require "^1.1.1"
@ -595,12 +595,12 @@
resolved "https://registry.yarnpkg.com/@nuxt/ui-templates/-/ui-templates-0.3.2.tgz#68bbc300a31cd14833f36fa69f6a6218cd8e1a16"
integrity sha512-o0KRB0Mna/M5QxqMe+XvlfKczFz3CQMlkEr6Ztyphp+00jq1Ti0AXdq1XAt9hXI3LoZRh4+2vVX331UaIZQQzQ==
"@nuxt/vite-builder@npm:@nuxt/vite-builder-edge@3.0.0-rc.8-27686415.9f1ecd1":
version "3.0.0-rc.8-27686415.9f1ecd1"
resolved "https://registry.yarnpkg.com/@nuxt/vite-builder-edge/-/vite-builder-edge-3.0.0-rc.8-27686415.9f1ecd1.tgz#604de9b94d5e2498f5a629738f366b409cc85bd1"
integrity sha512-IdDt3btuxT2GGVjCliQnuolkZdaqa1XwcgQRW+VuI0QqxVdDgLgyEF1xqoIaG7W6jB8lhIZwDLwyqXROwDth3A==
"@nuxt/vite-builder@npm:@nuxt/vite-builder-edge@3.0.0-rc.8-27689472.403e0e6":
version "3.0.0-rc.8-27689472.403e0e6"
resolved "https://registry.yarnpkg.com/@nuxt/vite-builder-edge/-/vite-builder-edge-3.0.0-rc.8-27689472.403e0e6.tgz#49f81ef20101a631399105f12fe1ae8fc0bf6bed"
integrity sha512-9gQwDNLMGpUWKnweyFdszFr5swr5DlkmC0IYXEX5aT1UnoiVDQTUdLCI7JIbcJ6jO9x42RiOiKvYKXbQID4r6w==
dependencies:
"@nuxt/kit" "npm:@nuxt/kit-edge@3.0.0-rc.8-27686415.9f1ecd1"
"@nuxt/kit" "npm:@nuxt/kit-edge@3.0.0-rc.8-27689472.403e0e6"
"@rollup/plugin-replace" "^4.0.0"
"@vitejs/plugin-vue" "^3.0.3"
"@vitejs/plugin-vue-jsx" "^2.0.0"
@ -614,7 +614,7 @@
externality "^0.2.2"
fs-extra "^10.1.0"
get-port-please "^2.6.1"
h3 "^0.7.15"
h3 "^0.7.16"
knitwork "^0.1.2"
magic-string "^0.26.2"
mlly "^0.5.14"
@ -797,9 +797,9 @@
integrity sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==
"@types/node@*", "@types/node@>=10.0.0":
version "18.7.10"
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.7.10.tgz#f642dc9ded1bdd8c2cd847246466e71182b0fd67"
integrity sha512-SST7B//wF7xlGoLo1IEVB0cQ4e7BgXlDk5IaPgb5s0DlYLjb4if07h8+0zbQIvahfPNXs6e7zyT0EH1MqaS+5g==
version "18.7.13"
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.7.13.tgz#23e6c5168333480d454243378b69e861ab5c011a"
integrity sha512-46yIhxSe5xEaJZXWdIBP7GU4HDTG8/eo0qd9atdiL+lFpA03y8KS+lkTN834TWJj5767GbWv4n/P6efyTFt1Dw==
"@types/parse-json@^4.0.0":
version "4.0.0"
@ -1471,9 +1471,9 @@ caniuse-api@^3.0.0:
lodash.uniq "^4.5.0"
caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001370, caniuse-lite@^1.0.30001373:
version "1.0.30001381"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001381.tgz#e62955310e6e69cdf4b40bc5bc0895aa24bc4b8b"
integrity sha512-fEnkDOKpvp6qc+olg7+NzE1SqyfiyKf4uci7fAU38M3zxs0YOyKOxW/nMZ2l9sJbt7KZHcDIxUnbI0Iime7V4w==
version "1.0.30001383"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001383.tgz#aecf317ccd940690725ae3ae4f28293c5fb8050e"
integrity sha512-swMpEoTp5vDoGBZsYZX7L7nXHe6dsHxi9o6/LKf/f0LukVtnrxly5GVb/fWdCDTqi/yw6Km6tiJ0pmBacm0gbg==
chalk@^1.1.3:
version "1.1.3"
@ -2275,9 +2275,9 @@ ee-first@1.1.1:
integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==
electron-to-chromium@^1.4.202:
version "1.4.225"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.225.tgz#3e27bdd157cbaf19768141f2e0f0f45071e52338"
integrity sha512-ICHvGaCIQR3P88uK8aRtx8gmejbVJyC6bB4LEC3anzBrIzdzC7aiZHY4iFfXhN4st6I7lMO0x4sgBHf/7kBvRw==
version "1.4.230"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.230.tgz#666909fdf5765acb1348b69752ee9955dc1664b7"
integrity sha512-3pwjAK0qHSDN9+YAF4fJknsSruP7mpjdWzUSruIJD/JCH77pEh0SorEyb3xVaKkfwk2tzjOt2D8scJ0KAdfXLA==
emoji-regex@^8.0.0:
version "8.0.0"
@ -3162,10 +3162,10 @@ gzip-size@^7.0.0:
dependencies:
duplexer "^0.1.2"
h3@^0.7.12, h3@^0.7.15:
version "0.7.15"
resolved "https://registry.yarnpkg.com/h3/-/h3-0.7.15.tgz#34b1d5cbded0c7491f629b4e3031ac9521785076"
integrity sha512-4lile6Q64nQ5Z2+6NaD85WU64fhF/qIVyGm4NaFyl4w7L/XDIiq5gkogWLUzZGGtq60M4tnFSj7qIxc0rmTqrg==
h3@^0.7.12, h3@^0.7.15, h3@^0.7.16:
version "0.7.16"
resolved "https://registry.yarnpkg.com/h3/-/h3-0.7.16.tgz#eaebfdf748000feafb4db49a814240a8ce43a8bb"
integrity sha512-U8DasgLV1dIv/FjlePZB0oSGWk37Swnx3eYYGPxJ0pup/KAmEXHt733NXFlPdX42y0HEEx9QEvJhULJR546JMg==
dependencies:
cookie-es "^0.5.0"
destr "^1.1.1"
@ -3271,10 +3271,10 @@ he@^1.1.1:
resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f"
integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==
hookable@^5.1.1:
version "5.1.1"
resolved "https://registry.yarnpkg.com/hookable/-/hookable-5.1.1.tgz#8e4cf052da4382ee232138cd9425369b9d5b280e"
integrity sha512-7qam9XBFb+DijNBthaL1k/7lHU2TEMZkWSyuqmU3sCQze1wFm5w9AlEx30PD7a+QVAjOy6Ec2goFwe1YVyk2uA==
hookable@^5.1.1, hookable@^5.2.2:
version "5.2.2"
resolved "https://registry.yarnpkg.com/hookable/-/hookable-5.2.2.tgz#303cd9a4c973900a51992ceb14590186351dabf7"
integrity sha512-J+tYTxF7bOYEQX2MJ3jWWjAKhQLzRAf0efkxyNfuSnIFLl3AXOpkuOVpVhBx5zMSeGPzIUNN5FpYQaA1eYzfVQ==
html-tags@^3.1.0:
version "3.2.0"
@ -3449,9 +3449,9 @@ internal-slot@^1.0.3:
side-channel "^1.0.4"
ioredis@^5.2.2:
version "5.2.2"
resolved "https://registry.yarnpkg.com/ioredis/-/ioredis-5.2.2.tgz#212467e04f6779b4e0e800cece7bb7d3d7b546d2"
integrity sha512-wryKc1ur8PcCmNwfcGkw5evouzpbDXxxkMkzPK8wl4xQfQf7lHe11Jotell5ikMVAtikXJEu/OJVaoV51BggRQ==
version "5.2.3"
resolved "https://registry.yarnpkg.com/ioredis/-/ioredis-5.2.3.tgz#d5b37eb13e643241660d6cee4eeb41a026cda8c0"
integrity sha512-gQNcMF23/NpvjCaa1b5YycUyQJ9rBNH2xP94LWinNpodMWVUPP5Ai/xXANn/SM7gfIvI62B5CCvZxhg5pOgyMw==
dependencies:
"@ioredis/commands" "^1.1.1"
cluster-key-slot "^1.1.0"
@ -4574,24 +4574,24 @@ nth-check@^2.0.1:
dependencies:
boolbase "^1.0.0"
"nuxi@npm:nuxi-edge@3.0.0-rc.8-27686415.9f1ecd1":
version "3.0.0-rc.8-27686415.9f1ecd1"
resolved "https://registry.yarnpkg.com/nuxi-edge/-/nuxi-edge-3.0.0-rc.8-27686415.9f1ecd1.tgz#71b18f2b49504e1758e78abbad6b53f522c4efd0"
integrity sha512-GwjgXRrR2iUVHKYXbwsSATZa8XQewWyaVzuaIwDQD85jqzXFmfuC4micd2U1qikaywjICczmL1finPT9+tXlTg==
"nuxi@npm:nuxi-edge@3.0.0-rc.8-27689472.403e0e6":
version "3.0.0-rc.8-27689472.403e0e6"
resolved "https://registry.yarnpkg.com/nuxi-edge/-/nuxi-edge-3.0.0-rc.8-27689472.403e0e6.tgz#3c8f962802f00ab3ca2128477e971fff366be603"
integrity sha512-wAIyA6JLPaBFAl7zOs5trjFK46cR3BBjzkolTZm+Q0Vet8b/3Wzla3u5uYsH7quiDSi+gdDCrsZ2P14tw/2BCw==
optionalDependencies:
fsevents "~2.3.2"
"nuxt@npm:nuxt3@latest":
version "3.0.0-rc.8-27686415.9f1ecd1"
resolved "https://registry.yarnpkg.com/nuxt3/-/nuxt3-3.0.0-rc.8-27686415.9f1ecd1.tgz#397065f683fd9ce6f52e582edcbb6373ef7f993b"
integrity sha512-X0dHZSPM84anHHLt7iQuHDqQA21uJeRzMuKIPzl1pgSYoI1wARXXh8sZ8lFP5fvyA9O5oXDC8n0sns0Y+8JUzA==
version "3.0.0-rc.8-27689472.403e0e6"
resolved "https://registry.yarnpkg.com/nuxt3/-/nuxt3-3.0.0-rc.8-27689472.403e0e6.tgz#92a2ece777e46ff04ec8d3a30c15e71f034ea627"
integrity sha512-QeruYkrUtLBL3HSXyZ9ErSeZQ1asuFRUByvmM5CbsN/V/s2bQ3+O1c7lMH+eqJKbtLlkS7gRI14EO/MS83ExWA==
dependencies:
"@nuxt/devalue" "^2.0.0"
"@nuxt/kit" "npm:@nuxt/kit-edge@3.0.0-rc.8-27686415.9f1ecd1"
"@nuxt/schema" "npm:@nuxt/schema-edge@3.0.0-rc.8-27686415.9f1ecd1"
"@nuxt/kit" "npm:@nuxt/kit-edge@3.0.0-rc.8-27689472.403e0e6"
"@nuxt/schema" "npm:@nuxt/schema-edge@3.0.0-rc.8-27689472.403e0e6"
"@nuxt/telemetry" "^2.1.4"
"@nuxt/ui-templates" "^0.3.2"
"@nuxt/vite-builder" "npm:@nuxt/vite-builder-edge@3.0.0-rc.8-27686415.9f1ecd1"
"@nuxt/vite-builder" "npm:@nuxt/vite-builder-edge@3.0.0-rc.8-27689472.403e0e6"
"@vue/reactivity" "^3.2.37"
"@vue/shared" "^3.2.37"
"@vueuse/head" "^0.7.9"
@ -4602,14 +4602,14 @@ nth-check@^2.0.1:
escape-string-regexp "^5.0.0"
fs-extra "^10.1.0"
globby "^13.1.2"
h3 "^0.7.15"
h3 "^0.7.16"
hash-sum "^2.0.0"
hookable "^5.1.1"
hookable "^5.2.2"
knitwork "^0.1.2"
magic-string "^0.26.2"
mlly "^0.5.14"
nitropack "^0.4.24"
nuxi "npm:nuxi-edge@3.0.0-rc.8-27686415.9f1ecd1"
nuxi "npm:nuxi-edge@3.0.0-rc.8-27689472.403e0e6"
ohash "^0.1.5"
ohmyfetch "^0.4.18"
pathe "^0.3.5"
@ -6339,9 +6339,9 @@ tar@^6.1.11:
yallist "^4.0.0"
terser@^5.0.0:
version "5.14.2"
resolved "https://registry.yarnpkg.com/terser/-/terser-5.14.2.tgz#9ac9f22b06994d736174f4091aa368db896f1c10"
integrity sha512-oL0rGeM/WFQCUd0y2QrWxYnq7tfSuKBiqTjRPWrRgB46WD/kiwHwF8T23z78H6Q6kGCuuHcPB+KULHRdxvVGQA==
version "5.15.0"
resolved "https://registry.yarnpkg.com/terser/-/terser-5.15.0.tgz#e16967894eeba6e1091509ec83f0c60e179f2425"
integrity sha512-L1BJiXVmheAQQy+as0oF3Pwtlo4s3Wi1X2zNZ2NxOB4wx9bdS9Vk67XQENLFdLYGCK/Z2di53mTj/hBafR+dTA==
dependencies:
"@jridgewell/source-map" "^0.3.2"
acorn "^8.5.0"
@ -6498,9 +6498,9 @@ unctx@^2.0.1:
unplugin "^0.8.0"
undici@^5.2.0:
version "5.9.1"
resolved "https://registry.yarnpkg.com/undici/-/undici-5.9.1.tgz#fc9fd85dd488f965f153314a63d9426a11f3360b"
integrity sha512-6fB3a+SNnWEm4CJbgo0/CWR8RGcOCQP68SF4X0mxtYTq2VNN8T88NYrWVBAeSX+zb7bny2dx2iYhP3XHi00omg==
version "5.10.0"
resolved "https://registry.yarnpkg.com/undici/-/undici-5.10.0.tgz#dd9391087a90ccfbd007568db458674232ebf014"
integrity sha512-c8HsD3IbwmjjbLvoZuRI26TZic+TSEe8FPMLLOkN1AfYRhdjnKBU6yL+IwcSCbdZiX4e5t0lfMDLDCqj4Sq70g==
unenv@^0.5.4:
version "0.5.4"