Socket
Socket
Sign inDemoInstall

@dbpath/dal

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dbpath/dal - npm Package Compare versions

Comparing version 0.2.18 to 0.2.19

dist/src/dal.spec.d.ts

4

dist/src/dal.d.ts

@@ -8,4 +8,6 @@ import { NameAnd } from "@dbpath/utils";

}
export type LimitFn = (pageNum: number, pageSize: number, s: string[]) => string[];
export declare function checkLimitOrThrow(l: LimitFn): LimitFn;
export interface DalDialect {
limitFn: (pageNum: number, pageSize: number, s: string[]) => string[];
limitFn: LimitFn;
safeQuery: string;

@@ -12,0 +14,0 @@ }

@@ -12,3 +12,13 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.useDal = void 0;
exports.useDal = exports.checkLimitOrThrow = void 0;
function checkLimitOrThrow(l) {
return (pageNum, pageSize, s) => {
if (typeof pageNum !== 'number' || pageNum < 1)
throw new Error(`Invalid page number (${typeof pageNum}) ${pageNum}`);
if (typeof pageSize !== 'number' || pageSize < 1)
throw new Error(`Invalid page size (${typeof pageSize}) ${pageSize}`);
return l(pageNum, pageSize, s);
};
}
exports.checkLimitOrThrow = checkLimitOrThrow;
function useDal(dal, fn) {

@@ -15,0 +25,0 @@ return __awaiter(this, void 0, void 0, function* () {

@@ -17,2 +17,3 @@ import { Summary } from "@dbpath/config";

actualTableName(tableName: string): string;
pkFor(tableName: string): string[];
}

@@ -19,0 +20,0 @@ export declare const PathValidatorAlwaysOK: PathValidator;

@@ -12,3 +12,4 @@ "use strict";

},
actualTableName: t => t
actualTableName: t => t,
pkFor: t => ['id']
};

@@ -108,5 +109,6 @@ function checkFullTableName(m, tableName) {

useIdsOrSingleFkLinkOrError: (0, exports.useIdsOrSingleFkLinkOrError)(summary, m),
actualTableName: t => fullTableName(summary, t)
actualTableName: t => fullTableName(summary, t),
pkFor: t => { var _a; return (_a = m.tables[t]) === null || _a === void 0 ? void 0 : _a.pk.map(c => c.name); }
};
}
exports.DalPathValidator = DalPathValidator;
{
"name": "@dbpath/dal",
"description": "",
"version": "0.2.18",
"version": "0.2.19",
"main": "dist/index",

@@ -20,4 +20,4 @@ "types": "dist/index",

"dependencies": {
"@dbpath/config": "0.2.18",
"@dbpath/fixtures": "0.2.18"
"@dbpath/config": "0.2.19",
"@dbpath/fixtures": "0.2.19"
},

@@ -24,0 +24,0 @@ "devDependencies": {

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