All files / test/ctp/adapter/payshield lmk.ts

73.91% Statements 17/23
66.66% Branches 2/3
100% Functions 1/1
73.91% Lines 17/23

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 241x 1x 1x 1x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x             2x 2x 1x  
import {library} from '@feasibleone/blong';
 
export default library(
    () =>
        function lmk(data: {lmkIdentifier: number | ''}) {
            const {lmkIdentifier} = data;
            const params =
                lmkIdentifier === '' || isNaN(lmkIdentifier)
                    ? {
                          delimiterLmkLen: 0,
                          delimiterLmk: '',
                          lmkIdentifierLen: 0,
                          lmkIdentifier: '',
                      }
                    : {
                          delimiterLmk: '%',
                          delimiterLmkLen: 1,
                          lmkIdentifier: `00${lmkIdentifier}`.slice(-2),
                          lmkIdentifierLen: 2,
                      };
            return {...data, ...params};
        },
);