Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
prototype._floor = function(_, pulse) {
const utc = _.timezone === 'utc';
// get parameters
let {units, step} = _.units
? {units: _.units, step: _.step || 1}
: timeBin({
extent: extent(pulse.materialize(pulse.SOURCE).source, _.field),
maxbins: _.maxbins
});
// check / standardize time units
units = timeUnits(units);
const prev = this.value || {},
floor = (utc ? utcFloor : timeFloor)(units, step);
floor.unit = peek(units);
floor.units = units;
floor.step = step;
floor.start = prev.start;
floor.stop = prev.stop;
return this.value = floor;
};