mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2024-12-22 12:50:36 +01:00
Replace deprecated String.prototype.substr()
This commit is contained in:
parent
dc593daba8
commit
bfa355b58d
@ -17,7 +17,7 @@ const fs = require("fs");
|
|||||||
function getAlphaVersion(manifest){
|
function getAlphaVersion(manifest){
|
||||||
"use strict";
|
"use strict";
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
const date = now.toISOString().substr(0, 10).replace(/-/g, "");
|
const date = now.toISOString().substring(0, 10).replace(/-/g, "");
|
||||||
return manifest.version.replace(/^([\d.]+).*$/, "$1Alpha" + date);
|
return manifest.version.replace(/^([\d.]+).*$/, "$1Alpha" + date);
|
||||||
}
|
}
|
||||||
function getRCVersion(manifest){
|
function getRCVersion(manifest){
|
||||||
|
@ -126,10 +126,10 @@ const decompressed2 = decompress(compressed2, usedWords);
|
|||||||
console.log("test: ", compressed === decompressed2);
|
console.log("test: ", compressed === decompressed2);
|
||||||
for (let start = 0; start < compressed.length; start += 100){
|
for (let start = 0; start < compressed.length; start += 100){
|
||||||
|
|
||||||
if (compressed.substr(start, 100) !== decompressed2.substr(start, 100)){
|
if (compressed.substring(start, start + 100) !== decompressed2.substring(start, start + 100)){
|
||||||
console.log(start);
|
console.log(start);
|
||||||
console.log(compressed.substr(start, 100));
|
console.log(compressed.substring(start, start + 100));
|
||||||
console.log(decompressed2.substr(start, 100));
|
console.log(decompressed2.substring(start, start + 100));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ var log = function(){
|
|||||||
str.unshift("color: green");
|
str.unshift("color: green");
|
||||||
str.unshift("%cOK");
|
str.unshift("%cOK");
|
||||||
}
|
}
|
||||||
else if (str[str.length - 1].substr(0, 9) === "missmatch"){
|
else if (str[str.length - 1].startsWith("missmatch")){
|
||||||
str.unshift("color: red");
|
str.unshift("color: red");
|
||||||
str.unshift("%cX");
|
str.unshift("%cX");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user