Template base para proyectos SaaS multi-tenant. Estructura inicial: - apps/backend (NestJS API) - apps/frontend (React/Vite) - apps/database (PostgreSQL DDL) - docs/ (Documentación) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
24 lines
480 B
JavaScript
24 lines
480 B
JavaScript
/**
|
|
* Merges two arrays.
|
|
* @param {*} a
|
|
* @param {*} b
|
|
* @return {*}
|
|
*/
|
|
export default function mergeArrays(a, b) {
|
|
const merged = a.slice()
|
|
|
|
for (const element of b) {
|
|
if (a.indexOf(element) < 0) {
|
|
merged.push(element)
|
|
}
|
|
}
|
|
|
|
return merged.sort((a, b) => a - b)
|
|
|
|
// ES6 version, requires Set polyfill.
|
|
// let merged = new Set(a)
|
|
// for (const element of b) {
|
|
// merged.add(i)
|
|
// }
|
|
// return Array.from(merged).sort((a, b) => a - b)
|
|
} |