x25 17.7.0 → 17.7.3
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.
- package/{dist/Account → Account}/Load.js +4 -4
- package/{dist/Account → Account}/actions.js +2 -2
- package/{dist/Account → Account}/index.js +2 -2
- package/{dist/Account → Account}/reducer.js +2 -2
- package/{dist/Async → Async}/InitModule.js +4 -4
- package/{dist/Async → Async}/RouteLoading.js +5 -5
- package/{dist/Async → Async}/index.js +3 -3
- package/{dist/Async → Async}/util.js +2 -2
- package/{dist/Developer → Developer}/JSONSyntaxFromData.js +1 -1
- package/{dist/Developer → Developer}/JSONSyntaxFromText.js +1 -1
- package/{dist/Inputs → Inputs}/CaptchaBox.js +1 -1
- package/{dist/Inputs → Inputs}/DateInput.js +2 -2
- package/{dist/Inputs → Inputs}/DateTemplate.js +2 -2
- package/{dist/Inputs → Inputs}/NumericInput.js +2 -2
- package/{dist/Inputs → Inputs}/NumericTemplate.js +2 -2
- package/{dist/Inputs → Inputs}/Selects/Custom.js +1 -1
- package/{dist/Inputs → Inputs}/Selects/Simple.js +1 -1
- package/{dist/Inputs → Inputs}/Selects/index.js +3 -3
- package/{dist/Inputs → Inputs}/TextareaTemplate.js +1 -1
- package/Inputs/index.js +13 -0
- package/{dist/Loader → Loader}/LoaderRender.js +3 -3
- package/{dist/Loader → Loader}/index.js +2 -2
- package/{dist/Messages → Messages}/CenterLoading.js +1 -1
- package/{dist/Messages → Messages}/Error.js +1 -1
- package/{dist/Messages → Messages}/Loading.js +1 -1
- package/{dist/Messages → Messages}/Update.js +1 -1
- package/Messages/index.js +3 -0
- package/{dist/Modal → Modal}/ConfirmationModal.js +3 -3
- package/{dist/Modal → Modal}/ModalWindow.js +1 -1
- package/{dist/Modal → Modal}/Root.js +3 -3
- package/{dist/Modal → Modal}/getComponent.js +3 -3
- package/Modal/index.js +5 -0
- package/{dist/Modal → Modal}/reducer.js +1 -1
- package/{dist/Payment → Payment}/Modal/BankTransfer.js +5 -5
- package/{dist/Payment → Payment}/Modal/BankTransferDoneModal.js +1 -1
- package/{dist/Payment → Payment}/Modal/index.js +2 -2
- package/{dist/Payment → Payment}/Pieces/BankTransferForm/BankTransferForm.js +2 -2
- package/{dist/Payment → Payment}/Pieces/BankTransferForm/BankTransferFormWrapper.js +3 -3
- package/{dist/Payment → Payment}/Pieces/BankTransferForm/validate.js +1 -1
- package/{dist/Payment → Payment}/Pieces/MobilPayForm.js +2 -2
- package/{dist/Payment → Payment}/Pieces/Payment.js +4 -4
- package/{dist/Payment → Payment}/core/actions.js +1 -1
- package/{dist/Payment → Payment}/core/util/util.js +1 -1
- package/Payment/index.js +8 -0
- package/{dist/UI → UI}/LoadImages.js +1 -1
- package/{dist/UI → UI}/Things.js +3 -3
- package/{dist/actions.js → actions.js} +2 -2
- package/index.d.ts +7 -1
- package/index.js +11 -0
- package/package.json +4 -4
- package/{dist/reducer → reducer}/index.js +4 -4
- package/{dist/reducer → reducer}/module.js +1 -1
- package/{dist/utility → utility}/calendar.js +1 -1
- package/{dist/utility → utility}/date.js +1 -1
- package/{dist/utility → utility}/dev/ErrorBoundary.js +2 -2
- package/{dist/utility → utility}/dev/index.js +1 -1
- package/utility/index.js +14 -0
- package/{dist/utility → utility}/languages/english.js +1 -1
- package/{dist/utility → utility}/normalize.js +1 -1
- package/utility/normalize.test.d.ts +1 -0
- package/utility/normalize.test.js +40 -0
- package/utility/normalize.test.js.map +1 -0
- package/{dist/utility → utility}/numeric.js +1 -1
- package/utility/strings.test.d.ts +1 -0
- package/utility/strings.test.js +104 -0
- package/utility/strings.test.js.map +1 -0
- package/{dist/utility → utility}/validation/common.js +3 -3
- package/{dist/utility → utility}/validation/index.js +3 -3
- package/{dist/utility → utility}/validation/specific.js +2 -2
- package/utility/validation/validate/email.test.d.ts +1 -0
- package/utility/validation/validate/email.test.js +24 -0
- package/utility/validation/validate/email.test.js.map +1 -0
- package/utility/validation/validate/index.js +3 -0
- package/{dist/utility → utility}/words.js +3 -3
- package/.eslintignore +0 -3
- package/.eslintrc.json +0 -350
- package/.vscode/settings.json +0 -61
- package/conf/dev.js +0 -19
- package/conf/dist.js +0 -19
- package/conf/polyfills/tempPolyfills.js +0 -7
- package/cspell.json +0 -18
- package/dist/Inputs/index.js +0 -13
- package/dist/Messages/index.js +0 -3
- package/dist/Modal/index.js +0 -5
- package/dist/Payment/index.js +0 -8
- package/dist/index.d.ts +0 -7
- package/dist/index.js +0 -11
- package/dist/package.json +0 -137
- package/dist/utility/index.js +0 -14
- package/dist/utility/validation/validate/index.js +0 -3
- package/script/check.js +0 -15
- package/src/Account/Load.tsx +0 -61
- package/src/Account/actions.ts +0 -45
- package/src/Account/index.ts +0 -4
- package/src/Account/reducer.ts +0 -103
- package/src/Async/InitModule.tsx +0 -44
- package/src/Async/RouteLoading.tsx +0 -79
- package/src/Async/SimulatedException.ts +0 -15
- package/src/Async/helpers.ts +0 -58
- package/src/Async/index.tsx +0 -72
- package/src/Async/types.ts +0 -39
- package/src/Async/util.ts +0 -110
- package/src/Developer/JSONSyntaxFromData.tsx +0 -24
- package/src/Developer/JSONSyntaxFromText.tsx +0 -33
- package/src/Developer/types.ts +0 -14
- package/src/Developer/util.ts +0 -41
- package/src/Inputs/CaptchaBox.tsx +0 -78
- package/src/Inputs/DateInput.tsx +0 -124
- package/src/Inputs/DateTemplate.tsx +0 -147
- package/src/Inputs/DelayInputChange.tsx +0 -104
- package/src/Inputs/InputTemplate.tsx +0 -68
- package/src/Inputs/LabelTemplate.tsx +0 -46
- package/src/Inputs/NumericInput.tsx +0 -130
- package/src/Inputs/NumericTemplate.tsx +0 -126
- package/src/Inputs/Selects/Custom.tsx +0 -49
- package/src/Inputs/Selects/Simple.tsx +0 -63
- package/src/Inputs/Selects/index.tsx +0 -26
- package/src/Inputs/SimpleInput.tsx +0 -42
- package/src/Inputs/SimpleTextarea.tsx +0 -43
- package/src/Inputs/TextareaTemplate.tsx +0 -49
- package/src/Inputs/common.ts +0 -44
- package/src/Inputs/index.ts +0 -13
- package/src/Loader/LoaderRender.tsx +0 -88
- package/src/Loader/index.ts +0 -195
- package/src/Messages/CenterLoading.tsx +0 -48
- package/src/Messages/Error.tsx +0 -77
- package/src/Messages/Loading.tsx +0 -55
- package/src/Messages/Update.tsx +0 -32
- package/src/Messages/index.ts +0 -2
- package/src/Modal/ConfirmationModal.tsx +0 -120
- package/src/Modal/ModalWindow.tsx +0 -167
- package/src/Modal/Root.tsx +0 -64
- package/src/Modal/actions.ts +0 -12
- package/src/Modal/getComponent.tsx +0 -24
- package/src/Modal/index.ts +0 -5
- package/src/Modal/reducer.ts +0 -52
- package/src/Modal/types.ts +0 -47
- package/src/Modal/util.ts +0 -12
- package/src/Payment/Modal/BankTransfer.tsx +0 -117
- package/src/Payment/Modal/BankTransferDoneModal.tsx +0 -27
- package/src/Payment/Modal/index.ts +0 -11
- package/src/Payment/Pieces/BankTransferForm/BankTransferForm.tsx +0 -91
- package/src/Payment/Pieces/BankTransferForm/BankTransferFormWrapper.tsx +0 -56
- package/src/Payment/Pieces/BankTransferForm/BankTransferNumberField.tsx +0 -33
- package/src/Payment/Pieces/BankTransferForm/validate.ts +0 -14
- package/src/Payment/Pieces/MobilPayForm.tsx +0 -47
- package/src/Payment/Pieces/Payment.tsx +0 -91
- package/src/Payment/core/actions.ts +0 -17
- package/src/Payment/core/codes.ts +0 -31
- package/src/Payment/core/request.ts +0 -39
- package/src/Payment/core/types.d.ts +0 -19
- package/src/Payment/core/util/info.ts +0 -10
- package/src/Payment/core/util/util.ts +0 -41
- package/src/Payment/index.ts +0 -9
- package/src/UI/Collapse.tsx +0 -80
- package/src/UI/LoadImages.tsx +0 -58
- package/src/UI/NewFeature.tsx +0 -23
- package/src/UI/Things.tsx +0 -30
- package/src/actions.ts +0 -48
- package/src/config.ts +0 -19
- package/src/index.ts +0 -16
- package/src/node_modules/.vitest/results.json +0 -1
- package/src/reducer/captchas.ts +0 -34
- package/src/reducer/index.ts +0 -17
- package/src/reducer/module.ts +0 -31
- package/src/styles/_json.scss +0 -48
- package/src/styles/index.scss +0 -1
- package/src/types.ts +0 -27
- package/src/utility/breakpoint.tsx +0 -88
- package/src/utility/calendar.ts +0 -23
- package/src/utility/date.ts +0 -108
- package/src/utility/dev/ErrorBoundary.tsx +0 -90
- package/src/utility/dev/TheError.tsx +0 -74
- package/src/utility/dev/index.ts +0 -109
- package/src/utility/dev/types.ts +0 -8
- package/src/utility/hooks.ts +0 -32
- package/src/utility/index.ts +0 -17
- package/src/utility/languages/date.ts +0 -2
- package/src/utility/languages/english.ts +0 -127
- package/src/utility/languages/ro.ts +0 -123
- package/src/utility/normalize.test.ts +0 -43
- package/src/utility/normalize.ts +0 -75
- package/src/utility/numbers.ts +0 -62
- package/src/utility/numeric.ts +0 -103
- package/src/utility/others.tsx +0 -53
- package/src/utility/strings.test.ts +0 -123
- package/src/utility/strings.ts +0 -22
- package/src/utility/uuid.ts +0 -30
- package/src/utility/validation/common.ts +0 -255
- package/src/utility/validation/index.ts +0 -24
- package/src/utility/validation/specific.ts +0 -18
- package/src/utility/validation/types.ts +0 -53
- package/src/utility/validation/validate/date.ts +0 -52
- package/src/utility/validation/validate/email.test.ts +0 -26
- package/src/utility/validation/validate/email.ts +0 -3
- package/src/utility/validation/validate/index.ts +0 -2
- package/src/utility/words.ts +0 -82
- package/tsconfig.json +0 -95
- package/vite.config.ts +0 -10
- package/webpack.config.js +0 -67
- package/x25.wiki/Account.md +0 -41
- package/x25.wiki/Company.md +0 -39
- package/x25.wiki/Header.md +0 -21
- package/x25.wiki/Home.md +0 -1
- package/x25.wiki/Inputs.md +0 -32
- package/x25.wiki/Messages.md +0 -27
- package/x25.wiki/Payment.md +0 -42
- /package/{dist/Account → Account}/Load.d.ts +0 -0
- /package/{dist/Account → Account}/Load.js.map +0 -0
- /package/{dist/Account → Account}/actions.d.ts +0 -0
- /package/{dist/Account → Account}/actions.js.map +0 -0
- /package/{dist/Account → Account}/index.d.ts +0 -0
- /package/{dist/Account → Account}/index.js.map +0 -0
- /package/{dist/Account → Account}/reducer.d.ts +0 -0
- /package/{dist/Account → Account}/reducer.js.map +0 -0
- /package/{dist/Async → Async}/InitModule.d.ts +0 -0
- /package/{dist/Async → Async}/InitModule.js.map +0 -0
- /package/{dist/Async → Async}/RouteLoading.d.ts +0 -0
- /package/{dist/Async → Async}/RouteLoading.js.map +0 -0
- /package/{dist/Async → Async}/SimulatedException.d.ts +0 -0
- /package/{dist/Async → Async}/SimulatedException.js +0 -0
- /package/{dist/Async → Async}/SimulatedException.js.map +0 -0
- /package/{dist/Async → Async}/helpers.d.ts +0 -0
- /package/{dist/Async → Async}/helpers.js +0 -0
- /package/{dist/Async → Async}/helpers.js.map +0 -0
- /package/{dist/Async → Async}/index.d.ts +0 -0
- /package/{dist/Async → Async}/index.js.map +0 -0
- /package/{dist/Async → Async}/types.d.ts +0 -0
- /package/{dist/Async → Async}/types.js +0 -0
- /package/{dist/Async → Async}/types.js.map +0 -0
- /package/{dist/Async → Async}/util.d.ts +0 -0
- /package/{dist/Async → Async}/util.js.map +0 -0
- /package/{dist/Developer → Developer}/JSONSyntaxFromData.d.ts +0 -0
- /package/{dist/Developer → Developer}/JSONSyntaxFromData.js.map +0 -0
- /package/{dist/Developer → Developer}/JSONSyntaxFromText.d.ts +0 -0
- /package/{dist/Developer → Developer}/JSONSyntaxFromText.js.map +0 -0
- /package/{dist/Developer → Developer}/types.d.ts +0 -0
- /package/{dist/Developer → Developer}/types.js +0 -0
- /package/{dist/Developer → Developer}/types.js.map +0 -0
- /package/{dist/Developer → Developer}/util.d.ts +0 -0
- /package/{dist/Developer → Developer}/util.js +0 -0
- /package/{dist/Developer → Developer}/util.js.map +0 -0
- /package/{dist/Inputs → Inputs}/CaptchaBox.d.ts +0 -0
- /package/{dist/Inputs → Inputs}/CaptchaBox.js.map +0 -0
- /package/{dist/Inputs → Inputs}/DateInput.d.ts +0 -0
- /package/{dist/Inputs → Inputs}/DateInput.js.map +0 -0
- /package/{dist/Inputs → Inputs}/DateTemplate.d.ts +0 -0
- /package/{dist/Inputs → Inputs}/DateTemplate.js.map +0 -0
- /package/{dist/Inputs → Inputs}/DelayInputChange.d.ts +0 -0
- /package/{dist/Inputs → Inputs}/DelayInputChange.js +0 -0
- /package/{dist/Inputs → Inputs}/DelayInputChange.js.map +0 -0
- /package/{dist/Inputs → Inputs}/InputTemplate.d.ts +0 -0
- /package/{dist/Inputs → Inputs}/InputTemplate.js +0 -0
- /package/{dist/Inputs → Inputs}/InputTemplate.js.map +0 -0
- /package/{dist/Inputs → Inputs}/LabelTemplate.d.ts +0 -0
- /package/{dist/Inputs → Inputs}/LabelTemplate.js +0 -0
- /package/{dist/Inputs → Inputs}/LabelTemplate.js.map +0 -0
- /package/{dist/Inputs → Inputs}/NumericInput.d.ts +0 -0
- /package/{dist/Inputs → Inputs}/NumericInput.js.map +0 -0
- /package/{dist/Inputs → Inputs}/NumericTemplate.d.ts +0 -0
- /package/{dist/Inputs → Inputs}/NumericTemplate.js.map +0 -0
- /package/{dist/Inputs → Inputs}/Selects/Custom.d.ts +0 -0
- /package/{dist/Inputs → Inputs}/Selects/Custom.js.map +0 -0
- /package/{dist/Inputs → Inputs}/Selects/Simple.d.ts +0 -0
- /package/{dist/Inputs → Inputs}/Selects/Simple.js.map +0 -0
- /package/{dist/Inputs → Inputs}/Selects/index.d.ts +0 -0
- /package/{dist/Inputs → Inputs}/Selects/index.js.map +0 -0
- /package/{dist/Inputs → Inputs}/SimpleInput.d.ts +0 -0
- /package/{dist/Inputs → Inputs}/SimpleInput.js +0 -0
- /package/{dist/Inputs → Inputs}/SimpleInput.js.map +0 -0
- /package/{dist/Inputs → Inputs}/SimpleTextarea.d.ts +0 -0
- /package/{dist/Inputs → Inputs}/SimpleTextarea.js +0 -0
- /package/{dist/Inputs → Inputs}/SimpleTextarea.js.map +0 -0
- /package/{dist/Inputs → Inputs}/TextareaTemplate.d.ts +0 -0
- /package/{dist/Inputs → Inputs}/TextareaTemplate.js.map +0 -0
- /package/{dist/Inputs → Inputs}/common.d.ts +0 -0
- /package/{dist/Inputs → Inputs}/common.js +0 -0
- /package/{dist/Inputs → Inputs}/common.js.map +0 -0
- /package/{dist/Inputs → Inputs}/index.d.ts +0 -0
- /package/{dist/Inputs → Inputs}/index.js.map +0 -0
- /package/{dist/Loader → Loader}/LoaderRender.d.ts +0 -0
- /package/{dist/Loader → Loader}/LoaderRender.js.map +0 -0
- /package/{dist/Loader → Loader}/index.d.ts +0 -0
- /package/{dist/Loader → Loader}/index.js.map +0 -0
- /package/{dist/Messages → Messages}/CenterLoading.d.ts +0 -0
- /package/{dist/Messages → Messages}/CenterLoading.js.map +0 -0
- /package/{dist/Messages → Messages}/Error.d.ts +0 -0
- /package/{dist/Messages → Messages}/Error.js.map +0 -0
- /package/{dist/Messages → Messages}/Loading.d.ts +0 -0
- /package/{dist/Messages → Messages}/Loading.js.map +0 -0
- /package/{dist/Messages → Messages}/Update.d.ts +0 -0
- /package/{dist/Messages → Messages}/Update.js.map +0 -0
- /package/{dist/Messages → Messages}/index.d.ts +0 -0
- /package/{dist/Messages → Messages}/index.js.map +0 -0
- /package/{dist/Modal → Modal}/ConfirmationModal.d.ts +0 -0
- /package/{dist/Modal → Modal}/ConfirmationModal.js.map +0 -0
- /package/{dist/Modal → Modal}/ModalWindow.d.ts +0 -0
- /package/{dist/Modal → Modal}/ModalWindow.js.map +0 -0
- /package/{dist/Modal → Modal}/Root.d.ts +0 -0
- /package/{dist/Modal → Modal}/Root.js.map +0 -0
- /package/{dist/Modal → Modal}/actions.d.ts +0 -0
- /package/{dist/Modal → Modal}/actions.js +0 -0
- /package/{dist/Modal → Modal}/actions.js.map +0 -0
- /package/{dist/Modal → Modal}/getComponent.d.ts +0 -0
- /package/{dist/Modal → Modal}/getComponent.js.map +0 -0
- /package/{dist/Modal → Modal}/index.d.ts +0 -0
- /package/{dist/Modal → Modal}/index.js.map +0 -0
- /package/{dist/Modal → Modal}/reducer.d.ts +0 -0
- /package/{dist/Modal → Modal}/reducer.js.map +0 -0
- /package/{dist/Modal → Modal}/types.d.ts +0 -0
- /package/{dist/Modal → Modal}/types.js +0 -0
- /package/{dist/Modal → Modal}/types.js.map +0 -0
- /package/{dist/Modal → Modal}/util.d.ts +0 -0
- /package/{dist/Modal → Modal}/util.js +0 -0
- /package/{dist/Modal → Modal}/util.js.map +0 -0
- /package/{dist/Payment → Payment}/Modal/BankTransfer.d.ts +0 -0
- /package/{dist/Payment → Payment}/Modal/BankTransfer.js.map +0 -0
- /package/{dist/Payment → Payment}/Modal/BankTransferDoneModal.d.ts +0 -0
- /package/{dist/Payment → Payment}/Modal/BankTransferDoneModal.js.map +0 -0
- /package/{dist/Payment → Payment}/Modal/index.d.ts +0 -0
- /package/{dist/Payment → Payment}/Modal/index.js.map +0 -0
- /package/{dist/Payment → Payment}/Pieces/BankTransferForm/BankTransferForm.d.ts +0 -0
- /package/{dist/Payment → Payment}/Pieces/BankTransferForm/BankTransferForm.js.map +0 -0
- /package/{dist/Payment → Payment}/Pieces/BankTransferForm/BankTransferFormWrapper.d.ts +0 -0
- /package/{dist/Payment → Payment}/Pieces/BankTransferForm/BankTransferFormWrapper.js.map +0 -0
- /package/{dist/Payment → Payment}/Pieces/BankTransferForm/BankTransferNumberField.d.ts +0 -0
- /package/{dist/Payment → Payment}/Pieces/BankTransferForm/BankTransferNumberField.js +0 -0
- /package/{dist/Payment → Payment}/Pieces/BankTransferForm/BankTransferNumberField.js.map +0 -0
- /package/{dist/Payment → Payment}/Pieces/BankTransferForm/validate.d.ts +0 -0
- /package/{dist/Payment → Payment}/Pieces/BankTransferForm/validate.js.map +0 -0
- /package/{dist/Payment → Payment}/Pieces/MobilPayForm.d.ts +0 -0
- /package/{dist/Payment → Payment}/Pieces/MobilPayForm.js.map +0 -0
- /package/{dist/Payment → Payment}/Pieces/Payment.d.ts +0 -0
- /package/{dist/Payment → Payment}/Pieces/Payment.js.map +0 -0
- /package/{dist/Payment → Payment}/core/actions.d.ts +0 -0
- /package/{dist/Payment → Payment}/core/actions.js.map +0 -0
- /package/{dist/Payment → Payment}/core/codes.d.ts +0 -0
- /package/{dist/Payment → Payment}/core/codes.js +0 -0
- /package/{dist/Payment → Payment}/core/codes.js.map +0 -0
- /package/{dist/Payment → Payment}/core/request.d.ts +0 -0
- /package/{dist/Payment → Payment}/core/request.js +0 -0
- /package/{dist/Payment → Payment}/core/request.js.map +0 -0
- /package/{dist/Payment → Payment}/core/util/info.d.ts +0 -0
- /package/{dist/Payment → Payment}/core/util/info.js +0 -0
- /package/{dist/Payment → Payment}/core/util/info.js.map +0 -0
- /package/{dist/Payment → Payment}/core/util/util.d.ts +0 -0
- /package/{dist/Payment → Payment}/core/util/util.js.map +0 -0
- /package/{dist/Payment → Payment}/index.d.ts +0 -0
- /package/{dist/Payment → Payment}/index.js.map +0 -0
- /package/{dist/UI → UI}/Collapse.d.ts +0 -0
- /package/{dist/UI → UI}/Collapse.js +0 -0
- /package/{dist/UI → UI}/Collapse.js.map +0 -0
- /package/{dist/UI → UI}/LoadImages.d.ts +0 -0
- /package/{dist/UI → UI}/LoadImages.js.map +0 -0
- /package/{dist/UI → UI}/NewFeature.d.ts +0 -0
- /package/{dist/UI → UI}/NewFeature.js +0 -0
- /package/{dist/UI → UI}/NewFeature.js.map +0 -0
- /package/{dist/UI → UI}/Things.d.ts +0 -0
- /package/{dist/UI → UI}/Things.js.map +0 -0
- /package/{dist/actions.d.ts → actions.d.ts} +0 -0
- /package/{dist/actions.js.map → actions.js.map} +0 -0
- /package/{dist/config.d.ts → config.d.ts} +0 -0
- /package/{dist/config.js → config.js} +0 -0
- /package/{dist/config.js.map → config.js.map} +0 -0
- /package/{dist/index.js.map → index.js.map} +0 -0
- /package/{dist/reducer → reducer}/captchas.d.ts +0 -0
- /package/{dist/reducer → reducer}/captchas.js +0 -0
- /package/{dist/reducer → reducer}/captchas.js.map +0 -0
- /package/{dist/reducer → reducer}/index.d.ts +0 -0
- /package/{dist/reducer → reducer}/index.js.map +0 -0
- /package/{dist/reducer → reducer}/module.d.ts +0 -0
- /package/{dist/reducer → reducer}/module.js.map +0 -0
- /package/{dist/styles → styles}/index.css +0 -0
- /package/{dist/types.d.ts → types.d.ts} +0 -0
- /package/{dist/types.js → types.js} +0 -0
- /package/{dist/types.js.map → types.js.map} +0 -0
- /package/{dist/utility → utility}/breakpoint.d.ts +0 -0
- /package/{dist/utility → utility}/breakpoint.js +0 -0
- /package/{dist/utility → utility}/breakpoint.js.map +0 -0
- /package/{dist/utility → utility}/calendar.d.ts +0 -0
- /package/{dist/utility → utility}/calendar.js.map +0 -0
- /package/{dist/utility → utility}/date.d.ts +0 -0
- /package/{dist/utility → utility}/date.js.map +0 -0
- /package/{dist/utility → utility}/dev/ErrorBoundary.d.ts +0 -0
- /package/{dist/utility → utility}/dev/ErrorBoundary.js.map +0 -0
- /package/{dist/utility → utility}/dev/TheError.d.ts +0 -0
- /package/{dist/utility → utility}/dev/TheError.js +0 -0
- /package/{dist/utility → utility}/dev/TheError.js.map +0 -0
- /package/{dist/utility → utility}/dev/index.d.ts +0 -0
- /package/{dist/utility → utility}/dev/index.js.map +0 -0
- /package/{dist/utility → utility}/dev/types.d.ts +0 -0
- /package/{dist/utility → utility}/dev/types.js +0 -0
- /package/{dist/utility → utility}/dev/types.js.map +0 -0
- /package/{dist/utility → utility}/hooks.d.ts +0 -0
- /package/{dist/utility → utility}/hooks.js +0 -0
- /package/{dist/utility → utility}/hooks.js.map +0 -0
- /package/{dist/utility → utility}/index.d.ts +0 -0
- /package/{dist/utility → utility}/index.js.map +0 -0
- /package/{dist/utility → utility}/languages/date.d.ts +0 -0
- /package/{dist/utility → utility}/languages/date.js +0 -0
- /package/{dist/utility → utility}/languages/date.js.map +0 -0
- /package/{dist/utility → utility}/languages/english.d.ts +0 -0
- /package/{dist/utility → utility}/languages/english.js.map +0 -0
- /package/{dist/utility → utility}/languages/ro.d.ts +0 -0
- /package/{dist/utility → utility}/languages/ro.js +0 -0
- /package/{dist/utility → utility}/languages/ro.js.map +0 -0
- /package/{dist/utility → utility}/normalize.d.ts +0 -0
- /package/{dist/utility → utility}/normalize.js.map +0 -0
- /package/{dist/utility → utility}/numbers.d.ts +0 -0
- /package/{dist/utility → utility}/numbers.js +0 -0
- /package/{dist/utility → utility}/numbers.js.map +0 -0
- /package/{dist/utility → utility}/numeric.d.ts +0 -0
- /package/{dist/utility → utility}/numeric.js.map +0 -0
- /package/{dist/utility → utility}/others.d.ts +0 -0
- /package/{dist/utility → utility}/others.js +0 -0
- /package/{dist/utility → utility}/others.js.map +0 -0
- /package/{dist/utility → utility}/strings.d.ts +0 -0
- /package/{dist/utility → utility}/strings.js +0 -0
- /package/{dist/utility → utility}/strings.js.map +0 -0
- /package/{dist/utility → utility}/uuid.d.ts +0 -0
- /package/{dist/utility → utility}/uuid.js +0 -0
- /package/{dist/utility → utility}/uuid.js.map +0 -0
- /package/{dist/utility → utility}/validation/common.d.ts +0 -0
- /package/{dist/utility → utility}/validation/common.js.map +0 -0
- /package/{dist/utility → utility}/validation/index.d.ts +0 -0
- /package/{dist/utility → utility}/validation/index.js.map +0 -0
- /package/{dist/utility → utility}/validation/specific.d.ts +0 -0
- /package/{dist/utility → utility}/validation/specific.js.map +0 -0
- /package/{dist/utility → utility}/validation/types.d.ts +0 -0
- /package/{dist/utility → utility}/validation/types.js +0 -0
- /package/{dist/utility → utility}/validation/types.js.map +0 -0
- /package/{dist/utility → utility}/validation/validate/date.d.ts +0 -0
- /package/{dist/utility → utility}/validation/validate/date.js +0 -0
- /package/{dist/utility → utility}/validation/validate/date.js.map +0 -0
- /package/{dist/utility → utility}/validation/validate/email.d.ts +0 -0
- /package/{dist/utility → utility}/validation/validate/email.js +0 -0
- /package/{dist/utility → utility}/validation/validate/email.js.map +0 -0
- /package/{dist/utility → utility}/validation/validate/index.d.ts +0 -0
- /package/{dist/utility → utility}/validation/validate/index.js.map +0 -0
- /package/{dist/utility → utility}/words.d.ts +0 -0
- /package/{dist/utility → utility}/words.js.map +0 -0
package/src/utility/normalize.ts
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
/* eslint-disable max-len, no-duplicate-imports */
|
|
2
|
-
import * as Immutable from "immutable";
|
|
3
|
-
import { words } from "./words";
|
|
4
|
-
import type { NormalizedResult } from "src/types";
|
|
5
|
-
|
|
6
|
-
type Normalizr = (item: any) => any;
|
|
7
|
-
type NormalizeBoolean = (input: "" | boolean) => boolean;
|
|
8
|
-
type NormalizeArray = (raw: Array<any>) => NormalizedResult;
|
|
9
|
-
type Normalize = (raw: Array<any>, field: string, normalizr: Normalizr) => NormalizedResult;
|
|
10
|
-
type Resolve = (data: any) => void;
|
|
11
|
-
type Reject = (arg: any) => void;
|
|
12
|
-
type Response = {
|
|
13
|
-
body: any;
|
|
14
|
-
};
|
|
15
|
-
type Error = {
|
|
16
|
-
status: any;
|
|
17
|
-
};
|
|
18
|
-
type DefaultNormalize = (raw: Array<any>, field: string) => NormalizedResult;
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
defaultNormalizr: Normalizr = (item) => Immutable.fromJS(item),
|
|
22
|
-
|
|
23
|
-
defaultValue = () => ({
|
|
24
|
-
entities : Immutable.Map(),
|
|
25
|
-
result : Immutable.List(),
|
|
26
|
-
}),
|
|
27
|
-
|
|
28
|
-
customNormalizeArrayByField: Normalize = (raw: Array<any>, field: string, normalizr: Normalizr) => raw === null ? defaultValue() : raw.reduce((previous, current) => {
|
|
29
|
-
const stringID = String(current[field]);
|
|
30
|
-
|
|
31
|
-
previous.entities = previous.entities.set(stringID, normalizr(current));
|
|
32
|
-
previous.result = previous.result.push(stringID);
|
|
33
|
-
return previous;
|
|
34
|
-
}, defaultValue()),
|
|
35
|
-
|
|
36
|
-
withPromiseCallback = (resolve: Resolve, reject: Reject) => (error: Error, response: Response) => {
|
|
37
|
-
if (error) {
|
|
38
|
-
const StatusUnauthorized = 401;
|
|
39
|
-
|
|
40
|
-
if (error.status === StatusUnauthorized) {
|
|
41
|
-
document.location.href = "/";
|
|
42
|
-
} else {
|
|
43
|
-
// error.message
|
|
44
|
-
reject({
|
|
45
|
-
error: words.ThereWasAProblem,
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
} else {
|
|
49
|
-
resolve(response.body);
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
/*
|
|
53
|
-
* entities ---> Object { "1": Immutable.Map(), ... ]) }
|
|
54
|
-
* result ---> List([ "1", "2", "3" ])
|
|
55
|
-
*/
|
|
56
|
-
normalizeArray: NormalizeArray = (raw: Array<any>, normalizr?: Normalizr) => (
|
|
57
|
-
customNormalizeArrayByField(raw, "ID", typeof normalizr === "undefined" ? defaultNormalizr : normalizr)
|
|
58
|
-
),
|
|
59
|
-
|
|
60
|
-
normalizeBoolean: NormalizeBoolean = (value: boolean | "") => value || false,
|
|
61
|
-
|
|
62
|
-
normalizeArrayByField: DefaultNormalize = (raw: Array<any>, field: string) => customNormalizeArrayByField(raw, field, defaultNormalizr),
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
normalizeSelectNumeric = (raw: string) => typeof raw === "string" && raw !== "" ? parseInt(raw, 10) : raw,
|
|
66
|
-
|
|
67
|
-
normalize = {
|
|
68
|
-
normalizeArrayByField,
|
|
69
|
-
normalizeSelectNumeric,
|
|
70
|
-
withPromiseCallback,
|
|
71
|
-
normalizeArray,
|
|
72
|
-
normalizeBoolean,
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
export default normalize;
|
package/src/utility/numbers.ts
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-magic-numbers */
|
|
2
|
-
|
|
3
|
-
const numberFormat: any = new Intl.NumberFormat("ro", {
|
|
4
|
-
minimumFractionDigits: 2,
|
|
5
|
-
}),
|
|
6
|
-
plainNumberFormat: any = new Intl.NumberFormat("ro"),
|
|
7
|
-
|
|
8
|
-
replaceCharInString = ({
|
|
9
|
-
word,
|
|
10
|
-
oldChar,
|
|
11
|
-
newChar,
|
|
12
|
-
}: {
|
|
13
|
-
word: string;
|
|
14
|
-
oldChar: string;
|
|
15
|
-
newChar: string;
|
|
16
|
-
}): string => {
|
|
17
|
-
const regex = new RegExp(oldChar, "gu");
|
|
18
|
-
|
|
19
|
-
return word.replace(regex, newChar);
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
// 127.99 ----> 127,99
|
|
23
|
-
// 0 ----> ""
|
|
24
|
-
export const
|
|
25
|
-
formatZeroValue = (word: any, optional?: boolean): string => (
|
|
26
|
-
optional && word === "" ? "" : replaceCharInString({
|
|
27
|
-
word : String(word),
|
|
28
|
-
oldChar : "\\.",
|
|
29
|
-
newChar : ",",
|
|
30
|
-
})
|
|
31
|
-
),
|
|
32
|
-
formatNumber = (word: any): string => replaceCharInString({
|
|
33
|
-
word : String(word),
|
|
34
|
-
oldChar : "\\.",
|
|
35
|
-
newChar : ",",
|
|
36
|
-
}),
|
|
37
|
-
normalizeNumber = (word: any): string => replaceCharInString({
|
|
38
|
-
word : String(word),
|
|
39
|
-
oldChar : ",",
|
|
40
|
-
newChar : ".",
|
|
41
|
-
}),
|
|
42
|
-
numberToLocale = (value: number): string => numberFormat.format(value),
|
|
43
|
-
plainNumberToLocale = (value: number): string => plainNumberFormat.format(value),
|
|
44
|
-
numericBehavior = {
|
|
45
|
-
normalize : normalizeNumber,
|
|
46
|
-
format : formatNumber,
|
|
47
|
-
},
|
|
48
|
-
tryToParseNumber = (raw: string) => {
|
|
49
|
-
const result = Number(raw);
|
|
50
|
-
|
|
51
|
-
if (!isNaN(result) && raw !== "") {
|
|
52
|
-
return result;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
return raw;
|
|
56
|
-
},
|
|
57
|
-
numberToLocaleHideBlank = (raw: any) => (
|
|
58
|
-
typeof raw === "number" && raw !== 0 ? numberToLocale(raw) : ""
|
|
59
|
-
),
|
|
60
|
-
plainNumberToLocaleHideZero = (raw: any) => (
|
|
61
|
-
typeof raw === "number" && raw !== 0 ? plainNumberToLocale(raw) : ""
|
|
62
|
-
);
|
package/src/utility/numeric.ts
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
type This = any;
|
|
2
|
-
import { normalizeNumber } from "./numbers";
|
|
3
|
-
|
|
4
|
-
export const handleBlur = (that: This) => {
|
|
5
|
-
const {
|
|
6
|
-
state,
|
|
7
|
-
props,
|
|
8
|
-
} = that,
|
|
9
|
-
{
|
|
10
|
-
input,
|
|
11
|
-
normalizeValue,
|
|
12
|
-
optional,
|
|
13
|
-
} = props,
|
|
14
|
-
{
|
|
15
|
-
onBlur,
|
|
16
|
-
} = input,
|
|
17
|
-
{
|
|
18
|
-
value: currentValue,
|
|
19
|
-
} = state,
|
|
20
|
-
|
|
21
|
-
performBlur = (value: number | null, shouldRenderAgain: boolean) => {
|
|
22
|
-
input.onChange(value);
|
|
23
|
-
|
|
24
|
-
/*
|
|
25
|
-
* Swallow the event to prevent Redux Form from
|
|
26
|
-
* extracting the form value
|
|
27
|
-
*/
|
|
28
|
-
onBlur();
|
|
29
|
-
|
|
30
|
-
if (shouldRenderAgain) {
|
|
31
|
-
const setState = that.setState.bind(that);
|
|
32
|
-
|
|
33
|
-
return setState({
|
|
34
|
-
value,
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
return null;
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
shouldNotChange = currentValue === "" && optional;
|
|
42
|
-
|
|
43
|
-
if (shouldNotChange) {
|
|
44
|
-
if (input.value === "") {
|
|
45
|
-
return null;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
return performBlur(null, true);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const normalizedValue = normalizeValue(currentValue),
|
|
52
|
-
shouldRenderAgain = !isNaN(normalizedValue) && currentValue !== normalizedValue;
|
|
53
|
-
|
|
54
|
-
return performBlur(normalizedValue, shouldRenderAgain);
|
|
55
|
-
};
|
|
56
|
-
export const normalizeFloat = (raw: string): number => {
|
|
57
|
-
/* eslint-disable no-magic-numbers */
|
|
58
|
-
const value = normalizeNumber(raw),
|
|
59
|
-
shouldNotNormalize = value.trim() === "" || isNaN(Number(value));
|
|
60
|
-
|
|
61
|
-
if (shouldNotNormalize) {
|
|
62
|
-
return NaN;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
const result = Number(value),
|
|
66
|
-
truncateTo = (unRouned: number, nrOfDecimals = 2): number => {
|
|
67
|
-
const parts = String(unRouned).split(".");
|
|
68
|
-
|
|
69
|
-
if (parts.length !== 2) {
|
|
70
|
-
// ex. 12
|
|
71
|
-
return unRouned;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
const newDecimals = parts[1].slice(0, nrOfDecimals),
|
|
75
|
-
newString = `${parts[0]}.${newDecimals}`;
|
|
76
|
-
|
|
77
|
-
return Number(newString);
|
|
78
|
-
},
|
|
79
|
-
normalized = truncateTo(result);
|
|
80
|
-
|
|
81
|
-
return normalized;
|
|
82
|
-
};
|
|
83
|
-
export const cwrp = (that: This, nextany: any) => {
|
|
84
|
-
const {
|
|
85
|
-
state,
|
|
86
|
-
} = that,
|
|
87
|
-
{
|
|
88
|
-
input: {
|
|
89
|
-
value: newValue,
|
|
90
|
-
},
|
|
91
|
-
} = nextany,
|
|
92
|
-
{
|
|
93
|
-
value: currentValue,
|
|
94
|
-
} = state,
|
|
95
|
-
shouldRenderAgain = !isNaN(newValue) && currentValue !== newValue,
|
|
96
|
-
setState = that.setState.bind(that);
|
|
97
|
-
|
|
98
|
-
if (shouldRenderAgain) {
|
|
99
|
-
setState({
|
|
100
|
-
value: newValue,
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
};
|
package/src/utility/others.tsx
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
// type ReduxError = {
|
|
3
|
-
// error: any;
|
|
4
|
-
// };
|
|
5
|
-
|
|
6
|
-
import type { List as ImmutableList, Map as ImmutableMap } from "immutable";
|
|
7
|
-
import React from "react";
|
|
8
|
-
|
|
9
|
-
type PropsType = {
|
|
10
|
-
// Define your props type here
|
|
11
|
-
[key: string]: undefined | any;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export const
|
|
15
|
-
propsAreEqualCreator = <T extends PropsType>(objects : (keyof T)[], primitives : (keyof T)[]) => (prevProps : T, nextProps : T) => {
|
|
16
|
-
const
|
|
17
|
-
result = [
|
|
18
|
-
...objects.map((field : any) => (
|
|
19
|
-
JSON.stringify(prevProps[field]) === JSON.stringify(nextProps[field])
|
|
20
|
-
)),
|
|
21
|
-
...primitives.map((field: any) => prevProps[field] === nextProps[field]),
|
|
22
|
-
].
|
|
23
|
-
filter((current) => current);
|
|
24
|
-
|
|
25
|
-
return result.length === (objects.length + primitives.length);
|
|
26
|
-
},
|
|
27
|
-
getDateSortNumber = (item: string) => Number(new Date(item).getTime()),
|
|
28
|
-
isAdministratorAccount = (current: number) => current === 0,
|
|
29
|
-
createModal = (modalType: string, modalProps?: any) => ({
|
|
30
|
-
type : "SHOW_MODAL",
|
|
31
|
-
payload : {
|
|
32
|
-
modalType,
|
|
33
|
-
modalProps,
|
|
34
|
-
},
|
|
35
|
-
}),
|
|
36
|
-
noError = "",
|
|
37
|
-
rowsPerLoad = 50,
|
|
38
|
-
nothingFetched = -1,
|
|
39
|
-
removeID = (payload: ImmutableMap<string, any>) => (list: ImmutableList<string>) => (
|
|
40
|
-
list.delete(list.findIndex((current: string) => current === String(payload.get("ID"))))
|
|
41
|
-
),
|
|
42
|
-
addID = (payload: ImmutableMap<string, any>) => (
|
|
43
|
-
(list: ImmutableList<string>) => list.push(String(payload.get("ID")))
|
|
44
|
-
),
|
|
45
|
-
delay = () => (new Promise((resolve) => {
|
|
46
|
-
setTimeout(resolve);
|
|
47
|
-
}) as Promise<any>),
|
|
48
|
-
showCheck = (value: boolean) => value ? <i className="fa fa-check text-success" /> : null,
|
|
49
|
-
tryToCloseModalDefault = (cb?: () => any) => {
|
|
50
|
-
if (typeof cb === "function") {
|
|
51
|
-
cb();
|
|
52
|
-
}
|
|
53
|
-
};
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import { describe, expect, test } from "vitest";
|
|
2
|
-
import { firstToUppercase, toLower, toTitle, toUpper } from "./strings";
|
|
3
|
-
|
|
4
|
-
// toTitle
|
|
5
|
-
(() => {
|
|
6
|
-
describe("Test toTitle", () => {
|
|
7
|
-
const tests = [
|
|
8
|
-
{
|
|
9
|
-
input : "",
|
|
10
|
-
output : "",
|
|
11
|
-
}, {
|
|
12
|
-
input : "cosovei",
|
|
13
|
-
output : "Cosovei",
|
|
14
|
-
}, {
|
|
15
|
-
input : "simona cosovei",
|
|
16
|
-
output : "Simona Cosovei",
|
|
17
|
-
}, {
|
|
18
|
-
input : "ștefănică țepeș",
|
|
19
|
-
output : "Ștefănică Țepeș",
|
|
20
|
-
}, {
|
|
21
|
-
input : "this is 4 long name 5",
|
|
22
|
-
output : "This Is 4 Long Name 5",
|
|
23
|
-
},
|
|
24
|
-
];
|
|
25
|
-
|
|
26
|
-
for (const {
|
|
27
|
-
input,
|
|
28
|
-
output,
|
|
29
|
-
} of tests) {
|
|
30
|
-
describe(`Given the raw string "${input}"`, () => {
|
|
31
|
-
test(`should be transformed to "${output}"`, () => {
|
|
32
|
-
expect(toTitle(input)).toEqual(output);
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
})();
|
|
38
|
-
|
|
39
|
-
// firstToUppercase
|
|
40
|
-
(() => {
|
|
41
|
-
describe("Test firstToUppercase", () => {
|
|
42
|
-
const tests = [
|
|
43
|
-
{
|
|
44
|
-
input : "",
|
|
45
|
-
output : "",
|
|
46
|
-
}, {
|
|
47
|
-
input : "sima",
|
|
48
|
-
output : "Sima",
|
|
49
|
-
}, {
|
|
50
|
-
input : "Simona Cosovei",
|
|
51
|
-
output : "Simona Cosovei",
|
|
52
|
-
}, {
|
|
53
|
-
input : "this is 4 long name 5",
|
|
54
|
-
output : "This is 4 long name 5",
|
|
55
|
-
},
|
|
56
|
-
];
|
|
57
|
-
|
|
58
|
-
for (const {
|
|
59
|
-
input,
|
|
60
|
-
output,
|
|
61
|
-
} of tests) {
|
|
62
|
-
describe(`given "${input}"`, () => {
|
|
63
|
-
test(`should be transformed to "${output}"`, () => {
|
|
64
|
-
expect(firstToUppercase(input)).toEqual(output);
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
})();
|
|
70
|
-
|
|
71
|
-
// toUpper
|
|
72
|
-
(() => {
|
|
73
|
-
const tests = [
|
|
74
|
-
{
|
|
75
|
-
input : "",
|
|
76
|
-
output : "",
|
|
77
|
-
}, {
|
|
78
|
-
input : "sima",
|
|
79
|
-
output : "SIMA",
|
|
80
|
-
}, {
|
|
81
|
-
input : "this is 4 long name 5",
|
|
82
|
-
output : "THIS IS 4 LONG NAME 5",
|
|
83
|
-
},
|
|
84
|
-
];
|
|
85
|
-
|
|
86
|
-
for (const {
|
|
87
|
-
input,
|
|
88
|
-
output,
|
|
89
|
-
} of tests) {
|
|
90
|
-
describe(`given "${input}"`, () => {
|
|
91
|
-
test(`should be transformed to "${output}"`, () => {
|
|
92
|
-
expect(toUpper(input)).toEqual(output);
|
|
93
|
-
});
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
})();
|
|
97
|
-
|
|
98
|
-
// toLower
|
|
99
|
-
(() => {
|
|
100
|
-
const tests = [
|
|
101
|
-
{
|
|
102
|
-
input : "",
|
|
103
|
-
output : "",
|
|
104
|
-
}, {
|
|
105
|
-
input : "siMa",
|
|
106
|
-
output : "sima",
|
|
107
|
-
}, {
|
|
108
|
-
input : "This is 4 long Name 5",
|
|
109
|
-
output : "this is 4 long name 5",
|
|
110
|
-
},
|
|
111
|
-
];
|
|
112
|
-
|
|
113
|
-
for (const {
|
|
114
|
-
input,
|
|
115
|
-
output,
|
|
116
|
-
} of tests) {
|
|
117
|
-
describe(`given "${input}"`, () => {
|
|
118
|
-
test(`should be transformed to "${output}"`, () => {
|
|
119
|
-
expect(toLower(input)).toEqual(output);
|
|
120
|
-
});
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
})();
|
package/src/utility/strings.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export const toTitle = (str: string): string => {
|
|
2
|
-
const transform = (txt: string): string => {
|
|
3
|
-
const firstPart = txt.charAt(0).toUpperCase(),
|
|
4
|
-
secondPart = txt.substr(1).toLowerCase();
|
|
5
|
-
|
|
6
|
-
return `${firstPart}${secondPart}`;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
return str.replace(/\S+/gu, transform);
|
|
10
|
-
};
|
|
11
|
-
// this is an example ---> This is an example
|
|
12
|
-
export const firstToUppercase = (str: string): string => {
|
|
13
|
-
const firstPart = str.charAt(0).toUpperCase(),
|
|
14
|
-
secondPart = str.slice(1);
|
|
15
|
-
|
|
16
|
-
return `${firstPart}${secondPart}`;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
// This is ---> THIS IS
|
|
20
|
-
export const toUpper = (str: string): string => String(str ? str : "").toUpperCase();
|
|
21
|
-
// This is ---> this is
|
|
22
|
-
export const toLower = (str: string): string => String(str ? str : "").toLowerCase();
|
package/src/utility/uuid.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-magic-numbers */
|
|
2
|
-
const
|
|
3
|
-
generatedUUIDs = new Set(),
|
|
4
|
-
generateUUIDv4 = () => {
|
|
5
|
-
let uuid = "";
|
|
6
|
-
const HEX_BASE = 16,
|
|
7
|
-
HEX_LENGTH = 16,
|
|
8
|
-
UUID_LENGTH = 32,
|
|
9
|
-
UUID_SECTIONS = [8, 12, 16, 20];
|
|
10
|
-
|
|
11
|
-
for (let index = 0; index < UUID_LENGTH; index+=1) {
|
|
12
|
-
if (UUID_SECTIONS.includes(index)) {
|
|
13
|
-
uuid += "-";
|
|
14
|
-
}
|
|
15
|
-
uuid += Math.floor(Math.random() * HEX_BASE).toString(HEX_LENGTH);
|
|
16
|
-
}
|
|
17
|
-
return uuid;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export const generateUniqueUUIDv4 = () => {
|
|
21
|
-
let uuid =generateUUIDv4();
|
|
22
|
-
|
|
23
|
-
while (generatedUUIDs.has(uuid)) {
|
|
24
|
-
uuid =generateUUIDv4();
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
generatedUUIDs.add(uuid);
|
|
28
|
-
|
|
29
|
-
return uuid;
|
|
30
|
-
};
|