Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (value === undefined) return "undefined";
if (value === null) return "null";
if (value.constructor == OnigString) return value;
return value.toString();
};
OnigScanner.prototype.convertToNumber = function(value) {
value = parseInt(value);
if (!isFinite(value)) {
value = 0;
}
value = Math.max(value, 0);
return value;
};
OnigString.prototype.substring = function(start, end) {
return this.content.substring(start, end);
};
OnigString.prototype.toString = function(start, end) {
return this.content;
};
Object.defineProperty(OnigString.prototype, "length", {
get() {
return this.content.length;
},
// https://github.com/facebook/jest/issues/3552
configurable: true,
});
// exports.OnigScanner = OnigScanner
if (!isFinite(value)) {
value = 0;
}
value = Math.max(value, 0);
return value;
};
OnigString.prototype.substring = function(start, end) {
return this.content.substring(start, end);
};
OnigString.prototype.toString = function(start, end) {
return this.content;
};
Object.defineProperty(OnigString.prototype, "length", {
get() {
return this.content.length;
},
// https://github.com/facebook/jest/issues/3552
configurable: true,
});
// exports.OnigScanner = OnigScanner
// exports.OnigRegExp = OnigRegExp
// exports.OnigString = OnigString
return { OnigScanner, OnigRegExp, OnigString };
});
/* eslint-enable */
};
OnigScanner.prototype.convertToNumber = function(value) {
value = parseInt(value);
if (!isFinite(value)) {
value = 0;
}
value = Math.max(value, 0);
return value;
};
OnigString.prototype.substring = function(start, end) {
return this.content.substring(start, end);
};
OnigString.prototype.toString = function(start, end) {
return this.content;
};
Object.defineProperty(OnigString.prototype, "length", {
get() {
return this.content.length;
},
// https://github.com/facebook/jest/issues/3552
configurable: true,
});
// exports.OnigScanner = OnigScanner
// exports.OnigRegExp = OnigRegExp
// exports.OnigString = OnigString
return { OnigScanner, OnigRegExp, OnigString };
});