Skip to content

Commit

Permalink
v1.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rkuykendall committed Jan 11, 2022
1 parent 403428c commit 89caa3d
Show file tree
Hide file tree
Showing 11 changed files with 197 additions and 41 deletions.
22 changes: 11 additions & 11 deletions dist/formatting.d.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/// <reference types="react" />
import React from 'react';
import { IAddress } from './interfaces';
export declare function canReplaceSymbols(template: string, chars: string[]): boolean;
export declare function replaceSymbolsWithChars(template: string, chars: string[]): string;
export declare function hasStringContent(value: unknown): value is string;
export declare function hasStringOrNumberContent(value: unknown): value is number | string;
export declare function splitName(name?: string | null): string[];
export declare function splitName(name?: string | null): [string, string];
export declare function splitCommaList(str?: string | null): string[];
export declare function formatFullName(firstName?: string, lastName?: string): string;
export declare function formatNumberTemplates(value: undefined | string | null, templates: string[]): string;
Expand All @@ -14,33 +14,33 @@ export declare function formatDateTime(value?: string | null): string;
export declare function getNameOrDefault(obj?: unknown, { field, defaultValue }?: {
field?: string;
defaultValue?: string;
}): any;
export declare function getOrDefault(value?: unknown): unknown;
}): string;
export declare function getOrDefault(value?: unknown): string;
export declare function formatSocialSecurityNumber(value?: null | string): string;
export declare function formatEmployerIdNumber(value?: null | string): string;
export declare function formatPercentage(value?: null | number | string, decimalPoints?: number): string;
export declare function formatMoney(value?: null | number | string): string;
export declare function formatDollars(value?: null | number | string): string;
export declare function formatParagraphs(value?: null | string): "--" | JSX.Element[];
export declare function formatParagraphs(value?: null | string): string | React.ReactNode[];
export declare function formatCommaSeparatedNumber(value?: null | number | string): string;
export declare function formatDelimitedList(list?: null | string[], delimiter?: string): unknown;
export declare function formatDelimitedList(list?: null | string[], delimiter?: string): string;
export declare function mapBooleanToText(bool?: boolean | null, { mapUndefinedToNo }?: {
mapUndefinedToNo: boolean;
}): "--" | "Yes" | "No";
}): string;
export declare function formatMoneyInput(value?: null | number | string): number;
export declare function formatDuration(iso8601?: null | string): string;
export declare function formatWebsite(website?: string | null, text?: string): string | JSX.Element;
export declare function formatWebsite(website?: string | null, text?: string): React.ReactNode;
export declare function stripNonAlpha(str?: string | null): string;
export declare function pluralize(baseWord: string, pluralSuffix: string, count: number): string;
export declare function getType(fullType?: null | string): string;
export declare function preserveNewLines(body: string): string;
export declare function parseAndPreserveNewlines(body?: string): any;
export declare function parseAndPreserveNewlines(body?: string): React.ReactNode;
export declare function getDisplayName(component: any): string | undefined;
export declare const varToLabel: (str: string) => string;
export declare function getInitials(value?: string | null): string;
export declare function toKey(dict: {
[key: string]: any;
}): string;
export declare function formatAddress(address?: IAddress | null): string;
export declare function formatAddressMultiline(address?: IAddress | null): any;
export declare function stringToHTML(string: string): any;
export declare function formatAddressMultiline(address?: IAddress | null): React.ReactNode;
export declare function stringToHTML(string: string): React.ReactNode;
1 change: 0 additions & 1 deletion dist/global.module.d.ts

This file was deleted.

1 change: 1 addition & 0 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ export * from './date';
export * from './formatting';
export * from './utils';
export * from './validation';
export * from './objects';
11 changes: 11 additions & 0 deletions dist/objects.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { flatten as flattenArray } from 'lodash';
declare type NonObjectKeysOf<T> = {
[K in keyof T]: T[K] extends Array<any> ? K : T[K] extends object ? never : K;
}[keyof T];
declare type ValuesOf<T> = T[keyof T];
declare type ObjectValuesOf<T> = Exclude<Extract<ValuesOf<T>, object>, Array<any>>;
declare type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
declare type Flatten<T> = Pick<T, NonObjectKeysOf<T>> & UnionToIntersection<ObjectValuesOf<T>>;
declare function flattenObject<T extends object>(input: T): Flatten<T>;
declare function unflattenObject(object: Object): {};
export { flattenArray, flattenObject, unflattenObject };
98 changes: 87 additions & 11 deletions dist/utils.cjs.development.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/utils.cjs.development.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/utils.cjs.production.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/utils.cjs.production.min.js.map

Large diffs are not rendered by default.

95 changes: 82 additions & 13 deletions dist/utils.esm.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/utils.esm.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mighty-justice/utils",
"version": "1.4.3",
"version": "1.5.0",
"description": "Standardization of small utilities across Mighty",
"main": "dist/index.js",
"module": "dist/tester.esm.js",
Expand Down

0 comments on commit 89caa3d

Please sign in to comment.