These are a few examples of how to validate various zip code formats.
In the following examples, A
represents any letter and 9
means any number.
Read more here…
// =============== | |
// Sleep function. | |
// =============== | |
const sleep = async (seconds = 0) => { | |
// Expose promise. | |
return new Promise((resolve) => { | |
// Set timer. | |
setTimeout(() => { | |
// Resolve promise. |
<!doctype html> | |
<html lang="en-us"> | |
<head> | |
<meta charset="utf-8" /> | |
<meta | |
content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1" | |
name="viewport" | |
/> | |
<title>Flex layout example</title> | |
<style> |
import React from 'react'; | |
import { render } from 'react-dom'; | |
// Test subject. | |
import MyComponent from './MyComponent'; | |
// ==================== | |
// Describe `fileName`. | |
// ==================== |
export type IJson = IJsonArray | IJsonObject | boolean | number | null | string; | |
export type IJsonArray = IJson[]; | |
/* | |
===== | |
NOTE: | |
===== | |
This is an `interface` because the reference |
These are a few examples of how to validate various zip code formats.
In the following examples, A
represents any letter and 9
means any number.
Read more here…
@function rkv-map-merge($maps...) { | |
$collection: (); | |
@each $map in $maps { | |
$collection: map-merge($collection, $map); | |
} | |
@return $collection; | |
} |
const { existsSync } = require('fs'); | |
const { execSync } = require('child_process'); | |
// ================ | |
// Check existence. | |
// ================ | |
const distFolderExists = existsSync('dist'); | |
const srcFolderExists = existsSync('src'); |
module.exports = { | |
collectCoverageFrom: ['./src/**/*.js', '!./src/fixtures/**', '!./src/svg-icons/'], | |
moduleNameMapper: { | |
'\\.(css|scss)$': '<rootDir>/jest.css.js', | |
'\\.svg$': '<rootDir>/jest.svg.js', | |
}, | |
testPathIgnorePatterns: ['/.cache/', '/public/'], | |
transform: { | |
'\\.jsx?$': '<rootDir>/jest.jsx.js', | |
}, |
// START: closure. | |
(async () => { | |
// Test URL. | |
const url = '/?rest_route=/wp/v2/posts&per_page=100'; | |
// Example options. | |
const options = { | |
credentials: 'include', | |
headers: { | |
'content-type': 'application/json', |
/* | |
Helper to mock DOM methods, for | |
when an element might not exist. | |
*/ | |
const getDomFallback = () => { | |
return { | |
// Props. | |
children: [], | |
className: '', | |
classList: { |