- 🚑
hotfix/
- for urgent bug fixes that merge directly into production - 🐛
bugfix/
- for bug fixes that merges to staging and then production - ✨
feature/
- to implement new feature - 🛠️
changes/
- to improve existing feature/code/algorithm - 📃
document/
- add/update documentation - 📦
deps/
- add/update dependencies
This file contains 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
const rURL = | |
/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!$&'()*+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!$&'()*+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!$&'()*+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2} |
This file contains 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 interface IsEmptyOptions { | |
isEmpty?: any[] | |
isNotEmpty?: any[] | |
} | |
export function isEmpty(input: any, options: IsEmptyOptions = {}): boolean { | |
options = { isEmpty: [], isNotEmpty: [], ...options } as IsEmptyOptions | |
if (options.isEmpty?.includes?.(input)) return true | |
if (options.isNotEmpty?.includes?.(input)) return false |
This file contains 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 function chain<T>(object: T) { | |
const call = | |
<V>(previousResult: V) => | |
<U>(callback: (object: T, result: V) => U) => { | |
const result = callback(object, previousResult) | |
return { call: call(result), result: () => result, object: () => object } | |
} | |
return { call: call(undefined), result: () => undefined, object: () => object } | |
} |
This file contains 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 path from "path" | |
import fs from "fs-extra" | |
import ignore from "ignore" | |
import type { Ignore } from "ignore" | |
import { minimatch } from "minimatch" | |
import type { SetOptional } from "type-fest" | |
const ignoreDirectories = [".*", ".git", ".idea", ".venv", ".vscode", "bin", "node_modules", "obj", "vendor"] | |
const ignoreBuildDirectories = ["build", "dist", "out", "public"] |
This file contains 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 pick<T, K extends keyof T>(obj: T, ...keys: K[]) { | |
return Object.fromEntries(keys.map((key) => [key, obj[key]])) as Pick<T, K> | |
} |
This file contains 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 function mapListByProp<T extends object, K extends keyof T>(list: T[], key: K) { | |
const output = new Map<T[K], T[]>() | |
for (const item of list) { | |
if (!(key in item)) continue | |
const existingList = (output.has(item[key]) && output.get(item[key])) || [] | |
const updatedList = [...existingList, item] | |
output.set(item[key], updatedList) | |
} |
This file contains 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 freezeColumns = (table, options = {}) => { | |
options = { index: 5, offset: -0, ignoreClasses: ['groupingTableAmount', 'activebg'], ...options }; | |
const stickyIndex = options.index; | |
const rows = table?.querySelectorAll?.('tr'); | |
const testRow = table?.querySelectorAll?.('tbody tr')?.[0] ?? rows?.[0]; | |
const cellSlice = Array.prototype.slice.call(testRow.children, 0, stickyIndex); | |
const widthList = Array.prototype.map.call(cellSlice, (cell) => cell?.getBoundingClientRect()?.width); | |
const leftOffsetList = widthList.map((_, index) => { |
This file contains 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
adam-bender.commit-message-editor | |
alefragnani.project-manager | |
arcsine.chronicler | |
Asuka.insertnumbers | |
bierner.emojisense | |
bodil.prettier-toml | |
bradlc.vscode-tailwindcss | |
bwildeman.tabulous | |
csstools.postcss | |
DavidAnson.vscode-markdownlint |
This file contains 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 cloneDeep from 'lodash/cloneDeep'; | |
import forOwn from 'lodash/forOwn'; | |
import isEqual from 'lodash/isEqual'; | |
import memoize from 'lodash/memoize'; | |
import xorWith from 'lodash/xorWith'; | |
import { DateTime, Duration } from 'luxon'; | |
export const LOCALE = 'en-US'; | |
export const CURRENCY = 'USD'; | |
export const TIMEZONE_IANA = 'Asia/Kolkata'; |