Comparing version 2.0.0-beta.5 to 2.0.0-beta.6
{ | ||
"name": "shades", | ||
"version": "2.0.0-beta.5", | ||
"version": "2.0.0-beta.6", | ||
"description": "Lens-like functionality with a lodash-style interface.", | ||
@@ -5,0 +5,0 @@ "main": "lib/bundle.js", |
@@ -24,2 +24,3 @@ import { | ||
into, | ||
Lens, | ||
lessThan, | ||
@@ -32,2 +33,3 @@ map, | ||
minOf, | ||
mod, | ||
not, | ||
@@ -71,2 +73,11 @@ or, | ||
// Virtual Lens | ||
const toString: Lens<boolean, string> = { | ||
get: b => b.toString(), | ||
mod: f => b => !!f(b.toString()) | ||
}; | ||
get("goldMember", toString)(user); // $ExpectType string | ||
mod("goldMember", toString)(s => s.toUpperCase())(user); // $ExpectType User | ||
mod("freinds", toString)(s => s.toUpperCase())(user); // $ExpectError | ||
into("a")({ a: 10 }); // $ExpectType number | ||
@@ -200,2 +211,14 @@ into("b")({ a: 10 }); // $ExpectError | ||
add(1)(3); // $ExpectType number | ||
add(1)("s"); // $ExpectError | ||
sub(1)(3); // $ExpectType number | ||
sub(1)("s"); // $ExpectError | ||
inc(1); // $ExpectType number | ||
inc(""); // $ExpectError | ||
dec(1); // $ExpectType number | ||
dec(""); // $ExpectError | ||
identity(10); // $ExpectType 10 | ||
@@ -273,14 +296,2 @@ identity("butts"); // $ExpectType "butts" | ||
add(1)(3); // $ExpectType number | ||
add(1)("s"); // $ExpectError | ||
sub(1)(3); // $ExpectType number | ||
sub(1)("s"); // $ExpectError | ||
inc(1); // $ExpectType number | ||
inc(""); // $ExpectError | ||
dec(1); // $ExpectType number | ||
dec(""); // $ExpectError | ||
includes("hello")("hello"); // $ExpectType boolean | ||
@@ -287,0 +298,0 @@ includes("hello")(false); // $ExpectError |
@@ -95,3 +95,3 @@ // TypeScript Version: 3.1 | ||
traversal: true; | ||
traversal?: true; | ||
} | ||
@@ -104,3 +104,3 @@ | ||
traversal: false; | ||
traversal?: false; | ||
} |
Sorry, the diff of this file is too big to display
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
4787864
2825