# all files / node-ipc/lib/ eventParser.js

84.62% Statements 11/13
50% Branches 2/4
100% Functions 2/2
84.62% Lines 11/13

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28

    1×

    1×
    9×

    9×

    9×
    9×

    1×
    9×
    9×
    9×

    1×
     'use strict';

    const parser={
        parse       : parseDataEvents,
        format      : formatData,
        delimiter   : '\f'
    };

    function formatData(message){
        Iif(!message.data){
            message.data={};
        }
        Iif(message.data['_maxListeners']){
            message.data={};
        }

        message=message.JSON+parser.delimiter;
        return message;
    }

    function parseDataEvents(data){
        let events=data.split(parser.delimiter);
        events.pop();
        return events;
    }

    module.exports=parser;