mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
Hello airbnb
This commit is contained in:
1 parent
f9468536de
commit
8c195661d7
78 files changed
+2032
-1471
No files matched your search
+6
-8
@@ -5,13 +5,12 @@ const map = [
|
||||
'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N',
|
||||
'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
|
||||
'Y', 'Z', '1', '2', '3', '4', '5', '6', '7', '8',
|
||||
'9', '0'
|
||||
'9', '0',
|
||||
];
|
||||
|
||||
String.random = function (digit) {
|
||||
String.random = function random(digit) {
|
||||
let str = '';
|
||||
for (let i = 1; i <= digit; i++)
|
||||
str += map[Math.floor(Math.random() * 62)];
|
||||
for (let i = 1; i <= digit; i++) str += map[Math.floor(Math.random() * 62)];
|
||||
return str;
|
||||
};
|
||||
|
||||
@@ -20,15 +19,14 @@ String.random = function (digit) {
|
||||
* @param {Array} b
|
||||
*/
|
||||
Array.isDiff = function isDiff(a, b) {
|
||||
if (a.length != b.length) return true;
|
||||
if (a.length !== b.length) return true;
|
||||
a.sort();
|
||||
b.sort();
|
||||
for (let i in a)
|
||||
if (a[i] != b[i]) return true;
|
||||
for (const i in a) { if (a[i] !== b[i]) return true; }
|
||||
return false;
|
||||
};
|
||||
|
||||
Date.prototype.format = function (fmt = '%Y-%m-%d %H:%M:%S') {
|
||||
Date.prototype.format = function formatDate(fmt = '%Y-%m-%d %H:%M:%S') {
|
||||
return fmt
|
||||
.replace('%Y', this.getFullYear())
|
||||
.replace('%m', this.getMonth() + 1)
|
||||
|
||||
Reference in new issue
Block a user