🐛 Fix arguments

master
KaKi87 2022-07-16 19:52:08 +02:00
parent 5e45f90aab
commit 5bdffbb546
1 changed files with 3 additions and 3 deletions

6
mod.js
View File

@ -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('');
};