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

rest-easy-loki

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rest-easy-loki - npm Package Compare versions

Comparing version 1.3.1 to 1.4.0

6

dist/authorization.js

@@ -63,3 +63,3 @@ "use strict";

const hostname = ctx.hostname && ctx.hostname.toUpperCase();
// console.table(hostname);
console.log(hostname);
if (hostname && apiKeys.whitelist.includes(hostname)) {

@@ -83,3 +83,5 @@ return true;

const pep = async (ctx, next) => {
if (pdp(ctx)) {
const allowed = pdp(ctx);
// console.log('Allowed: ' + allowed);
if (allowed) {
// Use await next. See here: https://github.com/ZijianHe/koa-router/issues/358

@@ -86,0 +88,0 @@ await next();

@@ -26,5 +26,3 @@ "use strict";

collection.insert(json);
// for (const o of json) {
// collection.insertOne
// }
console.log(`Finished reading ${filename}, number of entries in collection '${collection.name}': ${collection.count()}`);
}

@@ -46,14 +44,9 @@ else {

}
else if (options) {
else if (options && options.collections && typeof options.collections === 'object') {
const { collections } = options;
if (collections && typeof collections === 'object') {
for (const collectionName of Object.keys(collections)) {
const collection = collections[collectionName];
db.addCollection(collectionName, collection);
collection.jsonImport && importJSON(collectionName, collection.jsonImport);
}
for (const collectionName of Object.keys(collections)) {
const collection = collections[collectionName];
collectionStore[collectionName] = db.addCollection(collectionName, collection);
collection.jsonImport && importJSON(collectionName, collection.jsonImport);
}
db.collections.forEach((c) => {
collectionStore[c.name] = db.getCollection(c.name);
});
}

@@ -83,3 +76,3 @@ // kick off any program logic or start listening to external events

autosave: true,
autosaveInterval: 4000,
throttledSaves: options ? options.throttledSaves : true,
});

@@ -86,0 +79,0 @@ };

@@ -24,2 +24,3 @@ /** From LokiJS typings, but not exported */

export interface ILokiConfiguration<T = {}> {
throttledSaves?: boolean;
/** Create collections on startup if there are no collections yet */

@@ -26,0 +27,0 @@ collections?: {

{
"name": "rest-easy-loki",
"version": "1.3.1",
"version": "1.4.0",
"description": "A REST interface for lokijs supporting CRUD operations and automatic creation of new collections.",

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