mirror of
https://github.com/horsicq/Detect-It-Easy.git
synced 2026-06-24 01:54:08 +00:00
special_db -> dbs_special && _init refactored
This commit is contained in:
parent
aa6ff5dcf6
commit
363222b4b4
2 changed files with 7 additions and 6 deletions
13
db/_init
13
db/_init
|
|
@ -49,6 +49,9 @@ function init() {
|
|||
*/
|
||||
function result() {
|
||||
if (bDetected) {
|
||||
sVersion = sVersion ? sVersion : String();
|
||||
sOptions = sOptions ? sOptions : String();
|
||||
|
||||
_setResult(sType, sName, sVersion, sOptions);
|
||||
|
||||
if (sLang) {
|
||||
|
|
@ -58,8 +61,6 @@ function result() {
|
|||
_setLang(sLang);
|
||||
}
|
||||
}
|
||||
|
||||
bDetected = false;
|
||||
}
|
||||
|
||||
sName = sVersion = sOptions = sLang = sLangVersion = '';
|
||||
|
|
@ -122,21 +123,21 @@ String.prototype.addIfNone = function (substring) {
|
|||
|
||||
|
||||
// Some ECMA6 functions that should be removed if DIE transitions to it
|
||||
String.prototype.beginsWith = function (s, min) { //the default case-sensitive version of beginsWith
|
||||
String.prototype.beginsWith = function (s, min) { // the default case-sensitive version of beginsWith
|
||||
var m = (typeof min == "number") ? Math.min(s.length, min) : 0;
|
||||
if (s.length > this.length - m) return false; else return this.slice(m, s.length) == s
|
||||
}
|
||||
|
||||
String.prototype.beginsWithCI = function (s, min) { //case-insensitive version of beginsWith
|
||||
String.prototype.beginsWithCI = function (s, min) { // case-insensitive version of beginsWith
|
||||
return this.toLowerCase().beginsWith(s.toLowerCase(), min)
|
||||
}
|
||||
|
||||
String.prototype.endsWith = function (s, max) { //the default case-sensitive version of endsWith
|
||||
String.prototype.endsWith = function (s, max) { // the default case-sensitive version of endsWith
|
||||
var m = (typeof max == "number") ? Math.min(this.length, max) : this.length;
|
||||
if (s.length > m) return false; else return this.slice(m - s.length, m) == s
|
||||
}
|
||||
|
||||
String.prototype.endsWithCI = function (s, max) { //the case-insensitive version of endsWith
|
||||
String.prototype.endsWithCI = function (s, max) { // the case-insensitive version of endsWith
|
||||
return this.toLowerCase().endsWith(s.toLowerCase(), max)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue