@onivoro/isomorphic-common 22.0.5 → 24.0.0
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/README.md +393 -0
- package/dist/libs/isomorphic/axios/libs/isomorphic/axios/README.md +314 -0
- package/dist/libs/isomorphic/axios/libs/isomorphic/axios/package.json +10 -0
- package/dist/libs/isomorphic/common/libs/isomorphic/common/README.md +393 -0
- package/dist/libs/isomorphic/common/libs/isomorphic/common/package.json +10 -0
- package/dist/libs/server/common/libs/server/common/README.md +322 -0
- package/dist/libs/server/common/libs/server/common/package.json +12 -0
- package/jest.config.ts +11 -0
- package/package.json +8 -39
- package/project.json +23 -0
- package/{dist/cjs/index.d.ts → src/index.ts} +42 -5
- package/src/lib/constants/api-id-header.constant.ts +1 -0
- package/src/lib/constants/api-key-header.constant.ts +1 -0
- package/src/lib/constants/auth-cookie-name.constant.ts +2 -0
- package/src/lib/constants/millis-per-day.constant.ts +3 -0
- package/src/lib/constants/millis-per-hour.constant.ts +3 -0
- package/src/lib/constants/millis-per-minute.constant.ts +1 -0
- package/src/lib/constants/regexes.constant.ts +30 -0
- package/src/lib/functions/__snapshots__/chunk.function.spec.ts.snap +94 -0
- package/src/lib/functions/__snapshots__/split-date-range-into-days.function.spec.ts.snap +50 -0
- package/src/lib/functions/add-offset.function.spec.ts +12 -0
- package/src/lib/functions/add-offset.function.ts +14 -0
- package/src/lib/functions/arrange-act-assert.function.ts +23 -0
- package/src/lib/functions/camel-case.function.ts +30 -0
- package/src/lib/functions/chunk.function.spec.ts +20 -0
- package/src/lib/functions/chunk.function.ts +25 -0
- package/src/lib/functions/convert-object-to-literal.function.spec.ts +16 -0
- package/src/lib/functions/convert-object-to-literal.function.ts +10 -0
- package/src/lib/functions/format-usd.function.ts +4 -0
- package/src/lib/functions/from-boolean-string.function.ts +3 -0
- package/src/lib/functions/from-calendar-date.function.spec.ts +11 -0
- package/src/lib/functions/from-calendar-date.function.ts +5 -0
- package/src/lib/functions/from-csv-string.function.ts +3 -0
- package/src/lib/functions/get-date-last-month.function.ts +6 -0
- package/src/lib/functions/get-date-range-for-month.function copy.ts +8 -0
- package/src/lib/functions/get-date-range-for-month.function.ts +8 -0
- package/src/lib/functions/get-tag.function.ts +10 -0
- package/src/lib/functions/get-user-full-name.function.ts +5 -0
- package/src/lib/functions/is-symbol.function.ts +11 -0
- package/src/lib/functions/is-valid-date.function.ts +5 -0
- package/src/lib/functions/kebab-case.function.ts +5 -0
- package/src/lib/functions/map-entities-to-options.function.ts +11 -0
- package/src/lib/functions/map-enum-to-array-of-values.function copy.ts +3 -0
- package/src/lib/functions/map-enum-to-array-of-values.function.ts +3 -0
- package/src/lib/functions/map-enum-to-lookup-array.function.ts +6 -0
- package/src/lib/functions/map-enum-to-options.function copy.ts +7 -0
- package/src/lib/functions/map-enum-to-options.function.ts +7 -0
- package/src/lib/functions/mock-calls.function.ts +4 -0
- package/src/lib/functions/money.function.spec.ts +10 -0
- package/src/lib/functions/money.function.ts +22 -0
- package/src/lib/functions/parse-bool.function.ts +3 -0
- package/src/lib/functions/properties-to-array.function.ts +21 -0
- package/src/lib/functions/remove-alpha-chars.function.spec.ts +11 -0
- package/src/lib/functions/remove-alpha-chars.function.ts +9 -0
- package/src/lib/functions/remove-element-at-index.function copy.ts +9 -0
- package/src/lib/functions/remove-element-at-index.function.ts +9 -0
- package/src/lib/functions/round.function copy.ts +4 -0
- package/src/lib/functions/round.function.ts +4 -0
- package/src/lib/functions/sanitize-filename.function.ts +9 -0
- package/src/lib/functions/sleep.function.ts +3 -0
- package/{dist/esm/lib/functions/snake-case.function.js → src/lib/functions/snake-case.function.ts} +9 -6
- package/src/lib/functions/sort-by-created-at.function.ts +7 -0
- package/src/lib/functions/sort-by-full-name.function.ts +6 -0
- package/src/lib/functions/sort-by-id.function.ts +3 -0
- package/src/lib/functions/sort-by-name.function.ts +3 -0
- package/src/lib/functions/sort-numbers.function.ts +3 -0
- package/src/lib/functions/split-date-range-into-days.function.spec.ts +17 -0
- package/src/lib/functions/split-date-range-into-days.function.ts +26 -0
- package/src/lib/functions/subtract-offset.function.spec.ts +12 -0
- package/src/lib/functions/subtract-offset.function.ts +14 -0
- package/src/lib/functions/to-boolean-string.function.ts +3 -0
- package/src/lib/functions/to-calendar-date.function.ts +11 -0
- package/src/lib/functions/to-csv-string.function.ts +3 -0
- package/{dist/cjs/lib/functions/to-decimal-base.function.js → src/lib/functions/to-decimal-base.function.ts} +9 -7
- package/src/lib/functions/to-dollars-and-cents.function.spec.ts +7 -0
- package/src/lib/functions/to-dollars-and-cents.function.ts +17 -0
- package/{dist/cjs/lib/functions/to-string.function.js → src/lib/functions/to-string.function.ts} +6 -6
- package/src/lib/functions/to-unique-array.function.spec.ts +45 -0
- package/src/lib/functions/to-unique-array.function.ts +3 -0
- package/src/lib/functions/to-words.function.spec.ts +7 -0
- package/{dist/cjs/lib/functions/to-words.function.js → src/lib/functions/to-words.function.ts} +43 -26
- package/src/lib/functions/try-json-parse.spec.ts +37 -0
- package/src/lib/functions/try-json-parse.ts +11 -0
- package/src/lib/functions/try-json-stringify.spec.ts +44 -0
- package/src/lib/functions/try-json-stringify.ts +11 -0
- package/src/lib/functions/try-parse-date.function.spec.ts +12 -0
- package/src/lib/functions/try-parse-date.function.ts +17 -0
- package/src/lib/functions/unicode-words.const.ts +70 -0
- package/src/lib/functions/upper-first.function.spec.ts +16 -0
- package/src/lib/functions/upper-first.function.ts +10 -0
- package/src/lib/functions/use-date.function.ts +21 -0
- package/src/lib/functions/words.function.ts +38 -0
- package/src/lib/types/access-token.interface.ts +8 -0
- package/{dist/esm/lib/interfaces/axios-wrapped-nest-exception.interface.d.ts → src/lib/types/axios-wrapped-nest-exception.interface.ts} +1 -1
- package/src/lib/types/company.type.ts +18 -0
- package/src/lib/types/createable.type.ts +1 -0
- package/{dist/cjs/lib/interfaces/entity-provider.interface.d.ts → src/lib/types/entity-provider.interface.ts} +1 -1
- package/src/lib/types/keys-of.type copy.ts +1 -0
- package/src/lib/types/keys-of.type.ts +1 -0
- package/{dist/types/lib/interfaces/lookup.interface.d.ts → src/lib/types/lookup.interface copy.ts } +2 -2
- package/{dist/cjs/lib/interfaces/lookup.interface.d.ts → src/lib/types/lookup.interface.ts} +2 -2
- package/src/lib/types/nameable.type.ts +4 -0
- package/tsconfig.json +13 -0
- package/tsconfig.lib.json +8 -0
- package/tsconfig.spec.json +14 -0
- package/dist/cjs/index.js +0 -59
- package/dist/cjs/lib/constants/decimal-regex.constant.d.ts +0 -1
- package/dist/cjs/lib/constants/decimal-regex.constant.js +0 -4
- package/dist/cjs/lib/constants/millis-per-day.constant.d.ts +0 -1
- package/dist/cjs/lib/constants/millis-per-day.constant.js +0 -5
- package/dist/cjs/lib/constants/millis-per-hour.constant.d.ts +0 -1
- package/dist/cjs/lib/constants/millis-per-hour.constant.js +0 -5
- package/dist/cjs/lib/constants/millis-per-minute.constant.d.ts +0 -1
- package/dist/cjs/lib/constants/millis-per-minute.constant.js +0 -4
- package/dist/cjs/lib/functions/add-offset.function.d.ts +0 -1
- package/dist/cjs/lib/functions/add-offset.function.js +0 -13
- package/dist/cjs/lib/functions/camel-case.function.d.ts +0 -20
- package/dist/cjs/lib/functions/camel-case.function.js +0 -31
- package/dist/cjs/lib/functions/convert-object-to-literal.function.d.ts +0 -1
- package/dist/cjs/lib/functions/convert-object-to-literal.function.js +0 -9
- package/dist/cjs/lib/functions/format-usd.function.d.ts +0 -1
- package/dist/cjs/lib/functions/format-usd.function.js +0 -7
- package/dist/cjs/lib/functions/from-boolean-string.function.d.ts +0 -1
- package/dist/cjs/lib/functions/from-boolean-string.function.js +0 -6
- package/dist/cjs/lib/functions/from-calendar-date.function.d.ts +0 -1
- package/dist/cjs/lib/functions/from-calendar-date.function.js +0 -7
- package/dist/cjs/lib/functions/from-csv-string.function.d.ts +0 -1
- package/dist/cjs/lib/functions/from-csv-string.function.js +0 -6
- package/dist/cjs/lib/functions/get-date-range-for-month.function.d.ts +0 -4
- package/dist/cjs/lib/functions/get-date-range-for-month.function.js +0 -9
- package/dist/cjs/lib/functions/get-tag.function.d.ts +0 -1
- package/dist/cjs/lib/functions/get-tag.function.js +0 -11
- package/dist/cjs/lib/functions/is-symbol.function.d.ts +0 -1
- package/dist/cjs/lib/functions/is-symbol.function.js +0 -10
- package/dist/cjs/lib/functions/is-valid-date.function.d.ts +0 -1
- package/dist/cjs/lib/functions/is-valid-date.function.js +0 -7
- package/dist/cjs/lib/functions/kebab-case.function.d.ts +0 -1
- package/dist/cjs/lib/functions/kebab-case.function.js +0 -7
- package/dist/cjs/lib/functions/map-enum-to-array-of-values.function.d.ts +0 -1
- package/dist/cjs/lib/functions/map-enum-to-array-of-values.function.js +0 -6
- package/dist/cjs/lib/functions/map-enum-to-lookup-array.function.d.ts +0 -2
- package/dist/cjs/lib/functions/map-enum-to-lookup-array.function.js +0 -7
- package/dist/cjs/lib/functions/map-enum-to-options.function.d.ts +0 -4
- package/dist/cjs/lib/functions/map-enum-to-options.function.js +0 -9
- package/dist/cjs/lib/functions/money.function.d.ts +0 -1
- package/dist/cjs/lib/functions/money.function.js +0 -19
- package/dist/cjs/lib/functions/parse-bool.function.d.ts +0 -1
- package/dist/cjs/lib/functions/parse-bool.function.js +0 -6
- package/dist/cjs/lib/functions/properties-to-array.function.d.ts +0 -1
- package/dist/cjs/lib/functions/properties-to-array.function.js +0 -18
- package/dist/cjs/lib/functions/remove-alpha-chars.function.d.ts +0 -1
- package/dist/cjs/lib/functions/remove-alpha-chars.function.js +0 -10
- package/dist/cjs/lib/functions/remove-element-at-index.function.d.ts +0 -1
- package/dist/cjs/lib/functions/remove-element-at-index.function.js +0 -12
- package/dist/cjs/lib/functions/round.function.d.ts +0 -1
- package/dist/cjs/lib/functions/round.function.js +0 -7
- package/dist/cjs/lib/functions/sanitize-filename.function.d.ts +0 -1
- package/dist/cjs/lib/functions/sanitize-filename.function.js +0 -10
- package/dist/cjs/lib/functions/sleep.function.d.ts +0 -1
- package/dist/cjs/lib/functions/sleep.function.js +0 -6
- package/dist/cjs/lib/functions/snake-case.function.d.ts +0 -24
- package/dist/cjs/lib/functions/snake-case.function.js +0 -31
- package/dist/cjs/lib/functions/subtract-offset.function.d.ts +0 -1
- package/dist/cjs/lib/functions/subtract-offset.function.js +0 -13
- package/dist/cjs/lib/functions/to-boolean-string.function.d.ts +0 -1
- package/dist/cjs/lib/functions/to-boolean-string.function.js +0 -6
- package/dist/cjs/lib/functions/to-calendar-date.function.d.ts +0 -1
- package/dist/cjs/lib/functions/to-calendar-date.function.js +0 -11
- package/dist/cjs/lib/functions/to-csv-string.function.d.ts +0 -1
- package/dist/cjs/lib/functions/to-csv-string.function.js +0 -6
- package/dist/cjs/lib/functions/to-decimal-base.function.d.ts +0 -1
- package/dist/cjs/lib/functions/to-dollars-and-cents.function.d.ts +0 -1
- package/dist/cjs/lib/functions/to-dollars-and-cents.function.js +0 -16
- package/dist/cjs/lib/functions/to-string.function.d.ts +0 -1
- package/dist/cjs/lib/functions/to-unique-array.function.d.ts +0 -1
- package/dist/cjs/lib/functions/to-unique-array.function.js +0 -6
- package/dist/cjs/lib/functions/to-words.function.d.ts +0 -1
- package/dist/cjs/lib/functions/try-json-parse.d.ts +0 -1
- package/dist/cjs/lib/functions/try-json-parse.js +0 -14
- package/dist/cjs/lib/functions/try-json-stringify.d.ts +0 -1
- package/dist/cjs/lib/functions/try-json-stringify.js +0 -14
- package/dist/cjs/lib/functions/try-parse-date.function.d.ts +0 -1
- package/dist/cjs/lib/functions/try-parse-date.function.js +0 -16
- package/dist/cjs/lib/functions/unicode-words.const.d.ts +0 -8
- package/dist/cjs/lib/functions/unicode-words.const.js +0 -68
- package/dist/cjs/lib/functions/upper-first.function.d.ts +0 -1
- package/dist/cjs/lib/functions/upper-first.function.js +0 -12
- package/dist/cjs/lib/functions/words.function.d.ts +0 -17
- package/dist/cjs/lib/functions/words.function.js +0 -34
- package/dist/cjs/lib/interfaces/axios-wrapped-nest-exception.interface.d.ts +0 -5
- package/dist/cjs/lib/interfaces/axios-wrapped-nest-exception.interface.js +0 -2
- package/dist/cjs/lib/interfaces/entity-provider.interface.js +0 -2
- package/dist/cjs/lib/interfaces/keys-of.type.d.ts +0 -3
- package/dist/cjs/lib/interfaces/keys-of.type.js +0 -2
- package/dist/cjs/lib/interfaces/lookup.interface.js +0 -2
- package/dist/esm/index.d.ts +0 -43
- package/dist/esm/index.js +0 -59
- package/dist/esm/lib/constants/decimal-regex.constant.d.ts +0 -1
- package/dist/esm/lib/constants/decimal-regex.constant.js +0 -4
- package/dist/esm/lib/constants/millis-per-day.constant.d.ts +0 -1
- package/dist/esm/lib/constants/millis-per-day.constant.js +0 -5
- package/dist/esm/lib/constants/millis-per-hour.constant.d.ts +0 -1
- package/dist/esm/lib/constants/millis-per-hour.constant.js +0 -5
- package/dist/esm/lib/constants/millis-per-minute.constant.d.ts +0 -1
- package/dist/esm/lib/constants/millis-per-minute.constant.js +0 -4
- package/dist/esm/lib/functions/add-offset.function.d.ts +0 -1
- package/dist/esm/lib/functions/add-offset.function.js +0 -13
- package/dist/esm/lib/functions/camel-case.function.d.ts +0 -20
- package/dist/esm/lib/functions/camel-case.function.js +0 -31
- package/dist/esm/lib/functions/convert-object-to-literal.function.d.ts +0 -1
- package/dist/esm/lib/functions/convert-object-to-literal.function.js +0 -9
- package/dist/esm/lib/functions/format-usd.function.d.ts +0 -1
- package/dist/esm/lib/functions/format-usd.function.js +0 -7
- package/dist/esm/lib/functions/from-boolean-string.function.d.ts +0 -1
- package/dist/esm/lib/functions/from-boolean-string.function.js +0 -6
- package/dist/esm/lib/functions/from-calendar-date.function.d.ts +0 -1
- package/dist/esm/lib/functions/from-calendar-date.function.js +0 -7
- package/dist/esm/lib/functions/from-csv-string.function.d.ts +0 -1
- package/dist/esm/lib/functions/from-csv-string.function.js +0 -6
- package/dist/esm/lib/functions/get-date-range-for-month.function.d.ts +0 -4
- package/dist/esm/lib/functions/get-date-range-for-month.function.js +0 -9
- package/dist/esm/lib/functions/get-tag.function.d.ts +0 -1
- package/dist/esm/lib/functions/get-tag.function.js +0 -11
- package/dist/esm/lib/functions/is-symbol.function.d.ts +0 -1
- package/dist/esm/lib/functions/is-symbol.function.js +0 -10
- package/dist/esm/lib/functions/is-valid-date.function.d.ts +0 -1
- package/dist/esm/lib/functions/is-valid-date.function.js +0 -7
- package/dist/esm/lib/functions/kebab-case.function.d.ts +0 -1
- package/dist/esm/lib/functions/kebab-case.function.js +0 -7
- package/dist/esm/lib/functions/map-enum-to-array-of-values.function.d.ts +0 -1
- package/dist/esm/lib/functions/map-enum-to-array-of-values.function.js +0 -6
- package/dist/esm/lib/functions/map-enum-to-lookup-array.function.d.ts +0 -2
- package/dist/esm/lib/functions/map-enum-to-lookup-array.function.js +0 -7
- package/dist/esm/lib/functions/map-enum-to-options.function.d.ts +0 -4
- package/dist/esm/lib/functions/map-enum-to-options.function.js +0 -9
- package/dist/esm/lib/functions/money.function.d.ts +0 -1
- package/dist/esm/lib/functions/money.function.js +0 -19
- package/dist/esm/lib/functions/parse-bool.function.d.ts +0 -1
- package/dist/esm/lib/functions/parse-bool.function.js +0 -6
- package/dist/esm/lib/functions/properties-to-array.function.d.ts +0 -1
- package/dist/esm/lib/functions/properties-to-array.function.js +0 -18
- package/dist/esm/lib/functions/remove-alpha-chars.function.d.ts +0 -1
- package/dist/esm/lib/functions/remove-alpha-chars.function.js +0 -10
- package/dist/esm/lib/functions/remove-element-at-index.function.d.ts +0 -1
- package/dist/esm/lib/functions/remove-element-at-index.function.js +0 -12
- package/dist/esm/lib/functions/round.function.d.ts +0 -1
- package/dist/esm/lib/functions/round.function.js +0 -7
- package/dist/esm/lib/functions/sanitize-filename.function.d.ts +0 -1
- package/dist/esm/lib/functions/sanitize-filename.function.js +0 -10
- package/dist/esm/lib/functions/sleep.function.d.ts +0 -1
- package/dist/esm/lib/functions/sleep.function.js +0 -6
- package/dist/esm/lib/functions/snake-case.function.d.ts +0 -24
- package/dist/esm/lib/functions/subtract-offset.function.d.ts +0 -1
- package/dist/esm/lib/functions/subtract-offset.function.js +0 -13
- package/dist/esm/lib/functions/to-boolean-string.function.d.ts +0 -1
- package/dist/esm/lib/functions/to-boolean-string.function.js +0 -6
- package/dist/esm/lib/functions/to-calendar-date.function.d.ts +0 -1
- package/dist/esm/lib/functions/to-calendar-date.function.js +0 -11
- package/dist/esm/lib/functions/to-csv-string.function.d.ts +0 -1
- package/dist/esm/lib/functions/to-csv-string.function.js +0 -6
- package/dist/esm/lib/functions/to-decimal-base.function.d.ts +0 -1
- package/dist/esm/lib/functions/to-decimal-base.function.js +0 -21
- package/dist/esm/lib/functions/to-dollars-and-cents.function.d.ts +0 -1
- package/dist/esm/lib/functions/to-dollars-and-cents.function.js +0 -16
- package/dist/esm/lib/functions/to-string.function.d.ts +0 -1
- package/dist/esm/lib/functions/to-string.function.js +0 -25
- package/dist/esm/lib/functions/to-unique-array.function.d.ts +0 -1
- package/dist/esm/lib/functions/to-unique-array.function.js +0 -6
- package/dist/esm/lib/functions/to-words.function.d.ts +0 -1
- package/dist/esm/lib/functions/to-words.function.js +0 -91
- package/dist/esm/lib/functions/try-json-parse.d.ts +0 -1
- package/dist/esm/lib/functions/try-json-parse.js +0 -14
- package/dist/esm/lib/functions/try-json-stringify.d.ts +0 -1
- package/dist/esm/lib/functions/try-json-stringify.js +0 -14
- package/dist/esm/lib/functions/try-parse-date.function.d.ts +0 -1
- package/dist/esm/lib/functions/try-parse-date.function.js +0 -16
- package/dist/esm/lib/functions/unicode-words.const.d.ts +0 -8
- package/dist/esm/lib/functions/unicode-words.const.js +0 -68
- package/dist/esm/lib/functions/upper-first.function.d.ts +0 -1
- package/dist/esm/lib/functions/upper-first.function.js +0 -12
- package/dist/esm/lib/functions/words.function.d.ts +0 -17
- package/dist/esm/lib/functions/words.function.js +0 -34
- package/dist/esm/lib/interfaces/axios-wrapped-nest-exception.interface.js +0 -2
- package/dist/esm/lib/interfaces/entity-provider.interface.d.ts +0 -9
- package/dist/esm/lib/interfaces/entity-provider.interface.js +0 -2
- package/dist/esm/lib/interfaces/keys-of.type.d.ts +0 -3
- package/dist/esm/lib/interfaces/keys-of.type.js +0 -2
- package/dist/esm/lib/interfaces/lookup.interface.d.ts +0 -4
- package/dist/esm/lib/interfaces/lookup.interface.js +0 -2
- package/dist/types/index.d.ts +0 -43
- package/dist/types/lib/constants/decimal-regex.constant.d.ts +0 -1
- package/dist/types/lib/constants/millis-per-day.constant.d.ts +0 -1
- package/dist/types/lib/constants/millis-per-hour.constant.d.ts +0 -1
- package/dist/types/lib/constants/millis-per-minute.constant.d.ts +0 -1
- package/dist/types/lib/functions/add-offset.function.d.ts +0 -1
- package/dist/types/lib/functions/camel-case.function.d.ts +0 -20
- package/dist/types/lib/functions/convert-object-to-literal.function.d.ts +0 -1
- package/dist/types/lib/functions/format-usd.function.d.ts +0 -1
- package/dist/types/lib/functions/from-boolean-string.function.d.ts +0 -1
- package/dist/types/lib/functions/from-calendar-date.function.d.ts +0 -1
- package/dist/types/lib/functions/from-csv-string.function.d.ts +0 -1
- package/dist/types/lib/functions/get-date-range-for-month.function.d.ts +0 -4
- package/dist/types/lib/functions/get-tag.function.d.ts +0 -1
- package/dist/types/lib/functions/is-symbol.function.d.ts +0 -1
- package/dist/types/lib/functions/is-valid-date.function.d.ts +0 -1
- package/dist/types/lib/functions/kebab-case.function.d.ts +0 -1
- package/dist/types/lib/functions/map-enum-to-array-of-values.function.d.ts +0 -1
- package/dist/types/lib/functions/map-enum-to-lookup-array.function.d.ts +0 -2
- package/dist/types/lib/functions/map-enum-to-options.function.d.ts +0 -4
- package/dist/types/lib/functions/money.function.d.ts +0 -1
- package/dist/types/lib/functions/parse-bool.function.d.ts +0 -1
- package/dist/types/lib/functions/properties-to-array.function.d.ts +0 -1
- package/dist/types/lib/functions/remove-alpha-chars.function.d.ts +0 -1
- package/dist/types/lib/functions/remove-element-at-index.function.d.ts +0 -1
- package/dist/types/lib/functions/round.function.d.ts +0 -1
- package/dist/types/lib/functions/sanitize-filename.function.d.ts +0 -1
- package/dist/types/lib/functions/sleep.function.d.ts +0 -1
- package/dist/types/lib/functions/snake-case.function.d.ts +0 -24
- package/dist/types/lib/functions/subtract-offset.function.d.ts +0 -1
- package/dist/types/lib/functions/to-boolean-string.function.d.ts +0 -1
- package/dist/types/lib/functions/to-calendar-date.function.d.ts +0 -1
- package/dist/types/lib/functions/to-csv-string.function.d.ts +0 -1
- package/dist/types/lib/functions/to-decimal-base.function.d.ts +0 -1
- package/dist/types/lib/functions/to-dollars-and-cents.function.d.ts +0 -1
- package/dist/types/lib/functions/to-string.function.d.ts +0 -1
- package/dist/types/lib/functions/to-unique-array.function.d.ts +0 -1
- package/dist/types/lib/functions/to-words.function.d.ts +0 -1
- package/dist/types/lib/functions/try-json-parse.d.ts +0 -1
- package/dist/types/lib/functions/try-json-stringify.d.ts +0 -1
- package/dist/types/lib/functions/try-parse-date.function.d.ts +0 -1
- package/dist/types/lib/functions/unicode-words.const.d.ts +0 -8
- package/dist/types/lib/functions/upper-first.function.d.ts +0 -1
- package/dist/types/lib/functions/words.function.d.ts +0 -17
- package/dist/types/lib/interfaces/axios-wrapped-nest-exception.interface.d.ts +0 -5
- package/dist/types/lib/interfaces/entity-provider.interface.d.ts +0 -9
- package/dist/types/lib/interfaces/keys-of.type.d.ts +0 -3
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { tryJsonStringify } from './try-json-stringify';
|
|
2
|
+
|
|
3
|
+
const arbitraryNumber: number = 337;
|
|
4
|
+
|
|
5
|
+
describe('tryJsonStringify', () => {
|
|
6
|
+
describe('GIVEN input is stringifiable', () => {
|
|
7
|
+
describe.each([
|
|
8
|
+
[0, '0'],
|
|
9
|
+
['0', '"0"'],
|
|
10
|
+
[arbitraryNumber, expect.stringMatching(/\d/)],
|
|
11
|
+
[arbitraryNumber.toString(), expect.stringMatching(/\d/)],
|
|
12
|
+
[false, 'false'],
|
|
13
|
+
['false', '"false"'],
|
|
14
|
+
[true, 'true'],
|
|
15
|
+
['true', '"true"'],
|
|
16
|
+
['', '""'],
|
|
17
|
+
[{ test: arbitraryNumber }, expect.stringMatching(new RegExp(`"test".*${arbitraryNumber}`))],
|
|
18
|
+
[{ test: arbitraryNumber.toString() }, expect.stringMatching(new RegExp(`"test".*"${arbitraryNumber}"`))],
|
|
19
|
+
['randommmm', expect.any(String)],
|
|
20
|
+
['so random', expect.any(String)],
|
|
21
|
+
])('WHEN input is: %j', (input, expectedOutput) => {
|
|
22
|
+
it(`returns ${expectedOutput}`, () => {
|
|
23
|
+
expect(tryJsonStringify(input as any)).toEqual(expectedOutput);
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
describe('GIVEN input is not stringifiable', () => {
|
|
29
|
+
let circularObject: any;
|
|
30
|
+
|
|
31
|
+
beforeEach(() => {
|
|
32
|
+
circularObject = { children: [] };
|
|
33
|
+
const circularObjectChild = { parent: circularObject };
|
|
34
|
+
circularObject.children.push(circularObjectChild);
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
describe('WHEN input is circular', () => {
|
|
38
|
+
it(`returns null`, () => {
|
|
39
|
+
expect(tryJsonStringify(circularObject)).toMatchSnapshot();
|
|
40
|
+
// expect(tryJsonStringify(circularObject)).toEqual(null);
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export function tryJsonStringify<T>(object: T | null | undefined, fmtr?: any, spaces?: number): string | null {
|
|
2
|
+
if (typeof object === 'undefined') {
|
|
3
|
+
return null;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
try {
|
|
7
|
+
return JSON.stringify(object, fmtr, spaces);
|
|
8
|
+
} catch (_e) {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { tryParseDate } from './try-parse-date.function';
|
|
2
|
+
|
|
3
|
+
describe('tryParseDate', () => {
|
|
4
|
+
describe('GIVEN input is partial or full ISO8601', () => {
|
|
5
|
+
it.each([
|
|
6
|
+
'2023-12-23',
|
|
7
|
+
'2023-12-23T00:00:00.000',
|
|
8
|
+
])('%j', (input) => {
|
|
9
|
+
expect(tryParseDate(input)).toMatchSnapshot();
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export function tryParseDate(input: string | Date | undefined | null): Date | undefined {
|
|
2
|
+
if (!input) {
|
|
3
|
+
return;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
if(input instanceof Date) {
|
|
7
|
+
return input;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const date = new Date(input);
|
|
11
|
+
|
|
12
|
+
if ((date as any) == 'Invalid Date') {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return date;
|
|
17
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
// source https://github.com/lodash/lodash/blob/master/.internal/unicodeWords.js
|
|
2
|
+
|
|
3
|
+
/** Used to compose unicode character classes. */
|
|
4
|
+
const rsAstralRange = '\\ud800-\\udfff'
|
|
5
|
+
const rsComboMarksRange = '\\u0300-\\u036f'
|
|
6
|
+
const reComboHalfMarksRange = '\\ufe20-\\ufe2f'
|
|
7
|
+
const rsComboSymbolsRange = '\\u20d0-\\u20ff'
|
|
8
|
+
const rsComboMarksExtendedRange = '\\u1ab0-\\u1aff'
|
|
9
|
+
const rsComboMarksSupplementRange = '\\u1dc0-\\u1dff'
|
|
10
|
+
const rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange + rsComboMarksExtendedRange + rsComboMarksSupplementRange
|
|
11
|
+
const rsDingbatRange = '\\u2700-\\u27bf'
|
|
12
|
+
const rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff'
|
|
13
|
+
const rsMathOpRange = '\\xac\\xb1\\xd7\\xf7'
|
|
14
|
+
const rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf'
|
|
15
|
+
const rsPunctuationRange = '\\u2000-\\u206f'
|
|
16
|
+
const rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000'
|
|
17
|
+
const rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde'
|
|
18
|
+
const rsVarRange = '\\ufe0e\\ufe0f'
|
|
19
|
+
const rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange
|
|
20
|
+
|
|
21
|
+
/** Used to compose unicode capture groups. */
|
|
22
|
+
const rsApos = "['\u2019]"
|
|
23
|
+
const rsBreak = `[${rsBreakRange}]`
|
|
24
|
+
const rsCombo = `[${rsComboRange}]`
|
|
25
|
+
const rsDigit = '\\d'
|
|
26
|
+
const rsDingbat = `[${rsDingbatRange}]`
|
|
27
|
+
const rsLower = `[${rsLowerRange}]`
|
|
28
|
+
const rsMisc = `[^${rsAstralRange}${rsBreakRange + rsDigit + rsDingbatRange + rsLowerRange + rsUpperRange}]`
|
|
29
|
+
const rsFitz = '\\ud83c[\\udffb-\\udfff]'
|
|
30
|
+
const rsModifier = `(?:${rsCombo}|${rsFitz})`
|
|
31
|
+
const rsNonAstral = `[^${rsAstralRange}]`
|
|
32
|
+
const rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}'
|
|
33
|
+
const rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]'
|
|
34
|
+
const rsUpper = `[${rsUpperRange}]`
|
|
35
|
+
const rsZWJ = '\\u200d'
|
|
36
|
+
|
|
37
|
+
/** Used to compose unicode regexes. */
|
|
38
|
+
const rsMiscLower = `(?:${rsLower}|${rsMisc})`
|
|
39
|
+
const rsMiscUpper = `(?:${rsUpper}|${rsMisc})`
|
|
40
|
+
const rsOptContrLower = `(?:${rsApos}(?:d|ll|m|re|s|t|ve))?`
|
|
41
|
+
const rsOptContrUpper = `(?:${rsApos}(?:D|LL|M|RE|S|T|VE))?`
|
|
42
|
+
const reOptMod = `${rsModifier}?`
|
|
43
|
+
const rsOptVar = `[${rsVarRange}]?`
|
|
44
|
+
const rsOptJoin = `(?:${rsZWJ}(?:${[rsNonAstral, rsRegional, rsSurrPair].join('|')})${rsOptVar + reOptMod})*`
|
|
45
|
+
const rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])'
|
|
46
|
+
const rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])'
|
|
47
|
+
const rsSeq = rsOptVar + reOptMod + rsOptJoin
|
|
48
|
+
const rsEmoji = `(?:${[rsDingbat, rsRegional, rsSurrPair].join('|')})${rsSeq}`
|
|
49
|
+
|
|
50
|
+
const reUnicodeWords = RegExp([
|
|
51
|
+
`${rsUpper}?${rsLower}+${rsOptContrLower}(?=${[rsBreak, rsUpper, '$'].join('|')})`,
|
|
52
|
+
`${rsMiscUpper}+${rsOptContrUpper}(?=${[rsBreak, rsUpper + rsMiscLower, '$'].join('|')})`,
|
|
53
|
+
`${rsUpper}?${rsMiscLower}+${rsOptContrLower}`,
|
|
54
|
+
`${rsUpper}+${rsOptContrUpper}`,
|
|
55
|
+
rsOrdUpper,
|
|
56
|
+
rsOrdLower,
|
|
57
|
+
`${rsDigit}+`,
|
|
58
|
+
rsEmoji
|
|
59
|
+
].join('|'), 'g')
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Splits a Unicode `string` into an array of its words.
|
|
63
|
+
*
|
|
64
|
+
* @private
|
|
65
|
+
* @param {string} The string to inspect.
|
|
66
|
+
* @returns {Array} Returns the words of `string`.
|
|
67
|
+
*/
|
|
68
|
+
export function unicodeWords(string: string) {
|
|
69
|
+
return string.match(reUnicodeWords)
|
|
70
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { upperFirst } from './upper-first.function';
|
|
2
|
+
|
|
3
|
+
describe('upperFirst', () => {
|
|
4
|
+
it.each([
|
|
5
|
+
'asdf',
|
|
6
|
+
'XCVB'
|
|
7
|
+
])('GIVEN %j, does what u expect', (input) => {
|
|
8
|
+
expect(upperFirst(input)).toMatchSnapshot();
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
it.each([
|
|
12
|
+
null, undefined, 0, false
|
|
13
|
+
])('GIVEN falsey input %j, does what u expect', (input) => {
|
|
14
|
+
expect(upperFirst(input)).toMatchSnapshot();
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/* eslint no-global-assign:0 */
|
|
2
|
+
export async function useDate(date: string, fn: () => Promise<void>) {
|
|
3
|
+
const mockedDate = new Date(date);
|
|
4
|
+
|
|
5
|
+
const OriginalDate = Date;
|
|
6
|
+
|
|
7
|
+
Date = class extends OriginalDate {
|
|
8
|
+
constructor(...args: any[]) {
|
|
9
|
+
super(
|
|
10
|
+
(args.length === 0) ? mockedDate : new (OriginalDate as any)(...args)
|
|
11
|
+
);
|
|
12
|
+
}
|
|
13
|
+
static override now() {
|
|
14
|
+
return mockedDate.getTime();
|
|
15
|
+
}
|
|
16
|
+
} as any;
|
|
17
|
+
|
|
18
|
+
await fn();
|
|
19
|
+
|
|
20
|
+
Date = OriginalDate;
|
|
21
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// source https://github.com/lodash/lodash/blob/master/words.js
|
|
2
|
+
|
|
3
|
+
import { unicodeWords } from './unicode-words.const';
|
|
4
|
+
|
|
5
|
+
const hasUnicodeWord = RegExp.prototype.test.bind(
|
|
6
|
+
/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/
|
|
7
|
+
)
|
|
8
|
+
|
|
9
|
+
/** Used to match words composed of alphanumeric characters. */
|
|
10
|
+
const reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g
|
|
11
|
+
|
|
12
|
+
function asciiWords(string: string) {
|
|
13
|
+
return string.match(reAsciiWord)
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Splits `string` into an array of its words.
|
|
18
|
+
*
|
|
19
|
+
* @since 3.0.0
|
|
20
|
+
* @category String
|
|
21
|
+
* @param {string} [string=''] The string to inspect.
|
|
22
|
+
* @param {RegExp|string} [pattern] The pattern to match words.
|
|
23
|
+
* @returns {Array} Returns the words of `string`.
|
|
24
|
+
* @example
|
|
25
|
+
*
|
|
26
|
+
* words('fred, barney, & pebbles')
|
|
27
|
+
* // => ['fred', 'barney', 'pebbles']
|
|
28
|
+
*
|
|
29
|
+
* words('fred, barney, & pebbles', /[^, ]+/g)
|
|
30
|
+
* // => ['fred', 'barney', '&', 'pebbles']
|
|
31
|
+
*/
|
|
32
|
+
export function words(string: string, pattern?: RegExp) {
|
|
33
|
+
if (pattern === undefined) {
|
|
34
|
+
const result = hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string)
|
|
35
|
+
return result || []
|
|
36
|
+
}
|
|
37
|
+
return string.match(pattern) || []
|
|
38
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type TCompany = {
|
|
2
|
+
id: string;
|
|
3
|
+
statusId: string;
|
|
4
|
+
renewalDate: string;
|
|
5
|
+
name: string;
|
|
6
|
+
ein: string;
|
|
7
|
+
duns: string;
|
|
8
|
+
address1: string;
|
|
9
|
+
address2: string;
|
|
10
|
+
city: string;
|
|
11
|
+
state: string;
|
|
12
|
+
zip: string;
|
|
13
|
+
phone: string;
|
|
14
|
+
externalId: string;
|
|
15
|
+
bmiThresholdWithComorbidities: number;
|
|
16
|
+
bmiThresholdWithoutComorbidities: number;
|
|
17
|
+
membershipType: string;
|
|
18
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type TCreateable = { createdAt: Date | string };
|
|
@@ -6,4 +6,4 @@ export interface IEntityProvider<TEntity, TFindOneOptions, TFindManyOptions, TFi
|
|
|
6
6
|
delete: (options: TFindOptionsWhere) => Promise<void>;
|
|
7
7
|
put: (options: TFindOptionsWhere, body: TQueryDeepPartialEntity) => Promise<void>;
|
|
8
8
|
patch: (options: TFindOptionsWhere, body: TQueryDeepPartialEntity) => Promise<void>;
|
|
9
|
-
}
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type TKeysOf<TKeySource, TValue> = { [key in keyof TKeySource]: TValue };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type TKeysOf<TKeySource, TValue> = { [key in keyof TKeySource]: TValue };
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "./tsconfig.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"outDir": "../../../dist/out-tsc",
|
|
5
|
+
"module": "commonjs",
|
|
6
|
+
"types": ["jest", "node"]
|
|
7
|
+
},
|
|
8
|
+
"include": [
|
|
9
|
+
"jest.config.ts",
|
|
10
|
+
"src/**/*.test.ts",
|
|
11
|
+
"src/**/*.spec.ts",
|
|
12
|
+
"src/**/*.d.ts"
|
|
13
|
+
]
|
|
14
|
+
}
|
package/dist/cjs/index.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./lib/constants/decimal-regex.constant"), exports);
|
|
18
|
-
__exportStar(require("./lib/constants/millis-per-day.constant"), exports);
|
|
19
|
-
__exportStar(require("./lib/constants/millis-per-hour.constant"), exports);
|
|
20
|
-
__exportStar(require("./lib/constants/millis-per-minute.constant"), exports);
|
|
21
|
-
__exportStar(require("./lib/functions/add-offset.function"), exports);
|
|
22
|
-
__exportStar(require("./lib/functions/camel-case.function"), exports);
|
|
23
|
-
__exportStar(require("./lib/functions/convert-object-to-literal.function"), exports);
|
|
24
|
-
__exportStar(require("./lib/functions/format-usd.function"), exports);
|
|
25
|
-
__exportStar(require("./lib/functions/from-boolean-string.function"), exports);
|
|
26
|
-
__exportStar(require("./lib/functions/from-calendar-date.function"), exports);
|
|
27
|
-
__exportStar(require("./lib/functions/from-csv-string.function"), exports);
|
|
28
|
-
__exportStar(require("./lib/functions/get-date-range-for-month.function"), exports);
|
|
29
|
-
__exportStar(require("./lib/functions/is-symbol.function"), exports);
|
|
30
|
-
__exportStar(require("./lib/functions/is-valid-date.function"), exports);
|
|
31
|
-
__exportStar(require("./lib/functions/kebab-case.function"), exports);
|
|
32
|
-
__exportStar(require("./lib/functions/map-enum-to-array-of-values.function"), exports);
|
|
33
|
-
__exportStar(require("./lib/functions/map-enum-to-lookup-array.function"), exports);
|
|
34
|
-
__exportStar(require("./lib/functions/map-enum-to-options.function"), exports);
|
|
35
|
-
__exportStar(require("./lib/functions/money.function"), exports);
|
|
36
|
-
__exportStar(require("./lib/functions/parse-bool.function"), exports);
|
|
37
|
-
__exportStar(require("./lib/functions/properties-to-array.function"), exports);
|
|
38
|
-
__exportStar(require("./lib/functions/remove-alpha-chars.function"), exports);
|
|
39
|
-
__exportStar(require("./lib/functions/remove-element-at-index.function"), exports);
|
|
40
|
-
__exportStar(require("./lib/functions/round.function"), exports);
|
|
41
|
-
__exportStar(require("./lib/functions/sleep.function"), exports);
|
|
42
|
-
__exportStar(require("./lib/functions/sanitize-filename.function"), exports);
|
|
43
|
-
__exportStar(require("./lib/functions/snake-case.function"), exports);
|
|
44
|
-
__exportStar(require("./lib/functions/subtract-offset.function"), exports);
|
|
45
|
-
__exportStar(require("./lib/functions/to-boolean-string.function"), exports);
|
|
46
|
-
__exportStar(require("./lib/functions/to-calendar-date.function"), exports);
|
|
47
|
-
__exportStar(require("./lib/functions/to-csv-string.function"), exports);
|
|
48
|
-
__exportStar(require("./lib/functions/to-decimal-base.function"), exports);
|
|
49
|
-
__exportStar(require("./lib/functions/to-dollars-and-cents.function"), exports);
|
|
50
|
-
__exportStar(require("./lib/functions/to-unique-array.function"), exports);
|
|
51
|
-
__exportStar(require("./lib/functions/to-words.function"), exports);
|
|
52
|
-
__exportStar(require("./lib/functions/try-parse-date.function"), exports);
|
|
53
|
-
__exportStar(require("./lib/functions/unicode-words.const"), exports);
|
|
54
|
-
__exportStar(require("./lib/functions/upper-first.function"), exports);
|
|
55
|
-
__exportStar(require("./lib/functions/words.function"), exports);
|
|
56
|
-
__exportStar(require("./lib/interfaces/axios-wrapped-nest-exception.interface"), exports);
|
|
57
|
-
__exportStar(require("./lib/interfaces/entity-provider.interface"), exports);
|
|
58
|
-
__exportStar(require("./lib/interfaces/keys-of.type"), exports);
|
|
59
|
-
__exportStar(require("./lib/interfaces/lookup.interface"), exports);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const decimalRegex: RegExp;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const MILLIS_PER_DAY: number;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const MILLIS_PER_HOUR: number;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MILLIS_PER_HOUR = void 0;
|
|
4
|
-
const millis_per_minute_constant_1 = require("./millis-per-minute.constant");
|
|
5
|
-
exports.MILLIS_PER_HOUR = millis_per_minute_constant_1.MILLIS_PER_MINUTE * 60;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const MILLIS_PER_MINUTE: number;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function addOffset(input: string | Date | undefined | null): Date | undefined;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.addOffset = addOffset;
|
|
4
|
-
const millis_per_minute_constant_1 = require("../constants/millis-per-minute.constant");
|
|
5
|
-
const try_parse_date_function_1 = require("./try-parse-date.function");
|
|
6
|
-
function addOffset(input) {
|
|
7
|
-
const parsed = (0, try_parse_date_function_1.tryParseDate)(input);
|
|
8
|
-
if (!parsed) {
|
|
9
|
-
return;
|
|
10
|
-
}
|
|
11
|
-
const offset = (parsed).getTimezoneOffset();
|
|
12
|
-
return new Date(parsed.valueOf() + offset * millis_per_minute_constant_1.MILLIS_PER_MINUTE);
|
|
13
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
|
|
3
|
-
*
|
|
4
|
-
* @since 3.0.0
|
|
5
|
-
* @category String
|
|
6
|
-
* @param {string} [string=''] The string to convert.
|
|
7
|
-
* @returns {string} Returns the camel cased string.
|
|
8
|
-
* @see lowerCase, kebabCase, snakeCase, startCase, upperCase, upperFirst
|
|
9
|
-
* @example
|
|
10
|
-
*
|
|
11
|
-
* camelCase('Foo Bar')
|
|
12
|
-
* // => 'fooBar'
|
|
13
|
-
*
|
|
14
|
-
* camelCase('--foo-bar--')
|
|
15
|
-
* // => 'fooBar'
|
|
16
|
-
*
|
|
17
|
-
* camelCase('__FOO_BAR__')
|
|
18
|
-
* // => 'fooBar'
|
|
19
|
-
*/
|
|
20
|
-
export declare const camelCase: (string: string) => string;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// https://github.com/lodash/lodash/blob/main/src/camelCase.ts
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.camelCase = void 0;
|
|
5
|
-
const to_string_function_1 = require("./to-string.function");
|
|
6
|
-
const upper_first_function_1 = require("./upper-first.function");
|
|
7
|
-
const words_function_1 = require("./words.function");
|
|
8
|
-
/**
|
|
9
|
-
* Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
|
|
10
|
-
*
|
|
11
|
-
* @since 3.0.0
|
|
12
|
-
* @category String
|
|
13
|
-
* @param {string} [string=''] The string to convert.
|
|
14
|
-
* @returns {string} Returns the camel cased string.
|
|
15
|
-
* @see lowerCase, kebabCase, snakeCase, startCase, upperCase, upperFirst
|
|
16
|
-
* @example
|
|
17
|
-
*
|
|
18
|
-
* camelCase('Foo Bar')
|
|
19
|
-
* // => 'fooBar'
|
|
20
|
-
*
|
|
21
|
-
* camelCase('--foo-bar--')
|
|
22
|
-
* // => 'fooBar'
|
|
23
|
-
*
|
|
24
|
-
* camelCase('__FOO_BAR__')
|
|
25
|
-
* // => 'fooBar'
|
|
26
|
-
*/
|
|
27
|
-
const camelCase = (string) => (0, words_function_1.words)((0, to_string_function_1.toString)(string).replace(/['\u2019]/g, '')).reduce((result, word, index) => {
|
|
28
|
-
word = word.toLowerCase();
|
|
29
|
-
return result + (index ? (0, upper_first_function_1.upperFirst)(word) : word);
|
|
30
|
-
}, '');
|
|
31
|
-
exports.camelCase = camelCase;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function convertObjectToLiteral(literalFn: (k: string, v: any) => string, delimiter: string, keyValuePairs: Record<string, any>): string;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.convertObjectToLiteral = convertObjectToLiteral;
|
|
4
|
-
function convertObjectToLiteral(literalFn, delimiter, keyValuePairs) {
|
|
5
|
-
return Object.entries(keyValuePairs)
|
|
6
|
-
.filter(([, v]) => !!v || v === 0 || v === false)
|
|
7
|
-
.map(([k, v]) => literalFn(k, v?.toString?.()))
|
|
8
|
-
.join(delimiter);
|
|
9
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function formatUsd(rawAmount?: number | string): string;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.formatUsd = formatUsd;
|
|
4
|
-
function formatUsd(rawAmount) {
|
|
5
|
-
const amount = Number(rawAmount) || 0;
|
|
6
|
-
return new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD' }).format(amount);
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function fromBooleanString(value?: string): value is "true";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function fromCalendarDate(input: string | Date | undefined | null): Date | null;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fromCalendarDate = fromCalendarDate;
|
|
4
|
-
const add_offset_function_1 = require("./add-offset.function");
|
|
5
|
-
function fromCalendarDate(input) {
|
|
6
|
-
return (0, add_offset_function_1.addOffset)(input) || null;
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function fromCsvString(value?: string): string[];
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getDateRangeForMonth = getDateRangeForMonth;
|
|
4
|
-
const millis_per_day_constant_1 = require("../constants/millis-per-day.constant");
|
|
5
|
-
function getDateRangeForMonth(year, month) {
|
|
6
|
-
const startDate = new Date(+Date.UTC(year, month + -1, 0) + millis_per_day_constant_1.MILLIS_PER_DAY);
|
|
7
|
-
const endDate = new Date(+Date.UTC(year, month + 0, 0) + millis_per_day_constant_1.MILLIS_PER_DAY);
|
|
8
|
-
return { startDate, endDate };
|
|
9
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function getTag(value: any): string;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// https://github.com/lodash/lodash/blob/main/src/.internal/getTag.ts
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.getTag = getTag;
|
|
5
|
-
const toString = Object.prototype.toString;
|
|
6
|
-
function getTag(value) {
|
|
7
|
-
if (value == null) {
|
|
8
|
-
return value === undefined ? '[object Undefined]' : '[object Null]';
|
|
9
|
-
}
|
|
10
|
-
return toString.call(value);
|
|
11
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function isSymbol(value: any): boolean;
|