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

casbin-knex-adapter

Package Overview
Dependencies
Maintainers
2
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

casbin-knex-adapter - npm Package Compare versions

Comparing version 0.5.0 to 0.6.0

2

dist/lib/adapter.d.ts

@@ -6,2 +6,3 @@ import type Knex from 'knex';

chunkSize?: number;
concurrentDeletes?: number;
};

@@ -12,2 +13,3 @@ export declare class KnexAdapter implements Adapter, BatchAdapter {

private readonly chunkSize;
private readonly concurrentDeletes;
constructor(knex: Knex, options?: KnexAdapterOptions);

@@ -14,0 +16,0 @@ static newAdapter(knex: Knex, options?: KnexAdapterOptions): Promise<KnexAdapter>;

10

dist/lib/adapter.js

@@ -11,2 +11,3 @@ "use strict";

this.chunkSize = (options === null || options === void 0 ? void 0 : options.chunkSize) || 100;
this.concurrentDeletes = (options === null || options === void 0 ? void 0 : options.concurrentDeletes) || 5;
}

@@ -82,5 +83,8 @@ static async newAdapter(knex, options) {

async removePolicies(sec, ptype, rules) {
const deleteChunks = utils_1.chunk(rules, this.chunkSize);
for (const deleteChunk of deleteChunks) {
await this.removePolicy(sec, ptype, deleteChunk);
const deleteChunks = utils_1.chunk(rules, this.concurrentDeletes);
for (const chunk of deleteChunks) {
const promises = chunk.map((rule) => {
return this.removePolicy(sec, ptype, rule);
});
await Promise.all(promises);
}

@@ -87,0 +91,0 @@ }

{
"name": "casbin-knex-adapter",
"version": "0.5.0",
"version": "0.6.0",
"description": "Knex adapter for Casbin",

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

Sorry, the diff of this file is not supported yet

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