]> git.r.bdr.sh - rbdr/dotfiles/blob
24ce16d3bce6e145b114dd6407e157f4197c3c2d
[rbdr/dotfiles] /
1 'use strict';
2
3 var indexOf = String.prototype.indexOf, slice = String.prototype.slice;
4
5 module.exports = function (search, replace) {
6 var index = indexOf.call(this, search);
7 if (index === -1) return String(this);
8 return slice.call(this, 0, index) + replace +
9 slice.call(this, index + String(search).length);
10 };