diff --git a/index.js b/index.js index f42a214..6848b06 100644 --- a/index.js +++ b/index.js @@ -119,9 +119,8 @@ function isAllowPublic (input) { } function isAllowPublic2 (input) { - if (typeof input.content !== 'object') return false - if (typeof get(input, ['content', 'type']) !== 'string') return false - if (get(input, ['options', 'allowPublic']) !== true) return false + return input.allowPublic === true + if (input.allowPublic !== true) return false return true } diff --git a/test/db2.test.js b/test/db2.test.js index 977dd27..16fa06a 100644 --- a/test/db2.test.js +++ b/test/db2.test.js @@ -28,7 +28,7 @@ test('db2', async t => { }) content = { type: 'profile', name: 'mix' } - await p(server.db.create)({ content, options: { allowPublic: true } }) + await p(server.db.create)({ content, allowPublic: true }) .then(data => { t.deepEqual(data.value.content, content, '(msg content unencrypted, allowPublic pruned). db.create') }) @@ -38,7 +38,7 @@ test('db2', async t => { const weird = { content: { type: 'profile', recps: [server.id] }, - options: { allowPublic: true } + allowPublic: true } await p(server.db.create)(weird) .then(msg => {