Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Putting regex creates a key #122

@PsychoLlama

Description

@PsychoLlama

Gun won't save regular expressions (which is good), but it will create a key when you pass one in.

var gun = Gun().get('test').set()
gun.path('regex').put(/expression/)
gun.val()
// => { _: Object, regex: Object } 

The regex isn't actually saved, but a key is created referencing a relation. If we look at how Infinity or NaN is handled, the key is never created, as though gun never saw the data (and for invalid values, and that makes sense here). Here's the minimum amount of code to create the issue:

Gun().get('test').set(/expression/)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions