Skip to content

Commit

Permalink
chore: update en.json until isMACAddress
Browse files Browse the repository at this point in the history
  • Loading branch information
gabriel-logan committed May 28, 2024
1 parent 5494fc7 commit 6fdbf21
Show file tree
Hide file tree
Showing 11 changed files with 378 additions and 213 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,50 +4,61 @@ import { Prism as SyntaxHighlighter } from "react-syntax-highlighter";
import { a11yDark } from "react-syntax-highlighter/dist/esm/styles/prism";

import DrawerComponent from "@/components/Drawer";
import translation from "@/components/Internationalization";

export default function IsAscii() {
const t = (text: string) =>
translation({ text, subject: "DocumentationJsFunctions" });

return (
<div id="page-content-wrapper">
<div className="relative mr-10 flex justify-end p-4">
<DrawerComponent />
</div>
<div className="container-fluid container">
<h1 className="title">isAscii Function Documentation</h1>
<h1 className="title">isAscii {t("Function Documentation")}</h1>
<p>
The <code>isAscii</code> function checks if the input string contains
only ASCII characters. It returns <code>true</code> if the string is
composed of ASCII characters, and <code>false</code> otherwise.
{t("The")} <code>isAscii</code>{" "}
{t(
"function checks if the input string contains only ASCII characters. It returns",
)}{" "}
<code>true</code>{" "}
{t("if the string is composed of ASCII characters, and")}{" "}
<code>false</code> {t("otherwise.")}
</p>

<h2 className="subtitle">Import</h2>
<h2 className="subtitle">{t("Import")}</h2>
<p>
The function can be imported using ES6 syntax from the
&quot;multiform-validator&quot; package:
{t(
'The function can be imported using ES6 syntax from the "multiform-validator" package:',
)}
</p>

<SyntaxHighlighter language="javascript" style={a11yDark}>
{`import { isAscii } from 'multiform-validator';`}
</SyntaxHighlighter>

<p>
Alternatively, you can import the function using CommonJS syntax with{" "}
<code>require</code> (Node.js):
{t(
"Alternatively, you can import the function using CommonJS syntax with",
)}{" "}
<code>{t("require")}</code> (Node.js):
</p>

<SyntaxHighlighter language="javascript" style={a11yDark}>
{`const { isAscii } = require('multiform-validator');`}
</SyntaxHighlighter>

<h2 className="subtitle">Parameters</h2>
<p>The function takes one parameter:</p>
<h2 className="subtitle">{t("Parameters")}</h2>
<p>{t("The function takes one parameter:")}</p>
<ul>
<li>
<code>value</code> (string) - The input string to check for ASCII
characters.
<code>value</code> (string) -{" "}
{t("The input string to check for ASCII characters.")}
</li>
</ul>

<h2 className="subtitle">Examples</h2>
<h2 className="subtitle">{t("Examples")}</h2>

<SyntaxHighlighter language="javascript" style={a11yDark}>
{`// Example 1 - Checking if the string contains only ASCII characters
Expand All @@ -71,13 +82,15 @@ const result5 = isAscii(undefined);
console.log(result5); // false`}
</SyntaxHighlighter>

<h2 className="subtitle">Notes</h2>
<h2 className="subtitle">{t("Notes")}</h2>
<p>
The function expects the input value to be passed as a string. It
checks each character of the string, and if any character has a
character code greater than 127 (non-ASCII), the function returns{" "}
<code>false</code>. If the input is not a string or an empty string,
it throws an error.
{t(
"The function expects the input value to be passed as a string. It checks each character of the string, and if any character has a character code greater than 127 (non-ASCII), the function returns",
)}{" "}
<code>false</code>.{" "}
{t(
"If the input is not a string or an empty string, it throws an error.",
)}
</p>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,50 +4,61 @@ import { Prism as SyntaxHighlighter } from "react-syntax-highlighter";
import { a11yDark } from "react-syntax-highlighter/dist/esm/styles/prism";

import DrawerComponent from "@/components/Drawer";
import translation from "@/components/Internationalization";

export default function IsBase64() {
const t = (text: string) =>
translation({ text, subject: "DocumentationJsFunctions" });

return (
<div id="page-content-wrapper">
<div className="relative mr-10 flex justify-end p-4">
<DrawerComponent />
</div>
<div className="container-fluid container">
<h1 className="title">isBase64 Function Documentation</h1>
<h1 className="title">isBase64 {t("Function Documentation")}</h1>
<p>
The <code>isBase64</code> function checks if the input string is a
valid Base64 string. It returns <code>true</code> if the string is a
valid Base64, and <code>false</code> otherwise.
{t("The")} <code>isBase64</code>{" "}
{t(
"function checks if the input string is a valid Base64 string. It returns",
)}{" "}
<code>true</code> {t("if the string is a valid Base64, and")}{" "}
<code>false</code> {t("otherwise.")}
</p>

<h2 className="subtitle">Import</h2>
<h2 className="subtitle">{t("Import")}</h2>
<p>
The function can be imported using ES6 syntax from the
&quot;multiform-validator&quot; package:
{t(
'The function can be imported using ES6 syntax from the "multiform-validator" package:',
)}
</p>

<SyntaxHighlighter language="javascript" style={a11yDark}>
{`import { isBase64 } from 'multiform-validator';`}
</SyntaxHighlighter>

<p>
Alternatively, you can import the function using CommonJS syntax with{" "}
<code>require</code> (Node.js):
{t(
"Alternatively, you can import the function using CommonJS syntax with",
)}{" "}
<code>{t("require")}</code> (Node.js):
</p>

<SyntaxHighlighter language="javascript" style={a11yDark}>
{`const { isBase64 } = require('multiform-validator');`}
</SyntaxHighlighter>

<h2 className="subtitle">Parameters</h2>
<p>The function takes one parameter:</p>
<h2 className="subtitle">{t("Parameters")}</h2>
<p>{t("The function takes one parameter:")}</p>

<ul>
<li>
<code>value</code> (string) - The input string to check if it is a
valid Base64 string.
<code>value</code> (string) -{" "}
{t("The input string to check if it is a valid Base64 string.")}
</li>
</ul>

<h2 className="subtitle">Examples</h2>
<h2 className="subtitle">{t("Examples")}</h2>

<SyntaxHighlighter language="javascript" style={a11yDark}>
{`// Example 1 - Checking if the string is a valid Base64
Expand All @@ -67,12 +78,11 @@ const result4 = isBase64(null);
console.log(result4); // false`}
</SyntaxHighlighter>

<h2 className="subtitle">Notes</h2>
<h2 className="subtitle">{t("Notes")}</h2>
<p>
The function expects the input value to be passed as a string. It
checks if the string is a valid Base64 string using a regular
expression. If the input is not a string or an empty string, it throws
an error.
{t(
"The function expects the input value to be passed as a string. It checks if the string is a valid Base64 string using a regular expression. If the input is not a string or an empty string, it throws an error.",
)}
</p>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,50 +4,62 @@ import { Prism as SyntaxHighlighter } from "react-syntax-highlighter";
import { a11yDark } from "react-syntax-highlighter/dist/esm/styles/prism";

import DrawerComponent from "@/components/Drawer";
import translation from "@/components/Internationalization";

export default function IsCEP() {
const t = (text: string) =>
translation({ text, subject: "DocumentationJsFunctions" });

return (
<div id="page-content-wrapper">
<div className="relative mr-10 flex justify-end p-4">
<DrawerComponent />
</div>
<div className="container-fluid container">
<h1 className="title">isCEP Function Documentation</h1>
<h1 className="title">isCEP {t("Function Documentation")}</h1>
<p>
The <code>isCEP</code> function checks if the input string is a valid
Brazilian ZIP Code (CEP). It returns <code>true</code> if the CEP is
valid, and <code>false</code> otherwise.
{t("The")} <code>isCEP</code>{" "}
{t(
"function checks if the input string is a valid Brazilian ZIP Code (CEP). It returns",
)}{" "}
<code>true</code> {t("if the CEP is valid, and")} <code>false</code>{" "}
{t("otherwise.")}
</p>

<h2 className="subtitle">Import</h2>
<h2 className="subtitle">{t("Import")}</h2>
<p>
The function can be imported using ES6 syntax from the
&quot;multiform-validator&quot; package:
{t(
'The function can be imported using ES6 syntax from the "multiform-validator" package:',
)}
</p>

<SyntaxHighlighter language="javascript" style={a11yDark}>
{`import { IsCEP } from 'multiform-validator';`}
{`import { isCEP } from 'multiform-validator';`}
</SyntaxHighlighter>

<p>
Alternatively, you can import the function using CommonJS syntax with{" "}
<code>require</code> (Node.js):
{t(
"Alternatively, you can import the function using CommonJS syntax with",
)}{" "}
<code>{t("require")}</code> (Node.js):
</p>

<SyntaxHighlighter language="javascript" style={a11yDark}>
{`const { IsCEP } = require('multiform-validator');`}
{`const { isCEP } = require('multiform-validator');`}
</SyntaxHighlighter>

<h2 className="subtitle">Parameters</h2>
<p>The function takes one parameter:</p>
<h2 className="subtitle">{t("Parameters")}</h2>
<p>{t("The function takes one parameter:")}</p>
<ul>
<li>
<code>cep</code> (string) - The input string to check if it is a
valid Brazilian ZIP Code (CEP).
<code>cep</code> (string) -{" "}
{t(
"The input string to check if it is a valid Brazilian ZIP Code (CEP).",
)}
</li>
</ul>

<h2 className="subtitle">Examples</h2>
<h2 className="subtitle">{t("Examples")}</h2>

<SyntaxHighlighter language="javascript" style={a11yDark}>
{`// Example 1 - Checking if the CEP is valid with dashes
Expand All @@ -63,8 +75,8 @@ const result3 = isCEP('12.345-678');
console.log(result3); // false`}
</SyntaxHighlighter>

<h2 className="subtitle">Notes</h2>
<p>The function expects the input to be passed as a string.</p>
<h2 className="subtitle">{t("Notes")}</h2>
<p>{t("The function expects the input to be passed as a string.")}</p>
</div>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,51 +4,65 @@ import { Prism as SyntaxHighlighter } from "react-syntax-highlighter";
import { a11yDark } from "react-syntax-highlighter/dist/esm/styles/prism";

import DrawerComponent from "@/components/Drawer";
import translation from "@/components/Internationalization";

export default function IsCreditCard() {
const t = (text: string) =>
translation({ text, subject: "DocumentationJsFunctions" });

return (
<div id="page-content-wrapper">
<div className="relative mr-10 flex justify-end p-4">
<DrawerComponent />
</div>
<div className="container-fluid container">
<h1 className="title">isCreditCardValid Function Documentation</h1>
<h1 className="title">
isCreditCardValid {t("Function Documentation")}
</h1>
<p>
The <code>isCreditCardValid</code> function checks if the input string
represents a valid credit card number using the Luhn algorithm. It
returns <code>true</code> if the credit card number is valid, and{" "}
<code>false</code> otherwise.
{t("The")} <code>isCreditCardValid</code>{" "}
{t(
"function checks if the input string represents a valid credit card number using the Luhn algorithm. It returns",
)}{" "}
<code>true</code> {t("if the credit card number is valid, and")}{" "}
<code>false</code> {t("otherwise.")}
</p>

<h2 className="subtitle">Import</h2>
<h2 className="subtitle">{t("Import")}</h2>
<p>
The function can be imported using ES6 syntax from the
&quot;multiform-validator&quot; package:
{t(
'The function can be imported using ES6 syntax from the "multiform-validator" package:',
)}
</p>

<SyntaxHighlighter language="javascript" style={a11yDark}>
{`import { isCreditCardValid } from 'multiform-validator';`}
</SyntaxHighlighter>

<p>
Alternatively, you can import the function using CommonJS syntax with{" "}
<code>require</code> (Node.js):
{t(
"Alternatively, you can import the function using CommonJS syntax with",
)}{" "}
<code>{t("require")}</code> (Node.js):
</p>

<SyntaxHighlighter language="javascript" style={a11yDark}>
{`const { isCreditCardValid } = require('multiform-validator');`}
</SyntaxHighlighter>

<h2 className="subtitle">Parameters</h2>
<p>The function takes one parameter:</p>
<h2 className="subtitle">{t("Parameters")}</h2>
<p>{t("The function takes one parameter:")}</p>

<ul>
<li>
<code>cardNumber</code> (string) - The input string representing the
credit card number to validate.
<code>cardNumber</code> (string) -{" "}
{t(
"The input string representing the credit card number to validate.",
)}
</li>
</ul>

<h2 className="subtitle">Examples</h2>
<h2 className="subtitle">{t("Examples")}</h2>

<SyntaxHighlighter language="javascript" style={a11yDark}>
{`// Example 1 - Valid credit card number with spaces
Expand All @@ -64,12 +78,11 @@ const result3 = isCreditCardValid('1234 5678 9012 3456');
console.log(result3); // false`}
</SyntaxHighlighter>

<h2 className="subtitle">Notes</h2>
<h2 className="subtitle">{t("Notes")}</h2>
<p>
The function expects the input value to be passed as a string
representing a credit card number. It removes any non-digit characters
and applies the Luhn algorithm to validate the credit card number. If
the input is not a string, the function throws an error.
{t(
"The function expects the input value to be passed as a string representing a credit card number. It removes any non-digit characters and applies the Luhn algorithm to validate the credit card number. If the input is not a string, the function throws an error.",
)}
</p>
</div>
</div>
Expand Down
Loading

0 comments on commit 6fdbf21

Please sign in to comment.