```ts
/**
 * Flattens a nested array up to a specified depth level without mutating the original array.
 * Strings are treated as individual values and do not contribute to the flattening process.
 *
 * @param items The array to flatten.
 * @param depth The maximum depth of recursion. Defaults to Infinity.
 * @returns A new flattened array.
 */
export function flatten(items: readonly unknown[], depth?: number): unknown[] {
  if (depth === undefined || depth === Infinity) {
    return [...items];
  }

  const result: unknown[] = [];
  for (const item of items) {
    if (!Array.isArray(item)) {
      result.push(item);
    } else if (depth > 0 && item.length > 0) {
      result.push(...flatten(item, depth - 1));
    }
  }

  return result;
}
```