All files / lib/core/runtime AvenxGuard.js

88.88% Statements 16/18
100% Branches 1/1
0% Functions 0/1
88.88% Lines 16/18

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 191x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x     1x  
/**
 * Base class for all route guards in Avenx.
 * Guards determine if a route transition should proceed, abort, or redirect.
 */
export class AvenxGuard {
    /**
     * Determines whether the route can be activated.
     * Can return a boolean (true to allow, false to abort), a string (to redirect),
     * or a Promise resolving to either.
     * 
     * @param {Object} to - The target route object (contains hash, page, params).
     * @param {Object} from - The current route object (contains hash, page, params).
     * @returns {boolean|string|Promise<boolean|string>}
     */
    canActivate(to, from) {
        return true;
    }
}