function concat(patterns) {
    const ret = {
        valid: [],
        invalid: [],
    }

    for (const { keyword, valid, invalid } of patterns) {
        ret.valid.push(...valid)
        ret.invalid.push(...invalid)

        // Add the invalid patterns with `ignores` option into the valid patterns.
        ret.valid.push(...invalid.map(ignores(keyword)))
    }

    return ret
}
Concatenate patterns.
@param {Array<{valid:Array,invalid:Array}>} patterns The patterns to concat.
@returns {{valid:Array,invalid:Array}} The concatenated patterns.