Files
klz-cables.com/.pnpm-store/v10/files/07/042f177a301cbf89222f013d8195a796c2f49c29f5fa97ec8ff9027b2ffe09d3123b6c29b9a1951f5b3fe1e98c955dbb7834f02dbc7463fab2c2ef9a3a22fc
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

39 lines
1.7 KiB
Plaintext

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GraphQLEmailAddress = exports.GraphQLEmailAddressConfig = void 0;
const graphql_1 = require("graphql");
const error_js_1 = require("../error.js");
const validate = (value, ast) => {
const EMAIL_ADDRESS_REGEX = /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
if (typeof value !== 'string') {
throw (0, error_js_1.createGraphQLError)(`Value is not string: ${value}`, { nodes: ast });
}
if (!EMAIL_ADDRESS_REGEX.test(value)) {
throw (0, error_js_1.createGraphQLError)(`Value is not a valid email address: ${value}`, { nodes: ast });
}
return value;
};
const specifiedByURL = 'https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address';
exports.GraphQLEmailAddressConfig = {
name: 'EmailAddress',
description: 'A field whose value conforms to the standard internet email address format as specified in HTML Spec: https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address.',
serialize: validate,
parseValue: validate,
parseLiteral(ast) {
if (ast.kind !== graphql_1.Kind.STRING) {
throw (0, error_js_1.createGraphQLError)(`Can only validate strings as email addresses but got a: ${ast.kind}`, { nodes: ast });
}
return validate(ast.value, ast);
},
specifiedByURL,
specifiedByUrl: specifiedByURL,
extensions: {
codegenScalarType: 'string',
jsonSchema: {
type: 'string',
format: 'email',
},
},
};
exports.GraphQLEmailAddress = new graphql_1.GraphQLScalarType(exports.GraphQLEmailAddressConfig);