new path separator for gun rpc
This commit is contained in:
parent
7a24dbeed2
commit
92b745a9a7
3 changed files with 4 additions and 4 deletions
|
|
@ -105,7 +105,7 @@ async function deepEncryptIfNeeded(value) {
|
||||||
* @returns {Promise<void>}
|
* @returns {Promise<void>}
|
||||||
*/
|
*/
|
||||||
const put = async (rawPath, value) => {
|
const put = async (rawPath, value) => {
|
||||||
const [root, ...path] = rawPath.split('.')
|
const [root, ...path] = rawPath.split('>')
|
||||||
|
|
||||||
const node = (() => {
|
const node = (() => {
|
||||||
// eslint-disable-next-line init-declarations
|
// eslint-disable-next-line init-declarations
|
||||||
|
|
@ -166,7 +166,7 @@ const put = async (rawPath, value) => {
|
||||||
*/
|
*/
|
||||||
// eslint-disable-next-line func-style
|
// eslint-disable-next-line func-style
|
||||||
async function set(rawPath, value) {
|
async function set(rawPath, value) {
|
||||||
const [root, ...path] = rawPath.split('.')
|
const [root, ...path] = rawPath.split('>')
|
||||||
|
|
||||||
const node = (() => {
|
const node = (() => {
|
||||||
// eslint-disable-next-line init-declarations
|
// eslint-disable-next-line init-declarations
|
||||||
|
|
|
||||||
|
|
@ -3041,7 +3041,7 @@ module.exports = async (
|
||||||
publicKey,
|
publicKey,
|
||||||
publicKeyForDecryption
|
publicKeyForDecryption
|
||||||
}) => {
|
}) => {
|
||||||
const keys = path.split('.')
|
const keys = path.split('>')
|
||||||
const { tryAndWait } = require('../services/gunDB/contact-api/utils')
|
const { tryAndWait } = require('../services/gunDB/contact-api/utils')
|
||||||
return tryAndWait((gun, user) => {
|
return tryAndWait((gun, user) => {
|
||||||
// eslint-disable-next-line no-nested-ternary
|
// eslint-disable-next-line no-nested-ternary
|
||||||
|
|
|
||||||
|
|
@ -308,7 +308,7 @@ module.exports = (
|
||||||
node = getGun().user(root)
|
node = getGun().user(root)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const bit of path.split('.')) {
|
for (const bit of path.split('>')) {
|
||||||
node = node.get(bit)
|
node = node.get(bit)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue