Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comments and minor improvements for utils.ts #83

Open
wants to merge 13 commits into
base: staging
Choose a base branch
from

Commits on Sep 6, 2023

  1. feat(utils): improve error handling in checkResponseError

    Refactored the checkResponseError function to handle Axios errors more effectively. Now, if an error response contains either an "error" or a "detail" property, it will throw an Error with the corresponding message. This change improves the error reporting and makes the code more robust.
    
    Closes cashubtc#123
    Constantin Vennekel committed Sep 6, 2023
    Configuration menu
    Copy the full SHA
    99b4083 View commit details
    Browse the repository at this point in the history
  2. feat(utils): improve type checking in isObj function

    The `isObj` function in the `utils.ts` file has been updated to provide more accurate type checking. Instead of simply checking if the value is an object, it now checks if the value is an object with a string key and unknown value. This change improves the reliability of type checking in the codebase, because in TypeScript, null is considered an object, which can lead to unexpected behavior.
    Constantin Vennekel committed Sep 6, 2023
    Configuration menu
    Copy the full SHA
    cbed4b2 View commit details
    Browse the repository at this point in the history
  3. feat(utils): cleanup

    - added explainer comments
    - made check response error more concise
    Constantin Vennekel committed Sep 6, 2023
    Configuration menu
    Copy the full SHA
    985bcb3 View commit details
    Browse the repository at this point in the history

Commits on Sep 29, 2023

  1. Merge branch 'main' into fix/ErrorHandling

    Constantin Vennekel committed Sep 29, 2023
    Configuration menu
    Copy the full SHA
    97f8924 View commit details
    Browse the repository at this point in the history

Commits on Oct 9, 2023

  1. Merge branch 'main' into fix/ErrorHandling

    Constantin Vennekel committed Oct 9, 2023
    Configuration menu
    Copy the full SHA
    d2f4e41 View commit details
    Browse the repository at this point in the history
  2. feat(utils): add documentation

    changes:
    - Exported `splitAmount`, `getDefaultAmountPreference`, `bytesToNumber`, `hexToNumber`, and `bigIntStringify` functions.
    - Added JSDoc comments for new functions: `isPowerOfTwo`, `getPreference`, and other utility functions.
    - Improved code readability by adding line breaks and indentation.
    Constantin Vennekel committed Oct 9, 2023
    Configuration menu
    Copy the full SHA
    c4118e3 View commit details
    Browse the repository at this point in the history

Commits on Apr 12, 2024

  1. Merge branch 'main' into fix/ErrorHandling

    Constantin Vennekel committed Apr 12, 2024
    Configuration menu
    Copy the full SHA
    5559488 View commit details
    Browse the repository at this point in the history
  2. Fix error handling in splitAmount function

    Added try-catch block to handle errors when getting preferences. Log error message if an exception occurs during preference retrieval.
    Constantin Vennekel committed Apr 12, 2024
    Configuration menu
    Copy the full SHA
    3d3d0e6 View commit details
    Browse the repository at this point in the history
  3. Refactor token decoding and prefix removal

    - Refactored code to separate prefix removal logic into a new function. Updated getDecodedToken to utilize this function for removing prefixes before handling tokens.
    Constantin Vennekel committed Apr 12, 2024
    Configuration menu
    Copy the full SHA
    a789bdc View commit details
    Browse the repository at this point in the history
  4. Refactor keyset id derivation, proofs sorting, URL joining,

    and invoice decoding functions. Add type annotations and cleanup code.
    Constantin Vennekel committed Apr 12, 2024
    Configuration menu
    Copy the full SHA
    130ce07 View commit details
    Browse the repository at this point in the history
  5. Refactor isPowerOfTwo function for type safety

    The isPowerOfTwo function in utils.ts was updated to include type annotations for better type safety. The return value now explicitly states the boolean type.
    Constantin Vennekel committed Apr 12, 2024
    Configuration menu
    Copy the full SHA
    53eb605 View commit details
    Browse the repository at this point in the history
  6. Refactor bigIntStringify to handle non-bigint values

    The function bigIntStringify now returns a stringified value using JSON.stringify for non-bigint values.
    Constantin Vennekel committed Apr 12, 2024
    Configuration menu
    Copy the full SHA
    8910261 View commit details
    Browse the repository at this point in the history

Commits on Apr 22, 2024

  1. Configuration menu
    Copy the full SHA
    31d61a2 View commit details
    Browse the repository at this point in the history