Do not use underscore
This commit is contained in:
parent
a4ecc18f2f
commit
9c64d674b3
@ -1,4 +1,3 @@
|
|||||||
var _ = require('underscore');
|
|
||||||
var BaseDataview = require('./base');
|
var BaseDataview = require('./base');
|
||||||
var debug = require('debug')('windshaft:dataview:formula');
|
var debug = require('debug')('windshaft:dataview:formula');
|
||||||
|
|
||||||
@ -51,7 +50,7 @@ var TYPE = 'formula';
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
function Formula(query, options = {}, queries = {}) {
|
function Formula(query, options = {}, queries = {}) {
|
||||||
if (!_.isString(options.operation)) {
|
if (typeof options.operation !== 'string') {
|
||||||
throw new Error('Formula expects `operation` in widget options');
|
throw new Error('Formula expects `operation` in widget options');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -59,7 +58,7 @@ function Formula(query, options = {}, queries = {}) {
|
|||||||
throw new Error("Formula does not support '" + options.operation + "' operation");
|
throw new Error("Formula does not support '" + options.operation + "' operation");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.operation !== 'count' && !_.isString(options.column)) {
|
if (options.operation !== 'count' && typeof options.column !== 'string') {
|
||||||
throw new Error('Formula expects `column` in widget options');
|
throw new Error('Formula expects `column` in widget options');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user