Merge pull request #231 from shocknet/rpc-paths

new path separator for gun rpc
This commit is contained in:
Daniel Lugo 2020-10-25 11:07:46 -04:00 committed by GitHub
commit ddfbb2aeed
3 changed files with 4 additions and 4 deletions

View file

@ -105,7 +105,7 @@ async function deepEncryptIfNeeded(value) {
* @returns {Promise<void>}
*/
const put = async (rawPath, value) => {
const [root, ...path] = rawPath.split('.')
const [root, ...path] = rawPath.split('>')
const node = (() => {
// eslint-disable-next-line init-declarations
@ -166,7 +166,7 @@ const put = async (rawPath, value) => {
*/
// eslint-disable-next-line func-style
async function set(rawPath, value) {
const [root, ...path] = rawPath.split('.')
const [root, ...path] = rawPath.split('>')
const node = (() => {
// eslint-disable-next-line init-declarations

View file

@ -3041,7 +3041,7 @@ module.exports = async (
publicKey,
publicKeyForDecryption
}) => {
const keys = path.split('.')
const keys = path.split('>')
const { tryAndWait } = require('../services/gunDB/contact-api/utils')
return tryAndWait((gun, user) => {
// eslint-disable-next-line no-nested-ternary

View file

@ -308,7 +308,7 @@ module.exports = (
node = getGun().user(root)
}
for (const bit of path.split('.')) {
for (const bit of path.split('>')) {
node = node.get(bit)
}