Socket
Socket
Sign inDemoInstall

@6river/reason-guard

Package Overview
Dependencies
Maintainers
5
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@6river/reason-guard - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1

18

dist/src/constantGuards.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const trueGuard = (input, _errs, confs = []) => {
confs.push('true');
return true;
};
const falseGuard = (input, errs = []) => {
try {
throw new Error('false');
}
catch (err) {
errs.push(err);
return false;
}
};
const Checker_1 = require("./Checker");
const trueGuard = Checker_1.checkerToGuard(() => 'true');
const falseGuard = Checker_1.checkerToGuard(() => {
throw new Error('false');
});
exports.constantGuards = (result) => result ? trueGuard : falseGuard;
//# sourceMappingURL=constantGuards.js.map

@@ -58,3 +58,3 @@ {

},
"version": "1.2.0"
"version": "1.2.1"
}
import {ReasonGuard} from './ReasonGuard';
import {checkerToGuard} from './Checker';
const trueGuard: ReasonGuard<unknown, unknown> = (input, _errs, confs = []): input is unknown => {
confs.push('true');
return true;
};
const falseGuard: ReasonGuard<unknown, never> = (input, errs = []): input is never => {
try {
const trueGuard: ReasonGuard<unknown, unknown> =
checkerToGuard(() => 'true');
const falseGuard: ReasonGuard<unknown, never> =
checkerToGuard(() => {
throw new Error('false');
} catch (err) {
errs.push(err);
return false;
}
};
});
export const constantGuards: (result: boolean) => ReasonGuard<unknown, unknown> =
(result: boolean) => result ? trueGuard : falseGuard;

Sorry, the diff of this file is not supported yet

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