Trying to create javascript to seperate +1 10 digit global numbers with dashes

I’ve found code for 7 and 10 digit numbers but I need to separate for 11.

For example I have numbers as +13138373884 and I need them to display as +1-313-837-3884

example for 10 digit code I found…

 var number = this.$el.find('#phoneNumberField').val().replace(/-/g, '');

    if(number.length > 10) {
        e.preventDefault();
    }

    if(number.length < 3) {
        number = number; // just for legibility
    } else if(number.length < 7) {
        number = number.substring(0,3) + 
        '-' + 
        number.substring(3,6)
    } else if(number.length > 6) {
        number = number.substring(0,3) + 
        '-' + 
        number.substring(3,6) + 
        '-' + 
        number.substring(6,10);
    }

    this.$el.find('#phoneNumberField').val(number);