Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
K
koishi-plugin-picsource-localfs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
3rdeye
koishi-plugin-picsource-localfs
Commits
0b814293
Commit
0b814293
authored
Jan 01, 2023
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bump
parent
8f3b076e
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
482 additions
and
211 deletions
+482
-211
package-lock.json
package-lock.json
+473
-200
package.json
package.json
+7
-7
src/index.ts
src/index.ts
+2
-4
No files found.
package-lock.json
View file @
0b814293
This diff is collapsed.
Click to expand it.
package.json
View file @
0b814293
...
@@ -28,17 +28,17 @@
...
@@ -28,17 +28,17 @@
},
},
"homepage"
:
"
https://github.com/koishijs/koishi-plugin-picsource-localfs
"
,
"homepage"
:
"
https://github.com/koishijs/koishi-plugin-picsource-localfs
"
,
"dependencies"
:
{
"dependencies"
:
{
"
koishi-thirdeye
"
:
"
^11.1.
16
"
,
"
koishi-thirdeye
"
:
"
^11.1.
20
"
,
"
read-dir-deep
"
:
"
^7.0.1
"
"
read-dir-deep
"
:
"
^7.0.1
"
},
},
"peerDependencies"
:
{
"peerDependencies"
:
{
"koishi"
:
"^4.1
0.6
"
,
"koishi"
:
"^4.1
1.0
"
,
"koishi-plugin-pics"
:
"^10.6.
1
"
"koishi-plugin-pics"
:
"^10.6.
4
"
},
},
"devDependencies"
:
{
"devDependencies"
:
{
"
@koishijs/plugin-console
"
:
"
^
4.7.1
"
,
"
@koishijs/plugin-console
"
:
"
^
5.0.2
"
,
"
@koishijs/plugin-database-memory
"
:
"
^2.
0.1
"
,
"
@koishijs/plugin-database-memory
"
:
"
^2.
2.0
"
,
"
@koishijs/plugin-sandbox
"
:
"
^2.
4
.0
"
,
"
@koishijs/plugin-sandbox
"
:
"
^2.
5
.0
"
,
"
@types/jest
"
:
"
^29.2.0
"
,
"
@types/jest
"
:
"
^29.2.0
"
,
"
@types/node
"
:
"
^16.11.4
"
,
"
@types/node
"
:
"
^16.11.4
"
,
"
@typescript-eslint/eslint-plugin
"
:
"
^4.33.0
"
,
"
@typescript-eslint/eslint-plugin
"
:
"
^4.33.0
"
,
...
@@ -53,7 +53,7 @@
...
@@ -53,7 +53,7 @@
"
ts-jest
"
:
"
^29.0.3
"
,
"
ts-jest
"
:
"
^29.0.3
"
,
"
ts-loader
"
:
"
^9.3.1
"
,
"
ts-loader
"
:
"
^9.3.1
"
,
"
ts-node
"
:
"
^10.9.1
"
,
"
ts-node
"
:
"
^10.9.1
"
,
"
typescript
"
:
"
^4.
8
.4
"
,
"
typescript
"
:
"
^4.
9
.4
"
,
"
webpack
"
:
"
^5.74.0
"
,
"
webpack
"
:
"
^5.74.0
"
,
"
webpack-cli
"
:
"
^4.10.0
"
,
"
webpack-cli
"
:
"
^4.10.0
"
,
"
ws
"
:
"
^8.3.0
"
"
ws
"
:
"
^8.3.0
"
...
...
src/index.ts
View file @
0b814293
...
@@ -22,11 +22,9 @@ export default class LocalSource extends PicSourcePlugin(LocalSourceConfig) {
...
@@ -22,11 +22,9 @@ export default class LocalSource extends PicSourcePlugin(LocalSourceConfig) {
return
null
;
return
null
;
}
}
const
filename
=
Random
.
pick
(
files
);
const
filename
=
Random
.
pick
(
files
);
const
fileBase64
=
(
await
fs
.
promises
.
readFile
(
filename
)).
toString
(
const
data
=
await
this
.
pics
.
urlToBuffer
(
`file://
${
filename
}
`
);
'
base64
'
,
);
return
{
return
{
url
:
`base64://
${
fileBase64
}
`
,
url
:
await
this
.
pics
.
bufferToUrl
(
data
.
buffer
,
data
.
mime
)
,
description
:
this
.
config
.
displayFilename
description
:
this
.
config
.
displayFilename
?
path
.
basename
(
filename
)
?
path
.
basename
(
filename
)
:
undefined
,
:
undefined
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment