一些无用的格式化

This commit is contained in:
tangly1024
2022-04-13 12:10:45 +08:00
parent c9e9a55ca7
commit b122bab41d
2 changed files with 6 additions and 6 deletions

View File

@@ -42,7 +42,7 @@ export const initTheme = (theme, changeTheme) => {
* 是否优先深色模式, 根据系统深色模式以及当前时间判断
* @returns {*}
*/
export function isPreferDark () {
export function isPreferDark() {
if (BLOG.APPEARANCE === 'dark') {
return true
}

View File

@@ -6,7 +6,7 @@
* @param type js 或 css
* @returns {Promise<unknown>}
*/
export function loadExternalResource (url, type) {
export function loadExternalResource(url, type) {
return new Promise((resolve, reject) => {
let tag
@@ -31,8 +31,8 @@ export function loadExternalResource (url, type) {
* @param {}} variable
* @returns
*/
export function getQueryVariable (variable) {
const query = window.location.search.substring(1)
export function getQueryVariable(variable) {
const query = typeof window !== 'undefined' ? window.location.search.substring(1) : ''
const vars = query.split('&')
for (let i = 0; i < vars.length; i++) {
const pair = vars[i].split('=')
@@ -46,7 +46,7 @@ export function getQueryVariable (variable) {
* @param target
* @param sources
*/
export function mergeDeep (target, ...sources) {
export function mergeDeep(target, ...sources) {
if (!sources.length) return target
const source = sources.shift()
@@ -68,6 +68,6 @@ export function mergeDeep (target, ...sources) {
* @param item
* @returns {boolean}
*/
export function isObject (item) {
export function isObject(item) {
return (item && typeof item === 'object' && !Array.isArray(item))
}