{"id":459569,"date":"2025-05-14T09:07:21","date_gmt":"2025-05-14T09:07:21","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=459569"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=459569","title":{"rendered":"<span>Isomorphic-validation \u2014 Javascript \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430, \u043e\u0431\u043b\u0435\u0433\u0447\u0430\u044e\u0449\u0430\u044f \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0432\u0432\u043e\u0434\u0430<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u042f \u043d\u0430\u0447\u0430\u043b \u044d\u0442\u043e\u0442 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c isomorphic-validation, \u043a\u0430\u043a \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442, \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0432 \u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0446\u0435\u043b\u044f\u0445. \u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0434\u0440\u0443\u0433\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438, \u044f \u0440\u0435\u0448\u0438\u043b \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u0438\u0437\u043e\u0431\u0440\u0435\u0441\u0442\u0438 \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434. \u042d\u0442\u043e \u0431\u044b\u043b\u0430 \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u0441\u043a\u0440\u044b\u0442\u044c \u0432\u0441\u0435 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u043c\u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430\u043c\u0438 \u0438 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430, \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u043e\u0439 \u0434\u043b\u044f \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a \u044f \u043d\u043e\u0432\u0438\u0447\u043a\u043e\u0432, \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0438\u043d\u0435\u043d\u0438\u044f \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u0431\u0435\u0437 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430.<\/p>\n<p>\u042f \u0432\u044b\u0434\u0432\u0438\u043d\u0443\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u043a \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435:<\/p>\n<ul>\n<li>\n<p>\u0413\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0439, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0432\u0430\u043b\u0438\u0434\u043d\u043e\u0441\u0442\u0438 \u0433\u0440\u0443\u043f\u043f\u044b \u0437\u0430\u0432\u0438\u0441\u0435\u043b\u043e \u043e\u0442 \u043a\u0430\u0436\u0434\u043e\u0439 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u0432 \u0433\u0440\u0443\u043f\u043f\u0435;<\/p>\n<\/li>\n<li>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c &#171;\u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f&#187; \u044d\u0444\u0444\u0435\u043a\u0442\u043e\u0432 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u043a \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f\u043c \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u043e\u0432, \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0439 \u0438 \u0433\u0440\u0443\u043f\u043f \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0439;<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u0438\u043c\u0438\u043d\u0435\u043d\u0438\u0435 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0439 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0438 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 <a href=\"https:\/\/expressjs.com\/en\/guide\/using-middleware.html\" rel=\"noopener noreferrer nofollow\">Express middleware<\/a> \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430;<\/p>\n<\/li>\n<li>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0438\u0445 \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u043e\u0432 \u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u043e\u0432 \u043e\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0445;<\/p>\n<\/li>\n<li>\n<p>\u041e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0445 \u0438 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0445 \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u043e\u0432;<\/p>\n<\/li>\n<li>\n<p>\u0423\u0434\u043e\u0431\u0441\u0442\u0432\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043b\u044e\u0431\u043e\u0439 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u0438 \u043d\u0430 \u043b\u044e\u0431\u043e\u0439 \u0442\u0438\u043f \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0444\u043e\u0440\u043c\u044b; <\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c \u0441 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u043c\u0438 \u0438\u043d\u0442\u0435\u0440\u043d\u0430\u0446\u0438\u043e\u043d\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e \u044f \u043f\u043e\u043f\u0440\u043e\u0448\u0443 \u0432\u0430\u0441 \u0432\u0437\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043e\u0431\u0440\u0430\u0437\u0435\u0446 \u043a\u043e\u0434\u0430 \u0438, \u043d\u0435 \u0432\u0438\u0434\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u0435\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u043f\u043e\u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c, \u0447\u0442\u043e \u043e\u043d \u0434\u0435\u043b\u0430\u0435\u0442:<\/p>\n<pre><code class=\"javascript\">form.addEventListener(   'input',   Validation.group(      Validation(form.email)       .constraint(isEmail, { err: 'Must be in the E-mail format.' })       .validated(applyOutline(form.email, delayedOutline))       .changed(applyOutline(form.email, changedOutline))       .validated(applyBox(form.email, validIcon))       .validated(applyBox(form.email, errMsg)),      Validation(form.password)       .constraint(isStrongPassword, { err: 'Min. 8 characters, 1 capital letter, 1 number, 1 special character.' })       .validated(applyOutline(form.password, delayedOutline))       .changed(applyOutline(form.password, changedOutline))       .validated(applyBox(form.password, validIcon))       .validated(applyBox(form.password, errMsg)),    )   .changed(applyAccess(form.submitBtn, delayedAccess)) );<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u0443\u0435\u043c \u0434\u0432\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u0432 \u043e\u0434\u0438\u043d \u0438 \u043f\u0440\u0438\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u043c \u043a \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044e \u0435\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0432\u0430\u043b\u0438\u0434\u043d\u043e\u0441\u0442\u0438 \u044d\u0444\u0444\u0435\u043a\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043a\u043d\u043e\u043f\u043a\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0444\u043e\u0440\u043c\u044b (\u0430\u0442\u0442\u0440\u0438\u0431\u0443\u0442 <code>disabled<\/code>). \u041a \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044e \u043a\u0430\u0436\u0434\u043e\u0439 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u0432  \u0433\u0440\u0443\u043f\u043f\u0435 \u0442\u043e\u0436\u0435 \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u044b \u044d\u0444\u0444\u0435\u043a\u0442\u044b: \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0438\u043a\u043e\u043d\u043a\u0438, \u043e\u0431\u0432\u043e\u0434\u043a\u0438 \u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043e \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>\u041f\u0440\u043e\u0449\u0435 \u0433\u043e\u0432\u043e\u0440\u044f, \u043a\u043e\u0433\u0434\u0430 \u0432 \u043e\u0431\u0430 \u043f\u043e\u043b\u044f \u0432\u0432\u0435\u0434\u0435\u043d\u044b \u0432\u0430\u043b\u0438\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u043a\u043d\u043e\u043f\u043a\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0444\u043e\u0440\u043c\u044b \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0439 \u0434\u043b\u044f \u043d\u0430\u0436\u0430\u0442\u0438\u044f. \u0412\u0430\u043b\u0438\u0434\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u043e\u043b\u044f \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442\u0441\u044f \u0438\u043a\u043e\u043d\u043a\u043e\u0439, \u043d\u0435\u0432\u0430\u043b\u0438\u0434\u043d\u043e\u0435 \u0441\u043e\u043f\u0440\u043e\u0432\u043e\u0436\u0434\u0430\u0435\u0442\u0441\u044f \u043e\u0431\u0432\u043e\u0434\u043a\u043e\u0439 \u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435\u043c \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0435 \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u043e\u0439.<\/p>\n<p><strong>\u041f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0430 \u0441 \u043f\u043e\u043b\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f <\/strong><a href=\"https:\/\/itihon.github.io\/isomorphic-validation\/quick-introduction\/\" rel=\"noopener noreferrer nofollow\"><strong>\u0437\u0434\u0435\u0441\u044c<\/strong><\/a><strong>.<\/strong><\/p>\n<h3>\u041c\u043e\u0442\u0438\u0432\u0430\u0446\u0438\u044f<\/h3>\n<p>\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e\u0442 \u043d\u0430\u0431\u043e\u0440 \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u043e\u0432 \u0432 \u0442\u043e\u043c \u0438\u043b\u0438 \u0438\u043d\u043e\u043c \u0432\u0438\u0434\u0435 \u0438 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441 \u043d\u0438\u043c\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439. \u041d\u0430\u043b\u0438\u0447\u0438\u0435 \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u043e\u0432 \u043d\u0430 \u0432\u0441\u0435 \u0441\u043b\u0443\u0447\u0430\u0438 \u0436\u0438\u0437\u043d\u0438, \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0445 \u0432 \u043e\u0434\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435, \u0434\u0430\u043b\u0435\u043a\u043e \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0438\u0445 \u043f\u0440\u0438\u043c\u0438\u043d\u0435\u043d\u0438\u044f. \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0438 \u0438\u043d\u0434\u0438\u043a\u0430\u0446\u0438\u0438 \u0432\u0430\u043b\u0438\u0434\u043d\u043e\u0441\u0442\u0438 \u043f\u043e\u043b\u0435\u0439 \u0432\u0432\u043e\u0434\u0430, \u043d\u043e \u043e\u043d \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439, \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044e. <\/p>\n<p>\u041c\u043d\u0435 \u0436\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0438\u043c\u0435\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431\u043b\u0435\u0433\u0447\u0430\u043b \u0431\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0432\u043e\u043e\u0431\u0449\u0435 <strong>\u043b\u044e\u0431\u043e\u0433\u043e<\/strong> \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u043b \u0431\u044b \u0441\u043a\u0440\u044b\u0442\u044c \u0432\u0441\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0438 \u0444\u043e\u043a\u0443\u0441\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u0442\u043e\u043c, <strong>\u0447\u0442\u043e<\/strong> \u0432\u0430\u043b\u0438\u0434\u0438\u0440\u0443\u0435\u043c, \u0438 <strong>\u0441 \u043a\u0430\u043a\u0438\u043c\u0438<\/strong> \u043f\u043e\u0431\u043e\u0447\u043d\u044b\u043c\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0430\u043c\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430, \u043d\u0435 \u0431\u0435\u0441\u043f\u043e\u043a\u043e\u044f\u0441\u044c \u043e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u043e\u0433\u043e \u0440\u043e\u0434\u0430 \u043f\u043e\u0433\u0440\u0430\u043d\u0438\u0447\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0443\u0441\u0442\u044b\u0435 \u043f\u043e\u043b\u044f \u0432\u0432\u043e\u0434\u0430 \u043f\u0430\u0440\u043e\u043b\u044f \u0438 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u043e\u043b\u044f \u0440\u0430\u0432\u043d\u044b \u0438\u043b\u0438 \u043f\u043e\u043a\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0437\u0430\u043f\u0440\u043e\u0441, \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0432\u0432\u0435\u043b \u0435\u0449\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043d\u0435 \u0430\u043a\u0442\u0443\u0430\u043b\u0435\u043d \u0438 \u0442.\u0434.<\/p>\n<h3>\u041a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044f<\/h3>\n<p>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043d\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0433\u043e\u0442\u043e\u0432\u044b\u0445 \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u043e\u0432 (\u044d\u0442\u0443 \u0437\u0430\u0434\u0430\u0447\u0443 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442 \u0434\u0440\u0443\u0433\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438). \u0417\u0434\u0435\u0441\u044c \u043b\u043e\u0433\u0438\u043a\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0430\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u043e\u0432, \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0437\u0430\u0432\u0435\u0440\u043d\u0443\u0442\u0430 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e-\u043f\u0440\u0435\u0434\u0438\u043a\u0430\u0442, \u043d\u0430 \u0432\u0445\u043e\u0434\u0435 \u0432\u0430\u043b\u0438\u0434\u0438\u0440\u0443\u0435\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u0431\u0443\u043b\u0435\u0432\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u043b\u0438 \u043f\u0440\u043e\u043c\u0438\u0441 \u0441 \u0431\u0443\u043b\u0435\u0432\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c.  \u042f \u043e\u0431\u044b\u0447\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u044b \u0438\u0437 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <a href=\"https:\/\/github.com\/validatorjs\/validator.js\" rel=\"noopener noreferrer nofollow\">validator.js<\/a>.<\/p>\n<p>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442 \u0434\u0432\u0435 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 <code>Validation<\/code> \u0438 <code>Predicate<\/code>, \u0430 \u0442\u0430\u043a \u0436\u0435 \u043d\u0430\u0431\u043e\u0440 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u044d\u0444\u0444\u0435\u043a\u0442\u043e\u0432 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0438 \u0445\u0435\u043b\u043f\u0435\u0440\u043e\u0432.<\/p>\n<p><code>Validation<\/code> &#8212; \u044d\u0442\u043e \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c \u0441 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c \u0438 \u043b\u043e\u0433\u0438\u043a\u043e\u0439. \u041c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0434\u0438\u043d\u043e\u0447\u043d\u043e\u0439 \u0438\u043b\u0438 \u0433\u0440\u0443\u043f\u043f\u043e\u0432\u043e\u0439 ( \u0430 \u0435\u0449\u0435 &#171;\u0441\u043a\u043b\u0435\u0435\u043d\u043d\u043e\u0439&#187;). \u0421\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0433\u0440\u0443\u043f\u043f\u044b \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u0432 \u0433\u0440\u0443\u043f\u043f\u0435. \u0410 \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440, \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0433\u0440\u0443\u043f\u043f\u0435, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a \u043a\u0430\u0436\u0434\u043e\u0439 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u0432 \u0433\u0440\u0443\u043f\u043f\u0435:<\/p>\n<pre><code class=\"javascript\">Validation.group(    Validation(form.firstName),    Validation(form.lastName),  ) .constraint(isAlpha, { msg: '\u0422\u043e\u043b\u044c\u043a\u043e \u0431\u0443\u043a\u0432\u044b \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u044b.' }) .constraint(isLongerOrEqual(2), { msg: '\u041d\u0435 \u043a\u043e\u0440\u043e\u0447\u0435 2 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432.' }) .constraint(isShorterOrEqual(32), { msg: '\u041d\u0435 \u0434\u043b\u0438\u043d\u043d\u0435\u0435 32 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432.' })<\/code><\/pre>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/713\/3f0\/7e0\/7133f07e0fffef40af202a7e780f0b81.gif\" alt=\"\u0413\u0440\u0443\u043f\u043f\u0430 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0439\" title=\"\u0413\u0440\u0443\u043f\u043f\u0430 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0439\" width=\"2800\" height=\"2000\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/713\/3f0\/7e0\/7133f07e0fffef40af202a7e780f0b81.gif 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/713\/3f0\/7e0\/7133f07e0fffef40af202a7e780f0b81.gif 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u0413\u0440\u0443\u043f\u043f\u0430 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0439<\/figcaption><\/div>\n<\/figure>\n<p>&#171;\u0421\u043a\u043b\u0435\u0435\u043d\u043d\u0430\u044f&#187; \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044f &#8212; \u044d\u0442\u043e \u0442\u043e\u0436\u0435 \u0433\u0440\u0443\u043f\u043f\u0430, \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u043e\u0431\u044b\u0447\u043d\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u044b \u0442\u0435\u043c, \u0447\u0442\u043e \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043d\u0430 \u0432\u0445\u043e\u0434 \u0432\u0430\u043b\u0438\u0434\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0439 \u0432 \u0433\u0440\u0443\u043f\u043f\u0435, \u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0432\u0430\u043b\u0438\u0434\u043d\u043e\u0441\u0442\u0438 \u0432\u0441\u0435\u0445 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0439 \u0432 \u0433\u0440\u0443\u043f\u043f\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u0430 (\u0432\u0437\u0430\u0438\u043c\u043e\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0435 \u043f\u043e\u043b\u044f \u043f\u0430\u0440\u043e\u043b\u044c \u0438 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u043e\u043b\u044f):<\/p>\n<pre><code class=\"javascript\">Validation.glue(   Validation(form.password),    Validation(form.pwdConfirm), ) .constraint(equals, { msg: '\u041f\u0430\u0440\u043e\u043b\u044c \u0438 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u043e\u043b\u044f \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0442\u044c.' })<\/code><\/pre>\n<p>\u0422\u0430\u043a \u0436\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0442\u0430\u043a\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432\u0430\u043b\u0438\u0434\u043d\u043e\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0434\u0440\u0443\u0433\u043e\u0433\u043e (\u043e\u0434\u043d\u043e\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u044f\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c). <strong>\u041f\u0440\u0438\u043c\u0435\u0440 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c<\/strong> <a href=\"https:\/\/itihon.github.io\/isomorphic-validation\/api\/validation\/static-methods\/glue\/#validating-one-field-depending-on-another\" rel=\"noopener noreferrer nofollow\"><strong>\u0437\u0434\u0435\u0441\u044c<\/strong><\/a>.<\/p>\n<p><code>Predicate<\/code> &#8212; \u044d\u0442\u043e \u043e\u0431\u0432\u0435\u0440\u0442\u043a\u0430, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0430\u044f \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u044d\u0444\u0444\u0435\u043a\u0442\u043e\u0432 \u043a \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f\u043c \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u043e\u0432 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0434\u043e \u0438\u0445 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043a \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438:<\/p>\n<pre><code class=\"javascript\">Validation()   .constraint(     Predicate(isEmailRegistered, { msg: '\u0414\u0430\u043d\u043d\u044b\u0439 \u0430\u0434\u0440\u0435\u0441 \u0443\u0436\u0435 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d.' })       .started(doSomething)       .invalid(doSomethingElse)   )<\/code><\/pre>\n<p>\u041a\u0430\u0436\u0434\u0430\u044f \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044f \u0438 \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440 \u0438\u043c\u0435\u044e\u0442 \u0440\u044f\u0434 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 (\u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 \u0430\u0432\u0442\u043e\u043c\u0430\u0442), \u043a \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u044d\u0444\u0444\u0435\u043a\u0442\u044b: <\/p>\n<pre><code class=\"javascript\">Validation.group(      Validation()     .constraint(       Predicate(isSomething)         .started(doSomething)         .valid(doSomething)         .invalid(doSomething)         .changed(doSomething)         .validated(doSomething)     )     .started(doSomething)     .valid(doSomething)     .invalid(doSomething)     .changed(doSomething)     .validated(doSomething) ) .started(doSomething) .valid(doSomething) .invalid(doSomething) .changed(doSomething) .validated(doSomething)<\/code><\/pre>\n<p>  \u0421\u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0447\u0435\u0440\u0435\u0437 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e <code>.validations<\/code> \u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u044b \u0447\u0435\u0440\u0435\u0437 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e <code>.constraints<\/code>:<\/p>\n<pre><code class=\"javascript\">Validation.group(   Validation(form.firstName),   Validation(form.lastName), ) .validations.forEach( \/\/ &lt;--   validation =&gt; {     validation.validated(doSomething);   } );  \/\/--------------------------------------  Validation.group(      Validation(form.email)     .constraint(isEmail),      Validation(form.password)     .constraint(isStrongPassword), ) .constraints.forEach( \/\/ &lt;--   (validator, formField) =&gt; {     validator.validated(applyOutline(formField));   } );<\/code><\/pre>\n<p>\u0414\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0442\u0435\u0445 \u0436\u0435 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0439 \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0438\u0445, \u043d\u0435 \u043f\u0440\u0438\u0432\u044f\u0437\u044b\u0432\u0430\u044f \u043a \u043f\u043e\u043b\u044f\u043c \u0444\u043e\u0440\u043c\u044b, \u0438 \u0441\u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>.profile()<\/code>:<\/p>\n<pre><code class=\"javascript\">const emailV = Validation()   .constraint(isMinLength(8), { next: false })   .constraint(isMaxLength(48), { next: false })   .constraint(isEmail, { next: false });  const passwordV = Validation()   .constraint(isStrongPassword);  const pwdConfirm = Validation();  Validation.glue(passwordV, pwdConfirm)   .constraint(equals);  const [signupForm, signupV] = Validation.profile(   '[name=\"signupForm\"]',   ['email', 'password', 'pwdConfirm'],   [emailV, passwordV, pwdConfirm], );<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044f <code>signupV<\/code> \u0433\u043e\u0442\u043e\u0432\u0430 \u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e, \u043a\u0430\u043a \u043d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0435, \u0442\u0430\u043a \u0438 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435:<\/p>\n<pre><code class=\"javascript\">\/\/ \u043d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0435 signupForm.addEventListener('input', signupV);  \/\/ \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 app.post('\/signup', urlencodeParser, signupV, signupHandler);<\/code><\/pre>\n<p>\u0410 \u044d\u0442\u043e \u0435\u0441\u043b\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0442\u0434\u0435\u043b\u0438\u0442\u044c \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0438\u0435 \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u044b \u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u044b \u043e\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0445:<\/p>\n<pre><code class=\"javascript\">Validation()   .client \/\/ &lt;--   .validated(doSomethingOnClient)  \/\/-----------------------------------  Validation()   .server \/\/ &lt;--   .invalid(doSomethingOnServer)<\/code><\/pre>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u0434\u0435\u043b\u0438\u0442\u044c \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440 \u043d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0435, \u0434\u0435\u043b\u0430\u044e\u0449\u0438\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0443, \u0438 \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0434\u0435\u043b\u0430\u044e\u0449\u0438\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445:<\/p>\n<pre><code class=\"javascript\">const emailV = Validation()   .constraint(isEmail, { next: false }) \/\/ \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0441\u044f \u043d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0435 \u0438 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435   .client   .constraint(isEmailRegisteredC); \/\/ \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0435  \/\/-----------------------------------  emailV   .server   .constraint(isEmailRegisteredS); \/\/ \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435<\/code><\/pre>\n<p>\u0412\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u044b \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0443\u0441\u043b\u043e\u0432\u043d\u043e \u0438 \u0441 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u043e\u0439. \u0417\u0430\u0434\u0435\u0440\u0436\u043a\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u0430 \u0434\u043b\u044f \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u043e\u0432, \u0434\u0435\u043b\u0430\u044e\u0449\u0438\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u043f\u0440\u0438 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u043f\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u044e <code>input<\/code>. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u043e\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 \u0441 \u043e\u043f\u0446\u0438\u044f\u043c\u0438:<\/p>\n<pre><code class=\"javascript\">const emailV = Validation()   .constraint(isEmail, { next: false }) \/\/ \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d, \u043f\u043e\u043a\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043d\u0435 \u0432\u0435\u0440\u043d\u0435\u0442 true   .constraint(isEmailRegisteredC, { debounce: 5000 }); \/\/ \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440<\/code><\/pre>\n<p>\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432 \u044d\u0442\u043e\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 \u0441 \u043e\u043f\u0446\u0438\u044f\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043b\u044e\u0431\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043b\u044e\u0431\u043e\u043c \u0432\u0438\u0434\u0435, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0438\u043b\u0438 \u043a\u043b\u044e\u0447\u0438 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u043e\u0432. \u041e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u043e\u0431\u0440\u043e\u0448\u0435\u043d\u044b \u043f\u043e\u0434 \u0442\u0435\u043c\u0438 \u0436\u0435 \u0438\u043c\u0435\u043d\u0430\u043c\u0438 \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u0430\u043b\u0438\u0446\u0438\u0438. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e \u0441 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 <a href=\"https:\/\/www.i18next.com\/\" rel=\"noopener noreferrer nofollow\">i18next<\/a> \u043c\u043e\u0436\u043d\u043e <strong>\u043d\u0430\u0439\u0442\u0438<\/strong> <a href=\"https:\/\/itihon.github.io\/isomorphic-validation\/api\/validation\/instance-methods\/constraint\/#parameter-anydata\" rel=\"noopener noreferrer nofollow\"><strong>\u0437\u0434\u0435\u0441\u044c<\/strong><\/a>.<\/p>\n<h3>\u042d\u0444\u0444\u0435\u043a\u0442\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430<\/h3>\n<p>\u041e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043e\u0442 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0430\u0431\u043e\u0440 \u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0445 \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u0447 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u043e\u0432, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a: \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u043c \u043a DOM \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c, \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0444\u043e\u043d\u0430, \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0438\u043a\u043e\u043d\u043e\u043a \u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439, \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u0430, \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e\u0431\u0432\u043e\u0434\u043a\u0438. <\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u044d\u0444\u0444\u0435\u043a\u0442\u043e\u0432 \u0438 \u0440\u0430\u0437\u043d\u0443\u044e \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0443 \u0438\u0445 \u043f\u0440\u0438\u043c\u0438\u043d\u0435\u043d\u0438\u044f \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0432\u0430\u043b\u0438\u0434\u043d\u043e\u0441\u0442\u0438:<\/p>\n<pre><code class=\"javascript\">const delayedOutline = {   \/\/ \u043f\u0440\u0438 \u043d\u0435\u0432\u0430\u043b\u0438\u0434\u043d\u043e\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438, \u0440\u043e\u0437\u043e\u0432\u0430\u044f \u043e\u0431\u0432\u043e\u0434\u043a\u0430, \u0441\u043f\u0443\u0441\u0442\u044f 2 \u0441\u0435\u043a\u0443\u043d\u0434\u044b   false: { delay: 2000, value: '2px solid lightpink' },   \/\/ \u043f\u0440\u0438 \u0432\u0430\u043b\u0438\u0434\u043d\u043e\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438, \u0443\u0431\u0440\u0430\u0442\u044c \u043e\u0431\u0432\u043e\u0434\u043a\u0443, \u0441\u043f\u0443\u0441\u0442\u044f \u043f\u043e\u043b \u0441\u0435\u043a\u0443\u043d\u0434\u044b   true: { delay: 500, value: '' }, };  Validation(form.email)   .constraint(isEmail)   .validated(applyOutline(delayedOutline))   .validate();<\/code><\/pre>\n<p>\u041d\u043e \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0441\u043b\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d \u043e\u0442\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u044d\u0444\u0444\u0435\u043a\u0442, \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u043e\u0441\u044c \u0440\u0430\u043d\u044c\u0448\u0435, \u0447\u0435\u043c \u043e\u043d \u043d\u0430\u0441\u0442\u0443\u043f\u0438\u043b \u0438 \u0434\u043b\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043e\u043d \u043d\u0435 \u0430\u043a\u0442\u0443\u0430\u043b\u0435\u043d? \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u044d\u0444\u0444\u0435\u043a\u0442\u0430. \u042d\u0444\u0444\u0435\u043a\u0442\u044b \u0441 \u043e\u0434\u043d\u0438\u043c \u0438 \u0442\u0435\u043c \u0436\u0435 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u043c, \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u043d\u044b\u0435 \u043a \u043e\u0434\u043d\u043e\u043c\u0443 \u0438 \u0442\u043e\u043c\u0443 \u0436\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443, \u043e\u0442\u043c\u0435\u043d\u044f\u044e\u0442 \u0434\u0440\u0443\u0433 \u0434\u0440\u0443\u0433\u0430:<\/p>\n<pre><code class=\"javascript\">const delayedOutline = {   false: { delay: 2000, value: '2px solid lightpink' },   true: { delay: 500, value: '2px solid green' }, };  const clearOutline = {   false: { delay: 500, value: '' },   true: { delay: 500, value: '' }, };  const outlineEID = 'outline'; \/\/ &lt;--  Validation(form.email)   .constraint(isEmail)   .started(applyOutline(clearOutline, outlineEID)) \/\/ &lt;--   .validated(applyOutline(delayedOutline, outlineEID)) \/\/ &lt;--   .validate();<\/code><\/pre>\n<p>\u0410 \u0432\u043e\u043e\u0431\u0449\u0435 \u044d\u0444\u0444\u0435\u043a\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043f\u0430\u0440\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043e\u0434\u043d\u0430 \u0434\u043b\u044f \u043e\u0442\u043c\u0435\u043d\u044b \u043e\u0442\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0433\u043e \u044d\u0444\u0444\u0435\u043a\u0442\u0430, \u0434\u0440\u0443\u0433\u0430\u044f \u0434\u043b\u044f \u0435\u0433\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438:<\/p>\n<pre><code class=\"javascript\">const [cancel, set] = applyOutline();<\/code><\/pre>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u044d\u0442\u043e\u0442 \u043f\u0430\u0442\u0442\u0435\u0440\u043d \u043a\u043e\u043c\u0443-\u0442\u043e \u0447\u0442\u043e-\u0442\u043e \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0435\u0441\u043b\u0438 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c &#171;apply&#187; \u043d\u0430 &#171;use&#187;.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0432\u043c\u0435\u0441\u0442\u043e \u043f\u0440\u0438\u043c\u0438\u043d\u0435\u043d\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u0447\u043d\u044b\u0445 \u044d\u0444\u0444\u0435\u043a\u0442\u043e\u0432 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u043a \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f\u043c \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0439 \u0438 \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u043e\u0432.<\/p>\n<h3>\u041f\u0440\u0438\u043c\u0438\u043d\u0435\u043d\u0438\u0435 \u043d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0435 \u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0435<\/h3>\n<p>\u041f\u0440\u0438\u043c\u0438\u043d\u0435\u043d\u0438\u0435 \u043e\u0434\u043d\u0438\u0445 \u0438 \u0442\u0435\u0445 \u0436\u0435 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0439 \u043d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0435 \u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0441\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c \u0448\u0430\u0433\u0430\u043c:<\/p>\n<ol>\n<li>\n<p>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u043e\u0432 \u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0439.<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u043e\u0432 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0444\u0438\u043b\u0435\u0439.<\/p>\n<\/li>\n<\/ol>\n<p>\u0413\u0440\u0430\u0444 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0441 \u0444\u043e\u0440\u043c\u043e\u0439 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0438 \u0444\u043e\u0440\u043c\u043e\u0439 \u0432\u0445\u043e\u0434\u0430 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/9ae\/f3d\/5f1\/9aef3d5f1de026a5c524bdf236453834.webp\" alt=\"\u041f\u0440\u0438\u043c\u0438\u043d\u0435\u043d\u0438\u0435 \u043e\u0434\u043d\u0438\u0445 \u0438 \u0442\u0435\u0445 \u0436\u0435 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0439 \u043d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0435 \u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0435.\" title=\"\u041f\u0440\u0438\u043c\u0438\u043d\u0435\u043d\u0438\u0435 \u043e\u0434\u043d\u0438\u0445 \u0438 \u0442\u0435\u0445 \u0436\u0435 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0439 \u043d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0435 \u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0435.\" width=\"800\" height=\"570\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/9ae\/f3d\/5f1\/9aef3d5f1de026a5c524bdf236453834.webp 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/9ae\/f3d\/5f1\/9aef3d5f1de026a5c524bdf236453834.webp 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u041f\u0440\u0438\u043c\u0438\u043d\u0435\u043d\u0438\u0435 \u043e\u0434\u043d\u0438\u0445 \u0438 \u0442\u0435\u0445 \u0436\u0435 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0439 \u043d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0435 \u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0435.<\/figcaption><\/div>\n<\/figure>\n<p>\u0417\u0434\u0435\u0441\u044c <code>index.js<\/code> &#8212; \u044d\u0442\u043e \u0441\u0435\u0440\u0432\u0435\u0440, \u0430 <code>signup.js<\/code> \u0438 <code>signin.js<\/code> &#8212; \u0442\u043e\u0447\u043a\u0438 \u0432\u0445\u043e\u0434\u0430 \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u0449\u0438\u043a\u0430 \u043c\u043e\u0434\u0443\u043b\u0435\u0439. \u0421\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043e\u0431\u0435 \u0444\u043e\u0440\u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u043e\u0434\u043d\u0438 \u0438 \u0442\u0435 \u0436\u0435 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u044d\u043b.\u043f\u043e\u0447\u0442\u044b \u0438 \u043f\u0430\u0440\u043e\u043b\u044f. \u041e\u0434\u043d\u0430\u043a\u043e \u043d\u0430 \u0444\u043e\u0440\u043c\u0435 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043d\u0430 \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u043e \u043f\u0430\u0440\u043e\u043b\u044f \u0438 \u0435\u0433\u043e \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u044f \u0430 \u0442\u0430\u043a \u0436\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0430\u0434\u0440\u0435\u0441\u0430 \u044d\u043b.\u043f\u043e\u0447\u0442\u044b, \u043f\u0440\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440. \u0412 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0435 \u0430\u0434\u0440\u0435\u0441\u0430 \u044d\u043b.\u043f\u043e\u0447\u0442\u044b \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445. <\/p>\n<p><strong>\u041f\u043e\u0448\u0430\u0433\u043e\u0432\u0430\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u0441 \u0434\u0430\u043d\u043d\u044b\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f<\/strong> <a href=\"https:\/\/dev.to\/itihon\/using-the-same-validation-logic-on-the-client-and-server-side-with-isomorphic-validation-1eaj\" rel=\"noopener noreferrer nofollow\"><strong>\u0437\u0434\u0435\u0441\u044c<\/strong><\/a>.<\/p>\n<p>\u0427\u0442\u043e \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435:<\/p>\n<ul>\n<li>\n<p>\u041d\u0435\u0442 \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u043c\u0435\u0436\u0434\u0443 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0444\u043e\u0440\u043c\u0430\u043c\u0438 \u0441 \u043f\u043e\u043b\u044f\u043c\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430.<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435\u0442 \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u043c\u0435\u0436\u0434\u0443 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u043c \u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c.<\/p>\n<\/li>\n<li>\n<p>\u0412\u0441\u044f \u043b\u043e\u0433\u0438\u043a\u0430 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043e\u0434\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435, \u0447\u0442\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u043e\u0434\u0438\u043d \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0438\u0441\u0442\u0438\u043d\u044b.<\/p>\n<\/li>\n<\/ul>\n<p>\u0418 \u043d\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u043a \u043f\u043e\u043f\u0440\u043e\u0448\u0443 \u0432\u0430\u0441 \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c \u043d\u0430 \u043e\u0434\u0438\u043d \u0432\u043e\u043f\u0440\u043e\u0441.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><\/p>\n<div class=\"tm-article-poll-container\"><!--[--><\/p>\n<div class=\"tm-article-poll tm-article-poll_variant-bordered\">\n<div class=\"tm-notice tm-notice_positive tm-article-poll__notice\"><!----><\/p>\n<div class=\"tm-notice__inner\"><!----><\/p>\n<div class=\"tm-notice__content\" data-test-id=\"notice-content\"><!--[--><span>\u0422\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043c\u043e\u0433\u0443\u0442 \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432 \u043e\u043f\u0440\u043e\u0441\u0435. <a rel=\"nofollow\" href=\"\/kek\/v1\/auth\/habrahabr\/?back=\/ru\/articles\/907724\/&#038;hl=ru\">\u0412\u043e\u0439\u0434\u0438\u0442\u0435<\/a>, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430.<\/span><!--]--><\/div>\n<\/div>\n<\/div>\n<p><!--[--><\/p>\n<div class=\"tm-article-poll__header\">\u041a\u0430\u043a \u0432\u044b \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0435, \u0438\u043c\u0435\u0435\u0442 \u043b\u0438 \u0442\u0430\u043a\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043f\u0440\u0430\u0432\u043e \u043d\u0430 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0435?<\/div>\n<div class=\"tm-article-poll__answers\"><!--[--><\/p>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent tm-article-poll__answer-percent_winning\">66.67% <\/span><span class=\"tm-article-poll__answer-label\">\u0414\u0430, \u0438\u043c\u0435\u0435\u0442.<\/span><span class=\"tm-article-poll__answer-votes\">2<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress tm-article-poll__answer-progress_winning\" style=\"width: 66.67%\"><\/div>\n<\/div>\n<\/div>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent\">0% <\/span><span class=\"tm-article-poll__answer-label\">\u0412\u0440\u044f\u0434\u043b\u0438.<\/span><span class=\"tm-article-poll__answer-votes\">0<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress\" style=\"width: 0%\"><\/div>\n<\/div>\n<\/div>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent\">33.33% <\/span><span class=\"tm-article-poll__answer-label\">\u0422\u0440\u0443\u0434\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c.<\/span><span class=\"tm-article-poll__answer-votes\">1<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress\" style=\"width: 33.33%\"><\/div>\n<\/div>\n<\/div>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent\">0% <\/span><span class=\"tm-article-poll__answer-label\">\u042f \u043d\u0435 \u043f\u043e\u043d\u044f\u043b(\u0430), \u043a\u0430\u043a\u0443\u044e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0440\u0435\u0448\u0430\u0435\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0438 \u0437\u0430\u0447\u0435\u043c \u043e\u043d\u0430 \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0443\u0436\u043d\u0430.<\/span><span class=\"tm-article-poll__answer-votes\">0<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress\" style=\"width: 0%\"><\/div>\n<\/div>\n<\/div>\n<p><!--]--><\/div>\n<div class=\"tm-article-poll__stats\"> \u041f\u0440\u043e\u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043b\u0438 3 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f.    \u0412\u043e\u0437\u0434\u0435\u0440\u0436\u0430\u043b\u0438\u0441\u044c 2 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. <\/div>\n<p><!--]--><\/div>\n<p><!--]--><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/907724\/\"> https:\/\/habr.com\/ru\/articles\/907724\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u042f \u043d\u0430\u0447\u0430\u043b \u044d\u0442\u043e\u0442 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c isomorphic-validation, \u043a\u0430\u043a \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442, \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0432 \u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0446\u0435\u043b\u044f\u0445. \u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0434\u0440\u0443\u0433\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438, \u044f \u0440\u0435\u0448\u0438\u043b \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u0438\u0437\u043e\u0431\u0440\u0435\u0441\u0442\u0438 \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434. \u042d\u0442\u043e \u0431\u044b\u043b\u0430 \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u0441\u043a\u0440\u044b\u0442\u044c \u0432\u0441\u0435 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u043c\u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430\u043c\u0438 \u0438 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430, \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u043e\u0439 \u0434\u043b\u044f \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a \u044f \u043d\u043e\u0432\u0438\u0447\u043a\u043e\u0432, \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0438\u043d\u0435\u043d\u0438\u044f \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u0431\u0435\u0437 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430.<\/p>\n<p>\u042f \u0432\u044b\u0434\u0432\u0438\u043d\u0443\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u043a \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435:<\/p>\n<ul>\n<li>\n<p>\u0413\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0439, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0432\u0430\u043b\u0438\u0434\u043d\u043e\u0441\u0442\u0438 \u0433\u0440\u0443\u043f\u043f\u044b \u0437\u0430\u0432\u0438\u0441\u0435\u043b\u043e \u043e\u0442 \u043a\u0430\u0436\u0434\u043e\u0439 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u0432 \u0433\u0440\u0443\u043f\u043f\u0435;<\/p>\n<\/li>\n<li>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c &#171;\u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f&#187; \u044d\u0444\u0444\u0435\u043a\u0442\u043e\u0432 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u043a \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f\u043c \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u043e\u0432, \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0439 \u0438 \u0433\u0440\u0443\u043f\u043f \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0439;<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u0438\u043c\u0438\u043d\u0435\u043d\u0438\u0435 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0439 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0438 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 <a href=\"https:\/\/expressjs.com\/en\/guide\/using-middleware.html\" rel=\"noopener noreferrer nofollow\">Express middleware<\/a> \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430;<\/p>\n<\/li>\n<li>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0438\u0445 \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u043e\u0432 \u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u043e\u0432 \u043e\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0445;<\/p>\n<\/li>\n<li>\n<p>\u041e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0445 \u0438 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0445 \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u043e\u0432;<\/p>\n<\/li>\n<li>\n<p>\u0423\u0434\u043e\u0431\u0441\u0442\u0432\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043b\u044e\u0431\u043e\u0439 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u0438 \u043d\u0430 \u043b\u044e\u0431\u043e\u0439 \u0442\u0438\u043f \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0444\u043e\u0440\u043c\u044b; <\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c \u0441 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u043c\u0438 \u0438\u043d\u0442\u0435\u0440\u043d\u0430\u0446\u0438\u043e\u043d\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e \u044f \u043f\u043e\u043f\u0440\u043e\u0448\u0443 \u0432\u0430\u0441 \u0432\u0437\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043e\u0431\u0440\u0430\u0437\u0435\u0446 \u043a\u043e\u0434\u0430 \u0438, \u043d\u0435 \u0432\u0438\u0434\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u0435\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u043f\u043e\u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c, \u0447\u0442\u043e \u043e\u043d \u0434\u0435\u043b\u0430\u0435\u0442:<\/p>\n<pre><code class=\"javascript\">form.addEventListener(   'input',   Validation.group(      Validation(form.email)       .constraint(isEmail, { err: 'Must be in the E-mail format.' })       .validated(applyOutline(form.email, delayedOutline))       .changed(applyOutline(form.email, changedOutline))       .validated(applyBox(form.email, validIcon))       .validated(applyBox(form.email, errMsg)),      Validation(form.password)       .constraint(isStrongPassword, { err: 'Min. 8 characters, 1 capital letter, 1 number, 1 special character.' })       .validated(applyOutline(form.password, delayedOutline))       .changed(applyOutline(form.password, changedOutline))       .validated(applyBox(form.password, validIcon))       .validated(applyBox(form.password, errMsg)),    )   .changed(applyAccess(form.submitBtn, delayedAccess)) );<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u0443\u0435\u043c \u0434\u0432\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u0432 \u043e\u0434\u0438\u043d \u0438 \u043f\u0440\u0438\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u043c \u043a \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044e \u0435\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0432\u0430\u043b\u0438\u0434\u043d\u043e\u0441\u0442\u0438 \u044d\u0444\u0444\u0435\u043a\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043a\u043d\u043e\u043f\u043a\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0444\u043e\u0440\u043c\u044b (\u0430\u0442\u0442\u0440\u0438\u0431\u0443\u0442 <code>disabled<\/code>). \u041a \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044e \u043a\u0430\u0436\u0434\u043e\u0439 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u0432  \u0433\u0440\u0443\u043f\u043f\u0435 \u0442\u043e\u0436\u0435 \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u044b \u044d\u0444\u0444\u0435\u043a\u0442\u044b: \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0438\u043a\u043e\u043d\u043a\u0438, \u043e\u0431\u0432\u043e\u0434\u043a\u0438 \u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043e \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>\u041f\u0440\u043e\u0449\u0435 \u0433\u043e\u0432\u043e\u0440\u044f, \u043a\u043e\u0433\u0434\u0430 \u0432 \u043e\u0431\u0430 \u043f\u043e\u043b\u044f \u0432\u0432\u0435\u0434\u0435\u043d\u044b \u0432\u0430\u043b\u0438\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u043a\u043d\u043e\u043f\u043a\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0444\u043e\u0440\u043c\u044b \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0439 \u0434\u043b\u044f \u043d\u0430\u0436\u0430\u0442\u0438\u044f. \u0412\u0430\u043b\u0438\u0434\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u043e\u043b\u044f \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442\u0441\u044f \u0438\u043a\u043e\u043d\u043a\u043e\u0439, \u043d\u0435\u0432\u0430\u043b\u0438\u0434\u043d\u043e\u0435 \u0441\u043e\u043f\u0440\u043e\u0432\u043e\u0436\u0434\u0430\u0435\u0442\u0441\u044f \u043e\u0431\u0432\u043e\u0434\u043a\u043e\u0439 \u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435\u043c \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0435 \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u043e\u0439.<\/p>\n<p><strong>\u041f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0430 \u0441 \u043f\u043e\u043b\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f <\/strong><a href=\"https:\/\/itihon.github.io\/isomorphic-validation\/quick-introduction\/\" rel=\"noopener noreferrer nofollow\"><strong>\u0437\u0434\u0435\u0441\u044c<\/strong><\/a><strong>.<\/strong><\/p>\n<h3>\u041c\u043e\u0442\u0438\u0432\u0430\u0446\u0438\u044f<\/h3>\n<p>\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e\u0442 \u043d\u0430\u0431\u043e\u0440 \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u043e\u0432 \u0432 \u0442\u043e\u043c \u0438\u043b\u0438 \u0438\u043d\u043e\u043c \u0432\u0438\u0434\u0435 \u0438 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441 \u043d\u0438\u043c\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439. \u041d\u0430\u043b\u0438\u0447\u0438\u0435 \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u043e\u0432 \u043d\u0430 \u0432\u0441\u0435 \u0441\u043b\u0443\u0447\u0430\u0438 \u0436\u0438\u0437\u043d\u0438, \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0445 \u0432 \u043e\u0434\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435, \u0434\u0430\u043b\u0435\u043a\u043e \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0438\u0445 \u043f\u0440\u0438\u043c\u0438\u043d\u0435\u043d\u0438\u044f. \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0438 \u0438\u043d\u0434\u0438\u043a\u0430\u0446\u0438\u0438 \u0432\u0430\u043b\u0438\u0434\u043d\u043e\u0441\u0442\u0438 \u043f\u043e\u043b\u0435\u0439 \u0432\u0432\u043e\u0434\u0430, \u043d\u043e \u043e\u043d \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439, \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044e. <\/p>\n<p>\u041c\u043d\u0435 \u0436\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0438\u043c\u0435\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431\u043b\u0435\u0433\u0447\u0430\u043b \u0431\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0432\u043e\u043e\u0431\u0449\u0435 <strong>\u043b\u044e\u0431\u043e\u0433\u043e<\/strong> \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u043b \u0431\u044b \u0441\u043a\u0440\u044b\u0442\u044c \u0432\u0441\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0438 \u0444\u043e\u043a\u0443\u0441\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u0442\u043e\u043c, <strong>\u0447\u0442\u043e<\/strong> \u0432\u0430\u043b\u0438\u0434\u0438\u0440\u0443\u0435\u043c, \u0438 <strong>\u0441 \u043a\u0430\u043a\u0438\u043c\u0438<\/strong> \u043f\u043e\u0431\u043e\u0447\u043d\u044b\u043c\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0430\u043c\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430, \u043d\u0435 \u0431\u0435\u0441\u043f\u043e\u043a\u043e\u044f\u0441\u044c \u043e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u043e\u0433\u043e \u0440\u043e\u0434\u0430 \u043f\u043e\u0433\u0440\u0430\u043d\u0438\u0447\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0443\u0441\u0442\u044b\u0435 \u043f\u043e\u043b\u044f \u0432\u0432\u043e\u0434\u0430 \u043f\u0430\u0440\u043e\u043b\u044f \u0438 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u043e\u043b\u044f \u0440\u0430\u0432\u043d\u044b \u0438\u043b\u0438 \u043f\u043e\u043a\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0437\u0430\u043f\u0440\u043e\u0441, \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0432\u0432\u0435\u043b \u0435\u0449\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043d\u0435 \u0430\u043a\u0442\u0443\u0430\u043b\u0435\u043d \u0438 \u0442.\u0434.<\/p>\n<h3>\u041a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044f<\/h3>\n<p>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043d\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0433\u043e\u0442\u043e\u0432\u044b\u0445 \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u043e\u0432 (\u044d\u0442\u0443 \u0437\u0430\u0434\u0430\u0447\u0443 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442 \u0434\u0440\u0443\u0433\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438). \u0417\u0434\u0435\u0441\u044c \u043b\u043e\u0433\u0438\u043a\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0430\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u043e\u0432, \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0437\u0430\u0432\u0435\u0440\u043d\u0443\u0442\u0430 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e-\u043f\u0440\u0435\u0434\u0438\u043a\u0430\u0442, \u043d\u0430 \u0432\u0445\u043e\u0434\u0435 \u0432\u0430\u043b\u0438\u0434\u0438\u0440\u0443\u0435\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u0431\u0443\u043b\u0435\u0432\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u043b\u0438 \u043f\u0440\u043e\u043c\u0438\u0441 \u0441 \u0431\u0443\u043b\u0435\u0432\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c.  \u042f \u043e\u0431\u044b\u0447\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u044b \u0438\u0437 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <a href=\"https:\/\/github.com\/validatorjs\/validator.js\" rel=\"noopener noreferrer nofollow\">validator.js<\/a>.<\/p>\n<p>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442 \u0434\u0432\u0435 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 <code>Validation<\/code> \u0438 <code>Predicate<\/code>, \u0430 \u0442\u0430\u043a \u0436\u0435 \u043d\u0430\u0431\u043e\u0440 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u044d\u0444\u0444\u0435\u043a\u0442\u043e\u0432 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0438 \u0445\u0435\u043b\u043f\u0435\u0440\u043e\u0432.<\/p>\n<p><code>Validation<\/code> &#8212; \u044d\u0442\u043e \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c \u0441 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c \u0438 \u043b\u043e\u0433\u0438\u043a\u043e\u0439. \u041c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0434\u0438\u043d\u043e\u0447\u043d\u043e\u0439 \u0438\u043b\u0438 \u0433\u0440\u0443\u043f\u043f\u043e\u0432\u043e\u0439 ( \u0430 \u0435\u0449\u0435 &#171;\u0441\u043a\u043b\u0435\u0435\u043d\u043d\u043e\u0439&#187;). \u0421\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0433\u0440\u0443\u043f\u043f\u044b \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u0432 \u0433\u0440\u0443\u043f\u043f\u0435. \u0410 \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440, \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0433\u0440\u0443\u043f\u043f\u0435, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a \u043a\u0430\u0436\u0434\u043e\u0439 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u0432 \u0433\u0440\u0443\u043f\u043f\u0435:<\/p>\n<pre><code class=\"javascript\">Validation.group(    Validation(form.firstName),    Validation(form.lastName),  ) .constraint(isAlpha, { msg: '\u0422\u043e\u043b\u044c\u043a\u043e \u0431\u0443\u043a\u0432\u044b \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u044b.' }) .constraint(isLongerOrEqual(2), { msg: '\u041d\u0435 \u043a\u043e\u0440\u043e\u0447\u0435 2 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432.' }) .constraint(isShorterOrEqual(32), { msg: '\u041d\u0435 \u0434\u043b\u0438\u043d\u043d\u0435\u0435 32 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432.' })<\/code><\/pre>\n<figure class=\"full-width\">\n<div><figcaption>\u0413\u0440\u0443\u043f\u043f\u0430 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0439<\/figcaption><\/div>\n<\/figure>\n<p>&#171;\u0421\u043a\u043b\u0435\u0435\u043d\u043d\u0430\u044f&#187; \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044f &#8212; \u044d\u0442\u043e \u0442\u043e\u0436\u0435 \u0433\u0440\u0443\u043f\u043f\u0430, \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u043e\u0431\u044b\u0447\u043d\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u044b \u0442\u0435\u043c, \u0447\u0442\u043e \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043d\u0430 \u0432\u0445\u043e\u0434 \u0432\u0430\u043b\u0438\u0434\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0439 \u0432 \u0433\u0440\u0443\u043f\u043f\u0435, \u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0432\u0430\u043b\u0438\u0434\u043d\u043e\u0441\u0442\u0438 \u0432\u0441\u0435\u0445 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0439 \u0432 \u0433\u0440\u0443\u043f\u043f\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u0430 (\u0432\u0437\u0430\u0438\u043c\u043e\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0435 \u043f\u043e\u043b\u044f \u043f\u0430\u0440\u043e\u043b\u044c \u0438 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u043e\u043b\u044f):<\/p>\n<pre><code class=\"javascript\">Validation.glue(   Validation(form.password),    Validation(form.pwdConfirm), ) .constraint(equals, { msg: '\u041f\u0430\u0440\u043e\u043b\u044c \u0438 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u043e\u043b\u044f \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0442\u044c.' })<\/code><\/pre>\n<p>\u0422\u0430\u043a \u0436\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0442\u0430\u043a\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432\u0430\u043b\u0438\u0434\u043d\u043e\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0434\u0440\u0443\u0433\u043e\u0433\u043e (\u043e\u0434\u043d\u043e\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u044f\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c). <strong>\u041f\u0440\u0438\u043c\u0435\u0440 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c<\/strong> <a href=\"https:\/\/itihon.github.io\/isomorphic-validation\/api\/validation\/static-methods\/glue\/#validating-one-field-depending-on-another\" rel=\"noopener noreferrer nofollow\"><strong>\u0437\u0434\u0435\u0441\u044c<\/strong><\/a>.<\/p>\n<p><code>Predicate<\/code> &#8212; \u044d\u0442\u043e \u043e\u0431\u0432\u0435\u0440\u0442\u043a\u0430, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0430\u044f \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u044d\u0444\u0444\u0435\u043a\u0442\u043e\u0432 \u043a \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f\u043c \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u043e\u0432 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0434\u043e \u0438\u0445 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043a \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438:<\/p>\n<pre><code class=\"javascript\">Validation()   .constraint(     Predicate(isEmailRegistered, { msg: '\u0414\u0430\u043d\u043d\u044b\u0439 \u0430\u0434\u0440\u0435\u0441 \u0443\u0436\u0435 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d.' })       .started(doSomething)       .invalid(doSomethingElse)   )<\/code><\/pre>\n<p>\u041a\u0430\u0436\u0434\u0430\u044f \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044f \u0438 \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440 \u0438\u043c\u0435\u044e\u0442 \u0440\u044f\u0434 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 (\u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 \u0430\u0432\u0442\u043e\u043c\u0430\u0442), \u043a \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u044d\u0444\u0444\u0435\u043a\u0442\u044b: <\/p>\n<pre><code class=\"javascript\">Validation.group(      Validation()     .constraint(       Predicate(isSomething)         .started(doSomething)         .valid(doSomething)         .invalid(doSomething)         .changed(doSomething)         .validated(doSomething)     )     .started(doSomething)     .valid(doSomething)     .invalid(doSomething)     .changed(doSomething)     .validated(doSomething) ) .started(doSomething) .valid(doSomething) .invalid(doSomething) .changed(doSomething) .validated(doSomething)<\/code><\/pre>\n<p>  \u0421\u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0447\u0435\u0440\u0435\u0437 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e <code>.validations<\/code> \u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u044b \u0447\u0435\u0440\u0435\u0437 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e <code>.constraints<\/code>:<\/p>\n<pre><code class=\"javascript\">Validation.group(   Validation(form.firstName),   Validation(form.lastName), ) .validations.forEach( \/\/ &lt;--   validation =&gt; {     validation.validated(doSomething);   } );  \/\/--------------------------------------  Validation.group(      Validation(form.email)     .constraint(isEmail),      Validation(form.password)     .constraint(isStrongPassword), ) .constraints.forEach( \/\/ &lt;--   (validator, formField) =&gt; {     validator.validated(applyOutline(formField));   } );<\/code><\/pre>\n<p>\u0414\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0442\u0435\u0445 \u0436\u0435 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0439 \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0438\u0445, \u043d\u0435 \u043f\u0440\u0438\u0432\u044f\u0437\u044b\u0432\u0430\u044f \u043a \u043f\u043e\u043b\u044f\u043c \u0444\u043e\u0440\u043c\u044b, \u0438 \u0441\u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>.profile()<\/code>:<\/p>\n<pre><code class=\"javascript\">const emailV = Validation()   .constraint(isMinLength(8), { next: false })   .constraint(isMaxLength(48), { next: false })   .constraint(isEmail, { next: false });  const passwordV = Validation()   .constraint(isStrongPassword);  const pwdConfirm = Validation();  Validation.glue(passwordV, pwdConfirm)   .constraint(equals);  const [signupForm, signupV] = Validation.profile(   '[name=\"signupForm\"]',   ['email', 'password', 'pwdConfirm'],   [emailV, passwordV, pwdConfirm], );<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044f <code>signupV<\/code> \u0433\u043e\u0442\u043e\u0432\u0430 \u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e, \u043a\u0430\u043a \u043d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0435, \u0442\u0430\u043a \u0438 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435:<\/p>\n<pre><code class=\"javascript\">\/\/ \u043d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0435 signupForm.addEventListener('input', signupV);  \/\/ \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 app.post('\/signup', urlencodeParser, signupV, signupHandler);<\/code><\/pre>\n<p>\u0410 \u044d\u0442\u043e \u0435\u0441\u043b\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0442\u0434\u0435\u043b\u0438\u0442\u044c \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0438\u0435 \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u044b \u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u044b \u043e\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0445:<\/p>\n<pre><code class=\"javascript\">Validation()   .client \/\/ &lt;--   .validated(doSomethingOnClient)  \/\/-----------------------------------  Validation()   .server \/\/ &lt;--   .invalid(doSomethingOnServer)<\/code><\/pre>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u0434\u0435\u043b\u0438\u0442\u044c \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440 \u043d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0435, \u0434\u0435\u043b\u0430\u044e\u0449\u0438\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0443, \u0438 \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0434\u0435\u043b\u0430\u044e\u0449\u0438\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445:<\/p>\n<pre><code class=\"javascript\">const emailV = Validation()   .constraint(isEmail, { next: false }) \/\/ \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0441\u044f \u043d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0435 \u0438 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435   .client   .constraint(isEmailRegisteredC); \/\/ \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0435  \/\/-----------------------------------  emailV   .server   .constraint(isEmailRegisteredS); \/\/ \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435<\/code><\/pre>\n<p>\u0412\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u044b \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0443\u0441\u043b\u043e\u0432\u043d\u043e \u0438 \u0441 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u043e\u0439. \u0417\u0430\u0434\u0435\u0440\u0436\u043a\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u0430 \u0434\u043b\u044f \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u043e\u0432, \u0434\u0435\u043b\u0430\u044e\u0449\u0438\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u043f\u0440\u0438 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u043f\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u044e <code>input<\/code>. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u043e\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 \u0441 \u043e\u043f\u0446\u0438\u044f\u043c\u0438:<\/p>\n<pre><code class=\"javascript\">const emailV = Validation()   .constraint(isEmail, { next: false }) \/\/ \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d, \u043f\u043e\u043a\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043d\u0435 \u0432\u0435\u0440\u043d\u0435\u0442 true   .constraint(isEmailRegisteredC, { debounce: 5000 }); \/\/ \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440<\/code><\/pre>\n<p>\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432 \u044d\u0442\u043e\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 \u0441 \u043e\u043f\u0446\u0438\u044f\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043b\u044e\u0431\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043b\u044e\u0431\u043e\u043c \u0432\u0438\u0434\u0435, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0438\u043b\u0438 \u043a\u043b\u044e\u0447\u0438 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u043e\u0432. \u041e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u043e\u0431\u0440\u043e\u0448\u0435\u043d\u044b \u043f\u043e\u0434 \u0442\u0435\u043c\u0438 \u0436\u0435 \u0438\u043c\u0435\u043d\u0430\u043c\u0438 \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u0430\u043b\u0438\u0446\u0438\u0438. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e \u0441 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 <a href=\"https:\/\/www.i18next.com\/\" rel=\"noopener noreferrer nofollow\">i18next<\/a> \u043c\u043e\u0436\u043d\u043e <strong>\u043d\u0430\u0439\u0442\u0438<\/strong> <a href=\"https:\/\/itihon.github.io\/isomorphic-validation\/api\/validation\/instance-methods\/constraint\/#parameter-anydata\" rel=\"noopener noreferrer nofollow\"><strong>\u0437\u0434\u0435\u0441\u044c<\/strong><\/a>.<\/p>\n<h3>\u042d\u0444\u0444\u0435\u043a\u0442\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430<\/h3>\n<p>\u041e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043e\u0442 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0430\u0431\u043e\u0440 \u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0445 \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u0447 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u043e\u0432, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a: \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u043c \u043a DOM \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c, \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0444\u043e\u043d\u0430, \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0438\u043a\u043e\u043d\u043e\u043a \u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439, \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u0430, \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e\u0431\u0432\u043e\u0434\u043a\u0438. <\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u044d\u0444\u0444\u0435\u043a\u0442\u043e\u0432 \u0438 \u0440\u0430\u0437\u043d\u0443\u044e \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0443 \u0438\u0445 \u043f\u0440\u0438\u043c\u0438\u043d\u0435\u043d\u0438\u044f \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0432\u0430\u043b\u0438\u0434\u043d\u043e\u0441\u0442\u0438:<\/p>\n<pre><code class=\"javascript\">const delayedOutline = {   \/\/ \u043f\u0440\u0438 \u043d\u0435\u0432\u0430\u043b\u0438\u0434\u043d\u043e\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438, \u0440\u043e\u0437\u043e\u0432\u0430\u044f \u043e\u0431\u0432\u043e\u0434\u043a\u0430, \u0441\u043f\u0443\u0441\u0442\u044f 2 \u0441\u0435\u043a\u0443\u043d\u0434\u044b   false: { delay: 2000, value: '2px solid lightpink' },   \/\/ \u043f\u0440\u0438 \u0432\u0430\u043b\u0438\u0434\u043d\u043e\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438, \u0443\u0431\u0440\u0430\u0442\u044c \u043e\u0431\u0432\u043e\u0434\u043a\u0443, \u0441\u043f\u0443\u0441\u0442\u044f \u043f\u043e\u043b \u0441\u0435\u043a\u0443\u043d\u0434\u044b   true: { delay: 500, value: '' }, };  Validation(form.email)   .constraint(isEmail)   .validated(applyOutline(delayedOutline))   .validate();<\/code><\/pre>\n<p>\u041d\u043e \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0441\u043b\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d \u043e\u0442\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u044d\u0444\u0444\u0435\u043a\u0442, \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u043e\u0441\u044c \u0440\u0430\u043d\u044c\u0448\u0435, \u0447\u0435\u043c \u043e\u043d \u043d\u0430\u0441\u0442\u0443\u043f\u0438\u043b \u0438 \u0434\u043b\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043e\u043d \u043d\u0435 \u0430\u043a\u0442\u0443\u0430\u043b\u0435\u043d? \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u044d\u0444\u0444\u0435\u043a\u0442\u0430. \u042d\u0444\u0444\u0435\u043a\u0442\u044b \u0441 \u043e\u0434\u043d\u0438\u043c \u0438 \u0442\u0435\u043c \u0436\u0435 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u043c, \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u043d\u044b\u0435 \u043a \u043e\u0434\u043d\u043e\u043c\u0443 \u0438 \u0442\u043e\u043c\u0443 \u0436\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443, \u043e\u0442\u043c\u0435\u043d\u044f\u044e\u0442 \u0434\u0440\u0443\u0433 \u0434\u0440\u0443\u0433\u0430:<\/p>\n<pre><code class=\"javascript\">const delayedOutline = {   false: { delay: 2000, value: '2px solid lightpink' },   true: { delay: 500,<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-459569","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/459569","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=459569"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/459569\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=459569"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=459569"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=459569"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}