mirror of
https://gitlab.com/Binaryify/neteasecloudmusicapi.git
synced 2025-07-07 01:22:08 +08:00
代码格式化
This commit is contained in:
32
main.js
32
main.js
@ -3,20 +3,24 @@ const path = require('path')
|
||||
const request = require('./util/request')
|
||||
const { cookieToJson } = require('./util/index')
|
||||
|
||||
|
||||
let obj = {}
|
||||
fs.readdirSync(path.join(__dirname, 'module')).reverse().forEach(file => {
|
||||
if(!file.endsWith('.js')) return
|
||||
let fileModule = require(path.join(__dirname, 'module', file))
|
||||
obj[file.split('.').shift()] = function (data) {
|
||||
if(typeof data.cookie === 'string'){
|
||||
data.cookie = cookieToJson(data.cookie)
|
||||
fs.readdirSync(path.join(__dirname, 'module'))
|
||||
.reverse()
|
||||
.forEach((file) => {
|
||||
if (!file.endsWith('.js')) return
|
||||
let fileModule = require(path.join(__dirname, 'module', file))
|
||||
obj[file.split('.').shift()] = function (data) {
|
||||
if (typeof data.cookie === 'string') {
|
||||
data.cookie = cookieToJson(data.cookie)
|
||||
}
|
||||
return fileModule(
|
||||
{
|
||||
...data,
|
||||
cookie: data.cookie ? data.cookie : {},
|
||||
},
|
||||
request,
|
||||
)
|
||||
}
|
||||
return fileModule({
|
||||
...data,
|
||||
cookie: data.cookie ? data.cookie : {}
|
||||
}, request)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
module.exports = obj
|
||||
module.exports = obj
|
||||
|
Reference in New Issue
Block a user