diff --git a/addLincese.js b/addLincese.js deleted file mode 100644 index e995fb8..0000000 --- a/addLincese.js +++ /dev/null @@ -1,28 +0,0 @@ -const fs = require('fs'); -const path = require('path'); - -function add(father, header) { - fs.readdir(father, { withFileTypes: true }, (err, files) => { - files.map((i) => { - const PATH = father + '/' + i.name; - if (i.isFile()) { - if (path.extname(PATH) === '.js') { - fs.readFile(PATH, (err, text) => { - fs.writeFile(PATH, header + text, () => {}); - }); - } - } else { - add(PATH, header); - } - }); - }); -} -add( - './src', - `/** - * @license - * Copyright 2021 KonghaYao 江夏尧 - * SPDX-License-Identifier: Apache-2.0 - */ - `, -); diff --git a/dist/JSpider.esm.min.js b/dist/JSpider.esm.min.js index 63bb7d1..1cf98eb 100644 --- a/dist/JSpider.esm.min.js +++ b/dist/JSpider.esm.min.js @@ -3712,6 +3712,12 @@ var pick = flatRest(function(object, paths) { return object == null ? {} : basePick(object, paths); }); +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ + class EventHub { all = new Map(); constructor(eventMap = {}, bindThis = null) { @@ -3774,6 +3780,11 @@ class EventHub { }; } +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ const staticEvent$2 = {}; // Unique ID creation requires a high quality random # generator. In the browser we therefore @@ -4041,17 +4052,21 @@ function sha1(bytes) { var v5 = v35('v5', 0x50, sha1); -/* - * @Author: KonghaYao - * @Date: 2021-06-28 21:07:01 - * @Last Modified by: KonghaYao - * @Last Modified time: 2021-06-28 21:07:01 +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 */ function createUUID(string) { return v5(string, v5.URL); } +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ /** * 函数用途描述 * 这个是用于 async 函数队列 连续执行的函数,只要 enQueue 之后就会连续执行,直至停止 @@ -4068,6 +4083,11 @@ class functionQueue { } } +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ // Pipeline 是组合 Plugin 实例的工具类,用于创建一个可以不断提供 source 进行固定操作的功能对象。 class Pipeline { constructor(Plugins) { @@ -4097,6 +4117,11 @@ class Pipeline { } } +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ // 每个 Task 拥有的静态事件 // 这些事件一般通过 $commit(eventName,payload) 进行执行 // ! this 被绑定为 Task 的实例 @@ -4129,6 +4154,12 @@ const staticEvent$1 = { }, }; +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ + // 装载信息的最小单元 // ! 需要进行 backup 的属性都放置在 Super 里面 @@ -4173,6 +4204,12 @@ class Data { } } +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ + // 这个 Task 是模板类,如果需要进行业务功能的实现,必须先继承它,然后 super 相应的东西 class Task extends Data { _belongTo = null; // 当有 TaskGroup 时,指向 Group @@ -4213,6 +4250,11 @@ class Task extends Data { } } +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ class TaskGroup extends Task { constructor(TaskArray, _spiderUUID = '00000') { const output = new Set(TaskArray); @@ -4251,6 +4293,12 @@ class TaskGroup extends Task { } } +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ + var staticEvent = { // ! 即使这些函数不会被使用,也必须使用注释的方式写下 stateChange(state) { @@ -4277,6 +4325,12 @@ var staticEvent = { 'Task:complete'() {}, }; +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ + function createTaskViewModel(task) { // TODO 建立 Proxy 对象提供监控 return new Proxy(task, {}); @@ -4305,6 +4359,21 @@ class TaskManager { } } +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * pauseToggle + * @date 2021-07-20 + * @author KonghaYao + * @description 用于暂停的 operator, 改编自 bufferToggle 但也不同 + * @param {Observable} openings 发出时触发主流缓存 + * @param {Observable} closings 发出时放出缓存到主流 + * @return {function} + */ function pauseToggle(openings, closings) { return (observable) => new Observable((subscriber) => { @@ -4339,6 +4408,12 @@ function pauseToggle(openings, closings) { }); } +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ + // ControlPanel 是 JSpider 内部的事件和数据中心。 // 全部 JSpider 涉及到的边界中,ControlPanel 只有一个,但是 View 可以有多个,而 Spider 就是 View 中的一个 // 用于分发数据流,提供 Task 的状态变更。 @@ -4410,13 +4485,18 @@ class ControlPanel$1 { } } +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ + var ControlPanel = new ControlPanel$1(); -/* - * @Author: KonghaYao - * @Date: 2021-07-13 15:33:08 - * @Last Modified by: KonghaYao - * @Last Modified time: 2021-07-19 16:34:32 +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 */ // TODO 未完成接口的接入 @@ -5045,7 +5125,11 @@ var TapSubscriber = /*@__PURE__*/ (function (_super) { return TapSubscriber; }(Subscriber)); -// 在 JSpider 系统中的流发生了错误 +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ // Plugin main 函数发生了错误 class PluginError extends Error { @@ -5063,11 +5147,10 @@ class RetryError extends Error { } } -/* - * @Author: KonghaYao - * @Date: 2021-06-28 21:06:34 - * @Last Modified by: KonghaYao - * @Last Modified time: 2021-07-16 20:24:50 +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 */ class PLUGIN { @@ -5156,11 +5239,10 @@ function Plugin(Process) { throw new PluginError('Plugin 必须是一个函数或者是 Plugin 描述对象'); } -/* - * @Author: KonghaYao - * @Date: 2021-06-28 21:06:13 - * @Last Modified by: KonghaYao - * @Last Modified time: 2021-07-13 19:33:35 +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 */ // delay 可以是一个函数用于产生数字 @@ -5188,19 +5270,10 @@ const retryAndDelay = (count, delay) => ), ); -/* - * @Author: KonghaYao - * @Date: 2021-06-28 21:06:08 - * @Last Modified by: KonghaYao - * @Last Modified time: 2021-07-16 10:11:11 - */ - /** - * 并发控制操作符 - * @date 2021-06-28 - * @param {any} promiseFunc - * @param {any} options - * @return {any} + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 */ function concurrent( @@ -5244,7 +5317,11 @@ function concurrent( ); } -/* eslint-disable no-invalid-this */ +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ // ! 这个 Request 文件是标准的 Plugin 的高级注册示例 @@ -5337,6 +5414,12 @@ function Request(options = {}) { }); } +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ + function toFile(data, name) { if (data instanceof File) return data; if (data instanceof Blob) { @@ -5347,6 +5430,11 @@ function toFile(data, name) { return new File([JSON.stringify(data)], name); } +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ // 在 浏览器中下载是不能够同时进行的,也就是说,如果前面的没有下载完,后面的又提交 // 会导致后面的全部失效,所以设置 Promise 下载队列 const DownloadQueue = { @@ -5378,6 +5466,11 @@ const Download = function (options = {}) { }); }; +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ const loaderFunction = { script(url) { return new Promise((resolve, reject) => { @@ -5409,6 +5502,11 @@ const loaderFunction = { // TODO UMD AMD 等类型的 JS 代码的载入 }; +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ var scriptMap = { zangodb: 'https://cdn.jsdelivr.net/gh/erikolson186/zangodb/dist/zangodb.min.js', dexie: 'https://cdn.jsdelivr.net/npm/dexie@3.0.3/dist/dexie.min.js', @@ -5430,6 +5528,11 @@ var scriptMap = { ], }; +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ // 借助 jsdelivr 网站的免费 cdn 实现直接查询导入插件的功能。 const URI = 'https://cdn.jsdelivr.net'; const wayMap = Object.entries({ @@ -5450,18 +5553,21 @@ function jsdelivr(moduleName, { version = '', store = 'npm', path = '' } = {}) { return `${URI}/${way}/${moduleName}${version ? `@${version}` : ''}${path ? `/${path}` : ''}`; } -/* - * @Author: KonghaYao - * @Date: 2021-06-28 21:06:20 - * @Last Modified by: KonghaYao - * @Last Modified time: 2021-06-28 21:06:20 +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 */ function type(any) { return Object.prototype.toString.call(any).match(/(?<=\[object\s+)\S+?(?=\])/)[0]; } -// 使用下面的 名称可以直接导入相应的包 +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ const URLTest = /(https?|ftp|file):\/\/[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]/; @@ -5507,6 +5613,12 @@ async function $load(Module) { return handle[type(Module)](Module); } +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ + let XLSX; function init$1() { return $load('xlsx').then(() => { @@ -5514,6 +5626,11 @@ function init$1() { }); } +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ // XLSX 通过 script 导入 function ArrayToSheet(sheetArray) { sheetArray.forEach((i) => { @@ -5550,6 +5667,11 @@ function createExcelFile(input, fileName, XLSXOptions) { }); } +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ // 未完成 导入 XLSX 的 Promise 到流的转变 // ExcelHelper 是将 Object => Book => File 用于下载的一个库 @@ -5565,6 +5687,12 @@ const ExcelHelper = function (formatter, options = {}) { }); }; +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ + let JSZip; function init() { return $load('jszip').then(() => { @@ -5572,6 +5700,12 @@ function init() { }); } +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ + let index$1 = 0; async function zipper(fileArray, zipName) { // 启动压缩 @@ -5587,6 +5721,12 @@ async function zipper(fileArray, zipName) { return content; } +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ + const ZipFile = function (options = {}) { if (!options.zipFileName) options.zipFileName = new Date().getTime(); return Plugin({ @@ -5616,6 +5756,12 @@ const ZipFile = function (options = {}) { }); }; +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ + var plugins = /*#__PURE__*/Object.freeze({ __proto__: null, Request: Request, @@ -5624,6 +5770,11 @@ var plugins = /*#__PURE__*/Object.freeze({ ZipFile: ZipFile }); +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ /* * @Author: KonghaYao * @Date: 2021-06-29 16:16:29 @@ -5650,6 +5801,11 @@ function $antiDebugger() { } } +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ /** * 这是清理copy的函数,目的是为了能够让用户进行复制 * @date 2021-03-02 @@ -5909,11 +6065,10 @@ var iframe = [ "ondeviceorientationabsolute" ]; -/* - * @Author: KonghaYao - * @Date: 2021-06-29 16:16:08 - * @Last Modified by: KonghaYao - * @Last Modified time: 2021-06-29 16:16:08 +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 */ // iframe 是所有的 window 对象下稳定的属性名 // !若是使用 iframe 标签的属性来得到 window 的自带属性,遇到不能使用 iframe 的网站就会失效 @@ -5931,11 +6086,10 @@ function $GlobalVars() { return pick(window, diff); } -/* - * @Author: KonghaYao - * @Date: 2021-06-29 16:16:22 - * @Last Modified by: KonghaYao - * @Last Modified time: 2021-06-29 16:16:22 +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 */ const TypeMap = { @@ -5998,11 +6152,10 @@ function searchObj(arr, RE, keepUnknown = false) { }, []); } -/* - * @Author: KonghaYao - * @Date: 2021-06-29 16:16:19 - * @Last Modified by: KonghaYao - * @Last Modified time: 2021-06-29 16:16:19 +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 */ /** * 描述 @@ -6025,6 +6178,11 @@ function $search(obj, reg) { throw new Error('不是对象,不能搜索'); } +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ var excelTemplate = { 'data|100': [ { @@ -6038,6 +6196,11 @@ var excelTemplate = { ], }; +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ // 在这里配置 url 和 type 信息 const Server = { excel: { @@ -6047,6 +6210,12 @@ const Server = { }, }; +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ + async function Mock(MockSiteName) { // 导入 Mockjs if (!window.Mock) { @@ -6060,6 +6229,12 @@ async function Mock(MockSiteName) { } const $Mock = memoize(Mock); +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ + var tools = /*#__PURE__*/Object.freeze({ __proto__: null, $antiDebugger: $antiDebugger, @@ -6070,13 +6245,18 @@ var tools = /*#__PURE__*/Object.freeze({ $Mock: $Mock }); +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ var index = Object.assign(Spider, tools, { plugins, Plugin, Task, TaskGroup, version: "3.1.8", - buildDate: new Date(1626696870961), + buildDate: new Date(1626743574108), }); export default index; diff --git a/dist/JSpider.min.js b/dist/JSpider.min.js index 948a5db..4e43c95 100644 --- a/dist/JSpider.min.js +++ b/dist/JSpider.min.js @@ -3715,6 +3715,12 @@ var JSpider = (function () { return object == null ? {} : basePick(object, paths); }); + /** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ + class EventHub { all = new Map(); constructor(eventMap = {}, bindThis = null) { @@ -3777,6 +3783,11 @@ var JSpider = (function () { }; } + /** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ const staticEvent$2 = {}; // Unique ID creation requires a high quality random # generator. In the browser we therefore @@ -4044,17 +4055,21 @@ var JSpider = (function () { var v5 = v35('v5', 0x50, sha1); - /* - * @Author: KonghaYao - * @Date: 2021-06-28 21:07:01 - * @Last Modified by: KonghaYao - * @Last Modified time: 2021-06-28 21:07:01 + /** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 */ function createUUID(string) { return v5(string, v5.URL); } + /** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ /** * 函数用途描述 * 这个是用于 async 函数队列 连续执行的函数,只要 enQueue 之后就会连续执行,直至停止 @@ -4071,6 +4086,11 @@ var JSpider = (function () { } } + /** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ // Pipeline 是组合 Plugin 实例的工具类,用于创建一个可以不断提供 source 进行固定操作的功能对象。 class Pipeline { constructor(Plugins) { @@ -4100,6 +4120,11 @@ var JSpider = (function () { } } + /** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ // 每个 Task 拥有的静态事件 // 这些事件一般通过 $commit(eventName,payload) 进行执行 // ! this 被绑定为 Task 的实例 @@ -4132,6 +4157,12 @@ var JSpider = (function () { }, }; + /** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ + // 装载信息的最小单元 // ! 需要进行 backup 的属性都放置在 Super 里面 @@ -4176,6 +4207,12 @@ var JSpider = (function () { } } + /** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ + // 这个 Task 是模板类,如果需要进行业务功能的实现,必须先继承它,然后 super 相应的东西 class Task extends Data { _belongTo = null; // 当有 TaskGroup 时,指向 Group @@ -4216,6 +4253,11 @@ var JSpider = (function () { } } + /** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ class TaskGroup extends Task { constructor(TaskArray, _spiderUUID = '00000') { const output = new Set(TaskArray); @@ -4254,6 +4296,12 @@ var JSpider = (function () { } } + /** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ + var staticEvent = { // ! 即使这些函数不会被使用,也必须使用注释的方式写下 stateChange(state) { @@ -4280,6 +4328,12 @@ var JSpider = (function () { 'Task:complete'() {}, }; + /** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ + function createTaskViewModel(task) { // TODO 建立 Proxy 对象提供监控 return new Proxy(task, {}); @@ -4308,6 +4362,21 @@ var JSpider = (function () { } } + /** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ + + /** + * pauseToggle + * @date 2021-07-20 + * @author KonghaYao + * @description 用于暂停的 operator, 改编自 bufferToggle 但也不同 + * @param {Observable} openings 发出时触发主流缓存 + * @param {Observable} closings 发出时放出缓存到主流 + * @return {function} + */ function pauseToggle(openings, closings) { return (observable) => new Observable((subscriber) => { @@ -4342,6 +4411,12 @@ var JSpider = (function () { }); } + /** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ + // ControlPanel 是 JSpider 内部的事件和数据中心。 // 全部 JSpider 涉及到的边界中,ControlPanel 只有一个,但是 View 可以有多个,而 Spider 就是 View 中的一个 // 用于分发数据流,提供 Task 的状态变更。 @@ -4413,13 +4488,18 @@ var JSpider = (function () { } } + /** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ + var ControlPanel = new ControlPanel$1(); - /* - * @Author: KonghaYao - * @Date: 2021-07-13 15:33:08 - * @Last Modified by: KonghaYao - * @Last Modified time: 2021-07-19 16:34:32 + /** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 */ // TODO 未完成接口的接入 @@ -5048,7 +5128,11 @@ var JSpider = (function () { return TapSubscriber; }(Subscriber)); - // 在 JSpider 系统中的流发生了错误 + /** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ // Plugin main 函数发生了错误 class PluginError extends Error { @@ -5066,11 +5150,10 @@ var JSpider = (function () { } } - /* - * @Author: KonghaYao - * @Date: 2021-06-28 21:06:34 - * @Last Modified by: KonghaYao - * @Last Modified time: 2021-07-16 20:24:50 + /** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 */ class PLUGIN { @@ -5159,11 +5242,10 @@ var JSpider = (function () { throw new PluginError('Plugin 必须是一个函数或者是 Plugin 描述对象'); } - /* - * @Author: KonghaYao - * @Date: 2021-06-28 21:06:13 - * @Last Modified by: KonghaYao - * @Last Modified time: 2021-07-13 19:33:35 + /** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 */ // delay 可以是一个函数用于产生数字 @@ -5191,19 +5273,10 @@ var JSpider = (function () { ), ); - /* - * @Author: KonghaYao - * @Date: 2021-06-28 21:06:08 - * @Last Modified by: KonghaYao - * @Last Modified time: 2021-07-16 10:11:11 - */ - /** - * 并发控制操作符 - * @date 2021-06-28 - * @param {any} promiseFunc - * @param {any} options - * @return {any} + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 */ function concurrent( @@ -5247,7 +5320,11 @@ var JSpider = (function () { ); } - /* eslint-disable no-invalid-this */ + /** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ // ! 这个 Request 文件是标准的 Plugin 的高级注册示例 @@ -5340,6 +5417,12 @@ var JSpider = (function () { }); } + /** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ + function toFile(data, name) { if (data instanceof File) return data; if (data instanceof Blob) { @@ -5350,6 +5433,11 @@ var JSpider = (function () { return new File([JSON.stringify(data)], name); } + /** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ // 在 浏览器中下载是不能够同时进行的,也就是说,如果前面的没有下载完,后面的又提交 // 会导致后面的全部失效,所以设置 Promise 下载队列 const DownloadQueue = { @@ -5381,6 +5469,11 @@ var JSpider = (function () { }); }; + /** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ const loaderFunction = { script(url) { return new Promise((resolve, reject) => { @@ -5412,6 +5505,11 @@ var JSpider = (function () { // TODO UMD AMD 等类型的 JS 代码的载入 }; + /** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ var scriptMap = { zangodb: 'https://cdn.jsdelivr.net/gh/erikolson186/zangodb/dist/zangodb.min.js', dexie: 'https://cdn.jsdelivr.net/npm/dexie@3.0.3/dist/dexie.min.js', @@ -5433,6 +5531,11 @@ var JSpider = (function () { ], }; + /** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ // 借助 jsdelivr 网站的免费 cdn 实现直接查询导入插件的功能。 const URI = 'https://cdn.jsdelivr.net'; const wayMap = Object.entries({ @@ -5453,18 +5556,21 @@ var JSpider = (function () { return `${URI}/${way}/${moduleName}${version ? `@${version}` : ''}${path ? `/${path}` : ''}`; } - /* - * @Author: KonghaYao - * @Date: 2021-06-28 21:06:20 - * @Last Modified by: KonghaYao - * @Last Modified time: 2021-06-28 21:06:20 + /** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 */ function type(any) { return Object.prototype.toString.call(any).match(/(?<=\[object\s+)\S+?(?=\])/)[0]; } - // 使用下面的 名称可以直接导入相应的包 + /** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ const URLTest = /(https?|ftp|file):\/\/[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]/; @@ -5510,6 +5616,12 @@ var JSpider = (function () { return handle[type(Module)](Module); } + /** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ + let XLSX; function init$1() { return $load('xlsx').then(() => { @@ -5517,6 +5629,11 @@ var JSpider = (function () { }); } + /** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ // XLSX 通过 script 导入 function ArrayToSheet(sheetArray) { sheetArray.forEach((i) => { @@ -5553,6 +5670,11 @@ var JSpider = (function () { }); } + /** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ // 未完成 导入 XLSX 的 Promise 到流的转变 // ExcelHelper 是将 Object => Book => File 用于下载的一个库 @@ -5568,6 +5690,12 @@ var JSpider = (function () { }); }; + /** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ + let JSZip; function init() { return $load('jszip').then(() => { @@ -5575,6 +5703,12 @@ var JSpider = (function () { }); } + /** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ + let index$1 = 0; async function zipper(fileArray, zipName) { // 启动压缩 @@ -5590,6 +5724,12 @@ var JSpider = (function () { return content; } + /** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ + const ZipFile = function (options = {}) { if (!options.zipFileName) options.zipFileName = new Date().getTime(); return Plugin({ @@ -5619,6 +5759,12 @@ var JSpider = (function () { }); }; + /** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ + var plugins = /*#__PURE__*/Object.freeze({ __proto__: null, Request: Request, @@ -5627,6 +5773,11 @@ var JSpider = (function () { ZipFile: ZipFile }); + /** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ /* * @Author: KonghaYao * @Date: 2021-06-29 16:16:29 @@ -5653,6 +5804,11 @@ var JSpider = (function () { } } + /** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ /** * 这是清理copy的函数,目的是为了能够让用户进行复制 * @date 2021-03-02 @@ -5912,11 +6068,10 @@ var JSpider = (function () { "ondeviceorientationabsolute" ]; - /* - * @Author: KonghaYao - * @Date: 2021-06-29 16:16:08 - * @Last Modified by: KonghaYao - * @Last Modified time: 2021-06-29 16:16:08 + /** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 */ // iframe 是所有的 window 对象下稳定的属性名 // !若是使用 iframe 标签的属性来得到 window 的自带属性,遇到不能使用 iframe 的网站就会失效 @@ -5934,11 +6089,10 @@ var JSpider = (function () { return pick(window, diff); } - /* - * @Author: KonghaYao - * @Date: 2021-06-29 16:16:22 - * @Last Modified by: KonghaYao - * @Last Modified time: 2021-06-29 16:16:22 + /** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 */ const TypeMap = { @@ -6001,11 +6155,10 @@ var JSpider = (function () { }, []); } - /* - * @Author: KonghaYao - * @Date: 2021-06-29 16:16:19 - * @Last Modified by: KonghaYao - * @Last Modified time: 2021-06-29 16:16:19 + /** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 */ /** * 描述 @@ -6028,6 +6181,11 @@ var JSpider = (function () { throw new Error('不是对象,不能搜索'); } + /** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ var excelTemplate = { 'data|100': [ { @@ -6041,6 +6199,11 @@ var JSpider = (function () { ], }; + /** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ // 在这里配置 url 和 type 信息 const Server = { excel: { @@ -6050,6 +6213,12 @@ var JSpider = (function () { }, }; + /** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ + async function Mock(MockSiteName) { // 导入 Mockjs if (!window.Mock) { @@ -6063,6 +6232,12 @@ var JSpider = (function () { } const $Mock = memoize(Mock); + /** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ + var tools = /*#__PURE__*/Object.freeze({ __proto__: null, $antiDebugger: $antiDebugger, @@ -6073,13 +6248,18 @@ var JSpider = (function () { $Mock: $Mock }); + /** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ var index = Object.assign(Spider, tools, { plugins, Plugin, Task, TaskGroup, version: "3.1.8", - buildDate: new Date(1626696870961), + buildDate: new Date(1626743574108), }); return index; diff --git a/src/ControlPanel/ControlPanel.js b/src/ControlPanel/ControlPanel.js index 3ba740d..b7eaa1a 100644 --- a/src/ControlPanel/ControlPanel.js +++ b/src/ControlPanel/ControlPanel.js @@ -1,3 +1,8 @@ +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ import staticEvent from './StaticEvent'; import { TaskManager } from './TaskManager'; import { functionQueue } from '../utils/functionQueue'; diff --git a/src/ControlPanel/Mirror.js b/src/ControlPanel/Mirror.js index c92320b..c3a3ccb 100644 --- a/src/ControlPanel/Mirror.js +++ b/src/ControlPanel/Mirror.js @@ -1,3 +1,8 @@ +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ // ! Mirror 是 ControlPanel 的 ViewModel // ! 继承 Mirror 可以实现一个 User Interface // export default class Mirror { diff --git a/src/ControlPanel/StaticEvent.js b/src/ControlPanel/StaticEvent.js index b53e4c2..1299651 100644 --- a/src/ControlPanel/StaticEvent.js +++ b/src/ControlPanel/StaticEvent.js @@ -1,3 +1,8 @@ +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ import { TaskGroup } from '../TaskSystem/TaskGroup'; export default { diff --git a/src/ControlPanel/TaskManager.js b/src/ControlPanel/TaskManager.js index 5353b46..e3931bb 100644 --- a/src/ControlPanel/TaskManager.js +++ b/src/ControlPanel/TaskManager.js @@ -1,3 +1,8 @@ +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ import { Task } from '../TaskSystem/Task'; function createTaskViewModel(task) { diff --git a/src/ControlPanel/index.js b/src/ControlPanel/index.js index 776bb0f..9f339b2 100644 --- a/src/ControlPanel/index.js +++ b/src/ControlPanel/index.js @@ -1,3 +1,8 @@ +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ import { ControlPanel } from './ControlPanel'; export default new ControlPanel(); diff --git a/src/Errors/errors.js b/src/Errors/errors.js index 35bea27..e52b9ed 100644 --- a/src/Errors/errors.js +++ b/src/Errors/errors.js @@ -1,3 +1,8 @@ +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ // 在 JSpider 系统中的流发生了错误 export class FlowError extends Error { constructor(message) { diff --git a/src/Memory/index.js b/src/Memory/index.js index b09274b..8e5bf39 100644 --- a/src/Memory/index.js +++ b/src/Memory/index.js @@ -1,3 +1,8 @@ +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ export class Memory { constructor() {} save() {} diff --git a/src/Pipeline/PluginSystem.js b/src/Pipeline/PluginSystem.js index 72f4d01..c028932 100644 --- a/src/Pipeline/PluginSystem.js +++ b/src/Pipeline/PluginSystem.js @@ -1,3 +1,8 @@ +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ /* * @Author: KonghaYao * @Date: 2021-06-28 21:06:34 diff --git a/src/Pipeline/index.js b/src/Pipeline/index.js index 8768d66..2919c43 100644 --- a/src/Pipeline/index.js +++ b/src/Pipeline/index.js @@ -1,3 +1,8 @@ +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ import { pipe } from 'rxjs'; import { createUUID } from '../utils/createUUID'; import { functionQueue } from '../utils/functionQueue'; diff --git a/src/Spider/index.js b/src/Spider/index.js index 4e75433..4fa470d 100644 --- a/src/Spider/index.js +++ b/src/Spider/index.js @@ -1,3 +1,8 @@ +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ /* * @Author: KonghaYao * @Date: 2021-07-13 15:33:08 diff --git a/src/Spider/staticEvent.js b/src/Spider/staticEvent.js index a228736..28d95dd 100644 --- a/src/Spider/staticEvent.js +++ b/src/Spider/staticEvent.js @@ -1 +1,6 @@ +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ export const staticEvent = {}; diff --git a/src/TaskSystem/Data.js b/src/TaskSystem/Data.js index 35794cc..2dfe078 100644 --- a/src/TaskSystem/Data.js +++ b/src/TaskSystem/Data.js @@ -1,3 +1,8 @@ +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ import { v4 as uuidv4 } from 'uuid'; import { pick } from 'lodash-es'; diff --git a/src/TaskSystem/StaticEvent.js b/src/TaskSystem/StaticEvent.js index afe81f2..e5ebbbc 100644 --- a/src/TaskSystem/StaticEvent.js +++ b/src/TaskSystem/StaticEvent.js @@ -1,3 +1,8 @@ +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ // 每个 Task 拥有的静态事件 // 这些事件一般通过 $commit(eventName,payload) 进行执行 // ! this 被绑定为 Task 的实例 diff --git a/src/TaskSystem/Task.js b/src/TaskSystem/Task.js index a1cc0c9..e4ab1d5 100644 --- a/src/TaskSystem/Task.js +++ b/src/TaskSystem/Task.js @@ -1,3 +1,8 @@ +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ import { EventHub } from '../utils/EventHub'; import { staticEvent } from './StaticEvent'; import { Data } from './Data'; // 属性信息归属于 Data diff --git a/src/TaskSystem/TaskGroup.js b/src/TaskSystem/TaskGroup.js index 29c9911..2cba1e9 100644 --- a/src/TaskSystem/TaskGroup.js +++ b/src/TaskSystem/TaskGroup.js @@ -1,3 +1,8 @@ +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ import { Task } from './Task'; export class TaskGroup extends Task { constructor(TaskArray, _spiderUUID = '00000') { diff --git a/src/TaskSystem/index.js b/src/TaskSystem/index.js index 8da92cf..2a2bf4b 100644 --- a/src/TaskSystem/index.js +++ b/src/TaskSystem/index.js @@ -1,2 +1,7 @@ +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ export { Task } from './Task'; export { TaskGroup } from './TaskGroup'; diff --git a/src/index.js b/src/index.js index 7d834f8..f3b6b2a 100644 --- a/src/index.js +++ b/src/index.js @@ -1,3 +1,8 @@ +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ import { Spider } from './Spider/index'; import * as plugins from './plugins/index.js'; import * as tools from './tools/index.js'; // 工具都是 $ 开头的函数 diff --git a/src/plugins/Dexie.js b/src/plugins/Dexie.js index cdc886b..7479eb0 100644 --- a/src/plugins/Dexie.js +++ b/src/plugins/Dexie.js @@ -1,3 +1,8 @@ +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ import { from } from 'rxjs'; import { delayWhen } from 'rxjs/operators'; import { init } from './Dexie/Dexie.js'; diff --git a/src/plugins/Dexie/Dexie.js b/src/plugins/Dexie/Dexie.js index b71b099..ada2528 100644 --- a/src/plugins/Dexie/Dexie.js +++ b/src/plugins/Dexie/Dexie.js @@ -1,3 +1,8 @@ +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ import { $load } from '../../tools/loader/loader.js'; let Dexie; diff --git a/src/plugins/Dexie/data.js b/src/plugins/Dexie/data.js index 6fe6371..ca448d3 100644 --- a/src/plugins/Dexie/data.js +++ b/src/plugins/Dexie/data.js @@ -1,3 +1,8 @@ +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ import { Dexie } from './Dexie.js'; const dbCache = {}; diff --git a/src/plugins/Download.js b/src/plugins/Download.js index 6ec4438..0db0343 100644 --- a/src/plugins/Download.js +++ b/src/plugins/Download.js @@ -1,3 +1,8 @@ +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ import { toFile } from './utils/toFile.js'; import { Plugin } from '../Pipeline/PluginSystem.js'; diff --git a/src/plugins/ExcelHelper.js b/src/plugins/ExcelHelper.js index 0089b14..90f3cd3 100644 --- a/src/plugins/ExcelHelper.js +++ b/src/plugins/ExcelHelper.js @@ -1,3 +1,8 @@ +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ import { createExcelFile } from './ExcelHelper/createExcelFile.js'; import { Plugin } from '../Pipeline/PluginSystem.js'; import { init } from './ExcelHelper/xlsx.js'; diff --git a/src/plugins/ExcelHelper/createExcelFile.js b/src/plugins/ExcelHelper/createExcelFile.js index 0d76192..cbbe792 100644 --- a/src/plugins/ExcelHelper/createExcelFile.js +++ b/src/plugins/ExcelHelper/createExcelFile.js @@ -1,3 +1,8 @@ +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ import { XLSX } from './xlsx.js'; // XLSX 通过 script 导入 function ArrayToSheet(sheetArray) { diff --git a/src/plugins/ExcelHelper/xlsx.js b/src/plugins/ExcelHelper/xlsx.js index ef5949f..521e79a 100644 --- a/src/plugins/ExcelHelper/xlsx.js +++ b/src/plugins/ExcelHelper/xlsx.js @@ -1,3 +1,8 @@ +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ import { $load } from '../../tools/loader/loader.js'; let XLSX; diff --git a/src/plugins/HTMLParser.js b/src/plugins/HTMLParser.js index 9b39c11..deccd19 100644 --- a/src/plugins/HTMLParser.js +++ b/src/plugins/HTMLParser.js @@ -1,3 +1,8 @@ +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ // 尚未进行测试 import { Plugin } from '../core/PluginSystem'; diff --git a/src/plugins/JSzip/JSzip.js b/src/plugins/JSzip/JSzip.js index d041798..9282ad3 100644 --- a/src/plugins/JSzip/JSzip.js +++ b/src/plugins/JSzip/JSzip.js @@ -1,3 +1,8 @@ +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ import { $load } from '../../tools/loader/loader.js'; let JSZip; diff --git a/src/plugins/JSzip/zipper.js b/src/plugins/JSzip/zipper.js index 53e54f2..4b28675 100644 --- a/src/plugins/JSzip/zipper.js +++ b/src/plugins/JSzip/zipper.js @@ -1,3 +1,8 @@ +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ import { JSZip } from './JSzip.js'; let index = 0; diff --git a/src/plugins/Request.js b/src/plugins/Request.js index a7fe540..b9c270d 100644 --- a/src/plugins/Request.js +++ b/src/plugins/Request.js @@ -1,3 +1,8 @@ +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ /* eslint-disable no-invalid-this */ import { Plugin } from '../Pipeline/PluginSystem.js'; diff --git a/src/plugins/index.js b/src/plugins/index.js index 5960991..288e4ef 100644 --- a/src/plugins/index.js +++ b/src/plugins/index.js @@ -1,3 +1,8 @@ +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ export * from './Request.js'; export * from './Download.js'; export * from './ExcelHelper.js'; diff --git a/src/plugins/utils/cartesianProductOf.js b/src/plugins/utils/cartesianProductOf.js index e390e90..6e3fc60 100644 --- a/src/plugins/utils/cartesianProductOf.js +++ b/src/plugins/utils/cartesianProductOf.js @@ -1,3 +1,8 @@ +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ // 数组的笛卡尔积结果 export function cartesianProductOf(...args) { return args.reduce( diff --git a/src/plugins/utils/toFile.js b/src/plugins/utils/toFile.js index 6aa4f9b..1cd8590 100644 --- a/src/plugins/utils/toFile.js +++ b/src/plugins/utils/toFile.js @@ -1,3 +1,9 @@ +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ + export function toFile(data, name) { if (data instanceof File) return data; if (data instanceof Blob) { diff --git a/src/plugins/zipFile.js b/src/plugins/zipFile.js index ceaf22b..ecef75c 100644 --- a/src/plugins/zipFile.js +++ b/src/plugins/zipFile.js @@ -1,3 +1,8 @@ +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ import { bufferTime, concatMap, filter } from 'rxjs/operators'; import { Plugin } from '../Pipeline/PluginSystem.js'; diff --git a/src/tools/Mock/Mock.js b/src/tools/Mock/Mock.js index 959f29d..c1d32cf 100644 --- a/src/tools/Mock/Mock.js +++ b/src/tools/Mock/Mock.js @@ -1,3 +1,8 @@ +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ import { Server } from './Server/index.js'; import { $load } from '../loader/loader.js'; diff --git a/src/tools/Mock/Server/excel.js b/src/tools/Mock/Server/excel.js index 8699d1f..fbc35c4 100644 --- a/src/tools/Mock/Server/excel.js +++ b/src/tools/Mock/Server/excel.js @@ -1,3 +1,8 @@ +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ export default { 'data|100': [ { diff --git a/src/tools/Mock/Server/index.js b/src/tools/Mock/Server/index.js index e7f7d67..5f99236 100644 --- a/src/tools/Mock/Server/index.js +++ b/src/tools/Mock/Server/index.js @@ -1,3 +1,8 @@ +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ import excelTemplate from './excel.js'; // 在这里配置 url 和 type 信息 const Server = { diff --git a/src/tools/UI/index.js b/src/tools/UI/index.js index ca13103..8d1fee0 100644 --- a/src/tools/UI/index.js +++ b/src/tools/UI/index.js @@ -1,3 +1,8 @@ +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ import { v4 as uuid } from 'uuid'; // 这个是用于组织爬虫 UI 界面的一个部分 diff --git a/src/tools/analysis/Observer/hook.js b/src/tools/analysis/Observer/hook.js index 89ae575..7cb5392 100644 --- a/src/tools/analysis/Observer/hook.js +++ b/src/tools/analysis/Observer/hook.js @@ -1,3 +1,8 @@ +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ /** * hook 主函数 * @description 通过 hook 函数 监控一个函数的触发 diff --git a/src/tools/analysis/Observer/hook/asyncApply.js b/src/tools/analysis/Observer/hook/asyncApply.js index dbc0410..faae81c 100644 --- a/src/tools/analysis/Observer/hook/asyncApply.js +++ b/src/tools/analysis/Observer/hook/asyncApply.js @@ -1,3 +1,8 @@ +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ /** * 异步函数代理 apply * @date 2020-09-17 diff --git a/src/tools/analysis/Observer/hook/createProperty.js b/src/tools/analysis/Observer/hook/createProperty.js index fd4bf0a..c4b6635 100644 --- a/src/tools/analysis/Observer/hook/createProperty.js +++ b/src/tools/analysis/Observer/hook/createProperty.js @@ -1,3 +1,8 @@ +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ /* eslint-disable no-invalid-this */ // 私有属性的调用值 diff --git a/src/tools/analysis/Observer/hook/syncApply.js b/src/tools/analysis/Observer/hook/syncApply.js index bb9b032..f35112a 100644 --- a/src/tools/analysis/Observer/hook/syncApply.js +++ b/src/tools/analysis/Observer/hook/syncApply.js @@ -1,3 +1,8 @@ +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ /** * 非异步函数代理 apply * @date 2020-09-17 diff --git a/src/tools/analysis/Observer/watch.js b/src/tools/analysis/Observer/watch.js index 5f07fdc..1df421e 100644 --- a/src/tools/analysis/Observer/watch.js +++ b/src/tools/analysis/Observer/watch.js @@ -1,3 +1,8 @@ +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ /* eslint-disable no-invalid-this */ const handle = { get, set }; const DEFAULT = (key, value) => value; diff --git a/src/tools/analysis/Search/GlobalVars.js b/src/tools/analysis/Search/GlobalVars.js index 293d936..07c9ee9 100644 --- a/src/tools/analysis/Search/GlobalVars.js +++ b/src/tools/analysis/Search/GlobalVars.js @@ -1,3 +1,8 @@ +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ /* * @Author: KonghaYao * @Date: 2021-06-29 16:16:08 diff --git a/src/tools/analysis/Search/Search.js b/src/tools/analysis/Search/Search.js index df4c460..b159695 100644 --- a/src/tools/analysis/Search/Search.js +++ b/src/tools/analysis/Search/Search.js @@ -1,3 +1,8 @@ +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ /* * @Author: KonghaYao * @Date: 2021-06-29 16:16:19 diff --git a/src/tools/analysis/Search/searchObj.js b/src/tools/analysis/Search/searchObj.js index 699ae16..f290fa4 100644 --- a/src/tools/analysis/Search/searchObj.js +++ b/src/tools/analysis/Search/searchObj.js @@ -1,3 +1,8 @@ +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ /* * @Author: KonghaYao * @Date: 2021-06-29 16:16:22 diff --git a/src/tools/analysis/antiDebugger.js b/src/tools/analysis/antiDebugger.js index 7943d27..e88a005 100644 --- a/src/tools/analysis/antiDebugger.js +++ b/src/tools/analysis/antiDebugger.js @@ -1,3 +1,8 @@ +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ /* * @Author: KonghaYao * @Date: 2021-06-29 16:16:29 diff --git a/src/tools/analysis/copy.js b/src/tools/analysis/copy.js index f01de6c..7f13c4e 100644 --- a/src/tools/analysis/copy.js +++ b/src/tools/analysis/copy.js @@ -1,3 +1,8 @@ +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ /** * 这是清理copy的函数,目的是为了能够让用户进行复制 * @date 2021-03-02 diff --git a/src/tools/analysis/index.js b/src/tools/analysis/index.js index 2c67858..69451ad 100644 --- a/src/tools/analysis/index.js +++ b/src/tools/analysis/index.js @@ -1,3 +1,8 @@ +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ export * from './antiDebugger.js'; export * from './copy.js'; export * from './Search/GlobalVars.js'; diff --git a/src/tools/index.js b/src/tools/index.js index d8be29f..2d3c0b6 100644 --- a/src/tools/index.js +++ b/src/tools/index.js @@ -1,3 +1,8 @@ +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ export * from './analysis/index.js'; export * from './loader/loader.js'; export * from './Mock/Mock.js'; diff --git a/src/tools/loader/jsDelivr.js b/src/tools/loader/jsDelivr.js index 254397e..0e57230 100644 --- a/src/tools/loader/jsDelivr.js +++ b/src/tools/loader/jsDelivr.js @@ -1,3 +1,8 @@ +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ // 借助 jsdelivr 网站的免费 cdn 实现直接查询导入插件的功能。 const URI = 'https://cdn.jsdelivr.net'; const wayMap = Object.entries({ diff --git a/src/tools/loader/loader.js b/src/tools/loader/loader.js index 517e0a5..d534f45 100644 --- a/src/tools/loader/loader.js +++ b/src/tools/loader/loader.js @@ -1,3 +1,8 @@ +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ // 使用下面的 名称可以直接导入相应的包 // 同时,如果需要导入其他数据的时候也可以使用 import { loaderFunction } from './loaderFunction.js'; diff --git a/src/tools/loader/loaderFunction.js b/src/tools/loader/loaderFunction.js index bcfb69f..151e6d3 100644 --- a/src/tools/loader/loaderFunction.js +++ b/src/tools/loader/loaderFunction.js @@ -1,3 +1,8 @@ +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ const loaderFunction = { script(url) { return new Promise((resolve, reject) => { diff --git a/src/tools/loader/scriptStore.js b/src/tools/loader/scriptStore.js index e32209d..0b3480b 100644 --- a/src/tools/loader/scriptStore.js +++ b/src/tools/loader/scriptStore.js @@ -1,3 +1,8 @@ +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ export default { zangodb: 'https://cdn.jsdelivr.net/gh/erikolson186/zangodb/dist/zangodb.min.js', dexie: 'https://cdn.jsdelivr.net/npm/dexie@3.0.3/dist/dexie.min.js', diff --git a/src/utils/EventHub.js b/src/utils/EventHub.js index 85e6282..01b0457 100644 --- a/src/utils/EventHub.js +++ b/src/utils/EventHub.js @@ -1,3 +1,8 @@ +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ import { fromEventPattern } from 'rxjs'; import { memoize } from 'lodash-es'; diff --git a/src/utils/concurrent.js b/src/utils/concurrent.js index 4acd4b3..e83e61c 100644 --- a/src/utils/concurrent.js +++ b/src/utils/concurrent.js @@ -1,3 +1,8 @@ +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ import { pipe, of, EMPTY, timer, from } from 'rxjs'; import { concatMap, catchError, delayWhen, mergeMap, bufferTime, filter } from 'rxjs/operators'; import { retryAndDelay } from './retryAndDelay.js'; diff --git a/src/utils/createUUID.js b/src/utils/createUUID.js index a307534..807b883 100644 --- a/src/utils/createUUID.js +++ b/src/utils/createUUID.js @@ -1,3 +1,8 @@ +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ import { v5 } from 'uuid'; export function createUUID(string) { diff --git a/src/utils/functionQueue.js b/src/utils/functionQueue.js index 4951d88..d2648f8 100644 --- a/src/utils/functionQueue.js +++ b/src/utils/functionQueue.js @@ -1,3 +1,8 @@ +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ /** * 函数用途描述 * 这个是用于 async 函数队列 连续执行的函数,只要 enQueue 之后就会连续执行,直至停止 diff --git a/src/utils/pauseToggle.js b/src/utils/pauseToggle.js index 6b01b2f..cdcfad6 100644 --- a/src/utils/pauseToggle.js +++ b/src/utils/pauseToggle.js @@ -1,3 +1,8 @@ +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ import { noop, Observable } from 'rxjs'; /** diff --git a/src/utils/retryAndDelay.js b/src/utils/retryAndDelay.js index 59a3375..b7a93a3 100644 --- a/src/utils/retryAndDelay.js +++ b/src/utils/retryAndDelay.js @@ -1,3 +1,8 @@ +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ import { pipe, timer } from 'rxjs'; import { delayWhen, scan, retryWhen } from 'rxjs/operators'; import { RetryError } from '../Errors/errors'; diff --git a/src/utils/type.js b/src/utils/type.js index 8b1318a..0564861 100644 --- a/src/utils/type.js +++ b/src/utils/type.js @@ -1,3 +1,9 @@ +/** + * @license + * Copyright 2021 KonghaYao 江夏尧 + * SPDX-License-Identifier: Apache-2.0 + */ + function type(any) { return Object.prototype.toString.call(any).match(/(?<=\[object\s+)\S+?(?=\])/)[0]; }