Comparing version 0.0.5 to 0.0.6
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.fetchmap = void 0; | ||
const identity = (x) => x; | ||
const success = (value) => ({ tag: 'success', success: value }); | ||
const failure = (error) => ({ tag: 'failure', failure: error }); | ||
const serverErrorFailure = (serverError) => failure({ serverError }); | ||
const mapFun = (response, map) => typeof map === 'string' ? response[map]() : map(response); | ||
function fetchmap(map, input, init, fetcher) { | ||
@@ -27,2 +22,7 @@ return fetcher === undefined | ||
exports.fetchmap = fetchmap; | ||
const serverErrorFailure = (serverError) => failure({ serverError }); | ||
const success = (value) => ({ tag: 'success', success: value }); | ||
const failure = (error) => ({ tag: 'failure', failure: error }); | ||
const mapFun = (response, map) => typeof map === 'string' ? response[map]() : map(response); | ||
const identity = (x) => x; | ||
//# sourceMappingURL=index.js.map |
@@ -1,6 +0,1 @@ | ||
const identity = (x) => x; | ||
const success = (value) => ({ tag: 'success', success: value }); | ||
const failure = (error) => ({ tag: 'failure', failure: error }); | ||
const serverErrorFailure = (serverError) => failure({ serverError }); | ||
const mapFun = (response, map) => typeof map === 'string' ? response[map]() : map(response); | ||
export function fetchmap(map, input, init, fetcher) { | ||
@@ -23,2 +18,7 @@ return fetcher === undefined | ||
} | ||
const serverErrorFailure = (serverError) => failure({ serverError }); | ||
const success = (value) => ({ tag: 'success', success: value }); | ||
const failure = (error) => ({ tag: 'failure', failure: error }); | ||
const mapFun = (response, map) => typeof map === 'string' ? response[map]() : map(response); | ||
const identity = (x) => x; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "fetchmap", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"description": "Non-throwing fetch wrapper", | ||
@@ -30,3 +30,4 @@ "sideEffects": false, | ||
"keywords": [ | ||
"fetch" | ||
"fetch", | ||
"result" | ||
], | ||
@@ -86,4 +87,4 @@ "files": [ | ||
"typeCoverage": { | ||
"atLeast": 99 | ||
"atLeast": 100 | ||
} | ||
} |
@@ -63,3 +63,3 @@ # fetchmap | ||
See [test](/test) or [playground](https://www.typescriptlang.org/play?ssl=7&ssc=58&pln=7&pc=63#code/JYWwDg9gTgLgBAbzgMwKYwMYAsQEMxwC+KUEIcA5GpjvhQFD0YQB2AzvAFYCuHASqjaR2qOAF4U6bHjAAKBIQA0lLDBhgAXAHotAGwgZcurBA4aArAAZL5igEpZ1bHcbN2XNqwDK3DBkFs4pI0MvJwEADWGpScniwURMoUquraegZGJmZWNvaOUlguTKwccABG+mU+fgEAgiwAJgAqqAAeMABiuMC63FCiEk60ckiR0RQVEGUUyiwQMADyUZQwbTAJSipqmjr6hsamMBbWtg5DRW6lyNwsGDDA3r7+bIGDBaGjy7JQ0QJCJag7OIAHxwKAAOg4uBgvESW1SuwyB2yJzy51cJXgU04qDuAFl8K9gtJ8PJ6HAKXAAEzWca4KBQXAATwAQtxkGgoDNyZSACyWXnjVbtBiU8LLCjC9aKHkUuaLL4-OB-YRsQEgsH0TbJbZpPaZQ7HXJnAoXTFg1AAR24ghgAEkWMBFmAYEShh9tSkdul9lkjjlbMokCB0CYGuMAAoLLxNGZwDD9BqoFj3IxscbAW69JMbE00FxAA) | ||
See [test](/test) or [playground](https://www.typescriptlang.org/play?#code/JYWwDg9gTgLgBAbzgMwKYwMYAsQEMxwC+KUEIcA5GpjvhQFD0YQB2AzvAK5QA2cAvJSwwYYAFwB6CTwgZcPLBA5iArAAY1Khk1Yc4AK04cASqjaR2qASnTY8YABQJCAGjjceASgfVsnxszs8PpsrADKnBgYZmzWvrSOSBAA1mKUIawURG4e3vH+OkFwAEYyxRFRMQCCLAAmACqoAB4wAGK4wDzcVoLx9k5wKWkUpRDFFG4sEDAA8qmUMM0wWa7uvHm2WAWBesicLBgwwOGR0WyxvZv9SfMOUGmm5rqongIAfHBQAHQcuDBG2TWXh8m22ungIE4PCOYB4qAAsvgLjYaNd6HAMXAAEwaYa4KBQXAATwAQpxkGgoBN0ZiACxqWnDZDQEAAET+uGpmMG8woixaXMxU1mt3ucEeFjYL3eny+MCJYFQ9FWuRBNDBRSgqAAjpwzDAAJIsYCzMAwZF9fBOFW8NxIEDoRS1YYABRmYXqEzgGC1tVQLCO8jYw2ABy6fpWG3V9CAA) | ||
@@ -66,0 +66,0 @@ ## Misc |
@@ -173,12 +173,2 @@ type OkStatus = | ||
const identity = <T>(x: T) => x | ||
const success = <T>(value: T) => ({ tag: 'success', success: value } as const) | ||
const failure = <T>(error: T) => ({ tag: 'failure', failure: error } as const) | ||
const serverErrorFailure = <T>(serverError: T) => failure({ serverError }) | ||
const mapFun = (response: Response, map: MapResponse) => | ||
typeof map === 'string' ? response[map]() : map(response) | ||
type FetchParams = Parameters<typeof fetch> | ||
@@ -271,1 +261,11 @@ | ||
} | ||
const serverErrorFailure = <T>(serverError: T) => failure({ serverError }) | ||
const success = <T>(value: T) => ({ tag: 'success', success: value } as const) | ||
const failure = <T>(error: T) => ({ tag: 'failure', failure: error } as const) | ||
const mapFun = (response: Response, map: MapResponse) => | ||
typeof map === 'string' ? response[map]() : map(response) | ||
const identity = <T>(x: T) => x |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
31224