1.0.4 • Published 2 years ago

common-operations v1.0.4

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

Common Operations

It can be used for your Common Operations which are there and some project specfic Operations are there and this is not based on any framework , you can use this package with any frontend javascript based framework.

Installation

Install package with npm

  npm install common-operations

Usage/Examples

import { generateValidationSteps} from 'common-operations'

function Steps() {
  const validationSteps = generateValidationSteps();
}

Operations present

FunctionOperationPrams
cmpVersionscompare two versions and return greater onea and b
hardCopyDoes hardCopy and Does not keep old referencedata
convertToNumberTypeconvert data to number if in proper format else 0data
arraysEqualcheck similarity of two array and return in booleana and b
generateCardIdgenerate 6 digit unique number for cart idnone
getDefaultCartProductgenerate cart modal and version field as optionalproduct , version? = null
isExistElementLocalStoragecheck existance of element in local storage and return booleankey
getItemLocalStorageget item based on key from localstoragekey
setItemLocalStorageset item in local storagekey and value
removeItemLocalStorageremove item from local storage based on keykey
addCurrenDataToAllDataIfNotExistadd current data to all data based on filed for comparison and removed duplicate itemcurrent , all , filed for comparision
convertMinToHourcomvert mminutes to HH:MMminutes
generateValidationStepsgenerate validatons steps for cart productproduct
checkProductSimilarcompare two prduct and check if they are similar or not (POS style)a and b
getTimeAsNumberOfMinutesconvert time from HH:MM to number of minutestime
parseSupplementsKDSparse supplement item in kds formatdata
getUniqueArrayBasedOnKeyget unique objects of an array according to keydata and key
allowOnlyNumberFromInputKeyget only number from the input keykey
trimStringtrim string till desired lengthstring and length
isMobileSafaricheck whether the mobile browser is safari or notnone
updateArrayBasedOnKeyupdate the array based on desired keykey , allProduct , currentProduct

Tech Stack

javascript , typescript

Badges

MIT License

Authors

🚀 About Me

Hi, I'm Ravi! 👋

I'm a frontend developer... More to come soon

🛠 Skills

Javascript, HTML, CSS , angular , node , electron , scss ...

Feedback

If you have any feedback , suggestion , please reach out to us at rrsv.gupta@gmail.com