-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(build): change entry point and export builded version
+ Change tsconfig to export d.ts files in dist + Introduces first code release to be imported BREAKING CHANGE: + Update tsconfig and build rules
- Loading branch information
1 parent
8b430a7
commit d887af6
Showing
24 changed files
with
339 additions
and
3 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { Locale, LocaleObject } from '../types/locale'; | ||
/** | ||
* Return selectedLocale from locales collection. | ||
* If selectedLocale is not found, it will return Locale.EN as fallback. | ||
* If both are not present, them it will throw an error | ||
* | ||
* @export | ||
* @template T | ||
* @param {LocaleObject<T>} locales | ||
* @param {Locale} [selectedLocale=Locale.EN] | ||
* @returns {T} | ||
*/ | ||
export default function getLocale<T>(locales: LocaleObject<T>, selectedLocale?: Locale): T; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import getLocale from './getLocale'; | ||
import randomArrayElement from './randomArrayElement'; | ||
import randomArrayElements from './randomArrayElements'; | ||
import randomNumber from './randomNumber'; | ||
declare const _default: { | ||
getLocale: typeof getLocale; | ||
randomArrayElement: typeof randomArrayElement; | ||
randomArrayElements: typeof randomArrayElements; | ||
randomNumber: typeof randomNumber; | ||
}; | ||
export default _default; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/** | ||
* Return a random element from given array | ||
* | ||
* @export | ||
* @template T | ||
* @param {T[]} collection | ||
* @returns {T} | ||
*/ | ||
export default function randomArrayElement<T>(collection: T[]): T; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/** | ||
* Return N random items from given array. | ||
* If the amount of items requested is greater than collection length, | ||
* it will return as many items as possible | ||
* | ||
* @export | ||
* @template T | ||
* @param {T[]} collection | ||
* @param {number} amount | ||
* @returns {T[]} | ||
*/ | ||
export default function randomArrayElements<T>(collection: T[], amount: number): T[]; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/** | ||
* Return a random number between min and max values. | ||
* By default this function returns integers numbers, but can | ||
* return float if isFloating = true | ||
* | ||
* @export | ||
* @param {number} [min] | ||
* @param {number} [max] | ||
* @param {boolean} [isFloating=false] | ||
* @returns {number} | ||
*/ | ||
export default function randomNumber(min?: number, max?: number, isFloating?: boolean): number; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
declare const faker: { | ||
helpers: { | ||
getLocale: typeof import("./helpers/getLocale").default; | ||
randomArrayElement: typeof import("./helpers/randomArrayElement").default; | ||
randomArrayElements: typeof import("./helpers/randomArrayElements").default; | ||
randomNumber: typeof import("./helpers/randomNumber").default; | ||
}; | ||
name: { | ||
firstName: typeof import("./name/firstName/firstName").default; | ||
}; | ||
}; | ||
export default faker; |
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Locale } from '../../types/locale'; | ||
/** | ||
* Return a random first name. | ||
* If a valid locale is given, it will the locale collection. | ||
* If the given locale is not valid, it will fallback to Locale.EN | ||
* | ||
* @export | ||
* @param {Locale} [selectedLocale] | ||
* @returns {string} | ||
*/ | ||
export default function firstName(selectedLocale?: Locale): string; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
declare const collection: string[]; | ||
export default collection; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { LocaleObject } from '../../../types/locale'; | ||
declare const locales: LocaleObject<string[]>; | ||
export default locales; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
declare const collection: string[]; | ||
export default collection; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import firstName from './firstName/firstName'; | ||
declare const _default: { | ||
firstName: typeof firstName; | ||
}; | ||
export default _default; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,233 @@ | ||
export declare enum Locale { | ||
AF = "af", | ||
AF_ZA = "af_ZA", | ||
AR = "ar", | ||
AR_AE = "ar_AE", | ||
AR_BH = "ar_BH", | ||
AR_DZ = "ar_DZ", | ||
AR_EG = "ar_EG", | ||
AR_IQ = "ar_IQ", | ||
AR_JO = "ar_JO", | ||
AR_KW = "ar_KW", | ||
AR_LB = "ar_LB", | ||
AR_LY = "ar_LY", | ||
AR_MA = "ar_MA", | ||
AR_OM = "ar_OM", | ||
AR_QA = "ar_QA", | ||
AR_SA = "ar_SA", | ||
AR_SY = "ar_SY", | ||
AR_TN = "ar_TN", | ||
AR_YE = "ar_YE", | ||
AZ = "az", | ||
AZ_AZ = "az_AZ", | ||
BE = "be", | ||
BE_BY = "be_BY", | ||
BG = "bg", | ||
BG_BG = "bg_BG", | ||
BS_BA = "bs_BA", | ||
CA = "ca", | ||
CA_ES = "ca_ES", | ||
CS = "cs", | ||
CS_CZ = "cs_CZ", | ||
CY = "cy", | ||
CY_GB = "cy_GB", | ||
DA = "da", | ||
DA_DK = "da_DK", | ||
DE = "de", | ||
DE_AT = "de_AT", | ||
DE_CH = "de_CH", | ||
DE_DE = "de_DE", | ||
DE_LI = "de_LI", | ||
DE_LU = "de_LU", | ||
DV = "dv", | ||
DV_MV = "dv_MV", | ||
EL = "el", | ||
EL_GR = "el_GR", | ||
EN = "en", | ||
EN_AU = "en_AU", | ||
EN_BZ = "en_BZ", | ||
EN_CA = "en_CA", | ||
EN_CB = "en_CB", | ||
EN_GB = "en_GB", | ||
EN_IE = "en_IE", | ||
EN_JM = "en_JM", | ||
EN_NZ = "en_NZ", | ||
EN_PH = "en_PH", | ||
EN_TT = "en_TT", | ||
EN_US = "en_US", | ||
EN_ZA = "en_ZA", | ||
EN_ZW = "en_ZW", | ||
EO = "eo", | ||
ES = "es", | ||
ES_AR = "es_AR", | ||
ES_BO = "es_BO", | ||
ES_CL = "es_CL", | ||
ES_CO = "es_CO", | ||
ES_CR = "es_CR", | ||
ES_DO = "es_DO", | ||
ES_EC = "es_EC", | ||
ES_ES = "es_ES", | ||
ES_GT = "es_GT", | ||
ES_HN = "es_HN", | ||
ES_MX = "es_MX", | ||
ES_NI = "es_NI", | ||
ES_PA = "es_PA", | ||
ES_PE = "es_PE", | ||
ES_PR = "es_PR", | ||
ES_PY = "es_PY", | ||
ES_SV = "es_SV", | ||
ES_UY = "es_UY", | ||
ES_VE = "es_VE", | ||
ET = "et", | ||
ET_EE = "et_EE", | ||
EU = "eu", | ||
EU_ES = "eu_ES", | ||
FA = "fa", | ||
FA_IR = "fa_IR", | ||
FI = "fi", | ||
FI_FI = "fi_FI", | ||
FO = "fo", | ||
FO_FO = "fo_FO", | ||
FR = "fr", | ||
FR_BE = "fr_BE", | ||
FR_CA = "fr_CA", | ||
FR_CH = "fr_CH", | ||
FR_FR = "fr_FR", | ||
FR_LU = "fr_LU", | ||
FR_MC = "fr_MC", | ||
GL = "gl", | ||
GL_ES = "gl_ES", | ||
GU = "gu", | ||
GU_IN = "gu_IN", | ||
HE = "he", | ||
HE_IL = "he_IL", | ||
HI = "hi", | ||
HI_IN = "hi_IN", | ||
HR = "hr", | ||
HR_BA = "hr_BA", | ||
HR_HR = "hr_HR", | ||
HU = "hu", | ||
HU_HU = "hu_HU", | ||
HY = "hy", | ||
HY_AM = "hy_AM", | ||
ID = "id", | ||
ID_ID = "id_ID", | ||
IS = "is", | ||
IS_IS = "is_IS", | ||
IT = "it", | ||
IT_CH = "it_CH", | ||
IT_IT = "it_IT", | ||
JA = "ja", | ||
JA_JP = "ja_JP", | ||
KA = "ka", | ||
KA_GE = "ka_GE", | ||
KK = "kk", | ||
KK_KZ = "kk_KZ", | ||
KN = "kn", | ||
KN_IN = "kn_IN", | ||
KO = "ko", | ||
KO_KR = "ko_KR", | ||
KOK = "kok", | ||
KOK_IN = "kok_IN", | ||
KY = "ky", | ||
KY_KG = "ky_KG", | ||
LT = "lt", | ||
LT_LT = "lt_LT", | ||
LV = "lv", | ||
LV_LV = "lv_LV", | ||
MI = "mi", | ||
MI_NZ = "mi_NZ", | ||
MK = "mk", | ||
MK_MK = "mk_MK", | ||
MN = "mn", | ||
MN_MN = "mn_MN", | ||
MR = "mr", | ||
MR_IN = "mr_IN", | ||
MS = "ms", | ||
MS_BN = "ms_BN", | ||
MS_MY = "ms_MY", | ||
MT = "mt", | ||
MT_MT = "mt_MT", | ||
NB = "nb", | ||
NB_NO = "nb_NO", | ||
NL = "nl", | ||
NL_BE = "nl_BE", | ||
NL_NL = "nl_NL", | ||
NN_NO = "nn_NO", | ||
NS = "ns", | ||
NS_ZA = "ns_ZA", | ||
PA = "pa", | ||
PA_IN = "pa_IN", | ||
PL = "pl", | ||
PL_PL = "pl_PL", | ||
PS = "ps", | ||
PS_AR = "ps_AR", | ||
PT = "pt", | ||
PT_BR = "pt_BR", | ||
PT_PT = "pt_PT", | ||
QU = "qu", | ||
QU_BO = "qu_BO", | ||
QU_EC = "qu_EC", | ||
QU_PE = "qu_PE", | ||
RO = "ro", | ||
RO_RO = "ro_RO", | ||
RU = "ru", | ||
RU_RU = "ru_RU", | ||
SA = "sa", | ||
SA_IN = "sa_IN", | ||
SE = "se", | ||
SE_FI = "se_FI", | ||
SE_NO = "se_NO", | ||
SE_SE = "se_SE", | ||
SK = "sk", | ||
SK_SK = "sk_SK", | ||
SL = "sl", | ||
SL_SI = "sl_SI", | ||
SQ = "sq", | ||
SQ_AL = "sq_AL", | ||
SR_BA = "sr_BA", | ||
SR_SP = "sr_SP", | ||
SV = "sv", | ||
SV_FI = "sv_FI", | ||
SV_SE = "sv_SE", | ||
SW = "sw", | ||
SW_KE = "sw_KE", | ||
SYR = "syr", | ||
SYR_SY = "syr_SY", | ||
TA = "ta", | ||
TA_IN = "ta_IN", | ||
TE = "te", | ||
TE_IN = "te_IN", | ||
TH = "th", | ||
TH_TH = "th_TH", | ||
TL = "tl", | ||
TL_PH = "tl_PH", | ||
TN = "tn", | ||
TN_ZA = "tn_ZA", | ||
TR = "tr", | ||
TR_TR = "tr_TR", | ||
TS = "ts", | ||
TT = "tt", | ||
TT_RU = "tt_RU", | ||
UK = "uk", | ||
UK_UA = "uk_UA", | ||
UR = "ur", | ||
UR_PK = "ur_PK", | ||
UZ = "uz", | ||
UZ_UZ = "uz_UZ", | ||
VI = "vi", | ||
VI_VN = "vi_VN", | ||
XH = "xh", | ||
XH_ZA = "xh_ZA", | ||
ZH = "zh", | ||
ZH_CN = "zh_CN", | ||
ZH_HK = "zh_HK", | ||
ZH_MO = "zh_MO", | ||
ZH_SG = "zh_SG", | ||
ZH_TW = "zh_TW", | ||
ZU = "zu", | ||
ZU_ZA = "zu_ZA" | ||
} | ||
export declare type LocaleObject<T = any> = { | ||
[K in Locale]?: T; | ||
}; |
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
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