Skip to content

Commit

Permalink
Internal export changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
RillingDev committed Mar 14, 2021
1 parent 133d38b commit 7542703
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 17 deletions.
4 changes: 1 addition & 3 deletions src/Ok.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type ValidatorMap = Map<string, Validator>;
*
* @class
*/
class Ok {
export class Ok {
private readonly map: ValidatorMap;
private readonly invalidClass: string | false;

Expand Down Expand Up @@ -94,5 +94,3 @@ class Ok {
element.addEventListener(eventType, (e) => this.validate(element, e));
}
}

export { Ok };
6 changes: 3 additions & 3 deletions src/dom/getInputElementValue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const isInputElementCheckboxLike = (element: HTMLInputElement): boolean =>
* @param element HTMLInputElement to get the value of.
* @returns value of the element, either a string or a boolean.
*/
const getInputElementValue = (element: HTMLInputElement): string | boolean =>
export const getInputElementValue = (
element: HTMLInputElement
): string | boolean =>
isInputElementCheckboxLike(element) ? element.checked : element.value;

export { getInputElementValue };
7 changes: 4 additions & 3 deletions src/dom/setCustomValidity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ const browserSupportsValidation = (): boolean =>
* @param element HTMLInputElement to set the validity status for.
* @param msg Validity message to add.
*/
const setCustomValidity = (element: HTMLInputElement, msg: string): void => {
export const setCustomValidity = (
element: HTMLInputElement,
msg: string
): void => {
if (browserSupportsValidation()) {
element.setCustomValidity(msg);
}
};

export { setCustomValidity };
4 changes: 2 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export { Ok } from "./Ok";
export { Validator } from "./validator/Validator";
export { ValidatorDictionary } from "./validator/ValidatorDictionary";
export type { Validator } from "./validator/Validator";
export type { ValidatorDictionary } from "./validator/ValidatorDictionary";
4 changes: 1 addition & 3 deletions src/validator/Validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ type ValidationFunction<TResult> = (
*
* @public
*/
interface Validator {
export interface Validator {
msg: string | ValidationFunction<string>;
fn: ValidationFunction<boolean>;
}

export { Validator };
4 changes: 1 addition & 3 deletions src/validator/ValidatorDictionary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import type { Validator } from "./Validator";
*
* @public
*/
interface ValidatorDictionary {
export interface ValidatorDictionary {
[key: string]: Validator;
}

export { ValidatorDictionary };

0 comments on commit 7542703

Please sign in to comment.