This file contains hidden or 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" нахуй | |
ясенХуй apisauce внатуре require("apisauce").намутить нахуй | |
ясенХуй superagent внатуре require("superagent") нахуй | |
ясенХуй uuid внатуре require("uuid") нахуй | |
ясенХуй moment внатуре require("moment") нахуй | |
ясенХуйжЫMoleculerClientError есть внатуре require("moleculer").Errors нахуй | |
ясенХуй Utils внатуре require("./utils.mixin") нахуй |
This file contains hidden or 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
import { validate, define } from "superstruct"; | |
export function validatePhoneForE164(phoneNumber: string) { | |
const regEx = /^\+[1-9]\d{10,14}$/; | |
return regEx.test("+" + phoneNumber.replace(/\D/g, "")); | |
} | |
export const isAccept = define("isAccept", (value, context) => !!value); | |
export function CustomValidator<T>( |
This file contains hidden or 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
/*** function that used as middleware ***/ | |
accessToken: async (name) => { | |
if (typeof document === "undefined") return ""; | |
let token = document.cookie | |
.split(";") | |
.filter((cookie) => cookie.startsWith("token"))[0]; | |
if (!token) { | |
const response = await fetch("/api/refresh", { method: "POST" }); |
This file contains hidden or 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
import { NodeTypes } from "@reactflow/core/dist/esm/types"; | |
import { Edge, Node } from "reactflow"; | |
export type FlowEditorProps = { | |
nodeTypes?: NodeTypes; | |
nodes?: Node[]; | |
edges?: Edge[]; | |
library: FlowEditorLibrary | |
children?: JSX.Element; | |
}; |
This file contains hidden or 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
export const LayoutPopup = <T extends unknown>({ | |
library, | |
}: { | |
library: Record<keyof T, ComponentType<any>>; | |
}): JSX.Element => { | |
const modalRoot = useCreateDomElement(); | |
return ( | |
<> | |
{modalRoot && | |
createPortal(<PopupContainer<T> library={library} />, modalRoot)} |