diff --git a/index.js b/index.js index 2e2a92e..b21ecea 100644 --- a/index.js +++ b/index.js @@ -9,11 +9,14 @@ function pify(fn, arg1, arg2) { }); } -// The method startsWith is not defined on string objects in node 0.10 -// eslint-disable-next-line no-extend-native -String.prototype.startsWith = function(suffix) { - return this.substring(0, suffix.length) === suffix; -}; +/* istanbul ignore next */ +if (!String.prototype.startsWith) { + // The method startsWith is not defined on string objects in node 0.10 + // eslint-disable-next-line no-extend-native + String.prototype.startsWith = function(suffix) { + return this.substring(0, suffix.length) === suffix; + }; +} var pidtree = require('./lib/pidtree');