persvr / rql

Resource Query Language
http://www.persvr.org/
269 stars 49 forks source link

.toString() coerces null to string:null #76

Open rkaw92 opened 7 years ago

rkaw92 commented 7 years ago

Simple test case:

'use strict';

const Query = require('rql/query').Query;
const testPredicate = new Query().eq('foo', null);
console.log(testPredicate.toString());

Expected output: eq(foo,null)

Actual output: eq(foo,string:null)

Going to fix this in greatcare/rql, so that null values no longer get coerced. This is probably due to the special-case treatment of null in the first lines of query's encodeValue.

wshager commented 7 years ago

@neonstalwart I see no problem with this fix, could you merge it? Who else has write permission nowadays?

neonstalwart commented 7 years ago

I'm uncertain about my status to contribute to open source. I believe it's probably ok for me to merge something like this (since I'm not the author) but since I'm not certain I'd rather not. I know I can get permission to contribute code I've authored by having my contributions reviewed and approved by my employer before contributing but that extra step is just enough of a burden to make it more effort than I have the time and energy for right now. I'm not sure who else could merge it.