Comparing version 1.1.1 to 1.1.2
@@ -87,10 +87,8 @@ var roughMatch = require('./lib/genotypeMatch'); | ||
exact: function(k, v){ | ||
if (typeof v !== 'string' && v !== null) { | ||
throw new Error('exact can only check for strings or null'); | ||
if (typeof v !== 'string') { | ||
throw new Error('exact can only check for strings'); | ||
} | ||
return function(data){ | ||
var snp = data[k]; | ||
if (!snp) return false | ||
if (snp.genotype === v) return true | ||
return roughMatch(snp.genotype, v); | ||
return !!(snp && snp.genotype && roughMatch(snp.genotype, v)); | ||
}; | ||
@@ -97,0 +95,0 @@ }, |
{ | ||
"name": "gql", | ||
"description": "Query language for interpreting genome SNPs", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"homepage": "http://github.com/genomejs/gql", | ||
@@ -6,0 +6,0 @@ "repository": "git://github.com/genomejs/gql.git", |
@@ -25,2 +25,4 @@ [![Build Status](https://travis-ci.org/genomejs/gql.png?branch=master)](https://travis-ci.org/genomejs/gql) | ||
Just a reminder: deletions are represented as `-`! | ||
## Usage | ||
@@ -68,8 +70,2 @@ | ||
To test for deletions, check for null: | ||
```javascript | ||
q.exact('rs2032651', null); | ||
``` | ||
#### has(id, genotype) | ||
@@ -76,0 +72,0 @@ |
@@ -6,11 +6,2 @@ var gql = require('../'); | ||
describe('exact()', function() { | ||
it('should match with null', function() { | ||
var data = { | ||
rs1234: { | ||
genotype: null | ||
} | ||
}; | ||
var fn = gql.exact('rs1234', null); | ||
fn(data).should.equal(true); | ||
}); | ||
it('should match with two alleles', function() { | ||
@@ -17,0 +8,0 @@ var data = { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
0
20968
559
194