feat: support Jekyll style where, #768

This commit is contained in:
Harttle
2024-11-17 21:33:38 +08:00
committed by Jun Yang
parent 11f013bf24
commit 9107eb1b93
9 changed files with 95 additions and 4 deletions
+4
View File
@@ -58,3 +58,7 @@ function arrayEquals (lhs: any[], rhs: any[]): boolean {
if (lhs.length !== rhs.length) return false
return !lhs.some((value, i) => !equals(value, rhs[i]))
}
export function arrayIncludes (arr: any[], item: any): boolean {
return arr.some(value => equals(value, item))
}