有什么方法可以判断当前加载了哪些 PouchDB 插件?

Is there any way to tell which PouchDB plugins are currently loaded?

标题几乎说明了一切。

有什么方法可以获取已加载 PouchDB 插件的列表吗?或者失败了,有什么方法可以检查是否加载了特定的插件?

Pouchdb 只是在其原型中添加了插件,所以如果您不介意看到一些内置插件:

> location.href
"http://nolanlawson.github.io/pouchdb-find/"

> Object.getOwnPropertyNames(PouchDB.prototype)
Array[11]
0: "constructor"
1: "query"
2: "viewCleanup"
3: "replicate"
4: "sync"
5: "upsert"
6: "putIfNotExists"
7: "createIndex"
8: "find"
9: "getIndexes"
10: "deleteIndex"
length: 11
__proto__: Array[0]


> "find" in Object.getOwnPropertyNames(PouchDB.prototype)
true