Skip to content

Instantly share code, notes, and snippets.

View pikax's full-sized avatar

Carlos Rodrigues pikax

View GitHub Profile
@pikax
pikax / vue.js
Created November 30, 2023 16:07
temp vue
var Vue = (function (exports) {
'use strict';
function makeMap(str, expectsLowerCase) {
const map = /* @__PURE__ */ Object.create(null);
const list = str.split(",");
for (let i = 0; i < list.length; i++) {
map[list[i]] = true;
}
return expectsLowerCase ? (val) => !!map[val.toLowerCase()] : (val) => !!map[val];
@pikax
pikax / mapSchema.ts
Created March 11, 2022 21:30
Yup MapSchema
import {
AnyObject,
mixed,
string,
Schema,
AnySchema,
ValidationError,
TestFunction,
} from "yup";
interface UseApiResult<
T,
TExecuteFactory extends (...args: any) => Promise<T | undefined>,
TError = any
> {
result: Ref<T | null>;
isLoading: Ref<boolean>;
error: Ref<TError | null>;
execute: TExecuteFactory;
}