iferr/000755 001751 000177 0000000000 14522325161013643 5ustar00runner000000 000000 1452232516114522325161iferr/LICENSE000644 001751 000177 0000002165 14522325161014654 0ustar00runner000000 000000 1452232516114522325161 MIT License Copyright (c) Microsoft Corporation. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE iferr/README.md000644 001751 000177 0000003147 14522325161015132 0ustar00runner000000 000000 1452236532214522325161# Installation > `npm install --save @types/iferr` # Summary This package contains type definitions for iferr (https://github.com/shesek/iferr). # Details Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/iferr. ## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/iferr/index.d.ts) ````ts type nodeCallback = (err: Error | null, ...a: T[]) => any; // Delegates to `succ` on sucecss or to `fail` on error // ex: Thing.load(123, iferr(cb, thing => ...)) declare function iferr(fail: (err: Error) => void, succ: (...result: T[]) => void): nodeCallback; declare namespace iferr { // Delegates to `succ` on sucecss or to `fail` on error // ex: Thing.load(123, iferr(cb, thing => ...)) function iferr(fail: (err: Error) => void, succ: (...result: T[]) => void): nodeCallback; // Like iferr, but also catches errors thrown from `succ` and passes to `fail` function tiferr(fail: (err: Error) => void, succ: (...result: T[]) => void): nodeCallback; // Delegate to the success function on success, throws the error otherwise // ex: Thing.load(123, throwerr(thing => ...)) function throwerr(succ: (...result: T[]) => void): nodeCallback; // Prints errors when one is passed, or does nothing otherwise // ex: Thing.load(123, printerr) function printerr(): nodeCallback; } export = iferr; ```` ### Additional Details * Last updated: Tue, 07 Nov 2023 03:09:37 GMT * Dependencies: none # Credits These definitions were written by [segayuu](https://github.com/segayuu). iferr/index.d.ts000644 001751 000177 0000002055 14522325161015546 0ustar00runner000000 000000 1452232516114522325161type nodeCallback = (err: Error | null, ...a: T[]) => any; // Delegates to `succ` on sucecss or to `fail` on error // ex: Thing.load(123, iferr(cb, thing => ...)) declare function iferr(fail: (err: Error) => void, succ: (...result: T[]) => void): nodeCallback; declare namespace iferr { // Delegates to `succ` on sucecss or to `fail` on error // ex: Thing.load(123, iferr(cb, thing => ...)) function iferr(fail: (err: Error) => void, succ: (...result: T[]) => void): nodeCallback; // Like iferr, but also catches errors thrown from `succ` and passes to `fail` function tiferr(fail: (err: Error) => void, succ: (...result: T[]) => void): nodeCallback; // Delegate to the success function on success, throws the error otherwise // ex: Thing.load(123, throwerr(thing => ...)) function throwerr(succ: (...result: T[]) => void): nodeCallback; // Prints errors when one is passed, or does nothing otherwise // ex: Thing.load(123, printerr) function printerr(): nodeCallback; } export = iferr; iferr/package.json000644 001751 000177 0000001403 14522325161016132 0ustar00runner000000 000000 1452236532214522325161{ "name": "@types/iferr", "version": "1.0.4", "description": "TypeScript definitions for iferr", "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/iferr", "license": "MIT", "contributors": [ { "name": "segayuu", "githubUsername": "segayuu", "url": "https://github.com/segayuu" } ], "main": "", "types": "index.d.ts", "repository": { "type": "git", "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", "directory": "types/iferr" }, "scripts": {}, "dependencies": {}, "typesPublisherContentHash": "7cee2e8f4ebdfea662b7c297906bc5db845a49c2c1a82d7d767107c23650b973", "typeScriptVersion": "4.5" }