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…
| // ============ | |
| // Helper: log. | |
| // ============ | |
| const log = (error) => { | |
| console.log(error?.message || error); | |
| } | |
| // =============== | |
| // Promise reject. |
| require('@testing-library/jest-dom'); | |
| // Override. | |
| Object.defineProperty(window, 'requestAnimationFrame', { | |
| writable: true, | |
| value: (f) => { | |
| if (typeof f === 'function') { | |
| f(); | |
| } | |
| }, |
| <script lang="ts"> | |
| // ====== | |
| // Props. | |
| // ====== | |
| const { Component, slot, ...otherProps } = $$props; | |
| </script> | |
| <!-- | |
| ======= |
| /* | |
| Code snippet from this tweet. | |
| https://twitter.com/nathansmith/status/1542887226803101697 | |
| */ | |
| // Generator function. | |
| function* dealWithIt() { | |
| // Step 1. | |
| yield '🙂'; |
| // =============== | |
| // 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; | |
| } |