mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-14 07:26:52 +00:00
一些无用的格式化
This commit is contained in:
@@ -42,7 +42,7 @@ export const initTheme = (theme, changeTheme) => {
|
||||
* 是否优先深色模式, 根据系统深色模式以及当前时间判断
|
||||
* @returns {*}
|
||||
*/
|
||||
export function isPreferDark () {
|
||||
export function isPreferDark() {
|
||||
if (BLOG.APPEARANCE === 'dark') {
|
||||
return true
|
||||
}
|
||||
|
||||
10
lib/utils.js
10
lib/utils.js
@@ -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))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user