New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@fakenickels/let-anything

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fakenickels/let-anything - npm Package Compare versions

Comparing version 0.1.0 to 1.0.0

7

package.json
{
"name": "@fakenickels/let-anything",
"version": "0.1.0",
"version": "1.0.0",
"main": "src/index.js",
"license": "MIT",
"typings": "src/index.ts",
"typings": "src/index.d.ts",
"devDependencies": {
"fp-ts": "^2.8.2",
"typescript": "^4.0.3"
},
"scripts": {
"build": "tsc --declaration"
}
}

@@ -6,3 +6,8 @@ type Config<T> = {

export function letAnything<T>(config: Config<T>) {
return (gen: () => Generator<T>) => {
interface LetAnything {
(gen: () => Generator<T, any, any>): T;
<TNext>(gen: () => Generator<T, any, TNext>): T;
}
const lettified: LetAnything = (gen: () => Generator<T, any, any>) => {
const context = gen()

@@ -12,6 +17,8 @@

? step.value
: config.let_(step.value, value => compose(context.next(value)))
: config.let_(step.value, value => compose(context.next(value as any))) // TODO: remove any
return compose(context.next())
}
return lettified
}

@@ -8,3 +8,3 @@ import {either} from 'fp-ts'

function* stuff() {
const stuff = letEither<string>(function*() {
const value = yield either.right("d");

@@ -15,7 +15,7 @@ const anotherValue = yield either.right("e");

return either.right(value + anotherValue + anotherAnother);
}
})
console.log(
either.getOrElse(error => `Something went wrong: ${error}`)(letEither(stuff))
either.getOrElse(error => `Something went wrong: ${error}`)(stuff)
)

@@ -97,3 +97,3 @@ "use strict";

});
function stuff() {
letResultAsync(function () {
var value, anotherValue, anotherAnother;

@@ -111,6 +111,5 @@ return __generator(this, function (_a) {

anotherAnother = _a.sent();
return [2 /*return*/, Promise.resolve(new Ok(value + anotherValue + anotherAnother))];
return [2 /*return*/, new Ok(value + anotherValue + anotherAnother)];
}
});
}
letResultAsync(stuff);
});

@@ -7,3 +7,3 @@ {

"lib": ["ES2018", "DOM"],
"rootDirs": [ "./src", "./tests" ],
"rootDirs": ["./src", "./tests"],
"strict": true,

@@ -10,0 +10,0 @@ "noImplicitAny": true,

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