* Return true if string begins with the characters of the specified string. * Polyfill copied from MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string/startsWith * * @param {string} search * @param {number=} rawPos * @return {boolean} * @this {string}
(search, rawPos)
| 8 | * @this {string} |
| 9 | */ |
| 10 | function startsWith(search, rawPos) { |
| 11 | const pos = rawPos > 0 ? rawPos | 0 : 0; |
| 12 | // eslint-disable-next-line local/no-invalid-this |
| 13 | return this.substr(pos, search.length) === search; |
| 14 | } |
| 15 | |
| 16 | /** |
| 17 | * Sets the String.startsWith polyfill if it does not exist. |
nothing calls this directly
no outgoing calls
no test coverage detected