medikoo / medikoo/dbjs

Improve validation of some object primitives

Open
#12 0 comments 0 reactions 1 assignee View on GitHub

@medikoo is already working on this.

Since Aug 29, 2014.

Dominant language
JavaScript
Stars
27
Forks
4
PR merge metrics
No merged PRs in 30d

Description

If for property of type Function, function instance is passed, and it's neither direct instance of this Function type, nor plain JavaScript function, validator should throw.

In case of Dates or RegExp's validator instead of throwing may create copies, but in case of functions there's no straightforward way to create perfect copy.

It will prevent errors, as one we approached with @kamsi, where following bogus code:

db2.Type.extend('SomeType', db1.OtherType);

didn't report any issue, but have broken state of db1.OtherType (its prototype was turned)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.