UNPKG

apitally

Version:

Simple API monitoring & analytics for REST APIs built with Express, Fastify, NestJS, AdonisJS, Hono, H3, Elysia, and Koa.

43 lines (42 loc) 1.63 kB
"use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // src/common/paramValidation.ts var paramValidation_exports = {}; __export(paramValidation_exports, { isValidClientId: () => isValidClientId, isValidEnv: () => isValidEnv }); module.exports = __toCommonJS(paramValidation_exports); function isValidClientId(clientId) { const regexExp = /^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i; return regexExp.test(clientId); } __name(isValidClientId, "isValidClientId"); function isValidEnv(env) { const regexExp = /^[\w-]{1,32}$/; return regexExp.test(env); } __name(isValidEnv, "isValidEnv"); // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { isValidClientId, isValidEnv }); //# sourceMappingURL=paramValidation.cjs.map