lune-climate / ts-results-es

A TypeScript implementation of Rust's Result and Option.
MIT License
98 stars 8 forks source link

npm version does seems to be not in sync with repo #171

Closed PlkMarudny closed 2 months ago

PlkMarudny commented 3 months ago

I installed v 4.2.0 from the npm registry, but, for example AsyncResult.isOk() does not exist, while AsyncResult.ok property does. According to documentation, the opposite should happen. Could you have a look?

PlkMarudny commented 3 months ago

Or maybe I use the package incorrectly?

const functionAsync = async (arg) => {
    try {
        await someAsyncFunction(arg);
        return new AsyncResult(Ok(true));
    } catch {
        return new AsyncResult(Err(false));
    }
};

// call the function
const result = await functionAsync("some_argument");

if (result.IsErr()) ... // --- > result.isErr() is not a function
PlkMarudny commented 3 months ago

And your account here seems to be hacked, a comment with a link to a binary download from MediaFire appeared shortly.

jstasiak commented 3 months ago

Hey,

AsyncResult has neither ok nor isOk. May I ask where in the documentation do you see references to either of these in the context of AsyncResult? Same for isErr (or IsErr – you have it misspelled in the example in your second commend). See https://ts-results-es.readthedocs.io/en/latest/reference/asyncresult.html for the AsyncResult API.

Granted, do we do have some not-yet-released patches in the repository but nothing related to what you're asking about.

And your account here seems to be hacked, a comment with a link to a binary download from MediaFire appeared shortly.

Can you provide any details here? Appeared where?

PlkMarudny commented 3 months ago

A comment appeared: image

jstasiak commented 3 months ago

That account is not affiliated with the project.

Can you confirm that the documented AsyncResult API matches what you're seeing?

PlkMarudny commented 3 months ago

I do, my bad. Did not find the example how to use AsyncResult properly.

On Wed, Aug 28, 2024, 16:53 Jakub Stasiak @.***> wrote:

That account is not affiliated with the project.

Can you confirm that the documented AsyncResult API matches what you're seeing?

— Reply to this email directly, view it on GitHub https://github.com/lune-climate/ts-results-es/issues/171#issuecomment-2315238599, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABBI252MEQ36NHXMXTMSTATZTXB25AVCNFSM6AAAAABNH7S57KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMJVGIZTQNJZHE . You are receiving this because you authored the thread.Message ID: @.***>

jstasiak commented 2 months ago

I'll close this as I don't think the originally reported problem exists.

Please reopen and provide more information if this is still an issue for you.