@playbooks/utils
Version:
A collection of utilities used for Playbooks.
102 lines (101 loc) • 2.88 kB
JavaScript
import { addOrRemoveItem, findRecordAndReplace, moveAndSort, removeAndSort, updateAndSort } from "./arrays.js";
import { getCountryCode, getCountryName, getCountryNames } from "./countries.js";
import { dayjs, formatDate, formatTimestamp, fromUnix, timeElapsed, toDate, toEndOfTime, toJson, toStartOfTime, toTimezone, toUnix, toYear, zonedDayjs } from "./dates.js";
import { performDownload } from "./downloads.js";
import { httpError, jsonApiError, normalizeError, objectionError, serializeError } from "./errors.js";
import { default as default2 } from "binary-extensions";
import { default as default3 } from "file-extension";
import { buildArray, chunkArray, computeBytes, env, formatUUID, getPlural, getRandomInt, getSeconds, getSingular, getUUID, isArray, isDate, isEmpty, isFunction, isObject, isString, mapChildren, shuffleArray, sleep } from "./helpers.js";
import { htmlToText, stripHtmlEntities } from "./html.js";
import { clearInput } from "./inputs.js";
import { logger } from "./logger.js";
import { avg, max, min, sum } from "./math.js";
import { alphaNumericRegex, alphaNumericRegexString, httpRegex, httpRegexString, nonAlphaNumericRegex, nonAlphaNumericRegexString } from "./regex.js";
export * from "js-base64";
import { camelToDash, camelToString, camelToUnderscore, capitalize, dashToCamel, dashToCapital, dashToString, dashToUnderscore, deCapitalize, fromCents, phoneToString, stringToUnderscore, toCents, toCurrency, toNumber, toPercent, toPhone, toShortNumber, truncate, underscoreToString } from "./transforms.js";
import { computeTailwind } from "@ehubbell/html";
export {
addOrRemoveItem,
alphaNumericRegex,
alphaNumericRegexString,
avg,
default2 as binaryExtensions,
buildArray,
camelToDash,
camelToString,
camelToUnderscore,
capitalize,
chunkArray,
clearInput,
computeBytes,
computeTailwind,
dashToCamel,
dashToCapital,
dashToString,
dashToUnderscore,
dayjs,
deCapitalize,
env,
default3 as fileExtension,
findRecordAndReplace,
formatDate,
formatTimestamp,
formatUUID,
fromCents,
fromUnix,
getCountryCode,
getCountryName,
getCountryNames,
getPlural,
getRandomInt,
getSeconds,
getSingular,
getUUID,
htmlToText,
httpError,
httpRegex,
httpRegexString,
isArray,
isDate,
isEmpty,
isFunction,
isObject,
isString,
jsonApiError,
logger,
mapChildren,
max,
min,
moveAndSort,
nonAlphaNumericRegex,
nonAlphaNumericRegexString,
normalizeError,
objectionError,
performDownload,
phoneToString,
removeAndSort,
serializeError,
shuffleArray,
sleep,
stringToUnderscore,
stripHtmlEntities,
sum,
timeElapsed,
toCents,
toCurrency,
toDate,
toEndOfTime,
toJson,
toNumber,
toPercent,
toPhone,
toShortNumber,
toStartOfTime,
toTimezone,
toUnix,
toYear,
truncate,
underscoreToString,
updateAndSort,
zonedDayjs
};