^(55)?(?:([1-9]{2})?)(\d{4,5})(\d{4})$
const regex = /^(55)?(?:([1-9]{2})?)(\d{4,5})(\d{4})$/;| export const updateParameter = (uri = '/', key, value) => { | |
| const hasQueries = uri.includes('?'); | |
| const hasHash = uri.includes('#'); | |
| let hash = ''; | |
| if (hasHash) { | |
| hash = uri.substr(uri.indexOf('#')); | |
| uri = uri.substr(0, uri.indexOf('#')); | |
| } | |
| let queries = ''; |
| import { parse } from 'https://deno.land/std/flags/mod.ts'; | |
| import readFileHelp from './read_file_help.ts'; | |
| import readFileList from './read_file_list.ts'; | |
| import readFileOutdated from './read_file_outdated.ts'; | |
| import readFileUpdate from './read_file_update.ts'; | |
| const args = parse(Deno.args); | |
| let arg; |
| const DEFAULT_TIMEOUT = 3000; | |
| function request(resource, options = {}) { | |
| const { timeout = DEFAULT_TIMEOUT } = options; | |
| delete options.timeout; | |
| return fetch(resource, { ...options, signal: AbortSignal.timeout(timeout) }); | |
| } | |
| export default request; |
| import React, { createContext, useContext, useState } from "react"; | |
| const Context = createContext({}); | |
| export function AuthContextProvider({ children }) { | |
| const [ auth, setAuth ] = useState(null); | |
| return ( | |
| <Context.Provider value={ { auth, setAuth } }> | |
| { children } |
| import fs from 'fs'; | |
| import { IncomingForm } from 'formidable'; | |
| import csvParser from 'csv-parser'; | |
| export default async (req, res) => { | |
| const data = await new Promise((resolve, reject) => { | |
| const form = new IncomingForm() | |
| form.parse(req, (err, fields, files) => { | |
| if (err) return reject(err); |
| # Load version control information | |
| autoload -Uz vcs_info | |
| precmd() { vcs_info } | |
| precmd_functions+=( precmd_vcs_info ) | |
| # Format the vcs_info_msg_0_ variable | |
| zstyle ':vcs_info:git:*' formats ' · %b' | |
| # Set up the prompt (with git branch name) | |
| setopt PROMPT_SUBST |
| function random(from = 0, to = 1) { | |
| return Math.random() * (to - from) + from; | |
| } | |
| export default random; |
| .content-grid { | |
| --padding: 1rem; | |
| --content-max-width: 700px; | |
| --breakout-max-width: 900px; | |
| justify-items: center; | |
| display: grid; | |
| grid-auto-flow: row; | |
| } | |
| .content-grid > * { | |
| box-sizing: border-box; |
| // Faster | |
| function html() { | |
| const base = arguments[0]; | |
| if (!arguments[1]) return base[0]; | |
| let html = base[0]; | |
| for (let i = 1; i < arguments.length; i++) { | |
| html += arguments[i]; | |
| if (base[i]) html += base[i]; | |
| } | |
| return html; |