Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

esqueue

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

esqueue - npm Package Compare versions

Comparing version 0.10.3 to 0.10.4

4

CHANGELOG.md

@@ -5,2 +5,6 @@ # Changelog

## v0.10.4
- Allow index pattern date separator to be customized
## v0.10.3

@@ -7,0 +11,0 @@

@@ -8,2 +8,3 @@ 'use strict';

DEFAULT_SETTING_TIMEOUT: 10000,
DEFAULT_SETTING_DATE_SEPARATOR: '-',
DEFAULT_SETTING_INTERVAL: 'week',

@@ -10,0 +11,0 @@ DEFAULT_SETTING_DOCTYPE: 'esqueue'

12

lib/helpers/index_timestamp.js

@@ -18,2 +18,6 @@ 'use strict';

function indexTimestamp(intervalStr) {
var separator = arguments.length <= 1 || arguments[1] === undefined ? '-' : arguments[1];
if (separator.match(/[a-z]/i)) throw new Error('Interval separator can not be a letter');
var index = intervals.indexOf(intervalStr);

@@ -31,12 +35,12 @@ if (index === -1) throw new Error('Invalid index interval: ', intervalStr);

case 'month':
dateString = 'YYYY-MM';
dateString = 'YYYY' + separator + 'MM';
break;
case 'hour':
dateString = 'YYYY-MM-DD-HH';
dateString = 'YYYY' + separator + 'MM' + separator + 'DD' + separator + 'HH';
break;
case 'minute':
dateString = 'YYYY-MM-DD-HH-mm';
dateString = 'YYYY' + separator + 'MM' + separator + 'DD' + separator + 'HH' + separator + 'mm';
break;
default:
dateString = 'YYYY-MM-DD';
dateString = 'YYYY' + separator + 'MM' + separator + 'DD';
}

@@ -43,0 +47,0 @@

@@ -67,3 +67,4 @@ 'use strict';

timeout: _constants2.default.DEFAULT_SETTING_TIMEOUT,
doctype: _constants2.default.DEFAULT_SETTING_DOCTYPE
doctype: _constants2.default.DEFAULT_SETTING_DOCTYPE,
dateSeparator: _constants2.default.DEFAULT_SETTING_DATE_SEPARATOR
}, (0, _lodash2.default)(options, ['client']));

@@ -94,3 +95,3 @@ _this.client = (0, _create_client2.default)(options.client || {});

var timestamp = (0, _index_timestamp2.default)(this.settings.interval);
var timestamp = (0, _index_timestamp2.default)(this.settings.interval, this.settings.dateSeparator);
var index = this.index + '-' + timestamp;

@@ -97,0 +98,0 @@ var defaults = {

{
"name": "esqueue",
"version": "0.10.3",
"version": "0.10.4",
"description": "Job queue, powered by Elasticsearch",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc