Skip to content

Latest commit

 

History

History
359 lines (188 loc) · 11.1 KB

utils.md

File metadata and controls

359 lines (188 loc) · 11.1 KB

Utils


Functions


Function: isQRIBAN(iban)

Defined in: src/shared/utils.ts

Parameter

  • iban string The IBAN to be checked.

Return Type

boolean true if the given IBAN is a QR-IBAN and false

Description

Checks whether the given iban is a QR-IBAN or not.


Function: isIBANValid(iban)

Defined in: src/shared/utils.ts

Parameter

  • iban string The IBAN to be checked.

Return Type

boolean true if the checksum of the given IBAN is valid and false

Description

Validates the given IBAN.


Function: formatIBAN(iban)

Defined in: src/shared/utils.ts

Parameter

  • iban string The IBAN to be formatted.

Return Type

string The formatted IBAN.

Description

Formats the given IBAN according the specifications to be easily readable.


Function: isQRReference(reference)

Defined in: src/shared/utils.ts

Parameter

  • reference string The Reference to be checked.

Return Type

boolean true if the given reference is a QR-Reference and false

Description

Checks whether the given reference is a QR-Reference or not.

Remark

The QR-Reference is a 27 digits long string containing only digits. The last digit is the checksum.


Function: isQRReferenceValid(reference)

Defined in: src/shared/utils.ts

Parameter

  • reference string The reference to be checked.

Return Type

boolean true if the given reference is valid and false

Description

Validates the given QR-Reference.


Function: isSCORReference(reference)

Defined in: src/shared/utils.ts

Parameter

  • reference string The Reference to be checked.

Return Type

boolean true if the given reference is a SCOR-Reference and false

Description

Checks whether the given reference is a SCOR-Reference or not.

Remark

The SCOR-Reference is an alphanumeric string beginning with 'RF' and containing a 2 digit checksum and a max 21 digits long reference.


Function: isSCORReferenceValid(reference)

Defined in: src/shared/utils.ts

Parameter

  • reference string The reference to be checked.

Return Type

boolean true if the given reference is valid and false

Description

Validates the given SCOR-Reference.


Function: calculateSCORReferenceChecksum(reference)

Defined in: src/shared/utils.ts

Parameter

  • reference string The max 21 digits long reference (without the "RF" and the 2 digit checksum) whose checksum should be calculated.

Return Type

string The calculated checksum as 2 digit string.

Description

Calculates the checksum according to the ISO 11649 standard.


Function: calculateQRReferenceChecksum(reference)

Defined in: src/shared/utils.ts

Parameter

  • reference string The 26 digits long reference (without the checksum) whose checksum should be calculated.

Return Type

string The calculated checksum.

Description

Calculates the checksum according the specifications.


Function: formatQRReference(reference)

Defined in: src/shared/utils.ts

Parameter

  • reference string The QR-Reference to be formatted.

Return Type

string The formatted QR-Reference.

Description

Formats the given QR-Reference according the specifications to be easily readable.


Function: formatSCORReference(reference)

Defined in: src/shared/utils.ts

Parameter

  • reference string The SCOR-Reference to be formatted.

Return Type

string The formatted SCOR-Reference.

Description

Formats the given SCOR-Reference according the specifications to be easily readable.


Function: formatReference(reference)

Defined in: src/shared/utils.ts

Parameter

  • reference string The reference to be formatted.

Return Type

string The formatted reference.

Description

Detects the type of the given reference and formats it according the specifications to be easily readable.


Function: formatAmount(amount)

Defined in: src/shared/utils.ts

Parameter

  • amount number Containing the amount to be formatted.

Return Type

string The formatted amount.

Description

Formats the given amount according the specifications to be easily readable.


Function: mm2pt(millimeters)

Defined in: src/shared/utils.ts

Parameter

  • millimeters number The millimeters you want to convert to points.

Return Type

number The converted millimeters in points.

Description

Converts millimeters to points.


Function: pt2mm(points)

Defined in: src/shared/utils.ts

Parameter

  • points number The points you want to convert to millimeters.

Return Type

number The converted points in millimeters.

Description

Converts points to millimeters.


Function: mm2px(millimeters)

Defined in: src/shared/utils.ts

Parameter

  • millimeters number The millimeters you want to convert to pixels.

Return Type

number The converted millimeters in pixels.

Description

Converts millimeters to pixels.


Function: px2mm(pixels)

Defined in: src/shared/utils.ts

Parameter

  • pixels number Containing the pixels you want to convert to millimeters.

Return Type

number The converted pixels in millimeters.

Description

Converts pixels to millimeters.


Function: getReferenceType(reference)

Defined in: src/shared/utils.ts

Parameter

Return Type

"NON" | "QRR" | "SCOR" The type of the given reference.

Description

Detects the type of the given reference.