🐛 Fix arguments

master
KaKi87 5 months ago
parent 5e45f90aab
commit 5bdffbb546
  1. 6
      mod.js

@ -13,9 +13,9 @@ const stringSplice = (
) => {
const
_string = (typeof arg === 'string' ? arg : arg.string).split(''),
_start = arg.start || start,
_deleteCount = arg.deleteCount || deleteCount,
_item = arg.item || item;
_start = typeof arg.start === 'number' ? arg.start : start,
_deleteCount = typeof arg.deleteCount === 'number' ? arg.deleteCount : deleteCount,
_item = typeof arg.item === 'string' ? arg.item : item;
_string.splice(_start, _deleteCount, _item);
return _string.join('');
};

Loading…
Cancel
Save