Before Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 9.2 KiB |
Before Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 4.0 KiB |
Before Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 799 B |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 10 KiB |
@ -1 +0,0 @@ |
||||
{"name":"yd-web-tool","short_name":"yd-web-tool","theme_color":"#4DBA87","icons":[{"src":"./img/icons/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"./img/icons/android-chrome-512x512.png","sizes":"512x512","type":"image/png"},{"src":"./img/icons/android-chrome-maskable-192x192.png","sizes":"192x192","type":"image/png","purpose":"maskable"},{"src":"./img/icons/android-chrome-maskable-512x512.png","sizes":"512x512","type":"image/png","purpose":"maskable"}],"start_url":".","display":"standalone","background_color":"#000000"} |
@ -1,70 +0,0 @@ |
||||
self.__precacheManifest = (self.__precacheManifest || []).concat([ |
||||
{ |
||||
"revision": "c6913d775f2f965ac5f3", |
||||
"url": "css/about.b9bb4fe0.css" |
||||
}, |
||||
{ |
||||
"revision": "c7b3e35a4e0391b1ed37", |
||||
"url": "css/app.e4c919b7.css" |
||||
}, |
||||
{ |
||||
"revision": "9a65f05f9810a3ea7f46", |
||||
"url": "css/chunk-vendors.8a465a1d.css" |
||||
}, |
||||
{ |
||||
"revision": "5ab5c6be15b21e2d609b", |
||||
"url": "css/detail.e03dc50b.css" |
||||
}, |
||||
{ |
||||
"revision": "535877f50039c0cb49a6196a5b7517cd", |
||||
"url": "fonts/element-icons.535877f5.woff" |
||||
}, |
||||
{ |
||||
"revision": "732389ded34cb9c52dd88271f1345af9", |
||||
"url": "fonts/element-icons.732389de.ttf" |
||||
}, |
||||
{ |
||||
"revision": "f9a3fb0e145017e166dd4d91d9280cc4", |
||||
"url": "fonts/iconfont.f9a3fb0e.woff" |
||||
}, |
||||
{ |
||||
"revision": "f39ecc1a1d2a1eff3aca8aadd818bb61", |
||||
"url": "fonts/popfont.f39ecc1a.ttf" |
||||
}, |
||||
{ |
||||
"revision": "6c094b6d4ae9404dbed273c41b06fae8", |
||||
"url": "fonts/shelffont.6c094b6d.ttf" |
||||
}, |
||||
{ |
||||
"revision": "8a8424347500238b7b6c08a98d0f89af", |
||||
"url": "index.html" |
||||
}, |
||||
{ |
||||
"revision": "c6913d775f2f965ac5f3", |
||||
"url": "js/about.9f8f9ac0.js" |
||||
}, |
||||
{ |
||||
"revision": "5998ccb313ed338c15e1", |
||||
"url": "js/about~detail.8270a871.js" |
||||
}, |
||||
{ |
||||
"revision": "c7b3e35a4e0391b1ed37", |
||||
"url": "js/app.e84ee963.js" |
||||
}, |
||||
{ |
||||
"revision": "9a65f05f9810a3ea7f46", |
||||
"url": "js/chunk-vendors.3ef7796f.js" |
||||
}, |
||||
{ |
||||
"revision": "5ab5c6be15b21e2d609b", |
||||
"url": "js/detail.4e6a53a9.js" |
||||
}, |
||||
{ |
||||
"revision": "b46d04eb43bc31ca0f9f95121646440d", |
||||
"url": "manifest.json" |
||||
}, |
||||
{ |
||||
"revision": "b6216d61c03e6ce0c9aea6ca7808f7ca", |
||||
"url": "robots.txt" |
||||
} |
||||
]); |
@ -1,34 +0,0 @@ |
||||
/** |
||||
* Welcome to your Workbox-powered service worker! |
||||
* |
||||
* You'll need to register this file in your web app and you should |
||||
* disable HTTP caching for this file too. |
||||
* See https://goo.gl/nhQhGp
|
||||
* |
||||
* The rest of the code is auto-generated. Please don't update this file |
||||
* directly; instead, make changes to your Workbox build configuration |
||||
* and re-run your build process. |
||||
* See https://goo.gl/2aRDsh
|
||||
*/ |
||||
|
||||
importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js"); |
||||
|
||||
importScripts( |
||||
"precache-manifest.5ae9ceec57e7f0f3cc808807b7fe5f32.js" |
||||
); |
||||
|
||||
workbox.core.setCacheNameDetails({prefix: "yd-web-tool"}); |
||||
|
||||
self.addEventListener('message', (event) => { |
||||
if (event.data && event.data.type === 'SKIP_WAITING') { |
||||
self.skipWaiting(); |
||||
} |
||||
}); |
||||
|
||||
/** |
||||
* The workboxSW.precacheAndRoute() method efficiently caches and responds to |
||||
* requests for URLs in the manifest. |
||||
* See https://goo.gl/S9QRab
|
||||
*/ |
||||
self.__precacheManifest = [].concat(self.__precacheManifest || []); |
||||
workbox.precaching.precacheAndRoute(self.__precacheManifest, {}); |
@ -0,0 +1,41 @@ |
||||
package io.legado.app.utils |
||||
|
||||
import kotlin.reflect.KClass |
||||
import kotlin.reflect.full.memberProperties |
||||
import kotlin.reflect.full.primaryConstructor |
||||
|
||||
@Suppress("UNCHECKED_CAST") |
||||
fun <T : Any> T.deepCopy(): T { |
||||
//如果不是数据类,直接返回 |
||||
if (!this::class.isData) { |
||||
return this |
||||
} |
||||
|
||||
//拿到构造函数 |
||||
return this::class.primaryConstructor!!.let { primaryConstructor -> |
||||
//转换类型 |
||||
//memberProperties 返回非扩展属性中的第一个并将构造函数赋值给其 |
||||
//最终value=第一个参数类型的对象 |
||||
|
||||
//如果当前类(这里的当前类指的是参数对应的类型,比如说这里如果非基本类型时)是数据类 |
||||
|
||||
//最终返回一个新的映射map,即返回一个属性值重新组合的map,并调用callBy返回指定的对象 |
||||
primaryConstructor.parameters.associate { parameter -> |
||||
//转换类型 |
||||
//memberProperties 返回非扩展属性中的第一个并将构造函数赋值给其 |
||||
//最终value=第一个参数类型的对象 |
||||
val value = (this::class as KClass<T>).memberProperties.first { |
||||
it.name == parameter.name |
||||
}.get(this) |
||||
|
||||
//如果当前类(这里的当前类指的是参数对应的类型,比如说这里如果非基本类型时)是数据类 |
||||
if ((parameter.type.classifier as? KClass<*>)?.isData == true) { |
||||
parameter to value?.deepCopy() |
||||
} else { |
||||
parameter to value |
||||
} |
||||
|
||||
//最终返回一个新的映射map,即返回一个属性值重新组合的map,并调用callBy返回指定的对象 |
||||
}.let(primaryConstructor::callBy) |
||||
} |
||||
} |