Sha256: 209214bea06433d3f9b42a7872f3678ffd8106f2e2321a3fff95b6ee59b4134f
Contents?: true
Size: 447 Bytes
Versions: 69
Compression:
Stored size: 447 Bytes
Contents
define(['../math/clamp', '../lang/toString'], function (clamp, toString) { /** * Inserts a string at a given index. */ function insert(string, index, partial){ string = toString(string); if (index < 0) { index = string.length + index; } index = clamp(index, 0, string.length); return string.substr(0, index) + partial + string.substr(index); } return insert; });
Version data entries
69 entries across 69 versions & 2 rubygems