Team Ai
Datasetpublic

Brunobkr/llama.cpp_AlgMor24_github

ΩFFFΣLLIa • llama.cpp • AlgMor24 ██████╗ ███████╗███████╗███████╗██╗ ██╗ ██╗ █████╗ ██╔═══██╗██╔════╝██╔════╝██╔════╝██║ ██║ ██║██╔══██╗ ██║ ██║█████╗ █████╗ █████╗ ██║ ██║ ██║███████║ ██║ ██║██╔══╝ ██╔══╝ ██╔══╝ ██║ ██║ ██║██╔══██║ ╚██████╔╝██║ ██║ ███████╗███████╗███████╗██║██║ ██║ ╚═════╝ ╚═╝ ╚═╝ ╚══════╝╚══════╝╚══════╝╚═╝╚═╝ ╚═╝ High-Performance LLM / VLM Inference & Autonomous Agentic Ecosystem… See the full description on the dataset page: https://huggingface.co/datasets/Brunobkr/llama.cpp_AlgMor24_github.

sourceHugging Faceupdated 2mo agoView on Hugging Face
0likes3.1kdownloads
registerRoute.js94 linesDownload Raw Back to workbox-routing
1/*2  Copyright 2019 Google LLC3 4  Use of this source code is governed by an MIT-style5  license that can be found in the LICENSE file or at6  https://opensource.org/licenses/MIT.7*/8import { logger } from 'workbox-core/_private/logger.js';9import { WorkboxError } from 'workbox-core/_private/WorkboxError.js';10import { Route } from './Route.js';11import { RegExpRoute } from './RegExpRoute.js';12import { getOrCreateDefaultRouter } from './utils/getOrCreateDefaultRouter.js';13import './_version.js';14/**15 * Easily register a RegExp, string, or function with a caching16 * strategy to a singleton Router instance.17 *18 * This method will generate a Route for you if needed and19 * call {@link workbox-routing.Router#registerRoute}.20 *21 * @param {RegExp|string|workbox-routing.Route~matchCallback|workbox-routing.Route} capture22 * If the capture param is a `Route`, all other arguments will be ignored.23 * @param {workbox-routing~handlerCallback} [handler] A callback24 * function that returns a Promise resulting in a Response. This parameter25 * is required if `capture` is not a `Route` object.26 * @param {string} [method='GET'] The HTTP method to match the Route27 * against.28 * @return {workbox-routing.Route} The generated `Route`.29 *30 * @memberof workbox-routing31 */32function registerRoute(capture, handler, method) {33    let route;34    if (typeof capture === 'string') {35        const captureUrl = new URL(capture, location.href);36        if (process.env.NODE_ENV !== 'production') {37            if (!(capture.startsWith('/') || capture.startsWith('http'))) {38                throw new WorkboxError('invalid-string', {39                    moduleName: 'workbox-routing',40                    funcName: 'registerRoute',41                    paramName: 'capture',42                });43            }44            // We want to check if Express-style wildcards are in the pathname only.45            // TODO: Remove this log message in v4.46            const valueToCheck = capture.startsWith('http')47                ? captureUrl.pathname48                : capture;49            // See https://github.com/pillarjs/path-to-regexp#parameters50            const wildcards = '[*:?+]';51            if (new RegExp(`${wildcards}`).exec(valueToCheck)) {52                logger.debug(`The '$capture' parameter contains an Express-style wildcard ` +53                    `character (${wildcards}). Strings are now always interpreted as ` +54                    `exact matches; use a RegExp for partial or wildcard matches.`);55            }56        }57        const matchCallback = ({ url }) => {58            if (process.env.NODE_ENV !== 'production') {59                if (url.pathname === captureUrl.pathname &&60                    url.origin !== captureUrl.origin) {61                    logger.debug(`${capture} only partially matches the cross-origin URL ` +62                        `${url.toString()}. This route will only handle cross-origin requests ` +63                        `if they match the entire URL.`);64                }65            }66            return url.href === captureUrl.href;67        };68        // If `capture` is a string then `handler` and `method` must be present.69        route = new Route(matchCallback, handler, method);70    }71    else if (capture instanceof RegExp) {72        // If `capture` is a `RegExp` then `handler` and `method` must be present.73        route = new RegExpRoute(capture, handler, method);74    }75    else if (typeof capture === 'function') {76        // If `capture` is a function then `handler` and `method` must be present.77        route = new Route(capture, handler, method);78    }79    else if (capture instanceof Route) {80        route = capture;81    }82    else {83        throw new WorkboxError('unsupported-route-type', {84            moduleName: 'workbox-routing',85            funcName: 'registerRoute',86            paramName: 'capture',87        });88    }89    const defaultRouter = getOrCreateDefaultRouter();90    defaultRouter.registerRoute(route);91    return route;92}93export { registerRoute };94 
Brunobkr/llama.cpp_AlgMor24_github · Team Ai