FreeKill/qml/util.js
notify 9a951fdbfe
Spdx license (#109)
在所有代码中添加了许可证标记头
2023-04-09 13:35:35 +08:00

24 lines
472 B
JavaScript

// SPDX-License-Identifier: GPL-3.0-or-later
.pragma library
function convertNumber(number) {
if (number === 1)
return "A";
if (number >= 2 && number <= 10)
return number;
if (number >= 11 && number <= 13) {
const strs = ["J", "Q", "K"];
return strs[number - 11];
}
return "";
}
Array.prototype.contains = function(element) {
return this.indexOf(element) != -1;
}
Array.prototype.prepend = function() {
this.splice(0, 0, ...arguments);
}