mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-17 05:38:04 +00:00
refactor: rename napi to netease_api
This commit is contained in:
parent
e030647720
commit
fe8b3261ca
228 changed files with 1 additions and 1 deletions
17
netease_api/util/index.js
Normal file
17
netease_api/util/index.js
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
module.exports = {
|
||||
toBoolean(val) {
|
||||
if (typeof val === 'boolean') return val;
|
||||
if (val === '') return val;
|
||||
return val === 'true' || val == '1';
|
||||
},
|
||||
cookieToJson(cookie) {
|
||||
if (!cookie) return {};
|
||||
let cookieArr = cookie.split(';');
|
||||
let obj = {};
|
||||
cookieArr.forEach((i) => {
|
||||
let arr = i.split('=');
|
||||
obj[arr[0]] = arr[1];
|
||||
});
|
||||
return obj;
|
||||
},
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue