New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

influx

Package Overview
Dependencies
Maintainers
3
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

influx - npm Package Compare versions

Comparing version 5.1.1 to 5.2.0

15

lib/src/index.d.ts

@@ -248,2 +248,9 @@ /// <reference types="node" />

/**
* Adds specified schema for better fields coercing.
*
* @param {ISchemaOptions} schema
* @memberof InfluxDB
*/
addSchema(schema: ISchemaOptions): void;
/**
* Creates a new database with the provided name.

@@ -677,2 +684,10 @@ * @param databaseName

private _getQueryOpts;
/**
* Creates specified measurement schema
*
* @private
* @param {ISchemaOptions} schema
* @memberof InfluxDB
*/
private _createSchema;
}

40

lib/src/index.js

@@ -239,16 +239,14 @@ "use strict";

});
this._options.schema.forEach(schema => {
schema.database = schema.database || this._options.database;
const db = schema.database;
if (!db) {
throw new Error(`Schema ${schema.measurement} doesn't have a database specified,` +
'and no default database is provided!');
}
if (!this._schema[db]) {
this._schema[db] = Object.create(null);
}
this._schema[db][schema.measurement] = new schema_1.Schema(schema);
});
this._options.schema.forEach(schema => this._createSchema(schema));
}
/**
* Adds specified schema for better fields coercing.
*
* @param {ISchemaOptions} schema
* @memberof InfluxDB
*/
addSchema(schema) {
this._createSchema(schema);
}
/**
* Creates a new database with the provided name.

@@ -918,3 +916,21 @@ * @param databaseName

}
/**
* Creates specified measurement schema
*
* @private
* @param {ISchemaOptions} schema
* @memberof InfluxDB
*/
_createSchema(schema) {
schema.database = schema.database || this._options.database;
if (!schema.database) {
throw new Error(`Schema ${schema.measurement} doesn't have a database specified,` +
'and no default database is provided!');
}
if (!this._schema[schema.database]) {
this._schema[schema.database] = Object.create(null);
}
this._schema[schema.database][schema.measurement] = new schema_1.Schema(schema);
}
}
exports.InfluxDB = InfluxDB;
{
"name": "influx",
"version": "5.1.1",
"version": "5.2.0",
"description": "InfluxDB Client",

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

"stream-http": "github:node-influx/stream-http",
"ts-node": "8.2.0",
"ts-node": "8.3.0",
"typescript": "3.5.2",
"webpack": "4.34.0"
"webpack": "4.35.0"
},

@@ -84,0 +84,0 @@ "eslintConfig": {

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