Skip to content

Commit 5f9952a

Browse files
author
pemrouz
committed
fix: should allow subscribing to keys as numbers
1 parent b5135a8 commit 5f9952a

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

end.test.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,14 @@
321321
page.close()
322322
})
323323

324+
await test('allow subscribing using numbers as keys', async ({ plan, same }) => {
325+
plan(1)
326+
const { ripple, page } = await startup()
327+
ripple('object', { 10: 20 })
328+
same(await page.evaluate(d => ripple.get('object', 10)), 20, 'number key')
329+
page.close()
330+
})
331+
324332
process.exit(0)
325333

326334
async function startup(){

server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ const upload = async (ripple, req, res) => {
136136
}, res)
137137
}
138138

139-
const subset = (target = '') => (source = '') => source.startsWith(target)
139+
const subset = (target = '') => (source = '') => str(source).startsWith(target)
140140

141141
const major = (v, f) =>
142142
v ? v.split('.').shift()

0 commit comments

Comments
 (0)