1.0.3 • Published 2 years ago

stanza-utils v1.0.3

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

stanza-utilities can be used to add all the functions which can be used across different JS projects in Stanza Living.

Install

npm i stanza-utils

or using yarn

yarn add stanza-utils

List of functions added:

  • pathOr: will parse and return the object if found or return the empty value passed in the function
  • isObject: will return true if the passed value is object else return false
  • isEmpty: will return true if the passed value is empty else return false
  • getUpdatedObjofForm: will return the updated form data with the updated value of the single modified component. It will receive three parameters formData, id of the updated of the object and updated object
  • findObjAndParentById: To find component and its parent in Layout form JSON, data -> Initially it will be form JSON, at recursion end it will be the component that needs to be found, parentObj -> Initially it will be form JSON, at recursion end it will be the parent component of the above component, idToFound -> ID of the Component that need to be found in Layout Form JSON, return will be object like -> { data, parentObj }
  • getPosition: will return the index of nth repetition of the substring, will receive three parameters string, subString and repetition
  • getCurrentRole: To get All the roles of logged In User, currentRole -> Possible list of roles initially empty Array, type -> for which Department you want to get roles, User Profile -> User profile of the logged In users
  • debounce:
  • roundOff:
  • getUserNameInitials:
  • getNameFromFirstMidLastName:
  • replaceWhiteSpaces:
  • containsAtleastOneChar:
  • capitalizeSentence:
  • getMaskedNum:
  • getCaptalize:
  • toTitleCase:
  • isPhoneNumber:
1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago