diff --git a/packages/kit/src/runtime/server/page/index.js b/packages/kit/src/runtime/server/page/index.js index d0df231da30b..ebe1f005df3e 100644 --- a/packages/kit/src/runtime/server/page/index.js +++ b/packages/kit/src/runtime/server/page/index.js @@ -5,6 +5,7 @@ import { method_not_allowed, error_to_pojo, allowed_methods } from '../utils.js' import { create_fetch } from './fetch.js'; import { HttpError, Redirect } from '../../../index/private.js'; import { error, json } from '../../../index/index.js'; +import { compact } from '../../../utils/array.js'; import { normalize_error } from '../../../utils/error.js'; import { load_data, load_server_data } from './load_data.js'; @@ -401,18 +402,3 @@ function redirect_response(status, location) { headers: { location } }); } - -/** - * @template T - * @param {Array} array - * @returns {T[]} - */ -function compact(array) { - const compacted = []; - for (const item of array) { - if (item) { - compacted.push(item); - } - } - return compacted; -}