mongo-iots-wrapper
Advanced tools
Comparing version 0.0.13 to 0.0.14
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var t = require("io-ts"); | ||
var io_ts_reporters_1 = require("io-ts-reporters"); | ||
@@ -12,3 +11,3 @@ /** | ||
if (process.env.NODE_ENV !== 'production') { | ||
var value = t.getValidationError(document, [t.getContextEntry("", validator.asDecoder())]); | ||
var value = validator.asDecoder().decode(document); | ||
var errors = io_ts_reporters_1.reporter(value); | ||
@@ -15,0 +14,0 @@ if (errors.length > 0) { |
@@ -42,2 +42,3 @@ "use strict"; | ||
var Schema_test_1 = require("./Schema.test"); | ||
var Config_1 = require("./Config"); | ||
var client = new mongodb_1.MongoClient(); | ||
@@ -48,3 +49,3 @@ (function () { return __awaiter(_this, void 0, void 0, function () { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, client.connect('mongodb://192.168.99.100:3002')]; | ||
case 0: return [4 /*yield*/, client.connect(Config_1.connectionString)]; | ||
case 1: | ||
@@ -62,3 +63,3 @@ db = _a.sent(); | ||
a = mongoClient.Collections.users.insertOne({ | ||
dateCreated: x, | ||
dateCreated: 123, | ||
email: 'dasds', | ||
@@ -65,0 +66,0 @@ password: 'dasasd' |
@@ -12,4 +12,4 @@ import * as t from 'io-ts'; | ||
if (process.env.NODE_ENV !== 'production') { | ||
const value = t.getValidationError(document, [t.getContextEntry("", validator.asDecoder())] as ReadonlyArray<t.ContextEntry>) as any; | ||
const errors = reporter(value); | ||
const value = validator.asDecoder().decode(document); | ||
const errors: string[] = reporter(value); | ||
if (errors.length > 0) { | ||
@@ -16,0 +16,0 @@ const msg = errors.join('\n'); |
@@ -5,2 +5,3 @@ import { MongoClient } from 'mongodb'; | ||
import { schema } from './Schema.test'; | ||
import { connectionString } from './Config'; | ||
@@ -10,3 +11,3 @@ const client = new MongoClient(); | ||
(async () => { | ||
const db = await client.connect('mongodb://192.168.99.100:3002'); | ||
const db = await client.connect(connectionString); | ||
@@ -27,3 +28,3 @@ const mongoClient = mongoRTWrapper( | ||
const a = mongoClient.Collections.users.insertOne({ | ||
dateCreated: x, | ||
dateCreated: 123, | ||
email: 'dasds', | ||
@@ -30,0 +31,0 @@ password: 'dasasd' |
{ | ||
"name": "mongo-iots-wrapper", | ||
"version": "0.0.13", | ||
"version": "0.0.14", | ||
"description": "Strongly typed MongoDB", | ||
@@ -5,0 +5,0 @@ "main": "dist/Index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
75943
31
1221