diff --git a/rollup.config.js b/rollup.config.js index 5f0d98e..977dc88 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -20,22 +20,17 @@ srcItems.forEach((item) => { } } }); -// console.log('🍕🍕🍕', utilsFiles); -// console.log('🍕🍕', hasIndexFiles); const indexEntries = []; hasIndexFiles.forEach(subDir => { indexEntries.push(...generateEntries(['index.js'], subDir)); }); // src/index.js indexEntries.push(...generateEntries(['index.js'])); - // console.log('🍕', indexEntries); -// return; function generateEntries(files, parentDir) { // Create entries with both ESM and CJS outputs const _Entries = files.flatMap((file) => { const moduleName = path.basename(file, '.js'); - // console.log('🍕', file, moduleName); return [ // ESM output diff --git a/src/utils/commons.js b/src/utils/commons.js index f40dfde..95d22be 100644 --- a/src/utils/commons.js +++ b/src/utils/commons.js @@ -654,9 +654,9 @@ export const getNestedValue = (obj, keyArr) => { /** * 计算笛卡尔积 * @param {object[]} arr - * @param {string} sep '_' - * @param {number} index 0 - * @param {string} prefix '' + * @param {string} [sep='_'] + * @param {number} [index=0] + * @param {string} [prefix=''] */ export const cartesianProductArray = (arr, sep = '_', index = 0, prefix = '') => { let result = []; @@ -669,6 +669,11 @@ export const cartesianProductArray = (arr, sep = '_', index = 0, prefix = '') => return result; }; +/** + * @param {string} [str=''] + * @param {boolean} [withFlag=true] + * @returns {string} + */ export const stringToColour = (str = '', withFlag = true) => { var hash = 0; if (str.length === 0) return hash; @@ -812,6 +817,9 @@ export const clearAllCaches = async (cb) => { } }; +/** + * 劚态蜜入JS + */ export const loadScript = (src) => { return new Promise((resolve, reject) => { const script = document.createElement('script'); diff --git a/src/utils/request.js b/src/utils/request.js index 7b19198..c607343 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -158,8 +158,7 @@ export function postStream(url, obj) { } export function delJSON(url, obj) { - const host = /^https?:\/\//i.test(url) ? '': HT_HOST; - return fetch(`${host}${url}`, { + return fetch(`${url}`, { method: 'DELETE', body: JSON.stringify(obj), headers: {