dce-reactkit 3.6.14 → 3.6.16
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/cjs/index.js +25 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/helpers/prefixWithAOrAn.d.ts +10 -0
- package/dist/cjs/types/index.d.ts +2 -1
- package/dist/esm/index.js +25 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/helpers/prefixWithAOrAn.d.ts +10 -0
- package/dist/esm/types/index.d.ts +2 -1
- package/dist/index.d.ts +11 -1
- package/package.json +1 -1
- package/src/helpers/prefixWithAOrAn.ts +29 -0
- package/src/index.ts +2 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prefix a word or name with "a" or "an" depending on whether it starts with a
|
|
3
|
+
* vowel or not
|
|
4
|
+
* @author Gabe Abrams
|
|
5
|
+
* @param text the text to prefix
|
|
6
|
+
* @param capitalize whether to capitalize the "A" or "An"
|
|
7
|
+
* @returns the text prefixed with "a" or "an"
|
|
8
|
+
*/
|
|
9
|
+
declare const prefixWithAOrAn: (text: string, capitalize?: boolean) => string;
|
|
10
|
+
export default prefixWithAOrAn;
|
|
@@ -68,6 +68,7 @@ import validateString from './helpers/validators/validateString';
|
|
|
68
68
|
import idify from './helpers/idify';
|
|
69
69
|
import makeLinksClickable from './helpers/makeLinksClickable';
|
|
70
70
|
import combineClassNames from './helpers/combineClassNames';
|
|
71
|
+
import prefixWithAOrAn from './helpers/prefixWithAOrAn';
|
|
71
72
|
import ModalButtonType from './types/ModalButtonType';
|
|
72
73
|
import ModalSize from './types/ModalSize';
|
|
73
74
|
import ModalType from './types/ModalType';
|
|
@@ -86,4 +87,4 @@ import PickableItem from './components/ItemPicker/types/PickableItem';
|
|
|
86
87
|
import DBEntry from './components/DBEntryManagerPanel/types/DBEntry';
|
|
87
88
|
import DBEntryField from './components/DBEntryManagerPanel/types/DBEntryField';
|
|
88
89
|
import DBEntryFieldType from './components/DBEntryManagerPanel/types/DBEntryFieldType';
|
|
89
|
-
export { AppWrapper, LoadingSpinner, ErrorBox, Modal, TabBox, RadioButton, CheckboxButton, ButtonInputGroup, SimpleDateChooser, Drawer, PopSuccessMark, PopFailureMark, PopPendingMark, CopiableBox, ItemPicker, LogReviewer, IntelliTable, CSVDownloadButton, DBEntryManagerPanel, Tooltip, ToggleSwitch, AutoscrollToBottomContainer, MultiSwitch, alert, confirm, showFatalError, ErrorWithCode, MINUTE_IN_MS, HOUR_IN_MS, DAY_IN_MS, DynamicWord, abbreviate, avg, ceilToNumDecimals, floorToNumDecimals, forceNumIntoBounds, padDecimalZeros, padZerosLeft, roundToNumDecimals, sum, waitMs, getOrdinal, getTimeInfoInET, stubServerEndpoint, startMinWait, getHumanReadableDate, getPartOfDay, stringsToHumanReadableList, onlyKeepLetters, parallelLimit, getMonthName, genCSV, canReviewLogs, isMobileOrTablet, extractProp, compareArraysByProp, genCommaList, validateEmail, validatePhoneNumber, validateString, getLocalTimeInfo, idify, makeLinksClickable, initClient, visitServerEndpoint, logClientEvent, addFatalErrorHandler, leaveToURL, combineClassNames, initServer, genRouteHandler, handleError, handleSuccess, initLogCollection, addDBEditorEndpoints, ModalButtonType, ModalSize, ModalType, ReactKitErrorCode, Variant, DayOfWeek, Log, LogType, LogSource, LogAction, LogBuiltInMetadata, LogMetadataType, IntelliTableColumn, PickableItem, DBEntry, DBEntryField, DBEntryFieldType, ParamType, };
|
|
90
|
+
export { AppWrapper, LoadingSpinner, ErrorBox, Modal, TabBox, RadioButton, CheckboxButton, ButtonInputGroup, SimpleDateChooser, Drawer, PopSuccessMark, PopFailureMark, PopPendingMark, CopiableBox, ItemPicker, LogReviewer, IntelliTable, CSVDownloadButton, DBEntryManagerPanel, Tooltip, ToggleSwitch, AutoscrollToBottomContainer, MultiSwitch, alert, confirm, showFatalError, ErrorWithCode, MINUTE_IN_MS, HOUR_IN_MS, DAY_IN_MS, DynamicWord, abbreviate, avg, ceilToNumDecimals, floorToNumDecimals, forceNumIntoBounds, padDecimalZeros, padZerosLeft, roundToNumDecimals, sum, waitMs, getOrdinal, getTimeInfoInET, stubServerEndpoint, startMinWait, getHumanReadableDate, getPartOfDay, stringsToHumanReadableList, onlyKeepLetters, parallelLimit, getMonthName, genCSV, canReviewLogs, isMobileOrTablet, extractProp, compareArraysByProp, genCommaList, validateEmail, validatePhoneNumber, validateString, getLocalTimeInfo, idify, makeLinksClickable, prefixWithAOrAn, initClient, visitServerEndpoint, logClientEvent, addFatalErrorHandler, leaveToURL, combineClassNames, initServer, genRouteHandler, handleError, handleSuccess, initLogCollection, addDBEditorEndpoints, ModalButtonType, ModalSize, ModalType, ReactKitErrorCode, Variant, DayOfWeek, Log, LogType, LogSource, LogAction, LogBuiltInMetadata, LogMetadataType, IntelliTableColumn, PickableItem, DBEntry, DBEntryField, DBEntryFieldType, ParamType, };
|
package/dist/esm/index.js
CHANGED
|
@@ -43324,6 +43324,30 @@ const makeLinksClickable = (text, opts) => {
|
|
|
43324
43324
|
return elements;
|
|
43325
43325
|
};
|
|
43326
43326
|
|
|
43327
|
+
// Constants
|
|
43328
|
+
const VOWELS = ['a', 'e', 'i', 'o', 'u'];
|
|
43329
|
+
/**
|
|
43330
|
+
* Prefix a word or name with "a" or "an" depending on whether it starts with a
|
|
43331
|
+
* vowel or not
|
|
43332
|
+
* @author Gabe Abrams
|
|
43333
|
+
* @param text the text to prefix
|
|
43334
|
+
* @param capitalize whether to capitalize the "A" or "An"
|
|
43335
|
+
* @returns the text prefixed with "a" or "an"
|
|
43336
|
+
*/
|
|
43337
|
+
const prefixWithAOrAn = (text, capitalize = false) => {
|
|
43338
|
+
// Get the first letter
|
|
43339
|
+
const firstLetter = text.charAt(0).toLowerCase();
|
|
43340
|
+
// Check if starts with vowel
|
|
43341
|
+
const startsWithVowel = VOWELS.includes(firstLetter);
|
|
43342
|
+
// Determine prefix
|
|
43343
|
+
let prefix = startsWithVowel ? 'an' : 'a';
|
|
43344
|
+
if (capitalize) {
|
|
43345
|
+
prefix = prefix.charAt(0).toUpperCase() + prefix.substring(1);
|
|
43346
|
+
}
|
|
43347
|
+
// Return the text prefixed with "a" or "an"
|
|
43348
|
+
return `${prefix} ${text}`;
|
|
43349
|
+
};
|
|
43350
|
+
|
|
43327
43351
|
/**
|
|
43328
43352
|
* Days of the week
|
|
43329
43353
|
* @author Gabe Abrams
|
|
@@ -43340,5 +43364,5 @@ var DayOfWeek;
|
|
|
43340
43364
|
})(DayOfWeek || (DayOfWeek = {}));
|
|
43341
43365
|
var DayOfWeek$1 = DayOfWeek;
|
|
43342
43366
|
|
|
43343
|
-
export { AppWrapper, AutoscrollToBottomContainer, ButtonInputGroup, CSVDownloadButton, CheckboxButton, CopiableBox, DAY_IN_MS, DBEntryFieldType$1 as DBEntryFieldType, DBEntryManagerPanel, DayOfWeek$1 as DayOfWeek, Drawer, DynamicWord, ErrorBox, ErrorWithCode, HOUR_IN_MS, IntelliTable, ItemPicker, LoadingSpinner, LogAction$1 as LogAction, LogBuiltInMetadata, LogReviewer, LogSource$1 as LogSource, LogType$1 as LogType, MINUTE_IN_MS, Modal, ModalButtonType$1 as ModalButtonType, ModalSize$1 as ModalSize, ModalType$1 as ModalType, MultiSwitch, ParamType$1 as ParamType, PopFailureMark, PopPendingMark, PopSuccessMark, RadioButton, ReactKitErrorCode$1 as ReactKitErrorCode, SimpleDateChooser, TabBox, ToggleSwitch, Tooltip, Variant$1 as Variant, abbreviate, addDBEditorEndpoints, addFatalErrorHandler, alert, avg, canReviewLogs, ceilToNumDecimals, combineClassNames, compareArraysByProp, confirm, extractProp, floorToNumDecimals, forceNumIntoBounds, genCSV, genCommaList, genRouteHandler, getHumanReadableDate, getLocalTimeInfo, getMonthName, getOrdinal, getPartOfDay, getTimeInfoInET, handleError, handleSuccess, idify, initClient, initLogCollection, initServer, isMobileOrTablet, leaveToURL, logClientEvent, makeLinksClickable, onlyKeepLetters, padDecimalZeros, padZerosLeft, parallelLimit, roundToNumDecimals, showFatalError, startMinWait, stringsToHumanReadableList, stubServerEndpoint, sum, validateEmail, validatePhoneNumber, validateString, visitServerEndpoint, waitMs };
|
|
43367
|
+
export { AppWrapper, AutoscrollToBottomContainer, ButtonInputGroup, CSVDownloadButton, CheckboxButton, CopiableBox, DAY_IN_MS, DBEntryFieldType$1 as DBEntryFieldType, DBEntryManagerPanel, DayOfWeek$1 as DayOfWeek, Drawer, DynamicWord, ErrorBox, ErrorWithCode, HOUR_IN_MS, IntelliTable, ItemPicker, LoadingSpinner, LogAction$1 as LogAction, LogBuiltInMetadata, LogReviewer, LogSource$1 as LogSource, LogType$1 as LogType, MINUTE_IN_MS, Modal, ModalButtonType$1 as ModalButtonType, ModalSize$1 as ModalSize, ModalType$1 as ModalType, MultiSwitch, ParamType$1 as ParamType, PopFailureMark, PopPendingMark, PopSuccessMark, RadioButton, ReactKitErrorCode$1 as ReactKitErrorCode, SimpleDateChooser, TabBox, ToggleSwitch, Tooltip, Variant$1 as Variant, abbreviate, addDBEditorEndpoints, addFatalErrorHandler, alert, avg, canReviewLogs, ceilToNumDecimals, combineClassNames, compareArraysByProp, confirm, extractProp, floorToNumDecimals, forceNumIntoBounds, genCSV, genCommaList, genRouteHandler, getHumanReadableDate, getLocalTimeInfo, getMonthName, getOrdinal, getPartOfDay, getTimeInfoInET, handleError, handleSuccess, idify, initClient, initLogCollection, initServer, isMobileOrTablet, leaveToURL, logClientEvent, makeLinksClickable, onlyKeepLetters, padDecimalZeros, padZerosLeft, parallelLimit, prefixWithAOrAn, roundToNumDecimals, showFatalError, startMinWait, stringsToHumanReadableList, stubServerEndpoint, sum, validateEmail, validatePhoneNumber, validateString, visitServerEndpoint, waitMs };
|
|
43344
43368
|
//# sourceMappingURL=index.js.map
|