Skip to content
This repository has been archived by the owner on Jul 28, 2020. It is now read-only.

epsitec-sa/electrum-utils

Repository files navigation

Electrum utilities

React components which work with Electrum might need some of the functionality provided by these utility functions.

  • getInstanceMethodNames (obj, stop) → gets an array of method names by walking obj's prototype chain until (optional) prototype stop is reached.
    See Enumerating methods on a JavaScript class instance for a discussion on how this works.

  • getTextSelection (element) → gets the selection as an object containing a from and a to position. Example selection: {from: 3, to: 8}. Cursor position without selection: from: 3, to: 3}.

  • shallowEqual (objA, objB) → returns true if both objects contain the same keys and values (the comparison is done by reference equality).

  • startsWithLowerCase (string) → returns true if the text starts with a lower case character (a-z, no accented characters).

  • startsWithUpperCase (string) → returns true if the text starts with an upper case character (A-Z, no accented characters).

About

Utility functions used in conjunction with Electrum

Resources

Stars

Watchers

Forks

Packages

No packages published