@push.rocks/smartguard
Advanced tools
Comparing version 2.0.4 to 3.0.0
@@ -6,5 +6,5 @@ /** | ||
name: '@push.rocks/smartguard', | ||
version: '2.0.4', | ||
version: '3.0.0', | ||
description: 'A TypeScript library for creating and managing validation guards, aiding in data validation and security checks.' | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMDBfY29tbWl0aW5mb19kYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvMDBfY29tbWl0aW5mb19kYXRhLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sVUFBVSxHQUFHO0lBQ3hCLElBQUksRUFBRSx3QkFBd0I7SUFDOUIsT0FBTyxFQUFFLE9BQU87SUFDaEIsV0FBVyxFQUFFLGtIQUFrSDtDQUNoSSxDQUFBIn0= |
@@ -9,3 +9,4 @@ export type TGuardFunction<T> = (dataArg: T) => Promise<boolean>; | ||
*/ | ||
executeGuardWithData(dataArg: T): Promise<boolean>; | ||
exec(dataArg: T): Promise<boolean>; | ||
execForTR(): Promise<void>; | ||
} |
@@ -10,7 +10,9 @@ import * as plugins from './smartguard.plugins.js'; | ||
*/ | ||
async executeGuardWithData(dataArg) { | ||
async exec(dataArg) { | ||
const result = await this.guardFunction(dataArg); | ||
return result; | ||
} | ||
async execForTR() { | ||
} | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRndWFyZC5jbGFzc2VzLmd1YXJkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnRndWFyZC5jbGFzc2VzLmd1YXJkLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxPQUFPLE1BQU0seUJBQXlCLENBQUM7QUFJbkQsTUFBTSxPQUFPLEtBQUs7SUFFaEIsWUFBWSxnQkFBbUM7UUFDN0MsSUFBSSxDQUFDLGFBQWEsR0FBRyxnQkFBZ0IsQ0FBQztJQUN4QyxDQUFDO0lBRUQ7OztPQUdHO0lBQ0ksS0FBSyxDQUFDLG9CQUFvQixDQUFDLE9BQVU7UUFDMUMsTUFBTSxNQUFNLEdBQUcsTUFBTSxJQUFJLENBQUMsYUFBYSxDQUFDLE9BQU8sQ0FBQyxDQUFDO1FBQ2pELE9BQU8sTUFBTSxDQUFDO0lBQ2hCLENBQUM7Q0FDRiJ9 | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRndWFyZC5jbGFzc2VzLmd1YXJkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnRndWFyZC5jbGFzc2VzLmd1YXJkLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxPQUFPLE1BQU0seUJBQXlCLENBQUM7QUFJbkQsTUFBTSxPQUFPLEtBQUs7SUFFaEIsWUFBWSxnQkFBbUM7UUFDN0MsSUFBSSxDQUFDLGFBQWEsR0FBRyxnQkFBZ0IsQ0FBQztJQUN4QyxDQUFDO0lBRUQ7OztPQUdHO0lBQ0ksS0FBSyxDQUFDLElBQUksQ0FBQyxPQUFVO1FBQzFCLE1BQU0sTUFBTSxHQUFHLE1BQU0sSUFBSSxDQUFDLGFBQWEsQ0FBQyxPQUFPLENBQUMsQ0FBQztRQUNqRCxPQUFPLE1BQU0sQ0FBQztJQUNoQixDQUFDO0lBRU0sS0FBSyxDQUFDLFNBQVM7SUFFdEIsQ0FBQztDQUNGIn0= |
@@ -13,3 +13,3 @@ import { Guard } from './smartguard.classes.guard.js'; | ||
*/ | ||
executeAllGuardsWithData(dataArg: T): Promise<boolean[]>; | ||
execAllWithData(dataArg: T): Promise<boolean[]>; | ||
/** | ||
@@ -16,0 +16,0 @@ * checks if all guards pass |
@@ -18,6 +18,6 @@ import * as plugins from './smartguard.plugins.js'; | ||
*/ | ||
async executeAllGuardsWithData(dataArg) { | ||
async execAllWithData(dataArg) { | ||
const resultPromises = []; | ||
for (const guard of this.guards) { | ||
const guardResultPromise = guard.executeGuardWithData(dataArg); | ||
const guardResultPromise = guard.exec(dataArg); | ||
resultPromises.push(guardResultPromise); | ||
@@ -33,3 +33,3 @@ } | ||
async allGuardsPass(dataArg) { | ||
const results = await this.executeAllGuardsWithData(dataArg); | ||
const results = await this.execAllWithData(dataArg); | ||
return results.every(result => result); | ||
@@ -42,6 +42,6 @@ } | ||
async anyGuardsPass(dataArg) { | ||
const results = await this.executeAllGuardsWithData(dataArg); | ||
const results = await this.execAllWithData(dataArg); | ||
return results.some(result => result); | ||
} | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRndWFyZC5jbGFzc2VzLmd1YXJkc2V0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnRndWFyZC5jbGFzc2VzLmd1YXJkc2V0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxPQUFPLE1BQU0seUJBQXlCLENBQUM7QUFDbkQsT0FBTyxFQUFFLEtBQUssRUFBdUIsTUFBTSwrQkFBK0IsQ0FBQztBQUUzRTs7O0dBR0c7QUFDSCxNQUFNLE9BQU8sUUFBWSxTQUFRLEtBQVE7SUFHdkMsWUFBWSxhQUE4QixFQUFFO1FBQzFDLEtBQUssQ0FBQyxLQUFLLEVBQUUsT0FBVSxFQUFFLEVBQUU7WUFDekIsT0FBTyxJQUFJLENBQUMsYUFBYSxDQUFDLE9BQU8sQ0FBQyxDQUFDO1FBQ3JDLENBQUMsQ0FBQyxDQUFBO1FBQ0YsSUFBSSxDQUFDLE1BQU0sR0FBRyxVQUFVLENBQUM7SUFDM0IsQ0FBQztJQUVEOzs7T0FHRztJQUN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Q0FBQyxPQUFPLENBQUMsQ0FBQztRQUNwRCxPQUFPLE9BQU8sQ0FBQyxLQUFLLENBQUMsTUFBTSxDQUFDLEVBQUUsQ0FBQyxNQUFNLENBQUMsQ0FBQztJQUN6QyxDQUFDO0lBRUQ7OztPQUdHO0lBQ0ksS0FBSyxDQUFDLGFBQWEsQ0FBQyxPQUFVO1FBQ25DLE1BQU0sT0FBTyxHQUFHLE1BQU0sSUFBSSxDQUFDLGVBQWUsQ0FBQyxPQUFPLENBQUMsQ0FBQztRQUNwRCxPQUFPLE9BQU8sQ0FBQyxJQUFJLENBQUMsTUFBTSxDQUFDLEVBQUUsQ0FBQyxNQUFNLENBQUMsQ0FBQztJQUN4QyxDQUFDO0NBQ0YifQ== |
{ | ||
"name": "@push.rocks/smartguard", | ||
"version": "2.0.4", | ||
"version": "3.0.0", | ||
"private": false, | ||
@@ -20,2 +20,3 @@ "description": "A TypeScript library for creating and managing validation guards, aiding in data validation and security checks.", | ||
"dependencies": { | ||
"@api.global/typedrequest": "^3.0.25", | ||
"@push.rocks/smartpromise": "^4.0.2", | ||
@@ -22,0 +23,0 @@ "@push.rocks/smartrequest": "^2.0.15" |
@@ -6,4 +6,4 @@ /** | ||
name: '@push.rocks/smartguard', | ||
version: '2.0.4', | ||
version: '3.0.0', | ||
description: 'A TypeScript library for creating and managing validation guards, aiding in data validation and security checks.' | ||
} |
@@ -15,6 +15,10 @@ import * as plugins from './smartguard.plugins.js'; | ||
*/ | ||
public async executeGuardWithData(dataArg: T) { | ||
public async exec(dataArg: T) { | ||
const result = await this.guardFunction(dataArg); | ||
return result; | ||
} | ||
public async execForTR() { | ||
} | ||
} |
@@ -22,7 +22,7 @@ import * as plugins from './smartguard.plugins.js'; | ||
*/ | ||
public async executeAllGuardsWithData(dataArg: T) { | ||
public async execAllWithData(dataArg: T) { | ||
const resultPromises: Array<Promise<boolean>> = []; | ||
for (const guard of this.guards) { | ||
const guardResultPromise = guard.executeGuardWithData(dataArg); | ||
const guardResultPromise = guard.exec(dataArg); | ||
resultPromises.push(guardResultPromise); | ||
@@ -40,3 +40,3 @@ } | ||
public async allGuardsPass(dataArg: T): Promise<boolean> { | ||
const results = await this.executeAllGuardsWithData(dataArg); | ||
const results = await this.execAllWithData(dataArg); | ||
return results.every(result => result); | ||
@@ -50,5 +50,5 @@ } | ||
public async anyGuardsPass(dataArg: T): Promise<boolean> { | ||
const results = await this.executeAllGuardsWithData(dataArg); | ||
const results = await this.execAllWithData(dataArg); | ||
return results.some(result => result); | ||
} | ||
} |
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
34202
276
3