Socket
Socket
Sign inDemoInstall

return-style

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

return-style - npm Package Compare versions

Comparing version 0.5.1 to 0.6.0

18

dist/es2015/index.umd.js

@@ -118,3 +118,3 @@ (function (global, factory) {

catch (e) {
return [false, e];
return [false, void 0];
}

@@ -130,3 +130,3 @@ }

catch (e) {
return [false, e];
return [false, void 0];
}

@@ -138,4 +138,4 @@ });

try {
const result = fn();
return [false, result];
fn();
return [false, void 0];
}

@@ -150,4 +150,4 @@ catch (e) {

try {
const result = yield promise;
return [false, result];
yield promise;
return [false, void 0];
}

@@ -390,6 +390,4 @@ catch (e) {

return new AsyncResult((() => __awaiter(this, void 0, void 0, function* () {
const [fail, ret] = yield getFailureAsync(__classPrivateFieldGet(this, _promise));
if (fail)
throw ret;
return mapper(ret);
const result = yield __classPrivateFieldGet(this, _promise);
return mapper(result);
}))());

@@ -396,0 +394,0 @@ }

@@ -53,3 +53,3 @@ (function (global, factory) {

catch (e) {
return [false, e];
return [false, void 0];
}

@@ -64,3 +64,3 @@ }

catch (e) {
return [false, e];
return [false, void 0];
}

@@ -71,4 +71,4 @@ }

try {
const result = fn();
return [false, result];
fn();
return [false, void 0];
}

@@ -82,4 +82,4 @@ catch (e) {

try {
const result = await promise;
return [false, result];
await promise;
return [false, void 0];
}

@@ -294,6 +294,4 @@ catch (e) {

return new AsyncResult((async () => {
const [fail, ret] = await getFailureAsync(__classPrivateFieldGet(this, _promise));
if (fail)
throw ret;
return mapper(ret);
const result = await __classPrivateFieldGet(this, _promise);
return mapper(result);
})());

@@ -300,0 +298,0 @@ }

@@ -38,2 +38,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.AsyncOptional = exports.None = void 0;
exports.None = Symbol();

@@ -40,0 +41,0 @@ class AsyncOptional {

@@ -38,2 +38,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.AsyncResult = void 0;
const get_success_async_1 = require("../functions/get-success-async");

@@ -99,6 +100,4 @@ const get_failure_async_1 = require("../functions/get-failure-async");

return new AsyncResult((() => __awaiter(this, void 0, void 0, function* () {
const [fail, ret] = yield get_failure_async_1.getFailureAsync(__classPrivateFieldGet(this, _promise));
if (fail)
throw ret;
return mapper(ret);
const result = yield __classPrivateFieldGet(this, _promise);
return mapper(result);
}))());

@@ -105,0 +104,0 @@ }

@@ -17,2 +17,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.Optional = void 0;
class Optional {

@@ -19,0 +20,0 @@ static of(value) {

@@ -17,2 +17,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.Result = void 0;
class Result {

@@ -19,0 +20,0 @@ static of(value) {

@@ -19,2 +19,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.getErrorAsyncIterable = void 0;
function getErrorAsyncIterable(iterable) {

@@ -21,0 +22,0 @@ var iterable_1, iterable_1_1;

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

Object.defineProperty(exports, "__esModule", { value: true });
exports.getErrorAsync = void 0;
function getErrorAsync(promise) {

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

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

Object.defineProperty(exports, "__esModule", { value: true });
exports.getErrorResultAsync = void 0;
function getErrorResultAsync(promise) {

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

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getErrorResult = void 0;
function getErrorResult(fn) {

@@ -4,0 +5,0 @@ try {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getError = void 0;
function getError(fn) {

@@ -4,0 +5,0 @@ try {

@@ -1,1 +0,1 @@

export declare function getFailureAsync<X, T>(promise: PromiseLike<T>): Promise<[false, T] | [true, X]>;
export declare function getFailureAsync<X>(promise: PromiseLike<unknown>): Promise<[true, X] | [false, undefined]>;

@@ -12,7 +12,8 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.getFailureAsync = void 0;
function getFailureAsync(promise) {
return __awaiter(this, void 0, void 0, function* () {
try {
const result = yield promise;
return [false, result];
yield promise;
return [false, void 0];
}

@@ -19,0 +20,0 @@ catch (e) {

@@ -1,1 +0,1 @@

export declare function getFailure<X, T>(fn: () => T): [false, T] | [true, X];
export declare function getFailure<X>(fn: () => unknown): [true, X] | [false, undefined];
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getFailure = void 0;
function getFailure(fn) {
try {
const result = fn();
return [false, result];
fn();
return [false, void 0];
}

@@ -8,0 +9,0 @@ catch (e) {

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

Object.defineProperty(exports, "__esModule", { value: true });
exports.getOptionalAsync = exports.getOptionalAsyncPartial = void 0;
const async_optional_1 = require("../classes/async-optional");

@@ -14,0 +15,0 @@ function getOptionalAsyncPartial(isNone) {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getOptional = exports.getOptionalPartial = void 0;
const optional_1 = require("../classes/optional");

@@ -4,0 +5,0 @@ function getOptionalPartial(isNone) {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getResultAsync = void 0;
const async_result_1 = require("../classes/async-result");

@@ -4,0 +5,0 @@ function getResultAsync(promise) {

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

Object.defineProperty(exports, "__esModule", { value: true });
exports.getResultErrorAsync = void 0;
function getResultErrorAsync(promise) {

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

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getResultError = void 0;
function getResultError(fn) {

@@ -4,0 +5,0 @@ try {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getResult = void 0;
const result_1 = require("../classes/result");

@@ -4,0 +5,0 @@ function getResult(fn) {

@@ -1,1 +0,1 @@

export declare function getSuccessAsync<X, T>(promise: PromiseLike<T>): Promise<[true, T] | [false, X]>;
export declare function getSuccessAsync<T>(promise: PromiseLike<T>): Promise<[true, T] | [false, undefined]>;

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

Object.defineProperty(exports, "__esModule", { value: true });
exports.getSuccessAsync = void 0;
function getSuccessAsync(promise) {

@@ -20,3 +21,3 @@ return __awaiter(this, void 0, void 0, function* () {

catch (e) {
return [false, e];
return [false, void 0];
}

@@ -23,0 +24,0 @@ });

@@ -1,1 +0,1 @@

export declare function getSuccess<X, T>(fn: () => T): [true, T] | [false, X];
export declare function getSuccess<T>(fn: () => T): [true, T] | [false, undefined];
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getSuccess = void 0;
function getSuccess(fn) {

@@ -9,3 +10,3 @@ try {

catch (e) {
return [false, e];
return [false, void 0];
}

@@ -12,0 +13,0 @@ }

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

Object.defineProperty(exports, "__esModule", { value: true });
exports.isFailureAsync = void 0;
function isFailureAsync(promise) {

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

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isFailure = void 0;
function isFailure(fn) {

@@ -4,0 +5,0 @@ try {

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

Object.defineProperty(exports, "__esModule", { value: true });
exports.isSuccessAsync = void 0;
function isSuccessAsync(promise) {

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

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isSuccess = void 0;
function isSuccess(fn) {

@@ -4,0 +5,0 @@ try {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var get_error_result_1 = require("./functions/get-error-result");
exports.getErrorResult = get_error_result_1.getErrorResult;
Object.defineProperty(exports, "getErrorResult", { enumerable: true, get: function () { return get_error_result_1.getErrorResult; } });
var get_error_result_async_1 = require("./functions/get-error-result-async");
exports.getErrorResultAsync = get_error_result_async_1.getErrorResultAsync;
Object.defineProperty(exports, "getErrorResultAsync", { enumerable: true, get: function () { return get_error_result_async_1.getErrorResultAsync; } });
var get_result_error_1 = require("./functions/get-result-error");
exports.getResultError = get_result_error_1.getResultError;
Object.defineProperty(exports, "getResultError", { enumerable: true, get: function () { return get_result_error_1.getResultError; } });
var get_result_error_async_1 = require("./functions/get-result-error-async");
exports.getResultErrorAsync = get_result_error_async_1.getResultErrorAsync;
Object.defineProperty(exports, "getResultErrorAsync", { enumerable: true, get: function () { return get_result_error_async_1.getResultErrorAsync; } });
var get_success_1 = require("./functions/get-success");
exports.getSuccess = get_success_1.getSuccess;
Object.defineProperty(exports, "getSuccess", { enumerable: true, get: function () { return get_success_1.getSuccess; } });
var get_success_async_1 = require("./functions/get-success-async");
exports.getSuccessAsync = get_success_async_1.getSuccessAsync;
Object.defineProperty(exports, "getSuccessAsync", { enumerable: true, get: function () { return get_success_async_1.getSuccessAsync; } });
var get_failure_1 = require("./functions/get-failure");
exports.getFailure = get_failure_1.getFailure;
Object.defineProperty(exports, "getFailure", { enumerable: true, get: function () { return get_failure_1.getFailure; } });
var get_failure_async_1 = require("./functions/get-failure-async");
exports.getFailureAsync = get_failure_async_1.getFailureAsync;
Object.defineProperty(exports, "getFailureAsync", { enumerable: true, get: function () { return get_failure_async_1.getFailureAsync; } });
var is_success_1 = require("./functions/is-success");
exports.isSuccess = is_success_1.isSuccess;
Object.defineProperty(exports, "isSuccess", { enumerable: true, get: function () { return is_success_1.isSuccess; } });
var is_success_async_1 = require("./functions/is-success-async");
exports.isSuccessAsync = is_success_async_1.isSuccessAsync;
Object.defineProperty(exports, "isSuccessAsync", { enumerable: true, get: function () { return is_success_async_1.isSuccessAsync; } });
var is_failure_1 = require("./functions/is-failure");
exports.isFailure = is_failure_1.isFailure;
Object.defineProperty(exports, "isFailure", { enumerable: true, get: function () { return is_failure_1.isFailure; } });
var is_failure_async_1 = require("./functions/is-failure-async");
exports.isFailureAsync = is_failure_async_1.isFailureAsync;
Object.defineProperty(exports, "isFailureAsync", { enumerable: true, get: function () { return is_failure_async_1.isFailureAsync; } });
var get_error_1 = require("./functions/get-error");
exports.getError = get_error_1.getError;
Object.defineProperty(exports, "getError", { enumerable: true, get: function () { return get_error_1.getError; } });
var get_error_async_1 = require("./functions/get-error-async");
exports.getErrorAsync = get_error_async_1.getErrorAsync;
Object.defineProperty(exports, "getErrorAsync", { enumerable: true, get: function () { return get_error_async_1.getErrorAsync; } });
var get_error_async_iterable_1 = require("./functions/get-error-async-iterable");
exports.getErrorAsyncIterable = get_error_async_iterable_1.getErrorAsyncIterable;
Object.defineProperty(exports, "getErrorAsyncIterable", { enumerable: true, get: function () { return get_error_async_iterable_1.getErrorAsyncIterable; } });
var get_result_1 = require("./functions/get-result");
exports.getResult = get_result_1.getResult;
Object.defineProperty(exports, "getResult", { enumerable: true, get: function () { return get_result_1.getResult; } });
var get_result_async_1 = require("./functions/get-result-async");
exports.getResultAsync = get_result_async_1.getResultAsync;
Object.defineProperty(exports, "getResultAsync", { enumerable: true, get: function () { return get_result_async_1.getResultAsync; } });
var get_optional_1 = require("./functions/get-optional");
exports.getOptional = get_optional_1.getOptional;
exports.getOptionalPartial = get_optional_1.getOptionalPartial;
Object.defineProperty(exports, "getOptional", { enumerable: true, get: function () { return get_optional_1.getOptional; } });
Object.defineProperty(exports, "getOptionalPartial", { enumerable: true, get: function () { return get_optional_1.getOptionalPartial; } });
var get_optional_async_1 = require("./functions/get-optional-async");
exports.getOptionalAsync = get_optional_async_1.getOptionalAsync;
exports.getOptionalAsyncPartial = get_optional_async_1.getOptionalAsyncPartial;
Object.defineProperty(exports, "getOptionalAsync", { enumerable: true, get: function () { return get_optional_async_1.getOptionalAsync; } });
Object.defineProperty(exports, "getOptionalAsyncPartial", { enumerable: true, get: function () { return get_optional_async_1.getOptionalAsyncPartial; } });
//# sourceMappingURL=index.js.map

@@ -17,2 +17,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.AsyncOptional = exports.None = void 0;
exports.None = Symbol();

@@ -19,0 +20,0 @@ class AsyncOptional {

@@ -17,2 +17,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.AsyncResult = void 0;
const get_success_async_1 = require("../functions/get-success-async");

@@ -72,6 +73,4 @@ const get_failure_async_1 = require("../functions/get-failure-async");

return new AsyncResult((async () => {
const [fail, ret] = await get_failure_async_1.getFailureAsync(__classPrivateFieldGet(this, _promise));
if (fail)
throw ret;
return mapper(ret);
const result = await __classPrivateFieldGet(this, _promise);
return mapper(result);
})());

@@ -78,0 +77,0 @@ }

@@ -17,2 +17,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.Optional = void 0;
class Optional {

@@ -19,0 +20,0 @@ static of(value) {

@@ -17,2 +17,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.Result = void 0;
class Result {

@@ -19,0 +20,0 @@ static of(value) {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getErrorAsyncIterable = void 0;
async function getErrorAsyncIterable(iterable) {

@@ -4,0 +5,0 @@ try {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getErrorAsync = void 0;
async function getErrorAsync(promise) {

@@ -4,0 +5,0 @@ try {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getErrorResultAsync = void 0;
async function getErrorResultAsync(promise) {

@@ -4,0 +5,0 @@ try {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getErrorResult = void 0;
function getErrorResult(fn) {

@@ -4,0 +5,0 @@ try {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getError = void 0;
function getError(fn) {

@@ -4,0 +5,0 @@ try {

@@ -1,1 +0,1 @@

export declare function getFailureAsync<X, T>(promise: PromiseLike<T>): Promise<[false, T] | [true, X]>;
export declare function getFailureAsync<X>(promise: PromiseLike<unknown>): Promise<[true, X] | [false, undefined]>;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getFailureAsync = void 0;
async function getFailureAsync(promise) {
try {
const result = await promise;
return [false, result];
await promise;
return [false, void 0];
}

@@ -8,0 +9,0 @@ catch (e) {

@@ -1,1 +0,1 @@

export declare function getFailure<X, T>(fn: () => T): [false, T] | [true, X];
export declare function getFailure<X>(fn: () => unknown): [true, X] | [false, undefined];
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getFailure = void 0;
function getFailure(fn) {
try {
const result = fn();
return [false, result];
fn();
return [false, void 0];
}

@@ -8,0 +9,0 @@ catch (e) {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getOptionalAsync = exports.getOptionalAsyncPartial = void 0;
const async_optional_1 = require("../classes/async-optional");

@@ -4,0 +5,0 @@ function getOptionalAsyncPartial(isNone) {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getOptional = exports.getOptionalPartial = void 0;
const optional_1 = require("../classes/optional");

@@ -4,0 +5,0 @@ function getOptionalPartial(isNone) {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getResultAsync = void 0;
const async_result_1 = require("../classes/async-result");

@@ -4,0 +5,0 @@ function getResultAsync(promise) {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getResultErrorAsync = void 0;
async function getResultErrorAsync(promise) {

@@ -4,0 +5,0 @@ try {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getResultError = void 0;
function getResultError(fn) {

@@ -4,0 +5,0 @@ try {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getResult = void 0;
const result_1 = require("../classes/result");

@@ -4,0 +5,0 @@ function getResult(fn) {

@@ -1,1 +0,1 @@

export declare function getSuccessAsync<X, T>(promise: PromiseLike<T>): Promise<[true, T] | [false, X]>;
export declare function getSuccessAsync<T>(promise: PromiseLike<T>): Promise<[true, T] | [false, undefined]>;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getSuccessAsync = void 0;
async function getSuccessAsync(promise) {

@@ -9,3 +10,3 @@ try {

catch (e) {
return [false, e];
return [false, void 0];
}

@@ -12,0 +13,0 @@ }

@@ -1,1 +0,1 @@

export declare function getSuccess<X, T>(fn: () => T): [true, T] | [false, X];
export declare function getSuccess<T>(fn: () => T): [true, T] | [false, undefined];
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getSuccess = void 0;
function getSuccess(fn) {

@@ -9,3 +10,3 @@ try {

catch (e) {
return [false, e];
return [false, void 0];
}

@@ -12,0 +13,0 @@ }

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isFailureAsync = void 0;
async function isFailureAsync(promise) {

@@ -4,0 +5,0 @@ try {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isFailure = void 0;
function isFailure(fn) {

@@ -4,0 +5,0 @@ try {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isSuccessAsync = void 0;
async function isSuccessAsync(promise) {

@@ -4,0 +5,0 @@ try {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isSuccess = void 0;
function isSuccess(fn) {

@@ -4,0 +5,0 @@ try {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var get_error_result_1 = require("./functions/get-error-result");
exports.getErrorResult = get_error_result_1.getErrorResult;
Object.defineProperty(exports, "getErrorResult", { enumerable: true, get: function () { return get_error_result_1.getErrorResult; } });
var get_error_result_async_1 = require("./functions/get-error-result-async");
exports.getErrorResultAsync = get_error_result_async_1.getErrorResultAsync;
Object.defineProperty(exports, "getErrorResultAsync", { enumerable: true, get: function () { return get_error_result_async_1.getErrorResultAsync; } });
var get_result_error_1 = require("./functions/get-result-error");
exports.getResultError = get_result_error_1.getResultError;
Object.defineProperty(exports, "getResultError", { enumerable: true, get: function () { return get_result_error_1.getResultError; } });
var get_result_error_async_1 = require("./functions/get-result-error-async");
exports.getResultErrorAsync = get_result_error_async_1.getResultErrorAsync;
Object.defineProperty(exports, "getResultErrorAsync", { enumerable: true, get: function () { return get_result_error_async_1.getResultErrorAsync; } });
var get_success_1 = require("./functions/get-success");
exports.getSuccess = get_success_1.getSuccess;
Object.defineProperty(exports, "getSuccess", { enumerable: true, get: function () { return get_success_1.getSuccess; } });
var get_success_async_1 = require("./functions/get-success-async");
exports.getSuccessAsync = get_success_async_1.getSuccessAsync;
Object.defineProperty(exports, "getSuccessAsync", { enumerable: true, get: function () { return get_success_async_1.getSuccessAsync; } });
var get_failure_1 = require("./functions/get-failure");
exports.getFailure = get_failure_1.getFailure;
Object.defineProperty(exports, "getFailure", { enumerable: true, get: function () { return get_failure_1.getFailure; } });
var get_failure_async_1 = require("./functions/get-failure-async");
exports.getFailureAsync = get_failure_async_1.getFailureAsync;
Object.defineProperty(exports, "getFailureAsync", { enumerable: true, get: function () { return get_failure_async_1.getFailureAsync; } });
var is_success_1 = require("./functions/is-success");
exports.isSuccess = is_success_1.isSuccess;
Object.defineProperty(exports, "isSuccess", { enumerable: true, get: function () { return is_success_1.isSuccess; } });
var is_success_async_1 = require("./functions/is-success-async");
exports.isSuccessAsync = is_success_async_1.isSuccessAsync;
Object.defineProperty(exports, "isSuccessAsync", { enumerable: true, get: function () { return is_success_async_1.isSuccessAsync; } });
var is_failure_1 = require("./functions/is-failure");
exports.isFailure = is_failure_1.isFailure;
Object.defineProperty(exports, "isFailure", { enumerable: true, get: function () { return is_failure_1.isFailure; } });
var is_failure_async_1 = require("./functions/is-failure-async");
exports.isFailureAsync = is_failure_async_1.isFailureAsync;
Object.defineProperty(exports, "isFailureAsync", { enumerable: true, get: function () { return is_failure_async_1.isFailureAsync; } });
var get_error_1 = require("./functions/get-error");
exports.getError = get_error_1.getError;
Object.defineProperty(exports, "getError", { enumerable: true, get: function () { return get_error_1.getError; } });
var get_error_async_1 = require("./functions/get-error-async");
exports.getErrorAsync = get_error_async_1.getErrorAsync;
Object.defineProperty(exports, "getErrorAsync", { enumerable: true, get: function () { return get_error_async_1.getErrorAsync; } });
var get_error_async_iterable_1 = require("./functions/get-error-async-iterable");
exports.getErrorAsyncIterable = get_error_async_iterable_1.getErrorAsyncIterable;
Object.defineProperty(exports, "getErrorAsyncIterable", { enumerable: true, get: function () { return get_error_async_iterable_1.getErrorAsyncIterable; } });
var get_result_1 = require("./functions/get-result");
exports.getResult = get_result_1.getResult;
Object.defineProperty(exports, "getResult", { enumerable: true, get: function () { return get_result_1.getResult; } });
var get_result_async_1 = require("./functions/get-result-async");
exports.getResultAsync = get_result_async_1.getResultAsync;
Object.defineProperty(exports, "getResultAsync", { enumerable: true, get: function () { return get_result_async_1.getResultAsync; } });
var get_optional_1 = require("./functions/get-optional");
exports.getOptional = get_optional_1.getOptional;
exports.getOptionalPartial = get_optional_1.getOptionalPartial;
Object.defineProperty(exports, "getOptional", { enumerable: true, get: function () { return get_optional_1.getOptional; } });
Object.defineProperty(exports, "getOptionalPartial", { enumerable: true, get: function () { return get_optional_1.getOptionalPartial; } });
var get_optional_async_1 = require("./functions/get-optional-async");
exports.getOptionalAsync = get_optional_async_1.getOptionalAsync;
exports.getOptionalAsyncPartial = get_optional_async_1.getOptionalAsyncPartial;
Object.defineProperty(exports, "getOptionalAsync", { enumerable: true, get: function () { return get_optional_async_1.getOptionalAsync; } });
Object.defineProperty(exports, "getOptionalAsyncPartial", { enumerable: true, get: function () { return get_optional_async_1.getOptionalAsyncPartial; } });
//# sourceMappingURL=index.js.map
{
"name": "return-style",
"version": "0.5.1",
"version": "0.6.0",
"description": "Non-intrusively convert the return value of any function or promise into the style that the user needs.",

@@ -35,15 +35,15 @@ "files": [

"devDependencies": {
"@rollup/plugin-typescript": "^4.1.1",
"@types/jest": "^25.2.1",
"@types/node": "^13.13.4",
"@rollup/plugin-typescript": "^4.1.2",
"@types/jest": "^25.2.3",
"@types/node": "^14.0.4",
"husky": "^4.2.5",
"iterable-operator": "^0.10.1",
"jest": "^25.5.2",
"rollup": "^2.7.5",
"ts-jest": "^25.4.0",
"iterable-operator": "^0.10.2",
"jest": "^26.0.1",
"rollup": "^2.10.5",
"ts-jest": "^26.0.0",
"tscpaths": "^0.0.9",
"tslint": "^6.1.2",
"typescript": "^3.8.3"
"typescript": "^3.9.3"
},
"dependencies": {}
}

@@ -45,8 +45,8 @@ # return-style

### [isSuccess, Result | Error]
### [isSuccess, Result | undefined]
Return tuple (isSuccess, Result | Error)
Return tuple (isSuccess, Result | undefined)
* `function getSuccess<X, T>(fn: () => T): [true, T] | [false, X]`
* `function getSuccessAsync<X, T>(promise: PromiseLike<T>): Promise<[true, T] | [false, X]>`
* `function getSuccess<T>(fn: () => T): [true, T] | [false, undefined]`
* `function getSuccessAsync<T>(promise: PromiseLike<T>): Promise<[true, T] | [false, undefined]>`

@@ -59,8 +59,8 @@ ```ts

### [isFailure, Result | Error]
### [isFailure, Error | undefined ]
Return tuple (isFailure, Result | Error)
Return tuple (isFailure, Error | undefined)
* `function getFailure<X, T>(fn: () => T): [false, T] | [true, X]`
* `function getFailureAsync<X, T>(promise: PromiseLike<T>): Promise<[false, T] | [true, X]>`
* `function getFailure<X>(fn: () => unknown): [true, X] | [false, undefined]`
* `function getFailureAsync<X>(promise: PromiseLike<unknown>): Promise<[true, X] | [false, undefined]>`

@@ -67,0 +67,0 @@ ```ts

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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