Validator | Description |
---|---|
contains(str, seed [, options ]) | check if the string contains the seed.options is an object that defaults to { ignoreCase: false} .ignoreCase specified whether the case of the substring be same or not. |
equals(str, comparison) | check if the string matches the comparison. |
isAfter(str [, date]) | check if the string is a date that's after the specified date (defaults to now). |
isAlpha(str [, locale, options]) | check if the string contains only letters (a-zA-Z). Locale is one of `['ar', 'ar-AE', 'ar-BH', 'ar-DZ', 'ar-EG', 'ar-IQ', 'ar-JO', 'ar-KW', 'ar-LB', 'ar-LY', 'ar-MA', 'ar-QA', 'ar-QM', 'ar-SA', 'ar-SD', 'ar-SY', 'ar-TN', 'ar-YE', 'bg-BG', 'cs-CZ', 'da-DK', 'de-DE', 'el-GR', 'en-AU', 'en-GB', 'en-HK', 'en-IN', 'en-NZ', 'en-US', 'en-ZA', 'en-ZM', 'es-ES', 'fa-IR', 'fr-CA', 'fr-FR', 'he', 'hu-HU', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
const password = 'secure secret key' | |
const encrypt = (content, password) => CryptoJS.AES.encrypt(JSON.stringify({ content }), password).toString() | |
const decrypt = (crypted, password) => JSON.parse(CryptoJS.AES.decrypt(crypted, password).toString(CryptoJS.enc.Utf8)).content | |
// Encrypt | |
const encryptedString = encrypt('This is a string', password) | |
const encryptedObject = encrypt({ test: 'This is an object' }, password) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Type definitions for react-query 0.3 | |
// Project: https://github.com/tannerlinsley/react-query | |
// Definitions by: Lukasz Fiszer <https://github.com/lukaszfiszer> | |
// Jace Hensley <https://github.com/jacehensley> | |
// Matteo Frana <https://github.com/matteofrana> | |
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | |
import { ComponentType } from 'react'; | |
// overloaded useQuery function with pagination |