@ioffice/fp
Advanced tools
Comparing version 0.2.0 to 0.3.0
@@ -16,2 +16,6 @@ # Changelog | ||
## [0.3.0] - April 19, 2020 | ||
- No longer running tests for node 8. | ||
## [0.2.0] - April 18, 2020 | ||
@@ -33,5 +37,6 @@ - Removed `pipeEither` and `asyncPipeEither`. | ||
[Unreleased]: https://github.com/iOffice/fp-eslib/compare/0.2.0...HEAD | ||
[Unreleased]: https://github.com/iOffice/fp-eslib/compare/0.3.0...HEAD | ||
[0.3.0]: https://github.com/iOffice/fp-eslib/compare/0.2.0...0.3.0 | ||
[0.2.0]: https://github.com/iOffice/fp-eslib/compare/0.1.0...0.2.0 | ||
[0.1.0]: https://github.com/iOffice/fp-eslib/compare/0.0.1...0.1.0 | ||
[0.0.1]: https://github.com/iOffice/fp-eslib/compare/7270ffed28016080f8bdecef9d29e059a6c3598a...0.0.1 |
@@ -1,2 +0,2 @@ | ||
import * as tslib_1 from "tslib"; | ||
import { __awaiter, __extends, __generator } from "tslib"; | ||
import { None, Some } from './Option'; | ||
@@ -261,2 +261,3 @@ import { extractLazyArg } from './Types'; | ||
var isDone = false; | ||
// eslint-disable-next-line @typescript-eslint/no-this-alias | ||
var instance = this; | ||
@@ -278,3 +279,3 @@ return { | ||
var EitherLeft = /** @class */ (function (_super) { | ||
tslib_1.__extends(EitherLeft, _super); | ||
__extends(EitherLeft, _super); | ||
function EitherLeft(value) { | ||
@@ -289,3 +290,3 @@ var _this = _super.call(this, value) || this; | ||
var EitherRight = /** @class */ (function (_super) { | ||
tslib_1.__extends(EitherRight, _super); | ||
__extends(EitherRight, _super); | ||
function EitherRight(value) { | ||
@@ -333,5 +334,5 @@ var _this = _super.call(this, value) || this; | ||
function asyncEvalIteration(cb) { | ||
return tslib_1.__awaiter(this, void 0, void 0, function () { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var _a, ex_1; | ||
return tslib_1.__generator(this, function (_b) { | ||
return __generator(this, function (_b) { | ||
switch (_b.label) { | ||
@@ -338,0 +339,0 @@ case 0: |
@@ -1,2 +0,2 @@ | ||
import * as tslib_1 from "tslib"; | ||
import { __values } from "tslib"; | ||
import { Some, None } from './Option'; | ||
@@ -10,3 +10,3 @@ var match = function (value) { | ||
try { | ||
for (var options_1 = tslib_1.__values(options), options_1_1 = options_1.next(); !options_1_1.done; options_1_1 = options_1.next()) { | ||
for (var options_1 = __values(options), options_1_1 = options_1.next(); !options_1_1.done; options_1_1 = options_1.next()) { | ||
var entry = options_1_1.value; | ||
@@ -33,3 +33,3 @@ if (entry[0] === value) | ||
try { | ||
for (var options_2 = tslib_1.__values(options), options_2_1 = options_2.next(); !options_2_1.done; options_2_1 = options_2.next()) { | ||
for (var options_2 = __values(options), options_2_1 = options_2.next(); !options_2_1.done; options_2_1 = options_2.next()) { | ||
var entry = options_2_1.value; | ||
@@ -56,3 +56,3 @@ if (entry[0]) | ||
try { | ||
for (var options_3 = tslib_1.__values(options), options_3_1 = options_3.next(); !options_3_1.done; options_3_1 = options_3.next()) { | ||
for (var options_3 = __values(options), options_3_1 = options_3.next(); !options_3_1.done; options_3_1 = options_3.next()) { | ||
var entry = options_3_1.value; | ||
@@ -59,0 +59,0 @@ if (value instanceof entry[0]) { |
@@ -1,2 +0,2 @@ | ||
import * as tslib_1 from "tslib"; | ||
import { __extends } from "tslib"; | ||
import { Left, Right } from './Either'; | ||
@@ -182,3 +182,3 @@ import { extractLazyArg } from './Types'; | ||
var OptionSome = /** @class */ (function (_super) { | ||
tslib_1.__extends(OptionSome, _super); | ||
__extends(OptionSome, _super); | ||
function OptionSome(value) { | ||
@@ -201,3 +201,3 @@ var _this = _super.call(this) || this; | ||
var OptionNone = /** @class */ (function (_super) { | ||
tslib_1.__extends(OptionNone, _super); | ||
__extends(OptionNone, _super); | ||
function OptionNone() { | ||
@@ -204,0 +204,0 @@ var _this = _super.call(this) || this; |
@@ -1,3 +0,2 @@ | ||
var _this = this; | ||
import * as tslib_1 from "tslib"; | ||
import { __awaiter, __extends, __generator } from "tslib"; | ||
import { Left, Right } from './Either'; | ||
@@ -39,3 +38,3 @@ import { None, Some } from './Option'; | ||
var TryFailure = /** @class */ (function (_super) { | ||
tslib_1.__extends(TryFailure, _super); | ||
__extends(TryFailure, _super); | ||
function TryFailure(exception) { | ||
@@ -74,3 +73,3 @@ var _this = _super.call(this) || this; | ||
var TrySuccess = /** @class */ (function (_super) { | ||
tslib_1.__extends(TrySuccess, _super); | ||
__extends(TrySuccess, _super); | ||
function TrySuccess(value) { | ||
@@ -141,5 +140,5 @@ var _this = _super.call(this) || this; | ||
*/ | ||
var TryAsync = function (r) { return tslib_1.__awaiter(_this, void 0, void 0, function () { | ||
var TryAsync = function (r) { return __awaiter(void 0, void 0, void 0, function () { | ||
var _a, err_1; | ||
return tslib_1.__generator(this, function (_b) { | ||
return __generator(this, function (_b) { | ||
switch (_b.label) { | ||
@@ -146,0 +145,0 @@ case 0: |
@@ -158,3 +158,3 @@ "use strict"; | ||
flatten() { | ||
return this.flatMap(id => id); | ||
return this.flatMap((id) => id); | ||
} | ||
@@ -264,2 +264,3 @@ /** | ||
let isDone = false; | ||
// eslint-disable-next-line @typescript-eslint/no-this-alias | ||
const instance = this; | ||
@@ -266,0 +267,0 @@ return { |
@@ -5,3 +5,3 @@ "use strict"; | ||
const match = (value, ...options) => { | ||
for (let entry of options) { | ||
for (const entry of options) { | ||
if (entry[0] === value) | ||
@@ -14,3 +14,3 @@ return Option_1.Some(entry[1]()); | ||
const ifElseChain = (...options) => { | ||
for (let entry of options) { | ||
for (const entry of options) { | ||
if (entry[0]) | ||
@@ -23,3 +23,3 @@ return Option_1.Some(entry[1]()); | ||
function matchType(value, ...options) { | ||
for (let entry of options) { | ||
for (const entry of options) { | ||
if (value instanceof entry[0]) { | ||
@@ -26,0 +26,0 @@ return Option_1.Some(entry[1](value)); |
@@ -72,3 +72,3 @@ "use strict"; | ||
flatten() { | ||
return this.flatMap(id => { | ||
return this.flatMap((id) => { | ||
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */ | ||
@@ -207,4 +207,4 @@ return id instanceof OptionW ? id : Some(id); | ||
} | ||
exports.OptionNone = OptionNone; | ||
OptionNone.instance = new OptionNone(); | ||
exports.OptionNone = OptionNone; | ||
/** | ||
@@ -211,0 +211,0 @@ * Returns a `OptionSome` instance of the given value. May throw an Error if a |
@@ -137,3 +137,3 @@ "use strict"; | ||
*/ | ||
const TryAsync = (r) => tslib_1.__awaiter(this, void 0, void 0, function* () { | ||
const TryAsync = (r) => tslib_1.__awaiter(void 0, void 0, void 0, function* () { | ||
try { | ||
@@ -140,0 +140,0 @@ return Success(yield r()); |
{ | ||
"name": "@ioffice/fp", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"description": "", | ||
@@ -16,43 +16,39 @@ "author": "iOFFICE Team", | ||
"devDependencies": { | ||
"@ioffice/ci-builder": "0.1.0", | ||
"@ioffice/fp": "0.0.1", | ||
"@ioffice/ci-builder": "0.3.3", | ||
"@ioffice/fp": "0.2.0", | ||
"@types/chai": "4.1.7", | ||
"@types/colors": "1.2.1", | ||
"@types/eslint": "4.16.6", | ||
"@types/fs-extra": "8.0.0", | ||
"@types/inquirer": "6.0.3", | ||
"@types/karma": "3.0.3", | ||
"@types/mocha": "5.2.7", | ||
"@types/karma": "5.0.0", | ||
"@types/mocha": "7.0.2", | ||
"@types/node": "12.6.2", | ||
"@types/puppeteer": "1.19.0", | ||
"@types/request-promise-native": "1.0.16", | ||
"@types/semver": "6.0.1", | ||
"@types/sinon": "7.0.13", | ||
"@types/webpack": "4.32.1", | ||
"@typescript-eslint/eslint-plugin": "1.12.0", | ||
"@typescript-eslint/parser": "1.12.0", | ||
"@types/webpack": "4.41.12", | ||
"@typescript-eslint/eslint-plugin": "2.28.0", | ||
"@typescript-eslint/parser": "2.28.0", | ||
"chai": "4.2.0", | ||
"colors": "1.3.3", | ||
"eslint": "6.0.1", | ||
"eslint": "6.8.0", | ||
"eslint-config-prettier": "6.0.0", | ||
"eslint-plugin-prettier": "3.1.0", | ||
"fs-extra": "8.1.0", | ||
"fs-extra": "9.0.0", | ||
"inquirer": "6.5.0", | ||
"karma": "4.2.0", | ||
"karma": "5.0.2", | ||
"karma-chai": "0.1.0", | ||
"karma-chrome-launcher": "3.0.0", | ||
"karma-mocha": "1.3.0", | ||
"karma-mocha": "2.0.0", | ||
"karma-spec-reporter": "0.0.32", | ||
"mocha": "6.2.0", | ||
"mocha": "7.1.1", | ||
"mocked-env": "1.3.1", | ||
"prettier": "1.18.2", | ||
"prettier": "2.0.4", | ||
"puppeteer": "1.19.0", | ||
"request": "2.88.0", | ||
"request-promise-native": "1.0.7", | ||
"semver": "6.2.0", | ||
"sinon": "7.3.2", | ||
"ts-loader": "6.0.4", | ||
"typescript": "3.5.3", | ||
"webpack": "4.41.5", | ||
"webpack-cli": "3.3.6" | ||
"ts-loader": "7.0.0", | ||
"typescript": "3.8.3", | ||
"webpack": "4.42.1", | ||
"webpack-cli": "3.3.11" | ||
}, | ||
@@ -59,0 +55,0 @@ "peerDependencies": {}, |
@@ -7,4 +7,4 @@ import { Option } from './Option'; | ||
declare type TypedTuple<B, U> = [Constructor<B>, (val: B) => U]; | ||
declare const match: <T, U>(value: T, ...options: [T, (_?: unknown) => U][]) => import("./Option").OptionW<U>; | ||
declare const ifElseChain: <A>(...options: [boolean, (_?: unknown) => A][]) => import("./Option").OptionW<A>; | ||
declare const match: <T, U>(value: T, ...options: Tuple<T, U>[]) => Option<U>; | ||
declare const ifElseChain: <A>(...options: [boolean, (_?: unknown) => A][]) => Option<A>; | ||
declare function matchType<V, U, T1>(value: V, case1: TypedTuple<T1, U>): Option<U>; | ||
@@ -11,0 +11,0 @@ declare function matchType<V, U, T1, T2>(value: V, case1: TypedTuple<T1, U>, case2: TypedTuple<T2, U>): Option<U>; |
@@ -173,3 +173,3 @@ import { Either } from './Either'; | ||
*/ | ||
declare const Maybe: <A>(val: A | null | undefined) => OptionW<A>; | ||
declare const Maybe: <A>(val: A | null | undefined) => Option<A>; | ||
export { Option, OptionW, OptionSome, OptionNone, Some, None, Maybe }; |
@@ -99,7 +99,7 @@ import { Either } from './Either'; | ||
*/ | ||
declare const Failure: <T>(exception: Error) => TryW<T>; | ||
declare const Failure: <T>(exception: Error) => Try<T>; | ||
/** | ||
* Returns a `TrySuccess` instance of the given value. | ||
*/ | ||
declare const Success: <T>(val: T | null | undefined) => TryW<T>; | ||
declare const Success: <T>(val: T | null | undefined) => Try<T>; | ||
/** | ||
@@ -109,3 +109,3 @@ * Constructs a `Try` using the anonymous function parameter. This method will | ||
*/ | ||
declare const Try: <T>(r: (_?: unknown) => T) => TryW<T>; | ||
declare const Try: <T>(r: (_?: unknown) => T) => Try<T>; | ||
/** | ||
@@ -115,3 +115,3 @@ * Constructs a `Try` using the async anonymous function parameter. This method | ||
*/ | ||
declare const TryAsync: <T>(r: (_?: unknown) => Promise<T>) => Promise<TryW<T>>; | ||
declare const TryAsync: <T>(r: (_?: unknown) => Promise<T>) => Promise<Try<T>>; | ||
/** | ||
@@ -118,0 +118,0 @@ * Since we cannot build a `Try` object without the new keyword (case classes |
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
74320
37
2167