0.5.0 • Published 3 years ago
nest-pertools v0.5.0
Nest Persian Tools
Have the most used and sensitive Persian tools! This package uses
persian-tools2
Installation
$ npm install --save nest-pertools
# or
$ yarn add nest-pertools
Getting Started
Import PersianToolsModule in the root module of the application.
app.module.ts
import { Module } from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { PersianToolsModule } from 'nest-pertools';
@Module({
imports: [PersianToolsModule],
controllers: [AppController],
providers: [AppService],
})
export class AppModule {}
Inject PersianToolsService in the your service of the application.
your.service.ts
import { Injectable } from '@nestjs/common';
import { PersianToolsService } from 'nest-pertools';
@Injectable()
export class YourRedisService {
constructor(private readonly toolsService: PersianToolsService) {}
// You can use all toolsService methods ...
}
PersianToolsService Api
Method | Arguments |
---|---|
convertFromString | ( input, options?: { digits?: string, addCommas?: boolean, fuzzy?: boolean } ) |
convertFromNumber | ( input, options?: {ordinal: boolean} ) |
addCommas | ( input ) |
removeCommas | ( input ) |
digitsArToFa | ( input ) |
digitsArToEn | ( input ) |
digitsEnToFa | ( input ) |
digitsFaToEn | ( input ) |
verifyIranianNationalId | ( input ) |
getPlaceByIranNationalId | ( input ) |
verifyCardNumber | ( input ) |
getBankNameFromCardNumber | ( input ) |
isPersian | ( input ) |
toPersianChars | ( input ) |
urlFix | ( input ) |
billRials | ( input: { billId: number, paymentId: number } ) |
billTomans | ( input: { billId: number, paymentId: number } ) |
billType | ( input: { billId: number, paymentId: number } ) |
billValidBillId | ( input: { billId: number, paymentId: number } ) |
billValidBillPayment | ( input: { billId: number, paymentId: number } ) |
billValid | ( input: { billId: number, paymentId: number } ) |
billBarcode | ( input: { billId: number, paymentId: number } ) |
billFindByBarcode | ( input: string ) |
shebaValidate | ( input: string ) |
shebaRecognize | ( input: string ) |
halfSpace | ( input: string ) |
Change Log
See Changelog for more information.
Contributing
Contributions welcome! See Contributing.
Author
Mostafa Gholami
mst-ghi
0.5.0
3 years ago