bajo-extra 2.4.0 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +6 -2
- package/package.json +1 -1
- package/wiki/CHANGES.md +8 -0
package/index.js
CHANGED
|
@@ -187,7 +187,7 @@ async function factory (pkgName) {
|
|
|
187
187
|
}
|
|
188
188
|
|
|
189
189
|
download = async (url, opts = {}, extra = {}) => {
|
|
190
|
-
const {
|
|
190
|
+
const { importPkg } = this.app.bajo
|
|
191
191
|
const { generateId } = this.app.lib.aneka
|
|
192
192
|
const { fetch } = await importPkg('bajoExtra:undici')
|
|
193
193
|
const { fs } = this.app.lib
|
|
@@ -195,7 +195,7 @@ async function factory (pkgName) {
|
|
|
195
195
|
if (typeof opts === 'string') extra = { dir: opts }
|
|
196
196
|
const increment = await importPkg('bajo:add-filename-increment')
|
|
197
197
|
if (!extra.dir) {
|
|
198
|
-
extra.dir = `${getPluginDataDir('bajoExtra')}/download`
|
|
198
|
+
extra.dir = `${this.app.getPluginDataDir('bajoExtra')}/download`
|
|
199
199
|
fs.ensureDirSync(extra.dir)
|
|
200
200
|
}
|
|
201
201
|
if (!fs.existsSync(extra.dir)) throw this.error('dlDirNotExists%s', extra.dir)
|
|
@@ -371,6 +371,10 @@ async function factory (pkgName) {
|
|
|
371
371
|
return /^[a-f0-9]{64}$/i.test(text)
|
|
372
372
|
}
|
|
373
373
|
|
|
374
|
+
isHtmlLink = (text) => {
|
|
375
|
+
return /<a\s+[^>]*href="([^"]*)"[^>]*>(.*?)<\/a>/gi.test(text)
|
|
376
|
+
}
|
|
377
|
+
|
|
374
378
|
encrypt = async (text, { type = 'short', subType = 'qr' } = {}) => {
|
|
375
379
|
const { importPkg } = this.app.bajo
|
|
376
380
|
const { ShortCrypt } = await importPkg('bajoExtra:short-crypt')
|
package/package.json
CHANGED