1.0.2 • Published 4 years ago

@musicbattles/helpers-utils v1.0.2

Weekly downloads
-
License
-
Repository
-
Last release
4 years ago

Helpers utils

Librería de utilidades. Actualmente cuenta con funciones y directives

Instalación

npm i @musicbattles/helpers-utils

Uso

import { Component, OnInit } from '@angular/core';
import { transformUpperCase } from '@musicbattles/helpers-utils;

@Component({
  selector: 'app-component',
  templateUrl: './app.component.html'
})
 export class AppComponent implements OnInit {
     
     ngOnInit(){
         const resutl = transformUpperCase("example");
     }
 }

Métodos

NameTypeType valueDescription
ConvertColorstatic classstringTransform color hex to rgb
generateFileExcelfunctiondata: Array, nameFile: stringGenerate file Excel
convertExcelToArrayfunctionfile: FileConvert file Excel to Array
convertDataJsonToDataGridfunctiondata: Array, headers:ArrayTransform data json to data grid
transformUpperCasefunctiontext: stringRemplace underscore to whiteSpace and uppercase
convertImgTobase64functionfile: FileListTransform file to image base64
getDataUrifunctionurl: string, callback: FunctionTransform url image to image base64
convertBlobToFilefunctiondataBlob: BlobConvert a file type Blob a File
convertFileToImagefunctionfile: Fileconvert file to image. Return to promise
imageBase64ToFilefunctionimgBase:string , name:stringTransform image in base64 to file. Return file
parseHTMLToStringfunctionvalue: stringTransform HTML to string. Return string
convertSvgToImagefunctiondata: NodeListTransform a nodeList into an image. Return Array
donwloadFilefunctionurl: stringDonwload file from a url
FormatDate.yyyymmddstatic classdate: stringTransform date in YYYY-MM-DD. Return string
FormatDate.ddmmyyyystatic classdate: stringTranform date in DD-MM-YYYY. Return string
FormatDate.utcFormatstatic classdate: stringTransform date in format UTC. Return Date
validateFormatMP4functionfile: FileValidate file video format. Return boolean
validateSizeVideofunctionfile: FileValidate size video format. Return boolean
validateFormatImagefunctionfile: FileValidate file image format. Return boolean
validateSizeImagefunctionfile: FileValidate size image format. Return boolean
validateDimentiosImagefunctionfile: File, width: number, height: numberValidate dimensions image. Return Promise
CustomerValidators.customerValidationEmailstatic classcontrol: AbstractControlMail validation through regex. Return ValidationErrorsnull
CustomerValidators.customerValidationTypeObjectstatic classcontrol: AbstractControlValidate string type. Return ValidationErrorsnull
CustomerValidators.rangeDatestatic classcontrol: AbstractControlValid start date is not greater than the end date. Return ValidationErrorsnull

Directivas

NameName moduleDescription
appOnlynumbersOnlynumbersModuleValidate allows only number entry
appValidationFormSubmitValidationFormModuleDirective for validate form. Import module ValidationFormModule to its component

License

MIT

Autor

Daniel Garcia