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

26.08% Statements 6/23
100% Branches 1/1
0% Functions 0/1
26.08% Lines 6/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                                   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};
        },
);