@stackone/utils 0.7.0 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,19 +0,0 @@
1
- import { NormalizedKeyMap } from '../dataStructures/normalizedKeyMap';
2
- import { ISO31661Alpha2CodeEnum } from './iso31661Countries';
3
- import { ISO31662SubDivisionCodeNamePairs } from './types';
4
- export interface ISubDivisionMaps {
5
- subDivisionsByAlpha2Code: Map<string, ISO31662SubDivisionCodeNamePairs>;
6
- subDivisionsByAlpha2CodeAndName: NormalizedKeyMap<NormalizedKeyMap<string>>;
7
- subDivisionCodeToSubDivisionName: Map<string, string>;
8
- subDivisionNameToSubDivisionCode: Map<string, string>;
9
- }
10
- export declare class SubDivisionMaps {
11
- private iso31661CountriesEnum;
12
- private iso31662SubDivisions;
13
- subDivisionsByAlpha2Code: Map<string, ISO31662SubDivisionCodeNamePairs>;
14
- subDivisionsByAlpha2CodeAndName: NormalizedKeyMap<NormalizedKeyMap<string>>;
15
- subDivisionCodeToSubDivisionName: Map<string, string>;
16
- subDivisionNameToSubDivisionCode: Map<string, string>;
17
- constructor(iso31661CountriesEnum?: typeof ISO31661Alpha2CodeEnum, iso31662SubDivisions?: Record<string, ISO31662SubDivisionCodeNamePairs>);
18
- createSubDivisionMaps(countriesEnum: typeof ISO31661Alpha2CodeEnum, subDivisions: Record<string, ISO31662SubDivisionCodeNamePairs>): void;
19
- }
@@ -1,20 +0,0 @@
1
- export type ISO31661CountryObject = {
2
- name: string;
3
- alpha2Code: string;
4
- alpha3Code: string;
5
- countryCode: string;
6
- ISO3166_2: string;
7
- region: string;
8
- subRegion: string;
9
- intermediateRegion: string;
10
- regionCode: string;
11
- subRegionCode: string;
12
- intermediateRegionCode: string;
13
- altNames?: string[];
14
- altAlpha2Codes?: string[];
15
- altAlpha3Codes?: string[];
16
- citizenships?: string[];
17
- };
18
- export type ISO31662SubDivisionCodeNamePairs = {
19
- [subDivisionCode: string]: string;
20
- };
@@ -1,7 +0,0 @@
1
- export declare class NormalizedKeyMap<V> extends Map<string, any> {
2
- #private;
3
- set(key: string, value: V): this;
4
- get(key: string): V | undefined;
5
- has(key: string): boolean;
6
- delete(key: string): boolean;
7
- }
@@ -1,16 +0,0 @@
1
- type InputDate = Date | string | null;
2
- export declare const calculateNextAnniversary: ({ initialDate, format, }: {
3
- initialDate?: InputDate;
4
- format?: string;
5
- }) => Date | null;
6
- export declare const calculateYearsElapsed: ({ startDate, endDate, format, }: {
7
- startDate?: InputDate;
8
- endDate?: InputDate;
9
- format?: string;
10
- }) => number | null;
11
- export declare const dateHasPassed: ({ date, yearsToAdd, format, }: {
12
- date?: InputDate;
13
- yearsToAdd?: number;
14
- format?: string;
15
- }) => boolean;
16
- export {};
@@ -1 +0,0 @@
1
- export declare const getContentHash: (content: unknown) => string;
@@ -1,7 +0,0 @@
1
- export { notMissing, isMissing, isString, isNumber, isBoolean, isDate, isObject, } from './typeguards';
2
- export { safeParseToString, safeParseToNumber, safeParseToBoolean, safeParseToDateTime, safeParseToDateTimeString, } from './parsers';
3
- export { getCountryAlpha2CodeByAlpha2Code, getCountryAlpha2CodeByAlpha3Code, getCountryAlpha2CodeByCountryCode, getCountryAlpha2CodeByCountryName, getCountryAlpha3CodeByAlpha2Code, getCountryAlpha3CodeByAlpha3Code, getCountryAlpha3CodeByCountryCode, getCountryAlpha3CodeByCountryName, getCountryCodeByAlpha2Code, getCountryCodeByAlpha3Code, getCountryCodeByCountryCode, getCountryCodeByCountryName, getCountryNameByAlpha2Code, getCountryNameByAlpha3Code, getCountryNameByCountryCode, getCountryNameByCountryName, getCountrySubDivisionByAlpha2CodeAndName, getCountrySubDivisionCodeBySubDivisionName, getCountrySubDivisionNameBySubDivisionCode, getCountrySubDivisionsByAlpha2Code, getCountryAlpha2CodeByCitizenship, } from './countries/countriesGetters';
4
- export { NormalizedKeyMap } from './dataStructures/normalizedKeyMap';
5
- export { calculateNextAnniversary, calculateYearsElapsed, dateHasPassed } from './dates';
6
- export { encodeToBase64, decodeFromBase64 } from './base64';
7
- export { getContentHash } from './hashContent';
@@ -1,17 +0,0 @@
1
- export declare const safeParseToString: ({ value, }: {
2
- value: unknown;
3
- }) => string | null;
4
- export declare const safeParseToNumber: ({ value, }: {
5
- value: unknown;
6
- }) => number | null;
7
- export declare const safeParseToBoolean: ({ value, }: {
8
- value: unknown;
9
- }) => boolean | null;
10
- export declare const safeParseToDateTime: ({ value, format, }: {
11
- value: unknown;
12
- format?: string;
13
- }) => Date | null;
14
- export declare const safeParseToDateTimeString: ({ value, format, }: {
15
- value: unknown;
16
- format?: string;
17
- }) => string | null;
@@ -1,7 +0,0 @@
1
- export declare const notMissing: <T>(value: T | null | undefined) => value is T;
2
- export declare const isMissing: <T>(value: T | null | undefined) => value is null | undefined;
3
- export declare const isString: (value: unknown) => value is string;
4
- export declare const isNumber: (value: unknown) => value is number;
5
- export declare const isBoolean: (value: unknown) => value is boolean;
6
- export declare const isDate: (value: unknown) => value is Date;
7
- export declare const isObject: (value: unknown) => value is Record<string, unknown>;