Socket
Socket
Sign inDemoInstall

sequelize-es-decorator

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sequelize-es-decorator - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

README.md

16

index.js
const elasticsearch = require('elasticsearch');
const {typeCheck} = require('type-check');
const {types} = require('./config/constants');
const { typeCheck } = require('type-check');
const { types } = require('./config/constants');
const decorateAdd = require('./methods/add');

@@ -24,3 +24,3 @@ const decorateUpdate = require('./methods/update');

decorate (model) {
decorate(model) {
if (model.getSearchOptions) {

@@ -30,2 +30,12 @@ const options = model.getSearchOptions();

if (options && typeCheck(types.modelIndexConfig, options)) {
this.client.indices.exists({
index: `${this.database}_${options.type}`
}).then(status => {
if (!status) {
this.client.indices.create({
index: `${this.database}_${options.type}`
});
}
});
decorateAdd(model, this.client, this.database);

@@ -32,0 +42,0 @@ decorateUpdate(model, this.client, this.database);

2

package.json
{
"name": "sequelize-es-decorator",
"version": "1.0.1",
"version": "1.0.2",
"description": "Decorator for Sequelize models that enables auto-indexing of data that goes through the model.",

@@ -5,0 +5,0 @@ "main": "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