diff --git a/吴光慧学习笔记/11.3/test1.txt b/吴光慧学习笔记/11.3/test1.vue similarity index 100% rename from 吴光慧学习笔记/11.3/test1.txt rename to 吴光慧学习笔记/11.3/test1.vue diff --git a/吴光慧学习笔记/11.3/test2.txt b/吴光慧学习笔记/11.3/test2.vue similarity index 100% rename from 吴光慧学习笔记/11.3/test2.txt rename to 吴光慧学习笔记/11.3/test2.vue diff --git a/吴光慧学习笔记/11.3/test3.txt b/吴光慧学习笔记/11.3/test3.vue similarity index 100% rename from 吴光慧学习笔记/11.3/test3.txt rename to 吴光慧学习笔记/11.3/test3.vue diff --git a/吴光慧学习笔记/11.3/test4.txt b/吴光慧学习笔记/11.3/test4.vue similarity index 100% rename from 吴光慧学习笔记/11.3/test4.txt rename to 吴光慧学习笔记/11.3/test4.vue diff --git a/吴光慧学习笔记/11.4/props.txt b/吴光慧学习笔记/11.4/props.vue similarity index 100% rename from 吴光慧学习笔记/11.4/props.txt rename to 吴光慧学习笔记/11.4/props.vue diff --git a/吴光慧学习笔记/11.4/test1.txt b/吴光慧学习笔记/11.4/test1.vue similarity index 100% rename from 吴光慧学习笔记/11.4/test1.txt rename to 吴光慧学习笔记/11.4/test1.vue diff --git a/吴光慧学习笔记/11.4/test2.txt b/吴光慧学习笔记/11.4/test2.vue similarity index 100% rename from 吴光慧学习笔记/11.4/test2.txt rename to 吴光慧学习笔记/11.4/test2.vue diff --git a/吴光慧学习笔记/11.5/11.5学习总结-吴光慧.docx b/吴光慧学习笔记/11.5/11.5学习总结-吴光慧.docx new file mode 100644 index 0000000..0c31625 Binary files /dev/null and b/吴光慧学习笔记/11.5/11.5学习总结-吴光慧.docx differ diff --git a/吴光慧学习笔记/11.5/Count.txt b/吴光慧学习笔记/11.5/Count.txt new file mode 100644 index 0000000..08991d7 --- /dev/null +++ b/吴光慧学习笔记/11.5/Count.txt @@ -0,0 +1,70 @@ + + + + + \ No newline at end of file diff --git a/吴光慧学习笔记/11.5/LoveTalk.txt b/吴光慧学习笔记/11.5/LoveTalk.txt new file mode 100644 index 0000000..cc35130 --- /dev/null +++ b/吴光慧学习笔记/11.5/LoveTalk.txt @@ -0,0 +1,38 @@ + + + + + \ No newline at end of file diff --git a/吴光慧学习笔记/11.5/query.txt b/吴光慧学习笔记/11.5/query.txt new file mode 100644 index 0000000..d40116c --- /dev/null +++ b/吴光慧学习笔记/11.5/query.txt @@ -0,0 +1,30 @@ +Detail + + + + + \ No newline at end of file diff --git a/吴光慧学习笔记/hello_vue3/src/components/About.vue b/吴光慧学习笔记/11.5/备份/About.vue similarity index 94% rename from 吴光慧学习笔记/hello_vue3/src/components/About.vue rename to 吴光慧学习笔记/11.5/备份/About.vue index d897dfb..39941e8 100644 --- a/吴光慧学习笔记/hello_vue3/src/components/About.vue +++ b/吴光慧学习笔记/11.5/备份/About.vue @@ -18,7 +18,7 @@ onUnmounted(()=>{ - \ No newline at end of file diff --git a/吴光慧学习笔记/11.5/备份/Detail.vue b/吴光慧学习笔记/11.5/备份/Detail.vue new file mode 100644 index 0000000..ad50fb1 --- /dev/null +++ b/吴光慧学习笔记/11.5/备份/Detail.vue @@ -0,0 +1,30 @@ + + + + + \ No newline at end of file diff --git a/吴光慧学习笔记/hello_vue3/src/components/Home.vue b/吴光慧学习笔记/11.5/备份/Home.vue similarity index 59% rename from 吴光慧学习笔记/hello_vue3/src/components/Home.vue rename to 吴光慧学习笔记/11.5/备份/Home.vue index 51cfcb9..ef3261f 100644 --- a/吴光慧学习笔记/hello_vue3/src/components/Home.vue +++ b/吴光慧学习笔记/11.5/备份/Home.vue @@ -5,6 +5,16 @@ diff --git a/吴光慧学习笔记/11.5/备份/News.txt b/吴光慧学习笔记/11.5/备份/News.txt new file mode 100644 index 0000000..529aff0 --- /dev/null +++ b/吴光慧学习笔记/11.5/备份/News.txt @@ -0,0 +1,61 @@ + + + + + \ No newline at end of file diff --git a/吴光慧学习笔记/hello_vue3/src/components/hooks.vue b/吴光慧学习笔记/11.5/备份/hooks.vue similarity index 100% rename from 吴光慧学习笔记/hello_vue3/src/components/hooks.vue rename to 吴光慧学习笔记/11.5/备份/hooks.vue diff --git a/吴光慧学习笔记/hello_vue3/src/router/index.ts b/吴光慧学习笔记/11.5/备份/index.ts similarity index 52% rename from 吴光慧学习笔记/hello_vue3/src/router/index.ts rename to 吴光慧学习笔记/11.5/备份/index.ts index 34f6af2..e26b3a9 100644 --- a/吴光慧学习笔记/hello_vue3/src/router/index.ts +++ b/吴光慧学习笔记/11.5/备份/index.ts @@ -2,21 +2,40 @@ import {createRouter,createWebHistory} from 'vue-router' import Home from '@/components/Home.vue' import News from '@/components/News.vue' import About from '@/components/About.vue' +import Detail from '@/components/Detail.vue' const router = createRouter({ history:createWebHistory(), routes:[ { + name:'zhuye', path:'/home', component:Home }, { + name:'xinwen', path:'/news', - component:News + component:News, + children:[ + { + name:'xiangqing', + path:'detail/:id/:title/:content', + component:Detail, + props(route){ + return route.query + } + } + ] + }, { + name:'guanyu', path:'/about', component:About + }, + { + path:'/', + redirect:'/home' } ] }) diff --git a/吴光慧学习笔记/11.5/备份/router/index.ts b/吴光慧学习笔记/11.5/备份/router/index.ts new file mode 100644 index 0000000..e26b3a9 --- /dev/null +++ b/吴光慧学习笔记/11.5/备份/router/index.ts @@ -0,0 +1,42 @@ +import {createRouter,createWebHistory} from 'vue-router' +import Home from '@/components/Home.vue' +import News from '@/components/News.vue' +import About from '@/components/About.vue' +import Detail from '@/components/Detail.vue' + +const router = createRouter({ + history:createWebHistory(), + routes:[ + { + name:'zhuye', + path:'/home', + component:Home + }, + { + name:'xinwen', + path:'/news', + component:News, + children:[ + { + name:'xiangqing', + path:'detail/:id/:title/:content', + component:Detail, + props(route){ + return route.query + } + } + ] + + }, + { + name:'guanyu', + path:'/about', + component:About + }, + { + path:'/', + redirect:'/home' + } + ] +}) +export default router \ No newline at end of file diff --git a/吴光慧学习笔记/11.5/道氏理论定义及基本观点.docx b/吴光慧学习笔记/11.5/道氏理论定义及基本观点.docx new file mode 100644 index 0000000..0fe3179 Binary files /dev/null and b/吴光慧学习笔记/11.5/道氏理论定义及基本观点.docx differ diff --git a/吴光慧学习笔记/hello_vue3/node_modules/.bin/nanoid b/吴光慧学习笔记/hello_vue3/node_modules/.bin/nanoid index 46220bd..fd093c0 100644 --- a/吴光慧学习笔记/hello_vue3/node_modules/.bin/nanoid +++ b/吴光慧学习笔记/hello_vue3/node_modules/.bin/nanoid @@ -10,7 +10,7 @@ case `uname` in esac if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../nanoid/bin/nanoid.cjs" "$@" + exec "$basedir/node" "$basedir/../nanoid/bin/nanoid.js" "$@" else - exec node "$basedir/../nanoid/bin/nanoid.cjs" "$@" + exec node "$basedir/../nanoid/bin/nanoid.js" "$@" fi diff --git a/吴光慧学习笔记/hello_vue3/node_modules/.bin/nanoid.cmd b/吴光慧学习笔记/hello_vue3/node_modules/.bin/nanoid.cmd index 9c40107..87f0842 100644 --- a/吴光慧学习笔记/hello_vue3/node_modules/.bin/nanoid.cmd +++ b/吴光慧学习笔记/hello_vue3/node_modules/.bin/nanoid.cmd @@ -14,4 +14,4 @@ IF EXIST "%dp0%\node.exe" ( SET PATHEXT=%PATHEXT:;.JS;=;% ) -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\nanoid\bin\nanoid.cjs" %* +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\nanoid\bin\nanoid.js" %* diff --git a/吴光慧学习笔记/hello_vue3/node_modules/.bin/nanoid.ps1 b/吴光慧学习笔记/hello_vue3/node_modules/.bin/nanoid.ps1 index d8a4d7a..954cf93 100644 --- a/吴光慧学习笔记/hello_vue3/node_modules/.bin/nanoid.ps1 +++ b/吴光慧学习笔记/hello_vue3/node_modules/.bin/nanoid.ps1 @@ -11,17 +11,17 @@ $ret=0 if (Test-Path "$basedir/node$exe") { # Support pipeline input if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../nanoid/bin/nanoid.cjs" $args + $input | & "$basedir/node$exe" "$basedir/../nanoid/bin/nanoid.js" $args } else { - & "$basedir/node$exe" "$basedir/../nanoid/bin/nanoid.cjs" $args + & "$basedir/node$exe" "$basedir/../nanoid/bin/nanoid.js" $args } $ret=$LASTEXITCODE } else { # Support pipeline input if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../nanoid/bin/nanoid.cjs" $args + $input | & "node$exe" "$basedir/../nanoid/bin/nanoid.js" $args } else { - & "node$exe" "$basedir/../nanoid/bin/nanoid.cjs" $args + & "node$exe" "$basedir/../nanoid/bin/nanoid.js" $args } $ret=$LASTEXITCODE } diff --git a/吴光慧学习笔记/hello_vue3/node_modules/.package-lock.json b/吴光慧学习笔记/hello_vue3/node_modules/.package-lock.json index 05df0ca..cc9451b 100644 --- a/吴光慧学习笔记/hello_vue3/node_modules/.package-lock.json +++ b/吴光慧学习笔记/hello_vue3/node_modules/.package-lock.json @@ -764,25 +764,6 @@ "vue": "^3.0.0" } }, - "node_modules/@vue/devtools-core/node_modules/nanoid": { - "version": "5.1.6", - "resolved": "https://registry.npmmirror.com/nanoid/-/nanoid-5.1.6.tgz", - "integrity": "sha512-c7+7RQ+dMB5dPwwCp4ee1/iV/q2P6aK1mTZcfr1BTuVlyW9hJYiMPybJCcnBlQtuSmTIWNeazm/zqNoZSSElBg==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "bin": { - "nanoid": "bin/nanoid.js" - }, - "engines": { - "node": "^18 || >=20" - } - }, "node_modules/@vue/devtools-kit": { "version": "8.0.3", "resolved": "https://registry.npmmirror.com/@vue/devtools-kit/-/devtools-kit-8.0.3.tgz", @@ -939,9 +920,9 @@ "license": "MIT" }, "node_modules/axios": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.13.1.tgz", - "integrity": "sha512-hU4EGxxt+j7TQijx1oYdAjw4xuIp1wRQSsbMFwSthCWeBQur1eF+qJ5iQ5sN3Tw8YRzQNKb8jszgBdMDVqwJcw==", + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.13.2.tgz", + "integrity": "sha512-VPk9ebNqPcy5lRGuSlKx752IlDatOjT9paPlm8A7yOuW2Fbvp4X3JznJtT4f0GzGLLiWE9W8onz51SqLYwzGaA==", "license": "MIT", "dependencies": { "follow-redirects": "^1.15.6", @@ -963,7 +944,6 @@ "version": "2.6.1", "resolved": "https://registry.npmmirror.com/birpc/-/birpc-2.6.1.tgz", "integrity": "sha512-LPnFhlDpdSH6FJhJyn4M0kFO7vtQ5iPw24FnG0y21q09xC7e8+1LeR31S1MAIrDAHp4m7aas4bEkTDTvMAtebQ==", - "dev": true, "license": "MIT", "funding": { "url": "https://github.com/sponsors/antfu" @@ -1076,7 +1056,6 @@ "version": "4.0.5", "resolved": "https://registry.npmmirror.com/copy-anything/-/copy-anything-4.0.5.tgz", "integrity": "sha512-7Vv6asjS4gMOuILabD3l739tsaxFQmC+a7pLZm02zyvs8p977bL3zEgq3yDk5rn9B0PbYgIv++jmHcuUab4RhA==", - "dev": true, "license": "MIT", "dependencies": { "is-what": "^5.2.0" @@ -1513,7 +1492,6 @@ "version": "5.5.3", "resolved": "https://registry.npmmirror.com/hookable/-/hookable-5.5.3.tgz", "integrity": "sha512-Yc+BQe8SvoXH1643Qez1zqLRmbA5rCL+sSmk6TVos0LWVfNIB7PGncdlId77WzLGSIB5KaWgTaNTs2lNVEI6VQ==", - "dev": true, "license": "MIT" }, "node_modules/is-docker": { @@ -1555,7 +1533,6 @@ "version": "5.5.0", "resolved": "https://registry.npmmirror.com/is-what/-/is-what-5.5.0.tgz", "integrity": "sha512-oG7cgbmg5kLYae2N5IVd3jm2s+vldjxJzK1pcu9LfpGuQ93MQSzo0okvRna+7y5ifrD+20FE8FvjusyGaz14fw==", - "dev": true, "license": "MIT", "engines": { "node": ">=18" @@ -1702,7 +1679,6 @@ "version": "3.0.1", "resolved": "https://registry.npmmirror.com/mitt/-/mitt-3.0.1.tgz", "integrity": "sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==", - "dev": true, "license": "MIT" }, "node_modules/mrmime": { @@ -1730,9 +1706,9 @@ "license": "MIT" }, "node_modules/nanoid": { - "version": "3.3.11", - "resolved": "https://registry.npmmirror.com/nanoid/-/nanoid-3.3.11.tgz", - "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==", + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-5.1.6.tgz", + "integrity": "sha512-c7+7RQ+dMB5dPwwCp4ee1/iV/q2P6aK1mTZcfr1BTuVlyW9hJYiMPybJCcnBlQtuSmTIWNeazm/zqNoZSSElBg==", "funding": [ { "type": "github", @@ -1741,10 +1717,10 @@ ], "license": "MIT", "bin": { - "nanoid": "bin/nanoid.cjs" + "nanoid": "bin/nanoid.js" }, "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + "node": "^18 || >=20" } }, "node_modules/node-releases": { @@ -1880,6 +1856,66 @@ "node": ">=0.10" } }, + "node_modules/pinia": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/pinia/-/pinia-3.0.3.tgz", + "integrity": "sha512-ttXO/InUULUXkMHpTdp9Fj4hLpD/2AoJdmAbAeW2yu1iy1k+pkFekQXw5VpC0/5p51IOR/jDaDRfRWRnMMsGOA==", + "license": "MIT", + "dependencies": { + "@vue/devtools-api": "^7.7.2" + }, + "funding": { + "url": "https://github.com/sponsors/posva" + }, + "peerDependencies": { + "typescript": ">=4.4.4", + "vue": "^2.7.0 || ^3.5.11" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/pinia/node_modules/@vue/devtools-api": { + "version": "7.7.7", + "resolved": "https://registry.npmjs.org/@vue/devtools-api/-/devtools-api-7.7.7.tgz", + "integrity": "sha512-lwOnNBH2e7x1fIIbVT7yF5D+YWhqELm55/4ZKf45R9T8r9dE2AIOy8HKjfqzGsoTHFbWbr337O4E0A0QADnjBg==", + "license": "MIT", + "dependencies": { + "@vue/devtools-kit": "^7.7.7" + } + }, + "node_modules/pinia/node_modules/@vue/devtools-kit": { + "version": "7.7.7", + "resolved": "https://registry.npmjs.org/@vue/devtools-kit/-/devtools-kit-7.7.7.tgz", + "integrity": "sha512-wgoZtxcTta65cnZ1Q6MbAfePVFxfM+gq0saaeytoph7nEa7yMXoi6sCPy4ufO111B9msnw0VOWjPEFCXuAKRHA==", + "license": "MIT", + "dependencies": { + "@vue/devtools-shared": "^7.7.7", + "birpc": "^2.3.0", + "hookable": "^5.5.3", + "mitt": "^3.0.1", + "perfect-debounce": "^1.0.0", + "speakingurl": "^14.0.1", + "superjson": "^2.2.2" + } + }, + "node_modules/pinia/node_modules/@vue/devtools-shared": { + "version": "7.7.7", + "resolved": "https://registry.npmjs.org/@vue/devtools-shared/-/devtools-shared-7.7.7.tgz", + "integrity": "sha512-+udSj47aRl5aKb0memBvcUG9koarqnxNM5yjuREvqwK6T3ap4mn3Zqqc17QrBFTqSMjr3HK1cvStEZpMDpfdyw==", + "license": "MIT", + "dependencies": { + "rfdc": "^1.4.1" + } + }, + "node_modules/pinia/node_modules/perfect-debounce": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/perfect-debounce/-/perfect-debounce-1.0.0.tgz", + "integrity": "sha512-xCy9V055GLEqoFaHoC1SoLIaLmWctgCUaBaWxDZ7/Zx4CTyX7cJQLJOok/orfjZAh9kEYpjJa4d0KcJmCbctZA==", + "license": "MIT" + }, "node_modules/postcss": { "version": "8.5.6", "resolved": "https://registry.npmmirror.com/postcss/-/postcss-8.5.6.tgz", @@ -1908,6 +1944,24 @@ "node": "^10 || ^12 || >=14" } }, + "node_modules/postcss/node_modules/nanoid": { + "version": "3.3.11", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz", + "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, "node_modules/proxy-from-env": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", @@ -1932,7 +1986,6 @@ "version": "1.4.1", "resolved": "https://registry.npmmirror.com/rfdc/-/rfdc-1.4.1.tgz", "integrity": "sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==", - "dev": true, "license": "MIT" }, "node_modules/rollup": { @@ -2072,7 +2125,6 @@ "version": "14.0.1", "resolved": "https://registry.npmmirror.com/speakingurl/-/speakingurl-14.0.1.tgz", "integrity": "sha512-1POYv7uv2gXoyGFpBCmpDVSNV74IfsWlDW216UPjbWufNf+bSU6GdbDsxdcxtfwb4xlI3yxzOTKClUosxARYrQ==", - "dev": true, "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" @@ -2082,7 +2134,6 @@ "version": "2.2.5", "resolved": "https://registry.npmmirror.com/superjson/-/superjson-2.2.5.tgz", "integrity": "sha512-zWPTX96LVsA/eVYnqOM2+ofcdPqdS1dAF1LN4TS2/MWuUpfitd9ctTa87wt4xrYnZnkLtS69xpBdSxVBP5Rm6w==", - "dev": true, "license": "MIT", "dependencies": { "copy-anything": "^4" diff --git a/吴光慧学习笔记/hello_vue3/node_modules/.vite/deps/_metadata.json b/吴光慧学习笔记/hello_vue3/node_modules/.vite/deps/_metadata.json index c3ff732..ba331cb 100644 --- a/吴光慧学习笔记/hello_vue3/node_modules/.vite/deps/_metadata.json +++ b/吴光慧学习笔记/hello_vue3/node_modules/.vite/deps/_metadata.json @@ -1,25 +1,46 @@ { - "hash": "547bafd9", + "hash": "39b4f1a2", "configHash": "e5b55508", - "lockfileHash": "0d539b07", - "browserHash": "2bc9fe4f", + "lockfileHash": "22fdfde4", + "browserHash": "b44b993f", "optimized": { + "pinia": { + "src": "../../pinia/dist/pinia.mjs", + "file": "pinia.js", + "fileHash": "a97780a2", + "needsInterop": false + }, "vue": { "src": "../../vue/dist/vue.runtime.esm-bundler.js", "file": "vue.js", - "fileHash": "5b2b4475", + "fileHash": "1e96b106", "needsInterop": false }, "vue-router": { "src": "../../vue-router/dist/vue-router.mjs", "file": "vue-router.js", - "fileHash": "832988d5", + "fileHash": "0eced000", + "needsInterop": false + }, + "axios": { + "src": "../../axios/index.js", + "file": "axios.js", + "fileHash": "0965a06b", + "needsInterop": false + }, + "nanoid": { + "src": "../../nanoid/index.browser.js", + "file": "nanoid.js", + "fileHash": "39507410", "needsInterop": false } }, "chunks": { "chunk-SFGEOVP2": { "file": "chunk-SFGEOVP2.js" + }, + "chunk-PZ5AY32C": { + "file": "chunk-PZ5AY32C.js" } } } \ No newline at end of file diff --git a/吴光慧学习笔记/hello_vue3/node_modules/.vite/deps/vue.js b/吴光慧学习笔记/hello_vue3/node_modules/.vite/deps/vue.js index 8964ff5..6b4ca1f 100644 --- a/吴光慧学习笔记/hello_vue3/node_modules/.vite/deps/vue.js +++ b/吴光慧学习笔记/hello_vue3/node_modules/.vite/deps/vue.js @@ -169,6 +169,7 @@ import { withModifiers, withScopeId } from "./chunk-SFGEOVP2.js"; +import "./chunk-PZ5AY32C.js"; export { BaseTransition, BaseTransitionPropsValidators, diff --git a/吴光慧学习笔记/hello_vue3/node_modules/@vue/devtools-core/node_modules/.bin/nanoid b/吴光慧学习笔记/hello_vue3/node_modules/@vue/devtools-core/node_modules/.bin/nanoid deleted file mode 100644 index fd093c0..0000000 --- a/吴光慧学习笔记/hello_vue3/node_modules/@vue/devtools-core/node_modules/.bin/nanoid +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../nanoid/bin/nanoid.js" "$@" -else - exec node "$basedir/../nanoid/bin/nanoid.js" "$@" -fi diff --git a/吴光慧学习笔记/hello_vue3/node_modules/@vue/devtools-core/node_modules/.bin/nanoid.cmd b/吴光慧学习笔记/hello_vue3/node_modules/@vue/devtools-core/node_modules/.bin/nanoid.cmd deleted file mode 100644 index 87f0842..0000000 --- a/吴光慧学习笔记/hello_vue3/node_modules/@vue/devtools-core/node_modules/.bin/nanoid.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\nanoid\bin\nanoid.js" %* diff --git a/吴光慧学习笔记/hello_vue3/node_modules/@vue/devtools-core/node_modules/.bin/nanoid.ps1 b/吴光慧学习笔记/hello_vue3/node_modules/@vue/devtools-core/node_modules/.bin/nanoid.ps1 deleted file mode 100644 index 954cf93..0000000 --- a/吴光慧学习笔记/hello_vue3/node_modules/@vue/devtools-core/node_modules/.bin/nanoid.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../nanoid/bin/nanoid.js" $args - } else { - & "$basedir/node$exe" "$basedir/../nanoid/bin/nanoid.js" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../nanoid/bin/nanoid.js" $args - } else { - & "node$exe" "$basedir/../nanoid/bin/nanoid.js" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/吴光慧学习笔记/hello_vue3/node_modules/@vue/devtools-core/node_modules/nanoid/LICENSE b/吴光慧学习笔记/hello_vue3/node_modules/@vue/devtools-core/node_modules/nanoid/LICENSE deleted file mode 100644 index 37f56aa..0000000 --- a/吴光慧学习笔记/hello_vue3/node_modules/@vue/devtools-core/node_modules/nanoid/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright 2017 Andrey Sitnik - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/吴光慧学习笔记/hello_vue3/node_modules/@vue/devtools-core/node_modules/nanoid/README.md b/吴光慧学习笔记/hello_vue3/node_modules/@vue/devtools-core/node_modules/nanoid/README.md deleted file mode 100644 index f243c78..0000000 --- a/吴光慧学习笔记/hello_vue3/node_modules/@vue/devtools-core/node_modules/nanoid/README.md +++ /dev/null @@ -1,38 +0,0 @@ -# Nano ID - -Nano ID logo by Anton Lovchikov - -**English** | [日本語](./README.ja.md) | [Русский](./README.ru.md) | [简体中文](./README.zh-CN.md) | [Bahasa Indonesia](./README.id-ID.md) | [한국어](./README.ko.md) - -A tiny, secure, URL-friendly, unique string ID generator for JavaScript. - -> “An amazing level of senseless perfectionism, -> which is simply impossible not to respect.” - -* **Small.** 118 bytes (minified and brotlied). No dependencies. - [Size Limit] controls the size. -* **Safe.** It uses hardware random generator. Can be used in clusters. -* **Short IDs.** It uses a larger alphabet than UUID (`A-Za-z0-9_-`). - So ID size was reduced from 36 to 21 symbols. -* **Portable.** Nano ID was ported - to over [20 programming languages](./README.md#other-programming-languages). - -```js -import { nanoid } from 'nanoid' -model.id = nanoid() //=> "V1StGXR8_Z5jdHi6B-myT" -``` - ---- - -  Made at Evil Martians, product consulting for developer tools. - ---- - -[online tool]: https://gitpod.io/#https://github.com/ai/nanoid/ -[with Babel]: https://developer.epages.com/blog/coding/how-to-transpile-node-modules-with-babel-and-webpack-in-a-monorepo/ -[Size Limit]: https://github.com/ai/size-limit - - -## Docs -Read full docs **[here](https://github.com/ai/nanoid#readme)**. diff --git a/吴光慧学习笔记/hello_vue3/node_modules/@vue/devtools-core/node_modules/nanoid/bin/nanoid.js b/吴光慧学习笔记/hello_vue3/node_modules/@vue/devtools-core/node_modules/nanoid/bin/nanoid.js deleted file mode 100644 index f8d7556..0000000 --- a/吴光慧学习笔记/hello_vue3/node_modules/@vue/devtools-core/node_modules/nanoid/bin/nanoid.js +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env node -import { customAlphabet, nanoid } from '../index.js' -function print(msg) { - process.stdout.write(msg + '\n') -} -function error(msg) { - process.stderr.write(msg + '\n') - process.exit(1) -} -if (process.argv.includes('--help') || process.argv.includes('-h')) { - print(`Usage - $ nanoid [options] -Options - -s, --size Generated ID size - -a, --alphabet Alphabet to use - -h, --help Show this help -Examples - $ nanoid -s 15 - S9sBF77U6sDB8Yg - $ nanoid --size 10 --alphabet abc - bcabababca`) - process.exit() -} -let alphabet, size -for (let i = 2; i < process.argv.length; i++) { - let arg = process.argv[i] - if (arg === '--size' || arg === '-s') { - size = Number(process.argv[i + 1]) - i += 1 - if (Number.isNaN(size) || size <= 0) { - error('Size must be positive integer') - } - } else if (arg === '--alphabet' || arg === '-a') { - alphabet = process.argv[i + 1] - i += 1 - } else { - error('Unknown argument ' + arg) - } -} -if (alphabet) { - let customNanoid = customAlphabet(alphabet, size) - print(customNanoid()) -} else { - print(nanoid(size)) -} diff --git a/吴光慧学习笔记/hello_vue3/node_modules/@vue/devtools-core/node_modules/nanoid/index.browser.js b/吴光慧学习笔记/hello_vue3/node_modules/@vue/devtools-core/node_modules/nanoid/index.browser.js deleted file mode 100644 index 3858bd3..0000000 --- a/吴光慧学习笔记/hello_vue3/node_modules/@vue/devtools-core/node_modules/nanoid/index.browser.js +++ /dev/null @@ -1,29 +0,0 @@ -/* @ts-self-types="./index.d.ts" */ -import { urlAlphabet as scopedUrlAlphabet } from './url-alphabet/index.js' -export { urlAlphabet } from './url-alphabet/index.js' -export let random = bytes => crypto.getRandomValues(new Uint8Array(bytes)) -export let customRandom = (alphabet, defaultSize, getRandom) => { - let mask = (2 << Math.log2(alphabet.length - 1)) - 1 - let step = -~((1.6 * mask * defaultSize) / alphabet.length) - return (size = defaultSize) => { - let id = '' - while (true) { - let bytes = getRandom(step) - let j = step | 0 - while (j--) { - id += alphabet[bytes[j] & mask] || '' - if (id.length >= size) return id - } - } - } -} -export let customAlphabet = (alphabet, size = 21) => - customRandom(alphabet, size | 0, random) -export let nanoid = (size = 21) => { - let id = '' - let bytes = crypto.getRandomValues(new Uint8Array((size |= 0))) - while (size--) { - id += scopedUrlAlphabet[bytes[size] & 63] - } - return id -} diff --git a/吴光慧学习笔记/hello_vue3/node_modules/@vue/devtools-core/node_modules/nanoid/index.d.ts b/吴光慧学习笔记/hello_vue3/node_modules/@vue/devtools-core/node_modules/nanoid/index.d.ts deleted file mode 100644 index 9f28403..0000000 --- a/吴光慧学习笔记/hello_vue3/node_modules/@vue/devtools-core/node_modules/nanoid/index.d.ts +++ /dev/null @@ -1,106 +0,0 @@ -/** - * A tiny, secure, URL-friendly, unique string ID generator for JavaScript - * with hardware random generator. - * - * ```js - * import { nanoid } from 'nanoid' - * model.id = nanoid() //=> "V1StGXR8_Z5jdHi6B-myT" - * ``` - * - * @module - */ - -/** - * Generate secure URL-friendly unique ID. - * - * By default, the ID will have 21 symbols to have a collision probability - * similar to UUID v4. - * - * ```js - * import { nanoid } from 'nanoid' - * model.id = nanoid() //=> "Uakgb_J5m9g-0JDMbcJqL" - * ``` - * - * @param size Size of the ID. The default size is 21. - * @typeparam Type The ID type to replace `string` with some opaque type. - * @returns A random string. - */ -export function nanoid(size?: number): Type - -/** - * Generate secure unique ID with custom alphabet. - * - * Alphabet must contain 256 symbols or less. Otherwise, the generator - * will not be secure. - * - * @param alphabet Alphabet used to generate the ID. - * @param defaultSize Size of the ID. The default size is 21. - * @typeparam Type The ID type to replace `string` with some opaque type. - * @returns A random string generator. - * - * ```js - * const { customAlphabet } = require('nanoid') - * const nanoid = customAlphabet('0123456789абвгдеё', 5) - * nanoid() //=> "8ё56а" - * ``` - */ -export function customAlphabet( - alphabet: string, - defaultSize?: number -): (size?: number) => Type - -/** - * Generate unique ID with custom random generator and alphabet. - * - * Alphabet must contain 256 symbols or less. Otherwise, the generator - * will not be secure. - * - * ```js - * import { customRandom } from 'nanoid/format' - * - * const nanoid = customRandom('abcdef', 5, size => { - * const random = [] - * for (let i = 0; i < size; i++) { - * random.push(randomByte()) - * } - * return random - * }) - * - * nanoid() //=> "fbaef" - * ``` - * - * @param alphabet Alphabet used to generate a random string. - * @param size Size of the random string. - * @param random A random bytes generator. - * @typeparam Type The ID type to replace `string` with some opaque type. - * @returns A random string generator. - */ -export function customRandom( - alphabet: string, - size: number, - random: (bytes: number) => Uint8Array -): () => Type - -/** - * URL safe symbols. - * - * ```js - * import { urlAlphabet } from 'nanoid' - * const nanoid = customAlphabet(urlAlphabet, 10) - * nanoid() //=> "Uakgb_J5m9" - * ``` - */ -export const urlAlphabet: string - -/** - * Generate an array of random bytes collected from hardware noise. - * - * ```js - * import { customRandom, random } from 'nanoid' - * const nanoid = customRandom("abcdef", 5, random) - * ``` - * - * @param bytes Size of the array. - * @returns An array of random bytes. - */ -export function random(bytes: number): Uint8Array diff --git a/吴光慧学习笔记/hello_vue3/node_modules/@vue/devtools-core/node_modules/nanoid/index.js b/吴光慧学习笔记/hello_vue3/node_modules/@vue/devtools-core/node_modules/nanoid/index.js deleted file mode 100644 index 80c7587..0000000 --- a/吴光慧学习笔记/hello_vue3/node_modules/@vue/devtools-core/node_modules/nanoid/index.js +++ /dev/null @@ -1,47 +0,0 @@ -import { webcrypto as crypto } from 'node:crypto' -import { urlAlphabet as scopedUrlAlphabet } from './url-alphabet/index.js' -export { urlAlphabet } from './url-alphabet/index.js' -const POOL_SIZE_MULTIPLIER = 128 -let pool, poolOffset -function fillPool(bytes) { - if (!pool || pool.length < bytes) { - pool = Buffer.allocUnsafe(bytes * POOL_SIZE_MULTIPLIER) - crypto.getRandomValues(pool) - poolOffset = 0 - } else if (poolOffset + bytes > pool.length) { - crypto.getRandomValues(pool) - poolOffset = 0 - } - poolOffset += bytes -} -export function random(bytes) { - fillPool((bytes |= 0)) - return pool.subarray(poolOffset - bytes, poolOffset) -} -export function customRandom(alphabet, defaultSize, getRandom) { - let mask = (2 << (31 - Math.clz32((alphabet.length - 1) | 1))) - 1 - let step = Math.ceil((1.6 * mask * defaultSize) / alphabet.length) - return (size = defaultSize) => { - if (!size) return '' - let id = '' - while (true) { - let bytes = getRandom(step) - let i = step - while (i--) { - id += alphabet[bytes[i] & mask] || '' - if (id.length >= size) return id - } - } - } -} -export function customAlphabet(alphabet, size = 21) { - return customRandom(alphabet, size, random) -} -export function nanoid(size = 21) { - fillPool((size |= 0)) - let id = '' - for (let i = poolOffset - size; i < poolOffset; i++) { - id += scopedUrlAlphabet[pool[i] & 63] - } - return id -} diff --git a/吴光慧学习笔记/hello_vue3/node_modules/@vue/devtools-core/node_modules/nanoid/nanoid.js b/吴光慧学习笔记/hello_vue3/node_modules/@vue/devtools-core/node_modules/nanoid/nanoid.js deleted file mode 100644 index ffa1d4b..0000000 --- a/吴光慧学习笔记/hello_vue3/node_modules/@vue/devtools-core/node_modules/nanoid/nanoid.js +++ /dev/null @@ -1 +0,0 @@ -let a="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";export let nanoid=(e=21)=>{let t="",r=crypto.getRandomValues(new Uint8Array(e));for(let n=0;n "Uakgb_J5m9g-0JDMbcJqLJ" - * ``` - * - * @module - */ - -/** - * Generate URL-friendly unique ID. This method uses the non-secure - * predictable random generator with bigger collision probability. - * - * ```js - * import { nanoid } from 'nanoid/non-secure' - * model.id = nanoid() //=> "Uakgb_J5m9g-0JDMbcJqL" - * ``` - * - * @param size Size of the ID. The default size is 21. - * @typeparam Type The ID type to replace `string` with some opaque type. - * @returns A random string. - */ -export function nanoid(size?: number): Type - -/** - * Generate a unique ID based on a custom alphabet. - * This method uses the non-secure predictable random generator - * with bigger collision probability. - * - * @param alphabet Alphabet used to generate the ID. - * @param defaultSize Size of the ID. The default size is 21. - * @typeparam Type The ID type to replace `string` with some opaque type. - * @returns A random string generator. - * - * ```js - * import { customAlphabet } from 'nanoid/non-secure' - * const nanoid = customAlphabet('0123456789абвгдеё', 5) - * model.id = nanoid() //=> "8ё56а" - * ``` - */ -export function customAlphabet( - alphabet: string, - defaultSize?: number -): (size?: number) => Type diff --git a/吴光慧学习笔记/hello_vue3/node_modules/@vue/devtools-core/node_modules/nanoid/non-secure/index.js b/吴光慧学习笔记/hello_vue3/node_modules/@vue/devtools-core/node_modules/nanoid/non-secure/index.js deleted file mode 100644 index a3d83f2..0000000 --- a/吴光慧学习笔记/hello_vue3/node_modules/@vue/devtools-core/node_modules/nanoid/non-secure/index.js +++ /dev/null @@ -1,21 +0,0 @@ -/* @ts-self-types="./index.d.ts" */ -let urlAlphabet = - 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict' -export let customAlphabet = (alphabet, defaultSize = 21) => { - return (size = defaultSize) => { - let id = '' - let i = size | 0 - while (i--) { - id += alphabet[(Math.random() * alphabet.length) | 0] - } - return id - } -} -export let nanoid = (size = 21) => { - let id = '' - let i = size | 0 - while (i--) { - id += urlAlphabet[(Math.random() * 64) | 0] - } - return id -} diff --git a/吴光慧学习笔记/hello_vue3/node_modules/@vue/devtools-core/node_modules/nanoid/package.json b/吴光慧学习笔记/hello_vue3/node_modules/@vue/devtools-core/node_modules/nanoid/package.json deleted file mode 100644 index 1d0bc74..0000000 --- a/吴光慧学习笔记/hello_vue3/node_modules/@vue/devtools-core/node_modules/nanoid/package.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "name": "nanoid", - "version": "5.1.6", - "description": "A tiny (118 bytes), secure URL-friendly unique string ID generator", - "keywords": [ - "uuid", - "random", - "id", - "url" - ], - "type": "module", - "engines": { - "node": "^18 || >=20" - }, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "author": "Andrey Sitnik ", - "license": "MIT", - "repository": "ai/nanoid", - "exports": { - ".": { - "types": "./index.d.ts", - "browser": "./index.browser.js", - "react-native": "./index.browser.js", - "default": "./index.js" - }, - "./non-secure": "./non-secure/index.js", - "./package.json": "./package.json" - }, - "browser": { - "./index.js": "./index.browser.js" - }, - "react-native": { - "./index.js": "./index.browser.js" - }, - "bin": "./bin/nanoid.js", - "sideEffects": false, - "types": "./index.d.ts" -} diff --git a/吴光慧学习笔记/hello_vue3/node_modules/@vue/devtools-core/node_modules/nanoid/url-alphabet/index.js b/吴光慧学习笔记/hello_vue3/node_modules/@vue/devtools-core/node_modules/nanoid/url-alphabet/index.js deleted file mode 100644 index cfec9b2..0000000 --- a/吴光慧学习笔记/hello_vue3/node_modules/@vue/devtools-core/node_modules/nanoid/url-alphabet/index.js +++ /dev/null @@ -1,2 +0,0 @@ -export const urlAlphabet = - 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict' diff --git a/吴光慧学习笔记/hello_vue3/node_modules/nanoid/README.md b/吴光慧学习笔记/hello_vue3/node_modules/nanoid/README.md index 35abb57..f243c78 100644 --- a/吴光慧学习笔记/hello_vue3/node_modules/nanoid/README.md +++ b/吴光慧学习笔记/hello_vue3/node_modules/nanoid/README.md @@ -3,37 +3,36 @@ Nano ID logo by Anton Lovchikov -**English** | [Русский](./README.ru.md) | [简体中文](./README.zh-CN.md) | [Bahasa Indonesia](./README.id-ID.md) +**English** | [日本語](./README.ja.md) | [Русский](./README.ru.md) | [简体中文](./README.zh-CN.md) | [Bahasa Indonesia](./README.id-ID.md) | [한국어](./README.ko.md) A tiny, secure, URL-friendly, unique string ID generator for JavaScript. > “An amazing level of senseless perfectionism, > which is simply impossible not to respect.” -* **Small.** 130 bytes (minified and gzipped). No dependencies. +* **Small.** 118 bytes (minified and brotlied). No dependencies. [Size Limit] controls the size. -* **Fast.** It is 2 times faster than UUID. * **Safe.** It uses hardware random generator. Can be used in clusters. * **Short IDs.** It uses a larger alphabet than UUID (`A-Za-z0-9_-`). So ID size was reduced from 36 to 21 symbols. * **Portable.** Nano ID was ported - to [20 programming languages](#other-programming-languages). + to over [20 programming languages](./README.md#other-programming-languages). ```js import { nanoid } from 'nanoid' model.id = nanoid() //=> "V1StGXR8_Z5jdHi6B-myT" ``` -Supports modern browsers, IE [with Babel], Node.js and React Native. +--- + +  Made at Evil Martians, product consulting for developer tools. + +--- [online tool]: https://gitpod.io/#https://github.com/ai/nanoid/ [with Babel]: https://developer.epages.com/blog/coding/how-to-transpile-node-modules-with-babel-and-webpack-in-a-monorepo/ [Size Limit]: https://github.com/ai/size-limit - - Sponsored by Evil Martians - ## Docs Read full docs **[here](https://github.com/ai/nanoid#readme)**. diff --git a/吴光慧学习笔记/hello_vue3/node_modules/nanoid/async/index.browser.cjs b/吴光慧学习笔记/hello_vue3/node_modules/nanoid/async/index.browser.cjs deleted file mode 100644 index 80d1871..0000000 --- a/吴光慧学习笔记/hello_vue3/node_modules/nanoid/async/index.browser.cjs +++ /dev/null @@ -1,69 +0,0 @@ -let random = async bytes => crypto.getRandomValues(new Uint8Array(bytes)) - -let customAlphabet = (alphabet, defaultSize = 21) => { - // First, a bitmask is necessary to generate the ID. The bitmask makes bytes - // values closer to the alphabet size. The bitmask calculates the closest - // `2^31 - 1` number, which exceeds the alphabet size. - // For example, the bitmask for the alphabet size 30 is 31 (00011111). - // `Math.clz32` is not used, because it is not available in browsers. - let mask = (2 << (Math.log(alphabet.length - 1) / Math.LN2)) - 1 - // Though, the bitmask solution is not perfect since the bytes exceeding - // the alphabet size are refused. Therefore, to reliably generate the ID, - // the random bytes redundancy has to be satisfied. - - // Note: every hardware random generator call is performance expensive, - // because the system call for entropy collection takes a lot of time. - // So, to avoid additional system calls, extra bytes are requested in advance. - - // Next, a step determines how many random bytes to generate. - // The number of random bytes gets decided upon the ID size, mask, - // alphabet size, and magic number 1.6 (using 1.6 peaks at performance - // according to benchmarks). - - // `-~f => Math.ceil(f)` if f is a float - // `-~i => i + 1` if i is an integer - let step = -~((1.6 * mask * defaultSize) / alphabet.length) - - return async (size = defaultSize) => { - let id = '' - while (true) { - let bytes = crypto.getRandomValues(new Uint8Array(step)) - // A compact alternative for `for (var i = 0; i < step; i++)`. - let i = step | 0 - while (i--) { - // Adding `|| ''` refuses a random byte that exceeds the alphabet size. - id += alphabet[bytes[i] & mask] || '' - if (id.length === size) return id - } - } - } -} - -let nanoid = async (size = 21) => { - let id = '' - let bytes = crypto.getRandomValues(new Uint8Array((size |= 0))) - - // A compact alternative for `for (var i = 0; i < step; i++)`. - while (size--) { - // It is incorrect to use bytes exceeding the alphabet size. - // The following mask reduces the random byte in the 0-255 value - // range to the 0-63 value range. Therefore, adding hacks, such - // as empty string fallback or magic numbers, is unneccessary because - // the bitmask trims bytes down to the alphabet size. - let byte = bytes[size] & 63 - if (byte < 36) { - // `0-9a-z` - id += byte.toString(36) - } else if (byte < 62) { - // `A-Z` - id += (byte - 26).toString(36).toUpperCase() - } else if (byte < 63) { - id += '_' - } else { - id += '-' - } - } - return id -} - -module.exports = { nanoid, customAlphabet, random } diff --git a/吴光慧学习笔记/hello_vue3/node_modules/nanoid/async/index.browser.js b/吴光慧学习笔记/hello_vue3/node_modules/nanoid/async/index.browser.js deleted file mode 100644 index fbaa230..0000000 --- a/吴光慧学习笔记/hello_vue3/node_modules/nanoid/async/index.browser.js +++ /dev/null @@ -1,34 +0,0 @@ -let random = async bytes => crypto.getRandomValues(new Uint8Array(bytes)) -let customAlphabet = (alphabet, defaultSize = 21) => { - let mask = (2 << (Math.log(alphabet.length - 1) / Math.LN2)) - 1 - let step = -~((1.6 * mask * defaultSize) / alphabet.length) - return async (size = defaultSize) => { - let id = '' - while (true) { - let bytes = crypto.getRandomValues(new Uint8Array(step)) - let i = step | 0 - while (i--) { - id += alphabet[bytes[i] & mask] || '' - if (id.length === size) return id - } - } - } -} -let nanoid = async (size = 21) => { - let id = '' - let bytes = crypto.getRandomValues(new Uint8Array((size |= 0))) - while (size--) { - let byte = bytes[size] & 63 - if (byte < 36) { - id += byte.toString(36) - } else if (byte < 62) { - id += (byte - 26).toString(36).toUpperCase() - } else if (byte < 63) { - id += '_' - } else { - id += '-' - } - } - return id -} -export { nanoid, customAlphabet, random } diff --git a/吴光慧学习笔记/hello_vue3/node_modules/nanoid/async/index.cjs b/吴光慧学习笔记/hello_vue3/node_modules/nanoid/async/index.cjs deleted file mode 100644 index f1b0ad0..0000000 --- a/吴光慧学习笔记/hello_vue3/node_modules/nanoid/async/index.cjs +++ /dev/null @@ -1,71 +0,0 @@ -let crypto = require('crypto') - -let { urlAlphabet } = require('../url-alphabet/index.cjs') - -// `crypto.randomFill()` is a little faster than `crypto.randomBytes()`, -// because it is possible to use in combination with `Buffer.allocUnsafe()`. -let random = bytes => - new Promise((resolve, reject) => { - // `Buffer.allocUnsafe()` is faster because it doesn’t flush the memory. - // Memory flushing is unnecessary since the buffer allocation itself resets - // the memory with the new bytes. - crypto.randomFill(Buffer.allocUnsafe(bytes), (err, buf) => { - if (err) { - reject(err) - } else { - resolve(buf) - } - }) - }) - -let customAlphabet = (alphabet, defaultSize = 21) => { - // First, a bitmask is necessary to generate the ID. The bitmask makes bytes - // values closer to the alphabet size. The bitmask calculates the closest - // `2^31 - 1` number, which exceeds the alphabet size. - // For example, the bitmask for the alphabet size 30 is 31 (00011111). - let mask = (2 << (31 - Math.clz32((alphabet.length - 1) | 1))) - 1 - // Though, the bitmask solution is not perfect since the bytes exceeding - // the alphabet size are refused. Therefore, to reliably generate the ID, - // the random bytes redundancy has to be satisfied. - - // Note: every hardware random generator call is performance expensive, - // because the system call for entropy collection takes a lot of time. - // So, to avoid additional system calls, extra bytes are requested in advance. - - // Next, a step determines how many random bytes to generate. - // The number of random bytes gets decided upon the ID size, mask, - // alphabet size, and magic number 1.6 (using 1.6 peaks at performance - // according to benchmarks). - let step = Math.ceil((1.6 * mask * defaultSize) / alphabet.length) - - let tick = (id, size = defaultSize) => - random(step).then(bytes => { - // A compact alternative for `for (var i = 0; i < step; i++)`. - let i = step - while (i--) { - // Adding `|| ''` refuses a random byte that exceeds the alphabet size. - id += alphabet[bytes[i] & mask] || '' - if (id.length >= size) return id - } - return tick(id, size) - }) - - return size => tick('', size) -} - -let nanoid = (size = 21) => - random((size |= 0)).then(bytes => { - let id = '' - // A compact alternative for `for (var i = 0; i < step; i++)`. - while (size--) { - // It is incorrect to use bytes exceeding the alphabet size. - // The following mask reduces the random byte in the 0-255 value - // range to the 0-63 value range. Therefore, adding hacks, such - // as empty string fallback or magic numbers, is unneccessary because - // the bitmask trims bytes down to the alphabet size. - id += urlAlphabet[bytes[size] & 63] - } - return id - }) - -module.exports = { nanoid, customAlphabet, random } diff --git a/吴光慧学习笔记/hello_vue3/node_modules/nanoid/async/index.d.ts b/吴光慧学习笔记/hello_vue3/node_modules/nanoid/async/index.d.ts deleted file mode 100644 index 9e91965..0000000 --- a/吴光慧学习笔记/hello_vue3/node_modules/nanoid/async/index.d.ts +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Generate secure URL-friendly unique ID. The non-blocking version. - * - * By default, the ID will have 21 symbols to have a collision probability - * similar to UUID v4. - * - * ```js - * import { nanoid } from 'nanoid/async' - * nanoid().then(id => { - * model.id = id - * }) - * ``` - * - * @param size Size of the ID. The default size is 21. - * @returns A promise with a random string. - */ -export function nanoid(size?: number): Promise - -/** - * A low-level function. - * Generate secure unique ID with custom alphabet. The non-blocking version. - * - * Alphabet must contain 256 symbols or less. Otherwise, the generator - * will not be secure. - * - * @param alphabet Alphabet used to generate the ID. - * @param defaultSize Size of the ID. The default size is 21. - * @returns A function that returns a promise with a random string. - * - * ```js - * import { customAlphabet } from 'nanoid/async' - * const nanoid = customAlphabet('0123456789абвгдеё', 5) - * nanoid().then(id => { - * model.id = id //=> "8ё56а" - * }) - * ``` - */ -export function customAlphabet( - alphabet: string, - defaultSize?: number -): (size?: number) => Promise - -/** - * Generate an array of random bytes collected from hardware noise. - * - * ```js - * import { random } from 'nanoid/async' - * random(5).then(bytes => { - * bytes //=> [10, 67, 212, 67, 89] - * }) - * ``` - * - * @param bytes Size of the array. - * @returns A promise with a random bytes array. - */ -export function random(bytes: number): Promise diff --git a/吴光慧学习笔记/hello_vue3/node_modules/nanoid/async/index.js b/吴光慧学习笔记/hello_vue3/node_modules/nanoid/async/index.js deleted file mode 100644 index cec454a..0000000 --- a/吴光慧学习笔记/hello_vue3/node_modules/nanoid/async/index.js +++ /dev/null @@ -1,35 +0,0 @@ -import crypto from 'crypto' -import { urlAlphabet } from '../url-alphabet/index.js' -let random = bytes => - new Promise((resolve, reject) => { - crypto.randomFill(Buffer.allocUnsafe(bytes), (err, buf) => { - if (err) { - reject(err) - } else { - resolve(buf) - } - }) - }) -let customAlphabet = (alphabet, defaultSize = 21) => { - let mask = (2 << (31 - Math.clz32((alphabet.length - 1) | 1))) - 1 - let step = Math.ceil((1.6 * mask * defaultSize) / alphabet.length) - let tick = (id, size = defaultSize) => - random(step).then(bytes => { - let i = step - while (i--) { - id += alphabet[bytes[i] & mask] || '' - if (id.length >= size) return id - } - return tick(id, size) - }) - return size => tick('', size) -} -let nanoid = (size = 21) => - random((size |= 0)).then(bytes => { - let id = '' - while (size--) { - id += urlAlphabet[bytes[size] & 63] - } - return id - }) -export { nanoid, customAlphabet, random } diff --git a/吴光慧学习笔记/hello_vue3/node_modules/nanoid/async/index.native.js b/吴光慧学习笔记/hello_vue3/node_modules/nanoid/async/index.native.js deleted file mode 100644 index 7c1d6f3..0000000 --- a/吴光慧学习笔记/hello_vue3/node_modules/nanoid/async/index.native.js +++ /dev/null @@ -1,26 +0,0 @@ -import { getRandomBytesAsync } from 'expo-random' -import { urlAlphabet } from '../url-alphabet/index.js' -let random = getRandomBytesAsync -let customAlphabet = (alphabet, defaultSize = 21) => { - let mask = (2 << (31 - Math.clz32((alphabet.length - 1) | 1))) - 1 - let step = Math.ceil((1.6 * mask * defaultSize) / alphabet.length) - let tick = (id, size = defaultSize) => - random(step).then(bytes => { - let i = step - while (i--) { - id += alphabet[bytes[i] & mask] || '' - if (id.length >= size) return id - } - return tick(id, size) - }) - return size => tick('', size) -} -let nanoid = (size = 21) => - random((size |= 0)).then(bytes => { - let id = '' - while (size--) { - id += urlAlphabet[bytes[size] & 63] - } - return id - }) -export { nanoid, customAlphabet, random } diff --git a/吴光慧学习笔记/hello_vue3/node_modules/nanoid/async/package.json b/吴光慧学习笔记/hello_vue3/node_modules/nanoid/async/package.json deleted file mode 100644 index 578cdb4..0000000 --- a/吴光慧学习笔记/hello_vue3/node_modules/nanoid/async/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "type": "module", - "main": "index.cjs", - "module": "index.js", - "react-native": { - "./index.js": "./index.native.js" - }, - "browser": { - "./index.js": "./index.browser.js", - "./index.cjs": "./index.browser.cjs" - } -} \ No newline at end of file diff --git a/吴光慧学习笔记/hello_vue3/node_modules/nanoid/bin/nanoid.cjs b/吴光慧学习笔记/hello_vue3/node_modules/nanoid/bin/nanoid.cjs deleted file mode 100644 index c76db0f..0000000 --- a/吴光慧学习笔记/hello_vue3/node_modules/nanoid/bin/nanoid.cjs +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/env node - -let { nanoid, customAlphabet } = require('..') - -function print(msg) { - process.stdout.write(msg + '\n') -} - -function error(msg) { - process.stderr.write(msg + '\n') - process.exit(1) -} - -if (process.argv.includes('--help') || process.argv.includes('-h')) { - print(` - Usage - $ nanoid [options] - - Options - -s, --size Generated ID size - -a, --alphabet Alphabet to use - -h, --help Show this help - - Examples - $ nanoid --s 15 - S9sBF77U6sDB8Yg - - $ nanoid --size 10 --alphabet abc - bcabababca`) - process.exit() -} - -let alphabet, size -for (let i = 2; i < process.argv.length; i++) { - let arg = process.argv[i] - if (arg === '--size' || arg === '-s') { - size = Number(process.argv[i + 1]) - i += 1 - if (Number.isNaN(size) || size <= 0) { - error('Size must be positive integer') - } - } else if (arg === '--alphabet' || arg === '-a') { - alphabet = process.argv[i + 1] - i += 1 - } else { - error('Unknown argument ' + arg) - } -} - -if (alphabet) { - let customNanoid = customAlphabet(alphabet, size) - print(customNanoid()) -} else { - print(nanoid(size)) -} diff --git a/吴光慧学习笔记/hello_vue3/node_modules/nanoid/index.browser.cjs b/吴光慧学习笔记/hello_vue3/node_modules/nanoid/index.browser.cjs deleted file mode 100644 index d21a91f..0000000 --- a/吴光慧学习笔记/hello_vue3/node_modules/nanoid/index.browser.cjs +++ /dev/null @@ -1,72 +0,0 @@ -// This file replaces `index.js` in bundlers like webpack or Rollup, -// according to `browser` config in `package.json`. - -let { urlAlphabet } = require('./url-alphabet/index.cjs') - -let random = bytes => crypto.getRandomValues(new Uint8Array(bytes)) - -let customRandom = (alphabet, defaultSize, getRandom) => { - // First, a bitmask is necessary to generate the ID. The bitmask makes bytes - // values closer to the alphabet size. The bitmask calculates the closest - // `2^31 - 1` number, which exceeds the alphabet size. - // For example, the bitmask for the alphabet size 30 is 31 (00011111). - // `Math.clz32` is not used, because it is not available in browsers. - let mask = (2 << (Math.log(alphabet.length - 1) / Math.LN2)) - 1 - // Though, the bitmask solution is not perfect since the bytes exceeding - // the alphabet size are refused. Therefore, to reliably generate the ID, - // the random bytes redundancy has to be satisfied. - - // Note: every hardware random generator call is performance expensive, - // because the system call for entropy collection takes a lot of time. - // So, to avoid additional system calls, extra bytes are requested in advance. - - // Next, a step determines how many random bytes to generate. - // The number of random bytes gets decided upon the ID size, mask, - // alphabet size, and magic number 1.6 (using 1.6 peaks at performance - // according to benchmarks). - - // `-~f => Math.ceil(f)` if f is a float - // `-~i => i + 1` if i is an integer - let step = -~((1.6 * mask * defaultSize) / alphabet.length) - - return (size = defaultSize) => { - let id = '' - while (true) { - let bytes = getRandom(step) - // A compact alternative for `for (var i = 0; i < step; i++)`. - let j = step | 0 - while (j--) { - // Adding `|| ''` refuses a random byte that exceeds the alphabet size. - id += alphabet[bytes[j] & mask] || '' - if (id.length === size) return id - } - } - } -} - -let customAlphabet = (alphabet, size = 21) => - customRandom(alphabet, size, random) - -let nanoid = (size = 21) => - crypto.getRandomValues(new Uint8Array(size)).reduce((id, byte) => { - // It is incorrect to use bytes exceeding the alphabet size. - // The following mask reduces the random byte in the 0-255 value - // range to the 0-63 value range. Therefore, adding hacks, such - // as empty string fallback or magic numbers, is unneccessary because - // the bitmask trims bytes down to the alphabet size. - byte &= 63 - if (byte < 36) { - // `0-9a-z` - id += byte.toString(36) - } else if (byte < 62) { - // `A-Z` - id += (byte - 26).toString(36).toUpperCase() - } else if (byte > 62) { - id += '-' - } else { - id += '_' - } - return id - }, '') - -module.exports = { nanoid, customAlphabet, customRandom, urlAlphabet, random } diff --git a/吴光慧学习笔记/hello_vue3/node_modules/nanoid/index.browser.js b/吴光慧学习笔记/hello_vue3/node_modules/nanoid/index.browser.js index 7d3b876..3858bd3 100644 --- a/吴光慧学习笔记/hello_vue3/node_modules/nanoid/index.browser.js +++ b/吴光慧学习笔记/hello_vue3/node_modules/nanoid/index.browser.js @@ -1,7 +1,9 @@ -import { urlAlphabet } from './url-alphabet/index.js' -let random = bytes => crypto.getRandomValues(new Uint8Array(bytes)) -let customRandom = (alphabet, defaultSize, getRandom) => { - let mask = (2 << (Math.log(alphabet.length - 1) / Math.LN2)) - 1 +/* @ts-self-types="./index.d.ts" */ +import { urlAlphabet as scopedUrlAlphabet } from './url-alphabet/index.js' +export { urlAlphabet } from './url-alphabet/index.js' +export let random = bytes => crypto.getRandomValues(new Uint8Array(bytes)) +export let customRandom = (alphabet, defaultSize, getRandom) => { + let mask = (2 << Math.log2(alphabet.length - 1)) - 1 let step = -~((1.6 * mask * defaultSize) / alphabet.length) return (size = defaultSize) => { let id = '' @@ -10,25 +12,18 @@ let customRandom = (alphabet, defaultSize, getRandom) => { let j = step | 0 while (j--) { id += alphabet[bytes[j] & mask] || '' - if (id.length === size) return id + if (id.length >= size) return id } } } } -let customAlphabet = (alphabet, size = 21) => - customRandom(alphabet, size, random) -let nanoid = (size = 21) => - crypto.getRandomValues(new Uint8Array(size)).reduce((id, byte) => { - byte &= 63 - if (byte < 36) { - id += byte.toString(36) - } else if (byte < 62) { - id += (byte - 26).toString(36).toUpperCase() - } else if (byte > 62) { - id += '-' - } else { - id += '_' - } - return id - }, '') -export { nanoid, customAlphabet, customRandom, urlAlphabet, random } +export let customAlphabet = (alphabet, size = 21) => + customRandom(alphabet, size | 0, random) +export let nanoid = (size = 21) => { + let id = '' + let bytes = crypto.getRandomValues(new Uint8Array((size |= 0))) + while (size--) { + id += scopedUrlAlphabet[bytes[size] & 63] + } + return id +} diff --git a/吴光慧学习笔记/hello_vue3/node_modules/nanoid/index.cjs b/吴光慧学习笔记/hello_vue3/node_modules/nanoid/index.cjs deleted file mode 100644 index c20e374..0000000 --- a/吴光慧学习笔记/hello_vue3/node_modules/nanoid/index.cjs +++ /dev/null @@ -1,85 +0,0 @@ -let crypto = require('crypto') - -let { urlAlphabet } = require('./url-alphabet/index.cjs') - -// It is best to make fewer, larger requests to the crypto module to -// avoid system call overhead. So, random numbers are generated in a -// pool. The pool is a Buffer that is larger than the initial random -// request size by this multiplier. The pool is enlarged if subsequent -// requests exceed the maximum buffer size. -const POOL_SIZE_MULTIPLIER = 128 -let pool, poolOffset - -let fillPool = bytes => { - if (!pool || pool.length < bytes) { - pool = Buffer.allocUnsafe(bytes * POOL_SIZE_MULTIPLIER) - crypto.randomFillSync(pool) - poolOffset = 0 - } else if (poolOffset + bytes > pool.length) { - crypto.randomFillSync(pool) - poolOffset = 0 - } - poolOffset += bytes -} - -let random = bytes => { - // `|=` convert `bytes` to number to prevent `valueOf` abusing and pool pollution - fillPool((bytes |= 0)) - return pool.subarray(poolOffset - bytes, poolOffset) -} - -let customRandom = (alphabet, defaultSize, getRandom) => { - // First, a bitmask is necessary to generate the ID. The bitmask makes bytes - // values closer to the alphabet size. The bitmask calculates the closest - // `2^31 - 1` number, which exceeds the alphabet size. - // For example, the bitmask for the alphabet size 30 is 31 (00011111). - let mask = (2 << (31 - Math.clz32((alphabet.length - 1) | 1))) - 1 - // Though, the bitmask solution is not perfect since the bytes exceeding - // the alphabet size are refused. Therefore, to reliably generate the ID, - // the random bytes redundancy has to be satisfied. - - // Note: every hardware random generator call is performance expensive, - // because the system call for entropy collection takes a lot of time. - // So, to avoid additional system calls, extra bytes are requested in advance. - - // Next, a step determines how many random bytes to generate. - // The number of random bytes gets decided upon the ID size, mask, - // alphabet size, and magic number 1.6 (using 1.6 peaks at performance - // according to benchmarks). - let step = Math.ceil((1.6 * mask * defaultSize) / alphabet.length) - - return (size = defaultSize) => { - let id = '' - while (true) { - let bytes = getRandom(step) - // A compact alternative for `for (let i = 0; i < step; i++)`. - let i = step - while (i--) { - // Adding `|| ''` refuses a random byte that exceeds the alphabet size. - id += alphabet[bytes[i] & mask] || '' - if (id.length === size) return id - } - } - } -} - -let customAlphabet = (alphabet, size = 21) => - customRandom(alphabet, size, random) - -let nanoid = (size = 21) => { - // `|=` convert `size` to number to prevent `valueOf` abusing and pool pollution - fillPool((size |= 0)) - let id = '' - // We are reading directly from the random pool to avoid creating new array - for (let i = poolOffset - size; i < poolOffset; i++) { - // It is incorrect to use bytes exceeding the alphabet size. - // The following mask reduces the random byte in the 0-255 value - // range to the 0-63 value range. Therefore, adding hacks, such - // as empty string fallback or magic numbers, is unneccessary because - // the bitmask trims bytes down to the alphabet size. - id += urlAlphabet[pool[i] & 63] - } - return id -} - -module.exports = { nanoid, customAlphabet, customRandom, urlAlphabet, random } diff --git a/吴光慧学习笔记/hello_vue3/node_modules/nanoid/index.d.cts b/吴光慧学习笔记/hello_vue3/node_modules/nanoid/index.d.cts deleted file mode 100644 index 3e111a3..0000000 --- a/吴光慧学习笔记/hello_vue3/node_modules/nanoid/index.d.cts +++ /dev/null @@ -1,91 +0,0 @@ -/** - * Generate secure URL-friendly unique ID. - * - * By default, the ID will have 21 symbols to have a collision probability - * similar to UUID v4. - * - * ```js - * import { nanoid } from 'nanoid' - * model.id = nanoid() //=> "Uakgb_J5m9g-0JDMbcJqL" - * ``` - * - * @param size Size of the ID. The default size is 21. - * @returns A random string. - */ -export function nanoid(size?: number): string - -/** - * Generate secure unique ID with custom alphabet. - * - * Alphabet must contain 256 symbols or less. Otherwise, the generator - * will not be secure. - * - * @param alphabet Alphabet used to generate the ID. - * @param defaultSize Size of the ID. The default size is 21. - * @returns A random string generator. - * - * ```js - * const { customAlphabet } = require('nanoid') - * const nanoid = customAlphabet('0123456789абвгдеё', 5) - * nanoid() //=> "8ё56а" - * ``` - */ -export function customAlphabet( - alphabet: string, - defaultSize?: number -): (size?: number) => string - -/** - * Generate unique ID with custom random generator and alphabet. - * - * Alphabet must contain 256 symbols or less. Otherwise, the generator - * will not be secure. - * - * ```js - * import { customRandom } from 'nanoid/format' - * - * const nanoid = customRandom('abcdef', 5, size => { - * const random = [] - * for (let i = 0; i < size; i++) { - * random.push(randomByte()) - * } - * return random - * }) - * - * nanoid() //=> "fbaef" - * ``` - * - * @param alphabet Alphabet used to generate a random string. - * @param size Size of the random string. - * @param random A random bytes generator. - * @returns A random string generator. - */ -export function customRandom( - alphabet: string, - size: number, - random: (bytes: number) => Uint8Array -): () => string - -/** - * URL safe symbols. - * - * ```js - * import { urlAlphabet } from 'nanoid' - * const nanoid = customAlphabet(urlAlphabet, 10) - * nanoid() //=> "Uakgb_J5m9" - * ``` - */ -export const urlAlphabet: string - -/** - * Generate an array of random bytes collected from hardware noise. - * - * ```js - * import { customRandom, random } from 'nanoid' - * const nanoid = customRandom("abcdef", 5, random) - * ``` - * - * @param bytes Size of the array. - * @returns An array of random bytes. - */ -export function random(bytes: number): Uint8Array diff --git a/吴光慧学习笔记/hello_vue3/node_modules/nanoid/index.d.ts b/吴光慧学习笔记/hello_vue3/node_modules/nanoid/index.d.ts index 3e111a3..9f28403 100644 --- a/吴光慧学习笔记/hello_vue3/node_modules/nanoid/index.d.ts +++ b/吴光慧学习笔记/hello_vue3/node_modules/nanoid/index.d.ts @@ -1,4 +1,16 @@ /** + * A tiny, secure, URL-friendly, unique string ID generator for JavaScript + * with hardware random generator. + * + * ```js + * import { nanoid } from 'nanoid' + * model.id = nanoid() //=> "V1StGXR8_Z5jdHi6B-myT" + * ``` + * + * @module + */ + +/** * Generate secure URL-friendly unique ID. * * By default, the ID will have 21 symbols to have a collision probability @@ -10,9 +22,10 @@ * ``` * * @param size Size of the ID. The default size is 21. + * @typeparam Type The ID type to replace `string` with some opaque type. * @returns A random string. */ -export function nanoid(size?: number): string +export function nanoid(size?: number): Type /** * Generate secure unique ID with custom alphabet. @@ -22,6 +35,7 @@ export function nanoid(size?: number): string * * @param alphabet Alphabet used to generate the ID. * @param defaultSize Size of the ID. The default size is 21. + * @typeparam Type The ID type to replace `string` with some opaque type. * @returns A random string generator. * * ```js @@ -30,10 +44,10 @@ export function nanoid(size?: number): string * nanoid() //=> "8ё56а" * ``` */ -export function customAlphabet( +export function customAlphabet( alphabet: string, defaultSize?: number -): (size?: number) => string +): (size?: number) => Type /** * Generate unique ID with custom random generator and alphabet. @@ -58,13 +72,14 @@ export function customAlphabet( * @param alphabet Alphabet used to generate a random string. * @param size Size of the random string. * @param random A random bytes generator. + * @typeparam Type The ID type to replace `string` with some opaque type. * @returns A random string generator. */ -export function customRandom( +export function customRandom( alphabet: string, size: number, random: (bytes: number) => Uint8Array -): () => string +): () => Type /** * URL safe symbols. diff --git a/吴光慧学习笔记/hello_vue3/node_modules/nanoid/index.js b/吴光慧学习笔记/hello_vue3/node_modules/nanoid/index.js index 9bc909d..80c7587 100644 --- a/吴光慧学习笔记/hello_vue3/node_modules/nanoid/index.js +++ b/吴光慧学习笔记/hello_vue3/node_modules/nanoid/index.js @@ -1,45 +1,47 @@ -import crypto from 'crypto' -import { urlAlphabet } from './url-alphabet/index.js' +import { webcrypto as crypto } from 'node:crypto' +import { urlAlphabet as scopedUrlAlphabet } from './url-alphabet/index.js' +export { urlAlphabet } from './url-alphabet/index.js' const POOL_SIZE_MULTIPLIER = 128 let pool, poolOffset -let fillPool = bytes => { +function fillPool(bytes) { if (!pool || pool.length < bytes) { pool = Buffer.allocUnsafe(bytes * POOL_SIZE_MULTIPLIER) - crypto.randomFillSync(pool) + crypto.getRandomValues(pool) poolOffset = 0 } else if (poolOffset + bytes > pool.length) { - crypto.randomFillSync(pool) + crypto.getRandomValues(pool) poolOffset = 0 } poolOffset += bytes } -let random = bytes => { +export function random(bytes) { fillPool((bytes |= 0)) return pool.subarray(poolOffset - bytes, poolOffset) } -let customRandom = (alphabet, defaultSize, getRandom) => { +export function customRandom(alphabet, defaultSize, getRandom) { let mask = (2 << (31 - Math.clz32((alphabet.length - 1) | 1))) - 1 let step = Math.ceil((1.6 * mask * defaultSize) / alphabet.length) return (size = defaultSize) => { + if (!size) return '' let id = '' while (true) { let bytes = getRandom(step) let i = step while (i--) { id += alphabet[bytes[i] & mask] || '' - if (id.length === size) return id + if (id.length >= size) return id } } } } -let customAlphabet = (alphabet, size = 21) => - customRandom(alphabet, size, random) -let nanoid = (size = 21) => { +export function customAlphabet(alphabet, size = 21) { + return customRandom(alphabet, size, random) +} +export function nanoid(size = 21) { fillPool((size |= 0)) let id = '' for (let i = poolOffset - size; i < poolOffset; i++) { - id += urlAlphabet[pool[i] & 63] + id += scopedUrlAlphabet[pool[i] & 63] } return id } -export { nanoid, customAlphabet, customRandom, urlAlphabet, random } diff --git a/吴光慧学习笔记/hello_vue3/node_modules/nanoid/nanoid.js b/吴光慧学习笔记/hello_vue3/node_modules/nanoid/nanoid.js index ec242ea..ffa1d4b 100644 --- a/吴光慧学习笔记/hello_vue3/node_modules/nanoid/nanoid.js +++ b/吴光慧学习笔记/hello_vue3/node_modules/nanoid/nanoid.js @@ -1 +1 @@ -export let nanoid=(t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce(((t,e)=>t+=(e&=63)<36?e.toString(36):e<62?(e-26).toString(36).toUpperCase():e<63?"_":"-"),""); \ No newline at end of file +let a="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";export let nanoid=(e=21)=>{let t="",r=crypto.getRandomValues(new Uint8Array(e));for(let n=0;n { - return (size = defaultSize) => { - let id = '' - // A compact alternative for `for (var i = 0; i < step; i++)`. - let i = size | 0 - while (i--) { - // `| 0` is more compact and faster than `Math.floor()`. - id += alphabet[(Math.random() * alphabet.length) | 0] - } - return id - } -} - -let nanoid = (size = 21) => { - let id = '' - // A compact alternative for `for (var i = 0; i < step; i++)`. - let i = size | 0 - while (i--) { - // `| 0` is more compact and faster than `Math.floor()`. - id += urlAlphabet[(Math.random() * 64) | 0] - } - return id -} - -module.exports = { nanoid, customAlphabet } diff --git a/吴光慧学习笔记/hello_vue3/node_modules/nanoid/non-secure/index.d.ts b/吴光慧学习笔记/hello_vue3/node_modules/nanoid/non-secure/index.d.ts index 4965322..5cd785d 100644 --- a/吴光慧学习笔记/hello_vue3/node_modules/nanoid/non-secure/index.d.ts +++ b/吴光慧学习笔记/hello_vue3/node_modules/nanoid/non-secure/index.d.ts @@ -1,4 +1,17 @@ /** + * By default, Nano ID uses hardware random bytes generation for security + * and low collision probability. If you are not so concerned with security, + * you can use it for environments without hardware random generators. + * + * ```js + * import { nanoid } from 'nanoid/non-secure' + * const id = nanoid() //=> "Uakgb_J5m9g-0JDMbcJqLJ" + * ``` + * + * @module + */ + +/** * Generate URL-friendly unique ID. This method uses the non-secure * predictable random generator with bigger collision probability. * @@ -8,9 +21,10 @@ * ``` * * @param size Size of the ID. The default size is 21. + * @typeparam Type The ID type to replace `string` with some opaque type. * @returns A random string. */ -export function nanoid(size?: number): string +export function nanoid(size?: number): Type /** * Generate a unique ID based on a custom alphabet. @@ -19,15 +33,16 @@ export function nanoid(size?: number): string * * @param alphabet Alphabet used to generate the ID. * @param defaultSize Size of the ID. The default size is 21. + * @typeparam Type The ID type to replace `string` with some opaque type. * @returns A random string generator. * * ```js * import { customAlphabet } from 'nanoid/non-secure' * const nanoid = customAlphabet('0123456789абвгдеё', 5) - * model.id = //=> "8ё56а" + * model.id = nanoid() //=> "8ё56а" * ``` */ -export function customAlphabet( +export function customAlphabet( alphabet: string, defaultSize?: number -): (size?: number) => string +): (size?: number) => Type diff --git a/吴光慧学习笔记/hello_vue3/node_modules/nanoid/non-secure/index.js b/吴光慧学习笔记/hello_vue3/node_modules/nanoid/non-secure/index.js index 2ea5827..a3d83f2 100644 --- a/吴光慧学习笔记/hello_vue3/node_modules/nanoid/non-secure/index.js +++ b/吴光慧学习笔记/hello_vue3/node_modules/nanoid/non-secure/index.js @@ -1,6 +1,7 @@ +/* @ts-self-types="./index.d.ts" */ let urlAlphabet = 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict' -let customAlphabet = (alphabet, defaultSize = 21) => { +export let customAlphabet = (alphabet, defaultSize = 21) => { return (size = defaultSize) => { let id = '' let i = size | 0 @@ -10,7 +11,7 @@ let customAlphabet = (alphabet, defaultSize = 21) => { return id } } -let nanoid = (size = 21) => { +export let nanoid = (size = 21) => { let id = '' let i = size | 0 while (i--) { @@ -18,4 +19,3 @@ let nanoid = (size = 21) => { } return id } -export { nanoid, customAlphabet } diff --git a/吴光慧学习笔记/hello_vue3/node_modules/nanoid/non-secure/package.json b/吴光慧学习笔记/hello_vue3/node_modules/nanoid/non-secure/package.json deleted file mode 100644 index 9930d6a..0000000 --- a/吴光慧学习笔记/hello_vue3/node_modules/nanoid/non-secure/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "type": "module", - "main": "index.cjs", - "module": "index.js", - "react-native": "index.js" -} \ No newline at end of file diff --git a/吴光慧学习笔记/hello_vue3/node_modules/nanoid/package.json b/吴光慧学习笔记/hello_vue3/node_modules/nanoid/package.json index a3d3f44..1d0bc74 100644 --- a/吴光慧学习笔记/hello_vue3/node_modules/nanoid/package.json +++ b/吴光慧学习笔记/hello_vue3/node_modules/nanoid/package.json @@ -1,15 +1,16 @@ { "name": "nanoid", - "version": "3.3.11", - "description": "A tiny (116 bytes), secure URL-friendly unique string ID generator", + "version": "5.1.6", + "description": "A tiny (118 bytes), secure URL-friendly unique string ID generator", "keywords": [ "uuid", "random", "id", "url" ], + "type": "module", "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + "node": "^18 || >=20" }, "funding": [ { @@ -20,70 +21,23 @@ "author": "Andrey Sitnik ", "license": "MIT", "repository": "ai/nanoid", - "browser": { - "./index.js": "./index.browser.js", - "./async/index.js": "./async/index.browser.js", - "./async/index.cjs": "./async/index.browser.cjs", - "./index.cjs": "./index.browser.cjs" - }, - "react-native": "index.js", - "bin": "./bin/nanoid.cjs", - "sideEffects": false, - "types": "./index.d.ts", - "type": "module", - "main": "index.cjs", - "module": "index.js", "exports": { ".": { - "react-native": "./index.browser.js", + "types": "./index.d.ts", "browser": "./index.browser.js", - "require": { - "types": "./index.d.cts", - "default": "./index.cjs" - }, - "import": { - "types": "./index.d.ts", - "default": "./index.js" - }, + "react-native": "./index.browser.js", "default": "./index.js" }, - "./package.json": "./package.json", - "./async/package.json": "./async/package.json", - "./async": { - "browser": "./async/index.browser.js", - "require": { - "types": "./index.d.cts", - "default": "./async/index.cjs" - }, - "import": { - "types": "./index.d.ts", - "default": "./async/index.js" - }, - "default": "./async/index.js" - }, - "./non-secure/package.json": "./non-secure/package.json", - "./non-secure": { - "require": { - "types": "./index.d.cts", - "default": "./non-secure/index.cjs" - }, - "import": { - "types": "./index.d.ts", - "default": "./non-secure/index.js" - }, - "default": "./non-secure/index.js" - }, - "./url-alphabet/package.json": "./url-alphabet/package.json", - "./url-alphabet": { - "require": { - "types": "./index.d.cts", - "default": "./url-alphabet/index.cjs" - }, - "import": { - "types": "./index.d.ts", - "default": "./url-alphabet/index.js" - }, - "default": "./url-alphabet/index.js" - } - } + "./non-secure": "./non-secure/index.js", + "./package.json": "./package.json" + }, + "browser": { + "./index.js": "./index.browser.js" + }, + "react-native": { + "./index.js": "./index.browser.js" + }, + "bin": "./bin/nanoid.js", + "sideEffects": false, + "types": "./index.d.ts" } diff --git a/吴光慧学习笔记/hello_vue3/node_modules/nanoid/url-alphabet/index.cjs b/吴光慧学习笔记/hello_vue3/node_modules/nanoid/url-alphabet/index.cjs deleted file mode 100644 index a332f0b..0000000 --- a/吴光慧学习笔记/hello_vue3/node_modules/nanoid/url-alphabet/index.cjs +++ /dev/null @@ -1,7 +0,0 @@ -// This alphabet uses `A-Za-z0-9_-` symbols. -// The order of characters is optimized for better gzip and brotli compression. -// Same as in non-secure/index.js -let urlAlphabet = - 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict' - -module.exports = { urlAlphabet } diff --git a/吴光慧学习笔记/hello_vue3/node_modules/nanoid/url-alphabet/index.js b/吴光慧学习笔记/hello_vue3/node_modules/nanoid/url-alphabet/index.js index c2782e5..cfec9b2 100644 --- a/吴光慧学习笔记/hello_vue3/node_modules/nanoid/url-alphabet/index.js +++ b/吴光慧学习笔记/hello_vue3/node_modules/nanoid/url-alphabet/index.js @@ -1,3 +1,2 @@ -let urlAlphabet = +export const urlAlphabet = 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict' -export { urlAlphabet } diff --git a/吴光慧学习笔记/hello_vue3/node_modules/nanoid/url-alphabet/package.json b/吴光慧学习笔记/hello_vue3/node_modules/nanoid/url-alphabet/package.json deleted file mode 100644 index 9930d6a..0000000 --- a/吴光慧学习笔记/hello_vue3/node_modules/nanoid/url-alphabet/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "type": "module", - "main": "index.cjs", - "module": "index.js", - "react-native": "index.js" -} \ No newline at end of file diff --git a/吴光慧学习笔记/hello_vue3/package-lock.json b/吴光慧学习笔记/hello_vue3/package-lock.json index ef19588..f64fb07 100644 --- a/吴光慧学习笔记/hello_vue3/package-lock.json +++ b/吴光慧学习笔记/hello_vue3/package-lock.json @@ -8,7 +8,9 @@ "name": "hello_vue3", "version": "0.0.0", "dependencies": { - "axios": "^1.13.1", + "axios": "^1.13.2", + "nanoid": "^5.1.6", + "pinia": "^3.0.3", "vue": "^3.5.22", "vue-router": "^4.6.3" }, @@ -1493,25 +1495,6 @@ "vue": "^3.0.0" } }, - "node_modules/@vue/devtools-core/node_modules/nanoid": { - "version": "5.1.6", - "resolved": "https://registry.npmmirror.com/nanoid/-/nanoid-5.1.6.tgz", - "integrity": "sha512-c7+7RQ+dMB5dPwwCp4ee1/iV/q2P6aK1mTZcfr1BTuVlyW9hJYiMPybJCcnBlQtuSmTIWNeazm/zqNoZSSElBg==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "bin": { - "nanoid": "bin/nanoid.js" - }, - "engines": { - "node": "^18 || >=20" - } - }, "node_modules/@vue/devtools-kit": { "version": "8.0.3", "resolved": "https://registry.npmmirror.com/@vue/devtools-kit/-/devtools-kit-8.0.3.tgz", @@ -1668,9 +1651,9 @@ "license": "MIT" }, "node_modules/axios": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.13.1.tgz", - "integrity": "sha512-hU4EGxxt+j7TQijx1oYdAjw4xuIp1wRQSsbMFwSthCWeBQur1eF+qJ5iQ5sN3Tw8YRzQNKb8jszgBdMDVqwJcw==", + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.13.2.tgz", + "integrity": "sha512-VPk9ebNqPcy5lRGuSlKx752IlDatOjT9paPlm8A7yOuW2Fbvp4X3JznJtT4f0GzGLLiWE9W8onz51SqLYwzGaA==", "license": "MIT", "dependencies": { "follow-redirects": "^1.15.6", @@ -1692,7 +1675,6 @@ "version": "2.6.1", "resolved": "https://registry.npmmirror.com/birpc/-/birpc-2.6.1.tgz", "integrity": "sha512-LPnFhlDpdSH6FJhJyn4M0kFO7vtQ5iPw24FnG0y21q09xC7e8+1LeR31S1MAIrDAHp4m7aas4bEkTDTvMAtebQ==", - "dev": true, "license": "MIT", "funding": { "url": "https://github.com/sponsors/antfu" @@ -1805,7 +1787,6 @@ "version": "4.0.5", "resolved": "https://registry.npmmirror.com/copy-anything/-/copy-anything-4.0.5.tgz", "integrity": "sha512-7Vv6asjS4gMOuILabD3l739tsaxFQmC+a7pLZm02zyvs8p977bL3zEgq3yDk5rn9B0PbYgIv++jmHcuUab4RhA==", - "dev": true, "license": "MIT", "dependencies": { "is-what": "^5.2.0" @@ -2257,7 +2238,6 @@ "version": "5.5.3", "resolved": "https://registry.npmmirror.com/hookable/-/hookable-5.5.3.tgz", "integrity": "sha512-Yc+BQe8SvoXH1643Qez1zqLRmbA5rCL+sSmk6TVos0LWVfNIB7PGncdlId77WzLGSIB5KaWgTaNTs2lNVEI6VQ==", - "dev": true, "license": "MIT" }, "node_modules/is-docker": { @@ -2299,7 +2279,6 @@ "version": "5.5.0", "resolved": "https://registry.npmmirror.com/is-what/-/is-what-5.5.0.tgz", "integrity": "sha512-oG7cgbmg5kLYae2N5IVd3jm2s+vldjxJzK1pcu9LfpGuQ93MQSzo0okvRna+7y5ifrD+20FE8FvjusyGaz14fw==", - "dev": true, "license": "MIT", "engines": { "node": ">=18" @@ -2446,7 +2425,6 @@ "version": "3.0.1", "resolved": "https://registry.npmmirror.com/mitt/-/mitt-3.0.1.tgz", "integrity": "sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==", - "dev": true, "license": "MIT" }, "node_modules/mrmime": { @@ -2474,9 +2452,9 @@ "license": "MIT" }, "node_modules/nanoid": { - "version": "3.3.11", - "resolved": "https://registry.npmmirror.com/nanoid/-/nanoid-3.3.11.tgz", - "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==", + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-5.1.6.tgz", + "integrity": "sha512-c7+7RQ+dMB5dPwwCp4ee1/iV/q2P6aK1mTZcfr1BTuVlyW9hJYiMPybJCcnBlQtuSmTIWNeazm/zqNoZSSElBg==", "funding": [ { "type": "github", @@ -2485,10 +2463,10 @@ ], "license": "MIT", "bin": { - "nanoid": "bin/nanoid.cjs" + "nanoid": "bin/nanoid.js" }, "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + "node": "^18 || >=20" } }, "node_modules/node-releases": { @@ -2624,6 +2602,66 @@ "node": ">=0.10" } }, + "node_modules/pinia": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/pinia/-/pinia-3.0.3.tgz", + "integrity": "sha512-ttXO/InUULUXkMHpTdp9Fj4hLpD/2AoJdmAbAeW2yu1iy1k+pkFekQXw5VpC0/5p51IOR/jDaDRfRWRnMMsGOA==", + "license": "MIT", + "dependencies": { + "@vue/devtools-api": "^7.7.2" + }, + "funding": { + "url": "https://github.com/sponsors/posva" + }, + "peerDependencies": { + "typescript": ">=4.4.4", + "vue": "^2.7.0 || ^3.5.11" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/pinia/node_modules/@vue/devtools-api": { + "version": "7.7.7", + "resolved": "https://registry.npmjs.org/@vue/devtools-api/-/devtools-api-7.7.7.tgz", + "integrity": "sha512-lwOnNBH2e7x1fIIbVT7yF5D+YWhqELm55/4ZKf45R9T8r9dE2AIOy8HKjfqzGsoTHFbWbr337O4E0A0QADnjBg==", + "license": "MIT", + "dependencies": { + "@vue/devtools-kit": "^7.7.7" + } + }, + "node_modules/pinia/node_modules/@vue/devtools-kit": { + "version": "7.7.7", + "resolved": "https://registry.npmjs.org/@vue/devtools-kit/-/devtools-kit-7.7.7.tgz", + "integrity": "sha512-wgoZtxcTta65cnZ1Q6MbAfePVFxfM+gq0saaeytoph7nEa7yMXoi6sCPy4ufO111B9msnw0VOWjPEFCXuAKRHA==", + "license": "MIT", + "dependencies": { + "@vue/devtools-shared": "^7.7.7", + "birpc": "^2.3.0", + "hookable": "^5.5.3", + "mitt": "^3.0.1", + "perfect-debounce": "^1.0.0", + "speakingurl": "^14.0.1", + "superjson": "^2.2.2" + } + }, + "node_modules/pinia/node_modules/@vue/devtools-shared": { + "version": "7.7.7", + "resolved": "https://registry.npmjs.org/@vue/devtools-shared/-/devtools-shared-7.7.7.tgz", + "integrity": "sha512-+udSj47aRl5aKb0memBvcUG9koarqnxNM5yjuREvqwK6T3ap4mn3Zqqc17QrBFTqSMjr3HK1cvStEZpMDpfdyw==", + "license": "MIT", + "dependencies": { + "rfdc": "^1.4.1" + } + }, + "node_modules/pinia/node_modules/perfect-debounce": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/perfect-debounce/-/perfect-debounce-1.0.0.tgz", + "integrity": "sha512-xCy9V055GLEqoFaHoC1SoLIaLmWctgCUaBaWxDZ7/Zx4CTyX7cJQLJOok/orfjZAh9kEYpjJa4d0KcJmCbctZA==", + "license": "MIT" + }, "node_modules/postcss": { "version": "8.5.6", "resolved": "https://registry.npmmirror.com/postcss/-/postcss-8.5.6.tgz", @@ -2652,6 +2690,24 @@ "node": "^10 || ^12 || >=14" } }, + "node_modules/postcss/node_modules/nanoid": { + "version": "3.3.11", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz", + "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, "node_modules/proxy-from-env": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", @@ -2676,7 +2732,6 @@ "version": "1.4.1", "resolved": "https://registry.npmmirror.com/rfdc/-/rfdc-1.4.1.tgz", "integrity": "sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==", - "dev": true, "license": "MIT" }, "node_modules/rollup": { @@ -2816,7 +2871,6 @@ "version": "14.0.1", "resolved": "https://registry.npmmirror.com/speakingurl/-/speakingurl-14.0.1.tgz", "integrity": "sha512-1POYv7uv2gXoyGFpBCmpDVSNV74IfsWlDW216UPjbWufNf+bSU6GdbDsxdcxtfwb4xlI3yxzOTKClUosxARYrQ==", - "dev": true, "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" @@ -2826,7 +2880,6 @@ "version": "2.2.5", "resolved": "https://registry.npmmirror.com/superjson/-/superjson-2.2.5.tgz", "integrity": "sha512-zWPTX96LVsA/eVYnqOM2+ofcdPqdS1dAF1LN4TS2/MWuUpfitd9ctTa87wt4xrYnZnkLtS69xpBdSxVBP5Rm6w==", - "dev": true, "license": "MIT", "dependencies": { "copy-anything": "^4" diff --git a/吴光慧学习笔记/hello_vue3/package.json b/吴光慧学习笔记/hello_vue3/package.json index a1510af..5a6c6b4 100644 --- a/吴光慧学习笔记/hello_vue3/package.json +++ b/吴光慧学习笔记/hello_vue3/package.json @@ -14,7 +14,9 @@ "type-check": "vue-tsc --build" }, "dependencies": { - "axios": "^1.13.1", + "axios": "^1.13.2", + "nanoid": "^5.1.6", + "pinia": "^3.0.3", "vue": "^3.5.22", "vue-router": "^4.6.3" }, diff --git a/吴光慧学习笔记/hello_vue3/src/App.vue b/吴光慧学习笔记/hello_vue3/src/App.vue index 6f2437c..3b26d9d 100644 --- a/吴光慧学习笔记/hello_vue3/src/App.vue +++ b/吴光慧学习笔记/hello_vue3/src/App.vue @@ -1,69 +1,10 @@ - - - \ No newline at end of file diff --git a/吴光慧学习笔记/hello_vue3/src/components/Count.vue b/吴光慧学习笔记/hello_vue3/src/components/Count.vue new file mode 100644 index 0000000..7a3f05c --- /dev/null +++ b/吴光慧学习笔记/hello_vue3/src/components/Count.vue @@ -0,0 +1,47 @@ + + + + + \ No newline at end of file diff --git a/吴光慧学习笔记/hello_vue3/src/components/LoveTalk.vue b/吴光慧学习笔记/hello_vue3/src/components/LoveTalk.vue new file mode 100644 index 0000000..b7a47d0 --- /dev/null +++ b/吴光慧学习笔记/hello_vue3/src/components/LoveTalk.vue @@ -0,0 +1,45 @@ + + + + + \ No newline at end of file diff --git a/吴光慧学习笔记/hello_vue3/src/components/News.vue b/吴光慧学习笔记/hello_vue3/src/components/News.vue deleted file mode 100644 index 068c767..0000000 --- a/吴光慧学习笔记/hello_vue3/src/components/News.vue +++ /dev/null @@ -1,34 +0,0 @@ - - - - - \ No newline at end of file diff --git a/吴光慧学习笔记/hello_vue3/src/components/Person.vue b/吴光慧学习笔记/hello_vue3/src/components/Person.vue deleted file mode 100644 index 37f5095..0000000 --- a/吴光慧学习笔记/hello_vue3/src/components/Person.vue +++ /dev/null @@ -1,48 +0,0 @@ - - - - - \ No newline at end of file diff --git a/吴光慧学习笔记/hello_vue3/src/main.ts b/吴光慧学习笔记/hello_vue3/src/main.ts index 265c7c7..8d9f489 100644 --- a/吴光慧学习笔记/hello_vue3/src/main.ts +++ b/吴光慧学习笔记/hello_vue3/src/main.ts @@ -3,10 +3,17 @@ import './assets/main.css' import { createApp } from 'vue' //引入App组件 import App from './App.vue' -//引入router -import router from './router' +// //引入router +// import router from './router' + +/* 引入createPinia,用于创建pinia */ +import { createPinia } from 'pinia' +/* 创建pinia */ +const pinia = createPinia() const app = createApp(App) -app.use(router) +//app.use(router) +/* 使用插件 */{} +app.use(pinia) app.mount('#app') diff --git a/吴光慧学习笔记/hello_vue3/src/store/count.ts b/吴光慧学习笔记/hello_vue3/src/store/count.ts new file mode 100644 index 0000000..ddae0bd --- /dev/null +++ b/吴光慧学习笔记/hello_vue3/src/store/count.ts @@ -0,0 +1,29 @@ +import {defineStore} from 'pinia' + +export const useCountStore = defineStore('count',{ + actions:{ + // 定义方法,可以修改state中的数据,响应组件中的“动作” + increment(value: number){ + console.log('increment被调用了',value) + //修改数据,响应组件 + //this是当前store实例 + this.sum += value + }, + //减 + decrement(value: number){ + this.sum -= value + } + }, + // 真正存储数据的地方 + state(){ + return { + sum:6 + } + }, + + getters:{ + bigSum(state){ + return state.sum * 10 + } + } +}) \ No newline at end of file diff --git a/吴光慧学习笔记/hello_vue3/src/store/loveTalk.ts b/吴光慧学习笔记/hello_vue3/src/store/loveTalk.ts new file mode 100644 index 0000000..8cc3102 --- /dev/null +++ b/吴光慧学习笔记/hello_vue3/src/store/loveTalk.ts @@ -0,0 +1,22 @@ +import {defineStore} from 'pinia' +import axios from 'axios' +import {nanoid} from 'nanoid' + +export const useTalkStore = defineStore('talk',{ + actions:{ + async getATalk(){ + // 发请求,下面这行的写法是:连续解构赋值+重命名 + let {data:{content:title}} = await axios.get('https://api.uomg.com/api/rand.qinghua?format=json') + // 把请求回来的字符串,包装成一个对象 + let obj = {id:nanoid(),title} + // 放到数组中 + this.talkList.unshift(obj) + } + }, + // 真正存储数据的地方 + state(){ + return { + talkList:JSON.parse(localStorage.getItem('talkList') as string) || [] + } + } +}) \ No newline at end of file diff --git a/股票知识评测系统.vue b/股票知识评测系统.vue new file mode 100644 index 0000000..a65f89d --- /dev/null +++ b/股票知识评测系统.vue @@ -0,0 +1,434 @@ + + + + +