Skip to content

refactor: replace deprecated String.prototype.substr() #281

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion auth-next/apple.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ function appleNonceNode() {
crypto.randomFillSync(buf);
nonce = decoder.write(buf);
}
return nonce.substr(0, length);
return nonce.slice(0, length);
};

const unhashedNonce = generateNonce(10);
Expand Down
2 changes: 1 addition & 1 deletion auth/apple.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ function appleNonceNode() {
crypto.randomFillSync(buf);
nonce = decoder.write(buf);
}
return nonce.substr(0, length);
return nonce.slice(0, length);
};

const unhashedNonce = generateNonce(10);
Expand Down
2 changes: 1 addition & 1 deletion scripts/separate-snippets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function adjustIndentation(lines: string[]) {
if (isBlank(line)) {
outputLines.push("");
} else {
outputLines.push(line.substr(minIndent));
outputLines.push(line.slice(minIndent));
}
}
return outputLines;
Expand Down
2 changes: 1 addition & 1 deletion snippets/auth-next/apple/auth_apple_nonce_node.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const generateNonce = (length) => {
crypto.randomFillSync(buf);
nonce = decoder.write(buf);
}
return nonce.substr(0, length);
return nonce.slice(0, length);
};

const unhashedNonce = generateNonce(10);
Expand Down